/* ===========================================================================
   Scheduling Wizard — one stylesheet, two apps.

   The Formulation Hub's shell, in black and white. Same bones as the Hub's
   modern pages: a white 58px header carrying the lockup, a dark rail of 236px,
   a cool-grey canvas, white cards at 14px with a shadow you can barely see,
   segmented pill tabs, one page-header pattern, one title size, and a 140ms
   transition on everything that can change. The colour is gone: ink, paper and
   seven greys, with two desaturated hues kept back for state alone.

   Space is a scale, never a guess: 4 8 12 18 26 34 44.
   =========================================================================== */

@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/fonts/manrope.woff2") format("woff2");
}

/* ---------------------------------------------------------------- tokens -- */
:root {
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --canvas: #f4f5f6;
  --card: #ffffff;
  --sunken: #f1f2f4;        /* inputs, hovered rows */
  --wash: #ebedef;          /* a selected thing */
  --line: #e4e6e9;
  --line-2: #eef0f2;

  --ink: #0d0f11;           /* headings, primary buttons */
  --body: #383d43;
  --soft: #6a7178;
  --faint: #9aa1a8;

  --rail: #111314;
  --railink: #d7dbdf;
  --railsoft: #868d94;
  --railhi: rgba(255, 255, 255, .07);
  --railon: rgba(255, 255, 255, .13);

  /* state, desaturated on purpose: the page reads as ink and paper */
  --ok: #2d6a4c;      --okwash: #edf3ef;    --okline: #cfe0d6;
  --alert: #8a463b;   --alertwash: #f8efed; --alertline: #ecd6d1;
  --note: #46505c;    --notewash: #eef0f3;  --noteline: #dde1e7;

  --lift: 0 1px 2px rgba(16, 18, 20, .04), 0 2px 6px rgba(16, 18, 20, .03);
  --lift-h: 0 1px 2px rgba(16, 18, 20, .05), 0 8px 22px -14px rgba(16, 18, 20, .24);
  --pop: 0 16px 44px -12px rgba(13, 15, 17, .26), 0 2px 8px rgba(13, 15, 17, .06);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 18px; --s5: 26px; --s6: 34px; --s7: 44px;
  --radius: 14px; --r-ctl: 11px; --r-sm: 9px; --r-xs: 7px;
  --sidew: 236px; --head: 58px;
}

html[data-theme="dark"], html.sysdark {
  color-scheme: dark;
  --canvas: #101213; --card: #181b1c; --sunken: #1e2223; --wash: #262b2d;
  --line: #262b2d; --line-2: #1f2324;
  --ink: #eceef0; --body: #c3c8cc; --soft: #8e959b; --faint: #697077;
  --rail: #0a0c0c; --railink: #d7dbdf; --railsoft: #7b8288;
  --ok: #6fbf96; --okwash: #16261e; --okline: #244635;
  --alert: #d99186; --alertwash: #2a1a17; --alertline: #4a2b25;
  --note: #9aa6b4; --notewash: #1c2126; --noteline: #2b3239;
  --lift: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .26);
  --lift-h: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 26px -14px rgba(0, 0, 0, .6);
  --pop: 0 20px 56px -12px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .4);
}

/* ----------------------------------------------------------------- reset -- */
* { box-sizing: border-box; margin: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--canvas); color: var(--body);
  font: 400 14.5px/1.55 var(--font); letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
textarea { resize: vertical; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: var(--wash); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* motion: short, everywhere, and none for those who asked for none */
a, button, .btn, .card, .tcard, .hk, .side a, .ftab, .pill, .chip, .schip, .tile, .drop,
.list .li, .table tr, .board tr, .filters button, input, select, textarea {
  transition: background-color .14s, color .14s, border-color .14s, box-shadow .18s, transform .14s;
}
.btn:active, button:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ type -- */
h1, h2, h3, h4 { font-family: var(--font); color: var(--ink); letter-spacing: -.02em; }
h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; line-height: 1.15; }
h2 { font-size: 19px; font-weight: 750; line-height: 1.25; }
h3 { font-size: 15px; font-weight: 750; line-height: 1.35; }
p { margin: 0 0 10px; } p:last-child { margin-bottom: 0; }
code, pre, kbd, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; }
b, strong { font-weight: 700; }
.display { font-size: clamp(28px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.028em; line-height: 1.12; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.lab { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.eyebrow { font-size: 12.5px; font-weight: 650; color: var(--soft); margin: 0 0 6px; }
.sub { color: var(--soft); font-size: 13.5px; }
.lede { color: var(--soft); font-size: 15.5px; margin: 8px 0 var(--s4); max-width: 66ch; }
.muted { color: var(--soft); } .faint { color: var(--faint); } .tiny { font-size: 12px; }
.nowrap { white-space: nowrap; } .right { margin-left: auto; } .grow { flex: 1; min-width: 0; }
.sr { position: absolute; left: -9999px; }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s2); }
.keyline { height: 1px; background: var(--line); border: 0; }

/* --------------------------------------------------------------- the head -- */
header.top {
  position: sticky; top: 0; z-index: 50; height: var(--head);
  display: flex; align-items: center; gap: var(--s4); padding: 0 22px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.lockup {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none;
}
.lockup:hover { text-decoration: none; }
.lockup::before {
  content: ""; width: 24px; height: 24px; border-radius: 8px; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--card) 0 4px, transparent 4.5px),
              linear-gradient(135deg, #2b2f33, var(--ink));
}
header.top .ctx { font-size: 13.5px; font-weight: 650; color: var(--soft); border-left: 1px solid var(--line); padding-left: var(--s4); }
header.top .srch { margin-left: auto; flex: 0 1 380px; position: relative; }
header.top .srch input { background: var(--canvas); border-color: transparent; padding: 8px 12px 8px 34px; margin: 0; }
header.top .srch input:focus { background: var(--card); border-color: var(--ink); box-shadow: none; }
header.top .srch svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
header.top .r { margin-left: auto; display: flex; align-items: center; gap: var(--s3); font-size: 13.5px; color: var(--soft); }
header.top .srch ~ .r { margin-left: 0; }

/* ---------------------------------------------------------------- the rail -- */
/* One layout at every width.
   A left rail and a top bar were two layouts to keep right, and the second one
   only existed below a breakpoint, which is where the bugs lived. The nav is
   always a slim dark bar under the header: it gives the content back the rail's
   236px, which the spreadsheet viewer and every wide table want, and it is one
   thing to get right instead of two. A rail earns its keep when there are
   fifteen destinations. There are five. */
.shell { display: block; min-height: calc(100vh - var(--head)); background: var(--canvas); }
.side {
  position: sticky; top: var(--head); z-index: 30;
  background: var(--rail); padding: 8px 20px; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px;
}
.side .org { display: none; }
/* "System" as a heading over a stack makes sense; beside a row it is noise.
   A hairline says the same thing in no words. */
.side .lbl { width: 1px; height: 20px; padding: 0; margin: 0 var(--s3);
  background: rgba(255, 255, 255, .14); overflow: hidden; text-indent: -999px; }
.side a.nav {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  color: var(--railink); font-weight: 500; line-height: 1.4; white-space: nowrap;
}
.side a.nav:hover { background: var(--railhi); color: #fff; text-decoration: none; }
.side a.nav.on { background: var(--railon); color: #fff; font-weight: 700; }
.side a.nav svg { width: 17px; height: 17px; flex: none; opacity: .62; }
.side a.nav:hover svg, .side a.nav.on svg { opacity: 1; }
.side a.nav .n { margin-left: 2px; min-width: 19px; text-align: center; font-size: 11px; font-weight: 700; background: #fff; color: var(--rail); border-radius: 999px; padding: 1px 6px; }
.side .navsep { width: 1px; height: 20px; background: rgba(255, 255, 255, .14); margin: 0 var(--s3); }
/* the signed-in person is in the header; a second copy here said it twice */
.side .foot { display: none; }
.side .foot .av { background: #fff; color: var(--rail); }
.side .foot form { margin-left: auto; }
.side .foot .btn.ghost { color: var(--railsoft); padding: 4px 8px; }
.side .foot .btn.ghost:hover { background: var(--railhi); color: #fff; }

.wrap, .page { padding: 30px 40px 90px; max-width: 1440px; width: 100%; }
.page.narrow { max-width: 880px; margin: 0 auto; }
.page.solo { max-width: 780px; margin: 0 auto; }

.av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; background: var(--wash); color: var(--soft); }
.av.sm { width: 24px; height: 24px; font-size: 9.5px; }

/* ------------------------------------------------------------- page header -- */
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4);
  flex-wrap: wrap; margin: 0 0 var(--s5); padding-bottom: var(--s4); border-bottom: 1px solid var(--line);
}
.pagehead .t { flex: 1; min-width: 260px; }
.pagehead .t h1 { margin: 0 0 var(--s1); }
.pagehead .t p, .pagehead .t .sub { margin: 0; max-width: 70ch; color: var(--soft); font-size: 13.5px; }
.pagehead .acts { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin: 0 0 var(--s5); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.topline .who { min-width: 0; } .topline .who .sub { margin-top: 5px; }
.topline .side-acts, .topline .side { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  position: static; height: auto; background: none; padding: 0; overflow: visible; }
.crumbbar { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--soft); margin-bottom: var(--s3); }
.crumbbar a { color: var(--soft); } .crumbbar b { color: var(--ink); font-weight: 700; }

/* ----------------------------------------------------------------- cards -- */
/* The page owns the gap between its blocks; no call site sets a margin. */
main.page > .card, main.page > .tcard, main.page > .split, main.page > .side-by,
main.page > .hks, main.page > .stats, main.page > .tabs, main.page > .banner,
main.page > .alert, main.page > .empty, main.page > .timeline { margin-bottom: var(--s4); }
main.page > :last-child { margin-bottom: 0; }

.card, .tcard, .hk, .empty {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift);
}
.card:hover, .tcard:hover { box-shadow: var(--lift-h); }
.card > .hd { display: flex; align-items: center; gap: var(--s2); padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .bd { padding: var(--s4) 18px; }
.card.pad { padding: var(--s4) 20px; }
.card.flush > .bd { padding: 0; }
.cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--soft); font-size: 14px; box-shadow: none; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 5px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
.split.one { grid-template-columns: minmax(0, 1fr); }
.side-by { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s3); align-items: start; }
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s3); }
.threecol { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s3); }
@media (max-width: 720px) { .twocol, .threecol { grid-template-columns: 1fr; } }
/* A bare `div.field` groups a label, some rows and a hint. It never got the
   column layout a `label.field` has, so the hint sat jammed against the button
   it was explaining, reading like part of the button. */
