:root {
    color-scheme: light;
    --bg: #f3f6f9;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --surface-raised: #ffffff;
    --ink: #122230;
    --muted: #687886;
    --muted-strong: #536574;
    --line: #dfe7ed;
    --line-soft: #edf1f4;
    --brand: #0a6e75;
    --brand-dark: #074f58;
    --brand-soft: #e3f4f3;
    --navy: #0b2942;
    --positive: #07845b;
    --positive-soft: #e1f5ec;
    --negative: #d54247;
    --negative-soft: #fbe9e9;
    --warning: #a96707;
    --warning-soft: #fff3d8;
    --neutral-soft: #eef2f5;
    --shadow: 0 12px 32px rgba(18, 34, 48, .07);
    --shadow-small: 0 3px 12px rgba(18, 34, 48, .06);
    --radius: 16px;
    --radius-small: 10px;
    --page-width: 1480px;
    --chart-grid: #e8edf1;
    --tooltip-bg: #102b40;
    --curve-1: #087f8c;
    --curve-2: #e08232;
    --curve-3: #5d62b5;
    --curve-4: #2c8b57;
    --curve-5: #d04e77;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b151d;
    --surface: #12212b;
    --surface-soft: #172832;
    --surface-raised: #172832;
    --ink: #e7eef2;
    --muted: #99abb5;
    --muted-strong: #bdc9cf;
    --line: #2a3c47;
    --line-soft: #20323d;
    --brand: #4ab3ae;
    --brand-dark: #82d5ce;
    --brand-soft: #173c3e;
    --navy: #e7f4fa;
    --positive: #56c896;
    --positive-soft: #173c30;
    --negative: #ff7b7e;
    --negative-soft: #47272b;
    --warning: #f1ba54;
    --warning-soft: #46391f;
    --neutral-soft: #24343d;
    --shadow: 0 16px 38px rgba(0, 0, 0, .2);
    --shadow-small: 0 4px 14px rgba(0, 0, 0, .15);
    --chart-grid: #293b46;
    --tooltip-bg: #e7eef2;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 92% 0%, rgba(39, 151, 153, .08), transparent 24rem),
        var(--bg);
    color: var(--ink);
    font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; }

