:root {
    --ink: #12181a;
    --panel: #1b2427;
    --panel-2: #212b2e;
    --hair: #2e3a3d;
    --paper: #e9e3d0;
    --paper-dim: #9aa096;
    --c1: #e2793d;
    --c2: #5fa8a3;
    --c3: #c9a227;
    --c4: #7b8cde;
    --c5: #a85c8b;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: "IBM Plex Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body {
    background-image:
        radial-gradient(
            circle at 20% 0%,
            rgba(95, 168, 163, 0.06),
            transparent 40%
        ),
        radial-gradient(
            circle at 90% 10%,
            rgba(226, 121, 61, 0.06),
            transparent 45%
        );
}

.wrap {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 20px 80px;
    min-height: 100vh;
}

.eyebrow {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.eyebrow::before {
    content: "";
    width: 16px;
    height: 1px;
    background: var(--c1);
    display: inline-block;
}
h1 {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 34px;
    letter-spacing: -0.01em;
    margin: 6px 0 4px;
}
.sub {
    color: var(--paper-dim);
    font-size: 14px;
    max-width: 520px;
    line-height: 1.5;
    margin-bottom: 22px;
}

.how-it-works {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}
.hiw-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    color: var(--paper-dim);
}
.hiw-num {
    color: var(--c1);
    font-weight: 600;
}
.hiw-sep {
    color: var(--hair);
    font-size: 12px;
}
@media (max-width: 640px) {
    .hiw-sep {
        display: none;
    }
    .how-it-works {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

.titlerow {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
}
.title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 220px;
}
.trip-title-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--hair);
    color: var(--paper);
    font-family: "Space Grotesk", sans-serif;
    font-size: 22px;
    font-weight: 600;
    padding: 4px 0;
    width: 100%;
    max-width: 420px;
    outline: none;
}
.trip-title-input:focus {
    border-color: var(--c1);
}
.trip-subtitle-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--paper-dim);
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 13.5px;
    padding: 2px 0;
    width: 100%;
    max-width: 420px;
    outline: none;
}
.trip-subtitle-input:hover {
    border-bottom-color: var(--hair);
}
.trip-subtitle-input:focus {
    border-bottom-color: var(--c1);
    color: var(--paper);
}
.trip-subtitle-input::placeholder {
    color: #616860;
}

.dropzone {
    border: 1px dashed var(--hair);
    border-radius: 2px;
    padding: 46px 20px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
    background: var(--panel);
}
.dropzone:hover,
.dropzone.drag {
    border-color: var(--c1);
    background: var(--panel-2);
}
.dropzone .dz-icon {
    font-family: "IBM Plex Mono", monospace;
    font-size: 26px;
    color: var(--c1);
    margin-bottom: 10px;
}
.dropzone .dz-main {
    font-family: "Space Grotesk", sans-serif;
    font-size: 16px;
    margin-bottom: 4px;
}
.dropzone .dz-sub {
    color: var(--paper-dim);
    font-size: 12.5px;
    font-family: "IBM Plex Mono", monospace;
}
.demo-link {
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--paper-dim);
    font-family: "IBM Plex Mono", monospace;
    text-align: center;
}
.demo-link button {
    background: none;
    border: none;
    color: var(--c2);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}
#fileInput {
    display: none;
}

.error-banner {
    background: #241819;
    border: 1px solid #5a3030;
    color: #e8a8a8;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    padding: 12px 14px;
    border-radius: 2px;
    margin-top: 14px;
    line-height: 1.6;
}
.error-banner b {
    color: #f0c0c0;
}

.ledger {
    border: 1px solid var(--hair);
    border-radius: 2px;
    overflow: hidden;
    background: var(--panel);
    margin: 0;
}
.ledger-group + .ledger-group {
    border-top: 1px solid var(--hair);
}
.ledger-group-title {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c1);
    background: var(--panel-2);
    padding: 6px 14px;
    border-bottom: 1px solid var(--hair);
}
.stat-row {
    display: grid;
    grid-template-columns: repeat(
        5,
        1fr
    ); /* JS sets an inline column count per row; this is just the pre-JS fallback */
}
.stat-row + .stat-row {
    border-top: 1px solid var(--hair);
}
.stat-row .cell {
    padding: 14px;
    border-right: 1px solid var(--hair);
}
.stat-row .cell:last-child {
    border-right: none;
}
.stat-row .label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper-dim);
    margin-bottom: 6px;
}
.stat-row .value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 20px;
    font-weight: 600;
}
.stat-row .value span.unit {
    font-size: 12px;
    color: var(--paper-dim);
    font-weight: 400;
    margin-left: 2px;
}

