/* ---- web fonts (self-hosted; Latin + Latin Extended subsets of Inter, Rajdhani and
   Share Tech Mono, SIL Open Font Licence — generated, see git history) ---- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-400-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-400-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/rajdhani-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/rajdhani-500-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/rajdhani-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/rajdhani-600-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/rajdhani-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/rajdhani-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Share Tech Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/sharetechmono-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* ---- end web fonts ---- */
/* Chainage — TekSwipe Traffic. Full-screen map with a game-style HUD.
   The HUD is always dark glass; the theme toggle switches the MAP between day
   and night (night = OpenFreeMap's dark style). */
:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: rgba(9, 13, 21, 0.82);
  --panel-solid: #0b111b;
  --panel-2: rgba(22, 31, 46, 0.72);
  --panel-3: rgba(34, 46, 66, 0.6);
  --line: rgba(150, 180, 225, 0.14);
  --line-2: rgba(150, 180, 225, 0.26);
  --text: #eaf1fb;
  --dim: #93a6c1;
  --faint: #5f7390;
  --acc: #ff9900;
  --acc-2: #ffb547;
  --acc-soft: rgba(255, 153, 0, 0.14);
  --cyan: #2ee6ff;
  --cyan-soft: rgba(46, 230, 255, 0.14);
  --ok: #3ddc84;
  --warn: #ffc233;
  --bad: #ff4d5e;
  --none: #7d8ca3;
  --on-road: var(--ok);
  --near: var(--warn);
  --far: var(--bad);
  --brand: var(--acc);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px rgba(255, 153, 0, 0.45), 0 0 22px rgba(255, 153, 0, 0.28);
  --r: 6px;
  --cut: 9px;
  --f-hud: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gap: 14px;
  --card-w: 404px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--f-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: var(--acc); }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); letter-spacing: 0.02em; }
.only-mobile { display: none !important; }
::selection { background: rgba(255, 153, 0, 0.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(150, 180, 225, 0.22); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

#app { position: fixed; inset: 0; }

/* ---------- world ---------- */
.map-wrap { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: #0d1420; }
[data-theme="light"] #map { background: #e9eef3; }
#gbase { position: absolute; inset: 0; display: none; }
#gbase .gbase-map { position: absolute; inset: 0; }
body.gbase-on #gbase { display: block; }
body.gbase-on #map { background: transparent; }
body.gbase-on #map canvas { filter: none !important; }
body.gbase-on .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { display: none; }
/* Edge vignette + faint scanlines: sells the "screen" look without hurting legibility. */
.map-fx {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 58%, rgba(3, 6, 12, 0.55) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}
[data-theme="light"] .map-fx { background: radial-gradient(ellipse at center, transparent 62%, rgba(3, 6, 12, 0.28) 100%); }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { bottom: calc(6px + var(--safe-bottom)); right: 4px; }
.maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(9, 13, 21, 0.75); color: var(--dim); }
.maplibregl-ctrl-attrib a { color: var(--dim); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #122036 0%, #070b12 70%);
  transition: opacity 0.5s ease, visibility 0.5s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.boot-logo { width: 74px; height: 74px; border-radius: 16px; box-shadow: 0 0 40px rgba(255, 153, 0, 0.35); animation: bootPulse 1.6s ease-in-out infinite; }
.boot-title { margin-top: 14px; font-family: var(--f-hud); font-weight: 700; font-size: 34px; letter-spacing: 0.32em; padding-left: 0.32em; }
.boot-sub { font-size: 12px; color: var(--dim); letter-spacing: 0.08em; }
.boot-bar { margin-top: 22px; width: 220px; height: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; border-radius: 3px; }
.boot-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--acc), transparent); animation: bootBar 1.1s ease-in-out infinite; }
.boot-status { margin-top: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.18em; }
@keyframes bootBar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes bootPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ---------- HUD primitives ---------- */
.hud {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
/* Corner brackets (top-left + bottom-right) in the accent colour. */
.hud::before, .hud::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border: 0 solid var(--acc); opacity: 0.85;
}
.hud::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: var(--r); }
.hud::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: var(--r); }

.hbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  font-family: var(--f-hud); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-2); border-radius: 3px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s, box-shadow 0.15s;
}
.hbtn svg { width: 17px; height: 17px; flex: none; }
.hbtn:hover { border-color: rgba(255, 153, 0, 0.7); color: var(--acc-2); background: var(--acc-soft); }
.hbtn:active { transform: translateY(1px) scale(0.99); }
.hbtn:disabled { opacity: 0.5; cursor: default; }
.hbtn.primary { color: #140c00; border-color: transparent; background: linear-gradient(90deg, var(--acc), var(--acc-2)); }
.hbtn.primary:hover { color: #140c00; filter: brightness(1.08); box-shadow: 0 0 24px rgba(255, 153, 0, 0.35); }
.hbtn.cyan { color: #001418; border-color: transparent; background: linear-gradient(90deg, #19c7e6, var(--cyan)); }
.hbtn.cyan:hover { color: #001418; filter: brightness(1.08); }
.hbtn.danger { color: #ffd9dd; border-color: rgba(255, 77, 94, 0.5); background: rgba(255, 77, 94, 0.12); }
.hbtn.danger:hover { color: #fff; background: rgba(255, 77, 94, 0.28); border-color: var(--bad); }
.hbtn.ghost { background: transparent; }
.hbtn.sm { min-height: 32px; padding: 0 11px; font-size: 12px; --cut: 6px; }
.hbtn.wide { width: 100%; margin-top: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn-row .hbtn { flex: 1 1 auto; }

.x-btn {
  flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--dim);
}
.x-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.08); }
.x-btn svg { width: 18px; height: 18px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px;
  font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #0a0e14; background: var(--acc); border-radius: 2px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  padding-right: 14px;
}
.tag::before { content: ""; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); opacity: 0.8; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 3px;
  font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--dim); background: rgba(255, 255, 255, 0.03);
}
.chip .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }

.field, .cj-row input, .chainage-ask input, .dlg-form input, .dlg-form textarea, .dlg-form select {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 4px;
  border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.35); color: var(--text);
  font: inherit; font-size: 15px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus, .cj-row input:focus, .chainage-ask input:focus, .dlg-form input:focus, .dlg-form textarea:focus, .dlg-form select:focus {
  border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.16);
}
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px !important; }
select option { background: var(--panel-solid); color: var(--text); }
textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
.mono-sub { font-family: var(--f-mono); color: var(--dim); font-size: 13px; }

.sec-head {
  display: flex; align-items: center; gap: 8px; margin: 18px 0 8px;
  font-family: var(--f-hud); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim);
}
.sec-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.sec-head .sec-act { order: 3; margin-left: 4px; }
.sec-head .count { color: var(--faint); font-family: var(--f-mono); letter-spacing: 0; }

/* ---------- brand plate (top-left) ---------- */
.brand-plate {
  position: absolute; z-index: 20; top: calc(var(--gap) + var(--safe-top)); left: var(--gap);
  display: flex; align-items: center; gap: 11px; padding: 8px 16px 8px 9px; text-decoration: none; color: var(--text);
}
.brand-plate img { width: 36px; height: 36px; border-radius: 7px; display: block; box-shadow: 0 0 16px rgba(255, 153, 0, 0.25); }
.bp-text { display: flex; flex-direction: column; line-height: 1; }
.bp-name { font-family: var(--f-hud); font-weight: 700; font-size: 21px; letter-spacing: 0.22em; }
.bp-by { margin-top: 4px; font-size: 11px; color: var(--dim); letter-spacing: 0.02em; white-space: nowrap; }
.bp-by b { color: var(--acc); font-weight: 600; }

/* ---------- command bar (search) ---------- */
.cmd { position: absolute; z-index: 40; top: calc(var(--gap) + var(--safe-top)); left: 50%; transform: translateX(-50%); width: 540px; }
.cmd-bar { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; }
.cmd-ico { width: 19px; height: 19px; color: var(--acc); flex: none; }
.cmd-bar input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text);
  font: inherit; font-size: 15px;
}
.cmd-bar input::placeholder { color: var(--faint); }
.cmd-bar input::-webkit-search-cancel-button { filter: invert(0.6); }
.cmd-kbd { font-family: var(--f-mono); font-size: 12px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 7px; }
.cmd-back { display: none; width: 34px; height: 34px; border: 0; background: transparent; color: var(--dim); align-items: center; justify-content: center; }
.cmd-back svg { width: 20px; height: 20px; }
.cmd-results {
  display: none; margin-top: 8px; max-height: min(62vh, 560px); overflow-y: auto; overflow-x: hidden; padding: 10px;
}
.cmd.open .cmd-results { display: block; }
.cmd.open .cmd-bar { border-color: rgba(255, 153, 0, 0.55); box-shadow: var(--shadow), 0 0 0 3px rgba(255, 153, 0, 0.1); }
.cmd.open .cmd-kbd { display: none; }

