@font-face { font-family: 'EX Agdasima'; src: url('fonts/Agdasima-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'EX Agdasima'; src: url('fonts/Agdasima-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'EX Agdasima Extended'; src: url('fonts/AgdasimaExtended-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'EX Agdasima Extended'; src: url('fonts/AgdasimaExtended-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  /* Graphite: neutral greys like Google Analytics dark, EarthX red as the only accent (Denis's pick, 2026-10-06). */
  --bg: #0f0f10;
  --bg-2: #151517;
  --surface: #1c1c1f;
  --surface-2: #242428;
  --surface-3: #2e2e33;
  /* Elevation: --bg (page) < --surface + --shadow (cards) < --surface-2/3 (raised inside cards, hover)
     < --surface-pop + --shadow-lg (popovers, tooltips, toasts, menus). */
  --surface-pop: #27272c;
  --surface-hover: #313137;
  --outline: rgba(255, 255, 255, 0.08);
  --outline-2: rgba(255, 255, 255, 0.15);
  --text: #f1f1f3;
  --text-2: #b9b9c2;
  --muted: #8b8b95;
  --red: #e74c3c;
  --red-hot: #ff6a5a;
  --red-wash: rgba(231, 76, 60, 0.14);
  --violet: #8f7bff;
  --violet-wash: rgba(143, 123, 255, 0.15);
  --amber: #f2a93b;
  --amber-wash: rgba(242, 169, 59, 0.14);
  --green: #3cc98f;
  --green-wash: rgba(60, 201, 143, 0.13);
  --blue: #5eaaff;
  --blue-wash: rgba(94, 170, 255, 0.13);
  --claude: #d97757;
  --font: 'Agdasima', 'EX Agdasima', 'Avenir Next Condensed', system-ui, sans-serif;
  --font-wide: 'EX Agdasima Extended', 'Agdasima', system-ui, sans-serif;
  --font-dot: 'Doto', ui-monospace, monospace;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* One spacing scale and one radius scale for the whole dashboard. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;
  --gap: 16px;
  --appbar: 56px;
  --nav: 208px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 400 17px/1.4 var(--font); letter-spacing: 0.01em; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(231, 76, 60, 0.35); }
[hidden] { display: none !important; }
.svg-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---- App bar --------------------------------------------------------------------------------- */

.appbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--appbar);
  display: flex; align-items: center; gap: 16px; padding: 0 24px 0 16px;
  background: rgba(15, 15, 16, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 8px; min-width: 0; }
.brand img { height: 26px; display: block; }
.brand-name { font: 700 14px/1 var(--font-wide); letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface-2); font-size: 15px; color: var(--text-2); white-space: nowrap;
}
.pill .svg-icon { width: 14px; height: 14px; }
.pill.version { background: var(--red-wash); color: #ffd1cb; font: 700 13px/1 var(--font-wide); letter-spacing: 0.08em; }
.countdown { margin-left: auto; display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.countdown .label { font: 400 12px/1 var(--font-wide); letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); }
.countdown .value { font: 700 23px/1 var(--font-dot); letter-spacing: 0.04em; }
.appbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.countdown + .appbar-right { margin-left: 24px; }
.status-dots { display: flex; gap: 2px; margin-right: 8px; }
.status-dot {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: 15px; color: var(--text-2); background: transparent; border: 0; cursor: pointer;
}
.status-dot:hover { background: var(--surface-2); color: var(--text); }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-dot.ok i { background: var(--green); }
.status-dot.warn i { background: var(--amber); }
.status-dot.err i { background: var(--red); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 0; color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; color: var(--text-2); padding: 0 4px; }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  font: 700 12px/1 var(--font-wide); background: #3a2a48; color: #f3e9ff;
}
.nav-toggle { display: none; }

/* ---- Navigation drawer / rail / bottom bar ----------------------------------------------------- */

.nav {
  position: fixed; z-index: 30; top: var(--appbar); bottom: 0; left: 0; width: var(--nav);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  background: var(--bg); border-right: 1px solid var(--outline);
}
.nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-pill);
  text-decoration: none; color: var(--text-2); font-size: 16px; position: relative;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: rgba(231, 76, 60, 0.18); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.nav a.on .svg-icon { color: var(--red-hot); }
.nav a .svg-icon { width: 21px; height: 21px; }
.nav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--red); color: #fff; font: 700 12px/22px var(--font-wide); text-align: center; }
.nav .badge.soft { background: var(--surface-3); color: var(--text-2); }
.nav .foot { margin-top: auto; padding: 16px 16px 4px; font-size: 14px; color: var(--muted); }
.nav .foot img { height: 34px; display: block; margin-bottom: 8px; opacity: 0.9; }

/* ---- Content ----------------------------------------------------------------------------------- */

