/* Gangplan. Author: Lee Alderman. */

@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans.woff2") format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; }

:root {
  --bg: #f5f1ea;
  --surface: #ffffff;
  --surface-2: #ece6dc;
  --ink: #14242a;
  --muted: #5b6a6f;
  --faint: #8b989c;
  --line: #e2dbcf;
  --accent: #0e5a63;
  --accent-2: #12747f;
  --accent-ink: #ffffff;
  --accent-soft: #dcebea;
  --coral: #e8613c;
  --sun: #f3b23e;
  --good: #1c7a4c;
  --bad: #b83a2a;
  --shadow-1: 0 1px 2px rgba(20, 36, 42, .06), 0 2px 8px rgba(20, 36, 42, .05);
  --shadow-2: 0 2px 6px rgba(20, 36, 42, .07), 0 12px 32px rgba(20, 36, 42, .10);
  --shadow-3: 0 8px 24px rgba(20, 36, 42, .14), 0 28px 64px rgba(20, 36, 42, .18);
  --radius: 18px;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1517;
    --surface: #152024;
    --surface-2: #1d2b30;
    --ink: #e9efee;
    --muted: #9eaeb1;
    --faint: #6f8185;
    --line: #26363b;
    --accent: #4fbcc4;
    --accent-2: #7bd3d9;
    --accent-ink: #052a2e;
    --accent-soft: #15373b;
    --good: #5fc592;
    --bad: #f08a78;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    --shadow-3: 0 8px 24px rgba(0, 0, 0, .4), 0 28px 64px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 var(--body); font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
:focus-visible { outline: 2.5px solid var(--accent-2); outline-offset: 2px; }
.spacer, .grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); font-size: .93rem; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.icon.faint { color: var(--faint); }
.poster { display: block; width: 100%; height: 100%; }

#app { min-height: 100dvh; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; font-weight: 500; }
.boot img { border-radius: 14px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 0% { opacity: 0; transform: translateY(-18px) scale(.6); } 70% { transform: translateY(2px) scale(1.06); } }

/* ---------- avatars ---------- */
.avatar {
  --c: #7b8a8e;
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 80%, #000));
  color: #fff; font-size: .82rem; font-weight: 700; letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
}
.avatar.small { width: 28px; height: 28px; font-size: .66rem; }
.avatar.tiny { width: 20px; height: 20px; font-size: .52rem; }
.avatar.big { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar.more { background: var(--surface-2); color: var(--muted); text-shadow: none; }
.stack { display: inline-flex; }
.stack .avatar { box-shadow: 0 0 0 2px var(--ring, var(--surface)); }
.stack .avatar + .avatar { margin-left: -8px; }
.stack .avatar.tiny + .avatar.tiny { margin-left: -6px; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; display: grid; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); transition: transform .2s var(--ease); }
.me-btn:hover { transform: scale(1.06); }

