/* SK Control layout system.
   Measured on linear.app, 2026-10-24, desktop product demo:
   page #08090a, chrome #090a0b, text #f7f8f8, nav #d0d6e0,
   nav row 28px / 13px / weight 510 / radius 8px / padding 0 7px,
   selected row rgba(255,255,255,.04).
   Weight 500 is the nearest CSS weight to the measured 510.
   Surfaces use the same white-alpha step as the selected row. */

:root {
  --ln-bg: #08090a;
  --ln-chrome: #090a0b;
  --ln-text: #f7f8f8;
  --ln-nav: #d0d6e0;
  --ln-muted: #8b919a;
  --ln-line: rgba(255, 255, 255, .06);
  --ln-hover: rgba(255, 255, 255, .04);
  --ln-row: 32px;
  --ln-radius: 8px;
}

body, body.ops, body.gate {
  background: var(--ln-bg);
  color: var(--ln-text);
  font-family: "Segoe UI", "SF Pro Display", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.sidebar {
  width: 220px;
  flex-basis: 220px;
  background: var(--ln-chrome);
  border-right: 1px solid var(--ln-line);
  padding: 8px;
}
.main { background: var(--ln-bg); }
.brand { padding: 6px 8px 12px; gap: 8px; }
.brand small { display: none; }
.brand b { font-size: 14px; font-weight: 600; }
.logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--ln-hover); color: var(--ln-text); font-size: 11px; font-weight: 600;
}
.side-nav { gap: 2px; margin-top: 6px; }
.side-nav a {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  gap: 10px;
  border-radius: var(--ln-radius);
  color: var(--ln-nav);
  font-size: 14px;
  font-weight: 500;
}
.side-nav a svg { width: 18px; height: 18px; }
.side-nav a:hover { background: var(--ln-hover); color: var(--ln-text); }
.side-nav a.on { background: var(--ln-hover); color: var(--ln-text); box-shadow: none; }
.user-btn { grid-template-columns: 28px 1fr; padding: 6px 8px; border-radius: var(--ln-radius); }
.avatar, .user-btn .avatar { width: 28px; height: 28px; border-radius: 6px; font-size: 12px; }
.user-btn b { font-size: 14px; font-weight: 500; }
.user-btn small, .leave { font-size: 12px; color: var(--ln-muted); }
.role-switch {
  min-height: var(--ln-row);
  margin: 4px 0;
  border-radius: var(--ln-radius);
  border: 1px solid var(--ln-line);
  background: transparent;
  color: var(--ln-nav);
  font-size: 12px;
  font-weight: 500;
}
.leave { padding: 4px 7px; border-radius: var(--ln-radius); text-decoration: none; }

.ln-mobile-bar { display: none; }

body.ops .ops-top,
body.ops .mon-headbar,
body.admin-page .admin-head,
body.admin-page .page-head {
  height: auto;
  min-height: 44px;
  padding: 8px 16px;
  align-items: center;
  gap: 8px 16px;
  border-bottom: 1px solid var(--ln-line);
  background: var(--ln-bg);
}
body.ops .ops-top h1,
body.ops h1,
body.admin-page .admin-head h1,
body.admin-page .page-head h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}
body.ops .ops-top p,
body.admin-page .admin-head p,
body.admin-page .page-head p { margin: 0; color: var(--ln-muted); font-size: 12px; }

body.ops #monBoard .mon-headbar { display: flex; flex-wrap: wrap; }
body.ops #monKpis,
.ln-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
}
body.ops #monKpis { margin-left: auto; }
.ln-stat, body.ops .mon-kpis article, .tm .hero-kpi {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.ln-stat span, .ln-stat small,
body.ops .mon-kpis span, body.ops .mon-kpis small,
.tm .hero-kpi span { color: var(--ln-muted); font-size: 12px; font-weight: 400; }
.ln-stat b, body.ops .mon-kpis b, .tm .hero-kpi b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  line-height: 1.2;
}
.tm .hero-kpis { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 16px 8px; }
.tm .hero-kpi .ico { display: none; }

body.ops #monBoard .mon-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ln-line);
}
body.ops #monBoard .mon-query { flex: 1 1 220px; width: auto; min-width: 0; }
body.ops #monBoard .chips { width: auto; flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; }
body.ops #monBoard #polyPick { flex: 0 1 200px; }
body.ops .mon-table th,
body.ops .team-table th,
body.ops th {
  background: var(--ln-chrome);
  color: var(--ln-muted);
  font-size: 12px;
  font-weight: 500;
  height: 32px;
}
body.ops .mon-table td,
body.ops .team-table td,
body.ops td { padding: 7px 12px; font-size: 13px; border-bottom: 1px solid var(--ln-line); }
body.ops .mon-row:hover td,
body.ops tr:hover td { background: var(--ln-hover); }

