/* ==========================================================
   LAFD Swiftwater app styles (on top of tokens.css)
   ========================================================== */
:root { --sidebar-w: 236px; --tabbar-h: 64px; color-scheme: light; }
html, body { height: 100%; }
body { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(1200px 800px at 50% 44%, #163460 0%, #0e2546 45%, #0b1f3a 75%, #081a31 100%); color: #fff;
  transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.ripples { position: absolute; left: 50%; top: 41%; width: 0; height: 0; }
.ripples span { position: absolute; border-radius: 50%; border: 1px solid rgba(170,205,245,.16); transform: translate(-50%,-50%);
  width: var(--d); height: var(--d); opacity: 0; animation: ripple 2.4s ease-out infinite; }
.ripples span:nth-child(1){--d:min(46vw,380px);animation-delay:0s}
.ripples span:nth-child(2){--d:min(62vw,520px);animation-delay:.25s}
.ripples span:nth-child(3){--d:min(80vw,680px);animation-delay:.5s}
.ripples span:nth-child(4){--d:min(100vw,860px);animation-delay:.75s}
.ripples span:nth-child(5){--d:min(124vw,1060px);animation-delay:1s}
.ripples span:nth-child(6){--d:min(150vw,1290px);animation-delay:1.25s}
@keyframes ripple { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.82); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.06); } }
.splash .glow { position: absolute; left: 50%; top: 41%; width: 420px; height: 420px; transform: translate(-50%,-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(90,150,230,.22) 0%, rgba(90,150,230,0) 65%); }
.splash .seal { position: relative; width: min(56vw, 272px); height: auto; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); margin-top: -40px; animation: sealIn .7s ease-out both; }
@keyframes sealIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.splash h1 { position: relative; margin-top: 36px; font-size: clamp(30px, 6vw, 46px); font-weight: 650; letter-spacing: -.025em; }
.splash .sub { position: relative; margin-top: 10px; font-size: clamp(11px, 2.4vw, 14px); font-weight: 500; letter-spacing: .34em; text-transform: uppercase; color: rgba(214,226,243,.62); }
.splash .load { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); width: 160px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.10); overflow: hidden; }
.splash .load i { display: block; width: 40%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(255,255,255,.35), #fff); animation: load 1.1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.splash .foot { position: absolute; bottom: calc(40px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(214,226,243,.38); }
.env-badge { position: fixed; z-index: 200; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); padding: 2px 10px 3px; border-radius: 0 0 7px 7px;
  background: #f59e0b; color: #1a1300; font: 800 11px/1.4 var(--font); letter-spacing: .1em; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* ---------- Gate screens (sign-in / waiting / blocked) ---------- */
.gate { position: fixed; inset: 0; overflow: auto; color: #fff;
  background: radial-gradient(1215px 945px at 50% 30%, #163460 0%, #0e2546 45%, #0b1f3a 75%, #081a31 100%);
  display: flex; flex-direction: column; align-items: center; padding: max(48px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.gate .ripples { top: 26%; position: fixed; }
.gate .ripples span { animation: none; opacity: 1; }
.gate .top { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: clamp(12px, 6vh, 90px); }
.gate .seal { width: clamp(150px, 26vh, 232px); height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 14px 32px rgba(0,0,0,.45)); }
.gate h1 { margin-top: 24px; font-size: clamp(30px, 5vw, 43px); font-weight: 650; letter-spacing: -.025em; }
.gate .sub { margin-top: 8px; font-size: clamp(12px, 2.2vw, 15.5px); font-weight: 500; letter-spacing: .32em; text-transform: uppercase; color: rgba(214,226,243,.62); }
.gate .gcard { position: relative; margin-top: auto; width: 100%; max-width: 520px; background: #fff; color: var(--navy-900);
  border-radius: 24px; padding: 30px 28px 24px; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
@media (min-width: 700px) { .gate .gcard { margin-top: clamp(40px, 12vh, 150px); margin-bottom: auto; padding: 34px 36px 30px; } }
.gcard h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.gcard .lead { font-size: 16px; color: var(--ink-2); margin-top: 6px; line-height: 1.45; }
.gbtn { margin-top: 24px; width: 100%; height: 62px; border-radius: 16px; border: 1.5px solid var(--border-strong); background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 18.5px; font-weight: 650; color: #1f2937; box-shadow: var(--shadow-1); }
.gbtn:hover { background: #f8fafc; } .gbtn:disabled { opacity: .6; cursor: progress; }
.gbtn.dark { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.domain { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.domain svg { width: 19px; height: 19px; color: var(--navy-700); flex: none; margin-top: 1px; }
.domain b { color: var(--navy-900); font-weight: 650; }
.fine { margin-top: 14px; font-size: 13px; color: var(--ink-3); line-height: 1.45; text-align: center; }
.fine a, .linkbtn { color: var(--navy-700); font-weight: 600; text-decoration: underline; background: none; border: 0; padding: 0; font-size: inherit; }
.gate .gfoot { position: relative; margin-top: 22px; text-align: center; font-size: 11px; color: rgba(214,226,243,.38); }
.gerr { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red); font-size: 13.5px; }
.who { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.who b { display: block; font-size: 14px; } .who span { display: block; font-size: 12.5px; color: var(--ink-3); }
.gate .row2 { display: flex; gap: 10px; margin-top: 16px; } .gate .row2 .btn { flex: 1; height: 46px; font-size: 14px; }

/* ---------- App shell ---------- */
.app { display: flex; height: 100vh; height: 100dvh; width: 100vw; }
.sidebar { width: var(--sidebar-w); }
.nav a { cursor: pointer; }
.nav a:not(.active):hover { background: var(--surface-2); }
.nav a .soon { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.nav a.active .soon { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.25); }
.side-foot { position: relative; }
.side-foot .who-btn { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 0; }
.side-foot .who-btn > div { min-width: 0; } .side-foot .who-btn b, .side-foot .who-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; z-index: 40; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--navy-900); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .mh { padding: 8px 10px 6px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .mh b { display: block; color: var(--navy-900); font-size: 13px; }
.side-foot .menu { bottom: 52px; left: 0; right: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.scroller { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.topbar .search { cursor: text; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--navy-900); font-size: 13px; }
.content { overflow: visible; padding-bottom: 32px; }
.appbar { display: none; }
.tabbar { display: none; }

/* ---------- Generic bits ---------- */
.btn { cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary:hover:not(:disabled) { background: var(--navy-800); }
.btn:not(.primary):hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 86%, #000); border-color: color-mix(in srgb, var(--red) 86%, #000); }
.btn.lg { height: 46px; padding: 0 18px; font-size: 14.5px; border-radius: 12px; }
.icon-btn { cursor: pointer; }
.empty { padding: 26px 16px 28px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty b { display: block; color: var(--navy-900); font-size: 14px; margin-bottom: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.pill.amber { background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line); }
.pill.gray { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }
.pill.navy { background: var(--navy-900); color: #fff; }
.pill svg { width: 11px; height: 11px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.kv > div { padding: 11px 16px; border-top: 1px solid var(--border); min-width: 0; }
.kv > div:nth-child(odd) { border-right: 1px solid var(--border); }
.kv dt { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.kv dd { margin-top: 3px; font-size: 13.5px; font-weight: 550; overflow-wrap: anywhere; }
.kv dd.none { color: var(--ink-4); font-weight: 450; }
.phase { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); border: 1px dashed var(--border-strong); border-radius: 999px; padding: 2px 9px; }
.soon-card { padding: 34px 28px; text-align: center; max-width: 620px; margin: 10px auto 0; }
.soon-card .ctile { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; }
.soon-card .ctile svg { width: 24px; height: 24px; }
.soon-card h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin: 10px 0 6px; }
.soon-card p { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.soon-card ul { text-align: left; margin: 16px auto 0; max-width: 440px; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }

/* ---------- Toast + modal ---------- */
#toasts { position: fixed; z-index: 300; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--navy-900); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 550; box-shadow: var(--shadow-3); display: flex; gap: 12px; align-items: center; max-width: min(92vw, 520px); }
.toast.err { background: var(--red); }
.toast button { background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 8px; padding: 5px 10px; font-weight: 600; }
.modal-bg { position: fixed; inset: 0; z-index: 150; background: rgba(8,20,38,.45); display: flex; align-items: flex-start; justify-content: center; padding: max(6vh, calc(env(safe-area-inset-top) + 16px)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); overflow: auto; }
.modal { width: 100%; max-width: 640px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-3); border: 1px solid var(--border); }
.modal.sm { max-width: 460px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-h h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 16px 20px; max-height: 68vh; overflow: auto; }
.modal-f { display: flex; gap: 10px; align-items: center; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.modal-f .spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { grid-column: 1 / -1; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: 14px; outline: 0; }
.field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(28,58,99,.12); }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.field.check { display: flex; align-items: center; gap: 8px; } .field.check input { width: 18px; height: 18px; } .field.check label { margin: 0; }
.form-err { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--red-bg); border: 1px solid var(--red-line); color: var(--red); font-size: 13px; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px 13px; text-decoration: none; display: block; }
.kpi .l { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.kpi .l i { width: 8px; height: 8px; border-radius: 50%; }
.kpi .v { font-size: 32px; font-weight: 650; letter-spacing: -.03em; margin-top: 6px; line-height: 1; }
.kpi .v.na { color: var(--ink-4); }
.kpi .s { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.kpi:hover { border-color: var(--border-strong); }
.cols { display: grid; grid-template-columns: minmax(0,1fr) 372px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.badge { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.amber { background: var(--amber-bg); color: var(--amber-ink); } .badge.gray { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }
.cat { display: grid; grid-template-columns: 30px 150px minmax(0,1fr); gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.cat:hover { background: var(--surface-2); }
.cat .n b { display: block; font-size: 13px; font-weight: 600; } .cat .n b small { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-left: 3px; }
.cat .n span { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.sbar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin-bottom: 7px; gap: 2px; }
.sbar i { display: block; height: 100%; } .sbar .g { background: #34a464; } .sbar .b { background: #3b7be0; } .sbar .s { background: #9aa3b0; }
.units { display: flex; flex-wrap: nowrap; gap: 5px; overflow: hidden; }
.u { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 11.5px; font-weight: 550; color: var(--navy-900); white-space: nowrap; background: var(--surface); text-decoration: none; }
.u::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34a464; }
.u.inservice::before { background: #3b7be0; } .u.oos::before { background: #9aa3b0; } .u.oos { color: var(--ink-2); }
.u.more { border-style: dashed; color: var(--ink-3); } .u.more::before { display: none; }
.cat .none { font-size: 12px; color: var(--ink-4); }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 5px; } .legend i { width: 7px; height: 7px; border-radius: 50%; }
.seg { cursor: pointer; } .seg span { cursor: pointer; user-select: none; }
.seg.sm span { padding: 5px 10px; font-size: 12px; }
.act { display: flex; gap: 11px; padding: 10px 16px; border-top: 1px solid var(--border); }
.act .t { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.act .t b { color: var(--navy-900); font-weight: 600; }
.act .t .m { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.act .time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ico svg { width: 15px; height: 15px; }
.ico.g { background: var(--green-bg); color: var(--green); } .ico.b { background: var(--blue-bg); color: var(--blue); }
.ico.s { background: var(--slate-bg); color: var(--slate); } .ico.n { background: var(--surface-2); color: var(--navy-700); border: 1px solid var(--border); }
.ico.a { background: var(--amber-bg); color: var(--amber); } .ico.r { background: var(--red-bg); color: var(--red); }
.vrow { display: flex; align-items: center; gap: 11px; padding: 10px 16px; border-top: 1px solid var(--border); text-decoration: none; }
.vrow:hover { background: var(--surface-2); }
.vrow .t { flex: 1; min-width: 0; } .vrow .t b { display: block; font-size: 13px; font-weight: 600; }
.vrow .t span { display: block; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next { padding: 4px 16px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.next > div { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.next > div b { color: var(--navy-900); font-weight: 600; }
.next .phase { margin-left: auto; }

/* ---------- Fleet table ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 6px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; background: none; border: 0; }
.tabs button b { font-weight: 550; color: var(--ink-3); margin-left: 4px; }
.tabs button.on { background: var(--navy-900); color: #fff; } .tabs button.on b { color: rgba(255,255,255,.6); }
.toolbar select { height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 12.5px; font-weight: 550; }
.toolbar .search { width: 260px; height: 32px; border-radius: 8px; }
table.fleet { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fleet th { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 9px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.fleet td { padding: 0 10px; height: 52px; border-bottom: 1px solid var(--border); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet td:first-child, .fleet th:first-child { padding-left: 16px; }
.fleet tbody tr { cursor: pointer; } .fleet tbody tr:hover td { background: var(--surface-2); }
.an { display: flex; align-items: center; gap: 10px; min-width: 0; }
.an .ctile { width: 28px; height: 28px; border-radius: 7px; } .an .ctile svg { width: 15px; height: 15px; }
.an > div:last-child { min-width: 0; }
.an b { font-weight: 600; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; }
.an span { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.tfoot { display: flex; align-items: center; padding: 10px 16px; font-size: 12px; color: var(--ink-3); }
.fleet-cards { display: none; }

/* ---------- Asset detail ---------- */
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); padding: 20px 28px 0; flex-wrap: wrap; }
.crumb a { text-decoration: none; } .crumb a:hover { color: var(--navy-900); }
.crumb svg { width: 13px; height: 13px; } .crumb b { color: var(--navy-900); font-weight: 550; }
.head { display: flex; align-items: flex-start; gap: 18px; padding: 14px 28px 0; }
.hero { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(160deg, #eef3fa, #e2e9f3); border: 1px solid var(--border); display: grid; place-items: center; color: var(--navy-700); flex: none; }
.hero svg { width: 30px; height: 30px; stroke-width: 1.5; }
.title { flex: 1; min-width: 0; }
.title .r1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title h1 { font-size: 28px; font-weight: 650; letter-spacing: -.025em; }
.title .r2 { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.title .r2 span { display: inline-flex; align-items: center; gap: 5px; }
.title .r2 svg { width: 14px; height: 14px; color: var(--ink-3); }
.actions { display: flex; gap: 8px; padding-top: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tabsbar { display: flex; gap: 26px; padding: 0 28px; margin-top: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabsbar button { padding: 11px 0 12px; font-size: 13.5px; font-weight: 550; color: var(--ink-2); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabsbar button.on { color: var(--navy-900); border-color: var(--navy-900); }
.tabsbar button svg { width: 15px; height: 15px; }
.tabsbar .n { font-size: 10px; font-weight: 650; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-3); }
.dgrid { display: grid; grid-template-columns: minmax(0,1fr) 316px; gap: 18px; padding: 14px 28px 32px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; }
.side .card-h { padding: 13px 16px 10px; } .side .card-h h3 { font-size: 13px; }
.qr { display: flex; gap: 14px; align-items: center; padding: 4px 16px 16px; }
.qr .code { width: 112px; height: 112px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: #fff; flex: none; }
.qr .code svg { width: 100%; height: 100%; display: block; }
.qr b { font-size: 12.5px; font-weight: 600; display: block; }
.qr .mono { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.qr .btn { margin-top: 10px; }
.side .muted-row { padding: 2px 16px 14px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.rec { padding: 0 16px 14px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.rec b { color: var(--navy-900); font-weight: 600; }
.banner { margin-bottom: 14px; } .banner svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.banner.oos { background: var(--slate-bg); border: 1px solid var(--slate-line); color: var(--slate); }
.banner b { font-weight: 650; }
.notes { padding: 0 16px 16px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; white-space: pre-wrap; }

/* ---------- Users ---------- */
.utable { width: 100%; border-collapse: collapse; }
.utable th { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.utable td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.utable td:first-child, .utable th:first-child { padding-left: 16px; }
.utable .an span { font-size: 12px; }
.utable select { height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 12.5px; }
.utable tr.off td { color: var(--ink-3); }
.req-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.req-row .t { flex: 1; min-width: 180px; } .req-row .t b { display: block; font-size: 13px; } .req-row .t span { font-size: 12px; color: var(--ink-3); }
.req-row select { height: 32px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 8px; background: var(--surface); }

/* ---------- Settings ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.set-row .t { flex: 1; min-width: 160px; } .set-row .t b { display: block; font-size: 13px; font-weight: 600; } .set-row .t span { font-size: 12px; color: var(--ink-3); }
.set-row input[type=number] { width: 76px; height: 36px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 10px; background: var(--surface); text-align: right; }
.set-row input[type=text] { height: 36px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 10px; background: var(--surface); width: 140px; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.card-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------- Scan ---------- */
.scan-wrap { max-width: 560px; margin: 0 auto; padding: 8px 0 30px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.scan-wrap > * { min-width: 0; }
.scan-hero { padding: 20px; display: flex; gap: 16px; align-items: center; }
.scan-hero .ctile { width: 56px; height: 56px; border-radius: 16px; background: var(--navy-900); color: #fff; border: 0; }
.scan-hero .ctile svg { width: 28px; height: 28px; }
.scan-hero b { display: block; font-size: 17px; font-weight: 650; } .scan-hero span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.shop-in { display: flex; gap: 10px; padding: 0 16px 16px; }
.shop-in input { flex: 1 1 0; width: 0; min-width: 0; height: 56px; border: 1.5px solid var(--border-strong); border-radius: 14px; padding: 0 16px; font-size: 24px; font-weight: 650; letter-spacing: .18em; font-variant-numeric: tabular-nums; background: var(--surface); }
.shop-in .btn { flex: none; height: 56px; border-radius: 14px; padding: 0 20px; font-size: 15px; }
.hits .vrow { padding: 12px 16px; }
.cam { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; max-height: 60vh; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; }

/* ---------- More (phone) ---------- */
.more-list a, .more-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-top: 1px solid var(--border); background: none; text-decoration: none; font-size: 15px; font-weight: 550; text-align: left; color: var(--navy-900); }
.more-list a:first-child { border-top: 0; }
.more-list svg { color: var(--ink-3); }
.more-list .phase { margin-left: auto; }

/* ---------- Print (QR tag) ---------- */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: flex !important; flex-direction: column; align-items: center; gap: 8px; padding: 20px; font-family: var(--font); color: #000; }
  #print-area svg { width: 2in; height: 2in; }
  #print-area b { font-size: 20pt; } #print-area span { font-size: 10pt; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1240px) {
  .cols { grid-template-columns: minmax(0,1fr) 320px; }
  .legend { display: none; }
  .fleet .c-serial { display: none; }
  .fleet.cat-motor .c-serial { display: table-cell; } /* v107: Motors tab keeps Serial # */
  .fleet.cat-motor col.c-serial { display: table-column; }
}
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .dgrid { grid-template-columns: minmax(0, 1fr); }
  .side { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .set-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) and (min-width: 761px) {
  :root { --sidebar-w: 72px; }
  .sidebar { padding: 18px 10px 14px; }
  .brand { justify-content: center; padding: 2px 0 16px; } .brand > div { display: none; }
  .nav-label { display: none; }
  .nav a { justify-content: center; padding: 10px 0; font-size: 0; gap: 0; }
  .nav a svg { width: 20px; height: 20px; } .nav a .soon, .nav a .count { display: none; }
  .side-foot { justify-content: center; padding: 12px 0 0; } .side-foot .who-btn > div:not(.avatar), .side-foot > .ell { display: none; }
  .side-foot .menu { left: 0; right: auto; width: 240px; }
  .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .topbar .search { width: 200px; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .sidebar { display: none; }
  .appbar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); position: sticky; top: 0; z-index: 20; }
  .appbar img { width: 32px; height: 32px; object-fit: contain; }
  .appbar .ttl { flex: 1; min-width: 0; } .appbar .ttl b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .appbar .ttl span { display: block; font-size: 11.5px; color: var(--ink-3); }
  .appbar .menu { right: 12px; top: calc(56px + env(safe-area-inset-top)); position: fixed; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 8px 0 env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 550; color: var(--ink-3); text-decoration: none; }
  .tabbar a svg { width: 25px; height: 25px; stroke-width: 1.6; }
  .tabbar a.on { color: var(--navy-900); }
  .scroller { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  .topbar { padding: 6px 16px 14px; flex-wrap: wrap; }
  .topbar h1 { font-size: 22px; }
  .topbar .search, .topbar .tb-actions { display: none; }
  .content { padding: 0 14px 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .kpis .kpi:first-child { grid-column: 1 / -1; }
  .kpi .v { font-size: 28px; }
  .cat { grid-template-columns: 30px minmax(0,1fr); }
  .cat > :last-child { grid-column: 1 / -1; }
  .legend { display: none; }
  .card-h { flex-wrap: wrap; }
  .side { grid-template-columns: minmax(0, 1fr); }
  table.fleet { display: none; } .fleet-cards { display: block; }
  .fcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); text-decoration: none; }
  .fcard .t { flex: 1; min-width: 0; } .fcard .t b { display: block; font-size: 15px; font-weight: 650; }
  .fcard .t span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fcard .r { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
  .toolbar .search { width: 100%; order: -1; height: 42px; }
  .toolbar select { height: 38px; }
  .crumb { padding: 6px 16px 0; }
  .head { padding: 10px 16px 0; flex-wrap: wrap; gap: 12px; }
  .hero { width: 52px; height: 52px; border-radius: 14px; }
  .title h1 { font-size: 26px; }
  .actions { width: 100%; justify-content: stretch; } .actions .btn { flex: 1; height: 44px; }
  .tabsbar { padding: 0 16px; gap: 20px; }
  .dgrid { padding: 12px 14px 24px; }
  .kv { grid-template-columns: minmax(0, 1fr); } .kv > div:nth-child(odd) { border-right: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-bg { padding: calc(env(safe-area-inset-top) + 8px) 0 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: min(94vh, calc(100dvh - env(safe-area-inset-top) - 8px)); display: flex; flex-direction: column; }
  .modal-b { max-height: none; flex: 1; }
  .modal-f { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .utable thead { display: none; } .utable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .utable td { border: 0; padding: 4px 16px; } .utable td.c-seen { display: none; }
  .utable, .utable tbody { display: block; width: 100%; } .utable tr { width: 100%; grid-template-areas: "p s" "r a"; align-items: center; row-gap: 4px; } .utable td { min-width: 0; }
  .utable td:nth-child(1) { grid-area: p; } .utable td:nth-child(2) { grid-area: r; } .utable td:nth-child(3) { grid-area: s; justify-self: end; } .utable td.c-act { grid-area: a; justify-self: end; }
  .utable td:nth-child(2) select { width: 100%; max-width: 220px; }
  #toasts { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
}

/* ==========================================================
   Dark theme (Settings > Theme). Overrides the tokens.
   ========================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy-900: #e4ebf5; --navy-800: #c9d5e6; --navy-700: #9db7da;
  --ink-2: #a6b3c6; --ink-3: #7d8aa0; --ink-4: #4d5a70;
  --bg: #0b111c; --surface: #131b29; --surface-2: #172030; --border: #243145; --border-strong: #324159;
  --red: #ff6b7d; --red-bg: #33151d; --red-line: #5c2331;
  --amber: #f2a640; --amber-ink: #f6bc5f; --amber-bg: #2b200d; --amber-line: #5a4114;
  --green: #4fcf86; --green-bg: #10291c; --green-line: #1e4d33;
  --blue: #78a9ff; --blue-bg: #13213b; --blue-line: #233f6b;
  --slate: #aab4c3; --slate-bg: #1d2531; --slate-line: #334055;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3); --shadow-2: 0 4px 16px rgba(0,0,0,.35); --shadow-3: 0 24px 60px rgba(0,0,0,.55);
}
:root[data-theme="dark"] .surface-2-solid, :root[data-theme="dark"] .fleet th, :root[data-theme="dark"] .utable th { background: #172030; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .tabs button.on, :root[data-theme="dark"] .pill.navy { background: #2d5ea8; border-color: #2d5ea8; color: #fff; }
:root[data-theme="dark"] .btn.primary:hover:not(:disabled) { background: #3a6dba; }
:root[data-theme="dark"] .nav a.active { background: #22324a; color: #fff; }
:root[data-theme="dark"] .avatar { background: #2d5ea8; color: #fff; }
:root[data-theme="dark"] .seg { background: #0f1622; } :root[data-theme="dark"] .seg span.on { background: #243145; color: #fff; }
:root[data-theme="dark"] .tag.lafd { color: #c9d5e6; background: #1b2638; border-color: #2e3d55; }
:root[data-theme="dark"] .tag.fema { color: #9cc2f5; background: #14243a; border-color: #24406a; }
:root[data-theme="dark"] .tag.oes { color: #86d2c6; background: #10282a; border-color: #1f4a47; }
:root[data-theme="dark"] .tag.catf { color: #c2b2ef; background: #211b35; border-color: #3b305f; }
:root[data-theme="dark"] .hero { background: linear-gradient(160deg, #1b2638, #151f2e); }
:root[data-theme="dark"] .qr .code { background: #fff; }
:root[data-theme="dark"] .tabsbar button.on { color: #fff; border-color: #78a9ff; }
:root[data-theme="dark"] .tabbar a.on { color: #fff; }
:root[data-theme="dark"] .toast { background: #22324a; }
:root[data-theme="dark"] .gate .gcard { background: #131b29; }
:root[data-theme="dark"] .gbtn { background: #fff; }
:root[data-theme="dark"] .icon-btn .dot { border-color: var(--surface); }
:root[data-theme="dark"] .modal-bg { background: rgba(0,0,0,.6); }

/* ---------- Small utilities used by the view modules ---------- */
.tb-actions { display: flex; gap: 10px; align-items: center; }
.meta { font-size: 12px; color: var(--ink-3); }
.right { margin-left: auto; }
.mt { margin-top: 14px; }
.pad { padding: 0 16px 16px; }
.wide { width: 100%; }
.clip { overflow: hidden; }
.note { padding: 0 4px; margin: 4px 0 0; line-height: 1.5; }
.nav-top { padding-top: 4px; }
.side-foot > .ell { margin-left: auto; color: var(--ink-3); display: grid; }
.filter-note { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--amber-ink); background: var(--amber-bg); }
.phone-add { display: none; margin-top: 14px; width: 100%; }
.fcard .r2 { display: flex; gap: 4px; }
.vrow.solo { padding: 16px; border-top: 0; }
.utable .c-act { text-align: right; }
.confirm-txt { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.dgrid.one { grid-template-columns: minmax(0, 1fr); }
.soon-card.wide { max-width: none; margin: 0; padding: 22px; }
.appbar .avatar { border: 0; }
@media (max-width: 760px) {
  .phone-add { display: inline-flex; }
}

/* Inline pills inside name lines (override the block-level span rules) */
.an b .pill, .vrow .t b .pill { display: inline-flex; width: auto; margin: 0 0 0 6px; vertical-align: 1px; overflow: visible; }
.seg span { white-space: nowrap; }
@media (max-width: 960px) { .side-foot > .ell { display: none; } }
@media (max-width: 760px) { .env-badge { font-size: 9.5px; padding: 1px 8px 2px; } }

/* ---- Phone overflow guards (hotfix v6): nothing may push the page wider than the screen ----
   Grid/flex children default to min-width:auto, so an input's intrinsic width (or a long word) could widen a card past
   the viewport (Terry's Android, Scan tab). Clip at the document, let form controls shrink, wrap long words. */
html, body { max-width: 100%; overflow-x: hidden; }
input, select, textarea, button { max-width: 100%; }
img, video, canvas { max-width: 100%; }
.card, .banner, .vrow .t, .task .t, .modal-b { overflow-wrap: anywhere; }
/* Oct 9: grouped per-category fields on the unit Details tab */
.kv-h { padding: 14px 16px 6px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--navy-700, var(--ink-2)); }
.kv-h + .kv > div:nth-child(-n+2) { border-top: 0; }
@media (max-width: 640px) { .kv-h + .kv > div:nth-child(2) { border-top: 1px solid var(--border); } }
.form-grid > .banner { grid-column: 1 / -1; margin: 0; }
.link-note ul { margin: 4px 0 0 18px; padding: 0; } .link-note li { margin: 2px 0; }
/* Oct 9: QR-scan location (Last seen card, Location history, Fleet map) */
.ls { display: flex; align-items: center; gap: 12px; padding: 12px 16px 14px; }
.ls-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ls-t b { font-size: 15px; } .ls-t span { font-size: 12.5px; color: var(--ink-2); }
.ls.old .ls-t b { color: var(--ink-3); }
.lh-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--border); }
.lh-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lh-row .t span { font-size: 12px; color: var(--ink-3); }
.fmap-card { overflow: hidden; }
.fmap { height: calc(100vh - 230px); min-height: 360px; background: var(--surface-2, #eef1f5); }
.fmap-wrap { position: relative; }
/* Oct 13: collapsible legend overlaid bottom-left (Map/Satellite is top-left, zoom bottom-right, Google logo under it) */
.fmap-lg { position: absolute; left: 10px; bottom: 30px; z-index: 5; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; max-width: calc(100% - 80px); }
.fmap-lg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(14,22,38,.82); color: #fff; font: 600 13.5px/1 inherit; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: pointer; min-height: 40px; }
.fmap-lg-btn svg { width: 18px; height: 18px; }
.fmap-lg-btn.on { background: rgba(30,90,200,.9); }
.fmap-lg-btn .lg-n { font-style: normal; background: #00C853; color: #062; border-radius: 999px; padding: 2px 7px; font-size: 11.5px; }
.fmap-legend { display: flex; flex-direction: column; gap: 9px; padding: 12px 14px; font-size: 13px; color: #eef2f8; width: 300px; max-width: 100%; max-height: min(55vh, 420px); overflow-y: auto;
  background: rgba(14,22,38,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.fmap-legend[hidden] { display: none; }
.fmap-legend .meta { color: #b8c2d2; border-top: 1px solid rgba(255,255,255,.14); padding-top: 8px; }
@media (max-width: 760px) { .fmap { height: calc(100dvh - 330px); min-height: 300px; } .fmap-legend { width: 260px; max-height: 50vh; } }
/* Oct 9: Live mode */
#livebar { display: none; }
#livebar.on { display: flex; align-items: center; gap: 10px; position: fixed; z-index: 60; left: calc(var(--sidebar-w) + 16px + env(safe-area-inset-left)); right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  padding: 8px 10px 8px 14px; border-radius: 14px; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.22); }
#livebar.green { background: #157a43; } #livebar.amber { background: #b86e00; } #livebar.off { background: #4b5563; }
#livebar .lb-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; }
#livebar.green .lb-dot { animation: lbpulse 1.6s ease-out infinite; }
#livebar .lb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; background: none; border: 0; color: inherit; padding: 0; font: inherit; cursor: pointer; }
#livebar .lb-t b { font-size: 14px; } #livebar .lb-t span { font-size: 12px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#livebar .lb-stop { background: #fff; color: #111; border-color: transparent; flex: none; }
body.has-live #view { padding-bottom: 76px; }
@keyframes lbpulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.8); } 100% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }
@media (max-width: 760px) { #livebar.on { left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); } }
.dp-live { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; }
.dp-live .t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .dp-live .t span { font-size: 12.5px; color: var(--ink-3); }
.dp-live b.g { color: #157a43; }
/* Oct 31 2026: location refused / app reopened: lasting red Live bar + Deploy card with the Turn on button and steps. */
#livebar.red { background: #b42318; }
.dp-live.dp-off { display: block; border: 2px solid #d92d20; background: #fef3f2; }
.dp-off .lo-row { display: flex; align-items: center; gap: 12px; }
.dp-off b.r { color: #b42318; font-size: 15px; } .dp-off .t span { color: #3f3f46; font-size: 13.5px; }
.lo-help { margin-top: 10px; font-size: 13.5px; } .lo-help summary { cursor: pointer; font-weight: 600; }
.lo-steps { margin: 8px 0 0; padding-left: 20px; line-height: 1.45; } .lo-steps li { margin: 4px 0; }
:root[data-theme="dark"] .dp-live.dp-off { background: #3a1210;  } :root[data-theme="dark"] .dp-off .t span { color: #f4d4d0;  } :root[data-theme="dark"] .dp-off b.r { color: #ff8a80; }
/* Live pin (Oct 12): DOM overlay; ring is a separate span animated with transform+opacity (GPU, no clipping). */
.lpw { position: absolute; width: 24px; height: 24px; transform: translate(-50%, -50%); cursor: pointer; line-height: 0; }
.lpw svg { position: relative; display: block; }
.lp { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,200,83,.55); pointer-events: none; animation: lppulse 1.8s ease-out infinite; will-change: transform, opacity; }
.lp::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid rgba(0,200,83,.9); }
.lp.late { display: none; } /* Oct 13: no amber; a quiet live rig stays green without the pulse */
@keyframes lppulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .lp { animation: none; transform: scale(1.7); opacity: .5; }
}
/* Google InfoWindow: force dark-on-white (app theme colors were inheriting) */
.gm-style .gm-style-iw-c { background: #fff !important; color: #111 !important; padding: 12px 12px 14px !important; border-radius: 12px !important; }
.gm-style .gm-style-iw-d { overflow: auto !important; color: #111 !important; }
.gm-style .gm-style-iw-tc::after { background: #fff !important; }
.gm-style .gm-style-iw-chr { min-height: 0; }
.gm-style button.gm-ui-hover-effect { width: 40px !important; height: 40px !important; opacity: 1 !important; background: #e8ecf2 !important; border-radius: 50% !important; position: absolute !important; top: 6px !important; right: 6px !important; z-index: 2; }
.gm-style button.gm-ui-hover-effect > span { width: 24px !important; height: 24px !important; margin: 8px !important; background-color: #111 !important; }
.lpop { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #222; min-width: 200px; padding-right: 40px; }
.lpop .lp-h { display: flex; flex-direction: column; } .lpop b { font-size: 18px; color: #0b1a33; }
.lpop .lp-live { color: #138a3c; font-style: normal; font-weight: 700; font-size: 13px; }
.lpop .late { color: #a35f00; font-style: normal; font-weight: 700; font-size: 13px; }
.lpop .lp-spd { font-size: 36px; font-weight: 800; color: #0b1a33; line-height: 1.1; margin: 4px 0; }
.lpop .lp-spd small { font-size: 16px; font-weight: 600; color: #444; } .lpop .lp-spd em { font-style: normal; font-size: 20px; margin-left: 10px; color: #1a5fd0; }
.lpop .lp-na { font-size: 15px; font-weight: 600; color: #555; }
.lpop .lp-btn { display: block; margin-top: 8px; margin-right: -40px; text-align: center; background: #1a5fd0; color: #fff !important; font-weight: 700; font-size: 15px; padding: 10px; border-radius: 8px; text-decoration: none; }
.modal.lg { width: min(900px, calc(100vw - 32px)); max-width: none; }
.routemap { height: min(60vh, 520px); border-radius: 10px; overflow: hidden; }
body.has-live #toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (max-width: 760px) { body.has-live #toasts { bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom)); } }
/* Deploy: my active deployments switcher (Oct 9 2026) */
.dp-switch{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 10px}
/* Oct 31 2026: theme tokens (the old --card / --line / --navy vars were never defined, so the chips stayed white
   with the dark theme's light text = unreadable). */
.dp-switch .chipbtn{padding:6px 12px;border-radius:999px;border:1px solid var(--border-strong);background:var(--surface);color:var(--navy-900);text-decoration:none;font-size:13px;font-weight:600}
.dp-switch .chipbtn.on{background:#14284b;border-color:#14284b;color:#fff}
:root[data-theme="dark"] .dp-switch .chipbtn.on{background:#2d5ea8;border-color:#2d5ea8;color:#fff}
:root[data-theme="dark"][data-skin] .dp-switch .chipbtn.on{background:var(--sk-accent);border-color:var(--sk-accent);color:var(--sk-on-accent)}
.dp-switch .right{margin-left:auto}
/* Users: Delete next to Disable (Oct 10 2026) */
.act-row{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}
.btn.danger-txt{color:var(--red,#b42318)}
/* Main unit photo + crop step (Oct 10 2026) */
.has-ph { overflow: hidden; padding: 0; }
.has-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an .ctile.has-ph, .vrow .ctile.has-ph { width: 50px; } .fcard .ctile.has-ph { width: 72px; }
.dp-title { display: flex; align-items: center; gap: 10px; } .dp-ph { width: 64px; height: 36px; border-radius: 8px; flex: none; background: var(--border); display: grid; place-items: center; }
.uph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .uph-t { width: 96px; height: 54px; border-radius: 8px; background: var(--border); display: grid; place-items: center; flex: none; }
.crop-bg { z-index: 1200; }
.crop-wrap { display: grid; grid-template-columns: 1fr 180px; gap: 16px; align-items: start; }
.crop-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #111; border-radius: 10px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.crop-frame:active { cursor: grabbing; } .crop-frame canvas { width: 100%; height: 100%; display: block; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; border: 2px solid rgba(255,255,255,.85); border-radius: 10px;
  background: linear-gradient(90deg, transparent 33%, rgba(255,255,255,.35) 33.3%, transparent 33.6%, transparent 66.4%, rgba(255,255,255,.35) 66.6%, transparent 67%),
    linear-gradient(transparent 33%, rgba(255,255,255,.35) 33.3%, transparent 33.6%, transparent 66.4%, rgba(255,255,255,.35) 66.6%, transparent 67%); }
.crop-thumb { width: 160px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); margin: 6px 0 10px; } .crop-thumb canvas { width: 100%; height: 100%; display: block; }
.crop-side input[type=range] { width: 100%; }
@media (max-width: 640px) { .crop-wrap { grid-template-columns: 1fr; } }
/* v30: header shows the full 16:9 crop (never cropped further); blurred copy fills the rest of the band */
.u-cover { position: relative; display: flex; justify-content: center; width: 100%; border: 0; padding: 0; margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: #0b1f3a; cursor: zoom-in; }
.u-cover-bg { position: absolute; inset: -24px; } .u-cover-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.55); transform: scale(1.1); }
.u-cover-img { position: relative; display: block; aspect-ratio: 16/9; width: min(100%, 880px, calc(45vh * 16 / 9)); }
.u-cover-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.head .hero.has-ph { width: 96px; height: 54px; border-radius: 10px; } .fcard .ctile.has-ph { width: 72px; height: 40.5px; }
.an .ctile.has-ph, .vrow .ctile.has-ph { width: 50px; height: 28px; } .dp-ph { width: 64px; height: 36px; }
@media (max-width: 700px) { .u-cover { border-radius: 12px; } .u-cover-img { width: 100%; } .head .hero.has-ph { width: 80px; height: 45px; } }
/* Manual unit location (Oct 10 2026) */
.fmap-tools { padding: 0 0 10px; display: flex; justify-content: flex-end; }
.ls-set { margin-top: 10px; }
.ml-search { display: flex; gap: 8px; flex-wrap: wrap; } .ml-search input { flex: 1 1 220px; min-width: 0; }
.ml-res { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; max-height: 120px; overflow: auto; }
.ml-hit { text-align: left; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; display: flex; gap: 6px; align-items: center; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.ml-map { height: min(46vh, 380px); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin: 6px 0; }
.ml-pin { display: block; width: 28px; height: 28px; background: #b01e1e; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.form-err-inline { color: var(--red, #b01e1e); font-size: 12px; }
/* Google Maps (Oct 10 2026) */
.map-off { display: grid; place-content: center; height: 100%; min-height: 200px; text-align: center; }
.fmap-legend .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px #111418; box-sizing: border-box; }
.fmap-legend .dot.hollow { background: #fff; box-shadow: 0 0 0 1px #111418, inset 0 0 0 3px var(--c); }
.gpin { display: block; line-height: 0; cursor: pointer; } .gpin svg { display: block; }
.gpin.drop { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #E0001B; border: 3px solid #fff; box-shadow: 0 0 0 1px #111418, 0 2px 6px rgba(0,0,0,.35); }
/* v49 (Terry): sign-in / gate card as navy glass panel matching the splash; app-blue button, no Google branding. */
.gate .gcard, :root[data-theme="dark"] .gate .gcard { background: rgba(14, 37, 70, .55); color: #fff; border: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(0,0,0,.35); padding: 24px 22px 20px; }
.gate .gcard h2 { color: #fff; font-size: 26px; }
.gate .gcard .lead { color: rgba(214,226,243,.85); }
.gate .gbtn, :root[data-theme="dark"] .gate .gbtn { margin-top: 18px; min-height: 60px; height: auto; border-radius: 18px; border: 0; background: #1d5fd1; color: #fff; font-size: 19px; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.gate .gbtn:hover { background: #1a54ba; } .gate .gbtn .g1 { width: 24px; height: 24px; color: #fff; flex: none; }
.gate .gbtn.dark, :root[data-theme="dark"] .gate .gbtn.dark { background: #1d5fd1; }
.gate .domain { background: transparent; border: 0; padding: 0; margin-top: 14px; color: rgba(214,226,243,.7); font-size: 13.5px; }
.gate .domain svg { color: rgba(214,226,243,.7); } .gate .domain b { color: rgba(255,255,255,.9); }
.gate .fine { color: rgba(214,226,243,.6); } .gate .fine a, .gate .linkbtn { color: #9cc0ff; }
.gate .who { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; } .gate .who span { color: rgba(214,226,243,.75); }
.gate .who .avatar { background: rgba(255,255,255,.18); color: #fff; }
.gate .row2 .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); min-height: 56px; border-radius: 16px; font-size: 16px; }
.gate .row2 .btn.primary { background: #1d5fd1; border-color: #1d5fd1; }
.gate .gerr { background: rgba(185,28,28,.25); border-color: rgba(248,113,113,.5); color: #fecaca; }
@media (max-height: 900px) and (max-width: 699px) { .gate .gfoot { margin-top: 12px; } }
/* Oct 13: last known live position (sharing ended) */
.lpop .lp-lk { color: #4a4f57; font-style: normal; font-weight: 700; font-size: 13px; }
.fmap-legend .dot.lk { box-shadow: 0 0 0 2px #111418, 0 0 0 3px #fff; }
.gpin.lk { filter: drop-shadow(0 0 0 #111418); opacity: .95; }
/* Oct 13: Tracking history */
.trk-f { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.trk-f label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.trk-u .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px #111418; margin-right: 6px; vertical-align: middle; }
/* Oct 13: Tires diagram. Oct 14: restyled (light stage, white line-art truck / trailer, glowing wheels, navy pills, (v100: per-tire cards removed)) */
.tires-b { padding: 4px 16px 14px; }
.tmock { container-type: inline-size; }
.tmock-in { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tstage { position: relative; background: linear-gradient(180deg, #e6edf6 0%, #d3deec 100%); border: 1px solid #bccbdd; border-radius: 16px; padding: 12px 10px 10px; color: #14284b; }
.tstage-h { text-align: center; font: 800 13px system-ui, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: #14284b; margin: 2px 0 4px; }
.tdiag { display: block; width: 100%; max-width: 460px; margin: 0 auto; height: auto; overflow: visible; }
.tdiag .tl { fill: url(#tgl); stroke: #6b7f99; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tdiag .tl2 { fill: none; stroke: #9db0c8; stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.tdiag .tl3 { fill: none; stroke: #b3c2d6; stroke-width: 1; stroke-linecap: round; }
.tdiag .tg { fill: #dbe8f6; stroke: #6b7f99; stroke-width: 1.5; stroke-linejoin: round; }
.tdiag .tax { stroke: #aebdd1; stroke-width: 7; stroke-linecap: round; }
.tdiag .tshd { fill: #8da2bd; opacity: .22; }
.tdiag .tpl rect { fill: #14284b; }
.tdiag .tpl text { font: 700 11.6px system-ui, sans-serif; fill: #fff; text-anchor: middle; letter-spacing: .02em; }
.tdiag .tspot { cursor: pointer; outline: none; }
.tdiag .tg1 { fill-opacity: .17; stroke-opacity: .55; stroke-width: 1.6; }
.tdiag .tg2 { fill: none; stroke-opacity: .35; stroke-width: 1.2; }
.tdiag .tt { fill: #263342; stroke: #0f1822; stroke-width: 1.6; }
.tdiag .tts { fill: #3b4b5f; stroke: none; }
.tdiag .ttr { stroke: #5a6c82; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.tdiag .tspot.tsp .tts { stroke: #55677e; stroke-width: 6; fill: none; }
.tdiag .thub { fill: #8fa2ba; stroke: #0f1822; stroke-width: 1.4; } .tdiag .thub2 { fill: #263342; }
.tdiag .tdot { stroke: #fff; stroke-width: 2.4; }
.tdiag .tyr { font: 800 12px system-ui, sans-serif; fill: #14284b; text-anchor: middle; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; }
.tdiag .tspot.empty .tyr { font-size: 20px; fill: #6b7f99; }
.tdiag .tspot:hover .tg1, .tdiag .tspot:focus .tg1 { fill-opacity: .32; stroke-opacity: 1; stroke-width: 2.6; }
.tdiag .tspot:focus-visible .tg2 { stroke-opacity: 1; stroke-width: 2.4; stroke: #1e5ac8; }
.tdiag .tsh { fill: #5d7394; opacity: .32; filter: url(#tblur); transform: translate(4px, 7px); }
.tdiag .ttf { fill: url(#tgl); } .tdiag .ttl { fill: #5f7391; }
.tdiag .tlead { stroke: #7f93ad; stroke-width: 1.4; stroke-dasharray: 2 3; }
.tdiag .tpl2 text { font-size: 11.5px; } .tdiag .tpl2 .tpl-s { font-size: 9px; font-weight: 600; letter-spacing: .08em; fill: #b9c8e0; }
.tdiag-rig .tspot.empty .tyr { font-size: 17px; }
.tleg { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; margin: 8px 0 2px; color: #14284b; }
.tleg i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: -1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.tsum { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; border-left: 5px solid #1e9e4a; background: var(--surface-2, #eef1f5); }
.tsum.soon { border-color: #f2a900; } .tsum.overdue { border-color: #d83a3a; }
.mm .tires-card { margin: 12px 0; }
/* Oct 13: sheet form (comms boxes / radios); was shared with the Tires card, removed Oct 19 (v99) */
.tform label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-weight: 600; font-size: 13.5px; }
.tform label.toggle { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; }
.tform .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tform small { font-weight: 500; font-size: 12px; }
.tform .t-made { color: #1e7a3c; font-weight: 700; font-size: 13px; } .tform .t-made.bad { color: #a35f00; }
/* Oct 13: Comms boxes + kit inventory rows */
.kits-b { padding: 4px 16px 14px; }
.kbox { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.kbox-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2, #eef1f5); flex-wrap: wrap; }
.kbox-h svg { width: 18px; height: 18px; } .kbox-h .right { margin-left: auto; }
.krow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); min-height: 44px; cursor: pointer; }
.krow small { display: block; color: var(--muted, #667085); font-size: 12.5px; }
.kdup { color: #b42318; font-weight: 700; }
.khits { padding: 10px 16px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--border); }
.mh-khits { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.khit { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #eef4ff; color: inherit; text-decoration: none; min-height: 44px; }
.khit svg { width: 22px; height: 22px; flex: none; } .khit small { display: block; color: var(--muted, #667085); }
.ic-grp { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 14px 0 4px; padding: 8px 10px; border-radius: 10px; background: #e8eefb; color: #0b1f3a; }
.ic-grp b { display: inline-flex; align-items: center; gap: 6px; } .ic-grp svg { width: 18px; height: 18px; }
.ic-grp small { color: #475467; } .ic-grp .linkbtn { margin-left: auto; }
.ic-r.sub, .iv.sub, .m9-i.sub { margin-left: 26px; }
.ic-tri { display: flex; gap: 4px; flex: none; }
.ic-tri button { min-height: 40px; min-width: 44px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font: 600 12.5px inherit; color: #344054; }
.ic-tri button.on.ok { background: #1e9e4a; color: #fff; border-color: #1e9e4a; }
.ic-tri button.on.miss, .ic-tri button.on.dmg { background: #f2a900; color: #1f1300; border-color: #d99400; }
.ic-r.kit { flex-wrap: wrap; }

/* Oct 13: Users readability: filter chips, role badges, status pills, clickable rows, sticky header, detail page. */
.ufilt { display: flex; flex-wrap: wrap; gap: 6px; }
.ufilt .uf { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ufilt .uf i { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); }
.ufilt .uf.on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; } .ufilt .uf.on i { background: rgba(255,255,255,.2); color: #fff; }
:root[data-theme="dark"] .ufilt .uf.on { background: #2d5ea8; border-color: #2d5ea8; }
.rbadge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.rbadge.r-site { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; } .rbadge.r-prog { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.rbadge.r-tech { background: #ffedd5; color: #9a3412; border-color: #fed7aa; } .rbadge.r-mem { background: var(--surface-2); color: var(--ink-2); border-color: var(--border); }
:root[data-theme="dark"] .rbadge.r-site { background: #3b1d5c; color: #e9d5ff; border-color: #5b2d8a; } :root[data-theme="dark"] .rbadge.r-prog { background: #172d54; color: #bfdbfe; border-color: #24467f; }
:root[data-theme="dark"] .rbadge.r-tech { background: #4a2410; color: #fed7aa; border-color: #6e3818; }
.spill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.spill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.spill.s-on { background: var(--green-bg, #dcfce7); color: var(--green, #15803d); } .spill.s-inv { background: var(--amber-bg); color: var(--amber-ink); } .spill.s-off { background: var(--surface-2); color: var(--ink-3); }
.utable-wrap { max-height: calc(100vh - 230px); overflow: auto; }
.utable thead th { position: sticky; top: 0; z-index: 1; padding: 11px 12px; font-size: 11px; }
.utable tbody td { padding: 13px 12px; }
.utable tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.utable tr.urow { cursor: pointer; } .utable tr.urow:hover td { background: var(--surface-2); }
.utable tr.urow:focus-visible { outline: 2px solid var(--navy-700, #2d5ea8); outline-offset: -2px; }
.utable .an b { font-size: 14px; } .utable .c-email { color: var(--ink-2); font-size: 12.5px; } .utable tr.off .rbadge { opacity: .6; }
.utable .c-go { width: 28px; text-align: right; color: var(--ink-3); font-size: 20px; padding-right: 16px; }
.udetail .uv { margin-left: auto; text-align: right; } .udetail .uv select { height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.udetail .ulink { color: inherit; text-decoration: none; } .udetail .ulink:hover { background: var(--surface-2); }
.udetail .uacts { flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .utable-wrap { max-height: none; overflow: visible; }
  .utable tr.urow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "p s" "e e" "r g"; }
  .utable td:nth-child(1) { grid-area: p; } .utable td.c-email { grid-area: e; display: block; padding-top: 0; } .utable td:nth-child(3) { grid-area: r; } .utable td:nth-child(4) { grid-area: s; justify-self: end; } .utable td.c-go { grid-area: g; justify-self: end; }
  .utable tbody tr:nth-child(even) td { background: none; }
}
#ausers .ufilt { margin: 10px 0 2px; }
.tag.prog-x { position: relative; overflow: visible; margin: 6px 8px 0 0; }
.tag-x { position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; border: 2px solid var(--surface, #fff); border-radius: 50%; background: var(--red, #E0001B); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; padding: 0; display: grid; place-items: center; cursor: pointer; z-index: 1; }
.tag-x::after { content: ''; position: absolute; inset: -12px; } /* ~42 px tap target */
.tag-x:hover, .tag-x:focus-visible { background: #a80014; outline: none; }

/* ==========================================================
   Oct 13: device-only skins (Engine Red, Swiftwater, Station House, Custom) layered on the dark theme.
   Colours come from --sk-* set by applyTheme(); status colours (green / amber / red) stay the dark-theme ones.
   ========================================================== */
:root[data-theme="dark"][data-skin] {
  --bg: var(--sk-bg); --surface: var(--sk-surface); --surface-2: var(--sk-surface-2); --border: var(--sk-border); --border-strong: color-mix(in srgb, var(--sk-border) 70%, var(--sk-text));
  --navy-900: var(--sk-text); --navy-800: color-mix(in srgb, var(--sk-text) 85%, var(--sk-bg)); --navy-700: var(--sk-accent-text);
  --ink-2: color-mix(in srgb, var(--sk-text) 78%, var(--sk-bg)); --ink-3: color-mix(in srgb, var(--sk-text) 62%, var(--sk-bg)); --ink-4: color-mix(in srgb, var(--sk-text) 35%, var(--sk-bg));
  color: var(--sk-text);
}
:root[data-skin="engine"] { --border: #A7B1BC55; --border-strong: #A7B1BC; }
:root[data-theme="dark"][data-skin] body { background: var(--sk-bg); color: var(--sk-text); }
:root[data-theme="dark"][data-skin] .btn.primary, :root[data-theme="dark"][data-skin] .tabs button.on, :root[data-theme="dark"][data-skin] .pill.navy,
:root[data-theme="dark"][data-skin] .ufilt .uf.on { background: var(--sk-accent); border-color: var(--sk-accent); color: var(--sk-on-accent); }
:root[data-theme="dark"][data-skin] .btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--sk-accent) 85%, #000); }
:root[data-theme="dark"][data-skin] .avatar { background: var(--sk-accent); color: var(--sk-on-accent); }
:root[data-theme="dark"][data-skin] .nav a.active { background: var(--sk-head); color: var(--sk-on-head); }
:root[data-theme="dark"][data-skin] .seg span.on { background: var(--sk-accent); color: var(--sk-on-accent); }
:root[data-theme="dark"][data-skin] .topbar { background: var(--sk-head); color: var(--sk-on-head); margin: 0 0 4px; padding-left: 20px; padding-right: 20px; border-radius: 0 0 12px 12px; }
:root[data-theme="dark"][data-skin] .topbar .sub { color: color-mix(in srgb, var(--sk-on-head) 75%, transparent); }
:root[data-theme="dark"][data-skin] .card-h h3 { color: var(--sk-text); } :root[data-theme="dark"][data-skin] .card-h { border-bottom-color: var(--sk-border); box-shadow: inset 3px 0 0 var(--sk-accent); }
:root[data-theme="dark"][data-skin] a.link, :root[data-theme="dark"][data-skin] .linkbtn, :root[data-theme="dark"][data-skin] .tabsbar button.on { color: var(--sk-accent-text); border-color: var(--sk-accent-text); }
:root[data-theme="dark"][data-skin] .mh-btn.pri, :root[data-theme="dark"][data-skin] .ap-btn.pri, :root[data-theme="dark"][data-skin] .mh-scan { background: var(--sk-accent); color: var(--sk-on-accent); border-color: var(--sk-accent); }
:root[data-theme="dark"][data-skin] .fleet th, :root[data-theme="dark"][data-skin] .utable th, :root[data-theme="dark"][data-skin] .surface-2-solid { background: var(--sk-surface-2); }
/* Theme picker */
.thgrid { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; justify-content: flex-end; }
.thtile { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 82px; padding: 6px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 11px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.thtile.on { border-color: var(--navy-700); color: var(--navy-900); }
.thtile .sw { width: 100%; height: 34px; border-radius: 6px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #0003; }
.thtile .sw i { display: block; } .thtile .sw i:first-child { grid-row: span 2; }
.thcustom .crow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.thcustom input[type=color] { width: 54px; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; background: none; padding: 2px; }
.thprev { margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid #0004; }
.thprev .h { padding: 10px 12px; font-weight: 700; } .thprev .b { padding: 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.thprev .bt { padding: 6px 12px; border-radius: 8px; font-weight: 650; font-size: 13px; }
@media (max-width: 760px) { .thgrid { margin-left: 0; justify-content: flex-start; } .thtile { width: calc(33% - 6px); } }
.lpop .lp-oos { color: #b0001a; } .lpop .lp-oos b { font-weight: 800; }
/* v100 (Oct 19): tire condition sheet (tap a tire on the picture) */
.tc-now { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border-left: 5px solid #1e9e4a; background: #eef8f1; margin-bottom: 12px; }
.tc-now b { font-size: 16px; } .tc-now span { font-size: 14px; } .tc-now small { font-size: 12.5px; color: var(--ink-3); }
.tc-now.low, .tc-now.other { border-color: #f2a900; background: #fff6dd; } .tc-now.worn { border-color: #d83a3a; background: #fdecec; }
.tc-os { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tc-o { min-height: 52px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--navy-900); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.tc-o.ok.on { background: #15803d; border-color: #15803d; color: #fff; } .tc-o.low.on { background: #b45309; border-color: #b45309; color: #fff; } .tc-o.worn.on { background: #b91c1c; border-color: #b91c1c; color: #fff; }
:root[data-theme="dark"] .tc-now { background: #10261a; } :root[data-theme="dark"] .tc-now.low, :root[data-theme="dark"] .tc-now.other { background: #2e2306; } :root[data-theme="dark"] .tc-now.worn { background: #3b0d0d; }
.tdiag .tspot.soon .tyr, .tdiag .tspot.overdue .tyr { font-size: 12px; }
.tc-f { display: grid; grid-template-columns: 120px 1fr; gap: 10px; margin-bottom: 8px; } .tc-f label small { font-weight: 500; color: var(--ink-3); }

/* ==========================================================
   Oct 29 2026 (Terry): one style for every sidebar item: [colour square + white icon] Label [badge] on one row,
   light row tint, slightly bolder label; active = solid navy row (dark: #22324a / skin head) + tone bar on the left.
   Tones: Dashboard slate, the four main functions their own colours, Tracking items steel, Admin items maroon.
   NB the item class is .ni, NOT .main: .main is the page-content column (display:flex; flex-direction:column), and
   reusing it on the links stacked the icon above the label (fixed Oct 29).
   ========================================================== */
.nav a.ni { --tone: #3b4f6b; font-size: 14px; font-weight: 600; color: var(--navy-900); padding: 6px 10px;
  background: color-mix(in srgb, var(--tone) 7%, var(--surface)); flex-direction: row; flex-wrap: nowrap; }
.nav a.ni.t-dash { --tone: #3b4f6b; }    /* slate navy */
.nav a.ni.t-fleet { --tone: #2d5ea8; }   /* blue */
.nav a.ni.t-maint { --tone: #0f766e; }   /* teal */
.nav a.ni.t-inv { --tone: #6b4fa0; }     /* violet */
.nav a.ni.t-deploy { --tone: #a15c07; }  /* LAFD gold, darkened */
.nav a.ni.t-trk { --tone: #46627f; }     /* Tracking: steel */
.nav a.ni.t-adm { --tone: #8a1c2b; }     /* Admin: LAFD maroon */
.nav a.ni .nchip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--tone); flex: none; font-style: normal; }
.nav a.ni .nchip svg { width: 15px; height: 15px; color: #fff; }
.nav a.ni .nlbl { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a.ni .count, .nav a.ni .soon { margin-left: 0; flex: none; }
.nav a.ni:not(.active):hover { background: color-mix(in srgb, var(--tone) 15%, var(--surface)); }
.nav a.ni.active { background: var(--navy-900); color: #fff; box-shadow: inset 4px 0 0 var(--tone); }
.nav a.ni.active .nchip { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.nav a.ni + a.ni { margin-top: 2px; }
:root[data-theme="dark"] .nav a.ni.t-dash { --tone: #4f6688; }
:root[data-theme="dark"] .nav a.ni.t-trk { --tone: #557595; }
:root[data-theme="dark"] .nav a.ni.t-adm { --tone: #a3283a; }
:root[data-theme="dark"] .nav a.ni { background: color-mix(in srgb, var(--tone) 14%, var(--surface)); color: var(--navy-900); }
:root[data-theme="dark"] .nav a.ni:not(.active):hover { background: color-mix(in srgb, var(--tone) 24%, var(--surface)); }
:root[data-theme="dark"] .nav a.ni.active { background: #22324a; color: #fff; box-shadow: inset 4px 0 0 color-mix(in srgb, var(--tone) 55%, #fff); }
:root[data-theme="dark"][data-skin] .nav a.ni.active { background: var(--sk-head); color: var(--sk-on-head); }
@media (max-width: 960px) and (min-width: 761px) { /* collapsed 72px sidebar: icon squares only, tint kept */
  .nav a.ni { padding: 7px 0; font-size: 0; gap: 0; justify-content: center; }
  .nav a.ni .nlbl { display: none; }
  .nav a.ni .nchip { width: 30px; height: 30px; } .nav a.ni .nchip svg { width: 18px; height: 18px; }
  .nav a.ni.active { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--tone) 55%, #fff); }
}

/* Section headings for the secondary groups (Program Admin+): Tracking = steel, Admin = maroon, with a rule line. */
.nav-label.g-trk { --grp: #46627f; } .nav-label.g-adm { --grp: #8a1c2b; }
.nav-label.g-trk, .nav-label.g-adm { color: var(--grp); font-weight: 700; display: flex; align-items: center; gap: 8px; padding-top: 18px; }
.nav-label.g-trk::after, .nav-label.g-adm::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--grp) 30%, transparent); }
:root[data-theme="dark"] .nav-label.g-trk { --grp: #9fb6cf; }
:root[data-theme="dark"] .nav-label.g-adm { --grp: #f0909b; }
@media (max-width: 960px) and (min-width: 761px) { /* collapsed: headings become thin group-coloured rules */
  .nav-label.g-trk, .nav-label.g-adm { display: block; font-size: 0; padding: 0; height: 2px; margin: 10px 14px 6px; border-radius: 2px; background: color-mix(in srgb, var(--grp) 55%, transparent); }
  .nav-label.g-trk::after, .nav-label.g-adm::after { display: none; }
}
/* Oct 29 2026: Fleet map lead pin lists the units deployed with it. */
.lpop .lp-with { margin-top: 4px; padding-top: 6px; border-top: 1px solid #d5d9e0; }
.lpop .lp-with i { font-style: normal; font-weight: 700; font-size: 13px; color: #4a4f57; }
.lpop .lp-with ul { margin: 2px 0 0; padding: 0 0 0 16px; max-height: 180px; overflow: auto; }
.lpop .lp-with li { font-size: 13px; line-height: 1.35; color: #222; } .lpop .lp-with li b { font-size: 13px; color: #0b1a33; }

/* Oct 29 2026 (Terry): every table / list gets rows on a contrasting surface (zebra + clear separators) and larger row text,
   light and dark (row tokens --tbl-well / --row-* are in inv.css). iPad / desktop only so the phone layouts stay as they are. */
@media (min-width: 761px) {
  :is(:root, :root[data-theme]) :is(.fleet, .utable, .rp-t, .ll-tbl, .lyed-tbl) thead th,
  :is(:root, :root[data-theme]) :is(.fleet, .utable, .rp-t, .ll-tbl, .lyed-tbl) tr > th { background: var(--tbl-well); border-bottom: 1px solid var(--row-line); color: var(--ink-2); font-size: 11px; }
  :is(.fleet, .utable, .rp-t, .ll-tbl, .lyed-tbl) tbody td, .lyed-tbl td { background: var(--row-bg); border-bottom: 1px solid var(--row-line); }
  :is(.fleet, .utable, .rp-t, .ll-tbl, .lyed-tbl) tbody tr:nth-child(even) td { background: var(--row-alt); }
  .fleet tbody tr:hover td, .utable tbody tr:hover td { background: var(--row-hover); }
  .fleet td { font-size: 13.5px; } .fleet .an b, .utable .an b { font-size: 14px; } .utable td { font-size: 13.5px; }
  /* Row lists in cards (maintenance tasks, history, lists of units, settings rows) */
  :is(.vrow, .task, .trow, .sitem, .hrow, .lh-row, .req-row, .ck) { border-top-color: var(--row-line); }
  .vrow:nth-child(even of .vrow), .task:nth-child(even of .task), .sitem:nth-child(even of .sitem), .hrow:nth-child(even of .hrow), .lh-row:nth-child(even of .lh-row), .req-row:nth-child(even of .req-row) { background: var(--row-alt); }
  .vrow:hover, .task:hover { background: var(--row-hover); }
  .vrow .t b, .task .t b { font-size: 14px; }
}

/* ---- Oct 29 2026: Users > Email users / Bulk invite / Sent emails, in-app banner ---- */
.usel { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 4px -4px -6px; cursor: pointer; flex: none; }
.usel input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.utable th .an { display: flex; align-items: center; gap: 6px; }
.selbar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--blue-line); box-shadow: var(--shadow-3, 0 8px 24px rgba(11,31,58,.18)); }
.selbar b { font-size: 14px; }
.mlist .mrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mlist .mrow:hover { background: var(--surface-2); }
.mlist .mi { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue-bg); color: var(--blue); flex: none; }
.mlist .mi svg { width: 18px; height: 18px; }
.mlist .t { flex: 1; min-width: 0; } .mlist .t b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlist .t span { display: block; font-size: 12.5px; color: var(--ink-3); }
.mlist .ms { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mlist.ph { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; } .mlist.ph .mrow:first-child { border-top: 0; }
.mlist.ph .mrow { flex-wrap: wrap; padding: 12px 14px; } .mlist.ph .ms { width: 100%; justify-content: flex-start; padding-left: 46px; } .mlist.ph .c-go { display: none; }
.mtag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.mtag.gray { background: var(--surface-2); color: var(--ink-2); border-color: var(--border); }
.mtag.blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.mtag.green { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.mtag.amber { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-line); }
.mtag.red { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.mtag.violet { background: rgba(109,40,217,.1); color: #6d28d9; border-color: rgba(109,40,217,.28); }
:root[data-theme="dark"] .mtag.violet { color: #c4b5fd; background: rgba(167,139,250,.14); border-color: rgba(167,139,250,.35); }
.mcomp { display: grid; gap: 14px; }
.mcomp textarea, .mbulk textarea { width: 100%; resize: vertical; min-height: 160px; font: inherit; font-size: 15px; line-height: 1.5; }
.mcomp details { display: inline; } .mcomp summary { display: inline; cursor: pointer; color: var(--blue); font-weight: 600; }
.mnames { margin-top: 6px; max-height: 120px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--ink-2); }
.mdeliv { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.mdeliv legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.mdeliv label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; } .mdeliv input:disabled + * , .mdeliv label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.mdeliv .mban { display: inline-flex; align-items: center; gap: 6px; } .mdeliv .mban[hidden] { display: none; } .mdeliv .hint { width: 100%; font-size: 11.5px; color: var(--ink-3); }
.mconfirm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-ink); font-size: 14px; }
.mconfirm svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.mdet { display: grid; gap: 12px; } .mdet .mhead b { display: block; font-size: 17px; } .mdet .mhead span { font-size: 12.5px; color: var(--ink-3); }
.mprog { display: grid; gap: 6px; font-size: 13px; } .mprog .bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.mprog .bar i { display: block; height: 100%; background: var(--blue); transition: width .4s; }
.mdet .mbody pre { white-space: pre-wrap; font: inherit; font-size: 14px; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.mrec { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.mrec .mr { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); } .mrec .mr:first-child { border-top: 0; }
.mrec .mr:nth-child(even) { background: var(--surface-2); } .mrec .mr.off { opacity: .65; }
.mrec .t { flex: 1; min-width: 0; } .mrec .t b { display: block; font-size: 14px; } .mrec .t span { display: block; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.mrec .mname { width: 100%; max-width: 280px; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: inherit; }
.mbulk { display: grid; gap: 12px; } .mbulk[hidden] { display: none; } .mbulk > .btn { justify-self: start; }
.mh-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; } .mh-row2 .mh-btn { min-height: 56px; font-size: 16px; }
.noticebar { flex: none; padding: 10px 28px 0; display: grid; gap: 8px; } .noticebar[hidden] { display: none; }
.notice-in { display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px 11px 14px; border-radius: 12px; background: var(--blue-bg); border: 1px solid var(--blue-line); color: var(--navy-900); font-size: 14px; }
.notice-in > svg { width: 20px; height: 20px; flex: none; color: var(--blue); margin-top: 1px; }
.notice-in .t { flex: 1; min-width: 0; } .notice-in .t b { display: block; font-size: 15px; font-weight: 700; }
.notice-in .nb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; line-height: 1.45; }
.notice-in.open .nb { display: block; -webkit-line-clamp: unset; }
.notice-in .nm { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.notice-in .icon-btn { flex: none; }
:root[data-theme="dark"] .notice-in { color: inherit; }
@media (max-width: 760px) {
  .noticebar { padding: 8px 12px 0; }
  .selbar { bottom: calc(var(--tabbar-h, 64px) + 10px); }
}
