:root {
  color-scheme: light;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #203640;
  --muted: #506673;
  --accent: #2d7489;
  --accent-hover: #225d70;
  --deep: #193b49;
  --brand-orange: #f57c04;
  --paper: #f2f6f7;
  --card: #ffffff;
  --line: #d4e1e5;
  --soft-blue: #e8f2f5;
  --warm: #fff0de;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a.button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 650; line-height: 1.08; letter-spacing: -.06em; }
h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.018em; }
p { line-height: 1.5; }
.masthead {
  border-top: 4px solid var(--brand-orange); border-bottom: 1px solid var(--line); background: var(--card); color: var(--deep);
}
.masthead-inner { max-width: 1420px; min-height: 79px; margin: 0 auto; padding: 12px clamp(18px, 4.7vw, 70px); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 17px; min-width: 0; }
.brand-logo { display: block; width: clamp(240px, 31vw, 398px); height: auto; max-width: 100%; }
.brand-section { padding-left: 17px; border-left: 1px solid var(--line); color: var(--muted); font-size: .88rem; font-weight: 650; }
.profile { display: flex; align-items: center; justify-content: flex-end; gap: 13px; font-size: .9rem; }
.profile > span { overflow-wrap: anywhere; }
.shell { max-width: 1420px; margin: 0 auto; padding: 0 clamp(18px, 4.7vw, 70px); }
.shell.signed-in { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: calc(100dvh - 84px); }
.navigation { padding: 42px 18px 20px 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.navigation button { text-align: left; border: 0; background: transparent; color: var(--muted); border-radius: 9px; font-weight: 600; padding: 11px 13px; font-size: .92rem; }
.navigation button:hover { background: #e6eff2; }
.navigation button[aria-current="page"] { color: var(--deep); background: #dbeaf0; box-shadow: inset 3px 0 var(--brand-orange); }
main { min-width: 0; }
.signed-in main { padding: 42px 0 58px clamp(20px, 4vw, 52px); }
.loading { padding-top: 42px; color: var(--muted); }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 28px; }
.intro p { margin-top: 8px; color: var(--muted); }
.intro .date { white-space: nowrap; font-size: .88rem; color: var(--muted); padding-bottom: 2px; }
.auth { max-width: 890px; margin: clamp(35px, 9vh, 100px) auto 55px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--card); box-shadow: 0 18px 65px #193b4910; }
.auth-aside { display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px; padding: clamp(26px, 4vw, 47px); background: var(--deep); gap: 15px; }
.auth-aside h1 { max-width: 12ch; color: white; }
.auth-aside p { max-width: 28ch; color: #cee7ef; }
.auth-body { align-self: center; padding: clamp(26px, 4vw, 47px); }
.auth-body h2 { font-size: 1.6rem; margin-bottom: 18px; }
.auth-body p { color: var(--muted); margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; min-width: 0; }
.panel { padding: 22px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.stack { display: grid; gap: 15px; }
.stack + .stack, .card + .card { margin-top: 20px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .87rem; min-width: 0; }
input, select, textarea { color: var(--ink); background: #fff; border: 1px solid #adbec5; border-radius: 8px; padding: 9px 11px; min-height: 42px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
.muted, small { color: var(--muted); }
small { line-height: 1.45; }
.button, .quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; min-height: 42px;
  padding: 8px 15px; font-weight: 650; font-size: .9rem; line-height: 1.2; text-align: center;
  border: 1px solid transparent; border-radius: 9px; text-decoration: none; white-space: nowrap;
}
.button { background: var(--accent); color: white; }
.button:hover { background: var(--accent-hover); }
.quiet { background: var(--card); color: var(--accent-hover); border-color: #b9cdd4; }
.quiet:hover { background: var(--soft-blue); }
.profile .quiet { min-height: 35px; }
.compact { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
.error { color: #802a21; background: #fff1ed; padding: 10px 12px; border-radius: 8px; font-size: .88rem; }
.success { color: var(--accent-hover); background: var(--soft-blue); padding: 10px 12px; border-radius: 8px; font-size: .88rem; }
.toolbar, .actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar { background: var(--card); padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
.toolbar label { flex: 0 1 210px; }
.toolbar .button { margin-left: auto; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { padding: 16px 18px 17px; }
.metric span, .metric strong, .metric small { display: block; overflow-wrap: anywhere; }
.metric span { font-weight: 650; font-size: .86rem; }
.metric strong { margin: 6px 0 3px; font-size: clamp(1.4rem, 2.9vw, 2.25rem); letter-spacing: -.055em; font-variant-numeric: tabular-nums; font-weight: 630; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e6edef; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
th { font-size: .8rem; color: var(--muted); background: #edf4f6; white-space: nowrap; }
tr:last-child td { border: 0; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 21px 22px; color: var(--muted); font-size: .9rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--soft-blue); color: var(--accent-hover); border-radius: 999px; padding: 4px 9px; white-space: nowrap; font-weight: 650; font-size: .76rem; }
.pill.warm { background: var(--warm); color: #783d10; }
.pill.neutral { background: #edf0f1; color: #50616a; }
.clock-panel { padding: clamp(23px, 4vw, 43px); background: #dcecf2; margin-bottom: 18px; }
.clock-panel h2 { margin: 13px 0 4px; color: var(--accent-hover); }
.timer { color: var(--deep); font-weight: 630; font-size: clamp(3rem, 8vw, 5.5rem); letter-spacing: -.07em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.clock-panel .actions { margin: 20px 0 10px; }
.clock-panel small { display: block; }
.account-list { display: grid; gap: 14px; }
.account-list .card { margin: 0; }
.account-fields, .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account-fields { margin-bottom: 14px; }
.settings { max-width: 590px; }
dialog { width: min(640px, calc(100% - 24px)); max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--card); box-shadow: 0 15px 60px #193b4950; }
dialog::backdrop { background: #18374688; }
.dialog-inner { padding: 22px; }
.dialog-inner h2 { margin-bottom: 13px; }
.dialog-inner .actions { margin-top: 6px; }
.pause-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; align-items: flex-end; margin-top: 8px; }
.history { padding: 0 0 0 19px; line-height: 1.5; }
.history li { margin-bottom: 10px; overflow-wrap: anywhere; }
.notice { position: fixed; bottom: 20px; right: 20px; max-width: calc(100% - 40px); z-index: 1; background: var(--deep); color: white; padding: 11px 16px; border-radius: 9px; box-shadow: 0 5px 20px #193b4933; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.leave-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 19px 0 12px; }
.leave-month-control { display: flex; align-items: center; gap: 6px; }
.leave-month-control .quiet { width: 42px; padding: 0; font-size: 1.45rem; }
.leave-month-control input { width: 180px; }
.leave-person-filter { flex: 0 1 200px; }
.leave-toolbar-actions { margin-left: auto; }
.leave-not-set { color: var(--muted); }
.leave-metrics .metric:last-child { background: var(--warm); border-color: #f4d4b0; }
.leave-calendar { overflow: hidden; }
.leave-scroll { overflow-x: auto; }
.leave-scroll:focus-visible { outline-offset: -3px; }
.leave-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 595px; }
.leave-weekday { padding: 10px 12px; text-align: center; font-size: .8rem; font-weight: 700; color: var(--accent-hover); background: #e8f2f5; }
.leave-day {
  appearance: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 6px 7px; min-width: 0; min-height: 75px; width: 100%; color: var(--ink); text-align: left;
  background: var(--card); border: 0; border-top: 1px solid var(--line); border-right: 1px solid var(--line);
}
.leave-day:nth-child(7n) { border-right: 0; }
.leave-day.weekend { background: #f5f8f9; }
.leave-day.empty-day { background: #f0f5f7; }
.leave-day.booked-day { background: #f7fbfc; }
button.leave-day:hover { background: var(--soft-blue); }
.leave-day:focus-visible { outline-offset: -3px; }
.leave-date { display: grid; place-items: center; width: 25px; height: 25px; font-size: .82rem; font-weight: 650; border-radius: 50%; }
.leave-day.today .leave-date { background: var(--warm); color: #713e12; box-shadow: inset 0 0 0 1px #eb9d56; }
.leave-person-0 { --leave-chip-bg: #fce8d3; --leave-chip-ink: #77380a; --leave-chip-dot: #d66900; }
.leave-person-1 { --leave-chip-bg: #eae8f8; --leave-chip-ink: #4d4276; --leave-chip-dot: #7968ad; }
.leave-person-2 { --leave-chip-bg: #daedf3; --leave-chip-ink: #1a5468; --leave-chip-dot: #2d7489; }
.leave-chip {
  display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--leave-chip-bg); color: var(--leave-chip-ink); font-weight: 650; font-size: .74rem;
  padding: 3px 6px; border-radius: 5px;
}
.leave-legend-dot { display: inline-block; background: var(--leave-chip-dot); width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.leave-date-picker { min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 8px; }
.leave-date-picker legend { padding: 0 5px; font-weight: 700; font-size: .9rem; }
.leave-date-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 240px; overflow: auto; margin-top: 8px; padding: 4px; }
.leave-date-options label { display: flex; align-items: center; gap: 7px; padding: 6px 7px; min-height: 36px; border-radius: 5px; background: #f1f6f8; font-weight: 550; }
.leave-date-options input { margin: 0; width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); }
.leave-selected { color: var(--accent-hover); font-size: .88rem; font-weight: 650; }
@media (max-width: 850px) {
  .brand-section { display: none; }
  .shell.signed-in { grid-template-columns: 1fr; }
  .navigation { flex-direction: row; flex-wrap: wrap; padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .navigation button { padding: 8px 10px; }
  .signed-in main { padding: 24px 0 48px; }
}
@media (max-width: 560px) {
  .masthead-inner { flex-wrap: wrap; min-height: 63px; gap: 6px; padding-block: 8px; }
  .brand-logo { width: min(270px, 100%); }
  .profile { font-size: .8rem; gap: 7px; }
  .profile .quiet { font-size: .8rem; padding: 6px 8px; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { min-height: 0; }
  .auth-aside h1 { max-width: none; }
  .auth-aside p { max-width: none; }
  .metrics, .account-fields, .pair { grid-template-columns: 1fr; }
  .intro { align-items: flex-start; flex-direction: column; }
  .toolbar label { flex: 1 1 130px; }
  .toolbar .button { margin-left: 0; }
  .pause-row { grid-template-columns: 1fr 1fr; }
  .card-title { flex-wrap: wrap; }
  .leave-toolbar-actions { margin-left: 0; }
  .leave-date-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
