/* LogSpec dark appearance. The light palette remains the default. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #0b1b2b;
  --blue: #65b8ff;
  --text: #e7eef7;
  --muted: #a1b3c8;
  --line: #34485d;
  --green: #52d5a8;
  --amber: #f3c56e;
  --theme-bg: #0b1521;
  --theme-surface: #142337;
  --theme-raised: #1a2b40;
  --theme-input: #0f1c2b;
  --theme-border: #344a60;
  --theme-copy: #d8e3ef;
  --theme-subtle: #a2b4c8;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #0b1521;
  color: #e7eef7;
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background-image: radial-gradient(circle at 85% -10%, rgba(68, 140, 196, .08), transparent 38%);
}

html[data-theme="dark"] .suite-shell,
html[data-theme="dark"] #main,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .workspace-main {
  color: #e7eef7;
  background: transparent;
}

html[data-theme="dark"] #suite-header,
html[data-theme="dark"] #suite-footer {
  color: #e7eef7;
  background: rgba(13, 27, 42, .96);
  border-color: #2d4156;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .checklist-card,
html[data-theme="dark"] .currency-card,
html[data-theme="dark"] .editor-panel,
html[data-theme="dark"] .flight-details-card,
html[data-theme="dark"] .goal-card,
html[data-theme="dark"] .knowledge-search-dialog,
html[data-theme="dark"] .leidos-plan-panel,
html[data-theme="dark"] .manage-card,
html[data-theme="dark"] .map-card,
html[data-theme="dark"] .notam-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .privacy-card,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .source-card,
html[data-theme="dark"] .transfer-card,
html[data-theme="dark"] .validation-card,
html[data-theme="dark"] .legal-index,
html[data-theme="dark"] .legal-article,
html[data-theme="dark"] .settings-sheet,
html[data-theme="dark"] .dialog-body,
html[data-theme="dark"] .suite-demo-panel,
html[data-theme="dark"] .workspace-guidance,
html[data-theme="dark"] .workspace-card,
html[data-theme="dark"] .source-confidence,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .data-state {
  color: #e7eef7;
  background-color: #142337;
  background-image: none;
  border-color: #344a60;
}

html[data-theme="dark"] .settings-sheet {
  background: linear-gradient(120deg, #142337, #101e2e);
  border-color: #344a60;
}

html[data-theme="dark"] .knowledge-search-head,
html[data-theme="dark"] .knowledge-search-shell,
html[data-theme="dark"] .knowledge-search-results,
html[data-theme="dark"] .knowledge-search-result,
html[data-theme="dark"] .knowledge-result,
html[data-theme="dark"] .knowledge-search-categories,
html[data-theme="dark"] .knowledge-search-meta,
html[data-theme="dark"] .knowledge-parent-line,
html[data-theme="dark"] .knowledge-refine-form,
html[data-theme="dark"] .knowledge-query-form,
html[data-theme="dark"] .knowledge-suggestions,
html[data-theme="dark"] .knowledge-search-history {
  color: #e7eef7;
  background-color: #142337;
  border-color: #344a60;
}

html[data-theme="dark"] .knowledge-search-footer {
  color: #a2b4c8;
  background-color: #0f1c2b;
  border-color: #344a60;
}

html[data-theme="dark"] .knowledge-search-history :is(p, span, small, time),
html[data-theme="dark"] .knowledge-search-history :is(h2, button),
html[data-theme="dark"] .knowledge-history-item {
  color: #c8d8e8;
}

html[data-theme="dark"] .knowledge-history-item {
  border-color: #344a60;
}

html[data-theme="dark"] .progress-overlay-card,
html[data-theme="dark"] .editor-dialog,
html[data-theme="dark"] .editor-dialog-compact,
html[data-theme="dark"] .report-dialog,
html[data-theme="dark"] dialog {
  color: #e7eef7;
  background: #142337;
  border-color: #40566e;
}

html[data-theme="dark"] dialog::backdrop {
  background: rgba(2, 7, 13, .78);
}

html[data-theme="dark"] .card-head,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .table-card-body,
html[data-theme="dark"] .editor-panel,
html[data-theme="dark"] .editor-section,
html[data-theme="dark"] .settings-layout,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .workspace-section,
html[data-theme="dark"] .route-panel,
html[data-theme="dark"] .trip-panel,
html[data-theme="dark"] .flight-panel,
html[data-theme="dark"] .section-panel {
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell :is(h1, h2, h3, h4, p, span, label, small, strong, li, th, td, dt, dd, legend, summary, .muted, .metric-label, .field-help, .form-help, .page-intro, .workspace-breadcrumb) {
  color: #d8e3ef;
}

html[data-theme="dark"] .suite-shell :is(h1, h2, h3, h4, strong, .metric-value, .workspace-breadcrumb strong) {
  color: #f1f6fb;
}

html[data-theme="dark"] .suite-shell a:not(.nav-item),
html[data-theme="dark"] .suite-shell .text-button,
html[data-theme="dark"] .suite-shell .blue,
html[data-theme="dark"] .suite-shell .page-title-icon > .icon {
  color: #72bdff;
}

html[data-theme="dark"] .suite-shell .green,
html[data-theme="dark"] .suite-shell .status-success,
html[data-theme="dark"] .suite-shell .success,
html[data-theme="dark"] .suite-shell .check-mark {
  color: #64ddb3;
}

html[data-theme="dark"] .suite-shell .amber,
html[data-theme="dark"] .suite-shell .status-warning,
html[data-theme="dark"] .suite-shell .warning {
  color: #f1c56e;
}

html[data-theme="dark"] .suite-shell .red,
html[data-theme="dark"] .suite-shell .status-error,
html[data-theme="dark"] .suite-shell .error {
  color: #ff9894;
}

html[data-theme="dark"] .suite-shell :is(input, select, textarea),
html[data-theme="dark"] .knowledge-search-dialog :is(input, select, textarea) {
  color: #e7eef7;
  background-color: #0f1c2b;
  border-color: #40566e;
}

html[data-theme="dark"] .suite-shell input::placeholder,
html[data-theme="dark"] .suite-shell textarea::placeholder,
html[data-theme="dark"] .knowledge-search-dialog input::placeholder {
  color: #93a7bc;
  opacity: 1;
}

html[data-theme="dark"] .suite-shell :is(input, select, textarea):focus,
html[data-theme="dark"] .knowledge-search-dialog :is(input, select, textarea):focus {
  border-color: #5aabeb;
  box-shadow: 0 0 0 3px rgba(73, 161, 230, .2);
}

html[data-theme="dark"] .suite-shell :is(.button, button:not(.nav-item)),
html[data-theme="dark"] .knowledge-search-dialog button:not(.knowledge-primary) {
  color: #dce8f4;
  background: #1b2d42;
  border-color: #435b73;
}

html[data-theme="dark"] .suite-shell :is(.button:hover, button:not(.nav-item):hover),
html[data-theme="dark"] .knowledge-search-dialog button:not(.knowledge-primary):hover {
  color: #f3f8fc;
  background: #263c54;
  border-color: #6384a4;
}

html[data-theme="dark"] .suite-shell .button.primary,
html[data-theme="dark"] .suite-shell .primary-action,
html[data-theme="dark"] .suite-shell .primary-page-button,
html[data-theme="dark"] .knowledge-search-dialog .knowledge-primary {
  color: #fff;
  background: linear-gradient(120deg, #087dcf, #0872c7);
  border-color: #1888db;
}

html[data-theme="dark"] .suite-shell .button.danger,
html[data-theme="dark"] .suite-shell .danger {
  color: #ffaaa5;
  background: #3b2028;
  border-color: #76404a;
}

html[data-theme="dark"] .suite-shell :is(table, .table-wrap, .table-card-body) {
  color: #d8e3ef;
  background-color: #142337;
}

html[data-theme="dark"] .suite-shell .table-card-body {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

html[data-theme="dark"] .suite-shell th {
  color: #c5d6e8;
  background: #1c2d41;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell td {
  color: #d9e5f2;
  border-color: #2f4359;
}

html[data-theme="dark"] .suite-shell tbody tr:nth-child(odd),
html[data-theme="dark"] .suite-shell tbody tr:nth-child(odd) td {
  background-color: #142337;
}

html[data-theme="dark"] .suite-shell tbody tr:nth-child(even),
html[data-theme="dark"] .suite-shell tbody tr:nth-child(even) td {
  background-color: #172a3e;
}

html[data-theme="dark"] .suite-shell tbody tr:hover,
html[data-theme="dark"] .suite-shell tbody tr:hover td,
html[data-theme="dark"] .suite-shell tbody tr.selected,
html[data-theme="dark"] .suite-shell tbody tr.selected td {
  background-color: #203b55;
}

html[data-theme="dark"] .suite-shell :is(hr, .subtle-rule, .workspace-divider) {
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell :is(.badge, .tag, .pill, .chip) {
  color: #c8d8e8;
  background: #21364d;
  border-color: #3a536c;
}

html[data-theme="dark"] .suite-shell .badge.blue,
html[data-theme="dark"] .suite-shell .badge.pill.blue {
  color: #8bcaff;
  background: #173650;
}

html[data-theme="dark"] .suite-shell .badge.green,
html[data-theme="dark"] .suite-shell .badge.pill.green {
  color: #7ce0bb;
  background: #12392f;
}

html[data-theme="dark"] .suite-shell .badge.amber,
html[data-theme="dark"] .suite-shell .badge.pill.amber {
  color: #f6d58d;
  background: #3a2e19;
}

html[data-theme="dark"] .suite-shell .badge.red,
html[data-theme="dark"] .suite-shell .badge.pill.red {
  color: #ffaaa5;
  background: #3c2028;
}

html[data-theme="dark"] .suite-shell :is(.sample-bar, .source-confidence, .trip-workflow, .trip-strip, .trip-summary, .metric, .metric-card, .status-card, .weather-panel, .weather-card, .connection-card, .connection-status, .map-panel, .route-panel, .flight-plan-panel, .leidos-flight-fields, .leidos-icao-fields, .leidos-domestic-fields, .leidos-code-group) {
  color: #d9e5f2;
  background-color: #172a3f;
  background-image: none;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell :is(.sample-bar, .form-help, .page-help, .callout, .notice, .info-banner, .empty-state, .source-confidence) {
  color: #c5d6e8;
}

html[data-theme="dark"] .suite-shell :is(.warning-banner, .amber-notice, .source-confidence.amber, .leidos-test-banner, .readiness-review-notice) {
  color: #f5d58f;
  background-color: #342a1a;
  border-color: #8a692c;
}

html[data-theme="dark"] .suite-shell :is(.error-banner, .danger-notice, .source-confidence.red) {
  color: #ffb3ad;
  background-color: #3a2228;
  border-color: #82414a;
}

html[data-theme="dark"] .suite-shell :is(.success-banner, .source-confidence.green) {
  color: #8ce5c3;
  background-color: #15372f;
  border-color: #2d7662;
}

html[data-theme="dark"] .suite-shell .mode-switch,
html[data-theme="dark"] .suite-shell .mode-switch a.selected {
  background-color: #223a53;
  border-color: #45617c;
}

html[data-theme="dark"] .suite-shell .theme-toggle {
  border: 1px solid #6686a34a;
  background: #ffffff08;
  color: #d7e7f5;
  text-align: left;
}

html[data-theme="dark"] .suite-shell .theme-toggle:hover {
  background: #ffffff16;
}

html[data-theme="dark"] .suite-shell .auth-status-pill,
html[data-theme="dark"] .suite-shell .workspace-status {
  color: #d7e7f5;
  background: #1c3045;
  border-color: #3a536c;
}

html[data-theme="dark"] .suite-shell .legal-index a.active {
  color: #e7eef7;
  background: #1b2d42;
  border-color: #435b73;
}

html[data-theme="dark"] .suite-shell .plan-label {
  color: #a8d5ff;
  background: #173650;
  border-color: #345a79;
}

html[data-theme="dark"] .suite-shell .current-plan-icon {
  color: #72dfba;
  background: #12392f;
  border-color: #2d7662;
}

html[data-theme="dark"] .suite-shell .current-plan #current-plan {
  color: #d8e3ef;
}

html[data-theme="dark"] .suite-shell .private-overview .metric,
html[data-theme="dark"] .suite-shell .duty-strip,
html[data-theme="dark"] .suite-shell .trip-strip > div,
html[data-theme="dark"] .suite-shell .duty-item {
  background-color: #162a3e;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .progress-overlay-card {
  background: #142337;
  color: #e7eef7;
}

html[data-theme="dark"] .suite-shell :is(.auth-page-brand img, .brand img) {
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] *,
  html[data-theme="dark"] *::before,
  html[data-theme="dark"] *::after {
    scroll-behavior: auto;
  }
}

html[data-theme="dark"] dialog :is(h1, h2, h3, h4, p, span, label, small, strong, li, th, td, dt, dd, legend, summary) {
  color: #d8e3ef;
}

html[data-theme="dark"] dialog :is(input, select, textarea) {
  color: #e7eef7;
  background-color: #0f1c2b;
  border-color: #40566e;
}

html[data-theme="dark"] #suite-nav .theme-toggle {
  background: #ffffff08;
  border: 1px solid #6686a34a;
  color: #d7e7f5;
}

html[data-theme="dark"] #suite-nav .theme-toggle:hover {
  background: #ffffff16;
}

html[data-theme="dark"] .suite-shell :is(.leidos-messages, .form-error, .field-error) {
  color: #ffaaa5;
}

/* Flight planning has a few legacy forms with page-scoped white surfaces. */
html[data-theme="dark"] body[data-page="flights"] #main #plan-form {
  color: #e7eef7;
  background: #142337;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(input, select, textarea) {
  color: #e7eef7;
  background: #0f1c2b;
  border-color: #40566e;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(.leidos-flight-fields, .leidos-icao-fields, .leidos-domestic-fields) {
  color: #d8e3ef;
  background: #142337;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form .leidos-code-group,
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .field.checkbox,
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .checklist li {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(.form-help, .notice:not(.error), .leidos-artcc, .route-summary) {
  color: #c5d6e8;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form .leidos-flight-fields > summary span {
  color: #d7e7f5;
  background: #1c3045;
  border-color: #3a536c;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form .leidos-code-group :is(legend, label, small),
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .leidos-icao-fields h3,
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .leidos-domestic-fields h3 {
  color: #d8e3ef;
}

html[data-theme="dark"] .suite-shell .card-head {
  color: #e7eef7;
  background: #162a3e;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .list-row {
  color: #d8e3ef;
  background: #172a3e;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main .flight-details-card > .card-head h2,
html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(label, legend, p, span, small, strong, summary, h2, h3, dt, dd, li) {
  color: #d8e3ef;
}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(.error, .field-error, .form-error, .leidos-messages) {
  color: #ffaaa5;
}

html[data-theme="dark"] body[data-page="flights"] #main .map-title {
  color: #e7eef7;
  background: rgba(20, 35, 55, .96);
  border: 1px solid #40566e;
}

html[data-theme="dark"] body[data-page="flights"] #main .route-footer .route-summary {
  color: #d8e3ef;
  background: #1a2b40;
  border: 1px solid #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main .weather-observation-grid > div {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main :is(.notice:not(.error), .leidos-artcc) {
  color: #c5d6e8;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-page="flights"] #main .leidos-artcc small {
  color: #a2b4c8;
}

html[data-theme="dark"] .suite-shell .skip-link {
  color: #e7eef7;
  background: #142337;
  border-color: #5aabeb;
}

html[data-theme="dark"] body[data-page="flights"] .leidos-flight-fields .field .leidos-field-label[data-tooltip]::after {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #40566e;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .35);
}

/* The sign-in page has its own light backdrop and high-specificity fields. */
html[data-theme="dark"] body[data-workspace-page="account"]:has(#auth-panel:not([hidden])) {
  background: #0b1521;
}

html[data-theme="dark"] body[data-workspace-page="account"]:has(#auth-panel:not([hidden])) :is(.suite-shell, .workspace-main, #main-content) {
  color: #e7eef7;
  background: transparent;
}

html[data-theme="dark"] body[data-workspace-page="account"] .workspace-main :is(input:not([type="checkbox"]):not([type="file"]), select, textarea) {
  color: #e7eef7;
  background: #0f1c2b;
  border-color: #40566e;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-workspace-page="account"] .auth-tabs {
  background: #0f1c2b;
  border-color: #344a60;
}

html[data-theme="dark"] body[data-workspace-page="account"] .auth-tabs .auth-tab.active {
  color: #e7eef7;
  background: #1b2d42;
  box-shadow: inset 0 0 0 1px #435b73;
}

html[data-theme="dark"] body[data-workspace-page="account"] .auth-tabs .auth-tab:not(.active) {
  color: #a2b4c8;
}

html[data-theme="dark"] body[data-workspace-page="account"] .auth-sso-label {
  color: #d8e3ef;
}

/* Close the remaining light-only gaps found in roster, trip, and record views. */
html[data-theme="dark"] .suite-shell .roster-calendar {
  color: #d8e3ef;
  background: #111f30;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .calendar-weekday {
  color: #c5d6e8;
  background: #1c3046;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .calendar-day {
  color: #d8e3ef;
  background: #142337;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .calendar-day.is-empty {
  background: #101d2b;
}

html[data-theme="dark"] .suite-shell .calendar-day:not(.today):hover {
  background: #203851;
  box-shadow: inset 0 0 0 1px #476784;
}

html[data-theme="dark"] .suite-shell .calendar-day.today {
  background: #17324d;
  box-shadow: inset 0 0 0 1px #2f6894;
}

html[data-theme="dark"] .suite-shell .calendar-day > strong {
  color: #d8e3ef;
}

html[data-theme="dark"] .suite-shell .calendar-day.today > strong {
  color: #fff;
  background: #087fd0;
}

/* Form row spacing is shared by web and the packaged native workspaces. */
#main .form-grid,
#plan-form .plan-fields,
#plan-form .plan-route-fields,
#suite-dialog.editor-dialog .editor-panel .form-grid,
#settings-dialog .form-grid,
.suite-shell .auth-form,
.suite-shell .password-form,
.suite-shell .runway-form { row-gap: 12px; }

/* WebKit's native date/time intrinsic size can ignore a narrow grid cell. */
:is(.suite-shell, #suite-dialog, #settings-dialog) input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"]) {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding-inline: 6px;
}
:is(.suite-shell, #suite-dialog, #settings-dialog) input::-webkit-date-and-time-value { white-space: nowrap; text-align: left; }

html[data-theme="dark"] .suite-shell .calendar-day-add {
  color: #d8e3ef;
  background: #1b2d42;
  border-color: #435b73;
}

html[data-theme="dark"] .suite-shell .calendar-day-add:hover {
  color: #fff;
  background: #087dcf;
  border-color: #55aef0;
}

html[data-theme="dark"] .suite-shell .calendar-event {
  color: #d9ecfb;
  background: #1e3f5c;
  border: 1px solid #365d7c;
}

html[data-theme="dark"] .suite-shell .calendar-event:hover {
  color: #fff;
  background: #285273;
}

html[data-theme="dark"] .suite-shell .roster-trip-card {
  color: #d8e3ef;
  background: #172a3f;
  border-color: #344a60;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .suite-shell .roster-trip-card-header {
  color: #d8e3ef;
  background: linear-gradient(125deg, #1a2f45, #172a3f 72%);
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell :is(.roster-trip-card-date time, .roster-trip-card-route, .roster-trip-card-grid .roster-trip-card-field > strong) {
  color: #e7eef7;
}

html[data-theme="dark"] .suite-shell :is(.roster-trip-card-date small, .roster-trip-card-number small, .roster-trip-card-field small) {
  color: #a8bdd2;
}

html[data-theme="dark"] .suite-shell .roster-trip-card-number {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #40566e;
}

html[data-theme="dark"] .suite-shell .roster-trip-card-number strong {
  color: #c4dcf2;
}

html[data-theme="dark"] .suite-shell .roster-trip-card-route > b {
  color: #63b8f1;
}

html[data-theme="dark"] .suite-shell .roster-trip-card-grid > div {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .roster-trip-card-actions {
  color: #d8e3ef;
  background: #142337;
  border-color: #344a60;
}

@media (max-width: 400px) {
  html[data-theme="dark"] .suite-shell .header-search-link {
    gap: 5px;
    min-width: 0;
    padding-inline: 8px;
    font-size: 12px;
  }
}

html[data-theme="dark"] body[data-page="trip"] #main .trip-workflow > .is-current {
  color: #e7eef7;
  background: #1a3045;
  border-left-color: #2f9af1;
  box-shadow: inset 0 0 0 1px #344a60;
}

html[data-theme="dark"] body[data-page="trip"] #main .trip-workflow > .is-current :is(small, strong, span) {
  color: #d8e3ef;
}

html[data-theme="dark"] .suite-shell .weather-station {
  color: #d8e3ef;
  background-color: #172a3f;
  background-image: none;
  border-color: #344a60;
  border-top-color: #1688d4;
}

html[data-theme="dark"] .suite-shell .weather-station-hero {
  color: #d8e3ef;
  background: linear-gradient(115deg, #1d3852, #172a3f 75%);
  border-color: #36536d;
}

html[data-theme="dark"] .suite-shell .weather-station-head strong {
  color: #e7eef7;
}

html[data-theme="dark"] .suite-shell .weather-station-head small,
html[data-theme="dark"] .suite-shell .weather-station-footer,
html[data-theme="dark"] .suite-shell .weather-station dl dt {
  color: #a8bdd2;
}

html[data-theme="dark"] .suite-shell .weather-station dl dd {
  color: #d8e3ef;
}

html[data-theme="dark"] .suite-shell .weather-observation-grid > div {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell .weather-observation-grid dt {
  color: #a8bdd2;
}

html[data-theme="dark"] .suite-shell .weather-observation-grid dd {
  color: #e0eaf4;
}

html[data-theme="dark"] .suite-shell #main .notice:not(.warning):not(.warning-banner):not(.error):not(.error-banner):not(.success):not(.success-banner):not(.amber):not(.red),
html[data-theme="dark"] .suite-shell #main .callout,
html[data-theme="dark"] .suite-shell #main .info-banner {
  color: #cbd9e8;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell #main .source-health {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell #main .source-health > small,
html[data-theme="dark"] .suite-shell #main .source-health-details {
  color: #b6c8da;
}

html[data-theme="dark"] .suite-shell #main .source-health-details summary {
  color: #8bcaff;
}

html[data-theme="dark"] .suite-shell #main .maintenance-entry {
  color: #d8e3ef;
  background: #172a3f;
  border-color: #344a60;
}

html[data-theme="dark"] .suite-shell #main .checklist li:nth-child(even) {
  color: #d8e3ef;
  background: #1a2b40;
}

html[data-theme="dark"] .suite-shell #main .pagination .current {
  color: #b7dcfb;
  background: #173650;
  border: 1px solid #345a79;
}

