@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/public-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "Young Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/young-serif-400-latin.woff2") format("woff2"); }

/* World: an itinerary on good card stock. Warm paper, evergreen ink, one vermilion "stamp" for
   what needs attention (the next thing, over budget, tight timing), sky blue only for weather. */
:root {
  --paper: oklch(97.4% 0.008 95);
  --card: oklch(99.3% 0.004 95);
  --sunk: oklch(94.2% 0.011 95);
  --ink: oklch(25% 0.03 160);
  --ink-2: oklch(45% 0.025 160);
  --rule: oklch(88% 0.012 120);
  --pine: oklch(42% 0.075 158);
  --pine-ink: oklch(98% 0.01 150);
  --pine-tint: oklch(93% 0.03 155);
  --stamp: oklch(55% 0.17 33);
  --stamp-tint: oklch(94% 0.035 35);
  --sky: oklch(55% 0.11 240);
  --gold: oklch(76% 0.15 80);
  --focus: oklch(55% 0.13 240);
  --shadow: 0 1px 2px oklch(25% 0.03 160 / 0.06), 0 8px 24px -12px oklch(25% 0.03 160 / 0.18);
  --r: 10px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: oklch(19% 0.012 160); --card: oklch(22.5% 0.014 160); --sunk: oklch(16.5% 0.01 160);
    --ink: oklch(94% 0.012 110); --ink-2: oklch(76% 0.015 120); --rule: oklch(33% 0.015 160);
    --pine: oklch(74% 0.1 155); --pine-ink: oklch(18% 0.02 160); --pine-tint: oklch(30% 0.04 158);
    --stamp: oklch(72% 0.14 35); --stamp-tint: oklch(30% 0.05 35); --sky: oklch(76% 0.09 240);
    --gold: oklch(82% 0.14 85); --focus: oklch(75% 0.11 240);
    --shadow: 0 1px 2px oklch(0% 0 0 / 0.3), 0 10px 28px -12px oklch(0% 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: oklch(19% 0.012 160); --card: oklch(22.5% 0.014 160); --sunk: oklch(16.5% 0.01 160);
  --ink: oklch(94% 0.012 110); --ink-2: oklch(76% 0.015 120); --rule: oklch(33% 0.015 160);
  --pine: oklch(74% 0.1 155); --pine-ink: oklch(18% 0.02 160); --pine-tint: oklch(30% 0.04 158);
  --stamp: oklch(72% 0.14 35); --stamp-tint: oklch(30% 0.05 35); --sky: oklch(76% 0.09 240);
  --gold: oklch(82% 0.14 85); --focus: oklch(75% 0.11 240); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 "Public Sans", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--pine-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
a { color: var(--pine); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font: 400 clamp(1.75rem, 1.2rem + 2vw, 2.4rem)/1.15 "Young Serif", Georgia, serif; letter-spacing: -0.01em; }
h2 { font: 400 1.3rem/1.25 "Young Serif", Georgia, serif; }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }
.sprite { position: absolute; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- bar */
.bar { display: flex; align-items: center; gap: 16px; padding: 14px max(16px, env(safe-area-inset-left)); max-width: 1240px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.mark { width: 28px; height: 28px; fill: var(--pine); }
.mark circle { fill: var(--stamp); }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a, .link { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: 0.95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .link:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current] { color: var(--ink); font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 8px 16px 96px; outline: none; }
.view.narrow { max-width: 680px; }

/* ---- buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink); font: 500 0.95rem/1.2 inherit; text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease); user-select: none; }
.btn:hover { border-color: color-mix(in oklch, var(--ink) 30%, var(--rule)); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.btn.primary:hover { background: color-mix(in oklch, var(--pine) 88%, black); }
.btn.danger { color: var(--stamp); }
.btn.big { min-height: 48px; padding: 12px 22px; font-size: 1rem; }
.btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--rule);
  border-radius: 8px; padding: 9px 11px; min-height: 42px; }
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: 0.9; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
label { display: grid; gap: 5px; font-size: 0.9rem; font-weight: 500; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); white-space: nowrap; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--pine); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 0.9rem; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.stack { display: grid; gap: 14px; }
.stack.tight { gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 180px; width: auto; }
.row.end { justify-content: flex-end; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.grow { flex: 1; }
.err { color: var(--stamp); margin: 0; min-height: 0; font-size: 0.9rem; }
.err:empty { display: none; }
.combo { position: relative; display: block; }
.hint { position: absolute; right: 10px; top: 50%; translate: 0 -50%; font-size: 0.8rem; color: var(--pine); font-weight: 500; pointer-events: none; }
.pick { list-style: none; margin: -6px 0 0; padding: 0; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--card); }
.pick:empty { display: none; }
.pick button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-top: 1px solid var(--rule); background: none; font: inherit; color: var(--ink); cursor: pointer; }
.pick li:first-child button { border-top: 0; }
.pick button:hover, .pick button:focus-visible { background: var(--pine-tint); }

/* chips (who's coming) */
.who { display: flex; flex-wrap: wrap; gap: 6px; }
.who legend { width: 100%; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; min-height: 0; cursor: pointer; }
.chip span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); font-size: 0.9rem; color: var(--ink); background: var(--card); transition: background-color 140ms var(--ease); }
.chip input:checked + span { background: var(--pine-tint); border-color: var(--pine); color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.who .none { font-size: 0.85rem; color: var(--ink-2); }

/* ---- login */
.login { max-width: 520px; margin: 12vh auto 0; display: grid; gap: 18px; }
.login .or { margin: 0; font-size: 14px; }
.lede { font-size: 1.1rem; color: var(--ink-2); margin: 0; max-width: 46ch; }

/* ---- trips list */
.head-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 20px 0 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.trip-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.trip-list a { display: grid; grid-template-columns: 10rem 1fr auto; gap: 4px 20px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--rule);
  color: inherit; text-decoration: none; transition: background-color 160ms var(--ease); }
.trip-list a:hover { background: var(--sunk); }
.trip-list .when { color: var(--ink-2); font-size: 0.9rem; }
.trip-list .name { font: 400 1.25rem/1.25 "Young Serif", Georgia, serif; }
.trip-list .where { grid-column: 2; color: var(--ink-2); font-size: 0.92rem; }
.trip-list .count { grid-row: 1 / span 2; grid-column: 3; color: var(--ink-2); font-size: 0.9rem; text-align: right; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--pine-tint); color: var(--ink); margin-left: 8px; vertical-align: 3px; font-family: "Public Sans", sans-serif; }
.tag.now { background: var(--stamp-tint); color: var(--stamp); }
.empty { padding: 48px 0; max-width: 52ch; }
.empty p { color: var(--ink-2); }

