/* Layout concept: a map-first civic utility. The map runs edge to edge; panels float above it.
   Signage blue for navigation, barricade amber for works, closure red for blocked roads.
   One recurring motif: the black-and-amber barricade chevron. */
:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #edf1f6;
  --ink: #0f1b2b;
  --ink-2: #33415a;
  --muted: #5e6b7e;
  --faint: #8995a7;
  --line: #e2e7ee;
  --line-strong: #cbd3de;
  --accent: #1747a6;
  --accent-hover: #123b8c;
  --accent-ink: #ffffff;
  --accent-soft: #e7eefb;
  --works: #c96f00;
  --works-soft: #fdf1df;
  --closure: #d22f27;
  --closure-soft: #fde7e5;
  --planned: #2f6ad6;
  --planned-soft: #e5edfb;
  --done: #17804a;
  --done-soft: #e1f3e8;
  --hold: #6b778a;
  --hold-soft: #edf0f4;
  --report: #7b4cc9;
  --report-soft: #efe8fa;
  --c-metro: #0f8f8f; --c-rail: #5b6573; --c-expressway: #6d3fd1; --c-newroad: #e0661b; --c-repair: #b98800;
  --c-bridge: #1f78c8; --c-tunnel: #8a5a2b; --c-utility: #2f9e5b; --c-other: #6b778a;
  --stripe-a: #f2b01e;
  --stripe-b: #0f1b2b;
  --map-sea: #cad9e3;
  --map-land: #f4f6f7;
  --map-other: #e8ecef;
  --map-urban: #e2e5ea;
  --map-road: #f6c86b;
  --map-border: #a9b4c0;
  --shadow-sm: 0 1px 2px rgba(15, 27, 43, .06);
  --shadow: 0 1px 2px rgba(15, 27, 43, .06), 0 8px 24px rgba(15, 27, 43, .08);
  --shadow-lg: 0 2px 4px rgba(15, 27, 43, .06), 0 18px 48px rgba(15, 27, 43, .16);
  --f-display: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --top-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1018; --surface: #111a25; --surface-2: #16212e; --surface-3: #1c2836; --ink: #e8eef6; --ink-2: #c3cedc;
    --muted: #97a5b8; --faint: #6f7e92; --line: #1f2c3b; --line-strong: #2d3d50;
    --accent: #79a5ff; --accent-hover: #9bbcff; --accent-ink: #0a1018; --accent-soft: #17284a;
    --works: #f3a93a; --works-soft: #36260d; --closure: #ff6b61; --closure-soft: #3d1715; --planned: #7ba6ff; --planned-soft: #172846;
    --done: #4fcf88; --done-soft: #10301f; --hold: #93a1b4; --hold-soft: #1d2733; --report: #b38cff; --report-soft: #261d3b; --c-metro: #2cc6c6; --c-rail: #9aa5b4; --c-expressway: #a585ff; --c-newroad: #ff8a3d; --c-repair: #f0c03a; --c-bridge: #5aa9f5; --c-tunnel: #c99460; --c-utility: #4fcf88; --c-other: #93a1b4;
    --stripe-b: #070b10; --map-sea: #0c1a26; --map-land: #19222c; --map-other: #131b23; --map-urban: #232e3a; --map-road: #8a6a2c; --map-border: #3c4b5c;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 18px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1018; --surface: #111a25; --surface-2: #16212e; --surface-3: #1c2836; --ink: #e8eef6; --ink-2: #c3cedc;
  --muted: #97a5b8; --faint: #6f7e92; --line: #1f2c3b; --line-strong: #2d3d50;
  --accent: #79a5ff; --accent-hover: #9bbcff; --accent-ink: #0a1018; --accent-soft: #17284a;
  --works: #f3a93a; --works-soft: #36260d; --closure: #ff6b61; --closure-soft: #3d1715; --planned: #7ba6ff; --planned-soft: #172846;
  --done: #4fcf88; --done-soft: #10301f; --hold: #93a1b4; --hold-soft: #1d2733; --report: #b38cff; --report-soft: #261d3b; --c-metro: #2cc6c6; --c-rail: #9aa5b4; --c-expressway: #a585ff; --c-newroad: #ff8a3d; --c-repair: #f0c03a; --c-bridge: #5aa9f5; --c-tunnel: #c99460; --c-utility: #4fcf88; --c-other: #93a1b4;
  --stripe-b: #070b10; --map-sea: #0c1a26; --map-land: #19222c; --map-other: #131b23; --map-urban: #232e3a; --map-road: #8a6a2c; --map-border: #3c4b5c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 18px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ================================================================ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: 0; color: var(--ink); }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.num, .mono { font-family: var(--f-data); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.eyebrow { font: 600 11px/1.2 var(--f-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; }

