/* Dark surfaces for the frontend pages. Keep page-specific layout and maps intact. */
html[data-jgo-theme="dark"] #page-contents {
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(h1, h2, h3, h4, h5, h6, strong, th, label) {
  color: inherit;
}

html[data-jgo-theme="dark"] #page-contents :is(input, select, textarea, button) {
  color-scheme: dark;
}

html[data-jgo-theme="dark"] #page-contents :is(input, select, textarea)::placeholder {
  color: var(--jgo-muted);
  opacity: 1;
}

html[data-jgo-theme="dark"] #page-contents :is(input, select, textarea, button, a):focus-visible {
  outline-color: var(--jgo-accent);
}

html[data-jgo-theme="dark"] #page-contents :is(.table, .table-responsive, .list-group, .accordion-item, .accordion-button, .nav-tabs) {
  --bs-table-bg: var(--jgo-surface);
  --bs-table-color: var(--jgo-ink);
  --bs-table-border-color: var(--jgo-line);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.table-striped, .table-hover) {
  --bs-table-striped-bg: var(--jgo-surface-soft);
  --bs-table-hover-bg: var(--jgo-surface-raised);
  --bs-table-striped-color: var(--jgo-ink);
  --bs-table-hover-color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.accordion-button, .list-group-item, .dropdown-item) {
  background: var(--jgo-surface);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.accordion-button:not(.collapsed), .dropdown-item:hover, .list-group-item-action:hover) {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.btn-light, .btn-outline-secondary, .btn-outline-dark) {
  background: var(--jgo-surface-soft);
  border-color: var(--jgo-line);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.btn-light, .btn-outline-secondary, .btn-outline-dark):hover {
  background: var(--jgo-surface-raised);
  border-color: var(--jgo-accent);
  color: var(--jgo-ink);
}

/* Page roots share the same ink, muted text, borders, and pale-blue action. */
html[data-jgo-theme="dark"] #page-contents :is(.jflights, .jjournal, .jfree, .jhub, .jbf, .jfolio, .jfd, .jhome, .jnet, .jrotation, .jet-detail, .jgp, .jex-page, .jreport, .jpp, .jpx, .jstats, .jexam, .jtake, .jadventure, .jdir, .jhon, .jgd, .jbc, .jap, .jmr, .joc, .jsb, .jda, .jfr, .jmaintenance) {
  color: var(--jgo-ink);
  --ink: var(--jgo-ink);
  --muted: var(--jgo-muted);
  --line: var(--jgo-line);
  --paper: var(--jgo-surface);
  --mint: var(--jgo-surface-soft);
  --brand-soft: var(--jgo-surface-soft);
  --green: var(--jgo-accent);
  --focus: var(--jgo-accent);
  --jf-accent: var(--jgo-accent);
  --jf-ink: var(--jgo-ink);
  --jf-muted: var(--jgo-muted);
  --jf-line: var(--jgo-line);
  --jf-soft: var(--jgo-surface-soft);
  --jj-accent: var(--jgo-accent);
  --jj-ink: var(--jgo-ink);
  --jj-muted: var(--jgo-muted);
  --jj-line: var(--jgo-line);
  --jj-soft: var(--jgo-surface-soft);
  --fr-accent: var(--jgo-accent);
  --fr-ink: var(--jgo-ink);
  --fr-muted: var(--jgo-muted);
  --fr-line: var(--jgo-line);
  --fr-soft: var(--jgo-surface-soft);
  --hub-accent: var(--jgo-accent);
  --hub-ink: var(--jgo-ink);
  --hub-muted: var(--jgo-muted);
  --hub-line: var(--jgo-line);
  --hub-soft: var(--jgo-surface-soft);
  --bf-brand: var(--jgo-accent);
  --bf-ink: var(--jgo-ink);
  --bf-muted: var(--jgo-muted);
  --bf-line: var(--jgo-line);
  --fd-brand: var(--jgo-accent);
  --fd-ink: var(--jgo-ink);
  --fd-muted: var(--jgo-muted);
  --fd-line: var(--jgo-line);
  --jh-brand: var(--jgo-accent);
  --jh-ink: var(--jgo-ink);
  --jh-muted: var(--jgo-muted);
  --jh-line: var(--jgo-line);
  --jn-brand: var(--jgo-accent);
  --jn-ink: var(--jgo-ink);
  --jn-muted: var(--jgo-muted);
  --jn-line: var(--jgo-line);
  --jr-brand: var(--jgo-accent);
  --jr-line: var(--jgo-line);
  --jr-muted: var(--jgo-muted);
  --jet-accent: var(--jgo-accent);
  --jet-ink: var(--jgo-ink);
  --jet-muted: var(--jgo-muted);
  --jet-line: var(--jgo-line);
}

