/* Trips — group trip planner. Mobile first. */
:root {
  --mist: #F2F4F1;
  --paper: #FFFFFF;
  --pine: #1F4D40;
  --pine-2: #2C6654;
  --pine-soft: #E3ECE7;
  --sun: #F2B632;
  --sun-soft: #FCEFCB;
  --ink: #17201C;
  --ink-2: #4C5A53;
  --line: #D9DFDA;
  --neg: #B5462F;
  --pos: #2E7A4F;
  --r: 14px;
  --r-sm: 10px;
  --head: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mist); color: var(--ink);
  font: 16px/1.45 var(--body); -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.sheet-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--head); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--pine); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.86rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.wrap { overflow-wrap: anywhere; }
.center { text-align: center; align-items: center; }
[hidden] { display: none !important; }

/* ---------- form controls ---------- */
label { font-weight: 600; font-size: 0.92rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: var(--paper); font-size: 16px; /* 16px stops iOS zoom */
  appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-soft); }
input[type=file] { font-size: 0.9rem; max-width: 100%; }
input[type=date], input[type=datetime-local] { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > label { margin-top: 8px; }
.stack > label:first-child { margin-top: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hint { font-size: 0.82rem; color: var(--ink-2); }
.err { color: var(--neg); font-weight: 600; font-size: 0.92rem; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--pine); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--pine); color: #fff; font-weight: 700; font-size: 0.98rem;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--pine-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.big { width: 100%; min-height: 54px; font-size: 1.05rem; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn.ghost { background: transparent; color: var(--pine); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--pine-soft); }
.btn.danger { background: var(--neg); }
.btn.danger-t { color: var(--neg); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--pine-soft); color: var(--pine); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm svg { width: 17px; height: 17px; }
.link-btn { border: 0; background: none; padding: 6px 2px; color: var(--pine); font-weight: 700; font-size: 0.92rem; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.pill-btn { border: 1.5px solid var(--pine); background: var(--paper); color: var(--pine); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.85rem; white-space: nowrap; flex: none; min-height: 36px; }
.pill-btn:hover { background: var(--pine); color: #fff; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.row-actions .btn.big { flex: 1; width: auto; }

/* segmented controls: radio labels or buttons */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; font-weight: 600; }
.seg label input { position: absolute; opacity: 0; inset: 0; }
.seg label > span, .seg button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; font-size: 0.92rem; color: var(--ink);
}
.seg label > input:checked + span, .seg button.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.seg label input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.seg.mini button { min-height: 32px; padding: 0 12px; font-size: 0.84rem; }
.seg.tabs4 { display: flex; flex-wrap: nowrap; gap: 2px; padding: 4px; background: var(--pine-soft); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.seg.tabs4::-webkit-scrollbar { display: none; }
.seg.tabs4 button { flex: 1 0 auto; white-space: nowrap; justify-content: center; border: 0; background: transparent; padding: 0 12px; min-height: 40px; font-size: 0.88rem; color: var(--pine); }
.seg.tabs4 button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 32, 28, .14); }
.seg.tabs4 i { font-style: normal; font-size: 0.72rem; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sun); color: var(--ink); display: inline-grid; place-items: center; font-weight: 800; }

/* checkbox chips for picking people */
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick label { position: relative; font-weight: 600; }
.pick input { position: absolute; opacity: 0; inset: 0; }
.pick label > span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 4px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-size: 0.92rem; opacity: .6; }
.pick input:checked + span { border-color: var(--pine); background: var(--pine-soft); opacity: 1; }
.pick input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }

