/* Pulse. A newsroom tool for SFM's creative directors: monochrome (busy data screens go mono), dark first with a real
   light mode, Newsreader for headlines and Atkinson Hyperlegible Next for everything else. Colour only means something:
   red is breaking, amber is rising. No grey text anywhere. */
:root {
  --bg: #0a0a0b;
  --bg-2: #101012;
  --surface: #151518;
  --surface-2: #1c1c20;
  --surface-3: #25252a;
  --line: #2c2c32;
  --line-2: #3a3a42;
  --ink: #f2f2f3;
  --ink-strong: #ffffff;
  --ink-soft: #d9d9de;
  --btn: #ffffff;
  --btn-ink: #0a0a0b;
  --breaking: #ff5a4a;
  --rising: #ffb547;
  --upcoming: #8fb8ff;
  --ok: #7ee2a8;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.4);
  --radius: 16px;
  --radius-s: 11px;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible Next', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.4,.64,1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f2;
  --bg-2: #ececea;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --surface-3: #ececea;
  --line: #dcdcd8;
  --line-2: #c9c9c4;
  --ink: #111113;
  --ink-strong: #000000;
  --ink-soft: #26262a;
  --btn: #0a0a0b;
  --btn-ink: #ffffff;
  --breaking: #d93a2b;
  --rising: #b86e00;
  --upcoming: #2f5fbf;
  --ok: #19804a;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f4f2; --bg-2: #ececea; --surface: #ffffff; --surface-2: #f6f6f4; --surface-3: #ececea;
    --line: #dcdcd8; --line-2: #c9c9c4; --ink: #111113; --ink-strong: #000000; --ink-soft: #26262a;
    --btn: #0a0a0b; --btn-ink: #ffffff; --breaking: #d93a2b; --rising: #b86e00; --upcoming: #2f5fbf; --ok: #19804a;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1;
  min-height: 100dvh; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink-strong); font-weight: 560; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 34px; line-height: 1.1; }
h2 { font-size: 23px; line-height: 1.2; }
h3 { font-size: 19px; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--ink-strong); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  height: 60px; padding: 0 20px; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 600 22px/1 var(--serif); color: var(--ink-strong); letter-spacing: -.01em; }
.beat { width: 22px; height: 22px; flex: none; }
.beat path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.scanning .beat path { stroke-dasharray: 60; animation: trace 1.8s var(--ease) infinite; }
@keyframes trace { from { stroke-dashoffset: 60; } to { stroke-dashoffset: -60; } }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a {
  position: relative; padding: 8px 13px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-soft);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--ink-strong); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--ink-strong); }
.top .grow { flex: 1; }
.scan {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); white-space: nowrap;
}
.scan .when { font-weight: 600; }
.status-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.shimmer {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 40%, var(--ink-strong) 50%, var(--ink) 60%, var(--ink) 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.orb { width: 14px; height: 14px; border-radius: 50%; flex: none; position: relative; }
.orb::before, .orb::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--ink-strong); opacity: .9; }
.orb::after { animation: ring 1.6s var(--ease) infinite; }
@keyframes ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2);
  display: grid; place-items: center; font: 700 13px/1 var(--sans); color: var(--ink-strong); cursor: pointer;
  transition: transform .14s var(--ease), border-color .14s;
}
.avatar:hover { border-color: var(--ink-soft); }
.avatar:active { transform: scale(.95); }

