:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-2: #111214;
  --panel: rgba(255, 255, 255, 0.078);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --panel-soft: rgba(255, 255, 255, 0.052);
  --stroke: rgba(255, 255, 255, 0.16);
  --stroke-strong: rgba(255, 255, 255, 0.28);
  --text: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.68);
  --faint: rgba(244, 241, 234, 0.43);
  --accent: #8fe0b2;
  --accent-2: #f0c572;
  --accent-3: #ff8c6f;
  --accent-4: #75b8ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
}

body.light {
  color-scheme: light;
  --bg: #f3f0ea;
  --bg-2: #fbf8f1;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-strong: rgba(255, 255, 255, 0.86);
  --panel-soft: rgba(255, 255, 255, 0.5);
  --stroke: rgba(38, 36, 32, 0.14);
  --stroke-strong: rgba(38, 36, 32, 0.24);
  --text: #181614;
  --muted: rgba(24, 22, 20, 0.68);
  --faint: rgba(24, 22, 20, 0.42);
  --shadow: 0 24px 80px rgba(68, 58, 40, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(143, 224, 178, 0.12), transparent 28rem),
    radial-gradient(circle at 78% 12%, rgba(240, 197, 114, 0.11), transparent 25rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  padding: 14px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 9px 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(145%);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.topbar.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-28px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 43px;
  height: 43px;
}

.brand-mark svg {
  width: 41px;
  height: 41px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-letter {
  stroke: var(--text);
  stroke-width: 3.2;
}

.mark-candle {
  stroke: var(--accent-2);
  stroke-width: 2.6;
}

.mark-candle-body {
  stroke: var(--accent-2);
  stroke-width: 2.3;
}

.mark-line {
  stroke: var(--accent);
  stroke-width: 2.7;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 850;
}

.brand-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mobile-nav {
  display: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.main-nav a.active {
  border-color: var(--stroke-strong);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  color: var(--text);
}

.main-nav svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.theme-toggle {
  position: relative;
  grid-template-columns: 1fr 1fr;
  width: 66px;
  padding: 4px;
}

.theme-toggle::before {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  content: "";
  transition: transform 180ms ease;
}

body.light .theme-toggle::before {
  transform: translateX(28px);
}

.sun,
.moon {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
}

.sun {
  border: 2px solid var(--accent-2);
  border-radius: 999px;
}

.moon {
  border-radius: 999px;
  box-shadow: inset -4px 0 0 var(--accent-4);
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
  height: calc(100dvh - 96px);
  min-height: 0;
  margin-top: 12px;
}

.story-rail,
.chart-stage,
.signal-panel,
.category-card,
.subpage-shell,
.watchlist-detail,
.profile-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--panel), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(145%);
}

.story-rail,
.signal-panel {
  align-self: start;
  max-height: calc(100dvh - 96px);
  overflow: auto;
  padding: 12px;
}

.rail-header,
.story-meta,
.chart-toolbar,
.chart-head,
.story-footer,
.panel-section,
.section-heading,
.category-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.rail-header {
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.rail-header span {
  display: grid;
  gap: 4px;
}

.rail-header strong {
  font-family: var(--serif);
  font-size: 1.34rem;
}

.rail-header svg {
  display: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  transition: transform 180ms ease;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.segmented-control {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.segmented-control button.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.story-list {
  display: grid;
  gap: 9px;
}

.story-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.story-card:hover,
.story-card.active {
  border-color: var(--stroke-strong);
  background: var(--panel-strong);
  transform: translateY(-1px);
}

.story-card strong {
  font-size: 0.9rem;
  line-height: 1.26;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.story-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 0.69rem;
  font-weight: 750;
}

.chart-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: clamp(13px, 1.35vw, 18px);
}

.story-meta {
  align-items: start;
}

h1 {
  max-width: 780px;
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 2.45vw, 3.05rem);
  font-weight: 760;
  line-height: 0.98;
  letter-spacing: 0;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(143, 224, 178, 0.25);
  border-radius: 999px;
  background: rgba(143, 224, 178, 0.09);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.confidence-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
}

.story-summary {
  max-width: 760px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.12vw, 1.06rem);
  line-height: 1.45;
}

.chart-toolbar {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.range-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.range-control input {
  width: 190px;
  accent-color: var(--accent);
}

.chart-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.08);
}