/* Explore cards use the adventure variables for their text and links. */
html[data-jgo-theme="dark"] #page-contents .jex-page {
  --ja-ink: var(--jgo-ink);
  --ja-muted: var(--jgo-muted);
  --ja-brand: var(--jgo-accent);
  --ja-line: var(--jgo-line);
}

/* Fleet explorer, airline statistics, and operating hub directory. */
html[data-jgo-theme="dark"] #page-contents .jadventure {
  --ja-ink: var(--jgo-ink);
  --ja-muted: var(--jgo-muted);
  --ja-brand: var(--jgo-accent);
  --ja-line: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jstats {
  --js-ink: var(--jgo-ink);
  --js-muted: var(--jgo-muted);
  --js-brand: var(--jgo-accent);
  --js-line: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jdir {
  --jd-ink: var(--jgo-ink);
  --jd-muted: var(--jgo-muted);
  --jd-blue: var(--jgo-accent);
  --jd-red: #f59aa8;
  --jd-line: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jair-nav {
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jair-nav :is(.jair-nav-label span, .jair-nav-links a) { color: var(--jgo-muted); }
html[data-jgo-theme="dark"] #page-contents .jair-nav-links :is(a:hover, a[aria-current="page"]) { color: var(--jgo-ink); }

html[data-jgo-theme="dark"] #page-contents :is(.ja-plane, .js-infrastructure, .js-networks article, .js-empty) {
  background: var(--jgo-surface);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.ja-plane, .js-networks article, .jstats .card):hover {
  background: var(--jgo-surface-raised);
  border-color: #36527f;
}

html[data-jgo-theme="dark"] #page-contents .jstats .card-header,
html[data-jgo-theme="dark"] #page-contents .jstats .card-footer {
  background: var(--jgo-surface-soft) !important;
  color: var(--jgo-ink);
  border-color: var(--jgo-line) !important;
}

html[data-jgo-theme="dark"] #page-contents .js-periods button:not(.active) {
  background: var(--jgo-surface-soft);
  border-color: var(--jgo-line);
  color: var(--jgo-muted);
}

html[data-jgo-theme="dark"] #page-contents .js-periods button.active {
  background: var(--jgo-action);
  border-color: var(--jgo-action);
  color: var(--jgo-page);
}

html[data-jgo-theme="dark"] #page-contents .jdir-hero-hubs {
  background: linear-gradient(112deg, #040b22 0%, #0d1c42 70%, #22396f 100%);
  color: #f3f7ff;
}

html[data-jgo-theme="dark"] #page-contents .jdir-hero-hubs :is(h1, p, strong, span) { color: inherit; }

html[data-jgo-theme="dark"] #page-contents .jdir-fuel {
  background: var(--jgo-surface);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jdir-fuel-calculator, .jdir-location, .jdir-search, .jdir-airline-id) {
  background: var(--jgo-surface-soft);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jdir-fuel-calculator input {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jdir-location dl div { border-color: var(--jgo-line); }

html[data-jgo-theme="dark"] #page-contents :is(.jdir-airline, .jdir-hub, .jdir-row-link):hover {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
}

/* Flight detail: badges, actions, weather tabs, and reservation panels. */
html[data-jgo-theme="dark"] #page-contents .jfd {
  --fd-brand: var(--jgo-accent);
  --fd-ink: var(--jgo-ink);
  --fd-muted: var(--jgo-muted);
  --fd-line: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jfd-status, .jfd-label) {
  background: var(--jgo-surface-raised);
  color: var(--jgo-accent);
}