.content { margin-left: var(--nav); padding: calc(var(--appbar) + 16px) 20px 24px; min-width: 0; }
.page { margin: 0 auto; display: flex; flex-direction: column; gap: var(--gap); }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font: 700 26px/1.1 var(--font-wide); letter-spacing: 0.01em; }
.page-head p { margin: 8px 0 0; color: var(--text-2); font-size: 18px; }
.grid { display: grid; gap: var(--gap); align-items: start; min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-players { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.g-build { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* Hero with the composer (overview) */
.hero {
  position: relative; border-radius: var(--r-xl); overflow: hidden; padding: 56px 24px 32px; text-align: center;
  background:
    linear-gradient(180deg, rgba(15, 15, 16, 0.1) 0%, rgba(15, 15, 16, 0.45) 50%, rgba(15, 15, 16, 0.94) 100%),
    url('img/hero.jpg') center 38% / cover no-repeat;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 24px; font: 700 clamp(26px, 2.6vw, 38px)/1.1 var(--font-wide); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); }
.hero h1 em { font-style: normal; color: var(--red); }
.composer {
  width: min(800px, 100%); margin: 0 auto; text-align: left; border-radius: var(--r-lg);
  background: rgba(28, 28, 31, 0.92); border: 1px solid var(--outline-2); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.composer-tabs { display: flex; gap: 4px; padding: 12px 12px 0; font-size: 15px; }
.composer-tabs span { padding: 4px 12px; border-radius: var(--r-sm); color: var(--muted); }
.composer-tabs span.on { color: var(--text); background: var(--surface-3); }
.composer textarea { display: block; width: 100%; min-height: 66px; max-height: 260px; resize: vertical; padding: 12px 16px; background: transparent; border: 0; outline: 0; font-size: 19px; }
.composer textarea::placeholder { color: var(--muted); }
.composer-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px 12px; flex-wrap: wrap; }
.composer-foot .grow { flex: 1; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px auto 0; width: min(800px, 100%); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--outline-2); background: rgba(28, 28, 31, 0.8); color: var(--text-2); font-size: 15.5px; cursor: pointer;
}
.chip-btn:hover { color: var(--text); border-color: rgba(231, 76, 60, 0.6); }
.chip-btn b { color: var(--text); }
.chip-btn .svg-icon { width: 15px; height: 15px; color: var(--claude); }

/* KPI scorecards */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpis[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1400px) {
  .kpis[data-n="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpis[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.kpi {
  display: block; text-decoration: none; padding: 12px 14px 8px; border-radius: var(--r-lg);
  background: var(--surface); position: relative; overflow: hidden; min-width: 0;
}
.kpi:hover { background: var(--surface-2); }
.kpi .k { font-size: 14.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { margin-top: 4px; font: 700 30px/1 var(--font-wide); white-space: nowrap; letter-spacing: 0.01em; }
.kpi .d { margin-top: 4px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; min-height: 19px; }
.kpi .spark { margin: 4px -4px 0; height: 26px; }
.delta { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: var(--r-sm); font: 700 13px/1 var(--font-wide); }
.delta.up { background: var(--green-wash); color: var(--green); }
.delta.down { background: var(--red-wash); color: var(--red-hot); }
.delta.flat { background: var(--surface-3); color: var(--text-2); }

/* ---- Cards ------------------------------------------------------------------------------------- */

.card { background: var(--surface); border-radius: var(--r-lg); min-width: 0; }
.card-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px 0; }
.card-head .titles { min-width: 0; }
.card-head h2 { margin: 0; font: 700 18px/1.2 var(--font); letter-spacing: 0.02em; }
.card-head .sub { margin-top: 2px; font-size: 14px; color: var(--muted); }
.card-head .actions { margin-left: auto; display: flex; align-items: center; gap: 2px; margin-top: -6px; margin-right: -8px; }
.card-body { padding: 8px 16px 12px; }
.card-body > * + * { margin-top: 12px; }
.subhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; font: 700 11.5px/1 var(--font-wide); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.subhead .right { margin-left: auto; font: 400 15px/1 var(--font); letter-spacing: 0.02em; text-transform: none; }
.empty { padding: 24px; border-radius: var(--r-md); background: var(--bg-2); color: var(--text-2); font-size: 17px; }
.empty b { color: var(--text); }
.empty .btn { margin-top: 16px; }
.see-all { display: inline-flex; align-items: center; gap: 4px; color: var(--red-hot); text-decoration: none; font-size: 16px; }
.see-all:hover { text-decoration: underline; }

/* ---- Controls ---------------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--outline-2); background: transparent; color: var(--text); font-size: 16.5px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn .svg-icon { width: 17px; height: 17px; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hot); border-color: var(--red-hot); }
.btn.tonal { background: var(--surface-3); border-color: transparent; }
.btn.tonal:hover { background: var(--surface-hover); }
.btn.claude .svg-icon { color: var(--claude); }
.btn.small { height: 28px; padding: 0 12px; font-size: 15px; border-radius: var(--r-pill); }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); }
.select {
  appearance: none; -webkit-appearance: none; height: 38px; padding: 0 34px 0 16px; border-radius: var(--r-md); border: 1px solid var(--outline-2);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aab0c8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center;
  font-size: 16px; cursor: pointer;
}
.input { height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--outline-2); background: var(--bg-2); font-size: 17px; outline: 0; min-width: 0; }
.input:focus, .select:focus { border-color: rgba(231, 76, 60, 0.75); }
textarea.input { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.4; width: 100%; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--outline); flex-wrap: wrap; }
.seg button { height: 32px; padding: 0 16px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); font-size: 15.5px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; border-radius: var(--r-pill); font-size: 14.5px; line-height: 1;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 0;
}
.chip .svg-icon { width: 14px; height: 14px; }
.chip i.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.red { color: #ffb8af; background: var(--red-wash); }
.chip.amber { color: #ffd69e; background: var(--amber-wash); }
.chip.green { color: #a3f0cf; background: var(--green-wash); }
.chip.blue { color: #bcdcff; background: var(--blue-wash); }
.chip.violet { color: #d3cbff; background: var(--violet-wash); }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--outline-2); }
.chip.link { cursor: pointer; text-decoration: none; }
.chip.link:hover { color: var(--text); background: var(--surface-hover); }

.pips { display: inline-flex; gap: 4px; vertical-align: middle; }
.pips i { width: 8px; height: 8px; border-radius: var(--r-xs); background: var(--surface-3); }
.pips.amber i.on { background: var(--amber); }
.pips.green i.on { background: var(--green); }
.meter-label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-2); white-space: nowrap; }

/* ---- Lists and rows ---------------------------------------------------------------------------- */

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 12px; margin: 0 -12px; border-radius: var(--r-md); min-width: 0; }
.row + .row { box-shadow: inset 0 1px 0 var(--outline); }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-2); box-shadow: none; }
.row.clickable:hover + .row { box-shadow: none; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-size: 16.5px; line-height: 1.25; overflow-wrap: anywhere; }
.row .meta { margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: 14px; color: var(--muted); }
.row .meta .svg-icon { width: 14px; height: 14px; vertical-align: -2px; }
.row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.row.compact { padding: 8px 12px; }
.kind-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); flex: none; }
.kind-icon .svg-icon { width: 16px; height: 16px; }
.kind-icon.bug, .kind-icon.exception { background: var(--red-wash); color: var(--red-hot); }
.kind-icon.idea, .kind-icon.crash { background: var(--violet-wash); color: var(--violet); }
.kind-icon.feedback, .kind-icon.question { background: var(--blue-wash); color: var(--blue); }
.kind-icon.other, .kind-icon.pending { background: var(--surface-3); color: var(--muted); }
.kind-icon.error { background: var(--amber-wash); color: var(--amber); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Post and error rows: one coloured badge on the right, severity as a left stripe, everything else quiet text. */
.post-row, .error-row { position: relative; }
.post-row::before, .error-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: var(--r-xs); }
.sev-critical::before { background: var(--red-hot); }
.sev-high::before { background: var(--red); opacity: 0.8; }
.sev-medium::before { background: var(--amber); opacity: 0.8; }
.sev-low::before { background: var(--blue); opacity: 0.6; }
.row .summary { font-size: 14.5px; margin-top: 2px; }
.row .frame { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-row .title { font-size: 16.5px; }
.row .side .chip { white-space: nowrap; }
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--text-2); }
.state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.state.green .dot { background: var(--green); }
.state.red .dot { background: var(--red-hot); }
.state.amber .dot { background: var(--amber); }
.state.blue .dot { background: var(--blue); }
.state.violet .dot { background: var(--violet); }
.state .dot.live { animation: dot-fade 1.6s ease-in-out infinite; }
.motion-full .state .dot.live { animation: pulse 1.6s ease-out infinite; }
.fitmeter { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); white-space: nowrap; }
.fitmeter .bars { display: inline-grid; gap: 4px; width: 34px; }
.fitmeter .bars i { display: block; height: 3px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--c) calc(var(--v) * 100%), var(--surface-3) 0); }
.fitmeter .bars .d { --c: var(--amber); }
.fitmeter .bars .f { --c: var(--green); }
.who { display: inline-flex; align-items: center; gap: 8px; }
.av { width: 20px; height: 20px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-3); }
.av.letter { display: inline-grid; place-items: center; font: 700 10px/1 var(--font-wide); color: var(--text-2); }
.avatars { display: inline-flex; align-items: center; }
.avatars .av { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .av + .av { margin-left: -8px; }
.avatars b { margin-left: 8px; font: 600 13.5px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; color: var(--text-2); }
.row.clickable:hover .avatars .av { box-shadow: 0 0 0 2px var(--surface-2); }
.more-btn { margin-top: 12px; }
.scroll { max-height: 820px; overflow-y: auto; padding: 0 12px; margin: 0 -12px; }
.scroll::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-sm); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: dot-fade 1.8s ease-in-out infinite; flex: none; }
.motion-full .pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 201, 143, 0.55); } 70% { box-shadow: 0 0 0 9px rgba(60, 201, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 201, 143, 0); } }
.idle-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); flex: none; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

