:root {
  --bg: #0b0b0c; --card: rgba(18, 18, 20, 0.94); --card-solid: #121214; --raise: #1a1a1d; --line: #26262b; --line2: #33333a;
  --ink: #ececef; --ink2: #b4b4bc; --mute: #7f7f89; --accent: #ffffff; --red: #ff4a4a;
  --radius: 14px; --shadow: 0 10px 40px rgba(0, 0, 0, 0.45); --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top-h: 60px; --panel-w: 372px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
#map { position: fixed; inset: 0; }
.muted { color: var(--mute); } .small { font-size: 12px; }

/* splash */
#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity .6s ease, visibility .6s; }
#splash.gone { opacity: 0; visibility: hidden; }
.splash-in { text-align: center; color: #d8d8dc; }
.splash-logo { width: 64px; height: 64px; animation: spin 6s linear infinite; }
.splash-name { margin-top: 14px; font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.splash-sub { margin-top: 4px; color: var(--mute); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* top bar */
#top { position: fixed; z-index: 20; top: 12px; left: 12px; right: 12px; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 650; font-size: 16px; letter-spacing: .01em; white-space: nowrap; color: #f2f2f4; }
.brand svg { width: 26px; height: 26px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 74, 74, .6); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(255, 74, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 74, 74, 0); } }
.search { position: relative; flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; height: 40px; padding: 0 12px; gap: 8px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; }
.search:focus-within { border-color: var(--line2); background: #1e1e22; }
.search svg { width: 17px; height: 17px; color: var(--mute); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 14px; }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.results { position: absolute; left: 0; right: 0; top: 46px; background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 5; }
.results button { display: block; width: 100%; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.results button:last-child { border-bottom: 0; }
.results button:hover, .results button.on { background: var(--raise); }
.results b { display: block; font-weight: 600; }
.results span { color: var(--mute); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex: none; }
.seg button { padding: 6px 11px; border-radius: 7px; color: var(--ink2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button[aria-checked="true"] { background: #f0f0f2; color: #0b0b0c; }
.tools { display: flex; gap: 2px; margin-left: auto; flex: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--ink2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--raise); color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: #fff; background: #222226; }
.icon-btn.small { width: 30px; height: 30px; } .icon-btn.small svg { width: 16px; height: 16px; }
#progress { position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff, transparent); background-size: 40% 100%; background-repeat: no-repeat; opacity: 0; transition: opacity .3s; }
#progress.on { opacity: .7; animation: prog 1.2s linear infinite; }
@keyframes prog { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* side panel (desktop) / bottom sheet (phone) */
#panel { position: fixed; z-index: 15; top: calc(var(--top-h) + 24px); left: 12px; bottom: 12px; width: var(--panel-w); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; }
.grab { display: none; }
.tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; padding: 9px 6px 11px; color: var(--mute); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: #f0f0f2; }
.tabs b { font-weight: 600; font-size: 11px; color: var(--ink2); background: var(--raise); border-radius: 20px; padding: 1px 6px; margin-left: 3px; }
.tabs b:empty { display: none; }
.tabbody { flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.tabbody section { padding: 10px 10px 16px; }

/* layer rows */
.group-title { margin: 12px 6px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.group-title:first-child { margin-top: 4px; }
.layer { border: 1px solid transparent; border-radius: 12px; margin-bottom: 2px; }
.layer.on { background: rgba(255, 255, 255, 0.025); border-color: var(--line); }
.layer-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; cursor: pointer; user-select: none; }
.swatch { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: #1d1d21; }
.swatch i { width: 10px; height: 10px; border-radius: 50%; }
.swatch.hatch i { border-radius: 2px; width: 14px; height: 14px; background: repeating-linear-gradient(135deg, #d4b25a 0 2px, transparent 2px 5px); border: 1px solid #d4b25a; }
.swatch.zone i { width: 14px; height: 14px; border: 1.5px dashed #ff7043; background: rgba(255, 112, 67, .18); }
.swatch.plane svg, .swatch.ship svg { width: 14px; height: 14px; }
.layer-name { flex: 1; min-width: 0; }
.layer-name b { display: block; font-weight: 550; font-size: 14px; color: var(--ink); }
.layer-name small { display: block; color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-name small.warn { color: #e0b45a; } .layer-name small.err { color: #ff8a80; }
.state { width: 8px; height: 8px; border-radius: 50%; background: #3a3a40; flex: none; }
.state.ok { background: #6fdc8c; } .state.loading { background: #fff; animation: blink 1s infinite; } .state.limited, .state.stale { background: #e0b45a; } .state.error, .state.blocked { background: #ff6b6b; }
@keyframes blink { 50% { opacity: .25; } }
.toggle { width: 34px; height: 20px; border-radius: 20px; background: #2b2b31; position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8b8b93; transition: transform .2s, background .2s; }
.layer.on .toggle { background: #e9e9ec; } .layer.on .toggle::after { transform: translateX(14px); background: #0b0b0c; }
.layer-more { padding: 0 10px 10px 44px; display: none; }
.layer.open .layer-more { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink2); font-size: 12px; margin: 2px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend i.ring { background: transparent !important; border: 1.5px solid; }
.note { color: var(--mute); font-size: 12px; margin: 4px 0; }
.note a { color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.chip { padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line2); color: var(--ink2); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 7px; height: 7px; border-radius: 50%; }
.chip[aria-pressed="false"] { opacity: .45; }
.chip[aria-pressed="true"] { border-color: #55555e; color: var(--ink); background: #1c1c20; }
.link-btn { color: var(--ink2); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 10px; background: #f0f0f2; color: #0b0b0c; font-weight: 600; text-decoration: none; font-size: 13px; }
.btn.ghost { background: var(--raise); color: var(--ink); border: 1px solid var(--line); }
.panel-foot { margin: 16px 6px 0; color: var(--mute); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }

/* feed */
.feed-head { position: sticky; top: -10px; z-index: 2; background: var(--card-solid); margin: -10px -10px 0; padding: 10px 10px 6px; border-bottom: 1px solid var(--line); }
.hotspots { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.hotspots::-webkit-scrollbar { display: none; }
.hot { flex: none; padding: 7px 10px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); text-align: left; max-width: 170px; }
.hot b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot span { font-size: 11px; color: #ff8a80; }
.hot-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 2px 0 6px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.feed li:hover { background: rgba(255, 255, 255, .025); }
.feed .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.feed .txt { min-width: 0; flex: 1; }
.feed .t1 { font-weight: 500; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed .t2 { color: var(--mute); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .kind { color: var(--ink2); }
.feed-empty { color: var(--mute); padding: 20px 8px; text-align: center; }

/* here */
.here-empty { padding: 14px 6px; color: var(--ink2); }
.here-empty p { margin: 0 0 12px; }
.here-title { margin: 4px 4px 2px; font-size: 19px; font-weight: 650; }
.here-sub { margin: 0 4px 10px; color: var(--mute); font-size: 12.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 12px; }
.stat { background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; text-align: left; }
.stat b { display: block; font-size: 18px; font-weight: 650; }
.stat span { display: flex; align-items: center; gap: 5px; color: var(--mute); font-size: 11px; white-space: nowrap; overflow: hidden; }
.stat span i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.callout { border: 1px solid var(--line2); border-left: 3px solid #ff7043; border-radius: 10px; padding: 9px 11px; margin: 8px 0; background: rgba(255, 112, 67, .05); font-size: 13px; color: var(--ink2); }
.callout b { color: var(--ink); }
.callout.disp { border-left-color: #d4b25a; background: rgba(212, 178, 90, .05); }
.sub-h { margin: 14px 4px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); display: flex; justify-content: space-between; }
.heads { list-style: none; margin: 0; padding: 0; }
.heads li { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.heads a { text-decoration: none; font-weight: 500; }
.heads a:hover { text-decoration: underline; }
.heads small { display: block; color: var(--mute); font-size: 12px; }

/* replay */
.replay { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.replay input { flex: 1; accent-color: #f0f0f2; height: 20px; }
#scrubLabel { min-width: 74px; text-align: right; font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* detail card */
.detail { position: fixed; z-index: 25; top: calc(var(--top-h) + 24px); right: 12px; width: 360px; max-height: calc(100% - var(--top-h) - 36px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 16px; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 9px; font-size: 22px; line-height: 1; color: var(--mute); }
.close:hover { background: var(--raise); color: var(--ink); }
.d-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.d-kind i { width: 8px; height: 8px; border-radius: 50%; }
.d-title { margin: 8px 30px 6px 0; font-size: 17px; font-weight: 650; line-height: 1.3; }
.d-meta { color: var(--mute); font-size: 12.5px; margin-bottom: 10px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.d-grid div { background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.d-grid small { display: block; color: var(--mute); font-size: 11px; }
.d-grid b { font-weight: 600; font-size: 14px; }
.d-text { color: var(--ink2); font-size: 13.5px; margin: 8px 0; }
.d-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.d-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 300px; overflow: auto; }
.d-list li { padding: 7px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.d-list li small { display: block; color: var(--mute); font-size: 11.5px; }

#toast { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #f0f0f2; color: #0b0b0c; padding: 9px 16px; border-radius: 10px; font-weight: 550; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* about */
dialog#about { width: min(620px, calc(100% - 24px)); max-height: calc(100% - 40px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow); }
dialog#about::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.about-in { padding: 22px 22px 18px; }
.about-credit { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.about-credit svg { width: 54px; height: 54px; flex: none; }
.about-credit h2 { margin: 0; font-size: 22px; }
.about-credit .by { margin: 2px 0 0; font-size: 16px; } .about-credit .by b { font-weight: 700; }
.about-credit .helper { margin: 2px 0 0; color: var(--mute); font-size: 12px; }
.about-in h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 18px 0 6px; }
.limits, .sources { margin: 0; padding-left: 18px; color: var(--ink2); font-size: 13px; }
.limits li, .sources li { margin: 5px 0; }
.sources a { color: var(--ink); }
.apps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.apps .muted { font-size: 12px; flex-basis: 100%; }

/* map controls */
.maplibregl-ctrl-group { background: var(--card) !important; border: 1px solid var(--line); box-shadow: var(--shadow) !important; border-radius: 10px !important; }
.maplibregl-ctrl-group button { width: 34px !important; height: 34px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-icon { filter: invert(1) brightness(.85); }
.maplibregl-ctrl-attrib { background: rgba(11, 11, 12, .7) !important; color: var(--mute); font-size: 10.5px; }
.maplibregl-ctrl-attrib a { color: var(--ink2) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-bottom-right { right: 0; }
.maplibregl-ctrl-scale { background: rgba(11, 11, 12, .6); color: var(--ink2); border-color: var(--ink2); }
.maplibregl-popup-content { background: var(--card-solid); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: 12.5px var(--font); box-shadow: var(--shadow); }
.maplibregl-popup-tip { display: none; }
body.light .maplibregl-ctrl-attrib { background: rgba(255, 255, 255, .7) !important; }

/* phone: compact top bar, bottom sheet */
@media (max-width: 760px) {
  :root { --top-h: 50px; }
  #top { top: 8px; left: 8px; right: 8px; gap: 8px; padding: 0 6px 0 10px; flex-wrap: nowrap; }
  .brand span, .brand .live-dot { display: none; }
  .search { height: 36px; max-width: none; }
  .seg { display: none; }
  .tools .icon-btn { width: 34px; height: 34px; }
  #btnHeat, #btnLocate, #btnBase, #btnTour, #btnFull { display: none; }
  .statbar { display: none !important; }
  .breaking { top: 62px !important; left: 8px !important; right: 8px !important; transform: none !important; width: auto !important; }
  .caption { top: 62px !important; max-width: calc(100% - 16px); }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: var(--sheet-h, 168px); border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); transition: height .28s cubic-bezier(.2, .8, .2, 1); }
  #panel.dragging { transition: none; }
  .grab { display: block; flex: none; padding: 8px 0 2px; cursor: grab; touch-action: none; }
  .grab i { display: block; width: 40px; height: 4px; border-radius: 4px; background: #44444b; margin: 0 auto; }
  .tabs { padding-top: 0; touch-action: none; }
  .mobile-seg { display: flex !important; margin: 2px 0 8px; }
  .mobile-seg button { flex: 1; }
  .mobile-tools { display: flex !important; gap: 6px; margin: 0 0 6px; flex-wrap: wrap; }
  .detail { top: auto; left: 8px; right: 8px; width: auto; bottom: calc(var(--sheet-h, 168px) + 8px); max-height: 52vh; }
  .maplibregl-ctrl-top-right { top: 62px; }
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--sheet-h, 168px); }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
.mobile-seg, .mobile-tools { display: none; }
.mobile-tools .chip { padding: 7px 12px; font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ---------- v2: stat bar, breaking alerts, tour caption ---------- */
.statbar { position: fixed; z-index: 12; top: calc(var(--top-h) + 24px); left: calc(var(--panel-w) + 24px); display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - var(--panel-w) - 400px); pointer-events: none; }
.statbar.empty { display: none; }
.sc { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink2); font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.sc:hover { border-color: var(--line2); color: var(--ink); }
.sc i { width: 7px; height: 7px; border-radius: 50%; }
.sc b { color: var(--ink); font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.sc small { color: #ffa726; font-size: 11px; }
.breaking { position: fixed; z-index: 30; top: calc(var(--top-h) + 24px); left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.alert { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 12px; background: rgba(32, 12, 12, .96); border: 1px solid #6b2323; border-left: 3px solid var(--red); box-shadow: var(--shadow); animation: pop .25s ease; }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; animation: live 1.6s infinite; }
.alert-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.alert-txt b { font-size: 10.5px; letter-spacing: .12em; color: #ff8a80; }
.alert-txt span { color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.caption { position: fixed; z-index: 14; top: calc(var(--top-h) + 24px); left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); padding: 10px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: center; box-shadow: var(--shadow); animation: pop .3s ease; }
.caption b { display: block; font-size: 15px; font-weight: 650; }
.caption span { display: block; font-size: 12.5px; color: var(--ink2); margin-top: 2px; }
.btn.small { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.close.sm { position: static; width: 28px; height: 28px; font-size: 18px; flex: none; }

/* layer rows: icons, collapsible details */
.swatch.ico svg { width: 17px; height: 17px; }
.more-btn { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--mute); flex: none; }
.more-btn:hover { background: var(--raise); color: var(--ink); }
.more-btn svg { transition: transform .2s; }
.layer.open .more-btn svg { transform: rotate(180deg); }
.layer-more { padding-left: 10px; }

/* watched places, alerts row */
.watch-row { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.watch-row:hover { background: var(--raise); border-color: var(--line); }
.wdot { width: 8px; height: 8px; border-radius: 50%; background: #3a3a40; flex: none; }
.wdot.warm { background: #e0b45a; } .wdot.hot { background: var(--red); animation: live 1.6s infinite; }
.wname { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.watch-row small { flex: 1; min-width: 0; color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.alerts-row { display: flex; align-items: center; gap: 10px; margin: 14px 4px 0; flex-wrap: wrap; }
.alerts-row small { color: var(--mute); font-size: 11.5px; }
.here-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.here-names { min-width: 0; }
.star[aria-pressed="true"] { color: #ffd54f; }
.star[aria-pressed="true"] svg path { fill: #ffd54f; }

/* feed extras */
.feed-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.feed-actions .btn { gap: 6px; }
.board { margin: 10px 0 4px; }
.bar { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 10px; margin-bottom: 4px; border-radius: 8px; background: var(--raise); overflow: hidden; font-size: 13px; text-align: left; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(255,74,74,.28), rgba(255,74,74,.06)); border-radius: 8px; transition: width .5s ease; }
.bar b, .bar em { position: relative; font-weight: 550; } .bar em { font-style: normal; color: var(--ink2); font-variant-numeric: tabular-nums; }
.skel { display: flex; gap: 10px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.skel .dot { width: 9px; height: 9px; border-radius: 50%; background: #2a2a30; margin-top: 6px; }
.skel .bar1, .skel .bar2 { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #1d1d21 25%, #2a2a30 50%, #1d1d21 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skel .bar1 { width: 85%; margin-bottom: 8px; } .skel .bar2 { width: 55%; height: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* detail accent, keys */
.detail { border-top: 3px solid var(--accent, #fff); }
kbd { background: var(--raise); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font: 600 11px var(--font); color: var(--ink); }
.keys { color: var(--ink2); font-size: 13px; line-height: 2; margin: 0; }
.icon-btn:focus-visible, .layer-row:focus-visible, .chip:focus-visible, .btn:focus-visible, .watch-row:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.layer-row { transition: background .15s; } .layer-row:hover { background: rgba(255,255,255,.03); border-radius: 12px; }
.toggle { transition: background .2s; }

/* ---------- v4: Journalist Aws, quick views, tab polish ---------- */
.tabs { gap: 2px; }
.tabs button { font-size: 13px; position: relative; }
.tab-aws::after { content: ""; position: absolute; top: 9px; right: 18%; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.tab-aws[aria-selected="true"]::after { display: none; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 2px 8px; }
.presets small { width: 100%; color: var(--mute); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.presets .chip { cursor: pointer; padding: 5px 11px; }
.presets .chip:hover { border-color: #66666f; color: var(--ink); }
.aws-ask { width: 100%; margin: 4px 0 6px; justify-content: flex-start; gap: 9px; background: #f0f0f2; }
.aws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255,74,74,.6); animation: live 2s infinite; }
.aws-head { display: flex; align-items: center; gap: 11px; padding: 4px 2px 12px; }
.aws-avatar { width: 38px; height: 38px; flex: none; display: block; }
.aws-avatar svg { width: 100%; height: 100%; display: block; }
.aws-id { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.aws-id b { font-size: 16px; }
.aws-id span { color: var(--mute); font-size: 12px; }
.aws-card { background: linear-gradient(160deg, #19191d, #131316); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.aws-card h3 { margin: 0 0 6px; font-size: 18px; }
.aws-card p { margin: 0 0 12px; color: var(--ink2); }
.aws-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.aws-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.aws-chips .chip { cursor: pointer; text-align: left; border-radius: 12px; padding: 7px 12px; line-height: 1.3; }
.aws-chips .chip:hover { border-color: #66666f; color: var(--ink); }
.aws-settings { background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.aws-settings h4 { margin: 0 0 6px; font-size: 15px; }
.aws-key, .aws-model, .aws-input { width: 100%; background: #101012; border: 1px solid var(--line2); border-radius: 10px; color: var(--ink); font: inherit; padding: 9px 11px; outline: 0; }
.aws-key:focus, .aws-model:focus, .aws-input:focus { border-color: #7a7a84; }
.aws-row { display: flex; gap: 8px; margin: 8px 0 4px; }
.aws-label { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--mute); }
.aws-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; color: var(--ink2); font-size: 13px; }
.aws-thread { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.msg { display: flex; gap: 9px; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #f0f0f2; color: #0b0b0c; border-radius: 16px 16px 4px 16px; max-width: 86%; }
.msg.aws .aws-avatar { width: 28px; height: 28px; margin-top: 2px; }
.aws-col { min-width: 0; flex: 1; }
.bubble { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--raise); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user .bubble { border: 0; }
.bubble.error { border-color: #6b2323; background: rgba(255,74,74,.07); color: #ffb4ac; }
.bubble p { margin: 0 0 6px; } .bubble p:last-child { margin-bottom: 0; }
.aws-list { margin: 4px 0 6px; padding-left: 18px; } .aws-list li { margin: 5px 0; }
.aws-next { color: var(--ink2); font-style: italic; }
.dateline { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--mute); margin: 0 2px 4px; }
.cite { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px 0 3px; border-radius: 9px; background: #2a2a31; color: var(--ink); font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.cite:hover { background: #fff; color: #0b0b0c; }
.aws-msg-actions { display: flex; gap: 14px; margin: 5px 4px 0; }
.typing { display: inline-flex; gap: 4px; padding: 3px 0; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); animation: blink 1s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
.aws-compose { position: sticky; bottom: -16px; display: flex; align-items: flex-end; gap: 8px; padding: 10px 0 4px; background: linear-gradient(to top, var(--card-solid) 70%, transparent); }
.aws-input { resize: none; max-height: 110px; line-height: 1.4; }
.aws-send { background: #f0f0f2; color: #0b0b0c; flex: none; border-radius: 12px; }
.aws-send:disabled, .aws-input:disabled { opacity: .4; }
.aws-foot { margin-top: 4px; color: var(--mute); font-size: 11.5px; }
@media (max-width: 760px) { .tab-aws::after { right: 22%; } .msg.user .bubble { max-width: 92%; } }
.aws-intro { margin: 0 0 8px; color: var(--ink2); }
.aws-settings h4 { font-size: 17px; }

.aws-pair { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.aws-steps { margin: 6px 0 8px; padding-left: 18px; color: var(--ink2); font-size: 13px; }
.aws-code { font: 700 22px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 12px 6px; margin: 8px 0; border-radius: 12px; background: #101012; border: 1px solid var(--line2); user-select: all; }
.aws-qr { display: block; margin: 8px auto; border-radius: 10px; background: #fff; padding: 8px; image-rendering: pixelated; }
.aws-codein { text-align: center; letter-spacing: .1em; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }

/* ---------- v5: place conditions, Wikipedia, activity chart, voice ---------- */
.wx { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 8px 0; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.wx-main { display: flex; align-items: baseline; gap: 8px; } .wx-main b { font-size: 26px; font-weight: 650; } .wx-main span { color: var(--ink2); }
.wx-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--mute); font-size: 12px; }
.wx-aqi { display: inline-flex; align-items: center; gap: 5px; color: var(--ink2); } .wx-aqi i { width: 8px; height: 8px; border-radius: 50%; }
.wiki { margin: 6px 0 4px; } .wiki-desc { margin: 0 4px 2px; color: var(--ink2); font-style: italic; font-size: 13px; } .wiki-text { margin: 0 4px 6px; color: var(--ink2); font-size: 13.5px; line-height: 1.5; }
.wiki .link-btn { margin-left: 4px; }
.activity { margin: 10px 0 2px; }
.act-bars { display: flex; align-items: flex-end; gap: 2px; height: 54px; padding: 0 2px; }
.act-bars i { flex: 1; min-width: 2px; background: linear-gradient(to top, #6b2a2a, #ff4a4a 120%); border-radius: 2px 2px 0 0; opacity: .85; transition: height .4s ease; }
.act-bars i.peak { opacity: 1; box-shadow: 0 0 10px rgba(255, 74, 74, .5); } .act-bars i:hover { opacity: 1; background: #fff; }
.act-axis { display: flex; justify-content: space-between; color: var(--mute); font-size: 11px; margin-top: 3px; padding: 0 2px; }
.aws-mic { flex: none; } .aws-mic.rec { background: rgba(255, 74, 74, .2); color: #ff8a80; animation: live 1.4s infinite; }

/* ---------- v6: dialogs, palette, health, alerts, welcome, polish ---------- */
dialog.dlg { width: min(560px, calc(100% - 24px)); max-height: calc(100% - 48px); padding: 0; border: 1px solid var(--line2); border-radius: 18px; background: var(--card-solid); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: auto; animation: pop .18s ease; }
dialog.dlg.wide { width: min(760px, calc(100% - 24px)); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.dlg > :not(.pal-top):not(.pal-list):not(.pal-foot) { margin-left: 20px; margin-right: 20px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 18px !important; margin-bottom: 10px; }
.dlg-head h2 { margin: 0; font-size: 19px; } .dlg-head p { margin: 2px 0 0; }
dialog.dlg > .aws-row, dialog.dlg > .note, dialog.dlg > p { margin-bottom: 16px; }
.dlg .close { position: static; }

/* palette */
dialog.pal { width: min(620px, calc(100% - 24px)); margin-top: 11vh; overflow: hidden; }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-input { flex: 1; background: none; border: 0; outline: 0; color: var(--ink); font: 500 17px var(--font); min-width: 0; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 420px); overflow: auto; }
.pal-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-list li.on { background: #24242a; } .pal-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-hint { color: var(--mute); font-size: 12px; } .pal-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); min-width: 58px; text-align: right; }
.pal-empty { color: var(--mute); padding: 18px 12px; cursor: default !important; } .pal-foot { padding: 9px 16px 12px; border-top: 1px solid var(--line); }

/* settings */
.opt-group { margin: 14px 20px 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); } .opt-group:last-of-type { border-bottom: 0; }
.opt-group h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.seg2 { display: flex; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg2 button { flex: 1; padding: 8px 10px; border-radius: 7px; color: var(--ink2); font-size: 13px; } .seg2 button[aria-checked="true"] { background: #f0f0f2; color: #0b0b0c; font-weight: 600; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; cursor: pointer; } .opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: #f0f0f2; flex: none; }
.opt b { display: block; font-weight: 550; } .opt small { display: block; color: var(--mute); font-size: 12px; margin-top: 1px; }
.btn.danger { background: #3a1616; color: #ffb4ac; border: 1px solid #6b2323; } .btn.danger:hover { background: #4a1c1c; }

/* data sources */
.health-sum { margin: 4px 0 10px; } .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
table.health { width: 100%; border-collapse: collapse; font-size: 13px; } table.health th { text-align: left; padding: 9px 12px; color: var(--mute); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); background: var(--raise); position: sticky; top: 0; }
table.health td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } table.health tr:last-child td { border-bottom: 0; } table.health small { color: var(--mute); } table.health small.err { color: #ff9a90; }
.hdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #6fdc8c; } .hdot.degraded { background: #e0b45a; } .hdot.down { background: #ff6b6b; }

/* alert history */
.alert-list { list-style: none; margin: 0 20px 12px; padding: 0; max-height: 50vh; overflow: auto; } .alert-list li { display: flex; align-items: center; gap: 10px; padding: 11px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.alert-list li:hover { background: rgba(255, 255, 255, .03); } .alert-list li.new span { font-weight: 600; } .alert-list span { flex: 1; min-width: 0; } .alert-list small { color: var(--mute); white-space: nowrap; }
.adot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; } .adot.quake { background: #ffa726; } .adot.hazard { background: #4fc3f7; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font: 700 10px/16px var(--font); text-align: center; } .icon-btn { position: relative; }

/* welcome */
.welcome-in { padding: 24px 24px 22px; } .welcome-in h2 { margin: 0 0 4px; font-size: 24px; } .wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.wcard { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; } .wcard b { display: block; margin-bottom: 3px; } .wcard span { color: var(--ink2); font-size: 13px; line-height: 1.45; }
dialog#welcome > .welcome-in { margin: 0 !important; }

/* misc */
.offline { position: fixed; z-index: 60; left: 50%; top: 8px; transform: translateX(-50%); background: #f0f0f2; color: #0b0b0c; padding: 8px 16px; border-radius: 0 0 12px 12px; font-weight: 550; font-size: 13px; box-shadow: var(--shadow); }
.foot-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 4px 0; } .foot-tools .chip { cursor: pointer; padding: 6px 12px; } .foot-tools .chip:hover { border-color: #66666f; color: var(--ink); }
.export-row { margin-top: 6px; }
body.saver *, body.saver *::before, body.saver *::after { animation: none !important; transition: none !important; }
::selection { background: rgba(255, 255, 255, .22); }
.tabbody { scrollbar-width: thin; scrollbar-color: #3a3a42 transparent; } .tabbody::-webkit-scrollbar { width: 8px; } .tabbody::-webkit-scrollbar-thumb { background: #3a3a42; border-radius: 8px; }
#top { background-image: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent); } #panel { background-image: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 30%); }
.icon-btn:active, .chip:active, .btn:active { transform: scale(.97); } .btn { transition: background .15s, transform .1s; } .btn:hover { background: #fff; }
.layer-row:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (max-width: 760px) {
  #btnPalette, #btnAlerts, #btnSettings { display: none; }
  .wgrid { grid-template-columns: 1fr; } dialog.pal { margin-top: 6vh; } .pal-group { display: none; }
  dialog.dlg { max-height: calc(100% - 24px); }
}
.opt { min-height: 44px; align-items: center; }
.seg2 button, .pal-list li, .alert-list li { min-height: 40px; }


.btn.small { min-height: 34px; }
@media (max-width: 760px), (pointer: coarse) { .btn.small { min-height: 40px; padding: 9px 14px; } .chip { min-height: 34px; } .icon-btn.small { width: 36px; height: 36px; } .close { width: 38px; height: 38px; } }


.dlg-head .close { flex: none; min-width: 38px; }


/* ---------- v7: ticker, country facts ---------- */
.ticker { position: fixed; z-index: 11; left: calc(var(--panel-w) + 24px); right: 76px; bottom: 34px; display: flex; justify-content: center; pointer-events: none; }
.tick { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--line2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 26px rgba(0,0,0,.4); animation: pop .35s ease; font-size: 13px; color: var(--ink); }
.tick:hover { border-color: #77777f; } .tick i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--red); animation: live 1.8s infinite; } .tick-quake i { background: #ffa726; } .tick-alert i { background: #4fc3f7; }
.tick b { font-size: 10px; letter-spacing: .12em; color: var(--mute); flex: none; } .tick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tick small { color: var(--mute); flex: none; }
.facts { margin: 10px 0; padding: 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.facts-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .flag { font-size: 34px; line-height: 1; } .facts-head b { display: block; } .facts-head small { color: var(--mute); }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .facts-grid > div { background: #101012; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; } .facts-grid small { display: block; color: var(--mute); font-size: 11px; } .facts-grid b { font-weight: 600; font-size: 13.5px; }
.facts .note { margin: 8px 0 0; }
body.saver .tick i { animation: none; }
@media (max-width: 760px) { .ticker { display: none !important; } }
