/* SDEQUST. Mission gear, not a holiday planner: near-black, one hi-vis signal colour, wide heavy caps for
   headings, mono for data (ids, coordinates, counts). Square corners, hard 1px rules, viewfinder ticks. */
@font-face { font-family: "Archivo"; src: url("/static/vendor/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Waypoint"; src: url("/static/vendor/sdequst-waypoint.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "JBMono"; src: url("/static/vendor/jbmono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
:root {
  --bg: #0b0c0c; --panel: #121414; --panel-2: #1a1d1d; --panel-3: #232727; --line: #2a2f2f; --line-2: #3a4040;
  --ink: #ecebe4; --ink-2: #9aa09d; --ink-3: #6c726f;
  --sig: #c6f432; --sig-ink: #0b0c0c; --warn: #ff5a1f; --ok: #c6f432; --bad: #ff5a5a;
  --r: 3px; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Archivo", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --disp: "Waypoint", "Archivo", system-ui, sans-serif;
  --mono: "JBMono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e9e8e2; --panel: #f7f6f1; --panel-2: #eeede6; --panel-3: #e2e1d9; --line: #d6d5cc; --line-2: #b9b8ae;
  --ink: #0f1111; --ink-2: #555a58; --ink-3: #7c817e; --sig: #0f1111; --sig-ink: #c6f432; --ok: #2f7d1e;
  --shadow: 0 8px 24px rgba(0, 0, 0, .14); color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14.5px/1.45 var(--font); font-stretch: 100%; color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cap { font-stretch: 125%; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }

#map { position: fixed; inset: 0; background: #151818; }
.leaflet-container { font: inherit; background: #151818; }
.leaflet-control-attribution { font: 10px var(--mono); background: rgba(11, 12, 12, .7) !important; color: var(--ink-2); }
.leaflet-control-attribution a { color: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { border-radius: var(--r); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.leaflet-popup-content b { font-stretch: 112%; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); cursor: pointer;
  text-decoration: none; font-weight: 700; font-stretch: 112%; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary, .btn.sig { background: var(--sig); color: var(--sig-ink); border-color: var(--sig); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 11.5px; }
.btn.wide { width: 100%; }
.btn.on { border-color: var(--sig); color: var(--sig); }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r); background: transparent; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.ic { width: 20px; height: 20px; display: block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ic-locate { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3' fill='black'/%3E%3Cpath d='M12 1v4M12 19v4M1 12h4M19 12h4'/%3E%3Ccircle cx='12' cy='12' r='7.5'/%3E%3C/svg%3E"); }
.ic-layers { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='miter'%3E%3Cpath d='M12 3 2 8l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 13 10 5 10-5'/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------- floating map controls */
.fabs { position: fixed; z-index: 500; display: flex; gap: 8px; bottom: calc(env(safe-area-inset-bottom) + 18px); }
.fabs.left { left: 18px; }
.fabs.right { right: 432px; flex-direction: column; }
.fab { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--panel); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.fab:hover { border-color: var(--ink-2); }
.fab.on { color: var(--sig); border-color: var(--sig); }
.fab.add { width: auto; display: flex; gap: 8px; padding: 0 16px 0 12px; background: var(--sig); color: var(--sig-ink); border-color: var(--sig);
  font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; }
.fab.add .plus { font-size: 22px; line-height: 1; font-weight: 500; }
body.placing-mode .fab.add { background: var(--panel); color: var(--ink); border-color: var(--line-2); }

.placing { position: fixed; z-index: 600; left: 18px; top: 18px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--sig); color: var(--sig-ink); padding: 5px 5px 5px 12px; border-radius: var(--r); font-weight: 700; max-width: calc(100% - 450px); }
.placing .btn { background: var(--sig-ink); color: var(--sig); border: 0; }
.placing .btn.ghost { background: transparent; color: var(--sig-ink); }
body.placing-mode #map { cursor: crosshair; }

.routechip { position: fixed; z-index: 520; left: calc((100% - 420px) / 2); transform: translateX(-50%); top: 18px; display: flex; align-items: center;
  gap: 10px; background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--sig); border-radius: var(--r);
  padding: 5px 5px 5px 12px; box-shadow: var(--shadow); max-width: calc(100% - 470px); }
.routechip .rc-t { display: grid; line-height: 1.15; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; min-width: 0; }
.routechip .rc-t b { font-stretch: 112%; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routechip .rc-t span { font: 11px var(--mono); color: var(--ink-2); }
.routechip .x { border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 0 6px; font-size: 15px; }

/* ---------------------------------------------------------------- pins: waypoint diamonds */
.wp { background: none; border: 0; }
.wp .m { position: relative; width: 26px; height: 26px; transition: transform .12s ease; }
.wp svg { display: block; width: 26px; height: 26px; overflow: visible; }
.wp.sel .m { transform: scale(1.3); }
.wp.ghost .m { opacity: .6; }
.wp .rn { position: absolute; top: -10px; left: 15px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--sig); color: var(--sig-ink);
  font: 700 11px/18px var(--mono); text-align: center; border: 1.5px solid #0b0c0c; }
.rstop { background: none; border: 0; }
.rstop b { display: grid; place-items: center; width: 22px; height: 22px; background: var(--sig); color: #0b0c0c; font: 700 11.5px var(--mono);
  border: 2px solid #0b0c0c; box-shadow: 0 0 0 1px var(--sig); }
.me-dot { width: 14px; height: 14px; border-radius: 50%; background: #2f8fff; box-shadow: 0 0 0 2px #fff, 0 0 0 8px rgba(47, 143, 255, .25); }

/* ---------------------------------------------------------------- sidebar (laptop) / sheet (phone) */
.side { position: fixed; z-index: 700; top: 12px; right: 12px; bottom: 12px; width: 408px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.grab { display: none; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; flex: none; }
.sb-brand .mark { width: 28px; height: 28px; }
.word { display: block; width: 138px; height: 23px; background: var(--ink); color: transparent; overflow: hidden; font-size: 0;
  -webkit-mask: url("/static/wordmark.svg") left center / contain no-repeat; mask: url("/static/wordmark.svg") left center / contain no-repeat; }
.sb-brand .ver { flex: 1; font-size: 10.5px; color: var(--ink-3); align-self: flex-end; padding-bottom: 2px; }
.sb-search { position: relative; padding: 0 14px 10px; flex: none; }
.sb-search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px 0 36px; background: var(--panel-2)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa09d' stroke-width='2'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") 11px 50%/16px no-repeat; }
.sb-search input:focus { border-color: var(--ink-2); outline: none; }
.results { position: absolute; z-index: 5; top: 44px; left: 14px; right: 14px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.results button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; }
.results button:first-child { border-top: 0; }
.results button:hover { background: var(--panel-3); }
.results small { display: block; color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .none { padding: 12px; color: var(--ink-2); }
.sb-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex: none; }
.sb-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border: 0; border-right: 1px solid var(--line);
  background: none; cursor: pointer; color: var(--ink-2); font-weight: 800; font-stretch: 125%; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.sb-tabs button:last-child { border-right: 0; }
.sb-tabs button i { font: 500 10.5px var(--mono); font-style: normal; color: var(--ink-3); }
.sb-tabs button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--sig); }
.sb-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.v-head { padding: 14px 16px 8px; flex: none; }
.v-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 18px; -webkit-overflow-scrolling: touch; }
.v-foot { flex: none; display: flex; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.v-foot .push { margin-left: auto; }
.kicker { font: 600 10.5px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.v-title { margin: 2px 0 0; font-family: var(--disp); font-size: 21px; line-height: 1.12; font-weight: 400; text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-2);
  font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.back:hover { color: var(--ink); }
.bar { height: 3px; background: var(--line); margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--sig); }

/* map switcher on the spots tab */
.mapsel { display: flex; align-items: center; gap: 8px; }
.mapsel select { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); padding: 0 10px;
  font-weight: 900; font-stretch: 118%; text-transform: uppercase; letter-spacing: .03em; font-size: 15px; }
.swatch { width: 12px; height: 12px; flex: none; transform: rotate(45deg); background: var(--c); }

/* lists */
.filters { display: grid; gap: 8px; padding: 2px 16px 10px; flex: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line-2); background: none; height: 32px; cursor: pointer; color: var(--ink-2);
  font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--bg); }
.chips { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: none; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip .swatch { width: 8px; height: 8px; }
.chip.off { color: var(--ink-3); border-color: var(--line); }
.chip.off .swatch { opacity: .3; }
.row2 { display: flex; gap: 6px; }
.row2 input, .row2 select, .field input, .field select, .field textarea {
  height: 38px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 10px; background: var(--panel-2); min-width: 0; }
.row2 input { flex: 1; }
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.items > li { border-bottom: 1px solid var(--line); }
.items > li > button.it { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 2px; cursor: pointer; }
.items > li > button.it:hover { background: var(--panel-2); }
.it .badge { width: 18px; height: 18px; flex: none; }
.it .tx { flex: 1; min-width: 0; }
.it .tx b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-stretch: 105%; }
.it .tx span { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it .end { font: 11.5px var(--mono); color: var(--ink-2); white-space: nowrap; text-align: right; }
.it.cur { box-shadow: inset 3px 0 0 var(--sig); }
.os { font-style: normal; color: var(--bad); }
.os.open { color: var(--ok); }
.empty { padding: 30px 8px; text-align: center; color: var(--ink-2); }
.empty b { color: var(--ink); }

/* maps tab */
.mapcard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px 12px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: none; cursor: pointer; text-align: left; }
.mapcard:hover { background: var(--panel-2); }
.mapcard .tx { flex: 1; min-width: 0; }
.mapcard .tx b { display: block; font-family: var(--disp); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: 15px; }
.mapcard .tx span { font: 11.5px var(--mono); color: var(--ink-2); }
.mapcard.cur { box-shadow: inset 3px 0 0 var(--sig); }
.mapcard .swatch { width: 14px; height: 14px; }

/* spot sheet */
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; font: 11.5px var(--mono); color: var(--ink-2); }
.coords { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r); padding: 5px 5px 5px 10px; margin-bottom: 12px; }
.coords span { flex: 1; font: 13px var(--mono); }
.place { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.os-line { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; color: var(--bad); }
.os-line.open { color: var(--ok); }
.hours { border-collapse: collapse; width: 100%; font: 12.5px var(--mono); }
.hours th { text-align: left; font-weight: 500; color: var(--ink-3); width: 46px; padding: 2px 0; }
.hours td { padding: 2px 0; color: var(--ink-2); }
.hours tr.today th, .hours tr.today td { color: var(--ink); font-weight: 700; }
.place .pl { margin: 6px 0 0; overflow-wrap: anywhere; }
.place .pl a { color: var(--ink); }
.status { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); }
.status.done { border-color: var(--sig); }
.status h3 { margin: 0 0 4px; font-family: var(--disp); font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; color: var(--sig); }
.status p { margin: 3px 0; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 14px; color: var(--ink); }
.sec { margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font: 600 10.5px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photos .ph { aspect-ratio: 1; overflow: hidden; border: 0; padding: 0; background: var(--panel-3); cursor: zoom-in; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph.up { display: grid; place-items: center; font-size: 11px; color: var(--ink-2); cursor: default; }
.photos label.addph { aspect-ratio: 1; border: 1px dashed var(--line-2); display: grid; place-items: center; text-align: center; font: 11px var(--mono);
  color: var(--ink-2); cursor: pointer; padding: 6px; text-transform: uppercase; }
.photos label.addph b { display: block; font-size: 20px; color: var(--ink); font-weight: 400; }
.photos label.addph:hover { border-color: var(--ink-2); color: var(--ink); }
.pick-route { display: grid; gap: 4px; margin-top: 6px; }
.pick-route button { text-align: left; }

/* routes tab */
.links { display: grid; gap: 6px; }
.links .btn { width: 100%; }
.stops { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.stops li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.stops .no { display: grid; place-items: center; width: 24px; height: 24px; flex: none; background: var(--sig); color: var(--sig-ink); font: 700 11.5px var(--mono); }
.stops .tx { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 6px 0; cursor: pointer; }
.stops .tx b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.stops .tx span { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stops .mv { display: flex; gap: 2px; flex: none; }
.stops .mv button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: none; cursor: pointer; }
.stops .mv button:disabled { opacity: .3; cursor: default; }
.rcard .end b { display: block; color: var(--ink); font-weight: 700; }

/* ---------------------------------------------------------------- dialogs, menu, toast, viewer */
.modal-bg { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .66); display: grid; place-items: center; padding: 14px; }
.modal { width: min(450px, 100%); max-height: calc(100vh - 28px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2);
  border-top: 3px solid var(--sig); border-radius: var(--r); padding: 18px; }
.modal h3 { margin: 0 0 14px; font-size: 18px; font-weight: 900; font-stretch: 118%; text-transform: uppercase; letter-spacing: .03em; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label, .field > .lab { font: 600 10.5px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.field textarea { height: auto; min-height: 90px; padding: 9px 10px; resize: vertical; }
.pick { display: flex; flex-wrap: wrap; gap: 5px; }
.palette { display: flex; gap: 6px; flex-wrap: wrap; }
.palette button { width: 32px; height: 32px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel-2); cursor: pointer; display: grid; place-items: center; }
.palette button.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--panel); }
.rate { display: flex; gap: 4px; }
.rate button { width: 40px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r); background: none; font: 700 13px var(--mono); cursor: pointer; color: var(--ink-2); }
.rate button.on { background: var(--sig); color: var(--sig-ink); border-color: var(--sig); }
.m-foot { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.catrow { display: grid; grid-template-columns: 1fr 50px 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.catrow input { height: 38px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 8px; background: var(--panel-2); min-width: 0; }
.catrow input[type=color] { padding: 2px; }
.catrow .del { border: 0; background: none; font-size: 18px; color: var(--ink-2); cursor: pointer; }
.hrs { display: grid; grid-template-columns: 44px 1fr; gap: 4px 8px; align-items: center; }
.hrs label { font: 12px var(--mono); color: var(--ink-2); }
.hrs input { height: 34px; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
details.more summary { cursor: pointer; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: 10px; }
.menu { position: fixed; z-index: 800; top: 62px; right: 26px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 4px; min-width: 240px; }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer;
  text-decoration: none; color: var(--ink); font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--panel-3); }
.toast { position: fixed; z-index: 1100; left: calc((100% - 420px) / 2); transform: translateX(-50%); bottom: 22px; background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: var(--r); max-width: calc(100% - 470px); font-weight: 600; }
.lb { position: fixed; inset: 0; z-index: 1000; background: #050606; display: flex; flex-direction: column; color: #fff; touch-action: pan-y; }
.lb-top { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top) + 8px) 8px 8px 14px; border-bottom: 1px solid #222; }
.lb-top .n { flex: 1; font: 12px var(--mono); opacity: .8; }
.lb-top .btn { background: transparent; color: #fff; border-color: #444; }
.lb-img { flex: 1; display: grid; place-items: center; min-height: 0; padding: 8px; }
.lb-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 60px; border: 1px solid #444; background: rgba(0, 0, 0, .4); color: #fff; font-size: 24px; cursor: pointer; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
@media (hover: none) { .lb-nav { display: none; } }

/* ---------------------------------------------------------------- phone: the sidebar becomes a bottom sheet */
@media (max-width: 900px) {
  .side { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 78vh; border-radius: 10px 10px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); transition: height .2s ease; }
  .side.peek { height: 168px; }
  .side.peek .sb-view { visibility: hidden; }
  .grab { display: block; flex: none; height: 18px; border: 0; background: none; cursor: pointer; position: relative; }
  .grab::after { content: ""; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-2); }
  .sb-brand { padding-top: 0; }
  .fabs { bottom: calc(env(safe-area-inset-bottom) + 182px); transition: bottom .2s ease; }
  .fabs.right { right: 14px; }
  .fabs.left { left: 14px; }
  body:not(.sheet-peek) .fabs { bottom: calc(78vh + 14px); }
  body:not(.sheet-peek) .fabs.left { display: none; }
  .routechip { left: 50%; top: calc(env(safe-area-inset-top) + 12px); max-width: calc(100% - 24px); }
  body:not(.sheet-peek) .routechip { display: none; }
  .routechip .rc-t span { white-space: nowrap; }
  .placing { left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 12px); max-width: none; }
  .toast { left: 50%; bottom: auto; top: calc(env(safe-area-inset-top) + 64px); max-width: calc(100% - 28px); }
  .menu { top: auto; bottom: calc(78vh - 60px); right: 14px; }
}

/* ---------------------------------------------------------------- login */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.login-card { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--sig); border-radius: var(--r);
  padding: 22px; display: grid; gap: 6px; }
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.login-card .brand .word { width: 156px; height: 26px; }
.login-card .brand img { width: 30px; height: 30px; }
.login-card label { font: 600 10.5px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.login-card input { height: 44px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 10px; background: var(--panel-2); margin-bottom: 8px; }
.login-card .err { color: var(--bad); margin: 0 0 4px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* SDEQUST Waypoint: the display lettering */
.sb-tabs button span, .btn, .fab.add .lbl, .routechip b, .mapsel select { font-family: var(--disp); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }
