/* Float Aide — brand & interface standard v1.1.
   Values come from "Float Aide - Brand v1.1.dc.html" in the Relief design project.
   This REPLACED the office-hours design system that was copied in at the start:
   Float Aide has its own, and two colour systems on one page make both unreadable.
   Change a colour in the token block, never in a component. */

:root, :root[data-theme="day"] {
  --bg:          #f2f2f3;
  --surface:     #e9e9ea;
  --text:        #1d1f20;
  --text-soft:   #424244;
  --neutral-600: #7a7a7d;
  --neutral-400: #b7b7ba;
  --divider:     rgba(29,31,32,.16);
  --hairline:    rgba(29,31,32,.08);
  --accent:      #5980a6;
  --accent-700:  #416180;
  --accent-900:  #1d2d3d;
  --signal-goal:  #8a6a24;
  --signal-short: #a4433a;
  --goal-tint:   rgba(138,106,36,.10);
  --short-tint:  rgba(164,67,58,.08);
  --accent-tint: rgba(89,128,166,.10);
  --on-accent:   #f2f2f3;
  /* Day is the only theme where an exception may take a SOLID field. */
  --short-fill:   var(--signal-short);
  --short-ink:    #f2f2f3;
  --short-border: var(--signal-short);
}

/* Night. On at 1900 with the shift change, off at 0700 — it follows the SHIFT,
   not prefers-color-scheme, so there is deliberately no media query here.

   NO SIGNAL TAKES A SOLID FIELD ON THE DARK GROUND. Below minimum becomes brick
   type inside a brick hairline; tints cap at 10%. The exception is brighter
   ink, not a brighter object, so it carries the same weight at 0300 as on paper.
   Ink tops out at #e6e7e8 and the ground bottoms at #15181b — no pure white and
   no pure black, so a phone in a dark bunk room never flares. */
