/* Shared dark surfaces. Keep semantic primary/danger actions and photographs intact. */
html[data-theme="dark"] {color-scheme:dark;--app-surface:#192633;--app-raised:#223342;--app-ink:#e4edf4;--app-muted:#acbdcb;--app-border:#506778}
html[data-theme="dark"] body {color:var(--app-ink)}
html[data-theme="dark"] body.client-photo-page:not(.photo-light)>main,html[data-theme="dark"] body.client-photo-page>footer {background:var(--app-surface);color:var(--app-ink)}
html[data-theme="dark"] :is(.billing-stat,.billing-list,.calendar-wrap,.agenda-card,.log-card,.summary-strip,.booking-extras-summary,.booking-panel,.pilot-flight,.picker,.picker-list,.pilot-assignment,.pilot-assignment-aircraft,.private-note,dialog) {background:var(--app-surface)!important;color:var(--app-ink);border-color:var(--app-border)}
html[data-theme="dark"] :is(.booking-panel,.booking-form) {--card:#192633;--line:#506778;--booking-selected:#26394a}
html[data-theme="dark"] :is(.billing-row,.aircraft-label,.calendar-row,.days div,.history-item,.booking-price-row,.booking-entry,.booking-checkin-footer,fieldset) {border-color:var(--app-border)}
html[data-theme="dark"] :is(.billing-stat strong,.billing-row strong,.billing-row .amount,.log-times strong,.booking-selected-price,.flight-card-times,.contact strong) {color:var(--app-ink)}
html[data-theme="dark"] :is(.billing-stat span,.billing-row small,.billing-empty,.intro,.subtle,.hint,.legend,.aircraft-label small,.log-times span,.field-help,.file-status,.booking-selection-note,.booking-extra-summary-row small,.booking-share-content small,.flight-card-times span,.flight-card-times small,.flight-card-report,.fineprint) {color:var(--app-muted)}
html[data-theme="dark"] :is(.billing-toolbar,.billing-access,.filters,.form-grid,.booking-panel,.access,.field,.pilot-invite-fields) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea),html[data-theme="dark"] dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {background:#14212d!important;color:var(--app-ink)!important;-webkit-text-fill-color:var(--app-ink)!important;border-color:var(--app-border)!important;color-scheme:dark}
html[data-theme="dark"] :is(input,textarea)::placeholder {color:var(--app-muted);-webkit-text-fill-color:var(--app-muted);opacity:1}
html[data-theme="dark"] :is(.bill-status,.calendar-head,.booking-status) {background:var(--app-raised);color:var(--app-ink)}
html[data-theme="dark"] .bill-status.sent,html[data-theme="dark"] .status.confirmed {background:#244638;color:#ceebdc}
html[data-theme="dark"] .billing-warning {color:#ffbf76!important}
html[data-theme="dark"] .reservation-bar {background:#263f51;color:var(--app-ink);border-color:#658399;border-left-color:#f07800}
html[data-theme="dark"] .reservation-bar.maintenance {background:#472d2b;color:#ffd7cd;border-color:#a8756b}
html[data-theme="dark"] .timeline {background:repeating-linear-gradient(to right,transparent 0,transparent calc(100% / var(--days) - 1px),#354959 calc(100% / var(--days) - 1px),#354959 calc(100% / var(--days)))}
html[data-theme="dark"] :is(.charge-preview,.pilot-invite-selection,.picked,.file-row,.booking-details-needed) {background:var(--app-raised);color:var(--app-ink);border-color:var(--app-border)}
html[data-theme="dark"] .booking-select-card.selected {background:#26394a;color:var(--app-ink);border-color:#f58200}
html[data-theme="dark"] .booking-panel .booking-extras-summary {background:var(--app-raised)}
html[data-theme="dark"] body.client-photo-page .join-access .join-offer-route {background:var(--app-surface);color:var(--app-ink);border-color:var(--app-border)}
html[data-theme="dark"] body.client-photo-page .join-access .join-offer-route:has(input:checked) {background:#26394a;border-color:#f58200}
html[data-theme="dark"] :is(.empty,#notice) {background:var(--app-surface);color:var(--app-ink);border-color:var(--app-border)}
html[data-theme="dark"] :is(button,a):focus-visible,html[data-theme="dark"] :is(input,select,textarea):focus-visible {outline:2px solid #83c7ee;outline-offset:3px}
html[data-theme="dark"] dialog::backdrop {background:#0009}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]) {color-scheme:dark;--app-surface:#192633;--app-raised:#223342;--app-ink:#e4edf4;--app-muted:#acbdcb;--app-border:#506778}
html:not([data-theme="light"]) body {color:var(--app-ink)}
html:not([data-theme="light"]) body.client-photo-page:not(.photo-light)>main,html:not([data-theme="light"]) body.client-photo-page>footer {background:var(--app-surface);color:var(--app-ink)}
html:not([data-theme="light"]) :is(.billing-stat,.billing-list,.calendar-wrap,.agenda-card,.log-card,.summary-strip,.booking-extras-summary,.booking-panel,.pilot-flight,.picker,.picker-list,.pilot-assignment,.pilot-assignment-aircraft,.private-note,dialog) {background:var(--app-surface)!important;color:var(--app-ink);border-color:var(--app-border)}
html:not([data-theme="light"]) :is(.booking-panel,.booking-form) {--card:#192633;--line:#506778;--booking-selected:#26394a}
html:not([data-theme="light"]) :is(.billing-row,.aircraft-label,.calendar-row,.days div,.history-item,.booking-price-row,.booking-entry,.booking-checkin-footer,fieldset) {border-color:var(--app-border)}
html:not([data-theme="light"]) :is(.billing-stat strong,.billing-row strong,.billing-row .amount,.log-times strong,.booking-selected-price,.flight-card-times,.contact strong) {color:var(--app-ink)}
html:not([data-theme="light"]) :is(.billing-stat span,.billing-row small,.billing-empty,.intro,.subtle,.hint,.legend,.aircraft-label small,.log-times span,.field-help,.file-status,.booking-selection-note,.booking-extra-summary-row small,.booking-share-content small,.flight-card-times span,.flight-card-times small,.flight-card-report,.fineprint) {color:var(--app-muted)}
html:not([data-theme="light"]) :is(.billing-toolbar,.billing-access,.filters,.form-grid,.booking-panel,.access,.field,.pilot-invite-fields) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea),html:not([data-theme="light"]) dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {background:#14212d!important;color:var(--app-ink)!important;-webkit-text-fill-color:var(--app-ink)!important;border-color:var(--app-border)!important;color-scheme:dark}
html:not([data-theme="light"]) :is(input,textarea)::placeholder {color:var(--app-muted);-webkit-text-fill-color:var(--app-muted);opacity:1}
html:not([data-theme="light"]) :is(.bill-status,.calendar-head,.booking-status) {background:var(--app-raised);color:var(--app-ink)}
html:not([data-theme="light"]) .bill-status.sent,html:not([data-theme="light"]) .status.confirmed {background:#244638;color:#ceebdc}
html:not([data-theme="light"]) .billing-warning {color:#ffbf76!important}
html:not([data-theme="light"]) .reservation-bar {background:#263f51;color:var(--app-ink);border-color:#658399;border-left-color:#f07800}
html:not([data-theme="light"]) .reservation-bar.maintenance {background:#472d2b;color:#ffd7cd;border-color:#a8756b}
html:not([data-theme="light"]) .timeline {background:repeating-linear-gradient(to right,transparent 0,transparent calc(100% / var(--days) - 1px),#354959 calc(100% / var(--days) - 1px),#354959 calc(100% / var(--days)))}
html:not([data-theme="light"]) :is(.charge-preview,.pilot-invite-selection,.picked,.file-row,.booking-details-needed) {background:var(--app-raised);color:var(--app-ink);border-color:var(--app-border)}
html:not([data-theme="light"]) .booking-select-card.selected {background:#26394a;color:var(--app-ink);border-color:#f58200}
html:not([data-theme="light"]) .booking-panel .booking-extras-summary {background:var(--app-raised)}
html:not([data-theme="light"]) body.client-photo-page .join-access .join-offer-route {background:var(--app-surface);color:var(--app-ink);border-color:var(--app-border)}
html:not([data-theme="light"]) body.client-photo-page .join-access .join-offer-route:has(input:checked) {background:#26394a;border-color:#f58200}
html:not([data-theme="light"]) :is(.empty,#notice) {background:var(--app-surface);color:var(--app-ink);border-color:var(--app-border)}
html:not([data-theme="light"]) :is(button,a):focus-visible,html:not([data-theme="light"]) :is(input,select,textarea):focus-visible {outline:2px solid #83c7ee;outline-offset:3px}
html:not([data-theme="light"]) dialog::backdrop {background:#0009}}
html[data-theme="dark"] body:not(.client-photo-page){background:#101923;color:#e4edf4}
html[data-theme="dark"] :is(.page-title h1,.tabs button,.filters label,.modal-head h2){color:#e4edf4}
html[data-theme="dark"] .tabs{border-color:#506778}
html[data-theme="dark"] .tabs button{background:transparent}
html[data-theme="dark"] :is(.empty h2,.empty a){color:#e4edf4}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]) body:not(.client-photo-page){background:#101923;color:#e4edf4}
html:not([data-theme="light"]) :is(.page-title h1,.tabs button,.filters label,.modal-head h2){color:#e4edf4}
html:not([data-theme="light"]) .tabs{border-color:#506778}
html:not([data-theme="light"]) .tabs button{background:transparent}
html:not([data-theme="light"]) :is(.empty h2,.empty a){color:#e4edf4}}
html[data-theme="dark"] body.client-photo-page::before,html[data-theme="dark"] body:not(.client-photo-page) .hero::before{filter:brightness(.48)}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]) body.client-photo-page::before,html:not([data-theme="light"]) body:not(.client-photo-page) .hero::before{filter:brightness(.48)}}
/* Edge-to-edge page surfaces on phones and narrow windows, across the app. */
@media(max-width:720px){
 :root body{background:#fff}
 :root body.client-photo-page::before{display:none}
 :root body>main,
 :root body.client-photo-page>main,
 :root body.client-photo-page>main:has(#app>.access),
 :root body.client-photo-page>main:has(.join-access){box-sizing:border-box;width:100%;max-width:none;margin:0;padding:24px 20px;border:0;border-radius:0;box-shadow:none;background:var(--dashboard-surface,#fff)}
 :root body>footer,
 :root body.client-photo-page>footer,
 :root body.client-photo-page:has(#app>.access)>footer{box-sizing:border-box;width:100%;max-width:none;margin:0;padding:20px;border:0;border-radius:0;background:var(--dashboard-surface,#fff)}
 :root body #booking.wrap{width:100%;max-width:none;margin:0;padding:0}
 :root body #booking>.panel{margin:0;border:0;border-radius:0;box-shadow:none}
 :root body .wiki-layout{gap:20px}
 :root body .wiki-article{margin:0;padding:0;border:0;border-radius:0;box-shadow:none}
 :root[data-theme="dark"] body,
 :root[data-theme="dark"] body>main,
 :root[data-theme="dark"] body.client-photo-page>main,
 :root[data-theme="dark"] body>footer{background:#192633}
}
@media(max-width:720px) and (prefers-color-scheme:dark){
 :root:not([data-theme="light"]) body,
 :root:not([data-theme="light"]) body>main,
 :root:not([data-theme="light"]) body.client-photo-page>main,
 :root:not([data-theme="light"]) body>footer{background:#192633}
}

/* Administrative workspaces use plain surfaces rather than photography. */
body.admin-page{background:var(--app-surface,#f4f6f8)}
body.admin-page::before{display:none!important;background-image:none!important}
/* Dashboard foreground and surface must switch together, including an explicit
   theme that differs from the device preference and the empty/access states. */
body.client-photo-page:has(> main #app){--dashboard-surface:#fff;--dashboard-ink:#002950;--dashboard-muted:#596d80}
html[data-theme="dark"] body.client-photo-page:has(> main #app){--dashboard-surface:#192633;--dashboard-ink:#e4edf4;--dashboard-muted:#acbdcb}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]) body.client-photo-page:has(> main #app){--dashboard-surface:#192633;--dashboard-ink:#e4edf4;--dashboard-muted:#acbdcb}}
html body.client-photo-page:has(> main #app)>main,
html body.client-photo-page:has(> main #app)>footer{background:var(--dashboard-surface);color:var(--dashboard-ink)}
html body.client-photo-page:has(> main #app) :is(#title,#app>h2){color:var(--dashboard-ink)}
html body.client-photo-page:has(> main #app) :is(#intro,#app>.access p,.privacy){color:var(--dashboard-muted)}



