:root {
  --bg: #111315;
  --paper: #1c1c1e;
  --paper-strong: #2c2c2e;
  --ink: #f5f5f7;
  --muted: #c7c7cc;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --good: #30d158;
  --bad: #ff453a;
  --blue: #0a84ff;
  --teal: #64d2ff;
  --purple: #bf5af2;
  --rust: #ff453a;
  --serif: "Songti SC", "STSong", Georgia, serif;
  --mono: "SFMono-Regular", "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --display: "Avenir Next Condensed", "DIN Condensed", "Arial Narrow", "PingFang SC", sans-serif;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  background: var(--bg);
  font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% -8%, rgba(53, 208, 189, 0.18), transparent 31rem),
    radial-gradient(circle at 84% 0%, rgba(243, 179, 92, 0.11), transparent 28rem),
    linear-gradient(135deg, #08100f 0%, #101613 46%, #091214 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 82%);
}

button {
  font: inherit;
}

.screen {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 40px);
}

.topbar,
.actions,
.chart-toolbar,
.card-head,
.metric-row,
.legend,
.side-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar,
.chart-toolbar,
.card-head,
.metric-row,
.side-heading {
  justify-content: space-between;
}

.chart-toolbar > div:last-child {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.metric-scope-note {
  max-width: 23rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
  line-height: 1.35;
  text-align: right;
}

.topbar {
  position: relative;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
  padding: 4px 2px 10px;
}

.title-block {
  display: grid;
  gap: 12px;
  max-width: 900px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(67, 211, 157, 0.4);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(67, 211, 157, 0.18), rgba(108, 164, 255, 0.08));
  color: #d9fff0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(53, 208, 189, 0.12);
}

.eyebrow,
.panel-title,
.method-label,
.metric-label,
.control-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  color: #bed3cb;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 980px;
  color: #f7fff9;
  font-family: var(--display);
  font-size: clamp(3.1rem, 8vw, 8.4rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.82;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.16rem, 1.8vw, 1.75rem);
  line-height: 1.08;
}

.hero-copy {
  max-width: 620px;
  color: #aac0b8;
  font-size: clamp(0.98rem, 1.4vw, 1.2rem);
  font-weight: 760;
  line-height: 1.55;
}

.source-pill,
.icon-button,
.summary-card,
.side-panel,
.chart-panel,
.status-strip,
.segmented,
.method-strip,
.memory-detail-panel,
.taiwan-demand-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 33, 31, 0.86), rgba(14, 23, 21, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.source-pill.official {
  border-color: color-mix(in oklch, var(--good) 34%, var(--line));
  background: rgba(67, 211, 157, 0.12);
  color: #b8ffe3;
}

.source-pill.sample {
  border-color: color-mix(in oklch, var(--purple) 36%, var(--line));
  background: rgba(243, 179, 92, 0.12);
  color: #ffd79a;
}

.source-pill.mixed {
  border-color: color-mix(in oklch, var(--blue) 32%, var(--line));
  background: rgba(108, 164, 255, 0.12);
  color: #c7dcff;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.icon-button.spinning {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(190px, 310px) 1fr;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-strip strong {
  color: var(--ink);
  font-family: var(--mono);
}

.method-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 8px;
  background: rgba(162, 184, 174, 0.16);
}

.method-strip div {
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 13px 15px;
  background: rgba(22, 33, 31, 0.78);
}

.method-strip strong {
  font-size: 0.9rem;
  line-height: 1.35;
}

.coverage-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 25, 24, 0.68);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.coverage-badge.compact {
  margin-top: 0;
  margin-bottom: 10px;
}

.coverage-badge span,
.coverage-badge strong {
  color: var(--ink);
  font-weight: 850;
}

.coverage-badge em {
  color: var(--muted);
  font-style: normal;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-head .panel-title {
  margin-bottom: 7px;
}

.freshness-note {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: right;
}

.chart-control-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 15, 0.42);
}

.control-group {
  display: grid;
  gap: 7px;
}

