/* Name Dat Bug brand tokens (from app.namedatbug.com) */
:root {
  --bg: #141414; --bg-2: #171717; --card: #1c1c1c; --card-2: #212121; --muted: #242424; --border: #2e2e2e;
  --fg: #f2f2f2; --fg-muted: #8c8c8c; --fg-dim: #6b6b6b;
  --primary: #37be47; --primary-hover: #3fd150; --primary-ink: #141414; --accent: #2a9136; --logo-green: #3aa856;
  --teal: #5ccad6; --amber: #f5c542; --red: #d92626; --red-soft: rgba(217, 38, 38, .14);
  --green-soft: rgba(55, 190, 71, .12); --teal-soft: rgba(92, 202, 214, .12); --amber-soft: rgba(245, 197, 66, .12);
  --radius: 10px; --radius-sm: 8px;
  --font: "DM Sans", system-ui, sans-serif; --display: "Bebas Neue", "DM Sans", sans-serif; --mono: Menlo, ui-monospace, monospace;
  --shadow: 0 2px 0 0 rgba(0,0,0,.3), 0 4px 10px -2px rgba(0,0,0,.4);
  --hover: #2b2b2b; --hover-border: #3a3a3a; --map-bg: #101010; --head-bg: rgba(20,20,20,.92); --tab-bg: rgba(23,23,23,.97);
  --err-ink: #ffb0b0; --ok-ink: #9ff0a8; --info-ink: #a8eef5; --warn-ink: #ffe08a; --danger-ink: #ff8a8a; --input-bg: var(--bg);
  color-scheme: dark;
  --sidebar-w: 236px; --tabbar-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .03em; margin: 0; line-height: 1.05; }
h1 { font-size: 40px; } h2 { font-size: 28px; } h3 { font-size: 22px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--fg-muted); }
.muted { color: var(--fg-muted); } .dim { color: var(--fg-dim); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; } .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .hidden { display: none !important; }


/* Light theme */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f3; --bg-2: #ffffff; --card: #ffffff; --card-2: #f4f4f2; --muted: #eeeeec; --border: #e1e1de;
  --fg: #141414; --fg-muted: #5f5f5f; --fg-dim: #8a8a8a;
  --primary: #23883a; --primary-hover: #1d7431; --primary-ink: #ffffff; --accent: #1d7431;
  --teal: #11818d; --amber: #9a6a00; --red: #c62828; --red-soft: rgba(198,40,40,.08);
  --green-soft: rgba(35,136,58,.09); --teal-soft: rgba(17,129,141,.09); --amber-soft: rgba(154,106,0,.09);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px -2px rgba(0,0,0,.08);
  --hover: #e6e6e3; --hover-border: #c9c9c5; --map-bg: #e8e8e5; --head-bg: rgba(255,255,255,.94); --tab-bg: rgba(255,255,255,.97);
  --err-ink: #a11d1d; --ok-ink: #1b6b2d; --info-ink: #0b5f68; --warn-ink: #7a5400; --danger-ink: #b42020;
}
:root[data-theme="light"] .btn { border-color: var(--border); }
:root[data-theme="light"] .auth { background: radial-gradient(1200px 600px at 50% -10%, rgba(35,136,58,.10), transparent 60%), var(--bg); }
:root[data-theme="light"] .pin { border-color: #fff; }
:root[data-theme="light"] .pin span { color: #fff; }
:root[data-theme="light"] .sig { border: 1px solid var(--border); }
.theme-btn svg { width: 16px; height: 16px; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand .name { font-family: var(--display); font-size: 22px; letter-spacing: .05em; line-height: 1; }
.brand .sub { font-size: 11px; color: var(--fg-muted); letter-spacing: .08em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--fg-muted); font-weight: 500; }
.nav a:hover { background: var(--muted); color: var(--fg); }
.nav a.active { background: var(--green-soft); color: var(--primary); }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.userbox { border-top: 1px solid var(--border); padding: 12px 8px 0; font-size: 13px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px 0; }
.content { padding: 18px 28px 40px; max-width: 1400px; }
.tabbar { display: none; }
.mobile-head { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--border); background: var(--head-bg); position: sticky; top: 0; z-index: 500; backdrop-filter: blur(8px); }
  .mobile-head img { width: 32px; height: 32px; }
  .topbar { padding: 14px 16px 0; } .content { padding: 14px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 600; background: var(--tab-bg); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar-h); color: var(--fg-muted); font-size: 11px; font-weight: 600; }
  .tabbar a.active { color: var(--primary); } .tabbar svg { width: 22px; height: 22px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0,1fr); } .g4.stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  h1 { font-size: 32px; }
  .hide-sm { display: none !important; }
  .mapcard { order: -1; }
}
@media (min-width: 861px) { .show-sm { display: none !important; } }

/* Cards & controls */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; } .card h3 { margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.stat .v { font-family: var(--display); font-size: 38px; line-height: 1; } .stat .l { color: var(--fg-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.1); background: var(--muted); color: var(--fg); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); } .btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; } .btn.danger { background: var(--red-soft); border-color: rgba(217,38,38,.4); color: var(--danger-ink); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; } .btn.lg { min-height: 48px; font-size: 16px; padding: 0 20px; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 34px; min-height: 34px; padding: 0; }
label.f, div.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
label.f.req > span::after, div.f.req > span::after { content: " *"; color: var(--primary); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--fg); font-size: 15px; font-weight: 400; outline: none; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(55,190,71,.18); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; } .check input { width: 18px; height: 18px; accent-color: var(--primary); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--muted); color: var(--fg-muted); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--primary); border-color: rgba(55,190,71,.35); }
.badge.teal { background: var(--teal-soft); color: var(--teal); border-color: rgba(92,202,214,.3); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(245,197,66,.3); }
.badge.red { background: var(--red-soft); color: var(--danger-ink); border-color: rgba(217,38,38,.35); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; color: var(--fg-muted); font-weight: 600; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--primary); color: var(--primary-ink); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--fg-muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-color: var(--primary); }