div.field { display: flex; flex-direction: column; align-items: flex-start; }
div.field > .lab { display: block; margin-bottom: 10px; font-size: 12.5px; font-weight: 700;
  color: var(--soft); }
/* the row of inputs inside one takes the full width; a lone button does not */
div.field > .row, div.field > .audience { width: 100%; }
div.field > .btn { align-self: flex-start; margin-top: 2px; }
/* a hint explains the thing above it, so it sits closer to that than to
   whatever comes next, but not so close that it reads as part of the button */
div.field > .sub, label.field > .sub { margin-top: 12px; line-height: 1.6; max-width: 70ch; }
label.field > .sub { margin-top: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px var(--s4); font-size: 13.5px; align-items: baseline; }
.kv .k { color: var(--soft); }
.copybox { display: flex; align-items: center; gap: var(--s2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* stat tiles, the Hub's .hk */
.hks, .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); }
.hk, .stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; color: inherit; text-decoration: none; }
.hk b, .stat b { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.hk span, .stat span { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.hk b small, .stat b small { font-size: 15px; font-weight: 650; color: var(--faint); letter-spacing: 0; }
a.hk:hover { text-decoration: none; border-color: var(--ink); }
.hk .note { font-size: 12.5px; color: var(--soft); letter-spacing: 0; text-transform: none; font-weight: 400; margin-top: 2px; }

/* metric rows: an icon tile, a micro label, a number */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics.one { grid-template-columns: 1fr; }
/* A row of icon, text and sometimes a button. It has to wrap, and the text has
   to be allowed to be narrower than its longest word, or an email address
   pushes the whole row off the screen. */
.metric { display: flex; align-items: flex-start; gap: var(--s3); padding: 16px 18px;
  border-top: 1px solid var(--line-2); flex-wrap: wrap; }
/* The icon stays beside its text. Letting the text block shrink is what keeps
   it there; without a basis it wraps underneath the moment the row is tight,
   and only the button should ever drop to a second line. */
.metric > .ic { flex: none; }
.metric > div:not(.ic) { flex: 1 1 0; min-width: 130px; }
.metric p, .metric .t { overflow-wrap: anywhere; }
.metrics > .metric:nth-child(-n+2) { border-top: 0; }
.metrics.one > .metric:first-child { border-top: 0; }
.metrics > .metric:nth-child(odd) { border-right: 1px solid var(--line-2); }
.metrics.one > .metric { border-right: 0; }
.metric .ic { width: 32px; height: 32px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; background: var(--sunken); color: var(--soft); }
.metric .ic svg { width: 16px; height: 16px; }
.metric .ic.ok { background: var(--okwash); color: var(--ok); }
.metric .ic.ask, .metric .ic.accent, .metric .ic.note { background: var(--notewash); color: var(--note); }
.metric .ic.warn, .metric .ic.alert { background: var(--alertwash); color: var(--alert); }
.metric .v { font-size: 23px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.metric .v small { font-size: 14px; font-weight: 650; color: var(--faint); letter-spacing: 0; }
.metric .note { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.statusline { display: flex; align-items: center; gap: 9px; padding: 10px 18px; font-size: 13px; font-weight: 600; background: var(--okwash); color: var(--ok); border-bottom: 1px solid var(--okline); }
.statusline svg { width: 15px; height: 15px; flex: none; }
.statusline.warn { background: var(--alertwash); color: var(--alert); border-bottom-color: var(--alertline); }
.statusline.accent { background: var(--notewash); color: var(--note); border-bottom-color: var(--noteline); }

/* ------------------------------------------------- the hero and the ways -- */
/* A page says one thing. The heading is the thing, the ask is under it, and
   the one action is under that. Nothing counts anything at the client. */
.hero { margin: 0 0 var(--s6); }
.hero .display { margin: 0 0 var(--s2); }
.hero .hero-sub { margin: 0 0 var(--s4); font-size: 16px; color: var(--soft); }
.hero .ask { margin: var(--s3) 0 0; font-size: 16px; line-height: 1.6; color: var(--body); max-width: 58ch; }
.ways { margin: 0 0 var(--s5); }
.ways .lab { margin: 0 0 10px; }
.stage { font-weight: 650; color: var(--ink); white-space: nowrap; }

/* --------------------------------------------------------------- controls -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-ctl); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 650;
  line-height: 1.3; cursor: pointer; white-space: nowrap; box-shadow: none;
}
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; border-color: var(--line); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--card); box-shadow: var(--lift); }
.btn.primary:hover:not(:disabled) { background: #000; border-color: #000; }
html[data-theme="dark"] .btn.primary:hover:not(:disabled), html.sysdark .btn.primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
.btn.soft { background: var(--wash); border-color: transparent; }
.btn.ok { background: var(--okwash); border-color: var(--okline); color: var(--ok); }
.btn.danger { color: var(--alert); }
.btn.danger:hover { background: var(--alertwash); border-color: var(--alertline); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); border-color: transparent; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.xs { padding: 3px 9px; font-size: 11.5px; border-radius: var(--r-xs); }
.btn .k { font-family: var(--mono); font-size: 10.5px; opacity: .55; border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; }
.iconbtn { width: 32px; height: 30px; padding: 0; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--soft); display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: var(--sunken); color: var(--ink); }
.iconbtn svg { width: 16px; height: 16px; }

/* segmented pills, the Hub's .ftabs */
.filters, .ftabs { display: inline-flex; gap: var(--s1); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex-wrap: wrap; box-shadow: var(--lift); }
.filters button, .ftab { border: 0; background: transparent; border-radius: var(--r-sm); padding: 7px 14px; font-size: 13px; font-weight: 650; color: var(--soft); cursor: pointer; }
.filters button:hover, .ftab:hover { color: var(--ink); }
.filters button.on, .ftab[aria-selected="true"] { background: var(--wash); color: var(--ink); }
.filters button .n, .fcount { margin-left: 6px; font-weight: 600; color: var(--faint); }
.filters button.on .n { color: var(--soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; padding: 7px 13px; font-weight: 650; font-size: 13px; color: var(--soft); cursor: pointer; }
.seg button.on { background: var(--wash); color: var(--ink); }
.seg button:disabled { color: var(--faint); cursor: not-allowed; }
.tabs { display: flex; gap: var(--s1); margin-bottom: var(--s4); overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: var(--lift); }
.tabs button { background: none; border: 0; padding: 7px 14px; color: var(--soft); font-weight: 650; font-size: 13.5px; cursor: pointer; border-radius: var(--r-sm); white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--wash); color: var(--ink); font-weight: 750; }
.tabs button .n { display: inline-block; margin-left: 6px; font-size: 11px; background: var(--sunken); border-radius: 999px; padding: 0 6px; color: var(--soft); font-weight: 650; }
.tabs button.on .n { background: var(--card); }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .pop { position: absolute; right: 0; top: calc(100% + 5px); z-index: 60; min-width: 220px; max-width: calc(100vw - 24px); padding: 7px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop); display: flex; flex-direction: column; }
details.menu .pop button, details.menu .pop a { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; }
details.menu .pop button:hover, details.menu .pop a:hover { background: var(--sunken); text-decoration: none; }
details.menu .pop button.danger { color: var(--alert); }
details.menu .pop .sep { height: 1px; background: var(--line-2); margin: var(--s1) 0; }

/* ----------------------------------------------------------------- forms -- */
.form { display: flex; flex-direction: column; gap: var(--s3); }
.form label, label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--soft); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--card); color: var(--body); font-size: 14px; font-weight: 400; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--wash); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 84px; line-height: 1.55; }
input[type=checkbox], input[type=radio] { width: auto; flex: none; accent-color: var(--ink); }
input[type=file] { font-size: 13px; border: 0; padding: 0; }