/* avatars */
.av { --c: var(--pine); display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: #fff; font: 700 0.82rem/1 var(--head); flex: none; letter-spacing: .02em; }
.av.sm { width: 28px; height: 28px; font-size: 0.7rem; }
.av.lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* ---------- landing ---------- */
.landing { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.land-hero {
  background: var(--pine); color: #fff; padding: calc(28px + env(safe-area-inset-top, 0px)) 24px 40px;
  border-radius: 0 0 28px 28px; position: relative; overflow: hidden;
}
.ridge { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70px; }
.ridge .r2 { fill: rgba(255,255,255,.06); stroke: none; }
.ridge .r1 { fill: none; stroke: var(--sun); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.land-hero { padding-bottom: 84px; }
.brand { display: flex; align-items: center; gap: 8px; font: 800 1.1rem var(--head); color: var(--sun); margin-bottom: 56px; }
.brand svg { width: 26px; height: 26px; }
.land-hero h1 { font-size: clamp(2.3rem, 9vw, 3.1rem); max-width: 12ch; }
.lede { margin-top: 14px; color: rgba(255,255,255,.82); max-width: 38ch; }
.land-actions { padding: 28px 20px 40px; display: flex; flex-direction: column; gap: 22px; }
.join-form { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .18em; font: 700 1.15rem var(--head); }
.join-form .code-row input { letter-spacing: .2em; }
.recent { display: flex; flex-direction: column; gap: 8px; }
.recent-trip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); }
.recent-trip:hover { border-color: var(--pine); }
.rt-name { font: 700 1.05rem var(--head); }
.demo-note, .demo-flag { font-size: 0.8rem; color: var(--ink-2); text-align: center; }
.demo-flag { position: fixed; top: 6px; right: 8px; background: var(--sun-soft); padding: 3px 9px; border-radius: 999px; z-index: 30; pointer-events: none; }

/* ---------- flows (create / join) ---------- */
.flow { max-width: 560px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 48px; display: flex; flex-direction: column; gap: 16px; }
.flow > h1 { margin-top: 4px; }
.back { align-self: flex-start; border: 0; background: none; color: var(--pine); font-weight: 700; padding: 8px 0; }
.join-card { --img: none; border-radius: 20px; padding: 72px 20px 20px; color: #fff; background: linear-gradient(180deg, rgba(23,32,28,.05), rgba(23,32,28,.75)), var(--img), var(--pine); background-size: cover; background-position: center; }
.join-card h1 { font-size: 1.9rem; margin: 2px 0 4px; }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who-btn { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); text-align: left; font-weight: 700; min-height: 64px; min-width: 0; }
.who-btn span { min-width: 0; overflow-wrap: anywhere; }
.who-btn small { display: block; font-weight: 500; color: var(--ink-2); font-size: 0.78rem; }
.who-btn:hover { border-color: var(--pine); }
.who-btn.new { border-style: dashed; color: var(--pine); }
.who-btn.new svg { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--pine-soft); }