.segmented.compact button {
  min-height: 30px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.series-chip,
.focus-pill {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(22, 33, 31, 0.86);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.series-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  cursor: pointer;
}

.series-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.series-chip.active {
  border-color: color-mix(in oklch, var(--blue) 34%, var(--line));
  background: rgba(108, 164, 255, 0.14);
  color: #c7dcff;
}

.focus-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.8fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.summary-card {
  position: relative;
  min-height: 188px;
  overflow: hidden;
  border-radius: 8px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: auto 16px 14px 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.summary-card:nth-child(1)::before {
  background: linear-gradient(90deg, var(--teal), transparent);
}

.summary-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--blue), transparent);
}

.summary-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--purple), transparent);
}

.summary-card:hover,
.summary-card.active {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.summary-card.active {
  background: linear-gradient(180deg, rgba(28, 43, 40, 0.92), rgba(13, 24, 23, 0.92));
}

.summary-card.scope-card {
  cursor: default;
  border-style: dashed;
  background:
    linear-gradient(150deg, rgba(53, 208, 189, 0.1), transparent 54%),
    rgba(12, 19, 18, 0.76);
}

.summary-card.scope-card::before {
  background: linear-gradient(90deg, var(--ink), transparent);
}

.summary-card.scope-card:hover {
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}

.summary-card.scope-card strong {
  font-size: clamp(1.2rem, 1.9vw, 1.72rem);
  line-height: 1.12;
}

.card-head span {
  font-weight: 850;
}

code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.summary-card .metric-label {
  display: block;
  margin-top: 18px;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  line-height: 1;
}

.metric-row,
.summary-analysis {
  margin-top: 18px;
  color: var(--ink);
  font-size: 0.82rem;
}

.summary-analysis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.analysis-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(238, 243, 237, 0.045);
  font-weight: 800;
}

.analysis-cell small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.analysis-cell b {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.analysis-cell em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-cell.signal {
  border-color: color-mix(in oklch, var(--blue) 18%, var(--line));
  background: rgba(108, 164, 255, 0.1);
}

.analysis-cell.signal b {
  color: #c7dcff;
}

.card-freshness {
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.delta.positive {
  color: var(--good);
  background: rgba(67, 211, 157, 0.08);
}

.delta.negative {
  color: var(--bad);
  background: rgba(255, 110, 104, 0.08);
}

.delta.neutral {
  color: var(--muted);
}

.analysis-cell.delta.positive b {
  color: var(--good);
}

.analysis-cell.delta.negative b {
  color: var(--bad);
}

.analysis-cell.delta.neutral b {
  color: var(--muted);
}

.workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.side-panel,
.chart-panel,
.memory-detail-panel,
.taiwan-demand-panel {
  border-radius: 8px;
  padding: 18px;
}

.side-panel {
  background:
    linear-gradient(180deg, rgba(53, 208, 189, 0.08), transparent 42%),
    rgba(16, 25, 24, 0.86);
}

.panel-title {
  margin-bottom: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--teal) 14%, transparent);
}

.note,
.chart-caption,
.method-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.note {
  margin-top: 10px;
}

.chart-caption {
  margin: -4px 0 10px;
}

.method-note {
  margin-top: 8px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
}

dd {
  margin: 0;
  font-weight: 850;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 8px;
  box-shadow: none;
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segmented button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.segmented button.selected {
  background: var(--ink);
  color: #08100f;
}

.axis-pair strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(58, 58, 60, 0.7);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.chart-frame {
  width: 100%;
  min-height: 390px;
  padding-top: 0;
}

.chart-frame.small {
  min-height: 286px;
}

.prelim-panel .chart-frame.small {
  min-height: 500px;
}

.three-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.flat-chart-card {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 15, 0.4);
  padding: 14px;
}

.flat-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.flat-chart-head span {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.42rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flat-chart-head code {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(238, 243, 237, 0.05);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.memory-detail-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.memory-detail-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.memory-detail-switch:empty,
.memory-detail-focus:empty {
  display: none;
}

.memory-detail-switch button {
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(58, 58, 60, 0.7);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0 12px;
}

.memory-detail-switch button:hover {
  border-color: var(--line-strong);
}

.memory-detail-switch button.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #08100f;
}

.memory-detail-focus {
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr) minmax(220px, 0.6fr);
  margin-top: 2px;
  padding: 14px;
  background: rgba(8, 16, 15, 0.44);
}

.memory-focus-main {
  display: grid;
  gap: 6px;
}