/* ---------------------------------------------------------------- tables -- */
.tcard { overflow: hidden; margin: 0 0 22px; }
.tcard .tbar { display: flex; align-items: center; gap: var(--s3); padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tcard .tbar .tname { font-weight: 750; font-size: 13px; color: var(--ink); }
.table, .board { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .board th {
  text-align: left; padding: 10px 18px; background: var(--card); color: var(--faint);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td, .board td { padding: 13px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td, .board tr:last-child td { border-bottom: 0; }
.table tr.click, .board tr.click { cursor: pointer; }
.table tr.click:hover td, .board tr.click:hover td { background: var(--sunken); }
.table td.n, .table th.n, .board td.n, .board th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

/* ----------------------------------------------------------------- lists -- */
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: var(--s3); padding: 13px 18px; border-top: 1px solid var(--line-2); font-size: 13.5px; color: inherit; text-decoration: none; }
.list .li:first-child { border-top: 0; }
.list a.li:hover { background: var(--sunken); text-decoration: none; }
.list .li .t { font-weight: 700; color: var(--ink); }
.list .li .s { color: var(--soft); font-size: 12.5px; margin-top: 1px; }
.list .li .ic { width: 30px; height: 30px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; background: var(--sunken); color: var(--soft); }
.list .li .ic svg { width: 15px; height: 15px; }
.list .li .ic.submitted, .list .li .ic.comment { background: var(--notewash); color: var(--note); }
.list .li .ic.questions { background: var(--alertwash); color: var(--alert); }
.list .li .ic.file { background: var(--okwash); color: var(--ok); }
.item { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); margin-bottom: var(--s2); color: inherit; text-decoration: none; }
.item:hover { border-color: var(--ink); text-decoration: none; }
.item .t { font-weight: 700; color: var(--ink); } .item .s { font-size: 12.5px; color: var(--soft); }
.kind { width: 38px; height: 38px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--line); color: var(--soft); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.files .cap { padding: 0 0 7px; }
.files .f { display: flex; align-items: center; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.files .f:last-child { border-bottom: 0; }
.files .f .k { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; background: var(--sunken); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; color: var(--soft); }
.note { display: flex; gap: 10px; font-size: 13.5px; }
.note .av { margin-top: 1px; }
.note.admin .av { background: var(--ink); color: var(--card); }
.note .b { flex: 1; min-width: 0; }
.note .h { font-size: 12px; color: var(--soft); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.note .h b { color: var(--ink); }
.note .t { white-space: pre-wrap; }
.note.internal .b { background: var(--alertwash); border: 1px dashed var(--alertline); padding: 6px 10px; border-radius: var(--r-xs); }
.note.resolved { opacity: .6; }
.note-to { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; font-size: 13.5px; background: var(--notewash); border: 1px solid var(--noteline); color: var(--note); border-radius: var(--r-ctl); padding: 12px 16px; margin-bottom: var(--s3); }
.note-to b { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; white-space: nowrap; }
.timeline { display: flex; flex-direction: column; gap: var(--s3); }

/* ---------------------------------------------------------------- upload -- */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: var(--s5) 20px; cursor: pointer; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.drop:hover, .drop.over { background: var(--sunken); border-color: var(--ink); }
.drop input { display: none; }
.drop .ic { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--wash); color: var(--ink); margin-bottom: 3px; }
.drop:hover .ic, .drop.over .ic { background: var(--ink); color: var(--card); }
.drop .ic svg { width: 19px; height: 19px; }
.drop b { font-size: 15.5px; color: var(--ink); font-weight: 750; }
.drop .sub { font-size: 12.5px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tiles .drop, .tile { min-height: 148px; padding: 20px 14px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; padding: 22px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: inherit; text-decoration: none; box-shadow: var(--lift); }
.tile:hover { border-color: var(--ink); text-decoration: none; box-shadow: var(--lift-h); }
.tile.off { opacity: .66; cursor: default; } .tile.off:hover { border-color: var(--line); box-shadow: var(--lift); }
.tile .ic { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--sunken); color: var(--soft); margin-bottom: 3px; }
.tile .ic svg { width: 19px; height: 19px; }
.tile b { font-size: 15.5px; color: var(--ink); font-weight: 750; }
.tile .sub { font-size: 12.5px; }

/* --------------------------------------------------------------- banners -- */
.alert { padding: 12px 15px; border-radius: var(--r-ctl); font-size: 13.5px; border: 1px solid; }
.alert.info { background: var(--notewash); border-color: var(--noteline); color: var(--note); }
.alert.ok { background: var(--okwash); border-color: var(--okline); color: var(--ok); }
.alert.warn, .alert.bad { background: var(--alertwash); border-color: var(--alertline); color: var(--alert); }
.banner { display: flex; align-items: flex-start; gap: var(--s3); padding: 14px 16px; margin-bottom: var(--s3); background: var(--alertwash); border: 1px solid var(--alertline); border-radius: var(--r-ctl); font-size: 13.5px; color: var(--body); }
.banner .ic { width: 20px; height: 20px; flex: none; color: var(--alert); }
.banner b { display: block; color: var(--ink); margin-bottom: 2px; }
.banner a { color: var(--alert); font-weight: 700; text-decoration: underline; }
.setup { display: flex; gap: 7px; flex-wrap: wrap; }
.err { background: var(--alertwash); color: var(--alert); border: 1px solid var(--alertline); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px; }

/* ------------------------------------------------------- chips and states -- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 700; border: 1px solid var(--line); background: var(--sunken); color: var(--soft); white-space: nowrap; }
.chip.id { font-family: var(--mono); font-weight: 500; color: var(--ink); letter-spacing: -.02em; }
.chip.HARD { background: var(--wash); color: var(--ink); border-color: transparent; }
.chip.SOFT { background: var(--notewash); color: var(--note); border-color: transparent; }
.chip.PROCESS { background: var(--sunken); color: var(--soft); border-color: transparent; }
.chip.clickable { cursor: pointer; } .chip.clickable:hover { border-color: var(--ink); }
.schip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--soft); font-size: 12.5px; font-weight: 650; white-space: nowrap; box-shadow: var(--lift); }
.schip svg { width: 13px; height: 13px; }
.schip.ok { color: var(--ok); border-color: var(--okline); background: var(--okwash); }
.schip.warn { color: var(--alert); border-color: var(--alertline); background: var(--alertwash); }
.schip b { color: inherit; font-weight: 800; }
.turn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: var(--wash); color: var(--ink); }
.turn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.turn.client { background: var(--notewash); color: var(--note); }
.turn.us { background: var(--wash); color: var(--ink); }
.turn.both { background: var(--alertwash); color: var(--alert); }
.turn.none { background: var(--okwash); color: var(--ok); }
.stale { color: var(--alert); font-weight: 800; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--wash); color: var(--ink); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.unreviewed, .pill.draft, .pill.archived { background: var(--sunken); color: var(--soft); }
.pill.confirmed, .pill.shared, .pill.done { background: var(--okwash); color: var(--ok); }
.pill.changed, .pill.removed { background: var(--alertwash); color: var(--alert); }
.pill.question, .pill.submitted, .pill.planned, .pill.released { background: var(--notewash); color: var(--note); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* -------------------------------------------------------------- progress -- */
.bar { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .confirmed { background: var(--ok); } .bar .changed { background: var(--soft); }
.bar .question { background: var(--note); } .bar .removed { background: var(--alert); }
.legend { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 11.5px; color: var(--soft); }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--faint); }
.legend .confirmed::before { background: var(--ok); } .legend .changed::before { background: var(--soft); }
.legend .question::before { background: var(--note); } .legend .removed::before { background: var(--alert); }
.ring { --p: 0; position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink); background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line-2) 0); }
.ring::before { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--soft); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- modal -- */
.backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(13, 15, 17, .42); display: grid; place-items: center; padding: var(--s5); backdrop-filter: blur(3px); }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--pop); width: 100%; max-width: 540px; max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 780px; }
.modal > .hd { display: flex; align-items: center; gap: var(--s2); padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal > .hd h2 { font-size: 17px; flex: 1; min-width: 0; }
/* A form you fill in once per client deserves room. The old gap was the same
   as the gap between two inputs in a row, so a field group and the hint
   explaining it were the same distance apart as two unrelated sections. */
.modal > .bd { padding: var(--s5) 24px; overflow: auto; display: flex; flex-direction: column; gap: var(--s5); }
.modal > .bd > .twocol, .modal > .bd > .threecol { gap: var(--s4); }
.modal > .ft { display: flex; gap: var(--s2); justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 650; box-shadow: var(--pop); max-width: 80vw; }
.toast.bad { background: var(--alert); color: #fff; }

/* ------------------------------------------------------------ plain pages -- */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: var(--s5); }
.card-narrow, .card-wide { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); padding: 34px; width: 100%; max-width: 430px; }
.card-wide { max-width: 780px; }
body.plain .brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
body.plain .brand .mark { width: 24px; height: 24px; border-radius: 8px; flex: none; background: radial-gradient(circle at 50% 50%, var(--card) 0 4px, transparent 4.5px), linear-gradient(135deg, #2b2f33, var(--ink)); }
body.plain .brand .mark::after { content: none; }
body.plain h1 { font-size: 26px; margin-bottom: 6px; }
body.plain .foot { margin-top: 20px; font-size: 13px; color: var(--soft); }
body.plain .form { margin-top: 16px; }

/* ---------------------------------------------------------- rules review -- */
.review { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.review > div { min-width: 0; }
.rail { position: sticky; top: calc(var(--head) + 18px); max-height: calc(100vh - var(--head) - 40px); overflow: auto; padding-right: 4px; }
.rail .g { margin-bottom: var(--s3); }
.rail .dim { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.rail a { display: flex; align-items: center; gap: var(--s2); padding: 6px 10px; border-radius: var(--r-sm); color: var(--body); font-size: 13.5px; }
.rail a:hover { background: var(--sunken); text-decoration: none; }
.rail a.on { background: var(--wash); color: var(--ink); font-weight: 700; }
.rail a .n { margin-left: auto; font-size: 11px; color: var(--soft); }
.rail a .done { color: var(--ok); }
.toolbar { position: sticky; top: var(--head); z-index: 20; background: var(--canvas); padding: 10px 0 12px; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.toolbar .search { margin-left: auto; flex: 0 1 230px; min-width: 150px; }
.toolbar .search input { padding: 8px 13px; font-size: 13.5px; }
.dimhead { margin: var(--s5) 0 10px; }
.dimhead h2 { font-size: 19px; }
.dimhead p { color: var(--soft); margin: 4px 0 0; max-width: 80ch; font-size: 13.5px; }
.grouphead { display: flex; align-items: baseline; gap: 10px; margin: var(--s4) 0 var(--s2); flex-wrap: wrap; }
.grouphead h3 { font-size: 15px; }
.grouphead .n { font-size: 11.5px; color: var(--soft); }
.grouphead .ctx { color: var(--soft); font-size: 13.5px; flex-basis: 100%; max-width: 80ch; }
.rule { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-ctl); margin-bottom: 9px; scroll-margin-top: 110px; box-shadow: var(--lift); }
.rule.focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--wash); }
.rule.confirmed { border-left: 3px solid var(--ok); }
.rule.changed { border-left: 3px solid var(--soft); }
.rule.question { border-left: 3px solid var(--note); }
.rule.removed { border-left: 3px solid var(--alert); }
.rule .top { display: flex; align-items: center; gap: var(--s2); padding: 12px 16px 0; flex-wrap: wrap; }
.rule .top .pill { margin-left: auto; }
.rule .stmt { padding: var(--s2) 16px 4px; font-size: 15px; line-height: 1.55; color: var(--ink); }
.rule.removed .stmt { text-decoration: line-through; color: var(--soft); }
.rule .stmt pre { background: var(--sunken); border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 10px 12px; margin: var(--s2) 0 0; font-size: 12.5px; }
.rule .was { margin: 0 16px 6px; font-size: 12.5px; color: var(--soft); }
.rule .was b { font-weight: 800; margin-right: 6px; }
.rule .meta { display: flex; gap: var(--s3); flex-wrap: wrap; padding: 4px 16px 0; font-size: 12.5px; color: var(--soft); }
.rule .meta .k { font-weight: 700; margin-right: 4px; }
.rule details.prov { margin: 6px 16px 0; font-size: 12.5px; }
.rule details.prov summary { cursor: pointer; color: var(--soft); font-weight: 650; }
.rule details.prov .in { padding: var(--s2) 0 2px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.rule details.prov .in .k { color: var(--faint); }
.rule blockquote { padding: var(--s2) 12px; border-left: 3px solid var(--line); background: var(--sunken); border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.rule blockquote cite { display: block; font-style: normal; color: var(--soft); font-size: 11.5px; margin-top: 4px; }
.rule .acts { display: flex; gap: 3px; padding: var(--s2) 12px 10px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line-2); margin-top: var(--s2); }
.rule .acts .btn { background: transparent; border-color: transparent; color: var(--soft); padding: 6px 10px; font-size: 13px; }
.rule .acts .btn:hover { background: var(--sunken); color: var(--ink); border-color: transparent; }
.rule .acts .btn.ok { color: var(--ok); background: transparent; border-color: transparent; }
.rule .acts .btn.ok:hover, .rule .acts .btn.ok.on { background: var(--okwash); }
.rule .acts .btn.ok.on { font-weight: 750; }
.rule .acts .who { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.rule .yours { padding: var(--s2) 16px 0; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.rule .edit { padding: 6px 16px 12px; display: flex; flex-direction: column; gap: var(--s2); }
.rule .edit .orig { font-size: 12.5px; color: var(--soft); }
.rule .notes { border-top: 1px solid var(--line-2); padding: 10px 16px 6px; display: flex; flex-direction: column; gap: 9px; }
.reply { display: flex; gap: var(--s2); align-items: flex-start; }
.reply textarea { min-height: 40px; flex: 1; padding: 8px 12px; font-size: 13.5px; }
.addrule { margin: 6px 0 var(--s3); }
.addrule .btn { border-style: dashed; color: var(--soft); }
.diff del { background: var(--alertwash); color: var(--alert); text-decoration: line-through; }
.diff ins { background: var(--okwash); color: var(--ok); text-decoration: none; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; background: var(--card); border-top: 1px solid var(--line); }
.dock .in { max-width: 1440px; padding: 10px 40px; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr) 312px; gap: 20px; align-items: start; }
.summary { position: sticky; top: calc(var(--head) + 18px); display: flex; flex-direction: column; gap: var(--s3); }
.summary .li { display: flex; gap: var(--s2); align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; cursor: pointer; }
.summary .li:last-child { border-bottom: 0; }
.summary .li:hover { color: var(--ink); }
.summary .li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.findings .f { padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.findings .f:last-child { border-bottom: 0; }
.findings .f .r { color: var(--soft); font-size: 12.5px; margin-top: 2px; }
.finding { font-size: 13.5px; }
.flash { max-width: 640px; margin: var(--s5) auto; text-align: center; }
.flash .q { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 22px 0 6px; color: var(--ink); }
.flash .a { text-align: left; margin-top: var(--s4); }

.grid { margin: var(--s2) 16px 4px; overflow-x: auto; }
.grid table { border-collapse: separate; border-spacing: 3px; font-size: 11.5px; }
.grid th { font-weight: 650; color: var(--soft); padding: 2px 6px; text-align: center; font-size: 10.5px; }
.grid th.r { text-align: right; }
.grid td { min-width: 62px; padding: 6px 8px; border-radius: 6px; background: var(--sunken); text-align: center; border: 1px solid var(--line-2); }
.grid td .l { font-weight: 700; } .grid td .s { display: block; font-size: 9.5px; color: var(--soft); }
.grid td.clinic, .grid td.didactics { background: var(--notewash); border-color: var(--noteline); }
.grid td.service, .grid td.duty { background: var(--wash); border-color: var(--line); }
.grid td.off { background: transparent; color: var(--faint); }
.grid td.ok { background: var(--okwash); border-color: var(--okline); }
.grid td.warn, .grid td.bad { background: var(--alertwash); border-color: var(--alertline); }
.grid td.none { background: transparent; border-style: dashed; color: var(--faint); }
.grid caption { caption-side: bottom; text-align: left; font-size: 11.5px; color: var(--soft); padding-top: 4px; }
.cellpop { display: flex; gap: var(--s1); flex-wrap: wrap; }
.ctxtable { margin: 10px 0; }
.ctxtable .cap { font-weight: 700; margin: var(--s2) 0 3px; font-size: 13px; }
.ctxtable table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.ctxtable th, .ctxtable td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
.ctxtable th { color: var(--soft); font-weight: 650; font-size: 11.5px; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--soft); }

/* ----------------------------------------------------------------- files -- */
.sheet { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); }
.sheet table { border-collapse: collapse; font-size: 12px; }
.sheet td { border: 1px solid var(--line-2); padding: 5px 9px; white-space: nowrap; }
.sheet tr:first-child td { background: var(--sunken); font-weight: 700; position: sticky; top: 0; }
.frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); }

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 1080px) {
  .side-by { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .workspace .rail { display: none; }
}
@media (max-width: 860px) {
  header.top { padding: 0 14px; gap: var(--s3); }
  header.top .ctx, header.top .srch { display: none; }
  .side { padding: 8px 12px; }
  .side a.nav { padding: 7px 11px; }
  .wrap, .page { padding: 20px 16px 80px; }
  .split, .metrics, .review, .workspace, .tiles { grid-template-columns: 1fr; }
  .metrics > .metric:nth-child(odd) { border-right: 0; }
  .metrics > .metric:nth-child(2) { border-top: 1px solid var(--line-2); }
  .steps .names { display: none; }
  .dock .in { padding: 10px 16px; }
  .rail, .toolbar, .summary { position: static; max-height: none; }
}


/* ----------------------------------------------------------------- print -- */
@media print {
  .no-print, header.top, .side, .toolbar, .rail, .dock, .acts, .addrule, .iconbtn,
  .seg, .filters, .backdrop, .toast, .btn, details.prov summary { display: none !important; }
  body, body.plain { background: #fff; display: block; padding: 0; }
  .shell { display: block; } .wrap, .page { max-width: none; padding: 0; }
  .card, .tcard, .card-wide, .card-narrow { border: 0; padding: 0; box-shadow: none; }
  .rule { break-inside: avoid; border-color: #ddd; box-shadow: none; }
}
.chips { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

/* ------------------------------------------------- the rules, as a list -- */
/* The Hub's shape: a section with a count, one line per rule, and the actions
   inside the line you opened. Rows, not cards, so a hundred rules is a page
   you scan rather than a mile you scroll. */
.rules-sec { margin: 0 0 var(--s6); }
.rules-sec .secname { font-size: 19px; font-weight: 750; margin: 0 0 var(--s1); }
.scgrp { margin: 0 0 var(--s4); }
.scsec {
  display: flex; align-items: baseline; gap: var(--s2); padding: var(--s3) 0 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.scsec .scn { font-family: var(--mono); letter-spacing: 0; font-size: 11px; color: var(--faint); }
.scrow { border-bottom: 1px solid var(--line-2); background: var(--card); }
.scrow:first-of-type { border-top: 0; }
.scgrp .scrow:last-of-type { border-bottom: 1px solid var(--line); }
.scrow.open { background: var(--card); box-shadow: var(--lift); border-radius: var(--r-ctl); border-bottom-color: transparent; margin: 6px 0; }
.scmain {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 18px; align-items: start; gap: var(--s3);
  width: 100%; text-align: left; padding: 12px 14px; background: none; border: 0; cursor: pointer; font: inherit;
}
.scmain:hover { background: var(--sunken); }
.scrow.open .scmain:hover { background: none; }
.scid { font-family: var(--mono); font-size: 11.5px; color: var(--faint); padding-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scstmt { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.scstmt pre { background: var(--sunken); border-radius: var(--r-xs); padding: 8px 10px; margin: 6px 0 0; font-size: 12px; }
.scsev { display: block; margin-top: 3px; font-size: 12px; color: var(--soft); font-weight: 500; }
.scstate { font-size: 12px; font-weight: 650; color: var(--soft); white-space: nowrap; padding-top: 2px; }
.scstate.confirmed { color: var(--ok); }
.scstate.question { color: var(--note); }
.scstate.removed { color: var(--alert); }
.scchev { color: var(--faint); display: grid; place-items: center; padding-top: 2px; }
.scchev svg { width: 15px; height: 15px; transition: transform .14s; }
.scrow.open .scchev svg { transform: rotate(180deg); }
.scrow.confirmed .scid { color: var(--ok); }
.scrow.removed .scstmt { text-decoration: line-through; color: var(--soft); }
.scbody { padding: 2px 14px 14px 90px; }
.scbody .grid { margin: 0 0 var(--s3); }
.scwas { font-size: 12.5px; color: var(--soft); margin: 0 0 var(--s2); }
.scwas b { color: var(--soft); font-weight: 700; margin-right: 5px; }
.scacts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.scacts .right { margin-left: auto; }
.scnotes { display: flex; flex-direction: column; gap: 9px; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-2); }
@media (max-width: 700px) {
  .scmain { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
  .scid { display: none; } .scchev { display: none; }
  .scbody { padding-left: 14px; }
}

/* the schedule, rendered where it is read */
.verpick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 var(--s3); }
.sheetwrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--lift); }
.sheetwrap .sheet { border: 0; border-radius: 0; max-height: 68vh; }
.sheetwrap .tabs { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--card); }
.sheetwrap .frame { border: 0; border-radius: 0; }
.sheetwrap .foot { display: flex; align-items: center; gap: var(--s2); padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ------------------------------------------------- the workbook, as a grid -- */
/* The .xlsx itself: column letters, row numbers, merged cells, the author's
   widths, and the sheet tabs along the bottom where a spreadsheet keeps them. */
.xlsx { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--lift); display: flex; flex-direction: column; }
.xl-bar { display: flex; align-items: center; gap: var(--s3); padding: 9px 14px;
  border-bottom: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.xl-bar .xl-name { font-weight: 700; font-size: 13px; color: var(--ink);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xl-bar .xl-dim { font-size: 12px; color: var(--faint); font-family: var(--mono); }
/* the one action that belongs to the file sits with the file, in its own bar */
.xl-acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.xl-acts + .xl-zoom { margin-left: var(--s3); }
.xl-zoom { margin-left: auto; display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; flex: none; }
.xl-zoom .iconbtn { width: 26px; height: 26px; font-size: 15px; line-height: 1; font-weight: 700; }
.xl-load { padding: var(--s7) var(--s5); text-align: center; color: var(--soft); font-size: 13.5px; }
.xl-grid { overflow: auto; max-height: 70vh; background: var(--card); }
.xl-grid table { border-collapse: separate; border-spacing: 0; font-family: var(--font); font-variant-numeric: tabular-nums; }
/* The faint gridlines are ours, drawn only where the author drew none; any
   border they did set arrives as an inline style on that side and wins. Same
   for fills, weight, colour and alignment — the sheet decides, not the theme. */
.xl-grid th, .xl-grid td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: bottom; line-height: 1.35; }
.xl-grid td { color: var(--body); background: var(--card); }
.xl-grid td a { color: inherit; text-decoration: underline; }
/* gridlines and headings off: the sheet alone, the way print preview shows it */
.xl-grid.bare th, .xl-grid.bare td { border-right: 0; border-bottom: 0; }
/* the frames: column letters along the top, row numbers down the side, both
   pinned so a wide block schedule stays readable when you scroll into it */
.xl-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--sunken); color: var(--soft);
  font-size: 10.5px; font-weight: 700; text-align: center; letter-spacing: .04em; min-width: 64px; padding: 4px 6px; }
.xl-grid th.xl-row { position: sticky; left: 0; z-index: 1; background: var(--sunken); color: var(--soft);
  font-size: 10.5px; font-weight: 700; text-align: center; min-width: 42px; width: 42px; }
.xl-grid th.xl-corner { position: sticky; left: 0; top: 0; z-index: 3; background: var(--sunken); min-width: 42px; width: 42px; }
/* no hover tint on the cells: a fill means something here, and washing it over
   to show which row the pointer is on would be a lie about the schedule */
.xl-grid tbody tr:hover th.xl-row { background: var(--wash); color: var(--ink); }
.xl-zoom .iconbtn.on { background: var(--ink); color: #fff; }
.xl-more { padding: 10px 14px; margin: 0; font-size: 12px; color: var(--soft); border-top: 1px solid var(--line-2); }
.xl-tabs { display: flex; gap: 2px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--sunken); overflow-x: auto; }
.xl-tabs button { border: 1px solid transparent; background: transparent; border-radius: var(--r-xs) var(--r-xs) 0 0;
  padding: 6px 14px; font-size: 12.5px; font-weight: 650; color: var(--soft); cursor: pointer; white-space: nowrap; }
.xl-tabs button:hover { color: var(--ink); }
.xl-tabs button.on { background: var(--card); border-color: var(--line); border-bottom-color: var(--card); color: var(--ink); }

/* -------------------------------------------------------------- the picker -- */
/* Year, then schedule, then version. Three rows of pills, each only drawn when
   there is a choice to make. */
.picker { display: flex; flex-direction: column; gap: var(--s2); margin: 0 0 var(--s4); }
.pick-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.pick-row .lab { min-width: 62px; }
.list .li .ic.message { background: var(--notewash); color: var(--note); }

/* ------------------------------------------- a note about the whole card -- */
/* One line under the filters. Closed it is quiet and still says what is in it;
   open it is the thread, in place, with the box focused. */
.wholenote { border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); margin: 0 0 var(--s4); overflow: hidden; }
.wholenote.open { box-shadow: var(--lift); }
.wn-bar { display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left;
  padding: 11px 14px; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
.wn-bar:hover { background: var(--sunken); }
.wholenote.open .wn-bar { border-bottom: 1px solid var(--line-2); }
.wholenote.open .wn-bar:hover { background: none; }
.wn-bar .ic { width: 28px; height: 28px; border-radius: var(--r-sm); flex: none; display: grid; place-items: center;
  background: var(--sunken); color: var(--soft); }
.wn-bar .ic svg { width: 15px; height: 15px; }
.wn-bar b { font-size: 13.5px; font-weight: 700; color: var(--ink); display: block; }
.wn-bar .sub { font-size: 12.5px; display: block; margin-top: 1px; }
.wn-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--note); flex: none; }
.wn-bar .chev { color: var(--faint); display: grid; place-items: center; }
.wn-bar .chev svg { width: 15px; height: 15px; transition: transform .14s; }
.wholenote.open .wn-bar .chev svg { transform: rotate(180deg); }
.wn-body { padding: var(--s3) 14px 14px; display: flex; flex-direction: column; gap: var(--s3); }
.list button.li.fold { background: none; border: 0; border-top: 1px solid var(--line-2); width: 100%;
  text-align: left; cursor: pointer; font: inherit; color: inherit; }