body.ops .chips button,
body.ops .helper-tabs button,
body.ops .scope button,
body.ops .team-tools a,
body.ops .mon-refresh,
body.ops .crm-btn,
body.ops .shift-tabs button,
body.ops .tl-kinds button {
  height: var(--ln-row);
  min-height: var(--ln-row);
  padding: 0 8px;
  border-radius: var(--ln-radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ln-nav);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}
body.ops .chips button.on,
body.ops .helper-tabs button.on,
body.ops .scope button.on,
body.ops .team-tools a.on,
body.ops #kindChips button.on,
body.ops .task-map-toolbar .chips button.on,
body.ops .task-map-toolbar .chips a.on {
  background: var(--ln-hover);
  border-color: transparent;
  color: var(--ln-text);
  box-shadow: none;
}
body.ops #kindChips button.on::before { content: none; }
body.ops .shift-tabs { gap: 0; border-bottom: 1px solid var(--ln-line); }
body.ops .shift-tabs button,
.tm .shift-tab { border-radius: 0; background: transparent; }
body.ops .shift-tabs button.on,
body.ops .shift-tabs button.active,
.tm .shift-tab.active,
body.ops .tl-kinds button.on {
  background: transparent;
  color: var(--ln-text);
  border-bottom: 2px solid var(--ln-text);
  box-shadow: none;
}

body.admin-page .ln-home {
  width: min(1080px, calc(100% - 32px));
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 0 40px;
}
body.admin-page .ln-home .admin-head { padding: 8px 4px 4px; border: 0; }
body.admin-page .ln-home .admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}
body.admin-page .ln-home .admin-group {
  grid-column: 1 / -1;
  margin: 18px 2px 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ln-muted);
}
body.admin-page .ln-home .admin-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: #2c3036;
  box-shadow: none;
  text-decoration: none;
  color: var(--ln-text);
  transform: none;
}
body.admin-page .ln-home a.admin-card:hover {
  background: #363b43;
  border-color: #7ea2d6;
  transform: none;
}
body.admin-page .ln-home a.admin-card:focus-visible {
  outline: 2px solid #7ea2d6;
  outline-offset: 2px;
}
body.admin-page .ln-home .admin-ico {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #3a3f46;
  color: #d5dae1;
}
body.admin-page .ln-home .admin-ico svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.admin-page .ln-home .admin-card b {
  grid-column: 2;
  grid-row: 1;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}
body.admin-page .ln-home .admin-card span {
  grid-column: 2;
  grid-row: 2;
  color: #b4bac3;
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 980px) {
  body.admin-page .ln-home .admin-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body.admin-page .ln-home .admin-grid { grid-template-columns: 1fr; }
}