.skip-link {
    position: fixed;
    z-index: 1000;
    top: -4rem;
    left: 1rem;
    padding: .65rem 1rem;
    border-radius: 0 0 8px 8px;
    background: var(--navy);
    color: var(--surface);
    text-decoration: none;
}
.skip-link:focus { top: 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;
}

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: rgba(9, 35, 55, .96);
    color: #eef7fa;
    backdrop-filter: blur(14px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(calc(100% - 40px), var(--page-width));
    min-height: 68px;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(47, 185, 178, .28), rgba(47, 185, 178, .08));
}
.brand__mark svg { width: 25px; fill: none; stroke: #65d7d0; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-size: .94rem; letter-spacing: .015em; }
.brand small { display: block; margin-top: -2px; color: #9fb4bf; font-size: .68rem; letter-spacing: .035em; }

.topbar__actions { display: flex; align-items: center; gap: 9px; }
.live-status { display: inline-flex; align-items: center; gap: 7px; margin-right: 7px; color: #b9cad2; font-size: .79rem; white-space: nowrap; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #edb64b; box-shadow: 0 0 0 4px rgba(237,182,75,.13); }
.live-status.is-ok i { background: #51d39a; box-shadow: 0 0 0 4px rgba(81,211,154,.13); }
.live-status.is-error i { background: #fb7575; box-shadow: 0 0 0 4px rgba(251,117,117,.13); }

.icon-button {
    display: grid;
    width: 37px;
    height: 37px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    color: #e5f0f4;
}
.icon-button:hover { background: rgba(255,255,255,.1); }
.icon-button:focus-visible, .tab:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, .text-button:focus-visible, .country-pill:focus-visible { outline: 3px solid rgba(66, 184, 180, .35); outline-offset: 2px; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon--sun { display: none; }
html[data-theme="dark"] .theme-icon--sun { display: block; }
html[data-theme="dark"] .theme-icon--moon { display: none; }

.page-shell { width: min(calc(100% - 40px), var(--page-width)); margin: 0 auto; }

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding: 45px 4px 31px;
}
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .17em; }
.hero h1 { margin: 0; color: var(--navy); font-size: clamp(1.65rem, 3vw, 2.42rem); line-height: 1.22; letter-spacing: -.04em; }
.hero > div:first-child > p:last-child { max-width: 720px; margin: 11px 0 0; color: var(--muted); font-size: .92rem; }
.as-of-card { min-width: 188px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.38); box-shadow: var(--shadow-small); text-align: right; }
html[data-theme="dark"] .as-of-card { background: rgba(23,40,50,.7); }
.as-of-card span, .as-of-card small { display: block; color: var(--muted); font-size: .69rem; }
.as-of-card strong { display: block; margin: 2px 0; color: var(--navy); font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.tabbar {
    position: sticky;
    z-index: 40;
    top: 68px;
    display: flex;
    gap: 4px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 9px 20px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-strong); font-size: .84rem; font-weight: 700; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--surface-soft); }
.tab.is-active { background: var(--navy); color: var(--surface); box-shadow: 0 3px 10px rgba(11,41,66,.18); }
html[data-theme="dark"] .tab.is-active { background: var(--brand); color: #07171d; }

main { padding: 20px 0 45px; }
.tab-panel { animation: panel-in .18s ease-out; }
.tab-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 15px; }
.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 15px; }
.metric-card { position: relative; min-height: 132px; padding: 19px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.metric-card::after { content: ""; position: absolute; width: 90px; height: 90px; top: -45px; right: -35px; border-radius: 50%; background: var(--brand-soft); opacity: .7; }
.metric-card__label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .75rem; font-weight: 700; }
.metric-card__icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.metric-card__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.metric-card__value { display: block; margin-top: 14px; color: var(--navy); font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.metric-card__detail { display: block; margin-top: 9px; color: var(--muted); font-size: .71rem; }

.dashboard-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 15px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.panel--wide { grid-row: span 2; }
.panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 20px 22px 14px; }
.panel__header h2 { margin: 1px 0 0; color: var(--navy); font-size: 1.02rem; letter-spacing: -.02em; }
.panel__kicker { display: block; color: var(--brand); font-size: .61rem; font-weight: 800; letter-spacing: .13em; }
.panel__description { max-width: 730px; margin: 6px 0 0; color: var(--muted); font-size: .75rem; }
.text-button { align-self: center; padding: 6px 0; border: 0; background: transparent; color: var(--brand); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: var(--brand-dark); }

.table-wrap { width: 100%; overflow-x: auto; }
.ag-grid {
    width: 100%;
    min-height: 180px;
    border-top: 1px solid var(--line-soft);
    --ag-font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
    --ag-font-size: 12px;
    --ag-background-color: var(--surface);
    --ag-foreground-color: var(--ink);
    --ag-secondary-foreground-color: var(--muted);
    --ag-header-background-color: var(--surface-soft);
    --ag-header-foreground-color: var(--muted-strong);
    --ag-border-color: var(--line);
    --ag-row-border-color: var(--line-soft);
    --ag-odd-row-background-color: var(--surface);
    --ag-row-hover-color: var(--brand-soft);
    --ag-selected-row-background-color: var(--brand-soft);
    --ag-accent-color: var(--brand);
    --ag-wrapper-border-radius: 0 0 var(--radius) var(--radius);
}
.ag-grid--overview { height: 450px; }
.ag-grid--large { height: 655px; }
.ag-grid--medium { height: 410px; }
.ag-grid--curve { height: 335px; }
.ag-grid .ag-root-wrapper { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.ag-grid .ag-header-cell-label { font-size: .69rem; font-weight: 800; }
.ag-grid .ag-cell { display: flex; align-items: center; color: var(--muted-strong); font-variant-numeric: tabular-nums; }
.ag-grid .ag-right-aligned-cell { justify-content: flex-end; }
.ag-grid .ag-pinned-left-cols-container { box-shadow: 5px 0 10px rgba(18,34,48,.035); }
.ag-grid .ag-paging-panel { color: var(--muted); font-size: .68rem; }
.ag-grid .ag-row { border-color: var(--line-soft); }
.ag-empty-message { display: inline-flex; padding: 9px 13px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: .72rem; }
.grid-entity { height: 100%; }
.grid-entity .flag { width: 29px; height: 23px; }
.grid-source { display: flex; min-width: 0; flex-direction: column; justify-content: center; line-height: 1.3; }
.grid-source a, .grid-source strong { overflow: hidden; color: var(--ink); font-size: .73rem; font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.grid-source a:hover { color: var(--brand); text-decoration: underline; }
.grid-source small { color: var(--muted); font-size: .61rem; }
.grid-sparkline { display: flex; align-items: center; }
#rate-grid .ag-row { cursor: pointer; }
#rate-grid .ag-row:hover .entity strong { color: var(--brand); }
.grid-inline-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 0 18px 11px; }
.grid-inline-toolbar--end { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.grid-inline-toolbar .search-box input { width: 170px; }
.grid-toolbar { flex-wrap: wrap; }
.data-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.data-table th { padding: 10px 16px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: .67rem; font-weight: 700; letter-spacing: .02em; text-align: left; white-space: nowrap; }
.data-table td { min-height: 49px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted-strong); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 33%, transparent); }
.data-table .align-right { text-align: right; }
.compact-table th, .compact-table td { padding-left: 20px; padding-right: 20px; }
.entity { display: flex; align-items: center; gap: 10px; min-width: 145px; }
.flag { display: grid; flex: 0 0 auto; width: 31px; height: 25px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); font-size: 1rem; line-height: 1; }
.entity strong { display: block; color: var(--ink); font-size: .77rem; }
.entity small { display: block; margin-top: 1px; color: var(--muted); font-size: .65rem; }
.number { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.change { display: inline-flex; align-items: center; gap: 3px; min-width: 65px; justify-content: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.change.is-positive { color: var(--positive); }
.change.is-negative { color: var(--negative); }
.change.is-neutral { color: var(--muted); }
.sparkline { display: block; width: 105px; height: 30px; overflow: visible; }
.sparkline path.line { fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sparkline path.area { fill: color-mix(in srgb, var(--brand) 13%, transparent); }
.sparkline.is-negative path.line { stroke: var(--negative); }
.sparkline.is-negative path.area { fill: color-mix(in srgb, var(--negative) 11%, transparent); }

.freshness { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.freshness::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }
.freshness.is-stale::before { background: var(--warning); }
.freshness.is-missing::before { background: var(--muted); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted-strong); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.status-badge.is-ok { background: var(--positive-soft); color: var(--positive); }
.status-badge.is-error { background: var(--negative-soft); color: var(--negative); }
.status-badge.is-warning { background: var(--warning-soft); color: var(--warning); }

.rate-snapshot { padding: 0 20px 15px; }
.rate-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 1px; border-bottom: 1px solid var(--line-soft); }
.rate-item:last-child { border-bottom: 0; }
.rate-item strong { color: var(--ink); font-size: .75rem; }
.rate-item .rate-value { grid-row: span 2; align-self: center; color: var(--navy); font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rate-item small { color: var(--muted); font-size: .64rem; }
.bar-list { padding: 3px 21px 18px; }
.bar-row { display: grid; grid-template-columns: 78px 1fr 48px; align-items: center; gap: 9px; margin: 10px 0; font-size: .69rem; }
.bar-row strong { color: var(--muted-strong); }
.bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--line-soft); }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #5fc0b8); }
.bar-value { color: var(--ink); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

.filters { display: flex; align-items: flex-end; gap: 8px; }
select, input[type="search"], input[type="date"] { height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: .75rem; }
select { min-width: 130px; padding: 0 31px 0 11px; }
input[type="search"] { width: 180px; padding: 0 10px 0 34px; }
input[type="date"] { padding: 0 9px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.field-label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: .61rem; font-weight: 700; }
.button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; font-size: .72rem; font-weight: 700; }
.button:disabled { cursor: not-allowed; opacity: .58; }
.button--primary { border: 1px solid var(--brand); background: var(--brand); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 24%, transparent); }
.button--primary:hover:not(:disabled) { border-color: var(--brand-dark); background: var(--brand-dark); }
.button--secondary { border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted-strong); }
.button--secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }

.collection-start-button { display: inline-flex; min-width: 98px; align-items: center; justify-content: center; gap: 7px; }
.collection-spinner { display: none; width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid rgba(255, 255, 255, .4); border-top-color: currentColor; border-radius: 50%; }
.collection-start-button[aria-busy="true"] .collection-spinner { display: inline-block; animation: spin .8s linear infinite; }
.collection-status { display: flex; align-items: flex-start; gap: 10px; margin: 0 20px 14px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-soft); }
.collection-status__indicator { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.collection-status > div { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.collection-status strong { color: var(--ink); font-size: .72rem; }
.collection-status span, .collection-status time { color: var(--muted); font-size: .67rem; }
.collection-status time:not([hidden])::before { content: "·"; margin-right: 8px; }
.collection-status[data-state="collecting"] { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 56%, var(--surface)); }
.collection-status[data-state="collecting"] .collection-status__indicator { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); animation: status-pulse 1.2s ease-in-out infinite; }
.collection-status[data-state="success"] { border-color: color-mix(in srgb, var(--positive) 26%, var(--line)); background: color-mix(in srgb, var(--positive-soft) 58%, var(--surface)); }
.collection-status[data-state="success"] .collection-status__indicator { background: var(--positive); box-shadow: 0 0 0 4px var(--positive-soft); }
.collection-status[data-state="warning"] { border-color: color-mix(in srgb, var(--warning) 30%, var(--line)); background: color-mix(in srgb, var(--warning-soft) 58%, var(--surface)); }
.collection-status[data-state="warning"] .collection-status__indicator { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.collection-status[data-state="error"] { border-color: color-mix(in srgb, var(--negative) 28%, var(--line)); background: color-mix(in srgb, var(--negative-soft) 58%, var(--surface)); }
.collection-status[data-state="error"] .collection-status__indicator { background: var(--negative); box-shadow: 0 0 0 4px var(--negative-soft); }
@keyframes status-pulse { 50% { opacity: .55; transform: scale(.82); } }

.split-grid { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(480px, 1.1fr); gap: 15px; }
.chart-panel { min-height: 440px; }
.chart { position: relative; min-height: 325px; margin: 0 18px 17px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 14%, transparent), transparent); }
.chart--large { min-height: 440px; margin-top: 13px; }
.chart svg { display: block; width: 100%; height: 100%; min-height: inherit; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-family: inherit; font-size: 10px; }
.chart .series-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .series-dot { stroke: var(--surface); stroke-width: 2; }
.chart .area-fill { opacity: .11; }
.chart-tooltip { position: absolute; z-index: 5; min-width: 112px; padding: 8px 10px; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); border-radius: 8px; background: var(--tooltip-bg); color: var(--surface); box-shadow: var(--shadow); font-size: .65rem; opacity: 0; transition: opacity .08s; }
html[data-theme="dark"] .chart-tooltip { color: #11222c; }
.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip strong { font-size: .73rem; }
.chart-tooltip span { opacity: .72; }
.empty-state { display: flex; min-height: inherit; align-items: center; justify-content: center; flex-direction: column; gap: 5px; padding: 30px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--muted-strong); font-size: .81rem; }
.empty-state span { max-width: 380px; font-size: .69rem; }

