/**
 * HYROX Interactive Polish
 * Final mobile-first layer for calculators, tools, and account pages.
 *
 * This file intentionally loads after the older section styles. It owns the
 * current interactive-page look and keeps legacy CSS from leaking through.
 */

/* ==========================================================================
   Utilities
   ========================================================================== */

.entry-content .hx-app .hx-mt-0 { margin-top: 0; }
.entry-content .hx-app .hx-mt-3 { margin-top: 0.75rem; }
.entry-content .hx-app .hx-mt-5 { margin-top: 1.25rem; }
.entry-content .hx-app .hx-table-cell-center { text-align: center; }

.entry-content .hx-app .hx-sr-control {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.entry-content .hx-app .hx-list-indented {
    margin: 0;
    padding-left: 1.25rem;
}

.entry-content .hx-app .hx-list-spaced {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.entry-content .hx-app .hx-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.entry-content .hx-app .hx-table-footnote {
    margin-top: 0.5rem;
    font-size: 0.85em;
}

.entry-content .hx-app .hx-badge-green {
    background: rgba(0, 200, 83, 0.12);
    color: #007a3d;
}

.entry-content .hx-app .hx-delta-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-left: 0.35rem;
    padding: 0.16rem 0.42rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.entry-content .hx-app .hx-delta-slower {
    background: rgba(255, 179, 0, 0.14);
    color: #8a5a00;
}

.entry-content .hx-app .hx-delta-fastest {
    background: rgba(232, 255, 0, 0.26);
    color: #3f4900;
}

/* ==========================================================================
   Shared Interactive Page Rhythm
   ========================================================================== */

.entry-content .hx-app :is(
    .hx-calculator-section,
    .hx-plan-generator,
    .hx-account-dashboard,
    .hx-account-settings,
    .hx-add-result,
    .hx-tools-page
) {
    width: min(100%, 1120px);
    margin-inline: auto;
}

.entry-content .hx-app .hx-calculator-section {
    padding-inline: clamp(0.75rem, 3vw, 1.5rem);
}

.entry-content .hx-app .hx-calculator-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: clamp(1rem, 3vw, 1.5rem);
    align-items: start;
    width: 100%;
    max-width: 1120px !important;
}

.entry-content .hx-app .hx-calculator-layout > * {
    min-width: 0;
}

.entry-content .hx-app :is(.hx-calc-form, .hx-results-section, .hx-plan-generator > .hx-card, .hx-auth-gate, .hx-add-result > .hx-card, .hx-account-settings > .hx-card) {
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    border-radius: clamp(18px, 3vw, 28px) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(232, 255, 0, 0.12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden;
}

.entry-content .hx-app :is(.hx-calc-form, .hx-results-section) {
    padding: clamp(1rem, 3vw, 1.75rem) !important;
}

.entry-content .hx-app .hx-results-section {
    color: #0f172a;
}

@media (min-width: 1100px) {
    .entry-content .hx-app .hx-results-section {
        position: sticky;
        top: 86px;
    }
}

@media (max-width: 540px) {
    .entry-content .hx-app :is(.hx-calc-form, .hx-results-section, .hx-card) {
        border-radius: 18px !important;
    }
}

/* ==========================================================================
   Forms
   ========================================================================== */

.entry-content .hx-app :is(.hx-calc-form, .hx-plan-generator, .hx-tools-plan-card, .hx-account-settings, .hx-add-result) .hx-form-header,
.entry-content .hx-app :is(.hx-calc-form, .hx-plan-generator, .hx-tools-plan-card, .hx-account-settings, .hx-add-result) .hx-card-header {
    border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

.entry-content .hx-app :is(.hx-input, .hx-select, .hx-select-modern, .hx-input-textarea) {
    min-height: 50px;
    border-radius: 14px !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.entry-content .hx-app :is(.hx-input, .hx-select, .hx-select-modern, .hx-input-textarea):focus {
    border-color: rgba(232, 255, 0, 0.95) !important;
    box-shadow: 0 0 0 4px rgba(232, 255, 0, 0.22) !important;
}

.entry-content .hx-app .hx-input-centered {
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.entry-content .hx-app .hx-time-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    width: 100%;
}

.entry-content .hx-app .hx-time-inputs .hx-input-wrapper {
    min-width: 0;
    width: 100%;
}

.entry-content .hx-app .hx-time-inputs .hx-input {
    width: 100% !important;
    min-width: 0;
    padding-right: 3rem !important;
}

.entry-content .hx-app .hx-input-suffix {
    right: 0.48rem;
    top: 50%;
    transform: translateY(-50%);
    min-width: 2rem;
    padding: 0.22rem 0.34rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.64rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.entry-content .hx-app .hx-time-sep {
    min-width: 0.6rem;
    color: #64748b;
    font-size: 1.05rem;
    font-weight: 900;
    text-align: center;
}

.entry-content .hx-app :is(.hx-radio-option, .hx-segmented-btn, .hx-toggle-btn) {
    border-radius: 14px !important;
}

.entry-content .hx-app :is(.hx-radio-option:has(input:checked), .hx-segmented-btn.active, .hx-segmented-btn.is-active, .hx-toggle-btn-active) {
    border-color: rgba(232, 255, 0, 0.95) !important;
    background: #e8ff00 !important;
    color: #111827 !important;
    box-shadow: 0 10px 24px rgba(232, 255, 0, 0.18);
}

.entry-content .hx-app .hx-btn-primary {
    border-radius: 999px !important;
    font-weight: 850;
}

/* ==========================================================================
   Results, Stats, Tables
   ========================================================================== */

.entry-content .hx-app .hx-results-section .hx-result-hero {
    align-items: flex-start !important;
    text-align: left !important;
    padding: clamp(1rem, 3vw, 1.5rem) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(circle at 90% 0%, rgba(232, 255, 0, 0.32), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #020617 !important;
}

.entry-content .hx-app .hx-results-section .hx-result-label {
    color: #475569 !important;
}

.entry-content .hx-app .hx-results-section :is(.hx-result-value, .hx-result-value-xl, .hx-result-headline) {
    color: #020617 !important;
    -webkit-text-fill-color: #020617 !important;
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-shadow: none !important;
}

.entry-content .hx-app .hx-results-section .hx-result-sub {
    color: #64748b !important;
}

.entry-content .hx-app .hx-results-section .hx-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 0.75rem;
}

.entry-content .hx-app .hx-results-section .hx-stat-card {
    padding: 1rem !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.82) !important;
    text-align: left;
    align-items: flex-start;
}

.entry-content .hx-app .hx-results-section .hx-stat-label {
    color: #64748b !important;
}

.entry-content .hx-app .hx-results-section .hx-stat-value {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.entry-content .hx-app :is(.hx-table-wrap, .hx-table-responsive, .hx-table-wrapper, .hx-table-scroll) {
    border-radius: 16px;
}

.entry-content .hx-app .hx-table th {
    color: #64748b;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.entry-content .hx-app .hx-table td,
.entry-content .hx-app .hx-table th {
    padding: 0.72rem 0.65rem;
    text-align: left;
}

.entry-content .hx-app .hx-table tbody tr:hover {
    background: rgba(232, 255, 0, 0.08);
}

/* ==========================================================================
   Tools Hub
   ========================================================================== */

.entry-content .hx-app .hx-tools-page {
    padding-bottom: clamp(2.5rem, 7vw, 4.5rem);
}

.entry-content .hx-app .hx-tools-shell {
    width: min(100%, 960px);
    margin-inline: auto;
}

.entry-content .hx-app .hx-tools-featured-grid,
.entry-content .hx-app .hx-tools-grid,
.entry-content .hx-app .hx-tools-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.entry-content .hx-app .hx-tools-featured-grid {
    margin-bottom: 1.5rem;
}

.entry-content .hx-app .hx-tools-grid {
    margin-bottom: 2rem;
}

.entry-content .hx-app .hx-tools-plan-inline {
    margin-top: 2rem;
}

.entry-content .hx-app .hx-tools-section-title {
    margin: 0 0 1rem;
    color: var(--hx-text, #1a1a1a);
    font-size: var(--hx-fs-xl, 1.5rem);
    font-weight: 850;
}

.entry-content .hx-app .hx-tools-plan-card {
    padding: clamp(1rem, 3vw, 1.5rem) !important;
}

.entry-content .hx-app .hx-tools-generated-note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hx-border, #e5e7eb);
}

.entry-content .hx-app .hx-tools-generated-note p {
    margin: 0;
    color: var(--hx-text-secondary, #475569);
}

.entry-content .hx-app .hx-tools-generated-note a {
    color: var(--hx-primary, #ff4500);
    font-weight: 700;
}

.entry-content .hx-app .hx-calc-card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hx-radius-md, 12px);
    background: rgba(255, 69, 0, 0.06);
    color: var(--hx-primary, #ff4500);
}

@media (min-width: 680px) {
    .entry-content .hx-app .hx-tools-featured-grid,
    .entry-content .hx-app .hx-tools-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-content .hx-app .hx-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* ==========================================================================
   Official Results Card
   ========================================================================== */

.entry-content .hx-app .hx-official-results-card {
    width: min(100%, 900px);
    margin: clamp(1.5rem, 4vw, 2rem) auto clamp(3rem, 8vw, 4.5rem);
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border-radius: clamp(20px, 4vw, 28px);
    background:
        radial-gradient(circle at top right, rgba(232, 255, 0, 0.2), transparent 34%),
        linear-gradient(135deg, #08111f 0%, #111827 100%);
    color: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
}

.entry-content .hx-app .hx-official-results-eyebrow {
    display: inline-flex;
    margin-bottom: 1.125rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(232, 255, 0, 0.12);
    color: #e8ff00;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.entry-content .hx-app .hx-official-results-card h1 {
    max-width: 720px;
    margin: 0 0 1rem;
    color: #ffffff;
    font-size: clamp(2.15rem, 8vw, 3.5rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.entry-content .hx-app .hx-official-results-card p {
    max-width: 720px;
    margin: 0 0 1.75rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.65;
}

.entry-content .hx-app .hx-official-results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ==========================================================================
   Training Plan Outputs
   ========================================================================== */

.entry-content .hx-app .hx-plan-week {
    margin-bottom: 1rem;
}

.entry-content .hx-app .hx-plan-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.entry-content .hx-app .hx-calculator-section .hx-plan-week-header {
    margin-bottom: 0.25rem;
}

.entry-content .hx-app .hx-plan-week-num {
    font-weight: 800;
    font-size: 1rem;
}

.entry-content .hx-app .hx-plan-phase-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--hx-primary-muted, rgba(255, 59, 48, 0.15));
    color: var(--hx-primary, #ff4500);
    font-size: 0.75rem;
    font-weight: 700;
}

.entry-content .hx-app .hx-phase-taper .hx-plan-phase-badge { background: rgba(255, 200, 0, 0.15); color: #8a6d00; }
.entry-content .hx-app .hx-phase-base .hx-plan-phase-badge { background: rgba(52, 199, 89, 0.15); color: #1f7a36; }
.entry-content .hx-app .hx-phase-build .hx-plan-phase-badge { background: rgba(0, 122, 255, 0.15); color: #005bbb; }

.entry-content .hx-app .hx-plan-week-focus {
    margin-bottom: 0.75rem;
    color: var(--hx-text-muted, #64748b);
    font-size: 0.85rem;
}

.entry-content .hx-app .hx-plan-sessions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry-content .hx-app .hx-plan-session {
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--hx-border, #e5e7eb);
    border-radius: 0 var(--hx-radius-sm, 8px) var(--hx-radius-sm, 8px) 0;
}

.entry-content .hx-app .hx-plan-session-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.entry-content .hx-app .hx-plan-session-type {
    font-size: 0.9rem;
    font-weight: 700;
}

.entry-content .hx-app .hx-plan-session-intensity {
    color: var(--hx-text-muted, #64748b);
    font-size: 0.75rem;
}

.entry-content .hx-app .hx-plan-session-detail {
    margin: 0;
    color: var(--hx-text-secondary, #475569);
    font-size: 0.85rem;
    line-height: 1.5;
}

.entry-content .hx-app .hx-days-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==========================================================================
   Account, Alerts, Venue Details
   ========================================================================== */

.entry-content .hx-app :is(.hx-loading-state, .hx-empty-state, .hx-auth-gate) {
    border-radius: 22px;
}

.entry-content .hx-app .hx-dashboard-actions {
    padding: 0.25rem;
    border-radius: 999px;
}

.entry-content .hx-app .hx-modal {
    border-radius: 22px;
}

.entry-content .hx-app .hx-venue-chart-card {
    margin-top: 1.5rem;
    padding: 1.5rem !important;
}

.entry-content .hx-app .hx-cohort-meta {
    margin: 0.5rem 0;
    color: var(--hx-text-muted, #64748b);
    font-size: 0.875rem;
}

@media (max-width: 520px) {
    .entry-content .hx-app .hx-official-results-actions .hx-btn,
    .entry-content .hx-app .hx-dashboard-actions .hx-btn,
    .entry-content .hx-app .hx-modal-actions .hx-btn {
        width: 100%;
    }
}

/* ==========================================================================
   Calculator Command Center Rollout
   ========================================================================== */

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg {
    min-height: clamp(240px, 28vw, 340px) !important;
    padding: clamp(1.5rem, 4vw, 3rem) !important;
    border-radius: 28px !important;
    isolation: isolate;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg::before {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.68) 44%, rgba(2, 6, 23, 0.28) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.28), transparent 24%) !important;
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg::after {
    content: "";
    position: absolute;
    inset: auto 2rem 1.5rem 2rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(232, 255, 0, 0.9), rgba(232, 255, 0, 0.18), transparent);
    z-index: 1;
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-hero-text {
    position: relative;
    z-index: 2;
    max-width: min(960px, 100%);
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-page-title {
    max-width: none;
    width: 100%;
    color: #ffffff !important;
    font-size: clamp(2rem, 4.2vw, 4.2rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-page-subtitle {
    max-width: 560px;
    margin-top: 1rem !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: clamp(1rem, 1.55vw, 1.2rem) !important;
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-hero-icon {
    position: absolute;
    right: clamp(1.25rem, 6vw, 5rem);
    top: 50%;
    z-index: 1;
    width: clamp(120px, 15vw, 210px);
    height: clamp(120px, 15vw, 210px);
    display: grid;
    place-items: center;
    border: 1px solid rgba(232, 255, 0, 0.18);
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(232, 255, 0, 0.18), rgba(232, 255, 0, 0.045) 54%, transparent 70%),
        rgba(2, 6, 23, 0.26);
    color: rgba(232, 255, 0, 0.44);
    box-shadow: inset 0 0 34px rgba(232, 255, 0, 0.06), 0 0 60px rgba(232, 255, 0, 0.12);
    pointer-events: none;
    transform: translateY(-50%);
}

.entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-hero-icon svg {
    width: 72%;
    height: 72%;
}

.entry-content .hx-app .hx-page-header-dark + .hx-calculator-section {
    position: relative;
    z-index: 3;
    margin-top: clamp(-3.25rem, -4vw, -1.5rem);
    padding-top: 0;
}

.entry-content .hx-app .hx-page-header-dark + .hx-calculator-section::before {
    content: "";
    position: absolute;
    inset: 2rem -2rem auto -2rem;
    height: 420px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 28% 28%, rgba(232, 255, 0, 0.12), transparent 32%),
        radial-gradient(circle at 72% 18%, rgba(15, 23, 42, 0.08), transparent 28%);
    filter: blur(10px);
    z-index: -1;
    pointer-events: none;
}

.entry-content .hx-app .hx-calculator-section .hx-calculator-layout {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 680px !important;
    gap: clamp(1.1rem, 2.5vw, 1.75rem);
}

.entry-content .hx-app .hx-calculator-section .hx-calculator-layout > * {
    width: 100%;
    min-width: 0;
}

.entry-content .hx-app .hx-calculator-section .hx-calc-form,
.entry-content .hx-app .hx-calculator-section .hx-results-section {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 28px !important;
    box-shadow: 0 30px 85px rgba(15, 23, 42, 0.12) !important;
}

.entry-content .hx-app .hx-calculator-section .hx-calc-form {
    padding: clamp(1.35rem, 2.5vw, 2rem) !important;
    background:
        radial-gradient(circle at 98% 0%, rgba(232, 255, 0, 0.2), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)) !important;
}

.entry-content .hx-app .hx-calculator-section .hx-form-header {
    display: grid !important;
    grid-template-columns: 48px 1fr;
    grid-template-areas:
        "icon title"
        "icon subtitle";
    column-gap: 0.85rem;
    align-items: center;
    padding: 0 0 1.35rem !important;
    text-align: left !important;
}

.entry-content .hx-app .hx-calculator-section .hx-form-icon {
    grid-area: icon;
    position: static !important;
    width: 48px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center;
    border-radius: 16px;
    background: rgba(232, 255, 0, 0.32);
    color: #6b7600 !important;
}

.entry-content .hx-app .hx-calculator-section .hx-form-title {
    grid-area: title;
    margin: 0;
    text-align: left !important;
}

.entry-content .hx-app .hx-calculator-section .hx-form-subtitle {
    grid-area: subtitle;
    max-width: 34rem;
    margin: 0.2rem 0 0;
    text-align: left !important;
}

.entry-content .hx-app .hx-calculator-section :is(.hx-form-group, .hx-form-section, .hx-field-meta) {
    text-align: left !important;
}

.entry-content .hx-app .hx-calculator-section :is(.hx-radio-option, .hx-segmented-btn, .hx-toggle-btn) {
    min-height: 48px;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    background: #ffffff !important;
    color: #0f172a;
    font-weight: 800;
}

.entry-content .hx-app .hx-calculator-section .hx-btn-primary {
    position: relative;
    min-height: 58px;
    overflow: hidden;
    background: #e8ff00 !important;
    color: #020617 !important;
    box-shadow: 0 14px 30px rgba(232, 255, 0, 0.28) !important;
}

.entry-content .hx-app .hx-calculator-section .hx-btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.52) 42%, transparent 62%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
}

.entry-content .hx-app .hx-calculator-section .hx-btn-primary:hover::after {
    transform: translateX(120%);
}

.entry-content .hx-app .hx-calculator-section .hx-results-section {
    padding: clamp(1.4rem, 3vw, 2rem) !important;
}

.entry-content .hx-app .hx-calculator-section .hx-result-hero {
    padding: clamp(1.25rem, 3vw, 2rem) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    background:
        radial-gradient(circle at 88% 0%, rgba(232, 255, 0, 0.42), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #020617 !important;
    text-align: left !important;
    align-items: flex-start !important;
}

.entry-content .hx-app .hx-calculator-section .hx-result-hero .hx-result-label {
    color: #475569 !important;
    -webkit-text-fill-color: #475569 !important;
}

.entry-content .hx-app .hx-calculator-section .hx-result-hero :is(.hx-result-value, .hx-result-value-xl, .hx-result-headline) {
    color: #020617 !important;
    -webkit-text-fill-color: #020617 !important;
    font-size: clamp(2.75rem, 7vw, 4.4rem) !important;
    text-shadow: none !important;
}

@media (min-width: 1181px) {
    .entry-content .hx-app .hx-calculator-section .hx-calculator-layout {
        grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr) !important;
        max-width: 1120px !important;
    }

}

.hx-app .hx-hero:has(+ .hx-container.hx-tools-page) {
    position: relative;
    display: grid;
    justify-items: start !important;
    min-height: clamp(220px, 24vw, 310px);
    padding: clamp(1.5rem, 4vw, 3rem) !important;
    border-radius: 28px !important;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.78) 46%, rgba(2, 6, 23, 0.52) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.28), transparent 24%),
        #05070d !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
    text-align: left !important;
}

.hx-app .hx-hero:has(+ .hx-container.hx-tools-page)::after {
    content: "";
    position: absolute;
    inset: auto 2rem 1.5rem 2rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(232, 255, 0, 0.9), rgba(232, 255, 0, 0.18), transparent);
}

.hx-app .hx-hero:has(+ .hx-container.hx-tools-page) .hx-hero-badge {
    width: fit-content;
    margin-bottom: 0.85rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid rgba(232, 255, 0, 0.36);
    border-radius: 999px;
    background: rgba(232, 255, 0, 0.12);
    color: #e8ff00;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hx-app .hx-hero:has(+ .hx-container.hx-tools-page) .hx-hero-title {
    max-width: 680px;
    margin-left: 0 !important;
    margin-right: auto !important;
    color: #ffffff !important;
    font-size: clamp(2rem, 4.2vw, 4.2rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-align: left !important;
}

.hx-app .hx-hero:has(+ .hx-container.hx-tools-page) .hx-hero-subtitle {
    max-width: 620px;
    margin-left: 0 !important;
    margin-right: auto !important;
    margin-top: 1rem !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: clamp(1rem, 1.55vw, 1.2rem) !important;
    text-align: left !important;
}

.hx-app .hx-hero:has(+ .hx-container.hx-tools-page) + .hx-container,
.hx-app .hx-hero:has(+ .hx-tools-page) + .hx-tools-page {
    position: relative;
    z-index: 3;
    margin-top: clamp(-2rem, -3vw, -1rem);
}

.hx-app .hx-tools-page :is(.hx-tools-featured-grid, .hx-tools-grid) {
    gap: clamp(1rem, 2.4vw, 1.4rem);
}

.hx-app .hx-tools-page .hx-calc-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 26px !important;
    background:
        radial-gradient(circle at 98% 0%, rgba(232, 255, 0, 0.18), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hx-app .hx-tools-page .hx-calc-card:hover {
    border-color: rgba(232, 255, 0, 0.55) !important;
    box-shadow: 0 30px 78px rgba(15, 23, 42, 0.13) !important;
    transform: translateY(-3px);
}

.hx-app .hx-tools-page .hx-calc-card-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(232, 255, 0, 0.28) !important;
    color: #6b7600 !important;
}

.hx-app .hx-tools-page .hx-calc-card-name {
    color: #0f172a;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    font-weight: 900;
    letter-spacing: -0.025em;
}

.hx-app .hx-tools-page .hx-calc-card-desc {
    max-width: 40rem;
    color: #64748b;
    line-height: 1.6;
}

.hx-app .hx-tools-page .hx-calc-card-cta {
    width: fit-content;
    margin-top: 0.9rem;
    padding: 0.68rem 0.9rem;
    border-radius: 999px;
    background: #e8ff00;
    color: #020617;
    font-weight: 900;
}

.hx-app .hx-tools-page .hx-tools-plan-card {
    border-radius: 28px !important;
    box-shadow: 0 30px 85px rgba(15, 23, 42, 0.12) !important;
}

@media (max-width: 640px) {
    .hx-app .hx-hero:has(+ .hx-container.hx-tools-page) {
        min-height: 220px;
        padding: 1.35rem !important;
        border-radius: 20px !important;
    }

    .hx-app .hx-hero:has(+ .hx-container.hx-tools-page) .hx-hero-title {
        font-size: clamp(1.85rem, 10vw, 2.7rem) !important;
    }

    .hx-app .hx-tools-page .hx-calc-card {
        border-radius: 18px !important;
    }
}

@media (max-width: 640px) {
    .entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg {
        padding: 1.35rem !important;
        border-radius: 20px !important;
    }

    .entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-page-title {
        font-size: clamp(1.85rem, 10vw, 2.7rem) !important;
    }

    .entry-content .hx-app .hx-page-header-dark.hx-hero-with-bg .hx-hero-icon {
        position: static;
        width: 84px;
        height: 84px;
        margin-top: 1rem;
        transform: none;
    }

    .entry-content .hx-app .hx-page-header-dark + .hx-calculator-section {
        margin-top: 1rem;
    }

    .entry-content .hx-app .hx-calculator-section .hx-form-header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon"
            "title"
            "subtitle";
    }

    .entry-content .hx-app .hx-calculator-section .hx-calc-form,
    .entry-content .hx-app .hx-calculator-section .hx-results-section {
        border-radius: 18px !important;
        padding: 1rem !important;
    }

    .entry-content .hx-app .hx-calculator-section .hx-result-hero {
        text-align: center !important;
        align-items: center !important;
    }
}

/* Theme wrapper fallback: some RoxRace routes do not expose the same entry-content
   ancestry in the final DOM, so the command-center layer also targets hx-app directly. */
.hx-app .hx-page-header-dark.hx-hero-with-bg {
    min-height: clamp(240px, 28vw, 340px) !important;
    padding: clamp(1.5rem, 4vw, 3rem) !important;
    border-radius: 28px !important;
    isolation: isolate;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.hx-app .hx-page-header-dark.hx-hero-with-bg::before {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.68) 44%, rgba(2, 6, 23, 0.28) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.28), transparent 24%) !important;
}

.hx-app .hx-page-header-dark.hx-hero-with-bg::after {
    content: "";
    position: absolute;
    inset: auto 2rem 1.5rem 2rem;
    height: 1px;
    background: linear-gradient(90deg, rgba(232, 255, 0, 0.9), rgba(232, 255, 0, 0.18), transparent);
    z-index: 1;
}

.hx-app .hx-page-header-dark.hx-hero-with-bg .hx-hero-text {
    position: relative;
    z-index: 2;
    max-width: min(960px, 100%);
}

.hx-app .hx-page-header-dark.hx-hero-with-bg .hx-page-title {
    max-width: none;
    width: 100%;
    color: #ffffff !important;
    font-size: clamp(2rem, 4.2vw, 4.2rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

.hx-app .hx-page-header-dark.hx-hero-with-bg .hx-page-subtitle {
    max-width: 560px;
    margin-top: 1rem !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: clamp(1rem, 1.55vw, 1.2rem) !important;
}

.hx-app .hx-page-header-dark.hx-hero-with-bg .hx-hero-icon {
    position: absolute;
    right: clamp(1.25rem, 6vw, 5rem);
    top: 50%;
    z-index: 1;
    width: clamp(120px, 15vw, 210px);
    height: clamp(120px, 15vw, 210px);
    display: grid;
    place-items: center;
    border: 1px solid rgba(232, 255, 0, 0.18);
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(232, 255, 0, 0.18), rgba(232, 255, 0, 0.045) 54%, transparent 70%),
        rgba(2, 6, 23, 0.26);
    color: rgba(232, 255, 0, 0.44);
    box-shadow: inset 0 0 34px rgba(232, 255, 0, 0.06), 0 0 60px rgba(232, 255, 0, 0.12);
    pointer-events: none;
    transform: translateY(-50%);
}

.hx-app .hx-page-header-dark + .hx-calculator-section {
    position: relative;
    z-index: 3;
    margin-top: clamp(-3.25rem, -4vw, -1.5rem);
    padding-top: 0;
}

.hx-app .hx-calculator-section .hx-calculator-layout {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 680px !important;
    gap: clamp(1.1rem, 2.5vw, 1.75rem);
}

.hx-app .hx-calculator-section .hx-calc-form,
.hx-app .hx-calculator-section .hx-results-section {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 28px !important;
    box-shadow: 0 30px 85px rgba(15, 23, 42, 0.12) !important;
}

.hx-app .hx-calculator-section .hx-calc-form {
    padding: clamp(1.35rem, 2.5vw, 2rem) !important;
    background:
        radial-gradient(circle at 98% 0%, rgba(232, 255, 0, 0.2), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)) !important;
}

.hx-app .hx-calculator-section .hx-form-header {
    display: grid !important;
    grid-template-columns: 48px 1fr;
    grid-template-areas:
        "icon title"
        "icon subtitle";
    column-gap: 0.85rem;
    align-items: center;
    padding: 0 0 1.35rem !important;
    text-align: left !important;
}

.hx-app .hx-calculator-section .hx-form-icon {
    grid-area: icon;
    position: static !important;
    width: 48px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center;
    border-radius: 16px;
    background: rgba(232, 255, 0, 0.32);
    color: #6b7600 !important;
}

.hx-app .hx-calculator-section .hx-form-title {
    grid-area: title;
    margin: 0;
    text-align: left !important;
}

.hx-app .hx-calculator-section .hx-form-subtitle {
    grid-area: subtitle;
    max-width: 34rem;
    margin: 0.2rem 0 0;
    text-align: left !important;
}

.hx-app .hx-calculator-section :is(.hx-form-group, .hx-form-section, .hx-field-meta) {
    text-align: left !important;
}

@media (min-width: 1181px) {
    .hx-app .hx-calculator-section .hx-calculator-layout {
        grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr) !important;
        max-width: 1120px !important;
    }

}

/* Result timeline repair: legacy absolute timeline rules were collapsing the
   nutrition result text column to a few pixels on rendered results. */
:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-results-section {
    align-self: start;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-nutrition-phase {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: 1.25rem !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline::before {
    display: none !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline-item {
    display: grid !important;
    grid-template-columns: 14px minmax(0, 1fr) !important;
    gap: 0.75rem !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0.85rem 0 !important;
    margin: 0 !important;
    border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
    background: transparent !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline-item:first-child {
    border-top: 0 !important;
    padding-top: 0 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline-marker {
    position: static !important;
    grid-column: 1;
    width: 10px !important;
    height: 10px !important;
    margin: 0.45rem 0 0 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline-content {
    grid-column: 2;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline-time {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 0 0.4rem !important;
    line-height: 1.35 !important;
    white-space: normal !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section .hx-timeline-details {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0.75rem 0.9rem !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 14px !important;
    background: rgba(248, 250, 252, 0.86) !important;
    overflow-wrap: break-word !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-results-section :is(.hx-timeline-food, .hx-list-compact) {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-calc-form .hx-checkbox-group.hx-chip-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.55rem !important;
    width: 100% !important;
    margin-top: 0.75rem !important;
    padding: 0 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-calc-form .hx-checkbox-group.hx-chip-group :is(.hx-chip-option, .hx-checkbox-label) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0.68rem 0.9rem !important;
}

/* Icon background removal: keep SVGs clean without tinted badge boxes. */
:is(.entry-content .hx-app, .hx-app) :is(.hx-calc-card-icon, .hx-card-icon, .hx-form-icon) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.entry-content .hx-card:hover .hx-card-icon,
:is(.entry-content .hx-app, .hx-app) .hx-calc-card:hover .hx-calc-card-icon {
    background: transparent !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-calc-card-icon, .hx-card-icon) svg {
    color: currentColor;
}

:is(.entry-content .hx-app, .hx-app) .hx-form-icon svg {
    color: var(--hx-primary, #d9ff00) !important;
}

/* Active tabs should read as selected controls, not just underlined text. */
:is(.entry-content .hx-app, .hx-app) .hx-tabs .hx-tab-btn:is(.active, [aria-selected="true"]),
.entry-content .hx-tab-bar .hx-tab-btn:is(.active, .hx-tab-btn-active, [aria-selected="true"]) {
    color: #0f172a !important;
    background: var(--hx-primary, #d9ff00) !important;
    border-color: var(--hx-primary, #d9ff00) !important;
    border-bottom-color: var(--hx-primary, #d9ff00) !important;
    border-radius: 999px !important;
    box-shadow: 0 12px 28px rgba(217, 255, 0, 0.24) !important;
    font-weight: 900 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-tabs .hx-tab-btn:is(.active, [aria-selected="true"]):hover,
.entry-content .hx-tab-bar .hx-tab-btn:is(.active, .hx-tab-btn-active, [aria-selected="true"]):hover {
    color: #0f172a !important;
    background: var(--hx-primary, #d9ff00) !important;
}

/* Shared calculator preview panel.
   Most calculator templates use public/templates/partials/calc-preview.php; the
   original detailed preview styles were scoped only to finish-time. */
:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-calc-preview {
    position: sticky;
    top: 86px;
    overflow: hidden;
    min-height: 100%;
    padding: clamp(1.4rem, 3vw, 2.15rem) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 28px !important;
    background:
        radial-gradient(circle at 88% 10%, rgba(232, 255, 0, 0.32), transparent 26%),
        radial-gradient(circle at 12% 90%, rgba(255, 255, 255, 0.1), transparent 30%),
        linear-gradient(145deg, #070b14 0%, #111827 58%, #030712 100%) !important;
    color: #ffffff;
    box-shadow: 0 30px 85px rgba(15, 23, 42, 0.12);
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-orbit {
    position: absolute;
    inset: auto 1.25rem 1.25rem auto;
    width: 160px;
    height: 160px;
    opacity: 0.55;
    pointer-events: none;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-orbit span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(232, 255, 0, 0.18);
    border-radius: 999px;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-orbit span:nth-child(2) {
    inset: 24px;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-orbit span:nth-child(3) {
    inset: 52px;
    background: rgba(232, 255, 0, 0.22);
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section :is(.hx-preview-header, .hx-preview-grid, .hx-preview-steps) {
    position: relative;
    z-index: 1;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-eyebrow {
    display: inline-flex;
    margin-bottom: 0.8rem;
    color: #e8ff00;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

:is(.entry-content.rbct .hx-app, .entry-content .hx-app, .hx-app) .hx-calculator-section .hx-calc-preview .hx-preview-header h2 {
    max-width: min(20rem, 100%);
    margin: 0;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    /* Subordinate to the page h1 — never reintroduce a 3.3rem cap here. */
    font-size: var(--hx-type-panel) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.04em !important;
    font-weight: 800 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-header p {
    max-width: 430px;
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.72) !important;
    line-height: 1.65;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-card {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-value {
    display: block;
    color: #e8ff00;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-label {
    display: block;
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    font-weight: 700;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-steps {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-steps li {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: 0.35rem 0.8rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-steps span {
    grid-row: span 2;
    color: rgba(232, 255, 0, 0.7);
    font-size: 0.78rem;
    font-weight: 900;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-steps strong {
    color: #ffffff;
    font-size: 0.94rem;
}

:is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-steps em {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.84rem;
    font-style: normal;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    :is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-calc-preview {
        position: static;
        min-height: 0;
    }
}

@media (max-width: 640px) {
    :is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-calc-preview {
        border-radius: 18px !important;
        padding: 1rem !important;
    }

    :is(.entry-content .hx-app, .hx-app) .hx-calculator-section .hx-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Calculator hero normalization: every calculator header should share one
   shape even when a route lacks a page-specific background image. */
:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: clamp(1.25rem, 4vw, 3rem) !important;
    min-height: clamp(260px, 28vw, 340px) !important;
    height: auto !important;
    margin: 0 0 var(--hx-sp-6, 1.5rem) !important;
    padding: clamp(1.5rem, 4vw, 3rem) !important;
    border-radius: 28px !important;
    overflow: hidden !important;
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.68) 44%, rgba(2, 6, 23, 0.3) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.22), transparent 24%),
        var(--hx-hero-bg, linear-gradient(145deg, #070b14 0%, #111827 58%, #030712 100%)) center / cover no-repeat !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22) !important;
    text-align: left !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: -1 !important;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.64) 48%, rgba(2, 6, 23, 0.22) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.24), transparent 24%) !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark::after {
    content: "" !important;
    position: absolute !important;
    inset: auto 2rem 1.5rem 2rem !important;
    z-index: 1 !important;
    height: 1px !important;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(232, 255, 0, 0.9), rgba(232, 255, 0, 0.18), transparent) !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-hero-text {
    position: relative !important;
    z-index: 2 !important;
    max-width: min(960px, 100%) !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark :is(.hx-hero-kicker, .hx-page-header-badge),
:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg .hx-page-header-badge {
    display: inline-flex !important;
    width: fit-content !important;
    margin: 0 0 0.85rem !important;
    padding: 0.42rem 0.65rem !important;
    border: 1px solid rgba(232, 255, 0, 0.22) !important;
    border-radius: 999px !important;
    background: rgba(232, 255, 0, 0.12) !important;
    color: var(--hx-primary, #d9ff00) !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-page-title {
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: clamp(2rem, 4.2vw, 4.2rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-page-subtitle {
    max-width: 560px !important;
    margin: 1rem 0 0 !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: clamp(1rem, 1.55vw, 1.2rem) !important;
    line-height: 1.55 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-hero-metrics {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
    margin-top: 1rem !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-hero-metrics span {
    padding: 0.45rem 0.65rem !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-hero-icon {
    position: absolute !important;
    right: clamp(1.25rem, 6vw, 5rem) !important;
    top: 50% !important;
    z-index: 1 !important;
    width: clamp(120px, 15vw, 210px) !important;
    height: clamp(120px, 15vw, 210px) !important;
    transform: translateY(-50%) !important;
    opacity: 1 !important;
}

@media (max-width: 640px) {
    :is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark {
        min-height: auto !important;
        padding: 1.35rem !important;
        border-radius: 20px !important;
    }

    :is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-page-title {
        font-size: clamp(1.85rem, 10vw, 2.7rem) !important;
    }

    :is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-hero-icon {
        position: static !important;
        width: 84px !important;
        height: 84px !important;
        transform: none !important;
    }
}

/* Guide / long-form article heroes: same “command center” shell as
   .hx-container > .hx-page-header-dark (gradients, radius, depth, accent line). */
:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.2rem !important;
    min-height: clamp(260px, 28vw, 340px) !important;
    height: auto !important;
    margin: 0 0 var(--hx-sp-6, 1.5rem) !important;
    padding: clamp(1.5rem, 4vw, 3rem) !important;
    border-radius: 28px !important;
    overflow: hidden !important;
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.68) 44%, rgba(2, 6, 23, 0.3) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.22), transparent 24%),
        var(--hx-hero-bg) center / cover no-repeat,
        #0a0a0a !important;
    background-color: #0a0a0a !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22) !important;
    text-align: left !important;
}

:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.58) 48%, rgba(2, 6, 23, 0.18) 100%),
        radial-gradient(circle at 86% 32%, rgba(232, 255, 0, 0.24), transparent 24%) !important;
    pointer-events: none;
}

:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg::after {
    content: "" !important;
    position: absolute !important;
    inset: auto 2rem 1.5rem 2rem !important;
    z-index: 1 !important;
    height: 1px !important;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(232, 255, 0, 0.9), rgba(232, 255, 0, 0.18), transparent) !important;
    pointer-events: none;
}

:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg
    :is(.hx-page-header-badge, h1.hx-page-title, .hx-page-title, .hx-page-subtitle, .hx-page-meta) {
    position: relative !important;
    z-index: 2 !important;
}

:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg :is(.hx-page-subtitle, p.hx-page-subtitle) {
    max-width: min(560px, 100%) !important;
    margin: 0.65rem 0 0 !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-size: clamp(1rem, 1.55vw, 1.2rem) !important;
    line-height: 1.55 !important;
}

@media (max-width: 640px) {
    :is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header.hx-hero-with-bg {
        min-height: auto !important;
        padding: 1.35rem !important;
        border-radius: 20px !important;
    }
}

/* Plugin-wide heading scale.
   The calculators/tools hub title is the visual ceiling; every other page
   heading should sit below it so pages feel like one product. */
:is(.entry-content .hx-app, .hx-app) .hx-hub-welcome-title {
    font-size: clamp(2.75rem, 7vw, 4.4rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.06em !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-page-title, .hx-hero-title, .hx-hero h1) {
    font-size: clamp(2rem, 4vw, 3.55rem) !important;
    line-height: 1 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

:is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-page-title,
:is(.entry-content .hx-app, .hx-app) .hx-finish-time-hero .hx-page-title {
    font-size: clamp(2rem, 4vw, 3.55rem) !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-section-title, .hx-content-section h2, .hx-faq-section h2, .hx-related-section h2, .hx-tools-grid-section h2) {
    font-size: clamp(1.55rem, 2.6vw, 2.25rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.035em !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-card h2, .hx-card h3, .hx-form-title, .hx-preview-header h2) {
    font-size: clamp(1.25rem, 2.2vw, 1.85rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.025em !important;
}

@media (max-width: 640px) {
    :is(.entry-content .hx-app, .hx-app) .hx-hub-welcome-title {
        font-size: clamp(2.35rem, 11vw, 3.25rem) !important;
    }

    :is(.entry-content .hx-app, .hx-app) :is(.hx-page-title, .hx-hero-title, .hx-hero h1),
    :is(.entry-content .hx-app, .hx-app) .hx-container > .hx-page-header-dark .hx-page-title,
    :is(.entry-content .hx-app, .hx-app) .hx-finish-time-hero .hx-page-title {
        font-size: clamp(1.85rem, 9vw, 2.55rem) !important;
    }
}

/* Final typography system.
   This intentionally wins over legacy page-by-page typography so the plugin
   reads as one product instead of a pile of unrelated templates. */
:is(.entry-content .hx-app, .hx-app) {
    /* Display > page h1 > panel/column titles > section > card. */
    --hx-type-display: clamp(2.45rem, 4.5vw, 3.4rem);
    --hx-type-page: clamp(2rem, 3.1vw, 2.6rem);
    --hx-type-panel: clamp(1.3rem, 1.9vw, 1.75rem);
    --hx-type-section: clamp(1.4rem, 2.1vw, 1.9rem);
    --hx-type-card: clamp(1.1rem, 1.5vw, 1.3rem);
    --hx-type-body: 1rem;
    --hx-type-small: 0.875rem;
    --hx-type-caption: 0.75rem;
    font-family: var(--hx-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif) !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

:is(.entry-content .hx-app, .hx-app) :is(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, span, li, th, td) {
    font-family: inherit !important;
}

:is(.entry-content .hx-app, .hx-app) :is(p, li, td, th, label, input, select, textarea, .hx-help-text, .hx-card-description, .hx-page-subtitle, .hx-form-subtitle) {
    font-size: var(--hx-type-body) !important;
    line-height: 1.6 !important;
    letter-spacing: normal !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-help-text, .hx-card-description, .hx-form-subtitle, .hx-page-subtitle, .hx-hub-welcome-sub, .hx-preview-header p) {
    max-width: 68ch;
    font-weight: 500 !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-hub-welcome-title) {
    /* Line length: do not use tiny `ch` caps here (12ch ≈ 6–8 characters). */
    max-width: min(20em, 100%);
    margin: 0 !important;
    font-size: var(--hx-type-display) !important;
    font-weight: 850 !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    text-wrap: balance;
}

/* Page / hero h1: no global width cap (20rem ≈ 320px broke long titles on guides).
   Calculator dark header keeps full width in its own block above; finish-time
   uses a local cap so the title does not run under the hero mark. */
:is(.entry-content .hx-app, .hx-app) :is(.hx-page-title, .hx-hero-title, .hx-hero h1) {
    max-width: none !important;
    margin: 0 !important;
    font-size: var(--hx-type-page) !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    letter-spacing: -0.05em !important;
    text-wrap: balance;
}

:is(.entry-content .hx-app, .hx-app) .hx-finish-time-hero .hx-page-title {
    max-width: min(22rem, calc(100% - 5.5rem)) !important;
}

/* Guide + editorial heroes: use header width, comfortable line length. */
:is(.entry-content .hx-app, .hx-app) article.hx-guide-page > .hx-page-header .hx-page-title {
    max-width: min(100%, 52rem) !important;
    font-size: clamp(2rem, 3.2vw, 3.1rem) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Preview column title only — keep result numbers/headlines on their own scale. */
:is(.entry-content .hx-app, .hx-app) .hx-calc-preview .hx-preview-header h2 {
    font-size: var(--hx-type-panel) !important;
    font-weight: 800 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.04em !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-section-title, .hx-content-section h2, .hx-faq-section h2, .hx-related-section h2, .hx-tools-grid-section h2, .hx-station-ref h2) {
    max-width: min(48ch, 100%);
    margin-bottom: 0.85rem !important;
    font-size: var(--hx-type-section) !important;
    font-weight: 800 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.035em !important;
    text-wrap: balance;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-form-title, .hx-card h2, .hx-card h3, .hx-calc-card h3, .hx-tool-card h3, .hx-result-card h3) {
    font-size: var(--hx-type-card) !important;
    font-weight: 800 !important;
    line-height: 1.18 !important;
    letter-spacing: -0.02em !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-label, .hx-stat-label, .hx-result-label, .hx-preview-eyebrow, .hx-hero-kicker, .hx-page-header-badge, .hx-input-suffix, .hx-badge, .hx-tab-btn) {
    font-size: var(--hx-type-caption) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: 0.075em !important;
    text-transform: uppercase !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-btn, .hx-btn-primary, .hx-btn-secondary, button, .hx-calc-card-cta) {
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
}

:is(.entry-content .hx-app, .hx-app) :is(.hx-stat-value, .hx-preview-value, .hx-hub-stat-card-value, .hx-gauge-value) {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.045em !important;
}

@media (max-width: 640px) {
    :is(.entry-content .hx-app, .hx-app) {
        --hx-type-display: clamp(2.1rem, 8vw, 2.75rem);
        --hx-type-page: clamp(1.75rem, 7vw, 2.2rem);
        --hx-type-panel: clamp(1.2rem, 5.5vw, 1.55rem);
        --hx-type-section: clamp(1.2rem, 5vw, 1.6rem);
        --hx-type-card: 1.1rem;
    }
}
