/* uwhere — main app styles. Calm, warm, grown-up. Tokens come from theme.css. */

:root {
  --fill: var(--paper-2);                 /* secondary button / input fill */
  --fill-hover: #e6e3dc;
  --hair: var(--line);
  --focus: rgba(63, 124, 172, .45);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --kb: 0px;
  --dock-h: 180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --ring: #ffffff;
  --marker-shadow: 0 1px 2px rgba(24, 24, 27, .18), 0 4px 12px -2px rgba(24, 24, 27, .22);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fill-hover: #26262a;
    --focus: rgba(143, 191, 255, .5);
    --ring: #2a2a2e;
    --marker-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 12px -2px rgba(0, 0, 0, .6);
  }
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { position: fixed; inset: 0; font-size: 15px; letter-spacing: -.005em; }
#app {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus) !important; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
b { font-weight: 600; }
.ic { flex: none; display: block; }

/* ---------- map ---------- */
#map { position: absolute; inset: 0; background: var(--paper-2); z-index: 0; }
.leaflet-container { font-family: var(--font-ui); background: var(--paper-2); }
.leaflet-control-attribution {
  font-size: 10px !important; line-height: 1.5; padding: 0 6px !important;
  background: color-mix(in srgb, var(--card) 75%, transparent) !important; color: var(--ink-3) !important;
  border-radius: 6px 0 0 6px;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; text-decoration: none; }
