/*
 * Ghost component theme
 * Adapted from the compositional patterns used by shadcn/ui dashboards:
 * semantic tokens, inset shell, compact cards, sheets, popovers and dialogs.
 */

:root {
  --radius: .7rem;
  --background: oklch(.982 .004 255);
  --foreground: oklch(.19 .025 258);
  --card: oklch(1 0 0);
  --card-foreground: var(--foreground);
  --popover: oklch(1 0 0);
  --popover-foreground: var(--foreground);
  --primary: oklch(.54 .19 252);
  --primary-foreground: oklch(.985 .002 255);
  --secondary: oklch(.958 .009 253);
  --secondary-foreground: oklch(.25 .025 258);
  --muted-surface: oklch(.963 .007 255);
  --muted-foreground: oklch(.51 .025 257);
  --accent: oklch(.948 .023 252);
  --accent-foreground: oklch(.34 .095 252);
  --destructive: oklch(.56 .2 28);
  --border-token: oklch(.90 .013 255);
  --input-token: oklch(.90 .013 255);
  --ring-token: oklch(.62 .16 252);
  --signal: oklch(.69 .15 191);
  --signal-soft: oklch(.95 .035 191);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 5px);

  --canvas: var(--background);
  --surface: var(--card);
  --surface-soft: var(--muted-surface);
  --sidebar: var(--card);
  --sidebar-soft: var(--muted-surface);
  --ink: var(--foreground);
  --muted: var(--muted-foreground);
  --faint: oklch(.64 .021 257);
  --line: var(--border-token);
  --line-strong: oklch(.84 .018 255);
  --blue: var(--primary);
  --blue-dark: oklch(.46 .18 252);
  --blue-soft: var(--accent);
  --cyan: var(--signal);
  --green: oklch(.59 .145 157);
  --red: var(--destructive);
  --red-soft: oklch(.97 .022 28);
  --shadow-sm: 0 1px 2px oklch(.19 .025 258 / .035), 0 8px 24px oklch(.19 .025 258 / .045);
  --shadow-lg: 0 28px 72px oklch(.14 .03 258 / .23);
}

html { background: var(--background); }
body {
  background:
    radial-gradient(circle at 76% -20%, oklch(.92 .035 252 / .55), transparent 32rem),
    var(--background);
  color: var(--foreground);
  font-size: 14px;
}

input, select, textarea {
  min-height: 40px;
  border-color: var(--input-token);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 1px 2px oklch(.2 .02 258 / .025);
}
input:hover, select:hover, textarea:hover { border-color: oklch(.77 .025 255); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--ring-token);
  box-shadow: 0 0 0 3px oklch(.62 .16 252 / .14);
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ring-token);
  outline-offset: 2px;
}

.primary-button, .secondary-button, .bar-button, .logout-button {
  border-radius: var(--radius-md);
  box-shadow: none;
}
.primary-button { background: var(--primary); }
.primary-button:hover { background: var(--blue-dark); box-shadow: 0 5px 15px oklch(.54 .19 252 / .18); }
.secondary-button { border-color: var(--border-token); color: var(--secondary-foreground); background: var(--secondary); }
.secondary-button:hover { border-color: var(--line-strong); background: oklch(.93 .012 253); }

