/* Calculator pages — extracted from landing-theme; text colors unchanged */

.calc-page section {
    padding: 4rem 0;
}

.calc-page h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--text-primary);
}

.calc-page .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.125rem;
}

.preset-example-note {
    margin: 0.75rem 0 1rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* App Store badge in nav (tool pages) */
.app-store-badge-nav {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-left: 2rem;
}

.app-store-badge-nav img {
    height: 32px;
    width: auto;
    display: block;
}

.app-store-badge-nav:hover {
    opacity: 0.9;
}

.calculator-card {
    background: var(--card-bg-gradient);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.theron-promo-calc {
    display: block;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(98, 157, 255, 0.12) 0%, rgba(98, 157, 255, 0.04) 100%);
    border: 1px solid rgba(98, 157, 255, 0.25);
    border-radius: 12px;
}

.theron-promo-calc.is-visible {
    display: block;
}

.theron-promo-calc h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.theron-promo-calc p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

.theron-promo-calc a {
    display: inline-flex;
}

.theron-promo-calc a img {
    height: 36px;
    width: auto;
}

.store-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.store-badges a {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
}

.store-badges a:hover {
    opacity: 0.9;
}

/* Mobile / tablet: show only the store for that OS */
html.store-platform-ios .store-badge-android,
html.store-platform-android .store-badge-ios {
    display: none !important;
}

/* Nav: desktop shows a single Download button; iOS/Android show the native badge */
.store-badges-nav .download-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 12px;
    background: #ffffff;
    color: #111111 !important;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.2;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.store-badges-nav .download-app-btn:hover,
.store-badges-nav .download-app-btn:visited:hover {
    opacity: 0.92;
    color: #111111 !important;
    text-decoration: none !important;
}

.store-badges-nav .download-app-btn:visited {
    color: #111111 !important;
}

.store-badges-nav .store-badge-ios,
.store-badges-nav .store-badge-android {
    display: none;
}

html.store-platform-ios .store-badges-nav .download-app-btn,
html.store-platform-android .store-badges-nav .download-app-btn {
    display: none !important;
}

html.store-platform-ios .store-badges-nav .store-badge-ios,
html.store-platform-android .store-badges-nav .store-badge-android {
    display: inline-block !important;
}

.store-badges-nav img {
    height: 32px;
    width: auto;
    display: block;
}

.store-badges-promo img,
.store-badges-docs img {
    height: 40px;
    width: auto;
    display: block;
}

.store-badges-hero img {
    height: 48px;
    width: auto;
    display: block;
}

.store-badges-footer img {
    height: 40px;
    width: auto;
    display: block;
}

.instructions {
    background: rgba(49, 49, 49, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.instructions h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.instructions p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

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

.instructions li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.instructions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
}

.tool-faq {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-faq > li {
    margin-bottom: 1.15rem;
    padding-left: 0;
    position: static;
}

.tool-faq > li::before {
    content: none;
}

.tool-faq dt,
.tool-faq .faq-q {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.tool-faq dd,
.tool-faq .faq-a {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

.tool-updated {
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Accent helper — set --accent on the element */
.calc-accent {
    --accent: var(--primary-blue);
}

.calc-accent-blue { --accent: var(--primary-blue); }
.calc-accent-orange { --accent: var(--primary-orange); }
.calc-accent-green { --accent: var(--primary-green); }
.calc-accent-pink { --accent: var(--primary-pink); }

/* Input fields */
.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label,
.input-field .field-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-field input {
    padding: 0.75rem;
    background: rgba(29, 29, 29, 0.6);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    min-height: 44px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-field input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(98, 157, 255, 0.1);
}

.input-field input::placeholder {
    color: var(--text-tertiary);
}

/* Segmented control (units, gender, intensity, etc.) */
.segmented-control {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.3rem;
    background: rgba(29, 29, 29, 0.55);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.segmented-control.centered {
    display: flex;
    justify-content: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.segmented-control.full-width {
    display: flex;
    width: 100%;
}

.segmented-control button {
    flex: 1 1 auto;
    min-height: 44px;
    min-width: 0;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.segmented-control button:hover {
    color: var(--text-primary);
}

.segmented-control button[aria-pressed="true"],
.segmented-control button.active {
    background: var(--primary-blue);
    color: var(--text-primary);
}

.segmented-control button:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Quick-fill / preset chip buttons */
.quick-fill {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    justify-content: center;
}

.quick-fill-btn {
    padding: 0.5rem 1rem;
    min-height: 40px;
    background: rgba(98, 157, 255, 0.1);
    border: 1px solid rgba(98, 157, 255, 0.45);
    border-radius: 8px;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.quick-fill-btn:hover {
    background: rgba(98, 157, 255, 0.2);
}

.quick-fill-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--text-primary);
}

.quick-fill-btn.clear {
    background: rgba(222, 74, 94, 0.1);
    border-color: rgba(222, 74, 94, 0.45);
    color: var(--primary-red);
}

.quick-fill-btn.clear:hover {
    background: rgba(222, 74, 94, 0.2);
}

/* Labeled time field (h : m : s) — labels sit below inputs */
.time-field {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.time-field .time-part {
    flex: 1;
    display: flex;
    flex-direction: column-reverse;
    min-width: 0;
}

.time-field .time-part label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
    margin-bottom: 0;
    text-align: center;
}

.time-field .time-part input {
    width: 100%;
    text-align: center;
    padding: 0.65rem 0.35rem;
    background: rgba(29, 29, 29, 0.6);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    min-height: 44px;
    font-variant-numeric: tabular-nums;
    -webkit-appearance: none;
    appearance: none;
}

.time-field .time-part input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(98, 157, 255, 0.1);
}

.time-field .time-sep {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0;
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1;
    user-select: none;
}

/* Discipline / section cards with left accent */
.calc-discipline {
    --accent: var(--primary-blue);
    background: rgba(29, 29, 29, 0.35);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1.1rem;
    margin-bottom: 1.25rem;
}

.calc-discipline .discipline-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.calc-discipline .discipline-title .discipline-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.calc-discipline .input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    margin-bottom: 0;
}

/* Inline pace / result pill */
.result-pill {
    display: none;
    margin-top: 0.85rem;
    padding: 0.65rem 0.9rem;
    background: color-mix(in srgb, var(--accent, var(--primary-blue)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, var(--primary-blue)) 30%, transparent);
    border-radius: 8px;
    color: var(--accent, var(--primary-blue));
    font-weight: 600;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.result-pill.is-visible {
    display: block;
}

.result-pill .result-pill-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 0.35rem;
}

/* Total race time card */
.total-card {
    background: rgba(29, 29, 29, 0.45);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
}

.total-card.is-populated {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.14) 0%, rgba(29, 29, 29, 0.5) 55%);
    border-color: rgba(74, 222, 128, 0.35);
}

.total-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.total-card-value {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.total-card-empty {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}

.total-breakdown {
    display: none;
    margin-top: 1.25rem;
    text-align: left;
}

.total-card.is-populated .total-breakdown {
    display: block;
}

.total-breakdown-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(29, 29, 29, 0.6);
    margin-bottom: 0.85rem;
}

.total-breakdown-bar > span {
    display: block;
    height: 100%;
    min-width: 0;
    transition: flex-grow 0.25s ease;
}

.total-breakdown-bar .leg-swim { background: var(--primary-blue); }
.total-breakdown-bar .leg-t1 { background: var(--text-tertiary); }
.total-breakdown-bar .leg-bike { background: var(--primary-orange); }
.total-breakdown-bar .leg-t2 { background: var(--text-tertiary); }
.total-breakdown-bar .leg-run { background: var(--primary-green); }

.total-breakdown-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
}

.total-breakdown-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.total-breakdown-legend .legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-swatch.swim { background: var(--primary-blue); }
.legend-swatch.t1,
.legend-swatch.t2 { background: var(--text-tertiary); }
.legend-swatch.bike { background: var(--primary-orange); }
.legend-swatch.run { background: var(--primary-green); }

/* Copy / secondary action button */
.calc-action-btn {
    display: none;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    min-height: 44px;
    background: rgba(98, 157, 255, 0.12);
    border: 1px solid rgba(98, 157, 255, 0.35);
    border-radius: 10px;
    color: var(--primary-blue);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.calc-action-btn.is-visible {
    display: block;
}

.calc-action-btn:hover {
    background: rgba(98, 157, 255, 0.22);
}

.calc-action-btn:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Results panel (swim CSS, watt/kg, etc.) */
.results-panel {
    --accent: var(--primary-blue);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.results-panel .results-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.results-panel .result-item {
    margin-bottom: 1rem;
}

.results-panel .result-item:last-child {
    margin-bottom: 0;
}

.results-panel .result-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.results-panel .result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.results-panel .result-hint {
    display: none;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.45;
}

.results-panel .result-hint.is-visible {
    display: block;
}

/* Nutrition-style result cards */
.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.result-card {
    --accent: var(--primary-blue);
    background: rgba(49, 49, 49, 0.5);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.result-card .result-title {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.result-card .result-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-card .result-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.result-card .result-unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.result-card .result-rate {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    padding-top: 0.5rem;
    border-top: 1px solid var(--card-border);
}

/* Shared clear button */
.clear-btn {
    padding: 0.5rem 1rem;
    min-height: 40px;
    background: rgba(222, 74, 94, 0.1);
    border: 1px solid rgba(222, 74, 94, 0.45);
    border-radius: 8px;
    color: var(--primary-red);
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.2s ease;
    margin-bottom: 1.5rem;
    -webkit-tap-highlight-color: transparent;
}

.clear-btn:hover {
    background: rgba(222, 74, 94, 0.2);
}

/* Calculator page mobile */
@media (max-width: 768px) {
    .calc-page section {
        padding: 2rem 0;
    }

    .calc-page h1 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    .calc-page .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .calc-page .logo img {
        height: 32px;
    }

    .calc-page .logo-text {
        display: none;
    }

    .calc-page .nav-tagline {
        display: none;
    }

    .app-store-badge-nav {
        margin-left: 1rem;
    }

    .app-store-badge-nav img {
        height: 28px;
    }

    .calculator-card {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .calc-discipline .input-group {
        grid-template-columns: 1fr;
    }

    .segmented-control {
        width: 100%;
        display: flex;
    }

    .segmented-control.centered {
        width: 100%;
    }

    .segmented-control button {
        flex: 1 1 0;
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    .quick-fill {
        justify-content: stretch;
    }

    .quick-fill-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .total-card {
        padding: 1.25rem;
    }

    .total-breakdown-legend {
        gap: 0.4rem 0.75rem;
        justify-content: flex-start;
    }

    .result-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .result-card .result-value {
        font-size: 2rem;
    }

    .instructions {
        padding: 1.25rem;
        margin-top: 1.5rem;
    }

    .theron-promo-calc {
        padding: 1rem 1.15rem;
    }
}

@media (max-width: 480px) {
    .calc-page h1 {
        font-size: 1.5rem;
    }

    .calculator-card {
        padding: 1rem;
    }

    .calc-discipline {
        padding: 1rem;
    }

    .time-field .time-part input {
        padding: 0.6rem 0.2rem;
    }

    .segmented-control button {
        font-size: 0.8rem;
        padding: 0.45rem 0.4rem;
    }
}

/* Directory, plan, and readiness pages */
.section-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(98, 157, 255, 0.12);
    border: 1px solid rgba(98, 157, 255, 0.25);
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
}
.support-form {
    max-width: 540px;
    margin: 1.5rem auto;
    background: var(--card-bg-gradient);
    border: var(--card-border-width) solid var(--card-border);
    border-radius: 24px;
    padding: 2rem 1.75rem;
    text-align: left;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
}
.form-group input,
.form-group select,
.support-form select {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(15, 15, 15, 0.55);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font: inherit;
    color-scheme: dark;
}
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--primary-green);
    color: #111;
    border: 0;
    border-radius: 12px;
    padding: 0.9rem 1.25rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.news-form h3 {
    font-size: 1.35rem;
    line-height: 1.35;
    text-align: center;
    margin: 0 0 1.25rem;
    color: var(--text-primary);
}
.news-consent {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 1.1rem;
}