/* Map overlays remain readable while the map provider keeps its own tile colors. */
html[data-theme="dark"] .suite-shell .route-map {
  background-color: #142337;
}

html[data-theme="dark"] .suite-shell .route-detail .route-line {
  background: #7088a0;
}

html[data-theme="dark"] .suite-shell .route-detail .route-line .icon {
  color: #9fd1ff;
  background: #142337;
}

html[data-theme="dark"] .suite-shell .map-caption {
  color: #d3e0ed;
  background: rgba(15, 28, 43, .92);
  border: 1px solid #40566e;
}

html[data-theme="dark"] .suite-shell .maplibregl-ctrl-group {
  overflow: hidden;
  background: #172a3f;
  border: 1px solid #40566e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

html[data-theme="dark"] .suite-shell .maplibregl-ctrl-group button {
  color: #e7eef7;
  background-color: #172a3f;
  border-color: #40566e;
}

html[data-theme="dark"] .suite-shell .maplibregl-ctrl-group button:hover {
  background-color: #263c54;
}

html[data-theme="dark"] .suite-shell .maplibregl-ctrl-icon {
  filter: brightness(0) invert(.88);
}

html[data-theme="dark"] .suite-shell .maplibregl-ctrl-attrib {
  color: #d8e3ef;
  background: rgba(15, 28, 43, .94);
  border: 1px solid #40566e;
}

html[data-theme="dark"] .suite-shell .maplibregl-ctrl-attrib a {
  color: #8bcaff;
}

/* The shared dialog has stronger legacy ID selectors, so the theme must match them. */
html[data-theme="dark"] #suite-dialog {
  color: #d8e3ef;
  background: #142337;
  background-image: none;
  border: 1px solid #40566e;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] #suite-dialog .dialog-head,
html[data-theme="dark"] #suite-dialog.editor-dialog .dialog-head {
  color: #e7eef7;
  background: linear-gradient(110deg, #183047, #12263a);
  border-color: #40566e;
}

html[data-theme="dark"] #suite-dialog .dialog-head h2 {
  color: #f1f6fb;
}

