/* CAISAR Live Map — theme tokens (caisar.org navy + signal orange), shared controls, account menu and Settings.
   Dark by default; light via [data-theme=light] or the system setting. monitor.css styles the map and its panels. */

:root {
  --bg: #0F1C2E; --bg-2: #12223A; --card: #12223A; --card-2: #152539; --line: #22344D; --line-2: #2A3E5A;
  --text: #E8EDF3; --muted: #A9B8CA; --muted-2: #C4D0DE; --faint: #6F84A0;
  --accent: #F28C38; --accent-text: #0F1C2E; --accent-soft: rgba(242, 140, 56, .16); --accent-soft-text: #FFC08A; --link: #F2A65A;
  --hud: #7FB6FF;
  --high: #FF6B6B; --high-soft: rgba(255, 107, 107, .15); --med: #FFB547; --low: #6F84A0;
  --ok: #4FD69C; --ok-soft: rgba(79, 214, 156, .14); --info: #7FB6FF; --info-soft: rgba(127, 182, 255, .14);
  --shadow: 0 18px 44px rgba(2, 8, 20, .5); --blur: blur(16px) saturate(140%);
  --radius: 14px; --r-ctl: 8px; --nav-h: 0px;
  --font: Inter, system-ui, sans-serif; --display: 'Barlow Condensed', Inter, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme]) {
  --bg: #F4F6F9; --bg-2: #FFFFFF; --card: #FFFFFF; --card-2: #EDF1F6; --line: #DCE3EC; --line-2: #C8D2DE;
  --text: #0F1C2E; --muted: #4A607E; --muted-2: #2A3E5A; --faint: #8FA3BC;
  --accent: #F28C38; --accent-text: #0F1C2E; --accent-soft: rgba(242, 140, 56, .16); --accent-soft-text: #B4470A; --link: #B4470A;
  --hud: #1F5FBF;
  --high: #D2312F; --high-soft: rgba(210, 49, 47, .1); --med: #B86E00; --low: #8FA3BC;
  --ok: #128552; --ok-soft: rgba(18, 133, 82, .1); --info: #1F5FBF; --info-soft: rgba(31, 95, 191, .1);
  --shadow: 0 14px 36px rgba(15, 28, 46, .16);
  color-scheme: light;
}}
:root[data-theme="light"] {
  --bg: #F4F6F9; --bg-2: #FFFFFF; --card: #FFFFFF; --card-2: #EDF1F6; --line: #DCE3EC; --line-2: #C8D2DE;
  --text: #0F1C2E; --muted: #4A607E; --muted-2: #2A3E5A; --faint: #8FA3BC;
  --accent: #F28C38; --accent-text: #0F1C2E; --accent-soft: rgba(242, 140, 56, .16); --accent-soft-text: #B4470A; --link: #B4470A;
  --hud: #1F5FBF;
  --high: #D2312F; --high-soft: rgba(210, 49, 47, .1); --med: #B86E00; --low: #8FA3BC;
  --ok: #128552; --ok-soft: rgba(18, 133, 82, .1); --info: #1F5FBF; --info-soft: rgba(31, 95, 191, .1);
  --shadow: 0 14px 36px rgba(15, 28, 46, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .9em; background: var(--card-2); padding: 1px 5px; border-radius: 4px; }

/* full-bleed map page */
body > .wm-slot { position: fixed; inset: 0; width: auto; height: auto; }

/* shared controls the map panels use */
.muted { color: var(--muted); }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.btn { height: 38px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 700; }
.btn.primary:hover { background: #F2A65A; color: var(--accent-text); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.ghost { background: none; }
.btn.danger { color: var(--high); }
.btn.on { background: var(--accent-soft); color: var(--accent-soft-text); border-color: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.chip { flex: none; font-size: 13px; padding: 6px 10px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--muted-2); background: none; }
.chip.active { background: var(--card-2); color: var(--text); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 3000; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* who may do what: hide editing controls from viewers, and places/plans from the public */
.ro [data-wm="savepoint"], .ro [data-wm="addcenter"], .ro [data-wm="editplace"], .ro [data-wm="askdel"], .ro [data-wm="delplace"],
.ro [data-wm="plandraw"], .ro [data-wm="planedit"], .ro [data-wm="planask"], .ro [data-wm="plandel"], .ro [data-wm="planstatus"] { display: none !important; }
.noplaces .wm-lrow:has(#wm-l-places), .noplans .wm-lrow:has(#wm-l-plans) { display: none !important; }

/* brand in the map's top bar */
.app-brand { gap: 10px !important; padding: 0 12px 0 6px !important; text-decoration: none; color: var(--text); }
.app-brand img { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.app-bt { display: flex; align-items: baseline; gap: 7px; line-height: 1; }
.app-bt h1, .app-bt b { margin: 0; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .06em; text-transform: none; }
.app-bt i { font-style: normal; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 899px) { .app-bt i { display: none; } }
@media (max-width: 520px) { .app-bt { display: none; } .app-brand { padding: 0 6px !important; } }
.app-me { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .04em; color: var(--accent) !important; }
.app-signin { display: flex !important; flex-direction: row !important; align-items: center; white-space: nowrap; width: auto !important; padding: 0 14px 0 11px !important; gap: 7px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text) !important; }
@media (max-width: 640px) { .app-signin { padding: 0 !important; width: 42px !important; } .app-signin span { display: none; } }

/* account menu */
.wm-topbtns { position: relative; }
.app-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 1200; display: flex; flex-direction: column; }
.app-menu > button, .app-menu > a { text-decoration: none; text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px 12px; font-size: 14px; cursor: pointer; color: var(--text); }
.app-menu > button:hover, .app-menu > a:hover { background: var(--card-2); }
.app-mh { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.app-mh span { font-size: 12px; color: var(--muted); }
.app-seg { display: flex; gap: 2px; margin: 6px 8px; padding: 3px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.app-seg button { flex: 1; border: 0; background: none; padding: 6px 4px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.app-seg button.on { background: var(--card-2); color: var(--text); }

/* Settings overlay */
.set { position: fixed; inset: 0; z-index: 2000; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; }
.set-box { width: min(860px, 100%); background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); }
.set-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.set-h h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .03em; }
.set-x { background: none; border: 0; color: var(--muted); padding: 8px; border-radius: 8px; cursor: pointer; display: flex; }
.set-x:hover { background: var(--card-2); color: var(--text); }
.set-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.set-tabs a { padding: 11px 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.set-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.set-body { padding: 6px 22px 22px; }
.set-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-sec:last-child { border-bottom: 0; }
.set-sec h3 { margin: 4px 0 10px; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.set-sec p { margin: 0 0 10px; font-size: 14px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; }
.set-grid .set-row, .set-grid .set-check { grid-column: 1 / -1; }
.set-f { display: block; margin: 8px 0; }
.set-f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted-2); margin-bottom: 5px; }
.set-f small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.set input:not([type=checkbox]):not([type=file]), .set select, .set textarea { width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); }
.set textarea { font-family: var(--mono); font-size: 12px; resize: vertical; margin: 6px 0; }
.set input:disabled { opacity: .6; }
.set-in { display: flex; gap: 8px; align-items: center; } .set-in input { flex: 1; min-width: 0; }
.set-in3 { display: grid; grid-template-columns: 1fr 1fr 80px; gap: 8px; }
.set-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.set-row.sticky { position: sticky; bottom: 0; background: var(--card); margin: 10px -22px -22px; padding: 12px 22px; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.set-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; cursor: pointer; }
.set-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.set-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 10px; background: var(--card-2); color: var(--muted-2); vertical-align: 1px; }
.set-pill.ok { background: var(--ok-soft); color: var(--ok); } .set-pill.warn { background: var(--high-soft); color: var(--high); }
.set-list { display: flex; flex-direction: column; gap: 8px; }
.set-item { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.set-item.off { opacity: .6; }
.set-item .muted { font-size: 13px; margin-top: 2px; }
.set-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .set-acts select { width: auto !important; min-height: 32px !important; padding: 4px 8px !important; }
.set-new { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 10px; padding: 12px 14px; margin: 10px 0; font-size: 14px; }
.set-new small { display: block; color: var(--muted-2); margin-top: 4px; }
.set-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; } .set-dl dt { color: var(--muted); } .set-dl dd { margin: 0; }
@media (max-width: 640px) { .set { padding: 0; } .set-box { border-radius: 0; min-height: 100%; border: 0; } .set-body, .set-h { padding-left: 16px; padding-right: 16px; } }

/* Settings → Feeds */
.set-feeds { display: flex; flex-direction: column; gap: 6px; }
.set-feed { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px 170px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.set-fn .muted { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.set-fi { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.set-fi select, .set-fi input { min-height: 32px !important; padding: 4px 8px !important; font-size: 13px; }
.set-fu { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; white-space: nowrap; }
.set-bad { color: var(--high); }
@media (max-width: 720px) { .set-feed { grid-template-columns: 1fr 1fr; } .set-fn, .set-fu { grid-column: 1 / -1; } .set-fu { justify-content: space-between; } }

.set-th { display: block; color: var(--muted); font-size: 12px; margin: -4px 0 8px 26px; }

/* installed app */
.app-offline { position: fixed; z-index: 2500; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top, 0px)); max-width: calc(100vw - 32px); padding: 8px 14px; border-radius: 10px; background: #B86E00; color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
@media (display-mode: standalone) { body > .wm-slot { top: env(safe-area-inset-top, 0px); } }

/* ‹ › arrows on sideways-scrolling strips */
.hs-wrap { position: relative; flex: none; min-width: 0; max-width: 100%; }

.hs-wrap > :first-child { overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.hs-wrap > :first-child::-webkit-scrollbar { display: none; }
.hs-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-size: 20px; line-height: 1; padding: 0 0 2px; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); cursor: pointer; }
.hs-btn:hover { border-color: var(--accent); color: var(--accent); }
.hs-l { left: 4px; } .hs-r { right: 4px; }
.hs-wrap.can-l .hs-l, .hs-wrap.can-r .hs-r { display: grid; place-items: center; }
.hs-wrap.can-l::before, .hs-wrap.can-r::after { content: ''; position: absolute; top: 0; bottom: 0; width: 46px; z-index: 2; pointer-events: none; }
.hs-wrap.can-l::before { left: 0; background: linear-gradient(90deg, var(--card) 30%, transparent); }
.hs-wrap.can-r::after { right: 0; background: linear-gradient(270deg, var(--card) 30%, transparent); }
