:root {
  color-scheme: light;
  --ink: #10253b;
  --muted: #607083;
  --line: #dbe3e9;
  --soft: #f2f6f8;
  --paper: #ffffff;
  --navy: #0b1f33;
  --teal: #1695a3;
  --blue: #4169a1;
  --amber: #d58a22;
  --red: #c94d5b;
  --green: #24765c;
  --shadow: 0 14px 32px rgba(20, 45, 68, .08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #eef3f6; color: var(--ink); min-width: 320px; }
button, input { font: inherit; }
button, .button-link { min-height: 38px; border: 1px solid #c9d4dd; border-radius: 7px; background: #fff; color: var(--ink); padding: 0 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .button-link:hover { border-color: var(--teal); color: #087582; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(22,149,163,.25); outline-offset: 2px; }
button.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.quiet { color: var(--muted); }
button:disabled { opacity: .5; cursor: wait; }
.top-rule { height: 5px; background: var(--teal); }
.page-header { background: var(--navy); color: #fff; padding: 25px max(24px, calc((100vw - 1500px)/2)); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: #66cad2; font-size: .76rem; letter-spacing: .17em; font-weight: 700; }
h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.5rem); font-weight: 650; letter-spacing: .01em; }
.header-status { display: flex; align-items: center; gap: 9px; color: #d8e7ee; font-size: .88rem; text-align: right; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #7f92a3; box-shadow: 0 0 0 4px rgba(255,255,255,.08); flex: 0 0 auto; }
.status-dot.ok { background: #4ac28b; }
.status-dot.warn { background: #f1ac44; }
.status-dot.error { background: #ef6a74; }
main { max-width: 1500px; margin: 0 auto; padding: 18px 24px 32px; }
.control-bar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); }
.range-buttons { display: flex; background: var(--soft); border-radius: 7px; padding: 3px; }
.range-buttons button { border: 0; min-height: 32px; background: transparent; }
.range-buttons button.active { background: #fff; color: #087582; box-shadow: 0 1px 4px rgba(18,45,66,.13); }
.custom-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom-range label { color: var(--muted); font-size: .86rem; }
input[type="date"] { border: 1px solid #c9d4dd; border-radius: 6px; padding: 8px; color: var(--ink); background: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.message { margin-top: 12px; padding: 11px 14px; border-left: 4px solid var(--amber); background: #fff8e9; color: #735018; border-radius: 4px; }
.message.error { border-color: var(--red); background: #fff1f2; color: #842c38; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.metric-card { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 15px; min-height: 138px; box-shadow: var(--shadow); border-radius: 7px; }
.metric-card h2 { font-size: .85rem; margin: 0; color: var(--muted); font-weight: 650; }
.metric-value { font-variant-numeric: tabular-nums; font-size: clamp(1.55rem, 2.4vw, 2.15rem); font-weight: 700; margin: 12px 0 6px; letter-spacing: -.03em; }
.unit { color: var(--muted); font-size: .78rem; font-weight: 550; letter-spacing: 0; }
.metric-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; color: var(--muted); }
.change.up { color: var(--red); }
.change.down { color: var(--green); }
.percentile { margin-top: 9px; font-size: .75rem; color: var(--muted); }
.percentile-track { margin-top: 5px; height: 4px; border-radius: 3px; background: #e8edf0; overflow: hidden; }
.percentile-track span { display: block; height: 100%; background: var(--accent); }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-panel, .table-panel, .notes-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.chart-panel { padding: 16px 16px 8px; min-width: 0; }
.chart-heading { display: flex; align-items: center; min-height: 42px; gap: 16px; }
.chart-heading > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.chart-heading h2, .panel-title h2, .notes-panel h2 { margin: 0; font-size: 1rem; }
.section-no { color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .09em; }
.readout { margin-left: auto; min-height: 18px; color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; text-align: right; }
.chart-panel canvas { width: 100%; height: 270px; display: block; touch-action: none; cursor: crosshair; }
.credit-toggles { display: flex; gap: 10px; font-size: .76rem; color: var(--muted); }
.credit-toggles label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.credit-toggles input { width: 14px; height: 14px; }
.swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.swatch.ig { background: var(--blue); }.swatch.hy { background: var(--amber); }
.tables-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; margin-top: 14px; }
.table-panel { min-width: 0; }
.panel-title { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 9px; gap: 12px; }
.panel-title span { color: var(--muted); font-size: .76rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
th { text-align: right; color: var(--muted); font-weight: 650; background: #f6f8fa; }
th:first-child, td:first-child { text-align: left; }
th, td { padding: 9px 12px; border-top: 1px solid #e8edf0; text-align: right; white-space: nowrap; }
.notes-panel { margin-top: 14px; padding: 18px; display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 24px; }
.notes-panel p, .notes-panel li { color: var(--muted); font-size: .82rem; line-height: 1.7; }
.notes-panel p { margin: 8px 0 0; }
.notes-panel ul { margin: 8px 0 0; padding-left: 18px; }
.notes-panel a { color: #087582; }
footer { text-align: center; color: #708093; font-size: .76rem; padding: 4px 24px 30px; }
@media (max-width: 1150px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .page-header { align-items: flex-start; flex-direction: column; } .header-status { text-align: left; } main { padding: 14px; } .metric-grid { grid-template-columns: repeat(2, 1fr); } .tables-grid, .notes-panel { grid-template-columns: 1fr; } .actions { margin-left: 0; } .chart-panel canvas { height: 240px; } }
@media (max-width: 520px) { .metric-grid { grid-template-columns: 1fr; } .custom-range label { width: 100%; display: flex; justify-content: space-between; align-items: center; } .actions > * { flex: 1 1 calc(50% - 5px); } .chart-heading { align-items: flex-start; flex-wrap: wrap; } .readout { width: 100%; text-align: left; } }
