:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #67728a;
    --border: #dfe5ee;
    --accent: #3458d4;
    --accent-soft: #eef2ff;
    --success: #177245;
    --shadow: 0 12px 30px rgba(24, 38, 74, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.hero {
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .18), transparent 28%),
        linear-gradient(135deg, #203aa8, #4c6de8);
    color: white;
    padding: 64px 24px 56px;
}

.hero-inner,
main {
    max-width: 1120px;
    margin: 0 auto;
}

.eyebrow,
.section-kicker {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.03;
    max-width: 850px;
}

.hero-copy {
    margin: 18px 0 0;
    max-width: 760px;
    font-size: 18px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .88);
}

main {
    padding: 40px 24px 60px;
}

section {
    margin-bottom: 42px;
}

.section-heading {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 28px;
}

.section-kicker {
    color: var(--accent);
}

.section-note,
.status {
    color: var(--muted);
    font-size: 14px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.metric-card,
.skeleton-card,
.panel,
.insight-card,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 22px;
}

.metric-card.best {
    border-color: #aab9ff;
    background: linear-gradient(180deg, #fff, var(--accent-soft));
}

.metric-card h3 {
    margin: 0 0 18px;
    font-size: 18px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-top: 1px solid #edf0f5;
}

.metric-row:first-of-type {
    border-top: 0;
}

.metric-value {
    font-weight: 800;
}

.best-badge {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: var(--success);
    background: #eaf8f0;
}

.skeleton-card {
    min-height: 190px;
    animation: pulse 1.2s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: .55;
    }

    to {
        opacity: .9;
    }
}

.panel {
    padding: 24px;
}

.store-picker {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
}

select {
    min-width: 110px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

.chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 8px 0 18px;
    font-size: 13px;
    color: var(--muted);
}

.chart {
    width: 100%;
    min-height: 430px;
    overflow-x: auto;
}

.chart svg {
    display: block;
    width: 100%;
    min-width: 760px;
    height: 430px;
}

.chart .grid-line {
    stroke: #e8ecf3;
    stroke-width: 1;
}

.chart .axis-text {
    fill: #7b8497;
    font-size: 11px;
}

.chart .series-line {
    fill: none;
    stroke-width: 2.4;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart .actual {
    stroke: #172033;
}

.chart .baseline {
    stroke: #d68b22;
}

.chart .holt {
    stroke: #7e57c2;
}

.chart .ml {
    stroke: #2379c9;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    background: #f9fafc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.best-cell {
    font-weight: 800;
    color: var(--success);
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.insight-card {
    padding: 22px;
}

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

.insight-card p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

footer {
    padding: 28px 24px 42px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.error {
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff0f0;
    color: #9e2b2b;
    border: 1px solid #ffd4d4;
}

@media (max-width: 800px) {

    .metric-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding-top: 46px;
    }
}