.list button.li.fold:first-child { border-top: 0; }
.list button.li.fold:hover { background: var(--sunken); }
.list button.li.fold.on { background: var(--wash); }
.list button.li.fold.on .t { color: var(--ink); font-weight: 750; }
.drop.slim { padding: var(--s4) 20px; }
.drop.slim .ic { width: 32px; height: 32px; margin: 0; }
.drop.slim .ic svg { width: 16px; height: 16px; }
.drop.slim b { font-size: 14.5px; }
.pick-row > .btn.ghost { margin-left: auto; }
.wn-do { font-size: 12.5px; font-weight: 700; color: var(--soft); }
.wn-bar:hover .wn-do { color: var(--ink); }
.filters button.newf { color: var(--faint); border-left: 1px solid var(--line); border-radius: 0; margin-left: 2px; padding-left: 12px; }
.filters button.newf:hover { color: var(--ink); background: none; }
.filters button.newf svg { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
/* the three doors: a tile is a door, so it is short and it is pressable */
.tiles .tile { min-height: 124px; gap: 8px; }
.tiles .tile b { font-size: 16px; }
.tiles .tile .ic { width: 42px; height: 42px; margin: 0; }
.tiles .tile .ic svg { width: 20px; height: 20px; }
.askpref { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4);
  font-size: 14px; font-weight: 600; color: var(--ink); }