html[data-theme="dark"] #suite-dialog .dialog-body,
html[data-theme="dark"] #suite-dialog.editor-dialog .dialog-body {
  color: #d8e3ef;
  background: #142337;
  background-image: none;
  border-color: #344a60;
}

html[data-theme="dark"] #suite-dialog :is(.record-editor, .editor-panels, .editor-panel, .card, .panel, .list-row, .readiness-record, .recency-record) {
  color: #d8e3ef;
  background-color: #172a3f;
  background-image: none;
  border-color: #40566e;
  box-shadow: none;
}

html[data-theme="dark"] #suite-dialog.editor-dialog .editor-panel legend {
  color: #e7eef7;
}

html[data-theme="dark"] #settings-dialog .settings-sheet {
  color: #d8e3ef;
  background: linear-gradient(120deg, #142337, #101e2e);
  border-color: #344a60;
}

html[data-theme="dark"] #settings-dialog .settings-heading :is(h1, h2, h3) {
  color: #f1f6fb;
}

html[data-theme="dark"] #settings-dialog .settings-heading p {
  color: #a8bdd2;
}

html[data-theme="dark"] #settings-dialog .settings-heading .icon-button {
  color: #dce8f4;
}

html[data-theme="dark"] #settings-dialog .settings-sheet .form-actions {
  color: #d8e3ef;
  background: #101e2e;
  border-color: #344a60;
  box-shadow: none;
}