.leaflet-top.leaflet-right { top: calc(var(--sat) + 64px); right: var(--sar); }
.leaflet-control-zoom { display: none; }
.leaflet-bar { border: var(--border) !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-bar a {
  background: var(--card) !important; color: var(--ink) !important; border-color: var(--hair) !important;
  width: 40px !important; height: 40px !important; line-height: 40px !important; font-size: 18px !important; font-weight: 400;
}

/* destination line: thin, dashed, slow drift */
.ants { stroke: var(--ink); animation: march 3s linear infinite; }
@keyframes march { to { stroke-dashoffset: -20; } }
.ants.dim { opacity: .2 !important; }
.ants-halo { stroke: var(--card); }
.ants-halo.dim { opacity: .2; }

/* ---------- markers ---------- */
.um { background: none; border: 0; }
.um-off {
  position: absolute; left: 0; top: 0;
  transform: translate(var(--dx, 0), var(--dy, 0));
  transition: transform .3s var(--ease);
}
.leaflet-marker-icon.hl { z-index: 100000 !important; }
.hl .pm-avwrap { transform: scale(1.1); }
.hl .pm-name { background: var(--ink); color: var(--card); }
.hl .pm-name em { color: color-mix(in srgb, var(--card) 65%, transparent); }
.hl .pinm .pin-tag { transform: scale(1.08); }

/* avatars (shared) */
.av {
  --s: 44px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: color-mix(in srgb, var(--c) 22%, var(--card));
  box-shadow: 0 0 0 1.5px var(--c);
  overflow: hidden;
}
.av-emoji { font-family: var(--emoji); font-size: calc(var(--s) * .5); line-height: 1; }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--fill); }
.av.noimg .av-img { display: none; }
.av.mini { --s: 22px; box-shadow: 0 0 0 1.5px var(--ring); }
.av.sm { --s: 28px; }
.av.md { --s: 40px; }
.av.lg { --s: 48px; }
.av.xl { --s: 72px; box-shadow: 0 0 0 2px var(--ring), 0 0 0 3.5px var(--c), var(--shadow); }
.av.pop { animation: pop .3s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* person marker */
.pm { position: absolute; left: 0; top: 0; cursor: pointer; transition: opacity .3s, filter .3s; }
.pm-avwrap { position: absolute; left: -23px; top: -23px; width: 46px; height: 46px; transition: transform .2s var(--ease); }
.av.pm-av {
  --s: 46px;
  box-shadow: 0 0 0 2px var(--ring), 0 0 0 3.5px var(--c), var(--marker-shadow);
}
.pm.me .pm-av { box-shadow: 0 0 0 2px var(--ring), 0 0 0 4.5px var(--coral), var(--marker-shadow); }
.pm.t-live .pm-avwrap::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: var(--coral); opacity: 0; z-index: -1;
  animation: halo 3.6s ease-out infinite;
}
@keyframes halo { 0% { transform: scale(.85); opacity: .22; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
.pm.t-stale .pm-avwrap { filter: grayscale(.5); opacity: .85; }
.pm.t-old { opacity: .55; }
.pm.t-old .pm-avwrap { filter: grayscale(1); }
.pm-name {
  position: absolute; left: 0; top: 29px; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 4px; white-space: nowrap;
  background: var(--card); color: var(--ink);
  padding: 3px 8px; border-radius: 999px;
  font-weight: 500; font-size: 12px; line-height: 1.25;
  box-shadow: var(--marker-shadow);
  transition: background-color .15s, color .15s;
}
.pm-name em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.pm-name .plus { color: var(--ink-2); }
.pm-bubble {
  position: absolute; left: 0; bottom: 31px; transform: translateX(-50%);
  max-width: 168px; display: flex; gap: 5px; align-items: center;
  background: var(--card); color: var(--ink); border-radius: 10px;
  padding: 5px 9px; font-weight: 500; font-size: 13px; line-height: 1.25; white-space: nowrap;
  box-shadow: var(--marker-shadow);
}
.pm-bubble span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pm-bubble i { font-style: normal; color: var(--ink-3); font-size: 12px; flex: none; }
.pm-bubble .ic { color: var(--ink-2); }
.pm-bubble.dim { opacity: .55; }
.pm-fol { position: absolute; left: 36px; top: 12px; display: flex; align-items: center; }
.pm-fol .av { margin-left: -7px; }
.pm-fol .av:first-child { margin-left: 0; }
.pm-more {
  margin-left: -4px; background: var(--card); color: var(--ink-2); font-size: 11px; font-weight: 600;
  border-radius: 999px; padding: 2px 6px; box-shadow: var(--marker-shadow);
}
.pm.enter, .pinm.enter { animation: fade-in .25s var(--ease); }
.pm.pop .pm-av { animation: pop .3s var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* pin marker: ink rounded square with the glyph, quiet label */
.pinm { position: absolute; left: 0; top: 0; cursor: pointer; }
.pin-tag {
  position: absolute; left: -19px; top: -19px; width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--card); border-radius: 12px;
  box-shadow: 0 0 0 1px var(--hair), var(--marker-shadow);
  font-family: var(--emoji); font-size: 20px; line-height: 1;
  transition: transform .2s var(--ease);
}
.pin-tag span { position: relative; }
.pin-label {
  position: absolute; left: 0; top: 24px; transform: translateX(-50%);
  white-space: nowrap; font-weight: 600; font-size: 12px; color: var(--ink);
  background: var(--card); border-radius: 999px; padding: 2px 8px;
  box-shadow: var(--marker-shadow);
}
.pin-tag.big { position: relative; left: auto; top: auto; width: 60px; height: 60px; border-radius: 16px; font-size: 30px; flex: none; box-shadow: 0 0 0 1px var(--hair); background: var(--fill); }

/* destination end marker */
.dest-end { position: absolute; left: 0; top: 0; cursor: pointer; }
.dest-end i {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--ink); box-shadow: var(--marker-shadow);
}
.dest-label {
  position: absolute; left: 0; top: 12px; transform: translateX(-50%); white-space: nowrap;
  font-weight: 500; font-size: 12px; background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 2px 8px; box-shadow: var(--marker-shadow);
}
.dest-end.dim { opacity: .4; }

/* breadcrumbs */
.crumb { position: absolute; left: 0; top: 0; }
.crumb i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--ink-2); }
.crumb span {
  position: absolute; left: 8px; top: -9px; white-space: nowrap; font-size: 11px; font-weight: 500;
  background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink-2); padding: 1px 6px; border-radius: 999px;
}