.chart-head {
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
}

.metric-stack {
  display: grid;
  gap: 3px;
}

.metric-stack span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.metric-stack strong {
  color: var(--accent);
  font-size: 1.42rem;
  line-height: 1;
}

.asset-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.asset-chip.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.asset-chip i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--chip-color);
  box-shadow: 0 0 14px var(--chip-color);
}

.canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 230px;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.tooltip {
  position: absolute;
  z-index: 3;
  min-width: 180px;
  padding: 10px 11px;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius);
  background: rgba(20, 20, 20, 0.86);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 0.76rem;
  pointer-events: none;
  backdrop-filter: blur(16px);
}

body.light .tooltip {
  background: rgba(255, 255, 255, 0.9);
  color: #171717;
}

.tooltip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
}

.tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  line-height: 1.7;
}

.story-footer {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 750;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.source-strip a {
  padding: 6px 8px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.signal-panel {
  display: grid;
  gap: 12px;
}

.panel-section {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.panel-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.signal-grid {
  display: grid;
  gap: 9px;
}

.signal-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.signal-item span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.signal-item strong {
  font-size: 0.88rem;
}

.signal-item b {
  color: var(--accent);
  font-size: 0.84rem;
}

.annotation-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.annotation-list li {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 9px 9px 9px 17px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.annotation-list li::before {
  position: absolute;
  top: 14px;
  left: 8px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent-3);
  content: "";
}

.annotation-list strong {
  font-size: 0.78rem;
}

.annotation-list time {
  color: var(--faint);
  font-size: 0.69rem;
  font-weight: 850;
}

.category-section,
.subpage-shell {
  margin-top: 18px;
}

.category-section {
  padding-bottom: 30px;
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
}

.section-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.category-rows {
  display: grid;
  gap: 20px;
}

.category-row-head {
  margin-bottom: 10px;
}

.category-row-head h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
}

.view-more {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 850;
}

.category-strip {
  display: grid;
  grid-auto-columns: minmax(280px, 360px);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.category-card {
  display: grid;
  min-height: 420px;
  overflow: hidden;
  scroll-snap-align: start;
}

.category-card-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-pills span,
.card-actions span,
.settings-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.category-card h4 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.18;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.45;
}

.preview-frame {
  height: 180px;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.025);
}

.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
}

.subpage-shell {
  min-height: calc(100dvh - 96px);
  padding: clamp(16px, 2vw, 24px);
}

.watchlist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.watchlist-table {
  display: grid;
  gap: 8px;
}