:root[data-theme="night"] {
  --bg:          #15181b;
  --surface:     #1e2227;
  --text:        #e6e7e8;
  --text-soft:   #b9bbbd;
  --neutral-600: #8b8d90;
  --neutral-400: #63666a;
  --divider:     rgba(230,231,232,.18);
  --hairline:    rgba(230,231,232,.09);
  --accent:      #94bce3;
  --accent-700:  #b5d9fd;
  --accent-900:  #0f1720;
  --signal-goal:  #d3ad57;
  --signal-short: #e5776b;
  --goal-tint:   rgba(211,173,87,.10);
  --short-tint:  rgba(229,119,107,.10);
  --accent-tint: rgba(148,188,227,.10);
  --on-accent:   #15181b;
  --short-fill:   var(--short-tint);
  --short-ink:    var(--signal-short);
  --short-border: var(--signal-short);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Barlow", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Barlow Condensed: units, times, headings. Always uppercase, never a paragraph. */
.cond, .shift, .wordmark, .tab, .btn, .tag, .board tbody th, .step-method, .panel-title {
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  text-transform: uppercase;
}
.lbl, .mono, .board td.n, .cite {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.lbl {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--neutral-600);
}

/* ---------- chrome ---------- */
.topbar {
  display: flex; align-items: center; gap: 26px;
  padding: 12px 24px; border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.mark { width: 26px; height: 26px; background: var(--accent-900); position: relative; flex-shrink: 0; }
.mark i { position: absolute; width: 44%; height: 44%; }
.mark i:first-child { left: 17%; top: 17%; background: var(--accent-700); }
.mark i:last-child { right: 17%; bottom: 17%; background: var(--accent); box-shadow: 0 0 0 1.5px var(--accent-900); }
.wordmark { font-weight: 700; font-size: 19px; letter-spacing: .16em; }

.tabs { display: flex; }
.tab {
  font-size: 15px; font-weight: 600; letter-spacing: .12em;
  padding: 9px 18px; min-height: 44px;
  background: transparent; color: var(--text-soft);
  border: 1px solid var(--divider); border-left: none; cursor: pointer;
}
.tab:first-child { border-left: 1px solid var(--divider); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab:focus-visible, .btn:focus-visible, .input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600; letter-spacing: .1em;
  min-height: 44px; padding: 0 18px; border-radius: 0; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--divider);
}
.btn:hover { background: var(--accent-tint); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-quiet { min-height: 36px; font-size: 13px; padding: 0 12px; }
.btn-small { min-height: 34px; font-size: 12px; padding: 0 10px; }
/* .btn is inline-flex, which beats the browser's [hidden] { display: none }.
   Without this an element with `hidden` renders anyway — the trap that cost
   office-hours real time. */
.btn[hidden] { display: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

main { max-width: 1220px; margin: 0 auto; padding: 0 24px 96px; }

.shiftbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; padding: 22px 0 16px; flex-wrap: wrap;
}
.shift { font-weight: 600; font-size: 32px; line-height: 1.1; letter-spacing: .02em; }
.shiftbar-end { display: flex; align-items: center; gap: 10px; }

.input {
  font: inherit; font-size: 14px; padding: 8px 10px; min-height: 40px;
  color: var(--text); background: transparent;
  border: 1px solid var(--divider); border-radius: 0; width: 100%;
}
.input:hover { border-color: var(--neutral-600); }

.intro { color: var(--text-soft); max-width: 78ch; margin: 0 0 20px; text-wrap: pretty; }

.banner {
  border-left: 3px solid var(--signal-short); background: var(--surface);
  padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}
.banner[hidden] { display: none; }
.view[hidden] { display: none; }

/* ---------- the count board ---------- */
.scroller { overflow-x: auto; border: 1px solid var(--divider); }
table.board { border-collapse: collapse; width: 100%; min-width: 800px; }
table.board th, table.board td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hairline);
}
table.board thead th {
  font-family: "IBM Plex Mono", monospace; font-weight: 400; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--neutral-600);
  border-bottom: 1px solid var(--divider); white-space: nowrap;
}
table.board tbody th {
  font-weight: 600; font-size: 19px; letter-spacing: .06em; white-space: nowrap;
}
.req { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--neutral-600); white-space: nowrap; }
.cell { text-align: center; }
.cell input {
  width: 62px; text-align: center; font-family: "IBM Plex Mono", monospace;
  font-size: 17px; padding: 6px 4px; min-height: 40px;
  background: transparent; color: inherit;
  border: 1px solid transparent; border-radius: 0;
}
.cell input:hover { border-color: var(--divider); }
.cell input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* THE THREE STATES. Goal met takes no treatment at all — most of a good day
   should look like nothing happened. Under goal is type and a rule and never
   fills a shape. Below minimum is the only state allowed a fill, and only by day. */
.cell.under_sg input { color: var(--signal-goal); border-bottom: 2px solid var(--signal-goal); }
.cell.below_msl input {
  color: var(--short-ink); background: var(--short-fill); border-color: var(--short-border);
  font-weight: 600;
}
.rowstate { text-align: right; white-space: nowrap; }
.tag {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  letter-spacing: .1em; padding: 4px 10px; border: 1px solid var(--divider);
  color: var(--neutral-600);
}
.tag.under_sg { color: var(--signal-goal); border-color: var(--signal-goal); background: var(--goal-tint); }
.tag.below_msl { color: var(--short-ink); border-color: var(--short-border); background: var(--short-fill); }
.tag.uncounted { color: var(--neutral-400); border-style: dashed; }

.notewrap { margin-top: 20px; max-width: 640px; }

/* ---------- the plan ---------- */
.planitem { border: 1px solid var(--divider); margin-bottom: 18px; }
.planitem-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.planitem-head .cond { font-weight: 600; font-size: 21px; letter-spacing: .06em; }
.basis { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--neutral-600); margin-left: auto; }

.step { display: grid; grid-template-columns: 132px 1fr auto; gap: 16px;
        padding: 12px 18px; border-bottom: 1px solid var(--hairline); align-items: start; }