/* preview marker (place selected, not yet confirmed) */
.preview { position: absolute; left: 0; top: 0; pointer-events: none; }
.preview-pin {
  position: absolute; left: -20px; top: -50px; width: 40px; height: 40px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg); background: var(--ink); box-shadow: var(--marker-shadow);
  display: grid; place-items: center; animation: drop .25s var(--ease);
}
.preview-pin span { transform: rotate(45deg); font-family: var(--emoji); font-size: 18px; }
.preview-shadow { position: absolute; left: -6px; top: -3px; width: 12px; height: 6px; border-radius: 50%; background: rgba(24,24,27,.3); }
@keyframes drop { from { translate: 0 -10px; opacity: 0; } to { translate: 0 0; opacity: 1; } }

/* ---------- top bar (phones) ---------- */
#topbar {
  position: absolute; z-index: 500;
  top: calc(var(--sat) + 10px); left: calc(var(--sal) + 12px); right: calc(var(--sar) + 12px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  pointer-events: none; transition: transform .22s var(--ease), opacity .2s;
}
#topbar > * { pointer-events: auto; }
.tb-title {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 999px; padding: 8px 16px 8px 14px; box-shadow: var(--shadow);
}
.trip-title {
  margin: 0; font-size: 16px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; transition: background-color .3s; }
.live.on { background: var(--mint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 20%, transparent); }
.tb-people {
  display: flex; align-items: center; gap: 8px; min-height: 44px; flex: none;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 0; border-radius: 999px; padding: 6px 14px 6px 8px;
  box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
}
.tb-people:active { background: var(--fill); }
.tb-faces { display: flex; }
.tb-faces .av { margin-left: -7px; }
.tb-faces .av:first-child { margin-left: 0; }
.tb-ic { color: var(--ink-2); }
.tb-faces:not(:empty) + .tb-ic { display: none; }

/* ---------- me card: dock (phones) + panel (desktop) ---------- */
.me-card { display: flex; flex-direction: column; gap: 14px; }
#dock {
  position: absolute; z-index: 600;
  left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px);
  bottom: max(8px, var(--sab));
  margin: 0 auto; max-width: 520px;
  background: var(--card); border-radius: var(--radius-l);
  box-shadow: 0 0 0 1px var(--hair), var(--shadow);
  padding: 16px;
  transition: transform .22s var(--ease), opacity .2s;
}
body.picking #dock, body.picking #fab-locate { transform: translateY(120%); opacity: 0; pointer-events: none; }
body.picking #topbar { transform: translateY(-140%); opacity: 0; }
.me-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.me-av { position: relative; padding: 0; background: none; border: 0; border-radius: 50%; flex: none; }
.me-av .av { box-shadow: 0 0 0 2px var(--ring), 0 0 0 3.5px var(--coral); }
.me-edit {
  position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--ink-2);
  box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(0,0,0,.1);
}
.me-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.me-sentence { font-family: var(--font-display); font-size: 17px; line-height: 1.3; font-weight: 500; letter-spacing: -.015em; }
.me-sentence b { font-weight: 600; }
.me-sentence .muted { display: block; font-family: var(--font-ui); font-size: 14px; letter-spacing: 0; font-weight: 400; margin-top: 2px; }
.me-sub { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.me-sub b { color: var(--ink); font-weight: 500; }
.age { font-style: normal; font-family: var(--font-ui); font-size: 13px; font-weight: 400; color: var(--ink-3); white-space: nowrap; letter-spacing: 0; }
.me-fol { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.me-fol .av { margin-right: -10px; }
.me-fol .av:last-of-type { margin-right: 2px; }

.me-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.me-actions.two { grid-template-columns: 1fr 1fr; }
.me-actions.one { grid-template-columns: 1fr; }

.nudge {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 8px 14px; text-align: left;
  background: var(--fill); color: var(--ink); border: 0; border-radius: 12px;
  font-size: 14px;
}
.nudge .ic { color: var(--ink-2); }
.nudge > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nudge u { text-decoration: none; font-weight: 600; color: var(--coral); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 18px;
  background: var(--fill); color: var(--ink);
  border: 0; border-radius: var(--radius); box-shadow: none;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-align: center;
  transition: background-color .15s, transform .1s, opacity .15s;
  position: relative;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--card); }
.btn.big { min-height: 56px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; font-weight: 500; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.btn.tile { flex-direction: column; gap: 6px; min-height: 68px; padding: 10px 6px; font-size: 13.5px; font-weight: 500; }
.btn.tile .ic { color: var(--ink-2); }
.btn.tile.primary .ic { color: var(--card); }
.busy { color: transparent !important; pointer-events: none; }
.busy > * { opacity: 0; }
.busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid var(--ink-3); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary.busy::after { border-color: var(--card); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; font-weight: 600; color: var(--ink); }
.mini-btn {
  width: 40px; height: 40px; flex: none; border-radius: 10px; border: 0; background: var(--card); color: var(--ink-2);
  display: grid; place-items: center; box-shadow: 0 0 0 1px var(--hair);
}

@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--fill-hover); }
  .btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 88%, var(--card)); }
  .btn.ghost:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
  .tb-people:hover { background: var(--card); }
  .row:hover, .choice:hover, .preset:hover, .pin-chip:hover, .pchip:hover { background: var(--fill); }
  .mini-btn:hover, .back:hover { background: var(--fill); color: var(--ink); }
  .pm:hover .pm-avwrap { transform: scale(1.06); }
  .pinm:hover .pin-tag { transform: scale(1.06); }
  .fab:hover { background: var(--fill); }
  .emo:hover { background: var(--fill); }
  .nudge:hover { background: var(--fill-hover); }
  .sheet-x:hover, .s-clear:hover, .ic-x:hover { color: var(--ink); background: var(--fill-hover); }
  .link:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* floating locate button */