/* ================================================================ brand */
.stripe { height: 3px; background: repeating-linear-gradient(135deg, var(--stripe-a) 0 8px, var(--stripe-b) 8px 16px); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; flex: none; display: block; filter: drop-shadow(0 1px 1.5px rgba(15, 27, 43, .18)); }
.logo-name { font: 700 20px/1 var(--f-display); letter-spacing: .005em; }
.logo-name span { color: var(--accent); }

/* ================================================================ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(23,71,166,.3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--closure); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); display: inline-grid;
  place-items: center; cursor: pointer; position: relative; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.badge { position: absolute; top: -5px; right: -5px; background: var(--closure); color: #fff; font: 700 10.5px/17px var(--f-body); min-width: 17px; height: 17px;
  border-radius: 9px; text-align: center; padding: 0 4px; box-shadow: 0 0 0 2px var(--surface); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); }
.input { width: 100%; height: 40px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 0 12px; min-width: 0;
  transition: border-color .12s, box-shadow .12s; }
select.input { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:hover { border-color: var(--faint); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { height: 34px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { appearance: none; margin: 0; width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.form-error { color: var(--closure); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ================================================================ pills & chips */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; letter-spacing: .01em; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.t-ongoing { background: var(--works-soft); color: var(--works); }
.t-closure { background: var(--closure-soft); color: var(--closure); }
.t-planned { background: var(--planned-soft); color: var(--planned); }
.t-completed { background: var(--done-soft); color: var(--done); }
.t-on_hold, .t-neutral { background: var(--hold-soft); color: var(--hold); }
.t-report { background: color-mix(in srgb, var(--report) 14%, transparent); color: var(--report); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px;
  font-size: 12.5px; background: var(--surface); color: var(--ink-2); }
.tag-sample { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font: 600 10.5px/1 var(--f-body); letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line-strong); }

/* ================================================================ shell */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.topbar { background: var(--surface); position: relative; z-index: 20; }
.topbar-in { height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.search { position: relative; width: min(380px, 34vw); }
.search .input { height: 38px; padding-left: 36px; background: var(--surface-2); border-color: var(--line); }
.search .input:focus { background: var(--surface); }
.search > svg { position: absolute; left: 11px; top: 10px; color: var(--faint); pointer-events: none; }
.search kbd { position: absolute; right: 9px; top: 9px; font: 600 11px/18px var(--f-data); padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--faint); }
.suggest { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 40; max-height: 380px; overflow-y: auto; }
.suggest .grp { padding: 8px 10px 4px; }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.suggest button:hover, .suggest button.hl { background: var(--surface-2); }
.loc-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 19px;
  padding: 0 14px 0 10px; cursor: pointer; max-width: 260px; min-width: 0; color: var(--ink); }