/* Authentication: shadcn sign-in split adapted to Ghost. */
.auth-screen {
  min-height: 100dvh;
  padding: 0;
  background: var(--card);
}
.auth-shell {
  width: 100%;
  min-height: 100dvh;
  grid-template-columns: minmax(360px, .85fr) minmax(520px, 1.15fr);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-panel {
  order: 1;
  width: min(520px, 100%);
  margin: auto;
  padding: clamp(32px, 6vw, 72px);
}
.auth-context {
  order: 2;
  justify-content: center;
  padding: clamp(48px, 8vw, 112px);
  background:
    linear-gradient(oklch(.16 .035 257 / .72), oklch(.13 .03 258 / .92)),
    repeating-linear-gradient(90deg, transparent 0 59px, oklch(1 0 0 / .045) 60px),
    repeating-linear-gradient(0deg, transparent 0 59px, oklch(1 0 0 / .045) 60px),
    oklch(.17 .033 258);
}
.auth-context::before {
  width: 520px;
  height: 520px;
  right: -190px;
  top: -190px;
  border-color: oklch(.76 .14 191 / .35);
  box-shadow: 0 0 0 78px oklch(.76 .14 191 / .03), 0 0 0 156px oklch(.76 .14 191 / .025);
}
.auth-context .signal-overline { color: oklch(.82 .13 191); }
.auth-context h1 { font-size: clamp(64px, 8vw, 108px); }
.auth-context > p { max-width: 540px; color: oklch(.83 .025 255); font-size: clamp(16px, 1.4vw, 20px); }
.auth-capabilities { max-width: 540px; border-color: oklch(1 0 0 / .12); }
.auth-capabilities div { grid-template-columns: 42px 1fr; padding: 16px 0; border-color: oklch(1 0 0 / .1); }
.auth-capabilities dt { color: oklch(.82 .13 191); }
.auth-panel h2 { font-size: 30px; }
.auth-tabs {
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--muted-surface);
}
.auth-tabs button {
  border: 0;
  border-radius: var(--radius-md);
}
.auth-tabs button.active {
  border: 0;
  color: var(--foreground);
  background: var(--card);
  box-shadow: 0 1px 3px oklch(.2 .02 258 / .1);
}

/* Inset application shell. */
.site-header {
  height: 64px;
  grid-template-columns: 260px minmax(220px, 1fr) auto;
  border-color: var(--border-token);
  background: oklch(1 0 0 / .9);
  backdrop-filter: blur(18px) saturate(140%);
}
.brand-word {
  padding: 0 22px;
  border-color: var(--border-token);
  background: var(--card);
}
.brand-word strong { color: var(--foreground); font-size: 25px; font-weight: 650; }
.brand-word small { color: var(--muted-foreground); }
.header-context { padding: 0 24px; }
.header-context > span { color: var(--muted-foreground); }
.header-context h1 { font-size: 19px; font-weight: 650; }
.header-status { gap: 8px; padding: 0 18px; }
.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-token);
  border-radius: var(--radius-md);
  background: var(--card);
}
.mobile-nav-toggle svg, .account-trigger svg, .account-popover svg, .nav-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.mobile-nav-toggle svg { width: 20px; }
.account-menu { position: relative; }
.account-trigger {
  max-width: 290px;
  min-height: 44px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] {
  border-color: var(--border-token);
  background: var(--muted-surface);
}
.account-trigger > svg { width: 16px; flex: 0 0 16px; color: var(--muted-foreground); }
.user-badge {
  border-radius: var(--radius-md);
  background: var(--foreground);
}
.account-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border-token);
  border-radius: var(--radius-lg);
  background: var(--popover);
  box-shadow: 0 16px 42px oklch(.17 .03 258 / .16);
}
.account-popover-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
}
.account-popover-head > span:last-child { min-width: 0; }
.account-popover-head strong, .account-popover-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-popover-head small { color: var(--muted-foreground); font-size: 11px; }
.account-popover-rule { height: 1px; background: var(--border-token); }
.account-popover button, .account-popover > a {
  width: calc(100% - 12px);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--destructive);
  padding: 0 10px;
  text-align: left;
  font-weight: 650;
  text-decoration: none;
}
.account-popover button:hover { background: var(--red-soft); }
.account-popover > a { color: var(--foreground); }
.account-popover > a:hover { background: var(--muted-surface); }
.account-popover button svg, .account-popover > a svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-frame {
  min-height: calc(100dvh - 64px);
  grid-template-columns: 260px minmax(0, 1fr);
}
.workspace-nav {
  top: 64px;
  height: calc(100dvh - 64px);
  padding: 18px 12px 14px;
  border-right: 1px solid var(--border-token);
  color: var(--foreground);
  background: var(--card);
  scrollbar-width: thin;
}
.sidebar-mobile-head { display: none; }
.nav-label { padding: 4px 12px 8px; color: var(--muted-foreground); font-size: 9px; }
.nav-label-spaced { margin-top: 18px; }
.workspace-nav nav { gap: 3px; }
.sidebar-link {
  min-height: 52px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  border: 0;
  border-radius: var(--radius-lg);
  color: oklch(.42 .025 257);
  padding: 7px 10px;
}
.sidebar-link:hover {
  color: var(--foreground);
  border: 0;
  background: var(--muted-surface);
  transform: none;
}
.sidebar-link.active {
  color: var(--foreground);
  border: 0;
  background: var(--accent);
}
.sidebar-link.active::before { display: none; }
.nav-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
}
.nav-icon svg { width: 18px; height: 18px; }
.sidebar-link.active .nav-icon { color: var(--primary); background: var(--card); box-shadow: 0 1px 3px oklch(.2 .02 258 / .08); }
.sidebar-link strong { color: inherit; font-size: 12px; font-weight: 650; }
.sidebar-link small, .sidebar-link.active small { color: var(--muted-foreground); }
.nav-foot {
  gap: 10px;
  border-color: var(--border-token);
  color: var(--muted-foreground);
  text-transform: none;
}
.nav-foot .status-dot { background: var(--signal); box-shadow: 0 0 0 3px oklch(.69 .15 191 / .14); }