.fab {
  position: absolute; z-index: 550;
  right: calc(var(--sar) + 12px); bottom: calc(max(8px, var(--sab)) + var(--dock-h) + 12px);
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); color: var(--ink); border: 0; box-shadow: 0 0 0 1px var(--hair), var(--shadow);
  transition: transform .22s var(--ease), bottom .22s var(--ease), opacity .2s, background-color .15s;
}
.fab:active { transform: scale(.95); }

/* ---------- sheets ---------- */
#sheet-root { position: absolute; inset: 0; z-index: 1000; }
.scrim { position: absolute; inset: 0; background: rgba(17, 17, 19, .22); opacity: 0; transition: opacity .2s; }
#sheet-root.open .scrim { opacity: 1; }
#sheet-root.closing .scrim { opacity: 0; }
.sheet {
  position: absolute; left: var(--sal); right: var(--sar); bottom: 0;
  margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - var(--sat) - 24px);
  max-height: calc(var(--vvh, 100dvh) - var(--sat) - 24px - var(--kb));
  transform: translateY(calc(-1 * var(--kb)));
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px 20px 0 0;
  box-shadow: 0 -1px 0 var(--hair), 0 -12px 40px -12px rgba(0,0,0,.25);
  overflow: hidden;
}
#sheet-root.open .sheet { animation: sheet-in .26s var(--ease); }
#sheet-root.closing .sheet { animation: sheet-out .18s ease-in forwards; }
.sheet.swap { animation: fade .18s var(--ease) !important; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: .6; } to { opacity: 1; } }
#sheet-root.typing .sheet { top: calc(var(--sat) + 8px); bottom: var(--kb); transform: none; max-height: none; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .45; margin: 8px auto 0; flex: none; }
.sheet-x {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--fill); color: var(--ink-2); display: grid; place-items: center;
}
.sheet-x::before { content: ""; position: absolute; inset: -4px; }
.sheet-body {
  padding: 8px 20px calc(20px + var(--sab)); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sheet-body h2, .pv-body h2 { font-size: 22px; font-weight: 600; margin: 8px 48px 16px 0; line-height: 1.2; letter-spacing: -.02em; }
.lede { margin: -8px 0 16px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }

/* ---------- lists & rows ---------- */
.sec {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: -.005em;
  color: var(--ink-2); margin: 22px 0 6px;
}
.sec span, .count { font-family: var(--font-ui); font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 8px;
  background: transparent; border: 0; border-radius: 12px; text-align: left; color: var(--ink);
  position: relative; transition: background-color .12s;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 60px; right: 8px; border-top: 1px solid var(--hair); }
.row:hover::before, .row:hover + .row::before, .row.active::before, .row.active + .row::before { opacity: 0; }
.row:active { background: var(--fill); }
.row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.row-main b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small b { font-size: inherit; font-weight: 500; color: var(--ink-2); }
.row-time { flex: none; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-time.t-live { color: var(--mint); }
.row.t-old .av { filter: grayscale(1); opacity: .6; }
.row.t-stale .av { filter: grayscale(.5); }
.row-emoji {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--emoji); font-size: 19px; background: var(--fill);
}
.row-emoji.is-pin { background: var(--card); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(0,0,0,.06); }
.row-emoji.big { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.row-dist { flex: none; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row.active { background: var(--fill); }
.tag { font-size: 11px; font-weight: 500; background: var(--fill); color: var(--ink-2); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; margin-left: 4px; }
.row.active .tag { background: var(--card); }
.you { font-size: 11px; font-weight: 500; background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--coral); padding: 1px 6px; border-radius: 6px; vertical-align: 2px; font-family: var(--font-ui); letter-spacing: 0; }
.chip { display: inline-block; font-style: normal; font-weight: 500; font-size: 12px; line-height: 1.4; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--ink-2); }
.chip.t-live { background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 28px 12px; color: var(--ink-2); font-size: 14px;
}
.empty .ic { color: var(--ink-3); margin-bottom: 6px; }
.empty b { color: var(--ink); font-size: 15px; font-weight: 500; }
.empty.sm { padding: 6px 8px; display: block; text-align: left; color: var(--ink-3); }
.roster-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-right: 44px; }
.roster-head h2 { margin-right: 0 !important; }

