/* Signal Desk design system.
   One type family, one accent, cards on a cool canvas. Tokens first, then the
   app shell, then shared components. View files only compose what is here. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Surfaces and ink */
  --canvas: #f3f4f7;
  --surface: #ffffff;
  --sunken: #f5f6f8;
  --ink: #12141a;
  --ink-2: #474d5c;
  --ink-3: #666c7c;
  --line: rgb(18 20 26 / 0.08);
  --line-strong: rgb(18 20 26 / 0.16);

  /* Accent and meaning. Fill is for backgrounds, ink is for text on light. */
  --primary: #d62b56;
  --primary-ink: #bd1f48;
  --primary-wash: #fcebef;
  --on-primary: #ffffff;
  --violet: #5b3fd6;
  --violet-wash: #eeeafb;
  --amber: #f0a020;
  --amber-ink: #99560a;
  --amber-wash: #fdf1d9;
  --green: #1fa85a;
  --green-ink: #137a3f;
  --green-wash: #e2f5ea;
  --red-ink: #b42318;
  --red-wash: #fdecea;

  /* Depth. Shadows carry elevation, hairlines only separate. */
  --elev-1: 0 0 0 1px rgb(18 20 26 / 0.05), 0 1px 2px rgb(18 20 26 / 0.04), 0 4px 12px -4px rgb(18 20 26 / 0.06);
  --elev-2: 0 0 0 1px rgb(18 20 26 / 0.08), 0 1px 3px rgb(18 20 26 / 0.06), 0 6px 16px -4px rgb(18 20 26 / 0.1);
  --elev-pop: 0 0 0 1px rgb(18 20 26 / 0.06), 0 10px 30px -8px rgb(18 20 26 / 0.22);
  --ring: 0 0 0 1px rgb(18 20 26 / 0.12);
  --hair: 1px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --gutter: 32px;
  --side: 264px;

  /* Motion tokens, from the transitions.dev scale. */
  --duration-stagger: 40ms;
  --duration-micro: 80ms;
  --duration-quick: 150ms;
  --duration-fast: 250ms;
  --duration-medium: 350ms;
  --duration-slow: 400ms;
  --duration-very-slow: 500ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: ease-in-out;
  --ease-out: ease-out;
  --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);
  --distance-micro: 4px;
  --distance-base: 8px;
  --distance-medium: 12px;
  --scale-small: 0.98;
  --blur-small: 2px;
  --blur-medium: 3px;

  /* Sliding tabs */
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media only screen and (min-resolution: 192dpi) { :root { --hair: 0.5px; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0c0d10;
    --surface: #15171c;
    --sunken: #1c1f26;
    --ink: #eef0f4;
    --ink-2: #b6bbc7;
    --ink-3: #9197a5;
    --line: #23262e;
    --line-strong: #353944;
    --primary: #dc4a70;
    --primary-ink: #f58ba6;
    --primary-wash: #36141f;
    --violet: #9a86f0;
    --violet-wash: #221c40;
    --amber: #e8a53a;
    --amber-ink: #ffd27a;
    --amber-wash: #4a3505;
    --green: #35b56c;
    --green-ink: #6fd69b;
    --green-wash: #11291b;
    --red-ink: #f59a90;
    --red-wash: #3a1613;
    --elev-1: 0 0 0 1px rgb(255 255 255 / 0.07);
    --elev-2: 0 0 0 1px rgb(255 255 255 / 0.13);
    --elev-pop: 0 0 0 1px rgb(255 255 255 / 0.12), 0 12px 32px -8px rgb(0 0 0 / 0.6);
    --ring: 0 0 0 1px rgb(255 255 255 / 0.14);
    --hair: 1px;
  }
}
/* Same values, for a forced theme: add ?theme=dark or ?theme=light to the URL. */
:root[data-theme="dark"] {
  --canvas: #0c0d10;
  --surface: #15171c;
  --sunken: #1c1f26;
  --ink: #eef0f4;
  --ink-2: #b6bbc7;
  --ink-3: #9197a5;
  --line: #23262e;
  --line-strong: #353944;
  --primary: #dc4a70;
  --primary-ink: #f58ba6;
  --primary-wash: #36141f;
  --violet: #9a86f0;
  --violet-wash: #221c40;
  --amber: #e8a53a;
  --amber-ink: #ffd27a;
  --amber-wash: #4a3505;
  --green: #35b56c;
  --green-ink: #6fd69b;
  --green-wash: #11291b;
  --red-ink: #f59a90;
  --red-wash: #3a1613;
  --elev-1: 0 0 0 1px rgb(255 255 255 / 0.07);
  --elev-2: 0 0 0 1px rgb(255 255 255 / 0.13);
  --elev-pop: 0 0 0 1px rgb(255 255 255 / 0.12), 0 12px 32px -8px rgb(0 0 0 / 0.6);
  --ring: 0 0 0 1px rgb(255 255 255 / 0.14);
  --hair: 1px;
}
@media (max-width: 720px) { :root { --gutter: 20px; } }
/* Large desktop screens get a larger reading size, not more empty space. */
@media (min-width: 1800px) { :root { --side: 288px; --gutter: 40px; } body { font-size: 16px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; scrollbar-width: thin; scrollbar-color: rgb(127 127 127 / 0.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(127 127 127 / 0.35); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgb(127 127 127 / 0.55); }
::-webkit-scrollbar-corner { background: transparent; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font: 600 28px/1.15 var(--font); letter-spacing: -0.022em; text-wrap: balance; }
h2 { font: 600 17px/1.3 var(--font); letter-spacing: -0.012em; }
h3 { font: 600 16px/1.35 var(--font); letter-spacing: -0.008em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
::selection { background: var(--primary-wash); color: var(--ink); }
svg.ic { flex: none; display: block; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--surface); padding: 10px 14px; z-index: 60; text-decoration: none; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.nil { color: var(--ink-3); }
.k { color: var(--ink-3); font-size: 14px; }
.meta { color: var(--ink-2); font-size: 14px; }
.meta > span + span::before, .dots > span + span::before { content: "·"; margin: 0 7px; color: var(--ink-3); }
.sub { color: var(--ink-2); font-size: 14px; }
.lede { color: var(--ink-2); max-width: 68ch; }
code { font: max(14px, 0.92em) var(--mono); background: var(--sunken); padding: 2px 6px; border-radius: 6px; box-shadow: inset 0 0 0 var(--hair) var(--line-strong); white-space: nowrap; }
.mono-in { display: inline-grid; place-items: center; width: var(--s, 16px); height: var(--s, 16px); border-radius: calc(var(--s, 16px) * 0.2); background: #0a66c2; color: #fff; flex: none; font: 700 calc(var(--s, 16px) * 0.64)/1 var(--font); letter-spacing: -0.03em; padding-bottom: 1px; }
a.out { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px 16px; background: var(--surface);
  box-shadow: var(--hair) 0 0 var(--line);
  overflow-y: auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; font: 600 17px/1 var(--font); letter-spacing: -0.015em; text-decoration: none; }
.brand-mark { border-radius: 9px; }
.nav { display: grid; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 10px;
  border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500;
  transition: background-color var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out);
}
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--primary-wash); color: var(--primary-ink); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav .label { flex: 1 1 auto; }
.nav .nav-sep { margin-top: 10px; padding-top: 10px; border-top: var(--hair) solid var(--line-strong); }
.nav .count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 7px; background: var(--primary); color: var(--on-primary); font: 600 13px/1 var(--font); font-variant-numeric: tabular-nums; animation: pop var(--duration-very-slow) var(--ease-bounce) both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

.side-foot { margin-top: auto; display: grid; gap: 10px; }
.sys { display: grid; gap: 2px; padding: 12px; border-radius: var(--r-md); background: var(--sunken); }
.sys-title { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 14px; padding-bottom: 6px; }
.sys-title a { font-weight: 500; color: var(--ink-2); }
@media (max-width: 720px) { .sync-2 { display: none; } }
/* Hosted copy: who is signed in, and the sign-in screen. */
.sys.who { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; }
.who-mail { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ink-2); }
.who-mail span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gated .app, .gated .skip { display: none; }
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas); }
.gate-card { width: min(100%, 400px); display: grid; gap: 16px; padding: 32px 28px 28px; border-radius: var(--r-lg, 20px); background: var(--surface); box-shadow: var(--ring), 0 12px 32px rgb(18 20 26 / 0.08); }
.gate-card h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; margin-top: 4px; }
.gate-sub { font-size: 15px; color: var(--ink-2); margin-top: -8px; }
.gate-card input { min-height: 44px; font-size: 16px; }
.gate-go { min-height: 44px; justify-content: center; margin-top: 4px; }
.sys-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; white-space: nowrap; min-height: 30px; font-size: 14px; color: var(--ink-2); }
.sys-row .state { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.sys-row .state.ok { color: var(--green-ink); }
.sys-row .state.warn { color: var(--amber-ink); }
.sys-row .state.off { color: var(--ink-3); }
.sys-help { font-size: 14px; color: var(--ink-2); padding-top: 8px; margin-top: 6px; border-top: var(--hair) solid var(--line-strong); }

.stage { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.top-meta { flex: 1 1 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; color: var(--ink-2); font-size: 14px; min-width: 0; }
.top-sync { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.btn.menu-btn, .scrim { display: none; }
main { padding: 12px var(--gutter) 96px; width: 100%; max-width: 1560px; margin: 0 auto; }
.top { width: 100%; }
#banner { padding: 0 var(--gutter); }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--red-wash); color: var(--red-ink); border-radius: var(--r-md); padding: 12px 14px; margin: 4px 0 12px; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); box-shadow: var(--elev-pop); transition: transform var(--duration-medium) var(--ease-smooth-out); visibility: hidden; }
  .nav-open .side { transform: none; visibility: visible; transition-duration: var(--duration-slow); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; border: 0; padding: 0; background: rgb(12 13 16 / 0.42); opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-out); }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .btn.menu-btn { display: inline-grid; }
  .nav a { min-height: 46px; }
  .top-sync #sync { display: none; }
}

/* ---------- Page furniture ---------- */
.page-head { display: grid; gap: 6px; margin-bottom: 24px; max-width: 760px; }
.deck { color: var(--ink-2); font-size: 16px; }
.section { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--elev-1); padding: 20px 24px 24px; margin-top: 20px; min-width: 0; }
.section:first-of-type { margin-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; min-height: 36px; }
h2 .count { margin-left: 8px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; }
@media (max-width: 720px) { .section { padding: 18px 18px 20px; border-radius: 14px; } h1 { font-size: 26px; } }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--sunken); color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tag.solid { background: var(--primary-wash); color: var(--primary-ink); }
.tag.hot { background: var(--amber-wash); color: var(--amber-ink); }
.tag.good { background: var(--green-wash); color: var(--green-ink); }
.tag.violet { background: var(--violet-wash); color: var(--violet); }
.tag.bad { background: var(--red-wash); color: var(--red-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 13px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: var(--ring), 0 1px 2px rgb(18 20 26 / 0.05);
  font: 500 14px/1 var(--font); white-space: nowrap; text-decoration: none;
  transition: background-color var(--duration-quick) var(--ease-out), box-shadow var(--duration-quick) var(--ease-out), color var(--duration-quick) var(--ease-out), transform var(--duration-micro) var(--ease-out);
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(var(--scale-small)); }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgb(214 43 86 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.16); }
.btn.primary:hover { background: color-mix(in oklch, var(--primary) 88%, black); }
.btn.dark { background: var(--ink); color: var(--surface); box-shadow: none; }
.btn.dark:hover { background: color-mix(in oklch, var(--ink) 86%, var(--surface)); }
.btn.quiet { background: transparent; box-shadow: none; color: var(--ink-2); padding: 0 10px; }
.btn.quiet:hover { background: var(--sunken); color: var(--ink); }
.btn.confirm { background: var(--red-wash); color: var(--red-ink); box-shadow: none; }
.btn.icon-only { width: 36px; padding: 0; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }
.btn:disabled { color: var(--ink-3); background: var(--sunken); box-shadow: none; cursor: default; transform: none; }
.btn.primary:disabled { background: color-mix(in srgb, var(--primary) 45%, var(--sunken)); color: var(--on-primary); }
a.btn { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions .push { margin-left: auto; }
/* 44px targets on touch screens and on any narrow window. */
@media (pointer: coarse), (max-width: 960px) { .btn { min-height: 44px; } .btn.icon-only { width: 44px; } }

/* Segmented control with a sliding pill (transitions.dev tabs sliding). */
.t-tabs { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--sunken); box-shadow: inset 0 0 0 var(--hair) var(--line); max-width: 100%; }
.t-tab { position: relative; z-index: 1; appearance: none; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; color: var(--ink-2); font: 500 14px/1 var(--font); white-space: nowrap; transition: color var(--tabs-dur) var(--tabs-ease); }
.t-tab:not([aria-pressed="true"]):hover, .t-tab[aria-pressed="true"] { color: var(--ink); }
.t-tab .num { color: var(--ink-3); font-weight: 500; }
.t-tabs-pill { position: absolute; top: 3px; left: 0; height: 32px; width: 0; z-index: 0; pointer-events: none; border-radius: 9px; background: var(--surface); box-shadow: var(--ring), 0 1px 2px rgb(18 20 26 / 0.08); transform: translateX(0); transition: transform var(--tabs-dur) var(--tabs-ease), width var(--tabs-dur) var(--tabs-ease); will-change: transform, width; }
@media (pointer: coarse), (max-width: 960px) { .t-tab, .t-tabs-pill { height: 44px; } .t-tabs { border-radius: 14px; } .t-tab, .t-tabs-pill { border-radius: 11px; } }

