:root {
  --bg: #f6f2ec;
  --panel: #fffdf9;
  --panel-2: #f1ebe2;
  --ink: #1f1a15;
  --ink-2: #5d544a;
  --line: #e2d9cc;
  --accent: #8b3a1a;
  --accent-ink: #fff;
  --accent-soft: #f3e2d8;
  --ok: #2f8a4c;
  --warn: #c98a12;
  --bad: #b8322a;
  --shadow: 0 6px 24px rgba(40, 25, 10, .18);
  --radius: 14px;
  --dock-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --panel: #1f1a15; --panel-2: #29221b; --ink: #f2ebe2; --ink-2: #b4a899;
    --line: #3a3027; --accent: #d0703f; --accent-soft: #3b2418; --shadow: 0 6px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --panel: #1f1a15; --panel-2: #29221b; --ink: #f2ebe2; --ink-2: #b4a899;
  --line: #3a3027; --accent: #d0703f; --accent-soft: #3b2418; --shadow: 0 6px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button svg, .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: linear-gradient(to bottom, rgba(20,15,10,.78), rgba(20,15,10,0));
  color: #fff; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: conic-gradient(from 45deg, #8b3a1a 0 25%, #c27c0e 0 50%, #8b3a1a 0 75%, #e9d5c3 0); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.brand h1 { font-size: 16px; margin: 0; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.brand p { font-size: 11.5px; margin: 0; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.search { position: relative; margin-inline-start: auto; width: min(340px, 46vw); }
.search input {
  width: 100%; border: 0; border-radius: 999px; padding: 9px 14px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow); outline: none; font-size: 14px;
}
.search-results {
  position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--panel); color: var(--ink);
  border-radius: 12px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto;
}
.search-results button { display: block; width: 100%; text-align: start; padding: 10px 12px; border: 0; background: none; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.search-results button small { display: block; color: var(--ink-2); font-size: 11.5px; }
.search-results button:hover { background: var(--panel-2); }
@media (max-width: 560px) {
  .brand p { display: none; }
  .search { width: auto; flex: 1; }
}

/* ---------- map ---------- */
#map { position: fixed; inset: 0; background: #ddd; }
.leaflet-container { font-family: inherit; direction: ltr; }
.leaflet-control-attribution { font-size: 9px !important; direction: ltr; }
.leaflet-bottom.leaflet-left, .leaflet-bottom.leaflet-right { bottom: calc(var(--dock-h) + var(--safe-b) + 4px); }
.leaflet-control-scale-line { background: rgba(255,255,255,.85); border-color: #333; font-size: 10px; }
.leaflet-tooltip.lbl {
  background: rgba(20, 15, 10, .78); color: #fff; border: 0; box-shadow: none; border-radius: 6px;
  padding: 1px 6px; font: 600 11px "IBM Plex Sans Arabic", sans-serif; direction: rtl;
}
.leaflet-tooltip.lbl::before { display: none; }
.leaflet-tooltip.hid { background: rgba(139,58,26,.92); font-size: 10px; padding: 0 4px; }
.plan-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; max-width: none !important; }

.pin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45); position: relative; }
.pin.photo::after { content: ""; position: absolute; top: -4px; inset-inline-end: -4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #222; }
.lm { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2.5px solid #1d5f8a; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.me { width: 20px; height: 20px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25), 0 1px 6px rgba(0,0,0,.4); position: relative; }
.me .hd { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; }
.me .hd::before { content: ""; position: absolute; left: -9px; top: -34px; border: 9px solid transparent; border-bottom: 22px solid rgba(26,115,232,.55); border-top: 0; }

/* ---------- fabs ---------- */
.fabs { position: fixed; z-index: 900; inset-inline-start: 12px; bottom: calc(var(--dock-h) + var(--safe-b) + 40px); display: flex; flex-direction: column; gap: 10px; }
.fab {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer;
}
.fab.on { background: #1a73e8; color: #fff; }
.fab.follow { background: #1a73e8; color: #fff; box-shadow: 0 0 0 4px rgba(26,115,232,.35), var(--shadow); }
.fab.active { background: var(--accent); color: var(--accent-ink); }

.gps-chip {
  position: fixed; z-index: 900; inset-inline-start: 66px; bottom: calc(var(--dock-h) + var(--safe-b) + 48px);
  background: var(--panel); color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; box-shadow: var(--shadow);
}
.track-bar, .mode-bar {
  position: fixed; z-index: 950; left: 50%; transform: translateX(-50%);
  top: calc(66px + env(safe-area-inset-top, 0px));
  background: var(--panel); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; font-size: 13.5px; max-width: calc(100vw - 24px);
}
.mode-bar { border-radius: 16px; flex-wrap: wrap; justify-content: center; padding: 8px 12px; }
.mode-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.crosshair { position: fixed; z-index: 800; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.crosshair span { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; }
.crosshair span::before, .crosshair span::after { content: ""; position: absolute; background: #e53935; box-shadow: 0 0 0 1px #fff; }
.crosshair span::before { left: 17px; top: 0; width: 2px; height: 36px; }
.crosshair span::after { top: 17px; left: 0; height: 2px; width: 36px; }

/* ---------- dock ---------- */
.dock {
  position: fixed; z-index: 1000; inset: auto 0 0 0; height: calc(var(--dock-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: var(--panel); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.dock button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.dock button.on { color: var(--accent); }
.dock button[data-panel="add"] svg { background: var(--accent); color: #fff; border-radius: 50%; padding: 4px; width: 30px; height: 30px; stroke-width: 2.4; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed; z-index: 1100; inset-inline: 0; bottom: calc(var(--dock-h) + var(--safe-b));
  max-height: min(72vh, 680px); background: var(--panel); color: var(--ink);
  border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.22);
  display: flex; flex-direction: column; animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 900px) {
  .sheet { inset-inline-start: 12px; inset-inline-end: auto; width: 400px; top: 70px; bottom: calc(var(--dock-h) + 12px); max-height: none; border-radius: 16px; }
  .fabs { inset-inline-start: auto; inset-inline-end: 12px; }
  .gps-chip { inset-inline-start: auto; inset-inline-end: 66px; }
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); position: relative; }
.sheet-head h2 { font-size: 16px; margin: 0; flex: 1; }
.grip { position: absolute; top: 5px; left: 50%; width: 38px; height: 4px; border-radius: 4px; background: var(--line); transform: translateX(-50%); }
.icon-btn { border: 0; background: var(--panel-2); color: var(--ink); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.sheet-body { overflow: auto; padding: 12px 14px 18px; -webkit-overflow-scrolling: touch; }

/* ---------- ui bits ---------- */
.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 999px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > .btn { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 12px; text-align: start;
  cursor: pointer; display: flex; gap: 10px; align-items: flex-start;
}
.tile b { display: block; font-size: 14px; }
.tile small { color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.tile .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.tile .ico svg { width: 19px; height: 19px; }
h3 { font-size: 13px; color: var(--ink-2); margin: 16px 0 8px; font-weight: 600; letter-spacing: 0; }
h3:first-child { margin-top: 2px; }
.muted { color: var(--ink-2); font-size: 12.5px; line-height: 1.6; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.f input, .f select, .f textarea {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 11px; font-size: 15px; outline: none;
}
.f textarea { min-height: 72px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }

.switch { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .sw { margin-inline-start: auto; width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: .15s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch.on .sw { background: var(--accent); }
.switch.on .sw::after { inset-inline-start: 20px; }
.switch .sw-l { font-size: 14px; }
.switch .sw-l small { display: block; color: var(--ink-2); font-size: 11.5px; }
.swatch { width: 16px; height: 16px; border-radius: 4px; flex: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.basemaps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.basemaps button { border: 2px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 8px 4px; font-size: 12px; cursor: pointer; }
.basemaps button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--panel-2); border-radius: 12px; padding: 10px; }
.kpi b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--ink-2); }
.progress { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 6px 0 2px; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 112px 1fr 44px; align-items: center; gap: 8px; font-size: 12.5px; }
.bar .t { height: 9px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar .t i { display: block; height: 100%; border-radius: 999px; }
.bar .v { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.list-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item .thumb { width: 46px; height: 46px; border-radius: 10px; background: var(--panel-2) center/cover; flex: none; display: grid; place-items: center; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta small { color: var(--ink-2); font-size: 12px; }
.list-item .dist { font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos .ph { aspect-ratio: 1; border-radius: 10px; background: var(--panel-2) center/cover; position: relative; cursor: zoom-in; }
.photos .ph button { position: absolute; top: 4px; inset-inline-start: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; cursor: pointer; }
.photos .add { border: 2px dashed var(--line); display: grid; place-items: center; color: var(--ink-2); cursor: pointer; font-size: 12px; text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; }

.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 6px; }
.lightbox .icon-btn { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; background: rgba(255,255,255,.15); color: #fff; }
.toast {
  position: fixed; z-index: 4000; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + var(--safe-b) + 16px);
  background: #221b14; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
}
.legend { display: grid; gap: 4px; margin-top: 6px; font-size: 12.5px; }
.legend span { display: flex; align-items: center; gap: 8px; }

/* ---------- labels by zoom ---------- */
.z-lt17 .lbl-name, .z-lt18 .lbl-lm, .z-lt19 .lbl-id { display: none; }
.z-lt17 .thumb-pin { transform: scale(.7); }
.leaflet-tooltip.lbl-id { background: rgba(80, 28, 8, .85); font-size: 9.5px; padding: 0 4px; }
.leaflet-tooltip.lbl-lm { background: rgba(14, 50, 75, .82); font-weight: 500; font-size: 10.5px; }

/* ---------- photo thumbnails on the map ---------- */
.thumb-pin {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; background: #555 center/cover;
  box-shadow: 0 2px 8px rgba(0,0,0,.55); position: relative; cursor: pointer; transition: transform .12s;
}
.thumb-pin:hover { transform: scale(1.15); }
.thumb-pin b { position: absolute; bottom: -4px; inset-inline-end: -6px; background: #9c3d16; color: #fff; font-size: 10px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; border: 2px solid #fff; font-weight: 700; }
.thumb-pin.pt { border-width: 3.5px; }

/* ---------- building card hero ---------- */
.hero { position: relative; margin: -2px -14px 0; }
.hero-strip { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 14px; -webkit-overflow-scrolling: touch; }
.hero-ph { flex: 0 0 82%; height: 190px; border: 0; border-radius: 14px; background: var(--panel-2) center/cover; scroll-snap-align: center; cursor: zoom-in; }
.hero-ph:only-child { flex-basis: 100%; }
.hero-count { position: absolute; top: 8px; inset-inline-start: 24px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.hero-empty { margin: 0 14px; height: 120px; border-radius: 14px; border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.hero-empty svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- gallery ---------- */
.lightbox .lb-cap { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.lightbox .lb-prev, .lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; cursor: pointer; }
.lightbox .lb-prev { right: 12px; } .lightbox .lb-next { left: 12px; }
.lightbox .lb-dl { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.leaflet-tooltip.lbl-street { background: rgba(60, 40, 0, .78); color: #ffe7a8; font-size: 10.5px; }
.z-lt17 .lbl-street { display: none; }

/* ---------- places & axes ---------- */
.place-pin { border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); cursor: pointer; }
.leaflet-tooltip.lbl-axis { background: rgba(90, 20, 140, .85); color: #fff; font-size: 11px; }

/* ---------- modes ---------- */
.modes { position: fixed; z-index: 1001; left: 50%; transform: translateX(-50%); top: calc(58px + env(safe-area-inset-top, 0px));
  display: flex; background: var(--panel); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.modes button { border: 0; background: none; color: var(--ink-2); padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.modes button.on { background: var(--accent); color: #fff; }
.track-bar, .mode-bar { top: calc(104px + env(safe-area-inset-top, 0px)); }
/* approximate heritage point */
.hp-pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: #9c3d16; border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.5); display: grid; place-items: center; cursor: pointer; }
.hp-pin span { transform: rotate(45deg); color: #fff; font: 700 10.5px "IBM Plex Sans Arabic", sans-serif; }
.hp-pin.visited { border-color: #3ddc84; }
.hp-pin.drawn { background: #6d2a0f; }
.thumb-pin.hp-photo { border-color: #9c3d16; }
.thumb-pin.hp-photo.visited { border-color: #3ddc84; }

/* ---------- team ---------- */
.fab[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -2px; inset-inline-end: -2px; min-width: 18px; height: 18px;
  border-radius: 9px; background: #3ddc84; color: #08311a; font: 700 11px/18px "IBM Plex Sans Arabic", sans-serif; text-align: center; border: 2px solid var(--panel); }
.fab { position: relative; }
#btnTeam.on { background: #2f8a4c; color: #fff; }
.mate { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--c), 0 2px 8px rgba(0,0,0,.5);
  display: grid; place-items: center; position: relative; }
.mate span { color: #fff; font: 700 11px "IBM Plex Sans Arabic", sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.mate.stale { filter: grayscale(.8); opacity: .6; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.mate-hd { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; }
.mate-hd::before { content: ""; position: absolute; left: -6px; top: -27px; border: 6px solid transparent; border-bottom: 12px solid var(--c); border-top: 0; }
.leaflet-tooltip.lbl-mate { background: rgba(10, 40, 20, .85); font-size: 11px; }
.team-code { display: flex; align-items: center; justify-content: space-between; background: var(--panel-2); border-radius: 12px; padding: 10px 14px; }
.team-code span { color: var(--ink-2); font-size: 12.5px; }
.team-code b { font-size: 20px; letter-spacing: 2px; font-family: ui-monospace, Consolas, monospace; }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; margin-inline-end: 4px; animation: blink 1.6s infinite; }

/* ---------- cloud ---------- */
.dock button.cloud-sync span::after, .dock button.cloud-err span::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-start: 4px; vertical-align: middle; }
.dock button.cloud-sync span::after { background: #1f9bd1; animation: blink 1s infinite; }
.dock button.cloud-err span::after { background: #e0a020; }
details.howto { background: var(--panel-2); border-radius: 12px; padding: 8px 12px; margin-top: 10px; font-size: 13px; line-height: 1.8; }
details.howto summary { cursor: pointer; font-weight: 600; }
details.howto ol { padding-inline-start: 18px; margin: 8px 0; }
details.howto code { background: var(--panel); padding: 0 4px; border-radius: 4px; }

/* ---------- gallery ---------- */
.gal-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.gal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gal-head b { display: block; font-size: 14px; } .gal-head small { color: var(--ink-2); font-size: 12px; }
.gal-strip { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.gal-ph { flex: 0 0 96px; height: 96px; border: 0; border-radius: 10px; background: var(--panel-2) center/cover; cursor: zoom-in; }
.gal-ph.missing { background: repeating-linear-gradient(45deg, var(--panel-2) 0 8px, var(--line) 8px 16px); }

/* photo still uploading from a teammate's phone */
.thumb-pin.waiting { background: #3b3127 !important; display: grid; place-items: center; }
.thumb-pin.waiting::before { content: "📷"; font-size: 15px; }
.ph.waiting, .hero-ph.waiting { display: grid; place-items: center; color: var(--ink-2); font-size: 13px; text-align: center; padding: 8px; background: var(--panel-2); }

/* GPS: last precise fix is getting old / waiting for a precise one */
.me.old { background: #8a94a6; box-shadow: 0 0 0 6px rgba(138,148,166,.25), 0 1px 6px rgba(0,0,0,.4); }
.me.old .hd { display: none !important; }
.gps-chip { cursor: pointer; }
.gps-chip.warn { background: #6b4a12; color: #ffe2a8; }

/* gallery: fetch the original from Drive */
.lightbox .lb-full { position: absolute; top: calc(56px + env(safe-area-inset-top, 0px)); left: 14px; border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.lightbox .lb-cap { white-space: normal; max-width: 92vw; text-align: center; }

.lightbox .lb-del { position: absolute; top: calc(98px + env(safe-area-inset-top, 0px)); left: 14px; border: 0; background: rgba(229,57,53,.75); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
