:root {
  color-scheme: dark;
  --window: #000000;
  --panel: #121212;
  --panel-raised: #1c1c1c;
  --face: #2a2a2a;
  --face-pressed: #3a3a3a;
  --ink: #ffffff;
  --muted: #c4c8cc;
  --edge: #4a4e52;
  --edge-strong: #6a7076;
  --teal: #008890;
  --teal-dim: #006870;
  --danger: #f85761;
  --warning: #c47a00;
  --ok: #2ead5a;
  --magenta: #e040fb;
  --home: #f47b20;
  --guidance: #3d9eff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --app-height: 100dvh;
  --app-offset-top: 0px;
  --dock-h: calc(56px + var(--safe-bot));
  --bar-h: calc(52px + var(--safe-top));
}
* { box-sizing: border-box; }
html {
  width: 100%;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  height: -webkit-fill-available;
  height: var(--app-height, 100dvh);
}
html, body {
  margin: 0;
  width: 100%;
  background: #000;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  position: relative;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: var(--app-height, 100dvh);
  height: var(--app-height, 100dvh);
}
#app, #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#app {
  min-height: var(--app-height, 100dvh);
  height: var(--app-height, 100dvh);
}
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right {
  bottom: calc(var(--dock-h) + 8px);
}
.maplibregl-ctrl-bottom-right { right: calc(8px + var(--safe-right)); }
.maplibregl-ctrl-bottom-left { left: calc(8px + var(--safe-left)); }
.maplibregl-ctrl-attrib { font-size: 10px; }

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(10px + var(--safe-left));
  background: linear-gradient(to bottom, rgba(0,0,0,.72), rgba(0,0,0,0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(74,78,82,.55);
  border-radius: 10px;
  padding: 5px 10px 5px 8px;
}
.brand .mark {
  width: 28px; height: 22px; object-fit: contain; display: block;
  flex: none;
}
.brand .wordmark {
  display: none; height: 32px; width: auto; object-fit: contain;
}
.brand .sub { color: var(--muted); font-size: 13px; font-weight: 650; letter-spacing: .04em; }
.top-actions { display: flex; gap: 6px; }
.icon-btn, .dock-btn, .primary, .ghost, .tab, .sso-btn {
  min-height: 44px;
  border: 1px solid var(--edge);
  background: var(--face);
  color: var(--ink);
  border-radius: 10px;
  font: inherit;
}
.icon-btn {
  min-width: 44px;
  padding: 0 10px;
  font-size: 13px;
  letter-spacing: .4px;
}
.icon-btn:active, .dock-btn:active, .primary:active { transform: scale(.98); }
.icon-btn.loc-on { background: var(--teal); border-color: var(--teal); color: #fff; }
.status-chip {
  position: absolute;
  top: calc(var(--bar-h) + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 21;
  background: #121212cc;
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  max-width: 92vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-chip.wrap {
  white-space: normal;
  line-height: 1.35;
  text-align: center;
  border-radius: 12px;
  overflow: visible;
  text-overflow: unset;
  max-width: min(92vw, 22rem);
}
.self-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid #fff;
  box-shadow: 0 0 0 8px rgba(0, 136, 144, 0.28);
}

.dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px calc(8px + var(--safe-right)) calc(8px + var(--safe-bot)) calc(8px + var(--safe-left));
  background: #000000ee;
  border-top: 1px solid #2a2a2a;
}
.dock-btn { width: 100%; font-weight: 600; font-size: 11px; padding: 0 2px; }
.dock-btn.on { background: var(--teal); border-color: var(--teal); }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: var(--dock-h);
  z-index: 25;
  max-height: min(62dvh, calc(var(--app-height, 100dvh) - var(--dock-h) - 8px), 520px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--panel);
  border-top: 1px solid var(--edge);
  border-radius: 16px 16px 0 0;
  padding: 8px 14px 16px;
}
.sheet[hidden] { display: none !important; }
.sheet h2 { margin: 4px 0 10px; font-size: 17px; }
.grab {
  width: 40px; height: 4px; border-radius: 4px; background: #3a3a3a;
  margin: 2px auto 8px;
}
.hint, .fine, .lede { color: var(--muted); font-size: 13px; line-height: 1.4; }
.field-list { display: flex; flex-direction: column; gap: 8px; }
.field-card, .layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  min-height: 48px;
}
.field-card { text-align: left; width: 100%; color: inherit; font: inherit; cursor: pointer; }
.field-card .name { font-weight: 650; }
.field-card .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.swatch {
  width: 12px; height: 12px; border-radius: 3px; flex: none;
  border: 1px solid #fff6;
}
.layer-list { display: flex; flex-direction: column; gap: 8px; }
.layer-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas:
    "label info check"
    "slider slider slider"
    "blurb blurb blurb";
  align-items: center;
  gap: 8px 10px;
}
.layer-row label { display: flex; align-items: center; gap: 10px; grid-area: label; min-width: 0; }
.layer-row input[type="checkbox"] { width: 22px; height: 22px; grid-area: check; }
.layer-info {
  grid-area: info;
  width: 36px; min-width: 36px; height: 36px; padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}
