/* LASTSYNC — "situation room" theme.
   Near-black field, ice-cyan signal colour, red reserved for alerts.
   System fonts only (works offline). */
:root {
  --bg: #0b0c0e;
  --bg-2: #0f1012;
  --panel: rgba(30, 31, 33, 0.92);
  --panel-solid: #16171a;
  --panel-2: #252628;
  --line: #2e2f31;
  --line-2: #31343a;
  --text: #e4e6ea;
  --muted: #9ba1aa;
  --faint: #646a73;
  --accent: #8fb4d9;
  --accent-2: #c3d6ea;
  --accent-dim: rgba(143, 180, 217, 0.10);
  --accent-ink: #0b0c0e;
  --safe: #5fd49a;
  --help: #f0566a;
  --warn: #e3c96b;
  --meet: #7aa7e0;
  --ping: #b39ddb;
  --radius: 6px;
  --glow: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", "SF Mono", ui-monospace, Consolas, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 15px/1.55 var(--font); -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(143, 180, 217, 0.045), transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
/* faint scanlines */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3000;
  background: none;
  mix-blend-mode: overlay;
}
a { color: inherit; }
a:hover { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 650; }
h1 { font-size: 1.55rem; letter-spacing: 0.01em; }
h2 { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: #cfd3d9; }
h3 { font-family: var(--mono); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
p { margin: 0 0 0.8em; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(143, 180, 217, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262729; border: 2px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 10px; z-index: 950;
  background: linear-gradient(180deg, rgba(16, 17, 19, 0.96), rgba(12, 13, 15, 0.98));
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 18px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--mono); font-weight: 800; letter-spacing: 0.32em; font-size: 0.92rem; display: block; color: #fff; }
.brand-sub { display: block; font-family: var(--mono); font-size: 0.6rem; color: var(--faint); letter-spacing: 0.22em; text-transform: uppercase; margin-top: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 3px; text-decoration: none;
  color: var(--muted); font-weight: 550; font-size: 0.92rem; border: 1px solid transparent; position: relative;
}
.nav a:hover { color: var(--text); background: rgba(143, 180, 217, 0.05); }
.nav a.on { color: #fff; background: linear-gradient(90deg, rgba(143, 180, 217, 0.16), rgba(143, 180, 217, 0.02)); border-color: rgba(143, 180, 217, 0.18); }
.nav a.on::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(143, 180, 217, 0.25); }
.nav a.on svg { color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-group { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.22em; color: var(--faint); padding: 10px 12px 4px; text-transform: uppercase; }
.nav .badge { margin-left: auto; }
.nav a.get-app { margin-top: 8px; border: 1px dashed rgba(143, 180, 217, 0.35); color: var(--accent-2); }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--faint); line-height: 1.6; }
.offline-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--safe); box-shadow: 0 0 8px var(--safe); margin-right: 7px; vertical-align: 1px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
main { min-width: 0; padding: 26px clamp(16px, 3.4vw, 40px) 80px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 120px; height: 1px; background: var(--accent); box-shadow: 0 0 10px rgba(143, 180, 217, 0.25); }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.kicker { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }

/* ---------- HUD bar ---------- */
.hud {
  position: sticky; top: 0; z-index: 900; display: flex; align-items: stretch; height: 38px;
  background: rgba(11, 12, 14, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; overflow-x: auto; scrollbar-width: none;
}
.hud::-webkit-scrollbar { display: none; }
.hud-item { display: flex; align-items: center; gap: 8px; padding: 0 16px; border-right: 1px solid var(--line); white-space: nowrap; color: var(--muted); text-decoration: none; }
.hud-item b { color: var(--text); font-weight: 700; }
.hud-item .k { color: var(--faint); }
.hud-item.ok b { color: var(--safe); }
.hud-item.bad b { color: var(--help); }
.hud-item.warn b { color: var(--warn); }
.hud-item.alert { background: var(--help); color: #fff; animation: blink-bg 1.2s steps(2) infinite; }
.hud-item.alert b, .hud-item.alert .k { color: #fff; }
.hud-spacer { flex: 1; border-right: 1px solid var(--line); }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.ok .led { background: var(--safe); box-shadow: 0 0 8px var(--safe); }
.bad .led { background: var(--help); box-shadow: 0 0 8px var(--help); }
.warn .led { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
@keyframes blink-bg { 50% { background: #8f0f22; } }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; overflow-x: auto; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 4px 8px; }
  .brand-name, .brand-sub, .side-foot, .nav-sep, .nav-group { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { white-space: nowrap; padding: 7px 10px; font-size: 0.84rem; }
  .nav a.on::before { left: 6px; right: 6px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .nav a.get-app { margin-top: 0; }
  .hud { top: 49px; }
  main { padding-top: 18px; }
}

/* ---------- panels ---------- */
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--glow);
}
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none; border-color: rgba(143, 180, 217, 0.28); border-style: solid;
}
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.card::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.spacer { flex: 1; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 15px;
  border-radius: 3px; border: 1px solid var(--line-2); background: rgba(28, 29, 31, 0.9); color: var(--text);
  font-family: var(--mono); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { border-color: var(--accent); color: #fff; box-shadow: 0 0 0 1px rgba(143, 180, 217, 0.09), 0 0 16px rgba(143, 180, 217, 0.068); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, rgba(143, 180, 217, 0.28), rgba(143, 180, 217, 0.12)); border-color: var(--accent); color: #eafaff; box-shadow: 0 0 18px rgba(143, 180, 217, 0.081), inset 0 0 12px rgba(143, 180, 217, 0.054); }
.btn.primary:hover { background: linear-gradient(180deg, rgba(143, 180, 217, 0.4), rgba(143, 180, 217, 0.18)); }
.btn.danger { background: rgba(240, 86, 106, 0.06); border-color: rgba(240, 86, 106, 0.55); color: #f27a8a; }
.btn.danger:hover { border-color: var(--help); box-shadow: 0 0 16px rgba(240, 86, 106, 0.25); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 0.66rem; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { background: none; border: 1px solid transparent; padding: 6px; border-radius: 3px; cursor: pointer; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--accent-dim); border-color: rgba(143, 180, 217, 0.25); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="url"], input[type="tel"], input:not([type]), select, textarea {
  width: 100%; background: rgba(12, 13, 15, 0.85); border: 1px solid var(--line-2); border-radius: 3px; padding: 9px 12px; min-height: 40px; color: var(--text);
}
input::placeholder, textarea::placeholder { color: #535559; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(143, 180, 217, 0.063), 0 0 18px rgba(143, 180, 217, 0.045); }
label.field { display: block; }
label.field > span { display: block; font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 2px; font-family: var(--mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(28, 29, 31, 0.9); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.badge.ok { color: var(--safe); border-color: rgba(95, 212, 154, 0.4); background: rgba(95, 212, 154, 0.06); }
.badge.warn { color: var(--warn); border-color: rgba(227, 201, 107, 0.35); background: rgba(227, 201, 107, 0.05); }
.badge.bad { color: #f27a8a; border-color: rgba(240, 86, 106, 0.5); background: rgba(240, 86, 106, 0.08); }
.badge.blue { color: var(--meet); border-color: rgba(122, 167, 224, 0.45); background: rgba(122, 167, 224, 0.07); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 2px; border: 1px solid var(--line-2); background: rgba(21, 22, 24, 0.8); text-decoration: none; font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; color: var(--muted); }
.chip:hover, .chip.on { color: #fff; border-color: var(--accent); box-shadow: 0 0 12px rgba(143, 180, 217, 0.068); }
.chip.on { background: var(--accent-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.item-link { display: block; text-decoration: none; }
.item-link.row { display: flex; }
.item-link:hover strong { color: var(--accent-2); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(12, 13, 15, 0.4); }
.notice { padding: 12px 14px; border-radius: 3px; border: 1px solid var(--line-2); background: rgba(28, 29, 31, 0.7); border-left-width: 3px; }
.notice.warn { border-color: rgba(227, 201, 107, 0.35); border-left-color: var(--warn); background: rgba(227, 201, 107, 0.04); }
.notice.bad { border-color: rgba(240, 86, 106, 0.45); border-left-color: var(--help); background: rgba(240, 86, 106, 0.07); }
.notice.ok { border-color: rgba(95, 212, 154, 0.35); border-left-color: var(--safe); background: rgba(95, 212, 154, 0.05); }
mark { background: rgba(143, 180, 217, 0.22); color: #fff; border-radius: 2px; padding: 0 2px; box-shadow: 0 0 0 1px rgba(143, 180, 217, 0.135); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
kbd { font-family: var(--mono); font-size: 0.78em; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2500; display: grid; gap: 8px; }
.toast { background: rgba(19, 20, 22, 0.97); color: var(--text); padding: 10px 16px; border: 1px solid var(--accent); border-radius: 3px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; box-shadow: 0 0 24px rgba(143, 180, 217, 0.09); max-width: 90vw; }
.toast::before { content: "▸ "; color: var(--accent); }
.toast.bad { border-color: var(--help); box-shadow: 0 0 24px rgba(240, 86, 106, 0.3); }
.toast.bad::before { content: "✕ "; color: var(--help); }

.alert-bar { position: sticky; top: 0; z-index: 960; display: flex; gap: 12px; align-items: center; padding: 11px 18px; background: linear-gradient(90deg, #a5091f, #f0566a 50%, #a5091f); background-size: 200% 100%; animation: sweep 2.4s linear infinite; color: #fff; font-family: var(--mono); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; }
.alert-bar a { color: #fff; }
@keyframes sweep { to { background-position: -200% 0; } }

/* ---------- dashboard ---------- */
.cmd { position: relative; }
.cmd input { font-family: var(--mono); font-size: 1.05rem; min-height: 60px; padding-left: 56px; padding-right: 90px; border-radius: 3px; background: rgba(12, 13, 15, 0.92); border-color: var(--line-2); letter-spacing: 0.02em; box-shadow: inset 0 0 30px rgba(143, 180, 217, 0.018); }
.cmd svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--accent); }
.cmd::after { content: "ENTER ↵"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; color: var(--faint); }
.hero-search { position: relative; }
.hero-search input { font-family: var(--mono); font-size: 1rem; min-height: 54px; padding-left: 50px; }
.hero-search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--accent); }
.big-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 20px; }
@media (max-width: 860px) { .big-tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; min-height: 140px; border-radius: var(--radius); text-decoration: none; overflow: hidden;
  background: linear-gradient(160deg, rgba(33, 34, 36, 0.95), rgba(16, 17, 19, 0.95)); border: 1px solid var(--line); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border: 1px solid rgba(143, 180, 217, 0.12); border-radius: 50%; box-shadow: 0 0 0 18px rgba(143, 180, 217, 0.013), 0 0 0 36px rgba(143, 180, 217, 0.009); }
.tile:hover { border-color: var(--accent); box-shadow: 0 0 28px rgba(143, 180, 217, 0.063); transform: translateY(-1px); color: inherit; }
.tile .num { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.2em; color: var(--faint); }
.tile svg { width: 26px; height: 26px; color: #c9ced6; filter: drop-shadow(0 0 6px rgba(143, 180, 217, 0.18)); }
.tile strong { font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.18em; text-transform: uppercase; color: #fff; }
.tile span { color: var(--muted); font-size: 0.86rem; line-height: 1.35; }
.score { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--ring-color, var(--accent)) calc(var(--p) * 1%), rgba(143, 180, 217, 0.08) 0);
  box-shadow: 0 0 24px color-mix(in srgb, var(--ring-color, var(--accent)) 25%, transparent); }
.ring::before { content: attr(data-label); width: 70px; height: 70px; border-radius: 50%; background: var(--panel-solid); display: grid; place-items: center; font-family: var(--mono); font-weight: 800; font-size: 1.15rem; color: #fff; border: 1px solid var(--line); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 16px; }
.stat { background: var(--panel-solid); padding: 12px 14px; }
.stat .v { font-family: var(--mono); font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: 0.04em; }
.stat .v.ok { color: var(--safe); } .stat .v.bad { color: var(--help); } .stat .v.warn { color: var(--warn); }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- search ---------- */
.result { position: relative; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); text-decoration: none; display: block; }
.result:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(143, 180, 217, 0.045); color: inherit; }
.result + .result { margin-top: 8px; }
.result-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.result-title { font-weight: 700; color: #fff; }
.result-sub { color: var(--accent-2); font-size: 0.92rem; }
.result p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.search-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; }
@media (max-width: 860px) { .search-layout { grid-template-columns: 1fr; } }
.facet h3 { margin: 16px 0 8px; }
.facet a { display: flex; justify-content: space-between; padding: 5px 8px; border-radius: 2px; text-decoration: none; color: var(--muted); font-size: 0.9rem; border-left: 2px solid transparent; }
.facet a span:last-child { font-family: var(--mono); font-size: 0.75rem; }
.facet a:hover, .facet a.on { background: var(--accent-dim); color: #fff; border-left-color: var(--accent); }

/* ---------- reading ---------- */
.prose { max-width: 74ch; font-size: 1.02rem; line-height: 1.65; }
.prose h2 { margin-top: 2em; padding-top: 0.9em; border-top: 1px solid var(--line); scroll-margin-top: 90px; font-size: 0.86rem; }
.prose h3 { margin-top: 1.4em; }
.prose strong { color: #fff; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 0.9em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--accent); font-family: var(--mono); }
.prose blockquote { margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--help); background: rgba(240, 86, 106, 0.06); border-radius: 0 3px 3px 0; }
.prose blockquote p { margin: 0; }
.section-flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(143, 180, 217, 0.12); box-shadow: -12px 0 0 rgba(143, 180, 217, 0.12); } 100% { background: transparent; } }
.guide-layout { display: grid; grid-template-columns: 1fr 250px; gap: 34px; align-items: start; }
.toc { position: sticky; top: 60px; font-size: 0.88rem; }
.toc a { display: block; padding: 5px 10px; text-decoration: none; color: var(--muted); border-left: 1px solid var(--line-2); }
.toc a:hover { color: #fff; border-left-color: var(--accent); background: var(--accent-dim); }
@media (max-width: 960px) { .guide-layout { grid-template-columns: 1fr; } .toc { position: static; order: -1; } }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; }
.meta-line strong { color: var(--text); }

/* ---------- ask ---------- */
.qa { display: grid; gap: 18px; }
.q-bubble { justify-self: end; max-width: 80%; background: rgba(143, 180, 217, 0.08); border: 1px solid rgba(143, 180, 217, 0.3); padding: 10px 14px; border-radius: 3px; font-weight: 600; }
.q-bubble::before { content: "QUERY ▸ "; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; color: var(--accent); }
.a-card { border-left: 2px solid var(--accent); }
.a-card.uncovered { border-left-color: var(--faint); }
.cite { display: inline-block; min-width: 1.6em; padding: 0 5px; margin: 0 1px; border-radius: 2px; background: rgba(143, 180, 217, 0.15); border: 1px solid rgba(143, 180, 217, 0.4); color: var(--accent-2); text-decoration: none; font-family: var(--mono); font-size: 0.72em; font-weight: 800; text-align: center; vertical-align: 1px; cursor: pointer; }
.sources { display: grid; gap: 6px; margin-top: 14px; }
.source { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; background: rgba(12, 13, 15, 0.6); }
.source:hover { border-color: var(--accent); color: inherit; }
.source.unused { opacity: 0.55; }
.source .n { font-family: var(--mono); font-weight: 800; color: var(--accent); }
.source p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
.ask-bar { position: sticky; bottom: 0; padding: 14px 0 6px; background: linear-gradient(transparent, var(--bg) 35%); }
.ask-bar form { display: flex; gap: 10px; }
.ask-bar input { min-height: 52px; font-family: var(--mono); }
.urgent { background: rgba(240, 86, 106, 0.14); border: 1px solid var(--help); color: #fff; padding: 10px 14px; border-radius: 3px; font-weight: 700; margin-bottom: 12px; box-shadow: 0 0 22px rgba(240, 86, 106, 0.2); }
.urgent::before { content: "⚠ PRIORITY — "; font-family: var(--mono); letter-spacing: 0.1em; color: #f5a0ab; }
.thinking { display: inline-flex; gap: 4px; }
.thinking i { width: 6px; height: 6px; background: var(--accent); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: 0.15s; } .thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ---------- map ---------- */
main.full { max-width: none; padding: 0; }
.map-page { display: grid; grid-template-columns: 1fr 340px; height: calc(100vh - 38px); }
@media (max-width: 960px) { .map-page { grid-template-columns: 1fr; height: auto; } .map-stage { height: 72vh; } .ov-layers { display: none; } .ov-search { left: 64px; right: 12px; width: auto; } }
.map-stage { position: relative; min-height: 420px; overflow: hidden; }
.map { position: absolute; inset: 0; background: #0d0e10; }
.map-side { overflow-y: auto; display: grid; gap: 10px; align-content: start; padding: 12px; background: rgba(13, 14, 16, 0.96); border-left: 1px solid var(--line); }
.map-side .card { padding: 14px; }
.leaflet-container { font: inherit; background: #0d0e10; outline: none; }
.mbtiles.night { filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(1.05) saturate(0.55); }
.map.day .mbtiles.night { filter: none; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: rgba(19, 20, 22, 0.97); color: var(--text); border: 1px solid var(--line-2); border-radius: 3px; box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(143, 180, 217, 0.054); }
.leaflet-popup-content { margin: 12px 14px; min-width: 180px; }
.leaflet-popup-content strong { color: #fff; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar { border: 1px solid var(--line-2) !important; box-shadow: none !important; border-radius: 3px !important; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { background: rgba(17, 18, 20, 0.92) !important; color: var(--text) !important; border-color: var(--line-2) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }
.leaflet-bar a:hover { background: var(--accent-dim); color: #fff; }
.leaflet-control-attribution { background: rgba(0, 0, 0, 0.6) !important; color: #6a8494 !important; font-family: var(--mono); font-size: 9px !important; letter-spacing: 0.06em; }
.leaflet-control-attribution a { color: #8fb0c0 !important; }
.leaflet-control-scale-line { background: rgba(13, 14, 16, 0.8); border-color: var(--accent) !important; color: var(--accent-2); font-family: var(--mono); font-size: 10px; text-shadow: none; }
.country-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: rgba(140, 220, 255, 0.45); white-space: nowrap; transform: translate(-50%, -50%); pointer-events: none; text-shadow: 0 0 6px #000; }
.mk-wrap { background: none; border: 0; }
.mk { position: relative; width: 28px; height: 35px; filter: drop-shadow(0 0 6px var(--c)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8)); }
.mk svg { width: 28px; height: 35px; display: block; }
.mk-body { fill: rgba(14, 15, 17, 0.92); stroke: var(--c); stroke-width: 2.2; }
.mk b { position: absolute; top: 7px; left: 0; right: 0; text-align: center; color: var(--c); font: 800 12px var(--mono); }
.mk.pulse::after { content: ""; position: absolute; left: 50%; top: 15px; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--c); animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(5); opacity: 0; } }
.me-icon { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 6px rgba(143, 180, 217, 0.113), 0 0 20px rgba(143, 180, 217, 0.25); }
.me-icon::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 2s ease-out infinite; }
.map-mode { position: absolute; z-index: 800; top: 64px; white-space: nowrap; left: 50%; transform: translateX(-50%); background: rgba(14, 15, 17, 0.94); border: 1px solid var(--accent); color: var(--accent-2); padding: 7px 14px; border-radius: 3px; font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; box-shadow: 0 0 24px rgba(143, 180, 217, 0.113); }
/* overlays */
.ov { position: absolute; z-index: 700; background: rgba(14, 15, 17, 0.88); border: 1px solid var(--line-2); border-radius: 3px; backdrop-filter: blur(6px); font-family: var(--mono); }
.ov-tools { top: 12px; left: 12px; display: flex; flex-direction: column; gap: 2px; padding: 4px; }
.tool { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 2px; color: var(--muted); cursor: pointer; position: relative; }
.tool svg { width: 18px; height: 18px; }
.tool:hover { color: #fff; background: var(--accent-dim); }
.tool.on { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 14px rgba(143, 180, 217, 0.113); }
.tool[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 46px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #0c0d0f; border: 1px solid var(--line-2); padding: 4px 8px; font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); pointer-events: none; z-index: 2; }
.tool-sep { height: 1px; background: var(--line-2); margin: 3px 4px; }
.ov-layers { top: 12px; right: 12px; padding: 10px 12px; font-size: 0.68rem; letter-spacing: 0.08em; min-width: 180px; }
.ov-layers .label { display: block; margin-bottom: 6px; }
.ov-layers label { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; color: var(--muted); text-transform: uppercase; }
.ov-layers label:hover { color: #fff; }
.ov-layers input { accent-color: var(--accent); }
.ov-coords { left: 12px; bottom: 12px; padding: 8px 12px; font-size: 0.68rem; letter-spacing: 0.08em; color: var(--accent-2); line-height: 1.6; min-width: 240px; }
.ov-coords .k { color: var(--faint); display: inline-block; width: 62px; }
.ov-search { top: 12px; left: 64px; width: min(320px, calc(100% - 300px)); min-width: 180px; }
.ov-search input { background: transparent; border: 0; min-height: 40px; font-family: var(--mono); font-size: 0.8rem; }
.ov-search input:focus { box-shadow: none; }
.ov-search .hits { border-top: 1px solid var(--line-2); max-height: 260px; overflow: auto; }
.ov-search .hits:empty { display: none; }
.ov-search .hits button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; color: var(--text); cursor: pointer; font-family: var(--font); font-size: 0.88rem; }
.ov-search .hits button:hover { background: var(--accent-dim); }
.ov-search .hits small { display: block; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ov-measure { bottom: 12px; left: 290px; max-width: calc(100% - 380px); flex-wrap: wrap; row-gap: 6px; padding: 8px 14px; font-size: 0.74rem; letter-spacing: 0.08em; color: var(--accent-2); display: flex; gap: 14px; align-items: center; }
.ov-measure b { color: #fff; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none; z-index: 650; opacity: 0.35; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--accent); }
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.crosshair::after { top: 50%; left: 0; right: 0; height: 1px; }
.map-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 640; box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.8); }
.ring-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent-2); white-space: nowrap; text-shadow: 0 0 4px #000, 0 0 8px #000; transform: translate(-50%, -50%); }
.measure-label { font-family: var(--mono); font-size: 10px; color: #fff; background: rgba(14, 15, 17, 0.9); border: 1px solid var(--accent); padding: 1px 5px; white-space: nowrap; transform: translate(10px, -50%); display: inline-block; }
.map-stage:fullscreen { background: #000; }

/* ---------- plan / tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 5px 4px; vertical-align: top; }
.table input, .table select { min-height: 36px; padding: 6px 9px; }
.table-scroll { overflow-x: auto; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 5px 0; border: 0; }
.checklist li input[type="text"] { flex: 1; }
.checklist li.done input[type="text"] { text-decoration: line-through; color: var(--faint); }

/* ---------- group ---------- */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.status-dot.safe { background: var(--safe); box-shadow: 0 0 10px var(--safe); }
.status-dot.help { background: var(--help); box-shadow: 0 0 0 4px rgba(240, 86, 106, 0.25), 0 0 14px var(--help); animation: blink 1s infinite; }
.status-dot.meet { background: var(--meet); box-shadow: 0 0 10px var(--meet); }
.member { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.member .who { flex: 1; min-width: 0; }
.member .who strong { color: #fff; }
.member .who small { display: block; }
.qr { background: #e9f8ff; padding: 12px; border-radius: 3px; width: fit-content; box-shadow: 0 0 0 1px rgba(143, 180, 217, 0.25), 0 0 30px rgba(143, 180, 217, 0.135); }
.qr img, .qr svg { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.code-big { font-family: var(--mono); font-size: 1.9rem; font-weight: 800; letter-spacing: 0.3em; color: #fff; text-shadow: none; }
.checkin-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.checkin-btns .btn { min-height: 78px; flex-direction: column; gap: 6px; font-size: 0.74rem; white-space: normal; text-align: center; padding: 8px 4px; letter-spacing: 0.08em; min-width: 0; }
.checkin-btns .btn svg { width: 22px; height: 22px; }
.btn.safe { border-color: rgba(95, 212, 154, 0.6); color: var(--safe); background: rgba(95, 212, 154, 0.05); }
.btn.help { border-color: rgba(240, 86, 106, 0.7); color: #f27a8a; background: rgba(240, 86, 106, 0.07); }
.btn.meet { border-color: rgba(122, 167, 224, 0.6); color: var(--meet); background: rgba(122, 167, 224, 0.05); }
.btn.safe:hover { box-shadow: 0 0 22px rgba(95, 212, 154, 0.25); border-color: var(--safe); }
.btn.help:hover { box-shadow: 0 0 26px rgba(240, 86, 106, 0.35); border-color: var(--help); }
.btn.meet:hover { box-shadow: 0 0 22px rgba(122, 167, 224, 0.25); border-color: var(--meet); }
.btn.safe.fill { background: var(--safe); color: #121315; }
.btn.help.fill { background: var(--help); color: #fff; }
.btn.meet.fill { background: var(--meet); color: #131416; }
.feed { display: grid; gap: 8px; }
.msg { padding: 12px 14px; border-radius: 3px; border: 1px solid var(--line); background: rgba(17, 18, 20, 0.85); border-left-width: 3px; }
.msg.safe { border-left-color: var(--safe); }
.msg.help { border-left-color: var(--help); background: rgba(240, 86, 106, 0.08); box-shadow: 0 0 24px rgba(240, 86, 106, 0.12); }
.msg.meet { border-left-color: var(--meet); }
.msg.ping { border-left-color: var(--ping); }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-head strong { font-size: 0.98rem; color: #fff; }
.msg-head small { font-family: var(--mono); font-size: 0.7rem; }
.msg-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.receipt { margin-top: 6px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.receipt.got { color: var(--safe); }

/* ---------- log ---------- */
.log-entry { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.log-entry:first-child { border-top: 0; }
.log-entry.done .log-text { text-decoration: line-through; color: var(--faint); }
.kind-icon { width: 28px; height: 28px; border-radius: 2px; display: grid; place-items: center; font-family: var(--mono); font-weight: 800; font-size: 0.78rem; border: 1px solid var(--line-2); }
.kind-icon.todo { color: var(--warn); border-color: rgba(227, 201, 107, 0.4); }
.kind-icon.checked { color: var(--safe); border-color: rgba(95, 212, 154, 0.4); }
.kind-icon.event { color: var(--accent); border-color: rgba(143, 180, 217, 0.4); }

/* ---------- readiness ---------- */
.check-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.check-row:first-child { border-top: 0; }
.check-icon { width: 22px; height: 22px; border-radius: 2px; display: grid; place-items: center; font-family: var(--mono); font-weight: 900; font-size: 0.74rem; border: 1px solid; }
.check-icon.ok { color: var(--safe); border-color: rgba(95, 212, 154, 0.5); background: rgba(95, 212, 154, 0.08); }
.check-icon.no { color: #f27a8a; border-color: rgba(240, 86, 106, 0.55); background: rgba(240, 86, 106, 0.08); }
.check-icon.opt { color: var(--faint); border-color: var(--line-2); }

.pdf-frame { width: 100%; height: calc(100vh - 220px); min-height: 500px; border: 1px solid var(--line-2); border-radius: 3px; background: #fff; }
.progress { height: 4px; background: rgba(143, 180, 217, 0.1); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 10px rgba(143, 180, 217, 0.25); width: 0; transition: width 0.2s; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-family: var(--mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; }
.tabs .on { color: #fff; border-bottom-color: var(--accent); }

/* ---------- download ---------- */
.dl-hero { position: relative; overflow: hidden; padding: 38px 34px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: radial-gradient(600px 300px at 85% 20%, rgba(143, 180, 217, 0.16), transparent 70%), linear-gradient(160deg, #18191b, #0b0c0e); }
.dl-hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); letter-spacing: -0.01em; margin: 8px 0 12px; color: #fff; max-width: 18ch; line-height: 1.1; }
.dl-hero p { max-width: 58ch; color: var(--muted); font-size: 1.05rem; }
.dl-hero .btn.primary { min-height: 52px; padding: 10px 22px; font-size: 0.8rem; }
.dl-hero .globe { position: absolute; right: -70px; top: 50%; transform: translateY(-50%); width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(143, 180, 217, 0.3); pointer-events: none;
  background: radial-gradient(circle at 35% 35%, rgba(143, 180, 217, 0.16), transparent 60%), repeating-linear-gradient(0deg, transparent 0 29px, rgba(143, 180, 217, 0.14) 29px 30px), repeating-linear-gradient(90deg, transparent 0 29px, rgba(143, 180, 217, 0.09) 29px 30px);
  box-shadow: 0 0 80px rgba(143, 180, 217, 0.068), inset 0 0 60px rgba(0, 0, 0, 0.8); }
.dl-hero .globe::after { content: ""; position: absolute; inset: -30px; border-radius: 50%; border: 1px dashed rgba(143, 180, 217, 0.2); animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dl-hero > *:not(.globe) { position: relative; }
@media (max-width: 760px) { .dl-hero .globe { display: none; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-weight: 800; color: var(--accent); border: 1px solid rgba(143, 180, 217, 0.4); text-align: center; padding: 3px 0; font-size: 0.76rem; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.9rem; margin: 0; }
.spec dt { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.spec dd { margin: 0; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list li::before { content: "◆"; color: var(--accent); font-size: 0.7rem; margin-top: 4px; text-shadow: none; }

/* ---------- printable sheet ---------- */
.sheet { background: #fff; color: #111; padding: 28px 32px; border-radius: 3px; max-width: 820px; font-size: 13px; line-height: 1.4; }
.sheet h1 { font-size: 22px; margin: 0; color: #111; }
.sheet h2 { font-family: var(--font); font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: #111; border-bottom: 2px solid #111; padding-bottom: 3px; margin: 16px 0 6px; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet td, .sheet th { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; vertical-align: top; }
.sheet th { font-size: 11px; text-transform: uppercase; color: #555; }
.sheet .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sheet .box { display: inline-block; width: 12px; height: 12px; border: 1.5px solid #111; margin-right: 6px; vertical-align: -2px; }
.sheet-map { height: 260px; border: 1px solid #999; margin-top: 6px; background: #fff; position: relative; }
.sheet-map .leaflet-container { background: #fff; }
.sheet .foot { margin-top: 18px; font-size: 11px; color: #555; border-top: 1px solid #ccc; padding-top: 6px; }
.sheet-sos { border: 2px solid #111; padding: 8px 10px; margin-top: 10px; font-size: 12px; }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { background: #fff !important; }
  body::after { display: none; }
  .side, .hud, .no-print, .alert-bar, .toast-wrap { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .sheet { padding: 0; max-width: none; border-radius: 0; }
  .leaflet-control-container { display: none; }
  .card { box-shadow: none; }
}

/* ---------- phone join page ---------- */
.phone { max-width: 560px; margin: 0 auto; padding: 16px 16px 92px; }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; }
.phone-head strong { font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #fff; }
.phone-tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 900; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(11, 12, 14, 0.97); border-top: 1px solid var(--line-2); padding-bottom: env(safe-area-inset-bottom); }
.phone-tabs button { background: none; border: 0; padding: 9px 4px 10px; color: var(--faint); font-family: var(--mono); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; display: grid; justify-items: center; gap: 4px; cursor: pointer; position: relative; }
.phone-tabs button svg { width: 21px; height: 21px; }
.phone-tabs button.on { color: var(--accent); }
.phone-tabs button.on::before { content: ""; position: absolute; top: -1px; left: 25%; right: 25%; height: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(143, 180, 217, 0.25); }
.phone-tabs .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--help); box-shadow: 0 0 8px var(--help); }
.modal-back { position: fixed; inset: 0; z-index: 1500; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; }
.modal { width: min(460px, 100%); max-height: 90vh; overflow: auto; }
body:has(.phone-tabs:not([hidden])) .toast-wrap { bottom: calc(86px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.ov-measure > span { white-space: nowrap; }
@media (max-width: 1100px) { .ov-measure { left: 12px; bottom: 132px; max-width: calc(100% - 80px); } }

/* ---------- encyclopedia ---------- */
.wiki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.wiki-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 3px; background: rgba(12, 13, 15, 0.6); text-decoration: none; }
.wiki-card:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(143, 180, 217, 0.045); color: inherit; }
.wiki-card img, .wiki-noimg { width: 64px; height: 64px; object-fit: cover; border-radius: 2px; border: 1px solid var(--line-2); filter: saturate(0.85) contrast(1.05); }
.wiki-noimg { display: grid; place-items: center; color: var(--faint); background: var(--panel-2); }
.wiki-noimg svg { width: 22px; height: 22px; }
.wiki-card strong { display: block; color: #fff; font-size: 0.92rem; line-height: 1.25; }
.wiki-card small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.35; margin-top: 4px; }
.wiki-card.missing { opacity: 0.5; }
.wiki-hero { margin: 0 0 18px; }
.wiki-hero img { width: 100%; max-height: 360px; object-fit: cover; border: 1px solid var(--line-2); border-radius: 3px; }
.wiki-hero figcaption { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); margin-top: 6px; letter-spacing: 0.04em; }
.stat .of { font-size: 0.8rem; color: var(--faint); }
a.stat { text-decoration: none; }
a.stat:hover { background: var(--panel-2); color: inherit; }
.stat-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- gear ---------- */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kit-item { display: flex; flex-direction: column; margin: 0 !important; }
.kit-item.owned { border-color: rgba(95, 212, 154, 0.45); }
.kit-item.owned .kit-name::after { content: " ✓"; color: var(--safe); }
.kit-name { font-family: var(--font); font-size: 1.08rem; text-transform: none; letter-spacing: 0; color: #fff; margin: 10px 0 4px; }
.kit-item .feature-list { font-size: 0.86rem; gap: 4px; color: var(--text); }
.kit-meter { display: flex; align-items: center; gap: 14px; }
.kit-meter .ring { width: 70px; height: 70px; }
.kit-meter .ring::before { width: 58px; height: 58px; font-size: 0.95rem; }

/* ---------- on-device AI ---------- */
.tier { display: flex; flex-direction: column; margin: 0 !important; min-height: 280px; }
.tier.chosen { border-color: var(--accent); box-shadow: 0 0 28px rgba(143, 180, 217, 0.068); }
.tier-name { font-family: var(--mono); font-size: 1.6rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; margin-top: 14px; }
.tier-size { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; color: var(--accent); text-shadow: none; }
.big-tiles { grid-template-columns: repeat(4, 1fr); }

/* ---------- MapLibre street map ---------- */
.maplibregl-map { font: inherit; background: #0c0e11; }
.maplibregl-popup-content { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 12px 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); min-width: 190px; }
.maplibregl-popup-content strong { color: #fff; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--panel-solid); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--panel-solid); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel-solid); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel-solid); }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; padding: 0 6px; }
.maplibregl-popup-close-button:hover { background: transparent; color: #fff; }
.maplibregl-ctrl-group { background: rgba(22, 23, 26, 0.94) !important; border: 1px solid var(--line-2); box-shadow: none !important; border-radius: 6px !important; }
.maplibregl-ctrl-group button { width: 34px; height: 34px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line-2) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(0.85); }
.maplibregl-ctrl-group button:hover { background: rgba(255, 255, 255, 0.05) !important; }
.maplibregl-ctrl-scale { background: rgba(11, 12, 14, 0.8); border-color: var(--muted) !important; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.maplibregl-ctrl-attrib { background: rgba(11, 12, 14, 0.7) !important; color: #7d838c; font-family: var(--mono); font-size: 9px; }
.maplibregl-ctrl-attrib a { color: #a3a9b2 !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-marker.mk-wrap, .mk-wrap { cursor: pointer; }
.ov-status { position: absolute; z-index: 700; top: 12px; right: 212px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(22, 23, 26, 0.9); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; pointer-events: none; }
.ov-status:empty { display: none; }
.led-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.led-dot.ok { background: var(--safe); } .led-dot.warn { background: var(--warn); } .led-dot.bad { background: var(--help); }
.ctx-menu { position: absolute; z-index: 900; min-width: 210px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6); }
.ctx-menu .ctx-head { font-size: 0.68rem; color: var(--faint); padding: 6px 10px 4px; letter-spacing: 0.06em; }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 0.88rem; text-align: left; }
.ctx-menu button:hover { background: rgba(255, 255, 255, 0.05); }
.ctx-menu button svg { width: 16px; height: 16px; color: var(--muted); }
.legend { margin-top: 8px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.legend summary { cursor: pointer; list-style: none; }
.legend div { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 0.7rem; }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #0c0e11; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); }
.ov-search { left: 64px; }
.ov-layers { max-height: calc(100% - 140px); overflow-y: auto; }

@media (max-width: 960px) { .ov-status { right: 12px; top: 60px; } }
.ov-search { width: min(280px, calc(100% - 560px)); min-width: 170px; }

/* ---------- open source ---------- */
.os-hero { position: relative; padding: 34px; border: 1px solid var(--line-2); border-radius: var(--radius); background: radial-gradient(700px 260px at 90% 0%, rgba(143, 180, 217, 0.08), transparent 70%), linear-gradient(160deg, #18191c, #0f1012); }
.os-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 6px 0 10px; color: #fff; }
.os-hero p { max-width: 62ch; color: var(--muted); font-size: 1.03rem; margin: 0; }
.os-fp { background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 10px 12px; font-size: 0.74rem; color: var(--accent-2); overflow-wrap: anywhere; }
.os-code { background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 12px 14px; font-family: var(--mono); font-size: 0.8rem; color: var(--text); overflow-x: auto; margin: 0 0 10px; white-space: pre; }
.os-file { font-size: 0.78rem; line-height: 1.55; max-height: calc(100vh - 230px); overflow: auto; }
.os-file .ln { display: inline-block; width: 3.4em; padding-right: 1em; text-align: right; color: var(--faint); user-select: none; }
.os-dir { border-top: 1px solid var(--line); }
.os-dir summary { display: flex; justify-content: space-between; padding: 9px 4px; cursor: pointer; list-style: none; font-size: 0.86rem; }
.os-dir summary::-webkit-details-marker { display: none; }
.os-dir summary:hover { background: rgba(255, 255, 255, 0.02); }
.os-table td { font-size: 0.78rem; padding: 3px 6px; }
.os-table a { text-decoration: none; }
.foot-link { color: var(--muted); text-decoration: none; display: inline-block; margin-top: 6px; }
.foot-link:hover { color: var(--accent-2); }