.askpref .sub { font-weight: 400; }
.turnset { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: var(--s2); }
.turnset .lab { min-width: 96px; }
.schip.warn { color: var(--alert); border-color: var(--alertline); background: var(--alertwash); text-decoration: none; }
.schip.warn:hover { text-decoration: none; border-color: var(--alert); }

/* ------------------------------------------------- a judgment someone made */
/* Written by a person, so it reads as a field you can fill, not as a verdict
   the page is handing down. Empty says empty. */
/* one line, where it sits, with no label of its own */
button.nextstep{all:unset;cursor:text;display:block;width:100%;font-size:13px;line-height:1.5;
  color:var(--ink);padding:6px 10px;border-radius:var(--r-ctl);border:1px solid transparent;
  transition:background .14s,border-color .14s}
button.nextstep:hover{background:var(--sunken);border-color:var(--line)}
button.nextstep .faint{border-bottom:1px dotted var(--line-2);padding-bottom:1px}
.nextstep.on{display:flex;flex-direction:column;gap:8px}
.nextstep.on input{font-size:13px}

/* the board's two editable cells */
.stepcell{all:unset;cursor:text;display:block;width:100%;font-size:12.5px;line-height:1.45;
  color:var(--body);padding:3px 6px;margin:-3px -6px;border-radius:6px;transition:background .14s}
