:root {
  --bg: #070d15;
  --bg-elevated: #0b1220;
  --surface: #111a2a;
  --surface-2: #162238;
  --surface-3: #1c2a43;
  --border: #293852;
  --border-soft: #1d2a40;
  --text: #f4f7fb;
  --text-soft: #c2cbd9;
  --muted: #8793a7;
  --gold: #e2bd42;
  --gold-strong: #f3cc45;
  --gold-deep: #80671e;
  --blue: #61a8ff;
  --blue-deep: #173b65;
  --green: #27d17f;
  --green-deep: #0d5135;
  --orange: #f6a916;
  --red: #ff6374;
  --purple: #a883ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: 244px;
  --topbar: 76px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, rgba(51, 102, 170, .18), transparent 28rem),
    var(--bg);
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(97, 168, 255, .78);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #07111f;
  background: #fff;
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.prototype-banner {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 18px;
  color: #0b1320;
  background: linear-gradient(90deg, #d9b637, #f3d45c, #d9b637);
  font-size: 12px;
  letter-spacing: .02em;
}
.prototype-banner strong { font-size: 11px; letter-spacing: .09em; }

.app-shell {
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: rgba(5, 10, 17, .97);
  border-right: 1px solid var(--border-soft);
  box-shadow: 10px 0 30px rgba(0, 0, 0, .14);
}

.brand-block { padding: 22px 20px 18px; border-bottom: 1px solid var(--border-soft); }
.brand { display: inline-flex; flex-direction: column; text-decoration: none; }
.brand-name { font-size: 23px; font-weight: 850; letter-spacing: .12em; }
.brand-subtitle { margin-top: 4px; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .19em; }
.prototype-chip {
  display: inline-flex;
  margin-top: 13px;
  padding: 5px 8px;
  color: #0b1320;
  background: var(--gold);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.primary-nav {
  display: grid;
  gap: 4px;
  padding: 17px 12px;
  overflow-y: auto;
}
.primary-nav a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--text-soft);
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}
.primary-nav a span:first-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
.primary-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.primary-nav a[aria-current="page"] {
  color: var(--text);
  background: linear-gradient(90deg, rgba(61, 103, 161, .34), rgba(32, 51, 79, .62));
  border-color: #355070;
  box-shadow: inset 3px 0 0 var(--gold);
}
.primary-nav a[aria-current="page"] span:first-child { color: var(--gold); }