.footnote-help {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-top: 10px;
}

.help-button {
    width: 19px;
    height: 19px;
    padding: 0;
    border: 1px solid var(--hair);
    border-radius: 50%;
    background: var(--panel);
    color: var(--paper-dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s,
        background 0.15s;
}

.help-button:hover,
.help-button.active {
    border-color: var(--c1);
    color: var(--c1);
    background: var(--panel-2);
}

.help-popover {
    position: absolute;
    z-index: 1000;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: min(520px, calc(100vw - 70px));
    padding: 12px 14px;
    background: var(--panel-2);
    border: 1px solid var(--hair);
    border-radius: 3px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--paper-dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.15s,
        visibility 0.15s;
}

.help-popover.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 640px) {
    .help-popover {
        left: 0;
        top: 28px;
        transform: none;
        width: min(420px, calc(100vw - 40px));
    }
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 30px 0 10px;
}
.section-head h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.01em;
}
.section-head .hint {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--paper-dim);
}

#map {
    height: 380px;
    border: 1px solid var(--hair);
    border-radius: 2px;
    background: var(--panel);
}
.leaflet-container {
    background: var(--panel) !important;
    font-family: "IBM Plex Sans", sans-serif;
}
.day-pin {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 600;
    color: #12181a;
    border: 2px solid var(--ink);
}

.elev-wrap {
    border: 1px solid var(--hair);
    border-radius: 2px;
    background: var(--panel);
    padding: 14px 6px 6px;
}
#elevSvg {
    width: 100%;
    height: 260px;
    display: block;
    overflow: visible;
}
.elev-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 14px 4px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--paper-dim);
}
.elev-legend .item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.swatch {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    display: inline-block;
}

.table-scroll {
    overflow-x: auto;
}
table.days {
    width: 100%;
    border-collapse: collapse;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12.5px;
    min-width: 760px;
}
table.days th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper-dim);
    font-weight: 500;
    padding: 8px 10px;
    border-bottom: 1px solid var(--hair);
    white-space: nowrap;
}
table.days td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--hair);
    vertical-align: middle;
    white-space: nowrap;
}
table.days tr:last-child td {
    border-bottom: none;
}
.day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    color: #12181a;
    font-weight: 600;
}
.row-actions {
    display: flex;
    gap: 4px;
}
.row-actions button {
    background: var(--panel-2);
    border: 1px solid var(--hair);
    color: var(--paper);
    width: 24px;
    height: 24px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
}
.row-actions button:hover {
    border-color: var(--c1);
    color: var(--c1);
}
.row-actions button.danger:hover {
    border-color: #c24e4e;
    color: #c24e4e;
}
.filename {
    color: var(--paper-dim);
    font-size: 11px;
}
.up-txt {
    color: var(--c2);
}
.down-txt {
    color: var(--c1);
}

.add-more {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    background: none;
    border: 1px dashed var(--hair);
    color: var(--paper-dim);
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer;
    margin-top: 12px;
}
.add-more:hover {
    border-color: var(--c1);
    color: var(--c1);
}

.card-outer {
    margin-top: 10px;
    margin-bottom: 40px;
}
.card-format-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--paper-dim);
    flex-shrink: 0;
}
.card-format-control label {
    white-space: nowrap;
}
.card-format-control select {
    appearance: none;
    background: var(--panel);
    border: 1px solid var(--hair);
    border-radius: 2px;
    color: var(--paper);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    padding: 8px 28px 8px 10px;
    cursor: pointer;
    max-width: 100%;
}
.card-format-control select:hover,
.card-format-control select:focus {
    border-color: var(--c1);
    outline: none;
}

