/* Paris trip — dusk-gradient backdrop, frosted cards, metro-line days. */
:root {
  --base: #F5F2FB;
  --g1: rgba(255, 158, 128, .55);   /* sunset peach */
  --g2: rgba(140, 120, 255, .42);   /* dusk violet */
  --g3: rgba(90, 190, 220, .30);    /* Seine teal */
  --glass: rgba(255, 255, 255, .64);
  --glass-strong: rgba(255, 255, 255, .9);
  --edge: rgba(255, 255, 255, .8);
  --line: rgba(30, 26, 60, .10);
  --ink: #17142B;
  --muted: #5E5878;
  --accent: #5B3DF5;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(91, 61, 245, .12);
  --ok: #128A5B;
  --ok-soft: rgba(18, 138, 91, .12);
  --warn-bg: rgba(255, 214, 170, .65);
  --warn-ink: #7A3B00;
  --danger: #C9302C;
  --shadow: 0 10px 30px -12px rgba(40, 20, 90, .25);
  --radius: 20px;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --day: #5B3DF5;
  --day-ink: #FFFFFF;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --base: #0A0B1A;
    --g1: rgba(255, 110, 80, .20);
    --g2: rgba(120, 90, 255, .30);
    --g3: rgba(0, 150, 190, .20);
    --glass: rgba(26, 26, 52, .58);
    --glass-strong: rgba(32, 32, 62, .94);
    --edge: rgba(255, 255, 255, .08);
    --line: rgba(255, 255, 255, .09);
    --ink: #EEEBFA;
    --muted: #A6A1C3;
    --accent: #A897FF;
    --accent-ink: #0F0C24;
    --accent-soft: rgba(168, 151, 255, .16);
    --ok: #4FD39B;
    --ok-soft: rgba(79, 211, 155, .14);
    --warn-bg: rgba(130, 70, 10, .45);
    --warn-ink: #FFD3A8;
    --danger: #FF7A75;
    --shadow: 0 12px 34px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--base); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
#bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 40% at 12% 0%, var(--g1), transparent 70%),
    radial-gradient(50% 45% at 95% 15%, var(--g2), transparent 70%),
    radial-gradient(70% 50% at 40% 105%, var(--g3), transparent 70%),
    var(--base);
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
img { max-width: 100%; display: block; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.app {
  max-width: 720px; margin: 0 auto; outline: none;
  padding-inline: 16px;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(110px + env(safe-area-inset-bottom, 0px));
}
.boot { padding-block: 40vh; text-align: center; color: var(--muted); }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.top h1 { font-size: 30px; font-weight: 800; line-height: 1.05; flex: 1; min-width: 0; }
.top .eyebrow { display: block; font-family: var(--body); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 15px; color: #fff; border: 2px solid var(--edge);
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; border-width: 1.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
button.avatar { cursor: pointer; padding: 0; }

/* ---------- glass surfaces ---------- */
.card {
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow);
}
.pad { padding: 16px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { font-size: 20px; font-weight: 750; margin: 22px 0 10px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--glass-strong); color: var(--ink);
  border-radius: 14px; padding: 10px 16px; font-weight: 650; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 42px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { appearance: none; border: 0; background: none; padding: 6px; border-radius: 10px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }

label.field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--glass-strong); border-radius: 12px;
  padding: 10px 12px; font-size: 16px; color: var(--ink); min-height: 44px;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--accent-soft); }
.seg button { border: 0; background: none; border-radius: 10px; padding: 8px 6px; font-weight: 650; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); }
.err { color: var(--danger); font-size: 14px; font-weight: 600; }

