/* LA_STRADA_APPEARANCE_R1. No global inversion, layout, map or image changes. */
#authPanelInner > .ls-app-settings-button {
  display:block;box-sizing:border-box;width:100%;min-height:42px;margin-top:12px;
  padding:9px 12px;border:1px solid rgba(255,255,255,.28);border-radius:6px;
  background:transparent;color:#fff;text-align:left;cursor:pointer;
  font:600 .9rem/1.3 'Barlow',system-ui,sans-serif;letter-spacing:normal;
}
#authPanelInner > .ls-app-settings-button:hover {background:rgba(255,255,255,.1)}
#authPanelInner > .ls-app-settings-button:focus-visible {outline:2px solid #FFD600;outline-offset:3px}
/* Keep the new menu entry reachable with a short viewport or an open mobile keyboard. */
#authPanel:has([data-ls-app-settings]) {max-height:calc(100dvh - 140px);overflow-y:auto;overscroll-behavior:contain}
#lsAppSettings {
  --ls-settings-bg:#fff;--ls-settings-text:#111;--ls-settings-line:#d4d0c8;
  box-sizing:border-box;position:fixed;inset:0;margin:auto;
  width:min(420px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 40px);
  padding:22px;border:1px solid var(--ls-settings-line);border-radius:12px;
  background:var(--ls-settings-bg);color:var(--ls-settings-text);overflow:auto;
  box-shadow:0 12px 50px #0006;font:16px/1.45 'Barlow',system-ui,sans-serif;
  text-align:left;color-scheme:light;
}
#lsAppSettings::backdrop {background:rgba(0,0,0,.55)}
#lsAppSettings .ls-settings-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}
#lsAppSettings h2 {margin:0;color:inherit;font:700 1.3rem/1.2 'Barlow Condensed',system-ui,sans-serif;text-transform:none;letter-spacing:normal}
#lsAppSettings .ls-settings-close {display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;padding:0;border:1px solid var(--ls-settings-line);border-radius:6px;background:transparent;color:inherit;cursor:pointer;font:28px/1 system-ui}
#lsAppSettings fieldset {min-width:0;margin:0;padding:0;border:0}
#lsAppSettings legend {margin:0 0 12px;padding:0;color:inherit;font:600 1rem/1.4 'Barlow',system-ui,sans-serif}
#lsAppSettings .ls-settings-choices {display:grid;grid-template-columns:1fr 1fr;gap:10px}
#lsAppSettings label {display:flex;align-items:center;gap:9px;min-height:48px;box-sizing:border-box;padding:10px;border:1px solid var(--ls-settings-line);border-radius:7px;cursor:pointer;color:inherit;background:transparent;font:600 .95rem/1.4 'Barlow',system-ui,sans-serif;letter-spacing:normal;text-transform:none}
#lsAppSettings label:has(input:checked) {border-color:#009246;box-shadow:inset 0 0 0 1px #009246}
#lsAppSettings input {appearance:auto;position:static;flex:0 0 auto;width:18px;height:18px;margin:0;padding:0;accent-color:#009246}
#lsAppSettings :focus-visible {outline:2px solid #009246;outline-offset:3px}
html[data-ls-theme="dark"] #lsAppSettings {--ls-settings-bg:#000;--ls-settings-text:#fff;--ls-settings-line:#444;color-scheme:dark}

