:root {
  color-scheme: light dark;
  --bg: #f2f2f2;
  --surface: #fafafa;
  --surface-soft: #e8e8e8;
  --text: #0f0f0f;
  --muted: #525252;
  --line: #cccccc;
  --accent: #d44000;
  --accent-strong: #a33000;
  --code-bg: #e0e0e0;
  --shadow: 0 20px 60px rgba(15, 15, 15, 0.1);
  --positive: #2e6e4e;
  --danger: #a33000;
  --reader-bg: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-soft: #242424;
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --line: #333333;
  --accent: #e85500;
  --accent-strong: #ff6a1a;
  --code-bg: #212121;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  --positive: #4caf7d;
  --danger: #ff6a1a;
  --reader-bg: #171717;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
}
button, input { font: inherit; }
a {
  border-radius: 4px;
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
a:hover, a:focus-visible { color: var(--accent-strong); }
.app-shell { background: var(--bg); color: var(--text); min-height: 100vh; }
.shell { margin: 0 auto; max-width: 1180px; padding: 0 clamp(20px, 5vw, 72px) 88px; }

.site-header {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: center;
  min-height: 74px;
  padding: 0 clamp(20px, 5vw, 72px);
  position: relative;
}
.site-header.minimal { justify-content: center; }
.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 750;
  gap: 10px;
  letter-spacing: -0.02em;
  width: fit-content;
}
.brand:hover { color: var(--accent); text-decoration: none; }
.brand-mark {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 0 30px;
  width: min(840px, 82vw);
}
.site-nav.compact { width: min(760px, 82vw); }
.site-nav a {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 1.08rem;
  min-height: 42px;
  padding: 2px 0;
}
.site-nav a.active { color: var(--accent); font-weight: 700; }
.nav-separator { color: var(--muted); }
.header-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  position: absolute;
  right: clamp(18px, 5vw, 72px);
  top: 50%;
  transform: translateY(-50%);
}
.header-actions form { margin: 0; }

.theme-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  opacity: 0.78;
  padding: 0;
  width: 34px;
}
.theme-toggle:hover { color: var(--accent); opacity: 1; }
.theme-toggle svg { height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 18px; }
.theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: block; }