.memory-focus-main span,
.memory-focus-kpis small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-focus-main h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  line-height: 1.05;
  margin: 0;
}

.memory-focus-main strong {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.7vw, 2.25rem);
  line-height: 1;
}

.memory-focus-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.memory-focus-kpis span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: rgba(238, 243, 237, 0.05);
}

.memory-focus-kpis b {
  color: #c7dcff;
  font-size: 1rem;
}

.memory-source-link {
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  display: grid;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
  padding: 10px;
  text-decoration: none;
}

.memory-source-link:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.memory-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.memory-table-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(238, 243, 237, 0.035), transparent),
    rgba(8, 16, 15, 0.55);
  color: var(--ink);
}

.memory-table-card:nth-child(1) {
  border-color: color-mix(in oklch, var(--teal) 32%, var(--line));
}

.memory-table-card:nth-child(2) {
  border-color: color-mix(in oklch, var(--blue) 32%, var(--line));
}

.memory-table-card:nth-child(3) {
  border-color: color-mix(in oklch, var(--purple) 32%, var(--line));
}

.memory-table-head {
  display: grid;
  gap: 6px;
}

.memory-table-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-table-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.05;
}

.memory-table-head strong {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1;
}

.memory-table-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
}

.memory-table {
  display: grid;
  gap: 0;
  margin: 0;
}

.memory-table div {
  display: grid;
  grid-template-columns: minmax(110px, 0.48fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.memory-table dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.memory-table dd {
  min-width: 0;
  margin: 0;
  color: #c7dcff;
  font-size: 0.92rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.memory-table dd.positive {
  color: var(--good);
}

.memory-table dd.negative {
  color: var(--bad);
}

.memory-table a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.taiwan-demand-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.taiwan-hs-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.taiwan-hs-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 15, 0.5);
}

.taiwan-hs-card:nth-child(1),
.taiwan-hs-card:nth-child(2) {
  border-color: color-mix(in oklch, var(--good) 28%, var(--line));
  background: rgba(67, 211, 157, 0.07);
}

.taiwan-hs-card.active {
  border-color: color-mix(in oklch, var(--blue) 28%, var(--line));
  background: rgba(108, 164, 255, 0.08);
}

.taiwan-hs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.taiwan-hs-head code {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(238, 243, 237, 0.05);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
}

.taiwan-hs-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.taiwan-hs-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.18;
}

.taiwan-hs-card p,
.taiwan-hs-card em {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 750;
  line-height: 1.45;
}

.taiwan-hs-card em {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.hs-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hs-link-row a {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(238, 243, 237, 0.05);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

.hs-link-row a:hover {
  border-color: var(--line-strong);
}

.taiwan-demand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.taiwan-route-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 15, 0.5);
}

.taiwan-route-card:first-child {
  border-color: color-mix(in oklch, var(--purple) 36%, var(--line));
}

.taiwan-route-card:last-child {
  border-color: color-mix(in oklch, var(--blue) 34%, var(--line));
}

.taiwan-route-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.taiwan-route-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.taiwan-route-head h3 {
  margin: 4px 0 0;
  font-size: clamp(1.15rem, 1.7vw, 1.65rem);
  line-height: 1.08;
}

.taiwan-route-head strong {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1;
}

.route-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.route-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(238, 243, 237, 0.045);
}

.route-stats dd {
  min-width: 0;
  color: #c7dcff;
  overflow-wrap: anywhere;
}

.route-stats dd.positive {
  color: var(--good);
}

.route-stats dd.negative {
  color: var(--bad);
}

.taiwan-route-card p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.5;
  margin: 0;
}

.route-chart {
  min-height: 250px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.76fr);
  gap: 14px;
}

.prelim-panel {
  grid-column: 1 / -1;
}

.stacked-legend {
  flex-wrap: wrap;
}

.stacked-legend .line-key {
  height: 3px;
  border-radius: 999px;
  transform: translateY(-1px);
}

.lower-grid > .chart-panel {
  grid-column: 1 / -1;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: inherit;
  color: var(--muted);
}

.provisional-snapshot {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(260px, 1fr);
  align-items: stretch;
  gap: 14px;
  min-height: 320px;
  padding: 16px;
}