/* ---------- buttons, chips, pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .95rem; white-space: nowrap; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, filter .2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { padding: 14px 22px; font-size: 1.02rem; border-radius: 14px; }
.btn.danger { color: var(--bad); border-color: transparent; background: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: 7px 12px; font-size: .86rem; border-radius: 10px; }
.btn.wide { width: 100%; padding: 13px; }
.btn.glass, .round-btn.glass, .pill.glass { background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .32); color: #fff; backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4); }
.btn.glass:hover, .round-btn.glass:hover { background: rgba(255, 255, 255, .34); }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 2px 0; text-decoration: none; font-size: .9rem; }
.link-btn:hover { text-decoration: underline; }
.round-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 1rem;
  transition: transform .15s var(--ease), background .2s;
}
.round-btn:hover { background: var(--surface-2); }
.round-btn:active { transform: scale(.92); }
.round-btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.round-btn.quiet:hover { background: var(--surface-2); color: var(--ink); }
.round-btn.small { width: 30px; height: 30px; font-size: .84rem; }
.round-btn.solid { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 13px; border-radius: 999px; font-size: .88rem; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease);
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.chip.person { padding-left: 6px; }
.chip.daychip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--day); }
.chip.daychip.on { background: var(--day); border-color: var(--day); color: #fff; }
.chip.daychip.on::before { background: #fff; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.soon { background: color-mix(in srgb, var(--sun) 22%, var(--surface)); border-color: color-mix(in srgb, var(--sun) 50%, var(--line)); color: color-mix(in srgb, var(--sun) 45%, var(--ink)); }
.pill.now { background: var(--coral); border-color: var(--coral); color: #fff; }
.pill.done { color: var(--good); }
.pill.glass, .pill.glass.soon, .pill.glass.done { background: rgba(10, 22, 28, .46); border-color: rgba(255, 255, 255, .28); color: #fff; }
.pill.glass.now { background: var(--coral); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tag.now { background: var(--coral); color: #fff; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: .88rem; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.banner { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--sun); color: #3a2500; padding: 8px 14px; font-size: .88rem; font-weight: 500; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px 20px; overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 0; }
.field-label, .who legend, .label { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.field-hint { font-size: .85rem; color: var(--muted); }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); min-height: 44px; transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 78px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent-2) 22%, transparent); }
input.amount { font: 600 1.25rem var(--display); }
.row { display: flex; gap: 10px; }
.row.three .field:first-child { flex: 0 0 30%; }
.who { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 11px; min-width: 0; background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.who legend { padding: 0 6px; }
.who .seg { align-self: flex-start; }
.check { display: flex; align-items: center; gap: 10px; font-size: .94rem; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--accent); flex: none; }
.check span { display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.picked { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--accent-soft); font-size: .93rem; color: var(--accent); font-weight: 500; }
.picked span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.place-search { display: flex; flex-direction: column; gap: 6px; }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box input { padding-left: 38px; }
.results { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; }
.results:not(:empty) { border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.result { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 10px 12px; color: var(--faint); }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--accent-soft); }
.result span { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
.result small { font-size: .82rem; color: var(--muted); }
.results-note { padding: 10px 12px; font-size: .88rem; color: var(--muted); }

.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kind-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); }
.kind-tile .kicon { width: 34px; height: 34px; }
.kind-tile:hover { border-color: var(--k); }
.kind-tile.on { border-color: var(--k); background: color-mix(in srgb, var(--k) 10%, var(--surface)); color: var(--ink); transform: translateY(-1px); box-shadow: 0 6px 14px color-mix(in srgb, var(--k) 22%, transparent); }
.cover-pick { position: relative; height: 150px; border-radius: 16px; overflow: hidden; }
.cover-pick .btn { position: absolute; right: 10px; bottom: 10px; }

/* kind colours */
.k-place { --k: #0e8f8f; } .k-food { --k: #e8613c; } .k-activity { --k: #d99411; } .k-flight { --k: #2f8fd0; }
.k-stay { --k: #6b5bd2; } .k-car { --k: #51707a; } .k-train { --k: #1697a6; } .k-note { --k: #9a8667; }
.kicon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; font-size: 1.05rem; color: var(--k); background: color-mix(in srgb, var(--k) 14%, var(--surface)); }

/* ---------- modal ---------- */
.backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 18, 21, .52); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { background: var(--bg); border-radius: 22px; width: min(540px, 100%); max-height: min(92dvh, 880px); display: flex; flex-direction: column; box-shadow: var(--shadow-3); overflow: hidden; animation: modal-in .32s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 12px 20px; flex: none; }
.modal-head h2 { font: 600 1.3rem var(--display); letter-spacing: -.01em; }
.sheet-grab { display: none; }

#toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 24px); z-index: 3000;
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: var(--bg); padding: 11px 18px 11px 14px; border-radius: 999px; font-size: .93rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); width: max-content; max-width: min(92vw, 480px); box-shadow: var(--shadow-3);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); color: #fff; }