/* ---------- sheets ---------- */
#sheet-root { position: relative; z-index: 50; }
.scrim { position: fixed; inset: 0; background: rgba(23,32,28,.45); animation: fade .18s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--mist); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(23,32,28,.18);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  max-width: 560px; margin: 0 auto;
}
.sheet.in { transform: none; }
.sheet:focus { outline: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px 6px 20px; }
.sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line); }
.sheet-head h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.sheet-body { overflow-y: auto; padding: 6px 20px calc(24px + var(--safe-b)); overscroll-behavior: contain; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 22px; transform: translateY(-46%) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; max-height: 86dvh; width: min(560px, 92vw); }
  .sheet.in { transform: translateY(-50%); opacity: 1; }
  .sheet-head::before { display: none; }
}
@keyframes fade { from { opacity: 0; } }
.big-code { font: 800 2.8rem/1 var(--head); letter-spacing: .14em; color: var(--pine); padding: 14px 0 6px; }
.big-amt { font: 800 2.4rem/1 var(--head); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 0.92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- inside a trip: frame ---------- */
.tabview { max-width: 680px; margin: 0 auto; padding: 0 16px calc(var(--tabbar) + 28px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; align-items: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: rgba(242,244,241,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.tb-name { font: 700 1rem var(--head); }
.tb-loc { font-size: 0.78rem; color: var(--ink-2); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + var(--safe-b));
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border: 0; background: none; color: var(--ink-2); font-size: 0.72rem; font-weight: 700; border-radius: 12px; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--pine); }
.tabbar button.on svg { background: var(--sun-soft); border-radius: 999px; padding: 2px 12px; width: 48px; height: 28px; stroke: var(--pine); }
@media (min-width: 700px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 14px; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 6px 24px rgba(23,32,28,.12); padding: 4px; }
  .tabview { padding-bottom: calc(var(--tabbar) + 48px); }
  .tab-chat { padding-bottom: calc(var(--tabbar) + 34px); }
}

.block { background: var(--paper); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.block-head h2 { display: flex; align-items: center; gap: 8px; }
.empty { color: var(--ink-2); font-size: 0.94rem; padding: 4px 0; }

/* ---------- Trip tab: hero with boarding-pass stub ---------- */
.tab-trip { padding-top: 0; }
.hero {
  --img: none; position: relative; margin: 0 -16px; min-height: 420px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
  display: flex; flex-direction: column; color: #fff;
  background: var(--pine);
}
.hero.has-photo { background: linear-gradient(180deg, rgba(23,32,28,.35) 0%, rgba(23,32,28,0) 28%, rgba(23,32,28,.15) 50%, rgba(23,32,28,.82) 100%), var(--img) center / cover no-repeat, var(--pine); }
.hero:not(.has-photo)::before { /* mountain line when there's no photo */
  content: ""; position: absolute; inset: auto 0 96px 0; height: 120px; opacity: .9;
  background: linear-gradient(155deg, transparent 49.6%, var(--sun) 50%, var(--sun) 51.2%, transparent 51.6%) left / 55% 100% no-repeat,
              linear-gradient(205deg, transparent 49.6%, var(--sun) 50%, var(--sun) 51.2%, transparent 51.6%) right / 46% 100% no-repeat;
  pointer-events: none;
}
.hero-top { display: flex; justify-content: flex-end; gap: 8px; position: relative; z-index: 1; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 0; background: rgba(23,32,28,.42); color: #fff; font-weight: 600; font-size: 0.84rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; min-height: 36px; }
.chip-btn svg { width: 16px; height: 16px; }
.chip-btn:hover { background: rgba(23,32,28,.62); }
.chip-btn:focus-within { outline: 3px solid var(--sun); outline-offset: 2px; }
.hero-text { margin-top: auto; padding: 0 4px 18px; position: relative; z-index: 1; }
.hero-text h1 { font-size: clamp(2.4rem, 11vw, 3.6rem); text-wrap: balance; text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.where { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.where svg { color: var(--sun); }
.where:hover { text-decoration: underline; }
.dates { margin-top: 2px; color: rgba(255,255,255,.85); font-size: 0.95rem; padding-left: 26px; }
.stub {
  position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 0 0 -26px; padding: 14px 18px; border: 0; border-radius: 16px; text-align: left;
  background: var(--sun); color: var(--ink); box-shadow: 0 6px 20px rgba(23,32,28,.22);
  /* ticket notches */
  -webkit-mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.stub-l { font-size: 0.78rem; font-weight: 700; line-height: 1.1; max-width: 5ch; }
.stub-code { font: 800 1.7rem/1 var(--head); letter-spacing: .16em; border-left: 2px dashed rgba(23,32,28,.35); padding-left: 14px; }
.stub-r { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9rem; }
.stub:hover .stub-r { text-decoration: underline; }
.glance-for { display: flex; align-items: center; gap: 8px; margin-top: 40px; font-size: 0.84rem; color: var(--ink-2); }
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: -4px; }
.g-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; min-width: 0; border: 0; border-radius: var(--r); background: var(--paper); }
.g-card:hover { box-shadow: inset 0 0 0 1.5px var(--pine); }
.g-k { font-size: 0.76rem; color: var(--ink-2); font-weight: 600; }
.g-v { font: 800 1.35rem/1.15 var(--head); overflow-wrap: anywhere; }
.g-v.small { font-size: 0.98rem; line-height: 1.2; }
.g-s { font-size: 0.74rem; color: var(--ink-2); }
.addr a { font-weight: 700; }
.notes { white-space: normal; color: var(--ink); }
.arrivals { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 0; position: relative; }
.arrivals li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.arrivals li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 44px; bottom: -8px; width: 2px; background: var(--line); }
.av-stack { display: flex; flex-direction: column; align-items: center; flex: none; width: 36px; }
.av-stack .av + .av { margin-top: -14px; box-shadow: 0 0 0 2px var(--paper); }
.row-actions.start { justify-content: flex-start; }
.you-travel { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sun-soft); }
.car.mine { border-color: var(--pine); }
.car.own .car-h { grid-template-columns: auto 1fr auto; }
.eta { display: block; font-weight: 700; font-size: 0.88rem; color: var(--pine); margin: 1px 0; }
.eta.unset { color: var(--ink-2); font-weight: 500; }
.rider.driver small { color: var(--ink-2); font-weight: 500; font-size: 0.78rem; }
/* chat */
.seg.chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; flex: none; }
.seg.chips::-webkit-scrollbar { display: none; }
.seg.chips button { flex: none; white-space: nowrap; }
.tab-chat { height: calc(100dvh - 62px - env(safe-area-inset-top, 0px)); padding-bottom: calc(var(--tabbar) + 12px + var(--safe-b)); gap: 10px; }
.chat-wrap { flex: 1; min-height: 0; overflow-y: auto; background: var(--paper); border-radius: var(--r); padding: 14px 12px; overscroll-behavior: contain; }
.tab-chat .msgs { max-height: none; overflow: visible; }
.composer { flex: none; }
.tab-chat .demo-note { display: none; }
.tabbar button { position: relative; }
.tabbar button i { position: absolute; top: 3px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--neg); color: #fff; font: 800 0.68rem/18px var(--body); font-style: normal; }
.arrivals b { font-family: var(--head); }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.people li { display: flex; align-items: center; gap: 0; }
.people li .av + .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--paper); }
.people li > span:last-child { margin-left: 10px; }