.provisional-snapshot.compact {
  grid-template-columns: 1fr;
  min-height: 250px;
  padding: 10px 2px 0;
}

.snapshot-copy,
.snapshot-bars {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 15, 0.48);
  padding: 16px;
}

.snapshot-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.snapshot-copy span,
.snapshot-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.snapshot-copy strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 2.3rem);
  line-height: 1.05;
}

.snapshot-copy p {
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.snapshot-bars {
  display: grid;
  gap: 14px;
  align-content: center;
}

.snapshot-row {
  display: grid;
  gap: 8px;
}

.snapshot-row div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.snapshot-row strong {
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 900;
}

.snapshot-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ded0;
}

.snapshot-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.snapshot-track i.positive {
  background: var(--teal);
}

.snapshot-track i.negative {
  background: var(--rust);
}

.snapshot-track i.neutral {
  background: var(--muted);
}

.snapshot-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 800;
}

.provisional-snapshot > .memory-source-link {
  grid-column: 1 / -1;
  justify-self: start;
}

.may-bridge-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(420px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--paper-strong) 86%, white);
}

.may-bridge-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.may-bridge-copy span,
.chart-inline-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.may-bridge-copy span {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.may-bridge-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.2vw, 2.05rem);
  line-height: 1.08;
}

.may-bridge-copy p,
.chart-inline-note {
  margin: 0;
  line-height: 1.55;
}

.may-bridge-copy p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.may-bridge-copy dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0;
}

.may-bridge-copy dl div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(238, 243, 237, 0.045);
}

.may-bridge-copy dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.may-bridge-copy dd {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.may-bridge-copy dd.positive {
  color: var(--good);
}

.may-bridge-copy dd.negative {
  color: var(--bad);
}

.may-bridge-chart {
  min-width: 0;
}

.chart-inline-note {
  padding: 0 2px 4px;
}

.legend {
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 999px;
}

.legend i.dashed {
  background: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 12px) !important;
  color: var(--teal);
}

.amount-bar {
  opacity: 0.92;
}

.source-list {
  display: grid;
  gap: 7px;
  max-height: 168px;
  overflow: auto;
  padding-right: 2px;
}

.source-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
}

.source-list a:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.source-list .stacked-source-row {
  display: grid;
  grid-template-columns:
    minmax(88px, 0.9fr)
    repeat(6, minmax(76px, 0.72fr))
    minmax(82px, 0.8fr)
    minmax(180px, 1.45fr);
  align-items: center;
  gap: 6px;
}

.source-list .stacked-source-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.source-list .stacked-source-row em.positive {
  color: var(--good);
}

.source-list .stacked-source-row em.negative {
  color: var(--bad);
}

.source-list .stacked-source-row em.neutral {
  color: var(--muted);
}

.source-list .stacked-source-row strong {
  text-align: right;
}

.source-list .stacked-source-row small {
  min-width: 0;
  overflow: visible;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
  text-overflow: clip;
  white-space: normal;
}