/* choice tiles (GPS / pick) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.choices.one { grid-template-columns: 1fr; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; text-align: left;
  background: var(--card); border: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--hair);
  transition: background-color .12s; position: relative;
}
.choice:active:not(:disabled) { background: var(--fill); }
.choice > .ic { color: var(--ink-2); }
.choice > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.choice b { font-size: 15px; font-weight: 500; }
.choice small { font-size: 13px; color: var(--ink-3); }
.choice.hero { width: 100%; min-height: 64px; margin: 0 0 14px; background: var(--ink); color: var(--card); box-shadow: none; }
.choice.hero > .ic { color: var(--card); }
.choice.hero small { color: color-mix(in srgb, var(--card) 65%, transparent); }
.choice.hero b { font-weight: 600; font-size: 16px; }
@media (hover: hover) { .choice.hero:hover { background: color-mix(in srgb, var(--ink) 88%, var(--card)); } }
.gps-msg { margin: 10px 2px 0; font-size: 14px; color: var(--ink-2); }
.gps-msg.err { color: var(--coral); }

/* pin chips */
.pin-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pin-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px 6px 6px;
  background: var(--card); color: var(--ink); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hair);
  font-weight: 500; font-size: 14.5px; max-width: 100%; position: relative;
  transition: background-color .12s;
}
.pin-chip:active { background: var(--fill); }
.pc-e { width: 36px; height: 36px; border-radius: 9px; background: var(--fill); display: grid; place-items: center; font-family: var(--emoji); font-size: 18px; flex: none; }
.pc-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-chip small { color: var(--ink-3); font-size: 13px; white-space: nowrap; font-weight: 400; }
.pin-chip.current { box-shadow: inset 0 0 0 1.5px var(--ink); }
.pc-check { color: var(--ink); }