html[data-jgo-theme="dark"] #page-contents :is(.jfd-route-text, .jfd-empty, .jfd-aircraft-list > a) {
  background: var(--jgo-surface-soft);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jfd-aircraft-list > a:hover {
  background: var(--jgo-surface-raised);
}

html[data-jgo-theme="dark"] #page-contents .jfd-weather-tabs button:not(.active) {
  background: var(--jgo-surface-soft);
  color: var(--jgo-muted);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jfd-weather-tabs button.active {
  background: var(--jgo-action);
  border-color: var(--jgo-action);
  color: var(--jgo-page);
}

html[data-jgo-theme="dark"] #page-contents :is(.jfd-section-head button, .jfd-secondary) {
  background: var(--jgo-surface-raised);
  border-color: var(--jgo-line);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.jfd-section-head button, .jfd-secondary):hover {
  background: var(--jgo-surface-soft);
  border-color: var(--jgo-accent);
  color: var(--jgo-ink);
}

/* Logbook: chart tracks and ledger controls share the page surfaces. */
html[data-jgo-theme="dark"] #page-contents .jfolio {
  --jf-brand: var(--jgo-accent);
  --jf-ink: var(--jgo-ink);
  --jf-muted: var(--jgo-muted);
  --jf-line: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jf-bar-track, .jf-type meter) {
  background: var(--jgo-surface-soft);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jf-type meter::-webkit-meter-bar {
  background: var(--jgo-surface-soft);
}

html[data-jgo-theme="dark"] #page-contents .jf-landing-record:hover {
  background: var(--jgo-surface-raised);
  border-color: var(--jgo-accent);
}

html[data-jgo-theme="dark"] #page-contents .jmf-nav {
  background: var(--jgo-surface);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
  box-shadow: none;
}

html[data-jgo-theme="dark"] #page-contents .jmf-nav :is(.jmf-nav-identity span, .jmf-nav-tabs a) {
  color: var(--jgo-muted);
}

html[data-jgo-theme="dark"] #page-contents .jmf-nav-tabs a:hover {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents .jmf-nav-tabs a[aria-current="page"] {
  background: var(--jgo-action);
  color: var(--jgo-page);
}

html[data-jgo-theme="dark"] #page-contents .jda-maintenance {
  background: var(--jgo-surface);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents .jda-maintenance p { color: var(--jgo-muted); }
html[data-jgo-theme="dark"] #page-contents .jda-maintenance :is(th, td) { border-color: var(--jgo-line); }
html[data-jgo-theme="dark"] #page-contents .jda-maintenance th { background: var(--jgo-surface-soft); }
html[data-jgo-theme="dark"] #page-contents .jda-status { background: #153a35; color: #b5ebd7; }
html[data-jgo-theme="dark"] #page-contents :is(.jda-status.is-blocked, .jda-notice) { background: #45351d; color: #f7d49a; }

html[data-jgo-theme="dark"] #page-contents :is(.page-link, .select2-selection--single) {
  background: var(--jgo-surface-soft) !important;
  border-color: var(--jgo-line) !important;
  color: var(--jgo-ink) !important;
}

html[data-jgo-theme="dark"] #page-contents .page-item.active .page-link {
  background: var(--jgo-action) !important;
  border-color: var(--jgo-action) !important;
  color: var(--jgo-page) !important;
}