/* ---- trip */
.trip-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 20px 0 10px; }
.trip-meta { margin: 6px 0 0; color: var(--ink-2); }
.money { display: flex; gap: 24px; flex-wrap: wrap; color: var(--ink-2); font-size: 0.95rem; margin-bottom: 14px; }
.money b { color: var(--ink); font-weight: 600; }
.money .over { color: var(--stamp); }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.day-strip a { flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 2px; min-width: 62px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink); text-decoration: none; font-size: 0.8rem; }
.day-strip a:hover { border-color: var(--pine); }
.day-strip .dow { font-weight: 600; }
.day-strip .ic { width: 20px; height: 20px; color: var(--sky); }
.day-strip .t { color: var(--ink-2); }
.day-strip a.today { border-color: var(--stamp); }
.trip-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }

.day { padding: 22px 0 8px; border-top: 1px solid var(--rule); scroll-margin-top: 12px; }
.day-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: space-between; }
.wx { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 0.92rem; }
.wx .ic { color: var(--sky); width: 20px; height: 20px; }
.wx .kind { font-size: 0.78rem; border: 1px solid var(--rule); border-radius: 999px; padding: 1px 7px; }
.ruler { margin: 10px 0 4px; display: grid; gap: 4px; font-size: 0.85rem; color: var(--ink-2); }
.ruler .track { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.ruler .fill { height: 100%; background: var(--pine); border-radius: 3px; transition: width 300ms var(--ease); }
.ruler.over .fill { background: var(--stamp); }
.ruler.over { color: var(--stamp); }
.day-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.day-tools .btn { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }

.events { list-style: none; margin: 8px 0 0; padding: 0; }
.ev { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; }
.ev + .ev, .leg + .ev { border-top: 1px solid var(--rule); }
.ev .time { font-weight: 600; font-size: 0.95rem; padding-top: 2px; white-space: nowrap; }
.ev .time small { display: block; font-weight: 400; color: var(--ink-2); }
.ev .title { display: flex; gap: 8px; align-items: start; justify-content: space-between; }
.ev h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ev .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 0.9rem; margin-top: 3px; }
.ev .meta a { display: inline-flex; gap: 4px; align-items: center; overflow-wrap: anywhere; }
.ev .meta .ic { width: 15px; height: 15px; }
.ev .notes { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; max-width: 70ch; }
.ev .body { min-width: 0; }
.leg { display: grid; grid-template-columns: 4.6rem 1fr; gap: 16px; font-size: 0.85rem; color: var(--ink-2); padding: 2px 0; }
.leg span + span { display: inline-flex; align-items: center; gap: 6px; border-left: 2px dotted var(--rule); padding: 4px 0 4px 12px; margin-left: -14px; }
.leg .ic { width: 15px; height: 15px; }
.leg.tight { color: var(--stamp); }
.day-empty { color: var(--ink-2); padding: 10px 0; margin: 0; }