.stacked-source-head {
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.stacked-source-head span,
.stacked-source-head em,
.stacked-source-head strong,
.stacked-source-head small {
  color: var(--muted);
}

.stack-total {
  fill: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 850;
}

.stack-segment {
  shape-rendering: geometricPrecision;
}

.stack-hit {
  fill: transparent;
  cursor: pointer;
}

.stacked-legend i {
  height: 8px;
}

svg {
  display: block;
  width: 100%;
}

svg text {
  fill: var(--muted);
  font-size: 12px;
}

.axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.gridline {
  stroke: var(--line);
  stroke-width: 1;
}

.axis-label {
  font-weight: 850;
}

.focus-line {
  stroke: var(--line-strong);
  stroke-dasharray: 4 4;
  stroke-width: 1.4;
}

.hit-zone {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.bar-mark {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.bar-mark.hovered {
  opacity: 0.84;
  transform: scaleY(1.03);
}

.chart-tooltip {
  position: fixed;
  z-index: 40;
  max-width: min(320px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #050807;
  box-shadow: 0 18px 40px rgba(22, 26, 29, 0.22);
  color: #f5f5f7;
  font-size: 0.76rem;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 0.82rem;
}

.chart-tooltip span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #c7c7cc;
  line-height: 1.3;
}

.chart-tooltip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.monthly-official {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.monthly-official a {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 15, 0.5);
  color: var(--ink);
  text-decoration: none;
}

.monthly-official a:hover {
  border-color: var(--line-strong);
}

.monthly-official a.high-frequency {
  border-color: rgba(191, 90, 242, 0.34);
  background: rgba(191, 90, 242, 0.1);
}

.monthly-official a.high-frequency strong {
  color: #f0d1ff;
}

.monthly-official span,
.monthly-official small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.monthly-official strong {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 1.35rem;
}

/* Apple-inspired dark research-console skin */
body {
  background:
    radial-gradient(circle at 16% -10%, rgba(143, 184, 255, 0.15), transparent 32rem),
    radial-gradient(circle at 86% 0%, rgba(135, 215, 202, 0.1), transparent 28rem),
    linear-gradient(135deg, #111315 0%, #181b1f 48%, #101214 100%);
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), transparent 74%);
}

h1 {
  color: #f5f5f7;
  font-family: "SF Pro Display", "Avenir Next Condensed", "DIN Condensed", "PingFang SC", sans-serif;
}

h2 {
  color: #f1f2f4;
}

.hero-copy {
  color: #a8adb4;
}

.eyebrow {
  color: #a4a9af;
}

.brand-mark {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(143, 184, 255, 0.08));
  color: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 34px rgba(0, 0, 0, 0.22);
}

.source-pill,
.icon-button,
.summary-card,
.side-panel,
.chart-panel,
.status-strip,
.segmented,
.method-strip,
.memory-detail-panel,
.taiwan-demand-panel {
  background: rgba(31, 34, 38, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.15);
}

.status-strip,
.chart-control-strip,
.coverage-badge,
.flat-chart-card,
.memory-detail-focus,
.memory-table-card,
.taiwan-hs-card,
.taiwan-route-card,
.snapshot-copy,
.snapshot-bars,
.monthly-official a {
  background: rgba(34, 37, 42, 0.62);
}

.method-strip {
  background: rgba(255, 255, 255, 0.08);
}

.method-strip div {
  background: rgba(32, 35, 39, 0.72);
}

.side-panel {
  background:
    linear-gradient(180deg, rgba(143, 184, 255, 0.08), transparent 38%),
    rgba(31, 34, 38, 0.72);
}

.source-pill.official,
.delta.positive,
.taiwan-hs-card:nth-child(1),
.taiwan-hs-card:nth-child(2) {
  background: rgba(122, 199, 162, 0.1);
  color: #b7ead2;
}

.source-pill.sample {
  background: rgba(227, 184, 117, 0.12);
  color: #f0d19e;
}

.source-pill.mixed,
.series-chip.active,
.analysis-cell.signal,
.taiwan-hs-card.active {
  background: rgba(143, 184, 255, 0.11);
  color: #c9dcff;
}

.summary-card.active {
  background:
    linear-gradient(180deg, rgba(143, 184, 255, 0.08), transparent),
    rgba(41, 45, 51, 0.78);
}

.summary-card.scope-card {
  background:
    linear-gradient(150deg, rgba(143, 184, 255, 0.08), transparent 54%),
    rgba(30, 33, 37, 0.62);
}

.analysis-cell,
.route-stats div,
.may-bridge-copy dl div,
.flat-chart-head code,
.taiwan-hs-head code,
.hs-link-row a,
.memory-focus-kpis span {
  background: rgba(255, 255, 255, 0.055);
}

.memory-table dd,
.route-stats dd,
.memory-focus-kpis b,
.analysis-cell.signal b {
  color: #c9dcff;
}

.segmented button.selected,
.memory-detail-switch button.selected {
  background: #f5f5f7;
  color: #16181b;
}

.snapshot-track {
  background: rgba(255, 255, 255, 0.1);
}

.chart-tooltip {
  background: #111315;
}

/* iOS dark readability pass: no dark text on graphite surfaces */
body {
  background:
    radial-gradient(circle at 16% -10%, rgba(10, 132, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 84% 0%, rgba(100, 210, 255, 0.1), transparent 28rem),
    linear-gradient(135deg, #000000 0%, #111113 44%, #1c1c1e 100%);
}

.source-pill,
.icon-button,
.summary-card,
.side-panel,
.chart-panel,
.status-strip,
.segmented,
.method-strip,
.memory-detail-panel,
.taiwan-demand-panel,
.status-strip,
.chart-control-strip,
.coverage-badge,
.flat-chart-card,
.memory-detail-focus,
.memory-table-card,
.taiwan-hs-card,
.taiwan-route-card,
.snapshot-copy,
.snapshot-bars,
.monthly-official a,
.may-bridge-card {
  background: rgba(28, 28, 30, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

.method-strip {
  background: rgba(255, 255, 255, 0.08);
}

.method-strip div,
.summary-card.active,
.summary-card.scope-card,
.side-panel {
  background: rgba(44, 44, 46, 0.72);
}

.analysis-cell,
.route-stats div,
.may-bridge-copy dl div,
.flat-chart-head code,
.taiwan-hs-head code,
.hs-link-row a,
.memory-focus-kpis span,
.series-chip,
.focus-pill,
.axis-pair strong {
  background: rgba(58, 58, 60, 0.7);
  color: #f5f5f7;
}

.source-pill.official,
.delta.positive,
.taiwan-hs-card:nth-child(1),
.taiwan-hs-card:nth-child(2) {
  background: rgba(48, 209, 88, 0.12);
  color: #d1f8dd;
}

.source-pill.sample {
  background: rgba(191, 90, 242, 0.13);
  color: #f0d1ff;
}

.source-pill.mixed,
.series-chip.active,
.analysis-cell.signal,
.taiwan-hs-card.active {
  background: rgba(10, 132, 255, 0.14);
  color: #d8eaff;
}

.delta.negative {
  background: rgba(255, 69, 58, 0.12);
  color: #ffd2ce;
}

.hero-copy,
.note,
.chart-caption,
.method-note,
.freshness-note,
.card-freshness,
.memory-table-note,
.taiwan-hs-card p,
.taiwan-hs-card em,
.taiwan-route-card p,
.monthly-official span,
.monthly-official small,
.may-bridge-copy p,
.chart-inline-note,
.source-list .stacked-source-row small,
dt,
code,
svg text,
.legend,
.control-label,
.metric-label,
.method-label,
.panel-title,
.eyebrow {
  color: #c7c7cc;
  fill: #c7c7cc;
}

h1,
h2,
h3,
strong,
dd,
.memory-table dd,
.route-stats dd,
.memory-focus-kpis b,
.analysis-cell b,
.analysis-cell.signal b,
.source-list a {
  color: #f5f5f7;
}

.gridline {
  stroke: rgba(255, 255, 255, 0.14);
}

.axis {
  stroke: rgba(255, 255, 255, 0.34);
}

.snapshot-track {
  background: rgba(255, 255, 255, 0.16);
}

.monthly-official a.high-frequency {
  border-color: rgba(191, 90, 242, 0.34);
  background: rgba(191, 90, 242, 0.1);
}

.monthly-official a.high-frequency strong {
  color: #f0d1ff;
}

@media (max-width: 960px) {
  .screen {
    padding: 18px;
  }

  .topbar,
  .chart-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-toolbar > div:last-child,
  .metric-scope-note {
    justify-items: start;
    text-align: left;
  }

  .actions {
    justify-content: space-between;
  }

  .status-strip,
  .summary-grid,
  .method-strip,
  .may-bridge-card,
  .memory-detail-focus,
  .memory-detail-grid,
  .taiwan-hs-guide,
  .taiwan-demand-grid,
  .three-chart-grid,
  .chart-control-strip,
  .workbench,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .freshness-note {
    text-align: left;
  }

  .chart-control-strip {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .screen {
    padding: 14px;
  }

  .summary-card strong {
    font-size: 1.45rem;
  }

  .metric-row,
  .summary-analysis,
  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-analysis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .monthly-official {
    grid-template-columns: 1fr;
  }

  .source-list .stacked-source-row {
    grid-template-columns: 1fr 1fr;
  }

  .source-list .stacked-source-row span {
    grid-column: 1 / -1;
  }

  .source-list .stacked-source-row small {
    grid-column: 1 / -1;
    text-align: left;
  }

  .memory-focus-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .taiwan-hs-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .taiwan-route-head {
    flex-direction: column;
  }

  .route-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
