/* Runnr - beregnerne på /tempoberegner/, /loebetid-beregner/ og /zone-2-puls/.
   Indlæses kun på de tre sider, oven på cinematic.css, og bruger dens tokens
   (--ink, --paper, --orange, --line, --muted). Selve regningen ligger i
   calc-tools.js. Tabellerne nederst står på papirfladen (.seo-bridge). */

.calc-tool {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    padding: 132px max(20px, calc((100vw - var(--max)) / 2)) 96px;
    background:
        radial-gradient(120% 70% at 85% 0%, rgba(255, 81, 37, 0.16), transparent 60%),
        var(--ink);
    color: var(--white);
}

.calc-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(36px, 6vw, 110px);
    min-height: calc(100svh - 228px);
}

.calc-title {
    font-size: clamp(46px, 5.6vw, 88px);
    font-weight: 950;
    letter-spacing: -0.065em;
    line-height: 0.92;
}

.calc-title span {
    color: var(--orange);
}

.calc-lead {
    max-width: 44ch;
    margin-top: 26px;
    color: var(--muted);
    font-size: clamp(17px, 1.3vw, 20px);
    line-height: 1.55;
}

.calc-card {
    display: grid;
    gap: 22px;
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: clamp(22px, 3vw, 38px);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 30px 80px rgba(0, 0, 0, 0.35);
}

.calc-card fieldset {
    min-width: 0;
    border: 0;
}

.calc-label,
.calc-card legend {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.calc-label small,
.calc-card legend small {
    color: rgba(255, 255, 255, 0.42);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: none;
}

/* Hvad skal regnes ud: tre knapper, den valgte er orange. */
.calc-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.calc-modes button {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 850;
}

.calc-modes button[aria-checked="true"] {
    background: var(--orange);
    color: #fff;
    box-shadow: 0 8px 22px rgba(255, 81, 37, 0.3);
}

.calc-row {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
    gap: 10px;
}

.calc-input {
    position: relative;
    display: flex;
    align-items: baseline;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.06);
    transition: border-color 160ms ease, background 160ms ease;
}

.calc-input:focus-within {
    border-color: var(--orange);
    background: rgba(255, 81, 37, 0.08);
}

.calc-input input {
    width: 100%;
    min-width: 0;
    padding: 14px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.calc-input input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.calc-input span {
    flex: 0 0 auto;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 800;
}

.calc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.calc-chips button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
}

.calc-chips button:hover {
    border-color: rgba(255, 81, 37, 0.6);
}

.calc-chips button.is-selected {
    border-color: transparent;
    background: #fff;
    color: var(--ink);
}

.calc-field[hidden] {
    display: none;
}

/* Svaret. */
.calc-result {
    display: block;
    border-radius: 24px;
    padding: 22px 24px;
    background: var(--orange);
    color: #fff;
}

.calc-result-label {
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    opacity: 0.85;
    text-transform: uppercase;
}

.calc-result-value {
    display: block;
    margin-top: 8px;
    font-size: clamp(44px, 5vw, 72px);
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.05em;
    line-height: 0.95;
}

.calc-result-value small {
    margin-left: 6px;
    font-size: 0.32em;
    font-weight: 850;
    letter-spacing: 0;
}

.calc-result-sub {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 750;
    opacity: 0.92;
}

.calc-result.is-empty {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.calc-error {
    border: 1px solid rgba(255, 157, 132, 0.28);
    border-radius: 14px;
    padding: 10px 14px;
    background: rgba(255, 81, 37, 0.08);
    color: #ffb09c;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.calc-error[hidden] {
    display: none;
}

/* Lille tabel i kortet: samme tempo på andre distancer, forudsagte tider,
   pulszonerne. */
.calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.calc-table caption {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-align: left;
    text-transform: uppercase;
}

.calc-table th,
.calc-table td {
    padding: 11px 4px;
    border-top: 1px solid var(--line);
    text-align: left;
}

.calc-table th {
    font-weight: 800;
}

.calc-table td {
    color: var(--muted);
    font-weight: 700;
}

.calc-table td:last-child,
.calc-table th:last-child {
    text-align: right;
}

.calc-table tr.is-own th,
.calc-table tr.is-own td {
    color: var(--orange);
}

.calc-table tr.is-zone2 th,
.calc-table tr.is-zone2 td {
    color: #fff;
}

.calc-table tr.is-zone2 th::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--orange);
    vertical-align: middle;
}

.calc-note {
    color: rgba(255, 255, 255, 0.46);
    font-size: 13px;
    line-height: 1.5;
}

.calc-noscript {
    margin-top: 24px;
    color: var(--muted);
}

/* Tabeller i artiklen på papirfladen. */
.seo-table {
    margin-top: clamp(30px, 4vh, 44px);
    overflow-x: auto;
    border: 1px solid rgba(8, 8, 8, 0.14);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.42);
}

.seo-table table {
    width: 100%;
    border-collapse: collapse;
    color: var(--ink);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.seo-table th,
.seo-table td {
    padding: 15px 20px;
    text-align: left;
}

.seo-table thead th {
    color: rgba(8, 8, 8, 0.55);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.seo-table tbody tr {
    border-top: 1px solid rgba(8, 8, 8, 0.1);
}

.seo-table tbody th {
    font-weight: 900;
}

.seo-table td {
    color: rgba(8, 8, 8, 0.72);
    font-weight: 650;
}

.seo-table figcaption {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(8, 8, 8, 0.1);
    color: rgba(8, 8, 8, 0.56);
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .calc-tool {
        padding-top: 108px;
        padding-bottom: 72px;
    }

    .calc-shell {
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 30px;
    }

    .calc-lead {
        margin-top: 18px;
    }
}

@media (max-width: 480px) {
    .calc-tool {
        padding-left: 16px;
        padding-right: 16px;
    }

    .calc-card {
        gap: 18px;
        border-radius: 26px;
        padding: 18px;
    }

    .calc-input {
        padding: 0 12px;
    }

    .calc-input input {
        font-size: 22px;
    }

    .calc-modes button {
        font-size: 14px;
    }

    /* Hele tabellen skal kunne ses uden at scrolle sidelæns: mindre luft og
       skrift, og tallene må bryde over to linjer. */
    .seo-table table {
        font-size: 13px;
    }

    .seo-table th,
    .seo-table td {
        padding: 11px 5px;
    }

    .seo-table th:first-child,
    .seo-table td:first-child {
        padding-left: 12px;
    }

    .seo-table th:last-child,
    .seo-table td:last-child {
        padding-right: 12px;
    }

    .seo-table thead th {
        font-size: 10px;
        letter-spacing: 0.06em;
    }
}