.banner { display: flex; align-items: center; gap: 12px; padding: 16px 16px; border-radius: var(--r-md); background: var(--bg-2); font-size: 17px; color: var(--text-2); }
.banner b { color: var(--text); }
.banner .grow { flex: 1; min-width: 0; }
.banner.warn { background: var(--amber-wash); }
.banner.warn > .svg-icon { color: var(--amber); }
.banner.ok { background: var(--green-wash); }
.banner.ok > .svg-icon { color: var(--green); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.stat { padding: 8px 12px; border-radius: var(--r-md); background: var(--bg-2); min-width: 0; }
.stat .k { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { margin-top: 4px; font: 700 24px/1 var(--font-wide); white-space: nowrap; }
.stat .d { margin-top: 4px; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up { color: var(--green); }
.down { color: var(--red-hot); }

/* ---- Protocol ----------------------------------------------------------------------------------- */

.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 16px; padding: 16px; border-radius: var(--r-md); background: var(--bg-2); }
.step.done { background: linear-gradient(0deg, var(--green-wash), var(--green-wash)), var(--bg-2); }
.step-num {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  font: 700 14px/1 var(--font-wide); border: 2px solid var(--outline-2); color: var(--text-2); background: transparent; cursor: pointer;
}
.step-num:hover { border-color: var(--green); }
.step.done .step-num { background: var(--green); border-color: var(--green); color: #062015; }
.step-title { font-size: 19px; }
.step-detail { font-size: 16px; color: var(--text-2); margin-top: 4px; }
.step-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: var(--r-xs); background: var(--red); }
.progress.green > i { background: var(--green); }

/* ---- Charts ------------------------------------------------------------------------------------- */

.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis { font: 400 13px var(--font); fill: var(--muted); }
.chart .grid-line { stroke: var(--outline-2); stroke-width: 1; }
.tooltip {
  position: fixed; z-index: 80; pointer-events: none; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--surface-pop); box-shadow: var(--shadow-lg); font-size: 15px; color: var(--text-2); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.tooltip b { color: var(--text); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(100px, 28%) 1fr auto; align-items: center; gap: 16px; font-size: 16.5px; }
.hbar .name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; border-radius: var(--r-pill); background: var(--bg-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 0 5px 5px 0; background: var(--red); min-width: 3px; }
.hbar .val { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }

/* ---- Localization -------------------------------------------------------------------------------- */

.langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 32px; }
.lang { display: grid; grid-template-columns: 1fr auto; gap: 8px 8px; align-items: center; font-size: 16.5px; }
.lang .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang .num { font-size: 14.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lang .progress { grid-column: 1 / -1; height: 6px; }
.lang .progress > i { background: var(--green); }
.lang.behind .progress > i { background: var(--amber); }
.keys { display: flex; flex-direction: column; }
.key-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; font-size: 16px; padding: 8px 0; }
.key-row + .key-row { box-shadow: inset 0 1px 0 var(--outline); }
.key-row .mono { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 4px; }
.key-row span:last-child { white-space: pre-line; overflow-wrap: anywhere; }

/* ---- Flight plan --------------------------------------------------------------------------------- */

.todo-add { display: flex; gap: 8px; }
.todo-add .input { flex: 1; }
.todos { display: flex; flex-direction: column; }
.todo { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 0; border-radius: var(--r-md); min-width: 0; background: var(--surface); }
.todo + .todo { box-shadow: inset 0 1px 0 var(--outline); }
.todo:hover { background: var(--surface-2); box-shadow: none; }
.todo.dragging { position: relative; z-index: 5; background: var(--surface-3); box-shadow: var(--shadow-lg); }
.grip { display: grid; place-items: center; width: 24px; height: 32px; color: var(--muted); cursor: grab; border: 0; background: transparent; border-radius: var(--r-sm); flex: none; touch-action: none; }
.grip:hover { color: var(--text); background: var(--surface-3); }
.grip:active { cursor: grabbing; }
.check { width: 22px; height: 22px; border-radius: var(--r-sm); border: 2px solid var(--outline-2); background: transparent; flex: none; display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; }
.check:hover { border-color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #062015; }
.check .svg-icon { width: 14px; height: 14px; stroke-width: 3; }
.todo .text { flex: 1; min-width: 0; font-size: 18px; overflow-wrap: anywhere; cursor: text; padding: 4px 0; }
.todo.done .text { color: var(--muted); text-decoration: line-through; }
.todo .text-edit { flex: 1; height: 34px; }
.todo .tools { display: flex; align-items: center; opacity: 0; }
.todo:hover .tools, .todo:focus-within .tools { opacity: 1; }
.todo .avatar { cursor: pointer; }
.todo .avatar.none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--outline-2); }
@media (hover: none) { .todo .tools { opacity: 1; } }

/* ---- Audience and trailers ----------------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile { padding: 16px 16px 12px; border-radius: var(--r-md); background: var(--bg-2); min-width: 0; position: relative; }
.tile .k { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--text-2); white-space: nowrap; }
.tile .k img { width: 16px; height: 16px; object-fit: contain; }
.tile .k .brand-dot { width: 10px; height: 10px; border-radius: var(--r-xs); }
.tile .v { margin-top: 12px; font: 700 32px/1 var(--font-wide); white-space: nowrap; }
.tile .d { margin-top: 8px; font-size: 15px; color: var(--muted); min-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .edit { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; }
.tile .spark { margin-top: 8px; height: 34px; }
.tile.na .v { color: var(--muted); font: 400 20px/1.2 var(--font); }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.video { display: flex; flex-direction: column; text-decoration: none; border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); }
.video:hover { background: var(--surface-2); }
.video img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--surface-3); }
.video .vb { padding: 12px 16px 12px; }
.video .vt { font-size: 18px; line-height: 1.25; }
.video .vm { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 15px; color: var(--text-2); }
.video .vm span { display: inline-flex; align-items: center; gap: 4px; }
.video .vm .svg-icon { width: 14px; height: 14px; color: var(--muted); }
.video .spark { margin-top: 8px; height: 28px; }

/* ---- Reports and decisions ---------------------------------------------------------------------- */