/* ---------- home ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 600 1.3rem var(--display); letter-spacing: -.01em; }
.logo img { border-radius: 9px; display: block; }
.home { display: flex; flex-direction: column; min-height: 100dvh; background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 70%), radial-gradient(900px 480px at -5% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%), var(--bg); }
.home-top { display: flex; align-items: center; padding: 18px clamp(16px, 4vw, 44px); padding-top: max(18px, env(safe-area-inset-top)); }
.home-top .me-btn { box-shadow: none; }
.home-main { width: min(1180px, 100%); margin: 0 auto; padding: clamp(18px, 5vw, 56px) clamp(16px, 4vw, 44px) 48px; flex: 1; }
.home-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: clamp(26px, 5vw, 48px); }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }
.home-hero h1 { font: 500 clamp(2.4rem, 7vw, 4.6rem)/1.02 var(--display); letter-spacing: -.035em; font-variation-settings: "SOFT" 60, "WONK" 0; margin-bottom: 8px; }
.home-hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); font-variation-settings: "SOFT" 100, "WONK" 1; }
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; }
.trip-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 4 / 3.3; border-radius: 26px; overflow: hidden;
  text-decoration: none; color: #fff; box-shadow: var(--shadow-2); transition: transform .45s var(--ease), box-shadow .45s var(--ease); isolation: isolate;
}
.trip-card .poster { position: absolute; inset: 0; z-index: -2; transition: transform .9s var(--ease); }
.trip-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-3); }
.trip-card:hover .poster { transform: scale(1.06); }
.scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 18, 24, .28) 0%, rgba(8, 18, 24, 0) 30%, rgba(8, 18, 24, .15) 52%, rgba(8, 18, 24, .82) 100%); pointer-events: none; }
.trip-card > .pill { position: absolute; top: 16px; left: 16px; }
.trip-card-text { padding: 20px 22px; display: flex; flex-direction: column; gap: 3px; }
.where { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .92; display: flex; align-items: center; gap: 6px; }
.trip-card h2 { font: 600 1.75rem/1.1 var(--display); letter-spacing: -.02em; text-shadow: 0 2px 14px rgba(0, 0, 0, .3); }
.trip-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-weight: 500; font-size: .93rem; --ring: rgba(255, 255, 255, .9); }
.empty-art { position: relative; border-radius: 28px; overflow: hidden; min-height: 380px; display: grid; place-items: center; color: #fff; text-align: center; isolation: isolate; box-shadow: var(--shadow-2); }
.empty-art .poster { position: absolute; inset: 0; z-index: -2; }
.empty-art div { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px; }
.empty-art h2 { font: 600 2rem var(--display); letter-spacing: -.02em; }
.empty-art p { max-width: 40ch; opacity: .92; margin-bottom: 6px; }
.home-foot { display: flex; justify-content: center; gap: 14px; padding: 22px; color: var(--faint); font-size: .86rem; }
.home-foot .link-btn { color: var(--muted); font-size: .86rem; }
.home.enter .home-hero > * { animation: rise .7s var(--ease) backwards; }
.home.enter .home-hero > :nth-child(2) { animation-delay: .06s; }
.home.enter .home-hero > :nth-child(3) { animation-delay: .14s; }
.home.enter .trip-card { animation: rise .8s var(--ease) backwards; animation-delay: calc(.16s + var(--i) * .08s); }

.fatal { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 24px; isolation: isolate; }
.fatal > .poster { position: absolute; inset: 0; z-index: -1; }
.fatal-card { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-radius: 28px; padding: 36px 32px 26px; width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--shadow-3); animation: modal-in .5s var(--ease); }
.fatal-card img { border-radius: 16px; box-shadow: var(--shadow-2); }
.fatal-card h1 { font: 600 1.8rem/1.15 var(--display); letter-spacing: -.02em; }
.fatal-card p { color: var(--muted); }
.fatal-card small { color: var(--faint); margin-top: 10px; }

/* ---------- trip layout: a floating panel over a full-bleed map ---------- */
.trip { position: relative; height: 100dvh; overflow: hidden; }
.mapwrap { position: absolute; inset: 0; }
#map { width: 100%; height: 100%; background: var(--surface-2); }
.panel { position: absolute; z-index: 600; top: 14px; left: 14px; bottom: 14px; width: clamp(400px, 38vw, 520px); background: var(--bg); border-radius: 26px; box-shadow: var(--shadow-3); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.mapbar { position: absolute; z-index: 500; top: 18px; left: calc(clamp(400px, 38vw, 520px) + 30px); right: 18px; display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.mapbar::-webkit-scrollbar { display: none; }
.mapbar .chip { box-shadow: var(--shadow-2); flex: none; border-color: transparent; }
.bottomnav { display: none; }

.hero { position: relative; height: 268px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; isolation: isolate; overflow: hidden; }
.hero .poster { position: absolute; inset: 0; z-index: -2; }
.trip.enter .hero .poster { animation: hero-in 1.4s var(--ease); }
@keyframes hero-in { from { transform: scale(1.12); } }
.hero-top { display: flex; align-items: center; gap: 8px; padding: 14px; padding-top: max(14px, env(safe-area-inset-top)); }
.hero-text { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 4px; }
.hero h1 { font: 600 clamp(1.8rem, 3.4vw, 2.3rem)/1.06 var(--display); letter-spacing: -.025em; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); font-variation-settings: "SOFT" 50; overflow-wrap: anywhere; }
.hero-meta { display: flex; align-items: center; margin-top: 8px; --ring: rgba(255, 255, 255, .9); }
.when { font-weight: 600; font-size: .98rem; }
.facts { display: flex; gap: 7px; padding: 14px 16px 2px; overflow-x: auto; scrollbar-width: none; }
.facts::-webkit-scrollbar { display: none; }

.tabs { position: sticky; top: 0; z-index: 30; display: flex; gap: 4px; padding: 10px 12px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 12px 13px; font-weight: 600; font-size: .93rem; color: var(--muted); border-radius: 10px 10px 0 0; transition: color .2s; }
.tabs button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { transform: scaleX(1); }
.tabs button:hover { color: var(--ink); }
.panel-body { padding: 16px 16px 60px; }

/* ---------- plan ---------- */
.plan, .money, .lists, .people { display: flex; flex-direction: column; gap: 16px; }
.plan-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nudge { display: flex; gap: 10px; align-items: center; background: var(--accent-soft); color: var(--accent); padding: 12px 14px; border-radius: 14px; font-size: .92rem; font-weight: 500; }

.day { display: flex; flex-direction: column; }
.day-head { position: sticky; top: 49px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: linear-gradient(var(--bg) 82%, transparent); }
.day-badge { display: grid; place-items: center; align-content: center; width: 48px; height: 52px; border-radius: 15px; border: 0; flex: none; background: var(--day); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--day) 34%, transparent); line-height: 1; transition: transform .2s var(--ease); }
.day-badge:hover { transform: scale(1.06) rotate(-3deg); }
.day-badge small { font-size: .62rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .9; }
.day-badge strong { font: 600 1.4rem/1.05 var(--display); }
.day-badge .icon { font-size: 1.25rem; }
.day.today .day-badge { outline: 3px solid color-mix(in srgb, var(--day) 30%, transparent); outline-offset: 2px; }
.day-title { min-width: 0; flex: 1; }
.day-title h3 { font: 600 1.14rem/1.2 var(--display); letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.day-title p { color: var(--muted); font-size: .83rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); flex: none; }
.weather .icon { color: var(--sun); font-size: 1.05rem; }
.weather strong { color: var(--ink); }
.round-btn.add { background: var(--surface); color: var(--day); border-color: color-mix(in srgb, var(--day) 30%, var(--line)); }
.round-btn.add:hover { background: var(--day); color: #fff; }

.items { position: relative; display: flex; flex-direction: column; min-height: 54px; padding: 2px 0 10px; }
.items::before { content: ""; position: absolute; left: 23px; top: 0; bottom: 14px; width: 2px; border-radius: 2px; background: repeating-linear-gradient(var(--day) 0 5px, transparent 5px 11px); opacity: .45; }
.items:empty::after { content: "Nothing here yet. Tap + to add, or drag something in."; color: var(--faint); font-size: .88rem; padding: 14px 0 14px 60px; }

.item { position: relative; display: grid; grid-template-columns: 48px 1fr; column-gap: 12px; padding: 5px 0; outline: 0; }
.marker {
  justify-self: center; margin-top: 16px; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--bg); padding: 0; z-index: 1;
  background: var(--day); color: #fff; font-size: .78rem; font-weight: 700; display: grid; place-items: center; box-shadow: var(--shadow-1); transition: transform .2s var(--ease);
}
.marker:not(.none):hover { transform: scale(1.18); }
.marker.none { width: 14px; height: 14px; margin-top: 23px; background: var(--bg); border: 3px solid color-mix(in srgb, var(--day) 55%, var(--bg)); cursor: default; }
.card {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); cursor: pointer; min-width: 0;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .2s;
}
.item:hover .card, .item:focus-visible .card { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--k) 45%, var(--line)); }
.item:focus-visible .card { outline: 2.5px solid var(--accent-2); outline-offset: 2px; }
.item.is-some .card { border-style: dashed; border-color: color-mix(in srgb, var(--k) 40%, var(--line)); }
.item.is-private .card { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 60%); }
.item.ghost .card { opacity: .35; }
.item.chosen .card { box-shadow: var(--shadow-3); transform: rotate(-1deg) scale(1.02); }
.card-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.time { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--k); }
.title { font-weight: 650; font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
.meta { font-size: .87rem; color: var(--ink); opacity: .85; }
.addr, .notes { font-size: .85rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notes { white-space: pre-line; font-style: italic; }
.card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }
.conf { display: inline-flex; align-items: center; gap: 4px; font: 600 .78rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.ext { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 600; text-decoration: none; }
.for { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--accent); font-size: .8rem; --ring: var(--surface); }
.grip { color: var(--faint); cursor: grab; padding: 4px 0 4px 2px; margin-right: -6px; user-select: none; touch-action: none; flex: none; opacity: 0; transition: opacity .2s; }
.item:hover .grip, .item:focus-within .grip { opacity: 1; }
@media (hover: none) { .grip { opacity: .7; } }
body.dragging { cursor: grabbing; }

.ticket { display: flex; align-items: center; gap: 10px; margin: 5px 0 2px; }
.ticket strong { font: 600 1.35rem/1 var(--display); letter-spacing: .01em; }
.ticket-line { position: relative; flex: 1 1 40px; max-width: 120px; display: grid; place-items: center; color: var(--k); font-size: .95rem; }
.ticket-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dotted color-mix(in srgb, var(--k) 55%, transparent); }
.ticket-line .icon { position: relative; background: var(--surface); padding: 0 5px; box-sizing: content-box; }
.ticket-no { margin-left: auto; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--k) 13%, var(--surface)); color: var(--k); white-space: nowrap; }

