/* Theme overrides are deliberately last: the legacy light styles use !important. */
html[data-theme="dark"]{--light-bg:#10242d;--light-paper:#0b1c25;--light-ink:#e5f1f5;--light-dark:#f0f7fa;--light-muted:#bad0d9;--light-stroke:#31505d}
html[data-theme="dark"] :is(#search-view,#results-view) :is(.v2-capability,.v2-tool-btn,.v2-preset){background:#142d39!important;color:#e5f1f5!important;border-color:#365462!important}
html[data-theme="dark"] :is(#search-view,#results-view) :is(.v2-section-head,.v2-capability,.v2-result-toolbar) :is(h2,h3,p){color:#e4f0f5!important}
html[data-theme="dark"] #search-view :is(.v2-capability-icon,.v3-feature-action){background:#183d43!important;color:#8ce8cc!important;border-color:#376064!important}
html[data-theme="dark"] #search-view > .mt-8.w-full.max-w-3xl > .glass-card{background:#102a39!important;background-image:none!important;border-color:#355160!important}
html[data-theme="dark"] #search-view > .mt-8.w-full.max-w-3xl :where(h3,p),
html[data-theme="dark"] #search-view > .mt-8.md\:mt-12 > h3{color:#deedf3!important}
html[data-theme="dark"] #search-view > div.absolute.bottom-4 > div{background:#142d39!important;border-color:#355160!important}
html[data-theme="dark"] #search-view > div.absolute.bottom-4 :is(button,a){color:#c4dce5!important}
html[data-theme="dark"] #route-form > .flex.gap-3 button[type="button"]{background:#26354e!important;color:#d7dfff!important;border-color:#465476!important}
html[data-theme="dark"] #results-view :is(.glass-card,#currency-bar){background:#102a39!important;color:#e5f3f6!important;border-color:#355160!important}
html[data-theme="dark"] #results-view :is(.text-white,.text-slate-300,.text-slate-400,.text-slate-500){color:#d2e5ed!important}
html[data-theme="dark"] #results-view :is(input,select,textarea){background:#0b202d!important;color:#edf6fa!important;border-color:#3b6171!important}
html[data-theme="dark"] #results-view .glass-card :where(h2,h3,h4,.font-black){color:#ecf6fa!important}
html[data-theme="dark"] :is(#auth-modal,#saved-trips-modal,#profile-modal,#comments-modal,#admin-modal) :is(.bg-white,.bg-slate-50,.bg-slate-100,.bg-gray-50,.bg-gray-100){background:#142e3d!important;color:#e5f1f5!important;border-color:#355160!important}
html[data-theme="dark"] :is(#auth-modal,#saved-trips-modal,#comments-modal,#admin-modal) :is(h1,h2,h3,h4,p,label,.text-slate-800,.text-slate-900){color:#e4f1f6!important}
html[data-theme="dark"] :is(#auth-modal,#saved-trips-modal,#comments-modal,#admin-modal) :is(input,select,textarea){background:#0a202e!important;color:#e4f1f6!important;border-color:#3a6070!important}
html[data-theme="dark"] #profile-modal :is(.v4-profile-header,.v4-profile-scroll,.v4-profile-footer,.v4-profile-action,.v4-profile-membership,.v4-profile-empty,.v4-profile-route-card,.v4-profile-badge,.v4-profile-stat,.v5-local-pill,.v5-trip-status){background:#142e3d!important;color:#e5f1f5!important;border-color:#355160!important}
html[data-theme="dark"] #profile-modal :is(.v4-profile-close,.v4-name-edit,.v4-profile-name-edit input){background:#1b3a49!important;color:#e4f1f6!important;border-color:#3a6070!important}
html[data-theme="dark"] #profile-modal :is(.v4-profile-stats,.v4-profile-stats>div){background:#193746!important;border-color:#355160!important;color:#e4f1f6!important}
html[data-theme="dark"] :is(#planner-modal,#expense-modal,.vp-panel,.vb-panel){background:#102a39!important;color:#e5f3f6!important;border-color:#355160!important}
html[data-theme="dark"] :is(.vp-panel,.vb-panel) :is(input,select,textarea){background:#0b202d!important;color:#e5f3f6!important;border-color:#3a6070!important}
html[data-theme="dark"] :is(#auth-card,[id$="-modal"]) > .glass-card{background:#102a39!important;color:#e5f3f6!important;border-color:#355160!important}
html[data-theme="dark"] :is(#auth-card,[id$="-modal"]) :where(h2,h3,p,span,label,.text-white){color:#deedf4!important}
html[data-theme="dark"] :is(#auth-card,[id$="-modal"]) :where(input,textarea,select){background:#0a202e!important;color:#e5f3f6!important;border-color:#3b6171!important}
html[data-theme="dark"] :is(#auth-card,[id$="-modal"]) :where(.bg-slate-900,.bg-slate-800){background:#193443!important}
html[data-theme="dark"] :is(#vira-expense-dialog,#vira-dayplanner-dialog){background:#102a39!important;color:#e5f3f6!important;border-color:#355160!important}
html[data-theme="dark"] :is(#vira-expense-dialog,#vira-dayplanner-dialog) :where(.text-white,h2,h3,p,span,label,.font-bold,.font-black){color:#deedf4!important}
html[data-theme="dark"] :is(#vira-expense-dialog,#vira-dayplanner-dialog) :where(.bg-slate-900,.bg-slate-800,.bg-slate-800\/40,.bg-slate-900\/60,.bg-slate-900\/70){background:#193443!important}
html[data-theme="dark"] :is(#vira-expense-dialog,#vira-dayplanner-dialog) :where(input,select){background:#0b202d!important;color:#edf6fa!important;border-color:#3b6171!important}
html[data-theme="dark"] :is(#vira-expense-dialog,#vira-dayplanner-dialog) .text-slate-400{color:#bfd4df!important}
html[data-theme="dark"] :is(#auth-card,[id$="-modal"],#vira-expense-dialog,#vira-dayplanner-dialog) :is(input,textarea)::placeholder{color:#abc2ca!important;opacity:1!important}
html[data-theme="dark"] #auth-card > .glass-card > button{color:#c5dbe6!important}
/* Account UI also has ID-specific and dynamically injected light styles. */
html[data-theme="dark"] #profile-modal :is(.v4-profile-heading,.v4-profile-badges,.v4-badge-item,.v4-profile-avatar-button){background:#142e3d!important;background-image:none!important;color:#e5f1f5!important;border-color:#355160!important}
html[data-theme="dark"] #profile-modal #profile-name{color:#edf7fb!important}
html[data-theme="dark"] #profile-modal #pro-promo-box{background:#173e40!important;background-image:none!important;color:#e5f5f2!important;border-color:#38615e!important}
html[data-theme="dark"] #profile-modal #pro-promo-box :is(h3,p,span,strong,li){color:#e5f5f2!important}
html[data-theme="dark"] #profile-modal #pro-promo-box .bg-clip-text{background-image:none!important;color:#8ce8cc!important}
html[data-theme="dark"] #profile-modal :is(#v5-note-input,#v5-trip-destination,#v5-trip-date,#edit-username-input){background:#0a202e!important;color:#e5f3f6!important;border-color:#3b6171!important}
html[data-theme="dark"] #profile-modal :is(#profil-rota-sayaci,#v5-check-count,.v5-local-pill){background:#234957!important;color:#d5eeef!important;border-color:#41636e!important}
html[data-theme="dark"] #profile-modal .v4-profile-logout{background:#482733!important;color:#ffd5df!important;border-color:#754452!important}
html[data-theme="dark"] #profile-modal .v4-profile-logout :is(span,i){color:#ffd5df!important}
html[data-theme="dark"] #profile-modal .v4-profile-action>i:first-child{background:#214452!important;color:#a4e5d6!important;border-color:#3b6171!important}


/* ViraWise dark contrast regression: legacy light.css force-colors nested
 * budget and hotel tiles. Override nested utilities after the light theme. */
html[data-theme="dark"] #results-view .glass-card :is(
 .bg-slate-800\/50,.bg-slate-900\/40,.bg-slate-900\/80,.bg-slate-800\/40,
 .bg-slate-800,.bg-slate-700,.bg-\[\#0f172a\]
) {
 background:#17323f!important;
 background-image:none!important;
 border-color:#395c68!important;
 color:#e7f3f6!important;
}
html[data-theme="dark"] #results-view .glass-card .bg-emerald-500\/10 {
 background:#123b3e!important;
 background-image:none!important;
 border-color:#266f68!important;
 color:#dff7ef!important;
}
html[data-theme="dark"] #results-view .glass-card :is(.bg-amber-500\/20,.bg-blue-500\/10) {
 background:#294050!important;
 border-color:#557080!important;
}
html[data-theme="dark"] #results-view .glass-card :is(
 .text-white,.text-slate-300,.text-slate-400,.text-slate-500,
 .font-black,.font-bold
) {color:#e8f5f8!important;}
html[data-theme="dark"] #results-view .glass-card :is(
 #b-food,#b-event,#b-taxi,#hotel-budget,#hotel-mid,#hotel-lux,
 .bg-slate-800\/50 h4,.bg-slate-900\/40 h4
) {color:#f2fbfd!important;}
html[data-theme="dark"] #results-view .glass-card :is(
 [data-i18n="gastronomy"],[data-i18n="event_est"],[data-i18n="eco_lbl"],
 [data-i18n="hostel"],[data-i18n="prem_lbl"],[data-i18n="central"]
) {color:#d6e9ee!important;}
html[data-theme="dark"] #results-view .glass-card .bg-emerald-500 :is(span,i),
html[data-theme="dark"] #results-view .glass-card :is(
 [data-i18n="rec_lbl"],.bg-emerald-500.text-white
) {color:#fff!important;}
html[data-theme="dark"] #results-view :is(#map,#walking-map) {
 background:#132d3c!important;
 border-color:#385b68!important;
}
html[data-theme="dark"] #results-view :is(#map,#walking-map) .leaflet-tile-pane {
 filter:grayscale(.15) invert(.92) hue-rotate(178deg) brightness(.72) contrast(1.12);
}
html[data-theme="dark"] #results-view :is(#map,#walking-map) .leaflet-control-attribution {
 color:#1c3342!important;
}
html[data-theme="dark"] #results-view .v7-map-external {
 background:#143e49!important;
 border-color:#316675!important;
 color:#d7f3ff!important;
}
html[data-theme="dark"] #results-view .glass-card :is(button,a).bg-black,
html[data-theme="dark"] #results-view .glass-card :is(button,a).bg-blue-600 {
 background:#096e7b!important;
 border-color:#1b8792!important;
 color:#fff!important;
}
html[data-theme="dark"] #results-view .glass-card :is(button,a).bg-black :is(i,span),
html[data-theme="dark"] #results-view .glass-card :is(button,a).bg-blue-600 :is(i,span) {color:#fff!important;}
html[data-theme="dark"] #results-view .glass-card .text-\[9px\],
html[data-theme="dark"] #results-view .glass-card .text-\[10px\] {opacity:1!important;}
/* Keep Leaflet markers / attribution unaffected by the tile darkening. */


/* Map frame: the old light skin also whitens the parent's inner panel. */
html[data-theme="dark"] #results-view .glass-card:has(#map),
html[data-theme="dark"] #results-view .glass-card:has(#walking-map) {
 background:#0f2835!important;
 background-image:none!important;
 border:1px solid #355764!important;
 box-shadow:0 15px 35px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] #results-view .glass-card:has(#walking-map) :is(.v7-map-external,.v7-map-message) {
 color:#e0f5f8!important;
}
