:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --panel-soft: #f7f9f6;
  --ink: #152027;
  --muted: #65717a;
  --line: #d9e0df;
  --line-strong: #acb7b5;
  --green: #13764f;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #b42318;
  --shadow: 0 14px 34px rgba(21, 32, 39, 0.08);
  --soft-shadow: 0 7px 18px rgba(21, 32, 39, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(19, 118, 79, 0.12), rgba(244, 246, 245, 0) 310px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 38px;
}

.topbar,
.topbar-meta,
.panel-header,
.footer,
.card-meta,
.gauge-title,
.fact-row,
.breadth-box,
.watch-item,
.rank-item {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 224, 223, 0.85);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
}

h3 {
  font-size: 13px;
  margin: 12px 0 8px;
}

.lead {
  margin-top: 10px;
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.topbar-meta {
  justify-content: flex-end;
  gap: 12px;
  text-align: right;
  flex-wrap: wrap;
}

.topbar-meta > div:not(.status-pill) {
  min-width: 104px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(217, 224, 223, 0.86);
  border-radius: 8px;
}

.topbar-meta strong {
  display: block;
  font-size: 14px;
}

.meta-label,
.panel-header p,
.footer,
.card-label,
.card-detail,
th,
.source-item span,
.gauge-copy,
.watch-meta,
.gap-copy {
  color: var(--muted);
  font-size: 12px;
}

.status-pill,
.command-button,
.flow-tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
}