/* Primary panels and cards. These classes were hard-coded to white in their own stylesheets. */
html[data-jgo-theme="dark"] #page-contents :is(
  .jf-explorer, .jf-flight-list, .jf-season, .jf-empty,
  .jgp-explorer, .jgp-collection, .jgp-folio, .jgp-favourites,
  .jj-entry, .jj-empty, .jfree-form, .jfree-results, .jfree-recent-list,
  .jh-empty, .jh-admin > div, .jc-contract, .jcrew-listing, .je-event,
  .jbf-section, .jf-cover, .jf-segments, .jf-month-chart, .jf-landing-record, .jf-filters, .jf-table-scroll,
  .jfd-subfleet, .jfd-notes, .jfd-dispatch, .jfd-empty,
  .jh-network-explorer, .jh-arrivals, .jh-new-crew,
  .jn-booking, .jn-empty, .jn-base, .jn-panel, .jn-pilot,
  .jr-picker, .jr-active, .jr-options article,
  .jex-resume-item, .jex-activity-list > a, .jex-filters,
  .jr-cover, .jr-sheet, .jr-profile, .jr-cabin, .jr-details, .jr-replay,
  .jpp-panel, .jpp-detail, .jpx-ticket, .jpx-narrative > div, .jpx-leaders,
  .jexam-state, .jexam-empty, .jtake-question, .jtake-side-inner,
  .ja-filter-form, .ja-flight, .ja-opportunity, .ja-empty, .ja-quicklinks,
  .jdir-empty, .jdir-fuel-calculator, .jhon-card, .jhon-empty,
  .jgd-collection, .jbc-panel, .jbc-runway,
  .jmr-pulse, .jmr-section, .jmr-aside-panel,
  .joc-turn-card, .joc-empty, .joc-panel, .joc-event-card,
  .jsb-aircraft-choice, .jsb-choice-summary, .jsb-review, .jsb-option-group,
  .jda-empty, .jpc-commitment
) {
  background: var(--jgo-surface);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

/* Recessed controls and rows stay distinct from the darker card plane. */
html[data-jgo-theme="dark"] #page-contents :is(
  .jf-search, .jf-list-tools > label:first-child, .jf-season-strip, .jf-season[open] summary,
  .jgp-country-inspector, .jgp-stamp:not(.is-visited), .jgp-stamp .jgp-stamp-state,
  .jj-search, .jfree-form input:not([type=hidden]), .jfree-form select, .jfree-form textarea,
  .jh-tools > label:first-child, .jcrew form.row select, .jcrew form.row input,
  .jbf-route-text, .jfolio th, .jf-filters input, .jf-filters select,
  .jfd-aircraft-list > a, .jfd-weather-tabs button,
  .jn-tools label, .jn-view-switch, .jn-table th,
  .jex-filters select, .jr-log-search input,
  .jpp-key-control code, .jpp-tab-content .bg-light,
  .jtake-option, .ja-filter-form input:not([type=checkbox]), .ja-filter-form select,
  .jdir-search, .jdir-fuel-calculator input,
  .jbc-search input, .jbc-raw code,
  .joc-toolbar label, .joc-state,
  .jsb-choice-tools label, .jsb .form-control:disabled,
  .jda-sector__step span
) {
  background: var(--jgo-surface-soft);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(
  .jf-destination, .jf-picker-tools select, .jf-list-tools select,
  .jf-map-toolbar > span, .jf-map-toolbar button, .jf-filter-button,
  .jgp-control, .jgp-sort select, .jgp-destination,
  .jgp-search, .jgp-rare > a,
  .jj-toolbar select, .jj-toolbar button,
  .jfree-results button, .jfree-modes button,
  .jh-tools select, .jh-tools > button,
  .jf-section-head > button, .jfd-section-head button, .jfd-secondary,
  .jrotation button, .jr-picker select,
  .jex-jump a, .jex-carousel-nav button,
  .jpp-actions a, .jpp-account-actions a, .jpp-account-actions button,
  .jhon-search, .ja-pills a, .ja-form-actions button.ja-secondary,
  .jgd-jump a, .jbc-runway-filter a,
  .jsb-section-nav a
) {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jf-destination, .jex-activity-list > a, .jfd-aircraft-list > a, .jn-booking):hover {
  background: var(--jgo-surface-raised);
}

html[data-jgo-theme="dark"] #page-contents :is(.jf-season-table, .jf-season-table th, .jf-season-table td, .jfolio table, .jfolio th, .jfolio td, .jn-table, .jn-table th, .jr-log-table, .jr-log-table thead) {
  background-color: var(--jgo-surface);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jf-season-table tbody tr, .jfolio tbody tr, .jn-table tbody tr):hover {
  background: var(--jgo-surface-raised);
}