.stepcell:hover{background:var(--sunken)}
.turn.unset{background:transparent;border:1px dashed var(--line);color:var(--faint);cursor:pointer;
  text-transform:none;letter-spacing:0;font-weight:600;font-size:12px;padding:2px 10px}
.turn.unset::before{display:none}
.turn.unset:hover{border-color:var(--ink);color:var(--ink);border-style:solid}
details.menu>summary.turn{cursor:pointer;list-style:none}
details.menu>summary.turn::-webkit-details-marker{display:none}

/* one line in a dialog saying what the dialog does */
.note{margin:0;padding:10px 12px;border-radius:10px;background:var(--sunken);border:1px solid var(--line);
  font-size:12.5px;line-height:1.55;color:var(--body)}

/* A way to open a file that is not available yet. Listed, not hidden, with the
   reason underneath, so nobody concludes the product cannot do it. */
details.menu .pop .off{display:flex;flex-direction:column;gap:1px;padding:8px 10px;border-radius:var(--r-sm);
  font-size:13.5px;font-weight:500;color:var(--faint);cursor:default}
details.menu .pop .off small{font-size:11.5px;font-weight:500;color:var(--faint);opacity:.85}

/* a hint under a field is a hint, not another label: the label's weight and
   colour are inherited by anything inside it, which made these read as shouting */
.form label > .sub, label.field > .sub { font-weight: 500; color: var(--faint); line-height: 1.45; }

/* ------------------------------------------------------------ the way in -- */
/* The two things a coordinator asks for, said in the order you would say them
   down a phone. Big enough to read out without squinting. */
.wayin .bd{display:flex;gap:var(--s5);flex-wrap:wrap}
.wayin .wi{min-width:0}
.wayin .wi:first-child{flex:2 1 360px}
.wayin .wi:last-child{flex:1 1 230px}
.wayin .copybox input{font-family:var(--mono);font-size:12.5px}
.wayin .wi .k{font-size:12.5px;font-weight:700;color:var(--soft);margin-bottom:6px}
.wayin .wi .k small{display:block;font-size:11.5px;font-weight:500;color:var(--faint);margin-top:2px}
.wayin .wi .row{flex-wrap:wrap}
.bigcode{font-family:var(--mono);font-size:19px;font-weight:700;letter-spacing:.08em;color:var(--ink);
  background:var(--sunken);border:1px solid var(--line);border-radius:var(--r-ctl);padding:7px 14px;
  user-select:all;white-space:nowrap}
/* An access code is four groups and fits anywhere. A two-factor setup key is
   eight, and nowrap quietly cut the last one off — which somebody copying it
   by eye would not notice until the codes never matched. It wraps, and the
   groups stay whole. */
.bigcode.wrap { white-space: normal; word-spacing: .35em; line-height: 1.7;
  font-size: 17px; overflow-wrap: break-word; }

/* the same two things on the clients list, one click to copy either */
.wayin-cell{display:flex;flex-direction:column;gap:3px;align-items:flex-start}
.wayin-cell button{border:0;background:none;padding:1px 4px;margin-left:-4px;border-radius:5px;cursor:pointer;
  font-size:12px;color:var(--soft);transition:background .14s,color .14s;
  display:inline-flex;align-items:center;gap:4px;max-width:200px;white-space:nowrap}
.wayin-cell .addr{overflow:hidden;text-overflow:ellipsis}
.wayin-cell .addr svg{flex:none;width:13px;height:13px;opacity:.6}
.wayin-cell button:hover{background:var(--sunken);color:var(--ink)}
.wayin-cell .code{font-family:var(--mono);font-weight:700;letter-spacing:.05em;color:var(--ink)}

/* ------------------------------------------------- files, at every width -- */
/* Wide: one row of actions that never wraps, in a column that takes exactly
   the width it needs. Narrow: the table stops being a table, because five
   columns in 380px is not a layout, it is a squeeze. */