.decision { display: flex; gap: 16px; padding: 16px 16px; border-radius: var(--r-md); background: var(--bg-2); }
.decision + .decision { margin-top: 12px; }
.decision .main { flex: 1; min-width: 0; font-size: 17px; }
.decision .src { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.decision .acts { display: flex; flex-direction: column; gap: 8px; flex: none; }
.decision.resolved { opacity: 0.55; }

/* ---- Drawer ------------------------------------------------------------------------------------- */

.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(3, 3, 8, 0.6); opacity: 0; transition: opacity 0.18s ease; }
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(780px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity 0.15s ease, visibility 0.15s;
}
.drawer.open { opacity: 1; visibility: visible; }
.motion-full .drawer { opacity: 1; visibility: visible; transform: translateX(100%); transition: transform 0.22s ease; }
.motion-full .drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 24px 24px 16px; }
.drawer-head h3 { margin: 0; flex: 1; font: 700 25px/1.2 var(--font); overflow-wrap: anywhere; }
.drawer-head .eyebrow { font: 700 11.5px/1 var(--font-wide); letter-spacing: 0.18em; text-transform: uppercase; color: var(--red-hot); margin-bottom: 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 32px; }
.drawer-body > * + * { margin-top: 24px; }
.drawer-foot { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px 24px; background: var(--surface-2); }
.section-title { font: 700 11.5px/1 var(--font-wide); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.prose { font-size: 17.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote { padding: 16px 16px; border-radius: var(--r-md); background: var(--bg-2); border-left: 3px solid var(--outline-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.fact { padding: 16px 16px; border-radius: var(--r-md); background: var(--bg-2); }
.fact .k { font-size: 14.5px; color: var(--muted); }
.fact .v { margin-top: 8px; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
ol.steps-list, ul.plain { margin: 0; padding-left: 24px; font-size: 17px; }
ol.steps-list li + li, ul.plain li + li { margin-top: 8px; }
.files { display: flex; flex-direction: column; gap: 8px; }
.files div { display: grid; grid-template-columns: minmax(0, auto) 1fr; gap: 12px; font-size: 16px; color: var(--text-2); }
.files .mono { color: #ffc3bb; overflow-wrap: anywhere; }
.reply { padding: 16px 16px; border-radius: var(--r-md); background: var(--blue-wash); font-size: 17px; }
pre.stack { margin: 0; padding: 16px; border-radius: var(--r-md); background: #07070c; overflow-x: auto; font: 12px/1.55 var(--mono); color: #d8dbe8; white-space: pre; max-height: 360px; }
.attachments { display: flex; flex-wrap: wrap; gap: 12px; }
.attachments img { max-width: 240px; max-height: 170px; border-radius: var(--r-md); display: block; }
.replies { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.reply-msg { font-size: 16.5px; }
.reply-msg b { color: var(--text-2); margin-right: 8px; }

.md { font-size: 17px; }
.md h1 { font: 700 26px/1.2 var(--font); margin: 0 0 16px; }
.md h2 { font: 700 13px/1.2 var(--font-wide); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-hot); margin: 32px 0 12px; }
.md h3, .md h4 { font: 700 19px/1.25 var(--font); margin: 24px 0 8px; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md code { font: 12.5px var(--mono); background: var(--surface-3); padding: 1px 8px; border-radius: var(--r-sm); }
.md pre { background: #07070c; border-radius: var(--r-md); padding: 16px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 15.5px; display: block; overflow-x: auto; }
.md th, .md td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--outline); }
.md th { color: var(--text-2); font-weight: 700; background: var(--surface-2); }
.md blockquote { margin: 0 0 12px; padding: 8px 16px; border-left: 3px solid var(--outline-2); color: var(--text-2); }
.md a { color: #ffb1a8; }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-pop); box-shadow: var(--shadow-lg); font-size: 16.5px; animation: fade-in 0.18s ease; max-width: min(560px, 92vw); }
.motion-full .toast { animation-name: toast-in; }
.toast.err { background: #4a2228; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.setup-list { display: flex; flex-direction: column; gap: 12px; }
.setup-item { display: flex; gap: 16px; padding: 16px; border-radius: var(--r-md); background: var(--bg-2); }
.setup-item .state { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.setup-item .state.ok { background: var(--green); color: #062015; }
.setup-item .state.todo { box-shadow: inset 0 0 0 2px var(--outline-2); }
.setup-item h4 { margin: 0; font-size: 19px; }
.setup-item p { margin: 8px 0 0; font-size: 16px; color: var(--text-2); }
.setup-item code { font: 12.5px var(--mono); background: var(--surface-3); padding: 1px 8px; border-radius: var(--r-sm); }
.setup-item .btn { margin-top: 12px; }

.step-editor { display: flex; flex-direction: column; gap: 16px; }
.step-edit { padding: 16px; border-radius: var(--r-md); background: var(--bg-2); display: flex; flex-direction: column; gap: 12px; }
.step-edit .toolbar .input { flex: 1; }
.step-edit textarea { min-height: 130px; font: 12.5px/1.5 var(--mono); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, rgba(15, 15, 16, 0.3), var(--bg) 70%), url('img/hero.jpg') center 30% / cover no-repeat; }
.login { width: min(420px, 100%); padding: 32px; border-radius: var(--r-xl); background: rgba(28, 28, 31, 0.94); box-shadow: var(--shadow-lg); }
.login img { height: 48px; display: block; margin: 0 auto 8px; }
.login h1 { margin: 0 0 24px; text-align: center; font: 700 13px/1 var(--font-wide); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-2); }
.login label { display: block; font-size: 15.5px; color: var(--text-2); margin: 16px 0 8px; }
.login .input { width: 100%; }
.login .btn { width: 100%; margin-top: 24px; }
.invite-hello { margin: 0 0 8px; text-align: center; color: var(--text-2); font-size: 16.5px; line-height: 1.4; }
.invite-hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
#dead .btn { display: flex; justify-content: center; margin-top: 16px; }
.login .error { color: var(--red-hot); font-size: 15.5px; margin-top: 12px; min-height: 20px; text-align: center; }

/* ---- Responsive ---------------------------------------------------------------------------------- */

@media (max-width: 1440px) {
  .g-players, .g-build { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1199px) {
  :root { --nav: 88px; }
  .nav { padding: 12px 8px; align-items: stretch; }
  .nav a { flex-direction: column; justify-content: center; gap: 4px; height: 64px; padding: 0; border-radius: var(--r-lg); font-size: 13.5px; }
  .nav .badge { position: absolute; top: 6px; right: 12px; margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; line-height: 18px; padding: 0 4px; }
  .nav .foot { display: none; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .status-dots { display: none; }
}
@media (max-width: 760px) {
  :root { --appbar: 56px; --gap: 16px; }
  body { font-size: 16.5px; }
  .appbar { padding: 0 8px 0 12px; gap: 8px; }
  .brand-name, .user-chip .name, .countdown .label { display: none; }
  .countdown .value { font-size: 18px; }
  .nav { top: auto; bottom: 0; right: 0; width: auto; height: 68px; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--outline); background: rgba(15, 15, 16, 0.96); }
  .nav a { flex: 1; height: 56px; }
  .content { margin-left: 0; padding: calc(var(--appbar) + 16px) 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 26px; }
  .hero { padding: 36px 16px 24px; border-radius: var(--r-lg); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi .v { font-size: 26px; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .videos { grid-template-columns: minmax(0, 1fr); }
}
.decision .src a { color: inherit; text-decoration: none; }
.decision .src a:hover { color: var(--text-2); text-decoration: underline; }
.tile, .video, .stat { --ring: var(--bg-2); }
.kpi:hover { --ring: var(--surface-2); }

/* ---- v2: overview, inbox, palette, specs --------------------------------------------------------- */

.hero { padding: 34px 24px 24px; }
.hero h1 { font-size: clamp(22px, 2vw, 30px); margin-bottom: 16px; }
.composer-text { display: block; width: 100%; min-height: 50px; max-height: 260px; resize: none; padding: 16px 16px 8px; background: transparent; border: 0; outline: 0; font-size: 19px; line-height: 1.35; overflow-y: auto; }
.composer-text::placeholder { color: var(--muted); }
.kbd { font-size: 14px; padding: 0 8px; }
.btn.primary .svg-icon { color: #fff; }

.g-inbox { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g-players.single { grid-template-columns: minmax(0, 1fr); }
.inbox .row { align-items: center; }
.inbox .title { font-size: 17.5px; }
.inbox .title.clamp2 { cursor: zoom-in; }
.inbox-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.kind-icon.tone-red { background: var(--red-wash); color: var(--red-hot); }
.kind-icon.tone-amber { background: var(--amber-wash); color: var(--amber); }
.kind-icon.tone-violet { background: var(--violet-wash); color: var(--violet); }
.kind-icon.tone-blue { background: var(--blue-wash); color: var(--blue); }
.setup-state { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 2px var(--outline-2); }
.setup-state.ok { background: var(--green); color: #062015; box-shadow: none; }
.setup-state .svg-icon { width: 14px; height: 14px; stroke-width: 3; }
.connect { display: flex; flex-direction: column; gap: 16px; padding: 8px 0 4px; }
.connect h3 { margin: 0 0 8px; font: 700 24px/1.2 var(--font); }
.connect p { margin: 0; font-size: 17.5px; max-width: 760px; }
.btn.claude-white .svg-icon { color: #fff; }

.todo-main { flex: 1; min-width: 0; }
.todo-main .text { display: block; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 2px; font-size: 14.5px; color: var(--muted); min-width: 0; }
.todo-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.palette-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(3, 3, 8, 0.6); display: flex; align-items: flex-start; justify-content: center; padding: 14vh 16px 16px; }
.palette { width: min(760px, 100%); }
.palette-title { margin: 0 0 12px 4px; font: 700 20px/1.2 var(--font-wide); }
.palette .composer { width: 100%; }

.specs { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.spec-list { padding: 16px; position: sticky; top: calc(var(--appbar) + 16px); max-height: calc(100vh - var(--appbar) - 40px); overflow-y: auto; }
.spec-list-head { display: flex; gap: 8px; margin-bottom: 12px; }
.spec-list-head .input { flex: 1; }
.spec-docs { display: flex; flex-direction: column; gap: 4px; }
.spec-doc { display: block; padding: 12px; border-radius: var(--r-md); text-decoration: none; }
.spec-doc:hover { background: var(--surface-2); }
.spec-doc.on { background: var(--red-wash); }
.spec-doc-title { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.spec-doc .meta { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; font-size: 14px; color: var(--muted); }
.spec-editor { padding: 24px 24px 24px; min-width: 0; }
.spec-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.spec-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 15px; color: var(--muted); }
.spec-title { width: 100%; background: transparent; border: 0; outline: 0; padding: 4px 0; font: 700 30px/1.15 var(--font); color: var(--text); border-bottom: 1px solid transparent; }
.spec-title:focus { border-bottom-color: var(--outline-2); }
.spec-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.danger { color: #fff; background: var(--red); border-color: var(--red); }
.spec-tabs { display: flex; gap: 4px; margin: 16px 0 0; border-bottom: 1px solid var(--outline); overflow-x: auto; }
.spec-tab { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; background: transparent; color: var(--text-2); font-size: 16.5px; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.spec-tab:hover { color: var(--text); }
.spec-tab.on { color: var(--text); border-bottom-color: var(--red); }
.spec-tab.add { color: var(--muted); }
.spec-tab .svg-icon { width: 15px; height: 15px; }
.tab-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.tab-x:hover { color: var(--red-hot); }
.spec-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 12px 0; }
.spec-toolbar .grow { flex: 1; }
.spec-toolbar .sep { width: 1px; height: 22px; background: var(--outline-2); margin: 0 8px; }
.tool { min-width: 36px; height: 34px; padding: 0 8px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text-2); font-size: 15.5px; cursor: pointer; display: inline-grid; place-items: center; }
.tool:hover { background: var(--surface-3); color: var(--text); }
.tool .svg-icon { width: 16px; height: 16px; }
.spec-body { display: grid; gap: 0; border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); min-height: 60vh; }
.spec-body.view-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.spec-body.view-write, .spec-body.view-preview { grid-template-columns: minmax(0, 1fr); }
.spec-src { display: block; width: 100%; height: 68vh; min-height: 360px; resize: vertical; padding: 16px 24px; border: 0; outline: 0; background: transparent; color: var(--text); font: 14px/1.65 var(--mono); tab-size: 2; }
.spec-src.drop { box-shadow: inset 0 0 0 2px var(--red); }
.spec-preview { height: 68vh; min-height: 360px; overflow-y: auto; padding: 16px 24px; background: var(--surface); border-left: 1px solid var(--outline); }
.view-preview .spec-preview { border-left: 0; height: auto; min-height: 60vh; }
.spec-preview img, .md img { max-width: 100%; border-radius: var(--r-md); vertical-align: middle; margin: 4px 0; }
.spec-status { font-size: 14.5px; }
.spec-empty { text-align: center; padding: 72px 24px; }
.spec-empty img { height: 46px; opacity: 0.85; }
.spec-empty h2 { margin: 16px 0 8px; font: 700 26px/1.2 var(--font); }
.spec-empty p { max-width: 520px; margin: 0 auto 24px; font-size: 17.5px; }
.md li.task { list-style: none; margin-left: -24px; display: flex; gap: 8px; align-items: baseline; }
.md .tick { width: 15px; height: 15px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 2px var(--outline-2); flex: none; position: relative; top: 2px; }
.md .tick.on { background: var(--green); box-shadow: none; }
.md hr { border: 0; border-top: 1px solid var(--outline-2); margin: 24px 0; }

@media (max-width: 1440px) { .g-inbox { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); } }
@media (max-width: 1199px) {
  .g-inbox { grid-template-columns: minmax(0, 1fr); }
  .specs { grid-template-columns: minmax(0, 1fr); }
  .spec-list { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .spec-body.view-split { grid-template-columns: minmax(0, 1fr); }
  .view-split .spec-preview { border-left: 0; border-top: 1px solid var(--outline); }
}
@media (max-width: 760px) {
  .nowrap, .row .muted { white-space: normal; }
  .row .side { max-width: 40%; }
  /* Phones: the badge and avatars get their own line under the text instead of squeezing the title. */
  .post-row, .error-row { flex-wrap: wrap; }
  .post-row .side, .error-row .side { flex-direction: row; align-items: center; flex-basis: 100%; max-width: none; padding-left: 54px; }
  .inbox .row { flex-wrap: wrap; }
  .inbox-acts { width: 100%; justify-content: flex-end; }
  .kbd { display: none; }
  .composer-foot .select { flex: 1; min-width: 0; }
  .spec-editor { padding: 16px; }
  .spec-title { font-size: 24px; }
  .tool { min-width: 32px; padding: 0 8px; }
}

/* ---- Money -------------------------------------------------------------------------------------- */

.money-page { display: flex; flex-direction: column; gap: var(--gap); }
.money-controls { justify-content: flex-start; }
.sample-banner { padding: 12px 16px; border-radius: var(--r-md); background: repeating-linear-gradient(135deg, rgba(242, 169, 59, 0.22) 0 14px, rgba(242, 169, 59, 0.12) 14px 28px); color: #ffd69e; font: 700 13px/1.3 var(--font-wide); letter-spacing: 0.14em; text-align: center; }
.legend { display: flex; gap: 16px; font-size: 15px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: var(--r-xs); }
.tbl-wrap { overflow-x: auto; margin: 0 -8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th { text-align: left; font-weight: 400; color: var(--muted); font-size: 14.5px; padding: 8px; border-bottom: 1px solid var(--outline-2); white-space: nowrap; }
.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--outline); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr:hover td { background: var(--surface-2); }

/* ---- Coverage ----------------------------------------------------------------------------------- */

.creator { align-items: flex-start; }
.creator .title { display: block; text-decoration: none; font-size: 17.5px; }
.creator .title:hover { text-decoration: underline; }
.creator .spark { height: 24px; margin-top: 8px; max-width: 240px; }
.creator-thumb { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); flex: none; background: var(--surface-3); }
.creator-thumb.mark { display: grid; place-items: center; font: 700 12px/1 var(--font-wide); letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 760px) { .creator-thumb { width: 88px; } .creator { flex-wrap: wrap; } }

/* ---- Wishlist charts and event markers ------------------------------------------------------------ */

.wishlist-charts .legend { flex-wrap: wrap; row-gap: 8px; }
.legend i.round { border-radius: 50%; width: 10px; height: 10px; }
.legend .legend-markers { margin-left: 12px; color: var(--muted); }
.marker { outline: none; }
.marker:hover circle, .marker:focus-visible circle { r: 6; }
.marker:focus-visible line { opacity: 0.9; }
.marker-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 8px; }
.wl-callout { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 16px 16px; border-radius: var(--r-md); background: var(--bg-2); margin-bottom: 16px; }
.wl-callout .k { font-size: 14.5px; color: var(--muted); }
.wl-callout .v { margin-top: 4px; font: 700 26px/1 var(--font-wide); }
.marker-form { margin-top: 12px; }
.marker-form > summary { display: inline-flex; }

/* ---- Work page: composer bar and mind board -------------------------------------------------------- */

.work-bar {
  padding: 24px 24px 16px; border-radius: var(--r-lg); box-shadow: var(--shadow);
  background: linear-gradient(90deg, rgba(15, 15, 16, 0.95) 0%, rgba(15, 15, 16, 0.82) 55%, rgba(15, 15, 16, 0.55) 100%), url('img/hero.jpg') center 40% / cover no-repeat;
}
.work-bar h1 { margin: 0 0 12px; font: 700 22px/1.15 var(--font-wide); }
.work-bar h1 em { font-style: normal; color: var(--red); }
.work-bar .composer { width: 100%; max-width: 980px; margin: 0; }
.work-bar .quick { justify-content: flex-start; margin: 12px 0 0; width: auto; }
/* The Work page fills the window so the board never hangs below the fold: the wheel belongs to the board. */
#page-work, #page-share { min-height: calc(100vh - var(--appbar) - 40px); min-height: calc(100dvh - var(--appbar) - 40px); }
.board-card { overflow: hidden; flex: 1 1 auto; display: flex; flex-direction: column; }
.board { display: flex; flex-direction: column; flex: 1 1 auto; }
.board-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--outline); }
.board-toolbar .sep { width: 1px; height: 22px; background: var(--outline-2); margin: 0 4px; }
.board-toolbar .grow { flex: 1; }
.board-toolbar .icon-btn { font-size: 20px; }
.board-status, .board-zoom { font-size: 14.5px; white-space: nowrap; }
.board-viewport {
  position: relative; overflow: hidden; flex: 1 1 auto; min-height: 260px; touch-action: none; cursor: grab; outline: none;
  background-color: var(--bg-2);
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1.5px);
}
.board-viewport:active { cursor: grabbing; }
.board-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.board-links { position: absolute; left: -100000px; top: -100000px; overflow: visible; pointer-events: none; }
.board-link { fill: none; stroke: var(--text-2); stroke-opacity: 0.4; stroke-width: 2; pointer-events: stroke; cursor: pointer; }
.board-link:hover { stroke: var(--red-hot); stroke-opacity: 0.9; stroke-width: 3; }
.board-link.temp { stroke: var(--red-hot); stroke-opacity: 0.7; pointer-events: none; }
.note {
  position: absolute; width: max-content; min-width: 140px; max-width: 260px; padding: 12px 16px 12px 38px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  font: 400 17px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; letter-spacing: 0;
  cursor: grab; user-select: none; touch-action: none; transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.note:focus-visible { outline: 2px solid var(--red); }
.note.c-rose { background: #3a2430; }
.note.c-amber { background: #3a3122; }
.note.c-sky { background: #1f3045; }
.note.c-violet { background: #2c2747; }
.note.selected { box-shadow: 0 0 0 2px var(--red-hot), 0 4px 18px rgba(0, 0, 0, 0.45); }
.note.done { opacity: 0.62; box-shadow: inset 0 0 0 2px var(--green), 0 2px 10px rgba(0, 0, 0, 0.35); }
.note.done.selected { box-shadow: inset 0 0 0 2px var(--green), 0 0 0 2px var(--red-hot); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-check {
  position: absolute; left: 10px; top: 12px; width: 19px; height: 19px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--outline-2); background: transparent; color: transparent; display: grid; place-items: center;
}
.note-check:hover { border-color: var(--green); }
.note.done .note-check { background: var(--green); border-color: var(--green); color: #062015; }
.note-check .svg-icon { width: 12px; height: 12px; stroke-width: 3.2; }
.note-tools {
  position: absolute; left: 0; bottom: calc(100% + 6px); display: none; align-items: center; gap: 2px; padding: 4px;
  border-radius: var(--r-md); background: var(--surface-3); box-shadow: var(--shadow); white-space: nowrap;
}
.note:hover .note-tools, .note.selected .note-tools { display: flex; }
.note-tool { min-width: 28px; height: 26px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.note-tool:hover { background: var(--surface-hover); color: var(--text); }
.note-tool.claude .svg-icon { width: 15px; height: 15px; color: var(--claude); }
.note-swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); margin: 0 2px; cursor: pointer; padding: 0; }
.note-swatch.c-plain { background: var(--surface-2); }
.note-swatch.c-rose { background: #b05468; }
.note-swatch.c-amber { background: #c49b4b; }
.note-swatch.c-sky { background: #4f8fd1; }
.note-swatch.c-violet { background: #8a7ae0; }
.note-handle {
  position: absolute; right: -7px; top: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-2); border: 2px solid var(--bg-2); opacity: 0; cursor: crosshair;
}
.note:hover .note-handle, .note.selected .note-handle { opacity: 1; }
.note-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.note-chips:not(:empty) { margin-top: 8px; }
.note-chip { font: 600 11.5px/1 var(--font); letter-spacing: 0.04em; padding: 4px 8px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.note-chip.live { background: var(--green-wash); color: var(--green); }
.note-edit, .board-input { font: 400 17px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; color: var(--text); resize: none; outline: none; overflow: hidden; }
.note-edit { display: block; width: 100%; min-width: 200px; padding: 0; border: 0; background: transparent; }
.board-input { position: absolute; width: 250px; min-height: 46px; padding: 12px 16px; border-radius: var(--r-md); border: 2px solid var(--red); background: var(--surface-2); box-shadow: var(--shadow-lg); }
.board-marquee { position: absolute; border: 1px solid var(--blue); background: rgba(94, 170, 255, 0.1); pointer-events: none; }
.board-hint { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 17px; line-height: 1.6; pointer-events: none; }
.board-hint b { color: var(--text-2); font-size: 20px; }
@media (max-width: 760px) {
  .work-bar { padding: 16px; }
  .work-bar h1 { font-size: 18px; }
  #page-work, #page-share { min-height: calc(100vh - var(--appbar) - 112px); min-height: calc(100dvh - var(--appbar) - 112px - env(safe-area-inset-bottom)); }
  .board-toolbar .board-zoom { display: none; }
}

/* ---- Daily goals (top bar, owner only) --------------------------------------------------------- */

.goals { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 12px; height: 100%; }
.goals-ring { width: 22px; height: 22px; flex: none; }
.goals-ring circle { fill: none; stroke-width: 2.6; }
.goals-ring .track { stroke: var(--surface-3); }
.goals-ring .fill { stroke: var(--red); stroke-linecap: round; transition: stroke-dasharray 0.4s ease; }
.goals-ring.all .fill { stroke: var(--green); }
.goals-label {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 400 12px/1 var(--font-wide); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.goals-label span::after { content: ':'; }
.goals-label:hover { color: var(--text-2); }
.goals-list { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.goals-sep { color: var(--muted); flex: none; }
.goal { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; transition: opacity 0.2s; }
.goal.done { opacity: 0.6; }
.goal-tick {
  flex: none; display: inline-grid; place-items: center; width: 21px; height: 21px; padding: 0; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1.5px solid var(--muted); color: transparent; transition: background 0.15s, border-color 0.15s;
}
.goal-tick .svg-icon { width: 12px; height: 12px; stroke-width: 3; }
.goal-tick:hover { border-color: var(--green); }
.goal.done .goal-tick { background: var(--green); border-color: var(--green); color: var(--bg); }
.goal-text {
  min-width: 7em; max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text;
  font-size: 18px; color: var(--text); border-radius: var(--r-sm); padding: 2px 4px; margin: 0 -4px;
}
.goal-text:hover { background: var(--surface-2); }
.goal.done .goal-text { color: var(--green); }
.goal-x {
  flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.goal-x .svg-icon { width: 13px; height: 13px; }
.goal:hover .goal-x, .goal:focus-within .goal-x { opacity: 1; }
.goal-x:hover { color: var(--text); background: var(--surface-2); }
.goals-add {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 8px; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; border: 1px dashed var(--outline-2); color: var(--text-2); font-size: 15px;
}
.goals-add .svg-icon { width: 14px; height: 14px; }
.goals-add:hover { color: var(--text); border-color: var(--muted); }
.goals-add.short { width: 28px; padding: 0; justify-content: center; border-radius: 50%; }
.goals-add.short span { display: none; }
.goals-input {
  width: 15em; min-width: 0; height: 30px; padding: 0 12px; border-radius: var(--r-sm); outline: none;
  background: var(--surface-2); border: 1px solid var(--outline-2); font-size: 16px;
}
.goals-input:focus { border-color: rgba(231, 76, 60, 0.6); }
.goals .chip, .goals-pop .chip { flex: none; }
.chip.carry { padding: 0 2px 0 0; background: transparent; box-shadow: inset 0 0 0 1px var(--outline-2); }
.carry-take { display: inline-flex; gap: 4px; align-items: center; height: 100%; padding: 0 4px 0 12px; border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 14.5px; min-width: 0; }
.carry-take b { font-weight: 400; color: var(--text); max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.carry-take:hover b { text-decoration: underline; }
.carry-x { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.carry-x:hover { color: var(--text); background: var(--surface-3); }
.carry-x .svg-icon { width: 12px; height: 12px; }
.chip.day-done { color: #a3f0cf; background: var(--green-wash); }
.goals-pill {
  display: none; flex: none; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surface-2); border: 0; color: var(--text-2); position: relative;
}
.goals-pill-label { font: 400 11.5px/1 var(--font-wide); letter-spacing: 0.16em; text-transform: uppercase; }
.goals-pill b { font-size: 16px; color: var(--text); }
.goals-pill.all { background: var(--green-wash); }
.goals-pill.all b { color: var(--green); }
.goals-pill.has-carry::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.goals-pill:hover, .goals-pill[aria-expanded="true"] { color: var(--text); background: var(--surface-3); }
.goals.compact .goals-label, .goals.compact .goals-list { display: none; }
.goals.compact .goals-pill { display: inline-flex; }

.goals-pop {
  position: fixed; z-index: 60; padding: 16px 16px 12px; border-radius: var(--r-lg); max-height: calc(100vh - var(--appbar) - 24px); overflow-y: auto;
  background: var(--surface-pop); box-shadow: var(--shadow-lg); border: 1px solid var(--outline);
}
.goals-pop-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.goals-pop-head b { font: 700 12px/1 var(--font-wide); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-2); }
.goals-pop-head .muted { font-size: 15px; }
.goals-col { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.goals-col .goals-sep { display: none; }
.goals-col .goal { max-width: 100%; }
.goals-col .goal-text { max-width: none; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.goals-col .goal-x { opacity: 1; }
.goals-col .goals-add.short { width: auto; padding: 0 12px 0 8px; border-radius: var(--r-pill); }
.goals-col .goals-add.short span { display: inline; }
.goals-col .goals-input { width: 100%; }
.goals-col .chip.carry { max-width: 100%; }
.goals-history { display: flex; flex-direction: column; gap: 8px; }
.goals-col + .goals-history { border-top: 1px solid var(--outline); padding-top: 12px; }
.goals-history-head { display: flex; justify-content: space-between; align-items: baseline; font: 400 11.5px/1.2 var(--font-wide); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.goals-history-head .streak { color: var(--green); letter-spacing: 0.08em; }
.goals-day { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 12px; font-size: 15px; align-items: baseline; }
.goals-day .when { color: var(--muted); white-space: nowrap; }
.goals-day.all .when { color: var(--green); }
.goals-day .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.goals-day .past { display: flex; align-items: baseline; gap: 8px; color: var(--text-2); overflow-wrap: anywhere; }
.goals-day .past .svg-icon { width: 12px; height: 12px; flex: none; color: var(--green); stroke-width: 3; transform: translateY(1px); }
.goals-day .past i { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); margin: 0 1.5px; transform: translateY(-1px); }
.goals-day .past.done { color: var(--text); }
.goals.tiny .goals-pill { padding: 0 12px 0 8px; }
.goals.tiny .goals-pill-label { display: none; }
@media (max-width: 760px) {
  .goals { gap: 8px; }
}

/* ---- Motion and feedback ----------------------------------------------------------------------------
   <html> carries motion-full or motion-reduced (public/motion.js: System follows the OS "Reduce motion", or Full /
   Reduced from Settings). Rules without a motion class are calm and never move anything: fades, colour changes and
   numbers counting in place. Movement (slides, lifts, presses, rings, charts drawing in) lives under .motion-full. */

body { font-variant-numeric: tabular-nums; }

/* Boot: placeholders the size of the real thing, so nothing jumps when the data lands. */
.kpi.skel { min-height: 130px; pointer-events: none; }
.booting .card:empty { min-height: 260px; }
.kpi.skel, .booting .card:empty { animation: skel-pulse 1.6s ease-in-out infinite; }
@keyframes skel-pulse { 50% { opacity: 0.55; } }
.motion-full .kpi.skel, .motion-full .booting .card:empty {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Hover and press: colour everywhere; clickable cards lift and buttons press only with full motion. */
.kpi, a.video, .tile.clickable { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.btn, .icon-btn, .chip-btn, .seg button, .goals-pill, .goals-add, .goal-tick, .note-tool { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.motion-full .kpi, .motion-full a.video, .motion-full .tile.clickable { transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease; }
.motion-full .kpi:hover, .motion-full a.video:hover, .motion-full .tile.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.motion-full .btn, .motion-full .icon-btn, .motion-full .chip-btn, .motion-full .seg button, .motion-full .goals-pill, .motion-full .goals-add, .motion-full .goal-tick, .motion-full .note-tool { transition: transform 0.1s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.motion-full .btn:active:not(:disabled), .motion-full .icon-btn:active:not(:disabled), .motion-full .chip-btn:active, .motion-full .seg button:active, .motion-full .goals-pill:active, .motion-full .goals-add:active, .motion-full .note-tool:active { transform: scale(0.98); }
.input:focus-visible, .select:focus-visible, .goals-input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* KPI tiles flash briefly when a live update changes their number (colour only). */
.kpi.flash { animation: kpi-flash 1.1s ease-out; }
@keyframes kpi-flash { 0%, 30% { background-color: var(--surface-hover); box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.45), var(--shadow); } }

/* Rows that arrive with a live update: a short red wash, sliding in only with full motion. */
.row.fresh { animation: row-glow 1.6s ease-out; }
@keyframes row-glow { 0%, 15% { background-color: var(--red-wash); } }
.motion-full .row.fresh { animation-name: row-in; }
@keyframes row-in {
  0% { opacity: 0; transform: translateY(-6px); background-color: var(--red-wash); }
  15% { opacity: 1; transform: none; background-color: var(--red-wash); }
}

/* Page switches: a fade, plus a small rise with full motion. */
main > section.page:not([hidden]) { animation: page-fade 0.15s ease-out; }
@keyframes page-fade { from { opacity: 0; } }
.motion-full main > section.page:not([hidden]) { animation: page-in 0.18s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* Charts draw themselves in the first time their page is shown; reduced motion shows them drawn, with a fade. */
.motion-reduced .draw-in svg { animation: fade-in 0.3s ease-out; }
.motion-full .draw-in svg .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(min(var(--i, 0), 60) * 8ms); }
.motion-full .draw-in svg .bar.down { transform-origin: 50% 0; }
.motion-full .draw-in svg .line { stroke-dasharray: 1; animation: line-draw 0.9s ease-out both; }
.motion-full .draw-in svg .area, .motion-full .draw-in svg .end-dot { animation: fade-in 0.4s 0.6s ease-out both; }
@keyframes bar-grow { from { transform: scaleY(0); } }
@keyframes line-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* Live heartbeat in the top bar: an opacity pulse, a radiating ring with full motion. */
.live { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.live.ok i { background: var(--green); animation: dot-fade 1.8s ease-in-out infinite; }
.motion-full .live.ok i { animation: pulse 1.8s infinite; }
.live.ok .label { display: none; }
.live.reconnecting { color: #ffd69e; }
.live.reconnecting i { background: var(--amber); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes dot-fade { 50% { opacity: 0.35; } }

@media (max-width: 760px) { .live .label { display: none; } .live { padding: 0 4px; } #fullscreen-btn, #sound-btn { display: none; } }
/* The folded "Today 1/2" pill sits at the start of its space, so it can never spill over the version on the left. */
.goals.compact { justify-content: flex-start; }

/* Settings drawer: per-viewer display settings */
.display-settings { display: flex; flex-direction: column; gap: 8px; }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.setting-row + .setting-row { box-shadow: inset 0 1px 0 var(--outline); }
.setting-row > div:first-child { flex: 1; min-width: 0; }
.setting-row h4 { margin: 0; font-size: 17px; }
.setting-row p { margin: 2px 0 0; font-size: 14.5px; }
@media (max-width: 760px) { .setting-row { flex-direction: column; align-items: flex-start; } }
.crew-settings { display: flex; flex-direction: column; gap: 8px; }
.invite-made { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--green-wash); }
.invite-made > div { flex: 1; }
.invite-link { margin: 4px 0; overflow-wrap: anywhere; color: var(--text); }
.invite-new .input { flex: 1; min-width: 0; height: 32px; }
.btn.danger { color: #fff; background: var(--red); border-color: var(--red); }

/* Shared board: links, images and files on cards, who added them, the drop target */
.note-media:empty { display: none; }
.note-media { margin: 0 0 8px; }
.note-img img { display: block; max-width: 100%; max-height: 240px; border-radius: var(--r-sm); background: var(--surface-3); pointer-events: none; }
.note-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.06); color: var(--text); text-decoration: none; }
.note-file:hover { background: rgba(255, 255, 255, 0.1); }
.note-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-file small { color: var(--muted); white-space: nowrap; }
.note-link { color: #9cc7ff; overflow-wrap: anywhere; }
.note-link:hover { text-decoration: underline; }
.note-chip.by { background: rgba(231, 76, 60, 0.16); color: #ffb8af; }
.board-viewport.dropping { box-shadow: inset 0 0 0 2px var(--red); background-color: var(--surface-2); }
.note-text:empty { display: none; }
.note.has-img { width: 260px; }
.shortcuts { display: flex; flex-direction: column; }
.shortcut { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.shortcut + .shortcut { box-shadow: inset 0 1px 0 var(--outline); }
.shortcut kbd { flex: none; min-width: 190px; font: 600 13.5px/1 var(--mono); color: var(--text); }
.shortcut span { color: var(--text-2); }

/* Overview greeting, empty states with game art, the sidebar's goals */
.hello { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; font-size: 16px; color: var(--text-2); min-height: 28px; }
.hello:empty { display: none; }
.hello b { font: 700 20px/1.2 var(--font); color: var(--text); }
.hello-icon { display: inline-grid; place-items: center; color: var(--amber); }
.hello-icon .svg-icon { width: 20px; height: 20px; }
.hello-live { color: var(--text); }
.empty-art { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r-md); background: var(--bg-2); color: var(--text-2); }
.empty-art img { width: 44px; opacity: 0.85; flex: none; }
.empty-art b { color: var(--text); font-size: 17px; }
.empty-art p { margin: 2px 0 0; font-size: 15px; }
.nav-goals { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; font-size: 14.5px; color: var(--text-2); }
.nav-goals .goals-ring { width: 18px; height: 18px; }
.nav-goals .streak { flex-basis: 100%; color: var(--green); font-size: 13.5px; }