/* Tables & lists */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); font-weight: 600; background: var(--card-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; } table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--card-2); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.item.click { cursor: pointer; } .item.click:hover { border-color: var(--hover-border); background: var(--card-2); }
.stop-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); font-weight: 700; font-size: 13px; border: 1px solid var(--border); }
.stop-n.done { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.empty { text-align: center; padding: 34px 16px; color: var(--fg-muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* Map */
.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--map-bg); z-index: 0; }
.map.tall { height: 520px; }
.leaflet-container { background: var(--map-bg); font-family: var(--font); }
:root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.5); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--fg); }
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--primary); border: 2px solid #0e0e0e; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pin span { transform: rotate(45deg); color: #0e0e0e; font-weight: 800; font-size: 12px; }
.pin.done { background: #5f5f5f; } .pin.office { background: var(--teal); }
@media (max-width: 860px) { .map { height: 260px; } .map.tall { height: 360px; } }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 11px; text-transform: uppercase; color: var(--fg-muted); text-align: center; padding: 4px 0; letter-spacing: .08em; }
.cal .day { min-height: 96px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal .day:hover { border-color: var(--hover-border); } .cal .day.other { opacity: .38; } .cal .day.today { border-color: var(--primary); }
.cal .day.sel { background: var(--green-soft); border-color: var(--primary); }
.cal .num { font-size: 12px; font-weight: 700; color: var(--fg-muted); } .cal .day.today .num { color: var(--primary); }
.cal .ev { font-size: 11px; padding: 2px 5px; border-radius: 4px; background: var(--teal-soft); color: var(--teal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.done { background: var(--green-soft); color: var(--primary); }
.cal .more { font-size: 11px; color: var(--fg-muted); }
@media (max-width: 860px) { .cal .day { min-height: 52px; padding: 4px; } .cal .ev { display: none; } .cal .dots { display: flex; gap: 3px; flex-wrap: wrap; } .cal .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); } .cal .dot.done { background: var(--primary); } }
@media (min-width: 861px) { .cal .dots { display: none; } }

/* Service form */
.section-title { font-family: var(--display); font-size: 20px; letter-spacing: .05em; color: var(--fg); margin: 6px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .n { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-family: var(--font); font-weight: 800; font-size: 13px; }
.prod { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--bg-2); position: relative; }
.prod + .prod { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--fg-muted); font-size: 13px; cursor: pointer; user-select: none; }
.chip.on { background: var(--green-soft); color: var(--primary); border-color: rgba(55,190,71,.5); }
.ms { position: relative; }
.ms-box { min-height: 42px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: text; }
.ms-box input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 120px; padding: 4px; color: var(--fg); }
.ms-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--green-soft); color: var(--primary); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; font-weight: 600; }
.ms-tag button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.ms-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 260px; overflow: auto; box-shadow: var(--shadow); }
.ms-drop .opt { padding: 8px 12px; cursor: pointer; font-size: 14px; } .ms-drop .opt:hover, .ms-drop .opt.hi { background: var(--muted); }
.ms-drop .grp { padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-dim); background: var(--bg-2); }
.ms-drop .sci { color: var(--fg-dim); font-style: italic; font-size: 12px; margin-left: 6px; }
.sig { width: 100%; height: 160px; background: #fafafa; border-radius: var(--radius-sm); touch-action: none; display: block; cursor: crosshair; }
.calc { font-size: 12px; color: var(--teal); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; display: flex; gap: 10px; justify-content: flex-end; z-index: 5; }
@media (max-width: 860px) { .sticky-actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); } .sticky-actions .btn { flex: 1; } }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, rgba(55,190,71,.10), transparent 60%), var(--bg); }
.auth .box { width: 100%; max-width: 410px; }
.auth .logo { display: block; width: 120px; height: 120px; margin: 0 auto 6px; object-fit: contain; }
.auth h1 { text-align: center; font-size: 44px; } .auth .tag { text-align: center; color: var(--fg-muted); margin: 4px 0 22px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-weight: 600; font-size: 14px; }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.alert.err { background: var(--red-soft); border-color: rgba(217,38,38,.4); color: var(--err-ink); }
.alert.ok { background: var(--green-soft); border-color: rgba(55,190,71,.4); color: var(--ok-ink); }
.alert.info { background: var(--teal-soft); border-color: rgba(92,202,214,.35); color: var(--info-ink); }
.alert.warn { background: var(--amber-soft); border-color: rgba(245,197,66,.35); color: var(--warn-ink); }