/* ---------- Forms ---------- */
.form { background: var(--sunken); padding: 20px; border-radius: var(--r-md); margin-bottom: 20px; display: grid; gap: 16px; box-shadow: inset 0 0 0 var(--hair) var(--line); }
.form-title { font: 600 16px/1.3 var(--font); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 16px; }
.fields.tight { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field.wide { grid-column: 1 / -1; }
label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); width: 100%; min-height: 40px; padding: 8px 11px;
  background: var(--surface); border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow var(--duration-quick) var(--ease-out), background-color var(--duration-quick) var(--ease-out);
}
input:hover, select:hover, textarea:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 34%, transparent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--primary), 0 0 0 3px var(--primary-wash); border-radius: 10px; }
textarea { resize: vertical; line-height: 1.5; display: block; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
.hint { font-size: 14px; color: var(--ink-3); }
.error { display: flex; gap: 7px; align-items: flex-start; color: var(--red-ink); font-size: 14px; font-weight: 500; }
.error::before { content: ""; width: 16px; height: 16px; margin-top: 2px; flex: none; background: currentColor; -webkit-mask: var(--mask-alert) center / contain no-repeat; mask: var(--mask-alert) center / contain no-repeat; }
:root { --mask-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E"); }
/* Inline editable cell: reads as text until you reach for it. */
.cell { width: 88px; min-height: 34px; padding: 4px 8px; text-align: right; background: transparent; box-shadow: none; border-radius: 8px; }
.cell.text { width: 100%; min-width: 180px; text-align: left; }
.cell:hover { background: var(--sunken); box-shadow: none; }
.cell:focus-visible { background: var(--surface); }
/* Last in this section on purpose: 44px targets and 16px text on touch and narrow screens. 16px stops iOS zooming on focus. */
@media (pointer: coarse), (max-width: 960px) { input, select, textarea { font-size: 16px; min-height: 44px; } .cell { min-height: 44px; } a.out { min-height: 44px; } }

/* ---------- Tables ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -8px; padding: 0 8px; }
.scroll:focus-visible { outline-offset: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px 12px 0; vertical-align: middle; border-bottom: var(--hair) solid var(--line-strong); font-weight: 400; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-size: 14px; color: var(--ink-3); font-weight: 500; white-space: nowrap; padding-top: 4px; padding-bottom: 10px; }
tbody th { font-weight: 600; }
tbody tr:last-child > * { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.has-cell { padding-top: 6px; padding-bottom: 6px; }
td.strong { font-weight: 600; }
td .sub, th .sub { display: block; font-weight: 400; color: var(--ink-3); font-size: 14px; }
td.clip { min-width: 240px; max-width: 420px; }
td.end { text-align: right; white-space: nowrap; }
tr.row-error td { padding-top: 0; }

/* ---------- Empty states ---------- */
.empty { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 18px; border-radius: var(--r-md); background: var(--sunken); max-width: 720px; }
.empty-ic { grid-row: 1 / span 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); color: var(--ink-3); box-shadow: var(--ring); }
.empty-t { font: 600 16px/1.35 var(--font); padding-top: 1px; }
.empty p + p { color: var(--ink-2); }
.empty .btn { margin-top: 10px; justify-self: start; }
.empty > :not(.empty-ic) { grid-column: 2; }

/* ---------- Lists inside cards ---------- */
.rows > li, .rows > article { padding: 20px 0; border-bottom: var(--hair) solid var(--line-strong); display: grid; gap: 12px; }
.rows > :first-child { padding-top: 4px; }
.rows > :last-child { border-bottom: 0; padding-bottom: 0; }
.row-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.pair { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 16px; }
.pair dt { color: var(--ink-3); font-size: 14px; padding-top: 1px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } .pair dd { margin-bottom: 8px; } }

