:root {
    color-scheme: light;
    --bg: #f5f1e8;
    --panel: rgba(255, 252, 245, 0.92);
    --panel-strong: #fffaf0;
    --line: rgba(44, 36, 22, 0.12);
    --text: #261e12;
    --muted: #6c5d49;
    --accent: #b45309;
    --accent-2: #1d4ed8;
    --accent-3: #15803d;
    --shadow: 0 24px 60px rgba(48, 38, 21, 0.12);
    font-family: Georgia, 'Times New Roman', serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(180, 83, 9, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(29, 78, 216, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f3e9 0%, #efe7d8 100%);
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

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

.hero {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.95;
}

.hero p {
    max-width: 72ch;
    color: var(--muted);
    line-height: 1.5;
    font-size: 1rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.controls {
    padding: 20px;
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.controls form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 240px) auto;
    gap: 14px;
    align-items: end;
}

label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

select,
button {
    appearance: none;
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(44, 36, 22, 0.14);
    background: #fffdf8;
    color: var(--text);
    font: inherit;
    padding: 12px 14px;
}

button {
    width: auto;
    min-width: 140px;
    background: linear-gradient(135deg, #b45309, #d97706);
    border-color: transparent;
    color: #fffdf8;
    cursor: pointer;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    padding: 18px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.card h2,
.card h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric {
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1;
    margin-bottom: 10px;
}

.meta {
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.94rem;
}

.section {
    padding: 22px;
    margin-bottom: 24px;
}

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

.section-header p {
    color: var(--muted);
    line-height: 1.5;
}

.chart-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-select {
    display: grid;
    gap: 8px;
    min-width: 220px;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.extreme {
    padding: 18px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.extreme strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

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

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

th {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

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

tbody tr.is-selected {
    background: rgba(180, 83, 9, 0.12);
}

.rank {
    font-weight: 700;
    color: var(--accent);
}

.price {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.chart-shell {
    padding: 14px 12px 4px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
}

canvas {
    width: 100%;
    height: 420px;
}

.note {
    color: var(--muted);
    font-size: 0.93rem;
    margin-top: 10px;
}

@media (max-width: 960px) {
    .grid,
    .two-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .controls form {
        grid-template-columns: 1fr 1fr;
    }

    .controls form button {
        grid-column: 1 / -1;
    }
}

#stationMap {
    height: 480px;
    border-radius: 18px;
    border: 1px solid var(--line);
    z-index: 0;
}

.map-legend {
    color: var(--muted);
    font-size: 0.93rem;
    margin-top: 10px;
}

@media (max-width: 640px) {
    .page {
        width: min(100% - 20px, 1180px);
        padding-top: 20px;
    }

    .grid,
    .two-col,
    .controls form {
        grid-template-columns: 1fr;
    }

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

    .chart-header-controls {
        width: 100%;
    }

    .mode-select {
        width: 100%;
    }

    canvas {
        height: 320px;
    }

    #stationMap {
        height: 340px;
    }
}

.breadcrumb {
    padding-top: 16px;
    padding-bottom: 0;
}

.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--muted);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 4px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.site-footer {
    padding-top: 24px;
    padding-bottom: 32px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.ranking-link {
    color: var(--text);
    text-decoration: none;
}

.ranking-link:hover {
    color: var(--accent);
    text-decoration: underline;
}