.step:last-child { border-bottom: none; }
.step-n { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--neutral-600); }
.step-method { font-weight: 600; font-size: 16px; letter-spacing: .08em; }
.step-who { font-size: 15px; }
.step-guard { font-size: 14px; color: var(--signal-goal); margin-top: 3px; }
.step-why { font-size: 13px; color: var(--neutral-600); margin-top: 3px; }
.cite { font-size: 11px; color: var(--neutral-600); margin-top: 4px; }
.step-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.warnflag { color: var(--signal-short); font-size: 12px; }
.done { color: var(--accent-700); font-size: 13px; }

.empty { border: 1px dashed var(--divider); padding: 26px; color: var(--neutral-600); text-align: center; }

/* ---------- available ---------- */
.pastewrap { margin-bottom: 22px; }
.pasterow { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.avail { border-collapse: collapse; width: 100%; }
.avail th, .avail td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.avail thead th { font-family: "IBM Plex Mono", monospace; font-weight: 400; font-size: 11px;
                  letter-spacing: .14em; text-transform: uppercase; color: var(--neutral-600); }
.match-none, .match-ambiguous { color: var(--signal-short); }
.match-near { color: var(--signal-goal); }

/* ---------- panel ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.scrim[hidden], .panel[hidden] { display: none; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg); border-left: 1px solid var(--divider);
  z-index: 41; display: flex; flex-direction: column;
}
.panel-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--divider); }
.panel-title { font-size: 20px; font-weight: 600; letter-spacing: .06em; margin: 0; margin-right: auto; }
.panel-body { padding: 18px 20px; overflow-y: auto; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1; }
  .step { grid-template-columns: 1fr; }
  .step-act { justify-content: flex-start; }
  main { padding: 0 14px 96px; }
}

/* ---------- sign-in ---------- */
.gate { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.gate[hidden] { display: none; }
.gate-side {
  background: var(--accent-900); color: #f2f2f3;
  padding: 44px 46px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.gate-side .wordmark { color: #f2f2f3; }
.gate-side .mark { background: transparent; }
.gate-side .mark i:first-child { background: var(--accent-700); }
.gate-side .mark i:last-child { background: #94bce3; box-shadow: 0 0 0 1.5px var(--accent-900); }
.gate-hero {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: clamp(30px, 4vw, 40px);
  line-height: 1.05; text-transform: uppercase; letter-spacing: .01em; margin: 0;
}
.gate-sub { font-size: 15px; line-height: 1.6; color: #bdd8f2; max-width: 34ch; margin: 14px 0 0; text-wrap: pretty; }
.gate-org { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: #94bce3; }
.gate-main { padding: 44px 46px; display: flex; flex-direction: column; justify-content: center; }
.gate-step { display: flex; flex-direction: column; gap: 14px; max-width: 380px; width: 100%; }
.gate-step[hidden] { display: none; }
.gate-h {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 26px;
  letter-spacing: .06em; text-transform: uppercase; margin: 0;
}
.gate-note { font-size: 14px; color: var(--text-soft); margin: -6px 0 4px; text-wrap: pretty; }
.gate-msg { font-size: 14px; color: var(--signal-short); margin: 2px 0 0; min-height: 1.2em; }
.field { display: flex; flex-direction: column; gap: 5px; }
.btn-block { width: 100%; }
.code-input { font-size: 26px; letter-spacing: .3em; text-align: center; min-height: 54px; }

/* ---------- acting bar ---------- */
.actingbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--accent-tint); border-bottom: 1px solid var(--accent);
  padding: 10px 24px; font-size: 14px; color: var(--text);
}
.actingbar[hidden] { display: none; }
.actingbar .btn { margin-left: auto; }

/* ---------- people ---------- */
.addrow { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.addrow .field { min-width: 240px; }
.addrow .btn { min-height: 40px; }
#peopleTab[hidden] { display: none; }

@media (max-width: 780px) {
  .gate { grid-template-columns: 1fr; min-height: auto; }
  .gate-side { padding: 28px 22px; gap: 22px; }
  .gate-main { padding: 28px 22px; }
}

/* ---------- the shift: counts as people in slots ---------- */
.count { border: 1px solid var(--divider); margin-bottom: 26px; }
.count-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--divider); background: var(--surface);
}
.count-name {
  font-weight: 600; font-size: 21px; letter-spacing: .06em; width: 9ch;
  background: transparent; color: var(--text); border: 1px solid transparent;
  padding: 3px 6px; border-radius: 0;
}
.count-name:hover, .count-name:focus-visible { border-color: var(--divider); }
.slots-lbl { display: inline-flex; align-items: center; gap: 6px; }
.slots-in { width: 62px; min-height: 32px; padding: 3px 6px; }
.hint { font-size: 13px; color: var(--text-soft); flex-basis: 100%; }
.hint .cite { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--neutral-600); }

table.slots { border-collapse: collapse; width: 100%; min-width: 1140px; table-layout: fixed; }
table.slots th, table.slots td { border-bottom: 1px solid var(--hairline); padding: 0; }
table.slots thead th {
  font-family: "IBM Plex Mono", monospace; font-weight: 400; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--neutral-600);
  padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--divider); white-space: nowrap;
}
.c-no { width: 34px; text-align: center; color: var(--neutral-600); font-size: 12px; }
.c-name { width: 200px; } .c-sta { width: 80px; } .c-t { width: 78px; }
.c-b { width: 64px; text-align: center; } .c-x { width: 36px; text-align: center; }
thead .c-b { text-align: center; }

.cell-in {
  width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; min-height: 38px;
  background: transparent; color: var(--text); border: 1px solid transparent; border-radius: 0;
}
.cell-in.mono { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
.cell-in:hover { border-color: var(--hairline); }
.cell-in:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.slot-empty .cell-in::placeholder { color: var(--neutral-400); }

/* A covered block is a filled square; an empty one is a target you can hit. */
.blk {
  width: 100%; min-height: 38px; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; line-height: 1; color: var(--on-accent);
}
.blk.on { background: var(--accent); color: var(--on-accent); }
.blk.off:hover { background: var(--accent-tint); }
.blk:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rm {
  border: 0; background: transparent; color: var(--neutral-600); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 8px; min-height: 38px;
}
.rm:hover { color: var(--signal-short); }

table.slots tfoot td {
  padding: 8px 10px; font-family: "IBM Plex Mono", monospace; font-size: 14px;
  border-top: 1px solid var(--divider); text-align: center;
}
table.slots tfoot td.lbl { text-align: left; }
tfoot .t-gap { color: var(--signal-goal); }
tfoot .short { font-size: 11px; margin-left: 4px; }

.gaps { margin: 0; padding: 12px 16px 14px 34px; font-size: 14px; color: var(--text-soft); }
.gaps li { margin-bottom: 4px; }
.gaps-none { padding: 10px 16px; margin: 0; }

.addcount { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 26px; }
.addcount .field { min-width: 170px; }
.addcount .field.narrow { min-width: 90px; }
.addcount .btn { min-height: 40px; }
.opt { text-transform: none; letter-spacing: 0; color: var(--neutral-400); }

.availwrap { border: 1px solid var(--divider); padding: 0 16px; margin-top: 26px; }
.availwrap > summary {
  cursor: pointer; padding: 13px 0; display: flex; gap: 12px; align-items: baseline;
  font-weight: 600; letter-spacing: .06em;
}
.availwrap[open] > summary { border-bottom: 1px solid var(--hairline); margin-bottom: 14px; }
.availwrap > *:last-child { margin-bottom: 16px; }

/* Transport and Relief are different problems; they read as different sections. */
.grouprow td {
  padding: 9px 14px 5px; background: var(--surface);
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--hairline);
}
.grouphint { font-size: 12px; color: var(--neutral-600); margin-left: 10px; text-transform: none; letter-spacing: 0; }
.count-head .btn-small { min-height: 30px; }

/* Somebody off, and who is actually there. */
.c-st { width: 112px; } .c-cov { width: 170px; }
.cell-sel { font-size: 13px; padding: 7px 6px; cursor: pointer; }
.row-off .struck { text-decoration: line-through; text-decoration-color: var(--neutral-600); color: var(--neutral-600); }
/* Off WITH cover is normal; off with nobody is the thing to look at. */
.row-open { background: var(--goal-tint); }
/* Hours the slot is meant to be covered, with nobody in it. Outline, not fill —
   the shift is still expected, the person isn't there. */
.blk.hollow {
  background: transparent; color: var(--signal-goal);
  box-shadow: inset 0 0 0 1px var(--signal-goal);
}

/* The goal comes first — it is the first decision of the morning. */
.goalbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px; border-bottom: 1px solid var(--divider); background: var(--bg);
}
.goal-in { width: 58px; min-height: 32px; padding: 3px 6px; text-align: center; }
.goal-txt { font-size: 14px; color: var(--text-soft); }
.goal-req {
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px;
  padding: 3px 10px 3px 4px; border: 1px solid var(--divider);
}
.goal-req.short { border-color: var(--signal-goal); color: var(--signal-goal); background: var(--goal-tint); }
.goal-req strong { font-weight: 600; }

