:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #0f172a);
  --hint: var(--tg-theme-hint-color, #6b7280);
  --link: var(--tg-theme-link-color, #2563eb);
  --accent: #ffb020;
  --accent-ink: #1a1200;
  --navy: #0f172a;
  --red: #ef4444;
  --orange: #f59e0b;
  --green: #16a34a;
  --cam: #475569;
  --grey: #9ca3af;
  --tgblue: #229ed9;
  --shadow: 0 6px 24px rgba(15, 23, 42, .16);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .28);
  --r: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: max(env(safe-area-inset-top), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-l: env(safe-area-inset-left);
  --safe-r: env(safe-area-inset-right);
}
@media (prefers-color-scheme: dark) {
  :root:not(.tg) { --bg: #111827; --bg2: #1f2937; --text: #f3f4f6; --hint: #9ca3af; --link: #60a5fa; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg2); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; width: 100%; transition: border-color .15s; }
textarea { resize: vertical; min-height: 92px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
svg { width: 22px; height: 22px; display: block; flex: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: calc(84px + var(--safe-b)); }
.maplibregl-ctrl-top-right { top: calc(56px + var(--safe-t)); right: calc(2px + var(--safe-r)); }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; overflow: hidden; }

/* top bar */
.top { position: fixed; top: calc(8px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: center; z-index: 5; pointer-events: none; }
.top > * { pointer-events: auto; }
.pill { background: var(--bg); color: var(--text); border-radius: 999px; box-shadow: var(--shadow); height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; transition: transform .2s var(--ease); }
.pill svg { width: 18px; height: 18px; }
.pill:active { transform: scale(.97); }
.status[hidden] { display: none; }
.status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.status.normal .dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.status.busy .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.top .grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; transition: transform .2s var(--ease); }
.icon-btn:active { transform: scale(.94); }
.badge-dev { position: fixed; top: calc(54px + var(--safe-t)); left: calc(10px + var(--safe-l)); z-index: 4; font-size: 11px; background: var(--navy); color: #fff; padding: 3px 8px; border-radius: 8px; opacity: .85; }

/* right buttons */
.fabs { position: fixed; right: calc(10px + var(--safe-r)); bottom: calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.fab { width: 46px; height: 46px; border-radius: 50%; background: var(--bg); box-shadow: var(--shadow); display: grid; place-items: center; transition: transform .2s var(--ease), color .2s; }
.fab:active { transform: scale(.93); }
.fab.gps-on { color: #2563eb; }
.fab.gps-off { color: var(--hint); }
.fab.fb { color: var(--accent-ink); background: var(--accent); }
.icon-btn { position: relative; }
.nbadge { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg); animation: pop .35s var(--ease); }
.nbadge.inline { position: static; display: inline-grid; border: 0; margin-left: 6px; vertical-align: 1px; }
.fab[hidden] { display: none; }
#compassBtn svg { width: 26px; height: 26px; transition: transform .15s linear; }
.modal .heart { color: #ef4444; font-weight: 600; margin-top: 10px; }

/* main button */
.mainbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(12px + var(--safe-b)); z-index: 5; display: flex; justify-content: center; pointer-events: none; }
.btn-main { pointer-events: auto; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px; height: 58px; border-radius: 29px; padding: 0 34px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(255, 176, 32, .45); transition: transform .2s var(--ease), box-shadow .2s; }
.btn-main:active { transform: scale(.96); }
.btn-main svg { width: 24px; height: 24px; stroke-width: 2.6; }
.btn-main.tgb { background: var(--tgblue); color: #fff; box-shadow: 0 8px 24px rgba(34, 158, 217, .4); font-size: 17px; }

/* markers: the outer element is positioned by the map, the inner one is styled and animated */
.mkw { cursor: pointer; }
.mk { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--red); border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3); position: relative; animation: pop .38s var(--ease) both; transition: transform .2s var(--ease), opacity .25s, background-color .4s; }
.mk.out { transform: scale(.3); opacity: 0; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.mk svg { width: 20px; height: 20px; }
.mk.hot::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--red); animation: pulse 2s ease-out infinite; pointer-events: none; }
@keyframes pulse { from { transform: scale(.7); opacity: .85; } to { transform: scale(1.5); opacity: 0; } }
.mk.warm { background: var(--orange); }
.mk.cool { background: #fb923c; opacity: .8; }
.mk.grey { background: var(--grey); }
.mk.trap { background: var(--navy); color: var(--accent); border-color: var(--accent); }
.mk.trap.hot { background: var(--red); color: #fff; border-color: #fff; }
.mk.cam { width: 30px; height: 30px; background: var(--cam); border-width: 2px; }
.mk.cam svg { width: 16px; height: 16px; }
.mk.cam.grey { background: var(--grey); }
.mk.sel { transform: scale(1.18); }
.mk .dirwrap { position: absolute; inset: -15px; pointer-events: none; }
.mk .dir { position: absolute; top: 0; left: 50%; width: 15px; height: 15px; margin-left: -7.5px; color: var(--navy); background: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mk .dir svg { width: 10px; height: 10px; stroke-width: 3; }
.mk.verified::before { content: ''; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; background: var(--green); border: 2px solid #fff; border-radius: 50%; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37, 99, 235, .2), 0 2px 6px rgba(0,0,0,.3); }

/* crosshair placement */
.cross { position: fixed; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -100%); pointer-events: none; opacity: 0; transition: opacity .2s; }
.cross svg { width: 44px; height: 44px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.placing .cross { opacity: 1; }
.placebar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 7; background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 14px;
  transform: translateY(140%); transition: transform .32s var(--ease); }
.placing .placebar { transform: none; }
.placing .mainbar, .placing .fabs { opacity: 0; pointer-events: none; }
.mainbar, .fabs { transition: opacity .2s; }
.placebar p { margin: 0 0 10px; color: var(--hint); font-size: 14px; }

/* sheets */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .32); z-index: 20; opacity: 0; pointer-events: none; transition: opacity .28s var(--ease); }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--bg); border-radius: 22px 22px 0 0; max-height: 86vh; max-height: 86dvh; overflow-y: auto;
  transform: translateY(105%); transition: transform .34s var(--ease); padding: 8px 16px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); overscroll-behavior: contain; will-change: transform; }
.sheet.on { transform: none; }
.sheet.drag { transition: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(127,127,127,.3); margin: 2px auto 8px; }
.sheet-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; color: var(--hint); z-index: 1; }
.sheet-x svg { width: 18px; height: 18px; }
.sbody.swap { animation: swap .26s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sheet h2 { font-size: 20px; margin: 4px 44px 12px 0; }
.sheet h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--hint); margin: 18px 0 8px; font-weight: 600; }
.sheet p { margin: 6px 0; }
.muted { color: var(--hint); font-size: 14px; }
.small { font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--bg2); border-radius: 14px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2; min-height: 84px; transition: transform .18s var(--ease), background-color .15s; }
.tile .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--red); }
.tile .ic.trap { background: var(--navy); color: var(--accent); }
.tile .ic.camera { background: var(--cam); }
.tile:active { transform: scale(.96); }