.content-area {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 22px clamp(16px, 2.5vw, 38px) 56px;
}
.page-trail { margin-bottom: 12px; color: var(--muted-foreground); }
.page-trail span:nth-child(3) { color: var(--foreground); }
.route-path { color: var(--muted-foreground); }
.view.active { animation: component-in .2s ease both; }
@keyframes component-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.view-bar {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--border-token);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--card);
  box-shadow: none;
}
.view-bar strong { font-size: 13px; }
.section-number { color: var(--primary); }
.catalog-readout { color: var(--muted-foreground); }

/* Search components. */
.search-layout {
  min-height: 680px;
  grid-template-columns: 326px minmax(0, 1fr);
  border-color: var(--border-token);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.filter-rail {
  min-height: 680px;
  border-color: var(--border-token);
  background: oklch(.986 .003 255);
}
.mobile-filter-head { display: none; }
.query-block {
  padding: 18px;
  border-color: var(--border-token);
  background: var(--card);
}
.query-block > label, .field-label { color: var(--foreground); }
.query-block > small { color: var(--muted-foreground); }
.query-row input { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.query-row:focus-within { box-shadow: 0 0 0 3px oklch(.62 .16 252 / .12); }
.search-submit {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--primary);
}
.form-actions, .filter-group { border-color: var(--border-token); }
.filter-group { background: transparent; }
.filter-group summary { min-height: 48px; }
.filter-group summary::before { color: var(--muted-foreground); }
.filter-group summary span { color: var(--foreground); font-weight: 650; }
.filter-group summary b { color: var(--muted-foreground); }
.filter-group summary:hover { background: var(--muted-surface); }
.segmented span { border-radius: var(--radius-md); }
.segmented input:checked + span {
  border-color: oklch(.72 .09 252);
  color: var(--primary);
  background: var(--accent);
  box-shadow: inset 0 0 0 1px oklch(.72 .09 252);
}
.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 60;
  border-color: var(--border-token);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px oklch(.17 .03 258 / .16);
}
.suggestion-item:hover, .suggestion-item.active { background: var(--accent); }
.selection-chip {
  border-color: oklch(.83 .055 252);
  background: var(--accent);
  color: var(--accent-foreground);
}
.facet-option { border-radius: var(--radius-md); }
.facet-option:hover { background: var(--muted-surface); }
.facet-option input { accent-color: var(--primary); }
.selected-station {
  border-color: oklch(.8 .065 252);
  border-radius: var(--radius-lg);
  background: var(--accent);
}
.selected-station strong { color: var(--accent-foreground); }
.recent-search:hover { color: var(--primary); background: var(--accent); }