/* Which of them are preceptors — marked, not just counted. */
.holds {
  display: inline-block; font-family: "IBM Plex Mono", monospace; font-size: 10px;
  letter-spacing: .06em; padding: 1px 5px; margin-left: 6px; vertical-align: middle;
  color: var(--accent-700); border: 1px solid var(--accent);
}
.holds.unk { color: var(--neutral-600); border-color: var(--divider); border-style: dashed; }

.offroster { border-top: 1px solid var(--divider); padding: 0 16px; }
.offroster > summary { cursor: pointer; padding: 10px 0; }
.offlist { list-style: none; margin: 0 0 14px; padding: 0; }
.offlist li { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; flex-wrap: wrap; }
.offlist .btn { margin-left: auto; }
.goal-add { width: auto; min-width: 150px; max-width: 260px; min-height: 32px; padding: 3px 8px; font-size: 13px; }
.goal-req .rm { min-height: 22px; padding: 0 4px; font-size: 15px; margin-left: 2px; }
.backlink { margin: 20px 0 6px; }
.viewtitle { font-weight: 600; font-size: 26px; letter-spacing: .06em; margin: 6px 0 14px; }

/* .shiftbar is display:flex, which beats the browser's [hidden] { display:none }.
   The same trap as .btn[hidden] — check this first when something "hidden" shows. */