/* ---------- Money ---------- */
.money-top { text-align: center; padding: 18px 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mt-k { font-weight: 700; color: var(--ink-2); }
.mt-v { font: 800 3.2rem/1 var(--head); letter-spacing: -0.02em; margin: 2px 0 4px; }
.mt-s { font-size: 0.92rem; }
.money-top .btn { margin-top: 14px; max-width: 360px; }
.settle { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.settle li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sun-soft); }
.settle-r { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.settle-r .link-btn { padding: 2px 0; font-size: 0.86rem; }
.amt { font: 800 1.15rem var(--head); }
.bal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bal-g { display: flex; flex-direction: column; gap: 4px; }
.bal-g:has(.bal-gh) { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.bal-gh { display: flex; justify-content: space-between; font-family: var(--head); font-size: 1.02rem; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.bal-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "av n v" "av s v"; column-gap: 10px; align-items: center; padding: 4px 0; }
.bal-row .av { grid-area: av; }
.bal-n { grid-area: n; font-weight: 700; }
.bal-row .small { grid-area: s; }
.bal-v { grid-area: v; font: 800 1.05rem var(--head); }
.exps { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; }
.exp { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 10px 8px; border: 0; background: none; text-align: left; border-radius: var(--r-sm); }
.exp:hover { background: var(--mist); }
.exp-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.exp-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--pine-soft); display: grid; place-items: center; font-size: 1.2rem; }
.exp-ico.pay { background: var(--sun-soft); font-weight: 800; color: var(--ink); }
.exp-main { display: flex; flex-direction: column; min-width: 0; }
.exp-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-amt { text-align: right; font: 800 1.02rem var(--head); display: flex; flex-direction: column; }
.exp-amt small { font: 600 0.76rem var(--body); color: var(--ink-2); }
.scan-box { display: flex; gap: 0; border: 2px dashed var(--pine); border-radius: var(--r); background: var(--pine-soft); overflow: hidden; }
.scan-box.drag { background: var(--sun-soft); border-color: var(--sun); }
.scan { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--pine); cursor: pointer; }
.scan:hover, .scan-paste:hover { background: rgba(31,77,64,.08); }
.scan-paste { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-left: 2px dashed rgba(31,77,64,.35); background: none; color: var(--pine); font-weight: 700; font-size: 0.8rem; line-height: 1.15; text-align: center; padding: 10px 8px; }
.scan-paste svg { width: 26px; height: 26px; }
.scan svg { width: 30px; height: 30px; }
.scan span { display: flex; flex-direction: column; color: var(--ink); }
.scan small { font-weight: 500; color: var(--ink-2); }
.scan:focus-within { outline: 3px solid var(--sun); outline-offset: 2px; }
.rc-prev:empty { display: none; }
.rc-prev img { max-height: 180px; border-radius: var(--r-sm); margin: 0 auto; box-shadow: 0 2px 10px rgba(23,32,28,.14); }
.split-head { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; flex-wrap: wrap; }
.cu-row { display: grid; grid-template-columns: auto 1fr 120px; gap: 10px; align-items: center; padding: 3px 0; font-weight: 600; }
.cu-row input { min-height: 42px !important; text-align: right; }
.shares { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shares li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-weight: 600; }
.rc-full { border: 0; padding: 0; background: none; cursor: zoom-in; }
.rc-full img { border-radius: var(--r-sm); max-height: 60dvh; margin: 0 auto; }

