/* YZER — THEME & ACCESSIBILITY LAYER (shared): dark mode, high contrast, text size, reduced motion, underline links. */
html[data-theme="dark"] { --bg: #08131f; --panel: #0f2233; --ink: #e7f2fb; --muted: #93aec2; --line: #1e3a52; --shadow: 0 1px 3px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.4); }
html[data-theme="dark"] body { background: radial-gradient(circle at top left, #0c1f30, #08131f 45%); color: var(--ink); }
html[data-theme="dark"] .card, html[data-theme="dark"] .panel, html[data-theme="dark"] .filter-bar { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .hero h2, html[data-theme="dark"] .panel h3, html[data-theme="dark"] .panel-head h2, html[data-theme="dark"] .delivery-id, html[data-theme="dark"] .feature strong { color: var(--ink); }
html[data-theme="dark"] .card-value { color: var(--brand-cyan); }
html[data-theme="dark"] .panel-head { background: #0c1c2b; border-bottom-color: var(--line); }
html[data-theme="dark"] .notice { background: #0c1c2b; color: #cfe6f5; }
html[data-theme="dark"] .feature { background: #0c1c2b; border-color: var(--line); }
html[data-theme="dark"] .notify { background: #0c1c2b; border-color: var(--line); }
html[data-theme="dark"] .notify-msg { color: #cfe6f5; }
html[data-theme="dark"] .filter-bar input, html[data-theme="dark"] .filter-bar select, html[data-theme="dark"] .filter-group input, html[data-theme="dark"] .filter-group select { background: #0c1c2b; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .btn-clear, html[data-theme="dark"] .adv-toggle, html[data-theme="dark"] .chip-toggle { background: #12283b; color: var(--brand-cyan); border-color: var(--line); }
html[data-theme="dark"] .btn-clear:hover, html[data-theme="dark"] .adv-toggle:hover, html[data-theme="dark"] .chip-toggle:hover { background: #163149; }
html[data-theme="dark"] .active-chip, html[data-theme="dark"] .chip { background: #12283b; color: #cfe6f5; border-color: var(--line); }
html[data-theme="dark"] th, html[data-theme="dark"] td { border-bottom-color: var(--line); }
html[data-theme="dark"] .delivery { border-color: var(--line); }
html[data-theme="dark"] .exec-map, html[data-theme="dark"] #custMap { background: #0c1c2b; }
html[data-theme="dark"] .status-pill.high { background: #3a2a12; }

html[data-contrast="on"] { --line: #000000; --muted: #1a1a1a; }
html[data-contrast="on"][data-theme="dark"] { --line: #ffffff; --muted: #d7e6f2; }
html[data-contrast="on"] .card, html[data-contrast="on"] .panel, html[data-contrast="on"] .filter-bar, html[data-contrast="on"] .delivery, html[data-contrast="on"] .notify, html[data-contrast="on"] .feature { border-width: 2px; }
html[data-contrast="on"] a:not(.leaflet-container a):not(.leaflet-control a):not(.btn) { text-decoration: underline; }
html[data-contrast="on"] .leaflet-container a, html[data-contrast="on"] .leaflet-control a, html[data-contrast="on"] .btn { text-decoration: none !important; }
html[data-contrast="on"] :focus-visible { outline: 3px solid var(--brand-cyan) !important; outline-offset: 2px; }
html[data-contrast="on"] .badge { outline: 1px solid rgba(0,0,0,.5); }

html[data-textsize="large"] body { zoom: 1.12; }
html[data-textsize="xl"] body { zoom: 1.25; }

html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }

html[data-links="underline"] a:not(.leaflet-container a):not(.leaflet-control a):not(.btn) { text-decoration: underline !important; }
html[data-links="underline"] .leaflet-container a, html[data-links="underline"] .leaflet-control a, html[data-links="underline"] .btn { text-decoration: none !important; }

.a11y-fab { position: fixed; right: 20px; bottom: 20px; z-index: 9998; width: 52px; height: 52px; border-radius: 50%; background: var(--brand-blue, #045493); color: #fff; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0,42,78,.35); cursor: pointer; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.a11y-fab:hover { background: var(--brand-navy, #002A4E); }
html[data-theme="dark"] .a11y-fab { border-color: #0f2233; }
.a11y-panel { position: fixed; right: 20px; bottom: 84px; z-index: 9999; width: 320px; max-width: calc(100vw - 40px); background: var(--panel, #fff); color: var(--ink, #002A4E); border: 1px solid var(--line, #cfe1ef); box-shadow: 0 12px 40px rgba(0,42,78,.28); padding: 16px 18px; display: none; }
.a11y-panel.open { display: block; }
.a11y-panel h3 { margin: 0 0 4px; font-size: 16px; color: var(--brand-navy, #002A4E); }
html[data-theme="dark"] .a11y-panel h3 { color: var(--ink); }
.a11y-panel .a11y-sub { color: var(--muted, #5f7a8c); font-size: 12px; margin: 0 0 14px; }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line, #cfe1ef); }
.a11y-row:first-of-type { border-top: none; }
.a11y-row .lbl { font-size: 13px; font-weight: 600; }
.a11y-row .lbl small { display: block; font-weight: 400; color: var(--muted, #5f7a8c); font-size: 11px; }
.a11y-switch { width: 44px; height: 24px; border-radius: 999px; position: relative; cursor: pointer; background: #b9cdda; border: none; flex: none; transition: background .18s; }
.a11y-switch.on { background: var(--brand-blue, #045493); }
.a11y-switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.a11y-switch.on .knob { left: 23px; }
.a11y-seg { display: inline-flex; border: 1px solid var(--line, #cfe1ef); overflow: hidden; }
.a11y-seg button { background: transparent; border: none; padding: 5px 10px; cursor: pointer; font-family: inherit; color: var(--ink, #002A4E); font-weight: 700; }
.a11y-seg button.active { background: var(--brand-blue, #045493); color: #fff; }
html[data-theme="dark"] .a11y-seg button { color: var(--ink); }
.a11y-reset { margin-top: 12px; width: 100%; padding: 9px; background: transparent; border: 1px solid var(--line, #cfe1ef); color: var(--brand-blue, #045493); font-weight: 700; cursor: pointer; }
.a11y-reset:hover { background: rgba(50,197,244,.12); }