.btn { min-height: 50px; border-radius: 14px; background: var(--bg2); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 0 12px; transition: transform .18s var(--ease), filter .15s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--navy); color: #fff; }
.btn.tgb { background: var(--tgblue); color: #fff; }
.btn.yes { background: #16a34a; color: #fff; }
.btn.no { background: #dc2626; color: #fff; }
.btn.ghost { background: transparent; color: var(--link); min-height: 44px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg2); border-radius: 999px; padding: 8px 12px; font-size: 14px; transition: background-color .15s, color .15s; }
.chip.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tagline span { background: var(--bg2); border-radius: 8px; padding: 3px 8px; font-size: 13px; }

.card-head { display: flex; gap: 12px; align-items: center; }
.card-head .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--red); flex: none; }
.card-head .ic svg { width: 26px; height: 26px; }
.card-head .ic.trap { background: var(--navy); color: var(--accent); }
.card-head .ic.camera { background: var(--cam); }
.card-head .ic.grey { background: var(--grey); color: #fff; }
.card-head h2 { margin: 0 40px 0 0; }
.note { background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.live { color: #dc2626; font-weight: 600; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.live::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.list { background: var(--bg2); border-radius: 14px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%; text-align: left; transition: background-color .15s; }
.item + .item { border-top: 1px solid rgba(127, 127, 127, .15); }
.item .grow { flex: 1; min-width: 0; }
.item .sub { color: var(--hint); font-size: 13px; }
.item svg { width: 20px; height: 20px; color: var(--hint); flex: none; }
.promo { display: flex; gap: 12px; align-items: center; background: var(--accent); color: var(--accent-ink); border-radius: 16px; padding: 14px; width: 100%; text-align: left; margin-bottom: 12px; transition: transform .18s var(--ease); }
.promo:active { transform: scale(.98); }
.promo .ic { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.55); display: grid; place-items: center; flex: none; }
.promo b { display: block; font-size: 16px; }
.promo span { font-size: 13px; opacity: .85; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: rgba(127,127,127,.35); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }
.seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 36px; border-radius: 9px; font-weight: 600; font-size: 14px; transition: background-color .15s, box-shadow .15s; }
.seg button.on { background: var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.status-chip { display: inline-block; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: var(--bg2); }
.status-chip.planned { background: #dbeafe; color: #1e40af; }
.status-chip.done { background: #dcfce7; color: #166534; }
.status-chip.seen { background: #fef3c7; color: #92400e; }

/* ask card */
.ask { position: fixed; left: 10px; right: 10px; top: calc(58px + var(--safe-t)); z-index: 15; background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 14px;
  transform: translateY(-20px); opacity: 0; transition: transform .32s var(--ease), opacity .25s; }
.ask:not(.on) { visibility: hidden; pointer-events: none; transition: transform .32s var(--ease), opacity .25s, visibility 0s .32s; }
.ask.on { transform: none; opacity: 1; }
.ask .card-head .ic { width: 40px; height: 40px; }
.ask .card-head h2 { font-size: 17px; margin: 0; }

/* modal popups */
.modal-wrap { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .5); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.modal-wrap.on { opacity: 1; pointer-events: auto; }
.modal { background: var(--bg); border-radius: 24px; width: 100%; max-width: 420px; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px 20px 18px; box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.97); transition: transform .34s var(--ease); }
.modal-wrap.on .modal { transform: none; }
.modal h2 { margin: 0 0 8px; font-size: 21px; text-align: center; }
.modal p { margin: 0 0 6px; text-align: center; color: var(--hint); }
.modal .hero { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--bg2); color: var(--text); }
.modal .hero svg { width: 36px; height: 36px; }
.modal .hero.accent { background: var(--accent); color: var(--accent-ink); }
.modal .hero.logo { background: none; }
.modal .hero.logo img { width: 76px; height: 76px; border-radius: 20px; }
.modal .slide { animation: swap .3s var(--ease); }
.dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 4px; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(127,127,127,.3); transition: width .3s var(--ease), background-color .3s; }
.dots i.on { width: 20px; background: var(--accent); }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 10px; }
.kinds button { background: var(--bg2); border-radius: 14px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; transition: background-color .15s, transform .18s var(--ease); }
.kinds button svg { width: 22px; height: 22px; }
.kinds button.on { background: var(--accent); color: var(--accent-ink); }
.kinds button:active { transform: scale(.95); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 24px); background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 14px; z-index: 50;
  opacity: 0; transition: opacity .25s, transform .32s var(--ease); pointer-events: none; display: flex; gap: 12px; align-items: center; width: max-content; max-width: min(460px, calc(100vw - 24px)); font-size: 14px; box-shadow: var(--shadow-lg); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* reference text */
.md p { margin: 8px 0; }
.md ul { padding-left: 20px; margin: 8px 0; }
.md li { margin: 4px 0; }
.phr li strong { font-size: 17px; }

.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy); z-index: 60; transition: opacity .4s var(--ease); }
.splash img { width: 88px; height: 88px; border-radius: 22px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); } }
.splash.off { opacity: 0; pointer-events: none; }