/* ---------- Lists ---------- */
.tab-lists { padding-top: 4px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; }
.add-row select { width: auto; flex: none; max-width: 112px; }
.add-row .btn { flex: none; width: 48px; min-height: 48px; padding: 0; }
.add-row .btn:not([aria-label]) { width: auto; padding: 0 18px; }
.attach { position: relative; display: inline-grid; place-items: center; width: 48px; min-height: 48px; flex: none; border-radius: 50%; color: var(--pine); background: var(--pine-soft); cursor: pointer; }
.attach:hover { background: var(--line); }
.attach input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.attach:focus-within { outline: 3px solid var(--sun); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.it-thumb, .chat-img { border: 0; padding: 0; background: none; border-radius: 10px; overflow: hidden; flex: none; cursor: zoom-in; }
.it-thumb img { width: 48px; height: 48px; object-fit: cover; }
.chat-img { display: block; margin-top: 4px; }
.msgs li.me .chat-img { margin-left: auto; }
.chat-img img { max-width: min(240px, 60vw); max-height: 260px; border-radius: 14px; }
.viewer img, .paste-prev { width: 100%; max-height: 72dvh; object-fit: contain; border-radius: var(--r-sm); background: var(--ink); }
.list-sum { padding: 0 4px; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; background: var(--paper); border-radius: var(--r-sm); min-height: 60px; }
.block .item { background: var(--mist); }
.it-main { flex: 1; min-width: 0; }
.it-main p:first-child { font-weight: 600; overflow-wrap: anywhere; }
.item.claimed .it-main p:first-child { color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(23,32,28,.35); }
.item.claimed .it-main p.small { color: var(--pine); font-weight: 600; }
.tick { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); display: grid; place-items: center; color: transparent; padding: 0; transition: background .15s, border-color .15s; }
.tick svg { width: 18px; height: 18px; stroke-width: 2.6; }
.tick:hover { border-color: var(--pine); }
.tick.on { background: var(--sun); border-color: var(--sun); color: var(--ink); animation: pop .28s ease-out; }
@keyframes pop { 50% { transform: scale(1.18); } }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--pine-soft); color: var(--pine); vertical-align: 2px; text-decoration: none; }
.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; min-height: 48px; flex: none; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-2); padding: 2px 0; }
.vote svg { width: 18px; height: 18px; stroke-width: 2.4; }
.vote b { font: 800 0.95rem/1 var(--head); color: var(--ink); }
.vote.on { background: var(--pine); border-color: var(--pine); color: var(--sun); }
.vote.on b { color: #fff; }

/* ---------- Rides ---------- */
.tab-rides { padding-top: 4px; }
.cars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.car { border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.car-h { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.seats { font-size: 0.8rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--sun-soft); white-space: nowrap; }
.seats.full { background: var(--pine-soft); color: var(--pine); }
.riders { display: flex; flex-wrap: wrap; gap: 6px; }
.rider { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 999px; background: var(--mist); font-weight: 600; font-size: 0.9rem; }
.car .row-actions:empty { display: none; }
.car .row-actions { justify-content: space-between; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); align-self: flex-start; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--pine-soft); color: var(--pine); font: 700 1.4rem/1 var(--head); display: grid; place-items: center; }
@media (hover: hover) { .stepper button:hover { background: var(--pine); color: #fff; } }
.stepper button:active { background: var(--pine); color: #fff; }
.stepper output { min-width: 56px; text-align: center; font: 800 1.6rem/1 var(--head); }
.stepper.sm { padding: 2px; }
.stepper.sm button { width: 34px; height: 34px; font-size: 1.15rem; }
.stepper.sm span { min-width: 64px; text-align: center; font-weight: 700; font-size: 0.9rem; }
.need { padding: 10px 12px; border-radius: var(--r-sm); background: var(--sun-soft); font-size: 0.94rem; }
.msgs { list-style: none; margin: 0; padding: 0 2px; display: flex; flex-direction: column; gap: 10px; max-height: 52dvh; overflow-y: auto; }
.msgs li { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.msgs li > div { min-width: 0; }
.msgs li.me { align-self: flex-end; }
.msgs li.me > div { text-align: right; }
.bubble { display: inline-block; text-align: left; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--mist); overflow-wrap: anywhere; margin-top: 2px; }
.msgs li.me .bubble { background: var(--pine); color: #fff; border-radius: 16px 16px 4px 16px; }

/* ---------- Me ---------- */
.tab-me { padding-top: 4px; }
.me-card { display: flex; align-items: center; gap: 14px; padding: 18px 4px 6px; }
.me-card > div { flex: 1; min-width: 0; }
.me-card h1 { font-size: 1.8rem; overflow-wrap: anywhere; }
.unlock { display: flex; flex-direction: column; gap: 10px; }
.unlock .code-row input { letter-spacing: .3em; }
.me-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  .hero { margin: 16px 0 0; border-radius: 24px; min-height: 460px; padding-top: 16px; }
  .stub { margin: 0 12px -26px; }
  h1 { font-size: 2.2rem; }
}
@media (max-width: 360px) {
  .glance { grid-template-columns: 1fr 1fr; }
  .glance .g-card:last-child { grid-column: span 2; }
  .stub-code { font-size: 1.4rem; }
  .who { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* privacy */
.foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 18px 16px calc(12px + var(--safe-b)); font-size: 0.86rem; color: var(--ink-2); }
.foot a { color: var(--ink-2); }
.foot .link-btn { font-size: 0.86rem; color: var(--ink-2); padding: 4px 2px; }
.landing .foot { margin-top: auto; }
.priv-line { text-align: center; }
.privacy h3 { font-size: 1rem; margin: 16px 0 4px; }
.privacy h3:first-child { margin-top: 4px; }
.privacy p { color: var(--ink); }
/* deleting a trip */
.del-panel { border: 2px solid var(--neg); }
.del-who { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.del-who li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-weight: 600; }
.del-who li > span:last-child { font-size: 0.86rem; }
.bubble.note { background: var(--sun-soft); font-style: italic; }
.msgs li.me .bubble.note { background: var(--sun-soft); color: var(--ink); }

/* split */
.split-modes label > span { min-height: 38px; padding: 0 12px; font-size: 0.88rem; }
.split-preview ul { list-style: none; margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); border: 1.5px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.split-preview li { display: flex; justify-content: space-between; gap: 8px; font-size: 0.92rem; }
.split-preview li b { font-family: var(--head); }
.split-preview p { margin-top: 6px; }
.cu-row .stepper { justify-self: end; }
.pick label > span .av + .av { margin-left: -10px; box-shadow: 0 0 0 2px var(--paper); }
.owed { padding: 10px 12px; border-radius: var(--r-sm); background: var(--sun-soft); }
.owed ul { margin: 6px 0; padding-left: 18px; }

/* families */
.gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchips:empty { display: none; }
.gchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--pine-soft); color: var(--pine); font-weight: 700; font-size: 0.92rem; }
.gchip button { border: 0; background: none; color: var(--pine); font-size: 1.1rem; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.gchip button:hover { background: rgba(31,77,64,.12); }
.fam-nudge { padding: 12px 14px; border-radius: var(--r-sm); background: var(--sun-soft); display: flex; flex-direction: column; gap: 8px; }
.av-row { display: flex; flex: none; }
.av-row .av + .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--paper); }
.people li { gap: 10px; }
.people li > span:last-child { margin-left: 0; }
.fam-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fam-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-weight: 600; }
.claim-h { margin-top: 8px; }
.who-btn.claim { border-style: dashed; }