.quiet-button, .primary-button {
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 13px;
}
.quiet-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
}
.quiet-button:hover { border-color: var(--accent); color: var(--accent-strong); }
.primary-button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}
.primary-button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.dashboard { margin: 0 auto; max-width: 1040px; padding-top: clamp(32px, 5vw, 72px); }
.dashboard-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 24px;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.dashboard h1, .report-head h1, .login-card h1 {
  font-size: clamp(2.25rem, 6vw, 4.9rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.98;
  margin: 0 0 18px;
  max-width: 900px;
}
.dashboard-copy { color: var(--muted); margin: 0; max-width: 800px; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.dashboard-actions form { margin: 0; }

.stats-strip, .report-list, .login-card, .report-head, .report-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.stats-strip {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 16px;
}
.stats-strip strong { color: var(--text); }
.ticker-filter { margin: -4px 0 20px; }
.ticker-filter input { max-width: 420px; }
.report-list { overflow: hidden; }
.indicators-dashboard .report-list {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.indicators-dashboard .report-list ul {
  display: grid;
  gap: 22px;
}
ul { list-style: none; margin: 0; padding: 0; }
.report-row { border-top: 1px solid var(--line); }
.report-row:first-child { border-top: 0; }
.report-row.unread {
  border: 1px solid rgba(255, 107, 53, 0.72);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.22), 0 10px 28px rgba(255, 107, 53, 0.08);
  margin: 8px 0;
}
.report-row.channel-row.unread {
  border-color: rgba(255, 107, 53, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.38), 0 14px 34px rgba(255, 107, 53, 0.14);
}
.report-row.unread + .report-row { border-top: 0; }
.report-row mark {
  background: rgba(255, 107, 53, 0.14);
  border: 1px solid rgba(255, 107, 53, 0.45);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.68rem;
  margin-left: 8px;
  padding: 2px 7px;
  text-transform: uppercase;
  vertical-align: middle;
}
.report-row a {
  color: var(--text);
  display: grid;
  gap: 5px;
  padding: 18px 20px;
}
.report-row a:hover {
  background: var(--surface-soft);
  color: var(--accent);
  text-decoration: none;
}
.report-row span { font-size: 0.98rem; font-weight: 700; }
.report-row small { color: var(--muted); font-size: 0.72rem; }
.report-row.empty { color: var(--muted); padding: 18px 20px; }
.indicator-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent));
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.indicator-card:first-child { border-top: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent)); }
.indicator-card-title {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 54%, transparent);
}
.indicator-card-title a {
  padding: 18px 22px 16px;
}
.indicator-card-title h2 {
  color: var(--text);
  font-size: clamp(1.18rem, 2.2vw, 1.65rem);
  font-weight: 690;
  line-height: 1.1;
  margin: 6px 0 6px;
}
.indicator-card-kicker {
  color: var(--accent);
  display: block;
  font-size: 0.78rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.indicator-card-description {
  border-top: 1px solid var(--line);
  padding: 14px 22px 18px;
}
.indicator-card-description p {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 10px 0 0;
}
.indicator-card .indicator-metrics {
  border-top: 0;
  padding: 0;
}
.indicator-card .indicator-chart {
  border-top: 0;
  padding: 16px 22px 14px;
}
.indicator-card .indicator-chart-empty {
  min-height: 120px;
}
.indicator-metrics {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding: 12px 20px 16px;
}
.indicator-metrics span { font-size: 0.78rem; font-weight: 500; }
.indicator-metrics strong { color: var(--text); display: block; font-size: 0.92rem; }
.rotation-candidates {
  margin-bottom: 22px;
  padding: 18px 20px 20px;
}
.rotation-candidates h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}
.rotation-candidate-row {
  border-top: 1px solid var(--line);
}
.rotation-candidate-row:first-child { border-top: 0; }
.rotation-candidate-row a {
  align-items: center;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(88px, 1.1fr) minmax(100px, 0.9fr) repeat(4, minmax(72px, 0.75fr));
  padding: 12px 0;
}
.rotation-candidate-main strong { display: block; font-size: 1rem; }
.rotation-candidate-main em {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-style: normal;
}
.rotation-pill, .rotation-ticker-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  width: fit-content;
}
.rotation-pill {
  font-size: 0.72rem !important;
  padding: 4px 9px;
}
.rotation-ticker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.rotation-ticker-badge {
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
}
.rotation-ticker-badge strong { color: var(--text); font-size: 0.88rem; }
.rotation-ticker-badge small { color: var(--muted); font-size: 0.68rem; }
.rotation-card.state-leader, .rotation-card.state-rotating_in, .rotation-candidate-row.state-leader, .rotation-candidate-row.state-early_rotation,
.rotation-ticker-badge.state-leader, .rotation-ticker-badge.state-early_rotation { border-color: color-mix(in srgb, var(--positive) 54%, var(--line)); }
.rotation-card.state-lagging, .rotation-card.state-weak, .rotation-ticker-badge.state-lagging, .rotation-ticker-badge.state-weak { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.indicator-chart {
  border-top: 1px solid var(--line);
  color: var(--accent);
  padding: 12px 20px 18px;
}
.indicator-chart small {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 4px;
}
.indicator-chart-empty {
  color: var(--muted);
  font-size: 0.82rem;
}
.indicator-sparkline {
  display: block;
  height: auto;
  max-height: 160px;
  overflow: visible;
  width: 100%;
}
.indicator-chart {
  position: relative;
}
.indicator-range-control {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.02em;
  padding: 4px 5px 4px 12px;
  text-transform: uppercase;
}
.indicator-range-control select {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  padding: 7px 26px 7px 10px;
}
.indicator-chart-tooltip {
  background: color-mix(in srgb, var(--panel) 94%, black 6%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  left: 0;
  line-height: 1.35;
  max-width: 220px;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(10px, -50%);
  white-space: nowrap;
  z-index: 4;
}
.indicator-hover-line {
  stroke: currentColor;
  opacity: 0.42;
  pointer-events: none;
  stroke-dasharray: 3 3;
  stroke-width: 1;
}
.indicator-hover-dot {
  fill: var(--accent);
  pointer-events: none;
  stroke: var(--panel);
  stroke-width: 2;
}
.indicator-threshold-line {
  opacity: 0.30;
  pointer-events: none;
  stroke: currentColor;
  stroke-dasharray: 5 5;
  stroke-width: 1.1;
}
.indicator-threshold-label {
  fill: currentColor;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.54;
  pointer-events: none;
}
.indicator-sparkline text {
  fill: currentColor;
  font-size: 10px;
  opacity: 0.72;
}
.indicator-recession-band {
  display: none;
  fill: #808080;
  opacity: 0.20;
  pointer-events: none;
}
.show-recessions .indicator-recession-band {
  display: block;
}
[data-recession-toggle][aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.ema-chart-wrap {
  border-top: 0;
  color: var(--text);
  padding: 16px 22px 14px;
}
.ema-chart-wrap small {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 4px;
}
.ema-chart {
  display: block;
  height: auto;
  max-height: 240px;
  overflow: visible;
  width: 100%;
}
.ema-chart text {
  fill: currentColor;
  font-size: 10px;
  opacity: 0.72;
}
.ema-line { fill: none; opacity: 0.92; }
.ema-line-close { stroke: var(--text); }
.ema-line-9 { stroke: #e85500; }
.ema-line-21 { stroke: #2f80ed; }
.ema-line-55 { stroke: #9b51e0; }
.ema-line-330 { stroke: #27ae60; stroke-dasharray: 5 4; }
.ema-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ema-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 6px;
  padding: 6px 10px;
}
.ema-badge strong { color: var(--text); }
.ema-side-above { border-color: color-mix(in srgb, var(--positive) 65%, var(--line)); color: var(--positive); }
.ema-side-below { border-color: color-mix(in srgb, var(--danger) 65%, var(--line)); color: var(--danger); }
.ema-chart-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 18px 22px;
}

.login-layout { align-items: center; display: grid; min-height: calc(100vh - 160px); padding: clamp(24px, 6vw, 72px) 0; }
.login-card { margin: 0 auto; max-width: 520px; padding: clamp(22px, 5vw, 48px); width: 100%; }
.login-card h1 { font-size: clamp(2.1rem, 7vw, 4.2rem); }
.login-card p { color: var(--muted); }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }
.login-card label { color: var(--muted); display: grid; gap: 8px; }
input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  padding: 12px 14px;
  width: 100%;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.error { color: var(--danger) !important; font-weight: 700; }

.report-page { margin: 0 auto; max-width: 900px; padding-top: clamp(26px, 5vw, 56px); }
.report-head { margin-bottom: 18px; padding: clamp(18px, 4vw, 32px); }
.report-head h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1.05; margin-bottom: 12px; }
.report-head p:not(.eyebrow) { color: var(--muted); margin: 0; }
.back-link { display: inline-block; font-size: 0.8rem; font-weight: 700; margin-bottom: 18px; }
.report-content { padding: clamp(22px, 5vw, 58px); }
.report-content h1 {
  color: var(--accent);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
  margin: 0 0 24px;
}
.report-content h2 {
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  margin: 34px 0 14px;
  padding-bottom: 8px;
}
.report-content h3 { color: var(--text); font-size: 1rem; margin: 24px 0 8px; }
.report-content p, .report-content ul, .report-content ol {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.report-content ul { list-style: disc; padding-left: 1.35rem; }
.report-content ol { padding-left: 1.35rem; }
.report-content li { margin: 0.28rem 0; }
.report-content strong { color: var(--text); }
.report-content hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.report-content a { color: var(--accent); }
.report-content img {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  height: auto;
  margin: 18px auto;
  max-width: 100%;
}
.report-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tts-player {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px;
}
.tts-player .tts-audio {
  height: 30px;
  max-width: min(360px, 70vw);
}
.tts-player .tts-button {
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 5px 9px;
}
.tts-player .tts-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.tts-status {
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0 6px;
}
.analysis-page { max-width: 1120px; }
.analysis-page .report-content { padding: clamp(16px, 3vw, 34px); }
.community-report .report-content { max-width: 100%; }
.report-content code {
  background: var(--code-bg);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.84em;
  padding: 0.12em 0.35em;
}
.report-content pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  padding: 14px 16px;
}
.report-content pre code { background: transparent; padding: 0; }
.report-content table { border-collapse: collapse; display: block; font-size: 0.78rem; margin: 18px 0; overflow-x: auto; width: 100%; }
.report-content th { color: var(--accent); font-weight: 700; padding: 10px 12px; text-align: left; }
.report-content td { border-top: 1px solid var(--line); color: var(--muted); padding: 8px 12px; }
.report-content blockquote { border-left: 2px solid var(--accent); color: var(--muted); font-style: italic; margin: 18px 0; padding-left: 16px; }

.ai-satellites-dashboard {
  hyphens: auto;
  max-width: 1280px;
  overflow-wrap: anywhere;
  word-break: normal;
}
.ai-satellites-dashboard * { min-width: 0; }
.ai-lab-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  margin-bottom: 22px;
}
.ai-control-panel, .ai-output-panel, .ai-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.ai-control-panel h2, .ai-output-panel h2, .ai-chart-card h2, .ai-assumptions h2 { margin: 0 0 8px; }
.ai-control-panel p, .ai-chart-card p { color: var(--muted); margin: 0 0 16px; }
.ai-slider-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-slider-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  padding: 12px;
}
.ai-slider-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: space-between;
}
.ai-slider-head span {
  color: var(--text);
  flex: 1 1 11rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ai-slider-head strong {
  color: var(--accent);
  flex: 0 1 auto;
  font-size: 0.86rem;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}
.ai-slider-card small, .ai-metric-grid small { color: var(--muted); font-size: 0.72rem; line-height: 1.45; }
.ai-slider-card input[type="range"] { accent-color: var(--accent); width: 100%; }
.ai-metric-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-metric-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 5px;
  padding: 12px;
}
.ai-metric-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.ai-metric-grid strong {
  color: var(--text);
  font-size: clamp(0.98rem, 1.8vw, 1.15rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.ai-metric-grid .ai-metric-emphasis { border-color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.ai-chart-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 22px; }
.ai-chart-card svg { color: var(--muted); display: block; height: auto; margin-top: 8px; max-width: 100%; overflow: visible; }
.ai-chart-line { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.ai-chart-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.ai-axis { stroke: var(--line); stroke-width: 1.2; }
.ai-chart-label, .ai-chart-note { fill: var(--muted); font-size: 14px; }
.ai-chart-value { fill: var(--text); font-size: 14px; font-weight: 700; }
.ai-assumptions { margin-top: 0; }
.ai-assumptions ul { display: grid; gap: 10px; list-style: disc; padding-left: 22px; }
.ai-assumptions li { color: var(--muted); }
.ai-assumptions strong { color: var(--text); }

@media (max-width: 1100px) {
  .ai-lab-grid, .ai-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ai-slider-grid, .ai-metric-grid { grid-template-columns: 1fr; }
}

.receipt-scanner {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 960px;
  min-height: calc(100vh - 120px);
}
.receipt-camera-shell {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.receipt-camera-stage {
  align-items: center;
  background: #050505;
  display: grid;
  min-height: min(72vh, 900px);
  overflow: hidden;
  position: relative;
}
.receipt-video {
  display: block;
  height: 100%;
  min-height: min(72vh, 900px);
  object-fit: cover;
  width: 100%;
}
.receipt-camera-placeholder {
  align-self: center;
  background: radial-gradient(circle at 50% 0%, rgba(212, 64, 0, 0.22), transparent 46%), rgba(0, 0, 0, 0.74);
  color: #fff;
  inset: 0;
  padding: clamp(24px, 8vw, 72px);
  position: absolute;
}
.receipt-camera-placeholder h1 { font-size: clamp(2.6rem, 10vw, 6.8rem); line-height: 0.9; margin: 0 0 16px; max-width: 8ch; }
.receipt-camera-placeholder p { max-width: 48ch; }
.receipt-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 16px;
}
.receipt-file-label { cursor: pointer; }
.receipt-status {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin: 0;
  padding: 12px 16px 16px;
  text-align: center;
}
.receipt-status[data-busy="1"] { color: var(--accent); }
.receipt-result { margin-bottom: 40px; }
.receipt-result-grid { display: grid; gap: 18px; }
.receipt-summary-card, .receipt-items-card, .receipt-raw-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.06);
  padding: clamp(16px, 3vw, 26px);
}
.receipt-summary-card h2, .receipt-items-card h2 { margin-top: 0; }
.receipt-summary-card dl { display: grid; gap: 10px; margin: 0; }
.receipt-summary-card dl div { border-top: 1px solid var(--line); display: grid; gap: 4px; padding-top: 10px; }
.receipt-summary-card dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.receipt-summary-card dd { margin: 0; overflow-wrap: anywhere; }
.receipt-items-card table { border-collapse: collapse; width: 100%; }
.receipt-items-card th, .receipt-items-card td { border-bottom: 1px solid var(--line); padding: 9px 6px; text-align: left; vertical-align: top; }
.receipt-items-card th:last-child, .receipt-items-card td:last-child { text-align: right; white-space: nowrap; }
.receipt-raw-card pre { background: var(--code-bg); border-radius: 12px; max-height: 440px; overflow: auto; padding: 14px; white-space: pre-wrap; }

@media (max-width: 820px) {
  .site-nav { gap: 10px; overflow-x: auto; padding: 0 8px; width: min(320px, calc(100vw - 112px)); }
  .site-nav a { font-size: 0.94rem; }
  .dashboard h1 { font-size: 3rem; }
  .receipt-scanner { min-height: calc(100vh - 90px); }
  .receipt-camera-stage, .receipt-video { min-height: 68vh; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-header { min-height: 66px; padding-left: 12px; padding-right: 12px; }
  .header-actions { right: 12px; }
  .header-actions form { display: none; }
  .brand span:last-child { display: none; }
  .shell { padding-left: 16px; padding-right: 16px; }
  .stats-strip { align-items: flex-start; flex-direction: column; }
}