/* search */
.search { position: relative; }
.search-box { position: relative; display: block; }
.s-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; font: inherit; font-size: 17px; font-weight: 400;
  color: var(--ink); background: var(--fill); border: 0; border-radius: var(--radius);
  -webkit-appearance: none; appearance: none; transition: box-shadow .15s, background-color .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink) !important; }
.input.big { min-height: 56px; font-size: 18px; text-align: center; }
.search-input { padding-left: 42px; padding-right: 46px; }
.search-input::-webkit-search-cancel-button { display: none; }
.s-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-3); display: grid; place-items: center;
}
.s-results { margin-top: 8px; display: flex; flex-direction: column; }
.s-status { display: flex; align-items: center; gap: 10px; padding: 14px 8px; color: var(--ink-2); font-size: 14px; }
.s-status.err { color: var(--coral); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
.s-credit { font-size: 11px; color: var(--ink-3); padding: 8px 8px 2px; }
.s-credit a { color: inherit; }

/* confirm (place preview) */
.confirm { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.confirm-place { display: flex; align-items: center; gap: 14px; margin: 0 44px 6px 0; min-height: 56px; }
.confirm-place > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.confirm-place b { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.confirm-place small { font-size: 14px; color: var(--ink-2); }
.confirm-form { display: flex; flex-direction: column; gap: 10px; }

/* status */
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.inline-form .btn { flex: none; min-height: 52px; background: var(--ink); color: var(--card); }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.preset {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; text-align: left;
  background: var(--card); border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hair);
  font-weight: 500; font-size: 14.5px; transition: background-color .12s; position: relative;
}
.preset:active { background: var(--fill); }
.preset .e { font-family: var(--emoji); font-size: 18px; }

/* details */
.d-head { display: flex; align-items: center; gap: 16px; margin: 8px 44px 4px 0; }
.d-title { min-width: 0; }
.d-head h2 { margin: 0 0 4px !important; font-size: 24px !important; overflow-wrap: anywhere; }
.d-head p { margin: 0; font-size: 14px; }
.note {
  background: var(--fill); border-radius: 12px; padding: 12px 14px;
  font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin: 14px 0 0; white-space: pre-wrap; user-select: text;
}
.facts { display: flex; flex-direction: column; margin-top: 16px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.fact { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; min-height: 60px; }
.fact + .fact { border-top: 1px solid var(--hair); }
.fact > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.fact b { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.fact small { font-size: 13px; color: var(--ink-3); }
.fact small.addr { color: var(--ink-2); }
.fact.old, .fact.t-old { opacity: .6; }
.fi { color: var(--ink-2); flex: none; display: grid; place-items: center; width: 22px; }
.d-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.d-actions.two { display: grid; grid-template-columns: 1fr 1fr; }
.together { text-align: center; color: var(--ink-2); font-size: 14px; margin: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 6px;
  background: var(--card); border: 0; box-shadow: inset 0 0 0 1px var(--hair); border-radius: 999px; font-weight: 500; font-size: 14px;
}
.pchip small { font-size: 12px; font-weight: 400; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 14px 0; }
.timeline li::before { content: ""; position: absolute; left: 4.5px; top: 14px; bottom: 0; border-left: 1px dashed var(--ink-3); opacity: .6; }
.timeline li:last-child::before { display: none; }
.timeline i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--ink-3); margin-top: 5px; }
.timeline li.now i { background: var(--ink); border-color: var(--ink); }
.timeline div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.timeline b { font-weight: 400; font-size: 14.5px; }
.timeline b b { font-weight: 500; }
.timeline small { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- profile form / onboarding ---------- */
.profile-form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.profile-form h2 { text-align: center; margin: 6px 0 0 !important; font-size: 22px; }
.profile-form > .muted { margin: 0 0 6px; font-size: 14.5px; }
.pf-preview { display: flex; justify-content: center; padding-top: 6px; }
.pf-label { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emo {
  aspect-ratio: 1; min-height: 40px; border-radius: 10px; border: 0; background: transparent;
  font-family: var(--emoji); font-size: 22px; display: grid; place-items: center; transition: background-color .12s;
}
.emo.sel { background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw {
  width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 0; padding: 0;
  transition: box-shadow .15s;
}
.sw.sel { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.pf-note { margin: 6px 0 8px; text-align: center; font-size: 13px; color: var(--ink-3); }

#onboard {
  position: absolute; inset: 0; z-index: 2000; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--paper);
  padding: calc(var(--sat) + 20px) calc(var(--sar) + 16px) calc(var(--sab) + 20px) calc(var(--sal) + 16px);
  display: flex; justify-content: center; align-items: flex-start;
}
.ob-card {
  width: 100%; max-width: 420px; margin: auto 0;
  background: var(--card); border-radius: 24px;
  box-shadow: 0 0 0 1px var(--hair), var(--shadow); padding: 28px 22px 22px;
  animation: fade-in .3s var(--ease);
}
.ob-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
.ob-logo { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--ink-2); }
.ob-tag { font-size: 13px; color: var(--ink-3); }
.ob-card h2 { font-size: 24px; }

/* ---------- pick mode ---------- */
#pick { position: absolute; inset: 0; z-index: 900; pointer-events: none; }
.pick-hint {
  position: absolute; top: calc(var(--sat) + 14px); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 32px); text-align: center; white-space: nowrap;
  background: var(--ink); color: var(--card); border-radius: 999px; padding: 10px 18px;
  font-weight: 500; font-size: 14.5px; box-shadow: var(--shadow); animation: drop .2s var(--ease);
}
.pick-cross { position: absolute; left: 50%; top: 50%; }
.pick-pin {
  position: absolute; left: -16px; top: -42px; width: 32px; height: 32px; border-radius: 50% 50% 50% 3px; transform: rotate(-45deg);
  background: var(--ink); box-shadow: var(--marker-shadow);
}
.pick-pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--card); }
.pick-shadow { position: absolute; left: -5px; top: -2px; width: 10px; height: 5px; border-radius: 50%; background: rgba(24,24,27,.35); }
.pick-actions {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, var(--sab)) + 6px);
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: auto;
}
.pick-actions .btn { min-height: 56px; font-size: 16px; box-shadow: var(--shadow); }
.pick-actions .btn.ghost { background: var(--card); color: var(--ink); }
body.picking .leaflet-container { cursor: crosshair; }