.results-pane { padding: 20px clamp(18px, 2.3vw, 32px) 34px; }
.result-toolbar { min-height: 64px; border-color: var(--border-token); }
.result-toolbar h2 { font-size: clamp(20px, 2vw, 27px); font-weight: 650; }
.result-count {
  border: 1px solid var(--border-token);
  border-radius: 999px;
  background: var(--muted-surface);
  padding: 6px 9px;
  color: var(--muted-foreground);
}
.active-filter-strip { border-color: var(--border-token); scrollbar-width: none; }
.active-filter-strip::-webkit-scrollbar { display: none; }
.active-filter-strip .filter-pill { border-color: var(--border-token); background: var(--muted-surface); }
.results-list { gap: 10px; padding-top: 12px; }
.result-card {
  grid-template-columns: 170px minmax(0, 1fr) 108px;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--border-token);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 1px 2px oklch(.2 .02 258 / .025);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.result-card::before { display: none; }
.result-card:hover {
  border-color: oklch(.78 .045 252);
  background: var(--card);
  box-shadow: 0 10px 28px oklch(.2 .02 258 / .07);
  transform: translateY(-1px);
}
.result-thumb { border-color: var(--border-token); border-radius: var(--radius-lg); }
.result-meta .source-name { color: var(--primary); }
.result-card h3 { font-weight: 650; }
.result-excerpt { color: oklch(.43 .026 257); }
.result-tag { border-color: var(--border-token); border-radius: 999px; background: var(--muted-surface); }
.result-actions button {
  border-color: var(--border-token);
  border-radius: var(--radius-md);
  font-size: 10px;
}
.result-actions button:hover { border-color: oklch(.72 .08 252); color: var(--primary); background: var(--accent); }
.result-actions .media-button { border-color: var(--primary); background: var(--primary); }
.transcript-panel {
  grid-column: 2 / 4;
  border-color: var(--border-token);
  border-radius: var(--radius-lg);
  background: var(--muted-surface);
}
.transcript-passage { border-color: var(--signal); }
.empty-state {
  border-color: var(--border-token);
  border-radius: var(--radius-lg);
  background: var(--muted-surface);
}
.syntax-help { border-color: var(--border-token); border-radius: var(--radius-lg); background: var(--muted-surface); }

/* Workspace cards. */
.workspace-panel, .admin-layout {
  border-color: var(--border-token);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.watchlist-layout, .admin-layout { padding: clamp(22px, 3vw, 34px); }
.panel-intro { border-color: var(--primary); }
.watch-item, .member-item, .stack-form, .watchlist-form {
  border-color: var(--border-token);
  border-radius: var(--radius-lg);
}
.watch-item:hover, .member-item:hover {
  border-color: oklch(.78 .045 252);
  box-shadow: 0 8px 24px oklch(.2 .02 258 / .06);
}
.stack-form { background: var(--muted-surface); }
.timeline-row { border-color: var(--border-token); }
.timeline-row::before { background: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.timeline-title { font-weight: 650; }
.timeline-title small, .timeline-station small { display: block; margin-top: 3px; color: var(--muted-foreground); font: 9px var(--mono); }

.settings-layout {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(380px, 1.3fr);
  gap: clamp(28px, 5vw, 76px);
  border: 1px solid var(--border-token);
  border-top: 0;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--card);
  padding: clamp(26px, 4vw, 54px);
  box-shadow: var(--shadow-sm);
}
.settings-intro { align-self: start; border-left: 3px solid var(--primary); padding-left: 20px; }
.settings-intro h2 { margin: 9px 0 11px; font: 650 clamp(28px, 3vw, 40px)/1.06 var(--display); letter-spacing: -.045em; }
.settings-intro p { max-width: 390px; margin: 0; color: var(--muted-foreground); line-height: 1.65; }
.settings-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--border-token);
  border-radius: var(--radius-xl);
  background: var(--card);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-sm);
}
.settings-card-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border-token); }
.settings-card h3 { margin: 0; font: 650 20px var(--display); }
.settings-card-head p { margin: 5px 0 0; color: var(--muted-foreground); font-size: 12px; }
.settings-state { align-self: start; border: 1px solid var(--border-token); border-radius: 999px; background: var(--muted-surface); color: var(--muted-foreground); padding: 5px 8px; font: 700 9px var(--mono); }
.settings-card > label { display: grid; gap: 7px; color: var(--foreground); font-size: 12px; font-weight: 650; }
.timezone-preview { display: grid; gap: 4px; border: 1px solid var(--border-token); border-radius: var(--radius-lg); background: var(--muted-surface); padding: 16px; }
.timezone-preview span { color: var(--muted-foreground); font-size: 11px; }
.timezone-preview strong { font: 650 clamp(22px, 3vw, 30px) var(--display); }
.timezone-preview small { color: var(--primary); }
.settings-actions { display: flex; align-items: center; gap: 10px; }