/* rating */
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; }
.stars { display: inline-flex; }
.stars button, .thumb { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--rule); padding: 0; }
.stars button .ic { width: 22px; height: 22px; fill: currentColor; stroke: none; transition: transform 160ms var(--ease); }
.stars button.on { color: var(--gold); }
.stars button:hover .ic { transform: scale(1.12); }
.stars button:active .ic, .thumb:active .ic { transform: scale(0.9); }
.thumb { color: var(--ink-2); }
.thumb .ic { width: 20px; height: 20px; transition: transform 160ms var(--ease); }
.thumb:hover { background: var(--sunk); }
.thumb[aria-pressed="true"].up { color: var(--pine); background: var(--pine-tint); }
.thumb[aria-pressed="true"].down { color: var(--stamp); background: var(--stamp-tint); }
.rate-note { font-size: 0.9rem; color: var(--ink-2); background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); font-family: inherit; }
.rate-note-input { flex: 1 1 100%; display: flex; gap: 8px; }
.others { width: 100%; font-size: 0.85rem; color: var(--ink-2); }

/* ideas */
.ideas { position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow: auto; background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); overscroll-behavior: contain; scrollbar-width: thin; }
.ideas-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ideas-status { font-size: 0.88rem; color: var(--ink-2); margin: 12px 0 0; }
.ideas-status:empty { display: none; }
.ideas-status .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--sky); }
.idea-list { list-style: none; margin: 8px 0 0; padding: 0; }
.idea { padding: 12px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.idea b { font-weight: 600; overflow-wrap: anywhere; }
.idea .sub { grid-column: 1; font-size: 0.85rem; color: var(--ink-2); }
.idea .why { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.idea .why span { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); }
.idea .why span.warn { background: var(--stamp-tint); color: var(--stamp); }
.idea .why span.good { background: var(--pine-tint); color: var(--ink); }
.idea .add { grid-row: 1 / span 2; grid-column: 2; align-self: center; min-height: 34px; padding: 6px 10px; font-size: 0.88rem; }
.idea.planned { background: var(--pine-tint); border-radius: 8px; padding: 12px 10px; border-top-color: transparent; }
.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); z-index: 5; }

/* settings */
.set { padding: 20px 0; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.set:first-of-type { margin-top: 18px; }
.set p { margin: 0; }
.people, .members { list-style: none; margin: 0; padding: 0; }
.people li, .members li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); }

/* dialogs */
dialog.sheet { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--rule); border-radius: 14px; padding: 22px;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
dialog.sheet::backdrop { background: oklch(20% 0.02 160 / 0.35); }
dialog[open] { animation: rise 220ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); translate: -50% 0; background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 10px; font-size: 0.92rem; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease); z-index: 20; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--stamp); color: white; }

.only-narrow { display: none; }
@media (max-width: 980px) {
  .trip-grid { grid-template-columns: minmax(0, 1fr); }
  .ideas { position: fixed; inset: auto 0 0 0; top: 10dvh; max-height: none; border-radius: 16px 16px 0 0; z-index: 10; transform: translateY(105%);
    transition: transform 280ms var(--ease); visibility: hidden; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .ideas.open { transform: none; visibility: visible; }
  .only-narrow { display: inline-flex; }
}
@media (max-width: 560px) {
  .trip-list a { grid-template-columns: 1fr auto; }
  .trip-list .when { grid-column: 1 / -1; }
  .trip-list .where { grid-column: 1; }
  .trip-list .count { grid-row: auto; grid-column: 2; }
  .ev, .leg { grid-template-columns: 4.3rem minmax(0, 1fr); gap: 4px 10px; }
  .ev .time { font-size: 0.88rem; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 label:first-child { grid-column: 1 / -1; }
  .head-row .actions, .trip-head .actions { width: 100%; }
  .trip-head .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