.status-pill {
  padding: 10px 13px;
  border-color: rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.warn {
  border-color: rgba(183, 121, 31, 0.3);
  background: rgba(183, 121, 31, 0.12);
  color: var(--amber);
}

.command-button {
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

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

.flow-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.flow-tab {
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.flow-tab:hover {
  border-color: var(--line-strong);
}

.flow-tab.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(116px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.flow-workbench {
  margin: 12px 0;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.52fr) minmax(0, 1fr);
  gap: 10px;
  padding: 16px 18px 10px;
}

.score-hero,
.questions-card,
.flow-map-card,
.workflow-grid article,
.score-module {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.score-hero {
  padding: 15px;
}

.score-hero > strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 38px;
  line-height: 1;
}

.score-hero p,
.state-box p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.score-scale {
  position: relative;
  height: 11px;
  margin: 15px 0;
  background: linear-gradient(90deg, var(--red), #d9b45f 50%, var(--teal));
  border-radius: 999px;
}

.score-scale span {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 23px;
  background: var(--ink);
  border-radius: 2px;
}

.state-box {
  padding: 11px;
  background: var(--panel);
  border: 1px solid #edf1ef;
  border-radius: 8px;
}

.state-box strong,
.state-box span {
  display: block;
}

.state-box span {
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.questions-card {
  padding: 14px;
}

.questions-card h3 {
  margin-top: 0;
}

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

.question-item {
  padding: 10px 11px;
  background: var(--panel);
  border: 1px solid #edf1ef;
  border-radius: 8px;
}

.question-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.question-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.score-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 10px;
}

.score-history-panel {
  margin: 0 18px 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.score-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.score-history-head h3 {
  margin: 0 0 5px;
}

.score-history-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.score-history-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 520px;
}

.score-history-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
}

.score-history-tab.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
}

.score-history-chart {
  min-height: 230px;
  margin-top: 10px;
  border-top: 1px solid #edf1ef;
}

.score-history-chart svg {
  display: block;
  width: 100%;
  height: 230px;
}

.score-history-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.score-axis {
  stroke: #cdd8d6;
  stroke-width: 1;
}

.score-grid {
  stroke: #dfe7e5;
  stroke-width: 1;
  opacity: 0.45;
}

.score-zero {
  stroke: #71807d;
  stroke-dasharray: 4 4;
  stroke-width: 1.1;
}

.score-module {
  padding: 11px;
}

.score-module-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.score-module-top strong {
  font-size: 13px;
}

.score-module-top b {
  font-size: 15px;
}

.score-module.good .score-module-top b {
  color: var(--green);
}

.score-module.bad .score-module-top b {
  color: var(--red);
}

.score-module.watch .score-module-top b {
  color: var(--amber);
}

.score-mini-scale {
  position: relative;
  height: 7px;
  margin: 9px 0;
  background: linear-gradient(90deg, rgba(180, 35, 24, 0.28), rgba(183, 121, 31, 0.25), rgba(19, 118, 79, 0.28));
  border-radius: 999px;
}

.score-mini-scale span {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 13px;
  background: var(--ink);
  border-radius: 2px;
}

.score-module-spark {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 8px 0 3px;
}

.score-module-spark span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score-module-spark .sparkline {
  height: 34px;
}

.score-module p {
  min-height: 46px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.score-module em {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  line-height: 1.35;
}

.score-module small {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.flow-map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 8px;
  padding: 0 18px 10px;
}

.flow-map-card {
  padding: 12px 13px;
}

.flow-map-card h3 {
  margin-top: 0;
}

.layer-list,
.state-list {
  display: grid;
  gap: 7px;
}

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

.layer-row,
.state-chip {
  min-width: 0;
  padding: 9px 10px;
  background: var(--panel);
  border: 1px solid #edf1ef;
  border-radius: 8px;
}

.layer-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.layer-row strong,
.layer-row span,
.layer-row em,
.state-chip strong,
.state-chip span {
  display: block;
}

.layer-row strong,
.state-chip strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.layer-row span,
.layer-row em,
.state-chip span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.layer-row em {
  font-style: normal;
}

.state-chip.current {
  border-color: rgba(15, 118, 110, 0.34);
  background: rgba(15, 118, 110, 0.07);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
}

.workflow-grid article {
  padding: 11px 13px;
}

.workflow-grid h3 {
  margin-top: 0;
}

.workflow-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workflow-grid li + li {
  margin-top: 5px;
}

.liquidity-route {
  margin: 12px 0;
}

.route-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.route-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.route-card h3 {
  margin: 0 0 10px;
}

.route-card h4 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}

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

.route-signal,
.route-row {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.route-signal span,
.route-signal em,
.route-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.route-signal strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 17px;
}

.route-global p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.global-liquidity-details {
  margin-top: 10px;
}

.global-liquidity-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.global-liquidity-head div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.global-liquidity-head span,
.global-liquidity-sub,
.global-liquidity-row span,
.global-liquidity-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.global-liquidity-head strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.global-liquidity-sub {
  display: grid;
  gap: 3px;
  margin: 8px 0;
}

.global-liquidity-table {
  display: grid;
  gap: 5px;
}

.global-liquidity-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 0.78fr 0.7fr 0.48fr;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.global-liquidity-row-head {
  border: 0;
  background: transparent;
  padding-top: 0;
  padding-bottom: 0;
}

.global-liquidity-row strong,
.global-liquidity-row b,
.global-liquidity-row em {
  min-width: 0;
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.global-liquidity-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-liquidity-row b,
.global-liquidity-row em,
.global-liquidity-row small {
  text-align: right;
  white-space: nowrap;
}

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

.route-split > div > div {
  display: grid;
  gap: 7px;
}

.route-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.route-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.route-row b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.route-history-panel {
  margin: 0 18px 18px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.route-history-head h3 {
  margin: 0 0 5px;
}

.route-history-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.route-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.route-history-grid article {
  min-width: 0;
  padding: 10px 10px 8px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.route-history-grid article:first-child {
  grid-column: 1 / -1;
}

.route-history-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}

.route-history-title strong {
  font-size: 13px;
}

.route-history-title span,
.route-chart-legend {
  color: var(--muted);
  font-size: 11px;
}

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

.route-history-chart svg {
  display: block;
  width: 100%;
  height: 230px;
}

.route-history-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.route-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-height: 34px;
  align-content: flex-start;
  margin-bottom: 2px;
}

.route-chart-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.route-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.route-chart-axis {
  stroke: #cdd8d6;
  stroke-width: 1;
}

.route-chart-grid {
  stroke: #dfe7e5;
  stroke-width: 1;
  opacity: 0.42;
}

.route-chart-zero {
  stroke: #93a19e;
  stroke-width: 1.1;
  stroke-dasharray: 4 4;
}

.route-mini-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 8px;
}

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

.route-mini-card {
  min-width: 0;
  padding: 8px 9px 7px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: #fbfcfb;
}

.route-mini-head,
.route-mini-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.route-mini-head {
  align-items: baseline;
}

.route-mini-head strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-mini-head b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.route-mini-card svg {
  display: block;
  width: 100%;
  height: 92px;
  margin-top: 3px;
}

.route-mini-meta {
  color: var(--muted);
  font-size: 10px;
}

.china-flow-panel {
  margin: 12px 0;
}

.china-flow-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.china-flow-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px)) minmax(0, 1fr);
  gap: 10px;
  padding: 0 18px 10px;
}

