/* Temaskift-knap */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.45rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #2c3e50;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

body.portal-article header,
body.program-page header,
body.portal-calc header,
body.portal-hub .header,
body.portal-hub-main .header {
    position: relative;
}

body.portal-article .footer,
body.program-page .footer,
body.portal-hub .footer,
body.portal-hub-main .footer,
body.portal-skema .footer,
body.portal-calc footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.theme-toggle--footer {
    margin: 0.85rem 0 0;
    align-self: flex-end;
    display: inline-flex;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle-floating {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 200;
    margin-left: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .theme-toggle {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

html[data-theme="dark"] .theme-toggle--footer {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(71, 85, 105, 0.85);
    color: #f1f5f9;
}

html[data-theme="dark"] .portal-nav--bottom {
    border-top-color: #334155;
}

/* —— Artikler og program-sider —— */
html[data-theme="dark"] {
    --primary-color: #e2e8f0;
    --secondary-color: #60a5fa;
    --dark-color: #f8fafc;
    --light-color: #334155;
}

html[data-theme="dark"] body {
    background-color: #0f1419 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] label,
html[data-theme="dark"] .intro-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .intro-text,
html[data-theme="dark"] .highlight,
html[data-theme="dark"] .tips,
html[data-theme="dark"] .info-box,
html[data-theme="dark"] .coach-note {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] strong,
html[data-theme="dark"] b {
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.card, .training-day, .interactive-zone, .highlight, .tips) strong,
html[data-theme="dark"] :is(.card, .training-day, .interactive-zone, .highlight, .tips) b {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] header {
    background: linear-gradient(to right, #1e3a5f, #2563eb) !important;
    color: #fff !important;
    border-bottom-color: #ef4444 !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
    color: #ffffff !important;
}

html[data-theme="dark"] h2 {
    border-bottom-color: #3b82f6;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .intro-card,
html[data-theme="dark"] .interactive-zone,
html[data-theme="dark"] .program-section,
html[data-theme="dark"] .program-overview,
html[data-theme="dark"] .intensity-guide,
html[data-theme="dark"] .week-card {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .card h3,
html[data-theme="dark"] .intro-card h2 {
    border-bottom-color: #3b82f6;
}

html[data-theme="dark"] .training-day {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .week-header {
    border-bottom-color: #334155 !important;
}

/* Side-CSS sætter ofte #666/#777 på tekst i hvide bokse */
html[data-theme="dark"] .intro-card :is(p, li, span, div, td, th, label, em, small),
html[data-theme="dark"] .card :is(p, li, span, div, td, th, label, em, small),
html[data-theme="dark"] .week-card :is(p, li, span, div, td, th, label, em, small),
html[data-theme="dark"] .interactive-zone :is(p, li, span, div),
html[data-theme="dark"] .program-section :is(p, li, span, div),
html[data-theme="dark"] .program-overview :is(p, li, span, div),
html[data-theme="dark"] .program-description,
html[data-theme="dark"] .training-description,
html[data-theme="dark"] .pace-overview-intro,
html[data-theme="dark"] .zone-guide-note,
html[data-theme="dark"] .program-print-hint {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .week-print-btn,
html[data-theme="dark"] .program-print-all-btn,
html[data-theme="dark"] .program-calendar-btn,
html[data-theme="dark"] .program-race-checklist-btn {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .week-print-btn:hover,
html[data-theme="dark"] .program-print-all-btn:hover,
html[data-theme="dark"] .program-calendar-btn:hover,
html[data-theme="dark"] .program-race-checklist-btn:hover {
    background-color: #334155 !important;
    border-color: #94a3b8 !important;
}

html[data-theme="dark"] body.program-page .program-calendar-row {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] body.program-page .program-toolbar-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] body.program-page .program-week-list {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] body.program-page .program-wednesday-guide {
    background-color: #1e293b !important;
    border-left-color: var(--program-accent) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.program-page .program-wednesday-guide h4,
html[data-theme="dark"] body.program-page .program-wednesday-guide h5 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.program-page .program-wednesday-taper,
html[data-theme="dark"] body.program-page .program-wednesday-ref {
    color: #cbd5e1 !important;
    background-color: rgba(15, 23, 42, 0.55) !important;
}

html[data-theme="dark"] body.program-page .program-week-list-meta p,
html[data-theme="dark"] body.program-page .program-week-list-head h2 {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.program-page .program-week-table th {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.program-page .program-week-table td {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.program-page .program-week-list-controls select {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] body.program-page .program-info-panel {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] body.program-page .program-calendar-row input[type='date'],
html[data-theme="dark"] body.program-page .program-race-row input[type='date'] {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] body.program-page .program-plan-tools select,
html[data-theme="dark"] body.program-page .program-calendar-tools select {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] body.program-page .program-race-plan-result {
    background-color: #14532d33 !important;
    border-left-color: #22c55e !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.program-page .program-go-to-week-btn {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] body.program-page .program-print-bar {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] body.portal-skema,
html[data-theme="dark"] body.portal-article {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.portal-skema header,
html[data-theme="dark"] body.portal-article header {
    color: #fff !important;
}

html[data-theme="dark"] body.portal-hub,
html[data-theme="dark"] body.portal-hub-main {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .zone-guide-note {
    background-color: #1e3a5f !important;
    border-left-color: #3b82f6 !important;
}

html[data-theme="dark"] .pace-overview-table {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .pace-overview-caption,
html[data-theme="dark"] .pace-overview-table thead th {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .pace-overview-table tbody th {
    color: #f1f5f9 !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .pace-overview-table tbody td {
    color: #f8fafc !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .pace-overview-row--goal th,
html[data-theme="dark"] .pace-overview-row--goal td {
    background-color: #14532d !important;
}

html[data-theme="dark"] .pace-overview-row--program th,
html[data-theme="dark"] .pace-overview-row--program td {
    background-color: #431407 !important;
}

html[data-theme="dark"] .intro-card strong,
html[data-theme="dark"] .card strong,
html[data-theme="dark"] .week-card strong,
html[data-theme="dark"] .coach-note strong {
    color: #ffffff !important;
}

/* Inline hvide / gule bokse i artikler */
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="background-color:white"] {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] [style*="background-color: white"] :is(p, li, span, div, strong, em),
html[data-theme="dark"] [style*="background-color:white"] :is(p, li, span, div, strong, em) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] [style*="background-color: #fff9e6"],
html[data-theme="dark"] [style*="background-color:#fff9e6"] {
    background-color: #422006 !important;
    color: #fef3c7 !important;
}

html[data-theme="dark"] [style*="background-color: #eaeef2"],
html[data-theme="dark"] [style*="background-color:#eaeef2"],
html[data-theme="dark"] [style*="background-color: var(--light-color)"],
html[data-theme="dark"] [style*="background-color:var(--light-color)"],
html[data-theme="dark"] [style*="background-color: #f0f7ff"],
html[data-theme="dark"] [style*="background-color:#f0f7ff"],
html[data-theme="dark"] [style*="background-color: #f9f9e0"],
html[data-theme="dark"] [style*="background-color:#f9f9e0"] {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

/* Løbeteori-artikler: øvelser, teknik, ernæring, tabeller */
html[data-theme="dark"] :is(
    .exercise-card,
    .technique-element,
    .pro-con,
    .competition-card,
    .carb-item,
    .science-box,
    .exercise-box,
    .stat-item,
    .zone-info,
    .distance-btn
) {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .coach-note {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-left-color: #3b82f6 !important;
}

html[data-theme="dark"] .warning-box {
    background-color: #450a0a !important;
    color: #fecaca !important;
    border-left-color: #ef4444 !important;
}

html[data-theme="dark"] .caffeine-box {
    background-color: #3b0764 !important;
    color: #e9d5ff !important;
    border-left-color: #a855f7 !important;
}

html[data-theme="dark"] .vitamin-box {
    background-color: #0c4a6e !important;
    color: #e0f2fe !important;
    border-left-color: #38bdf8 !important;
}

html[data-theme="dark"] .creatine-box {
    background-color: #14532d !important;
    color: #dcfce7 !important;
    border-left-color: #4ade80 !important;
}

html[data-theme="dark"] :is(
    .exercise-card,
    .technique-element,
    .pro-con,
    .competition-card,
    .carb-item,
    .science-box,
    .exercise-box,
    .stat-item,
    .coach-note,
    .warning-box,
    .caffeine-box,
    .vitamin-box,
    .creatine-box,
    .zone-info
) :is(p, li, span, div, td, th, label, em, small) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .energy-table th,
html[data-theme="dark"] .table th {
    background-color: #1e3a5f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .energy-table td,
html[data-theme="dark"] .table td {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .energy-table tr:nth-child(even) td,
html[data-theme="dark"] .table tr:nth-child(even) td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .energy-table-wrapper {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .stat-label {
    color: #cbd5e1 !important;
}

/* Basis træning (basic.html, begynder.html) */
html[data-theme="dark"] .coach-card,
html[data-theme="dark"] .muscle-group {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .training-section h2 {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .training-section.marathon-section h2 {
    background-color: #2e1065 !important;
    border-left-color: #a855f7 !important;
}

html[data-theme="dark"] .training-section.outdoor-section h2 {
    background-color: #134e4a !important;
    border-left-color: #2dd4bf !important;
}

html[data-theme="dark"] .training-section.strength-section h2 {
    background-color: #422006 !important;
    border-left-color: #f59e0b !important;
}

html[data-theme="dark"] .training-day,
html[data-theme="dark"] .card .training-day {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .training-day :is(h3, h4, p, li, strong, em),
html[data-theme="dark"] .card :is(h3, h4, p, li, strong, em),
html[data-theme="dark"] .interactive-zone :is(h2, h3, h4, p, li, strong, em) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .card h3,
html[data-theme="dark"] .training-day h3 {
    color: #f8fafc !important;
    border-bottom-color: #475569 !important;
}

html[data-theme="dark"] .highlight:not(.marathon):not(.extra-day):not(.strength):not(.info) {
    background-color: #1e3a5f !important;
    color: #e0f2fe !important;
    border-left-color: #3b82f6 !important;
}

html[data-theme="dark"] .highlight.marathon {
    background-color: #2e1065 !important;
    color: #e9d5ff !important;
    border-left-color: #a855f7 !important;
}

html[data-theme="dark"] [style*="background-color: #f3e8fc"],
html[data-theme="dark"] [style*="background-color:#f3e8fc"],
html[data-theme="dark"] [style*="background-color: #e8f8f0"],
html[data-theme="dark"] [style*="background-color:#e8f8f0"] {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .distance-btn {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .distance-btn.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] .distance-btn.marathon.active {
    background-color: #7c3aed !important;
    border-color: #a78bfa !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .distance-table th {
    background-color: #1e3a5f !important;
    color: #f8fafc !important;
    border-bottom-color: #475569 !important;
}

html[data-theme="dark"] .distance-table td {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .distance-table tr:hover td {
    background-color: #334155 !important;
}

html[data-theme="dark"] section.tips > .grid .card {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .highlight.extra-day,
html[data-theme="dark"] .highlight.strength {
    background-color: #14532d !important;
    color: #dcfce7 !important;
    border-left-color: #4ade80 !important;
}

html[data-theme="dark"] .highlight.info {
    background-color: #1e3a5f !important;
    color: #e0f2fe !important;
    border-left-color: #3b82f6 !important;
}

html[data-theme="dark"] .marathon-features {
    background-color: #2e1065 !important;
    color: #e9d5ff !important;
    border-left-color: #a855f7 !important;
}

html[data-theme="dark"] .extra-day-features {
    background-color: #14532d !important;
    color: #dcfce7 !important;
    border-left-color: #4ade80 !important;
}

html[data-theme="dark"] .recruitment-box {
    background-color: #134e4a !important;
    color: #ccfbf1 !important;
    border-color: #2dd4bf !important;
}

html[data-theme="dark"] .image-fallback {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .self-training-note {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .distance-options {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .marathon-features h4 {
    color: #e9d5ff !important;
}

html[data-theme="dark"] .extra-day-features h4 {
    color: #86efac !important;
}

html[data-theme="dark"] .muscle-group h4 {
    color: #fbbf24 !important;
}

html[data-theme="dark"] .week-card h4 {
    color: #5eead4 !important;
}

html[data-theme="dark"] :is(
    .coach-card,
    .muscle-group,
    .marathon-features,
    .extra-day-features,
    .recruitment-box,
    .card .training-day
) :is(p, li, span, div, td, th, label, em, small) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .distance-table td {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .distance-table tr:hover td {
    background-color: #334155 !important;
}

html[data-theme="dark"] .zone-table tr:nth-child(even) td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .zone-table tr:hover td {
    background-color: #334155 !important;
}

html[data-theme="dark"] .route-table tr:nth-child(even) td {
    background-color: #0f172a !important;
}

html[data-theme="dark"] .route-table tr:hover td {
    background-color: #334155 !important;
}

html[data-theme="dark"] .intro-text,
html[data-theme="dark"] .highlight,
html[data-theme="dark"] .info-box {
    background-color: #1e3a5f !important;
    color: #f1f5f9 !important;
    border-left-color: #3b82f6;
}

html[data-theme="dark"] .tips {
    background-color: #422006 !important;
    color: #fef3c7 !important;
    border-left-color: #f59e0b !important;
}

html[data-theme="dark"] .footer {
    color: #cbd5e1 !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .subtitle {
    color: #f1f5f9 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .portal-nav.portal-nav-sticky {
    background: rgba(15, 20, 25, 0.95) !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .portal-nav a {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .portal-nav a:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .portal-nav.portal-nav-sticky {
    background: rgba(15, 20, 25, 0.97) !important;
    border-bottom-color: #334155 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .portal-nav.portal-nav-sticky a {
    background: #1e293b !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .portal-nav a.portal-nav-home {
    background: linear-gradient(135deg, #2563eb, #1e3a5f);
    color: #fff;
}

html[data-theme="dark"] .table-scroll {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .route-table th,
html[data-theme="dark"] .distance-table th,
html[data-theme="dark"] .zone-table th,
html[data-theme="dark"] .time-table th {
    background-color: #1e3a5f !important;
    color: #fff !important;
}

html[data-theme="dark"] .route-table td,
html[data-theme="dark"] .distance-table td,
html[data-theme="dark"] .zone-table td,
html[data-theme="dark"] .time-table td {
    border-color: #334155;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .route-table tr:nth-child(even),
html[data-theme="dark"] .distance-table tr:nth-child(even),
html[data-theme="dark"] .zone-table tr:nth-child(even),
html[data-theme="dark"] .time-table tr:nth-child(even) {
    background-color: #1e293b;
}

html[data-theme="dark"] .route-table tr:hover,
html[data-theme="dark"] .distance-table tr:hover {
    background-color: #334155 !important;
}

html[data-theme="dark"] .time-table-container {
    background: transparent;
}

html[data-theme="dark"] .legend {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

/* Zone-kort (mobil) – artikler med .zone-1 … .zone-5 */
html[data-theme="dark"] .zone-card,
html[data-theme="dark"] .zone-info,
html[data-theme="dark"] .zone-btn {
    border-color: #475569;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .zone-card:not([class*="zone-"]),
html[data-theme="dark"] .zone-info:not(.zone-1):not(.zone-2):not(.zone-3):not(.zone-4):not(.zone-5),
html[data-theme="dark"] .zone-btn:not(.zone-1):not(.zone-2):not(.zone-3):not(.zone-4):not(.zone-5) {
    background-color: #1e293b !important;
}

html[data-theme="dark"] :is(.zone-card, .zone-info, .zone-btn).zone-1 { background-color: #14532d !important; }
html[data-theme="dark"] :is(.zone-card, .zone-info, .zone-btn).zone-2 { background-color: #166534 !important; }
html[data-theme="dark"] :is(.zone-card, .zone-info, .zone-btn).zone-3 { background-color: #854d0e !important; }
html[data-theme="dark"] :is(.zone-card, .zone-info, .zone-btn).zone-4 { background-color: #9f1239 !important; }
html[data-theme="dark"] :is(.zone-card, .zone-info, .zone-btn).zone-5 { background-color: #7f1d1d !important; }

html[data-theme="dark"] :is(.zone-card, .zone-info) :is(p, li, span, div, h3, h4, strong) {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .zone-tag {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .zone-btn.active {
    background-color: #2563eb;
    color: #fff;
}

/* —— Portal-forsider (index, index2, index3) —— */
html[data-theme="dark"][data-page="hub"] body {
    background: linear-gradient(135deg, #0d1b2a, #1b3a4b) !important;
    background-attachment: scroll !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"][data-page="hub"] body::before,
html[data-theme="dark"][data-page="hub"] body::after {
    display: none !important;
}

html[data-theme="dark"][data-page="hub"] .container {
    background-color: rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"][data-page="hub"] .instructions {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(255, 255, 255, 0.25);
}

html[data-theme="dark"][data-page="hub"] .nav-button {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

html[data-theme="dark"][data-page="hub"] .button-title {
    color: #ffffff !important;
}

html[data-theme="dark"][data-page="hub"] .button-description {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

html[data-theme="dark"][data-page="hub"] .badge {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.25) !important;
}

html[data-theme="dark"][data-page="hub"] .instructions,
html[data-theme="dark"][data-page="hub"] .instructions p {
    color: #f1f5f9 !important;
}

html[data-theme="dark"][data-page="hub"] .back-link {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
}

html[data-theme="dark"][data-page="hub"] .footer {
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"][data-page="hub"] .footer p {
    color: #e2e8f0 !important;
}

/* index2 / index3 farvede baggrunde */
html[data-theme="dark"][data-page="hub"].page-theory body {
    background: linear-gradient(135deg, #2a2310, #3d3018) !important;
}

html[data-theme="dark"][data-page="hub"].page-programs body {
    background: linear-gradient(135deg, #0a2e33, #145a52) !important;
}

/* —— Løbsberegner —— */
html[data-theme="dark"] .app {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] h1 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .section-title {
    color: #ffffff !important;
}

html[data-theme="dark"] select,
html[data-theme="dark"] input,
html[data-theme="dark"] .chip {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .toggle {
    background: #0f172a;
}

html[data-theme="dark"] .chip.active {
    background: #334155 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chip:not(.active) {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .result-box,
html[data-theme="dark"] .stat-box,
html[data-theme="dark"] .kadence-box,
html[data-theme="dark"] .zone-card,
html[data-theme="dark"] .status-box {
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .big,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .kadence-value {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .small,
html[data-theme="dark"] p.lead,
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .kadence-label,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .zone-indicator,
html[data-theme="dark"] .zone {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .tab {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .tab.active {
    color: #ffffff !important;
    font-weight: 700;
}

html[data-theme="dark"] .btn.secondary {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .efficiency-calculation,
html[data-theme="dark"] .cadence-guide,
html[data-theme="dark"] .efficiency-calculation li {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .zone-name,
html[data-theme="dark"] .zone-pulse,
html[data-theme="dark"] .zone-description {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #paceVerification,
html[data-theme="dark"] #paceInfo {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .form-error {
    background: #450a0a;
    border-color: #991b1b;
    color: #fecaca;
}

html[data-theme="dark"] .share-feedback {
    color: #86efac;
}

html[data-theme="dark"] .share-feedback.error {
    color: #fca5a5;
}

/* —— Program-sider, skema, fælles paneler (lyse bokse → mørke) —— */
html[data-theme="dark"] :is(
    .goal-selector,
    .quick-nav,
    .phase-header,
    .program-section,
    .mara-features,
    .alt-program,
    .pace-item,
    .zone-guide,
    .intensity-guide .zone-table,
    .halv-features
) {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .filter-btn {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .filter-btn:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .filter-btn.active {
    background-color: #2563eb !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .phase-btn {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .phase-btn:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .phase-btn.active {
    background-color: #7c3aed !important;
    border-color: #a78bfa !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .training-day.race-day {
    background-color: #2e1065 !important;
    color: #e9d5ff !important;
}

html[data-theme="dark"] .training-type,
html[data-theme="dark"] .training-description,
html[data-theme="dark"] .program-description {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .goal-selector select {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .distance-table {
    background-color: #1e293b !important;
}

html[data-theme="dark"] body > .footer,
html[data-theme="dark"] .container > .footer {
    color: #94a3b8 !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .time-cell {
    color: #93c5fd !important;
}

html[data-theme="dark"] .tempo-cell {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .legend {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .legend-item {
    color: #e2e8f0 !important;
}

/* Skema-tabel: inline farver fra JS */
html[data-theme="dark"] [style*="background-color: #d4edda"],
html[data-theme="dark"] [style*="background-color:#d4edda"] {
    background-color: #14532d !important;
    color: #bbf7d0 !important;
}

html[data-theme="dark"] [style*="background-color: #c3e6cb"],
html[data-theme="dark"] [style*="background-color:#c3e6cb"] {
    background-color: #166534 !important;
    color: #bbf7d0 !important;
}

html[data-theme="dark"] [style*="background-color: #ffeaa7"],
html[data-theme="dark"] [style*="background-color:#ffeaa7"] {
    background-color: #854d0e !important;
    color: #fef3c7 !important;
}

html[data-theme="dark"] [style*="background-color: #f8d7da"],
html[data-theme="dark"] [style*="background-color:#f8d7da"] {
    background-color: #7f1d1d !important;
    color: #fecaca !important;
}

html[data-theme="dark"] [style*="background-color: #e8f4fc"],
html[data-theme="dark"] [style*="background-color:#e8f4fc"] {
    background-color: #1e3a5f !important;
    color: #e0f2fe !important;
}

html[data-theme="dark"] [style*="background-color: #f8f9fa"],
html[data-theme="dark"] [style*="background-color:#f8f9fa"],
html[data-theme="dark"] [style*="background-color: #f9f9f9"],
html[data-theme="dark"] [style*="background-color:#f9f9f9"],
html[data-theme="dark"] [style*="background-color: #f1f7fd"],
html[data-theme="dark"] [style*="background-color:#f1f7fd"],
html[data-theme="dark"] [style*="background-color: #f3e8ff"],
html[data-theme="dark"] [style*="background-color:#f3e8ff"],
html[data-theme="dark"] [style*="background-color: #f9f0ff"],
html[data-theme="dark"] [style*="background-color:#f9f0ff"] {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] [style*="color: #666"],
html[data-theme="dark"] [style*="color:#666"] {
    color: #cbd5e1 !important;
}

/* Hub: gradient-knapper må ikke blive lyse med hvid tekst */
html[data-theme="dark"][data-page="hub"] :is(
    .button-1,
    .button-2,
    .button-3,
    .button-4,
    .button-5,
    .button-6,
    .button-theory,
    .button-specific,
    .button-marathon,
    .button-halfmarathon,
    .button-10k,
    .button-5k,
    .button-begynder,
    .button-custom
) {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #ffffff !important;
}

html[data-theme="dark"][data-page="hub"] .info-box,
html[data-theme="dark"][data-page="hub"] .info-box :is(h3, p) {
    color: #f1f5f9 !important;
}

html[data-theme="dark"][data-page="hub"] .stat-item {
    background: rgba(30, 41, 59, 0.85) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"][data-page="hub"] .stat-value,
html[data-theme="dark"][data-page="hub"] .stat-label {
    color: #e2e8f0 !important;
}

html[data-theme="dark"][data-page="hub"] .feature-tag span {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"][data-page="hub"] .submenu-indicator {
    background-color: rgba(0, 0, 0, 0.55) !important;
    color: #ffffff !important;
}

/* —— Løbeteori-artikler (vo2max, energikilder, lobetaerskel, lobeteknik) —— */
html[data-theme="dark"] .coach-note {
    color: #e2e8f0 !important;
    border-left-color: #3b82f6 !important;
}

html[data-theme="dark"] .coach-note[style*="background-color: white"],
html[data-theme="dark"] .coach-note[style*="background-color:white"] {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .example-box {
    background-color: #1e3a5f !important;
    color: #e0f2fe !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .example-box h4 {
    color: #93c5fd !important;
}

html[data-theme="dark"] .intensity-section {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .fuel-box {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .fuel-box h4 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .scale-labels {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .distance-example {
    background-color: #1e3a5f !important;
    color: #bae6fd !important;
}

html[data-theme="dark"] .energy-source {
    color: #fca5a5 !important;
}

html[data-theme="dark"] body.portal-article .intro-card--muted,
html[data-theme="dark"] body.portal-article .highlight--muted {
    background-color: #1e293b !important;
    border-left-color: #475569 !important;
}

html[data-theme="dark"] body.portal-article .benefit-item,
html[data-theme="dark"] body.portal-article .sub-panel,
html[data-theme="dark"] body.portal-article .checklist-panel {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .intro-card :is(h2, h3, h4),
html[data-theme="dark"] .card :is(h3, h4) {
    color: #f8fafc !important;
    border-bottom-color: #475569 !important;
}

html[data-theme="dark"] .intro-card :is(p, li, span, em),
html[data-theme="dark"] .card :is(p, li, span, em),
html[data-theme="dark"] .intensity-section :is(p, li, span, em) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .intro-card strong,
html[data-theme="dark"] .card strong,
html[data-theme="dark"] .fuel-box strong,
html[data-theme="dark"] .intensity-section strong {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] [style*="background-color: white"] strong,
html[data-theme="dark"] [style*="background-color:white"] strong {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] [style*="color: #2c3e50"],
html[data-theme="dark"] [style*="color:#2c3e50"] {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] [style*="color: #555"],
html[data-theme="dark"] [style*="color:#555"] {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .zone-table tbody tr.zone-1 td { background-color: #14532d !important; color: #f1f5f9 !important; }
html[data-theme="dark"] .zone-table tbody tr.zone-2 td { background-color: #166534 !important; color: #f1f5f9 !important; }
html[data-theme="dark"] .zone-table tbody tr.zone-3 td { background-color: #854d0e !important; color: #fef3c7 !important; }
html[data-theme="dark"] .zone-table tbody tr.zone-4 td { background-color: #9f1239 !important; color: #fecaca !important; }
html[data-theme="dark"] .zone-table tbody tr.zone-5 td { background-color: #7f1d1d !important; color: #fecaca !important; }

html[data-theme="dark"] .zone-table tbody tr:hover td {
    filter: brightness(1.12);
}

html[data-theme="dark"] .container > h2 {
    color: #f8fafc !important;
    border-bottom-color: #3b82f6 !important;
}

html[data-theme="dark"] .portal-related {
    background: #1e293b !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .portal-related-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] body.portal-article .portal-related-title {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .portal-related-heading {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .portal-related-link {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .portal-related-link:hover {
    background: #334155 !important;
    border-color: #60a5fa !important;
}

html[data-theme="dark"] .portal-related-desc {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .rs-split-table th {
    background: #1e3a5f !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .rs-split-table td {
    border-top-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .rs-split-table tr:nth-child(even) td {
    background: #0f172a !important;
}

html[data-theme="dark"] .rs-split-table-wrap {
    border-color: #475569 !important;
}

html[data-theme="dark"] .rs-summary {
    background: #14532d !important;
    color: #dcfce7 !important;
}

@media (max-width: 640px) {
    html[data-theme="dark"] .rs-split-table tbody tr {
        background: #1e293b !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .rs-split-table td::before {
        color: #94a3b8 !important;
    }

    html[data-theme="dark"] .rs-split-table td:last-child {
        border-top-color: #475569 !important;
    }
}

html[data-theme="dark"] .rs-negative-hint {
    background: #422006 !important;
    color: #fef3c7 !important;
    border-left-color: #f59e0b !important;
}

/* Del-resultat */
.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.share-feedback {
    font-size: 0.875rem;
    font-weight: 600;
    color: #27ae60;
    min-height: 1.25rem;
}

.share-feedback.error {
    color: #e74c3c;
}

#shareBtn {
    flex: 0 1 auto;
    min-width: 140px;
}