.country-pills { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 22px; }
.country-pill { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted-strong); font-size: .69rem; font-weight: 700; }
.country-pill:hover { border-color: var(--brand); color: var(--brand); }
.country-pill.is-selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.country-pill i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; min-height: 30px; padding: 0 22px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-strong); font-size: .67rem; }
.legend-item i { width: 18px; height: 3px; border-radius: 5px; }
.curve-table-wrap { margin-top: 2px; border-top: 1px solid var(--line-soft); }

.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.notice--important { border-color: color-mix(in srgb, var(--warning) 32%, var(--line)); background: color-mix(in srgb, var(--warning-soft) 42%, var(--surface)); }
.notice svg { flex: 0 0 auto; width: 21px; height: 21px; margin-top: 1px; fill: none; stroke: var(--warning); stroke-width: 1.8; }
.notice strong { color: var(--ink); font-size: .79rem; }
.notice p { margin: 3px 0 0; color: var(--muted-strong); font-size: .72rem; }
.flow-grid { align-items: start; }
.source-tag { display: inline-block; margin-bottom: 5px; padding: 3px 8px; border-radius: 99px; font-size: .6rem; font-weight: 800; letter-spacing: .02em; }
.source-tag--official { background: var(--positive-soft); color: var(--positive); }
.source-tag--proxy { background: var(--warning-soft); color: var(--warning); }
.footnote { margin: 0; padding: 11px 19px 15px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .64rem; }
.methodology { display: grid; grid-template-columns: 180px 1fr; gap: 25px; margin-top: 15px; padding: 21px 22px; }
.methodology h2 { margin: 2px 0; color: var(--navy); font-size: 1rem; }
.methodology__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.methodology__grid > div { position: relative; padding-left: 32px; }
.methodology__grid span { position: absolute; left: 0; top: -1px; color: var(--brand); font-size: .69rem; font-weight: 800; }
.methodology__grid strong { color: var(--ink); font-size: .72rem; }
.methodology__grid p { margin: 4px 0 0; color: var(--muted); font-size: .66rem; }

