@font-face {
  font-family: "Young Serif";
  src: url("/static/fonts/young-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F5F0E8;
  --paper: #FFFDF9;
  --ink: #1C1A16;
  --ink-2: #47423A;
  --muted: #6B6458;
  --line: #E2D9CB;
  --accent: #B4472A;
  --accent-ink: #FFFFFF;
  --accent-soft: #F6E2D8;
  --good: #2C6A46;
  --good-soft: #E2EFE6;
  --warn: #7A4F00;
  --warn-soft: #FAEDD2;
  --bad: #A0302A;
  --bad-soft: #FADFDC;
  --wa: #0E7240;
  --wa-ink: #FFFFFF;
  --focus: #1D5FD1;
  --shadow: 0 1px 2px rgba(28, 26, 22, .06), 0 8px 24px rgba(28, 26, 22, .07);
  --radius: 18px;
  --radius-s: 12px;
  --display: "Young Serif", ui-serif, Georgia, serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130F;
    --paper: #201D17;
    --ink: #F2ECE2;
    --ink-2: #D3CBBE;
    --muted: #A9A092;
    --line: #3B362D;
    --accent: #E58462;
    --accent-ink: #1B0E08;
    --accent-soft: #3A2219;
    --good: #85C9A1;
    --good-soft: #1D3227;
    --warn: #E9BC66;
    --warn-soft: #36290F;
    --bad: #F2948A;
    --bad-soft: #3D1E1A;
    --wa: #2DB56B;
    --wa-ink: #06130C;
    --focus: #7AA7FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 var(--text);
  padding-bottom: env(safe-area-inset-bottom);
  caret-color: var(--accent);
  accent-color: var(--accent);
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; font-synthesis: none; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .75em; text-wrap: pretty; }
.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 32px; }
.top { max-width: 520px; margin: 0 auto; padding: 14px 16px 4px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 400 1.2rem var(--display); color: var(--ink); text-decoration: none; }
.mark { width: 24px; height: 24px; border-radius: 7px; background: url("/static/icon.svg") center/cover; }
.foot { max-width: 520px; margin: 0 auto; padding: 8px 16px 40px; color: var(--muted); font-size: .85rem; }
.foot p { margin: 0 0 .4em; }
.lead { font-size: 1.06rem; color: var(--ink-2); }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: .95rem; margin-bottom: .2em; }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius-s); border: 1.5px solid var(--ink); background: var(--paper);
  color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .12s cubic-bezier(.2, .8, .2, 1), background-color .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.wa { background: var(--wa); border-color: var(--wa); color: var(--wa-ink); }
.btn.ghost { border-color: var(--line); color: var(--ink-2); background: transparent; }
.btn.big { width: 100%; min-height: 56px; font-size: 1.06rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .65; }
.btn.busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.link { display: inline-block; margin-top: .2em; font-weight: 650; }
.back { display: inline-block; margin: 4px 0 12px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }

/* Landing */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 3rem); line-height: 1.05; letter-spacing: -.03em; }
.how { padding-left: 1.3em; margin: 28px 0; }
.how li { margin-bottom: .8em; padding-left: .2em; }
.how li::marker { font-family: var(--display); color: var(--accent); }
.how.small { font-size: .98rem; color: var(--ink-2); margin: 20px 0; }

/* Forms */
.stack { display: grid; gap: 20px; }
.stack.tight { gap: 8px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.label { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; font-size: 1.02rem; }
.hint { color: var(--muted); font-size: .9rem; margin: -2px 0 10px; }
.sub, .sub-label { display: block; font-size: .95rem; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.sub input { margin-top: 4px; }
.sub-field { margin-top: 18px; }
input[type=text], input:not([type]), input[type=number], input[type=date], select {
  display: block; width: 100%; min-width: 0; min-height: 50px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font: inherit; appearance: none; -webkit-appearance: none;
}
input::placeholder { color: var(--muted); }
input[type=date] { line-height: 1.6; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: right 18px center, right 12px center; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.has-error input, .has-error select, .has-error .choice span, .has-error .chip span { border-color: var(--bad); }
.error { color: var(--bad); font-weight: 650; font-size: .92rem; margin: 6px 0 0; }
.banner { padding: 12px 14px; border-radius: var(--radius-s); }
.banner.error { background: var(--bad-soft); color: var(--bad); margin: 0 0 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.chip { position: relative; }
.chip input, .choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; text-align: center; }
.chips.dates .chip span { border-radius: var(--radius-s); font-size: .95rem; }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:focus-visible + span, .choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choices { display: grid; gap: 8px; }
.choice { position: relative; }
.choice span { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--paper); cursor: pointer; }
.choice small { color: var(--muted); font-size: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.choice input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.more { border-top: 1px solid var(--line); padding-top: 4px; }
.more summary { cursor: pointer; font-weight: 650; color: var(--ink-2); min-height: 48px; display: flex; align-items: center; }
.more[open] { display: grid; gap: 14px; }
.pact { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--bg); }
.pact input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; }
.pact label { cursor: pointer; }

/* Trip page */
.invite { padding: 18px 0 4px; }
.invite h1 { font-size: 2.2rem; }
.trip-head { padding: 6px 0 0; }
.callout { border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.callout.share { background: var(--paper); box-shadow: var(--shadow); }
.callout.share .btn { margin: 4px 0 2px; }
.callout.keep { background: var(--good-soft); }
.callout h2 { font-size: 1.2rem; }
.linkbox { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 10px; padding: 6px 6px 6px 12px; font-size: .85rem; margin: 10px 0 0; }
.callout.keep .linkbox { background: var(--paper); }
.linkbox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.copy { min-height: 40px; padding: 6px 14px; border-radius: 8px; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-weight: 650; cursor: pointer; }

.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; padding: 0; margin: 18px 0 14px; }
.track li { display: flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 650; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); }
.track li .icon { width: 1em; height: 1em; }
.track li.done { color: var(--good); border-color: var(--good); }
.track li.now { color: var(--ink); border-color: var(--accent); }

