/* LSEA appearance controls. The map imagery and QR codes are never inverted. */
html { color-scheme: light; }
body { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
.lsea-theme-toggle {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: max(16px, env(safe-area-inset-right, 0px)); z-index: 1100;
  border: 1px solid #aebdcc; border-radius: 999px; background: #102d48;
  color: #fff; padding: 11px 18px; min-height: 46px; cursor: pointer;
  font: 650 14px/1.5 system-ui, sans-serif; box-shadow: 0 4px 18px #0003;
}
.lsea-theme-toggle:focus-visible { outline: 3px solid #e9b94a; outline-offset: 4px; }
html[data-theme="dark"] {
  color-scheme: dark; --ink: #e4edf5; --muted: #b7c8d8; --line: #3b5065;
  --soft: #192c3f; --blue: #9dcdf0; --gold: #e9b94a;
  background: #0d1927;
}
html[data-theme="dark"] body { background: #0d1927; color: var(--ink); }
html[data-theme="dark"] :is(header,.resource-card,.panel,.officer,.auth-card,.admin-card,.item-button,.admin-nav button,.filter,.empty,.community-panel,.community-layout aside,.community-list button,.map-list article,.message,.skip) {
  background: #142537; color: var(--ink); border-color: var(--line);
}
html[data-theme="dark"] :is(.admin-top,.community-top) { background: #102d48; color: #fff; }
html[data-theme="dark"] :is(.label,.eyebrow,.number,.role-num,.text-link) { color: #a6cdec; }
html[data-theme="dark"] .hero .eyebrow { color: var(--gold); }
html[data-theme="dark"] :is(input,select,textarea) { background: #0e1d2d; color: var(--ink); border-color: #647d93; }
html[data-theme="dark"] :is(input,textarea)::placeholder { color: #a9bacb; opacity: 1; }
html[data-theme="dark"] :is(input,select,textarea):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
html[data-theme="dark"] :is(.member-strip,.secret,.map-consent,.conversation-log) { background: #192c3f; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] :is(.member-strip span,.message small,.executive-post small,.item-button span) { color: var(--muted); }
html[data-theme="dark"] :is(.community-notice,.pending) { background: #352d1c; color: #f6dfa7; }
html[data-theme="dark"] .message.mine { background: #203b55; border-left-color: #94c5ef; }
html[data-theme="dark"] :is(.message,.executive-post,.conversation-log,.map-surface,.community-list button) { border-color: var(--line); }
html[data-theme="dark"] .message { border-left-color: var(--gold); }
html[data-theme="dark"] :is(.item-button:hover,.community-list button:hover) { background: #243e57; }
html[data-theme="dark"] :is(.button.secondary,.community-tabs button) { background: #243e57; color: var(--ink); border-color: #647d93; }
html[data-theme="dark"] :is(.admin-nav button.active,.filter.active,.community-tabs button[aria-selected="true"]) { background: #e9b94a; color: #102d48; border-color: #e9b94a; }
html[data-theme="dark"] .button.navy { background: #254f72; color: #fff; border-color: #6486a2; }
html[data-theme="dark"] :is(.error,.community-error) { color: #ffabab !important; }
html[data-theme="dark"] .success { color: #8fdeb9 !important; }
html[data-theme="dark"] .lsea-theme-toggle { background: #e9b94a; color: #102d48; border-color: #f4d786; }
html[data-theme="dark"] .qr { background: #fff; padding: 12px; width: fit-content; border-radius: 6px; }
html[data-theme="dark"] .leaflet-container { color-scheme: light; color: #20364a; }
html[data-theme="dark"] .leaflet-popup-content :is(p,strong) { color: #20364a; }
html[data-theme="dark"] .leaflet-popup-content a { color: #174669; }
@media print { .lsea-theme-toggle { display: none !important; } body { padding-bottom: 0; } }
/* Amber screen overlay, including the top-layer settings dialog. */
html[data-night="soft"] { --night-tint: #ffad3212; }
html[data-night="warm"] { --night-tint: #ffad3229; }
html:not([data-night="off"]) body::after,
html:not([data-night="off"]) #lsea-settings::after {
  content: ''; position: fixed; inset: 0; background: var(--night-tint, transparent);
  pointer-events: none; z-index: 2147483647;
}
#lsea-settings { width: min(680px, calc(100vw - 24px)); max-height: 85dvh; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; padding: 26px; background: #fff; color: var(--ink); }
#lsea-settings::backdrop { background: #06121d99; }
#lsea-settings h2 { font-size: 1.9rem; margin: 0; }
#lsea-settings h3 { margin: 0 0 16px; }
#lsea-settings section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
#lsea-settings .checkline { margin: 12px 0; }
#lsea-settings .checkline input { min-width: 18px; min-height: 18px; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#settings-close { border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); width: 44px; height: 44px; cursor: pointer; font-size: 24px; flex-shrink: 0; }
.settings-update { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.settings-update small { display: block; color: var(--muted); }
.lsea-notice { position: fixed; bottom: 82px; right: 16px; z-index: 1100; display: flex; flex-wrap: wrap; gap: 8px; max-width: min(430px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 5px 22px #0003; }
.lsea-notice button { white-space: normal; text-align: left; }
.calendar-controls { margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.calendar-controls select { max-width: 280px; display: block; margin: 8px 0 16px; }
html[data-theme="dark"] :is(#lsea-settings,.lsea-notice) { background: #142537; color: var(--ink); }
@media(max-width:650px) { #lsea-settings { padding: 18px; } }
@media print { #lsea-settings,.lsea-notice,body::after,.calendar-controls { display: none !important; } }

/* LSEA notification bell v1 */
body{padding-top:3.7rem}
#lsea-bell{position:fixed;top:.55rem;right:max(.7rem,env(safe-area-inset-right));z-index:1200;width:46px;height:46px;border:1px solid #c9d4df;border-radius:50%;background:#fff;color:#16334d;box-shadow:0 3px 14px #0002;display:grid;place-items:center;cursor:pointer}
#lsea-bell-count{position:absolute;top:-5px;right:-5px;min-width:22px;height:22px;padding:0 4px;border-radius:20px;background:#a71c32;color:white;font:700 12px/22px system-ui;text-align:center}#lsea-bell-count[hidden]{display:none}
#lsea-bell-panel{position:fixed;inset:.6rem .6rem auto auto;margin:0;width:min(440px,calc(100vw - 1.2rem));max-height:85dvh;box-sizing:border-box;padding:20px;border:1px solid #c9d4df;border-radius:15px;background:#fff;color:#16334d;overflow:auto;box-shadow:0 12px 45px #0004;font-family:system-ui,sans-serif}
#lsea-bell-panel::backdrop{background:#122b4433}.bell-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.bell-heading h2{font-size:23px;margin:0}.bell-heading button{font-size:26px}.bell-actions{display:flex;flex-wrap:wrap;gap:8px}#lsea-bell-panel button{cursor:pointer;min-height:36px;border:1px solid #b8c9d8;border-radius:6px;background:transparent;color:inherit;padding:6px 10px;font:inherit}#lsea-bell-panel button:disabled{opacity:.55;cursor:default}.bell-help{font-size:12px;line-height:1.5;color:#52677b}.bell-item{display:grid;grid-template-columns:1fr auto;gap:8px;padding:14px 10px;margin-top:8px;border:1px solid #dae2e9;border-radius:8px}.bell-item a{grid-column:1/-1;color:inherit;font-size:14px;line-height:1.5}.bell-item small{align-self:center;font-size:11px}.bell-item button{font-size:12px!important}.bell-unread{border-left:4px solid #b67a00;background:#fff8e7}.bell-unread a{font-weight:700}
html[data-theme="dark"] #lsea-bell,html[data-theme="dark"] #lsea-bell-panel{background:#152f48;color:#eef4fc;border-color:#42617b}html[data-theme="dark"] .bell-unread{background:#263e50}html[data-theme="dark"] .bell-help{color:#bfcede}
#lsea-bell:focus-visible,#lsea-bell-panel :focus-visible{outline:3px solid #d59b25;outline-offset:3px}
html:not([data-night="off"]) #lsea-bell-panel::after{content:'';position:fixed;inset:0;background:var(--night-tint,transparent);pointer-events:none;z-index:2147483647}