/* splits shown by family */
.fam-split { list-style: none; margin: 0; padding: 4px 12px; border-radius: var(--r-sm); background: var(--paper); border: 1.5px solid var(--line); }
.fam-split li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.fam-split li + li { border-top: 1px solid var(--line); }
.fs-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fs-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.fs-who small { color: var(--ink-2); font-size: 0.8rem; }
.fs-amt { font: 800 1.05rem var(--head); white-space: nowrap; }
.split-preview .fam-split { display: block; }
.bal > .bal-row { grid-template-columns: auto 1fr auto; grid-template-areas: "av n v" "av s v"; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bal > .bal-row:last-child { border-bottom: 0; }
.bal > .bal-row .av-row { grid-area: av; }

/* notifications */
.push-nudge { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 14px 16px; border-radius: var(--r); background: var(--paper); border: 1.5px solid var(--sun); }
.push-nudge > svg { color: var(--pine); width: 26px; height: 26px; margin-top: 2px; }
.push-nudge .row-actions { grid-column: 2; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.block-head h2 svg { width: 20px; height: 20px; }

/* add to Home Screen */
.howto-os { gap: 0; padding: 3px; border-radius: 999px; background: var(--pine-soft); width: max-content; }
.howto-os button { border: 0; background: transparent; }
.howto { list-style: none; margin: 0 -20px; padding: 2px 20px 6px; scroll-padding: 0 20px; display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; counter-reset: step; }
.howto li { scroll-snap-align: start; counter-increment: step; display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; line-height: 1.3; }
.howto img { width: 100%; height: auto; display: block; }
.howto span::before { content: counter(step); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--sun); color: var(--ink); font: 800 0.75rem var(--head); vertical-align: 1px; }

/* "Trips was updated" */
#update { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 10px); padding: 10px 16px; border: 0; border-radius: 999px; background: var(--pine); color: #fff; font: 600 0.92rem var(--body); box-shadow: 0 6px 20px rgba(23,32,28,.25); white-space: nowrap; }

/* the place to stay */
.stay-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--r); background: var(--pine-soft); color: var(--ink); text-decoration: none; }
.stay-card > svg { width: 26px; height: 26px; color: var(--pine); }
.stay-card > span:not(.ext) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stay-card b { font: 700 1.02rem/1.2 var(--head); overflow-wrap: anywhere; }
.stay-card small { color: var(--ink-2); font-size: 0.84rem; }
.stay-card .ext { font-weight: 700; color: var(--pine); }
.stay-card:hover, .stay-card:focus-visible { box-shadow: inset 0 0 0 1.5px var(--pine); }
.bubble a, .notes a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* reactions */
.bubble[data-msg] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bubble[data-msg]:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.rx-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msgs li.me .rx-row { justify-content: flex-end; }
.rx { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 0.95rem; line-height: 1; color: var(--ink); }
.rx span { font-size: 0.78rem; font-weight: 700; color: var(--ink-2); }
.rx.on { border-color: var(--pine); background: var(--pine-soft); }
.rx.on span { color: var(--pine); }
.rx-pick { display: inline-flex; gap: 2px; margin-top: 6px; padding: 4px; border-radius: 999px; background: var(--paper); box-shadow: 0 4px 16px rgba(23,32,28,.18); }
.rx-pick button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.35rem; line-height: 1; }
.rx-pick button.on { background: var(--pine-soft); }
.rx-add { display: block; font-size: 0.8rem; margin-top: 2px; }
.msgs li.me .rx-add { margin-left: auto; }
.rx-hint { margin: 6px 4px 0; font-size: 0.8rem; color: var(--ink-2); }
/* where a message will go */
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 2px 0; font-size: 0.82rem; color: var(--ink-2); }
.route:empty { display: none; }
.route .chip { min-height: 30px; padding: 3px 10px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; font-size: 0.8rem; color: var(--ink-2); }
.route .chip.on { border: 1px solid var(--pine); background: var(--pine-soft); color: var(--pine); font-weight: 600; }