/* Only these two complete pages get a dark page palette. Brand colors stay intact. */
html[data-ls-theme="dark"][data-ls-theme-page="plans"] {
  --bg:#000;--surface:#000;--surface-2:#151515;--ink:#fff;--muted:#c5c5c5;--faint:#aaa;
  --line:#333;--line-strong:#555;--light-border:#444;--paper:#000;--paper-dark:#151515;
  --file-bg:#000;--file-border:#444;--folder-bg:#000;--folder-hover:#151515;
}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] {
  --paper:#000;--paper-dark:#151515;--marble:#000;--travertine:#000;--travertine-dark:#151515;
  --ink:#fff;--text:#fff;--muted:#c5c5c5;--mid-gray:#aaa;
  --light-border:#444;--line-strong:#555;--border:#444;
  --folder-bg:#000;--folder-hover:#151515;--file-bg:#000;--cartolina-cream:#000;
}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(body,.page) {background:#000;color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.cartolina,.tour-day-box,.folder-body,.subfolder-item,.subfolder-item .folder-body,.file-item,.folder-desc-area,.empty-state,.explain-box,.upload-zone,.search-card,.modal-box) {background:#000;color:#fff;border-color:#444}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.cartolina-desc,.tour-day-desc,.tour-day-title,.group-label,.filter-title,.section-title,.folder-name,.file-name,.folder-desc-text,.explain-box-body,.explain-step,.state-loggedout p,.state-loggedout h3,.upload-zone-sub,.upload-zone-title,.upload-zone-limit,.modal-title,.search-card-title,.explain-box-title,.filter-group label,.btn-modal-cancel:hover) {color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.filter-group input,.filter-group select,.folder-desc-input,.modal-input) {background:#151515;color:#fff;border-color:#555;color-scheme:dark}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.tab-btn,.tab-btn.active,.tab-btn:hover) {color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] .tab-btn.active::before {background:#151515}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] .tab-btn.active::after {background:#000}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.btn-ghost,.chip-ghost,.chip-round) {background:#151515;color:#fff;border-color:#555}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.btn-ghost,.chip-ghost,.chip-round):hover {background:#252525;color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.icon-btn:hover,.btn-add-small:hover,.folder-desc-input::placeholder) {color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] .usage-badge {background:#151515}
/* Statistics become readable text surfaces; colored action buttons retain their palette. */
html[data-ls-theme="dark"][data-ls-theme-page="tours"] .stat {background:#151515;color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="tours"] :is(.btn-lemon,.tab-btn.active .tab-badge) {color:#1a1411}
html[data-ls-theme="dark"][data-ls-theme-page="plans"] :is(.folder-desc-input,.modal-box input,.modal-box textarea,.modal-box select,.file-item:hover .file-menu-dot,.btn-modal-cancel) {background:#151515;color:#fff;border-color:#555;color-scheme:dark}
html[data-ls-theme="dark"][data-ls-theme-page="plans"] :is(.hint,.info-btn[aria-expanded="true"],.icon-btn:not(.danger):hover,.tab:hover,.dropbar:hover,.dropbar.drag-over,.dropbar.is-over,.file-item:hover,.file-item:focus-visible) {background:#151515;color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="plans"] :is(.tab.is-active .count,.panel-head .ph-ico:not(.poi):not(.gpx):not(.done)) {color:#1a1a1a}
html[data-ls-theme="dark"][data-ls-theme-page="plans"] .stat:not(.km):not(.up) {color:#fff}

/* Shared detail: styles added later from legacy templates are intentionally overridden. */
html[data-ls-theme="dark"][data-ls-theme-page="detail"] {--paper:#000;--paper-dark:#151515;--ink:#fff;--text:#fff;--light-border:#444}
html[data-ls-theme="dark"][data-ls-theme-page="detail"] :is(body,.page,.card) {background:#000;color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="detail"] :is(.h1,.small,.coords,.p,.content-section,.content-section p,.content-section li,.content-section h2,.highlight-box,.highlight-box p,.highlight-box .p,.highlight-box h3) {color:#fff}
html[data-ls-theme="dark"][data-ls-theme-page="detail"] .content-section h3 {color:#fff!important}
html[data-ls-theme="dark"][data-ls-theme-page="detail"] .content-section h2 {border-bottom-color:#555}
html[data-ls-theme="dark"][data-ls-theme-page="detail"] .highlight-box {background:#151515}
/* Cards on a map are scoped independently: never recolor the map page or its HUD. */
html[data-ls-theme="dark"] :is(.ls-glance-card,.ls-personal-poi-card) {background:#000;color:#fff}
html[data-ls-theme="dark"] .ls-glance-card :is(strong,em) {color:#fff}
html[data-ls-theme="dark"] .ls-personal-poi-card :is(.ls-personal-hint,.ls-personal-description,.ls-personal-close) {color:#fff}
html[data-ls-theme="dark"] .ls-personal-poi-card .ls-personal-close {background:#000}
html[data-ls-theme="dark"] #lsPersonalPoiCard .ls-personal-phone {color:#80dca9}

/* TOUR_PREVIEW_EDIT_R1: account dropdown above transformed cards and page text. */
#authPanel[popover] {position:fixed;inset:auto;margin:0;left:var(--ls-auth-left,8px);top:var(--ls-auth-top,60px);max-width:calc(100vw - 16px);box-sizing:border-box}
#authPanel[popover]:popover-open {display:block;max-height:var(--ls-auth-height,calc(100dvh - 80px));overflow-y:auto;overscroll-behavior:contain}
#authPanel[popover]::backdrop {background:transparent;pointer-events:none}
@supports not selector(:popover-open) {
  .topbar:has(#authPanel.open) {position:relative;z-index:1000301}
  html.lastrada-map-first body.map-full .topbar:has(#authPanel.open) {position:fixed}
}
