:root {
  --bg: #f6f3ec; --card: #fffdf8; --ink: #1d2b27; --muted: #66736e; --line: #e3ddcf;
  --accent: #1f3a34; --accent-ink: #fff; --warm: #b4532a; --ok: #2f7d4f; --bad: #b3261e;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14201d; --card: #1c2b27; --ink: #eae6da; --muted: #9baba5; --line: #2d3f3a;
          --accent: #e8d9b0; --accent-ink: #14201d; --warm: #e08a5c; --ok: #6fcf97; --bad: #f2837a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 1.5rem; margin: 8px 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0; }
.big { font-size: 2.6rem; font-weight: 700; line-height: 1.1; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.stack > * + * { margin-top: 8px; }
.tag { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); }
.warn { color: var(--warm); font-weight: 600; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
label { display: block; font-size: .9rem; margin: 10px 0 4px; }
input, select { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); padding: 10px 14px; min-height: 44px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; min-height: 0; padding: 4px; }
.opt { display: block; width: 100%; text-align: right; margin-top: 8px; }
.opt.picked { border: 2px solid var(--ok); }
.opt small { display: block; color: var(--muted); }
.err { color: var(--bad); min-height: 1.4em; margin-top: 8px; }
#tabs { position: fixed; bottom: 0; inset-inline: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs[hidden] { display: none; }
#tabs button { flex: 1; border: 0; border-radius: 0; background: none; font-size: .8rem; padding: 10px 2px; }
#tabs button[aria-current="page"] { color: var(--warm); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; }
.done { text-decoration: line-through; color: var(--muted); }
.time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.2em; }