.watch-row {
  display: grid;
  grid-template-columns: 84px 1fr 92px 78px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.watch-symbol {
  display: grid;
  gap: 2px;
}

.watch-symbol strong {
  font-size: 0.94rem;
}

.watch-symbol span,
.watch-name {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.watch-price,
.watch-change {
  text-align: right;
  font-weight: 850;
}

.watch-change.up {
  color: var(--accent);
}

.watch-change.down {
  color: var(--accent-3);
}

.watchlist-detail {
  padding: 16px;
}

.watchlist-detail h3,
.profile-card h2,
.profile-card h3 {
  margin: 8px 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.watchlist-detail p,
.profile-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.mini-chart-frame {
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.profile-card {
  padding: clamp(18px, 3vw, 28px);
}

.settings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  }

  .signal-panel {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    max-height: none;
  }

  .chart-stage {
    height: 100%;
    min-height: 0;
  }

  .panel-section {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    width: 100%;
    padding: 10px 10px 82px;
    overflow-x: hidden;
  }

  .topbar,
  .topbar.is-hidden {
    position: sticky;
    top: 10px;
    z-index: 40;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 56px;
    opacity: 1;
    transform: none;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand-mark svg {
    width: 38px;
    height: 38px;
  }

  .brand-copy span,
  .icon-button {
    display: none;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    position: fixed !important;
    top: auto !important;
    right: 10px !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: auto;
  }

  .main-nav a {
    min-height: 56px;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(24, 24, 24, 0.62);
    backdrop-filter: blur(24px) saturate(145%);
  }

  body.light .main-nav a {
    background: rgba(255, 255, 255, 0.72);
  }

  .main-nav svg {
    width: 19px;
    height: 19px;
  }

  .main-nav span {
    font-size: 0.72rem;
  }

  .workspace {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: auto;
    gap: 10px;
  }

  .story-rail {
    order: 1;
    max-height: none;
    overflow: hidden;
    padding: 11px;
  }

  .rail-header {
    margin-bottom: 0;
  }

  .rail-header svg {
    display: block;
  }

  .story-rail.is-open .rail-header svg {
    transform: rotate(180deg);
  }

  .story-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 220ms ease, margin-top 220ms ease;
  }

  .story-rail.is-open .story-list {
    max-height: 540px;
    margin-top: 10px;
    overflow: auto;
  }

  .chart-stage {
    order: 2;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: auto;
    padding: 11px;
  }

  .signal-panel {
    order: 3;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    padding: 10px;
    overflow: hidden;
  }

  .story-meta,
  .chart-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-meta {
    gap: 8px;
  }

  h1 {
    font-size: clamp(1.58rem, 7vw, 2.25rem);
    line-height: 1;
  }

  .story-summary {
    display: -webkit-box;
    margin: 9px 0 10px;
    overflow: hidden;
    font-size: 0.86rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .chart-toolbar {
    gap: 9px;
  }

  .segmented-control {
    width: 100%;
  }

  .range-control {
    width: 100%;
  }

  .range-control input {
    flex: 1;
    width: auto;
  }

  .chart-head {
    min-height: auto;
    padding: 9px;
  }

  .metric-stack strong {
    font-size: 1.24rem;
  }

  .asset-toggles {
    justify-content: flex-start;
  }

  .canvas-wrap {
    flex: none;
    height: clamp(230px, 38dvh, 320px);
    min-height: 220px;
  }

  .source-strip {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: clamp(1.85rem, 9vw, 2.8rem);
  }

  .section-heading p {
    font-size: 0.84rem;
    line-height: 1.42;
  }

  .category-strip {
    grid-auto-columns: minmax(238px, 74vw);
    gap: 10px;
  }

  .watchlist-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .watch-row {
    grid-template-columns: 78px 1fr 76px;
  }

  .watch-name {
    display: none;
  }
}

body.is-mobile .desktop-nav {
  display: none;
}

body.is-mobile .mobile-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: fixed !important;
  top: auto !important;
  right: 10px !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  left: 10px !important;
  z-index: 50;
}

body.is-mobile .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.is-mobile .brand-copy span,
body.is-mobile .icon-button {
  display: none;
}

@media (max-width: 860px) {
  .theme-toggle {
    width: 62px;
    height: 40px;
  }

  .theme-toggle::before {
    width: 26px;
  }

  body.light .theme-toggle::before {
    transform: translateX(26px);
  }

  .confidence-pill {
    min-height: 29px;
  }

  .asset-chip {
    min-height: 29px;
    padding: 0 9px;
    font-size: 0.7rem;
  }

  .canvas-wrap {
    height: 238px;
    min-height: 220px;
  }

  .story-footer {
    margin-top: 8px;
  }

  .signal-panel {
    gap: 8px;
  }

  .panel-section {
    gap: 8px;
    padding-bottom: 8px;
  }

  .signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .signal-item {
    padding: 8px;
    gap: 5px;
  }

  .signal-item span,
  .signal-item b {
    font-size: 0.7rem;
  }

  .signal-item strong {
    font-size: 0.78rem;
  }

  .annotation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .annotation-list li {
    padding: 8px 8px 8px 15px;
  }

  .annotation-list strong {
    font-size: 0.7rem;
    line-height: 1.25;
  }

  .annotation-list time {
    font-size: 0.64rem;
  }

  .category-section,
  .subpage-shell {
    margin-top: 12px;
  }

  .category-rows {
    gap: 14px;
  }

  .category-row-head {
    margin-bottom: 8px;
  }

  .category-row-head h3 {
    font-size: 1.35rem;
  }

  .view-more {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.72rem;
  }

  .category-card {
    min-height: 315px;
  }

  .category-card-body {
    gap: 8px;
    padding: 11px;
  }

  .category-pills {
    gap: 5px;
  }

  .category-pills span,
  .card-actions span,
  .settings-list span {
    min-height: 23px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .category-card h4 {
    font-size: 0.98rem;
  }

  .category-card p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .preview-frame {
    height: 125px;
  }

  .card-actions {
    padding: 9px 11px 11px;
  }
}
