/* RidgeHere — calm, friendly "paper glass" over a living panorama. No third-party fonts: the system UI face. */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #17262a; --ink-2: #3f5357; --muted: #66787b; --line: rgba(23, 38, 42, 0.1);
  --pine: #1f5c4c; --pine-2: #2c7a64; --dusk: #f08a63; --dusk-2: #ffb27a; --gold: #e2a34a; --err: #c2452d; --ok: #2c7a64;
  --glass: rgba(252, 251, 248, 0.82); --glass-2: rgba(252, 251, 248, 0.66); --shadow: 0 10px 30px rgba(15, 30, 35, 0.18), 0 2px 6px rgba(15, 30, 35, 0.08);
  --r: 18px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe3f3; color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--pine); }
svg { flex: none; }

.pano { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; outline: none; }
.pano:active { cursor: grabbing; }
.pano.cam { background: transparent; }
.cam { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; object-fit: cover; background: #000; }
body.camera { background: #000; }

.glass { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow); }

/* ---------- top bar ---------- */
.topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 6px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; text-shadow: 0 1px 6px rgba(10, 30, 40, 0.45); }
.logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 12px rgba(10, 30, 40, 0.25); }
.brand-t { font-weight: 800; font-size: 18px; letter-spacing: -0.2px; }
.place-chip { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 360px; padding: 6px 14px 6px 10px; border-radius: 999px; color: var(--ink); text-align: left; }
.place-chip svg { width: 18px; height: 18px; fill: none; stroke: var(--dusk); stroke-width: 2; }
.pc-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pc-t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-t small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tb-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.7); background: var(--glass); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: #fff; }
.acct-chip { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px 0 6px; border-radius: 999px; color: var(--ink); font-weight: 650; font-size: 14px; max-width: 200px; }
.acct-chip svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--pine); fill: none; stroke: #fff; stroke-width: 2; }
.acct-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-chip.in svg { background: linear-gradient(135deg, var(--pine-2), var(--pine)); }
.acct-chip.pro svg { background: linear-gradient(135deg, var(--dusk-2), var(--dusk)); }
.acct-ph { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.badge-n { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--dusk); color: #fff; font: 700 11px/18px var(--font); font-style: normal; text-align: center; box-shadow: 0 2px 6px rgba(240, 138, 99, 0.5); }
.chat-ic { width: 20px; height: 20px; }
.chat-ic .ci-b { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chat-ic .ci-s { fill: var(--dusk); stroke: none; }

/* ---------- dock ---------- */
.dock { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 12px calc(14px + var(--safe-b)); pointer-events: none; }
.dock > * { pointer-events: auto; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 16px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--ink-2); }
.seg button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.seg button.on { background: var(--pine); color: #fff; box-shadow: 0 4px 12px rgba(31, 92, 76, 0.35); }
.dock-row { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; max-width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.7); background: var(--glass); color: var(--ink); font-weight: 650; font-size: 14px; white-space: nowrap; }
.pill b { font-size: 16px; color: var(--pine); }
.pill.warm { background: linear-gradient(135deg, var(--dusk-2), var(--dusk)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(240, 138, 99, 0.45); }
.pill svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
body.camera .dock .pill:not(.warm), body.camera .dock .icon-btn { background: rgba(252, 251, 248, 0.9); }

.settings { position: fixed; z-index: 25; right: 12px; bottom: calc(118px + var(--safe-b)); width: 300px; padding: 14px 16px; border-radius: var(--r); animation: rise 0.2s ease-out; }
.settings h3 { margin: 4px 0 8px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chips button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.7); padding: 7px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.chips button.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.chips button.lock::after { content: " · Pro"; color: var(--gold); font-weight: 700; }
.chips button.lock.on::after { color: #ffe1b0; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px; cursor: pointer; font-weight: 550; border-top: 1px solid var(--line); }
.toggle .sw { width: 42px; height: 24px; border-radius: 12px; background: #c9d2d0; position: relative; transition: background 0.2s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.toggle[aria-checked="true"] .sw { background: var(--pine-2); }
.toggle[aria-checked="true"] .sw::after { transform: translateX(18px); }

/* ---------- loader + hint + toast ---------- */
.loader { position: fixed; z-index: 22; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; border-radius: 16px; font-size: 13.5px; font-weight: 600; min-width: 250px; }
.ld-peak { width: 22px; height: 18px; background: var(--pine); clip-path: polygon(0 100%, 42% 10%, 60% 45%, 72% 28%, 100% 100%); animation: breathe 1.3s ease-in-out infinite; }
.ld-bar { position: absolute; left: 14px; right: 14px; bottom: 7px; height: 3px; border-radius: 2px; background: rgba(31, 92, 76, 0.12); overflow: hidden; }
.ld-bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--pine-2), var(--dusk)); transform-origin: left; transition: transform 0.2s; }
.loader.indet .ld-bar i { animation: indet 1.2s ease-in-out infinite; transform: scaleX(0.3) !important; }
.hint { position: fixed; z-index: 21; left: 50%; bottom: calc(132px + var(--safe-b)); transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; animation: rise 0.3s ease-out; }
.toast { position: fixed; z-index: 60; left: 50%; top: calc(70px + var(--safe-t)); transform: translate(-50%, -8px); max-width: min(92vw, 460px); padding: 11px 18px; border-radius: 14px; background: rgba(23, 38, 42, 0.92); color: #fff; font-size: 14px; font-weight: 550; box-shadow: var(--shadow); opacity: 0; transition: opacity 0.25s, transform 0.25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { position: fixed; z-index: 5; left: 12px; bottom: calc(4px + var(--safe-b)); font-size: 10px; opacity: 0.7; }
.foot a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }

/* ---------- peak card ---------- */
.card { position: fixed; z-index: 24; left: 16px; bottom: calc(118px + var(--safe-b)); width: 380px; padding: 16px 18px 14px; border-radius: 22px; animation: rise 0.22s ease-out; }
.card h2 { margin: 0 34px 10px 0; font-size: 23px; line-height: 1.15; letter-spacing: -0.3px; }
.c-kind { margin: 0 0 2px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dusk); font-weight: 700; }
.c-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.c-facts div { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.65); border: 1px solid var(--line); }
.c-facts b { font-size: 16px; }
.c-facts small { color: var(--muted); font-size: 12.5px; }
.c-state { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; font-weight: 650; padding: 4px 10px; border-radius: 999px; }
.c-state.ok { background: rgba(44, 122, 100, 0.12); color: var(--pine); }
.c-state.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pine-2); }
.c-state.hid { background: rgba(102, 120, 123, 0.12); color: var(--ink-2); }
.c-out { margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; }
.c-out:empty { display: none; }
.c-out.ok, .c-out.maybe, .c-out.no, .c-out.wait { padding: 9px 12px; border-radius: 12px; }
.c-out.ok { background: rgba(44, 122, 100, 0.12); color: #164a3d; }
.c-out.maybe { background: rgba(226, 163, 74, 0.16); color: #6d4612; }
.c-out.no { background: rgba(102, 120, 123, 0.13); color: var(--ink-2); }
.c-out.wait { background: rgba(255, 255, 255, 0.6); color: var(--muted); }
.c-acts { display: flex; gap: 8px; align-items: center; }
.c-acts .btn { white-space: nowrap; padding: 0 16px; }
#c-seen { flex: 1.3; }
#c-isout { flex: 1; }
.c-acts .icon-btn { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.7); border-color: var(--line); }
#c-fav.on svg { fill: var(--gold); stroke: var(--gold); }
.c-chat { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(240, 138, 99, 0.3); background: linear-gradient(135deg, rgba(255, 178, 122, 0.16), rgba(240, 138, 99, 0.08)); text-align: left; color: var(--ink); }
.c-chat .chat-ic { width: 26px; height: 26px; color: var(--pine); }
.c-chat span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.c-chat small { color: var(--muted); font-size: 12.5px; }
.c-chat.dim { opacity: 0.85; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--pine); color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: 0 4px 12px rgba(31, 92, 76, 0.28); }
.btn:hover { background: var(--pine-2); }
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn.on { background: rgba(44, 122, 100, 0.14); color: var(--pine); box-shadow: none; }
.btn.ghost { background: rgba(255, 255, 255, 0.75); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: #fff; }
.btn.small { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn:disabled, .btn.off { opacity: 0.55; }
.wide-btn { width: 100%; height: 48px; font-size: 15.5px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--pine); font-weight: 650; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.warn { color: var(--err); }
.x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(23, 38, 42, 0.06); font-size: 21px; line-height: 1; color: var(--ink-2); }
.x:hover { background: rgba(23, 38, 42, 0.12); }

/* ---------- list sheet ---------- */
.sheet { position: fixed; z-index: 23; right: 16px; top: calc(70px + var(--safe-t)); bottom: calc(118px + var(--safe-b)); width: 340px; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; animation: rise 0.22s ease-out; }
.sh-top { position: relative; padding: 16px 18px 8px; border-bottom: 1px solid var(--line); }
.sh-top h2 { margin: 0; font-size: 19px; }
.sh-top p { margin: 2px 0 0; font-size: 12.5px; }
.sh-body { flex: 1; overflow-y: auto; padding: 6px 8px 12px; overscroll-behavior: contain; }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 14px; background: none; text-align: left; color: var(--ink); }
.lrow:hover:not(.static) { background: rgba(255, 255, 255, 0.75); }
.lrow.dim { opacity: 0.6; }
.lr-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(31, 92, 76, 0.1); color: var(--pine); font-size: 15px; }
.lr-ic svg { width: 18px; height: 18px; fill: currentColor; }
.lr-ic.vol { background: rgba(240, 138, 99, 0.15); color: #c9643f; }
.lr-ic.pin svg { fill: none; stroke: currentColor; stroke-width: 2; }
.lr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-t b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-t small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-go { color: var(--muted); font-size: 22px; }
.muted { color: var(--muted); }
.pad { padding: 18px 12px; }
.fine { font-size: 12px; color: var(--muted); line-height: 1.45; }
.err { color: var(--err); font-size: 13.5px; min-height: 0; margin: 6px 0; }
.err:empty { display: none; }
.ok { color: var(--ok); }

/* ---------- dialogs ---------- */
dialog.dlg { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 22px 22px 18px; border-radius: 24px; color: var(--ink); background: rgba(252, 251, 248, 0.95); }
dialog.dlg.wide { width: min(560px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(15, 30, 35, 0.35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: pop 0.22s ease-out; }
dialog h2 { margin: 0 34px 8px 0; font-size: 21px; letter-spacing: -0.2px; }
.row { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.row input, .search, .latlon input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 15px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, .toggle:focus-visible, .pano:focus-visible { outline: 2px solid var(--dusk); outline-offset: 2px; }
.search { width: 100%; margin: 8px 0 6px; }
.pl-list { max-height: 260px; overflow-y: auto; margin: 0 -6px; }
.latlon input { width: 40%; }
.eye { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin: 8px 0; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); }
.eye > span:first-child { display: flex; flex-direction: column; }
.eye small { color: var(--muted); font-size: 12px; }
.eye-v { font-weight: 700; color: var(--pine); }
.eye input { grid-column: 1 / -1; accent-color: var(--pine); }

.welcome { text-align: center; padding-top: 0 !important; overflow: hidden; }
.w-art { margin: 0 -22px 14px; height: 150px; }
.w-art svg { width: 100%; height: 100%; display: block; }
.welcome h2 { margin: 0 0 6px; font-size: 24px; }
.w-acts { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 6px; }
.w-acts .btn { height: 48px; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(23, 38, 42, 0.06); margin: 6px 0 10px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
.my-body { min-height: 160px; }
.pitch { text-align: center; padding: 18px 8px; }

.pf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pf-head h2 { margin: 0 0 2px; }
.pf-av { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--pine-2), var(--pine)); box-shadow: 0 6px 16px rgba(31, 92, 76, 0.3); }
.pf-card { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--line); margin-bottom: 10px; }
.pf-plan { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.tag { padding: 3px 10px; border-radius: 999px; background: rgba(31, 92, 76, 0.1); color: var(--pine); font-size: 13px; font-weight: 700; }
.pf-lock { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.pf-lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.pf-email { margin: 4px 0 0; font-size: 14px; }
.pf-links { display: flex; gap: 14px; margin: 6px 2px 4px; font-size: 13px; }

/* sign-in */
.a-agree { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.a-agree input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--pine); flex: none; }
.a-methods { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 12px 0 4px; transition: opacity 0.2s; }
.a-methods.off { opacity: 0.45; }
.a-methods .row { width: 100%; margin: 0; }
.a-google { min-height: 44px; }
.a-apple { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 300px; max-width: 100%; height: 44px; border-radius: 999px; border: 0; background: #000; color: #fff; font-weight: 600; }
.a-or { margin: 2px 0; font-size: 12.5px; color: var(--muted); }
.a-name { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.a-name input, .ch-name input { height: 50px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 18px; text-align: center; font-weight: 650; }
.a-signout { align-self: center; }
.shake { animation: shake 0.35s; }

/* Pro */
.grad { background: linear-gradient(90deg, var(--pine), var(--dusk)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cmp-wrap { overflow-x: auto; margin: 8px 0 12px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.cmp td:first-child { text-align: left; color: var(--ink-2); }
.cmp th.cur, .cmp td.cur { background: rgba(31, 92, 76, 0.06); }
.cmp .pro { background: rgba(240, 138, 99, 0.07); font-weight: 650; }
.cmp b.ok { color: var(--pine-2); }
.pro-mark { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 6px; border-radius: 999px; background: linear-gradient(135deg, #ffd9a8, var(--gold)); color: #4a2c06; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 0.6px; vertical-align: middle; }
.pro-mark .pm-star { width: 12px; height: 12px; fill: currentColor; }
.acct-chip .pro-mark { margin-left: 2px; }
.pro-state { margin: 6px 0; font-weight: 600; }
.pro-state.on { color: var(--pine); }
.buy-ok { font-size: 12.5px; margin: 8px 0; }
.buy .btn { flex: 1; height: auto; min-height: 56px; flex-direction: column; gap: 0; padding: 8px 12px; }
.buy .btn small { font-weight: 500; font-size: 11.5px; opacity: 0.85; }
.buy .btn.hl { background: linear-gradient(135deg, var(--dusk-2), var(--dusk)); box-shadow: 0 6px 16px rgba(240, 138, 99, 0.4); }
.promo-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(226, 163, 74, 0.12); font-size: 13.5px; }
.promo-tag { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #fff; font-weight: 800; }
.promo-row span:nth-child(2) { flex: 1; }

/* ---------- Ridge Link chat ---------- */
.chatp { position: fixed; top: calc(66px + var(--safe-t)); right: 16px; bottom: calc(118px + var(--safe-b)); width: 400px; z-index: 30; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; animation: rise 0.25s ease-out; background: rgba(252, 251, 248, 0.94); }
.ch-top { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.ab-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(23, 38, 42, 0.06); color: var(--ink); flex: none; }
.ab-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ab-icon svg circle { fill: currentColor; stroke: none; }
.ch-titles { flex: 1; min-width: 0; }
.ch-titles h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-titles h2 .chat-ic { width: 22px; height: 22px; color: var(--pine); }
.ch-titles p { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-body { flex: 1; overflow-y: auto; padding: 10px 12px 14px; overscroll-behavior: contain; }
.ch-h { margin: 10px 4px 6px; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dusk); }
.ch-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 14px; background: none; color: var(--ink); text-align: left; position: relative; }
.ch-row:hover:not(:disabled) { background: rgba(255, 255, 255, 0.85); }
.ch-row .badge-n { position: static; }
.ch-av { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--dusk-2), var(--dusk)); }
.ch-av.peak { background: linear-gradient(135deg, var(--pine-2), var(--pine)); }
.ch-av .chat-ic { width: 22px; height: 22px; }
.ch-av .chat-ic .ci-s { fill: #fff; }
.ch-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-rt b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-rt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-mute { font-style: normal; color: var(--muted); }
.ch-req { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(240, 138, 99, 0.08); border: 1px solid rgba(240, 138, 99, 0.25); margin-bottom: 6px; }
.ch-req > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-req small { color: var(--muted); font-size: 12px; }
.ch-empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.ch-empty.small { padding: 16px; font-size: 13.5px; }
.ch-hero { font-size: 36px; font-weight: 800; margin-bottom: 6px; color: var(--pine); }
.ch-hero .chat-ic.hero { width: 56px; height: 56px; }
.ch-note { margin: 16px 6px 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.ch-me { margin: 4px 6px; font-size: 12px; color: var(--muted); }
.ch-banner { margin: 2px auto 10px; max-width: 92%; text-align: center; font-size: 11.5px; color: var(--pine); padding: 6px 10px; border-radius: 10px; background: rgba(31, 92, 76, 0.08); }
.ch-pending { margin: 8px 0 12px; padding: 12px; border-radius: 14px; text-align: center; background: rgba(240, 138, 99, 0.08); border: 1px solid rgba(240, 138, 99, 0.25); font-size: 13.5px; }
.ch-pending p { margin: 0 0 8px; }
.ch-day { text-align: center; font-size: 11px; color: var(--muted); margin: 12px 0 6px; }
.ch-sys { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0; }
.ch-sys.mod { color: var(--err); }
.ch-msg { display: flex; flex-direction: column; align-items: flex-start; margin: 6px 0; max-width: 84%; }
.ch-msg.me { align-items: flex-end; margin-left: auto; }
.ch-nick { border: 0; background: none; color: var(--pine); font-size: 12px; font-weight: 700; padding: 0 4px 2px; }
.ch-bub { padding: 8px 12px; border-radius: 16px 16px 16px 5px; background: #fff; border: 1px solid var(--line); font-size: 14.5px; line-height: 1.42; overflow-wrap: anywhere; cursor: pointer; }
.ch-msg.me .ch-bub { border-radius: 16px 16px 5px 16px; background: linear-gradient(135deg, var(--pine-2), var(--pine)); color: #fff; border-color: transparent; }
.ch-bub i { color: var(--muted); }
.ch-msg.me .ch-bub i { color: rgba(255, 255, 255, 0.8); }
.ch-t { font-size: 10.5px; color: var(--muted); margin: 2px 6px 0; }
.ch-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ch-form textarea:focus-visible { outline: none; border-color: var(--dusk); }
.ch-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 15px; line-height: 1.35; }
.ch-send { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--dusk-2), var(--dusk)); color: #fff; }
.ch-send svg { width: 19px; height: 19px; fill: currentColor; }
.ch-send:disabled { opacity: 0.5; }
.ch-pop { position: absolute; z-index: 3; min-width: 210px; padding: 6px; border-radius: 14px; display: flex; flex-direction: column; background: #fff; }
.ch-pop button { border: 0; background: none; font-size: 14px; text-align: left; padding: 10px 12px; border-radius: 10px; }
.ch-pop button:hover { background: rgba(23, 38, 42, 0.06); }
.ch-pop button.warn { color: var(--err); }
.ch-name { display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; padding: 20px 8px; }
.ch-name .err { margin: 0; }
.ab-spin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(31, 92, 76, 0.15); border-top-color: var(--pine); animation: spin 0.9s linear infinite; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .brand-t { display: none; }
  .place-chip { flex: 1; max-width: none; }
  .acct-chip { padding-right: 6px; max-width: 46px; }
  .acct-chip span, .acct-chip .pro-mark { display: none; }
  .card { left: 8px; right: 8px; width: auto; bottom: calc(112px + var(--safe-b)); }
  .sheet { left: 8px; right: 8px; width: auto; top: auto; height: 52vh; bottom: calc(112px + var(--safe-b)); }
  .chatp { inset: calc(8px + var(--safe-t)) 0 0 0; width: auto; border-radius: 22px 22px 0 0; z-index: 40; }
  .settings { left: 8px; right: 8px; width: auto; }
  .pill { padding: 0 13px; }
  .dock-row { gap: 6px; }
  .foot { display: none; }
}
@media (max-width: 520px) { #range { display: none; } .pill { padding: 0 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.8; } }
@keyframes indet { 0% { transform: translateX(-100%) scaleX(0.3); } 100% { transform: translateX(300%) scaleX(0.3); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
