/* Stadium Checks — dark, booth-friendly, responsive. */
:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --surface-3: #2c2c2a;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --hairline: rgba(255,255,255,0.10);
  --grid: #2c2c2a;
  --accent: #C99700;         /* venue accent (default: ND gold) — chrome only, never data */
  --accent-ink: #10100e;
  --accent-soft: rgba(201,151,0,0.12);
  --good: #0ca30c;           /* pass */
  --warning: #fab219;        /* resolved (fixed on the spot) */
  --serious: #ec835a;
  --critical: #d03b3b;       /* fail */
  --nt: #52514e;             /* not tested */
  --radius: 12px;
  --nav-h: 58px;
  font-size: 16px;
}
/* ---------- light mode ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e1e0d9;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: rgba(11,11,11,0.12);
  --grid: #e1e0d9;
  --accent: #0C2340;         /* venue accent (default: ND navy) */
  --accent-ink: #ffffff;
  --accent-soft: rgba(12,35,64,0.10);
  --nt: #b9b7af;
}
:root[data-theme="light"] .topbar { background: rgba(249,249,247,0.92); }
:root[data-theme="light"] .bottomnav { background: rgba(249,249,247,0.95); }
:root[data-theme="light"] .chip.pass { color: #006300; border-color: rgba(12,163,12,.45); background: rgba(12,163,12,.10); }
:root[data-theme="light"] .chip.fail { color: #a52f2f; border-color: rgba(208,59,59,.5); background: rgba(208,59,59,.10); }
:root[data-theme="light"] .chip.resolved { color: #8a5b00; border-color: rgba(250,178,25,.55); background: rgba(250,178,25,.14); }
:root[data-theme="light"] .btn.danger { color: #a52f2f; }
:root[data-theme="light"] .login-err { color: #a52f2f; }
:root[data-theme="light"] .statusbtn.pass.sel { color: #006300; }
:root[data-theme="light"] .statusbtn.fail.sel { color: #a52f2f; }
:root[data-theme="light"] .statusbtn.resolved.sel { color: #8a5b00; }
:root[data-theme="light"] .node .bubble { stroke: #ffffff; }
:root[data-theme="light"] .tile .big.warn { color: #8a5b00; }
:root[data-theme="light"] .planwrap .plan-img { opacity: 1; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ---------- layout shell ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.splash { display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center; min-height:100vh; }
.splash-mark { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.02em; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px);
  background: rgba(13,13,13,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar .brand { font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.topbar .brand .gold { color: var(--accent); }
.topbar .crumb { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.userchip {
  display:flex; align-items:center; gap:8px; border:1px solid var(--hairline);
  background: var(--surface); border-radius: 99px; padding: 5px 12px 5px 6px; cursor: pointer;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size: 0.8rem;
}
.live-dot { width:8px; height:8px; border-radius:50%; background: var(--nt); }
.live-dot.on { background: var(--good); box-shadow: 0 0 6px var(--good); }

main.content { flex: 1; padding: 14px; padding-bottom: calc(var(--nav-h) + 24px); max-width: 1200px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) { main.content { padding: 22px 28px calc(var(--nav-h) + 30px); } }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(13,13,13,0.95); backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline);
}
.bottomnav button {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 0.68rem; font-weight: 600;
}
.bottomnav button svg { width: 22px; height: 22px; }
.bottomnav button.active { color: var(--accent); }

/* ---------- cards / lists ---------- */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.card.tappable { cursor: pointer; transition: background 0.12s; }
.card.tappable:hover { background: var(--surface-2); }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .grid.cols { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }

h1.page { font-size: 1.25rem; margin: 4px 0 14px; }
h2.section { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 20px 0 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; transition: filter .12s;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: none; }
.btn.sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn.danger { color: #ff9d9d; border-color: rgba(208,59,59,0.5); }
.btn:disabled { opacity: 0.45; cursor: default; }
.iconbtn {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px;
  width: 40px; height: 40px; display:flex; align-items:center; justify-content:center; cursor:pointer;
}

/* ---------- status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 700; border-radius: 99px; padding: 3px 9px;
  border: 1px solid var(--hairline); color: var(--ink-2); white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; }
.chip.pass { color: #7bdc7b; border-color: rgba(12,163,12,.45); background: rgba(12,163,12,.12); }
.chip.fail { color: #ff9d9d; border-color: rgba(208,59,59,.5); background: rgba(208,59,59,.14); }
.chip.resolved { color: #ffd479; border-color: rgba(250,178,25,.45); background: rgba(250,178,25,.12); }
.chip.not_tested { color: var(--muted); background: rgba(82,81,78,.25); }

/* stacked status bar (2px gaps between segments per mark spec) */
.statusbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.statusbar span { height: 100%; }
.statusbar .s-pass { background: var(--good); }
.statusbar .s-resolved { background: var(--warning); }
.statusbar .s-fail { background: var(--critical); }
.statusbar .s-nt { background: var(--nt); }

.readiness { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login-wrap { max-width: 380px; margin: 8vh auto 0; padding: 20px; }
.login-title { text-align:center; font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.login-sub { text-align: center; margin-bottom: 24px; }
.namegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.namegrid .btn { justify-content: flex-start; }
.namegrid .btn.sel { border-color: var(--accent); background: rgba(212,160,23,0.12); }
.pinrow { display: flex; gap: 10px; justify-content: center; margin: 16px 0 6px; }
.pindot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); }
.pindot.full { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.keypad button {
  height: 56px; font-size: 1.3rem; font-weight: 600; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--hairline); cursor: pointer;
}
.keypad button:active { background: var(--surface-3); }
.login-err { color: #ff9d9d; text-align: center; min-height: 1.3em; margin-top: 10px; font-weight: 600; }

/* ---------- floorplan ---------- */
.planwrap {
  position: relative; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden; touch-action: none;
  height: 52vh; min-height: 300px;
}
@media (min-width: 900px) { .planwrap { height: 62vh; } }
.planwrap svg { width: 100%; height: 100%; display: block; cursor: grab; }
.planwrap svg.panning { cursor: grabbing; }
.planwrap .plan-img { opacity: 0.92; }
.plan-tools {
  position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5;
}
.plan-tools .iconbtn { background: rgba(26,26,25,0.9); }
.plan-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.node { cursor: pointer; }
.node circle.halo { fill: transparent; }
.node .bubble { stroke: var(--page); stroke-width: 1.5; }
.node.pass .bubble { fill: var(--good); }
.node.fail .bubble { fill: var(--critical); }
.node.resolved .bubble { fill: var(--warning); }
.node.not_tested .bubble { fill: #6b6a66; }
.node.selected .bubble { stroke: var(--accent); stroke-width: 2.5; }
.node text { fill: #fff; font-weight: 700; pointer-events: none; }
.node .glyph { fill: rgba(0,0,0,0.85); }
.node.not_tested .glyph { fill: rgba(255,255,255,0.9); }
.node.dragging .bubble { stroke: var(--accent); stroke-dasharray: 3 2; }

.viewtoggle { display: flex; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.viewtoggle button { flex: 1; border: none; background: none; padding: 8px 14px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.viewtoggle button.active { background: var(--surface-3); color: var(--ink); }

/* item rows */
.itemrow {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--hairline); cursor: pointer;
}
.itemrow:last-child { border-bottom: none; }
.itemrow:hover { background: var(--surface-2); }
.itemrow .kind-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex: none; }
.itemrow .kind-ic svg { width: 17px; height: 17px; }
.itemrow .name { font-weight: 600; font-size: 0.92rem; }
.itemrow .sub { font-size: 0.75rem; color: var(--muted); }
.itemlist .sechead {
  padding: 10px 12px 4px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); background: var(--surface);
}
.badge-unplaced { font-size: 0.68rem; color: var(--warning); font-weight: 700; }

/* ---------- bottom sheet / modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 700px) { .overlay { align-items: center; } }
.sheet {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 88vh;
  overflow-y: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  animation: up .16s ease-out;
}
@media (min-width: 700px) { .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0; font-size: 1.05rem; }
.statusbtns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.statusbtn {
  border-radius: 12px; border: 1.5px solid var(--hairline); background: var(--surface-2);
  padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; font-weight: 700; font-size: 0.9rem;
}
.statusbtn svg { width: 22px; height: 22px; }
.statusbtn.pass.sel { border-color: var(--good); background: rgba(12,163,12,.14); color: #7bdc7b; }
.statusbtn.fail.sel { border-color: var(--critical); background: rgba(208,59,59,.16); color: #ff9d9d; }
.statusbtn.resolved.sel { border-color: var(--warning); background: rgba(250,178,25,.13); color: #ffd479; }
.statusbtn.not_tested.sel { border-color: var(--muted); background: rgba(82,81,78,.3); }
.histrow { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 0.85rem; }
.histrow:last-child { border-bottom: none; }

/* ---------- dashboard ---------- */
.dash { max-width: 1400px; margin: 0 auto; }
.dash-hero { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .dash-hero { grid-template-columns: 300px 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px; }
.tile .label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tile .big { font-size: 3.4rem; font-weight: 800; line-height: 1.1; }
.tile .big.ok { color: var(--good); }
.tile .big.warn { color: var(--warning); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.statmini { text-align: left; }
.statmini .v { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.arearow { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.arearow:last-child { border-bottom: none; }
.arearow .nm { width: 210px; flex: none; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .arearow .nm { width: 130px; font-size: .8rem; } }
.arearow .statusbar { flex: 1; }
.arearow .pct { width: 52px; text-align: right; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; }
.feed { max-height: 420px; overflow-y: auto; }
.feeditem { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: .88rem; align-items: baseline; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-2); margin-top: 10px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th { text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--hairline); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.tappable { cursor: pointer; }
table.data tr.tappable:hover { background: var(--surface-2); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: calc(var(--nav-h) + 16px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.toast {
  background: var(--surface-3); border: 1px solid var(--hairline); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 0.9rem;
  animation: up .18s ease-out; max-width: 90vw;
}
.toast.err { border-color: rgba(208,59,59,.6); }

/* editor palette */
.editor-banner {
  display: flex; align-items: center; gap: 10px; background: rgba(212,160,23,0.1);
  border: 1px solid rgba(212,160,23,0.45); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
  font-size: 0.85rem; font-weight: 600;
}
.placing { outline: 2px dashed var(--accent); outline-offset: -2px; }

.searchrow { display: flex; gap: 8px; margin: 10px 0; }
.progress-inline { font-size: .78rem; color: var(--muted); }
.pill-count { font-weight: 800; font-variant-numeric: tabular-nums; }

/* venue cards */
.venuecard { display: flex; align-items: center; gap: 14px; }
.venuelogo {
  width: 54px; height: 54px; border-radius: 12px; flex: none;
  background: var(--surface-2); border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-weight: 800; font-size: 1.2rem; color: var(--accent);
}
.venuelogo img { width: 100%; height: 100%; object-fit: contain; }
.topbar .venuelogo { width: 30px; height: 30px; border-radius: 8px; font-size: 0.8rem; }
.swatchrow { display: flex; align-items: center; gap: 10px; }
.swatchrow input[type="color"] { width: 46px; height: 34px; padding: 2px; cursor: pointer; }

/* clickable feed rows */
.feeditem.tappable { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding: 8px 6px; }
.feeditem.tappable:hover { background: var(--surface-2); }

/* highlighted node (deep-linked) */
.node.flash .halo { fill: var(--accent); opacity: 0; animation: pulse 1.2s ease-out 3; }
@keyframes pulse { 0% { opacity: .5; transform: scale(.5);} 100% { opacity: 0; transform: scale(1.6);} }

.mode-btn { width: 36px; height: 36px; }
.version-tag { text-align: center; color: var(--muted); font-size: .72rem; margin: 18px 0 4px; }

/* ---------- v1.2 ---------- */
.avatar.photo { background: var(--surface-3); overflow: hidden; padding: 0; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* topbar readiness chip */
.readychip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline); background: var(--surface); border-radius: 99px;
  padding: 5px 12px; cursor: pointer; font-weight: 800; font-size: 0.85rem;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.readychip .fails { color: var(--critical); font-size: 0.75rem; }
.readychip .ok { color: var(--good); }

/* HTML marker layer (constant-size icons over the SVG plan) */
.markers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.marker {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; will-change: transform;
}
.marker .dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.92);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  transition: transform .12s;
}
.marker:active .dot { transform: scale(1.15); }
.marker .dot svg { width: 16px; height: 16px; stroke: rgba(0,0,0,0.82); }
.marker.not_tested .dot { background: #7c7a75; }
.marker.not_tested .dot svg { stroke: rgba(255,255,255,0.95); }
.marker.pass .dot { background: var(--good); }
.marker.fail .dot { background: var(--critical); }
.marker.fail .dot svg { stroke: rgba(255,255,255,0.95); }
.marker.resolved .dot { background: var(--warning); }
.marker .mlabel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: -4px; padding: 2px 7px; border-radius: 6px;
  background: rgba(13,13,13,0.85); color: #fff; font-size: 0.68rem; font-weight: 700;
  white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
:root[data-theme="light"] .marker .mlabel { background: rgba(252,252,251,0.92); color: #0b0b0b; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.planwrap.labels-on .marker .mlabel { opacity: 1; }
.marker.selected .dot, .marker.dragging .dot { outline: 3px solid var(--accent); outline-offset: 1px; }
.marker.flash .dot { animation: markerpulse 0.9s ease-out 4; }
@keyframes markerpulse { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 22px rgba(0,0,0,0); } }

/* full-viewport map mode (no page scroll) */
.maplock main.content { height: calc(100dvh - 57px); overflow: hidden; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + 10px); }
.maplock .planwrap { flex: 1; height: auto; min-height: 160px; }
.tasks-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hairline); background: var(--surface); border-radius: 99px;
  padding: 5px 12px; cursor: pointer; font-size: 0.8rem; font-weight: 700;
}
.tasks-pill .n { color: var(--accent); }

/* building section headers pop in accent */
h2.section.bldg { color: var(--accent); font-size: 0.85rem; letter-spacing: 0.1em; border-bottom: 2px solid var(--accent-soft); padding-bottom: 4px; }

/* compact dashboard — fits a laptop screen */
.dash.compact { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.dash.compact h1 { margin: 2px 0 0; font-size: 1.05rem; }
.dash.compact .dash-grid { flex: 1; display: grid; gap: 10px; grid-template-columns: 230px 1.4fr 1fr; grid-template-rows: 100%; min-height: 0; }
@media (max-width: 980px) { .dash.compact { height: auto; overflow: visible; } .dash.compact .dash-grid { grid-template-columns: 1fr; grid-template-rows: auto; } }
.dash.compact .tile { padding: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.dash.compact .tile .big { font-size: 2.6rem; }
.dash.compact .scrolly { flex: 1; overflow-y: auto; min-height: 0; }
.dash.compact .statmini .v { font-size: 1.3rem; }
.dash.compact .arearow { padding: 5px 0; }
.dash.compact .arearow .nm { width: 170px; font-size: 0.82rem; }
.dash.compact .feeditem { padding: 6px 0; font-size: 0.82rem; }
.dash.compact .legend { font-size: 0.7rem; gap: 10px; }
.statmini.tappable { cursor: pointer; border-radius: 8px; }
.statmini.tappable:hover { background: var(--surface-2); }

/* tasks */
.navbadge {
  position: absolute; top: 4px; right: calc(50% - 20px);
  background: var(--critical); color: #fff; font-size: 0.62rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.bottomnav button { position: relative; }
.taskcard .prog { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.taskcard .prog span { display: block; height: 100%; background: var(--accent); }
.taskcard.done { opacity: 0.6; }

/* achievements */
.badge-toast { display: flex; gap: 10px; align-items: center; border-color: var(--accent); }
.badge-emoji { font-size: 1.6rem; }
.badgegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badgecard { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px; text-align: center; }
.badgecard .be { font-size: 1.8rem; }
.badgecard .bn { font-weight: 800; font-size: 0.82rem; margin-top: 4px; }
.badgecard .bd { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.xpbar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.xpbar span { display: block; height: 100%; background: var(--accent); }
.lvl-pill { background: var(--accent); color: var(--accent-ink); font-weight: 800; border-radius: 99px; padding: 2px 10px; font-size: 0.8rem; }

/* icon picker */
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.iconpick button {
  aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--hairline); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconpick button.sel { border-color: var(--accent); background: var(--accent-soft); }
.iconpick button svg { width: 22px; height: 22px; }

/* user picker rows */
.userpick { max-height: 45vh; overflow-y: auto; }
.userpick .row { padding: 9px 4px; border-bottom: 1px solid var(--hairline); cursor: pointer; border-radius: 8px; }
.userpick .row:hover { background: var(--surface-2); }


/* ---------- v1.3 ---------- */
/* topbar: don't let controls get crushed on phones */
.topbar .iconbtn, .topbar .readychip, .topbar .live-dot, .topbar .userchip, .topbar .venuelogo { flex: none; }
.mode-btn { flex: none; min-width: 36px; }
@media (max-width: 640px) {
  .topbar .crumb { display: none; }
  .topbar .userchip .small { display: none; }
  .topbar .userchip { padding: 4px; border: none; background: none; }
  .topbar { gap: 7px; padding: 8px 10px; }
  .topbar .brand { font-size: 0.95rem; }
}

/* floorplan color modes (invert the plan image only, never the markers) */
:root[data-theme="light"] .planwrap.plan-inv-light .plan-img { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .planwrap.plan-inv-dark .plan-img { filter: invert(1) hue-rotate(180deg); }

/* photos */
.photothumb { object-fit: cover; border-radius: 8px; border: 1px solid var(--hairline); cursor: zoom-in; flex: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 8px; }
.photo-attach { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.photo-attach .preview { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--hairline); }

/* assignment notification toast */
.assign-toast { border-color: var(--accent); display: flex; gap: 10px; align-items: center; cursor: pointer; pointer-events: auto; }


/* ---------- v1.4 ---------- */
/* real touch targets on phones/tablets */
@media (pointer: coarse) {
  .topbar .iconbtn, .mode-btn { width: 44px; height: 44px; min-width: 44px; border-radius: 12px; }
  .mode-btn svg { width: 21px; height: 21px; }
  .iconbtn { width: 44px; height: 44px; }
  .btn.sm { padding: 10px 15px; font-size: 0.92rem; }
  .readychip { padding: 9px 15px; font-size: 0.95rem; }
  .viewtoggle button { padding: 12px 14px; font-size: 0.92rem; }
  .plan-tools .iconbtn { width: 46px; height: 46px; }
  .topbar .userchip .avatar { width: 34px !important; height: 34px !important; font-size: 0.85rem !important; }
  .itemrow { padding: 13px 12px; }
}

/* home button top-left */
.homebtn { flex: none; }

/* persistent assignment banners (must be dismissed) */
#banner-root {
  position: fixed; top: 62px; left: 0; right: 0; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; padding: 0 10px;
}
.banner {
  pointer-events: auto; width: 100%; max-width: 560px;
  background: var(--surface); border: 2px solid var(--accent); border-radius: 14px;
  padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  animation: bannerIn .25s ease-out;
}
@keyframes bannerIn { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.banner .bicon { font-size: 1.6rem; flex: none; }
.banner .btext { flex: 1; min-width: 0; }
.banner .btext strong { display: block; }
.banner .btext .small { color: var(--ink-2); }
.banner .btn { flex: none; }

/* let the venue name shrink/ellipsize before controls get pushed off-screen */
.topbar .brand { flex: 0 1 auto; min-width: 36px; overflow: hidden; text-overflow: ellipsis; }


/* v1.4.1 fixes */
.dash .scrolly { overflow-x: hidden; }
.dash .feeditem.tappable { margin: 0; padding: 8px 4px; }
.feeditem .grow { min-width: 0; overflow-wrap: break-word; }


/* v1.6: markers never intercept gestures in check mode — taps are hit-tested by the map */
.markers .marker { pointer-events: none; }
.markers.editing .marker { pointer-events: auto; }


/* ---------- v1.6.1: iOS standalone safe areas ---------- */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }
.topbar { padding-top: calc(10px + var(--sat)); }
@media (max-width: 640px) { .topbar { padding-top: calc(8px + var(--sat)); } }
#banner-root { top: calc(62px + var(--sat)); }
/* full-viewport layouts must subtract the insets too */
.maplock main.content {
  height: calc(100dvh - 57px - var(--sat));
  padding-bottom: calc(var(--nav-h) + var(--sab) + 10px);
}


/* login dropdown */
.login-select-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.login-select-row select { flex: 1; font-size: 1.05rem; padding: 13px 12px; }


/* v1.6.2: dashboard uses the same locked-viewport layout as the map (no magic heights) */
.maplock .dash.compact { flex: 1 1 auto; min-height: 0; height: auto; }


/* ---------- v1.6.3: true app-shell layout ---------- */
/* The document itself never scrolls — only the content pane between the bars.
   This makes the top/bottom bars physically immovable (kills every iOS
   fixed-position drift bug) and consistent on every tab. */
html, body { height: 100%; overflow: hidden; }
#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.topbar { position: static; flex: none; }
main.content {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-bottom: 28px; /* nav no longer overlays content — modest breathing room only */
}
.bottomnav { position: static; flex: none; }
/* map/dashboard locked modes: the pane simply stops scrolling — flex does the rest */
.maplock main.content { height: auto; overflow: hidden; padding-bottom: 10px; }
/* login screen scrolls inside the shell too */
#app > .login-wrap { overflow-y: auto; flex: 1 1 auto; min-height: 0; width: 100%; }
/* toasts sit just above the (now in-flow) nav — same visual position */
#toast-root { bottom: calc(var(--nav-h) + var(--sab) + 16px); }


/* v1.6.5: drag items from the palette onto the map */
.chip-drag { touch-action: none; }
.drag-ghost {
  position: fixed; left: -17px; top: -17px; z-index: 300; pointer-events: none;
  display: flex; align-items: center; gap: 7px;
}
.drag-ghost .dot {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.92); box-shadow: 0 3px 12px rgba(0,0,0,0.5);
}
.drag-ghost .dot svg { width: 18px; height: 18px; stroke: var(--accent-ink); }
.drag-ghost .glabel {
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 3px 9px; border-radius: 7px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}


/* v1.6.5: edit-mode ergonomics */
.plan-tools { pointer-events: none; }           /* gaps between tool buttons pass through to the map */
.plan-tools .iconbtn { pointer-events: auto; }
.maplock .planwrap { min-height: 300px; }        /* editing must leave a usable map */
.palette-strip { padding: 8px; }
.palette-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; }
.palette-row .btn { flex: none; }