/* comments on list items, expenses and cars */
.link-btn.cm { display: inline-flex; align-items: center; gap: 4px; font-size: inherit; vertical-align: baseline; }
.link-btn.cm svg { width: 15px; height: 15px; }
.ref { display: block; max-width: 100%; margin: 2px 0 3px; padding: 0; border: 0; background: none; font-size: 0.8rem; color: var(--ink-2); text-align: inherit; overflow-wrap: anywhere; }
.ref b { color: var(--pine); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cm-about { margin: 0; }
.cm-list { max-height: 46dvh; overflow-y: auto; padding: 4px 2px; }
.cm-empty { list-style: none; max-width: none; }

/* reply threads */
.av.xs { width: 20px; height: 20px; font-size: 0.55rem; }
.thread-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 0.82rem; color: var(--ink); }
.thread-link b { color: var(--pine); }
.thread-link .av-row .av + .av { margin-left: -6px; }
.th-reply { display: block; font-size: 0.8rem; margin-top: 2px; }
.msgs li.me .th-reply { margin-left: auto; }
.rx-pick .rx-reply { width: auto; padding: 0 12px; border-radius: 999px; font: 600 0.9rem var(--body); color: var(--pine); background: var(--pine-soft); margin-left: 4px; }
.th-back { align-self: flex-start; }
.th-root { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.th-list { max-height: 40dvh; overflow-y: auto; padding: 2px; }
.th-count { margin: 0; }
.thread-link { display: flex; width: max-content; max-width: 100%; }
.msgs li.me .thread-link { margin-left: auto; }
.sheet .msgs li:not(.me) .bubble:not(.note) { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