.road-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 6px; border-radius: 4px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--text);
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.road-item:hover, .road-item:focus-visible { border-color: rgba(255, 153, 0, 0.55); background: var(--acc-soft); outline: none; }
.road-item:active { transform: scale(0.995); }
.road-item .ri-name { font-weight: 600; font-size: 14px; }
.road-item .ri-meta { font-size: 12px; color: var(--dim); margin-top: 2px; font-family: var(--f-mono); }
.road-item .ri-go { margin-left: auto; color: var(--acc); flex: none; display: inline-flex; }
.road-item .ri-go svg, .road-item .ri-ico svg { width: 18px; height: 18px; }
.road-item .ri-ico { flex: none; color: var(--cyan); display: inline-flex; }
.chainage-ask { padding: 12px; border: 1px solid var(--line-2); border-radius: 4px; background: rgba(0, 0, 0, 0.25); }
.chainage-ask label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 10px; line-height: 1.4; }
.chainage-ask label b { color: var(--text); }
.chainage-ask .row, .cj-row { display: flex; gap: 8px; }
.chainage-ask input, .cj-row input { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 17px; }
.unit-toggle { display: flex; flex: none; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.unit-toggle button { border: 0; padding: 0 12px; background: transparent; color: var(--dim); font-family: var(--f-hud); font-weight: 700; font-size: 14px; }
.unit-toggle button + button { border-left: 1px solid var(--line-2); }
.unit-toggle button.active { background: var(--acc); color: #140c00; }
.cj-ends { display: flex; gap: 8px; margin-top: 8px; }
.cj-ends .hbtn { flex: 1; }
.hint { color: var(--dim); font-size: 12.5px; padding: 6px 4px; line-height: 1.5; }
.empty { text-align: center; color: var(--dim); padding: 28px 16px; }
.recent-group + .recent-group { margin-top: 10px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.recent-head span { font-family: var(--f-hud); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.recent-clear { background: none; border: 0; color: var(--acc); font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 6px; }

/* ---------- top-right cluster ---------- */
.hud-tr { position: absolute; z-index: 20; top: calc(var(--gap) + var(--safe-top)); right: var(--gap); display: flex; gap: 8px; }
.sq-btn { width: 50px; height: 50px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); border-radius: var(--r); }
.sq-btn svg { width: 22px; height: 22px; }
.sq-btn:hover, .acct-btn:hover { border-color: rgba(255, 153, 0, 0.55); }
.sq-btn.on { color: var(--acc); border-color: rgba(255, 153, 0, 0.6); box-shadow: var(--shadow), var(--glow); }
.sq-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--acc); color: #140c00; font-family: var(--f-mono); font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.6);
}
.acct-btn { height: 50px; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px 0 8px; border-radius: var(--r); color: var(--text); }
.acct-av {
  width: 34px; height: 34px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255, 153, 0, 0.25), rgba(46, 230, 255, 0.18)); border: 1px solid var(--line-2);
  font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: var(--text);
}
.acct-av svg { width: 19px; height: 19px; }
.acct-btn.signed-in .acct-av { background: linear-gradient(135deg, var(--acc), #ff6a00); color: #140c00; border-color: transparent; box-shadow: 0 0 14px rgba(255, 153, 0, 0.35); }
.acct-label { font-family: var(--f-hud); font-weight: 700; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu { position: absolute; z-index: 45; min-width: 230px; padding: 6px; display: flex; flex-direction: column; }
.menu-head { padding: 8px 10px 6px; font-family: var(--f-hud); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.menu-id { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-id b { display: block; font-size: 14px; }
.menu-id span { font-size: 12px; color: var(--dim); }
.menu-item, .bm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 10px; border: 0; background: none; border-radius: 3px; color: var(--text); font-size: 14px; font-weight: 500;
}
.menu-item svg { width: 17px; height: 17px; color: var(--dim); }
.menu-item:hover, .bm-item:hover { background: rgba(255, 255, 255, 0.06); }
.menu-item.danger { color: #ff9aa4; }
.acct-menu { top: calc(var(--gap) + 58px + var(--safe-top)); right: var(--gap); }
.base-menu { top: calc(var(--gap) + 58px + var(--safe-top)); right: calc(var(--gap) + 62px); }
.bm-item { justify-content: space-between; }
.bm-item .bm-sub { font-size: 11px; color: var(--faint); font-family: var(--f-mono); }
.bm-item.active { color: var(--acc); box-shadow: inset 2px 0 0 var(--acc); background: var(--acc-soft); }

/* ---------- tool rail (right) ---------- */
.rail {
  position: absolute; z-index: 20; right: var(--gap); top: calc(var(--gap) + 62px + var(--safe-top));
  display: flex; flex-direction: column; gap: 4px; padding: 5px;
}
.rail-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--dim);
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.rail-btn.active { color: var(--acc); background: var(--acc-soft); border-color: rgba(255, 153, 0, 0.45); }
.rail-sep { height: 1px; margin: 3px 6px; background: var(--line-2); }
.rail-txt { font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; line-height: 1; }
#northIco { transition: transform 0.2s; }
.ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: block; }

/* ---------- status banners ---------- */
.live-status {
  position: absolute; z-index: 21; top: calc(var(--gap) + 66px + var(--safe-top)); left: 50%; transform: translate(-50%, -8px);
  max-width: min(520px, calc(100% - 140px));
  display: flex; align-items: center; gap: 9px; padding: 8px 14px;
  font-family: var(--f-hud); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.live-status.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.live-status.live { cursor: pointer; }
#floatStatusText { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.live-status.live .dot { background: var(--ok) !important; animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}
.share-banner {
  position: absolute; z-index: 21; top: calc(var(--gap) + 66px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 14px; max-width: calc(100% - 2 * var(--gap));
}
.share-banner .sb-kick { font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.18em; color: var(--cyan); text-transform: uppercase; }
.share-banner .sb-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.share-banner .sb-meta { font-family: var(--f-mono); font-size: 12px; color: var(--dim); white-space: nowrap; }
body.shared .live-status { top: calc(var(--gap) + 118px + var(--safe-top)); }

/* ---------- telemetry (bottom-left) ---------- */
.telemetry {
  position: absolute; z-index: 20; left: var(--gap); bottom: calc(var(--gap) + var(--safe-bottom));
  display: flex; gap: 14px; padding: 8px 14px; font-family: var(--f-mono); font-size: 12.5px; color: var(--text);
  transition: left 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
.telemetry span { display: inline-flex; gap: 6px; }
.telemetry i { font-style: normal; color: var(--acc); opacity: 0.9; }
.telemetry b { font-weight: 400; min-width: 4ch; }
body.card-open .telemetry { left: calc(var(--gap) * 2 + var(--card-w)); }

/* ---------- primary action ---------- */
.locate-btn {
  position: absolute; z-index: 20; left: 50%; bottom: calc(22px + var(--safe-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 26px 0 10px;
  border: 0; color: #140c00; white-space: nowrap; max-width: calc(100vw - 24px);
  font-family: var(--f-hud); font-weight: 700; font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--acc), var(--acc-2));
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  filter: drop-shadow(0 10px 22px rgba(255, 140, 0, 0.35));
  transition: transform 0.12s, filter 0.15s, opacity 0.2s;
}
.locate-btn:hover { filter: drop-shadow(0 10px 28px rgba(255, 140, 0, 0.55)) brightness(1.06); }
.locate-btn:active { transform: translateX(-50%) scale(0.97); }
.locate-btn[disabled] { opacity: 0.8; }
.lb-ico { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.18); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.lb-ico svg { width: 22px; height: 22px; }
#locateLabel { display: inline-flex; align-items: center; gap: 8px; }
.locate-btn.tracking { background: linear-gradient(90deg, #22c57a, #3ddc84); filter: drop-shadow(0 10px 22px rgba(61, 220, 132, 0.35)); }
.locate-btn.tracking #locateLabel { font-family: var(--f-mono); letter-spacing: 0.04em; font-size: 19px; text-transform: none; }
.locate-btn.tracking .lb-ico svg { animation: spin 3s linear infinite; }
body.sheet-open .locate-btn { opacity: 0; pointer-events: none; }

/* ---------- cards (result + saved point) ---------- */
.card {
  position: absolute; z-index: 30; left: var(--gap); top: calc(var(--gap) + 66px + var(--safe-top)); bottom: var(--gap);
  width: var(--card-w); display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(-100% - 40px)); opacity: 0; visibility: hidden;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s, visibility 0.36s;
}
.card.open { transform: none; opacity: 1; visibility: visible; }
.card.open::before, .card.open::after { animation: bracketIn 0.5s ease-out; }
@keyframes bracketIn { from { width: 60px; height: 60px; opacity: 0; } to { width: 12px; height: 12px; opacity: 0.85; } }
/* scan sweep on open */
.card.open .card-scroll::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 90px; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, rgba(255, 153, 0, 0.14), transparent);
  animation: sweep 0.7s ease-out forwards;
}
@keyframes sweep { from { transform: translateY(-90px); opacity: 1; } to { transform: translateY(420px); opacity: 0; } }
.grabber { display: none; }
.card-scroll { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head .tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.card-title {
  margin: 12px 0 0; font-family: var(--f-hud); font-weight: 700; font-size: 23px; line-height: 1.12; letter-spacing: 0.02em; text-transform: uppercase;
}
.card-msg { margin: 6px 0 0; color: var(--dim); font-size: 13px; line-height: 1.45; }

.readout {
  margin: 14px 0 12px; padding: 12px 14px 12px; border-radius: 4px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 153, 0, 0.12), rgba(46, 230, 255, 0.05)); border: 1px solid rgba(255, 153, 0, 0.3);
}
.readout::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px); }
.ro-top { display: flex; justify-content: space-between; align-items: baseline; }
.ro-label { font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--acc); }
.ro-marker { font-family: var(--f-mono); font-size: 13px; color: var(--dim); }
.ro-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.ro-value { font-family: var(--f-mono); font-size: 42px; line-height: 1.05; color: #fff; text-shadow: 0 0 18px rgba(255, 153, 0, 0.45); letter-spacing: 0.01em; }
.copy-chip {
  flex: none; width: 34px; height: 34px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.25); color: var(--dim); margin-left: auto;
}
.copy-chip:hover { color: var(--acc); border-color: rgba(255, 153, 0, 0.6); }
.copy-chip svg { width: 16px; height: 16px; }
.ro-track { position: relative; height: 4px; margin: 12px 0 5px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.ro-track .rt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 153, 0, 0.4), var(--acc)); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.ro-track .rt-dot { position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--acc); transform: rotate(45deg); box-shadow: 0 0 10px var(--acc); transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.ro-ends { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.06em; }
.ro-sub { margin-top: 8px; font-family: var(--f-mono); font-size: 12.5px; color: var(--dim); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat {
  position: relative; padding: 9px 11px 10px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line);
  min-width: 0;
}
.stat .k { font-family: var(--f-hud); font-weight: 600; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.stat .v { margin-top: 3px; font-family: var(--f-mono); font-size: 15.5px; color: var(--text); word-break: break-word; display: flex; align-items: center; gap: 6px; }
.stat .bar { height: 3px; margin-top: 7px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.stat .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), #8ff3ff); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s; }
.stat .bar.hv span { background: linear-gradient(90deg, var(--acc), var(--acc-2)); }
.stat.wide { grid-column: 1 / -1; }
.stat.src { cursor: pointer; }
.stat.src:hover { border-color: rgba(46, 230, 255, 0.5); }
.stat.src .src-ico { margin-left: auto; color: var(--cyan); display: inline-flex; }
.stat.src .src-ico svg { width: 15px; height: 15px; }

/* speed signs */
.speed-box { margin-top: 10px; padding: 10px 12px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.speed-label { font-family: var(--f-hud); font-weight: 700; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.speed-label .tap-hint { text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 500; color: var(--cyan); margin-left: 6px; font-size: 11.5px; }
.speed-row { display: flex; gap: 12px; }
.speed-item { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.speed-sign {
  flex: none; width: 54px; height: 54px; border-radius: 50%; background: #fff; border: 5px solid #e02323;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 16px rgba(224, 35, 35, 0.35);
}
.speed-sign .speed-num { color: #111; font-weight: 800; font-size: 20px; line-height: 1; font-family: var(--f-body); }
.speed-sign .speed-na { color: #8a96a8; font-weight: 700; font-size: 12px; }
.speed-sign.clickable { cursor: pointer; transition: transform 0.12s; }
.speed-sign.clickable:hover { transform: scale(1.07); }
.speed-cap { font-size: 12px; color: var(--dim); line-height: 1.35; }
.speed-cap b { display: block; color: var(--text); font-family: var(--f-hud); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

/* "More information" (external lookups on demand) */
.intel-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 12px; text-align: left;
  border: 1px dashed rgba(46, 230, 255, 0.45); border-radius: 3px; background: var(--cyan-soft); color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.intel-btn:hover { background: rgba(46, 230, 255, 0.22); border-style: solid; }
.ib-ico, .ib-go { display: inline-flex; color: var(--cyan); flex: none; }
.ib-ico svg { width: 22px; height: 22px; }
.ib-go { margin-left: auto; }
.ib-go svg { width: 18px; height: 18px; }
.ib-text b { display: block; font-family: var(--f-hud); font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; }
.ib-text small { color: var(--dim); font-size: 12px; }
.intel-btn.loading { pointer-events: none; opacity: 0.8; }
.intel-btn.loading .ib-go { animation: spin 0.8s linear infinite; }

/* heavy-vehicle access (NHVR) */
.hvn-box { margin-top: 10px; padding: 10px 12px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.hvn-head { display: flex; align-items: center; gap: 8px; font-family: var(--f-hud); font-weight: 700; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.hvn-largest .k { font-size: 11px; color: var(--dim); }
.hvn-largest .v { font-family: var(--f-hud); font-weight: 700; font-size: 18px; letter-spacing: 0.04em; margin: 2px 0 8px; color: var(--acc-2); }
.hvn-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.hvn-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--faint); background: rgba(255, 255, 255, 0.02); }
.hvn-chip.ok { color: #9ff5c6; background: rgba(61, 220, 132, 0.12); border-color: rgba(61, 220, 132, 0.45); }
.hvn-chip.cond { color: #ffe199; background: rgba(255, 194, 51, 0.12); border-color: rgba(255, 194, 51, 0.45); }
.hvn-chip.no { color: #ffb3bb; background: rgba(255, 77, 94, 0.12); border-color: rgba(255, 77, 94, 0.45); }
.hvn-chip .hc-ico { font-size: 12px; line-height: 1; }
.hvn-note { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.4; }
.hvn-note b { color: var(--text); }
.hvn-restrict { margin-top: 8px; }
.hvn-restrict .ri-ico { color: var(--bad); }
.hvn-foot { font-size: 11px; color: var(--faint); margin-top: 8px; }
.hvn-foot a { color: var(--cyan); text-decoration: none; }
.hvn-unavail { font-size: 12.5px; color: var(--dim); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.actions .hbtn { font-size: 13px; padding: 0 10px; }
.actions .hbtn.span2 { grid-column: 1 / -1; min-height: 48px; font-size: 15px; }

.chainage-jump { margin-top: 12px; padding: 11px 12px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.cj-label { font-family: var(--f-hud); font-weight: 700; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }

/* ---------- saved point card ---------- */
.pt-meta { margin-top: 10px; display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.pt-notes { margin-top: 12px; padding: 10px 12px; border-left: 2px solid var(--acc); background: rgba(255, 153, 0, 0.06); white-space: pre-wrap; line-height: 1.5; font-size: 13.5px; color: var(--text); border-radius: 0 3px 3px 0; overflow-wrap: anywhere; }
.pt-notes.empty-notes { color: var(--faint); font-style: italic; border-left-color: var(--line-2); background: transparent; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph-tile {
  position: relative; aspect-ratio: 1; border-radius: 3px; overflow: hidden; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); padding: 0; display: block;
}
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s; }
.ph-tile:hover img { transform: scale(1.06); }
.ph-tile.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--acc); border: 1px dashed rgba(255, 153, 0, 0.5); background: var(--acc-soft); font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.ph-tile.add svg { width: 24px; height: 24px; }
.ph-tile.add:hover { background: rgba(255, 153, 0, 0.22); }
.ph-tile.up { display: flex; align-items: center; justify-content: center; }
.ph-tile.up .up-bar { position: absolute; left: 8px; right: 8px; bottom: 10px; height: 3px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
.ph-tile.up .up-bar span { display: block; height: 100%; width: 0; background: var(--acc); transition: width 0.2s; }
.ph-tile.up .up-pct { font-family: var(--f-mono); font-size: 13px; color: var(--dim); }
.ph-tile.up img { position: absolute; inset: 0; opacity: 0.35; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, 0.02); }
.link-row a { flex: 1; min-width: 0; color: var(--cyan); text-decoration: none; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a:hover { text-decoration: underline; }
.link-row small { display: block; color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .l-ico { color: var(--cyan); display: inline-flex; flex: none; }
.link-row .l-ico svg { width: 16px; height: 16px; }
.icon-x { flex: none; width: 28px; height: 28px; border: 0; background: transparent; color: var(--faint); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; }
.icon-x:hover { color: var(--bad); background: rgba(255, 77, 94, 0.12); }
.icon-x svg { width: 15px; height: 15px; }
.add-link { display: flex; gap: 6px; margin-top: 6px; }
.add-link .field { min-height: 38px; font-size: 13.5px; padding: 8px 10px; }
.muted-note { color: var(--faint); font-size: 12.5px; }
.dlg-form { display: grid; gap: 12px; margin-top: 14px; }
.dlg-form label { display: grid; gap: 6px; font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.dlg-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-form .inline-new { display: flex; gap: 6px; }
.dlg-form .err { color: #ff9aa4; font-size: 13px; min-height: 1em; }
.dlg-form .check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 500; font-size: 14px; color: var(--text); }
.dlg-form .check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--acc); }
.check-list { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, 0.2); max-height: 170px; overflow-y: auto; }
.check-list.disabled { opacity: 0.45; pointer-events: none; }

/* ---------- projects panel (right) ---------- */
.panel {
  position: absolute; z-index: 30; right: calc(var(--gap) + 62px); top: calc(var(--gap) + 62px + var(--safe-top)); bottom: var(--gap);
  width: 372px; display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(100% + 100px)); opacity: 0; visibility: hidden;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s, visibility 0.36s;
}
.panel.open { transform: none; opacity: 1; visibility: visible; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-title { font-family: var(--f-hud); font-weight: 700; font-size: 17px; letter-spacing: 0.2em; text-transform: uppercase; }
.panel-title::before { content: "◆"; color: var(--acc); margin-right: 9px; font-size: 12px; vertical-align: 2px; }
.panel-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 14px 18px; overscroll-behavior: contain; }
.proj-switch { display: flex; gap: 6px; }
.proj-switch select { flex: 1; min-width: 0; }
.proj-card { margin-top: 12px; padding: 12px; border: 1px solid rgba(255, 153, 0, 0.3); border-radius: 4px; background: linear-gradient(135deg, rgba(255, 153, 0, 0.1), rgba(46, 230, 255, 0.04)); }
.proj-card h4 { margin: 0; font-family: var(--f-hud); font-size: 19px; letter-spacing: 0.04em; text-transform: uppercase; }
.proj-card p { margin: 4px 0 0; color: var(--dim); font-size: 12.5px; white-space: pre-wrap; }
.proj-stats { display: flex; gap: 16px; margin-top: 10px; font-family: var(--f-mono); font-size: 12px; color: var(--dim); }
.proj-stats b { color: var(--acc-2); font-weight: 400; font-size: 18px; margin-right: 4px; }
.proj-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.grp-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 3px; border: 1px solid transparent; }
.grp-row:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.grp-row.off .g-name, .grp-row.off .g-count { opacity: 0.4; }
.eye { flex: none; width: 28px; height: 28px; border: 0; background: transparent; color: var(--acc); display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; }
.eye svg { width: 17px; height: 17px; }
.grp-row.off .eye { color: var(--faint); }
.swatch { flex: none; width: 16px; height: 16px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.35); cursor: pointer; position: relative; overflow: hidden; }
.swatch input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; width: 30px; height: 30px; }
.g-name { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-count { font-family: var(--f-mono); font-size: 12px; color: var(--faint); }
.g-act { flex: none; width: 26px; height: 26px; border: 0; background: transparent; color: var(--faint); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; opacity: 0; }
.g-act svg { width: 14px; height: 14px; }
.grp-row:hover .g-act, .g-act:focus { opacity: 1; }
.g-act:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.g-act.del:hover { color: var(--bad); }
.pt-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; margin-bottom: 5px; border-radius: 3px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); color: var(--text); }
.pt-row:hover { border-color: rgba(255, 153, 0, 0.5); background: var(--acc-soft); }
.pt-row .pd { flex: none; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 1px; }
.pt-row .pr-main { min-width: 0; flex: 1; }
.pt-row .pr-main, .pt-row .pr-title, .pt-row .pr-meta { display: block; }
.pt-row .pr-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-row .pr-meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-row .pr-ico { flex: none; color: var(--faint); display: inline-flex; gap: 4px; font-family: var(--f-mono); font-size: 11px; align-items: center; }
.pt-row .pr-ico svg { width: 13px; height: 13px; }
.signin-box { text-align: center; padding: 18px 6px; }
.signin-box .sb-ico { width: 64px; height: 64px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 153, 0, 0.4); background: var(--acc-soft); color: var(--acc); transform: rotate(45deg); border-radius: 6px; }
.signin-box .sb-ico svg { width: 28px; height: 28px; transform: rotate(-45deg); }
.signin-box h4 { margin: 8px 0 6px; font-family: var(--f-hud); font-size: 20px; letter-spacing: 0.1em; text-transform: uppercase; }
.signin-box p { color: var(--dim); font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; }
.feat-list { text-align: left; display: grid; gap: 7px; margin: 0 0 16px; padding: 0; list-style: none; }
.feat-list li { display: flex; gap: 9px; font-size: 13.5px; color: var(--text); }
.feat-list li::before { content: "▸"; color: var(--acc); }

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(2, 5, 10, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.18s ease-out; }
/* Dialogs can be raised from inside Street View (e.g. Save point), so they sit above it. */
#dlgModal, #confirmModal { z-index: 75; }
.modal-backdrop.open .modal { animation: popIn 0.26s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal { width: 100%; max-width: 460px; max-height: calc(100% - 20px); overflow-y: auto; overflow-x: hidden; padding: 20px 20px 18px; background: rgba(9, 13, 21, 0.94); }
.modal-wide { max-width: 640px; }
.modal-sm { max-width: 400px; }
.modal-x { float: right; margin: -4px -4px 0 10px; }
.modal-kicker { font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--acc); }
.modal h3 { margin: 4px 0 6px; font-family: var(--f-hud); font-weight: 700; font-size: 24px; letter-spacing: 0.03em; line-height: 1.1; }
.modal p { color: var(--dim); font-size: 13.5px; line-height: 1.55; }
.modal ol { padding-left: 20px; line-height: 1.65; font-size: 13.5px; color: var(--text); }
.embed-frame { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 4px; margin-top: 8px; background: #000; }
.seg { display: flex; gap: 0; margin: 12px 0; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.seg-btn { flex: 1; padding: 9px; border: 0; background: transparent; font-family: var(--f-hud); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn.active { background: var(--acc); color: #140c00; }
.share-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; }
.share-qr img { width: 200px; height: 200px; background: #fff; border-radius: 8px; padding: 6px; box-shadow: 0 0 30px rgba(255, 153, 0, 0.18); }
.share-qr-hint { font-size: 11.5px; color: var(--faint); }
.share-url { margin-top: 10px; }
.field.mono { font-family: var(--f-mono); font-size: 13px; }

/* share-link manager */
.sl-row { padding: 11px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.02); }
.sl-top { display: flex; align-items: center; gap: 8px; }
.sl-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-views { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.sl-scope { margin-top: 5px; font-size: 12px; color: var(--dim); line-height: 1.45; }
.sl-scope b { color: var(--cyan); font-weight: 600; }
.sl-acts { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

/* ---------- Street View (always full screen) ---------- */
.sv-modal { position: fixed; inset: 0; z-index: 70; display: none; background: #000; }
.sv-modal.open { display: block; animation: fadeIn 0.25s ease-out; }
#svPano, .sv-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#svPano { overflow: hidden; touch-action: none; }
/* Tapping the pin in Street View raises its info card over the panorama;
   anything opened from that card (share, photos, dialogs) sits above it. */
body.sv-open .card.sv-raised { z-index: 72; }
body.sv-open .modal-backdrop { z-index: 76; }
.wp-pin.sv-pin .wp-drop, .wp-pin.sv-pin .wp-box, .wp-pin.sv-pin.free::after { pointer-events: auto; cursor: pointer; }
.sv-back { pointer-events: auto; background: linear-gradient(90deg, var(--acc), var(--acc-2)); color: #140c00; border: 0; font-family: var(--f-hud); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; box-shadow: 0 8px 22px rgba(255, 140, 0, 0.35); }
.sv-back[hidden] { display: none; }
.sv-back svg { width: 18px; height: 18px; }
.sv-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px; text-align: center; color: var(--dim); font-size: 15px; line-height: 1.5; }
.sv-tl { position: absolute; z-index: 5; top: calc(14px + var(--safe-top)); left: 14px; display: flex; align-items: center; gap: 14px; padding: 8px 16px 8px 8px; max-width: calc(50% - 150px); }
.sv-id { min-width: 0; }
.sv-kicker { font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.22em; color: var(--cyan); text-transform: uppercase; }
.sv-title { font-family: var(--f-hud); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-ch { font-family: var(--f-mono); font-size: 15px; color: var(--acc-2); text-shadow: 0 0 12px rgba(255, 153, 0, 0.5); }
.sv-tr { position: absolute; z-index: 5; top: calc(14px + var(--safe-top)); right: 14px; display: flex; gap: 8px; }
.sv-tr .hbtn { background: rgba(9, 13, 21, 0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sv-tr .hbtn.primary { background: linear-gradient(90deg, var(--acc), var(--acc-2)); }
.sv-compass { position: absolute; z-index: 5; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%); width: 300px; height: 46px; padding: 0; overflow: visible; }
.svc-window { position: absolute; inset: 0 0 12px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.svc-strip { position: absolute; top: 0; left: 0; height: 100%; will-change: transform; }
.svc-tick { position: absolute; top: 4px; width: 1px; height: 7px; background: rgba(255, 255, 255, 0.35); }
.svc-tick.maj { height: 11px; background: rgba(255, 255, 255, 0.7); }
.svc-lbl { position: absolute; top: 15px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 11px; color: var(--dim); }
.svc-lbl.cd { color: var(--text); font-family: var(--f-hud); font-weight: 700; font-size: 14px; top: 12px; }
.svc-lbl.n { color: var(--acc); }
.svc-needle { position: absolute; left: 50%; top: -1px; width: 0; height: 0; margin-left: -6px; border: 6px solid transparent; border-top: 8px solid var(--acc); }
.svc-read { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); padding: 1px 7px; background: var(--acc); color: #140c00; font-family: var(--f-mono); font-size: 12px; border-radius: 2px; }
.svc-target { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 10px var(--cyan); display: none; }
.sv-bottom { position: absolute; z-index: 5; left: 0; right: 0; bottom: calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.sv-prompt { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-family: var(--f-hud); font-weight: 700; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.sv-prompt kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.92); color: #0b111b; font-family: var(--f-mono); font-size: 12px; box-shadow: 0 3px 0 rgba(255, 255, 255, 0.35); }
.sv-prompt .plus { color: var(--dim); }
.sv-dist { display: none; padding: 5px 12px; font-family: var(--f-mono); font-size: 13px; color: var(--cyan); }
.sv-dist.show { display: block; }
.wp-pin.sv-pin { position: absolute; z-index: 3; pointer-events: none; }
.sv-pin .wp-box { transform: scale(1.12); transform-origin: 100% 100%; }
.sv-pin.flip .wp-box { transform-origin: 0 100%; }

/* ---------- map markers ---------- */
.user-marker { width: 20px; height: 20px; border-radius: 50%; background: var(--cyan); border: 3px solid #04121a; box-shadow: 0 0 0 3px rgba(46, 230, 255, 0.35), 0 0 18px rgba(46, 230, 255, 0.8); }
/* chainage pin (as on the website hero): a zero-size anchor on the road point
   with pulse rings, a drop pin, and a readout box up-left on a leader line */
.wp-pin { position: relative; width: 0; height: 0; cursor: pointer; }
.wp-pin > * { position: absolute; }
.wp-rings i { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--acc); animation: wpRing 2.2s ease-out infinite; }
.wp-rings i + i { animation-delay: 1.1s; }
@keyframes wpRing { from { opacity: 0.95; transform: scale(0.45); } to { opacity: 0; transform: scale(2.3); } }
.wp-shadow { left: -8px; top: -3px; width: 16px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); }
.wp-drop { left: -14px; top: -34px; width: 28px; height: 36px; overflow: visible; filter: drop-shadow(0 0 8px rgba(255, 153, 0, 0.55)); }
.wp-drop path { fill: var(--acc); stroke: #140c00; stroke-width: 1.6; }
.wp-drop circle { fill: #140c00; }
.wp-lead { left: -24px; top: -46px; width: 22px; height: 20px; overflow: visible; }
.wp-lead path { fill: none; stroke: var(--acc); stroke-width: 1.4; opacity: 0.9; }
.wp-box {
  right: 22px; bottom: 44px; display: flex; flex-direction: column; gap: 3px; padding: 7px 11px 7px 10px; white-space: nowrap;
  background: rgba(7, 11, 18, 0.94); border: 1px solid rgba(255, 153, 0, 0.85); border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 153, 0, 0.18);
}
.wp-box::before { content: ""; position: absolute; left: -1px; top: -1px; width: 10px; height: 10px; border-left: 2.5px solid var(--acc); border-top: 2.5px solid var(--acc); border-top-left-radius: 4px; }
.wp-kick { display: none; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.wp-km { font-family: var(--f-mono); font-size: 21px; line-height: 1; color: #eaf1fb; }
.wp-km small { font-size: 11px; color: #ffb547; margin-left: 4px; }
.wp-sub { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.07em; color: #93a6c1; text-transform: uppercase; }
.wp-sub:empty { display: none; }
.wp-pin.flip .wp-box { right: auto; left: 22px; }
.wp-pin.flip .wp-lead { left: 2px; transform: scaleX(-1); }
/* dropped (off-road) pin: cyan dot, DROPPED PIN readout */
.wp-pin.free .wp-drop, .wp-pin.free .wp-shadow { display: none; }
.wp-pin.free::after { content: ""; position: absolute; left: -7.5px; top: -7.5px; width: 15px; height: 15px; border-radius: 50%; background: var(--cyan); border: 2.5px solid #001418; box-sizing: border-box; box-shadow: 0 0 12px rgba(46, 230, 255, 0.8); }
.wp-pin.free .wp-rings i { border-color: var(--cyan); }
.wp-pin.free .wp-lead { top: -34px; }
.wp-pin.free .wp-lead path { stroke: var(--cyan); }
.wp-pin.free .wp-box { bottom: 32px; border-color: rgba(46, 230, 255, 0.6); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 18px rgba(46, 230, 255, 0.15); }
.wp-pin.free .wp-box::before { border-color: var(--cyan); }
.wp-pin.free .wp-kick { display: block; }
.wp-pin.free .wp-km { font-size: 14px; }
/* drop-in: the pin falls onto the road, the box and leader fade up */
.wp-pin.drop .wp-drop { animation: wpDrop 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.wp-pin.drop .wp-box, .wp-pin.drop .wp-lead { animation: wpBox 0.45s 0.18s ease-out both; }
@keyframes wpDrop { from { transform: translateY(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wpBox { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wp-rings, .wp-pin.drop .wp-drop, .wp-pin.drop .wp-box, .wp-pin.drop .wp-lead { animation: none; } }
@media (max-width: 720px) { .wp-km { font-size: 18px; } .wp-box { padding: 6px 9px; } }
.tap-marker { width: 12px; height: 12px; border-radius: 50%; background: #c9d6e8; border: 2px solid #0b111b; box-shadow: 0 0 0 2px rgba(201, 214, 232, 0.4); }
.source-marker { display: flex; flex-direction: column; align-items: center; }
.source-marker .sm-label { background: rgba(9, 13, 21, 0.92); color: var(--cyan); font-family: var(--f-mono); font-size: 12px; line-height: 1; padding: 6px 9px; white-space: nowrap; border: 1px solid var(--cyan); border-radius: 2px; margin-bottom: 5px; box-shadow: 0 0 14px rgba(46, 230, 255, 0.4); }
.source-marker .sm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); border: 2px solid #04121a; box-shadow: 0 0 12px var(--cyan); }
/* radar ping where the map was tapped */
.ping { position: absolute; z-index: 2; width: 0; height: 0; pointer-events: none; }
.ping::before, .ping::after { content: ""; position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--acc); animation: ping 0.75s ease-out forwards; }
.ping::after { animation-delay: 0.15s; border-color: var(--cyan); }
@keyframes ping { from { transform: scale(0.15); opacity: 1; } to { transform: scale(1.2); opacity: 0; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(2, 4, 8, 0.96); }
.lightbox.open { display: block; animation: fadeIn 0.2s; }
.lightbox img { position: absolute; inset: 64px 16px 64px; width: calc(100% - 32px); height: calc(100% - 128px); object-fit: contain; }
.lb-top { position: absolute; top: calc(12px + var(--safe-top)); left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-count { color: var(--dim); font-size: 13px; }
.lb-actions { display: flex; gap: 8px; align-items: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 1px solid var(--line-2); background: rgba(9, 13, 21, 0.7); color: var(--text); border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.lb-nav svg { width: 24px; height: 24px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-cap { position: absolute; left: 16px; right: 16px; bottom: calc(18px + var(--safe-bottom)); text-align: center; color: var(--text); font-size: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 11px 16px 11px 14px;
  background: rgba(9, 13, 21, 0.94); border: 1px solid var(--line-2); border-left: 3px solid var(--acc); border-radius: 3px;
  box-shadow: var(--shadow); color: var(--text); font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s;
}
.toast::before { content: "◆"; color: var(--acc); font-size: 10px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- misc ---------- */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--acc); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -3px; }
.spinner.dark { border-color: rgba(0, 0, 0, 0.15); border-top-color: #e02323; }
@keyframes spin { to { transform: rotate(360deg); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.only-desktop { }

/* ---------- brand plate is a button (opens About) ---------- */
button.brand-plate { font: inherit; cursor: pointer; text-align: left; }
button.brand-plate:hover { border-color: rgba(255, 153, 0, 0.55); }
.about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.about-head img { width: 58px; height: 58px; border-radius: 12px; box-shadow: 0 0 24px rgba(255, 153, 0, 0.3); }
.about-head h3 { margin: 2px 0 0; letter-spacing: 0.22em; }
.about-by { font-size: 12.5px; color: var(--dim); }
.about-by b { color: var(--acc); font-weight: 600; }
.modal.about .feat-list { margin: 12px 0; }

/* ---------- context chip: current project > phase > layer ---------- */
/* Desktop: top-right, beside the tool rail (clear of the result card on the
   left); it tucks away while the project panel occupies that corner. */
.ctx-chip {
  position: absolute; z-index: 20; right: calc(var(--gap) + 62px); top: calc(var(--gap) + 62px + var(--safe-top));
  width: 280px; padding: 8px 10px 9px; border-left: 3px solid var(--layer-color, var(--acc));
}
body:has(#projPanel.open) .ctx-chip { visibility: hidden; }
.cc-top { display: flex; align-items: flex-start; gap: 6px; }
.cc-proj { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; border: 0; background: none; padding: 0 0 6px; text-align: left; color: var(--text); }
.cc-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -3px -3px 0 0; padding: 0; border: 1px solid transparent; border-radius: 3px; background: none; color: var(--dim); cursor: pointer; }
.cc-x svg { width: 14px; height: 14px; }
.cc-x:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.05); }
.cc-proj svg { width: 15px; height: 15px; margin-left: auto; color: var(--dim); flex: none; }
.cc-proj .cc-v { font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-k { font-family: var(--f-hud); font-weight: 700; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--acc); flex: none; }
.cc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cc-sel { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-sel .cc-k { color: var(--faint); }
.cc-sel select {
  width: 100%; min-width: 0; height: 30px; padding: 0 26px 0 8px !important; border-radius: 3px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); background-color: rgba(255, 153, 0, 0.1); border: 1px solid rgba(255, 153, 0, 0.45); outline: none;
}
#ccLayer { background-color: color-mix(in srgb, var(--layer-color, #ff9900) 18%, transparent); border-color: var(--layer-color, var(--acc)); }
.cc-sel select:focus { box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.18); }
body.shared .ctx-chip { top: calc(var(--gap) + 118px + var(--safe-top)); }
@media (min-width: 721px) {
  body.has-ctx .live-status { max-width: min(520px, calc(100% - 2 * (var(--gap) + 62px + 296px))); }
}
@media (min-width: 721px) and (max-width: 1180px) {
  body.has-ctx .live-status { top: calc(var(--gap) + 62px + 106px + var(--safe-top)); left: auto; right: calc(var(--gap) + 62px); transform: translate(0, -8px); max-width: 280px; }
  body.has-ctx .live-status.show { transform: none; }
}
body.screen-open .ctx-chip, body.screen-open .live-status { visibility: hidden; }

/* ---------- dropped pin vs snapped ---------- */
.snap-bar { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; padding: 8px; border: 1px dashed rgba(46, 230, 255, 0.4); border-radius: 3px; background: rgba(46, 230, 255, 0.06); }
.snap-bar .hbtn { flex: none; min-height: 36px; font-size: 13px; }
.snap-bar .sb-txt { font-size: 12px; color: var(--dim); line-height: 1.35; }
.readout.nearest { background: linear-gradient(135deg, rgba(46, 230, 255, 0.09), rgba(255, 153, 0, 0.05)); border-color: rgba(46, 230, 255, 0.35); }
.readout.nearest .ro-label { color: var(--cyan); }
.readout.nearest .ro-value { color: #d7f7ff; text-shadow: 0 0 16px rgba(46, 230, 255, 0.35); font-size: 36px; }
.road-dot { width: 12px; height: 12px; background: var(--acc); border: 2px solid #070b12; transform: rotate(45deg); box-shadow: 0 0 10px rgba(255, 153, 0, 0.8); }

/* ---------- saved item card ---------- */
.chip.base { color: var(--cyan); border-color: rgba(46, 230, 255, 0.45); }
.item-title { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.item-title .card-title { margin: 0; }
.it-icon { width: 32px; height: 32px; flex: none; }
.it-line { width: 34px; height: 6px; border-radius: 3px; flex: none; background: var(--c); box-shadow: 0 0 10px var(--c); }
.map-label { display: inline-block; margin-top: 8px; padding: 3px 10px; border: 2px solid var(--c); border-radius: 5px; background: rgba(9, 13, 21, 0.94); font-size: 12.5px; font-weight: 600; }
.ro-unit { font-family: var(--f-mono); font-size: 16px; color: var(--dim); }
.ro-value.range-v { font-size: 30px; }
.data-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 3px; background: rgba(255, 255, 255, 0.03); color: var(--text);
}
.data-toggle > svg { width: 20px; height: 20px; color: var(--cyan); flex: none; }
.data-toggle > svg:last-child { margin-left: auto; color: var(--dim); transition: transform 0.2s; width: 18px; height: 18px; }
.data-toggle.open > svg:last-child { transform: rotate(90deg); }
.data-toggle b { display: block; font-family: var(--f-hud); font-size: 14.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.data-toggle small { color: var(--dim); font-size: 12px; }
.data-toggle:hover { border-color: rgba(46, 230, 255, 0.5); }
.pt-data { margin-top: 8px; }
.range-btn { color: var(--cyan) !important; border-color: rgba(46, 230, 255, 0.45) !important; }
.range-btn:hover { background: var(--cyan-soft) !important; }
.range-ro .range-inputs { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.range-inputs label { flex: 1; display: grid; gap: 4px; font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.range-inputs input { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.35); color: #fff; font-family: var(--f-mono); font-size: 20px; outline: none; }
.range-inputs input:focus { border-color: var(--acc); }
.ri-arrow { font-family: var(--f-mono); font-size: 22px; color: var(--acc); padding-bottom: 8px; }
.move-opts { display: grid; gap: 6px; margin-top: 12px; }
.move-ch { padding: 11px 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.025); }
.move-ch .ri-name { margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.lbl-note { text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 500; color: var(--faint); font-size: 11.5px; }

/* pickers */
.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.ip { aspect-ratio: 1; padding: 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); display: flex; align-items: center; justify-content: center; }
.ip img { width: 100%; height: 100%; max-width: 30px; }
.ip:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.07); }
.ip.on { border-color: var(--acc); background: var(--acc-soft); box-shadow: 0 0 0 1px var(--acc); }
.color-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-sw { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); background: var(--sw); cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: #0b111b; font-weight: 800; }
.cp-sw.layer { width: auto; padding: 0 10px; border-radius: 15px; font-family: var(--f-hud); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.cp-sw.layer span { color: #0b111b; }
.cp-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--acc); }
.cp-sw.custom { overflow: hidden; }
.cp-sw.custom input { position: absolute; inset: -8px; width: 46px; height: 46px; opacity: 0; cursor: pointer; }
.seg.sm { margin: 0; }
.seg.sm .seg-btn { padding: 7px 6px; font-size: 12px; }
input[type=range] { accent-color: var(--acc); width: 100%; }
.cl-group { margin-top: 6px; font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc); }
.cl-group:first-child { margin-top: 0; }

/* ---------- project panel: phases + layers ---------- */
.phase-bar { display: flex; gap: 6px; }
.phase-bar select { flex: 1; min-width: 0; min-height: 38px; font-weight: 600; border-color: rgba(255, 153, 0, 0.5); background-color: rgba(255, 153, 0, 0.08); }
.sq-mini { flex: none; width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--dim); display: inline-flex; align-items: center; justify-content: center; }
.sq-mini svg { width: 16px; height: 16px; }
.sq-mini:hover { color: var(--text); border-color: rgba(255, 153, 0, 0.5); }
.sq-mini.del:hover { color: var(--bad); border-color: rgba(255, 77, 94, 0.5); }
.grp-list.base { border-left: 2px solid rgba(46, 230, 255, 0.35); padding-left: 4px; }
.grp-row .g-name { border: 0; background: none; color: var(--text); text-align: left; padding: 4px 2px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.grp-row.active { background: var(--acc-soft); border-color: rgba(255, 153, 0, 0.5); }
.grp-row .cur { font-family: var(--f-hud); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; padding: 1px 6px; border-radius: 2px; background: var(--acc); color: #140c00; }
.pc-kick { display: flex; align-items: center; gap: 6px; font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.pc-kick svg { width: 13px; height: 13px; }
.proj-card.shared { border-color: rgba(46, 230, 255, 0.35); background: linear-gradient(135deg, rgba(46, 230, 255, 0.1), rgba(255, 153, 0, 0.03)); }
.pc-tags, .tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tagchip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(46, 230, 255, 0.35); background: var(--cyan-soft); color: #bff6ff; font-size: 11.5px; font-weight: 600; cursor: default; }
button.tagchip { cursor: pointer; font-family: inherit; }
button.tagchip:hover { border-color: var(--cyan); }
.pt-row .pr-icon { width: 22px; height: 22px; flex: none; }
.pt-row .pr-line { width: 18px; height: 5px; border-radius: 3px; flex: none; background: var(--c); }
.pt-row.on { border-color: var(--acc); background: var(--acc-soft); }
.acct-btn.admin .acct-av { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px rgba(46, 230, 255, 0.4); }
.adm-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 2px; background: var(--cyan); color: #001418; font-family: var(--f-hud); font-size: 10px; letter-spacing: 0.12em; vertical-align: 2px; }
.adm-badge.off { background: var(--bad); color: #fff; }
.adm-badge.you { background: var(--acc); color: #140c00; }
.sb-kept { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); }
.sb-kept svg { width: 15px; height: 15px; }
#dlgBox.modal-wide { max-width: 560px; }

/* ---------- pick-on-map banner ---------- */
.pick-bar {
  position: absolute; z-index: 35; left: 50%; top: calc(var(--gap) + 66px + var(--safe-top)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; max-width: calc(100% - 2 * var(--gap));
  border-color: rgba(46, 230, 255, 0.55); font-size: 13.5px; font-weight: 500;
}
.pb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); animation: pulseC 1.4s infinite; flex: none; }
@keyframes pulseC { 0% { box-shadow: 0 0 0 0 rgba(46, 230, 255, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(46, 230, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 230, 255, 0); } }
body.picking .live-status { visibility: hidden; }

/* ---------- full-screen screens (Project Hub, admin) ---------- */
.screen {
  position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; gap: 12px;
  padding: calc(var(--gap) + var(--safe-top)) var(--gap) var(--gap);
  background: radial-gradient(ellipse at 20% 0%, rgba(255, 153, 0, 0.08), transparent 55%), radial-gradient(ellipse at 90% 100%, rgba(46, 230, 255, 0.07), transparent 55%), rgba(5, 8, 14, 0.96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease-out;
}
.scr-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.scr-title { font-family: var(--f-hud); font-weight: 700; font-size: 20px; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.scr-title::before { content: "\25C6"; color: var(--acc); margin-right: 10px; font-size: 14px; vertical-align: 2px; }
.scr-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border: 1px solid var(--line-2); border-radius: 4px; background: rgba(0, 0, 0, 0.3); }
.scr-search svg { width: 17px; height: 17px; color: var(--acc); flex: none; }
.scr-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; }
.scr-acts { display: flex; gap: 8px; align-items: center; }
.scr-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px 1fr; gap: 12px; }
.scr-body.single { grid-template-columns: 1fr; }
.scr-side { overflow-y: auto; overflow-x: hidden; padding: 10px 8px; }
body.screen-open .locate-btn, body.screen-open .telemetry { visibility: hidden; }
.scr-main { overflow-y: auto; padding: 4px 4px 20px; min-width: 0; }
.scr-loading { margin: auto; color: var(--dim); display: flex; align-items: center; gap: 10px; }
.tree-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 3px; background: none; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; }
.tree-item svg { width: 16px; height: 16px; color: var(--dim); flex: none; }
.tree-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item i { font-style: normal; font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.tree-item:hover { background: rgba(255, 255, 255, 0.05); }
.tree-item.on { background: var(--acc-soft); box-shadow: inset 2px 0 0 var(--acc); }
.tree-item.on svg { color: var(--acc); }
.tree-item.folder svg { color: #ffc766; }
.tree-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 4px 6px 10px; font-family: var(--f-hud); font-weight: 700; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.tree-head .sq-mini { width: 28px; height: 28px; }
.side-note { padding: 2px 10px; line-height: 1.5; }
.scr-side .tag-cloud { padding: 0 8px; }
.hub-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 4px 2px 14px; }
.hub-crumbs h2 { margin: 0; font-family: var(--f-hud); font-weight: 700; font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; }
.hub-crumbs .count { font-family: var(--f-mono); font-size: 12px; color: var(--faint); }
.crumb-acts { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.fcard { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 199, 102, 0.05); color: var(--text); text-align: left; font-weight: 600; }
.fcard svg { width: 20px; height: 20px; color: #ffc766; flex: none; }
.fcard span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard i { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--faint); }
.fcard:hover { border-color: rgba(255, 199, 102, 0.6); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); transition: border-color 0.15s, transform 0.15s; }
.pcard:hover { border-color: rgba(255, 153, 0, 0.5); transform: translateY(-1px); }
.pcard::before { content: ""; position: absolute; left: -1px; top: -1px; width: 12px; height: 12px; border-top: 2px solid var(--acc); border-left: 2px solid var(--acc); border-top-left-radius: 5px; }
.pcard.shared::before { border-color: var(--cyan); }
.pcard.active { border-color: var(--acc); box-shadow: 0 0 0 1px rgba(255, 153, 0, 0.4), 0 0 26px rgba(255, 153, 0, 0.12); }
.pc-top { display: flex; align-items: center; }
.pc-kind { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.pcard.shared .pc-kind { color: var(--cyan); }
.pcard.active .pc-kind { color: var(--acc); }
.pc-kind svg { width: 13px; height: 13px; }
.pcard h4 { margin: 0; font-family: var(--f-hud); font-weight: 700; font-size: 18px; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.15; }
.pc-desc { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pc-tags { margin-top: 2px; }
.pc-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); margin-top: auto; padding-top: 4px; }
.pc-folder { display: inline-flex; align-items: center; gap: 4px; color: #ffc766; }
.pc-folder svg { width: 12px; height: 12px; }
.pc-acts { display: flex; gap: 6px; margin-top: 6px; }
.pc-acts .hbtn:first-child { flex: 1; }
.hub-empty { padding: 34px 16px; text-align: center; color: var(--dim); border: 1px dashed var(--line-2); border-radius: 5px; margin-bottom: 12px; line-height: 1.55; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 12px 14px; }
.kpi span { display: block; font-family: var(--f-hud); font-weight: 700; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.kpi b { font-family: var(--f-mono); font-weight: 400; font-size: 28px; color: var(--acc-2); }
.ulist { display: grid; gap: 8px; }
.urow { display: grid; grid-template-columns: minmax(220px, 1.3fr) 1fr 1fr auto; align-items: center; gap: 14px; padding: 12px 14px; }
.urow.disabled { opacity: 0.6; }
.ur-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ur-id b { display: block; font-size: 14px; }
.ur-id > div > span { display: block; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.ur-id > div { min-width: 0; }
.acct-av.adm { background: linear-gradient(135deg, var(--cyan), #3b82f6); color: #001418; border-color: transparent; }
.ur-stats { display: flex; gap: 12px; font-size: 11.5px; color: var(--faint); }
.ur-stats b { display: block; font-family: var(--f-mono); font-weight: 400; font-size: 17px; color: var(--text); }
.ur-dates { display: grid; gap: 2px; font-size: 12px; color: var(--dim); }
.ur-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- mid-size desktop: keep the command bar between brand and account ---------- */
@media (max-width: 1200px) and (min-width: 721px) {
  .cmd { left: 240px; right: 290px; width: auto; transform: none; }
}
@media (max-width: 960px) and (min-width: 721px) {
  .acct-label { display: none; }
  .acct-btn { padding: 0 8px; }
  .cmd { right: 140px; }
  :root { --card-w: 360px; }
}

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  :root { --gap: 10px; }
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  .brand-plate { padding: 6px 12px 6px 6px; gap: 9px; }
  .brand-plate img { width: 30px; height: 30px; }
  .bp-name { font-size: 17px; letter-spacing: 0.18em; }
  .bp-by { font-size: 10px; margin-top: 3px; }
  .hud-tr { gap: 6px; }
  .sq-btn { width: 44px; height: 44px; }
  .acct-btn { height: 44px; padding: 0 5px; }
  .acct-av { width: 32px; height: 32px; }
  .acct-label { display: none; }
  .rail { top: calc(var(--gap) + 52px + var(--safe-top)); padding: 4px; }
  .rail-btn { width: 36px; height: 36px; }
  .acct-menu { top: calc(var(--gap) + 52px + var(--safe-top)); }
  .base-menu { top: calc(var(--gap) + 52px + var(--safe-top)); right: calc(var(--gap) + 52px); }
  .telemetry { display: none; }
  .live-status { top: calc(var(--gap) + 54px + var(--safe-top)); max-width: calc(100% - 90px); left: calc(50% - 22px); font-size: 13px; }
  .share-banner { top: calc(var(--gap) + 54px + var(--safe-top)); left: var(--gap); right: calc(var(--gap) + 56px); transform: none; }
  .share-banner .sb-name { max-width: 34vw; }
  body.shared .live-status { top: calc(var(--gap) + 104px + var(--safe-top)); }

  /* search = full-screen command overlay */
  .cmd { display: none; top: 0; left: 0; right: 0; bottom: 0; transform: none; width: auto; min-width: 0; padding: calc(10px + var(--safe-top)) 10px 10px; background: rgba(4, 7, 12, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); flex-direction: column; }
  body.search-open .cmd { display: flex; }
  .cmd-back { display: inline-flex; }
  .cmd-kbd { display: none; }
  .cmd-results { display: block; flex: 1; max-height: none; margin-top: 10px; }
  .cmd-bar input { font-size: 16px; }

  .locate-btn { height: 54px; font-size: 16px; letter-spacing: 0.08em; bottom: calc(18px + var(--safe-bottom)); padding-right: 20px; }
  #locateLabel { overflow: hidden; text-overflow: ellipsis; }
  .lb-ico { width: 38px; height: 38px; }

  /* cards become bottom sheets */
  .card {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 76%; border-radius: 10px 10px 0 0; border-bottom: 0;
    transform: translateY(105%); padding-bottom: var(--safe-bottom);
  }
  .card.open { transform: none; }
  .card::after { display: none; }
  .grabber { display: block; flex: none; width: 46px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 9px auto 0; cursor: pointer; }
  .card-scroll { padding: 8px 14px 16px; }
  .card-title { font-size: 21px; margin-top: 10px; }
  .ro-value { font-size: 36px; }
  body.card-open .telemetry { left: var(--gap); }

  .panel { left: 0; right: 0; top: 10%; bottom: 0; width: auto; border-radius: 10px 10px 0 0; transform: translateY(105%); padding-bottom: var(--safe-bottom); }
  .panel.open { transform: none; }
  .g-act { opacity: 1; }

  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 10px 10px 0 0; max-height: 92%; padding-bottom: calc(18px + var(--safe-bottom)); }

  .sv-tl { max-width: calc(100% - 120px); padding: 6px 12px 6px 6px; top: calc(10px + var(--safe-top)); left: 10px; }
  .sv-id { min-width: 0; }
  body:has(#svSave:not([hidden])) .sv-tl { max-width: calc(100% - 196px); }
  .sv-tr { top: calc(10px + var(--safe-top)); right: 10px; }
  .sv-tr .hbtn { padding: 0 11px; }
  .sv-compass { top: auto; bottom: calc(80px + var(--safe-bottom)); width: 240px; }
  .sv-bottom { bottom: calc(14px + var(--safe-bottom)); }
  .sv-prompt { font-size: 12.5px; padding: 8px 12px; }
  .sv-dist { display: none !important; }
  .toast { bottom: calc(88px + var(--safe-bottom)); }
  body.sheet-open .toast { bottom: calc(40% + 12px); }
  .lb-nav { display: none; }
}

@media (max-width: 1100px) and (min-width: 721px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .urow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .ctx-chip { top: calc(var(--gap) + 52px + var(--safe-top)); width: auto; left: var(--gap); right: calc(var(--gap) + 52px); padding: 6px 8px 7px; }
  body:has(#projPanel.open) .ctx-chip { visibility: visible; }
  .cc-proj { padding-bottom: 4px; }
  .cc-proj .cc-v { font-size: 13.5px; }
  .cc-sel select { height: 28px; font-size: 12.5px; }
  body.has-ctx .live-status { top: calc(var(--gap) + 52px + 86px + var(--safe-top)); }
  body.shared .ctx-chip { top: calc(var(--gap) + 100px + var(--safe-top)); }
  body.has-ctx .card, body.shared.has-ctx .card { top: auto; }
  .pick-bar { top: auto; bottom: calc(86px + var(--safe-bottom)); font-size: 12.5px; }
  .icon-pick { grid-template-columns: repeat(8, 1fr); gap: 4px; }
  .snap-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .screen { padding: calc(8px + var(--safe-top)) 8px 8px; gap: 8px; }
  .scr-head { flex-wrap: wrap; padding: 8px; gap: 8px; }
  .scr-title { font-size: 16px; flex: 1; }
  .scr-search { order: 3; flex-basis: 100%; }
  .scr-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .scr-side { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 6px; white-space: nowrap; }
  .scr-side .tree-item { width: auto; flex: none; padding: 7px 10px !important; }
  .scr-side .tree-head, .scr-side .side-note, .scr-side .tag-cloud { display: none; }
  .pgrid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .kpi b { font-size: 22px; }
  .urow { grid-template-columns: 1fr; gap: 8px; }
  .ur-acts { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- round 3: project pages, teams, billing, share settings ---------- */
.acct-av { position: relative; }
.acct-btn.alert .acct-av::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--cyan); }
.plan-chip { display: inline-flex; align-self: flex-start; margin-top: 6px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line-2); font-family: var(--f-hud); font-weight: 700; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.plan-chip.operator { color: var(--acc-2); border-color: rgba(255, 153, 0, 0.5); }
.plan-chip.crew { color: var(--ok); border-color: rgba(61, 220, 132, 0.5); }
.plan-chip.authority { color: var(--cyan); border-color: rgba(46, 230, 255, 0.5); }
.menu-id { display: flex; flex-direction: column; }
.menu-item.warn { color: var(--cyan); }
.menu-item.warn svg { color: var(--cyan); }
.menu-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--cyan); color: #001418; font-family: var(--f-mono); font-size: 11px; text-align: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--acc-2); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }
.link-btn:hover { color: var(--acc); }
.fine { margin: 12px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.fine a { color: var(--dim); }
.ro-banner { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 10px; border: 1px solid rgba(255, 194, 51, 0.45); border-radius: 4px; background: rgba(255, 194, 51, 0.08); color: #ffe4a3; font-size: 13px; line-height: 1.45; }
.ro-banner svg { width: 16px; height: 16px; flex: none; color: var(--warn); }
.ro-banner.cyan { border-color: rgba(46, 230, 255, 0.4); background: var(--cyan-soft); color: #c9f7ff; }
.ro-banner.cyan svg { color: var(--cyan); }
.ro-banner.wide { margin: 0; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); text-decoration: none; background: rgba(255, 255, 255, 0.02); }
.file-row:hover { border-color: rgba(46, 230, 255, 0.5); }
.file-row svg { width: 16px; height: 16px; flex: none; color: var(--cyan); }
.fr-main { flex: 1; min-width: 0; display: grid; }
.fr-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-meta { font-family: var(--f-mono); font-size: 11px; color: var(--faint); }
.mono-sub { font-family: var(--f-mono); font-size: 12px; color: var(--dim); margin: 2px 0 0; }

/* badges */
.sbadge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.sbadge svg { width: 12px; height: 12px; }
.sbadge.lock { color: var(--ok); border-color: rgba(61, 220, 132, 0.45); }
.sbadge.open { color: var(--warn); border-color: rgba(255, 194, 51, 0.4); }
.sbadge.bad { color: #ff9aa4; border-color: rgba(255, 77, 94, 0.5); }
.sbadge.ok { color: var(--ok); border-color: rgba(61, 220, 132, 0.45); }
.sbadge.seat { color: var(--acc-2); border-color: rgba(255, 153, 0, 0.45); }
.sbadge.free { color: var(--cyan); border-color: rgba(46, 230, 255, 0.4); }
.sl-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.dlg-sec { display: flex; align-items: center; gap: 7px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-family: var(--f-hud); font-weight: 700; font-size: 12.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--acc); }
.dlg-sec svg { width: 15px; height: 15px; }
.st-chip { display: inline-block; margin-left: auto; padding: 1px 7px; border-radius: 3px; font-family: var(--f-hud); font-weight: 700; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--dim); }
.st-chip.planning { color: #b9a6ff; border-color: rgba(179, 136, 255, 0.5); }
.st-chip.on_hold { color: var(--warn); border-color: rgba(255, 194, 51, 0.5); }
.st-chip.complete { color: var(--ok); border-color: rgba(61, 220, 132, 0.5); }
.st-chip.archived { color: var(--faint); }
.pg-kick .st-chip { margin-left: 4px; }

/* project hub cards */
.pcard { cursor: pointer; }
.pcard.company::before { border-color: var(--ok); }
.pcard.company .pc-kind { color: var(--ok); }
.pc-meta { margin: 0; font-family: var(--f-mono); font-size: 12px; color: var(--dim); }
.tree-head span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-head span svg { width: 13px; height: 13px; color: var(--ok); flex: none; }
.tree-item.team-link { margin-top: 12px; color: var(--ok); }
.tree-item.team-link svg { color: var(--ok); }
.plan-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; }
.plan-note svg { width: 18px; height: 18px; color: var(--acc); flex: none; }
.plan-note span { flex: 1; }
.plan-note.cyan svg { color: var(--cyan); }
.plan-note.cyan::before, .plan-note.cyan::after { border-color: var(--cyan); }

/* tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font-family: var(--f-hud); font-weight: 700; font-size: 13.5px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.tab i { font-style: normal; font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); margin-left: 3px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--acc-2); border-bottom-color: var(--acc); }
.pg-tabs .tabs { margin-bottom: 0; }
.adm-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.note-card { padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; line-height: 1.55; color: var(--dim); }
.note-card p { margin: 0 0 6px; }
.note-card b { color: var(--text); }

/* project page */
.pg-head .back-btn { flex: none; }
.pg-title { flex: 1; min-width: 0; }
.pg-title h2 { margin: 2px 0 0; font-family: var(--f-hud); font-weight: 700; font-size: 22px; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-kick { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-hud); font-weight: 700; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.pg-kick svg { width: 13px; height: 13px; color: var(--acc); }
.scr-title .pg-kick { display: flex; margin-bottom: 2px; }
.pg-main { max-width: 1280px; width: 100%; margin: 0 auto; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.pg-grid > aside { display: grid; gap: 12px; }
.pg-cols { display: grid; gap: 12px; max-width: 900px; }
.panel-card { padding: 14px 16px; }
.pc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--f-hud); font-weight: 700; font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); }
.pc-head > span:first-child { display: inline-flex; align-items: center; gap: 8px; flex: 1; }
.pc-head svg { width: 17px; height: 17px; color: var(--acc); }
.pc-head .muted-note { flex: none; text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-weight: 500; }
.pg-form { margin-top: 0; }
.notes-area { min-height: 180px; line-height: 1.55; }
.saved-note { align-self: center; color: var(--ok); font-family: var(--f-hud); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; flex: none !important; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0 0 10px; font-size: 14px; }
.kv dt { font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding-top: 2px; }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { display: grid; justify-items: start; gap: 2px; padding: 10px 12px; }
.tile .t-ico svg { width: 16px; height: 16px; color: var(--acc); }
.tile b { font-family: var(--f-mono); font-weight: 400; font-size: 24px; color: var(--acc-2); line-height: 1.1; }
.tile span:last-child { font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.usage { margin: 6px 0 10px; }
.us-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--dim); margin-bottom: 5px; }
.us-top b { font-family: var(--f-mono); font-weight: 400; color: var(--text); }
.us-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.us-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #19c7e6); border-radius: 4px; }
.us-bar.warm span { background: linear-gradient(90deg, var(--acc), var(--acc-2)); }
.us-bar.hot span { background: linear-gradient(90deg, #ff6a00, var(--bad)); }
.owner-line { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.owner-line svg { width: 16px; height: 16px; color: var(--acc); }
.act-list { display: grid; }
.act-row { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: 0; }
.act-ico { flex: none; width: 28px; height: 28px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; background: var(--acc-soft); }
.act-ico svg { width: 15px; height: 15px; color: var(--acc); }
.act-main { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.act-main time { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--faint); margin-top: 1px; }
.act-proj { color: var(--cyan); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fchip { padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--dim); font-size: 12.5px; font-weight: 600; }
.fchip:hover { color: var(--text); border-color: rgba(255, 153, 0, 0.5); }
.fchip.on { background: var(--acc); border-color: var(--acc); color: #140c00; }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; margin-bottom: 12px; text-align: center; cursor: pointer; border-style: dashed; border-color: rgba(255, 153, 0, 0.45); transition: background 0.15s, border-color 0.15s; }
.dropzone svg { width: 30px; height: 30px; color: var(--acc); }
.dropzone b { font-family: var(--f-hud); font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; }
.dropzone span { color: var(--dim); font-size: 12.5px; }
.dropzone:hover, .dropzone.over { background: var(--acc-soft); border-color: var(--acc); }
.up-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; }
.ur-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ur-state { font-family: var(--f-mono); font-size: 12px; color: var(--dim); }
.ur-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ur-bar span { display: block; height: 100%; background: var(--acc); transition: width 0.2s; }
.up-row.failed { border-color: rgba(255, 77, 94, 0.5); }
.up-row.failed .ur-state { color: #ff9aa4; }
.up-row.failed .ur-bar span { background: var(--bad); }
.file-list { display: grid; gap: 8px; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.fc-ico { flex: none; width: 44px; height: 44px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; background: rgba(46, 230, 255, 0.1); border: 1px solid rgba(46, 230, 255, 0.35); color: var(--cyan); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.05em; }
.fc-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fc-name { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-name:hover { color: var(--acc-2); text-decoration: underline; }
.fc-meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.fc-note { font-size: 12.5px; color: var(--dim); }
.fc-acts { display: flex; gap: 6px; flex: none; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.inline-form .field { flex: 1 1 200px; min-width: 0; }
.inline-form select.field { flex: 0 1 190px; }
.field.sm { min-height: 34px; padding: 5px 8px; font-size: 13px; width: auto; }
.people { display: grid; gap: 6px; margin-top: 10px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.02); }
.person.invited { border-style: dashed; }
.pp-main { flex: 1; min-width: 0; display: grid; }
.pp-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-main span { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone::before, .danger-zone::after { border-color: var(--bad); }
.danger-zone .pc-head svg { color: var(--bad); }

/* teams */
.sec-title { margin: 6px 2px 10px; font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 18px; }
.team-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; text-align: left; color: var(--text); cursor: pointer; }
.team-card h4 { margin: 0; font-family: var(--f-hud); font-weight: 700; font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase; }
.team-card p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.5; }
.team-card:hover { border-color: rgba(255, 153, 0, 0.55); }
.team-card.new { border-style: dashed; }
.team-card.new > svg { width: 26px; height: 26px; color: var(--acc); }
.team-card.invite { cursor: default; border-color: rgba(46, 230, 255, 0.5); }
.team-card.invite::before, .team-card.invite::after { border-color: var(--cyan); }
.tc-kick { display: flex; align-items: center; gap: 6px; width: 100%; font-family: var(--f-hud); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ok); }
.tc-kick svg { width: 13px; height: 13px; }
.tc-foot { margin-top: auto; font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.st-dot { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 10.5px; letter-spacing: 0.1em; }
.st-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.st-dot.ok { color: var(--ok); }
.st-dot.warn { color: var(--warn); }
.st-dot.bad { color: var(--bad); }
.scr-title .st-dot { margin-left: 4px; }
.plan-pick { display: grid; gap: 8px; }
.dlg-form .pp-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.dlg-form .pp-opt input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--acc); flex: none; }
.pp-opt span { display: grid; gap: 2px; }
.pp-opt b { font-family: var(--f-hud); font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.pp-opt i { font-style: normal; font-family: var(--f-body); font-weight: 500; font-size: 12.5px; color: var(--dim); }
.dlg-form .pp-opt:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.price-sum { display: grid; gap: 2px; padding: 12px 14px; }
.price-sum span { font-size: 12.5px; color: var(--dim); }
.price-sum b { font-family: var(--f-mono); font-weight: 400; font-size: 26px; color: var(--acc-2); }
.plan-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0 10px; }
.plan-line > b:first-child { font-family: var(--f-hud); font-size: 24px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc-2); }
.plan-line span { color: var(--dim); font-size: 13.5px; }
.pl-total { margin-left: auto; font-family: var(--f-mono); font-weight: 400; font-size: 20px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.role-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; text-align: left; color: var(--text); cursor: pointer; }
.role-card p { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.45; }
.role-card:hover { border-color: rgba(255, 153, 0, 0.55); }
.rc-top { display: flex; align-items: center; gap: 8px; }
.rc-top b { flex: 1; font-family: var(--f-hud); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; }
.rc-foot { margin-top: auto; font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.perm-list { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.perm-group { display: grid; gap: 2px; padding-bottom: 6px; }
.dlg-form .check.perm { align-items: flex-start; font-size: 13.5px; }
.dlg-form .check.perm input { margin-top: 1px; flex: none; }
.dlg-form .check.perm.locked { opacity: 0.55; }
#rdSeat { display: flex; align-items: center; gap: 6px; margin: 0; }
#rdSeat svg { width: 15px; height: 15px; color: var(--acc); }

/* billing */
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-card { display: grid; gap: 4px; padding: 12px 14px; }
.plan-card b { font-family: var(--f-hud); font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase; }
.plan-card .pc-price { font-family: var(--f-mono); font-size: 22px; color: var(--acc-2); }
.plan-card .pc-price small { font-size: 12px; color: var(--faint); }
.plan-card ul { margin: 4px 0 0; padding-left: 16px; color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.plan-card.current { border-color: var(--acc); box-shadow: 0 0 0 1px rgba(255, 153, 0, 0.35), 0 0 22px rgba(255, 153, 0, 0.12); }
.share-banner.locked .sb-kick svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }

@media (max-width: 960px) {
  .pg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pg-title h2 { font-size: 17px; }
  .pg-head .scr-acts .hbtn span { display: none; }
  .tile b { font-size: 19px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .file-card { flex-wrap: wrap; }
  .fc-acts { width: 100%; justify-content: flex-end; }
  .person { flex-wrap: wrap; }
  .team-grid, .role-grid { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: 1fr; }
  .dlg-form .row2 { grid-template-columns: 1fr; }
  .scr-side .tree-item.team-link { margin-top: 0; }
}
.modal-kicker svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.scr-title:has(.pg-kick)::before { display: none; }
.scr-title:has(.pg-kick) { white-space: normal; min-width: 0; flex: 1; }
.scr-head .scr-acts { margin-left: auto; }

/* inline rename button beside a screen title (company name) */
.title-edit { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: 8px; vertical-align: 2px; border: 1px solid var(--line-2); border-radius: 4px; background: transparent; color: var(--dim); cursor: pointer; }
.title-edit svg { width: 15px; height: 15px; }
.title-edit:hover { color: var(--acc); border-color: rgba(255, 153, 0, 0.5); }

/* ---------- admin: system documentation ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.docs-toc { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px; max-height: calc(100vh - 140px); overflow-y: auto; }
.docs-toc b { font-family: var(--f-hud); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--acc); margin-bottom: 6px; }
#docToc { display: flex; flex-direction: column; gap: 2px; }
.docs-toc button { text-align: left; border: 0; background: none; color: var(--dim); font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 3px; cursor: pointer; }
.docs-toc button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.docs-body { min-width: 0; }
.doc-sec { margin: 0 0 28px; scroll-margin-top: 10px; }
.doc-sec h2 { margin: 0 0 10px; font-family: var(--f-hud); font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.doc-sec h2::before { content: "◆"; color: var(--acc); font-size: 11px; margin-right: 9px; vertical-align: 3px; }
.doc-sec h3 { margin: 18px 0 8px; font-size: 15px; color: var(--text); }
.doc-sec p, .doc-sec li { color: var(--dim); font-size: 14px; line-height: 1.6; }
.doc-sec p b, .doc-sec li b, .doc-sec td b { color: var(--text); }
.doc-sec ul, .doc-sec ol { padding-left: 20px; margin: 8px 0; }
.doc-sec li { margin: 4px 0; }
.doc-sec code { font-family: var(--f-mono); font-size: 12.5px; color: #ffcf8a; background: rgba(255, 153, 0, 0.08); padding: 1px 5px; border-radius: 3px; word-break: break-word; }
.doc-note { padding: 10px 12px; border-left: 3px solid var(--cyan); background: rgba(46, 230, 255, 0.05); border-radius: 0 3px 3px 0; }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 13.5px; }
.doc-table th { text-align: left; font-family: var(--f-hud); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.doc-table td { vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--dim); line-height: 1.5; }
.doc-table td:first-child { color: var(--text); min-width: 130px; }
.doc-table code { word-break: break-all; }
.doc-map { display: grid; grid-template-columns: 1fr auto 1.2fr auto 1fr; gap: 10px; align-items: center; margin: 14px 0; }
.dm-col { display: flex; flex-direction: column; gap: 8px; }
.dm-box { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 4px; background: rgba(9, 13, 21, 0.6); }
.dm-box.acc { border-color: rgba(255, 153, 0, 0.6); background: rgba(255, 153, 0, 0.07); }
.dm-box b { display: block; font-family: var(--f-hud); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); font-size: 14px; }
.dm-box span { display: block; font-size: 12.5px; color: var(--dim); line-height: 1.45; margin-top: 3px; }
.dm-arrow { font-family: var(--f-mono); font-size: 11px; color: var(--cyan); text-align: center; white-space: nowrap; }
.dm-arrow::after { content: "→"; display: block; font-size: 20px; line-height: 1; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.dl-card { padding: 12px 14px; }
.dl-card h4 { margin: 0 0 8px; font-family: var(--f-hud); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); }
.dl-card dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 13px; }
.dl-card dt { color: var(--faint); }
.dl-card dd { margin: 0; color: var(--text); font-family: var(--f-mono); font-size: 12.5px; word-break: break-word; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; }
  .docs-toc { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .docs-toc b { width: 100%; }
  #docToc { flex-direction: row; flex-wrap: wrap; }
  .doc-map { grid-template-columns: 1fr; }
  .dm-arrow::after { content: "↓"; }
  .doc-table { display: block; overflow-x: auto; }
}

/* shown only when JavaScript is off (the map needs it) */
.noscript { position: fixed; inset: auto 16px 16px; z-index: 100; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 6px; background: rgba(9, 13, 21, 0.95); color: var(--text); font-size: 14px; }
.noscript a { color: var(--acc); }