.rowacts { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.table.files td:last-child, .table.files th:last-child { white-space: nowrap; width: 1px; }
/* The name takes what is left after the columns that have a fixed shape. A
   percentage here pushed the action buttons off the right edge of the card at
   every width narrower than a desktop. */
.table.files { width: 100%; table-layout: auto; }
.table.files td:first-child, .table.files th:first-child { min-width: 150px; }
.table.files td:nth-child(2) { min-width: 92px; }
.table.files td:nth-child(3), .table.files td:nth-child(4),
.table.files th:nth-child(3), .table.files th:nth-child(4) { white-space: nowrap; width: 1px; }
.table.files td:nth-child(4) { font-size: 12px; }

/* The ⋯ popover is anchored to the right edge of a cell at the right edge of
   the page, so it opens leftwards and never wider than the window. */
details.menu .pop { max-width: min(280px, calc(100vw - 32px)); }
.rowacts details.menu .pop { right: 0; left: auto; }

/* a filename you can change where you read it */
.rename { all: unset; cursor: text; font-weight: 700; color: var(--ink); border-radius: 5px;
  padding: 2px 5px; margin: -2px -5px; transition: background .14s; word-break: break-word; }
.rename:hover { background: var(--sunken); }
.renaming { font-weight: 600; padding: 4px 8px; }

/* one dropdown where a row of pills would run off the page */
.pickone { width: auto; min-width: 240px; max-width: 100%; padding: 7px 12px;
  font-weight: 600; font-size: 13px; }

/* the file types that are not spreadsheets */
.imgview { max-width: 100%; height: auto; border-radius: var(--r-sm); }
.docview { line-height: 1.6; font-size: 14.5px; color: var(--body); }
.docview p { margin: 0 0 10px; }
.docview .dh { font-weight: 800; color: var(--ink); margin: 18px 0 6px; }
.docview .dh:first-child { margin-top: 0; }
.docview .h1 { font-size: 20px; } .docview .h2 { font-size: 17px; }
.docview .h3 { font-size: 15px; } .docview .h4 { font-size: 14px; }
.docview .dli { margin: 0 0 6px 18px; position: relative; }
.docview .dli::before { content: "\2022"; position: absolute; left: -14px; color: var(--faint); }
.dtable { border-collapse: collapse; width: 100%; margin: 10px 0 14px; font-size: 13.5px; }
.dtable th, .dtable td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.dtable th { background: var(--sunken); font-weight: 700; color: var(--ink); }

@media (max-width: 820px) {
  .table.files, .table.files tbody, .table.files tr, .table.files td { display: block; width: auto; }
  .table.files thead { display: none; }
  .table.files tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .table.files tr:last-child { border-bottom: 0; }
  .table.files td { border: 0; padding: 0; }
  .table.files td:first-child { min-width: 0; }
  /* folder, size and date read as one quiet line under the name */
  .table.files td:nth-child(2), .table.files td:nth-child(3), .table.files td:nth-child(4) {
    display: inline; font-size: 12px; color: var(--soft); }
  .table.files td:nth-child(2)::after, .table.files td:nth-child(3)::after { content: " \00b7 "; }
  .table.files td:last-child { display: block; margin-top: 10px; width: auto; white-space: normal; }
  .rowacts { justify-content: flex-start; flex-wrap: wrap; }
  /* the extra menu sits at the far end, so when it wraps it reads as the end
     of the row rather than a stray mark under it */
  .rowacts > details.menu { margin-left: auto; }
}

/* ---------------------------------------------------- the smaller signals -- */
/* A pencil that appears on hover: the name is editable, and nobody has to be
   told so in a sentence or go hunting in a menu for it. The menu has Rename
   too, because hover is not a thing on a phone. */
.rename .pen { opacity: 0; margin-left: 4px; vertical-align: -2px; color: var(--faint); }
.rename .pen svg { width: 13px; height: 13px; }
.rename:hover .pen, .rename:focus-visible .pen { opacity: 1; }

/* "yours" as a grey chip read like a status nobody set. The folder a program
   actually uses is the one thing worth seeing here, so it gets the row. */
.folderrow.theirs { background: var(--sunken); }
.folderrow.theirs .ic { background: var(--ink); color: #fff; }
.folderrow .tag { margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: var(--soft); text-transform: uppercase; white-space: nowrap; }
@media (max-width: 520px) { .folderrow .tag { display: block; margin: 2px 0 0; } }
.folderrow .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* --------------------------------------------------------- one story, once -- */
/* Audit, messages, stage moves and uploads all answer "what happened". Five
   panels meant reading all five and sorting them in your head. */
.tl .li { align-items: flex-start; }
.tl .t { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.45; }
.tl .did { font-weight: 400; color: var(--body); }
.tl .t-said .did { color: var(--ink); }
.tl .t-said { background: var(--sunken); }
.tl .t-stage .did { font-weight: 600; }

/* ------------------------------------------------ one row, or all of them -- */
/* The global "More" widens every row; the caret opens one. Both exist because
   scanning ten clients and reading one are different jobs. */
.caret { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; color: var(--faint); flex: none;
  transition: background .14s, color .14s; }
.caret:hover { background: var(--wash); color: var(--ink); }
.caret svg { width: 15px; height: 15px; }
.board tr.open > td { border-bottom: 0; }
.board tr.detail > td { background: var(--sunken); padding-top: 4px; padding-bottom: 14px; }
.kv.tight { gap: 4px var(--s3); font-size: 12.5px; }
.kv.tight .k { font-size: 11.5px; }

/* ---------------------------------------------------------------- drafting -- */
/* A draft has to announce itself. A page that is not the one your client sees,
   with nothing on screen saying so, is how somebody promises a program
   director a schedule that was never published. */
.draftbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--s3);
  padding: 9px 20px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; }
.draftbar .tag { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.18); padding: 3px 9px; border-radius: 999px; }
.draftbar .btn { background: #fff; color: var(--ink); border-color: #fff; flex: none; }
.draftbar .btn:hover { background: var(--wash); }
.top.drafting { border-bottom-color: var(--ink); }
@media (max-width: 720px) { .draftbar { flex-wrap: wrap; padding: 9px 16px; } }

/* ------------------------------------------------- what we build, by group -- */
/* One row per audience, with the kinds as toggles. A row of (who, kind) pairs
   made you say "Resident" four times to build four resident schedules. */
.audience { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); margin-bottom: 8px;
  background: var(--card); flex-wrap: wrap; }
.audience.some { border-color: var(--ink); }
.audience .who { font-weight: 700; font-size: 13px; color: var(--ink); min-width: 128px; }
.audience .filters { gap: 4px; }
.audience .filters button { padding: 5px 11px; font-size: 12.5px; }

/* --------------------------------------------------------------- getting in -- */
/* The link is long and nobody reads it; they copy it. So the button is the
   control and the address is not on screen at all. */
.getin { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.getin .k { font-size: 11.5px; font-weight: 700; color: var(--soft); min-width: 46px;
  text-transform: uppercase; letter-spacing: .04em; }
code.code { font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .06em;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 5px 10px; user-select: all; cursor: pointer; white-space: nowrap;
  transition: border-color .14s; }
code.code:hover { border-color: var(--ink); }

/* One line of state above the two streams. Three controls, no headings: a
   label over every control said less than the controls themselves, and
   "Next step" appeared twice because the field already carries its own. */
.statusbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--lift); }
.statusbar .seg button { padding: 5px 11px; font-size: 12px; }
.statusbar .stage.pick { cursor: pointer; list-style: none; display: inline-flex; align-items: center;
  gap: 5px; }
.statusbar .stage.pick::-webkit-details-marker { display: none; }
.statusbar .stage.pick svg { width: 13px; height: 13px; opacity: .6; }
.statusbar > .grow { min-width: 220px; }

/* a secondary heading inside a card that already has one */
.sub-hd { padding-top: 10px; padding-bottom: 8px; border-top: 1px solid var(--line-2); border-bottom: 0; }
.sub-hd .lab { flex: 1; }

/* everything that is true but not often needed, folded away */
details.quiet > summary { cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 650;
  color: var(--soft); padding: 8px 2px; }
details.quiet > summary::-webkit-details-marker { display: none; }
details.quiet > summary::before { content: "▸ "; color: var(--faint); }
details.quiet[open] > summary::before { content: "▾ "; }
details.quiet > summary:hover { color: var(--ink); }

/* a count beside a tab label needs air, not to run into the word */
.ftabs button .n, .seg button .n { margin-left: 6px; }

/* ------------------------------------------------------------- one toggle -- */
/* Two choices, centred, one visibly chosen. A row of left-aligned bordered
   rectangles reads as two buttons you could press at once; a single pill with
   one half filled reads as a switch, which is what it is. */
.streamhd { display: flex; justify-content: center; padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line); }
.toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken);
  border: 1px solid var(--line); border-radius: 999px; }
.toggle button { border: 0; background: transparent; cursor: pointer; border-radius: 999px;
  padding: 7px 18px; font-size: 13px; font-weight: 650; color: var(--soft);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: background .16s, color .16s, box-shadow .16s; }
.toggle button:hover { color: var(--ink); }
.toggle button .n { font-size: 11px; font-weight: 700; color: var(--faint);
  background: transparent; padding: 0; margin: 0; }
.toggle button.on { background: var(--card); color: var(--ink); box-shadow: var(--lift); }
.toggle button.on .n { color: var(--soft); }
@media (max-width: 560px) { .toggle button { padding: 7px 12px; font-size: 12.5px; } }

/* one of us, and the three ways a client reaches them */
.person { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); }
.person .who { font-weight: 700; font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.person .field { gap: 4px; }

/* ------------------------------------------------- narrow screens -- */
/* Last in the file on purpose: these are overrides, and a rule that loses
   to the base rule it is meant to override is not an override. */

/* The backstop. Any one long word, link, filename or code can push a whole
   page sideways, and a horizontally scrolling page is the thing that makes an
   interface feel broken on a phone. Spreadsheets and wide tables scroll inside
   their own box; the page itself never does. */
html, body { overflow-x: hidden; }
/* A segmented control beside a card title is fine until the title plus the
   control is wider than a phone. Then the control takes its own line rather
   than hanging off the edge. */
.card > .hd > .right { margin-left: auto; }
/* Two things on one line stop being two things on one line when the line is a
   phone wide: a 90px column of wrapped words is not a sentence anyone reads,
   and a filename squeezed beside two buttons is not a filename. */
@media (max-width: 480px) {
  .row.approvebar > .sub.grow { flex: 1 1 100%; }
  /* a sentence squeezed to a third of a phone is a column of fragments, so what
     sat beside it drops below it. Two columns rather than a wrapping row, so the
     icon stays next to the title it labels instead of stranded on a line alone. */
  .list .li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s3); align-items: start; }
  .list .li > .ic, .list .li > .av { grid-column: 1; grid-row: 1; }
  .list .li > * { grid-column: 2; }
  .list .li > .btn, .list .li > a.btn { justify-self: start; margin-top: 8px; }
  .row.filerow > .grow { flex: 1 1 100%; overflow-wrap: anywhere; }
  /* the composer's example is four lines at this width, so give it four */
  .reply { flex-wrap: wrap; }
  .reply textarea { flex: 1 1 100%; min-height: 72px; }
  .reply > .btn { margin-left: auto; }
}
@media (max-width: 480px) {
  .card > .hd > .right { margin-left: 0; width: 100%; }
  .card > .hd > .right.row { flex-wrap: wrap; }
  .seg { max-width: 100%; }
  .seg button { flex: 1 1 auto; }
}
/* Below this the question and the answer cannot share a line, and the control
   is self-explanatory under a card called "Your shared folder". */