/* ---------- toasts ---------- */
#toasts {
  position: absolute; z-index: 3000; left: 50%; transform: translateX(-50%);
  top: calc(var(--sat) + 66px); width: min(420px, calc(100% - 24px));
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--card); border-radius: 999px; padding: 10px 18px;
  font-weight: 500; font-size: 14.5px; text-align: center; box-shadow: var(--shadow);
  animation: toast-in .22s var(--ease); transition: opacity .25s, transform .25s;
}
.toast.err { background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: inset 3px 0 0 var(--coral), 0 0 0 1px var(--hair), var(--shadow); text-align: left; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- install nudge ---------- */
.install-card { display: flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 12px; }
.ic-main {
  flex: 1; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px 6px 14px;
  background: none; border: 0; text-align: left; min-width: 0;
}
.ic-main > .ic { color: var(--ink-2); }
.ic-main > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.ic-main b { font-size: 14px; font-weight: 500; }
.ic-main small { font-size: 12.5px; color: var(--ink-3); }
.ic-go { margin-left: auto; background: var(--ink); color: var(--card); font-weight: 600; font-size: 13px; border-radius: 999px; padding: 6px 12px; flex: none; }
.ic-x { width: 44px; height: 44px; flex: none; background: none; border: 0; border-radius: 10px; color: var(--ink-3); display: grid; place-items: center; }
.steps { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--hair); }
.steps li { display: flex; align-items: center; gap: 12px; padding: 14px; }
.steps li + li { border-top: 1px solid var(--hair); }
.steps li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.steps b { font-size: 15px; font-weight: 500; }
.steps small { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.step-n { flex: none; width: 20px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-3); text-align: center; }
.step-ico {
  flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--fill); color: var(--ink);
}
.step-ico.add { font-weight: 600; font-size: 15px; color: #2f7cf6; }
.down-arrow { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 2px; color: var(--ink-3); font-size: 13px; }
.extras { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 24px 0 6px; }

/* ---------- desktop side panel ---------- */
#panel { display: none; }
@media (min-width: 900px) {
  #topbar, #dock { display: none; }
  #panel {
    position: absolute; z-index: 700; display: flex; flex-direction: column;
    top: 12px; bottom: 12px; left: 12px; width: 372px;
    background: var(--card); border-radius: var(--radius-l);
    box-shadow: 0 0 0 1px var(--hair), var(--shadow); overflow: hidden;
    transition: opacity .2s;
  }
  .panel-head { display: flex; align-items: center; gap: 10px; padding: 20px 20px 2px; }
  .panel-head .trip-title { font-size: 19px; white-space: normal; }
  .panel-me { margin: 12px 12px 0; padding: 14px; background: var(--paper); border-radius: 16px; }
  .panel-me .btn.tile { background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
  .panel-me .btn.tile.primary { background: var(--ink); box-shadow: none; }
  .panel-me .nudge, .panel-me .install-card { background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
  @media (hover: hover) {
    .panel-me .btn.tile:hover:not(.primary) { background: var(--fill); }
  }
  .panel-view { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; margin-top: 4px; }
  .pv-top {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--card); padding: 12px 8px 6px; min-height: 56px;
  }
  .pv-title { margin: 0; font-size: 16px; font-weight: 600; }
  .back {
    display: inline-flex; align-items: center; gap: 4px;
    min-height: 40px; padding: 6px 12px 6px 6px; border-radius: 10px; border: 0; background: transparent;
    font-weight: 500; font-size: 14px; color: var(--ink-2);
  }
  .pv-body { padding: 0 4px; }
  .pv-body .sec:first-child { margin-top: 4px; }
  .pv-body h2 { margin-right: 0; }
  .pv-body .d-head, .pv-body .confirm-place { margin-right: 0; }
  .leaflet-control-zoom { display: block; }
  .leaflet-bottom.leaflet-right { margin: 0 12px 12px 0; }
  .leaflet-top.leaflet-right { top: 0; }
  .fab { right: 12px; bottom: 112px; }
  #toasts { top: 20px; left: calc(50% + 192px); }
  .pick-hint, .pick-actions { left: calc(50% + 192px); }
  body.picking #panel { opacity: .5; pointer-events: none; }
}

@media (min-width: 600px) and (max-width: 899px) {
  .sheet { bottom: 16px; border-radius: 20px; left: 16px; right: 16px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- onboarding: "is this you?" ---------- */
.ob-matches { margin: 10px 0 4px; border: var(--border); border-radius: var(--radius); background: var(--paper-2); overflow: hidden; animation: obmIn .18s var(--spring); }
.ob-matches.insist { border-color: color-mix(in srgb, var(--coral) 45%, transparent); background: color-mix(in srgb, var(--coral) 6%, var(--card)); }
.obm-head { padding: 12px 14px 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.obm-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 14px; border: 0; border-top: var(--border); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.obm-row .av { flex: none; }
.obm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.obm-txt b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obm-txt small { color: var(--ink-3); font-size: 13px; }
.obm-cta { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--card); font-size: 14px; font-weight: 600; }
.obm-new { display: block; width: 100%; min-height: 52px; border: 0; border-top: var(--border); background: transparent; color: var(--ink-2); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; touch-action: manipulation; }
.obm-row:disabled { opacity: .6; }
@media (hover: hover) { .obm-row:hover, .obm-new:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); } }
@keyframes obmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ob-matches { animation: none; } }
