/* Tokens from the house palette (hd-tech-standards BRAND_VOICE.md). System fonts on purpose:
   no third-party font requests (privacy), Montserrat/Source Sans used if installed. */
:root {
  --primary: #006f9a;        /* house #01AEEF darkened for AA text contrast on light */
  --primary-fill: #01AEEF;
  --depth: #2E3192;
  --bg: #fbf0ee;
  --surface: #ffffff;
  --text: #1f1f3d;
  --muted: #5b5876;
  --line: #e6d9d6;
  --amber: #f89f06;
  --amber-soft: #fff1d6;
  --amber-text: #8a5300;
  --night-soft: #e8e9f8;
  --mine: #16704b;
  --mine-soft: #dcf3e8;
  --danger: #b0174f;
  --focus: #ff0080;
  --heading: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #1CBBF0; --primary-fill: #1CBBF0; --bg: #0a0916; --surface: #16142c; --text: #f2f0f7;
    --muted: #a8a2bd; --line: #2b2848; --amber: #f9a820; --amber-soft: #3a2a10; --amber-text: #f9c46b;
    --night-soft: #23255a; --mine: #6fd3a6; --mine-soft: #143a2c; --danger: #ff6fa6; --focus: #ff2e93;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); }
h1, h2 { font-family: var(--heading); color: var(--depth); line-height: 1.15; margin: 0 0 var(--s3); text-wrap: balance; }
@media (prefers-color-scheme: dark) { h1, h2 { color: var(--text); } }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 20px; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
main.wrap { display: grid; gap: var(--s5); padding-block: var(--s5) var(--s6); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s4); top: var(--s4); background: var(--surface); color: var(--text); padding: var(--s2); z-index: 5; outline-color: #fff; }
.top :focus-visible { outline-color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top { background: var(--depth); color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding-block: var(--s3); }
.brand { color: #fff; font-family: var(--heading); font-weight: 700; text-decoration: none; }
.nav { display: flex; gap: var(--s4); align-items: center; }
.nav a, .nav .link { color: #fff; }
.link { background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; padding: 6px 0; }
.eyebrow { margin: 0 0 var(--s1); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s4); }
.inline, .row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.flash { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--amber-soft); color: var(--amber-text); font-weight: 600; }
select, input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 8px; padding: 6px 10px; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--muted); background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--primary-fill); border-color: var(--primary-fill); color: #06263a; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s3); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); display: grid; gap: 2px; }
.stat span { color: var(--muted); font-size: 14px; }
.stat b { font-family: var(--heading); font-size: 22px; font-variant-numeric: tabular-nums; }
.how summary { cursor: pointer; font-weight: 600; }
.how p { max-width: 70ch; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: 14px; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); }
.sw.dawn { background: var(--amber-soft); } .sw.night { background: var(--night-soft); }
.sw.mine { background: var(--mine-soft); border-color: var(--mine); } .sw.can { border: 1px dashed var(--muted); }
.sw.offd { box-shadow: inset 3px 0 var(--amber); } .sw.pastd { background: var(--bg); border-style: dashed; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; }
.person .you { display: inline; margin-left: 4px; }
.cal { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.cal th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 var(--s1); }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; vertical-align: top; }
.day > * + * { margin-top: 5px; }
.day.off { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--amber-soft) 6px 9px); box-shadow: inset 4px 0 var(--amber); }
.day.past { background: var(--bg); border-style: dashed; }
.blank { background: none; }
.dnum { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl { display: none; }
.off-btn { font: inherit; font-size: 12px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; min-height: 32px; min-width: 44px; border-radius: 4px; }
.off-btn[aria-pressed="true"] { color: var(--amber-text); font-weight: 600; }
.off-btn:hover { color: var(--amber-text); }
.slot { display: grid; width: 100%; text-align: left; gap: 1px; padding: 5px 7px; border-radius: 7px; border: 1px solid transparent; font: inherit; font-size: 13px; line-height: 1.25; color: var(--text); }
.slot .t { font-size: 11px; color: var(--muted); }
.slot .w { font-weight: 600; overflow-wrap: anywhere; }
.slot.dawn { background: var(--amber-soft); } .slot.dawn .w { color: var(--amber-text); }
.slot.night { background: var(--night-soft); } .slot.night .w { color: var(--depth); }
@media (prefers-color-scheme: dark) { .slot.night .w { color: var(--text); } }
.slot.open .w { color: var(--muted); }
.slot.mine { background: var(--mine-soft); border-color: var(--mine); } .slot.mine .w { color: var(--mine); }
button.slot { cursor: pointer; }
button.slot.can { border: 1px dashed var(--muted); }
button.slot:hover { border-style: solid; border-color: currentColor; }
.team { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s2); }
.person { display: flex; justify-content: space-between; gap: var(--s3); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: var(--s2) var(--s3); }
.person.me { border-color: var(--mine); }
.person small { display: block; color: var(--muted); font-size: 13px; }
.person .ct { font-variant-numeric: tabular-nums; font-weight: 600; }
.signin { max-width: 520px; }
.scroll { overflow-x: auto; }
.list { border-collapse: collapse; width: 100%; font-size: 14px; }
.list th, .list td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid-form { display: grid; gap: var(--s3); margin-top: var(--s4); max-width: 640px; }
.grid-form label { display: grid; gap: var(--s1); }
.grid-form fieldset { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
label.chk { display: inline-flex !important; gap: 6px; align-items: center; }
@media (max-width: 680px) {
  .cal, .cal tbody, .cal tr { display: block; }
  .cal thead, .cal .blank { display: none; }
  .cal { border-spacing: 0; }
  .day { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
  .day > * + * { margin-top: 0; }
  .dnum { flex-direction: column; align-items: start; }
  .dl { display: inline; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