.shiftbar[hidden] { display: none; }
#themeBtn { padding: 0 10px; min-width: 40px; }
#themeBtn svg { display: block; }
.goal-driver { display: inline-flex; align-items: center; gap: 7px; }
.goal-need {
  font-family: "IBM Plex Mono", monospace; font-size: 15px; min-width: 22px;
  text-align: center; padding: 3px 6px; border-bottom: 2px solid var(--accent);
}

/* Which counts you care about. The counts are the department's; what you look
   at is yours. */
.chooser { border: 1px solid var(--divider); padding: 0 14px; margin-bottom: 20px; }
.chooser > summary { cursor: pointer; padding: 10px 0; }
.chooselist { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 4px 0 14px; }
.choose { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.choose input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* Uploading a fresh people list. */
.rosterbox { border-top: 1px solid var(--divider); margin-top: 34px; padding-top: 22px; }
.rosterbox label.btn { cursor: pointer; }
.rosterdiff { border: 1px solid var(--divider); padding: 16px 18px; margin-top: 16px; }
.rosterdiff > details { margin: 10px 0; }
.rosterdiff > details > summary { cursor: pointer; padding: 4px 0; }
.difflist { margin: 6px 0 10px; padding-left: 20px; font-size: 14px; color: var(--text-soft); max-height: 260px; overflow-y: auto; }
.difflist li { margin-bottom: 4px; }
.rosterdiff .btn-primary { margin-top: 12px; }