.leg { grid-column: 2; display: flex; align-items: center; gap: 7px; padding: 7px 0 1px 6px; font-size: .8rem; font-weight: 600; color: var(--faint); }
.leg .icon { color: var(--day); }

.trip.enter .day { animation: rise .6s var(--ease) backwards; animation-delay: calc(var(--i) * .06s); }
.trip.enter .card, .trip.enter .total-card, .trip.enter .newlist { animation: rise .55s var(--ease) backwards; }

/* ---------- cards: money, lists, people ---------- */
.card.list, section.card, form.card { display: flex; flex-direction: column; gap: 2px; padding: 16px; cursor: default; }
section.card:hover, form.card:hover { transform: none; }
.card h3 { display: flex; align-items: center; gap: 8px; font: 600 1.08rem var(--display); margin-bottom: 8px; }
.card h3 .icon { color: var(--accent); }
.total-card { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; color: #fff; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(135deg, #0c4b53, #12747f 55%, #1a9aa0); box-shadow: 0 14px 34px rgba(14, 90, 99, .32); }
.total-card::after { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(243, 178, 62, .5), transparent 65%); pointer-events: none; }
.total-card .label { color: rgba(255, 255, 255, .75); }
.total { font: 600 2.6rem/1.05 var(--display); letter-spacing: -.02em; }
.catbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; margin-top: 10px; }
.catbar span { background: var(--c); min-width: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: .8rem; color: rgba(255, 255, 255, .85); margin-top: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.legend b { color: #fff; font-weight: 600; }
.split-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.split-row > div { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; border-radius: 14px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .16); }
.split-row strong { font: 600 1.25rem var(--display); }
.split-row .good { background: rgba(120, 230, 170, .2); }
.split-row .bad { background: rgba(255, 150, 120, .24); }
.line { display: flex; align-items: center; gap: 11px; padding: 11px 0; border: 0; border-top: 1px solid var(--line); text-align: left; background: none; width: 100%; }
.card h3 + .line { border-top: 0; }
.line.tap { border-radius: 12px; transition: background .2s, padding .2s; }
.line.tap:hover { background: var(--surface-2); padding-left: 8px; padding-right: 8px; }
.line .grow { display: flex; flex-direction: column; }
.line small { color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.line > strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }

.list-head { display: flex; align-items: center; gap: 8px; }
.list-head h3 { margin: 0; }
.count { display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.list.complete .count { color: var(--good); }
.progress { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 8px 0 4px; }
.progress span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s var(--ease); }
.list.complete .progress span { background: var(--good); }
.todo { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.todo label { display: flex; align-items: center; gap: 11px; flex: 1 1 auto; padding: 10px 0; min-width: 0; cursor: pointer; }
.todo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; border: 2px solid var(--faint); flex: none; color: transparent; font-size: .8rem; transition: all .25s var(--ease); }
.box .icon { stroke-width: 3.2; }
.todo input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: scale(1.06); }
.todo input:focus-visible + .box { outline: 2.5px solid var(--accent-2); outline-offset: 2px; }
.todo-text { overflow-wrap: anywhere; transition: color .2s; }
.todo.done .todo-text { text-decoration: line-through; color: var(--faint); }
.todo small { color: var(--faint); font-size: .76rem; margin-left: auto; white-space: nowrap; }
.additem { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.newlist { gap: 10px !important; }
.newlist h3 { margin-bottom: 0; }
.newlist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.newlist > .btn { align-self: flex-start; }

.me-head { display: flex; align-items: center; gap: 14px; }
.me-head div { display: flex; flex-direction: column; }
.me-head strong { font: 600 1.25rem var(--display); }
.me-head small { color: var(--muted); }

.about-art { position: relative; height: 170px; isolation: isolate; }
.about-art .poster { position: absolute; inset: 0; z-index: -1; }
.about-mark { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff; }
.about-mark img { border-radius: 15px; box-shadow: var(--shadow-3); }
.about-mark strong { font: 600 1.7rem var(--display); text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.about-body { padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.about-tag { font: italic 400 1.1rem var(--display); color: var(--muted); text-align: center; }
.about dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.about dt { color: var(--muted); font-size: .86rem; font-weight: 600; }
.about dd { font-weight: 600; text-align: right; }
.about h3 { font: 600 1rem var(--display); }
.credits { list-style: none; display: flex; flex-direction: column; font-size: .9rem; }
.credits li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); }
.credits a { font-weight: 600; text-decoration: none; text-align: right; }

/* ---------- map pins and popups ---------- */
.pin-wrap { width: 34px; height: 42px; cursor: pointer; }
.pin {
  --c: #0e7c86; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c)); border: 2.5px solid #fff;
  box-shadow: -3px 5px 10px rgba(0, 0, 0, .34); display: grid; place-items: center; transition: transform .25s var(--ease);
}
.pin span { transform: rotate(45deg); color: #fff; font: 700 13.5px/1 var(--body); display: grid; place-items: center; }
.pin.hot, .pin-wrap:hover .pin { transform: rotate(-45deg) scale(1.3); }
.pin.idea { width: 27px; height: 27px; margin: 9px auto 0; opacity: .94; }
.pin.idea span { font-size: 12px; }
@keyframes pin-drop { 0% { opacity: 0; transform: translateY(-26px) rotate(-45deg) scale(.4); } 65% { opacity: 1; transform: translateY(2px) rotate(-45deg) scale(1.1); } }
#map.drop .pin { animation: pin-drop .6s var(--ease) backwards; animation-delay: var(--d, 0ms); }
.maplibregl-map { font: inherit; }
.maplibregl-popup { z-index: 5; }
.maplibregl-popup-content { border-radius: 20px; box-shadow: var(--shadow-3); background: var(--surface); color: var(--ink); padding: 15px; animation: modal-in .28s var(--ease); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.pop { display: flex; flex-direction: column; gap: 11px; font-size: 14px; min-width: 210px; }
.pop-head { display: flex; gap: 11px; align-items: center; }
.pop-head div { display: flex; flex-direction: column; min-width: 0; }
.pop-head strong { font: 600 1.08rem/1.2 var(--display); }
.pop-head div span { color: var(--muted); font-size: .82rem; }
.pop p { color: var(--muted); font-size: .85rem; }
.pop-actions { display: flex; gap: 8px; }
.pop-actions .btn { flex: 1; }
.maplibregl-ctrl-group { border-radius: 14px !important; overflow: hidden; box-shadow: var(--shadow-2) !important; background: var(--surface) !important; }
.maplibregl-ctrl-group button { width: 38px !important; height: 38px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 14px 12px 0 !important; }
.maplibregl-ctrl-attrib { font-size: 10.5px; border-radius: 10px !important; background: color-mix(in srgb, var(--surface) 82%, transparent) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-group button .maplibregl-ctrl-icon, .maplibregl-ctrl-attrib-button { filter: invert(1) brightness(1.6); }
}

/* ---------- sample trip (read-only) and home extras ---------- */
.btn.leave { align-self: flex-start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.samples { margin-top: clamp(30px, 5vw, 56px); display: flex; flex-direction: column; gap: 14px; }
.sample-note { display: flex; align-items: center; gap: 10px; margin: 14px 16px 0; padding: 10px 12px 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--sun) 20%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sun) 45%, var(--line)); font-size: .9rem; font-weight: 500; }
.sample-note span { flex: 1; }
.sample-note > .icon { color: color-mix(in srgb, var(--sun) 55%, var(--ink)); }
.trip.readonly .card { cursor: pointer; }
button.line:disabled { cursor: default; color: inherit; }
button.line:disabled:hover { background: none; padding-left: 0; padding-right: 0; }
.todo input:disabled + .box { opacity: .75; }
.view-head { display: flex; align-items: center; gap: 12px; }
.view-head h3 { font: 600 1.35rem/1.15 var(--display); letter-spacing: -.01em; }
.view-row { display: flex; gap: 11px; align-items: flex-start; color: var(--ink); }
.view-row .icon { color: var(--k); margin-top: 3px; }
.view-row span { white-space: pre-line; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .trip-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .trip-card.featured { grid-column: span 2; aspect-ratio: auto; min-height: 380px; }
  .trip-card.featured h2 { font-size: 2.5rem; }
  .trip-card.featured .trip-card-text { padding: 28px 30px; }
}

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .trip { display: flex; flex-direction: column; }
  .panel { position: static; width: auto; flex: 1 1 auto; min-height: 0; border-radius: 0; box-shadow: none; }
  .mapwrap { position: relative; inset: auto; flex: 1 1 auto; min-height: 0; }
  .trip[data-tab="map"] .panel { display: none; }
  .trip:not([data-tab="map"]) .mapwrap { display: none; }
  .mapbar { left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); }
  .tabs { display: none; }
  .day-head { top: 0; }
  .hero { height: 250px; }
  .panel-body { padding-bottom: 110px; }
  .bottomnav {
    position: fixed; z-index: 900; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; gap: 2px; padding: 6px; border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    box-shadow: var(--shadow-3); border: 1px solid var(--line);
  }
  .bottomnav button { border: 0; background: none; padding: 9px 13px; border-radius: 999px; display: flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 700; color: var(--muted); transition: background .3s var(--ease), color .2s; }
  .bottomnav button .icon { font-size: 1.2rem; }
  .bottomnav button span { display: none; }
  .bottomnav button.on { background: var(--ink); color: var(--bg); }
  .bottomnav button.on span { display: inline; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .maplibregl-ctrl-bottom-right { bottom: 74px; }
  .backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 94dvh; border-radius: 26px 26px 0 0; animation: sheet-in .38s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  .sheet-grab { display: block; position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 40px; height: 4.5px; border-radius: 3px; background: var(--line); }
  .modal-head { padding-top: 20px; }
  .form { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .trip-card { aspect-ratio: 4 / 3; }
}
@media (max-width: 420px) {
  .row.three { flex-wrap: wrap; }
  .row.three .field:first-child { flex: 1 1 100%; }
  .kinds { gap: 6px; }
  .total { font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
