/* Theme colours do not alter destination photography, video or globe textures. */
:root { color-scheme: light; --theme-button-bg: #edf5f7; --theme-button-ink: #163e50; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7f2f8; --ink-soft: #b3c9d6; --muted: #b3c9d6;
  --blue: #82caff; --blue-dark: #a3d8ff; --green: #8ae0c6;
  --coral: #ffa087; --sand: #24352e; --cream: #101f2a; --paper: #0b1822;
  --white: #132530; --line: #37505e; --shadow: 0 18px 55px #0004;
  --surface: #132530; --surface-raised: #1c3341; --surface-input: #10212d;
  --theme-button-bg: #203a49; --theme-button-ink: #dff3ff;
}
.theme-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--theme-button-ink); background: var(--theme-button-bg); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.theme-toggle[hidden] { display: none; }
.theme-toggle [data-theme-icon] { font-size: 21px; line-height: 1; width: 22px; text-align: center; }
.theme-toggle:hover { border-color: currentColor; }
.topbar > .theme-toggle { margin-left: auto; }
.credits-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
@media (max-width: 1200px) { .topbar > .theme-toggle [data-theme-label] { display: none; } .topbar > .theme-toggle { padding-inline: 10px; } }
@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; gap: 16px; }
  .site-header nav { flex: 1 0 100%; justify-content: space-between; gap: 12px; }
  .site-header .theme-toggle { margin-left: auto; }
}
@media (max-width: 400px) {
  .site-header .theme-toggle [data-theme-label] { display: none; }
  .site-header .theme-toggle { padding-inline: 10px; }
  .site-header nav > a { white-space: nowrap; }
}
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] :focus-visible { outline-color: #9dece0; box-shadow: 0 0 0 3px #0b1822; }
html[data-theme="dark"] .chip-grid input:focus-visible + span { outline-color: #9dece0; box-shadow: 0 0 0 3px #0b1822; }
html[data-theme="dark"] input::placeholder { color: #94aebf; opacity: 1; }
html[data-theme="dark"] :is(input, select, textarea) { color: var(--ink); background: var(--surface-input); border-color: var(--line); accent-color: #82caff; }
html[data-theme="dark"] :is(.topbar, .site-header) { background: #0b1822f5; border-color: var(--line); }

/* Public pages: landing, sign-in, account, checkout, terms and credits. */
html[data-theme="dark"] :is(.preview-section, .price-card, .auth-card, .account-access, .checkout-card) { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] footer { background: #0e222c; }
html[data-theme="dark"] .site-header .brand span { color: #8ae0c6; }
html[data-theme="dark"] .brand-mark { color: #0c2939; }
html[data-theme="dark"] .button { background: #8ae0c6; color: #0c2928; }
html[data-theme="dark"] .button:hover { background: #b4f0dd; }
html[data-theme="dark"] .outline { color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .notice { background: #173d35; color: #c5f6e6; }
html[data-theme="dark"] .notice.error { background: #442a29; color: #ffc5b8; }
html[data-theme="dark"] :is(.owner-test-panel, .password-card) { border-color: var(--line); }
html[data-theme="dark"] .plan-option:has(input:checked) { background: #173d35; border-color: var(--green); }

/* App panels and native dialogs, including dynamically rendered content. */
html[data-theme="dark"] :is(.preference-panel, .destination-card, .planner-builder, .route-card, .route-card.expanded, .planned-trips-section, .planned-trip-card, .explore-toolbar, .compare-col, dialog, .activity-dialog, .dialog-save) { background: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .match-panel { background: linear-gradient(155deg, #12394b, #0c293a); border-color: var(--line); }
html[data-theme="dark"] .match-card { background: #1b3342; }
html[data-theme="dark"] :is(.card-body p, .match-price, .live-status, .account-strip, .chip-grid small, .interest-field small, .compare-row, .activity-dialog-image) { color: var(--ink-soft); }
html[data-theme="dark"] .match-card .match-weather { color: #9ae5d0; }
html[data-theme="dark"] .match-score { background: #214d42; color: #b4f4df; }
html[data-theme="dark"] :is(.metric, .fact, .planner-summary > div, .stay-row, .activity-practical, .empty-state, .planner-empty, .trip-itinerary-stop, .trip-overview-facts > div) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] :is(.nav-link .nav-count, .save-button, .compare-button, .planner-stop, .planner-controls button, .planned-trip-body button, .globe-stop, .map-zoom-controls, .map-place-preview, .map-preview-close, .close-button, .detail-top-actions button) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] :is(.nav-link:hover, .nav-link.active, .plan-nav-link, .context-toggle, .secondary-button, .map-action, .chip-grid input:checked + span, .photo-credit-disclosure > summary, .activity-attribution > summary) { background: #214858; color: #c0efff; border-color: #527588; }
html[data-theme="dark"] :is(.chip-grid label > span, .continent-tab, .climate-month) { background: var(--surface-input); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .chip-grid input:checked + span { background: #214858; color: #c0efff; border-color: #82caff; }
html[data-theme="dark"] :is(.primary-button, .open-card, .continent-tab.active, .compare-button.active, .price-total) { background: #82caff; color: #0c2939; border-color: #82caff; }
html[data-theme="dark"] .primary-button:hover { background: #a3d8ff; }
html[data-theme="dark"] .save-button.active { background: #ffa087; color: #351a15; border-color: #ffa087; }
html[data-theme="dark"] :is(.planner-order, .flight-link em, .trip-button.active) { color: #153c40; }
html[data-theme="dark"] :is(.price-total span, .price-total small) { color: #153c50; }
html[data-theme="dark"] .map-link { background: #183b49; color: #e7f2f8; }
html[data-theme="dark"] .climate-month.best { background: #3b322c; border-color: #cf9e77; }
html[data-theme="dark"] .climate-month strong { color: #ffb39f; }
html[data-theme="dark"] .climate-month small { color: #aad9f0; }
html[data-theme="dark"] :is(.planner-controls .planner-remove, .planned-trip-body button:last-child, .account-strip .save-error) { color: #ffb39f; }
html[data-theme="dark"] :is(.activity-dialog a, .source-links a, .stay-row a) { color: #a3d8ff; }
html[data-theme="dark"] :is(.activity-missing, .activity-dialog-image) { background: var(--surface-raised); }
html[data-theme="dark"] :is(.activity-image-fallback, .activity-missing .activity-tile-copy small, .activity-missing .activity-tile-copy strong, .activity-missing .activity-tile-copy em) { color: var(--ink-soft); }
html[data-theme="dark"] .toast { background: #d8eef6; color: #123545; }
html[data-theme="dark"] .stay-length-note { color: #edc08e; }
html[data-theme="dark"] .price-key { color: var(--ink-soft); }
html[data-theme="dark"] :is(.card-image img, .activity-tile) { background-color: var(--surface-raised); }
@media (max-width: 790px) { html[data-theme="dark"] .main-navigation { background: #10232ef5; border-color: var(--line); } }
@media (min-width: 791px) and (max-width: 1120px) {
  .topbar { flex-wrap: wrap; gap: 8px 18px; }
  .topbar > .main-navigation { order: 3; flex-basis: 100%; gap: 8px; }
  .topbar .nav-link { padding: 7px 9px; font-size: .8rem; }
  .topbar .nav-icon { font-size: 1.1rem; min-width: 20px; }
  body:has(> .topbar) { padding-top: 128px; }
  #finderResults { scroll-margin-top: 140px; }
}
@media (forced-colors: active) { .theme-toggle { border: 1px solid ButtonText; } html[data-theme="dark"] :focus-visible { outline-color: Highlight; box-shadow: none; } }