html[data-jgo-theme="dark"] #page-contents :is(.jgp-stamp:not(.is-visited), .jgp-stamp:not(.is-visited) strong) {
  color: var(--jgo-muted);
}

html[data-jgo-theme="dark"] #page-contents .jgp-stamp.is-visited {
  background: var(--jgo-surface-raised);
  border-color: var(--jgo-accent);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents .jgp-stamp.is-visited strong { color: var(--jgo-ink); }
html[data-jgo-theme="dark"] #page-contents .jgp-stamp.is-visited .jgp-flag-frame { background: #f4f7fb; }

/* Brand panels remain deep blue so white labels retain strong contrast. */
html[data-jgo-theme="dark"] #page-contents :is(
  .jc-welcome, .je-welcome, .jcrew-welcome,
  .jet-hero, .jbf-route, .jfd-sector,
  .jn-base-header, .jn-airline-header, .jn-map-toolbar,
  .jgp-folio-cover, .js-highlights
) {
  background: #0d1c42;
  color: #f3f7ff;
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jc-welcome, .je-welcome, .jcrew-welcome, .jet-hero, .jgp-folio-cover, .js-highlights) :is(h1, h2, h3, p, small, strong, span) {
  color: inherit;
}

html[data-jgo-theme="dark"] #page-contents :is(.jet-join, .jet-personal) {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.jet-join p, .jet-closed, .jet-personal-bottom, .jet-leg h3, .jet-leg-facts, .jet-utility a) {
  color: var(--jgo-muted);
}

html[data-jgo-theme="dark"] #page-contents :is(.jet-leg-number, .jet-avatar) {
  background: var(--jgo-surface-raised);
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.jet-join button, .jet-leg-action button) {
  background: var(--jgo-action);
  color: var(--jgo-page);
}

html[data-jgo-theme="dark"] #page-contents :is(.jet-join button, .jet-leg-action button):hover {
  background: var(--jgo-action-hover);
}

/* Filled action controls use navy text on the pale-blue brand color. */
html[data-jgo-theme="dark"] #page-contents :is(
  .jh-button, .jh-join, .jfree-dispatch button,
  .jj-empty a, .jj-empty button, .jfolio .jf-filters button,
  .jfd-primary, .jn-button, .jrotation .jr-primary,
  .jsb-primary, .jtake-submit button, .jex-filters button,
  .ja-form-actions button:not(.ja-secondary), .jpp-actions .jpp-action-primary,
  .joc-toolbar button, .jo-primary
) {
  background: var(--jgo-action);
  border-color: var(--jgo-action);
  color: var(--jgo-page);
}

html[data-jgo-theme="dark"] #page-contents :is(
  .jh-button, .jh-join, .jfree-dispatch button,
  .jj-empty a, .jj-empty button, .jfolio .jf-filters button,
  .jfd-primary, .jn-button, .jrotation .jr-primary,
  .jsb-primary, .jtake-submit button, .jex-filters button,
  .ja-form-actions button:not(.ja-secondary), .jpp-actions .jpp-action-primary,
  .joc-toolbar button, .jo-primary
):hover {
  background: var(--jgo-action-hover);
  border-color: var(--jgo-action-hover);
  color: var(--jgo-page);
}

/* Original layout CSS gives some section headings fixed dark text. */
html[data-jgo-theme="dark"] #page-contents :is(.jflights, .jjournal, .jfree, .jhub, .jbf, .jfolio, .jfd, .jhome, .jnet, .jrotation, .jet-detail, .jgp, .jex-page, .jreport) :is(h1, h2, h3, h4) {
  color: var(--jgo-ink);
}