.next { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin: 0 0 16px; }
.next.you { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.next.done { background: var(--good-soft); box-shadow: none; }
.next h2 { margin-bottom: .35em; }
.next .btn.big { margin-top: 6px; }
.next > form + form { margin-top: 8px; }
.deadline { display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink-2); font-size: .95rem; }
.progress { font-weight: 650; }
.done-msg { display: flex; align-items: center; gap: 6px; color: var(--good); font-weight: 700; font-size: 1.1rem; }
.inline-check { color: var(--good); margin-right: 4px; }

.options { display: grid; gap: 12px; margin-bottom: 20px; }
.option { display: block; position: relative; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--paper); }
article.option { margin-bottom: 20px; }
.option.selectable { cursor: pointer; padding-right: 60px; }
.option.selectable input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option .tick { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); display: grid; place-items: center; color: transparent; }
.option.selectable input:checked ~ .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.option.selectable:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option.selectable input:focus-visible ~ .tick { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.opt-head h3 { margin: 0; font: 400 1.3rem/1.15 var(--display); }
.country { display: block; font: 500 .9rem var(--text); color: var(--muted); margin-top: 2px; }
.when { font-weight: 650; color: var(--ink); margin: 8px 0 6px; font-size: .95rem; }
.pitch { color: var(--ink-2); font-size: .95rem; margin-bottom: 6px; }
.facts { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.notes { list-style: none; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.notes li { padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 650; font-size: .82rem; }
.notes li.good { background: var(--good-soft); color: var(--good); }
.entry { border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 8px 0 0; }
.entry p { margin: 0 0 .3em; }
.entry p:last-child { margin: 0; }
.entry.ok { background: var(--good-soft); }
.entry.no { background: var(--bad-soft); }
.entry.unchecked { background: var(--warn-soft); color: var(--ink); }
.source { color: var(--ink-2); }
.votes { font-weight: 700; margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sticky-action { position: sticky; bottom: 0; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }

.book { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.book-link { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-s); color: var(--ink); text-decoration: none; background: var(--paper); }
.book-link .icon { width: 24px; height: 24px; color: var(--accent); }
.book-link span { display: grid; }
.book-link small { color: var(--muted); }

.people { margin: 8px 0 20px; }
.people h2 { font-size: 1.15rem; }
.people ul { list-style: none; padding: 0; margin: 0; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 50px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.tag { margin-left: 8px; font-size: .75rem; font-weight: 650; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }
.people li.done .status { color: var(--good); }
.people li.waiting .status { color: var(--muted); font-size: .92rem; }
.people li.out .status { color: var(--muted); font-size: .92rem; }

.panel { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 20px 0; }
.panel h2 { font-size: 1.15rem; }
.panel .block { margin-top: 14px; display: grid; gap: 8px; }
.panel form { margin: 0; }
.panel.dev { border-color: var(--muted); }
.inline { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin: 16px 0; }
.card.warn { background: var(--warn-soft); box-shadow: none; }

.offline { position: sticky; top: 0; z-index: 9; background: var(--ink); color: var(--bg); text-align: center; padding: 10px 16px; font-size: .9rem; }
.offline[hidden] { display: none; }

.prose h2 { margin-top: 1.4em; font-size: 1.25rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }

/* Data view */
.wrap.wide { max-width: 1100px; }
.marks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.mark-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.mark-card p { margin: 0 0 .2em; }
.mark-card .big { font: 400 2.2rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.mark-card.pass { box-shadow: var(--shadow), inset 0 0 0 2px var(--good); }
.data { border-collapse: collapse; width: 100%; background: var(--paper); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 16px; font-size: .92rem; }
.data th, .data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data td { font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.trips th { white-space: nowrap; }
.btn.small { min-height: 36px; padding: 4px 10px; font-size: .85rem; }

@media (min-width: 600px) { h1 { font-size: 2.3rem; } }
@media (prefers-reduced-motion: reduce) { .btn.busy::after { animation: none; } .btn { transition: none; } }

.mylink { margin: 8px 0 20px; color: var(--ink-2); }
.mylink summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.remove-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.remove-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Fresh-eyes fixes */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: .5em; height: .5em; margin-right: .6em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; flex: none; }
details[open] > summary::before { transform: rotate(45deg); }
.has-error.sub-field select { border-color: var(--bad); }
.sub-label.second { margin-top: 12px; }
.chips.dates { grid-auto-rows: 1fr; }
.chips.dates .chip span { height: 100%; }
.banner.note { background: var(--warn-soft); color: var(--ink); margin: 0 0 16px; }
.count { font: 500 .85rem var(--text); color: var(--muted); margin-left: 6px; }