/* ---------- chips & tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; border-radius: 999px; padding: 3px 10px; background: var(--accent-soft); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.book { background: var(--accent); color: var(--accent-ink); }
.chip.free { background: transparent; color: var(--ok); border: 1px solid currentColor; padding: 2px 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- plan ---------- */
.hero { padding: 18px 18px 16px; display: grid; gap: 10px; }
.hero .count { font-size: 15px; }
.hero .count b { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.alert { background: var(--warn-bg); color: var(--warn-ink); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); gap: 4px; margin: 16px -4px 6px; padding: 0 4px 4px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.dbtn { display: grid; justify-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 16px; border: 1px solid transparent; background: none; cursor: pointer; }
.dbtn[aria-current="true"] { background: var(--glass-strong); border-color: var(--edge); box-shadow: var(--shadow); }
.badge { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 15px; }
.badge.sq { border-radius: 9px; }
.dbtn .wd { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.dbtn .dd { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.dbtn .today { font-size: 9.5px; color: var(--ok); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }

.dhead { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0 6px; }
.dhead .badge { width: 46px; height: 46px; font-size: 19px; flex: none; }
.dhead h2 { font-size: 27px; font-weight: 800; line-height: 1.08; }
.dhead p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.dhead > div { min-width: 0; }

.line { list-style: none; margin: 14px 0 0; padding: 0; }
.stop { display: grid; grid-template-columns: 50px 24px minmax(0, 1fr); column-gap: 8px; }
.stop .time { font-family: var(--mono); font-weight: 600; font-size: 13.5px; padding-top: 14px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail { position: relative; display: flex; justify-content: center; }
.rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; background: var(--day); left: 50%; transform: translateX(-50%); }
.stop:first-child .rail::before { top: 18px; }
.stop:last-child .rail::before { bottom: calc(100% - 24px); }
.dot { position: relative; margin-top: 14px; width: 18px; height: 18px; border-radius: 50%; background: var(--base); border: 4px solid var(--day); z-index: 1; }
.stop.key .dot { width: 22px; height: 22px; margin-top: 12px; border-width: 5px; box-shadow: 0 0 0 3px var(--base), 0 0 0 5px var(--day); }
.stop .card { padding: 12px 14px; margin-bottom: 10px; }
.stop h3 { font-family: var(--body); font-size: 16px; font-weight: 700; line-height: 1.3; }
.stop p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.stop .chips { margin-top: 9px; }
.maplink { font-size: 12.5px; font-weight: 650; text-decoration: none; }
.vis { margin-left: auto; border: 1px solid var(--line); background: var(--glass-strong); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 650; cursor: pointer; color: var(--muted); }
.vis[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.stop.done h3 { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.stop.done .dot { background: var(--day); }
.stop.now .card { outline: 2px solid var(--day); }
.nowlbl { display: inline-block; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); margin-bottom: 2px; }

.today { gap: 12px; }
.eyebrow-sm { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); }
.today-title { font-size: 24px; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.day-tools { margin: 10px 0 4px 60px; gap: 8px; }
@media (max-width: 420px) { .day-tools { margin-left: 0; } }
.chip.weather { background: var(--glass-strong); border: 1px solid var(--edge); gap: 5px; white-space: normal; }

/* ---------- info ---------- */
.kv { display: grid; }
.kv > div { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.kv > div:first-child { border-top: 0; }
.kv dt { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; font-size: 14.5px; }
.kv-note { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; line-height: 1.45; }
.app-link { margin-top: 18px; color: inherit; text-decoration: none; }
.phr { display: grid; gap: 8px; }
.ph { padding: 11px 14px; display: grid; gap: 1px; text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; }
.ph .fr { font-weight: 700; }
.ph .pr { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.ph .ua { font-size: 13.5px; color: var(--muted); }

/* ---------- lists ---------- */
.list { display: grid; }
.list > .item { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.list > .item:first-child { border-top: 0; }
.item h3 { font-family: var(--body); font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.item .meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.item .meta b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.item.done h3 { text-decoration: line-through; color: var(--muted); }
.prio { font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--warn-ink); }
.tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--glass-strong); cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.tick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.tick[aria-pressed="true"]::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.progress { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); transition: width .3s; }

/* ---------- photos ---------- */
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 12px; padding-inline: 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1px solid var(--edge); background: var(--glass); border-radius: 999px; padding: 6px 13px; font-weight: 650; font-size: 13.5px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--base); border-color: var(--ink); }
.filters .dotc { width: 9px; height: 9px; border-radius: 50%; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: 16px; overflow: hidden; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid button { border: 0; padding: 0; aspect-ratio: 1; background: var(--accent-soft); cursor: pointer; position: relative; max-width: 100%; }
.grid img { width: 100%; height: 100%; object-fit: cover; }
.grid .who { position: absolute; left: 5px; bottom: 5px; }
.uploader { display: grid; gap: 8px; }
.usage { font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; margin-top: 16px; }

.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(5, 5, 15, .94); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; }
.lightbox .lb-top, .lightbox .lb-bottom { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; display: flex; align-items: center; gap: 10px; }
.lightbox .lb-bottom { padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.lightbox .lb-img { display: grid; place-items: center; min-height: 0; position: relative; touch-action: pan-y; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox .icon-btn { color: #fff; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border-radius: 50%; width: 42px; height: 42px; }
.lightbox .nav.prev { left: 8px; } .lightbox .nav.next { right: 8px; }
.lightbox .btn { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.lightbox .btn.danger { color: #ff9b97; }

.vote { display: grid; justify-items: center; gap: 1px; border: 1px solid var(--line); background: var(--glass-strong); border-radius: 12px; padding: 6px 8px; min-width: 46px; cursor: pointer; color: var(--muted); }
.vote.on { color: #E0245E; border-color: currentColor; background: rgba(224, 36, 94, .08); }
.vote.on svg { fill: currentColor; }
.vote b { font-size: 13px; color: var(--ink); }

/* documents: always white so QR codes scan */
.docview { position: fixed; inset: 0; z-index: 30; background: #FFFFFF; color: #111; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.docview-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 6px; font-size: 17px; }
.docview-top .icon-btn { color: #111; }
.docview-pages { overflow-y: auto; display: grid; gap: 12px; align-content: start; padding: 0 12px 12px; }
.docview-pages img { width: 100%; height: auto; border: 1px solid #e5e5e5; border-radius: 8px; }
.docview-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #eee; }
.docview-actions .btn { background: #f3f3f6; color: #111; border-color: #e3e3ea; }
.docview-actions .btn.danger { color: #C9302C; }

/* ---------- money ---------- */
.summary { padding: 16px; display: grid; gap: 12px; }
.total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.total b { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.fx { font-size: 12.5px; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bal { display: grid; gap: 8px; }
.bal .who-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bal .net { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.net.pos { color: var(--ok); } .net.neg { color: var(--danger); }
.settle { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.settle .s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.exp { grid-template-columns: auto minmax(0, 1fr) auto !important; cursor: pointer; }
.exp .amt { text-align: right; }
.exp .amt b { font-family: var(--mono); font-weight: 600; font-size: 15px; white-space: nowrap; }
.cat { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); font-size: 18px; }
.dategroup { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 18px 4px 8px; }
.fab { position: fixed; right: max(16px, calc(50vw - 344px)); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 6; border-radius: 18px; box-shadow: var(--shadow); padding-inline: 18px; }
.share-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 110px; gap: 10px; align-items: center; }
.share-row .input { text-align: right; }
.split-sum { font-size: 13px; font-weight: 600; }

/* ---------- sheet (modal) ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(10, 8, 30, .45); display: grid; align-items: end; justify-items: center; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow);
}
@media (min-width: 680px) { .sheet-back { align-items: center; } .sheet { border-radius: 24px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h2 { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.sheet form { display: grid; gap: 14px; }

/* ---------- places & confirm ---------- */
.place { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 9px; }
.place-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: 14px; text-decoration: none; min-width: 0; }
.place-name svg { width: 16px; height: 16px; flex: none; }
.place-modes { display: inline-flex; gap: 6px; }
.mode { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; text-decoration: none; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.mode svg { width: 14px; height: 14px; }
.confirm-back { align-items: center; padding: 16px; z-index: 50; }
.sheet.confirm { max-width: 400px; border-radius: 22px; padding: 20px; }
.btn.danger-solid { background: var(--danger); color: #fff; border-color: transparent; }
.chip.private { background: var(--ink); color: var(--base); }
.stop.private .card { border-style: dashed; }
.stop.private .dot { border-color: var(--muted); }

/* ---------- auth ---------- */
.auth { min-height: 70vh; display: grid; align-content: center; gap: 18px; max-width: 420px; margin: 0 auto; }
.auth .brand { text-align: center; display: grid; gap: 6px; justify-items: center; }
.auth .brand h1 { font-size: 46px; font-weight: 800; letter-spacing: -.03em; }
.auth form { display: grid; gap: 14px; padding: 20px; }

/* ---------- admin ---------- */
.admin-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.copybox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copybox .input { font-family: var(--mono); font-size: 13px; }

/* ---------- tabs ---------- */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 10;
  width: min(560px, calc(100% - 24px)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 6px;
  background: var(--glass-strong); border: 1px solid var(--edge); border-radius: 22px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.tabs a { display: grid; justify-items: center; gap: 2px; padding: 7px 4px; border-radius: 16px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 650; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 60;
  background: var(--ink); color: var(--base); padding: 10px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: var(--shadow);
}

.offline {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; margin: 0 auto; max-width: 720px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; font-weight: 650; text-align: center;
  padding: 7px 16px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* Tickets: "До Парижа" / "В Парижі". */
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }

.chip svg { width: 14px; height: 14px; }
.chip.owner { background: var(--glass-strong); border: 1px solid var(--edge); }
a.chip { text-decoration: none; color: var(--ink); }
.ticket-docs { gap: 6px; margin-top: 8px; }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 5px 10px; font: 650 13px/1.25 var(--body); cursor: pointer; text-align: left; }
.doc-chip svg { width: 16px; height: 16px; flex: none; }
.doc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tick:disabled { opacity: .55; cursor: default; }

/* Change log. */
.item.log { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; }
.log-text { font-size: 14.5px; overflow-wrap: anywhere; }

/* Discussion of an idea. */
.chat { display: grid; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; overscroll-behavior: contain; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.bubble { background: var(--glass); border: 1px solid var(--edge); border-radius: 16px 16px 16px 6px; padding: 8px 12px; min-width: 0; box-shadow: var(--shadow); }
.msg.mine .bubble { background: var(--accent-soft); border-radius: 16px 16px 6px 16px; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.msg-head b { color: var(--ink); font-size: 12.5px; }
.msg-del { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; display: inline-grid; margin-left: auto; }
.msg-del svg { width: 14px; height: 14px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; margin-top: 2px; }
.chat-form { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.field .hint { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }

/* Time zone label under a stop time (road days in Kyiv / Warsaw time). */
.tzlbl { display: block; font-size: 10px; font-weight: 650; line-height: 1.2; color: var(--muted); letter-spacing: .02em; }

/* Expense amount + currency side by side. */
.amount-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 6px; }

/* Day map. Leaflet's own z-indexes stay inside the card (isolation). */
.daymap { position: relative; padding: 8px; margin: 10px 0 4px; }
.map-canvas { height: 280px; border-radius: calc(var(--radius) - 8px); overflow: hidden; isolation: isolate; z-index: 0; background: var(--accent-soft); }
.map-status { padding: 8px 6px 2px; }
.map-me { position: absolute; right: 18px; top: 18px; z-index: 2; background: var(--glass-strong); box-shadow: var(--shadow); }
.map-pin { background: none; border: 0; }
.map-pin span {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font: 750 13px/1 var(--body); border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}
.map-pop { font-family: var(--body); font-size: 13.5px; min-width: 160px; }
.map-pop .mode { color: var(--accent); }
.leaflet-container a.mode { color: #5B3DF5; }
@media (prefers-color-scheme: dark) { .map-canvas .leaflet-tile-pane { filter: brightness(.82) contrast(1.05) saturate(.85); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