/* Modal, toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 1000; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal.wide { max-width: 900px; }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal .mb { padding: 18px; } .modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card); }
@media (max-width: 860px) { .modal-bg { place-items: end stretch; padding: 0; } .modal { max-height: 92vh; border-radius: 16px 16px 0 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--primary); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 2000; transition: transform .2s; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); } .toast.err { border-left-color: var(--red); }
@media (max-width: 860px) { .toast { bottom: calc(var(--tabbar-h) + 16px); } }
@keyframes fade { from { opacity: 0; } }

/* Printable documents (MSPUR, service report) */
.doc { background: #fff; color: #111; border-radius: 8px; padding: 28px; font: 12px/1.4 Arial, Helvetica, sans-serif; }
.doc h2, .doc h3 { font-family: Arial, Helvetica, sans-serif; letter-spacing: 0; font-weight: 700; }
.doc h2 { font-size: 16px; } .doc h3 { font-size: 13px; margin: 12px 0 6px; }
.doc table { width: 100%; border-collapse: collapse; } .doc td, .doc th { border: 1px solid #333; padding: 5px 6px; vertical-align: top; text-align: left; }
.doc th { background: #eee; font-size: 11px; } .doc .hdr td { border: 1px solid #333; } .doc .lbl { font-size: 9px; text-transform: uppercase; color: #555; display: block; }
.doc .flag { color: #b45309; font-size: 10px; } .doc .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc .sigimg { height: 60px; } .doc .center { text-align: center; } .doc .stampbox { border: 2px dashed #888; height: 70px; display: grid; place-items: center; color: #777; font-size: 10px; }
@media print {
  body { background: #fff; }
  .sidebar, .tabbar, .mobile-head, .topbar, .no-print, .toast, .sticky-actions { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  .doc { padding: 0; border-radius: 0; } .print-break { page-break-after: always; }
  .card { box-shadow: none; border: 0; background: #fff; padding: 0; }
}

/* Searchable dropdown (combo) */
.combo { position: relative; min-width: 0; }
.combo > select.combo-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.combo-btn { text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.combo-btn.ph { color: var(--fg-dim); }
.combo-btn:disabled { opacity: .55; cursor: not-allowed; }
.combo-pop { position: fixed; z-index: 3000; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.combo-search { border: 0; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--fg); padding: 10px 12px; font-size: 15px; outline: none; }
.combo-list { overflow: auto; padding: 4px 0; }
.combo-opt { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.combo-opt.hi { background: var(--muted); } .combo-opt.sel { color: var(--primary); font-weight: 600; } .combo-opt.ph { color: var(--fg-dim); }
@media (pointer: coarse) { .combo-opt { padding: 12px 14px; font-size: 15px; } }

/* Identification embed */
.idframe-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #121212; height: calc(100vh - 150px); min-height: 520px; }
.idframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 860px) { .idframe-wrap { height: calc(100vh - 230px - env(safe-area-inset-bottom)); border-radius: 8px; } }

/* Barcode labels (Avery 5160: 3 x 10, 2.625in x 1in) */
.labels { display: grid; grid-template-columns: repeat(3, 2.625in); column-gap: .125in; row-gap: 0; background: #fff; color: #000; padding: .5in .1875in; width: 8.5in; border-radius: 8px; }
.label { width: 2.625in; height: 1in; padding: .06in .12in; overflow: hidden; display: flex; flex-direction: column; justify-content: center; font: 9px/1.2 Arial, sans-serif; }
.label .lt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .label .ls { color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.label svg.bc { width: 100%; height: .55in; }
@media print { @page { size: letter; margin: 0; } .labels { padding: .5in .1875in; border-radius: 0; } }

/* Device inspections */
.dev { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.dev.open { border-color: var(--primary); }
.dev-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; }
.dev-edit { padding: 4px 12px 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.seg.wrap button { margin: 1px; }

/* Trend chart (palette validated for both surfaces with the dataviz validator) */
:root { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9; --so: #8c8c8c; }
:root[data-theme="light"] { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #6250d6; --so: #8a8a8a; }
.chart { position: relative; }
.chart .grid-l { stroke: var(--border); stroke-width: 1; }
.chart .ax { fill: var(--fg-muted); font-size: 11px; font-family: var(--font); }
.chart .dl { fill: var(--fg); font-size: 11px; font-family: var(--font); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--card); stroke-width: 2; }
.chart .xh { stroke: var(--fg-dim); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip { position: absolute; min-width: 180px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); pointer-events: none; display: flex; flex-direction: column; gap: 3px; }
.ln.s1 { stroke: var(--s1); } .ln.s2 { stroke: var(--s2); } .ln.s3 { stroke: var(--s3); } .ln.s4 { stroke: var(--s4); } .ln.s5 { stroke: var(--s5); } .ln.s6 { stroke: var(--s6); } .ln.so { stroke: var(--so); stroke-dasharray: 5 4; }
.pt.s1, .sw.s1 { fill: var(--s1); background: var(--s1); } .pt.s2, .sw.s2 { fill: var(--s2); background: var(--s2); } .pt.s3, .sw.s3 { fill: var(--s3); background: var(--s3); }
.pt.s4, .sw.s4 { fill: var(--s4); background: var(--s4); } .pt.s5, .sw.s5 { fill: var(--s5); background: var(--s5); } .pt.s6, .sw.s6 { fill: var(--s6); background: var(--s6); } .pt.so, .sw.so { fill: var(--so); background: var(--so); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; color: var(--fg); font-size: 13px; cursor: pointer; }
.lg-item.off { opacity: .4; text-decoration: line-through; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Calendar drag & drop */
.draggable { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dragging { opacity: .35; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.cal .day.drop { border-color: var(--primary); background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.drag-ghost { position: fixed; z-index: 4000; pointer-events: none; background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: nowrap; }

/* Device map pins */
.dpin { width: 26px; height: 26px; border-radius: 50%; background: var(--c, #bdbdbd); color: #111; font: 800 11px/26px var(--font); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.dpin.hot { box-shadow: 0 0 0 3px #e5484d, 0 1px 6px rgba(0,0,0,.6); }
.dpin.mini { display: inline-block; width: 12px; height: 12px; border-width: 1px; background: #888; }
.map.sat .leaflet-tile-pane { filter: none !important; }
.leaflet-control-layers { background: var(--card); color: var(--fg); border: 1px solid var(--border) !important; }

/* Customer device map + trend */
.devgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.trendpanel { background: var(--bg-2); padding: 14px; min-width: 0; }
@media (max-width: 1100px) { .devgrid { grid-template-columns: 1fr; } }

/* Talk-to-text */
.dict { position: relative; display: block; width: 100%; }
.dict > .input { padding-right: 44px; }
.dict-btn { position: absolute; right: 6px; top: 6px; width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; }
.dict:not(.ta) .dict-btn { top: 50%; transform: translateY(-50%); }
.dict-btn svg { width: 16px; height: 16px; }
.dict-btn:hover { color: var(--primary); border-color: var(--primary); }
.dict-btn.rec { background: var(--red); color: #fff; border-color: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,38,38,.5); } 50% { box-shadow: 0 0 0 6px rgba(217,38,38,0); } }
/* Draft watermark on report preview */
.draftmark { position: absolute; top: 10px; right: 10px; background: #fff3cd; color: #7a5400; border: 1px solid #e0c060; font: 700 11px Arial, sans-serif; padding: 4px 8px; border-radius: 4px; letter-spacing: .04em; }

/* ===== Service report (fresh layout) ===== */
.rpt { --rg: #2a9136; --rgs: #e8f6ea; --ra: #b26b00; --ras: #fff4df; --rr: #c62828; --rrs: #fdecec; --rl: #e7e9ec; --rm: #6b7280;
  background: #fff; color: #1d2329; border-radius: 14px; padding: 34px 38px; font: 13.5px/1.5 "DM Sans", system-ui, sans-serif; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.rpt::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #37be47, #2a9136 60%, #5ccad6); }
.rpt h2, .rpt h3 { font-family: "DM Sans", system-ui, sans-serif; letter-spacing: 0; color: #111827; }
.rpt h3 { font-size: 15px; font-weight: 700; margin: 26px 0 10px; display: flex; gap: 10px; align-items: baseline; }
.rpt h3 .r-mute { font-weight: 500; font-size: 12.5px; }
.r-mute { color: var(--rm); font-size: 12.5px; }
.r-lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--rm); font-weight: 700; margin-bottom: 4px; }
.r-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--rl); }
.r-brand { display: flex; gap: 14px; align-items: center; } .r-brand img { display: block; width: 180px; height: 72px; object-fit: contain; object-position: left center; flex: none; }
.r-co { font-family: "Bebas Neue", sans-serif; font-size: 28px; letter-spacing: .04em; line-height: 1; color: #111; }
.r-title { text-align: right; } .r-kicker { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--rg); }
.r-date { font-size: 18px; font-weight: 700; margin: 2px 0 6px; } .r-id { font-size: 10.5px; color: #9aa1a9; margin-top: 6px; }
.r-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef0f2; color: #374151; white-space: nowrap; }
.r-pill.ok { background: var(--rgs); color: var(--rg); } .r-pill.warn { background: var(--ras); color: var(--ra); } .r-pill.bad { background: var(--rrs); color: var(--rr); }
.r-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.r-card { border: 1px solid var(--rl); border-radius: 12px; padding: 12px 14px; background: #fafbfc; }
.r-card b { font-size: 15px; }
.r-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.r-kpis > div { border: 1px solid var(--rl); border-radius: 12px; padding: 10px 12px; }
.r-kpis b { display: block; font-size: 22px; line-height: 1.1; } .r-kpis span { font-size: 11px; color: var(--rm); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.r-kpis .ok b { color: var(--rg); } .r-kpis .warn b { color: var(--ra); } .r-kpis .bad b { color: var(--rr); }
.r-summary { margin-top: 18px; border-radius: 12px; background: linear-gradient(180deg, #f2fbf3, #fff); border: 1px solid #cfe9d3; padding: 4px 16px 14px; border-left: 5px solid #37be47; }
.r-summary h3 { margin-top: 12px; }
.r-pre { white-space: pre-wrap; }
.r-tbl { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--rl); border-radius: 12px; overflow: hidden; font-size: 12.5px; }
.r-tbl th { background: #f4f6f8; text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--rm); padding: 8px 10px; border-bottom: 1px solid var(--rl); }
.r-tbl td { padding: 8px 10px; border-bottom: 1px solid #eef0f2; vertical-align: top; } .r-tbl tr:last-child td { border-bottom: 0; }
.r-tbl .num { text-align: right; white-space: nowrap; } .r-dev tr.hit td { background: #fffaf0; }
.r-rates { display: flex; gap: 28px; margin-bottom: 4px; }
.r-sign { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 16px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--rl); }
.r-sig { height: 56px; display: block; } .r-sigline { height: 40px; border-bottom: 1px solid #9aa1a9; width: 80%; }
.r-foot { margin-top: 22px; text-align: center; color: #9aa1a9; font-size: 11.5px; }
.r-break { height: 34px; }
@media (max-width: 760px) { .rpt { padding: 22px 16px; } .r-head { flex-direction: column; } .r-title { text-align: left; } .r-cards, .r-sign { grid-template-columns: 1fr; } .r-kpis { grid-template-columns: repeat(2, 1fr); } .r-tbl { display: block; overflow-x: auto; } }

/* ===== B&P 8538 notice ===== */
.n8538 { border: 2px solid #111827; border-radius: 12px; padding: 22px 24px; color: #111827; background: #fff; font: 13px/1.5 "DM Sans", system-ui, sans-serif; }
.n8538 h2 { font-family: "DM Sans", sans-serif; font-size: 22px; font-weight: 800; margin: 2px 0; letter-spacing: 0; }
.n-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #d1d5db; padding-bottom: 12px; }
.n-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #b42318; }
.n-sub { color: #4b5563; font-size: 12px; } .n-co { text-align: right; font-size: 12px; }
.n-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin: 14px 0 4px; }
.n-lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; font-weight: 700; margin-bottom: 2px; }
.n-items { padding-left: 20px; margin: 10px 0; } .n-items li { margin: 10px 0; }
.n-statement { margin: 8px 0; padding: 10px 12px; background: #fff7ed; border-left: 4px solid #ea580c; border-radius: 6px; }
.n-tbl { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; } .n-tbl th, .n-tbl td { border: 1px solid #d1d5db; padding: 5px 8px; text-align: left; } .n-tbl th { background: #f3f4f6; font-size: 11px; }
.n-mute { color: #6b7280; } .n-blank { display: inline-block; border-bottom: 1px solid #6b7280; height: 1em; vertical-align: bottom; }
.n-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.n-contacts > div { border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.n-foot { font-size: 11px; color: #4b5563; margin: 12px 0 0; }
@media (max-width: 760px) { .n-head, .n-grid { flex-direction: column; grid-template-columns: 1fr; } .n-co { text-align: left; } .n-contacts { grid-template-columns: 1fr 1fr; } }
@media print {
  .rpt { box-shadow: none; border-radius: 0; padding: 0; } .rpt::before { display: none; }
  .r-break { page-break-before: always; height: 0; } .r-card, .n8538 { break-inside: avoid; }
  .rpt h3 { break-after: avoid; }
}
@media print { body.print-only-area .content > *:not(#pane), body.print-only-area .tabs, body.print-only-area #nf, body.print-only-area #pane .muted.small.mb { display: none !important; } body.print-only-area #n8grid { display: block !important; } }

/* Mobile phone polish */
svg.ic { flex: none; }
.list .item > svg.ic, .item > svg.ic { width: 20px; height: 20px; color: var(--fg-muted); }
.toast { opacity: 0; visibility: hidden; transition: transform .2s, opacity .2s, visibility .2s; }
.toast.show { opacity: 1; visibility: visible; }
.savebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.card-head { flex-wrap: wrap; }
.grid > * { min-width: 0; }
@media (max-width: 860px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .shell, .main, .content { max-width: 100vw; min-width: 0; }
  .input, select.input, textarea.input, .combo input, input, select, textarea { font-size: 16px; }
  .btn.sm { min-height: 38px; padding: 0 12px; }
  .btn { min-height: 42px; }
  .icon-btn, .btn.icon-btn { width: 40px; min-height: 40px; }
  .seg button, .tabs button, .tabs a { min-height: 40px; }
  .dict-btn { min-width: 40px; min-height: 40px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .ms-tag button { min-width: 30px; min-height: 30px; font-size: 18px; }
  .topbar { flex-wrap: wrap; } .topbar > * { min-width: 0; }
  .topbar .row.wrap .btn { flex: 1 1 auto; }
  :not(.table-wrap) > table:not(.r-tbl) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap { max-width: 100%; overflow-x: auto; }
  div.f > span, label.f > span { overflow-wrap: anywhere; }
  .row { min-width: 0; }
  .mobile-head span { min-width: 0; font-size: 17px !important; }
  .card h3 { overflow-wrap: anywhere; }
  .tabbar a { min-width: 0; }
}
@media (max-width: 860px) { #q { flex: 1 1 100%; max-width: none !important; } }
#stops .item .grow { min-width: 0; } #stops .item .row { flex-wrap: wrap; }

/* iOS Safari: stop text autosizing and native-control intrinsic widths from widening the page */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
label.f > *, div.f > *, .ms, .ms-box, .combo, .prod, .card, .sec { min-width: 0; max-width: 100%; }
select.input { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
input[type=date].input, input[type=time].input, input[type=datetime-local].input, input[type=month].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.ms-box input { min-width: 80px; }
.check > span { min-width: 0; }
@media (max-width: 860px) {
  .prod { padding: 12px; }
}

/* Device groups (by device type) */
.dgroups { display: flex; flex-direction: column; gap: 10px; }
.dgroup { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.dgroup.single { background: transparent; }
.dgroup > summary { list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; min-height: 48px; cursor: pointer; user-select: none; }
.dgroup > summary::-webkit-details-marker { display: none; }
.dgroup > summary:hover { background: var(--hover); }
.dg-name { font-weight: 700; flex: 1 1 auto; min-width: 0; }
.dg-chev { display: inline-flex; color: var(--fg-muted); transition: transform .15s; }
.dgroup[open] > .dg-chev, .dgroup[open] > summary .dg-chev { transform: rotate(90deg); }
.dgroup > .table-wrap { border-top: 1px solid var(--border); }
.dgroup .table-wrap { margin: 0; }
.dg-body { padding: 10px; border-top: 1px solid var(--border); }
#devlist { display: flex; flex-direction: column; gap: 8px; }
.dgroup > summary { flex-wrap: nowrap; }
.dg-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-meta { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 860px) { .dg-main { flex-direction: column; align-items: flex-start; gap: 6px; } .dg-meta { margin-left: 0; } }

/* Company logo upload */
.logo-up { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 220px; max-width: 100%; height: 96px; border: 1px dashed var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: #fff; padding: 8px; flex: none; overflow: hidden; position: relative; }
.logo-prev img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.n-logo { display: inline-block; width: 140px; height: 48px; object-fit: contain; object-position: right center; }

/* Time clock */
.clock-gate { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.clock-now { font-family: var(--display); font-size: 56px; line-height: 1; letter-spacing: .03em; margin: 6px 0; }
.clock-btn { width: 100%; min-height: 58px; font-size: 18px; }
.clock-chip { gap: 6px; font-variant-numeric: tabular-nums; }
.clock-chip.on { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.clock-chip.off { border-color: var(--amber, #eda100); }
.clock-chip.block { width: 100%; margin-top: 10px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 var(--primary); animation: livepulse 2s infinite; flex: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 420px) { .hide-xs { display: none; } .mobile-head .clock-chip { padding: 0 10px; } }
.tl-auto { color: var(--amber, #b07800); }

@media (max-width: 860px) { .logo-up { flex-direction: column; align-items: stretch; } .logo-prev { width: 100%; height: 110px; } .r-brand { flex-direction: column; align-items: flex-start; } .r-brand img { width: 160px; height: 64px; } .n-logo { object-position: left center; } }
.n-tbl .n-used { width: 56px; text-align: center; } .n-tbl tr.is-used td { font-weight: 600; background: #f0f9f1; }
.sidebar .brand img, .mobile-head img, .auth .logo { object-fit: contain; }
.n-missing { color: #c62828; font-size: 11px; font-weight: 600; }

/* Avatars */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; background: color-mix(in srgb, var(--primary) 18%, var(--muted)); color: var(--primary); font-weight: 800; letter-spacing: .02em; border: 1px solid var(--border); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clock-gate .avatar { margin-bottom: 4px; }

/* Collapsible service sections */
details.sec { padding: 0; }
details.sec > summary { list-style: none; cursor: pointer; margin: 0; padding: 14px 16px; min-height: 56px; user-select: none; border-radius: var(--radius); }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary:hover { background: var(--hover); }
details.sec[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.sec-sum { margin-left: auto; font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--fg-muted); text-align: right; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-sum.ok { color: var(--primary); } .sec-sum.warn { color: var(--amber, #b07800); }
.sec-chev { display: inline-flex; color: var(--fg-muted); transition: transform .15s; } .sec-chev svg { width: 18px; height: 18px; }
details.sec[open] .sec-chev { transform: rotate(90deg); }
.sec-body { padding: 14px 16px 16px; }
@media (max-width: 860px) { .sec-sum { max-width: 45%; font-size: 11px; } details.sec > summary { padding: 12px 14px; } .sec-body { padding: 12px 14px 14px; } }

/* Findings & photos */
.finding { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--bg-2); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ph { position: relative; display: flex; flex-direction: column; gap: 6px; }
.ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; background: #000; }
.ph .ph-cap { min-height: 34px; padding: 6px 8px; font-size: 13px; }
.ph-x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.ph.uploading { aspect-ratio: 4 / 3; border: 1px dashed var(--border); border-radius: 8px; display: grid; place-items: center; color: var(--fg-muted); font-size: 12px; }
.ph-add { aspect-ratio: 4 / 3; border: 1px dashed var(--border); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--fg-muted); font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; padding: 6px; }
.ph-add:hover { border-color: var(--primary); color: var(--primary); } .ph-add svg { width: 22px; height: 22px; }
.r-findings { display: flex; flex-direction: column; gap: 12px; }
.r-finding { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; break-inside: avoid; }
.r-fhead { margin-bottom: 6px; } .r-frec { margin-top: 8px; }
.r-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.r-photos figure { margin: 0; } .r-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid #e5e7eb; display: block; }
.r-photos figcaption { font-size: 11px; color: #4b5563; margin-top: 3px; }
@media (max-width: 760px) { .r-photos { grid-template-columns: repeat(2, 1fr); } }
@media print { .r-photos { grid-template-columns: repeat(3, 1fr); } details.sec > .sec-body { display: block; } }

/* Help */
.help-input { position: relative; }
.help-input textarea { min-height: 64px; padding-right: 64px; font-size: 16px; resize: vertical; }
.help-mic { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.help-mic svg { width: 22px; height: 22px; }
.help-mic.rec { background: #e5484d; color: #fff; animation: livepulse 1.4s infinite; }
.help-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { border: 1px solid var(--border); background: var(--bg-2); color: var(--fg); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 38px; }
.chip:hover { border-color: var(--primary); color: var(--primary); } .chip.sm { padding: 5px 10px; font-size: 12px; min-height: 30px; }
.help-q { align-self: flex-end; max-width: 85%; background: var(--primary); color: var(--primary-ink); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-weight: 600; }
.help-a { line-height: 1.55; } .help-a p { margin: 0 0 8px; } .help-a ol, .help-a ul, .help-body ol, .help-body ul { margin: 6px 0 10px; padding-left: 22px; } .help-a li, .help-body li { margin: 4px 0; }
.help-link { display: inline-flex; align-items: center; margin-top: 4px; padding: 8px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 700; }
.help-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.help-typing { display: flex; gap: 6px; padding: 6px 0; } .help-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-muted); animation: hdot 1s infinite; } .help-typing span:nth-child(2) { animation-delay: .15s; } .help-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hdot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.help-topic { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.help-topic > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; min-height: 44px; } .help-topic > summary::-webkit-details-marker { display: none; }
.help-topic > summary::after { content: '›'; float: right; color: var(--fg-muted); transition: transform .15s; } .help-topic[open] > summary::after { transform: rotate(90deg); }
.help-body { padding: 0 14px 12px; line-height: 1.5; } .help-body p { margin: 0 0 8px; }

/* Copyright & terms */
.copyright { font-size: 11px; color: var(--fg-muted); text-align: center; margin: 14px 0 4px; line-height: 1.5; }
.copyright a { color: var(--fg-muted); text-decoration: underline; }
.sidebar .copyright { text-align: left; margin: 10px 4px 0; }
.r-soft { font-size: 9px; color: #9ca3af; margin-top: 4px; }
.terms h3 { font-size: 15px; margin: 18px 0 6px; font-family: var(--font); letter-spacing: 0; text-transform: none; }
.terms p, .terms li { font-size: 14px; line-height: 1.55; } .terms ul { padding-left: 20px; }
.terms-scroll { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 16px 12px; background: var(--bg-2); -webkit-overflow-scrolling: touch; }
.terms-gate .check span { font-size: 14px; }

/* Training */
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.train-card { display: flex; gap: 14px; align-items: flex-start; color: inherit; transition: border-color .15s, transform .15s; }
.train-card:hover { border-color: var(--primary); } .train-card.inactive { opacity: .6; }
.train-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); flex: none; }
.train-ico svg { width: 24px; height: 24px; }
.course { line-height: 1.6; } .course h3 { margin: 22px 0 8px; } .course h3:first-child { margin-top: 0; } .course ul, .course ol { padding-left: 22px; } .course li { margin: 5px 0; }
.quiz-prog { height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; } .quiz-prog > div { height: 100%; background: var(--primary); transition: width .2s; }
.quiz-q { font-family: var(--font); font-size: 20px; line-height: 1.4; letter-spacing: 0; text-transform: none; margin: 0 0 18px; font-weight: 700; }
.quiz-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 16px; min-height: 56px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg-2); color: var(--fg); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.quiz-opt:hover { border-color: var(--primary); } .quiz-opt.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.quiz-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--fg-muted); flex: none; } .quiz-opt.on .quiz-dot { border-color: var(--primary); background: radial-gradient(var(--primary) 45%, transparent 50%); }
.quiz-result { text-align: center; padding: 28px 18px; } .quiz-result.pass { border-color: var(--primary); } .quiz-result.fail { border-color: #e5484d; }
.quiz-score { font-family: var(--display); font-size: 72px; line-height: 1; } .quiz-result.pass .quiz-score { color: var(--primary); } .quiz-result.fail .quiz-score { color: #e5484d; }
.quiz-rev.ok { border-left: 4px solid var(--primary); } .quiz-rev.bad { border-left: 4px solid #e5484d; }
.cert-wrap { display: flex; justify-content: center; }
.cert { width: 100%; max-width: 1000px; aspect-ratio: 11 / 8.5; background: #fff; color: #1f2933; padding: 18px; border-radius: 6px; box-shadow: var(--shadow); }
.cert-in { height: 100%; border: 3px double #2e7d32; outline: 1px solid #c8e6c9; outline-offset: -10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 40px; gap: 6px; }
.cert-logo { max-width: 220px; max-height: 70px; object-fit: contain; margin-bottom: 6px; }
.cert-kicker { font-family: var(--display); font-size: 40px; letter-spacing: .08em; color: #2e7d32; }
.cert-pre { font-size: 15px; color: #52606d; font-style: italic; }
.cert-name { font-family: Georgia, 'Times New Roman', serif; font-size: 40px; font-weight: 700; border-bottom: 1px solid #cbd2d9; padding: 0 30px 4px; margin: 2px 0 4px; }
.cert-course { font-size: 24px; font-weight: 800; color: #124a5e; }
.cert-sub { font-size: 13px; color: #52606d; }
.cert-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; width: 100%; margin-top: 18px; }
.cert-line { border-bottom: 1px solid #52606d; min-height: 24px; font-weight: 700; font-size: 14px; padding-bottom: 3px; }
.cert-lbl { font-size: 11px; color: #52606d; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.cert-foot { margin-top: 14px; font-size: 10px; color: #7b8794; }
@media (max-width: 760px) { .cert { aspect-ratio: auto; padding: 10px; } .cert-in { padding: 20px 14px; } .cert-kicker { font-size: 28px; } .cert-name { font-size: 28px; padding: 0 10px 4px; } .cert-course { font-size: 19px; } .cert-row { grid-template-columns: 1fr; gap: 12px; } }
@page cert { size: letter landscape; margin: 0.4in; }
@media print { .cert-wrap { page: cert; } .cert { box-shadow: none; max-width: none; aspect-ratio: auto; height: 7.5in; } }
.course-fig { margin: 12px 0 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.course-fig img { display: block; width: 100%; height: auto; border-radius: 6px; cursor: zoom-in; }
.train-ico.img { background: #fff; border: 1px solid var(--border); padding: 4px; }
.train-ico.img img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 900px) { .course-fig:has(img[src$="heat-exhaustion.png"]), .course-fig:has(img[src$="heat-stroke.png"]) { display: inline-block; width: calc(50% - 6px); vertical-align: top; } .course-fig:has(img[src$="heat-exhaustion.png"]) { margin-right: 8px; } }
.mv-list { max-height: 42vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mv-list .item { gap: 10px; cursor: pointer; } .mv-list .item input { flex: none; }
.act-day { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); margin: 14px 0 6px; } .act-day:first-of-type { margin-top: 0; }
.act-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.act-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); flex: none; } .act-ico svg { width: 16px; height: 16px; }

/* ---------- Self-serve demo ---------- */
.demo-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 16px; background:#f5c542; color:#1b1b1b; font-size:14px; position:sticky; top:0; z-index:30; }
.demo-bar .btn { background:rgba(255,255,255,.75); color:#1b1b1b; border-color:rgba(0,0,0,.15); }
.demo-bar .btn.primary { background:#1b1b1b; color:#fff; border-color:#1b1b1b; }
.demo-bar .btn.ghost { background:transparent; }
.demo-bar .spacer { flex:1; }
.demo-pill { display:inline-flex; align-items:center; gap:6px; font-weight:700; }
.demo-as { font-size:13px; }
.demo-cta { margin-top:18px; padding-top:16px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px; align-items:stretch; text-align:center; }
.demo-cta span { color:var(--fg-muted); font-size:14px; }
.demo-logo { width:64px; height:64px; border-radius:12px; border:1px dashed var(--border); display:inline-flex; align-items:center; justify-content:center; overflow:hidden; background:var(--card-2); color:var(--fg-muted); }
.demo-logo img { width:100%; height:100%; object-fit:contain; background:#fff; }
.demo-tips { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.demo-tips li { display:flex; gap:10px; align-items:flex-start; }
.demo-tips .ic { flex:none; margin-top:2px; color:var(--primary); }
.hp { position:absolute !important; left:-9999px !important; width:1px; height:1px; opacity:0; }
.demo-t td { vertical-align:top; }
@media (max-width: 760px) {
  .demo-bar { padding:6px 10px; gap:6px; font-size:13px; top:auto; }
  .demo-bar .spacer { display:none; }
  .demo-bar .btn { padding:4px 8px; font-size:12px; }
  .demo-bar .demo-pill { width:100%; }
}

/* ---------- Training videos ---------- */
.course-video { margin:0 0 18px; }
.course-video:last-child { margin-bottom:0; }
.course-video figcaption { display:flex; align-items:center; gap:8px; font-weight:600; margin-bottom:8px; }
.course-video .vframe { position:relative; width:100%; aspect-ratio:16/9; border-radius:10px; overflow:hidden; background:#000; }
.course-video iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.course-video > a { display:inline-block; margin-top:6px; }
#vpv .course-video { max-width:560px; margin-top:12px; }

.crow{border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px;}
.crow + .crow{margin-top:8px;}

/* ---------- County filing ---------- */
.filing-t td{vertical-align:middle}
.filing-t .stamp-in{max-width:140px;text-transform:uppercase;font-family:var(--mono,monospace)}
.sub-opt{border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px}
.sub-opt.pref{border-color:var(--primary);background:var(--green-soft)}
.sub-opt > b{display:flex;align-items:center;gap:8px}
.rpt-copy{background:#fff;color:#111;padding:12px;border-radius:8px;overflow:auto}
.rpt-copy table{width:100%;border-collapse:collapse}.rpt-copy td,.rpt-copy th{border:1px solid #333;padding:4px;font-size:11px}

/* ---------- Training add-on ---------- */
.train-card.locked{opacity:.72}
.train-card.locked .train-ico{filter:grayscale(1)}
.train-upsell{border-color:var(--primary);background:var(--green-soft)}
.train-lock{width:44px;height:44px;border-radius:12px;background:var(--primary);color:var(--primary-ink);display:inline-flex;align-items:center;justify-content:center;flex:none}
.train-plan b{display:inline-flex;align-items:center;gap:6px}

/* ---------- Map lock ---------- */
.map-lock{display:flex !important;align-items:center;gap:6px;padding:6px 10px !important;background:#fff;color:#1b1b1b;font:600 12px/1 var(--font, system-ui);cursor:pointer;user-select:none;-webkit-user-select:none;min-height:32px}
.map-lock input{width:16px;height:16px;margin:0;accent-color:#2e7d32;cursor:pointer}
.map-lock.on{color:#1b5e20}
.map-lock .ml-ico{display:inline-flex}
.leaflet-container.map-locked{touch-action:pan-x pan-y !important;cursor:default}
.leaflet-container.map-locked .leaflet-interactive{cursor:pointer}
@media (max-width:760px){.map-lock{min-height:36px;padding:8px 10px !important;font-size:13px}.map-lock input{width:18px;height:18px}}

/* ---------- Payments ---------- */
.pay-hero{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.pay-amt{font-size:30px;font-weight:700;line-height:1.1}
.pay-amt.void{text-decoration:line-through;color:var(--fg-muted)}
.pay-grid > div{display:flex;flex-direction:column;gap:2px;padding:8px 0;border-bottom:1px solid var(--border)}
.pay-verify{background:var(--bg-2)}
.pay-t tr.void td{color:var(--fg-muted);text-decoration:line-through}
.pay-t tr.void td:last-child,.pay-t tr.void td:nth-last-child(2){text-decoration:none}
.pay-hist{padding-left:18px;margin:4px 0}
.ar-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.ar-tiles .card{padding:12px 14px}.ar-tiles .v{font-size:22px;font-weight:700}.ar-tiles .l{font-size:12px;color:var(--fg-muted)}
.ar-eq{font-size:13px;color:var(--fg-muted);margin:8px 0 14px}
.aging{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.aging > div{border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 10px}.aging b{display:block;font-size:17px}
@media (max-width:760px){.ar-tiles,.aging{grid-template-columns:repeat(2,minmax(0,1fr))}.pay-amt{font-size:26px}}
.rpt-title-print{display:none}
@media print{.rpt-title-print{display:block;margin-bottom:10px}}
.t tr.tot td{border-top:2px solid var(--border);background:var(--bg-2)}

.nowrap{white-space:nowrap}
@media (max-width:760px){
  .pay-sum{grid-template-columns:repeat(3,minmax(0,1fr)) !important;gap:8px}
  .pay-t th,.pay-t td{padding:8px 6px}
  .pay-t .badge{font-size:11px;padding:2px 6px}
  .pay-t .badge svg{display:none}
}
.show-sm{display:none}
@media (max-width:760px){.show-sm{display:block}}

/* ---------- Fleet ---------- */
.veh-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
.veh-card{display:flex;gap:14px;align-items:flex-start;color:inherit;text-decoration:none}
.veh-card.inactive{opacity:.6}
.veh-ph{width:64px;height:64px;border-radius:12px;background:var(--green-soft);color:var(--primary);display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden}
.veh-ph.lg{width:96px;height:96px}
.veh-ph img{width:100%;height:100%;object-fit:cover}
.veh-ph svg{width:30px;height:30px}
.veh-facts > div{display:flex;flex-direction:column;gap:2px}
.veh-thumbs{display:flex;flex-wrap:wrap;gap:8px}
.veh-th{position:relative;width:84px;height:84px;border-radius:8px;overflow:hidden;border:1px solid var(--border);background:var(--bg-2)}
.veh-th.lg{width:160px;height:160px}
.veh-th img{width:100%;height:100%;object-fit:cover}
.veh-th button{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.veh-th button svg{width:14px;height:14px}
@media (max-width:760px){.veh-grid{grid-template-columns:1fr}.veh-ph.lg{width:72px;height:72px}.veh-th.lg{width:46%;height:auto;aspect-ratio:1}}
@media (max-width:760px){.veh-facts{grid-template-columns:repeat(2,minmax(0,1fr)) !important}.veh-facts > div{min-width:0;word-break:break-word}}

/* fleet map */
.fleet-map { height: 380px; border-radius: 12px; }
@media (max-width: 700px) { .fleet-map { height: 300px; } }
.vpin { display: flex; align-items: center; gap: 3px; padding: 3px 7px 3px 5px; border-radius: 16px; background: #1e9e5a; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); font: 700 12px/1 var(--body, system-ui); white-space: nowrap; width: max-content; }
.vpin svg { width: 16px; height: 16px; }
.vpin.soon { background: #c98a00; } .vpin.overdue { background: #d23c3c; } .vpin.stale { background: #6b7280; }
.vdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: #1e9e5a; }
.vdot.soon { background: #c98a00; } .vdot.overdue { background: #d23c3c; } .vdot.stale { background: #6b7280; }

/* payment methods on file */
.pm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pm-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); font-size: 13px; }
.pm-chip.def { border-color: rgba(46,160,90,.5); }
.pm-chip .icon-btn { width: 26px; height: 26px; min-height: 0; }
.pm-pick { display: flex; flex-direction: column; gap: 6px; }
.pm-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.pm-opt:has(input:checked) { border-color: var(--primary); background: rgba(46,160,90,.08); }
.note-box { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); }

/* ---------- text wrapping, app-wide ----------
   Long words, IDs, URLs, emails and references wrap inside their box instead of running off the card or screen. */
html, body { overflow-wrap: anywhere; }
td, th { overflow-wrap: break-word; }
th, .badge, .btn, .tabs button, .nowrap, .num, .tiny.mono { overflow-wrap: normal; }
.grow, .item > div, .row > div, .card-head > div, .list .item > *, .veh-card > .grow, .pm-chip > span { min-width: 0; }
img, video, svg, canvas, iframe { max-width: 100%; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
.modal, .card, .content { min-width: 0; }

/* ---------- photo repository ---------- */
.ph-fgrid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .ph-fgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ph-fgrid #pq { grid-column: 1 / -1; } }
@media (max-width: 600px) { .ph-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.ph-card { position: relative; margin: 0; background: var(--card, var(--bg-2)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ph-card.on { outline: 3px solid var(--primary); outline-offset: -1px; }
.ph-img { display: block; padding: 0; border: 0; background: #222; cursor: pointer; aspect-ratio: 4 / 3; width: 100%; }
.ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-card figcaption { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.ph-card figcaption b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-check { position: absolute; top: 8px; left: 8px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.ph-check svg { width: 18px; height: 18px; }
.ph-card.on .ph-check { background: var(--primary); color: #fff; }
.ph-sev { position: absolute; top: 10px; right: 8px; }
.ph-detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .ph-detail { grid-template-columns: 1fr; } }
.ph-big { position: relative; background: #111; border-radius: 10px; overflow: hidden; }
.ph-big img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.ph-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: 0; }
.ph-nav.prev { left: 8px; } .ph-nav.next { right: 8px; }
.ph-nav:disabled { opacity: .25; }
.ph-pick { display: grid; place-items: center; min-height: 160px; border: 2px dashed var(--fg-dim, #999); border-radius: 12px; cursor: pointer; text-align: center; padding: 10px; }
.ph-pick span { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ph-pick svg { width: 32px; height: 32px; }
.ph-pick img { max-height: 260px; max-width: 100%; border-radius: 8px; }
.ph-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.ph-thumb { position: relative; flex: 0 0 150px; height: 112px; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #222; cursor: pointer; scroll-snap-align: start; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-thumb .badge { position: absolute; top: 6px; right: 6px; }
.ph-tcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; color: #fff; font-size: 12px; font-weight: 600; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .ph-thumb { flex-basis: 128px; height: 96px; } }
.sup-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.ph-sev, .ph-thumb .badge { background: rgba(255,255,255,.94); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ph-sev.red, .ph-thumb .badge.red { color: #b42318; } .ph-sev.amber, .ph-thumb .badge.amber { color: #8a5a00; }
.combo { min-width: 0; max-width: 100%; } .combo-btn { width: 100%; max-width: 100%; }

.combo-btn.ph { display: block; }
.ph-card .badge.ph-sev, .ph-thumb .badge { background: #fff !important; border-color: transparent !important; }
.ctabs { margin-bottom: 14px; }
.ctabs button { display: inline-flex; align-items: center; gap: 6px; }
.ctabs button svg { width: 16px; height: 16px; }
.ctabs .badge { font-size: 11px; padding: 1px 7px; }

/* map lock: top center */
.leaflet-container > .map-lock { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; margin: 0; border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.steps-ol { padding-left: 20px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.stripe-box code { font-size: 12px; background: var(--muted); padding: 1px 5px; border-radius: 4px; }

/* scan + inventory */
.scan-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(46,160,90,.12); border: 1px solid rgba(46,160,90,.4); font-size: 14px; }
.scan-note svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
.scan-note span { flex: 1; min-width: 0; }
.inv-f { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
@media (max-width: 700px) { .inv-f { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .inv-f #iq { grid-column: 1 / -1; } }
.inv-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .inv-big b { font-size: 30px; font-family: var(--display); letter-spacing: .02em; }
.tx-seg { display: flex; flex-wrap: wrap; width: 100%; } .tx-seg button { flex: 1 1 auto; min-height: 40px; }
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ---------- back navigation ---------- */
.back-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 600; font-size: 14px; padding: 6px 10px 6px 4px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.back-btn svg { width: 20px; height: 20px; }
.back-btn:hover { background: var(--muted, rgba(127,127,127,.12)); }
.backrow { padding: 10px 32px 0; }
@media (max-width: 860px) { .backrow { display: none; } }
.mh-back { padding: 6px 6px 6px 0; margin-right: 2px; min-height: 44px; }
.mh-back span { display: none; }
.mh-back + img { display: none !important; }
@media (min-width: 380px) { .mh-back span { display: inline; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.auth-back { position: fixed; top: 14px; left: 14px; z-index: 50; display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--card, var(--bg-2)); border: 1px solid var(--border); color: var(--fg); font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.auth-back svg { width: 18px; height: 18px; color: var(--primary); }
.auth-back:hover { border-color: var(--primary); }
.auth { padding-top: 70px; }

/* ---------- pricing ---------- */
.auth.pricing { place-items: start center; }
.pr-box { max-width: 980px !important; }
.pr-kicker { text-align: center; text-transform: uppercase; letter-spacing: .25em; font-size: 12px; font-weight: 700; color: var(--primary); }
.pricing h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1; margin: 6px 0; }
.pricing .tag { max-width: 620px; margin: 8px auto 24px; }
.pr-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 760px) { .pr-grid { grid-template-columns: 1fr; } }
.pr-price, .pr-bce { display: flex; flex-direction: column; gap: 10px; }
.pr-price { border: 2px solid var(--primary); }
.pr-label { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--fg-muted); }
.pr-amt { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pr-amt b { font-family: var(--display); font-size: 64px; line-height: 1; color: var(--primary); letter-spacing: .01em; }
.pr-amt span { color: var(--fg-muted); font-weight: 600; }
.pr-setup { font-weight: 700; }
.pr-list { list-style: none; padding: 0; margin: 4px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.pr-list li { display: flex; gap: 8px; align-items: flex-start; } .pr-list svg { width: 18px; height: 18px; color: var(--primary); flex: none; margin-top: 2px; }
.pr-h2 { text-align: center; margin: 4px 0 14px; }
.pr-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
@media (max-width: 600px) { .pr-feats { grid-template-columns: 1fr; } }
.pr-feat { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.pr-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(46,160,90,.14); color: var(--primary); }
.pr-ico svg { width: 22px; height: 22px; }
.pr-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.scan-note[hidden] { display: none !important; }
.demo-cta .row { width: 100%; } .demo-cta .row .btn { flex: 1 1 auto; justify-content: center; }

/* access + pdf viewer */
.access-box { background: var(--bg-2); }
.access-box.dim { opacity: .6; }
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
@media (max-width: 560px) { .mod-grid { grid-template-columns: 1fr; } }
.pdfv-modal .modal { width: min(1100px, 96vw); }
.pdfv-bar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 2; background: var(--card); padding: 4px 0 8px; }
.pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 72vh; overflow: auto; background: #6b6b6b; padding: 12px; border-radius: 10px; }
.pdfv-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); max-width: 100%; }
.pdfv-page canvas { display: block; max-width: 100%; height: auto !important; }
.pdfv-pages.locked { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pdfv-pages.locked canvas { pointer-events: none; }
.pdfv-wm { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: 700 clamp(12px, 2.4vw, 22px)/1.2 var(--font); color: rgba(30, 120, 60, .16); transform: rotate(-28deg); text-align: center; padding: 20px; white-space: pre-wrap; }
@media print { .pdfv-modal, .pdfv-pages { display: none !important; } }
.tabs a { display: inline-block; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--fg-muted); font-weight: 600; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }

/* ---------- Licenses ---------- */
.nowrap { white-space: nowrap; }
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lic-card { display: block; color: inherit; text-decoration: none; }
.lic-card:hover { border-color: var(--hover-border); }
.lic-card.inactive { opacity: .6; }
.lic-ce { display: flex; align-items: center; gap: 10px; }
.lic-ce .tiny.ok { color: var(--primary); font-weight: 600; }
.lic-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; min-width: 60px; }
.lic-bar i { display: block; height: 100%; background: var(--amber); border-radius: 999px; }
.lic-bar i.met { background: var(--primary); }
.lic-ce.sm { min-width: 140px; } .lic-ce.sm .lic-bar { height: 6px; }
.lic-req { display: flex; flex-direction: column; gap: 10px; }
.lic-parts { display: flex; flex-wrap: wrap; gap: 8px; }
.lic-part { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--card-2); }
.lic-part b { color: var(--amber); } .lic-part.met b { color: var(--primary); }
.lic-facts > div { display: flex; flex-direction: column; gap: 2px; }
.lic-doc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--card-2); }
.lic-doc .lic-doc-ic { color: var(--fg-muted); display: inline-flex; }
.lic-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.lic-step { display: flex; gap: 12px; align-items: flex-start; }
.lic-num { flex: 0 0 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--fg-muted); }
.lic-step.done .lic-num { border-color: var(--primary); background: var(--green-soft); color: var(--primary); }
.lic-step.done .lic-num .ic { width: 16px; height: 16px; }
.lic-frame { width: 100%; height: 70vh; border: 0; border-radius: var(--radius-sm); background: #fff; }
.lic-img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: var(--radius-sm); }
table.t tr.dim td { opacity: .5; }
.hist-docs { display: flex; flex-wrap: wrap; gap: 4px; }

/* training CE */
.ce-agency { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ce-result { text-align: left; max-width: 520px; margin-left: auto; margin-right: auto; padding: 12px 14px; border-radius: 10px; background: rgba(46,160,90,.1); border: 1px solid rgba(46,160,90,.35); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ce-result svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--primary); }

/* Map tiles: overlap by half a pixel so Chrome never shows white seams between tiles */
.leaflet-tile-container img.leaflet-tile { width: 256.5px !important; height: 256.5px !important; }
.pin.sm { width: 22px; height: 22px; border-width: 2px; border-color: #fff; }
.pin.sm span { font-size: 11px; }
.mstats { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.mstats .stat { padding: 10px 12px; min-width: 0; }
.mstats .stat .v { font-size: clamp(20px, 2vw, 28px); line-height: 1.1; overflow-wrap: anywhere; }
.mstats .stat .l { font-size: 11px; overflow-wrap: anywhere; }
@media (max-width: 1280px) { .mstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 861px) {
  #dgrid.multi .mcol { display: flex; flex-direction: column; min-height: 0; }
  #dgrid.multi .mscroll { flex: 1; min-height: 0; overflow-y: auto; }
  #dgrid.multi .map.mfill { flex: 1; min-height: 0; height: auto; }
}
.sidebar { overflow-y: auto; overscroll-behavior: contain; }

/* ---------- training portal additions ---------- */
.reg-steps{display:flex;gap:6px;flex-wrap:wrap;font-size:12px;font-weight:600;letter-spacing:.02em}
.reg-steps span{padding:4px 10px;border-radius:999px;border:1px solid var(--border);color:var(--fg-muted);display:inline-flex;align-items:center;gap:4px}
.reg-steps span.on{background:var(--primary);border-color:transparent;color:var(--primary-ink)}
.reg-steps span.done{color:var(--primary)}
.reg-steps .ic{width:14px;height:14px}
.linkrow{display:flex;gap:8px;align-items:center}
.linkrow .input{flex:1;min-width:0}
.jur-row{padding:10px;border:1px dashed var(--border);border-radius:var(--radius-sm)}
tr.dim td{opacity:.55}
.lic-ce.sm{margin-top:4px}