html[data-theme="dark"] #settings-dialog .settings-sheet :is(.button:not(.primary):not(.danger), a.button:not(.primary):not(.danger)) {
  color: #dce8f4;
  background: #1b2d42;
  border-color: #435b73;
}

html[data-theme="dark"] #settings-dialog .settings-sheet :is(.button:not(.primary):not(.danger), a.button:not(.primary):not(.danger)):hover {
  color: #fff;
  background: #263c54;
  border-color: #6384a4;
}

html[data-theme="dark"] #settings-dialog .settings-sheet .button.primary {
  color: #fff;
  background: linear-gradient(120deg, #087dcf, #0872c7);
  border-color: #1888db;
}

html[data-theme="dark"] #settings-dialog .settings-sheet .button.primary:disabled {
  color: #c4d7e8;
  background: #315777;
  border-color: #456b8d;
  opacity: 1;
}

html[data-theme="dark"] #suite-dialog.editor-dialog .editor-panel :is(.editor-panel-help, .form-help, small) {
  color: #aabed2;
}

html[data-theme="dark"] #suite-dialog.editor-dialog .editor-panel-number {
  color: #b7dcfb;
  background: #173650;
}

html[data-theme="dark"] #suite-dialog .field.checkbox {
  color: #d8e3ef;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] #suite-dialog .field.checkbox :is(span, small) {
  color: #d8e3ef;
}