#tripCard {
    border: 1px solid var(--hair);
    border-radius: 4px;
    background: linear-gradient(180deg, #171f21, #12181a);
    padding: clamp(16px, 4vw, 28px);
    position: relative;
    overflow: hidden;
    /* container-type lets the stat grid react to the CARD's own width
       (set below via max-width per format) rather than the viewport's —
       a narrow Instagram Story card on a wide desktop screen still needs
       to drop to 2 columns even though the browser window itself is wide. */
    container-type: inline-size;
}
/* Fixed-ratio formats: pin the card to that shape and let flexbox give the
   map whatever vertical room is actually left after the title/stats/
   elevation chart, instead of a hardcoded aspect-ratio that would leave the
   map squished or oversized depending on the format. This is the "actually
   change the layout, not just the aspect-ratio" version. */
#tripCard.format-story,
#tripCard.format-portrait,
#tripCard.format-square,
#tripCard.format-landscape,
#tripCard.format-a4,
#tripCard.format-a5 {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
}
#tripCard.format-story {
    max-width: 420px;
    aspect-ratio: 9 / 16;
}
#tripCard.format-portrait {
    max-width: 480px;
    aspect-ratio: 4 / 5;
}
#tripCard.format-square {
    max-width: 560px;
    aspect-ratio: 1 / 1;
}
#tripCard.format-landscape {
    max-width: 820px;
    aspect-ratio: 1.91 / 1;
}
#tripCard.format-a4 {
    max-width: 560px;
    aspect-ratio: 210 / 297;
}
#tripCard.format-a5 {
    max-width: 480px;
    aspect-ratio: 148 / 210;
}
#tripCard.format-story .card-map-wrap,
#tripCard.format-portrait .card-map-wrap,
#tripCard.format-square .card-map-wrap,
#tripCard.format-landscape .card-map-wrap,
#tripCard.format-a4 .card-map-wrap,
#tripCard.format-a5 .card-map-wrap {
    flex: 1 1 auto;
    min-height: 60px;
    aspect-ratio: unset; /* let flex sizing decide, not the classic 1000/440 ratio */
}
#tripCard.format-story #cardElevSvg,
#tripCard.format-portrait #cardElevSvg,
#tripCard.format-square #cardElevSvg,
#tripCard.format-landscape #cardElevSvg,
#tripCard.format-a4 #cardElevSvg,
#tripCard.format-a5 #cardElevSvg {
    flex: 0 0 auto;
}

#tripCard .card-eyebrow {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c1);
}
#tripCard .card-title {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(19px, 5vw, 26px);
    font-weight: 700;
    margin: 6px 0 2px;
    word-break: break-word;
}
#tripCard .card-dates {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--paper-dim);
    margin-bottom: 16px;
}
#tripCard .card-subtitle {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 13.5px;
    color: var(--paper-dim);
    margin: 2px 0 8px;
    line-height: 1.4;
}
#cardGrid {
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
    margin-bottom: 16px;
}
#cardGrid .stat-row {
    grid-template-columns: repeat(5, 1fr);
}
#cardGrid .cell {
    padding: clamp(8px, 2vw, 12px) clamp(6px, 2vw, 14px);
    min-width: 0;
}
#cardGrid .label {
    font-size: 8.5px;
    white-space: normal;
}
#cardGrid .value {
    font-size: clamp(13px, 3.2vw, 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-map-wrap {
    position: relative;
    background: #0e1416;
    border: 1px solid var(--hair);
    border-radius: 3px;
    margin-bottom: 14px;
    overflow: hidden;
    aspect-ratio: 1000/440;
}
#cardMapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}
.card-map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--paper-dim);
    background: #0e1416;
    transition: opacity 0.25s;
    pointer-events: none;
}
.card-map-loading.hidden {
    opacity: 0;
}
.map-tick {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    z-index: 400;
}
.tick-tl {
    top: 8px;
    left: 8px;
    border-top: 2px solid var(--c1);
    border-left: 2px solid var(--c1);
}
.tick-tr {
    top: 8px;
    right: 8px;
    border-top: 2px solid var(--c1);
    border-right: 2px solid var(--c1);
}
.tick-bl {
    bottom: 8px;
    left: 8px;
    border-bottom: 2px solid var(--c1);
    border-left: 2px solid var(--c1);
}
.tick-br {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid var(--c1);
    border-right: 2px solid var(--c1);
}
#cardElevSvg {
    width: 100%;
    height: 90px;
    display: block;
}