/* ---------- buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 11px; border: 1px solid transparent; background: var(--btn); color: var(--btn-ink);
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .14s var(--ease), opacity .14s, background .16s, border-color .16s;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink-strong); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-soft); opacity: 1; }
.btn.quiet { background: transparent; color: var(--ink-strong); padding: 0 11px; }
.btn.quiet:hover { background: var(--surface-2); opacity: 1; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.small svg { width: 15px; height: 15px; }
.iconbtn { width: 38px; padding: 0; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.seg button {
  position: relative; z-index: 1; border: 0; background: none; padding: 7px 13px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-soft); cursor: pointer;
  transition: color .18s var(--ease);
}
.seg button[aria-pressed="true"] { color: var(--btn-ink); }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 9px; background: var(--btn); transition: left .28s var(--spring), width .28s var(--spring); }

.field { display: grid; gap: 7px; }
.field > span { font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.input, textarea.input, select.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink-strong); font-size: 16px; outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
textarea.input { min-height: 88px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--ink-soft); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink-strong) 10%, transparent); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; cursor: pointer; }
.switch { position: relative; width: 46px; height: 28px; flex: none; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-3); cursor: pointer; transition: background .2s var(--ease), border-color .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-soft); transition: transform .26s var(--spring), background .2s; }
.switch[aria-checked="true"] { background: var(--btn); border-color: var(--btn); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--btn-ink); }

/* ---------- layout ---------- */
.app { max-width: 1440px; margin: 0 auto; padding: 0 20px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 28px 0 18px; }
.page-head .grow { flex: 1; }
.meta { font-size: 15px; color: var(--ink); font-weight: 600; }
.today { display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.side { position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow: auto; padding: 22px 4px 20px 0; scrollbar-width: thin; }
.side h3 { font: 700 13px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-strong); margin: 18px 10px 8px; }
.side h3:first-child { margin-top: 6px; }
.client-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px;
  transition: background .14s var(--ease);
}
.client-link:hover { background: var(--surface-2); color: var(--ink-strong); }
.client-link[aria-current="true"] { background: var(--surface-3); color: var(--ink-strong); }
.client-link .name { flex: 1; min-width: 0; }
.count { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-strong); font: 700 12px/22px var(--sans); text-align: center; }
.client-link[aria-current="true"] .count { background: var(--btn); color: var(--btn-ink); }
.fold { border: 0; background: none; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--ink-strong); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.fold:hover { background: var(--surface-2); }
.fold svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.fold[aria-expanded="true"] svg { transform: rotate(90deg); }

