/* Statistics pages (dgtstats). Same palette and cards as the guides. */
:root {
    --st-accent: #007a6a;
    --st-accent-dark: #005a4e;
    --st-accent-soft: #e6f4f1;
    --st-ink: #1a202c;
    --st-text: #2d3748;
    --st-muted: #64748b;
    --st-line: #e2e8f0;
    --st-card: #ffffff;
    --st-bg: #f4f6f8;
    --st-up: #0f766e;
    --st-down: #b45309;
}

body { background: var(--st-bg); overflow-x: hidden; }

.st-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.st-narrow { max-width: 820px; }

/* Sub navigation between the statistics pages */
.st-nav {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(6px);
    border-bottom: 1px solid var(--st-line);
    width: 100vw; margin-left: calc(50% - 50vw);
}
.st-nav ul {
    display: flex; gap: .25rem; list-style: none; margin: 0 auto; padding: .5rem 16px;
    max-width: 1120px; overflow-x: auto; scrollbar-width: none;
}
.st-nav ul::-webkit-scrollbar { display: none; }
.st-nav a {
    display: block; white-space: nowrap; padding: .4rem .85rem; border-radius: 999px;
    color: var(--st-text); font-size: .9rem; font-weight: 600; text-decoration: none;
}
.st-nav a:hover { background: var(--st-accent-soft); color: var(--st-accent-dark); }
.st-nav a.active { background: var(--st-accent); color: #fff; }

/* Hero */
.st-hero { padding: 2.25rem 0 1.25rem; }
.st-eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700;
    color: var(--st-accent); background: var(--st-accent-soft); border: 1px solid #b2ddd6;
    border-radius: 999px; padding: .25rem .8rem; margin-bottom: .9rem;
}
.st-hero h1 { font-size: 2.1rem; font-weight: 800; line-height: 1.18; color: var(--st-ink); margin-bottom: .6rem; }
.st-hero .st-lead { font-size: 1.08rem; color: #4a5568; max-width: 760px; line-height: 1.6; }
.st-meta { font-size: .85rem; color: var(--st-muted); margin-top: .6rem; }

/* KPI cards */
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 1.25rem 0 1.5rem; }
.st-kpi {
    background: var(--st-card); border-radius: 14px; padding: 1.1rem 1.2rem;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .06); border: 1px solid #edf2f7;
}
.st-kpi-label { font-size: .82rem; color: var(--st-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.st-kpi-value { font-size: 2rem; font-weight: 800; color: var(--st-ink); line-height: 1.15; margin: .3rem 0 .2rem; font-variant-numeric: tabular-nums; }
.st-kpi-value small { font-size: 1rem; font-weight: 700; color: var(--st-muted); }
.st-kpi-note { font-size: .86rem; color: #4a5568; }
.st-delta { display: inline-flex; align-items: center; gap: .15rem; font-weight: 700; font-size: .85rem; border-radius: 6px; padding: 0 .35rem; }
.st-delta.up { color: var(--st-up); background: #e6f6f4; }
.st-delta.down { color: var(--st-down); background: #fdf3e7; }
.st-delta.flat { color: var(--st-muted); background: #f1f5f9; }

/* Highlights */
.st-highlights {
    background: var(--st-accent-soft); border-left: 4px solid var(--st-accent); border-radius: 10px;
    padding: 1rem 1.3rem; margin: .5rem 0 2rem;
}
.st-highlights h2 { font-size: 1rem; font-weight: 800; color: var(--st-accent-dark); margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .04em; }
.st-highlights ul { margin: 0; padding-left: 1.1rem; }
.st-highlights li { color: var(--st-ink); line-height: 1.6; margin-bottom: .25rem; }

/* Sections */
.st-section { margin: 2.5rem 0 1rem; }
.st-section > h2 { font-size: 1.55rem; font-weight: 800; color: var(--st-ink); margin-bottom: .4rem; }
.st-section > p, .st-prose p { color: var(--st-text); line-height: 1.7; max-width: 820px; }
.st-grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 992px) { .st-grid-2 { grid-template-columns: 1fr 1fr; } }

/* Chart cards */
.ic-chart {
    background: var(--st-card); border-radius: 14px; border: 1px solid #edf2f7;
    box-shadow: 0 2px 16px rgba(15, 23, 42, .06); padding: 1.1rem 1.1rem .8rem; margin: 1.25rem 0;
}
.ic-chart figcaption h3 { font-size: 1.12rem; font-weight: 800; color: var(--st-ink); margin: 0 0 .2rem; }
.ic-chart figcaption p { font-size: .88rem; color: var(--st-muted); margin: 0; }
.ic-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; }
.ic-chart-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ic-seg { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; }
.ic-seg button {
    border: 0; background: transparent; color: #475569; font-size: .8rem; font-weight: 700;
    padding: .3rem .65rem; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.ic-seg button.on { background: #fff; color: var(--st-accent-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ic-chart select, .ic-chart input[type=search] {
    font-size: .85rem; border: 1px solid var(--st-line); border-radius: 8px; padding: .3rem .55rem; background: #fff; color: var(--st-text);
}
.ic-chart input[type=search] { min-width: 180px; }
.ic-chart-canvas { position: relative; width: 100%; }
.ic-chart-canvas canvas { position: absolute; inset: 0; }
.ic-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .9rem; }
.ic-chart-foot {
    display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between;
    border-top: 1px solid #f1f5f9; margin-top: .75rem; padding-top: .6rem; font-size: .8rem; color: var(--st-muted);
}
.ic-chart-foot .ic-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.ic-chart-foot button, .ic-chart-foot a.ic-act {
    border: 1px solid var(--st-line); background: #fff; color: #475569; border-radius: 7px;
    font-size: .78rem; font-weight: 700; padding: .2rem .55rem; cursor: pointer; text-decoration: none;
}
.ic-chart-foot button:hover, .ic-chart-foot a.ic-act:hover { border-color: var(--st-accent); color: var(--st-accent-dark); }
.ic-chart-note { font-size: .82rem; color: var(--st-muted); margin-top: .4rem; }

/* Embed code box */
.ic-embed-box { display: none; margin-top: .6rem; }
.ic-embed-box.open { display: block; }
.ic-embed-box textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; border: 1px solid var(--st-line); border-radius: 8px; padding: .5rem; color: #334155; }

/* Ranking tables */
.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.st-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--st-muted); font-weight: 700; text-align: left; padding: .5rem .6rem; border-bottom: 2px solid var(--st-line); white-space: nowrap; }
.st-table td { padding: .55rem .6rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.st-table tr:hover td { background: #fafcfc; }
.st-table .num { text-align: right; white-space: nowrap; }
.st-table .rank { color: #94a3b8; font-weight: 700; width: 2.2rem; }
.st-table .model { font-weight: 700; color: var(--st-ink); }
.st-table .brand { color: var(--st-muted); font-size: .82rem; display: block; font-weight: 600; }
.st-table .spark { width: 120px; }
.st-table .mix { width: 110px; }
.st-mix { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #f1f5f9; }
.st-mix span { display: block; height: 100%; }
.st-more { text-align: center; margin-top: .6rem; }
.st-more button { border: 1px solid var(--st-line); background: #fff; border-radius: 8px; padding: .35rem 1rem; font-weight: 700; color: var(--st-accent-dark); font-size: .85rem; }

/* Map */
.ic-map-wrap { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
@media (min-width: 992px) { .ic-map-wrap { grid-template-columns: 3fr 2fr; } }
.ic-map { width: 100%; height: auto; display: block; }
.ic-map path[data-p] { fill: #e2e8f0; stroke: #fff; stroke-width: .7; transition: fill .2s; cursor: pointer; }
.ic-map path[data-p]:hover, .ic-map path[data-p].hot { stroke: #0f172a; stroke-width: 1.4; }
.ic-map .ic-map-border { fill: none; stroke: #cbd5e1; stroke-width: 1; }
.ic-map-legend { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--st-muted); margin-top: .4rem; }
.ic-map-legend .bar { flex: 1; height: 10px; border-radius: 5px; }
.ic-map-tip {
    position: fixed; pointer-events: none; z-index: 50; background: #0f172a; color: #fff;
    font-size: .8rem; padding: .4rem .6rem; border-radius: 8px; display: none; max-width: 240px;
}
.ic-map-side h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--st-muted); font-weight: 700; margin: .25rem 0 .4rem; }
.ic-map-side ol { padding-left: 1.2rem; margin: 0 0 .9rem; font-size: .9rem; }
.ic-map-side li { margin-bottom: .15rem; }
.ic-map-side li b { font-variant-numeric: tabular-nums; }

/* Cards on the hub */
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.st-card {
    display: block; background: var(--st-card); border-radius: 14px; padding: 1.2rem 1.25rem;
    border: 1px solid #edf2f7; box-shadow: 0 2px 12px rgba(15, 23, 42, .06); color: inherit; text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.st-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(15, 23, 42, .1); text-decoration: none; color: inherit; }
.st-card .st-card-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--st-accent-soft); color: var(--st-accent); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: .7rem; }
.st-card h2 { font-size: 1.1rem; font-weight: 800; color: var(--st-ink); margin: 0 0 .3rem; }
.st-card .st-card-big { font-size: 1.7rem; font-weight: 800; color: var(--st-ink); font-variant-numeric: tabular-nums; }
.st-card p { font-size: .9rem; color: #4a5568; margin: .2rem 0 0; }
.st-card .st-card-go { display: inline-block; margin-top: .7rem; font-weight: 700; color: var(--st-accent); font-size: .9rem; }

/* Press / custom data and cite boxes */
.st-press {
    background: linear-gradient(135deg, #003d35 0%, #007a6a 100%); color: #fff; border-radius: 16px;
    padding: 1.6rem 1.5rem; margin: 2.5rem 0; display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 768px) { .st-press { grid-template-columns: 2fr 1fr; align-items: center; } }
.st-press h2 { color: #fff; font-size: 1.35rem; font-weight: 800; margin: 0 0 .4rem; }
.st-press p { color: #d7efeb; margin: 0; line-height: 1.6; }
.st-press a.btn-press { display: inline-block; background: #fff; color: var(--st-accent-dark); font-weight: 800; border-radius: 10px; padding: .7rem 1.2rem; text-decoration: none; text-align: center; }
.st-press a.btn-press:hover { background: #e6f4f1; text-decoration: none; }
.st-cite { background: #fff; border: 1px dashed #b2ddd6; border-radius: 12px; padding: 1rem 1.2rem; font-size: .9rem; color: var(--st-text); }
.st-cite code { color: var(--st-accent-dark); background: var(--st-accent-soft); padding: .1rem .35rem; border-radius: 4px; }

/* Buyer call to action (used-car pages) */
.st-buyer {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
    background: #fff; border: 2px solid var(--st-accent); border-radius: 14px; padding: 1.1rem 1.3rem; margin: 1.5rem 0;
}
.st-buyer p { margin: 0; color: var(--st-ink); font-weight: 600; max-width: 640px; }
.st-buyer a { background: var(--st-accent); color: #fff; font-weight: 800; padding: .65rem 1.3rem; border-radius: 10px; text-decoration: none; white-space: nowrap; }
.st-buyer a:hover { background: var(--st-accent-dark); color: #fff; text-decoration: none; }

/* Method and FAQ */
.st-method { background: #fff; border-radius: 14px; padding: 1.25rem 1.4rem; border: 1px solid #edf2f7; }
.st-method h3 { font-size: 1rem; font-weight: 800; margin-top: 1rem; }
.st-method p, .st-method li { font-size: .93rem; color: var(--st-text); line-height: 1.65; }
.st-faq details { background: #fff; border: 1px solid #edf2f7; border-radius: 10px; padding: .8rem 1rem; margin-bottom: .6rem; }
.st-faq summary { font-weight: 700; color: var(--st-ink); cursor: pointer; }
.st-faq details p { margin: .6rem 0 0; color: var(--st-text); line-height: 1.65; }

/* Embed page */
.st-embed-body { background: #fff; margin: 0; padding: 8px; }
.st-embed-body .ic-chart { box-shadow: none; border: 0; margin: 0; padding: 4px; }

@media (max-width: 575px) {
    .st-hero h1 { font-size: 1.6rem; }
    .st-kpi-value { font-size: 1.6rem; }
    .st-table .spark, .st-table .mix, .st-table .hide-sm { display: none; }
    .ic-chart { padding: .9rem .75rem .7rem; }
}