.layer-info.on { color: var(--ink); border-color: var(--teal); }
.layer-opacity {
  grid-area: slider;
  width: 100%;
  min-height: 28px;
  accent-color: var(--teal);
}
.layer-blurb {
  grid-area: blurb;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.layer-row.locked { opacity: .45; }
.tfr-mini { font-size: 12px; color: var(--muted); max-height: 28vh; overflow: auto; margin: 8px 0 0; }
.tfr-mini li { margin: 0 0 6px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kv {
  background: var(--face); border: 1px solid var(--edge); border-radius: 10px; padding: 10px;
}
.kv .k { color: var(--muted); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }
.kv .v { font-size: 16px; font-weight: 650; margin-top: 2px; }
.rings { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 6px 8px; border-radius: 999px;
  border: 1px solid var(--edge); background: #000;
}
#fieldSearch {
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: #000;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}
.primary {
  width: 100%;
  background: var(--teal);
  border-color: var(--teal);
  font-weight: 650;
}
.ghost { background: transparent; }
.ghost.on { background: var(--teal); border-color: var(--teal); }
.job-card.on { border-color: var(--teal); }

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.chip-btn {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--face);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.chip-btn.on { background: var(--teal); border-color: var(--teal); }

.week-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.week-tools .ghost { flex: 1; min-height: 40px; font-size: 13px; }
.week-tools .primary { width: auto; flex: 1; min-height: 40px; }
.client-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.client-form[hidden] { display: none !important; }
.client-form input, .client-edit input, .client-edit select {
  width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--edge); background: #000; color: var(--ink);
  padding: 0 12px; font: inherit;
}
.client-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.client-edit label { color: var(--muted); font-size: 12px; }

.sheet-week { max-height: min(78dvh, calc(var(--app-height, 100dvh) - var(--dock-h) - 8px), 720px); }
.sheet-sync, .sheet-jobs, .sheet-account, .sheet-data { max-height: min(82dvh, calc(var(--app-height, 100dvh) - var(--dock-h) - 8px), 760px); }
.sheet h3 { font-size: 14px; margin: 16px 0 8px; }
.sync-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.conn-card {
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 12px;
}
.conn-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.conn-form[hidden] { display: none !important; }
.conn-form input, .conn-form select, .conn-form textarea, #csSearch {
  width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--edge); background: #000; color: var(--ink);
  padding: 8px 12px; font: inherit;
}
.conn-form textarea { min-height: 88px; resize: vertical; }
#csSearch { margin: 0 0 10px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex: 1; }
.check-label input { width: 20px; height: 20px; }
.preview-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.preview-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: var(--face); border: 1px solid var(--edge);
  border-radius: 12px; text-align: left; color: inherit; font: inherit; width: 100%;
}
.preview-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.preview-row .name { font-weight: 650; }
.preview-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.sync-log {
  background: #000; border: 1px solid var(--edge); border-radius: 10px;
  padding: 10px; font-size: 11px; color: var(--muted); max-height: 22vh; overflow: auto;
  white-space: pre-wrap;
}
.row { display: flex; gap: 8px; align-items: center; }
.week-head {
  display: none;
}
.week-day-chips { margin: 4px 0 10px; }
.week-day-chips .chip-btn { min-width: 44px; }
.week-base {
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.week-base strong { font-size: 13px; }
.week-run {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.week-run-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 8px 10px;
}
.week-run-row .name { font-weight: 650; flex: 1; }
.week-list { display: flex; flex-direction: column; gap: 10px; }
.week-row {
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 10px;
}
.week-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.week-meta { text-align: left; flex: 1; background: none; border: 0; color: inherit; font: inherit; padding: 0; min-height: 0; }
.week-name { font-weight: 650; }
.week-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.week-pri { display: flex; gap: 4px; flex: none; }
.week-pri button { min-width: 36px; min-height: 36px; padding: 0; }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 8px; }
.day-cell {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid #0006;
  padding: 4px 2px;
  font-size: 10px;
  text-align: center;
  color: #fff;
}
.day-cell.on { outline: 2px solid #fff; }
.wx-ok { background: #1F6B4A; }
.wx-caut { background: #6B5A20; }
.wx-warn { background: #6B3A18; }
.wx-off { background: #2a2a2a; color: var(--muted); }
.week-hours { display: flex; gap: 2px; margin-top: 8px; overflow-x: auto; }
.hour-pip {
  width: 10px; height: 18px; border-radius: 2px; flex: none;
}
.hour-pip.now { outline: 1px solid #fff; }
.dots7 { display: flex; gap: 3px; margin-top: 6px; }
.dots7 i { width: 8px; height: 8px; border-radius: 2px; display: block; }

.primary.secondary { background: var(--face); border-color: var(--edge); margin-top: 8px; }

.job-form, .biz-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.job-form[hidden] { display: none !important; }
.job-form input, .job-form select, .job-form textarea,
.biz-form input, #grantPass, #jobPaste {
  width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--edge); background: #000; color: var(--ink);
  padding: 8px 12px; font: inherit;
}
.job-form textarea, #jobPaste { min-height: 88px; resize: vertical; }
.job-form details, #jobPasteBox {
  background: var(--face); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px;
}
.job-form details { display: flex; flex-direction: column; gap: 8px; }
.job-form summary, #jobPasteBox summary {
  cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px;
}
.job-form .hint.gcs { color: var(--teal); }
.job-card.locked .name::after { content: " · locked"; color: var(--muted); font-weight: 400; }
.job-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.job-actions button { flex: 1; min-height: 40px; font-size: 12px; }
@media (max-width: 380px) {
  .dock-btn { font-size: 10px; }
}

.overlay-screen {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--app-offset-top, 0px);
  width: 100%;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
}
.overlay-screen[hidden] { display: none !important; }
.overlay-pin {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.login {
  z-index: 80;
  background: #000c;
}
.login .overlay-pin {
  padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) calc(12px + var(--safe-bot)) calc(12px + var(--safe-left));
}
.login-splash {
  background: var(--window) url("/brand/home_background_z80.jpg") center / cover no-repeat;
}
.login-splash::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.86) 0%, rgba(0,0,0,.42) 48%, rgba(0,0,0,.28) 100%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: min(440px, 100%);
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 18px 16px 16px;
}
.login-splash .login-card { background: rgba(18, 18, 18, 0.94); }
.login-logo {
  display: block;
  width: min(280px, 86%);
  height: auto;
  margin: 2px auto 10px;
}
@media (max-height: 720px) {
  .login-logo { width: min(200px, 72%); margin: 0 auto 6px; }
}
.login-product {
  margin: 0 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.login h1:not(.login-product) {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  color: var(--ink);
}
.login-splash .lede { text-align: center; }
.login-splash .sso-row { margin-top: 4px; }
.login-splash #ssoHint { text-align: center; margin: 6px 0 0; font-size: 12px; }
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--edge);
}
.tabs { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.tab { flex: 1; font-size: 13px; }
.tab.on { background: var(--teal); border-color: var(--teal); }
.sso-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.sso-row button,
.sso-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: #fff;
  color: #1f1f1f;
  border-color: #dadce0;
  font-weight: 600;
  font-size: 13px;
}
.sso-btn:disabled { opacity: 0.55; }
.sso-mark { width: 18px; height: 18px; flex: none; }
@media (max-width: 400px) {
  .sso-row { flex-direction: column; }
}
#createForm { margin-top: 12px; }
#createForm label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
#createForm input {
  width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--edge); background: #000; color: var(--ink);
  padding: 0 12px; font: inherit;
}
.id-account { margin: 12px 0 18px; padding-top: 8px; border-top: 1px solid var(--edge); }
.id-block { margin: 10px 0; padding: 10px; border: 1px solid var(--edge); border-radius: 12px; background: #0006; }
.id-qr-card { margin: 0 0 12px; }
.id-qr { width: 168px; height: 168px; background: #fff; border-radius: 10px; padding: 8px; }
.id-qr svg { width: 100%; height: 100%; display: block; }
.id-code, .id-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all; font-size: 14px; margin: 8px 0;
}
.id-form { margin: 10px 0 14px; }
.id-scopes { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 10px; }
.id-login-row { display: flex; align-items: center; gap: 8px; }
.id-docs-link { display: inline-block; }
.login label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.login input {
  width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--edge); background: #000; color: var(--ink);
  padding: 0 12px; font: inherit;
}
.login .row { display: flex; gap: 8px; }
.login .row input { flex: 1; }
.err { color: var(--danger); margin: 8px 0 0; font-size: 13px; }
.plan-hud {
  position: absolute;
  top: calc(var(--bar-h) + 4px);
  left: 8px; right: 8px;
  z-index: 22;
  background: #121212ee;
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 8px 10px 10px;
  max-height: min(34dvh, 280px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.plan-hud[hidden] { display: none !important; }
.plan-hud .plan-meta input,
.plan-hud .plan-meta select {
  flex: 1; min-width: 0; min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: #000;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}
.plan-job { color: var(--ink); margin: 2px 0 6px; }
.plan-hud .chip-btn { min-height: 44px; }
.plan-types { margin-bottom: 2px; }
.plan-rings { margin-bottom: 2px; }
.plan-types .chip-btn { border-width: 2px; }
.plan-details { margin: 2px 0 8px; }
.plan-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
.plan-hud .hint.warn { color: #e2b340; }
.plan-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plan-tools button {
  flex: 1 1 calc(25% - 6px);
  min-height: 44px;
  min-width: 0;
  padding: 0 6px;
  font-size: 12px;
}
.plan-tools button:disabled { opacity: 0.38; }
.plan-tools button.on { background: var(--teal); border-color: var(--teal); }
@media (max-width: 719px) {
  .plan-hud { max-height: min(28dvh, 200px); padding-bottom: 8px; }
  .plan-tools {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--dock-h);
    z-index: 24;
    padding: 8px 8px 6px;
    background: #121212f2;
    border-top: 1px solid var(--edge);
  }
}
.plat-help {
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 0 10px;
}
.plat-help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.plat-help ol { margin: 8px 0 4px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.plat-help a { color: var(--teal); }
.plat-help li { margin: 0 0 6px; }
#btnEditPlan { margin-bottom: 8px; }
@media (min-width: 720px) {
  .plan-hud {
    left: 12px;
    right: auto;
    width: min(420px, 42vw);
    max-height: min(78dvh, 720px);
  }
}
.fine { margin: 12px 0 0; }
.fine a { color: var(--teal); }
#btnSkipLogin { width: 100%; margin-top: 10px; }

.adv-filter {
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.adv-filter[hidden] { display: none !important; }
.filter-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.filter-label input, .filter-label select {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: #000;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.map-labels {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}
.field-label {
  position: absolute;
  transform: translate(-50%, -110%);
  background: #000000cc;
  border: 1px solid #ffffff33;
  border-radius: 8px;
  padding: 4px 8px 6px;
  min-width: 88px;
  text-align: center;
  box-shadow: 0 4px 12px #00000066;
}
.field-label .name { font-weight: 650; font-size: 12px; line-height: 1.2; }
.field-label .meta { color: var(--muted); font-size: 10px; line-height: 1.25; margin-top: 2px; }
.field-label.sched { border-color: #c47a00; }
.field-label.ok { border-color: #2ead5a; }
.field-label.past { border-color: #6a7076; }
.wx-line {
  display: flex;
  gap: 2px;
  width: 100%;
  margin-top: 5px;
  height: 4px;
}
.wx-line i {
  flex: 1 1 0;
  min-width: 6px;
  height: 4px;
  border-radius: 2px;
  display: block;
}
.field-label .wx-line i.wx-ok,
.field-card .wx-line i.wx-ok { background: #2ead5a; }
.field-label .wx-line i.wx-caut,
.field-card .wx-line i.wx-caut { background: #E8A838; }
.field-label .wx-line i.wx-warn,
.field-card .wx-line i.wx-warn { background: #f85761; }
.field-label .wx-line i.wx-off,
.field-card .wx-line i.wx-off { background: #3a3a3a; }

.ac-label {
  position: absolute;
  transform: translate(-50%, -120%);
  pointer-events: auto;
  cursor: pointer;
  background: #000000cc;
  border: 1px solid #2ead5a;
  border-radius: 8px;
  padding: 5px 8px 6px;
  min-width: 92px;
  text-align: center;
  color: #fff;
  font: inherit;
  z-index: 5;
}
.ac-label .n { font-weight: 700; font-size: 12px; line-height: 1.2; }
.ac-label .nick { font-size: 11px; line-height: 1.2; margin-top: 1px; }
.ac-label .st { color: var(--muted); font-size: 10px; line-height: 1.25; margin-top: 2px; }
.ac-label .hdg { display: none; }
.ac-label.live { border-color: #008890; }
.ac-label.working { border-color: #4DA6FF; }
.ac-label.last, .ac-label.offline, .ac-label.locked { border-color: #6a7076; }
.ac-label.on { box-shadow: 0 0 0 2px #ffffffaa; }

.traf-label, .truck-label {
  position: absolute;
  transform: translate(-50%, -120%);
  pointer-events: none;
  background: #000000cc;
  border: 1px solid #F4D06F;
  border-radius: 8px;
  padding: 4px 7px 5px;
  min-width: 72px;
  text-align: center;
  color: #fff;
  font: inherit;
  z-index: 4;
}
.traf-label .n, .truck-label .n { font-weight: 700; font-size: 11px; line-height: 1.2; }
.traf-label .st, .truck-label .st { color: var(--muted); font-size: 10px; line-height: 1.25; margin-top: 2px; }
.traf-label.factor { border-color: #f85761; }
.traf-label.nofactor { border-color: #F4D06F; }
.truck-label { border-color: #F47B20; }
.truck-label.self { border-color: #ffffff; }

#acBody h3 { margin: 8px 0 8px; font-size: 14px; }
#acBody .field-list { margin-bottom: 10px; }
#acBody > .ghost { width: 100%; }

.data-table-wrap { overflow: auto; margin: 0 0 16px; border: 1px solid var(--edge); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2a2a2a; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table select, .data-table input { min-height: 32px; max-width: 160px; }
.chem-stale { color: var(--warning); }
.chem-ok { color: var(--ok); }
.chem-filters { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.chem-filters .filter-label { width: 100%; }
.chem-filter-row { align-items: stretch; flex-wrap: wrap; }
.chem-filter-row .filter-label { min-width: 140px; }
.chem-count { margin: 0 0 8px; }

.drive-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #f47b20; border: 2px solid #fff;
}
#laancCustom, #laancAircraft, #laancProvider,
#coaTitle, #coaNumber, #coaSiteName, #coaSiteLat, #coaSiteLon, #coaSiteNm,
#coaWellClearFt, #coaWellClearAltFt {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: #000;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  margin: 0 0 8px;
}
#btnSaveCoa { width: 100%; margin: 0 0 8px; }

.wx-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0;
}
.wx-hour {
  flex: 1 0 44px;
  min-width: 44px;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  line-height: 1.25;
}
.wx-hour .t { font-weight: 650; }
.wx-hour .r { color: #fff9; font-size: 10px; }

.vra-panel {
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0 12px;
}
.vra-panel[hidden] { display: none !important; }
.vra-panel h3 { margin: 0 0 8px; }
.vra-cols, .vra-rows { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.vra-col, .vra-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: center;
}
.vra-panel input, .vra-panel select {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: #000;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}
.vra-table-wrap { overflow: auto; max-height: 28vh; margin: 8px 0; }
.vra-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vra-table th, .vra-table td {
  border-bottom: 1px solid var(--edge);
  padding: 6px 4px;
  text-align: left;
  white-space: nowrap;
}
.vra-table input { min-height: 32px; width: 88px; }

.welcome {
  z-index: 70;
  background: #000a;
}
.welcome .overlay-pin {
  padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) calc(12px + var(--dock-h));
}
.welcome-card {
  width: min(480px, 100%);
  max-width: 100%;
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 16px;
}
.welcome-mark { display: block; margin: 0 auto 8px; }
.welcome-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 20px;
}
.welcome-picks select {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: #000;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}
.stand-in { color: var(--warning); }
.stand-out { color: var(--ok); }

.sheet-backdrop {
  position: absolute; inset: 0; bottom: var(--dock-h);
  z-index: 24;
  background: #0006;
}
.sheet-backdrop[hidden] { display: none !important; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 8px;
}
.sheet-head h2 { margin: 4px 0; flex: 1; }
.sheet-close { min-width: 40px; min-height: 40px; padding: 0; font-size: 16px; }
.grab { cursor: pointer; }

.plan-hud-bar {
  display: flex; align-items: center; gap: 8px; min-height: 40px;
}
.plan-hud-summary { flex: 1; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-hud-bar .ghost { flex: none; min-height: 36px; padding: 0 10px; font-size: 12px; }
.plan-hud.collapsed { max-height: none; overflow: visible; }
.plan-hud.collapsed #planHudBody { display: none; }
@media (max-width: 719px) {
  .plan-hud.collapsed .plan-tools { display: none; }
}

.diag-stack {
  position: absolute;
  top: calc(var(--bar-h) + 40px);
  right: 8px;
  left: auto;
  z-index: 28;
  display: flex; flex-direction: column; gap: 6px;
  max-width: min(360px, 92vw);
  pointer-events: none;
}
.diag-card {
  pointer-events: auto;
  background: #3a1212ee;
  border: 1px solid var(--danger);
  color: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  display: flex; gap: 8px; align-items: flex-start;
}
.diag-card.warn { background: #3a2e12ee; border-color: #e2b340; }
.diag-card.info { background: #121212ee; border-color: var(--edge); }
.diag-card button { flex: none; min-height: 32px; min-width: 32px; padding: 0; }

.basemap-pop {
  position: absolute;
  top: calc(var(--bar-h) + 4px);
  right: 10px;
  z-index: 26;
  background: #121212f2;
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 200px;
}
.basemap-pop[hidden] { display: none !important; }
.basemap-pop button { width: 100%; text-align: left; min-height: 40px; }
.basemap-pop button.on { background: var(--teal); border-color: var(--teal); }

.day-cell.booked { box-shadow: inset 0 0 0 2px #fff; }
.day-cell.cached::after { content: "C"; display: block; font-size: 9px; color: #9ee0c4; }
.week-route {
  margin-top: 12px;
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 10px 12px;
}
.week-route[hidden] { display: none !important; }
.week-route .leg { margin: 4px 0; font-size: 13px; }
.week-route .tot { font-weight: 650; margin-top: 8px; }
.week-route .est { color: var(--muted); font-size: 12px; }
.launch-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #4DA6FF; border: 2px solid #fff;
}

.print-modal {
  z-index: 90;
  background: #000c;
}
.print-modal .overlay-pin {
  justify-content: center;
  padding: 12px;
}
.print-card {
  width: min(720px, 100%);
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 12px;
}
.print-card iframe {
  width: 100%; height: min(58dvh, 520px);
  border: 1px solid var(--edge); border-radius: 10px; background: #fff;
}

#netPref, #baseLat, #baseLon, #stopLabel, #teamPreview, #teamRole, #teamName, #teamEmail, #teamPhone, #teamUserId {
  width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--edge); background: #000; color: var(--ink);
  padding: 0 12px; font: inherit;
}

.account-who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.account-who .lede { margin: 0; }
.account-who .hint { margin: 2px 0 0; }
#btnAccount { padding: 0; overflow: hidden; }
#btnAccount .avatar-chip { width: 32px; height: 32px; border: 0; font-size: 11px; }

.avatar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: #2a2a2a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 2px solid #0e0e0e;
  box-shadow: 0 0 0 1px #ffffff22;
}
.avatar-chip img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.avatar-chip.lg { width: 44px; height: 44px; font-size: 14px; }
.avatar-chip.empty {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
}

.team-preview { margin: 0 0 10px; }
.team-preview .filter-label { display: flex; flex-direction: column; gap: 6px; width: 100%; color: var(--muted); font-size: 12px; }
.team-roster { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.team-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
}
.team-card .who { flex: 1; min-width: 0; text-align: left; }
.team-card .name { font-weight: 650; }
.team-card .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.team-card .ghost { flex: none; min-height: 36px; width: auto; padding: 0 10px; font-size: 12px; }
.role-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  color: var(--muted);
  flex: none;
}
.team-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--face);
  border: 1px solid var(--edge);
  border-radius: 12px;
}
.team-form[hidden] { display: none !important; }
#btnAddPerson { width: 100%; margin-bottom: 16px; }
#teamPhoto { width: auto; min-height: 0; }

.crew-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.crew-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: #000;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.crew-slot .crew-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--muted);
  min-width: 26px;
}
.crew-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.crew-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.week-run-row .crew-mini { margin-right: 4px; }

.crew-pop {
  z-index: 80;
  background: #000c;
}
.crew-pop .overlay-pin {
  padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bot));
}
.crew-pop-card {
  width: min(420px, 100%);
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 14px;
}
.crew-pop-card .ghost { width: 100%; margin-top: 10px; }
.send-card { width: min(480px, 100%); }
.send-card .week-tools { margin-top: 8px; }
.send-card .week-tools .ghost { width: auto; margin-top: 0; }
.send-card .conn-form { margin-top: 0; }
.send-card .chip-row { margin-bottom: 8px; }
.crew-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  min-height: 48px;
  padding: 8px 10px;
  margin: 0 0 6px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: var(--face);
  color: inherit;
  font: inherit;
}
.crew-pick.on { border-color: var(--teal); background: #00889022; }
.crew-pick .who { flex: 1; min-width: 0; }
.crew-pick .name { font-weight: 650; }
.crew-pick .meta { color: var(--muted); font-size: 12px; }

@media (min-width: 720px) {
  .login .overlay-pin,
  .welcome .overlay-pin,
  .crew-pop .overlay-pin { justify-content: center; }
}

@media (min-width: 720px) {
  .brand .mark { display: none; }
  .brand .wordmark { display: block; }
  .sheet { left: 12px; right: auto; width: min(380px, 42vw); bottom: calc(var(--dock-h) + 12px); border-radius: 16px; max-height: min(70dvh, calc(var(--app-height, 100dvh) - var(--dock-h) - 24px)); }
  .sheet-week { width: min(640px, 92vw); max-height: min(78dvh, calc(var(--app-height, 100dvh) - var(--dock-h) - 24px)); }
  .sheet-sync, .sheet-jobs, .sheet-account, .sheet-data { width: min(640px, 92vw); max-height: min(82dvh, calc(var(--app-height, 100dvh) - var(--dock-h) - 24px)); }
  .sync-grid { grid-template-columns: 1fr 1fr; }
  .dock { left: 50%; transform: translateX(-50%); width: min(840px, 96vw); border-radius: 16px 16px 0 0; }
}

html.is-pwa .dock {
  left: 0;
  right: 0;
  transform: none;
  width: auto;
  border-radius: 0;
}
html.dev-docs,
html.dev-docs body {
  overflow: auto;
  overscroll-behavior: auto;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
}
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  .dock {
    left: 0;
    right: 0;
    transform: none;
    width: auto;
    border-radius: 0;
  }
}