/* ---------- Avatar ---------- */
.av { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 14px/1 var(--font); letter-spacing: 0.01em; background: var(--av-bg, var(--sunken)); color: var(--av-ink, var(--ink-2)); }
.av.lg { width: 48px; height: 48px; font-size: 16px; }
.av .on { position: absolute; right: -5px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 var(--hair) var(--line-strong); }
.av.c0 { --av-bg: var(--primary-wash); --av-ink: var(--primary-ink); }
.av.c1 { --av-bg: var(--violet-wash); --av-ink: var(--violet); }
.av.c2 { --av-bg: var(--amber-wash); --av-ink: var(--amber-ink); }
.av.c3 { --av-bg: var(--green-wash); --av-ink: var(--green-ink); }
.av.c4 { --av-bg: var(--sunken); --av-ink: var(--ink-2); }

/* ---------- Signal bars: priority and scorecard share one motif ---------- */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.bars i { width: 3px; border-radius: 1.5px; background: var(--line-strong); }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 11px; } .bars i:nth-child(4) { height: 13.5px; } .bars i:nth-child(5) { height: 16px; }
.bars i.on { background: var(--ink-2); }
.bars.hot i.on { background: var(--primary); }

/* Scorecard */
.sc { display: grid; gap: 12px; }
.sc-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sc-avg { font: 600 24px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.verdict { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 6px; border-radius: 7px; font-size: 14px; font-weight: 600; background: var(--green-wash); color: var(--green-ink); }
.verdict.rewrite { background: var(--amber-wash); color: var(--amber-ink); }
/* The 9 criteria as an equaliser: bar height is the score out of 5. */
.eq { display: inline-flex; align-items: flex-end; gap: 4px; height: 30px; padding: 0 2px; }
.eq i { width: 7px; border-radius: 2.5px; background: var(--ink); transform-origin: bottom; }
.eq i.low { background: var(--amber); }
.eq i[data-s="1"] { height: 20%; } .eq i[data-s="2"] { height: 40%; } .eq i[data-s="3"] { height: 60%; } .eq i[data-s="4"] { height: 80%; } .eq i[data-s="5"] { height: 100%; }
.eq i:hover { opacity: 0.7; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 32px; max-width: 900px; }
.sc-grid li { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; min-height: 34px; }
.sc-grid li.low { color: var(--amber-ink); font-weight: 600; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 16px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.pips i.on { background: var(--ink); }
.low .pips i.on { background: var(--amber); }
.fixes { display: grid; gap: 8px; max-width: 76ch; }
.fixes li { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 2px 14px; padding: 10px 12px; border-radius: 10px; background: var(--amber-wash); }
.fixes .fix-k { color: var(--amber-ink); font-weight: 600; }
@media (max-width: 640px) { .fixes li { grid-template-columns: 1fr; } }

.working { display: grid; gap: 10px; color: var(--ink-2); padding: 14px; border-radius: var(--r-md); background: var(--sunken); }
.working .track { height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.working .track i { display: block; height: 100%; width: 32%; border-radius: 2px; background: var(--primary); animation: slide 1.4s var(--ease-in-out) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(320%); } }

/* Draft panel: the thing you came here to copy. */
.draft { background: var(--sunken); border-radius: var(--r-md); padding: 14px 16px 16px; display: grid; gap: 8px; box-shadow: inset 0 0 0 var(--hair) var(--line); }
.draft-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; }
.draft-text { white-space: pre-wrap; font-size: 16px; line-height: 1.55; max-width: 68ch; }
/* The rewrite panel. Not the "Rewrite" verdict tag, which shares the word. */
.rewrite:not(.verdict) { border-radius: var(--r-md); padding: 14px 16px 16px; display: grid; gap: 10px; background: var(--green-wash); }
.rewrite-text { white-space: pre-wrap; font-size: 16px; line-height: 1.55; max-width: 68ch; }

/* Progress */
.bar { height: 8px; background: var(--sunken); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 var(--hair) var(--line); }
.bar i { display: block; height: 100%; min-width: 4px; border-radius: 4px; background: var(--ink); transform-origin: left; }
.bar.accent i { background: var(--primary); }
.bar.none i { display: none; }

/* Charts */
.chart-wrap { display: grid; gap: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart text { font: 500 12.5px var(--font); fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line-strong); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .pt { cursor: default; outline: none; }
.chart .pt-li { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart .pt-x { fill: var(--violet); stroke: var(--surface); stroke-width: 2; }
.chart .pt:hover .pt-li, .chart .pt:focus-visible .pt-li, .chart .pt:hover .pt-x, .chart .pt:focus-visible .pt-x { stroke: var(--ink); stroke-width: 2.5; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }

/* Tooltip and toast */
#tip { position: fixed; z-index: 70; background: var(--ink); color: var(--surface); font-size: 14px; line-height: 1.4; padding: 7px 10px; border-radius: 9px; max-width: 300px; pointer-events: none; box-shadow: var(--elev-pop); animation: tip-in var(--duration-quick) var(--ease-out) both; }
@keyframes tip-in { from { opacity: 0; transform: scale(var(--scale-small)); } }
#live { pointer-events: none; position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; background: var(--ink); color: var(--surface); font-weight: 500; padding: 11px 16px 11px 13px; border-radius: 12px; max-width: calc(100vw - 32px); box-shadow: var(--elev-pop); animation: toast-in var(--duration-fast) var(--ease-smooth-out) both; }
#live::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--green) var(--mask-check) center / 12px no-repeat; }
:root { --mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
#live:empty { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, var(--distance-base)); filter: blur(var(--blur-small)); } }

/* ---------- Motion: arrival on tab change, then stillness ---------- */
main.enter > *, main.enter .stagger > * { animation: rise var(--duration-very-slow) var(--ease-smooth-out) both; }
main.enter > :nth-child(2), main.enter .stagger > :nth-child(2) { animation-delay: calc(var(--duration-stagger) * 1); }
main.enter > :nth-child(3), main.enter .stagger > :nth-child(3) { animation-delay: calc(var(--duration-stagger) * 2); }
main.enter > :nth-child(4), main.enter .stagger > :nth-child(4) { animation-delay: calc(var(--duration-stagger) * 3); }
main.enter > :nth-child(5), main.enter .stagger > :nth-child(5) { animation-delay: calc(var(--duration-stagger) * 4); }
main.enter > :nth-child(n + 6), main.enter .stagger > :nth-child(n + 6) { animation-delay: calc(var(--duration-stagger) * 5); }
main.enter .stagger { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--distance-medium)); filter: blur(var(--blur-medium)); } }
main.enter .bar i { animation: grow var(--duration-very-slow) var(--ease-smooth-out) var(--duration-fast) both; }
@keyframes grow { from { transform: scaleX(0); } }
main.enter .eq i { animation: eq-up var(--duration-slow) var(--ease-bounce) both; animation-delay: calc(var(--duration-fast) + var(--i, 0) * 30ms); }
@keyframes eq-up { from { transform: scaleY(0.1); opacity: 0; } }
.swap { animation: swap var(--duration-quick) var(--ease-in-out) both; }
@keyframes swap { from { opacity: 0; transform: translateY(var(--distance-micro)); filter: blur(var(--blur-small)); } }
.spin { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .t-tabs-pill, .t-tab { transition: none !important; }
  .working .track i { animation: none; width: 100%; opacity: 0.5; }
}
