/* ---------- Theme tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #0b0d12; --panel: #151922; --panel-2: #1d2230; --line: #262c3b; --scrim: rgba(0,0,0,.55);
  --text: #eef1f7; --muted: #8b93a7; --soft: #c9cfdc;
  --red: #ff3b4e; --amber: #ffb020; --blue: #3d8bff; --green: #2fd17a; --grey: #6b7386;
  --nav-bg: rgba(11,13,18,.92); --shadow: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f4f7; --panel: #ffffff; --panel-2: #eceef3; --line: #e0e3ea; --scrim: rgba(15,19,32,.35);
  --text: #0f1320; --muted: #5c6579; --soft: #3a4255;
  --red: #e5283b; --amber: #d98a00; --blue: #1f6fe5; --green: #12a65a; --grey: #9aa1b2;
  --nav-bg: rgba(255,255,255,.92); --shadow: 0 10px 30px rgba(20,30,60,.15);
  color-scheme: light;
}
:root { --kb: 0px; --radius: 16px; --nav-h: 76px; --head-h: 62px; --ease: cubic-bezier(.2,.9,.3,1); }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #05060a; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
[data-theme="light"] body { background: #d9dce3; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; transition: transform .12s, background .2s, opacity .2s; }
button:active:not(:disabled) { transform: scale(.96); }
input, textarea, select { font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; width: 100%; outline: none; transition: border-color .2s; }
input:focus, textarea:focus { border-color: var(--blue); }
textarea { resize: vertical; min-height: 84px; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; } .ic.xs { width: 13px; height: 13px; } .ic.lg { width: 26px; height: 26px; }

#app { position: relative; height: 100%; max-width: 440px; margin: 0 auto; background: var(--bg); overflow: hidden; overflow: clip; transition: background .3s; }

/* ---------- Header ---------- */
header { position: absolute; top: 0; left: 0; right: 0; height: var(--head-h); z-index: 40; padding: 0 16px;
  display: flex; align-items: center; gap: 10px; background: linear-gradient(var(--bg) 55%, transparent); }