html[data-theme="dark"] #suite-dialog .notice:not(.warning):not(.warning-banner):not(.error):not(.error-banner):not(.success):not(.success-banner):not(.amber):not(.red):not(.readiness-review-notice),
html[data-theme="dark"] #suite-dialog .notice.spaced:not(.warning):not(.warning-banner):not(.error):not(.error-banner):not(.success):not(.success-banner):not(.amber):not(.red):not(.readiness-review-notice) {
  color: #cbd9e8;
  background: #1a2b40;
  border-color: #344a60;
}

html[data-theme="dark"] #suite-dialog .readiness-review-notice {
  color: #f0d392;
  background: #352b18;
  border-color: #87641f;
}

html[data-theme="dark"] #suite-dialog .readiness-review-notice :is(strong, p, small, span) {
  color: #f0d392;
}

html[data-theme="dark"] #suite-dialog .readiness-review-notice strong {
  color: #ffe6a8;
}

html[data-theme="dark"] #suite-dialog .readiness-record-tail {
  color: #b7dcfb;
  background: #173650;
}

html[data-theme="dark"] #suite-dialog .form-actions,
html[data-theme="dark"] #suite-dialog.editor-dialog .record-editor > .form-actions {
  color: #d8e3ef;
  background: #101e2e;
  border-color: #344a60;
  box-shadow: none;
}

html[data-theme="dark"] #suite-dialog :is(h1, h2, h3, h4, p, span, label, small, strong, li, th, td, dt, dd, legend, summary) {
  color: #d8e3ef;
}

html[data-theme="dark"] #suite-dialog :is(h1, h2, h3, h4, strong, legend) {
  color: #f1f6fb;
}

html[data-theme="dark"] #suite-dialog :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  color: #e7eef7;
  background: #0f1c2b;
  border-color: #40566e;
  color-scheme: dark;
}

html[data-theme="dark"] #suite-dialog :is(input, textarea)::placeholder {
  color: #93a7bc;
  opacity: 1;
}

html[data-theme="dark"] #suite-dialog :is(input, select, textarea):disabled {
  color: #aabed2;
  -webkit-text-fill-color: #aabed2;
  background-color: #142337;
  opacity: 1;
}

html[data-theme="dark"] #suite-dialog :is(input, select, textarea):focus {
  border-color: #5aabeb;
  box-shadow: 0 0 0 3px rgba(73, 161, 230, .2);
}

html[data-theme="dark"] #suite-dialog input[type="checkbox"],
html[data-theme="dark"] #suite-dialog input[type="radio"] {
  accent-color: #1688d4;
  color-scheme: dark;
}

html[data-theme="dark"] #suite-dialog :is(button:not(.primary):not(.danger), .button:not(.primary):not(.danger), a.button:not(.primary):not(.danger)) {
  color: #dce8f4;
  background: #1b2d42;
  border-color: #435b73;
}