.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border-soft); }
.plan-card {
  padding: 13px;
  background: linear-gradient(155deg, rgba(226, 189, 66, .12), rgba(22, 34, 56, .86));
  border: 1px solid rgba(226, 189, 66, .24);
  border-radius: 10px;
}
.plan-card .eyebrow { display: block; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.plan-card strong { display: block; margin: 5px 0 11px; font-size: 12px; }
.usage-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.usage-track { height: 5px; margin: 7px 0 9px; overflow: hidden; background: rgba(255,255,255,.07); border-radius: 999px; }
.usage-track span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.plan-card small { display: block; color: var(--muted); font-size: 9px; line-height: 1.45; }
.account-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 8px;
  border-radius: 9px;
  text-decoration: none;
}
.account-link:hover { background: rgba(255,255,255,.04); }
.account-link strong, .account-link small { display: block; }
.account-link strong { font-size: 11px; }
.account-link small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  color: #08101b;
  background: linear-gradient(145deg, #f3d15b, #9c7923);
  border: 1px solid #f9dc6c;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar);
  display: grid;
  grid-template-columns: minmax(280px, 760px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(7, 13, 21, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.menu-button { display: none !important; }
.global-search {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.global-search > span { color: var(--muted); }
.global-search input {
  min-width: 0;
  height: 42px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
.global-search input::placeholder { color: #6f7d92; }
kbd { padding: 3px 6px; color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 5px; font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.date-button, .icon-button, .profile-button {
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.date-button { height: 42px; padding: 0 13px; white-space: nowrap; font-size: 11px; font-weight: 750; }
.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
}
.notification-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--bg);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  text-decoration: none;
}
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { color: var(--muted); font-size: 9px; }

#main-content { padding: 26px; }
.page { max-width: 1540px; margin: 0 auto; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(25px, 3vw, 38px); line-height: 1.07; letter-spacing: -.025em; }
h2 { font-size: 17px; }
h3 { font-size: 13px; }
.page-heading p { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 9px; }
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { color: #07111d; background: var(--gold); border: 1px solid var(--gold-strong); }
.button-secondary { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.button:hover { filter: brightness(1.08); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.metric-card, .panel {
  background: linear-gradient(145deg, rgba(22, 34, 56, .96), rgba(13, 22, 37, .96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card { position: relative; min-height: 132px; padding: 17px; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -40px; bottom: -55px; background: radial-gradient(circle, var(--metric-glow, rgba(97,168,255,.17)), transparent 68%); }
.metric-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 750; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--metric-color, var(--blue)); background: rgba(255,255,255,.04); border: 1px solid var(--border-soft); border-radius: 8px; }
.metric-value { margin-top: 12px; font-size: 25px; font-weight: 900; letter-spacing: -.03em; }
.metric-note { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.metric-note.positive { color: var(--green); }
.metric-note.warning { color: var(--orange); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 15px; align-items: start; }
.stack { display: grid; gap: 15px; }
.panel { overflow: hidden; }
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-header h2 { margin-bottom: 4px; }
.panel-header p { margin-bottom: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.panel-body { padding: 17px 18px; }
.panel-link { color: var(--blue); font-size: 10px; font-weight: 800; text-decoration: none; }

.chart-shell { position: relative; min-height: 250px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; color: var(--muted); font-size: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }
.line-chart { width: 100%; height: 220px; overflow: visible; }
.line-chart .grid { stroke: #223149; stroke-width: 1; }
.line-chart .area { fill: url(#valueArea); }
.line-chart .ask-line { fill: none; stroke: var(--blue); stroke-width: 3; }
.line-chart .value-line { fill: none; stroke: var(--green); stroke-width: 3; }
.line-chart .dot { stroke: var(--surface); stroke-width: 3; }
.chart-axis { fill: var(--muted); font-size: 9px; }
.chart-tooltip {
  position: absolute;
  min-width: 124px;
  padding: 9px 10px;
  color: var(--text);
  background: #050b13;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -112%);
  transition: opacity .12s ease;
  font-size: 9px;
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip strong { display: block; margin-bottom: 4px; font-size: 10px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
td { color: var(--text-soft); font-size: 11px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(97,168,255,.045); }
.card-cell { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.card-thumb {
  width: 38px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.78);
  background: linear-gradient(145deg, #223b63, #101827 70%);
  border: 1px solid #3a4d69;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
}
.card-cell strong, .card-cell small { display: block; }
.card-cell strong { color: var(--text); font-size: 11px; }
.card-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
}
.status-buy { color: var(--green); background: rgba(39,209,127,.08); }
.status-watch { color: var(--gold); background: rgba(226,189,66,.08); }
.status-verify { color: var(--orange); background: rgba(246,169,22,.08); }
.status-pass { color: var(--red); background: rgba(255,99,116,.08); }
.score { font-weight: 900; color: var(--text); }
.value-positive { color: var(--green); font-weight: 850; }
.value-warning { color: var(--orange); font-weight: 850; }

.signal-list { display: grid; gap: 10px; }
.signal-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 11px; }
.signal-label { color: var(--text-soft); font-size: 10px; font-weight: 750; }
.signal-track { height: 8px; overflow: hidden; background: #09111f; border: 1px solid var(--border-soft); border-radius: 999px; }
.signal-track span { display: block; height: 100%; border-radius: inherit; }
.signal-value { min-width: 42px; color: var(--text); font-size: 10px; font-weight: 850; text-align: right; }

.readiness-ring {
  --progress: 72%;
  width: 142px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 4px auto 16px;
  background: conic-gradient(var(--green) var(--progress), #1a2a41 0);
  border-radius: 50%;
}
.readiness-ring::before { content: ""; width: 108px; aspect-ratio: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.readiness-ring-copy { position: absolute; text-align: center; }
.readiness-ring-copy strong { display: block; font-size: 24px; }
.readiness-ring-copy span { color: var(--muted); font-size: 9px; }
.check-list { display: grid; gap: 8px; }
.check-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px 10px; background: rgba(255,255,255,.025); border: 1px solid var(--border-soft); border-radius: 8px; }
.check-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-size: 10px; font-weight: 900; }
.check-mark.ok { color: var(--green); background: rgba(39,209,127,.09); }
.check-mark.warn { color: var(--orange); background: rgba(246,169,22,.1); }
.check-item strong { display: block; font-size: 10px; }
.check-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.check-item > span:last-child { color: var(--muted); font-size: 9px; }

.activity-list { display: grid; gap: 2px; }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--blue); background: rgba(97,168,255,.08); border: 1px solid rgba(97,168,255,.18); border-radius: 8px; }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 10px; }
.activity-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-time { color: var(--muted); font-size: 9px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 15px; align-items: start; }
.hero-card { padding: 20px; }
.hero-top { display: flex; justify-content: space-between; gap: 18px; }
.hero-identity { display: flex; gap: 16px; }
.large-card-thumb { width: 92px; height: 124px; display: grid; place-items: center; background: linear-gradient(145deg,#345587,#111a29 72%); border: 1px solid #466083; border-radius: 10px; box-shadow: var(--shadow); font-weight: 900; }
.hero-title h1 { font-size: clamp(22px, 2.4vw, 32px); }
.hero-title p { color: var(--muted); font-size: 11px; }
.hero-price { text-align: right; }
.hero-price strong { display: block; font-size: 27px; }
.hero-price span { color: var(--muted); font-size: 9px; }
.key-value-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 18px; }
.key-value { padding: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--border-soft); border-radius: 9px; }
.key-value span, .key-value strong { display: block; }
.key-value span { color: var(--muted); font-size: 9px; }
.key-value strong { margin-top: 5px; font-size: 13px; }

.explanation-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.explanation-card { padding: 14px; background: rgba(255,255,255,.022); border: 1px solid var(--border-soft); border-radius: 10px; }
.explanation-card h3 { display: flex; align-items: center; gap: 7px; }
.explanation-card ul { margin: 0; padding-left: 17px; color: var(--text-soft); font-size: 10px; line-height: 1.7; }

.compare-selectors { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.swap-button { width: 42px; height: 42px; display: grid; place-items: center; color: var(--gold); background: var(--surface-2); border: 1px solid var(--gold-deep); border-radius: 50%; cursor: pointer; }
.comparison-table { display: grid; gap: 2px; }
.comparison-row { display: grid; grid-template-columns: minmax(110px,.65fr) 1fr 1fr; gap: 2px; }
.comparison-row > * { padding: 11px 12px; background: rgba(255,255,255,.025); border: 1px solid var(--border-soft); }
.comparison-row .comparison-label { color: var(--muted); font-size: 9px; font-weight: 800; }
.comparison-row strong { font-size: 11px; }
.winner { color: var(--green); }

.population-bars { display: grid; gap: 12px; }
.population-row { display: grid; grid-template-columns: 72px 1fr 54px; align-items: center; gap: 10px; }
.population-row span { color: var(--text-soft); font-size: 10px; font-weight: 750; }
.population-bar { height: 22px; overflow: hidden; background: #09111f; border: 1px solid var(--border-soft); border-radius: 6px; }
.population-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-deep), var(--blue)); border-radius: inherit; }
.population-row strong { text-align: right; font-size: 10px; }

.grade-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.grade-card { padding: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--border-soft); border-radius: 10px; }
.grade-card.recommended { border-color: var(--gold-deep); box-shadow: inset 0 3px 0 var(--gold); }
.grade-card span, .grade-card strong, .grade-card small { display: block; }
.grade-card span { color: var(--muted); font-size: 9px; }
.grade-card strong { margin: 7px 0 4px; font-size: 21px; }
.grade-card small { color: var(--text-soft); font-size: 9px; line-height: 1.5; }

.evidence-timeline { position: relative; display: grid; gap: 12px; }
.evidence-timeline::before { content: ""; position: absolute; left: 15px; top: 15px; bottom: 15px; width: 1px; background: var(--border); }
.evidence-step { position: relative; display: grid; grid-template-columns: 31px 1fr auto; gap: 11px; align-items: start; }
.step-dot { z-index: 1; width: 31px; height: 31px; display: grid; place-items: center; color: #08101b; background: var(--green); border: 4px solid var(--surface); border-radius: 50%; font-size: 9px; font-weight: 900; }
.step-dot.warn { background: var(--orange); }
.evidence-step strong, .evidence-step small { display: block; }
.evidence-step strong { font-size: 11px; }
.evidence-step small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.evidence-step time { color: var(--muted); font-size: 9px; }

.empty-state { padding: 54px 22px; text-align: center; }
.empty-state-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--gold); background: rgba(226,189,66,.08); border: 1px solid var(--gold-deep); border-radius: 16px; font-size: 22px; }
.empty-state p { max-width: 540px; margin: 0 auto 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.boundary-note { margin-top: 15px; padding: 13px 14px; color: var(--text-soft); background: rgba(226,189,66,.055); border: 1px solid rgba(226,189,66,.22); border-radius: 9px; font-size: 9px; line-height: 1.55; }
.boundary-note strong { color: var(--gold); }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 14px; color: var(--text); background: #08101b; border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: 9px; box-shadow: var(--shadow); font-size: 10px; animation: toast-in .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.mobile-scrim { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 218px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .key-value-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .prototype-banner { justify-content: flex-start; overflow-x: auto; white-space: nowrap; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 32px auto 0 0;
    width: min(86vw, 290px);
    height: calc(100vh - 32px);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .app-shell[data-nav-open="true"] .sidebar { transform: translateX(0); }
  .mobile-scrim { position: fixed; z-index: 35; inset: 32px 0 0; background: rgba(0,0,0,.6); }
  .app-shell[data-nav-open="true"] .mobile-scrim { display: block; }
  .topbar { grid-template-columns: auto minmax(160px,1fr) auto; padding: 12px 14px; }
  .menu-button { display: inline-grid !important; }
  .date-button, .profile-button { display: none; }
  #main-content { padding: 20px 16px; }
  .page-heading { align-items: flex-start; }
  .explanation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .prototype-banner span { display: none; }
  .topbar { gap: 8px; }
  .global-search kbd { display: none; }
  .topbar-actions { gap: 6px; }
  .page-heading { display: grid; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 115px; }
  .panel-header { padding: 15px; }
  .panel-body { padding: 15px; }
  .signal-row { grid-template-columns: 80px 1fr 38px; }
  .hero-top, .hero-identity { display: grid; }
  .hero-price { text-align: left; }
  .large-card-thumb { width: 74px; height: 100px; }
  .key-value-grid, .grade-grid { grid-template-columns: 1fr; }
  .compare-selectors { grid-template-columns: 1fr; }
  .swap-button { justify-self: center; transform: rotate(90deg); }
  .comparison-row { grid-template-columns: 100px 1fr 1fr; }
  .comparison-row > * { padding: 9px 8px; }
  .population-row { grid-template-columns: 58px 1fr 45px; }
  .toast-region { right: 12px; left: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