body.ops .kind-board.ln-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; }
body.ops .kind-board.ln-meters article,
body.ops .ln-meter {
  display: grid;
  justify-items: stretch;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.ln-meter div { display: flex; justify-content: space-between; gap: 8px; }
.ln-meter span, .ln-meter small { color: var(--ln-muted); font-size: 12px; }
.ln-meter b { font-size: 13px; font-weight: 600; }
.ln-meter i { display: block; height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.ln-meter em { display: block; height: 100%; background: #3dba84; }
.kind-board .ring { display: none; }

body.ops .helper-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 6px 12px; }
body.ops .helper-tabs button { flex: 0 0 auto; }
body.ops .helper-content { padding: 8px 16px 24px; }
body.ops .helper-card,
body.ops .station-card,
body.ops .helper-report,
body.admin-page .admin-card.static,
body.admin-page .admin-form,
body.admin-page .admin-list li {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--ln-line);
  border-radius: var(--ln-radius);
  box-shadow: none;
}
body.ops .place-board i { height: 3px; background: rgba(255,255,255,.08); }
body.ops .place-board em { background: #8b9cf7; }

body.ops .team-tools,
body.ops .journal-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
body.ops input,
body.ops select,
body.admin-page input,
body.admin-page select {
  height: 32px;
  border-radius: var(--ln-radius);
  border: 1px solid var(--ln-line);
  background: rgba(255, 255, 255, .03);
  color: var(--ln-text);
}
body.admin-page .admin-form button,
body.ops .draft-card button[type="submit"] {
  height: 32px;
  border-radius: var(--ln-radius);
  background: var(--ln-text);
  color: var(--ln-bg);
  font-weight: 600;
}

body.ops .ops-map,
body.ops.map-screen .map-workspace,
body.ops.home .map-card { background: var(--ln-bg); }
body.ops .map-tools { pointer-events: none; }
body.ops .chips { flex-wrap: nowrap; }
body.ops .chips button,
body.ops .map-search,
body.ops .map-find select,
body.ops .status-pill,
body.ops .pick-btn {
  background: rgba(9, 10, 11, .92);
  border-color: var(--ln-line);
  color: var(--ln-nav);
}
body.ops .ops-empty,
body.ops .map-note,
body.ops.map-screen .map-note {
  background: rgba(9, 10, 11, .94);
  border: 1px solid var(--ln-line);
  border-radius: var(--ln-radius);
  color: var(--ln-text);
}

.gate-card {
  background: #111214;
  border: 1px solid var(--ln-line);
  border-radius: 12px;
  box-shadow: none;
}
.leaflet-bar.sk-locate { margin-top: 8px; border: 0; }
.sk-locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: #1c1f26;
  color: #e7e8ea;
  cursor: pointer;
}
.sk-locate-btn svg { width: 16px; height: 16px; fill: currentColor; }
.sk-locate-btn.on { color: #8b9cf7; }
.sk-locate-btn.wait { opacity: .55; }
.sk-locate-btn:disabled { opacity: .35; cursor: default; }
.sk-geo-back {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
}
.sk-geo-card {
  width: min(420px, 100%);
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #16181d;
  color: #f7f8f8;
}
.sk-geo-card h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.sk-geo-card p { margin: 0; color: #c5c8ce; font-size: 14px; line-height: 1.45; }
.sk-geo-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.sk-geo-actions button {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: transparent;
  color: #d0d6e0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.sk-geo-actions [data-geo="yes"] { background: #f7f8f8; color: #08090a; border-color: transparent; font-weight: 600; }
.sk-geo-note {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 4001;
  transform: translateX(-50%);
  max-width: min(420px, calc(100% - 24px));
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #16181d;
  color: #f7f8f8;
  font-size: 13px;
}
@media (max-width: 768px) {
  .sk-locate-btn, .sk-locate-btn svg { width: 40px; height: 40px; }
  .sk-locate-btn svg { width: 18px; height: 18px; }
  .sk-geo-back { place-items: end center; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sk-geo-actions button { flex: 1; height: 44px; }
}

.gate-card h1 { font-size: 20px; font-weight: 600; }
.gate-card .primary {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--ln-radius);
  background: var(--ln-text);
  color: var(--ln-bg);
  font-weight: 600;
}

@media (max-width: 768px) {
  .ln-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0 12px;
    background: var(--ln-chrome);
    border-bottom: 1px solid var(--ln-line);
  }
  .ln-mobile-brand { font-size: 13px; font-weight: 600; }
  .ln-mobile-actions { display: flex; align-items: center; gap: 6px; }
  body .ln-mobile-bar .help-fab {
    display: flex;
    position: static;
    float: none;
    width: 28px;
    height: 28px;
    margin: 0;
    border-radius: var(--ln-radius);
    border: 1px solid var(--ln-line);
    background: transparent;
    color: var(--ln-nav);
  }
  body .ln-mobile-bar .role-switch.mobile,
  body.ops .ln-mobile-bar .role-switch.mobile {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    display: inline-flex;
    width: auto;
    min-height: 28px;
    margin: 0;
    padding: 0 8px;
    border-radius: var(--ln-radius);
    background: var(--ln-hover);
    border: 1px solid var(--ln-line);
    color: var(--ln-nav);
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
  }
  body.ops .ops-top h1,
  body.admin-page .admin-head h1 { font-size: 15px; white-space: normal; }
  body.ops #monKpis { margin-left: 0; width: 100%; }
  body.ops #monBoard .mon-filters { align-items: stretch; }
  body.ops .helper-tabs { padding-bottom: 8px; }
  body.ops .ops-filter-launch { top: 8px; right: 8px; }
  .more-grid { display: flex; flex-direction: column; gap: 2px; }
  .more-tile, body.ops .more-tile {
    flex-direction: row;
    justify-content: flex-start;
    min-height: 36px;
    padding: 0 8px;
    gap: 10px;
    background: transparent;
    border-radius: var(--ln-radius);
    font-size: 13px;
    font-weight: 500;
  }
  .more-tile svg { width: 16px; height: 16px; }
  .more-tile.on, body.ops .more-tile.on { background: var(--ln-hover); box-shadow: none; }
  body.ops .more-sheet, .more-sheet { background: #16181d; border-radius: 12px; }
  body.ops .bottom-nav, .bottom-nav {
    background: var(--ln-chrome);
    border-top: 1px solid var(--ln-line);
    box-shadow: none;
  }
  body.ops .bottom-nav a.on,
  body.ops .bottom-nav button.on,
  body .bottom-nav a.on,
  body .bottom-nav button.on {
    background: transparent;
    color: var(--ln-text);
  }
}

@media (max-width: 430px) {
  body.admin-page .ln-home .admin-card span { display: block; }
  body.ops .mon-head-tools { width: 100%; }
  body.ops .mon-head-tools input[type="date"] { flex: 1; min-width: 0; }
}

/* Cluster rows: the plate was inheriting the popup's dark gray,
   so it sat on #1c1f26. The detail line was #8b919a. */
.stack-item,
body.ops .stack-item {
  color: #f7f8f8;
}
.stack-item b,
body.ops .stack-item b {
  color: #f7f8f8;
}
.stack-item span,
body.ops .stack-item span {
  color: #d0d6e0;
}
.stack-item:hover,
.stack-item:active,
.stack-item:focus-visible,
body.ops .stack-item:hover,
body.ops .stack-item:active,
body.ops .stack-item:focus-visible {
  background: #f1f5fb;
  color: #1a1d24;
  border-color: #8b9cf7;
}
.stack-item:hover b,
.stack-item:active b,
.stack-item:focus-visible b,
body.ops .stack-item:hover b,
body.ops .stack-item:active b,
body.ops .stack-item:focus-visible b {
  color: #1a1d24;
}
.stack-item:hover span,
.stack-item:active span,
.stack-item:focus-visible span,
body.ops .stack-item:hover span,
body.ops .stack-item:active span,
body.ops .stack-item:focus-visible span {
  color: #3e4654;
}

body.ops .leaflet-tooltip.zone-label {
  background: rgba(22, 24, 29, .92);
  color: #f7f8f8;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  box-shadow: none;
}
body.ops .leaflet-tooltip.zone-label::before { display: none; }

/* Senior pages kept the old navy sidebar and cyan selection. */
body.ops .sidebar {
  background: var(--ln-chrome);
  border-right: 1px solid var(--ln-line);
}
body.ops .side-nav a.on,
body.ops .side-nav a:hover {
  background: var(--ln-hover);
  color: var(--ln-text);
  box-shadow: none;
}

/* Map filters sit on the tiles. The pressed state used a 4% white fill and disappeared. */
body.ops #kindChips button,
body.ops #viewChips button,
body.ops .map-tools .chips button,
body.ops .map-tools .map-search,
body.ops .map-tools .pick-btn,
body.ops .map-tools .status-pill,
body.ops .ops-filter-launch,
body.ops .attn-fab {
  background-color: #2c3036;
  color: #e8ebef;
  border: 1px solid rgba(255, 255, 255, .28);
  opacity: 1;
  box-shadow: none;
  backdrop-filter: none;
}
body.ops #kindChips button:hover,
body.ops #viewChips button:hover,
body.ops .map-tools .chips button:hover {
  background-color: #3a3f46;
  color: #f4f6f8;
}
body.ops #kindChips button.on,
body.ops #kindChips button:active,
body.ops #kindChips button.on:active,
body.ops #viewChips button.on,
body.ops #viewChips button:active,
body.ops #viewChips button.on:active,
body.ops .map-tools .chips button.on,
body.ops .map-tools .chips button:active {
  background-color: #3e5678;
  color: #f7f9fc;
  border-color: #c5d6ee;
  opacity: 1;
}
body.ops #kindChips button.on::before { content: none; }

/* Polygon shifts and other admin pages are documents, not a locked map.
   sk.css pins every ops page to the viewport, so the last supervisor card was cut off. */
@media (min-width: 769px) {
  html:has(body.ops.admin-page:not(.fit):not(.map-screen)),
  body.ops.admin-page:not(.fit):not(.map-screen),
  body.ops.admin-page:not(.fit):not(.map-screen) .shell,
  body.ops.admin-page:not(.fit):not(.map-screen) .main {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}