html[data-theme="dark"] #suite-dialog :is(button:not(.primary):not(.danger), .button:not(.primary):not(.danger), a.button:not(.primary):not(.danger)):hover {
  color: #fff;
  background: #263c54;
  border-color: #6384a4;
}

html[data-theme="dark"] #suite-dialog :is(button.primary, .button.primary, .button.primary-action, .button.primary-page-button) {
  color: #fff;
  background: linear-gradient(120deg, #087dcf, #0872c7);
  border-color: #1888db;
}

html[data-theme="dark"] #suite-dialog :is(button.danger, .button.danger) {
  color: #ffaaa5;
  background: #3b2028;
  border-color: #76404a;
}

html[data-theme="dark"] #suite-dialog :is(button.primary, .button.primary, .button.primary-action, .button.primary-page-button):disabled {
  color: #c4d7e8;
  background: #315777;
  border-color: #456b8d;
  opacity: 1;
}

/* Reviewed transfer, advisory, report and account surfaces share the dark palette. */
html[data-theme="dark"] :is(.report-aircraft-cards article,.handoff-note,.local-history,.stepper,.step,.runway-form-card,.runway-preflight,.runway-source-notes,.runway-result,.runway-evidence,.workspace-title-icon,.account-avatar-large,.review-actions,.export-panel,.review-summary,.summary-item,.review-card-heading,.review-disclosure,.source-files-list,.validation-item) {
  color:var(--theme-copy);background:var(--theme-surface);border-color:var(--theme-border);background-image:none;
}
html[data-theme="dark"] :is(.step.active,.step-number,.dropzone,.file-badge,.principles li>span:first-child) {
  color:var(--theme-copy);background:var(--theme-raised);border-color:var(--theme-border);background-image:none;
}
html[data-theme="dark"] .file-badge{box-shadow:5px -5px 0 #263c54}
html[data-theme="dark"] .dropzone:hover{background:#20364c;border-color:#65b8ff}
html[data-theme="dark"] .workspace-main :is(.secondary-action,.text-page-button,.local-history .secondary-action) {color:#dce8f4;background:#1b2d42;border-color:#435b73}
html[data-theme="dark"] body[data-workspace-page="runway"] :is(section,article,aside,.runway-form-card input,.runway-form-card select) {color:var(--theme-copy);background:var(--theme-surface);border-color:var(--theme-border)}
html[data-theme="dark"] body[data-workspace-page="runway"] :is(input,select,textarea) {background:var(--theme-input);color:var(--theme-copy);border-color:var(--theme-border)}
html[data-theme="dark"] :is(.required-missing,.preview-cell-needs-repair,.preview-guidance){background:#352b18;color:#f0d392}
html[data-theme="dark"] .workspace-main :is(th,.preview-table th,.mapping-table th){background:#1a2b40;color:#a2b4c8}
html[data-theme="dark"] .suite-shell .maplibregl-map{background:#0b1521}
html[data-theme="dark"] .maplibregl-popup-content{background:#142337;color:#e7eef7;border:1px solid #344a60}
html[data-theme="dark"] .maplibregl-popup-anchor-bottom .maplibregl-popup-tip{border-top-color:#142337}
html[data-theme="dark"] .legal-main .page-title-icon>.workspace-title-icon {background:var(--theme-raised);border-color:var(--theme-border);color:var(--theme-copy)}
html[data-theme="dark"] .workspace-main :is(.airport-prefix-prompt,.mapping-confidence) {background:#1a2b40;color:#d8e3ef;border-color:#40566e}
html[data-theme="dark"] .workspace-main .airport-prefix-prompt :is(p,span,strong,small,label) {color:#d8e3ef}
html[data-theme="dark"] .skip-link {background:#142337;color:#72bdff;border:1px solid #40566e}
html[data-theme="dark"] .workspace-main :is(.auth-message,.account-action-message,.billing-status) {background:#173650;color:#b7dcfb;border:1px solid #344a60}
html[data-theme="dark"] .workspace-main :is(.auth-message.error,.account-action-message.error,.billing-status.error) {background:#3b2028;color:#ffaaa5;border-color:#76404a}
html[data-theme="dark"] .workspace-main :is(.auth-message.success,.account-action-message.success,.billing-status.success) {background:#153b34;color:#64ddb3;border-color:#2f6858}
html[data-theme="dark"] .suite-shell :is(button.primary-page-button:not(:disabled),button.primary-action:not(:disabled),a.primary-page-button) {background:linear-gradient(120deg,#087dcf,#0872c7);color:#fff;border-color:#1888db}
html[data-theme="dark"] .knowledge-facts {background:#142337;border-color:#344a60;color:#d8e3ef}
html[data-theme="dark"] .knowledge-facts dt {color:#a2b4c8}
html[data-theme="dark"] .knowledge-facts dd {color:#e7eef7}
html[data-theme="dark"] :is(.knowledge-source-icon,.knowledge-group-heading>span) {background:#20364c;color:#b7dcfb;border-color:#40566e}
html[data-theme="dark"] .knowledge-group-heading {border-color:#344a60}
html[data-theme="dark"] .knowledge-search-answer {background:#173650;color:#d8e3ef;border-color:#344a60}
html[data-theme="dark"] .suite-shell .flight-time-coverage {background:#173650;color:#d8e3ef;border-color:#344a60}
html[data-theme="dark"] #main :is(.metric-note,.muted,.source-confidence small,.source-confidence span,.weather-station-head small) {color:#a2b4c8}
html[data-theme="dark"] #suite-dialog .record-files-input::file-selector-button {background:#1b2d42;color:#dce8f4;border-color:#435b73}

/* Authenticated imports share one uploader, including evidence and roster photos. */
html[data-theme="dark"] #suite-dialog .suite-upload {
  color: var(--theme-copy);
  background: var(--theme-input);
  border-color: #557491;
}
html[data-theme="dark"] #suite-dialog .suite-upload-icon {
  color: #72bdff;
  background: #203b55;
}
html[data-theme="dark"] #suite-dialog .suite-upload-title { color: #f1f6fb; }
html[data-theme="dark"] #suite-dialog :is(.suite-upload-prompt, .suite-upload-formats) { color: #b3c5d8; }
html[data-theme="dark"] #suite-dialog .suite-upload-browse { color: #72bdff; }
html[data-theme="dark"] #suite-dialog .suite-upload-selection {
  color: #b3c5d8;
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
html[data-theme="dark"] #suite-dialog .suite-upload:is(:hover, :focus-within, .is-dragging) {
  background: #19334b;
  border-color: #72bdff;
}
html[data-theme="dark"] #suite-dialog .suite-upload:focus-within { box-shadow: 0 0 0 3px #65b8ff40; }
html[data-theme="dark"] #suite-dialog .suite-upload.is-dragging { box-shadow: inset 0 0 0 1px #72bdff; }
html[data-theme="dark"] #suite-dialog .suite-upload[aria-busy="true"] { opacity: 1; }
html[data-theme="dark"] #suite-dialog .suite-upload.has-error { border-color: #ff9894; }
html[data-theme="dark"] #suite-dialog .suite-upload.has-error .suite-upload-selection { color: #ffb2ae; background: #3b2028; border-color: #76404a; }
html[data-theme="dark"] #suite-dialog :is(#evidence-status, #import-result) .notice.error {
  color: #ffb2ae;
  background: #3b2028;
  border-color: #76404a;
}

/* Planning empty states and attachment controls share the dark card palette. */
html[data-theme="dark"] body[data-page="flights"] #main .plan-map .map-unavailable{background:#132337;color:#b9cbdc;}
html[data-theme="dark"] body[data-page="flights"] #main .map-unavailable strong{color:#e1ecf6;}
html[data-theme="dark"] body[data-page="flights"] #main .map-unavailable button,
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .record-files-input::file-selector-button{background:#1d354c;color:#dcebf7;border-color:#46627b;}
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .record-files-input{background:#102033;border-color:#46627b;}
html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(.plan-monitor,.plan-attachments){border-color:#344a60;}
html[data-theme="dark"] body[data-page="flights"] #main #plan-form .plan-monitor .field.checkbox{background:transparent;}
html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(.draft-status,.record-files-status){color:#afc1d3;}

html[data-theme="dark"] body[data-page="flights"] #main #plan-form :is(.draft-status,.plan-attachments>.form-help){background:transparent;}