.china-flow-summary > div,
.china-flow-summary p {
  min-width: 0;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: #fbfcfb;
}

.china-flow-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.china-flow-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.china-flow-summary p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.china-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 10px;
}

.china-flow-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.china-flow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.china-flow-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.china-flow-card-head span,
.china-flow-card p,
.china-member-row span,
.china-member-head {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.china-flow-card-head b {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.china-flow-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0;
}

.china-flow-stats div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.china-flow-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.china-flow-stats strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.china-flow-card p {
  min-height: 48px;
  margin: 0 0 9px;
}

.china-member-head,
.china-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 66px;
  gap: 8px;
  align-items: center;
}

.china-member-head {
  padding: 0 2px 5px;
  font-weight: 800;
}

.china-member-list {
  display: grid;
  gap: 6px;
}

.china-member-row {
  padding: 8px 9px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.china-member-row strong {
  display: block;
  font-size: 12px;
}

.china-member-row b,
.china-member-row em {
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.china-flow-history-wrap {
  margin: 0 18px 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.kpi-card,
.panel,
.ratio-card,
.report-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 116px;
  padding: 13px 13px 12px;
  display: grid;
  align-content: space-between;
}

.card-label {
  min-height: 30px;
  line-height: 1.25;
}

.card-value {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
}

.card-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card-meta {
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.tone-good {
  border-color: rgba(19, 118, 79, 0.28);
}

.tone-good .card-value,
.pos {
  color: var(--green);
}

.tone-bad {
  border-color: rgba(180, 35, 24, 0.25);
}

.tone-bad .card-value,
.neg {
  color: var(--red);
}

.tone-watch .card-value {
  color: var(--amber);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.65fr);
  gap: 12px;
  margin: 12px 0;
}

.top-grid {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.75fr);
}

.panel {
  min-width: 0;
}

.panel-header {
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.panel-header.compact {
  padding-bottom: 12px;
}

.snapshot-body,
.proxy-stack {
  padding: 16px 18px 18px;
}

.gauge-block {
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gauge-title {
  justify-content: space-between;
  gap: 12px;
}

.gauge-title strong {
  font-size: 28px;
}

.gauge-track {
  position: relative;
  height: 12px;
  margin: 18px 0 13px;
  background: linear-gradient(90deg, #2f7d5b, #d9b45f 50%, #b42318);
  border-radius: 999px;
}

.gauge-track i {
  position: absolute;
  top: -7px;
  width: 2px;
  height: 26px;
  background: var(--ink);
  border-radius: 2px;
}

.threshold {
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.threshold.buy {
  left: 20%;
}

.threshold.sell {
  left: 80%;
}

.snapshot-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.fact-row {
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fact-row span {
  color: var(--muted);
  font-size: 12px;
}

.fact-row strong {
  font-size: 14px;
}

.flow-bars {
  display: grid;
  gap: 8px;
}

.flow-bar {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.flow-track,
.meter {
  height: 9px;
  overflow: hidden;
  background: #edf1ef;
  border-radius: 999px;
}

.flow-track span,
.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
  border-radius: inherit;
}

.flow-track.negative span {
  background: var(--red);
}

.breadth-box {
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.breadth-box strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.breadth-box .meter {
  width: min(280px, 46%);
}

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

.source-item {
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.source-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.source-badge {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.source-badge.manual,
.source-badge.not_configured {
  background: rgba(183, 121, 31, 0.12);
  color: var(--amber);
}

.source-badge.error {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 18px 18px;
}

.ratio-card {
  padding: 12px;
  box-shadow: none;
}

.ratio-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ratio-card h3 {
  margin: 0;
  font-size: 14px;
}

.explain-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  margin: 14px 18px 0;
  padding: 11px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.explain-strip strong {
  color: var(--ink);
}

.ratio-formula {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ratio-value {
  font-size: 18px;
  font-weight: 850;
  white-space: nowrap;
}

.ratio-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 10px 0;
}

.mini-stat {
  padding: 7px;
  background: var(--panel-soft);
  border-radius: 8px;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.mini-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.ratio-meaning {
  min-height: 34px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sparkline {
  width: 100%;
  height: 48px;
}

.watch-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.watch-item {
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.watch-name {
  min-width: 0;
}

.watch-name strong {
  display: block;
  font-size: 13px;
}

.watch-meta {
  display: block;
  margin-top: 2px;
}

.watch-num {
  text-align: right;
  font-weight: 850;
}

.table-wrap {
  overflow-x: auto;
  padding: 0 18px 18px;
}

.flow-chart-wrap {
  padding: 16px 18px 8px;
}

.chart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-title-row strong {
  font-size: 14px;
}

.chart-title-row span {
  color: var(--muted);
  font-size: 12px;
}

.line-chart {
  width: 100%;
  min-height: 280px;
  padding: 10px 0 0;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 280px;
}

.line-chart text {
  fill: var(--muted);
  font-size: 11px;
}

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

.line-chart .zero {
  stroke: #93a19e;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.line-chart .monthly-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart .weekly-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart .dot-monthly {
  fill: var(--teal);
}

.line-chart .dot-weekly {
  fill: var(--blue);
}

.line-chart .area-pos {
  fill: rgba(19, 118, 79, 0.08);
}

.line-chart .empty-chart {
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.compact-table table {
  min-width: 440px;
}

th {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

td {
  padding: 10px;
  border-bottom: 1px solid #edf1ef;
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfcfb;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.spark-cell {
  min-width: 130px;
}

.bar-spark {
  display: flex;
  align-items: end;
  gap: 4px;
  width: 116px;
  height: 42px;
}

.bar-spark span {
  flex: 1;
  min-height: 3px;
  background: var(--teal);
  border-radius: 4px 4px 0 0;
}

.bar-spark span.down {
  background: var(--red);
}

.etf-flow-section {
  align-items: stretch;
}

.etf-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.etf-flow-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.etf-flow-card h3 {
  margin: 0 0 10px;
}

.etf-flow-list,
.etf-category-list {
  display: grid;
  gap: 7px;
}

.etf-flow-row,
.etf-category-row {
  display: grid;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 9px;
  border: 1px solid #edf1ef;
  border-radius: 8px;
  background: var(--panel);
}

.etf-flow-row {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.etf-category-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.rank-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
}

.etf-flow-row strong,
.etf-category-row span {
  font-size: 13px;
}

.etf-flow-row span:not(.rank-num) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.etf-flow-row b,
.etf-category-row strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-dossier {
  margin: 12px 0;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr) minmax(320px, 0.72fr);
  gap: 10px;
  padding: 16px 18px 18px;
}

.report-card {
  padding: 13px;
  box-shadow: none;
  background: #fbfcfb;
}

.report-card h3,
.snapshot-side-list h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

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

.theme-item {
  padding: 10px 11px;
  background: var(--panel);
  border: 1px solid #edf1ef;
  border-radius: 8px;
}

.theme-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.theme-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dense-list,
.component-list,
.snapshot-side-list {
  display: grid;
  gap: 8px;
}

.dense-row,
.side-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 31px;
  padding-bottom: 7px;
  border-bottom: 1px solid #edf1ef;
  font-size: 13px;
}

.dense-row span,
.side-fact span {
  color: var(--muted);
}

.stacked-row {
  align-items: flex-start;
}

.stacked-row span strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.stacked-row em,
.side-fact em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.component-list {
  padding: 14px 16px 16px;
}

.component-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(84px, 0.8fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1ef;
}

.component-item strong {
  display: block;
  font-size: 13px;
}

.component-item span {
  color: var(--muted);
  font-size: 12px;
}

.component-item b {
  text-align: right;
  font-size: 13px;
}

.component-meter {
  height: 8px;
  overflow: hidden;
  background: #edf1ef;
  border-radius: 999px;
}

.component-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  border-radius: inherit;
}

.snapshot-side-list {
  padding: 14px 16px 0;
}

.compact-side-list {
  padding-top: 12px;
  padding-bottom: 16px;
}

.side-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.side-tags strong {
  margin-right: 2px;
  font-size: 12px;
}

.side-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(19, 118, 79, 0.1);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.sell-tags span {
  background: rgba(180, 35, 24, 0.09);
  color: var(--red);
}

.coverage-wrap table {
  min-width: 1180px;
}

.coverage-badge {
  display: inline-flex;
  max-width: 220px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf1ef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
}

.coverage-badge.live {
  background: rgba(19, 118, 79, 0.1);
  color: var(--teal);
}

.coverage-badge.proxy {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.coverage-badge.manual,
.coverage-badge.paid {
  background: rgba(183, 121, 31, 0.12);
  color: var(--amber);
}

.rank-stack {
  padding: 4px 16px 16px;
}

.rank-item {
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1ef;
}

.rank-item strong {
  font-size: 13px;
}

.rank-item span {
  color: var(--muted);
  font-size: 12px;
}

.rank-item small,
.d200-cell span,
.d200-cell small,
.mini-stat small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.rank-value {
  font-weight: 850;
}

.d200-cell strong {
  display: block;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.gap-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  padding: 16px 18px 18px;
}

.macro-box,
.gap-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.macro-box {
  padding: 14px;
}

.macro-box strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

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

.gap-item {
  padding: 11px 12px;
}

.gap-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.footer {
  justify-content: space-between;
  min-height: 30px;
  padding: 4px 2px 0;
}

.empty-state {
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .score-history-head {
    flex-direction: column;
  }

  .score-history-tabs {
    justify-content: flex-start;
    max-width: none;
  }

  .dashboard-grid,
  .top-grid,
  .gap-grid,
  .china-flow-summary,
  .flow-map-grid,
  .route-history-grid,
  .route-grid,
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .ratio-grid,
  .gap-list,
    .report-grid,
    .theme-list,
    .layer-list,
    .china-flow-grid,
    .etf-flow-grid,
    .score-module-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 22px, 1500px);
    padding-top: 14px;
  }

  .topbar,
  .topbar-meta {
    align-items: stretch;
    flex-direction: column;
    text-align: left;
  }

  h1 {
    font-size: 34px;
  }

  .kpi-grid,
  .ratio-grid,
  .snapshot-facts,
  .source-grid,
  .gap-list,
    .report-grid,
    .theme-list,
    .question-grid,
    .layer-list,
    .layer-row,
    .route-global-grid,
    .route-split,
    .route-mini-grid,
    .global-liquidity-head,
    .china-flow-grid,
    .china-flow-stats,
    .etf-flow-grid,
    .score-module-grid,
    .workflow-grid {
    grid-template-columns: 1fr;
  }

  .global-liquidity-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .global-liquidity-row-head {
    display: none;
  }

  .breadth-box {
    align-items: stretch;
    flex-direction: column;
  }

  .explain-strip {
    grid-template-columns: 1fr;
  }

  .breadth-box .meter {
    width: 100%;
  }

  .flow-bar {
    grid-template-columns: 74px minmax(0, 1fr) 58px;
  }

  .route-chart-legend span {
    white-space: normal;
  }
}
