:root {
    color-scheme: light;
    --paper: #fafaf7;
    --surface: #ffffff;
    --ink: #14171c;
    --muted: #525a66;
    --line: #e4e2dc;
    --card-line: #d0cdc6;
    --accent: #1f3a68;
    --soft: #e8edf5;
}

html.dark {
    color-scheme: dark;
    --paper: #0e1116;
    --surface: #151a21;
    --ink: #e8e6e1;
    --muted: #9aa3af;
    --line: #262c35;
    --card-line: #3a4250;
    --accent: #8fb0e6;
    --soft: #1a2436;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
}

body {
    padding: 18px 16px 20px;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.35;
}

h2,
h3,
p {
    margin: 0;
}

h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.card,
.pill {
    border: 1px solid var(--card-line);
    border-radius: 12px;
    background: var(--surface);
}

.hot {
    border-color: var(--accent);
    background: var(--soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.cols,
.flow,
.themes {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.cols,
.themes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.col h3,
.themes h3 {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.card {
    margin-top: 10px;
    padding: 12px 10px;
    text-align: center;
}

.card strong,
.card b {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.card em,
.card .quiet {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12.5px;
    font-style: normal;
    font-weight: 400;
}

.flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
}

.flow article {
    margin-top: 0;
    padding: 14px 12px;
    text-align: left;
}

.flow h3 {
    margin-bottom: 12px;
    font-size: 14.5px;
    text-align: left;
}

.kicker {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12.5px;
}

.flow strong {
    display: block;
    margin-top: 2px;
    font-size: 14px;
}

.arrow {
    align-self: center;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.tops {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 16px;
}

.tops article {
    margin-top: 0;
    padding: 14px 14px 12px;
    text-align: left;
}

.tops h3 {
    margin-bottom: 8px;
    font-size: 14.5px;
}

.tops p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.stem {
    width: 1px;
    height: 26px;
    margin: 0 auto;
    background: var(--muted);
    position: relative;
}

.stem::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--muted);
}

.sink {
    max-width: 440px;
    margin: 2px auto 0;
    padding: 14px 16px;
    text-align: left;
}

.sink h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.sink p {
    font-size: 14px;
    line-height: 1.45;
}

.themes article {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    margin-top: 0;
    padding: 14px 14px 12px;
    text-align: left;
}

.themes h3 {
    margin-bottom: 12px;
}

.themes ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.themes li {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.like {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.themes article.hot .like {
    border-top-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.cols-head,
.band {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
}

.cols-head {
    grid-template-columns: 104px minmax(0, 0.9fr) 22px minmax(0, 1.15fr);
    margin-top: 16px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

.band + .band {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.band h3 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: right;
}

.rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) 22px minmax(0, 1.15fr);
    align-items: center;
}

.pill {
    margin: 0;
    padding: 9px 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.map-head {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) 22px minmax(0, 1.15fr);
    margin-top: 16px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
}

.pairs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card.gone {
    border-style: dashed;
    background: transparent;
    box-shadow: none;
}

.card.gone strong,
.card.gone h3 {
    color: var(--muted);
}

.steps {
    margin-top: 16px;
}

.steps .card {
    margin-top: 0;
    text-align: left;
}

.steps .arrow {
    padding: 3px 0;
}

.bars {
    margin-top: 16px;
}

.bar-row {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 58px;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.bar-row span {
    font-size: 13px;
    font-weight: 600;
}

.bar-row .val {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.track {
    height: 26px;
    overflow: hidden;
    border-radius: 8px;
    background: color-mix(in srgb, var(--line) 80%, var(--surface));
}

.fill {
    height: 100%;
    border-radius: 8px;
    background: var(--muted);
}

.fill.hot {
    background: var(--accent);
}

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

.matrix {
    margin-top: 16px;
}

.matrix .axis {
    margin: 12px 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.matrix .two,
.quad,
.pair,
.roles {
    display: grid;
    gap: 8px;
}

.matrix .two,
.quad,
.pair {
    grid-template-columns: 1fr 1fr;
}

.roles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
}

.quad,
.pair {
    margin-top: 16px;
    gap: 12px;
}

.matrix .card,
.quad article,
.pair article,
.roles article {
    margin-top: 0;
    text-align: left;
}

.roles article {
    padding: 10px 8px;
    text-align: center;
}

.xlab {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.wheel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
        'a ab b bc c'
        'up . . . down'
        'f ef e de d';
    gap: 4px 6px;
    align-items: stretch;
    margin-top: 16px;
}

.wheel article {
    margin-top: 0;
    padding: 12px;
    text-align: left;
}

.wheel .a { grid-area: a; }
.wheel .ab { grid-area: ab; }
.wheel .b { grid-area: b; }
.wheel .bc { grid-area: bc; }
.wheel .c { grid-area: c; }
.wheel .d { grid-area: d; }
.wheel .de { grid-area: de; }
.wheel .e { grid-area: e; }
.wheel .ef { grid-area: ef; }
.wheel .f { grid-area: f; }

.n {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.meter {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    height: 132px;
    margin-top: 14px;
}

.meter .salary,
.meter .spend {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.meter .salary {
    height: 46px;
    background: var(--line);
    color: var(--ink);
}

.meter .spend {
    border: 1px solid var(--accent);
    background: var(--soft);
    color: var(--accent);
}

.meter .spend.low {
    height: 26px;
}

.meter .spend.high {
    height: 78px;
}

.tops ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tops li {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.rail {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.rail li {
    position: relative;
    margin: 0;
    padding: 0 0 14px 18px;
    border-left: 1px solid var(--card-line);
    font-size: 14px;
    line-height: 1.4;
}

.rail li:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.rail li::before {
    content: '';
    position: absolute;
    top: 4px;
    left: -4px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    background: var(--surface);
}

.rail li.hot {
    background: transparent;
    box-shadow: none;
    border-color: var(--card-line);
}

.rail li.hot::before {
    background: var(--accent);
}

.rail b {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.rail li.hot b {
    color: var(--accent);
}

.chain {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    margin-top: 16px;
}

.chain .card {
    margin-top: 0;
    padding: 12px 8px;
}

.track {
    position: relative;
}

.one-x {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 0;
    border-left: 1px dashed var(--ink);
}

.grid2 {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    margin-top: 16px;
}

.grid2 .side {
    align-self: center;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.grid2 .card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 96px;
    margin-top: 0;
}

.grid2 .foot {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
}

.chips {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.chips li {
    margin-top: 8px;
    padding: 7px 12px;
    border: 1px dashed var(--card-line);
    border-radius: 8px;
    font-size: 13.5px;
}

.hot .chips li {
    border: 1px solid var(--accent);
    background: var(--surface);
}

.tops article.hot h3,
.tops article.gone h3 {
    margin-bottom: 4px;
}

.wheel .up { grid-area: up; }
.wheel .down { grid-area: down; }

.wheel .up,
.wheel .down {
    justify-self: center;
}

@media (max-width: 560px) {
    .chain {
        grid-template-columns: 1fr;
    }

    .chain .arrow {
        transform: rotate(90deg);
    }

    .grid2 {
        grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
    }

    .grid2 .side {
        font-size: 11.5px;
    }

    .cols,
    .themes,
    .tops {
        grid-template-columns: 1fr;
    }

    .flow {
        grid-template-columns: 1fr;
    }

    .flow .arrow {
        transform: rotate(90deg);
        padding: 2px 0;
    }

    .cols-head {
        display: none;
    }

    .band,
    .band + .band {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .band h3 {
        text-align: left;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .row .arrow {
        transform: rotate(90deg);
    }

    .sink {
        max-width: none;
    }

    .map-head {
        display: none;
    }

    .wheel {
        grid-template-columns: 1fr;
        grid-template-areas:
            'a'
            'b'
            'c'
            'd'
            'e'
            'f';
    }

    .wheel .arrow {
        display: none;
    }

    .pair {
        grid-template-columns: 1fr;
    }

    .roles,
    .quad,
    .matrix .two,
    .matrix .xlab {
        grid-template-columns: 1fr 1fr;
    }
}