.loc-btn:hover { background: var(--surface-2); }
.loc-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }
.loc-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.scan { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
.scan .live { width: 8px; height: 8px; border-radius: 50%; background: var(--done); box-shadow: 0 0 0 3px var(--done-soft); }
.scan .live.warn { background: var(--works); box-shadow: 0 0 0 3px var(--works-soft); }
.scan b { color: var(--ink-2); font-weight: 500; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font: 700 14px/36px var(--f-body); color: #fff; flex: none;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); }
.menu { position: absolute; right: 16px; top: calc(var(--top-h) + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); width: 250px; padding: 6px; z-index: 60; }
.menu .who { padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu button, .menu a { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 7px;
  cursor: pointer; color: var(--ink); font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .mobile-only { display: none; }

.body { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 0; }
.nav { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav .grp { padding: 14px 10px 6px; }
.nav .grp:first-child { padding-top: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 0 10px; height: 36px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav a .count { margin-left: auto; font: 600 11px var(--f-data); color: var(--muted); }
.nav-foot { margin-top: auto; padding: 14px 10px 4px; font-size: 11.5px; color: var(--faint); display: grid; gap: 4px; }
.nav .nav-foot a { color: var(--faint); display: inline-flex; height: auto; padding: 0; gap: 6px; font-size: 11.5px; font-weight: 500; border-radius: 0; }
.nav .nav-foot a:hover { background: none; color: var(--ink-2); text-decoration: underline; }
.main { min-width: 0; min-height: 0; overflow-y: auto; position: relative; }
.tabbar { display: none; }

.page { padding-block: 28px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  max-width: 1200px; margin: 0 auto; display: grid; gap: 20px; }
@media (min-width: 900px) { .page { padding-left: 32px; padding-right: 32px; } }
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 64ch; font-size: 14.5px; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ================================================================ panels, cards, lists */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.panel-b { padding: 0 18px 18px; }
.pad { padding: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.empty svg { width: 28px; height: 28px; color: var(--faint); }
.notice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); padding: 11px 14px;
  font-size: 12.5px; color: var(--muted); }
.notice.sample { border-style: dashed; }
.divider { height: 1px; background: var(--line); }

.item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
  background: transparent; text-align: left; width: 100%; border-left: 0; border-right: 0; border-top: 0; color: inherit; position: relative; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); text-decoration: none; }
.item.sel { background: var(--accent-soft); }
.item.sel::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.glyph { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.glyph svg { width: 19px; height: 19px; }
.item-b { display: grid; gap: 4px; min-width: 0; }
.item-t { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.item-title { font-weight: 650; font-size: 14px; line-height: 1.32; color: var(--ink); }
.meta { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.meta .sep::before { content: "·"; margin-right: 12px; margin-left: -6px; color: var(--faint); }

/* skeleton */
.skel { border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-item { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skel-item .skel:first-child { height: 38px; border-radius: 10px; }

/* ================================================================ map-first views */
.mapview { position: absolute; inset: 0; }
.mapview .map { position: absolute; inset: 0; }
.float { position: absolute; z-index: 5; top: 16px; left: 16px; bottom: 16px; width: 392px; display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; }
.float-h { padding: 18px 18px 14px; display: grid; gap: 14px; border-bottom: 1px solid var(--line); }
.float-h h2 { font-size: 23px; }
.float-scroll { overflow-y: auto; min-height: 0; flex: 1; }
.float-foot { padding: 10px 16px; border-top: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tab { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 10px; text-align: left; cursor: pointer; display: grid; gap: 1px; }
.tab:hover { border-color: var(--line-strong); }
.tab b { font: 600 22px/1.05 var(--f-display); display: flex; align-items: center; gap: 6px; }
.tab b i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tab span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tab.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

.map-ctl { position: absolute; z-index: 4; right: 16px; top: 16px; display: grid; gap: 8px; }
.map-ctl .grp { display: grid; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.map-ctl button { width: 38px; height: 38px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.map-ctl button + button { border-top: 1px solid var(--line); }
.map-ctl button:hover { background: var(--surface-2); color: var(--ink); }
.map-ctl button.on { color: var(--accent); }
.legend { position: absolute; z-index: 4; right: 16px; bottom: 30px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.legend span { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow); font-size: 12px; font-weight: 600; color: var(--ink-2); backdrop-filter: blur(6px); }
.legend i { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--closure) 0 4px, transparent 4px 7px) !important; }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.attrib { position: absolute; z-index: 3; right: 0; bottom: 0; font-size: 10.5px; padding: 2px 8px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent); border-top-left-radius: 6px; }
.attrib a { color: var(--muted); }
.map-note { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); bottom: 30px; font-size: 12px; padding: 6px 12px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--muted); white-space: nowrap; }
.mapbox { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--map-land); min-height: 200px; }
.mapbox .map { position: absolute; inset: 0; }
.mapbox .map-ctl { top: 12px; right: 12px; }
.mapbox .legend { right: 12px; bottom: 26px; }

/* map markers & popups */
.you { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); position: relative; }
.you::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; background: var(--accent); opacity: .18; animation: pulse 2.4s infinite ease-out; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .35; } 100% { transform: scale(1.4); opacity: 0; } }
.pin { width: 28px; height: 28px; transform: translateY(-12px); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); cursor: grab; }
.end-a, .end-b { width: 18px; height: 18px; border-radius: 50%; border: 4px solid var(--accent); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.end-b { border-color: var(--ink); }
.hit-no { width: 24px; height: 24px; border-radius: 7px; transform: rotate(45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.hit-no span { transform: rotate(-45deg); color: #fff; font: 700 11px var(--f-data); }
.city-lbl { font: 600 11.5px/1 var(--f-body); color: var(--ink-2); white-space: nowrap; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 6px var(--surface);
  pointer-events: none; display: flex; align-items: center; gap: 5px; }
.city-lbl i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); }
.city-lbl.minor { display: none; font-weight: 500; color: var(--muted); }
.zoomed .city-lbl.minor { display: flex; }
.pop { display: grid; gap: 8px; min-width: 220px; max-width: 280px; }
.pop .item-title { font-size: 14.5px; }
.pop-act { display: flex; gap: 8px; margin-top: 2px; }

/* ================================================================ project detail */
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { padding: 16px 18px; display: grid; gap: 6px; border-right: 1px solid var(--line); min-width: 0; align-content: start; }
.stat:last-child { border-right: 0; }
.stat b { font: 600 25px/1.05 var(--f-display); }
.stat .sub { font-size: 12px; color: var(--muted); }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 4px; background: repeating-linear-gradient(135deg, var(--works) 0 6px, color-mix(in srgb, var(--works) 78%, #000) 6px 12px); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; } .timeline li:last-child::before { display: none; }
.timeline .dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface); margin-top: 3px; z-index: 1; }
.timeline li:not(:first-child) .dot { border-color: var(--line-strong); }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.source-line { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding-top: 4px; }

/* diversion cards */
.dv { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dv:last-child { border-bottom: 0; }
.sign { width: 48px; height: 48px; display: grid; place-items: center; font: 700 10.5px/1.02 var(--f-display); text-align: center; text-transform: uppercase; }
.sign.closure { border-radius: 50%; border: 5px solid var(--closure); color: var(--closure); background: var(--surface); }
.sign.other { width: 42px; height: 42px; margin: 3px; border-radius: 7px; transform: rotate(45deg); border: 4px solid var(--works); color: var(--ink); background: var(--works-soft); }
.sign.other span { transform: rotate(-45deg); }
.when { font: 500 12.5px/1.5 var(--f-data); color: var(--ink-2); }
.alt { display: flex; gap: 8px; border-radius: 8px; background: var(--done-soft); padding: 8px 11px; font-size: 13px; color: var(--ink); }
.alt b { color: var(--done); }
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cards-2 > .panel .dv { border-bottom: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font: 600 11px/1.2 var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
th:first-child { border-top-left-radius: var(--r-lg); } th:last-child { border-top-right-radius: var(--r-lg); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.bar > div { height: 100%; border-radius: 4px; background: var(--closure); }
.hbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 13px; padding: 5px 0; }
.hbar .track { height: 18px; background: var(--surface-2); border-radius: 5px; overflow: hidden; position: relative; }
.hbar .track div { height: 100%; border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--closure) 70%, var(--works)), var(--closure)); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 4px; }
.kpi b { font: 600 28px/1.05 var(--f-display); }

/* route */
.route-form { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.route-form .rail { display: grid; justify-items: center; grid-row: span 2; align-self: stretch; padding: 13px 0; }
.route-form .rail i { width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--accent); }
.route-form .rail i:last-child { border-color: var(--ink); }
.route-form .rail span { width: 2px; flex: 1; background: repeating-linear-gradient(var(--line-strong) 0 3px, transparent 3px 6px); min-height: 18px; }
.route-form .rail { display: flex; flex-direction: column; align-items: center; }
.strip { position: relative; height: 34px; margin: 4px 10px 0; }
.strip .line { position: absolute; left: 0; right: 0; top: 15px; height: 4px; background: var(--accent); border-radius: 2px; opacity: .5; }
.strip .e { position: absolute; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); transform: translateX(-50%); }
.strip .e.b { border-color: var(--ink); }
.strip .hit-no { position: absolute; top: 5px; width: 22px; height: 22px; margin-left: -11px; }

/* ================================================================ auth */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { position: relative; overflow: hidden; background: #0b1420; color: #e6edf5; min-height: 100%; }
.auth-art .map { position: absolute; inset: 0; }
.auth-art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,13,20,.86) 0%, rgba(8,13,20,.35) 45%, rgba(8,13,20,.88) 100%); }
.auth-copy { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; gap: 22px; padding: 40px 44px; pointer-events: none; }
.auth-copy > * { pointer-events: auto; }
.auth-copy .logo { color: #fff; }
.auth-copy .logo-name span { color: #8fb3ff; }
.auth-copy h1 { color: #fff; font-size: 50px; line-height: 1; max-width: 13ch; font-weight: 600; margin-top: 18px; }
.auth-copy p.lead { color: #b9c5d3; max-width: 44ch; font-size: 16px; line-height: 1.55; }
.auth-stripe { position: absolute; left: 0; right: 0; top: 0; height: 8px; z-index: 3; background: repeating-linear-gradient(135deg, #f2b01e 0 12px, #070b10 12px 24px); }
.board { margin-top: auto; display: grid; gap: 8px; max-width: 470px; }
.board-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 10px;
  background: rgba(14, 22, 33, .72); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(8px); font-size: 13.5px; color: #e6edf5; }
.board-row i { width: 10px; height: 10px; border-radius: 50%; }
.board-row .mono { color: #9fb0c3; font-size: 12px; }
.auth-side { display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.auth-form h2 { font-size: 30px; }
.auth-form .sub { color: var(--muted); margin-top: 6px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.mailcard { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.mailcard .p { padding: 14px 16px; display: grid; gap: 8px; font-size: 13px; }
.pw { position: relative; } .pw button { position: absolute; right: 6px; top: 6px; height: 28px; font-size: 12px; }

/* ================================================================ modal, toast, menus */
.modal-back { position: fixed; inset: 0; background: rgba(6, 11, 18, .5); z-index: 100; display: grid; place-items: center; backdrop-filter: blur(2px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); animation: fade .15s ease-out; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  display: grid; gap: 16px; padding: 22px; animation: rise .18s ease-out; }
.modal-wide { max-width: 860px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px); display: flex; gap: 10px; align-items: center; animation: rise .18s ease-out; }
.pick { height: 300px; }

/* ================================================================ MapLibre essentials (works without the library stylesheet) */
.maplibregl-map { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; font: inherit; }
.maplibregl-canvas { position: absolute; left: 0; top: 0; }
.maplibregl-canvas:focus { outline: none; }
.maplibregl-canvas-container.maplibregl-interactive { cursor: grab; }
.maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate, .maplibregl-canvas-container.maplibregl-touch-drag-pan { touch-action: pan-x pan-y; }
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan { touch-action: none; }
.maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }
.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; } .maplibregl-ctrl-bottom-left { left: 0; bottom: 0; }
.maplibregl-ctrl-top-right { right: 0; top: 0; } .maplibregl-ctrl-top-left { left: 0; top: 0; }
.maplibregl-ctrl { clear: both; pointer-events: auto; }
.maplibregl-marker { position: absolute; top: 0; left: 0; will-change: transform; }
.maplibregl-user-location-dot { display: none; }
.maplibregl-popup { position: absolute; top: 0; left: 0; display: flex; will-change: transform; pointer-events: none; z-index: 6; }
.maplibregl-popup-anchor-top, .maplibregl-popup-anchor-top-left, .maplibregl-popup-anchor-top-right { flex-direction: column; }
.maplibregl-popup-anchor-bottom, .maplibregl-popup-anchor-bottom-left, .maplibregl-popup-anchor-bottom-right { flex-direction: column-reverse; }
.maplibregl-popup-anchor-left { flex-direction: row; } .maplibregl-popup-anchor-right { flex-direction: row-reverse; }
.maplibregl-popup-tip { width: 0; height: 0; border: 9px solid transparent; z-index: 1; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { align-self: center; border-top: none; border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip { align-self: flex-start; border-top: none; border-left: none; border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { align-self: flex-end; border-top: none; border-right: none; border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { align-self: center; border-bottom: none; border-top-color: var(--surface); }
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip { align-self: flex-start; border-bottom: none; border-left: none; border-top-color: var(--surface); }
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { align-self: flex-end; border-bottom: none; border-right: none; border-top-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { align-self: center; border-left: none; border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { align-self: center; border-right: none; border-left-color: var(--surface); }
.maplibregl-popup-content { position: relative; background: var(--surface); color: var(--ink); border-radius: 12px; padding: 14px 16px; pointer-events: auto;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.maplibregl-popup-close-button { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent;
  cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.maplibregl-popup-close-button:hover { background: var(--surface-2); color: var(--ink); }
.maplibregl-ctrl-attrib { display: none; }

/* ================================================================ responsive */
@media (max-width: 1100px) {
  .scan .long { display: none; }
  .search { width: 240px; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); z-index: 20; }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--accent); }
  .app { grid-template-rows: auto minmax(0, 1fr) auto; }
  .menu .mobile-only { display: flex; }
  .topbar .search { display: none; }
  .scan { display: none; }
  .float { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 52%; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .sheet-handle { display: block; }
  .float { transition: height .2s ease; }
  .float.sheet-full { height: calc(100% - 56px); }
  .float.sheet-min { height: 150px; }
  .float.sheet-min .float-scroll, .float.sheet-min .float-foot { display: none; }
  .float-h { padding-top: 10px; }
  .map-ctl { top: 12px; right: 12px; }
  .legend { display: none; }
  .mapview.has-float .attrib { bottom: 52%; }
  .hero-stats, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats .stat:nth-child(2) { border-right: 0; } .hero-stats .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid-2, .cards-2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 300px; } .auth-copy { padding: 28px 20px; } .auth-copy h1 { font-size: 34px; } .board { display: none; }
}
@media (max-width: 560px) {
  .logo-name { display: none; }
  .loc-btn { max-width: 170px; }
  h1 { font-size: 25px; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbar { grid-template-columns: 70px minmax(0, 1fr) 80px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ================================================================ revamp: schedule, feed, plans */
.whenline { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; flex-wrap: nowrap; line-height: 1.4; }
.whenline > svg { margin-top: 1px; flex: none; }
.whenline > span { min-width: 0; }
.whenline b { font-weight: 650; }
.whenline .late { color: var(--closure); font-weight: 650; }
.mini { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 2px; }
.mini .tiny { font-family: var(--f-data); color: var(--muted); }
.dual { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: visible; }
.dual .work { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--works); }
.dual .clock { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }
.dual.ok .work { background: var(--done); } .dual.risk .work { background: var(--works); } .dual.late .work, .dual.overdue .work { background: var(--closure); }
.h-ok { background: var(--done-soft); color: var(--done); } .h-risk { background: var(--works-soft); color: var(--works); }
.h-late, .h-overdue { background: var(--closure-soft); color: var(--closure); } .h-upcoming { background: var(--planned-soft); color: var(--planned); }
.h-hold { background: var(--hold-soft); color: var(--hold); } .h-done { background: var(--done-soft); color: var(--done); }

.scanline { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.scanline .live { width: 7px; height: 7px; border-radius: 50%; background: var(--done); box-shadow: 0 0 0 3px var(--done-soft); }
.day-h { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day-h b { color: var(--ink); }
.feed-kind { font: 700 10.5px/1 var(--f-body); letter-spacing: .07em; text-transform: uppercase; }
.k-update { color: var(--accent); } .k-new_project { color: var(--done); } .k-diversion { color: var(--closure); }

.scan-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; }
.scan-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--done-soft); color: var(--done); }
.scan-ring svg { width: 26px; height: 26px; }
.src-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.src-dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--done); }
.src-dots i.off { background: var(--line-strong); } .src-dots i.err { background: var(--closure); } .src-dots i.same { background: color-mix(in srgb, var(--done) 45%, var(--surface)); }

.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 6px; }
.kpi .ico svg { width: 17px; height: 17px; }
.kpi.click { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.kpi.click:hover { border-color: var(--line-strong); }
.kpi.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.work-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 230px; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: inherit; align-items: start; }
.work-card:last-child { border-bottom: 0; }
.work-card:hover { background: var(--surface-2); text-decoration: none; }
.work-card .glyph { width: 44px; height: 44px; border-radius: 12px; }
.sched-col { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.sched-col .r { display: grid; grid-template-columns: 74px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.sched-col .r .bar { height: 6px; }
.sched-col .r .bar > div.t { background: var(--ink-2); }
.sched-col .r .bar > div.w { background: var(--works); }
.sched-col .r span:last-child { text-align: right; font-family: var(--f-data); color: var(--ink-2); }

.sched { display: grid; gap: 16px; }
.sched .big { font: 500 19px/1.35 var(--f-body); color: var(--ink); max-width: 46ch; }
.sched .big b { font-weight: 700; }
.tl { position: relative; height: 54px; margin: 6px 6px 0; }
.tl .track { position: absolute; left: 0; right: 0; top: 14px; height: 10px; border-radius: 5px; background: var(--surface-3); }
.tl .used { position: absolute; top: 14px; left: 0; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 35%, var(--surface-3)); }
.tl .slip { position: absolute; top: 14px; height: 10px; border-radius: 0 5px 5px 0;
  background: repeating-linear-gradient(135deg, var(--closure) 0 4px, color-mix(in srgb, var(--closure) 45%, var(--surface)) 4px 8px); }
.tl .mark { position: absolute; top: 6px; width: 2px; height: 26px; background: var(--ink); transform: translateX(-1px); }
.tl .mark.plan { background: var(--faint); height: 20px; top: 9px; }
.tl .lab { position: absolute; top: 36px; font-size: 11.5px; color: var(--muted); white-space: nowrap; transform: translateX(-50%); }
.tl .lab b { color: var(--ink); font-weight: 650; }
.tl .lab.l { transform: none; } .tl .lab.r { transform: translateX(-100%); }
.tl .now { position: absolute; top: -12px; transform: translateX(-50%); font: 700 10px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  background: var(--surface); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-strong); }
.cmp { display: grid; gap: 10px; }
.cmp .r { display: grid; grid-template-columns: 90px minmax(0, 1fr) 46px; gap: 12px; align-items: center; font-size: 13px; }
.cmp .bar { height: 10px; border-radius: 5px; }
.cmp .bar > div.t { background: var(--ink-2); } .cmp .bar > div.w { background: var(--works); }
.cmp .r span:last-child { text-align: right; font-family: var(--f-data); }
.explain { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; border-left: 3px solid var(--line-strong); }
.explain.risk { border-left-color: var(--works); } .explain.late, .explain.overdue { border-left-color: var(--closure); } .explain.ok { border-left-color: var(--done); }

.gantt { min-width: 780px; }
.g-axis, .g-row { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.g-axis { position: sticky; top: 0; background: var(--surface); z-index: 1; border-bottom: 1px solid var(--line); }
.g-axis .yrs { position: relative; height: 34px; }
.g-axis .yrs span { position: absolute; top: 10px; transform: translateX(-50%); font: 600 11.5px var(--f-data); color: var(--muted); }
.g-grp { padding: 14px 18px 6px; display: flex; gap: 8px; align-items: center; }
.g-row { color: inherit; border-bottom: 1px solid var(--line); min-height: 52px; align-items: center; }
.g-row:hover { background: var(--surface-2); text-decoration: none; }
.g-lbl { padding: 8px 14px 8px 18px; display: grid; gap: 2px; min-width: 0; }
.g-lbl b { font-size: 13px; font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; height: 52px; }
.g-track .yl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-track .today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .75; }
.g-bar { position: absolute; top: 17px; height: 18px; border-radius: 5px; overflow: hidden; min-width: 6px; }
.g-bar.planned { background: color-mix(in srgb, var(--planned) 22%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--planned); }
.g-bar.ongoing { background: color-mix(in srgb, var(--works) 22%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--works); }
.g-bar.on_hold { background: repeating-linear-gradient(135deg, var(--hold-soft) 0 5px, var(--surface) 5px 10px); box-shadow: inset 0 0 0 1.5px var(--hold); }
.g-bar.completed { background: color-mix(in srgb, var(--done) 25%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--done); }
.g-bar .done { position: absolute; left: 0; top: 0; bottom: 0; background: var(--works); }
.g-slip { position: absolute; top: 22px; height: 8px; border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(135deg, var(--closure) 0 3px, transparent 3px 6px); }
.g-end { position: absolute; top: 18px; font: 600 11px/16px var(--f-data); color: var(--muted); white-space: nowrap; padding-left: 6px; }
.g-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 12px 18px; border-top: 1px solid var(--line); }
.g-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

.rpin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--report); border: 3px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.35); cursor: grab; }
.num-pin { width: 24px; height: 24px; border-radius: 7px; transform: rotate(45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.num-pin span { transform: rotate(-45deg); color: #fff; font: 700 11px var(--f-data); }
.draw-pt { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--works); }

@media (max-width: 900px) {
  .work-card { grid-template-columns: 44px minmax(0, 1fr); }
  .work-card .sched-col { grid-column: 2; }
  .scan-card { grid-template-columns: auto minmax(0, 1fr); }
  .scan-card > :last-child { grid-column: 1 / -1; }
}

.glyph.sm { width: 30px; height: 30px; border-radius: 8px; } .glyph.sm svg { width: 16px; height: 16px; }
.glyph.xs { width: 26px; height: 26px; border-radius: 7px; } .glyph.xs svg { width: 15px; height: 15px; }
.glyph.md { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.searchbox { position: relative; }

/* ================================================================ map UX: swatches, layers, tooltip, full screen */
.sw { display: inline-block; position: relative; width: 26px; height: 6px; border-radius: 3px; background: var(--c); flex: none; vertical-align: middle; }
.sw-cons::after { content: ""; position: absolute; left: 3px; right: 3px; top: 2.2px; height: 1.6px; background: repeating-linear-gradient(90deg, var(--surface) 0 4px, transparent 4px 7px); }
.sw-plan { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 10px); }
.legend { flex-direction: column; align-items: flex-end; gap: 6px; }
.legend .lg-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.legend .sw { width: 22px; }
.layers-pop { position: absolute; z-index: 8; top: 16px; right: 64px; width: 290px; max-width: calc(100% - 80px); max-height: calc(100% - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; display: grid; gap: 14px; animation: rise .15s ease-out; }
.mapbox .layers-pop { top: 12px; right: 58px; }
.lp-sec { display: grid; gap: 6px; }
.lp-sec .seg { justify-self: start; }
.lp-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; padding: 3px 0; }
.lp-row input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.map-tip { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; display: grid; gap: 1px; max-width: 260px; box-shadow: var(--shadow); }
.map-tip span { opacity: .75; font-size: 11.5px; }
.map-full { position: fixed !important; inset: 0 !important; z-index: 90; height: auto !important; border-radius: 0 !important; border: 0 !important; }
.map-full .map-ctl { top: calc(16px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); }
body.has-full-map .tabbar { display: none; }
.sheet-handle { display: none; width: 100%; height: 22px; border: 0; background: transparent; cursor: pointer; flex: none; position: relative; }
.sheet-handle::after { content: ""; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
.net-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.net-stats .chip { gap: 7px; }
.line-item { grid-template-columns: 34px minmax(0, 1fr); }
.ln-sw { display: grid; place-items: center; height: 22px; }
.ln-sw .sw { width: 30px; height: 7px; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.auth-side { position: relative; }
.auth-theme { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
#theme-btn { color: var(--ink-2); }
@media (max-width: 900px) { .layers-pop { right: 60px; top: 12px; } .auth-theme { top: 12px; } .sheet-handle { display: block; } }

.legend .lg-rows { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lg-toggle { align-self: flex-end; height: 26px; padding: 0 10px; border-radius: 13px; border: 0; cursor: pointer; font: 600 11.5px var(--f-body); color: var(--muted);
  background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 6px; }
.lg-toggle:hover { color: var(--ink); }
.legend .lg-show { display: none; align-items: center; gap: 6px; }
.legend.collapsed .lg-rows, .legend.collapsed .lg-hide { display: none; }
.legend.collapsed .lg-show { display: inline-flex; color: var(--ink-2); }
.auth-art .city-lbl { color: #8a9bb0; text-shadow: none; }
.auth-art .city-lbl i { background: #8a9bb0; }
