/* Formal register style: navy app bar, flat surfaces, thin rules, tabular data. */
:root {
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #dde3ea;
  --rule: #e9edf2;
  --text: #16202c;
  --muted: #5f6b7a;
  --faint: #8a96a6;
  --navy: #0b2545;
  --navy-2: #13315c;
  --accent: #1f5fad;
  --accent-soft: #e8f0fa;
  --ok: #1d7a46;
  --ok-soft: #e6f3ec;
  --warn: #9a6a12;
  --warn-soft: #f8f0df;
  --bad: #b42318;
  --bad-soft: #fbeae8;
  --on-navy: #ffffff;
  --on-navy-muted: #a9b8cc;
  --radius: 6px;
  --radius-sm: 4px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root.dark {
  --canvas: #0e141b;
  --surface: #161e28;
  --surface-2: #1b2531;
  --border: #283444;
  --rule: #222d3a;
  --text: #e6ebf1;
  --muted: #9aa7b8;
  --faint: #738196;
  --navy: #0a1a30;
  --navy-2: #112a4a;
  --accent: #6ea6e8;
  --accent-soft: #19304d;
  --ok: #4cc27f; --ok-soft: #15301f;
  --warn: #e0b354; --warn-soft: #33290f;
  --bad: #f07167; --bad-soft: #3a1b19;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 14.5px/1.45 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--canvas); color: var(--text);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- app bar ---------- */
.view { min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
.appbar { background: var(--navy); color: var(--on-navy); padding: 14px 16px 14px; }
.appbar .org { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-navy-muted); font-weight: 600; }
.appbar h1 { font-size: 20px; font-weight: 600; margin: 2px 0 0; letter-spacing: -.01em; }
.appbar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bar-btn { position: relative; width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .22); color: var(--on-navy); }
.bar-btn:active { background: rgba(255, 255, 255, .08); }
.bar-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--navy); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.search { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 10px; height: 40px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: var(--on-navy-muted); }
.search:focus-within { background: #fff; color: #5f6b7a; border-color: #fff; }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--on-navy); min-width: 0; height: 100%; }
.search:focus-within input { color: #16202c; }
.search input::placeholder { color: var(--on-navy-muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { font-size: 12.5px; color: inherit; padding: 4px; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-bottom: 1px solid var(--border); }
.kpi { padding: 10px 14px; border-right: 1px solid var(--rule); }
.kpi:last-child { border-right: 0; }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 19px; font-weight: 600; margin-top: 1px; }

/* filter tabs */
.toolbar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 11px 10px 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab .n { font-weight: 400; color: var(--faint); margin-left: 3px; }
.tab.on { color: var(--navy); border-bottom-color: var(--navy); }
:root.dark .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.result-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 12.5px; color: var(--muted); }
.result-bar b { color: var(--text); font-weight: 600; }
.link-btn { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--accent); font-size: 12.5px; }
.link-btn svg { width: 15px; height: 15px; }

/* ---------- list rows ---------- */
.list { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.row-item { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); position: relative; cursor: pointer; }
.row-item:last-child { border-bottom: 0; }
.row-item:active { background: var(--surface-2); }
.thumb { width: 104px; height: 78px; border-radius: var(--radius-sm); overflow: hidden; background: var(--rule); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.thumb img.ok { opacity: 1; }
.thumb .cnt { position: absolute; right: 4px; bottom: 4px; background: rgba(11, 37, 69, .82); color: #fff; font-size: 10.5px; font-weight: 600; padding: 1px 5px; border-radius: 3px; display: flex; align-items: center; gap: 3px; }
.thumb .cnt svg { width: 11px; height: 11px; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); background: var(--rule); }
.noimg svg { width: 28px; height: 28px; stroke-width: 1.4; }
.ri-body { min-width: 0; display: flex; flex-direction: column; }
.ri-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.ri-title { font-weight: 600; font-size: 14.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; }
.ri-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-price { margin-top: auto; padding-top: 4px; font-weight: 700; font-size: 15px; }
.ri-price.tba { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.fav { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--faint); }
.fav svg { width: 19px; height: 19px; }
.fav.on { color: var(--navy); }
.fav.on svg { fill: currentColor; }
:root.dark .fav.on { color: var(--accent); }

.status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; letter-spacing: .01em; text-transform: none; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.on_sale { color: var(--ok); background: var(--ok-soft); }
.status.reserved { color: var(--warn); background: var(--warn-soft); }
.status.sold { color: var(--bad); background: var(--bad-soft); }

.skeleton { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.skeleton .a { height: 78px; border-radius: var(--radius-sm); }
.skeleton .l { height: 11px; border-radius: 3px; margin: 6px 0; }
.skeleton .a, .skeleton .l { background: linear-gradient(90deg, var(--rule) 25%, var(--surface-2) 50%, var(--rule) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); background: var(--surface); }
.empty .ill { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; color: var(--faint); }
.empty h3 { color: var(--text); margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.empty .btn { margin-top: 16px; }

/* ---------- buttons ---------- */
.btn { height: 44px; padding: 0 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; border: 1px solid transparent; transition: background .15s, border-color .15s, opacity .2s; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:active { background: var(--navy-2); }
:root.dark .btn.primary { background: var(--accent); color: #08172b; }
.btn.outline { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn.outline:active { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: var(--surface); border-top: 1px solid var(--border); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--navy); }
.tabbar a.on::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--navy); }
:root.dark .tabbar a.on { color: var(--accent); }
:root.dark .tabbar a.on::before { background: var(--accent); }
.tabbar .dot { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
:root.dark .tabbar .dot { background: var(--accent); color: #08172b; }

/* ---------- detail page ---------- */
.page { position: fixed; inset: 0; z-index: 30; background: var(--canvas); overflow-y: auto; overscroll-behavior: contain; animation: slidein .25s var(--ease); }
.page.out { animation: slideout .18s var(--ease) forwards; }
@keyframes slidein { from { transform: translateX(18%); opacity: 0; } }
@keyframes slideout { to { transform: translateX(18%); opacity: 0; } }
.d-bar { position: sticky; top: 0; z-index: 3; height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 6px 0 12px; background: var(--navy); color: #fff; }
.d-bar .t { flex: 1; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-bar button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-sm); }
.d-bar button:active { background: rgba(255, 255, 255, .1); }
.d-bar .fav-d.on svg { fill: currentColor; }
.gallery { position: relative; background: #0b1420; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 16 / 10; max-height: 56vh; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track > * { flex: 0 0 100%; scroll-snap-align: center; width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .counter { position: absolute; right: 10px; bottom: 10px; background: rgba(11, 20, 32, .75); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 3px; }
.d-head { background: var(--surface); padding: 14px 16px 16px; border-bottom: 1px solid var(--border); }
.d-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.d-title { font-size: 20px; font-weight: 600; line-height: 1.25; margin: 6px 0 2px; }
.d-loc { color: var(--muted); font-size: 13.5px; }
.price { margin-top: 14px; padding: 2px 0 2px 12px; border-left: 3px solid var(--navy); }
:root.dark .price { border-left-color: var(--accent); }
.price .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.price .v { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.price .s { font-size: 12.5px; color: var(--muted); }
.section { background: var(--surface); margin-top: 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 16px; }
.section h3 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.section p { margin: 0; white-space: pre-line; }
.kv { display: grid; grid-template-columns: minmax(120px, 44%) 1fr; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); padding-right: 12px; }
.kv .v { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.copy { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; }
.copy svg { width: 14px; height: 14px; }
.mini-map { height: 180px; border-radius: var(--radius-sm); overflow: hidden; margin: 4px 0 10px; border: 1px solid var(--border); position: relative; z-index: 0; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; height: 38px; font-size: 13px; padding: 0 10px; }
.note { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); font-size: 13px; }
.similar .row-item { padding-left: 0; padding-right: 0; }
.similar .fav { right: -6px; }
.actionbar { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + var(--safe-b)); display: flex; gap: 8px; background: var(--surface); border-top: 1px solid var(--border); }
.actionbar .btn { flex: 1; }
.spacer { height: calc(84px + var(--safe-b)); }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.backdrop { position: absolute; inset: 0; background: rgba(8, 18, 32, .5); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 10px 10px 0 0; animation: up .25s var(--ease); transition: transform .22s var(--ease); }
@keyframes up { from { transform: translateY(100%); } }
.sheet-wrap.closing .sheet { transform: translateY(100%); }
.sheet-wrap.closing .backdrop { opacity: 0; transition: opacity .22s; }
.grab { padding: 8px 0 2px; display: grid; place-items: center; touch-action: none; }
.grab span { width: 36px; height: 4px; border-radius: 2px; background: var(--border); }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(16px + var(--safe-b)); overscroll-behavior: contain; }
.sheet-body h2 { margin: 6px 0 2px; font-size: 18px; font-weight: 600; }
.sheet-body .lead { color: var(--muted); margin: 0 0 12px; font-size: 13.5px; }
.group-title { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 18px 0 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { padding: 7px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13.5px; font-weight: 500; background: var(--surface); }
.opt.on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root.dark .opt.on { background: var(--accent); border-color: var(--accent); color: #08172b; }
.opt .n { color: var(--faint); margin-left: 3px; }
.opt.on .n { color: inherit; opacity: .7; }
.days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.day { height: 62px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.day small { font-size: 11px; color: var(--muted); }
.day b { font-size: 18px; font-weight: 600; }
.day.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.day.on small { color: var(--on-navy-muted); }
:root.dark .day.on { background: var(--accent); border-color: var(--accent); color: #08172b; }
:root.dark .day.on small { color: #08172b; }
.times { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.times .opt { text-align: center; padding: 8px 0; }
.field { margin-top: 10px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--border); outline: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; padding: 10px 12px; border-radius: var(--radius-sm); }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { min-height: 76px; resize: none; }
.field.err input { border-color: var(--bad); }
.field .msg { color: var(--bad); font-size: 12px; margin-top: 4px; }
.sheet-foot { margin-top: 18px; display: grid; gap: 8px; }
.summary { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.summary img { width: 64px; height: 48px; border-radius: 3px; object-fit: cover; }
.summary b { display: block; font-size: 14px; font-weight: 600; }
.summary span { color: var(--muted); font-size: 12.5px; }
.result { padding: 12px 0 0; }
.result .mark { width: 52px; height: 52px; margin: 4px auto 12px; border-radius: 50%; border: 2px solid var(--ok); color: var(--ok); display: grid; place-items: center; }
.result .mark svg { width: 26px; height: 26px; stroke-width: 2.2; }
.result h2 { margin: 0 0 4px; text-align: center; }
.result > p { text-align: center; color: var(--muted); margin: 0; font-size: 13.5px; }
.result .kv { margin-top: 14px; border-top: 1px solid var(--rule); }
.list-opts { display: grid; }
.list-opts button { display: flex; justify-content: space-between; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--rule); font-weight: 500; text-align: left; }
.list-opts button:last-child { border-bottom: 0; }
.list-opts button.on { color: var(--accent); font-weight: 600; }
.list-opts button.on::after { content: "✓"; }

/* ---------- map ---------- */
#view-map { padding: 0; }
#bigmap { position: fixed; inset: 0 0 calc(var(--tab-h) + var(--safe-b)) 0; z-index: 0; }
.map-top { position: fixed; z-index: 5; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-pill { background: var(--surface); border: 1px solid var(--border); padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.map-btn { width: 38px; height: 38px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.price-marker { position: absolute; transform: translate(-50%, -100%); background: #0b2545; color: #fff; font-weight: 600; font-size: 11.5px; padding: 3px 7px; border-radius: 3px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .5); }
.price-marker::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; background: inherit; transform: translateX(-50%) rotate(45deg); z-index: -1; }
.price-marker.reserved { background: #9a6a12; }
.price-marker.active { background: #1f5fad; transform: translate(-50%, -100%) scale(1.1); z-index: 1000; }
.cluster { position: absolute; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(11, 37, 69, .22); }
.cluster b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #0b2545; color: #fff; font-size: 12.5px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .6); }
.leaflet-div-icon { background: none; border: 0; }
.map-card { position: fixed; z-index: 6; left: 10px; right: 10px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); display: flex; gap: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); animation: up .22s var(--ease); cursor: pointer; }
.map-card .thumb { width: 92px; height: 70px; }
.map-card .info { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.leaflet-container { font: inherit; background: var(--canvas); }

/* ---------- contact ---------- */
.org-card { background: var(--navy); color: #fff; padding: 18px 16px; }
.org-card .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--on-navy-muted); font-weight: 600; }
.org-card h2 { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.org-card .btn { margin-top: 14px; background: #fff; color: #0b2545; }
.steps { counter-reset: s; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.step:last-child { border-bottom: 0; }
.step::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--navy); color: var(--navy); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
:root.dark .step::before { border-color: var(--accent); color: var(--accent); }
.step b { display: block; font-weight: 600; }
.step span { color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--border); transition: background .2s; flex-shrink: 0; }
.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 .2s var(--ease); }
.switch.on { background: var(--navy); }
:root.dark .switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }
.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle-row div { flex: 1; }
.toggle-row small { color: var(--muted); display: block; font-size: 12.5px; }

/* ---------- viewer / toast ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; animation: fade .2s; }
.viewer-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track > * { flex: 0 0 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.viewer-top { position: absolute; top: 0; left: 0; right: 0; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 600; font-size: 13px; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.viewer-top button { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; }
.toast { position: fixed; z-index: 80; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); background: #1b2733; color: #fff; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); animation: up .2s var(--ease); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* branding background (illustration or uploaded building photo) behind the app bars */
.appbar, .org-card { background: linear-gradient(180deg, rgba(11, 37, 69, .93), rgba(11, 37, 69, .8)), var(--brand-bg, none) 65% 70% / cover no-repeat, var(--navy); }
:root.dark .appbar, :root.dark .org-card { background: linear-gradient(180deg, rgba(10, 26, 48, .95), rgba(10, 26, 48, .84)), var(--brand-bg, none) 65% 70% / cover no-repeat, var(--navy); }