/* Media dialog: one controlled scrolling region. */
.media-dialog {
  width: min(1220px, calc(100vw - 32px));
  max-width: none;
  height: min(820px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  border-color: var(--border-token);
  border-radius: var(--radius-xl);
}
.media-dialog::backdrop { background: oklch(.1 .02 258 / .76); }
.media-dialog-head {
  min-height: 74px;
  border-color: var(--border-token);
}
.media-dialog-head > div { min-width: 0; }
.media-close {
  flex: 0 0 44px;
  border-radius: var(--radius-md);
  background: var(--muted-surface);
}
.media-workbench {
  height: calc(100% - 74px);
  min-height: 0;
  overflow: hidden;
}
.player-column { min-height: 0; overflow-y: auto; }
.media-stage { min-height: 390px; }
.transcript-desk { min-height: 0; }
.media-transcript { max-height: none; }
.transcript-line { border-radius: var(--radius-md); }
.transcript-line:hover, .transcript-line.active { border-color: oklch(.78 .06 252); background: var(--accent); }

.nav-overlay {
  position: fixed;
  inset: 64px 0 0;
  z-index: 39;
  border: 0;
  background: oklch(.1 .02 258 / .56);
  backdrop-filter: blur(2px);
}

@media (max-width: 1180px) {
  .site-header { grid-template-columns: 232px minmax(180px, 1fr) auto; }
  .app-frame { grid-template-columns: 232px minmax(0, 1fr); }
  .search-layout, .datetime-layout { grid-template-columns: 306px minmax(0, 1fr); }
  .account-trigger { max-width: 220px; }
  .result-card { grid-template-columns: 150px minmax(0, 1fr) 104px; }
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 48px 112px minmax(0, 1fr) auto;
    padding: 0 10px;
  }
  .mobile-nav-toggle { display: grid; place-items: center; }
  .brand-word { padding: 0 12px; border-right: 0; }
  .brand-word small { display: none; }
  .header-context { padding: 0 12px; }
  .header-context > span { display: none; }
  .header-status { padding: 0; }
  .account-trigger { max-width: 190px; }
  .app-frame { display: block; }
  .workspace-nav {
    position: fixed;
    z-index: 45;
    top: 0;
    left: 0;
    width: min(300px, calc(100vw - 48px));
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    white-space: normal;
    transform: translateX(-104%);
    transition: transform .2s ease;
    box-shadow: 20px 0 60px oklch(.12 .03 258 / .18);
  }
  .workspace-nav.mobile-open { transform: none; }
  .workspace-nav .nav-label { display: block; }
  .workspace-nav nav { display: grid; gap: 3px; }
  .workspace-nav nav + nav { margin-left: 0; }
  .workspace-nav .sidebar-link {
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 7px 10px;
  }
  .workspace-nav .sidebar-link small { display: block; }
  .workspace-nav .nav-foot { display: flex; }
  .sidebar-mobile-head {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 8px 12px;
  }
  .sidebar-mobile-head strong { font: 650 24px var(--display); letter-spacing: -.04em; }
  .sidebar-mobile-head button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--muted-surface);
    font-size: 24px;
  }
  body.nav-open { overflow: hidden; }
  .content-area { padding-top: 18px; }
  .search-layout, .datetime-layout { grid-template-columns: 1fr; }
  .filter-rail { min-height: 0; border-right: 0; border-bottom: 1px solid var(--border-token); }
  .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query-block, .form-actions { grid-column: 1 / -1; }
  .recent-block { display: none; }
  .results-pane { padding-top: 18px; }
  .watchlist-layout, .admin-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .media-workbench { grid-template-columns: 1fr; overflow-y: auto; }
  .player-column { overflow: visible; }
  .transcript-desk { min-height: 430px; }
  .media-transcript { min-height: 280px; max-height: 420px; }
}