.feed { min-width: 0; }
.group { margin: 0 0 30px; }
.group-head { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin: 0 2px 12px; }
.group-head h2 a { text-decoration: none; }
.group-head h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.group-head .niche { font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.angle { padding: 18px 20px 16px; margin-bottom: 12px; transition: opacity .22s var(--ease), transform .22s var(--ease), border-color .16s; }
.angle:hover { border-color: var(--line-2); }
.angle.leaving { opacity: 0; transform: translateX(14px) scale(.985); }
.angle .rides { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.angle .rides a { text-decoration: none; color: var(--ink-strong); }
.angle .rides a:hover { text-decoration: underline; text-underline-offset: 3px; }
.angle h3 { font-size: 21px; margin-bottom: 8px; }
.angle h3 a { text-decoration: none; }
.hook { font: italic 400 18px/1.45 var(--serif); color: var(--ink-strong); margin-bottom: 8px; }
.hook::before { content: '“'; } .hook::after { content: '”'; }
.why { font-size: 15.5px; color: var(--ink); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.actions .grow { flex: 1; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line-2); font: 700 12.5px/1 var(--sans); color: var(--ink-strong); white-space: nowrap; }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.breaking { color: var(--breaking); border-color: color-mix(in srgb, var(--breaking) 45%, transparent); }
.tag.rising { color: var(--rising); border-color: color-mix(in srgb, var(--rising) 45%, transparent); }
.tag.upcoming { color: var(--upcoming); border-color: color-mix(in srgb, var(--upcoming) 45%, transparent); }
.tag.breaking .dot { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tag.kept { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.aud { font-weight: 700; color: var(--ink-strong); }

/* trending column */
.rail { position: sticky; top: 76px; padding-top: 22px; max-height: calc(100dvh - 92px); overflow: auto; overscroll-behavior: contain; }
.rail .card { padding: 6px 6px 8px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 12px 8px; }
.trend-row { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 11px; text-decoration: none; transition: background .14s var(--ease); }
.trend-row:hover { background: var(--surface-2); }
.trend-row .rank { font: 700 14px/1.4 var(--sans); color: var(--ink-strong); }
.trend-row .t { font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--ink-strong); }
.trend-row .m { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.trend-row .n { font: 700 15px/1.4 var(--sans); color: var(--ink-strong); text-align: right; }

/* tables */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.grid th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font: 700 13px/1 var(--sans); color: var(--ink-strong); padding: 13px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.grid th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.grid th button:focus-visible { outline: 2px solid var(--ink-strong); border-radius: 4px; }
.grid th .arrow { opacity: .9; font-size: 11px; }
.grid td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: pointer; transition: background .12s; }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid td.title { font-weight: 700; color: var(--ink-strong); min-width: 260px; }
.grid td.num { text-align: right; font-weight: 700; color: var(--ink-strong); white-space: nowrap; }
.grid th.num { text-align: right; }
.grid td .sub { font-weight: 400; color: var(--ink); margin-top: 4px; font-size: 14px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.search { min-width: 220px; max-width: 320px; }

/* detail pages */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: start; padding-top: 8px; }
.detail.flip { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 22px 0 6px; font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink-strong); padding: 6px 8px 6px 4px; border-radius: 8px; }
.back:hover { background: var(--surface-2); }
.back svg { width: 16px; height: 16px; }
.panel { padding: 22px 22px 20px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin-bottom: 12px; }
.kv { display: grid; gap: 14px; }
.kv dt { font-weight: 700; font-size: 14px; color: var(--ink-strong); margin-bottom: 3px; }
.kv dd { margin: 0; color: var(--ink); }
.big-num { font: 600 44px/1 var(--serif); color: var(--ink-strong); letter-spacing: -.02em; }
.sources { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sources a { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 11px; background: var(--surface-2); text-decoration: none; font-weight: 600; color: var(--ink-strong); transition: background .14s; }
.sources a:hover { background: var(--surface-3); }
.sources a small { display: block; font-weight: 400; color: var(--ink); font-size: 13px; margin-top: 2px; word-break: break-all; }
.post { padding: 13px 14px; border-radius: 12px; background: var(--surface-2); text-decoration: none; display: block; }
.post b { color: var(--ink-strong); }
.post p { margin-top: 4px; color: var(--ink); font-size: 15px; }

/* script */
.script-hooks { display: grid; gap: 8px; margin-bottom: 18px; }
.hook-pick { all: unset; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font: italic 17px/1.45 var(--serif); color: var(--ink-strong); transition: border-color .16s, background .16s; }
.hook-pick:hover { border-color: var(--line-2); }
.hook-pick[aria-checked="true"] { border-color: var(--ink-strong); background: var(--surface-3); }
.hook-pick .radio { flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--ink-soft); display: grid; place-items: center; }
.hook-pick[aria-checked="true"] .radio::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-strong); }
.script-body { white-space: pre-wrap; font-size: 17px; line-height: 1.65; color: var(--ink-strong); padding: 16px 18px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); outline: none; }
.script-body:focus { border-color: var(--ink-soft); }
.label { font-weight: 700; font-size: 14px; color: var(--ink-strong); margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.overlays { display: flex; gap: 8px; flex-wrap: wrap; }
.overlays span { padding: 7px 11px; border-radius: 9px; background: var(--surface-3); font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.writing { display: flex; align-items: center; gap: 12px; padding: 22px 4px; font-size: 16px; }
.versions summary { cursor: pointer; font-weight: 700; color: var(--ink-strong); padding: 6px 0; }

/* empty and states */
.empty { padding: 34px 26px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--ink); max-width: 46ch; margin: 0 auto 16px; }
.skeleton-line { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.6s linear infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* toast */
.toasts { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 13px; background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: toast-in .26s var(--spring); max-width: calc(100vw - 32px); }
.toast button { border: 0; background: color-mix(in srgb, var(--btn-ink) 12%, transparent); color: var(--btn-ink); font-weight: 800; padding: 6px 11px; border-radius: 9px; cursor: pointer; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* menu */
.menu { position: absolute; right: 16px; top: 56px; z-index: 60; width: 250px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgba(0,0,0,.45); transform-origin: top right; animation: pop .18s var(--ease); }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; color: var(--ink-strong); }
.menu .who span { font-size: 14px; color: var(--ink); word-break: break-all; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 9px; background: none; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-strong); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }

/* sign in */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 40px 20px; position: relative; overflow: hidden; }
.gate .glow { position: absolute; inset: -20% -10% auto; height: 70%; background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--ink-strong) 7%, transparent), transparent 70%); pointer-events: none; }
.gate-box { position: relative; width: 100%; max-width: 440px; text-align: center; }
.gate-box .brand { justify-content: center; font-size: 26px; margin-bottom: 30px; }
.gate-box h1 { font-size: 42px; margin-bottom: 14px; }
.gate-box .lead { font-size: 19px; color: var(--ink); margin-bottom: 30px; }
.gate-box .stack { display: grid; gap: 10px; text-align: left; }
.gbtn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; min-height: 48px; font-weight: 700; }
:root[data-theme="light"] .gbtn { border-color: #c9c9c4; }
.gbtn svg { width: 19px; height: 19px; }
.linkish { border: 0; background: none; color: var(--ink-strong); font-weight: 700; cursor: pointer; padding: 10px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.code-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-slots input { text-align: center; font: 700 24px/1 var(--sans); padding: 0; min-height: 56px; }
.err { color: var(--breaking); font-weight: 700; font-size: 14.5px; }
.demo-band { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 14px; }
.demo-band button { border: 0; background: color-mix(in srgb, var(--btn-ink) 14%, transparent); color: var(--btn-ink); font-weight: 800; padding: 5px 10px; border-radius: 8px; cursor: pointer; }

/* sheet (first run, small dialogs) */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 480px; padding: 26px; animation: pop .24s var(--spring); max-height: calc(100dvh - 40px); overflow: auto; }
.sheet h2 { margin-bottom: 10px; }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pick-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; margin-top: 12px; }
.pick-list button { all: unset; cursor: pointer; padding: 11px 13px; border-radius: 11px; background: var(--surface-2); font-weight: 700; color: var(--ink-strong); display: flex; justify-content: space-between; }
.pick-list button:hover { background: var(--surface-3); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.line-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .grow { flex: 1; min-width: 0; }
.line-item b { color: var(--ink-strong); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-strong); padding: 6px 11px; border-radius: 99px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
shinyrock-connect-ai { --cai-ink: var(--ink-strong); --cai-surface: var(--surface-2); --cai-surface-hi: var(--surface-3); --cai-line: var(--line-2); --cai-ok: var(--ok); --cai-radius: 12px; display: block; }

/* enter */
.enter { animation: enter .32s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* ---------- canvas previews: other directions and looks ---------- */
.sheetview .hook::before, .sheetview .hook::after { content: none; }
.sheetview .client-s { display: none; }
.sheetview .sub.hook { font-style: italic; font-family: var(--serif); color: var(--ink-strong); }
.triage { max-width: 760px; margin: 0 auto; padding-top: 30px; }
.triage-top { display: flex; justify-content: space-between; margin-bottom: 12px; }
.triage-card { padding: 34px 34px 30px; transition: transform .22s var(--ease), opacity .22s var(--ease); }
.triage-card h1 { font-size: 38px; margin: 6px 0 16px; }
.triage-card .rides { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; margin-bottom: 8px; }
.triage-card.out-left { transform: translateX(-40px) rotate(-1.5deg); opacity: 0; }
.triage-card.out-right { transform: translateX(40px) rotate(1.5deg); opacity: 0; }
.triage-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; margin-top: 14px; }
.triage-actions .btn { min-height: 52px; font-size: 16px; }
.narrow { max-width: 1040px; margin: 0 auto; }
.radar { display: grid; gap: 16px; }
:root.still *, :root.still *::before, :root.still *::after { animation: none !important; transition: none !important; }
.radar-card { padding: 22px 22px 10px; }
.radar-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.radar-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 13px 12px; margin: 0 -12px; border-top: 1px solid var(--line); text-decoration: none; transition: background .14s; border-radius: 10px; }
.radar-row:hover { background: var(--surface-2); }
.radar-row .who { font-weight: 700; color: var(--ink-strong); }
.radar-row .what b { display: block; color: var(--ink-strong); }
.radar-row .what .hook { display: block; font-size: 16px; margin: 3px 0 0; }
.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 26px; }
.moment { padding: 14px 16px; text-decoration: none; display: grid; gap: 4px; }
.moment .date { font-weight: 800; color: var(--upcoming); font-size: 14px; }
.moment b { color: var(--ink-strong); line-height: 1.3; }
.week-cols { max-width: none; }
:root[data-look="midnight"] { --bg: #0a0f1d; --bg-2: #0d1426; --surface: #111a2e; --surface-2: #17213a; --surface-3: #202c4a; --line: #243052; --line-2: #33416a; --ink: #e8eefc; --ink-strong: #ffffff; --ink-soft: #cdd8f2; --btn: #cfe2ff; --btn-ink: #0a0f1d; --upcoming: #9cc4ff; color-scheme: dark; }
:root[data-look="newsprint"] { --bg: #ffffff; --bg-2: #f6f6f6; --surface: #ffffff; --surface-2: #f4f4f4; --surface-3: #eaeaea; --line: #e2e2e2; --line-2: #cfcfcf; --ink: #111111; --ink-strong: #000000; --ink-soft: #222222; --btn: #000000; --btn-ink: #ffffff; --breaking: #d4111e; --rising: #a35d00; --upcoming: #1d4fd8; --ok: #127a3e; --shadow: 0 1px 2px rgba(0,0,0,.05); color-scheme: light; }
:root[data-look="graphite"] { --bg: #151413; --bg-2: #1a1918; --surface: #1e1c1a; --surface-2: #272421; --surface-3: #312d29; --line: #38332e; --line-2: #4a443d; --ink: #f2ede6; --ink-strong: #fffaf3; --ink-soft: #ddd5ca; --btn: #ffb547; --btn-ink: #1a1408; --rising: #ffc76e; color-scheme: dark; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .today { grid-template-columns: 220px minmax(0, 1fr); }
  .rail { position: static; grid-column: 2; padding-top: 0; }
}
@media (max-width: 900px) {
  h1 { font-size: 29px; }
  .top { gap: 10px; padding: 0 14px; height: 56px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .nav a { flex: 1; text-align: center; padding: 10px 6px; }
  .scan .when { display: none; }
  .app { padding: 0 16px 110px; }
  .today { display: block; }
  .side { position: static; max-height: none; padding: 4px 0 6px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 18px; padding-left: 16px; padding-right: 16px; }
  .side::-webkit-scrollbar { display: none; }
  .side h3, .side .fold, .side .others { display: none; }
  .client-link { flex: none; border: 1px solid var(--line-2); border-radius: 99px; padding: 8px 12px; }
  .rail { margin-top: 10px; }
  .detail, .detail.flip { grid-template-columns: 1fr; }
  .angle { padding: 16px; }
  .angle h3 { font-size: 20px; }
  .grid .hide-s { display: none; }
  .sheetview td.title { min-width: 0 !important; } .sheetview .client-s { display: block; font-size: 13.5px; margin-bottom: 4px; color: var(--ink); }
  .triage-card { padding: 22px 20px; } .triage-card h1 { font-size: 28px; } .triage-actions { grid-template-columns: 1fr 1fr; } .triage-actions .btn:last-child { grid-column: span 2; }
  .radar-row { grid-template-columns: 1fr; gap: 6px; } .radar-head { flex-direction: column; gap: 8px; }
  .menu { right: 10px; }
  .gate-box h1 { font-size: 34px; }
  .search { max-width: none; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