@media (max-width: 400px) {
  .card > .hd > .right.row > .sub { display: none; }
  .card > .hd > .right.row > .seg { flex: 1 1 100%; }
  .seg button { white-space: nowrap; }
}
/* Three options in a pill is wider than a small phone. The control wraps to
   two rows and loses its pill shape rather than clipping the third option,
   because a choice you cannot see is not a choice. */
@media (max-width: 440px) {
  .pick-row .seg { flex-wrap: wrap; border-radius: var(--r-ctl); width: 100%; }
  .pick-row .seg button { flex: 1 1 auto; border-radius: var(--r-sm); }
}
.page, .wrap, .card, .metric, .li, .kv { min-width: 0; }
.kv > span, .li .t, .li .s, .note-to, .alert { overflow-wrap: anywhere; }

/* Five columns of account detail do not fit a narrow window, and an account
   list is read top to bottom anyway. Below this width each person is a block:
   name, address, whether two-factor is on, when they last signed in, then
   what you can do about it. The breakpoint moved out from 700 when two-factor
   became a column — five columns need more room than four, which is obvious
   and was still worth being told by a measurement. */
@media (max-width: 860px) {
  .table.team, .table.team tbody, .table.team tr, .table.team td { display: block; width: auto; }
  .table.team thead { display: none; }
  .table.team tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .table.team tr:last-child { border-bottom: 0; }
  .table.team td { border: 0; padding: 0; }
  .table.team td:nth-child(2) { color: var(--soft); font-size: 12.5px; overflow-wrap: anywhere; }
  /* Stacked, a cell loses the column heading that said what it was, and
     "off" on a line of its own under somebody's name means nothing. The two
     that are not self-evident say so. */
  .table.team td:nth-child(3),
  .table.team td:nth-child(4) { font-size: 12.5px; margin-top: 6px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .table.team td:nth-child(3)::before { content: "Two-factor"; }
  .table.team td:nth-child(4)::before { content: "Last sign-in"; }
  .table.team td:nth-child(3)::before,
  .table.team td:nth-child(4)::before {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--soft); font-weight: 700; flex: none; min-width: 86px; }
  .table.team td:last-child { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
}

/* On a phone the header has four things competing for 360px. The brand and the
   way out both have to stay, so the name goes: the avatar already says who you
   are, and nobody signed in needs telling their own name. */
@media (max-width: 560px) {
  header.top { padding: 0 12px; gap: var(--s2); }
  header.top .r > span { display: none; }
  header.top .lockup { font-size: 14px; }
  .pagehead { flex-direction: column; align-items: flex-start; gap: var(--s3); }
  .pagehead .acts { width: 100%; flex-wrap: wrap; }
  /* a label beside its pills costs a third of the width, so it goes above */
  .pick-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .pick-row .lab { min-width: 0; }
  /* in a column, margin-left:auto no longer pushes right, it centres */
  .pick-row > .btn.ghost { margin-left: 0; align-self: flex-start; }
  .pick-row > .filters, .pick-row > .seg { align-self: stretch; }
  .statusbar { flex-direction: column; align-items: flex-start; gap: var(--s3); }
  .statusbar > .grow { min-width: 0; width: 100%; }
  .getin { gap: 6px; }
  .bigcode { font-size: 16px; }
  h1, h1.display { font-size: 26px; }
}

/* A board is for scanning; acting on a row is what the caret is for. Below
   this width the two editable columns move into the expander rather than
   squeezing five columns into a phone and cutting the last one off. */
.narrow-only, .quiet-only { display: none; }
/* Narrower still, and the client's own name is down to one word a line while
   two numbers sit beside it. The quiet-for column goes into the expander with
   the others; the name is the thing you came to read. */
@media (max-width: 480px) {
  .board thead th:last-child,
  .board tbody tr:not(.detail) td:last-child { display: none; }
  .kv.tight > .quiet-only { display: block; }
  .board td:first-child b { overflow-wrap: anywhere; }
}
@media (max-width: 760px) {
  .board thead th:nth-child(3), .board tbody td:nth-child(3),
  .board thead th:nth-child(4), .board tbody td:nth-child(4) { display: none; }
  .board tr.detail > td { display: table-cell; }
  .kv.tight > .narrow-only { display: block; }
  .board td:first-child { min-width: 0; }
  .board .sub.tiny { white-space: normal; }
}

/* A switch, for the one setting a client changes about their own page. A
   checkbox would do the job and look like a form; this is one decision in a
   card about where their files live, so it reads as a preference. */
.switchrow { border-top: 1px solid var(--line-2); }
.switch { display: flex; align-items: flex-start; gap: var(--s3); cursor: pointer; }
.switch > input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  flex: none; width: 40px; height: 23px; margin-top: 1px; border-radius: 999px;
  background: var(--line); transition: background .16s ease; position: relative;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .16s ease;
}
.switch > input:checked + .track { background: var(--ink); }
.switch > input:checked + .track .knob { transform: translateX(17px); }
.switch > input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch-text { display: block; font-size: 13.5px; min-width: 0; }
.switch-text .sub { display: block; font-size: 12.5px; margin-top: 1px; }

/* A field's label and whatever qualifies it — "optional", a count, a hint —
   on one line. `label.field` is a column, so anything after the label text
   became a row of its own and pushed that field's input a line below its
   neighbour's. Two fields side by side stopped lining up for want of this. */
.field > .labrow { display: flex; align-items: baseline; gap: 6px; min-height: 16px; }
.field > .labrow > .sub { font-weight: 500; }

/* A short list of plain statements — why something is refused, what will be
   removed. Bullets, because each line is its own fact. */
.plainlist { margin: var(--s2) 0 0; padding-left: 18px; font-size: 13.5px; color: var(--body); }
.plainlist li { margin: 3px 0; }

/* Anything that acts like a link should look like one under the pointer. The
   rule only covered whole rows, so a board row whose cells carry the click
   showed an I-beam everywhere except the caret — which reads as "this text is
   selectable", the opposite of "this opens the client". */
.click, td.click, .table tr.click, .board tr.click { cursor: pointer; }
.board tr.click:hover, .table tr.click:hover { background: var(--sunken); }

/* Continue with Google. The mark keeps its own colours — it is Google's, and
   a recoloured one is the thing phishing pages get wrong. */
.btn.google { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  font-weight: 700; }
.btn.google:hover { background: var(--sunken); border-color: var(--ink); }
.btn.google svg { flex: none; }
/* The password form, kept for the day Google is unavailable and out of the
   way every other day. */
.breakglass { margin-top: var(--s4); }
.breakglass > summary { cursor: pointer; font-size: 12.5px; color: var(--soft); }
.breakglass[open] > summary { margin-bottom: var(--s2); }

/* ------------------------------------------------------------- the landing --
   The bare domain. Nobody arrives here on their way to somewhere — a client
   opens the long address they were sent, and we open /admin — so it owes a
   visitor two things: proof they are in the right place, and a way on. Said
   in as few words as that takes. */
.landing { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s3); min-height: 62vh; text-align: center; padding: var(--s4) 16px; }
.landing .mark {
  width: 56px; height: 56px; border-radius: 17px; background: var(--ink);
  position: relative; box-shadow: var(--lift);
}
.landing .mark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 17px; height: 17px; border-radius: 50%; background: var(--canvas);
}
.landing h1 { font-size: 27px; letter-spacing: -.02em; margin: 0; }
.landing p { color: var(--soft); font-size: 15px; margin: -6px 0 0; }
.landing .quietlink {
  margin-top: var(--s3); font-size: 12.5px; color: var(--faint);
  text-decoration: none; padding: 6px 14px; border-radius: 999px;
  border: 1px solid transparent; transition: color .14s ease, border-color .14s ease;
}
.landing .quietlink:hover { color: var(--ink); border-color: var(--line); }

/* A field the form is still waiting on. Not an error — nothing has gone
   wrong yet — so it is a hint in the margin rather than red text under a box
   somebody has not reached. */
input.wanted, select.wanted { border-color: var(--line); box-shadow: inset 3px 0 0 var(--alert); }
input.wanted:focus, select.wanted:focus { box-shadow: inset 3px 0 0 var(--alert), var(--ring); }

/* ------------------------------------------------------------------ access --
   The link and the code are two different things, used at two different
   moments: one is pasted into an email, the other is read out over the phone.
   They were sharing one crowded line, which made neither of them findable. */
.bd.access { display: flex; flex-direction: column; gap: var(--s3); }
.accessrow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.accessrow > .lab { min-width: 92px; flex: none; }
.accessrow > .addr {
  flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 12px;
  color: var(--soft); background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) {
  .accessrow { gap: 6px; }
  .accessrow > .lab { min-width: 0; flex: 1 1 100%; }
  .accessrow > .addr { flex: 1 1 100%; }
}

/* The thread, on our side. It is the same conversation the client reads on
   their own page, and nothing about a box with a Send button beside it said
   so — which left somebody wondering whether this was a note to ourselves. */
.bd.talkbox { display: flex; flex-direction: column; gap: var(--s3); }
.bd.talkbox .reply { display: flex; flex-direction: column; gap: var(--s2); align-items: stretch; }
.bd.talkbox .reply textarea { width: 100%; min-height: 76px; }
.bd.talkbox .reply > .row { align-items: center; }