.run-list { padding: 0 21px 16px; }
.run-item { display: grid; grid-template-columns: 15px minmax(130px, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: .7rem; }
.run-item:last-child { border-bottom: 0; }
.run-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.run-item__dot.is-ok { background: var(--positive); box-shadow: 0 0 0 4px var(--positive-soft); }
.run-item__dot.is-error { background: var(--negative); box-shadow: 0 0 0 4px var(--negative-soft); }
.run-item strong { color: var(--ink); }
.run-item span, .run-item time { color: var(--muted); }

.loading-row { display: flex; min-height: 72px; align-items: center; justify-content: center; color: var(--muted); font-size: .71rem; }
.loading-row::before { content: ""; width: 15px; height: 15px; margin-right: 8px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-block { background: linear-gradient(90deg, var(--surface) 20%, var(--surface-soft) 40%, var(--surface) 60%); background-size: 220% 100%; animation: shimmer 1.35s infinite linear; }
@keyframes shimmer { to { background-position: -220% 0; } }

.error-box { margin: 16px 20px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--negative) 30%, var(--line)); border-radius: 10px; background: var(--negative-soft); color: var(--negative); font-size: .71rem; }
.error-box strong { display: block; margin-bottom: 2px; }

.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(380px, calc(100% - 40px)); padding: 11px 15px; transform: translateY(20px); border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow); font-size: .72rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { transform: none; opacity: 1; }
.toast.is-error { border-color: color-mix(in srgb, var(--negative) 35%, var(--line)); }
.noscript { position: fixed; inset: auto 20px 20px; z-index: 100; padding: 13px; border-radius: 10px; background: var(--negative); color: white; text-align: center; }

footer { display: flex; justify-content: space-between; gap: 2rem; padding: 22px 5px 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: .63rem; }
footer p { margin: 0; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .panel--wide { grid-column: 1 / -1; grid-row: auto; }
    .split-grid { grid-template-columns: 1fr; }
    .chart-panel { min-height: 400px; }
}

@media (max-width: 760px) {
    body { font-size: 14px; }
    .topbar__inner, .page-shell { width: min(calc(100% - 24px), var(--page-width)); }
    .topbar__inner { min-height: 60px; }
    .brand small { display: none; }
    .brand__mark { width: 34px; height: 34px; }
    .live-status { display: none; }
    .hero { align-items: flex-start; padding: 29px 2px 22px; }
    .hero > div:first-child > p:last-child { font-size: .8rem; }
    .as-of-card { display: none; }
    .tabbar { top: 60px; border-radius: 11px; }
    .tab { padding: 8px 15px; }
    main { padding-top: 14px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .metric-grid { gap: 10px; }
    .metric-card { min-height: 112px; padding: 15px; }
    .metric-card__value { font-size: 1.23rem; }
    .panel__header--responsive { align-items: stretch; flex-direction: column; }
    .filters { align-items: stretch; }
    .filters > * { flex: 1; }
    .filters select, .filters input[type="search"] { width: 100%; min-width: 0; }
    .health-grid { grid-template-columns: 1fr; gap: 10px; }
    .chart--large { min-height: 350px; }
    .ag-grid--overview { height: 430px; }
    .ag-grid--large { height: 610px; }
    .ag-grid--medium { height: 390px; }
    .ag-grid--curve { height: 315px; }
    .grid-inline-toolbar { justify-content: stretch; padding-left: 14px; padding-right: 14px; }
    .grid-inline-toolbar .search-box { flex: 1; }
    .grid-inline-toolbar .search-box input { width: 100%; }
    .methodology { grid-template-columns: 1fr; gap: 15px; }
    .methodology__grid { grid-template-columns: 1fr; gap: 15px; }
    footer { flex-direction: column; gap: 7px; }
}

@media (max-width: 480px) {
    .brand strong { font-size: .82rem; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .metric-card { min-height: 105px; }
    .metric-card__label { font-size: .68rem; }
    .metric-card__icon { display: none; }
    .metric-card__value { margin-top: 11px; font-size: 1.08rem; }
    .metric-card__detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .panel__header { padding: 17px 16px 12px; }
    .data-table th, .data-table td { padding: 10px 13px; }
    .country-pills { padding: 0 16px; }
    .chart { margin-left: 10px; margin-right: 10px; }
    .notice { padding: 14px; }
}

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