/* Ghost newsroom uplift — a restrained, dark signal-intelligence workspace. */

:root {
  color-scheme: dark;
  --radius: .9rem;
  --background: #0a1017;
  --foreground: #edf4f7;
  --card: #121b25;
  --card-foreground: #edf4f7;
  --popover: #17222e;
  --popover-foreground: #edf4f7;
  --primary: #57cbd2;
  --primary-foreground: #061416;
  --secondary: #1b2835;
  --secondary-foreground: #dbe7eb;
  --muted-surface: #17222d;
  --muted-foreground: #93a6b2;
  --accent: #17313a;
  --accent-foreground: #8fe5e8;
  --destructive: #f17872;
  --border-token: #263544;
  --input-token: #314252;
  --ring-token: #57cbd2;
  --signal: #57cbd2;
  --signal-soft: #173239;
  --canvas: var(--background);
  --surface: var(--card);
  --surface-soft: var(--muted-surface);
  --sidebar: #0d151e;
  --sidebar-soft: #15212c;
  --ink: var(--foreground);
  --muted: var(--muted-foreground);
  --faint: #748995;
  --line: var(--border-token);
  --line-strong: #384b5c;
  --blue: var(--primary);
  --blue-dark: #74dbe0;
  --blue-soft: var(--accent);
  --cyan: var(--signal);
  --amber: #f2b667;
  --amber-soft: #30291f;
  --green: #6bd5a4;
  --red: var(--destructive);
  --red-soft: #342022;
  --shadow-sm: 0 1px 0 rgba(255,255,255,.025), 0 18px 45px rgba(0,0,0,.16);
  --shadow-lg: 0 36px 100px rgba(0,0,0,.5);
  --display: Bahnschrift, "Aptos Display", "Segoe UI Variable Display", sans-serif;
  --body: Aptos, "Segoe UI Variable Text", "Helvetica Neue", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

::selection { color: #061416; background: #84e4e8; }
html { background: var(--background); color: var(--foreground); scrollbar-color: #435766 #0a1017; }
body {
  color: var(--foreground);
  background:
    radial-gradient(circle at 78% -12%, rgba(56, 129, 142, .18), transparent 34rem),
    radial-gradient(circle at 18% 118%, rgba(181, 119, 62, .08), transparent 31rem),
    var(--background);
  font-family: var(--body);
  font-size: 14px;
}

.signal-overline { color: var(--signal); letter-spacing: .14em; }
.skip-link { color: var(--primary-foreground); background: var(--primary); }
.status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(107, 213, 164, .11); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline-color: rgba(87, 203, 210, .85);
}

input, select, textarea {
  border-color: var(--input-token);
  color: var(--foreground);
  background: #0e1720;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
}
input:hover, select:hover, textarea:hover { border-color: #4a6172; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(87, 203, 210, .12);
}
input::placeholder { color: #687c89; }
select { color-scheme: dark; background-color: #0e1720; }

.primary-button { color: var(--primary-foreground); background: var(--primary); }
.primary-button:hover { color: #041113; background: #78dce1; box-shadow: 0 8px 24px rgba(87,203,210,.17); }
.secondary-button { border-color: #354a59; color: #dce9ed; background: #192733; }
.secondary-button:hover { border-color: #507080; background: #203442; }
.bar-button { border-color: var(--line-strong); color: var(--signal); background: #15212c; }
.bar-button:hover { border-color: var(--signal); background: var(--signal-soft); }
.text-button { color: var(--muted-foreground); }
.text-button:hover { color: var(--signal); }

/* Boot and sign-in */
.boot-screen {
  background:
    radial-gradient(circle at 50% 44%, rgba(87, 203, 210, .08), transparent 22rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    #081018;
  background-size: auto, 48px 48px, 48px 48px, auto;
}
.boot-word { font-weight: 640; letter-spacing: -.06em; }
.boot-line { background: rgba(255,255,255,.08); }
.boot-screen p { color: #8296a2; }
.auth-screen { background: var(--background); }
.auth-shell { background: var(--card); }
.auth-panel { background: #101923; }
.auth-context {
  background:
    linear-gradient(145deg, rgba(10, 19, 27, .2), rgba(5, 12, 18, .92)),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(255,255,255,.03) 60px),
    repeating-linear-gradient(0deg, transparent 0 59px, rgba(255,255,255,.03) 60px),
    #132632;
}
.auth-context::before { border-color: rgba(87,203,210,.36); box-shadow: 0 0 0 78px rgba(87,203,210,.035), 0 0 0 156px rgba(87,203,210,.022); }
.auth-context h1 { display: flex; align-items: center; gap: 20px; font-weight: 680; letter-spacing: -.065em; }
.brand-wordmark { display: inline-flex; align-items: baseline; color: #f3f8fa; font-family: var(--display); font-weight: 680; letter-spacing: -.06em; }
.brand-dot { color: var(--signal); }
.auth-context .brand-wordmark { font-size: clamp(56px, 7vw, 86px); line-height: .9; }
.auth-brand-mark { width: .78em; height: .78em; flex: 0 0 .78em; display: grid; place-items: center; border: 1px solid rgba(87,203,210,.48); border-radius: .24em; color: var(--signal); background: rgba(8,19,26,.56); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 42px rgba(0,0,0,.2); }
.auth-brand-mark svg { width: 68%; height: 68%; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.auth-brand-mark circle { fill: var(--amber); stroke: none; }
.auth-context > p, .auth-capabilities dd { color: #bdcbd2; }
.auth-panel h2 { color: var(--foreground); }
.auth-copy, .auth-footnote { color: var(--muted-foreground); }
.auth-tabs { background: #0d161f; }
.auth-tabs button { color: var(--muted-foreground); }
.auth-tabs button:hover { color: var(--foreground); background: #15212c; }
.auth-tabs button.active { color: var(--foreground); background: #22313d; box-shadow: inset 0 0 0 1px #344757; }
.auth-form label, .stack-form label, .watchlist-form label { color: #afbec6; }

/* Branded shell */
.site-header {
  height: 68px;
  grid-template-columns: 270px minmax(220px, 1fr) auto;
  border-color: #22313e;
  background: rgba(11, 18, 26, .9);
  backdrop-filter: blur(20px) saturate(130%);
}
.brand-word {
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 0 22px;
  border-color: #22313e;
  background: #0b131c;
}
.brand-word > .brand-wordmark { font-size: 25px; line-height: 1; }
.sidebar-mobile-head .brand-wordmark { font-size: 20px; line-height: 1; }
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid #31505d;
  border-radius: 12px;
  color: var(--signal);
  background: linear-gradient(145deg, #192934, #0d171f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 8px 20px rgba(0,0,0,.18);
}
.brand-mark svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { fill: var(--amber); stroke: none; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-word strong { color: #f3f8fa; font: 680 23px/1 var(--display); letter-spacing: -.045em; }
.brand-word small { margin-top: 5px; color: #7f939f; font: 700 8px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.header-context { padding-inline: 26px; }
.header-context > span { color: #7d929f; }
.header-context h1 { color: #f0f5f7; font-size: 20px; font-weight: 650; }
.header-status { padding-inline: 20px; }
.account-trigger { border-color: transparent; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: #2b3c4a; background: #15212c; }
.account-trigger strong { color: var(--foreground); }
.account-trigger small, .account-trigger > svg { color: var(--muted-foreground); }
.user-badge { color: #081416; background: linear-gradient(135deg, #76dce0, #4bb8c1); }
.account-popover { border-color: #314354; background: #15212c; box-shadow: 0 22px 60px rgba(0,0,0,.44); }
.account-popover-rule { background: var(--border-token); }
.account-popover > a { color: var(--foreground); }
.account-popover > a:hover { background: #1d2b37; }
.account-popover button:hover { background: var(--red-soft); }

.app-frame { min-height: calc(100dvh - 68px); grid-template-columns: 270px minmax(0, 1fr); }
.workspace-nav {
  top: 68px;
  height: calc(100dvh - 68px);
  border-color: #22313e;
  color: var(--foreground);
  background:
    linear-gradient(180deg, rgba(87,203,210,.025), transparent 24%),
    #0d151e;
}
.nav-label { color: #667b88; letter-spacing: .16em; }
.sidebar-link { color: #91a3ad; }
.sidebar-link:hover { color: #eaf1f4; background: #15212c; }
.sidebar-link.active { color: #f3f8fa; background: linear-gradient(90deg, #18313a, #152632); box-shadow: inset 0 0 0 1px #26414d; }
.nav-icon { color: #748995; }
.sidebar-link.active .nav-icon { color: var(--signal); background: #0e1a22; box-shadow: inset 0 0 0 1px #2b4c58; }
.sidebar-link small, .sidebar-link.active small { color: #6e8490; }
.nav-foot { border-color: #243440; color: #78909c; }
.nav-foot .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(107,213,164,.12); }

.content-area { max-width: 1800px; padding: 26px clamp(16px, 2.5vw, 42px) 64px; }
.page-trail { margin-bottom: 14px; color: #657b88; }
.page-trail span:nth-child(3) { color: #a8bac2; }
.route-path { color: #556a76; }
.view.active { animation: newsroom-in .3s cubic-bezier(.2,.75,.25,1) both; }
@keyframes newsroom-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.view-bar {
  min-height: 58px;
  padding-inline: 20px;
  border-color: #2a3a48;
  background: linear-gradient(180deg, #17232e, #141f29);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.view-bar strong { color: #dce7eb; font-size: 13px; }
.section-number { color: var(--signal); }
.catalog-readout { color: #7f939e; }

/* Search and result workspace */
.search-layout {
  min-height: 680px;
  grid-template-columns: 338px minmax(0, 1fr);
  border-color: #2a3a48;
  background: #101821;
  box-shadow: 0 24px 65px rgba(0,0,0,.19);
}
.filter-rail { border-color: #293a47; background: #0e171f; }
.query-block { border-color: #293a47; background: #121d27; }
.query-block > label, .field-label { color: #dfe8ec; }
.query-block > small, .filter-note { color: #748a96; }
.query-row:focus-within { box-shadow: 0 0 0 3px rgba(87,203,210,.12); }
.search-submit { color: #061416; background: var(--signal); }
.search-submit:hover { background: #7bdee2; }
.form-actions, .filter-group, .recent-block { border-color: #293a47; }
.filter-group summary { color: #d4dfe4; }
.filter-group summary::before, .filter-group summary b { color: #748994; }
.filter-group summary:hover { background: #15212b; }
.segmented span { border-color: #324554; color: #8fa2ad; background: #0e1720; }
.segmented input:checked + span { border-color: #4aa8b1; color: #9ce7ea; background: #173038; box-shadow: inset 0 0 0 1px #4aa8b1; }
.suggestions { border-color: #344858; background: #15222d; box-shadow: 0 20px 55px rgba(0,0,0,.5); }
.suggestion-item { border-color: #293b49; color: #d5e0e4; background: transparent; }
.suggestion-item:hover, .suggestion-item.active { background: #1b3039; }
.selection-chip { border-color: #315461; color: #a0e8eb; background: #183039; }
.facet-option:hover { background: #17242e; }
.facet-option input { accent-color: var(--signal); }
.recent-search:hover { color: var(--signal); background: #173039; }

.results-pane { padding: 24px clamp(18px, 2.3vw, 34px) 38px; background: #111a23; }
.result-toolbar { border-color: #2b3b48; }
.result-toolbar h2 { color: #f1f6f8; font-size: clamp(22px, 2vw, 30px); font-weight: 660; letter-spacing: -.035em; }
.result-count { border-color: #344656; color: #a7bac2; background: #18242f; }
.result-controls label { color: #718692; }
.active-filter-strip { border-color: #293a47; color: #8498a2; }
.active-filter-strip .filter-pill { border-color: #314553; color: #b2c3ca; background: #16232d; }

.result-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 16px 0 6px;
}
.insight-card {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #2b3d4a;
  border-radius: 12px;
  background: linear-gradient(145deg, #17232d, #131d26);
  padding: 12px 13px;
}
.insight-card span { color: #758b97; font-size: 10px; letter-spacing: .02em; }
.insight-card strong { overflow: hidden; color: #dfe8ec; font: 650 17px/1.1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.insight-card.accent { border-color: #574b39; background: linear-gradient(145deg, #2b251d, #1b1f22); }
.insight-card.accent span { color: #b99a72; }
.insight-card.accent strong { color: var(--amber); }
.loading-insight .skeleton { height: 10px; margin: 0; }
.loading-insight .skeleton.medium { height: 18px; }

.results-list { gap: 12px; padding-top: 10px; }
.result-card {
  grid-template-columns: 172px minmax(0, 1fr) 122px;
  gap: 20px;
  padding: 17px;
  border-color: #2b3c49;
  background: linear-gradient(145deg, #17222d, #121b24 72%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 7px 20px rgba(0,0,0,.08);
}
.result-card:hover { border-color: #42616c; background: linear-gradient(145deg, #192733, #142029 72%); box-shadow: 0 18px 42px rgba(0,0,0,.22); transform: translateY(-2px); }
.result-thumb { border-color: #304450; background: #0c151d; }
.result-thumb::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.result-thumb > span:not(.thumb-kind) { color: #657d89; }
.result-thumb .thumb-kind { color: #d7e4e8; background: rgba(7,15,21,.88); }
.result-meta { color: #758a95; }
.result-meta .source-name { color: var(--signal); }
.result-meta .meta-separator { color: #465a66; }
.result-card h3 { margin-top: 8px; color: #f1f6f8; font-size: 19px; font-weight: 650; white-space: normal; }
.result-excerpt { color: #a6b6bd; font-size: 12px; line-height: 1.58; }
mark { color: #17140f; background: #e9b86d; box-shadow: 0 0 0 2px rgba(233,184,109,.1); }

.result-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.result-metric { min-width: 76px; display: grid; gap: 2px; border-left: 2px solid #3b5360; background: #111b23; padding: 6px 9px; }
.result-metric small { color: #748a95; font: 8px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.result-metric strong { color: #d8e3e7; font: 650 13px var(--display); }
.result-metric.audience-metric { border-color: var(--amber); background: #211e19; }
.result-metric.audience-metric small { color: #aa8d69; }
.result-metric.audience-metric strong { color: var(--amber); }
.result-facts { color: #8296a0; }
.result-facts span::before { color: var(--signal); }
.result-tag { border-color: #314451; color: #91a4ae; background: #121d26; }

.result-actions { gap: 7px; }
.result-actions button, .result-actions .external-action {
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #354958;
  border-radius: 9px;
  color: #a9bac2;
  background: #121c25;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.result-actions button:hover, .result-actions .external-action:hover { border-color: #4e727e; color: #95e5e8; background: #173039; }
.result-actions .media-button { border-color: #4cb9c1; color: #071416; background: var(--signal); }
.result-actions .media-button:hover { border-color: #77dbe0; color: #061416; background: #77dbe0; }
.result-actions .external-action { border-color: #5a4d3b; color: #dfb778; background: #221f1a; }
.result-actions .external-action:hover { border-color: var(--amber); color: #ffd390; background: #2c261d; }

.transcript-panel { border-color: #304350; background: #101a22; }
.transcript-panel summary { color: #a4b5bd; }
.transcript-panel summary::after { color: var(--signal); }
.transcript-passages { gap: 7px; }
.transcript-passage { border-color: #3c6670; color: #a8b9c0; }
.match-jump {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid #293b48;
  border-left: 2px solid var(--signal);
  border-radius: 8px;
  background: #131f28;
  padding: 9px 10px;
  text-align: left;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.match-jump time { color: var(--signal); font: 700 9px/1.5 var(--mono); }
.match-jump span { color: #adbdc4; font-size: 11px; line-height: 1.55; }
.match-jump b { align-self: center; color: #81969f; font-size: 9px; white-space: nowrap; }
.match-jump:hover { border-color: #477481; background: #182a33; transform: translateX(2px); }
.match-jump:hover b { color: var(--signal); }

.pager { border-color: #293a47; }
.pager button { border-color: #354958; color: var(--signal); background: #121d26; }
.pager button:hover:not(:disabled) { border-color: #4e727e; background: #173039; }
.pager button:disabled { color: #566c78; background: #101820; }
.pager span { color: #8397a1; }
.empty-state { border-color: #354956; color: #91a4ad; background: #121d26; }
.empty-state strong { color: #dce7eb; }
.syntax-help { border-color: #2f414f; background: #111b24; }
.syntax-help summary { color: #a4b5bc; }
.syntax-help summary::before { color: #071416; background: var(--signal); }
.syntax-grid { border-color: #2d3e4b; }
.syntax-grid > div { border-color: #2d3e4b; }
.syntax-grid b { color: var(--signal); }
.syntax-grid code { color: #bcc9cf; }
.syntax-grid span { color: #738892; }

/* Timeline, saved work, settings and admin */
.timeline-guide, .timeline-row { border-color: #2c3e4b; }
.timeline-guide { color: #6e838e; }
.timeline-row::before { border-color: #111a23; background: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.timeline-time { color: var(--signal); }
.timeline-title { color: #e6eef1; }
.timeline-station { color: #8da0aa; }
.workspace-panel, .admin-layout, .settings-layout { border-color: #2a3b48; background: #111a23; box-shadow: 0 24px 65px rgba(0,0,0,.19); }
.panel-intro, .settings-intro { border-color: var(--signal); }
.panel-intro h2, .settings-intro h2 { color: #f1f6f8; }
.panel-intro p, .settings-intro p { color: #93a6af; }
.watch-item, .member-item, .stack-form, .watchlist-form, .settings-card { border-color: #2e414f; background: #15212b; }
.watch-item:hover, .member-item:hover { border-color: #44636e; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.watch-type, .timezone-preview small { color: var(--signal); }
.watch-item h4, .member-item h4, .stack-form h3, .settings-card h3 { color: #e6eef1; }
.watch-item p, .member-item p { color: #8ea1aa; }
.delete-button { border-color: #633f42; color: #f39790; background: #302023; }
.delete-button:hover { border-color: var(--red); background: #3d2426; }
.settings-card-head { border-color: #2d3e4b; }
.settings-card-head p, .timezone-preview span { color: #8fa2ac; }
.settings-state { border-color: #354957; color: #9eb0b7; background: #111a23; }
.timezone-preview { border-color: #304350; background: #101a22; }
.timezone-preview strong { color: #e7eff2; }
.created-invite { border-color: #3c626c; color: #b7dfe2; background: #173039; }
.created-invite button { border-color: #4d7c85; color: var(--signal); background: #101b23; }

/* Admin discovery controls */
.taxonomy-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #2b3d4b;
  border-radius: var(--radius-xl);
  background: #111a23;
  box-shadow: 0 24px 65px rgba(0,0,0,.19);
  transition: opacity .2s ease, filter .2s ease;
}
.taxonomy-panel.is-saving { opacity: .62; filter: saturate(.7); pointer-events: none; }
.taxonomy-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: clamp(22px, 4vw, 70px);
  align-items: end;
  padding: clamp(22px, 3vw, 34px);
  border-bottom: 1px solid #2b3d4b;
  background: linear-gradient(145deg, #17242e, #111a23);
}
.taxonomy-head h2 { margin: 8px 0 8px; color: #eff5f7; font: 660 clamp(25px, 3vw, 36px)/1.06 var(--display); letter-spacing: -.045em; }
.taxonomy-head p { max-width: 680px; margin: 0; color: #91a5ae; line-height: 1.6; }
.taxonomy-search { display: grid; gap: 7px; color: #a8bac1; font-size: 11px; font-weight: 650; }
.taxonomy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.taxonomy-group { overflow: hidden; border: 1px solid #2d404e; border-radius: 13px; background: #131e27; }
.taxonomy-group > summary { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; padding: 11px 13px 11px 16px; cursor: pointer; }
.taxonomy-group > summary::-webkit-details-marker { display: none; }
.taxonomy-group > summary:hover { background: #17252f; }
.taxonomy-group > summary > span:first-child { min-width: 0; display: grid; gap: 3px; }
.taxonomy-group > summary b { color: #e2ebee; font-size: 14px; }
.taxonomy-group > summary small { color: #78909b; font-size: 10px; }
.taxonomy-bulk { display: flex; align-items: center; gap: 5px; }
.taxonomy-bulk button { min-height: 32px; border: 1px solid #354a58; border-radius: 8px; color: #96aab3; background: #101a22; padding: 0 9px; font-size: 9px; font-weight: 700; }
.taxonomy-bulk button:hover { border-color: #4d737d; color: var(--signal); background: #183039; }
.taxonomy-bulk button:last-child:hover { border-color: #6d4649; color: #f49a94; background: #322124; }
.taxonomy-list { max-height: 340px; overflow-y: auto; display: grid; align-content: start; border-top: 1px solid #2a3c49; scrollbar-color: #435a68 #111a23; }
.taxonomy-item { min-width: 0; min-height: 57px; display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 12px; border-bottom: 1px solid #263744; padding: 9px 14px; cursor: pointer; content-visibility: auto; contain-intrinsic-size: 57px; transition: background-color .15s ease, opacity .15s ease; }
.taxonomy-item:last-child { border-bottom: 0; }
.taxonomy-item:hover { background: #172630; }
.taxonomy-item > span { min-width: 0; display: grid; gap: 2px; }
.taxonomy-item strong, .taxonomy-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taxonomy-item strong { color: #cbd8dd; font-size: 11px; }
.taxonomy-item small { color: #6f8590; font-size: 9px; }
.taxonomy-item input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.taxonomy-item i { width: 38px; height: 22px; position: relative; border: 1px solid #405362; border-radius: 999px; background: #1b2832; transition: border-color .18s ease, background-color .18s ease; }
.taxonomy-item i::after { content: ""; width: 16px; height: 16px; position: absolute; left: 2px; top: 2px; border-radius: 50%; background: #7d919b; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .2s cubic-bezier(.2,.8,.2,1), background-color .18s ease; }
.taxonomy-item input:checked + i { border-color: #4daab2; background: #1a454b; }
.taxonomy-item input:checked + i::after { background: #8ee4e7; transform: translateX(16px); }
.taxonomy-item:has(input:not(:checked)) > span { opacity: .52; }
.taxonomy-item:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: -3px; }

/* Purposeful motion: one orchestrated entrance and tactile controls. */
.primary-button, .search-submit, .media-button { position: relative; overflow: hidden; isolation: isolate; }
.primary-button::after, .search-submit::after, .media-button::after {
  content: "";
  width: 45%;
  height: 180%;
  position: absolute;
  left: -70%;
  top: -40%;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg);
  transition: left .55s cubic-bezier(.2,.75,.2,1);
}
.primary-button:hover::after, .search-submit:hover::after, .media-button:hover::after { left: 125%; }
.sidebar-link, .nav-icon { transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.sidebar-link:hover .nav-icon { transform: translateX(2px); }
.result-insights .insight-card { animation: metric-arrive .42s cubic-bezier(.2,.8,.2,1) both; }
.result-insights .insight-card:nth-child(2) { animation-delay: 45ms; }
.result-insights .insight-card:nth-child(3) { animation-delay: 90ms; }
.result-insights .insight-card:nth-child(4) { animation-delay: 135ms; }
.results-list > .result-card { animation: card-arrive .45s cubic-bezier(.2,.8,.2,1) both; }
.results-list > .result-card:nth-child(2) { animation-delay: 45ms; }
.results-list > .result-card:nth-child(3) { animation-delay: 90ms; }
.results-list > .result-card:nth-child(4) { animation-delay: 135ms; }
.results-list > .result-card:nth-child(5) { animation-delay: 180ms; }
.results-list > .result-card:nth-child(n+6) { animation-delay: 220ms; }
@keyframes metric-arrive { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes card-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.media-dialog[open] { animation: dialog-arrive .3s cubic-bezier(.18,.82,.2,1) both; }
.media-dialog[open]::backdrop { animation: backdrop-arrive .25s ease both; }
@keyframes dialog-arrive { from { opacity: 0; transform: translateY(18px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes backdrop-arrive { from { opacity: 0; } to { opacity: 1; } }
.toast.show { animation: toast-arrive .4s cubic-bezier(.2,1.4,.35,1) both; }
@keyframes toast-arrive { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* Media desk */
.media-dialog { border-color: #3a4e5e; color: var(--foreground); background: #111a23; box-shadow: var(--shadow-lg); }
.media-dialog::backdrop { background: rgba(3,8,12,.84); backdrop-filter: blur(8px); }
.media-dialog-head { border-color: #2d3f4c; background: #15212b; }
.media-dialog-head h2 { color: #edf4f7; }
.media-dialog-head p { color: #8398a2; }
.media-close { color: #a8b9c0; background: #1e2b36; }
.media-close:hover { color: #ff9890; background: #342326; }
.player-column { background: #071017; }
.media-stage { background: radial-gradient(circle at center, #172c37, #050b10 72%); }
.clip-desk, .media-note { border-color: #263b47; background: #0b151c; }
.clip-desk input { border-color: #36505e; color: #f0f5f7; background: #071118; }
.clip-desk button { border-color: #3b5866; color: #c4d2d8; background: #152832; }
.clip-desk .clip-play { border-color: var(--signal); color: #061416; background: var(--signal); }
.transcript-desk { background: #101a22; }
.transcript-head h3 { color: #e3ecef; }
.transcript-line { color: #afbec5; background: #15212b; }
.transcript-line:hover, .transcript-line.active { border-color: #42717a; background: #183039; }
.transcript-time { color: var(--signal); }
.toast { background: #1b3039; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.toast.error { background: #632d31; }

@media (max-width: 1180px) {
  .site-header { grid-template-columns: 230px minmax(190px, 1fr) auto; }
  .app-frame { grid-template-columns: 230px minmax(0, 1fr); }
  .search-layout { grid-template-columns: 294px minmax(0, 1fr); }
  .result-card { grid-template-columns: 145px minmax(0, 1fr) 105px; gap: 15px; }
}

@media (max-width: 930px) {
  .site-header { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .brand-word { justify-content: center; padding: 0 12px; border-right: 0; }
  .brand-copy { display: none; }
  .app-frame { grid-template-columns: 190px minmax(0, 1fr); }
  .search-layout { grid-template-columns: 1fr; }
  .filter-rail { border-color: #293a47; }
  .taxonomy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .auth-screen { background: var(--background); }
  .auth-shell, .auth-panel { background: #101923; }
  .site-header { height: 64px; grid-template-columns: 58px minmax(0, 1fr) 58px; }
  .mobile-nav-toggle { border-color: #314453; color: #b4c3ca; background: #15212b; }
  .brand-word { display: none; }
  .app-frame { display: block; }
  .workspace-nav { background: #0d151e; }
  .sidebar-mobile-head > span { display: flex; align-items: center; gap: 10px; }
  .sidebar-mobile-head .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar-mobile-head strong { color: #edf4f7; font: 650 20px var(--display); }
  .content-area { padding: 15px 11px 44px; }
  .view-bar { border-radius: 12px 12px 0 0; }
  .search-layout { border-radius: 0 0 12px 12px; }
  .results-pane { padding: 19px 13px 30px; }
  .result-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-card { grid-template-columns: 120px minmax(0, 1fr); }
  .result-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-actions > :only-child { grid-column: 1 / -1; }
  .match-jump { grid-template-columns: 48px minmax(0, 1fr); }
  .match-jump b { grid-column: 2; }
  .media-dialog { background: #111a23; }
  .media-workbench { display: block; height: calc(100dvh - 70px); overflow-y: auto; }
  .player-column { min-height: 0; }
  .transcript-desk { min-height: 480px; }
  .taxonomy-head { grid-template-columns: 1fr; }
  .taxonomy-grid { padding: 10px; }
}

@media (max-width: 460px) {
  .result-card { grid-template-columns: 1fr; }
  .result-visual { max-width: none; }
  .result-actions { grid-column: 1; }
  .result-insights { gap: 7px; }
  .insight-card { min-height: 68px; padding: 11px; }
  .insight-card strong { font-size: 15px; }
  .result-metric { flex: 1; }
  .taxonomy-group > summary { align-items: flex-start; flex-direction: column; }
  .taxonomy-bulk { width: 100%; }
  .taxonomy-bulk button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
  .match-jump:hover, .result-card:hover { transform: none; }
}
