
.look-light {
  --bg:#f3f4f6; --surface:#ffffff; --surface-2:#f8f9fb; --sunken:#f1f3f6; --hover:#eef1f5;
  --side-bg:#fbfbfc; --line:#e3e6ea; --line-strong:#cdd2d9; --edge:#8b93a1;
  --text:#111827; --text-2:#465063; --text-3:#626b7a;
  --acc:#2458d6; --acc-ink:#ffffff; --acc-soft:#e9effd; --acc-text:#1f4fc4;
  --ok:#17703f; --ok-soft:#e4f4ea; --warn:#9a5500; --warn-soft:#fdf0db;
  --err:#c42f2a; --err-soft:#fcebea; --info:#0e6699; --info-soft:#e3f1f8;
  --focus:rgba(36,88,214,.35);
  --shadow-1:0 1px 2px rgba(16,24,40,.06); --shadow-2:0 18px 44px rgba(16,24,40,.18);
  --r-sm:6px; --r-md:8px; --r-lg:12px;
  color-scheme: light;
}
.look-dark {
  --bg:#0e1319; --surface:#151c24; --surface-2:#1a222c; --sunken:#10161d; --hover:#1f2934;
  --side-bg:#0b1015; --line:#27313d; --line-strong:#384453; --edge:#4c5a6a;
  --text:#e8edf3; --text-2:#b4bfcb; --text-3:#8d99a8;
  --acc:#2f6fe0; --acc-ink:#ffffff; --acc-soft:rgba(88,146,255,.16); --acc-text:#86b4ff;
  --ok:#4cc38a; --ok-soft:rgba(76,195,138,.14); --warn:#eaa646; --warn-soft:rgba(234,166,70,.15);
  --err:#f47a7d; --err-soft:rgba(244,122,125,.15); --info:#70b6ef; --info-soft:rgba(112,182,239,.14);
  --focus:rgba(88,146,255,.45);
  --shadow-1:0 1px 2px rgba(0,0,0,.45); --shadow-2:0 20px 50px rgba(0,0,0,.6);
  --r-sm:6px; --r-md:8px; --r-lg:12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acc-text); }
h1, h2, h3, p { margin: 0; }