/* admin */
.adm { position: fixed; inset: 0; background: var(--bg); z-index: 25; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transform: translateY(16px); transition: opacity .25s, transform .32s var(--ease); }
.adm.on { opacity: 1; pointer-events: auto; transform: none; }
.adm-head { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 8px; }
.adm-head h2 { margin: 0; flex: 1; font-size: 19px; }
.adm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { background: var(--bg2); border-radius: 999px; padding: 7px 13px; white-space: nowrap; font-size: 14px; font-weight: 600; transition: background-color .15s, color .15s; }
.adm-tabs button.on { background: var(--navy); color: #fff; }
.adm-tabs button .n { background: var(--red); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 12px; margin-left: 4px; }
.adm-body { flex: 1; overflow-y: auto; padding: 0 12px calc(20px + var(--safe-b)); }
.adm-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--hint); margin: 16px 0 8px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--bg2); border-radius: 12px; padding: 10px; }
.kpi b { display: block; font-size: 22px; }
.kpi span { font-size: 12px; color: var(--hint); }
.acard { background: var(--bg2); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.acard .t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acard .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acard .acts button { background: var(--bg); border-radius: 10px; padding: 7px 11px; font-size: 13px; font-weight: 600; }
.acard .acts button.red { color: #dc2626; }
.acard .acts button.green { color: #16a34a; }
.acard .acts button.on { background: var(--navy); color: #fff; }
.flag { display: inline-block; background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 1px 6px; font-size: 12px; margin-right: 4px; }
.form label { display: block; font-size: 13px; color: var(--hint); margin: 10px 0 4px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty { text-align: center; color: var(--hint); padding: 30px 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.fbtext { white-space: pre-wrap; margin: 8px 0; }

/* pointer devices */
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .tile:hover, .chip:hover, .item:hover, .seg button:hover:not(.on) { filter: brightness(.96); }
  .fab:hover, .icon-btn:hover, .pill:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(15, 23, 42, .2); }
  .btn-main:hover { transform: translateY(-1px); }
  .mkw:hover .mk { transform: scale(1.12); }
}

/* wide screens: tablets, an unfolded Fold, landscape phones, computers. Panels float on the left, the map stays usable. */
@media (min-width: 720px) {
  .sheet { left: calc(12px + var(--safe-l)); right: auto; top: calc(58px + var(--safe-t)); bottom: auto; width: 400px; max-height: calc(100% - 70px - var(--safe-t) - var(--safe-b));
    border-radius: 22px; transform: translateX(calc(-100% - 30px)); padding-bottom: 18px; box-shadow: var(--shadow-lg); }
  .sheet .grab { display: none; }
  .sheet.on { transform: none; }
  .scrim { display: none; }
  .mainbar { justify-content: flex-end; padding-right: calc(72px + var(--safe-r)); }
  .ask { left: calc(50% - 190px); right: auto; width: 380px; }
  .placebar { left: 50%; right: auto; width: 440px; margin-left: -220px; }
  .adm { inset: calc(12px + var(--safe-t)) auto calc(12px + var(--safe-b)) 50%; width: min(760px, calc(100% - 24px)); transform: translate(-50%, 16px); border-radius: 22px; box-shadow: var(--shadow-lg); }
  .adm.on { transform: translate(-50%, 0); }
  .adm-head { padding-top: 14px; }
  .toast { bottom: calc(24px + var(--safe-b)); }
}
/* short landscape screens: tighter vertical spacing */
@media (max-height: 520px) {
  .btn-main { height: 50px; font-size: 16px; }
  .fabs { bottom: calc(76px + var(--safe-b)); gap: 8px; }
  .fab { width: 42px; height: 42px; }
  .modal { padding: 16px; }
  .modal .hero { width: 56px; height: 56px; margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