/* ---- version 2 additions ---- */
.narrow { max-width: 420px; margin: 8vh auto 0; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); resize: vertical; }
button:disabled { opacity: .55; cursor: default; }
button.danger { color: var(--bad); border-color: var(--bad); }
.empty { text-align: center; padding: 34px 16px; }
.big-text { font-size: 1.25rem; margin: 0 0 6px; }
.item { padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item p { margin: 4px 0 0; }
.item .tag { margin-inline-end: 8px; }
.tag.gold { border-color: var(--warm); color: var(--warm); }
.tag.okc { border-color: var(--ok); color: var(--ok); }
.tag.badc { border-color: var(--bad); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions button { min-height: 40px; padding: 8px 12px; font-size: .92rem; }
.seg { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 70px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.code { border: 2px dashed var(--warm); }
.code code { font-size: 1.35rem; letter-spacing: .04em; user-select: all; word-break: break-all; }
.stage.locked { opacity: .92; }
.stage .row input { font-weight: 700; }
.preview { border: 2px dashed var(--line); border-radius: var(--radius); padding: 0 14px 14px; margin: 12px 0; }
.banner { background: var(--warm); color: #fff; margin: 0 -14px 10px; padding: 6px 14px; font-size: .88rem;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat span { color: var(--muted); font-size: .8rem; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; }
th, td { padding: 5px 8px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 8px; }
.tile { padding: 0; border: 0; background: var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 1; min-height: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .close { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-start: 12px; background: rgba(255,255,255,.15);
  color: #fff; border: 0; border-radius: 999px; width: 44px; }
@media (min-width: 900px) { main { max-width: 760px; } main.wide { max-width: 1240px; } }

/* ---- entrance page: photo background ---- */
.landing { position: fixed; inset: 0; z-index: 5; background: #111; color: #fff7df; overflow: auto; }
.lp-bg, .lp-shade { position: fixed; inset: 0; }
.lp-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  opacity: 0; transition: opacity 1800ms ease; transform: scale(1.02); }
.lp-bg img.on { opacity: 1; animation: lpdrift 14s ease-out forwards; }
@keyframes lpdrift { to { transform: scale(1.12); } }
.lp-shade { background: radial-gradient(ellipse at center, rgba(0,0,0,.4) 0%, rgba(0,0,0,.78) 100%); }
.lp-tape { position: fixed; inset-inline: -4vw; height: 30px; z-index: 3;
  background: repeating-linear-gradient(-45deg, #f5c400 0 22px, #111 22px 44px); box-shadow: 0 4px 18px rgba(0,0,0,.55); }
.lp-top { top: 20px; transform: rotate(-1.4deg); }
.lp-bottom { bottom: 20px; transform: rotate(1.1deg); }
.lp-center { position: relative; z-index: 2; min-height: 100%; display: grid; place-items: center; padding: 80px 16px; }
.lp-card { width: min(100%, 410px); background: rgba(14,14,14,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 2px solid #f5c400; border-radius: 14px; padding: 24px 24px 20px; box-shadow: 0 0 0 6px rgba(17,17,17,.6), 0 28px 80px rgba(0,0,0,.65); }
.lp-head { text-align: center; margin-bottom: 6px; }
.lp-kicker { display: block; font-size: .78rem; letter-spacing: .22em; color: #f5c400; font-weight: 800; }
.lp-card h1 { margin: 2px 0 0; font-size: 2.4rem; line-height: 1.1; font-weight: 900; text-shadow: 0 3px 0 #000; }
.lp-card h2 { font-size: 1.05rem; margin: 0 0 4px; text-align: center; color: #fff7df; font-weight: 600; }
.fld { display: block; margin-top: 14px; }
.fld-label { display: block; font-size: .85rem; color: #e9dfc2; margin-bottom: 6px; }
.fld-box { display: flex; align-items: center; background: rgba(255,255,255,.96); border: 2px solid transparent; border-radius: 12px;
  transition: border-color .15s, box-shadow .15s; }
.fld-box:focus-within { border-color: #f5c400; box-shadow: 0 0 0 4px rgba(245,196,0,.28); }
.fld-ico { display: grid; place-items: center; width: 46px; color: #6b6b6b; flex: none; }
.lp-card .fld-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: #111; padding: 13px 4px 13px 10px;
  font-size: 1rem; outline: none; border-radius: 12px; }
.lp-card .fld-box input::placeholder { color: #9a9a9a; }
.fld-eye { border: 0; background: none; color: #6b6b6b; width: 46px; min-height: 46px; display: grid; place-items: center; padding: 0; border-radius: 12px; }
.fld-eye:hover { color: #111; }
.lp-card .muted { color: #d9cfae; font-size: .82rem; margin: 10px 0 0; }
.lp-card .err { color: #ff9a8f; min-height: 1.3em; margin: 10px 0 0; font-size: .9rem; }
.lp-submit { width: 100%; margin-top: 8px; min-height: 50px; border: 0; border-radius: 12px; background: #f5c400; color: #111;
  font-size: 1.08rem; font-weight: 800; letter-spacing: .02em; box-shadow: 0 4px 0 #a98b00; transition: transform .08s, box-shadow .08s; }
.lp-submit:hover { filter: brightness(1.05); }
.lp-submit:active { transform: translateY(3px); box-shadow: 0 1px 0 #a98b00; }
.lp-submit:disabled { opacity: .6; }
.lp-switch { text-align: center; margin: 12px 0 0; }
.lp-card button.link { color: #e8dcc0; }
.lp-forgot { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(245,196,0,.45); text-align: center; }
.lp-forgot p { margin: 0; font-weight: 600; }
.lp-forgot .muted { font-weight: 400; margin: 2px 0 10px; }
.lp-wa { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: #1fa855; color: #fff;
  font-weight: 700; text-decoration: none; font-size: .92rem; }
.lp-wa:hover { background: #25c063; }
@media (max-width: 420px) { .lp-tape { height: 24px; } .lp-top { top: 12px; } .lp-bottom { bottom: 12px; } }

/* ---- user control table ---- */
.utable { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); margin-top: 8px; }
.urow { display: grid; grid-template-columns: 1.1fr 1.5fr 1.3fr 1.1fr auto; gap: 8px 12px; padding: 12px 14px; align-items: center;
  border-top: 1px solid var(--line); }
.urow.uhead { background: rgba(0,0,0,.05); font-size: .8rem; color: var(--muted); border-top: 0; font-weight: 700; }
.urow.open { background: rgba(245,196,0,.07); }
.ucell code { font-size: .9rem; }
.small { font-size: .8rem; }
.upanel { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 12px; }
.upanel h3 { margin: 16px 0 4px; font-size: .95rem; }
.ugrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 12px; }
.tempbox { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tempbox input { flex: 1; min-width: 180px; }
@media (max-width: 760px) {
  .uhead { display: none; }
  .urow { grid-template-columns: 1fr 1fr; }
  .ucell::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); }
  .ucell[data-label=""]::before { display: none; }
}
.lp-note { background: rgba(245,196,0,.14); border: 1px solid rgba(245,196,0,.5); border-radius: 10px; padding: 8px 12px;
  font-size: .88rem; margin: 10px 0 0; }

/* ---- personal area: running photo background (only while signed in) ---- */
#pbg { position: fixed; inset: 0; z-index: 0; background: #14201d; }
#pbg .pslide { position: absolute; inset: 0; opacity: 0; transition: opacity 1800ms ease; }
#pbg .pslide.on { opacity: 1; }
#pbg .pslide img { position: absolute; inset: 0; width: 100%; height: 100%; }
#pbg .fill { object-fit: cover; filter: blur(26px) brightness(.5); transform: scale(1.15); }
#pbg .fit { object-fit: contain; object-position: 50% 50%; }
.pbg-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(8,12,11,.05), rgba(8,12,11,.18)); }
body.personal main { position: relative; z-index: 1; padding-top: 12px; }
body.personal #tabs { z-index: 3; }
.p-hero { height: 30vh; min-height: 150px; display: flex; align-items: flex-end; padding: 0 4px 10px; }
.p-hero h1 { color: #fff; margin: 0; font-size: 2.1rem; text-shadow: 0 2px 16px rgba(0,0,0,.75); }
.sheet { background: color-mix(in srgb, var(--bg) 93%, transparent); border-radius: 18px; padding: 6px 14px 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
body.personal .sheet > h1:first-child { margin-top: 10px; }
body.personal main > .sheet { margin-top: 14vh; }
body.personal main > .bare { margin-top: 0; }

/* ---- budget ---- */
.rate { font-size: 1.7rem; margin: 2px 0; }
.small { font-size: .8rem; }
.warn-tag { border-color: var(--warm); color: var(--warm); }
.convert { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; margin-top: 10px; }
.cv span { display: block; font-size: .85rem; margin-bottom: 4px; }
.cv-eq { padding-bottom: 12px; color: var(--muted); font-size: 1.2rem; }
.meter-text { margin: 2px 0 8px; font-size: 1.15rem; }
.meter { height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--ok); width: 0; transition: width .6s ease; }
.meter.warn .meter-fill { background: #e0a21b; }
.meter.over .meter-fill { background: var(--bad); }
.editbudget { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.editbudget[hidden] { display: none; }
.bal { display: grid; grid-template-columns: 6.5em 1fr auto; gap: 10px; align-items: center; margin: 8px 0; }
.bal-name { display: flex; gap: 6px; align-items: center; }
.bal-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; display: block; }
.bal-bar i { display: block; height: 100%; border-radius: 999px; }
.bal-bar .pos { background: var(--ok); } .bal-bar .neg { background: var(--bad); }
.settle { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.exp { padding: 10px 0; border-top: 1px solid var(--line); }
.exp.pay { background: rgba(47,125,79,.06); margin: 0 -14px; padding: 10px 14px; }
.danger-link { color: var(--bad); }
button.add { width: 100%; margin-top: 12px; }
.newexp { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.newexp[hidden] { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who { margin: 8px 0; }
.who-row { align-items: center; }
.who-name { flex: 1; }
.exact-in { width: 7.5em; padding: 6px 8px; }
.exact-in[hidden] { display: none; }
.check input.exact-in { width: 7.5em; height: 40px; margin: 0; flex: none; padding: 6px 8px; }
.who-row input[type=checkbox], .check input[type=radio] { accent-color: var(--accent); }
.banner-closed { border: 2px solid var(--warm); }
.filters { margin: 8px 0; }
.cat { display: grid; grid-template-columns: 6.5em 1fr auto; gap: 10px; align-items: center; margin: 6px 0; }
.small-actions { margin-top: 4px; }
.small-actions button { min-height: 0; padding: 2px 6px; }
.link-a { color: var(--muted); }
.fold { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.fold summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.act { padding: 5px 0; border-top: 1px solid var(--line); }
.settle-amt { margin-inline-start: auto; margin-inline-end: 8px; }
.newexp .fld-label { margin: 10px 0 2px; font-size: .9rem; }
.lp-seg { margin-top: 4px; }
.lp-seg button { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.lp-seg button.on { background: #f5c400; color: #111; border-color: #f5c400; font-weight: 800; }
.preview-text { white-space: pre-wrap; background: rgba(0,0,0,.05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; margin: 8px 0; }

/* ---- trip management ---- */
.titem { display: grid; grid-template-columns: 4.2em 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.titem:first-of-type { border-top: 0; }
.titem.skip { opacity: .5; }
.ttime { font-variant-numeric: tabular-nums; font-weight: 800; }
.ttime small { display: block; font-weight: 400; color: var(--muted); }
.tmeta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.on-btn { background: var(--ok); color: #fff; border-color: var(--ok); }
.off-btn { background: var(--bad); color: #fff; border-color: var(--bad); }
.chips.daychips { margin: 8px 0 12px; }
.chipbtn { min-height: 0; padding: 6px 12px; border-radius: 999px; font-size: .88rem; }
.chipbtn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chipbtn.is-today { border-color: var(--warm); }
.tripmap { height: 380px; border-radius: 12px; overflow: hidden; margin: 8px 0; background: var(--line); }
.pinwrap { background: none; border: 0; }
.pin-num { border-radius: 50%; color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pin-dot { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.pop { min-width: 140px; direction: rtl; }
.hero-today { border: 2px solid var(--warm); }
.wx { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; text-align: center; }
.wxday { border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.wxicon { font-size: 1.6rem; }
.pack { margin: 4px 0 0; padding-inline-start: 1.2em; line-height: 1.6; }
.btn-a { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--card); }

/* ---- wallet ---- */
.big-count { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.leg { border-top: 1px solid var(--line); padding: 10px 0; }
.leg:first-of-type { border-top: 0; }
.route { display: flex; gap: 12px; align-items: center; font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; margin: 4px 0; }
.route .arrow { color: var(--warm); }
.body-text { white-space: pre-wrap; }

/* ---- home centrepiece: countdown and the hint button ---- */
.home-center { display: grid; justify-items: center; gap: 14px; text-align: center; color: #fff; margin: 0 auto; padding: 8px 0 18px; }
.cd-title { margin: 0; font-size: clamp(16px, 4vw, 22px); font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.cd { display: flex; flex-direction: row; gap: clamp(8px, 2.4vw, 16px); direction: rtl; }
.cd-cell { display: grid; justify-items: center; min-width: clamp(58px, 17vw, 96px); padding: 10px 6px; border-radius: 16px;
  background: rgba(10,14,13,.62); border: 1px solid rgba(246,241,225,.35); backdrop-filter: blur(6px); }
.cd-num { font-size: clamp(28px, 8.5vw, 52px); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; direction: ltr; }
.cd-lab { font-size: clamp(11px, 3vw, 14px); opacity: .85; }
.hint-btn { max-width: calc(100vw - 32px); text-align: center; background: rgba(10,14,13,.62); color: #f6f1e1; border: 1px solid rgba(246,241,225,.55);
  border-radius: 999px; padding: 14px 26px; font: inherit; font-size: clamp(17px, 4.6vw, 24px); font-weight: 700; cursor: pointer;
  backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.hint-btn:hover, .hint-btn:focus-visible { background: rgba(246,241,225,.92); color: #14201d; }
.quiet { min-height: 70vh; display: grid; align-content: center; }
.prank { position: fixed; inset: 0; z-index: 50; background: #000; display: grid; place-items: center; }
.prank-card { width: 100%; height: 100%; display: grid; place-items: center; grid-template-rows: 1fr auto; padding: 0; background: transparent; text-align: center; }
.prank-card video, .prank-card img { width: 100vw; height: 100%; max-height: 100vh; object-fit: contain; display: block; margin: 0; background: #000; }
.prank-card p { position: fixed; bottom: 64px; inset-inline: 0; margin: 0; color: #f6f1e1; font-weight: 700; font-size: 22px; text-shadow: 0 2px 8px #000; }
.prank-card button { position: fixed; top: 14px; inset-inline-end: 14px; z-index: 2; background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px; padding: 8px 18px; font: inherit; font-size: 15px; cursor: pointer; }
.quiet-out { position: fixed; bottom: 14px; inset-inline-start: 14px; z-index: 5; background: rgba(10,14,13,.45); color: #f6f1e1;
  border: 1px solid rgba(246,241,225,.35); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }

/* ---- wallet v3: summary tiles, receipts ---- */
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.mini-stats > div { display: grid; gap: 2px; padding: 8px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 85%, #000); text-align: center; }
.mini-stats strong { font-size: 1.05rem; }
.receipts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.rcpt { position: relative; display: inline-block; }
.rcpt img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid rgba(0,0,0,.2); }
.rcpt-x { position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%; line-height: 1; font-size: 14px; }
#tabs button.soon { opacity: .38; cursor: not-allowed; display: grid; gap: 0; justify-items: center; }
#tabs button.soon small { font-size: .6rem; }

/* trip timetable: one column per day, side by side */
.timetable { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.tcol { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; scroll-snap-align: start; min-width: 0; }
.tcol.is-today { border: 2px solid var(--warm); }
.tcol h2 { font-size: 1rem; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.titem.compact { display: block; padding: 8px 0; }
.titem.compact .ttime { display: flex; gap: 6px; align-items: baseline; margin-bottom: 2px; }
.titem.compact .ttime small { display: inline; }
.titem.compact .small-actions button { padding: 4px 8px; font-size: .85rem; }

/* the trip album */
.album-head { margin: 4px 0 8px; }
.uploads { margin-top: 8px; display: grid; gap: 6px; }
.up { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; font-size: .9rem; }
.up progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: var(--accent); }
.up .bad { color: var(--bad); }
.album-day { margin: 14px 0 0; font-size: 1rem; }
.atile { position: relative; }
.atile .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.6rem; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.atile .by { position: absolute; inset-inline: 0; bottom: 0; padding: 14px 6px 3px; font-size: .72rem; color: #fff; text-align: start;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; }
.viewer video { max-width: 100%; max-height: 100%; background: #000; }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 1.6rem; padding: 10px 14px; border-radius: 12px; }
.vnav.prev { inset-inline-end: 8px; } .vnav.next { inset-inline-start: 8px; }
.vbar { position: absolute; inset-inline: 0; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  padding: 10px 14px max(10px, env(safe-area-inset-bottom)); color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.vbar a, .vbar button { color: #fff; background: rgba(255,255,255,.15); border: 0; padding: 6px 12px; border-radius: 10px; text-decoration: none; font-size: .9rem; }

.leg-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0 4px 4.2em; font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); }
.day-summary { align-items: center; margin: 4px 0 8px; }
.tripmap.adding { cursor: crosshair; }

.lang-pick { position: fixed; top: 10px; inset-inline-start: 12px; z-index: 20; }
.lang-btn { font-size: 1.3rem; line-height: 1; padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 88%, transparent); cursor: pointer; }
.lang-list { list-style: none; margin: 6px 0 0; padding: 4px; min-width: 9em; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.lang-list button { display: block; width: 100%; text-align: start; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.lang-list button:hover { background: var(--line); }
.lang-toast { position: fixed; top: 56px; inset-inline-start: 12px; z-index: 21; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; font-size: 1.05rem; }

/* the timetable of the trip: hours down, days across, blocks at their time */
.tt { display: grid; grid-template-columns: 3.6em repeat(var(--cols, 5), minmax(128px, 1fr)); gap: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tt-head { position: sticky; top: 0; z-index: 3; min-height: 2.6em; padding: 6px 6px; font-weight: 600; font-size: .88rem; background: var(--card); border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.tt-gutter .tt-head { border-inline-start: 0; }
.tt-col.is-today .tt-head { background: color-mix(in srgb, var(--warm) 18%, var(--card)); }
.tt-loose { display: block; font-weight: 400; font-size: .78rem; }
.tt-body { position: relative; height: calc(17 * 56px); border-inline-start: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 55px, var(--line) 55px, var(--line) 56px); }
.tt-gutter .tt-body { background-image: none; border-inline-start: 0; }
.tt-hour { height: 56px; font-size: .72rem; color: var(--muted); text-align: center; }
.tt-hour span { position: relative; top: -.55em; background: var(--card); padding: 0 2px; }
.tt-drop { cursor: cell; }
.tt-block { position: absolute; box-sizing: border-box; padding: 3px 6px; overflow: hidden; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--k, #6b7a74) 60%, var(--card)); border-inline-start: 4px solid var(--k, #6b7a74); background: color-mix(in srgb, var(--k, #6b7a74) 16%, var(--card)); font-size: .78rem; line-height: 1.25; cursor: pointer; }
.tt-block strong { display: block; font-size: .82rem; }
.tt-block small { display: block; color: var(--muted); }
.tt-block:hover, .tt-block:focus-visible { z-index: 2; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); overflow-y: auto; }
.modal-card { width: min(460px, 100%); margin: 0; }
.qp .fld-label { margin: 10px 0 4px; font-size: .9rem; color: var(--ink); }
.qp-picker { position: relative; }
.qp-chips, .qp-cur { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.qp-chip { min-height: 38px; padding: 6px 14px; border-radius: 999px; }
.qp-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.qp-money { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.qp-money .qp-cur { margin: 0; flex-wrap: nowrap; }
.qp-sugg { position: absolute; z-index: 5; inset-inline: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18); overflow: hidden; }
.qp-sugg[hidden] { display: none; }
.qp-opt { display: block; width: 100%; text-align: start; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.qp button.primary { width: 100%; margin-top: 10px; }
.as-log { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; padding: 4px 2px; }
.as-msg { max-width: 92%; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.as-me { align-self: flex-start; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.as-bot { align-self: flex-end; }
.as-msg p { margin: 0 0 6px; }
.as-card { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.as-text { white-space: pre-line; font-size: .9rem; margin: 4px 0; }
.as-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.as-link { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent); color: var(--ink); text-decoration: none; font-size: .88rem; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.as-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.as-tools { margin-bottom: 8px; }

.wx-days { list-style: none; margin: 4px 0 8px; padding: 0; line-height: 1.9; }

/* weather dashboard */
.wxd h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--muted); }
.wxd-now { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.wxd-icon { font-size: 3.4rem; line-height: 1; }
.wxd-temp { font-size: 2.8rem; font-weight: 700; line-height: 1; text-align: start; }
.wxd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wxd-stat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.wxd-hours { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.wxd-hour { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; }
.wxd-hicon { font-size: 1.4rem; }
.wxd-rain { min-height: 1.2em; color: var(--muted); }
.wxd-days { display: flex; flex-direction: column; }
.wxd-day { display: grid; grid-template-columns: 6em 1.8em 1fr; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.wxd-dname { display: flex; flex-direction: column; line-height: 1.25; }
.wxd-dicon { font-size: 1.3rem; text-align: center; }
.wxd-day:first-child { border-top: 0; }
.wxd-range { display: grid; grid-template-columns: 2.2em 1fr 2.2em; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.wxd-bar { position: relative; height: 6px; border-radius: 3px; background: var(--line); }
.wxd-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--warm); }

/* split by receipt */
.rs-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 16px; }
.rs-card { width: 100%; max-width: 560px; margin: 0; }
.rs-line { border-top: 1px solid var(--line); padding: 8px 0; }
.rs-top { display: grid; grid-template-columns: 1fr 5.5em auto; gap: 6px; align-items: center; }
.rs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rs-chip { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .9rem; }
.rs-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rs-totals { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }

/* trips */
.two > label { min-width: 0; }
.two input[type=date], .two select { width: 100%; min-width: 0; max-width: 100%; }
.cur-trip { border-color: var(--accent); }

/* notification settings */
.notif-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.notif-row:first-of-type { border-top: 0; }