.shell {
  --font-ui: "Onest", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  display: flex; height: 100vh; height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.45;
}
.i { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dim { color: var(--text-2); }
.faint { color: var(--text-3); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ======================================================= the side rail */
.side {
  width: 236px; flex: none; height: 100%; display: flex; flex-direction: column;
  background: var(--side-bg); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; min-height: 66px;
  color: var(--text); text-decoration: none; }
.brand .logo { width: 40px; height: 40px; flex: none; display: block; }
.tries { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tries .card + .card { margin-top: 0; }
.try { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.try .big { width: 150px; height: 150px; }
.try .small { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--r-md);
  background: #fbfbfc; color: #111827; border: 1px solid var(--line); font-size: 16px; }
.try .small.dk { background: #0b1015; color: #e8edf3; }
.try .sm { width: 34px; height: 34px; }
.brand .wm { display: flex; flex-direction: column; line-height: 1.1; }
.brand .wm b { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.brand .wm span { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px;
  border-radius: var(--r-md); color: var(--text-2); font-size: 14px; text-decoration: none;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--acc-soft); color: var(--acc-text); font-weight: 600; }
.nav a .n { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.side .foot { margin-top: auto; padding: 12px 14px 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.seg a { padding: 4px 10px; font-size: 12.5px; color: var(--text-2); text-decoration: none;
  border-right: 1px solid var(--line-strong); background: var(--surface); }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: var(--hover); }
.seg a.on { background: var(--acc); color: var(--acc-ink); }
.note { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.note a { color: var(--text-2); }

/* ======================================================= the page */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; flex-wrap: wrap;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.top .sub { font-size: 12.5px; color: var(--text-3); }
.kpis { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.kpi { min-width: 84px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); text-decoration: none; color: var(--text); }
a.kpi:hover { border-color: var(--line-strong); background: var(--hover); }
.kpi b { display: block; font-size: 19px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--text-3); }
.kpi.new b { color: var(--err); } .kpi.work b { color: var(--warn); } .kpi.done b { color: var(--ok); }
.scroll { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); overflow: hidden; }
.card + .card { margin-top: 16px; }
.card > h2 { font-size: 14px; font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; }
.card > h2 .faint { font-weight: 400; font-size: 12.5px; }
.card .pad { padding: 14px 16px; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--text-2); }
.tag.new { background: var(--err-soft); color: var(--err); }
.tag.work { background: var(--warn-soft); color: var(--warn); }
.tag.done { background: var(--ok-soft); color: var(--ok); }
.tag.src { background: var(--info-soft); color: var(--info); }
.tag.ex { background: var(--warn-soft); color: var(--warn); }
.tag .i { width: 13px; height: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px;
  padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 550;
  text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--acc); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn:focus-visible, .nav a:focus-visible, .chip:focus-visible, .pin:focus-visible, .input:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 1px; }
.input { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); }
.look-dark .input { background: var(--sunken); }
textarea.input { min-height: 84px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small { font-size: 12px; color: var(--text-3); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td:last-child, .tbl td:has(> .dot), .tbl td:has(> .tag) { white-space: nowrap; }
.cols.even .tbl th, .cols.even .tbl td { padding-left: 10px; padding-right: 10px; }
.tbl a.go { color: var(--text); text-decoration: none; font-weight: 550; }
.tbl a.go:hover { color: var(--acc-text); text-decoration: underline; }
.wide { overflow-x: auto; }
.bar { display: flex; height: 10px; min-width: 72px; border-radius: 5px; overflow: hidden; background: var(--sunken); }
.bar i { display: block; height: 100%; }
.bar .new { background: #c9433e; } .bar .work { background: #d08a1e; } .bar .done { background: #2b8a57; }
.key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-right: 12px; }
.key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key .new { background: #c9433e; } .key .work { background: #d08a1e; } .key .done { background: #2b8a57; }

/* ======================================================= the map */
.stage { flex: 1; min-height: 0; display: flex; }
.mapbox { flex: 1; min-width: 0; position: relative; overflow: hidden; background: var(--sunken); }
.grid { position: absolute; left: 50%; top: 50%; }
.grid .tile { position: absolute; width: 256px; height: 256px; display: block; user-select: none; }
.look-dark .grid .tile { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
.grid .route { position: absolute; left: 0; top: 0; pointer-events: none; }
.grid .route polyline { fill: none; stroke: #2458d6; stroke-width: 4; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .9; }
.grid .pick { position: absolute; left: 0; top: 0; cursor: crosshair; opacity: 0; }
.pin { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none;
  border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.pin .i { width: 16px; height: 16px; stroke-width: 2; }
.pin.new { background: #c42f2a; } .pin.work { background: #b86a00; } .pin.done { background: #17703f; }
.pin:hover { z-index: 6; transform: scale(1.12); }
.pin.sel { z-index: 7; transform: scale(1.25); box-shadow: 0 0 0 4px rgba(36,88,214,.55), 0 2px 8px rgba(0,0,0,.5); }
.pin.here { background: #2458d6; }
.bpin { position: absolute; height: 24px; min-width: 24px; margin: -12px 0 0 -12px; padding: 0 6px;
  border-radius: 6px; background: #1b2433; color: #fff; border: 2px solid #fff; font-size: 12px;
  font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.bpin .i { width: 13px; height: 13px; stroke-width: 2; }
.bpin.off { background: #c42f2a; }
.bpin.sel { box-shadow: 0 0 0 4px rgba(36,88,214,.55), 0 2px 8px rgba(0,0,0,.5); z-index: 7; }
.spin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: #fff; border: 3px solid #2458d6; color: #2458d6; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.spin.miss { border-color: #c42f2a; color: #c42f2a; }
.spin.wait { border-color: #7c8698; color: #5a6475; }
.cpin { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 5px;
  background: #fff; border: 2px solid #1b2433; color: #1b2433; display: flex; align-items: center;
  justify-content: center; text-decoration: none; }
.cpin .i { width: 12px; height: 12px; stroke-width: 2; }
.cpin.off { border-color: #c42f2a; color: #c42f2a; }
.pin.here { pointer-events: none; }
.item .where { display: block; }
.chips { position: absolute; left: 12px; top: 12px; right: 64px; display: flex; gap: 6px; flex-wrap: wrap;
  pointer-events: none; }
.chips > * { pointer-events: auto; }
.chips .sep { width: 1px; background: var(--line-strong); margin: 3px 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  font-size: 13px; text-decoration: none; box-shadow: var(--shadow-1); white-space: nowrap; }
.chip:hover { color: var(--text); background: var(--hover); }
.chip.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.chip .i { width: 14px; height: 14px; }
.ctl { position: absolute; right: 12px; top: 12px; display: grid; grid-template-columns: 34px; gap: 6px; }
.ctl a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  color: var(--text); text-decoration: none; font-size: 18px; line-height: 1; box-shadow: var(--shadow-1); }
.ctl a:hover { background: var(--hover); }
.ctl .gap { height: 4px; }
.legend { position: absolute; left: 12px; bottom: 12px; padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size: 12px; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; max-width: calc(100% - 200px); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.legend .new { background: #c42f2a; } .legend .work { background: #b86a00; } .legend .done { background: #17703f; }
.attr { position: absolute; right: 6px; bottom: 4px; font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: rgba(255,255,255,.85); color: #333; }
.attr a { color: #333; }
.hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 8px 14px;
  background: var(--acc); color: var(--acc-ink); border-radius: var(--r-md); font-weight: 600;
  box-shadow: var(--shadow-2); pointer-events: none; white-space: nowrap; }

/* ======================================================= the panel beside the map */
.panel { width: 384px; flex: none; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-left: 1px solid var(--line); }
.panel > h2 { font-size: 14px; font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; }
.panel .list { flex: 1; overflow: auto; }
.item { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; }
.item:hover { background: var(--hover); }
.item .thumb { width: 60px; height: 60px; flex: none; border-radius: var(--r-md); object-fit: cover;
  background: var(--sunken); display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.item b { display: block; font-weight: 600; }
.item .where { font-size: 12.5px; color: var(--text-2); }
.item .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 5px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; color: var(--text-2); }
.back:hover { color: var(--text); }
.shot { position: relative; background: var(--sunken); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shot .tag { position: absolute; left: 10px; top: 10px; background: rgba(17,24,39,.82); color: #fff; }
.credit { font-size: 11.5px; color: var(--text-3); padding: 5px 16px 0; }
.credit a { color: var(--text-3); }
.case { padding: 14px 16px 18px; overflow: auto; flex: 1; }
.case h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 8px 0 2px; }
.case .say { margin: 10px 0 14px; padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 12px 0; font-size: 13.5px; }
.facts dt { color: var(--text-3); } .facts dd { margin: 0; }
.tl { list-style: none; margin: 6px 0 14px; padding: 0; }
.tl li { position: relative; padding: 0 0 13px 24px; }
.tl li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--acc); }
.tl li::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: -3px; width: 1px; background: var(--line-strong); }
.tl li:last-child::after { display: none; }
.tl li.todo::before { background: var(--surface); border: 2px solid var(--edge); }
.tl li.todo { color: var(--text-3); }
.tl .when { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); margin-right: 6px; }
.act { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.act h4 { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
.two { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }

/* ======================================================= brigades and cameras */
.brig { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.brig:hover { background: var(--hover); }
.brig.on { background: var(--acc-soft); }
.brig .hd { display: flex; align-items: center; gap: 8px; }
.brig .hd b { font-size: 14.5px; font-weight: 650; }
.brig .ln { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.stops { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.stops li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.stops .p { flex: 1; min-width: 0; }
.ok-t { color: var(--ok); font-weight: 600; } .err-t { color: var(--err); font-weight: 600; }
.warn-t { color: var(--warn); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ok); }
.dot.off { background: var(--err); }

/* ======================================================= a phone */
@media (max-width: 860px) {
  .shell { flex-direction: column; height: auto; min-height: 100vh; min-height: 100dvh; }
  .side { width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: 0; border-bottom: 1px solid var(--line); }
  .side .foot form { display: none; }
  .brand { padding: 8px 10px; min-height: 0; }
  .brand .logo { width: 30px; height: 30px; }
  .brand .wm span { display: none; }
  .nav { flex-direction: row; padding: 6px 4px; }
  .nav a { height: 34px; white-space: nowrap; }
  .nav a .n, .nav a .lbl { display: none; }
  .nav { flex: 1; }
  .side .foot { margin: 0; width: 100%; padding: 0 10px 8px; border-top: 0; flex-direction: row; align-items: center; }
  .side .foot .note { display: none; }
  .top { padding: 10px 14px; }
  .kpis { margin-left: 0; width: 100%; }
  .kpi { flex: 1 1 28%; min-width: 0; padding: 5px 8px; }
  .stage { flex-direction: column; flex: none; }
  .mapbox { flex: none; height: 62vh; }
  .panel { width: auto; flex: none; border-left: 0; border-top: 1px solid var(--line); }
  .panel .list, .case { overflow: visible; }
  .scroll { overflow: visible; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .scroll { padding: 12px; }
  .legend { display: none; }
}
