/* Home Family: night blue and gold, glass panels over a dark map. Phone first; on wide screens a side column. */
@font-face { font-family: "Montserrat"; src: url("vendor/montserrat-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; src: url("vendor/montserrat-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #070b18; --surface: #0f1730; --raised: #17223f; --line: rgba(255, 255, 255, .09); --ink: #f3f5fb; --muted: #95a1bd; --faint: #5e6a86;
  --gold: #e0b25c; --gold-2: #f6dc9a; --goldg: linear-gradient(135deg, #f6dc9a, #dcaa52 55%, #a4722a); --accent: #5b8cff; --red: #ff5a5f; --green: #35c48d;
  --title: "Montserrat", system-ui, sans-serif; --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --tabs: 64px; --side: 300px; --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
h1, h2, h3 { font-family: var(--title); margin: 0 0 8px; line-height: 1.15; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; margin-top: 22px; }
p { margin: 0 0 10px; }
a { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button, .btn { min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--goldg); color: #1a1406; border-color: transparent; font-weight: 700; }
button.danger { color: var(--red); }
button.ghost { background: transparent; }
button.icon { width: 44px; padding: 0; border-radius: 50%; }
svg { flex: none; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .05); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); }
label.check input { width: 22px; min-height: 22px; accent-color: var(--gold); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.hint { color: var(--muted); font-size: .85rem; }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.glass { background: rgba(14, 21, 44, .72); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); border: 1px solid rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 14px 40px rgba(0, 0, 0, .5); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs) + 24px + env(safe-area-inset-bottom)); z-index: 60; max-width: 480px; margin: 0 auto; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* ---------- Map ---------- */
#map { position: fixed; inset: 0; z-index: 0; background: #0b1020; }
.leaflet-container { background: #0b1020; font: inherit; }
.tiles-night { filter: invert(1) hue-rotate(200deg) brightness(.82) contrast(.92) saturate(.55); }  /* light OSM map turned night blue */
.leaflet-control-attribution { background: rgba(7, 11, 24, .6) !important; color: var(--faint) !important; font-size: 9px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-control-zoom { display: none; }
.pin { position: relative; width: 52px; height: 52px; border-radius: 50%; padding: 3px; background: var(--c, var(--accent)); box-shadow: 0 6px 18px rgba(0, 0, 0, .55); transform: translate(-50%, -100%); }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 8px solid transparent; border-top: 11px solid var(--c, var(--accent)); border-bottom: 0; }
.pin .face { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #101a36; color: #fff; font: 800 1rem var(--title); border: 2px solid rgba(255, 255, 255, .9); }
.pin .face img { width: 100%; height: 100%; object-fit: cover; }
.pin .bat { position: absolute; right: -6px; top: -4px; padding: 1px 5px; border-radius: 8px; background: #0d1530; border: 1px solid var(--line); font: 700 .62rem var(--text); color: var(--ink); }
.pin .bat.low { color: var(--red); }
.pin.old .face { filter: grayscale(.7) brightness(.8); }
.pin.sos { animation: sos 1s ease-in-out infinite alternate; }
@keyframes sos { to { box-shadow: 0 0 0 10px rgba(255, 90, 95, .35), 0 6px 18px rgba(0, 0, 0, .55); } }
.place-label { padding: 3px 9px; border-radius: 10px; background: rgba(7, 11, 24, .8); border: 1px solid rgba(224, 178, 92, .5); color: var(--gold-2); font: 700 .72rem var(--text); white-space: nowrap; transform: translate(-50%, -50%); }
.hist-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; transform: translate(-50%, -50%); }

/* ---------- Top bar over the map ---------- */
.topbar { position: fixed; z-index: 20; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.circle-pill { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; min-height: 48px; }
.circle-pill img { width: 36px; height: 36px; border-radius: 10px; }
.circle-pill strong { font: 800 1rem var(--title); }
.circle-pill span { display: block; font-size: .75rem; color: var(--muted); }
.topbar .spacer { flex: 1; }
.round { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.sos-btn { background: linear-gradient(135deg, #ff7b7f, #e0353b); color: #fff; border: 0; font: 900 .8rem var(--title); letter-spacing: .04em; box-shadow: 0 8px 22px rgba(224, 53, 59, .5); }
.map-tools { position: fixed; z-index: 20; right: 12px; display: grid; gap: 8px; bottom: calc(var(--sheet, 260px) + var(--tabs) + 20px + env(safe-area-inset-bottom)); transition: bottom .25s; }

/* ---------- Bottom sheet with the members ---------- */
.sheet { position: fixed; z-index: 15; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); max-height: 62vh; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; border-bottom: 0; padding: 6px 0 4px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); margin: 4px auto 6px; border: 0; padding: 0; min-height: 0; cursor: grab; }
.sheet .s-head { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 6px; }
.sheet .s-head h2 { margin: 0; font-size: 1.05rem; }
.sheet .list { overflow-y: auto; padding: 0 10px 8px; }
.sheet.small .list { max-height: 210px; }
.mrow { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 0; padding: 8px; border: 0; border-radius: 14px; background: none; text-align: left; }
.mrow:hover, .mrow.on { background: rgba(255, 255, 255, .06); }
.avatar { position: relative; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff; font: 800 1rem var(--title); overflow: hidden; box-shadow: 0 0 0 2px var(--c, var(--accent)); border: 2px solid var(--bg); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: .78rem; }
.mrow .who { display: grid; min-width: 0; }
.mrow .who strong { font-size: 1rem; }
.mrow .who span { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .who span.at { color: var(--gold-2); }
.mrow .meta { display: grid; justify-items: end; gap: 2px; font-size: .75rem; color: var(--muted); }
.battery { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); }
.battery.low { color: var(--red); }
.battery.charging { color: var(--green); }
.member-card { padding: 4px 16px 10px; }
.member-card .mc-head { display: flex; align-items: center; gap: 14px; }
.member-card h3 { margin: 0; font-size: 1.25rem; }
.member-card .addr { color: var(--muted); margin: 8px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); font-size: .86rem; text-decoration: none; }
.chip svg { width: 17px; height: 17px; color: var(--gold); }

/* ---------- Tab bar (phones) ---------- */
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(7, 11, 24, .92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-top: 1px solid var(--line); }
.tabs a { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .66rem; font-weight: 600; border-radius: 14px; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--gold-2); }
.tabs .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 800 .65rem var(--text); }

/* ---------- Pages over the map ---------- */
.page { position: fixed; z-index: 10; inset: 0 0 calc(var(--tabs) + env(safe-area-inset-bottom)) 0; overflow-y: auto; padding: calc(18px + env(safe-area-inset-top)) 18px 30px; background: radial-gradient(70% 40% at 90% -10%, rgba(74, 111, 214, .28), transparent 70%), var(--bg); }
.page.over-map { background: none; pointer-events: none; padding: 0; overflow: visible; }
.page.over-map > * { pointer-events: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.card { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.card h2 { margin-top: 0; }
.list-rows { display: grid; gap: 2px; }
.lrow { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(224, 178, 92, .14); color: var(--gold); }
.lrow .ic svg { width: 22px; height: 22px; }
.lrow strong { display: block; }
.lrow span { color: var(--muted); font-size: .84rem; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); }

/* History: a panel at the bottom over the map */
.hist-panel { position: fixed; z-index: 15; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); max-height: 55vh; overflow-y: auto; padding: 12px 16px 14px; border-radius: 24px 24px 0 0; }
.hist-top { position: fixed; z-index: 20; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 18px; }
.hist-top select, .hist-top input { min-height: 40px; padding: 6px 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.stat { padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); text-align: center; }
.stat b { display: block; font: 800 1.15rem var(--title); color: var(--gold-2); }
.stat span { font-size: .74rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 6px 0 10px 26px; border-left: 2px solid rgba(224, 178, 92, .35); margin-left: 8px; cursor: pointer; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.timeline li.trip::before { background: var(--gold); }
.timeline strong { display: block; font-size: .92rem; }
.timeline span { color: var(--muted); font-size: .8rem; }

/* Messages */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 80px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 18px; background: var(--raised); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #2a3d75, #1d2b57); }
.bubble.sos { background: linear-gradient(135deg, #ff6b6f, #c92e34); color: #fff; }
.bubble.checkin { border: 1px solid rgba(53, 196, 141, .5); background: rgba(53, 196, 141, .12); }
.bubble small { display: block; color: var(--muted); font-size: .72rem; margin-bottom: 2px; }
.bubble.sos small { color: rgba(255, 255, 255, .8); }
.bubble a { font-size: .8rem; }
.composer { position: fixed; z-index: 12; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 12px; background: rgba(7, 11, 24, .95); border-top: 1px solid var(--line); }
.composer input { border-radius: 999px; }

/* Sign-in */
.login { max-width: 400px; margin: 0 auto; padding: calc(9vh + env(safe-area-inset-top)) 18px 40px; text-align: center; }
.login > img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(224, 178, 92, .3); }
.login h1 { margin: 18px 0 4px; font-size: 2rem; }
.login .sub { color: var(--muted); margin-bottom: 22px; }
.login form { text-align: left; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.login .page { position: static; }
body.signed-out #map { display: none; }
body.signed-out { background: radial-gradient(70% 50% at 50% -10%, rgba(74, 111, 214, .35), transparent 70%), var(--bg); }

/* Dialog */
dialog { width: min(480px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin-top: 0; }
input[type="range"] { padding: 0; min-height: 30px; accent-color: var(--gold); border: 0; background: none; }

/* Place picking: a fixed cross in the middle of the map */
.pick-cross { position: fixed; z-index: 14; left: 50%; top: 45%; width: 40px; height: 40px; transform: translate(-50%, -50%); pointer-events: none; color: var(--gold); }
.pick-panel { position: fixed; z-index: 15; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); padding: 16px; border-radius: 24px 24px 0 0; }

/* Wide screens: a column on the left, the map on the right */
@media (min-width: 900px) {
  .tabs { top: 0; right: auto; width: 84px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 72px; align-content: start; padding: calc(14px + env(safe-area-inset-top)) 8px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs::before { content: ""; height: 56px; background: url(icon.svg) center / 44px no-repeat; }
  #map { left: 84px; }
  .page { left: 84px; bottom: 0; padding: 30px 40px; }
  .page > .inner { max-width: 860px; }
  .page.over-map { left: 84px; }
  .topbar, .hist-top { left: 96px; }
  .sheet, .hist-panel, .pick-panel { left: 96px; right: auto; width: var(--side); top: calc(76px + env(safe-area-inset-top)); bottom: 12px; max-height: none; border-radius: 22px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .sheet .grab { display: none; }
  .sheet.small .list { max-height: none; }
  .map-tools { bottom: 24px; }
  .composer { left: 84px; bottom: 0; }
  .toast { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Location turned off: banner under the top bar */
.geo-banner { position: fixed; z-index: 21; top: calc(66px + env(safe-area-inset-top)); left: 12px; right: 12px; display: grid; gap: 2px; padding: 10px 14px; border-radius: 16px; border-color: rgba(255, 90, 95, .5); }
.geo-banner strong { color: #ff8a8d; font-size: .9rem; }
.geo-banner span { color: var(--muted); font-size: .8rem; }
@media (min-width: 900px) { .geo-banner { left: calc(96px + var(--side) + 12px); right: 12px; width: auto; max-width: 520px; } }

/* Administration on phones: rows that wrap cleanly, buttons that stay reachable */
.lrow .row { justify-content: flex-end; }
button.icon.is-admin { color: var(--gold); border-color: rgba(224, 178, 92, .5); background: rgba(224, 178, 92, .12); }
@media (max-width: 600px) {
  .lrow[data-req] { grid-template-columns: 42px minmax(0, 1fr); }
  .lrow[data-req] > .row { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .lrow[data-u] { grid-template-columns: 36px minmax(0, 1fr); }
  .lrow[data-u] > .row { grid-column: 2; justify-content: flex-start; margin-top: 4px !important; }
  .lrow span { overflow-wrap: anywhere; }
  .card { padding: 14px; }
  .page-head .btn { padding: 8px 12px; font-size: .9rem; }
  input, select, textarea { font-size: 16px; }  /* no zoom on iPhone when typing */
}

/* =====================================================================================================
   iPhone (and phones): the iOS 26 way. Floating glass tab bar, floating sheet that slides to three heights,
   dialogs that rise from the bottom, large titles, the keyboard kept above the message bar.
   ===================================================================================================== */
@media (max-width: 899px) {
  :root { --nb: max(8px, calc(env(safe-area-inset-bottom) - 14px)); --bar: 62px; --dock: calc(var(--bar) + var(--nb) + 10px); }
  html, body { height: 100dvh; }
  body { font-size: 16px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, .bubble, .addr, code { -webkit-user-select: text; user-select: text; }
  input, select, textarea { font-size: 16px; }
  button, .btn, .chip, .mrow, .lrow, .tabs a { transition: transform .12s ease, background-color .15s; }
  button:active, .btn:active, .chip:active, .mrow:active, .tabs a:active { transform: scale(.96); }
  /* Tab bar: a glass capsule floating above the home indicator */
  .tabs { left: 12px; right: 12px; bottom: var(--nb); height: var(--bar); padding: 4px; border-radius: 31px; border: 1px solid rgba(255, 255, 255, .16); border-top-color: rgba(255, 255, 255, .26);
    background: linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04) 55%, rgba(120, 160, 255, .07)); -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 30px rgba(0, 0, 0, .55); }
  .tabs a { border-radius: 26px; font-size: .62rem; gap: 1px; }
  .tabs a svg { width: 23px; height: 23px; }
  .tabs a[aria-current="page"] { background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
  /* Everything that sat on the old bar now sits above the capsule */
  .page { bottom: 0; padding: calc(10px + env(safe-area-inset-top)) 16px calc(var(--dock) + 24px); }
  .page.over-map { bottom: 0; padding: 0; }
  .page-head { position: sticky; top: calc(-10px - env(safe-area-inset-top)); z-index: 3; margin: 0 -16px 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(var(--bg) 70%, rgba(7, 11, 24, 0)); }
  .page-head h1 { font-size: 2.05rem; letter-spacing: -.02em; }
  .card { border-radius: 20px; }
  /* The family sheet: floating, rounded on every side, three heights */
  .sheet { left: 8px; right: 8px; bottom: var(--dock); border-radius: 28px; border: 1px solid rgba(255, 255, 255, .14); max-height: none; height: var(--sheet-h, 42dvh); transition: height .28s cubic-bezier(.2, .8, .2, 1); touch-action: none; }
  .sheet.dragging { transition: none; }
  .sheet .grab { width: 44px; height: 6px; margin: 2px auto 8px; padding: 10px 40px; box-sizing: content-box; background-clip: content-box; touch-action: none; }
  .sheet .list { flex: 1; touch-action: pan-y; }
  .sheet.small .list { max-height: none; }
  .map-tools { right: 12px; bottom: calc(var(--dock) + var(--sheet-h, 42dvh) + 12px); }
  .map-tools .round { width: 46px; height: 46px; }
  .topbar { top: calc(6px + env(safe-area-inset-top)); left: 10px; right: 10px; gap: 8px; }
  .circle-pill { min-height: 46px; padding: 5px 14px 5px 5px; }
  .circle-pill img { width: 34px; height: 34px; }
  .round { width: 46px; height: 46px; }
  .geo-banner { top: calc(60px + env(safe-area-inset-top)); left: 10px; right: 10px; }
  .leaflet-control-attribution { margin-bottom: calc(var(--dock) + var(--sheet-h, 42dvh) + 4px) !important; transition: margin .28s; }
  /* History and place panels float like the sheet */
  .hist-panel, .pick-panel { left: 8px; right: 8px; bottom: var(--dock); border-radius: 28px; max-height: 48dvh; }
  .hist-top { top: calc(6px + env(safe-area-inset-top)); left: 10px; right: 10px; border-radius: 22px; }
  .hist-top select { flex: 1; min-width: 0; }
  .hist-top input[type="date"] { width: 132px; flex: none; }
  .pick-cross { top: 38%; }
  /* Messages: the bar stays above the capsule, then above the keyboard when it opens */
  .composer { left: 8px; right: 8px; bottom: calc(var(--dock) + var(--kb, 0px)); border-radius: 26px; border: 1px solid rgba(255, 255, 255, .12); padding: 6px; background: rgba(14, 21, 44, .9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: bottom .2s; }
  body.kb .composer { bottom: calc(var(--kb) + 6px); }
  body.kb .tabs { display: none; }
  .chat { padding-bottom: 90px; }
  .bubble { max-width: 86%; font-size: 1rem; }
  /* Dialogs rise from the bottom, as iOS sheets */
  dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 26px 26px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88dvh; border-bottom: 0; }
  dialog::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); margin: 0 auto 12px; }
  dialog[open] { animation: rise .28s cubic-bezier(.2, .8, .2, 1); }
  @keyframes rise { from { transform: translateY(40px); opacity: .4; } }
  dialog .row.end { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); padding: 10px 0 4px; background: var(--surface); }
  dialog .row.end button, dialog .row.end .btn { flex: 1; }
  .toast { bottom: calc(var(--dock) + 12px); border-radius: 18px; }
  /* Sign-in: comfortable on a phone */
  .login { padding-top: calc(7vh + env(safe-area-inset-top)); }
  .login form button.primary { width: 100%; min-height: 50px; font-size: 1.05rem; }
}
@media (max-width: 899px) and (prefers-reduced-motion: reduce) { .sheet, dialog[open] { transition: none; animation: none; } }

/* « Ton téléphone sonne » */
.ring-page { display: grid; place-items: center; text-align: center; background: radial-gradient(60% 45% at 50% 35%, rgba(224, 178, 92, .28), transparent 70%), var(--bg); }
.ring-box { display: grid; justify-items: center; gap: 10px; max-width: 360px; }
.ring-icon { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--goldg); color: #1a1406; box-shadow: 0 0 0 14px rgba(224, 178, 92, .15), 0 0 0 30px rgba(224, 178, 92, .07); }
.ring-icon svg { width: 56px; height: 56px; }
@media (prefers-reduced-motion: no-preference) { .ring-icon { animation: ringshake .5s ease-in-out infinite alternate; } }
@keyframes ringshake { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.ring-stop { min-height: 56px; padding: 0 30px; font-size: 1.1rem; margin-top: 10px; }

.chip.ringing { border-color: rgba(255, 90, 95, .6); color: #ff8a8d; }
.chip.ringing svg { color: #ff8a8d; }

/* Folded family sheet: only its title stays, a hint invites to pull it up */
@media (max-width: 899px) {
  .sheet.folded .list, .sheet.folded .member-card > :not(.mc-head):not(.row) { display: none; }
  .sheet.folded .member-card .row { display: none; }
  .sheet.folded .s-head h2::after { content: " ⌃"; color: var(--muted); font-weight: 400; }
  .sheet.folded { cursor: pointer; }
}
@media (max-width: 899px) { .sheet { overflow: hidden; } }

/* Choice of the map background */
.bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.base-opt { display: grid; justify-items: center; gap: 6px; min-height: 0; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .04); font-size: .82rem; }
.base-opt[aria-pressed="true"] { border-color: var(--gold); background: rgba(224, 178, 92, .1); color: var(--gold-2); }
.base-pic { width: 72px; height: 72px; border-radius: 12px; background: #1a2440; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.base-night .base-pic { background: linear-gradient(135deg, #1b2442, #0c1124), repeating-linear-gradient(35deg, transparent 0 12px, rgba(255, 255, 255, .08) 12px 14px); background-blend-mode: screen; }
.base-day .base-pic { background: linear-gradient(135deg, #f3efe6, #e3e9dc); }
.base-sat .base-pic { background: radial-gradient(circle at 30% 30%, #3e5a3a, #1e2e22 60%, #24364a); }
.base-hybrid .base-pic { background: radial-gradient(circle at 30% 30%, #3e5a3a, #1e2e22 60%, #24364a), repeating-linear-gradient(60deg, transparent 0 16px, rgba(255, 220, 120, .5) 16px 18px); background-blend-mode: screen; }
.base-relief .base-pic { background: repeating-radial-gradient(circle at 40% 60%, #d8dcc0 0 6px, #bfc8a0 6px 12px); }
/* Light backgrounds: the place names stay readable */
html[data-base="day"] .place-label, html[data-base="relief"] .place-label { background: rgba(255, 255, 255, .92); color: #6a4b12; border-color: rgba(164, 114, 42, .6); }

/* My phone rings: red banner on the map */
.ring-banner { position: fixed; z-index: 22; top: calc(62px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 20px; background: linear-gradient(135deg, #ff6b6f, #c92e34); color: #fff; box-shadow: 0 12px 30px rgba(201, 46, 52, .5); }
.ring-banner > span svg { width: 26px; height: 26px; }
@media (prefers-reduced-motion: no-preference) { .ring-banner > span { animation: ringshake .4s ease-in-out infinite alternate; } }
.ring-banner div { flex: 1; display: grid; }
.ring-banner small { opacity: .85; }
.ring-banner button { background: #fff; color: #c92e34; border: 0; font-weight: 800; min-height: 42px; }
@media (min-width: 900px) { .ring-banner { left: calc(96px + var(--side) + 12px); right: auto; width: 420px; } }

/* =====================================================================================================
   18 October 2026: home in the manner of « Localiser » and Life360. Gear top left, inbox and new message top
   right, « Localiser » pill, sheet with Famille / Lieux / Événements, tabs Personnes · Au volant · Moi.
   ===================================================================================================== */
.tabs { grid-template-columns: repeat(3, 1fr); }
.topbar { align-items: flex-start; }
.topbar .round, .top-stack .round { position: relative; color: var(--ink); text-decoration: none; }
.topbar .badge { position: absolute; top: -3px; right: -3px; }
.top-stack { display: grid; gap: 8px; }
.gear svg { width: 23px; height: 23px; }
.locate-pill { position: fixed; z-index: 20; left: 12px; bottom: calc(var(--sheet, 260px) + var(--tabs) + 20px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px 0 14px; border-radius: 23px; color: var(--ink); font-weight: 700; }
.locate-pill svg { color: var(--gold); }
.map-tools .sos-btn { width: 46px; height: 46px; font-size: .72rem; }
/* Segments of the sheet: Famille, Lieux, Événements */
.segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px 8px; }
.seg-btn { display: grid; justify-items: center; gap: 2px; min-height: 54px; padding: 6px 4px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid transparent; color: var(--muted); font-size: .78rem; font-weight: 600; }
.seg-btn svg { width: 22px; height: 22px; }
.seg-btn[aria-pressed="true"] { background: rgba(224, 178, 92, .14); border-color: rgba(224, 178, 92, .45); color: var(--gold-2); }
.s-head { gap: 8px; }
.s-head h2 { font-size: 1.35rem; font-weight: 800; }
.s-acts { display: flex; gap: 6px; }
.plus { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 0; color: var(--gold-2); text-decoration: none; }
.plus svg { width: 20px; height: 20px; }
/* People rows, « Localiser » style: name, place, distance and time on the right */
.mrow .meta .dist { color: var(--ink); font-weight: 600; font-size: .82rem; }
.place-ic { background: rgba(224, 178, 92, .16) !important; color: var(--gold); box-shadow: none !important; }
.place-ic svg { width: 24px; height: 24px; }
.ev-row { cursor: default; }
.ev-date { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(160deg, #ff6b6f 0 34%, #1a2440 34%); display: grid; grid-template-rows: auto 1fr; justify-items: center; align-content: start; overflow: hidden; }
.ev-date small { order: -1; color: #fff; font-size: .62rem; font-weight: 800; text-transform: uppercase; line-height: 17px; }
.ev-date b { font: 800 1.15rem/1.4 var(--title); }
/* A member's card: large tile buttons */
.mc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.tile-act { display: grid; justify-items: center; gap: 4px; min-height: 70px; padding: 10px 4px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--ink); font-size: .76rem; font-weight: 600; text-decoration: none; }
.tile-act svg { width: 22px; height: 22px; color: var(--gold); }
.trip-chip { position: fixed; z-index: 21; top: calc(64px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border-radius: 20px; font-size: .86rem; white-space: nowrap; }
.trip-chip svg { width: 16px; height: 16px; vertical-align: -3px; }
.hist-dot.end { background: var(--red); }
/* Settings rows */
.nav-rows .lrow { width: 100%; min-height: 0; border: 0; border-radius: 0; background: none; text-align: left; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.nav-rows .lrow:last-child { border-bottom: 0; }
.chev { color: var(--faint); }
.page-head .btn.icon, .page-head > span:empty { width: 44px; flex: none; }
/* « Au volant » */
.seg-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.person-chip { flex: none; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 4px 14px 4px 4px; border-radius: 23px; background: rgba(255, 255, 255, .05); }
.person-chip[aria-pressed="true"] { border-color: var(--gold); background: rgba(224, 178, 92, .12); color: var(--gold-2); }
.drive-stats { grid-template-columns: repeat(3, 1fr); }
.stat.warn b { color: var(--red); }
.trips .lrow { width: 100%; min-height: 0; border: 0; border-radius: 0; background: none; text-align: left; color: var(--ink); border-bottom: 1px solid var(--line); }
.trips .ic.walk { background: rgba(53, 196, 141, .14); color: var(--green); }
/* Place: postal address search */
.addr-search { display: flex; gap: 8px; }
.addr-search input { flex: 1; min-width: 0; }
.addr-search button { flex: none; }
.geo-list { display: grid; gap: 4px; margin: -4px 0 10px; max-height: 180px; overflow-y: auto; }
.geo-opt { display: flex; align-items: flex-start; justify-content: flex-start; gap: 8px; min-height: 0; padding: 8px 10px; border-radius: 12px; text-align: left; font-size: .82rem; background: rgba(255, 255, 255, .04); }
.geo-opt svg { width: 16px; height: 16px; color: var(--gold); flex: none; margin-top: 2px; }
.geo-opt em { color: var(--gold-2); font-style: normal; }
/* Phones (iPhone, Android) */
@media (max-width: 899px) {
  .locate-pill { bottom: calc(var(--dock) + var(--sheet-h, 42dvh) + 12px); left: 10px; }
  .map-tools { gap: 6px; }
  .sheet .segs { padding: 0 10px 6px; }
  .drive-stats .stat b { font-size: 1rem; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(3, 1fr); } .seg-btn { font-size: .7rem; } }
/* Android: Material shapes */
html.android .seg-btn, html.android .tile-act { border-radius: 20px; }
/* iPad, PC, Mac: side column for the tabs, the sheet on the left of the map, tools on the right */
@media (min-width: 900px) {
  .tabs { grid-auto-rows: 76px; }
  .locate-pill { left: calc(96px + var(--side) + 14px); bottom: 24px; }
  .topbar { left: calc(96px + var(--side) + 12px); }
  .trip-chip { left: calc(96px + var(--side) + (100vw - 96px - var(--side)) / 2); }
  .drive-stats { grid-template-columns: repeat(6, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1300px) { :root { --side: 340px; } }

/* Left of the map: SOS above « Localiser »; the banners leave the right column free */
.left-tools { position: fixed; z-index: 20; left: 12px; bottom: calc(var(--sheet, 260px) + var(--tabs) + 20px + env(safe-area-inset-bottom)); display: grid; justify-items: start; gap: 8px; }
.left-tools .locate-pill { position: static; }
.left-tools .sos-btn { width: 46px; height: 46px; font-size: .72rem; }
.geo-banner, .ring-banner { right: 66px !important; }
@media (max-width: 899px) { .left-tools { left: 10px; bottom: calc(var(--dock) + var(--sheet-h, 42dvh) + 12px); } }
@media (min-width: 900px) { .left-tools { left: calc(96px + var(--side) + 14px); bottom: 24px; } .geo-banner, .ring-banner { right: auto !important; } }

/* Folded sheet (phones): a clean header only — « Personnes » (or the place / events title), or a member in small */
@media (max-width: 899px) {
  .sheet { touch-action: none; }
  .sheet .list { touch-action: pan-y; overscroll-behavior: contain; }
  .sheet.folded .segs, .sheet.folded .list, .sheet.folded .member-card > :not(.mc-head) { display: none !important; }
  .sheet.folded .s-head { padding-top: 2px; }
  .sheet.folded .s-head h2::after { content: ""; }
  .sheet.folded .member-card { padding-top: 0; }
  .sheet.folded .mc-head .avatar { width: 40px; height: 40px; font-size: .85rem; }
  .sheet.folded .mc-head h3 { font-size: 1.05rem; }
  .sheet .grab { width: 54px; height: 6px; padding: 8px 60px; }
}
/* New place: the panel scrolls, « Enregistrer » always in view at its bottom */
.pick-panel { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0; }
.pick-panel form > .row.end { position: sticky; bottom: 0; margin: 10px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom) * 0); background: linear-gradient(rgba(14, 21, 44, 0), rgba(14, 21, 44, .97) 30%); }
.pick-panel .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 4px -4px 10px; padding: 0 4px; }
.pick-panel .chip { flex: none; }
@media (max-width: 899px) { .pick-panel { max-height: 58dvh; } .pick-cross { top: 30%; } body.kb .pick-panel { bottom: calc(var(--kb) + 4px); max-height: calc(100dvh - var(--kb) - 80px); } }

/* Profile photo framing */
.crop-box { position: relative; width: var(--f); height: var(--f); margin: 10px auto 14px; border-radius: 50%; overflow: hidden; background: #000; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crop-box:active { cursor: grabbing; }
.crop-img { position: absolute; left: 50%; top: 50%; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(224, 178, 92, .9); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 0 0 8px; }
.crop-zoom input { flex: 1; }

/* New / changed place: a compact panel (title, scrolling body, buttons always visible), the cross in the middle of the
   visible map above it, the members' bubbles faded meanwhile. */
body.picking .leaflet-marker-pane { opacity: .25; pointer-events: none; }
.pick-cross { position: fixed; z-index: 14; transform: translate(-50%, -50%); width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7)); }
.pick-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pk-form { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.pk-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 18px; flex: none; }
.pk-head h2 { margin: 0; font-size: 1.15rem; }
.pk-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 8px; }
.pk-body label { margin-bottom: 10px; }
.pk-foot { flex: none; display: flex; gap: 10px; padding: 10px 18px 14px; border-top: 1px solid var(--line); background: rgba(14, 21, 44, .96); }
.pk-foot > * { flex: 1; }
.pk-range span { display: flex; justify-content: space-between; color: var(--muted); }
.pk-range b { color: var(--gold-2); }
.pk-del { width: 100%; margin-top: 4px; }
.pick-panel form > .row.end { display: none; }
input:-webkit-autofill, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 40px #1b2440 inset; caret-color: var(--ink); }
@media (max-width: 899px) { .pick-panel { max-height: 50dvh; } }
@media (max-width: 899px) and (max-height: 700px) { .pick-panel { max-height: 56dvh; } }
@media (min-width: 900px) { .pick-panel { max-height: none; } }

/* ---------- « Sport » (17 octobre 2026): rings like the Fitness app, week bars, family ranking ---------- */
.tabs { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 900px) { .tabs { grid-template-columns: 1fr; } }
.sport-hero { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 18px; align-items: center; }
.ring-wrap { position: relative; aspect-ratio: 1; }
.rings { width: 100%; height: 100%; display: block; }
.rings circle { transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); }
.ring-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ring-mid b { font: 800 1.15rem var(--title); line-height: 1; }
.ring-mid span { font-size: .66rem; color: var(--muted); }
.rl { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rl:last-of-type { border-bottom: 0; }
.rl i { width: 12px; height: 12px; border-radius: 50%; }
.rl span { font-weight: 600; }
.rl b { font: 800 1.05rem var(--title); white-space: nowrap; }
.rl small { font: 500 .78rem var(--body, inherit); color: var(--muted); }
.goal-ok { margin: 8px 0 0; color: #9cf500; font-weight: 700; }
.sport-stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.week { position: relative; height: 150px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wbar { all: unset; cursor: pointer; display: grid; grid-template-rows: 1fr 22px; height: 150px; justify-items: center; }
.wcol { position: relative; width: 100%; max-width: 30px; height: 128px; align-self: end; border-radius: 9px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.wfill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 9px; background: linear-gradient(#ff5a87, #fa114f); opacity: .55; transition: height .6s; }
.wbar.ok .wfill { opacity: .85; }
.wbar.on .wfill { opacity: 1; box-shadow: 0 0 14px rgba(250, 17, 79, .55); }
.wbar small { align-self: center; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.wbar.on small { color: var(--text, #fff); font-weight: 800; }
.wbar:focus-visible .wcol { outline: 2px solid var(--gold-2); }
.wgoal { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed rgba(255, 255, 255, .45); pointer-events: none; }
.wgoal em { position: absolute; right: 0; top: -16px; font: normal 600 .62rem var(--body, inherit); color: var(--muted); }
.lrow.rank-row { grid-template-columns: 30px 36px minmax(0, 1fr) auto; gap: 10px; }
.rank-row .rank { font-weight: 800; text-align: center; font-size: 1.05rem; }
.rank-row b { font: 800 1rem var(--title); }
.rank-bar { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; }
@media (max-width: 420px) { .sport-hero { grid-template-columns: 1fr; justify-items: center; } .ring-wrap { width: 200px; } .ring-legend { width: 100%; } }
.rank-row { width: 100%; min-height: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; text-align: left; color: var(--ink); }
.rank-row:last-child { border-bottom: 0; }
.wbar.on small { color: var(--ink); }
.wallet .w-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.w-pts { display: block; font: 800 2rem var(--title); color: var(--gold-2); line-height: 1.1; }
.w-streak { display: grid; justify-items: center; padding: 8px 14px; border-radius: 16px; background: rgba(255, 140, 40, .12); }
.w-streak span { font-size: 1.3rem; line-height: 1; }
.w-streak b { font: 800 1.3rem var(--title); color: #ffae4a; }
.w-streak small { font-size: .66rem; color: var(--muted); }
.w-btn { width: 100%; margin-top: 12px; min-height: 50px; font-size: 1rem; }
.w-btn[disabled] { opacity: .55; }
.w-bonus { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.w-bonus span { flex: 1; min-width: 60px; display: grid; justify-items: center; padding: 6px 4px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: .72rem; color: var(--muted); }
.w-bonus span b { font: 800 .9rem var(--title); color: var(--ink); }
.w-bonus span.got { background: rgba(255, 140, 40, .16); color: #ffae4a; }
.w-bonus span.got b { color: #ffae4a; }
.wbar.valid small::after { content: "✓"; display: block; text-align: center; color: #9cf500; font-size: .6rem; line-height: .8; }

/* Flame around the bubble: days in a row with the steps validated at the goal */
@keyframes flicker { 0%, 100% { box-shadow: 0 0 0 2px #ff9d2e, 0 0 10px 3px rgba(255, 110, 20, .7); } 50% { box-shadow: 0 0 0 2px #ffc23f, 0 0 16px 5px rgba(255, 70, 0, .75); } }
.flame-wrap { position: relative; display: inline-grid; flex: none; border-radius: 50%; }
.flame-wrap .avatar { box-shadow: 0 0 0 2px #ff9d2e, 0 0 10px 3px rgba(255, 110, 20, .7); animation: flicker 1.8s ease-in-out infinite; }
.flame-n { position: absolute; z-index: 2; bottom: -7px; left: 50%; transform: translateX(-50%); padding: 0 5px; border-radius: 9px; background: #2a1405; border: 1px solid #ff8a2a; color: #ffb35a; font: 800 .62rem/1.45 var(--title); white-space: nowrap; pointer-events: none; }
.pin.flame { background: conic-gradient(from 0deg, #ffd23f, #ff7a1a, #ff3d00, #ff7a1a, #ffd23f); animation: flicker 1.8s ease-in-out infinite; }
.pin .flame-n { bottom: -9px; }
@media (prefers-reduced-motion: reduce) { .flame-wrap .avatar, .pin.flame { animation: none; } }

/* Boîte de réception: tabs, trash buttons, archives */
.box-tabs { margin-bottom: 10px; }
.box-tabs .chip[aria-pressed="true"] { background: var(--gold-2); color: #1a1205; border-color: transparent; }
.bubble { position: relative; }
.b-act { display: block; margin: 6px 0 0 auto; min-height: 0; padding: 3px 8px; font-size: .74rem; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 0; color: var(--muted); }
.b-act svg { width: 15px; height: 15px; }
.b-note { display: block; margin-top: 5px; font-size: .72rem; color: #ff9a9c; }
.bubble.deleted { outline: 1px dashed rgba(255, 120, 120, .45); }

/* Circles */
button.circle-pill { border: 0; color: var(--ink); text-align: left; cursor: pointer; }
.circle-row { grid-template-columns: minmax(0, 1fr) auto !important; padding: 4px 0; }
.circle-row.on .c-pick strong { color: var(--gold-2); }
.c-pick { all: unset; cursor: pointer; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 4px; }
.c-pick .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); color: var(--gold-2); }
.c-pick strong { display: block; } .c-pick span { font-size: .8rem; color: var(--muted); }
.c-new { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.people-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pp { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); cursor: pointer; }
.pp input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--gold-2); }
.pp:has(input:checked) { border-color: var(--gold-2); background: rgba(224, 178, 92, .14); }
.lrow.pp-row { grid-template-columns: 36px minmax(0, 1fr) auto; }

/* Sheet on phones: until it is fully open, the browser must not scroll its list (that stole the drag on iPhone) */
@media (max-width: 899px) {
  .sheet:not(.full), .sheet:not(.full) * { touch-action: none; }
  .sheet:not(.full) .list { overflow: hidden; }
}

/* Réglages: profile on top, foldable sections */
.profile-hero { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 22px 16px 18px; }
.profile-hero h2 { margin: 8px 0 0; font-size: 1.35rem; }
.profile-hero .hint { margin: 0 0 8px; }
.hero-photo { position: relative; margin: 0; cursor: pointer; display: block; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.9rem; }
.hero-cam { position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--goldg); color: #1a1406; border: 3px solid var(--surface); }
.hero-cam svg { width: 16px; height: 16px; }
.fold { padding: 0; overflow: hidden; }
.fold summary, .fold-link { list-style: none; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; color: var(--ink); text-decoration: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary .ic, .fold-link .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(224, 178, 92, .14); color: var(--gold-2); }
.fold summary strong, .fold-link strong { display: block; }
.fold summary span:not(.ic):not(.fold-chev), .fold-link div span { display: block; font-size: .8rem; color: var(--muted); }
.fold-chev { color: var(--muted); transition: transform .25s; display: grid; }
.fold[open] .fold-chev { transform: rotate(90deg); }
.fold-body { padding: 0 16px 16px; animation: foldIn .25s ease; }
@keyframes foldIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.fold-link { margin-bottom: 12px; }
.fold.sub { margin: 0 0 8px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); box-shadow: none; }
.fold.sub summary { padding: 11px 12px; grid-template-columns: 32px minmax(0, 1fr) auto; }
.fold.sub summary .ic { width: 32px; height: 32px; border-radius: 9px; }
.fold.sub .fold-body { padding: 0 12px 12px; }

/* =====================================================================
   iOS 26 / 27 « Liquid Glass » (17 octobre 2026): translucent glass that bends the light, specular edges,
   SF typography, large titles, capsules everywhere, tab bar that shrinks while scrolling.
   ===================================================================== */
:root {
  --title: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --lg-tint: rgba(14, 18, 34, .58);
  --lg-edge: rgba(255, 255, 255, .22);
  --lg-hi: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 0 rgba(255, 255, 255, .06), inset 1px 0 0 rgba(255, 255, 255, .08), inset -1px 0 0 rgba(255, 255, 255, .05);
  --lg-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 34px rgba(0, 0, 0, .42);
  --lg-blur: blur(30px) saturate(1.9) brightness(1.06);
  --card: rgba(255, 255, 255, .055);
  --radius: 24px;
}
h1, h2, h3, .ring-mid b, .rl b, .stat b, .w-pts { font-family: var(--title); letter-spacing: -.022em; }
h1 { font-weight: 800; }
h2 { font-weight: 700; letter-spacing: -.015em; }

/* Liquid glass material: tint + light from the top-left + bright rim */
.glass, .tabs, .sheet, .composer, .hist-panel, .pick-panel, .hist-top, .toast, .round.glass, .locate-pill {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)),
    var(--lg-tint) !important;
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  border: .5px solid var(--lg-edge) !important;
  box-shadow: var(--lg-hi), var(--lg-shadow) !important;
}
.sos-btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 22px rgba(255, 60, 70, .45) !important; background: radial-gradient(120% 90% at 20% 0%, #ff8d91, #ff4950 60%, #d92f37) !important; border: .5px solid rgba(255, 255, 255, .35) !important; }

/* Pages: deep night with soft colour light behind the glass */
.page { background:
  radial-gradient(60% 35% at 100% 0%, rgba(90, 120, 255, .26), transparent 70%),
  radial-gradient(50% 30% at 0% 25%, rgba(224, 178, 92, .10), transparent 70%),
  radial-gradient(70% 40% at 50% 110%, rgba(120, 80, 220, .14), transparent 70%), var(--bg); }
.page-head { background: linear-gradient(rgba(7, 11, 24, .92) 60%, rgba(7, 11, 24, 0)) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.page-head h1 { font-size: 2.15rem; }

/* Cards: frosted panes with a lit rim */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035)); border: .5px solid rgba(255, 255, 255, .12); border-radius: var(--radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 10px 30px rgba(0, 0, 0, .25); }
.stat { border-radius: 18px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03)); border: .5px solid rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }

/* Buttons: glass capsules; primary = tinted glass, glossy */
button, .btn { background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05)); border: .5px solid rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 8px rgba(0, 0, 0, .18); font-weight: 600; }
button.primary, .btn.primary { background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 50%), var(--goldg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(120, 70, 10, .35), 0 6px 18px rgba(224, 178, 92, .35); border: .5px solid rgba(255, 240, 200, .6); }
button.ghost { background: transparent; box-shadow: none; border-color: transparent; }
button.danger { background: linear-gradient(180deg, rgba(255, 90, 95, .16), rgba(255, 90, 95, .07)); border-color: rgba(255, 90, 95, .3); }
input, select, textarea { border-radius: 14px; background: rgba(255, 255, 255, .06); border: .5px solid rgba(255, 255, 255, .14); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(246, 220, 154, .7); box-shadow: 0 0 0 4px rgba(224, 178, 92, .18); }

/* Segmented controls and chips: a glass track, the chosen one lifted */
.segs { padding: 4px; margin: 0 12px 10px; gap: 4px; border-radius: 20px; background: rgba(255, 255, 255, .05); border: .5px solid rgba(255, 255, 255, .08); }
.seg-btn { border-radius: 16px; background: transparent; box-shadow: none; border: 0; }
.seg-btn[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .08)); color: var(--gold-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 12px rgba(0, 0, 0, .3); border: 0; }
.chip, .person-chip { border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); border: .5px solid rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.person-chip[aria-pressed="true"] { background: linear-gradient(180deg, rgba(246, 220, 154, .32), rgba(224, 178, 92, .14)); border-color: rgba(246, 220, 154, .55); }

/* Sheet and dialogs: big rounded glass, iOS grabber */
.sheet .grab { background-color: rgba(255, 255, 255, .38) !important; width: 38px; height: 5px; border-radius: 3px; border: 0; box-shadow: none; }
dialog { background: radial-gradient(120% 60% at 0% 0%, rgba(255, 255, 255, .1), transparent 60%), rgba(22, 27, 46, .82); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); border: .5px solid var(--lg-edge); box-shadow: var(--lg-hi), 0 30px 80px rgba(0, 0, 0, .6); border-radius: 30px; }
dialog::backdrop { background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Avatars and pins: glossy rim */
.pin { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 22px rgba(0, 0, 0, .55); }
.avatar { box-shadow: 0 0 0 2px var(--c, var(--accent)), 0 4px 12px rgba(0, 0, 0, .3); }

/* Lists: inset separators like iOS */
.lrow, .mrow { border-bottom-color: rgba(255, 255, 255, .07); }
.toast { color: var(--ink) !important; border-radius: 20px; font-weight: 600; }

@media (max-width: 899px) {
  /* Tab bar: floating liquid capsule; the chosen tab is a lens of brighter glass; it shrinks while a page scrolls */
  .tabs { border-radius: 34px; padding: 5px; transition: transform .35s cubic-bezier(.2, .8, .2, 1), left .35s, right .35s, height .35s; }
  .tabs a { border-radius: 28px; transition: background-color .25s, color .2s, transform .12s; }
  .tabs a[aria-current="page"] { background: radial-gradient(120% 100% at 30% 0%, rgba(255, 255, 255, .3), rgba(255, 255, 255, .1) 60%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(255, 255, 255, .08), 0 4px 14px rgba(0, 0, 0, .35); color: var(--gold-2); }
  body.scrolled .tabs { left: 22%; right: 22%; height: calc(var(--bar) - 10px); }
  body.scrolled .tabs a span { opacity: 0; height: 0; overflow: hidden; }
  body.scrolled .tabs a svg { width: 22px; height: 22px; }
  .tabs a span { transition: opacity .2s; }
  .sheet { border-radius: 34px; }
  .card { border-radius: 26px; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .tabs, .sheet, dialog { background: #141a2e !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Safari on iOS 26 takes a full-width bar fixed at the top for a header and lays its blurred « edge effect » under it
   (the hazy band over the map). The top buttons are therefore two narrow groups, left and right, never a full-width bar. */
.topbar { right: auto !important; }
.top-stack { position: fixed; z-index: 20; top: calc(10px + env(safe-area-inset-top)); right: 12px; }
@media (max-width: 899px) { .top-stack { top: calc(6px + env(safe-area-inset-top)); right: 10px; } }

/* iPhone: iOS 26 blurs the top of the screen under the clock; the map buttons start below that band */
@media (max-width: 899px) {
  .topbar, .top-stack { top: calc(env(safe-area-inset-top) + 64px) !important; }
  .geo-banner { top: calc(env(safe-area-inset-top) + 122px) !important; }
  .ring-banner { top: calc(env(safe-area-inset-top) + 122px) !important; }
}