.brand { font-weight: 800; font-size: 21px; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; color: var(--red); flex: none; }
.city-pick { margin-left: auto; display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 4px 0 10px; color: var(--muted); }
.city-pick select { border: 0; background: transparent; padding: 7px 4px; font-size: 13px; width: auto; color: var(--text); cursor: pointer; }
.sos { display: flex; align-items: center; gap: 5px; background: var(--red); color: #fff; font-weight: 800; border-radius: 999px; padding: 7px 12px; font-size: 13px; }

/* ---------- Views ---------- */
main { position: absolute; inset: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.scroll { position: absolute; inset: 0; overflow-y: auto; padding: calc(var(--head-h) + 6px) 16px calc(var(--nav-h) + 24px); }
h2 { font-size: 26px; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 14px; margin: 2px 0 16px; line-height: 1.4; }

/* ---------- Map ---------- */
#map { position: absolute; inset: 0 0 var(--nav-h) 0; z-index: 0; background: var(--bg); }
.leaflet-container { font: inherit; background: var(--bg); }
.leaflet-bottom { bottom: 84px; }
.leaflet-control-attribution { font-size: 9px !important; background: var(--scrim) !important; color: #aaa !important; border-radius: 6px 0 0 6px; }
.leaflet-control-attribution a { color: #ccc !important; }

.pin { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.pin.new { animation: drop .4s var(--ease) both; }
.pin .ic { width: 18px; height: 18px; }
.pin.high { background: var(--red); } .pin.med { background: var(--amber); } .pin.low { background: var(--blue); }
.pin.done { background: var(--grey); width: 26px; height: 26px; opacity: .8; border-width: 2px; }
.pin.done .ic { width: 13px; height: 13px; }
.pin.live::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid currentColor; animation: ring 1.8s infinite; }
.pin.live.high::after { color: var(--red); } .pin.live.med::after { color: var(--amber); } .pin.live.low::after { color: var(--blue); }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
@keyframes drop { from { transform: translateY(-14px) scale(.6); opacity: 0; } }
.me { width: 18px; height: 18px; background: var(--blue); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 8px rgba(61,139,255,.22); }

.fab { position: absolute; right: 14px; bottom: calc(var(--nav-h) + 96px); z-index: 5; width: 44px; height: 44px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow); color: var(--blue); transition: opacity .2s; }

/* Draggable bottom sheet */
.sheet { position: absolute; left: 0; right: 0; top: calc(var(--head-h) + 10px); bottom: var(--nav-h); z-index: 10;
  background: var(--panel); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; will-change: transform; }
.sheet.anim { transition: transform .38s var(--ease); }
.sheet-grab { padding: 8px 18px 12px; cursor: grab; touch-action: none; user-select: none; }
.sheet-grab:active { cursor: grabbing; }
.handle { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head b { font-size: 17px; display: block; }
.sheet-head small { color: var(--muted); font-size: 13px; }
.sev-dots { margin-left: auto; display: flex; gap: 6px; }
.sev-dots span { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sev-dots i { width: 8px; height: 8px; border-radius: 50%; }
.sheet-list { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.row-item:hover { background: var(--panel-2); }
.row-item h4 { font-size: 15px; font-weight: 600; line-height: 1.25; }
.row-item .ic.chev { color: var(--muted); margin-left: auto; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  cursor: pointer; animation: rise .35s var(--ease) both; transition: border-color .2s, transform .12s; }
.card:hover { border-color: color-mix(in srgb, var(--muted) 40%, var(--line)); }
.card:active { transform: scale(.99); }
.card.flat { cursor: default; animation: none; border: 0; background: none; padding: 0; }
.card.is-resolved { opacity: .72; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
#feed .card:nth-child(2), #alerts .card:nth-child(2) { animation-delay: .04s; } #feed .card:nth-child(3), #alerts .card:nth-child(3) { animation-delay: .08s; }
#feed .card:nth-child(4), #alerts .card:nth-child(4) { animation-delay: .12s; } #feed .card:nth-child(n+5) { animation-delay: .16s; }
.card-head { display: flex; gap: 11px; align-items: flex-start; }
.cat-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; }
.cat-ic.high { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.cat-ic.med { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.cat-ic.low { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.cat-ic.done { background: var(--panel-2); color: var(--grey); }
.card h3 { font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
.card.flat h3 { font-size: 21px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card p { color: var(--soft); font-size: 14px; margin-top: 10px; line-height: 1.45; }
.thumb { position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: #000; }
.thumb video, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .more { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; display: flex; align-items: center; gap: 4px; }
.stats { display: flex; align-items: center; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.stats span { display: inline-flex; align-items: center; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.badge.verified { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.badge.unverified { background: var(--panel-2); color: var(--muted); }
.badge.live { background: var(--red); color: #fff; }
.badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
.badge.resolved { background: var(--panel-2); color: var(--grey); }
@keyframes blink { 50% { opacity: .2; } }

/* Demo media placeholder */
.demo { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.9); overflow: hidden; }
.demo.high { background: radial-gradient(circle at 30% 70%, #ff6b3d 0, transparent 45%), radial-gradient(circle at 70% 30%, #5a1020 0, transparent 60%), #1a0a0e; }
.demo.med { background: radial-gradient(circle at 60% 60%, #d98a00 0, transparent 40%), radial-gradient(circle at 20% 20%, #33405a 0, transparent 60%), #10141d; }
.demo.low { background: radial-gradient(circle at 40% 40%, #3d8bff 0, transparent 40%), radial-gradient(circle at 80% 80%, #1b2a4a 0, transparent 60%), #0b1020; }
.demo::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(6px); background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px); }
.demo .play { position: relative; width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; border: 1.5px solid rgba(255,255,255,.5); }
.demo .play .ic { width: 18px; height: 18px; margin-left: 2px; }
.demo .dur { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 6px; }
.demo .lbl { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .7; }

/* Filters */
.segmented { display: flex; background: var(--panel-2); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.segmented button { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.chip .ic { width: 15px; height: 15px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }
.empty .ic { width: 34px; height: 34px; margin-bottom: 10px; opacity: .6; }

/* ---------- Tab bar ---------- */
nav { position: absolute; bottom: 0; left: 0; right: 0; z-index: 30; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--nav-bg); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: 8px; }
nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); position: relative; min-width: 0; }
nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav button.on { color: var(--text); }
nav button.on .ic { stroke-width: 2.4; }
.rec { width: 60px; height: 60px; margin-top: -26px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; box-shadow: 0 6px 22px rgba(255,59,78,.45); border: 4px solid var(--bg); transition: transform .15s; }
.rec .ic { width: 26px; height: 26px; color: #fff; stroke-width: 2.1; }
.rec-wrap:hover .rec { transform: scale(1.06); }
.count { position: absolute; top: -5px; left: 54%; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; font-style: normal;
  border-radius: 999px; padding: 1px 6px; display: none; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(0); } }

/* ---------- Modals (slide up) ---------- */
.modal { position: absolute; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  transform: translateY(100%); visibility: hidden; transition: transform .34s var(--ease), visibility 0s .34s; }
.modal.open { transform: none; visibility: visible; transition: transform .34s var(--ease), visibility 0s; }
#detail { z-index: 45; }
.modal-head { display: flex; align-items: center; padding: 10px 10px 10px 16px; gap: 8px; border-bottom: 1px solid var(--line); min-height: 56px; }
.modal-head h3 { font-size: 17px; flex: 1; }
#detail .modal-head { padding-left: 6px; }
#detail .modal-head h3 { text-align: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 16px 32px; }

/* Report flow */
.warn { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); color: var(--text); border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.45; margin-bottom: 14px; }
.warn .ic { color: var(--red); margin-top: 1px; }
.warn a { color: var(--red); font-weight: 700; }
.camera { position: relative; background: #000; border-radius: 20px; overflow: hidden; height: clamp(200px, calc(100dvh - 330px), 560px); display: grid; place-items: center; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera .hint { position: absolute; color: #9aa; text-align: center; padding: 24px; font-size: 14px; line-height: 1.4; }
.rec-indicator { position: absolute; top: 12px; left: 12px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: none; }
.cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 18px 0 4px; }
.cam-side { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; cursor: pointer; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--text); display: grid; place-items: center; }
.shutter i { width: 58px; height: 58px; border-radius: 50%; background: var(--red); transition: all .25s var(--ease); }
.shutter.recording i { width: 28px; height: 28px; border-radius: 7px; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cat { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; font-size: 13.5px; }
.cat .ic { width: 18px; height: 18px; }
.cat.high .ic { color: var(--red); } .cat.med .ic { color: var(--amber); } .cat.low .ic { color: var(--blue); }
.cat.on { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--panel)); }
.toggle { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 8px; font-size: 14px; cursor: pointer; }
.toggle > .ic { color: var(--muted); }
.toggle small, .setting small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.grow { flex: 1; min-width: 0; }
.primary { width: 100%; background: var(--red); color: #fff; font-weight: 700; padding: 15px; border-radius: 14px; margin-top: 22px; font-size: 16px; }
.primary:disabled { opacity: .35; cursor: default; }
.secondary { width: 100%; background: var(--panel-2); padding: 13px; border-radius: 14px; margin-top: 10px; font-weight: 600; }
.preview-media { position: relative; border-radius: 14px; overflow: hidden; }
.preview-media video, .preview-media img { width: 100%; display: block; max-height: 220px; object-fit: cover; }

/* Switch */
.switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; padding: 0; flex: none; border-radius: 999px; background: var(--line); border: 0; position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .22s var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Detail ---------- */
.hero { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/10; background: #000; cursor: pointer; margin-bottom: 8px; }
.hero video, .hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.g-item { position: relative; flex: none; width: 92px; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; border: 2px solid transparent; }
.g-item.on { border-color: var(--text); }
.g-item video, .g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-item .demo .play { width: 30px; height: 30px; } .g-item .demo .play .ic { width: 12px; height: 12px; }
.g-item .demo .lbl { display: none; }
.g-add { flex: none; width: 92px; aspect-ratio: 3/4; border-radius: 10px; border: 1.5px dashed var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; text-align: center; padding: 6px; }
.g-add:hover { color: var(--text); border-color: var(--muted); }
.g-add.big { width: 100%; aspect-ratio: auto; flex-direction: row; padding: 14px; margin-bottom: 14px; }
.badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 11px 6px; font-size: 12.5px; font-weight: 600; }
.actions button small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.actions button.on { background: color-mix(in srgb, var(--green) 14%, var(--panel)); color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.actions button:disabled { opacity: .55; }
.area { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
#mini { height: 170px; z-index: 0; }
.area-info { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 14px; }
.area-info .ic { color: var(--muted); }
.area-info.inside { color: var(--red); font-weight: 600; } .area-info.inside .ic { color: var(--red); }
.area-info small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; font-weight: 400; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 24px 0 10px; }
.composer { display: flex; gap: 8px; margin-bottom: 8px; }
.composer button { background: var(--blue); color: #fff; border-radius: 12px; padding: 0 16px; font-weight: 600; }
.timeline { position: relative; padding-left: 4px; }
.tl { position: relative; display: flex; gap: 12px; padding: 10px 0; animation: rise .3s var(--ease) both; }
.tl::before { content: ''; position: absolute; left: 15px; top: 40px; bottom: -10px; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); position: relative; z-index: 1; }
.tl-dot .ic { width: 15px; height: 15px; }
.tl.official .tl-dot { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.tl.report .tl-dot { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.tl.resolved .tl-dot { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tl-body { flex: 1; min-width: 0; padding-top: 5px; }
.tl-head { font-size: 13px; color: var(--muted); }
.tl-head b { color: var(--text); font-weight: 600; }
.tl-head .off { color: var(--blue); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.tl-text { font-size: 14.5px; margin-top: 3px; line-height: 1.4; }
.tl .thumb { margin-top: 8px; max-width: 220px; }
.link { color: var(--blue); font-weight: 600; font-size: 14px; }
.danger-link { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 24px; padding: 12px; color: var(--muted); font-size: 13px; }

/* Media viewer */
.viewer { position: absolute; inset: 0; z-index: 70; background: rgba(0,0,0,.94); display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.viewer.open { opacity: 1; visibility: visible; transition: opacity .25s; }
#viewer-body { width: 100%; position: relative; }
#viewer-body video, #viewer-body img { width: 100%; max-height: 80vh; display: block; }
#viewer-body .vdemo { position: relative; aspect-ratio: 9/14; width: 100%; max-height: 80vh; }
#viewer-body .vdemo .lbl { font-size: 12px; top: auto; bottom: 14px; left: 0; right: 0; text-align: center; opacity: .85; text-transform: none; letter-spacing: 0; }
.viewer-x { position: absolute; top: 12px; right: 12px; color: #fff; z-index: 2; }

/* Emergency sheet */
.backdrop { position: absolute; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: flex-end; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.backdrop.open { opacity: 1; visibility: visible; transition: opacity .25s; }
.em-panel { width: 100%; background: var(--panel); border-radius: 24px 24px 0 0; padding: 10px 16px 28px; transform: translateY(100%); transition: transform .34s var(--ease); max-height: 85%; overflow-y: auto; }
.backdrop.open .em-panel { transform: none; }
.em-panel h3 { font-size: 20px; margin-top: 4px; }
.em-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--text); margin-top: 6px; background: var(--panel-2); transition: transform .12s; }
.em-row:active { transform: scale(.98); }
.em-row b { font-size: 20px; font-variant-numeric: tabular-nums; min-width: 64px; }
.em-row span { flex: 1; font-size: 14px; color: var(--soft); }
.em-row .call { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.em-row.main { background: var(--red); color: #fff; padding: 16px 14px; }
.em-row.main span { color: #fff; font-weight: 600; }
.em-row.main b { font-size: 28px; }
.em-row.main .call { background: #fff; color: var(--red); }

/* Settings */
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; margin-bottom: 14px; }
.setting { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; cursor: default; }
label.setting { cursor: pointer; }
.setting:last-child { border-bottom: 0; }
.setting.col { flex-direction: column; align-items: stretch; }
.s-row { display: flex; align-items: center; gap: 12px; }
.s-ic { color: var(--muted); }
.setting select { width: auto; padding: 8px 10px; }
.setting .segmented { margin: 4px 0 0; }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--red); margin-top: 6px; }

/* Push banner + toast */
.banner { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 80; background: var(--panel); box-shadow: var(--shadow);
  border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 16px; padding: 12px 14px;
  transform: translateY(-150%); transition: transform .45s var(--ease); cursor: pointer; }
.banner.show { transform: none; }
.banner small { display: flex; align-items: center; gap: 5px; color: var(--red); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.banner div { font-weight: 600; font-size: 14.5px; margin-top: 3px; }
.toast { position: absolute; left: 50%; bottom: calc(var(--nav-h) + 16px); z-index: 85; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  width: max-content; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow); transition: all .3s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.ctr-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* ---------- Onboarding (welcome, login, register, plans, permissions) ---------- */
.auth { position: absolute; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column;
  transition: opacity .35s, visibility 0s .35s; }
.auth.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.auth::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 420px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--red) 22%, transparent), transparent 70%); }
.auth-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 12px 0 6px; min-height: 52px; }
.auth-top .icon-btn.hide { visibility: hidden; }
.steps { flex: 1; display: flex; justify-content: center; gap: 6px; }
.steps.hide { visibility: hidden; }
.steps i { width: 26px; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.steps i.on { background: var(--red); }
.auth-lang { display: flex; align-items: center; gap: 4px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 4px 0 10px; }
.auth-lang select { border: 0; background: transparent; padding: 6px 4px; font-size: 13px; width: auto; color: var(--text); cursor: pointer; }
.auth-screen { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 8px 24px 32px; display: none; flex-direction: column; }
.auth-screen.active { display: flex; animation: slideIn .35s var(--ease); }
.auth-screen.back.active { animation-name: slideBack; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-24px); } }
.auth-screen h2 { font-size: 28px; margin-top: 8px; }
.auth-screen .sub { font-size: 15px; margin-bottom: 8px; }
.auth-screen .primary { margin-top: 20px; }
.auth-screen.centered { justify-content: center; text-align: center; align-items: center; }
.auth-screen.centered .primary { width: 100%; }

/* Welcome hero */
.hero-art { position: relative; height: clamp(170px, 27vh, 230px); margin: 0 auto 4px; width: 100%; display: grid; place-items: center; }
/* Nothing on the start screen gets squeezed to fit; on very small phones it scrolls instead */
[data-screen="welcome"] > * { flex-shrink: 0; }
.ring { position: absolute; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--red) 45%, transparent); animation: ripple 3.6s infinite var(--ease); opacity: 0; }
/* Rings grow to the height of the hero at most, so they never run off the screen */
.ring { height: 100%; aspect-ratio: 1; } .ring.r2 { animation-delay: 1.2s; } .ring.r3 { animation-delay: 2.4s; }
@keyframes ripple { 0% { transform: scale(.42); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.core-icon { position: relative; width: 96px; height: 96px; filter: drop-shadow(0 10px 28px color-mix(in srgb, var(--red) 45%, transparent)); animation: iconIn .6s var(--ease) both; }
@keyframes iconIn { from { transform: scale(.7); opacity: 0; } }
.core-icon .pulse-outer, .brand-mark .pulse-outer { transform-origin: 50px 50px; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .12; transform: scale(1.06); } }
.float { position: absolute; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; box-shadow: var(--shadow); animation: bob 4s infinite ease-in-out; }
.float.high { background: var(--red); } .float.med { background: var(--amber); } .float.low { background: var(--blue); }
.float.f1 { top: 12%; left: 15%; } .float.f2 { bottom: 4%; left: 23%; animation-delay: 1.3s; } .float.f3 { top: 4%; right: 17%; animation-delay: 2.1s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.logo { font-size: 44px; font-weight: 800; letter-spacing: -.04em; display: flex; align-items: center; justify-content: center; gap: 12px; }
.tagline { text-align: center; color: var(--soft); font-size: 17px; line-height: 1.4; margin: 6px auto 18px; max-width: 300px; }
.features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.features li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.f-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; color: var(--red); flex: none; }
.f-ic .ic { width: 18px; height: 18px; }
.features.compact { gap: 9px; margin-bottom: 4px; }
.features.compact li { font-size: 14px; color: var(--soft); }
.features.compact .ic { color: var(--green); width: 18px; height: 18px; }
.auth-actions { margin-top: auto; padding-top: 24px; }
.auth-actions .primary { margin-top: 0; }
.demo-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }

/* Forms */
.field { position: relative; display: flex; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.field.bad { border-color: var(--red); }
.field > .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.field input { border: 0; background: transparent; padding: 13px 12px 13px 42px; box-shadow: none; }
.pw-toggle { position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.pw-toggle.on { color: var(--blue); }
.field input[type=password], .field input#li-pw, .field input#rg-pw { padding-right: 44px; }
.link.small { font-size: 13px; }
.forgot { display: block; margin: 10px 0 0 auto; }
.center { display: block; margin: 14px auto 0; }
.form-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.strength { display: flex; gap: 4px; margin-top: 8px; }
.strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .25s; }
.strength.s1 i:nth-child(-n+1) { background: var(--red); }
.strength.s2 i:nth-child(-n+2) { background: var(--amber); }
.strength.s3 i:nth-child(-n+3) { background: var(--green); }
.strength.s4 i { background: var(--green); }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; color: var(--soft); margin-top: 12px; cursor: pointer; }
.check:first-of-type { margin-top: 18px; }
.check input { width: 18px; height: 18px; padding: 0; flex: none; margin-top: 1px; accent-color: var(--red); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 22px 0 14px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.social { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-weight: 600; margin-top: 10px; }
.switch-line { text-align: center; color: var(--muted); font-size: 14px; margin-top: 22px; }

/* Plans */
.plans { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 6px; }
.plan { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 16px; transition: border-color .2s, background .2s; }
.plan.on { border-color: var(--red); background: color-mix(in srgb, var(--red) 7%, var(--panel)); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: border-color .2s; }
.plan.on .radio { border-color: var(--red); }
.plan.on .radio::after { content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--red); }
.plan b { font-size: 16px; display: block; }
.plan small { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.plan .price { margin-left: auto; text-align: right; }
.plan .price b { font-size: 20px; font-variant-numeric: tabular-nums; }
.plan .tag { position: absolute; top: -10px; right: 14px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.fine { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 14px; }

/* Confirm + done + permissions */
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; margin-top: 18px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sum-row span { color: var(--muted); }
.sum-row:last-child { border-bottom: 0; font-size: 17px; font-weight: 700; }
.sum-row:last-child span { color: var(--text); }
.primary .spinner { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.success { width: 88px; height: 88px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin-bottom: 18px; animation: pop .5s var(--ease); box-shadow: 0 0 0 12px color-mix(in srgb, var(--green) 18%, transparent); }
.success .ic { width: 44px; height: 44px; stroke-width: 3; }
.perm { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-top: 12px; }
.perm-ic { width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); display: grid; place-items: center; flex: none; }
.perm b { display: block; font-size: 15px; }
.perm small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 3px; }

/* Account rows in Settings */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: rgba(255,255,255,.92); overflow: hidden; flex: none; }
.avatar svg { width: 100%; height: 100%; display: block; }
.row-btn { width: 100%; text-align: left; cursor: pointer; }
.row-btn:active { transform: none; background: var(--panel-2); }
.row-btn.danger, .row-btn.danger .s-ic { color: var(--red); }

/* ---------- Map type picker ---------- */
.fab.layers-btn { top: calc(var(--head-h) + 6px); bottom: auto; color: var(--text); }
.fab.layers-btn[aria-expanded="true"] { color: var(--blue); border-color: var(--blue); }
.map-styles { position: absolute; top: calc(var(--head-h) + 58px); right: 14px; z-index: 12; width: 272px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow);
  transform-origin: top right; transform: scale(.92); opacity: 0; visibility: hidden;
  transition: transform .2s var(--ease), opacity .2s, visibility 0s .2s; }
.map-styles.open { transform: none; opacity: 1; visibility: visible; transition: transform .25s var(--ease), opacity .2s; }
.ms-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.ms-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ms-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.ms-opt.on { color: var(--text); font-weight: 700; }
.ms-thumb { position: relative; width: 54px; height: 54px; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: var(--panel-2); transition: border-color .2s; }
.ms-opt.on .ms-thumb { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent); }
.ms-thumb img, .ms-thumb svg, .ms-thumb .half { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-thumb .half { clip-path: inset(0 0 0 50%); }
/* Satellite photos are busy, so give the my-location dot a stronger outline */
#map[data-mode="sat"] .me { box-shadow: 0 0 0 8px rgba(61,139,255,.35), 0 0 0 1px rgba(0,0,0,.4); }

/* ---------- Settings menu & pages ---------- */
.profile-card { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.profile-card .avatar { width: 54px; height: 54px; }
.profile-card b { display: block; font-size: 17px; }
.profile-card small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.plan-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, transparent); padding: 3px 8px; border-radius: 999px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 92px; height: 92px; }
.tile { width: 30px; height: 30px; border-radius: 8px; background: var(--tile); color: #fff; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; }
.tile .ic { width: 17px; height: 17px; }
.group.menu .setting { padding: 11px 0; }
.version { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.group-foot { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: -6px 4px 16px; }
.setting.disabled { opacity: .45; }
.setting .s-ic.ok { color: var(--green); }
.setting small + span { display: block; margin-top: 2px; }
.setting select, .setting input.time { width: auto; padding: 8px 10px; }
.setting.field-row input { margin-top: 6px; padding: 10px 12px; }
.setting .link { font-size: 14px; }
a.setting { color: inherit; text-decoration: none; }
.cat-ic.sm { width: 30px; height: 30px; border-radius: 8px; }
.cat-ic.sm .ic { width: 16px; height: 16px; }
.pill { background: var(--panel-2); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.danger { color: var(--red); }
.row-btn:disabled { opacity: .5; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.progress { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .18s; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); flex: none; margin: 0 9px; box-shadow: 0 0 0 0 var(--green); animation: liveDot 1.6s infinite; }
@keyframes liveDot { 70% { box-shadow: 0 0 0 8px transparent; } }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 18px; }
.profile-head label { cursor: pointer; }
#page-body .secondary { margin-top: 4px; }
#page-body .primary { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Pages slide in from the right; deeper pages animate inside */
.modal.page { z-index: 48; transform: translateX(100%); }
.modal.page.open { transform: none; }
.modal.page .modal-head h3 { text-align: center; }
.modal.page .modal-head { padding-left: 6px; }
#page-body.fwd { animation: pageFwd .28s var(--ease); }
#page-body.back { animation: pageBack .28s var(--ease); }
@keyframes pageFwd { from { opacity: 0; transform: translateX(30px); } }
@keyframes pageBack { from { opacity: 0; transform: translateX(-30px); } }

/* Documents */
.doc-note { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.45; margin-bottom: 16px; }
.doc-note .ic { color: var(--amber); }
.doc-list { padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.doc-list li { font-size: 14px; line-height: 1.45; }
.doc-list li b { display: block; margin-bottom: 2px; }
.doc-list li span { color: var(--soft); }
.doc-list.plain { gap: 10px; }

/* Saved place pins on the map */
.place-pin { width: 28px; height: 28px; border-radius: 9px; background: var(--panel); color: var(--green); border: 2px solid var(--green);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.place-pin .ic { width: 15px; height: 15px; }

/* Confirm dialog */
.backdrop.dialog-wrap { align-items: center; justify-content: center; padding: 24px; z-index: 90; }
.dialog { background: var(--panel); border-radius: 20px; padding: 22px; width: 100%; max-width: 340px; box-shadow: var(--shadow);
  transform: scale(.94); transition: transform .25s var(--ease); }
.backdrop.open .dialog { transform: none; }
.dialog h3 { font-size: 18px; }
.dialog p { color: var(--soft); font-size: 14px; line-height: 1.45; margin-top: 8px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.dialog-actions button { margin: 0 !important; padding: 12px; }
.primary.danger { background: var(--red); }

/* Hold-to-call 112 */
.sos { position: relative; overflow: hidden; }
.sos::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.35); transform: scaleX(0); transform-origin: left; }
.sos.holding::after { transform: scaleX(1); transition: transform 1.5s linear; }

/* Accessibility modes */
.a11y-large .scroll, .a11y-large .modal-body, .a11y-large .sheet-list, .a11y-large .sheet-grab, .a11y-large .auth-screen, .a11y-large .banner { zoom: 1.15; }
.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after { animation: none !important; transition: none !important; }
.primary + .group-foot, .secondary + .group-foot, .segmented + .group-foot { margin-top: 10px; }

/* ---------- Family plan ---------- */
.segmented.billing { margin: 4px 0 14px; }
.segmented.billing button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.segmented .save { font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--green);
  background: color-mix(in srgb, var(--green) 15%, transparent); padding: 2px 6px; border-radius: 999px; }
.fam-pin { width: 32px; height: 32px; border-radius: 50%; background: var(--fam); color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.fam-pin.alert { box-shadow: 0 0 0 4px var(--red), 0 3px 10px rgba(0,0,0,.35); animation: famAlert 1.4s infinite; }
@keyframes famAlert { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--red) 25%, transparent), 0 3px 10px rgba(0,0,0,.35); } }
.family-hero { text-align: center; padding: 10px 6px 18px; }
.family-hero .tile { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px; }
.family-hero .tile .ic { width: 32px; height: 32px; }
.family-hero h3 { font-size: 22px; letter-spacing: -.02em; }
.family-hero p { color: var(--soft); font-size: 14.5px; line-height: 1.5; margin-top: 8px; }
.setting small .near { color: var(--red); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.group-foot.spaced { margin: 10px 2px 0; }
.setting .avatar { width: 30px; height: 30px; }
#page-body .secondary + .group, #page-body .secondary + .section-title { margin-top: 14px; }

/* ---------- Walk me home ---------- */
.walk-btn { position: absolute; left: 14px; bottom: calc(var(--nav-h) + 96px); z-index: 5; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px 10px 12px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); color: var(--text); }
.walk-btn .ic { color: var(--green); width: 20px; height: 20px; }
#app.walking .layers-btn, #app.walking .map-styles { display: none; }
#app.picking .sheet, #app.picking .fab, #app.picking .walk-btn, #app.picking .walk-card { display: none !important; }

/* Status card at the top of the map */
.walk-card { position: absolute; top: calc(var(--head-h) + 4px); left: 12px; right: 12px; z-index: 7; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); animation: rise .3s var(--ease); }
.walk-card.alerted { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--panel)); }
.wc-head { display: flex; align-items: center; gap: 10px; }
.wc-head .live-dot { margin: 0 2px; }
.walk-card.alerted .live-dot { background: var(--red); }
.wc-head b { font-size: 15px; display: block; }
.wc-head small { font-size: 12.5px; color: var(--muted); display: block; margin-top: 1px; }
.walk-card.alerted .wc-head small { color: var(--red); font-weight: 600; }
.wc-alert { display: flex; gap: 8px; margin-top: 10px; }
.wc-alert .pill { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; color: var(--text); }
.wc-alert .pill.danger { background: var(--red); color: #fff; }
.wc-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 10px; }
.wc-stats b { font-size: 17px; font-variant-numeric: tabular-nums; display: block; }
.wc-stats small { font-size: 11.5px; color: var(--muted); }
.walk-card .progress { margin-top: 10px; }
.walk-card .progress i { background: var(--green); width: 2%; }
.wc-demo { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.wc-demo summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.wc-demo-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wc-demo-row .pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 6px 10px; }
.wc-demo-row .pill.on { background: var(--blue); color: #fff; }

/* SOS button: always on screen during a walk */
.walk-sos { position: absolute; left: 14px; bottom: calc(var(--nav-h) + 96px); z-index: 96; width: 66px; height: 66px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 900; font-size: 17px; letter-spacing: .04em; border: 3px solid #fff;
  box-shadow: 0 8px 24px rgba(255,59,78,.5); animation: sosRing 2s infinite; }
@keyframes sosRing { 0% { box-shadow: 0 0 0 0 rgba(255,59,78,.55), 0 8px 24px rgba(255,59,78,.5); } 70% { box-shadow: 0 0 0 16px rgba(255,59,78,0), 0 8px 24px rgba(255,59,78,.5); } 100% { box-shadow: 0 0 0 0 rgba(255,59,78,0), 0 8px 24px rgba(255,59,78,.5); } }
.walk-pill { position: absolute; top: calc(var(--head-h) - 2px); left: 50%; transform: translateX(-50%); z-index: 35; background: var(--green); color: #fff;
  font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; }

/* Prompts: "Are you OK?", SOS, arrived */
.walk-overlay { position: absolute; inset: 0; z-index: 97; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 22px; animation: fade .2s ease; }
.walk-overlay.is-sos { background: color-mix(in srgb, var(--red) 55%, rgba(0,0,0,.6)); }
.wo-box { width: 100%; max-width: 340px; background: var(--panel); border-radius: 24px; padding: 26px 22px 20px; text-align: center; box-shadow: var(--shadow); animation: pop .3s var(--ease); }
.wo-box h2 { font-size: 24px; margin-top: 14px; }
.wo-box p { color: var(--soft); font-size: 14.5px; line-height: 1.45; margin-top: 8px; }
.wo-box .wo-small { font-size: 12.5px; color: var(--muted); }
.wo-box .primary, .wo-box .secondary { margin-top: 12px; }
.wo-box .primary.ok { background: var(--green); }
.wo-box a.primary { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.wo-icon { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; color: #fff; }
.wo-icon .ic { width: 38px; height: 38px; stroke-width: 2.4; }
.wo-icon.is-warn { background: var(--amber); }
.wo-icon.is-ok { background: var(--green); }
.wo-icon.is-sos { background: var(--red); font-weight: 900; font-size: 20px; animation: sosRing 1.4s infinite; }
.wo-count { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 10px; color: var(--amber); }

/* Picking a destination on the map */
.walk-pick { position: absolute; inset: 0 0 var(--nav-h) 0; z-index: 8; pointer-events: none; }
.walk-cross { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); width: 44px; height: 44px; border-radius: 50% 50% 50% 4px;
  rotate: -45deg; background: var(--green); display: grid; place-items: center; box-shadow: var(--shadow); }
.walk-cross .ic { rotate: 45deg; color: #fff; }
.walk-pick-bar { position: absolute; left: 12px; right: 12px; bottom: 14px; pointer-events: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; box-shadow: var(--shadow); text-align: center; }
.walk-pick-bar p { font-size: 14px; color: var(--soft); }
.walk-pick-bar .dialog-actions { margin-top: 12px; }

/* Map markers */
.walker { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(61,139,255,.5); animation: walker 1.6s infinite; }
@keyframes walker { 70% { box-shadow: 0 0 0 14px rgba(61,139,255,0); } }
.walk-dest-pin { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.walk-dest-pin .ic { width: 16px; height: 16px; }

/* Setup page */
.walk-intro { color: var(--soft); font-size: 14px; line-height: 1.5; margin-bottom: 6px; }
.walk-dest { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.walk-dest > .ic { color: var(--green); }
.walk-dest b { display: block; font-size: 15px; }
.walk-dest small { color: var(--muted); font-size: 13px; }
.walk-start { margin-top: 18px !important; }
.walk-start:disabled { opacity: .4; }

/* ---------- Walk me home: contacts, WhatsApp / SMS, send sheet ---------- */
.setting.follower { align-items: flex-start; }
.setting.follower > .tile, .setting.follower > .switch, .setting.follower > .icon-btn { margin-top: 2px; }
.channel { display: inline-flex; gap: 4px; margin-top: 8px; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.channel button { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 8px; }
.channel button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.channel button.on .ic { color: var(--green); }
.check-round { width: 22px; height: 22px; padding: 0; flex: none; accent-color: var(--green); cursor: pointer; }
.pick-list { margin-top: 10px; max-height: 52vh; overflow-y: auto; }
#page-body .field { margin-top: 4px; }
.walk-overlay.is-send .wo-box { text-align: left; max-width: 380px; }
.walk-overlay.is-send h2 { margin-top: 0; }
.send-list { margin: 14px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.send-row { display: flex; align-items: center; gap: 12px; }
.send-row b { display: block; font-size: 15px; }
.send-row small { color: var(--muted); font-size: 12px; }
.send-row .pill { display: inline-flex; align-items: center; gap: 5px; color: #fff; }
.send-row .pill.whatsapp { background: #25d366; }
.send-row .pill.sms { background: var(--blue); }
.send-row .pill.done { background: var(--panel-2); color: var(--green); }
.send-row .sent { color: var(--green); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.walk-overlay.is-send .link { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; }
.wc-head .pill + .pill { margin-left: -4px; }

/* ---------- Signup improvements ---------- */
.tagline { text-wrap: balance; }
.steps-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.steps-wrap .steps { flex: none; }
.step-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; min-height: 13px; }
.price-hint { text-align: center; font-size: 13px; color: var(--soft); margin: 8px 0 10px; }
.auth-screen .social:first-of-type { margin-top: 14px; }
.plan .price .per-month { display: block; color: var(--green); font-weight: 600; font-size: 11.5px; margin-top: 3px; white-space: nowrap; }
.auth-doc { margin-top: 12px; }
.auth-doc .group { margin-top: 4px; }
.check a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Trial timeline on the confirmation screen */
.trial-timeline { margin-top: 18px; padding-left: 4px; }
.tt-step { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.tt-step:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px; background: var(--line); }
.tt-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.tt-step.now .tt-dot { background: var(--green); color: #fff; }
.tt-step b { display: block; font-size: 14px; }
.tt-step small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }

/* "Set up your safety" */
.su-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 12px; }
.su-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.su-row select { width: auto; padding: 8px 10px; }
.su-head { display: flex; gap: 12px; align-items: flex-start; }
.su-head b, .su-row b { display: block; font-size: 15px; }
.su-head small, .su-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.su-contact { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.su-contact b { display: block; font-size: 14px; } .su-contact small { color: var(--muted); font-size: 12px; }
.su-contact > .ic { color: var(--green); }
.su-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 12px; }
.su-form input { padding: 10px 12px; min-width: 0; }
.su-card .form-err { min-height: 0; margin-top: 6px; }
@media (max-width: 380px) { .su-form { grid-template-columns: 1fr; } }

/* Location unknown */
.loc-chip { position: absolute; top: calc(var(--head-h) + 6px); left: 14px; right: 66px; z-index: 6; width: fit-content; max-width: calc(100% - 80px);
  display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 12px; font-size: 12.5px; color: var(--soft); box-shadow: var(--shadow); }
.loc-chip .ic { color: var(--amber); }
.loc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-chip button { flex: none; background: var(--blue); color: #fff; font-weight: 700; font-size: 12px; border-radius: 999px; padding: 5px 11px; }
#app.walking .loc-chip, #app.picking .loc-chip { display: none; }
.su-form input.bad { border-color: var(--red); }

/* ---------- Email confirmation ---------- */
.vf-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-top: 12px;
  background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.vf-icon .ic { width: 28px; height: 28px; }
#vf-sub b { color: var(--text); word-break: break-all; }
.code-input { font-size: 30px; font-weight: 800; letter-spacing: .5em; text-align: center; padding: 14px 0 14px .5em;
  font-variant-numeric: tabular-nums; border-radius: 14px; }
.code-input.bad { border-color: var(--red); }
.demo-note { font-size: 12.5px; color: var(--muted); background: var(--panel-2); border: 1px dashed var(--line); border-radius: 10px;
  padding: 8px 10px; text-align: center; margin: 4px 0 14px; }
.vf-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.vf-links .link:disabled { color: var(--muted); cursor: default; }
.vf-spam { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; }

/* ---------- Background location (Walk me home) ---------- */
.perm-ic.walk { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.perm-tag { display: inline-block; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--soft);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }

/* ---------- Tour ---------- */
.tour-skip { align-self: flex-end; font-size: 14px; }
.tour-track { flex: 1; display: flex; margin: 0 -24px; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.auth-screen.tour { overflow-x: hidden; }
.tour-slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 32px; }
.tour-slide h2 { margin-top: 28px; }
.tour-slide .sub { max-width: 320px; margin-left: auto; margin-right: auto; }
.tour-art { position: relative; width: 150px; height: 150px; border-radius: 44px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tile) 16%, transparent); color: var(--tile);
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--tile) 7%, transparent); }
.tour-art .ic { width: 64px; height: 64px; }
.tour-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); }
.tour-dot.d1 { background: var(--red); top: 18px; right: 22px; }
.tour-dot.d2 { background: #f59e0b; bottom: 24px; left: 18px; }
.tour-dot.d3 { background: var(--blue); bottom: 16px; right: 30px; }
.tour-dots { display: flex; justify-content: center; gap: 7px; margin: 18px 0 6px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width .25s, background .25s; }
.tour-dots i.on { width: 22px; background: var(--red); }
@media (prefers-reduced-motion: reduce) { .tour-track { transition: none; } }

/* ---------- Report: where it happened ---------- */
.loc-btn { width: 100%; text-align: left; color: inherit; font: inherit; font-size: 14px; }
.loc-btn .chev { color: var(--muted); width: 16px; height: 16px; }
.loc-btn.need { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--panel)); }
.loc-btn.need > .ic:first-child { color: var(--amber); }

/* ---------- Incident: what to do ---------- */
.tips { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px; }
.tips.high { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); background: color-mix(in srgb, var(--red) 6%, var(--panel)); }
.tips ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.tips li .ic { flex: none; margin-top: 2px; color: var(--green); }
.tips-call { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 11px; border-radius: 12px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }

/* ---------- Possible duplicate ---------- */
#dupe-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.dupe-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; color: inherit; font: inherit;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.dupe-row b { display: block; font-size: 14px; line-height: 1.3; }
.dupe-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dupe-row .pill { flex: none; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; }
#dupe .secondary { margin-top: 10px; width: 100%; }

/* ---------- Incident: trust and add video ---------- */
.verify-hint { font-size: 12px !important; color: var(--muted); margin-top: 8px !important; }
.g-add.big.after { margin: 12px 0 0; }

/* ---------- Alerts tab ---------- */
.al-top { display: flex; justify-content: flex-end; margin: -4px 0 -6px; }
.al-top .link { font-size: 13px; }
.al-list { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.al-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; color: inherit; font: inherit;
  padding: 12px 14px; position: relative; }
.al-row + .al-row { border-top: 1px solid var(--line); }
.al-row .cat-ic, .al-row .tile { width: 36px; height: 36px; border-radius: 11px; flex: none; }
.al-row b { display: block; font-size: 14.5px; line-height: 1.3; font-weight: 600; }
.al-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.al-row.unread b { font-weight: 800; }
.al-row.unread::after { content: ''; position: absolute; right: 14px; bottom: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.al-time { flex: none; font-size: 12px; color: var(--muted); margin-top: 1px; }
.al-body { font-size: 13.5px; line-height: 1.45; margin-top: 8px; color: var(--soft); }
.al-demo { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* ---------- Offline ---------- */
.offline-bar { position: absolute; top: var(--head-h); left: 0; right: 0; z-index: 39; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600; background: var(--amber); color: #1b1300; text-align: center; }
.offline-bar[hidden] { display: none; }
#app.offline .loc-chip { display: none; }
#app.offline .fab.layers-btn { top: calc(var(--head-h) + 52px); }
#app.offline .map-styles { margin-top: 46px; }
/* Start screen: a little tighter so it fits a standard phone without scrolling */
[data-screen="welcome"] .features { gap: 9px; }
[data-screen="welcome"] .features li { font-size: 15.5px; line-height: 1.3; }
[data-screen="welcome"] .f-ic { width: 32px; height: 32px; border-radius: 10px; }
/* The artwork takes whatever height is left once the text and buttons fit, so both buttons stay on screen on every phone
   (the logo inside scales with it) */
[data-screen="welcome"] > * { flex: none; }
[data-screen="welcome"] .hero-art { flex: 1 1 0; min-height: 96px; max-height: 220px; height: auto; container-type: size; }
[data-screen="welcome"] .core-icon { width: clamp(64px, 45cqh, 92px); height: auto; aspect-ratio: 1; }
/* Short phones (e.g. iPhone SE): smaller artwork and spacing so Create account and Log in stay on screen */
/* Start screen buttons: full phone size, easy to tap */
[data-screen="welcome"] .auth-actions .primary { padding: 17px; font-size: 17px; border-radius: 16px; }
[data-screen="welcome"] .auth-actions .secondary { padding: 16px; font-size: 16.5px; border-radius: 16px; }
@media (max-height: 860px) { /* most iPhones once the notch and home bar are taken off */
  [data-screen="welcome"] .float { width: 36px; height: 36px; border-radius: 12px; }
  [data-screen="welcome"] .float .ic { width: 18px; height: 18px; }
  [data-screen="welcome"] .logo { font-size: 36px; }
  [data-screen="welcome"] .tagline { font-size: 16px; margin: 2px auto 12px; }
  [data-screen="welcome"] .features { gap: 8px; }
  [data-screen="welcome"] .features li { font-size: 15px; }
  [data-screen="welcome"] .f-ic { width: 32px; height: 32px; }
}

/* ---------- iPhone notch and home bar (safe areas) ----------
   The app uses the whole screen (viewport-fit=cover), so content must keep clear of the status bar / camera
   at the top and the home bar at the bottom. On screens without these, the insets are 0. */
:root {
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --head-h: calc(62px + var(--sat));
  --nav-h: calc(68px + max(8px, var(--sab)));
}
header { padding-top: var(--sat); }
nav { padding-bottom: max(8px, var(--sab)); }
.auth { padding-top: var(--sat); padding-bottom: var(--sab); }
.modal { padding-top: var(--sat); }
.modal-body { padding-bottom: calc(32px + var(--sab)); }
.viewer-x { top: calc(12px + var(--sat)); }
.banner { top: calc(10px + var(--sat)); }
.em-panel { padding-bottom: calc(28px + var(--sab)); }
.banner:not(.show) { transform: translateY(calc(-150% - var(--sat))); } /* fully hidden above the notch too */

/* Fill the whole phone screen. In Home Screen web apps iOS measures "height: 100%" short of the bottom edge,
   which left a black strip under the app; pinning the app to all four edges avoids that. */
#app { position: fixed; top: 0; bottom: 0; left: 0; right: 0; height: auto; margin: 0 auto; }
@media (max-width: 440px) { html, body { background: var(--bg); } } /* on phones, nothing behind the app should ever show */
@media (max-height: 700px) { /* iPhone SE and other short screens: a little tighter so both buttons stay on screen */
  [data-screen="welcome"] .features { gap: 6px; }
  [data-screen="welcome"] .features li { font-size: 14.5px; }
  [data-screen="welcome"] .auth-actions { padding-top: 14px; }
  [data-screen="welcome"] .auth-actions .primary { padding: 15px; }
  [data-screen="welcome"] .auth-actions .secondary { padding: 14px; }
}

/* ---------- Main screen: map up to the top edge ----------
   On the map tab the header has no solid background: the map runs up behind the clock and camera,
   with a soft shade only where the status bar sits so the time and battery stay readable. */
#app[data-tab="map"] header { background: linear-gradient(rgba(5, 6, 10, .5), rgba(5, 6, 10, 0) calc(var(--sat) + 16px)); }
#app[data-tab="map"] .brand { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px 5px 8px; box-shadow: var(--shadow); }

/* ---------- Tab bar closer to the bottom edge ----------
   Like native iPhone tab bars, the buttons sit just above the home bar instead of a full home-bar height above it. */
:root { --nav-h: calc(62px + max(6px, calc(var(--sab) - 12px))); }
nav { padding-bottom: max(6px, calc(var(--sab) - 12px)); }

/* ---------- Slightly bigger buttons and text on the main screens ---------- */
nav button { font-size: 11.5px; gap: 3px; }
nav .ic { width: 25px; height: 25px; }
.rec { width: 62px; height: 62px; }
.rec .ic { width: 28px; height: 28px; }
.brand { font-size: 22px; }
.brand-mark { width: 27px; height: 27px; }
.city-pick select { font-size: 14.5px; padding: 8px 4px; }
.sos { font-size: 14.5px; padding: 8px 13px; }
.sheet-head b { font-size: 18px; }
.sheet-head small { font-size: 14px; }
.row-item h4 { font-size: 16px; }
.meta { font-size: 13.5px; }
.card h3 { font-size: 17px; }
.card p { font-size: 15px; }
.chip { font-size: 14px; padding: 8px 13px; }
.stats { font-size: 13.5px; }
.walk-btn { font-size: 15.5px; }
.loc-chip { font-size: 13.5px; }
.loc-chip button { font-size: 13px; padding: 6px 12px; }
.segmented button { font-size: 14px; }
html, body { overflow: hidden; overscroll-behavior: none; } /* the app never scrolls as a whole page; screens scroll inside */
/* Home Screen app on iPhone: fill the physical screen (set from JS, see fitStandalone in app.js) */
#app.fit-screen { bottom: auto; height: var(--app-h); }
html:has(#app.fit-screen), html:has(#app.fit-screen) body { height: var(--app-h); }

/* ---------- Walk me home: address search ---------- */
.addr-search { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; }
.addr-search .ic { color: var(--muted); flex: none; }
.addr-search input { border: 0; background: transparent; padding: 13px 0; font-size: 16px; box-shadow: none; }
.addr-results { display: flex; flex-direction: column; margin-top: 6px; }
.addr-results:empty { display: none; }
.addr-hit { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; color: inherit; font: inherit; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.addr-hit .ic { color: var(--muted); flex: none; }
.addr-hit b { display: block; font-size: 15px; font-weight: 600; }
.addr-hit small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.addr-note { color: var(--muted); font-size: 13.5px; padding: 8px 4px; }
.addr-search + .addr-results + .chips { margin-top: 10px; }

/* Signed in at launch (set in index.html before anything is drawn): no signup screen flash */
html.signed-in #auth { display: none; }

/* "Turn on location" line in the map list header */
.sub-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font: inherit; font-size: 14px; font-weight: 600; padding: 2px 0; text-align: left; }
.sub-link .ic { flex: none; }

/* Location banner (top left of the map): the whole banner turns location on */
button.loc-chip { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); padding: 8px 14px 8px 11px; text-align: left; }
button.loc-chip .ic { color: var(--blue); flex: none; }
.loc-chip[hidden] { display: none; }
button.loc-chip span { white-space: normal; line-height: 1.3; } /* longer translations wrap instead of being cut off */
button.loc-chip { border-radius: 18px; }

/* Room under forms while the keyboard is open, so the last fields can scroll above it (see keyboardRoom in app.js) */
.modal-body::after, .auth-screen::after { content: ''; display: block; flex: none; height: var(--kb); }

/* Camera zoom steps, over the bottom of the picture */
.zoom-chips { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(0,0,0,.35); }
.zoom-chips[hidden] { display: none; }
.zoom-chips button { min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px; border: 0; background: rgba(0,0,0,.45); color: #fff; font: inherit; font-size: 13px; font-weight: 600; }
.zoom-chips button.on { background: rgba(255,255,255,.9); color: #000; }

/* Real video thumbnails: a play button over the first frame */
.play-ov { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.45);
  border: 1.5px solid rgba(255,255,255,.6); display: grid; place-items: center; color: #fff; pointer-events: none; }
.play-ov .ic { width: 18px; height: 18px; margin-left: 2px; }
.g-item .play-ov { width: 30px; height: 30px; } .g-item .play-ov .ic { width: 12px; height: 12px; }

/* 2. Video viewer: black, edge to edge, the video as large as the screen allows (whole picture visible, portrait or landscape).
   Close with the X or by swiping down. */
.viewer { background: #000; place-items: stretch; }
#viewer-body { position: absolute; left: 0; right: 0; top: calc(56px + var(--sat)); bottom: calc(12px + var(--sab)); display: grid; place-items: center; transition: transform .2s; }
#viewer-body video, #viewer-body img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
#viewer-body .vdemo { height: auto; max-height: 100%; }
.viewer-x { background: rgba(255,255,255,.14); border-radius: 50%; }

/* Link from the in-app privacy summary to the full policy on the website */
.primary.doc-full { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; margin-bottom: 16px; }

/* Report links on updates and videos, and the report button in the video viewer */
.tl-flag { border: 0; background: none; color: var(--muted); padding: 2px 4px; margin-left: 4px; vertical-align: middle; cursor: pointer; opacity: .7; }
.tl-flag .ic { width: 13px; height: 13px; }
.viewer-flag { position: absolute; top: calc(12px + var(--sat)); left: 12px; color: #fff; z-index: 2; background: rgba(255,255,255,.14); border-radius: 50%; }
.viewer-flag[hidden] { display: none; }
#mod-reasons { margin: 12px 0 4px; }
#mod-block .dupe-row { margin-top: 8px; }