html[data-jgo-theme="dark"] #page-contents :is(.jflights, .jjournal, .jfree, .jhub, .jbf, .jfolio, .jfd, .jhome, .jnet, .jrotation, .jet-detail, .jgp, .jex-page, .jreport) :is(p, small, time) {
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(.jf-season-routes span, .jgp-control, .jfree-modes button, .jcrew #cockpitTabs .nav-link, .jex-filters select) {
  background: var(--jgo-surface-soft);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}

html[data-jgo-theme="dark"] #page-contents :is(
  .jf-map-toolbar button[aria-pressed="true"],
  .jj-toolbar button[aria-pressed="true"],
  .jf-segments [aria-pressed="true"],
  .ja-pills .is-active,
  .jfd-weather-tabs button.active,
  .jn-tabs button.active, .jn-view-switch [aria-pressed="true"],
  .jex-carousel-nav button:hover,
  .jgp-map-pin
) {
  background: var(--jgo-action);
  border-color: var(--jgo-action);
  color: var(--jgo-page);
}

@media (prefers-reduced-motion: no-preference) {
  html[data-jgo-theme="dark"] #page-contents :is(.jf-destination, .jgp-control, .jfree-modes button, .jex-jump a) {
    transition: background-color .18s ease, border-color .18s ease;
  }
}

/* Monthly operations balance and the flight-detail daylight widget. */
html[data-jgo-theme="dark"] #page-contents .jgo-funds-summary .bg-light,
html[data-jgo-theme="dark"] #page-contents .jgo-solar-card .bg-light {
  background: var(--jgo-surface-raised) !important;
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jgo-funds-summary .bg-light :is(strong, small, span),
html[data-jgo-theme="dark"] #page-contents .jgo-solar-card .bg-light .text-dark {
  color: var(--jgo-ink) !important;
}
html[data-jgo-theme="dark"] #page-contents .jgo-funds-summary .bg-light .text-secondary,
html[data-jgo-theme="dark"] #page-contents .jgo-solar-card .bg-light .text-secondary {
  color: var(--jgo-muted) !important;
}
html[data-jgo-theme="dark"] #page-contents .jgo-solar-card .card-body.bg-white {
  background: var(--jgo-surface) !important;
}