@container (max-width: 460px) {
    #cardGrid .stat-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #cardGrid .cell:nth-child(2n) {
        border-right: none;
    }
    #cardGrid .value {
        font-size: 12.5px;
    }
    #cardGrid .label {
        font-size: 8px;
    }
}

@media (max-width: 640px) {
    #cardGrid .stat-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #cardGrid .cell:nth-child(2n) {
        border-right: none;
    }

    .card-outer {
        margin-bottom: 70px;
    }
}
@media (max-width: 400px) {
    #cardGrid .value {
        font-size: 12.5px;
    }
    #cardGrid .label {
        font-size: 8px;
    }
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.btn {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
    padding: 10px 16px;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid var(--hair);
    background: var(--panel);
    color: var(--paper);
}
.btn.primary {
    background: var(--c1);
    border-color: var(--c1);
    color: #12181a;
    font-weight: 600;
}
.btn.primary:hover {
    background: #ef8b52;
}
.btn:hover {
    border-color: var(--paper-dim);
}

#dashboard {
    display: none;
}
#dashboard.show {
    display: block;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 24, 26, 0.88);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 999;
}
.loading-overlay.show {
    display: flex;
}
.spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--hair);
    border-top-color: var(--c1);
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-text {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12.5px;
    color: var(--paper-dim);
    letter-spacing: 0.03em;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background: var(--hair);
    border-radius: 4px;
}

.site-footer {
    position: absolute;
    bottom: 2%;
    left: 20px;
    right: 20px;
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--hair);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-links a {
    color: var(--paper-dim);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--c1);
}
.footer-links a.footer-coffee:hover {
    color: var(--c3);
}
.footer-dot {
    color: var(--hair);
}
.footer-note {
    color: #5a6058;
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--paper-dim);
}

.toggle-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: relative;
    width: 30px;
    height: 16px;
    border: 1px solid var(--hair);
    border-radius: 10px;
    background: var(--panel);
    transition:
        background 0.15s,
        border-color 0.15s;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--paper-dim);
    transition:
        transform 0.15s,
        background 0.15s;
}

.toggle-control input:checked + .toggle-slider {
    background: var(--c1);
    border-color: var(--c1);
}

.toggle-control input:checked + .toggle-slider::after {
    transform: translateX(14px);
    background: var(--ink);
}

.toggle-control:hover .toggle-slider {
    border-color: var(--paper-dim);
}

@media (max-width: 640px) {
    .toggle-control span:first-child {
        display: none;
    }
}

.section-title-with-help {
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
}

.help-button {
    width: 17px;
    height: 17px;
    padding: 0;
    border: 1px solid var(--hair);
    border-radius: 50%;
    background: transparent;
    color: var(--paper-dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    cursor: pointer;
}

.help-button:hover,
.help-button:focus {
    border-color: var(--c1);
    color: var(--c1);
    outline: none;
}

.help-tooltip {
    display: none;
    position: absolute;
    z-index: 100;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--hair);
    border-radius: 2px;
    color: var(--paper-dim);
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.help-button:hover + .help-tooltip,
.help-button:focus + .help-tooltip {
    display: block;
}

.section-title-with-help {
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
}

.help-button {
    width: 17px;
    height: 17px;
    padding: 0;
    border: 1px solid var(--hair);
    border-radius: 50%;
    background: transparent;
    color: var(--paper-dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    cursor: pointer;
}

.help-button:hover,
.help-button:focus {
    border-color: var(--c1);
    color: var(--c1);
    outline: none;
}

.help-tooltip {
    display: none;
    position: absolute;
    z-index: 100;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--hair);
    border-radius: 2px;
    color: var(--paper-dim);
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.help-button:hover + .help-tooltip,
.help-button:focus + .help-tooltip {
    display: block;
}

.stat-head {
    margin: 28px 0 10px;

    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--c1);

    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-head::before {
    content: "";
    width: 14px;
    height: 1px;
    background: var(--c1);
    flex-shrink: 0;
}
@media (max-width: 640px) {
    /* !important: rows now get their column count set inline per-row by JS
       (so a 3-stat row and a 4-stat row both fill the width evenly) — this
       has to win over that on narrow screens or a 6-stat group would try to
       cram 4 columns into a phone-width card. */
    .stat-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .stat-row .cell:nth-child(2n) {
        border-right: none;
    }
}