@media (max-width: 680px) {
  .site-header { grid-template-columns: 46px 90px minmax(0, 1fr) 46px; height: 60px; padding: 0 8px; }
  .brand-word { padding: 0 8px; }
  .brand-word strong { font-size: 21px; }
  .header-context { padding: 0 7px; }
  .header-context h1 { font-size: 16px; }
  .account-trigger { min-height: 42px; padding: 3px; }
  .account-trigger > span:last-of-type, .account-trigger > svg { display: none; }
  .user-badge { width: 34px; height: 34px; flex-basis: 34px; }
  .nav-overlay { top: 0; }
  .content-area { padding: 12px 10px 34px; }
  .page-trail { display: none; }
  .view-bar { min-height: 48px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .catalog-readout { display: none; }
  .mobile-filter-head {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--border-token);
    background: var(--muted-surface);
  }
  .mobile-filter-head span { font-size: 12px; font-weight: 650; }
  .mobile-filter-head button {
    min-height: 34px;
    border: 1px solid var(--border-token);
    border-radius: var(--radius-md);
    background: var(--card);
    color: var(--primary);
    padding: 0 10px;
    font-size: 11px;
    font-weight: 650;
  }
  .filter-rail:not(.filters-open) .filter-group,
  .filter-rail:not(.filters-open) .recent-block,
  .filter-rail:not(.filters-open) .selected-station { display: none; }
  .search-form { grid-template-columns: 1fr; }
  .query-block, .form-actions { grid-column: auto; }
  .query-block { padding: 14px; }
  .form-actions { padding: 10px 14px; }
  .search-layout { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .results-pane { padding: 15px 12px 24px; }
  .result-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .result-toolbar h2 { white-space: normal; }
  .result-controls { width: 100%; flex-wrap: wrap; }
  .result-controls label { min-width: 110px; flex: 1; }
  .result-controls select { width: 100%; }
  .result-count { margin-left: auto; }
  .result-card { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .result-actions { grid-column: 1 / -1; flex-direction: row; }
  .result-actions button { min-height: 42px; flex: 1; }
  .transcript-panel { grid-column: 1 / -1; }
  .timeline-guide { display: none; }
  .timeline-row { grid-template-columns: 1fr; gap: 5px; padding: 13px 0 13px 23px; }
  .timeline-time { padding-left: 0; }
  .timeline-station { text-align: left; }
  .syntax-grid { grid-template-columns: 1fr; }
  .syntax-grid > div { border-right: 0; }
  .media-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
    border: 0;
    border-radius: 0;
  }
  .media-dialog-head { height: 70px; min-height: 70px; padding: 10px 12px; }
  .media-dialog-head h2 { font-size: 18px; }
  .media-workbench { height: calc(100dvh - 70px); max-height: none; overflow-y: auto; }
  .media-stage { min-height: 250px; padding: 10px; }
  .clip-desk { grid-template-columns: 1fr 1fr; }
  .clip-desk > div, .clip-desk .clip-play { grid-column: 1 / -1; }
  .transcript-desk { min-height: 480px; overflow: visible; padding: 14px; }
  .media-transcript { max-height: none; overflow: visible; }
}

@media (max-width: 430px) {
  .auth-shell { display: block; }
  .auth-context { display: none; }
  .auth-panel { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 20px 40px; }
  .auth-panel-head { align-items: center; }
  .auth-panel h2 { margin-top: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .result-card { grid-template-columns: 1fr; }
  .result-visual { width: min(200px, 100%); }
  .result-card h3 { white-space: normal; }
  .result-actions, .transcript-panel { grid-column: 1; }
  .watchlist-layout, .admin-layout { padding: 18px 14px; }
  .settings-layout { padding: 18px 14px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .watch-item, .member-item { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-nav { transition: none; }
}