/* SimBrief aircraft chooser and dispatch form should share dark surfaces. */
html[data-jgo-theme="dark"] #page-contents .jsb {
  --sb-ink: var(--jgo-ink);
  --sb-muted: var(--jgo-muted);
  --sb-line: var(--jgo-line);
  --sb-brand: var(--jgo-accent);
}
html[data-jgo-theme="dark"] #page-contents .jsb-aircraft-choice input:checked + label {
  background: var(--jgo-surface-raised) !important;
  border-color: var(--jgo-accent);
  color: var(--jgo-ink);
}
html[data-jgo-theme="dark"] #page-contents .jsb-aircraft-choice input:checked + label :is(strong, h2, dt, dd, header span) {
  color: var(--jgo-ink);
}
html[data-jgo-theme="dark"] #page-contents .jsb-aircraft-choice input:checked + label dt { color: var(--jgo-muted); }
html[data-jgo-theme="dark"] #page-contents .jsb :is(.jsb-panel, .jsb-options-column > .card, .jsb-option-group, .jsb-review, .jsb-choice-summary) {
  background: var(--jgo-surface) !important;
  color: var(--jgo-ink);
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jsb .card-header {
  background: var(--jgo-surface-soft) !important;
  color: var(--jgo-ink) !important;
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jsb :is(.form-control, .form-select) {
  background: var(--jgo-surface-soft) !important;
  color: var(--jgo-ink) !important;
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jsb :is(.form-control, .form-select):disabled {
  background: var(--jgo-surface-raised) !important;
  color: var(--jgo-ink) !important;
  opacity: 1;
}
html[data-jgo-theme="dark"] #page-contents .jsb :is(.form-control, .form-select)::placeholder { color: var(--jgo-muted) !important; }
html[data-jgo-theme="dark"] #page-contents .jsb #specs > div > div,
html[data-jgo-theme="dark"] #page-contents .jsb-route-fields > [class*="col-"] > .border,
html[data-jgo-theme="dark"] #page-contents .jsb-timing-fields > [class*="col-"] > .border,
html[data-jgo-theme="dark"] #page-contents .jsb [data-sb-dispatch-feedback] {
  background: var(--jgo-surface-raised) !important;
  border-color: var(--jgo-line) !important;
  color: var(--jgo-ink);
}
html[data-jgo-theme="dark"] #page-contents .jsb #fl { background: var(--jgo-surface-raised) !important; }
html[data-jgo-theme="dark"] #page-contents .jsb :is(.jsb-cargo-refresh, .jsb-manifest-table th, .jsb-weather-notams .card-footer) {
  background: var(--jgo-surface-soft) !important;
  color: var(--jgo-ink) !important;
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jsb .jsb-manifest-table :is(table, td) {
  background: var(--jgo-surface) !important;
  color: var(--jgo-ink);
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jsb .jsb-manifest-table tr:nth-child(even) td { background: var(--jgo-surface-soft) !important; }
html[data-jgo-theme="dark"] #page-contents .jsb :is(.badge.bg-secondary, #jsb-payload .badge) {
  background: var(--jgo-surface-raised) !important;
  color: var(--jgo-ink) !important;
}

/* Keep generated briefing references and route controls legible on dark cards. */
html[data-jgo-theme="dark"] #page-contents .jbf {
  --bf-ink: var(--jgo-ink);
  --bf-muted: var(--jgo-muted);
  --bf-line: var(--jgo-line);
  --bf-brand: var(--jgo-accent);
}
html[data-jgo-theme="dark"] #page-contents .jbf :is(.jbf-essentials, .jbf-section, .jbf-documents > .card) {
  background: var(--jgo-surface) !important;
  color: var(--jgo-ink);
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jbf :is(.jbf-essentials > div, .jbf-station-grid, .jbf-station-column, .jbf-navlog th, .jbf-navlog td) {
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jbf :is(.jbf-essentials strong, .jbf-station-head strong, .jbf-filed-token strong, .jbf-navlog tbody th, .jbf-procedure-status strong) {
  color: var(--jgo-ink) !important;
}
html[data-jgo-theme="dark"] #page-contents .jbf :is(.jbf-essentials span, .jbf-essentials small, .jbf-station-head span, .jbf-runway-facts, .jbf-procedure-disclaimer, .jbf-navlog tbody td, .jbf-map-legend small) {
  color: var(--jgo-muted) !important;
}
html[data-jgo-theme="dark"] #page-contents .jbf :is(.jbf-cycle, .jbf-filed-token, .jbf-procedure-list span, .jbf-procedure-status span, .jbf-navlog thead th, .jbf-documents .card-footer, .jbf-route-text) {
  background: var(--jgo-surface-raised) !important;
  color: var(--jgo-ink) !important;
  border-color: var(--jgo-line) !important;
}
html[data-jgo-theme="dark"] #page-contents .jbf :is(.jbf-map-toolbar button, .jbf-map-legend button, .jbf-format-shortcuts a) {
  background: var(--jgo-surface-soft);
  color: var(--jgo-ink);
  border-color: var(--jgo-line);
}
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-map-toolbar button[aria-pressed="true"] {
  background: var(--jgo-action);
  color: var(--jgo-page);
  border-color: var(--jgo-action);
}
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-procedure-map { background: var(--jgo-surface-raised); }
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-legend-line.is-route { background: var(--jgo-accent); }
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-cycle-warning,
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-plan-age { background: #342716; color: #f8d69c; }
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-section .jbf-route-text { color: var(--jgo-ink) !important; }
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-documents .card-body .text-muted,
html[data-jgo-theme="dark"] #page-contents .jbf .jbf-side .jbf-note { color: var(--jgo-muted) !important; }
