/* Tagalong. Identity: a luggage tag and a field notebook. One accent (stamp red), serif display, mono labels. */
:root {
  --paper: #f5f0e6;
  --card: #fffdf8;
  --ink: #1e1b16;
  --muted: #5f574b;
  --line: #d9cfbd;
  --edge: #8a7f6c;
  --accent: #b93a1e;
  --accent-ink: #ffffff;
  --tint: #f6e3da;
  --good: #1f6b4a;
  --land: #e0d5c0;
  --next: #e2a48f;
  --dot: #e9e0cf;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #16140f;
  --card: #211e17;
  --ink: #efe8d8;
  --muted: #b3a995;
  --line: #3a3528;
  --edge: #8c836f;
  --accent: #f08060;
  --accent-ink: #1a120c;
  --tint: #3a2219;
  --good: #7fd0a4;
  --land: #37322a;
  --next: #8a4a38;
  --dot: #1e1b15;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#main:focus { outline: none; }

#app { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip {
  position: absolute; left: 8px; top: -80px; z-index: 30;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--ink); color: var(--paper); border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 8px; }

/* ---------- top bar and footer ---------- */
.top { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px;
  font: 700 1.3rem/1 var(--serif); letter-spacing: -0.01em; text-decoration: none;
}
.logo { width: 28px; height: 28px; color: var(--accent); flex: none; }
.top nav { display: flex; gap: 2px; margin-left: auto; }
.top nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent;
}
.top nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.icon-btn {
  min-width: 44px; min-height: 44px; padding: 0 12px;
  background: transparent; border: 1px solid var(--edge); border-radius: 999px;
  font: 600 0.8125rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em;
}
.foot { margin-top: 56px; padding: 16px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }

/* ---------- shared pieces ---------- */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; white-space: nowrap;
  background: transparent; border: 1.5px solid var(--ink); border-radius: 999px;
  font: 600 0.9375rem var(--sans); text-decoration: none;
}
.btn:hover { background: var(--tint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 0 14px; font-size: 0.8125rem; }
.btn.ghost { justify-self: start; border: 1.5px dashed var(--edge); color: var(--muted); }
.btn.danger { border-color: var(--accent); color: var(--accent); }
.btn.file { overflow: hidden; }
.btn.file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.btn.file:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline;
}
.eyebrow, .section-title, .block-title, .tag-status, legend, .totals dt, .figures dt {
  font: 600 0.8125rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
}
.eyebrow { color: var(--accent); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; color: var(--muted); }
.section-title::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.note { max-width: 64ch; color: var(--muted); }
.note.good { color: var(--good); font-weight: 600; }
.sub { margin-top: 6px; color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
.page-head h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
.amount, .totals dd, .figures dd, .when { font-variant-numeric: tabular-nums; }
.amount { font-weight: 700; white-space: nowrap; }
.warn { color: var(--accent); font-weight: 600; }
ul.balances, ul.settle-list, ul.members, ul.stamps, ul.chips, ol.steps { list-style: none; margin: 0; padding: 0; }

/* ---------- first run ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); padding: clamp(32px, 8vw, 88px) 0 8px; }
.hero-copy { max-width: 780px; }
.hero h1 { margin: 12px 0 16px; font-size: clamp(2.5rem, 10vw, 4.5rem); line-height: 0.98; letter-spacing: -0.02em; }
.lead { max-width: 56ch; margin-bottom: 24px; font-size: 1.125rem; }
ol.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 44px; counter-reset: step; }
.steps li { padding-top: 10px; border-top: 2px solid var(--ink); color: var(--muted); counter-increment: step; }
.steps li::before { content: "0" counter(step); display: block; margin-bottom: 4px; color: var(--accent); font: 600 0.8125rem var(--mono); letter-spacing: 0.08em; }
.steps strong { color: var(--ink); }
/* the sample trip as a hanging luggage tag: shows what a trip looks like before anyone taps anything */
.ticket {
  position: relative; order: 3; display: grid; justify-self: center; width: 100%; max-width: 380px;
  margin: 60px 0 0; padding: 54px 22px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 46px 46px 12px 12px;
}
.ticket::before {
  content: ""; position: absolute; left: 50%; top: 18px; width: 18px; height: 18px; margin-left: -9px;
  background: var(--paper); border: 1.5px solid var(--edge); border-radius: 50%;
}
.ticket::after { content: ""; position: absolute; left: 50%; top: -26px; width: 2px; height: 46px; margin-left: -1px; background: var(--accent); }
.ticket figcaption { display: grid; gap: 4px; }
.ticket figcaption strong { font: 700 1.75rem/1.1 var(--serif); }
.ticket-rows { list-style: none; margin: 16px 0 0; padding: 0; }
.ticket-rows li { display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); }
.ticket-rows span { grid-row: 1 / span 2; padding-top: 3px; color: var(--accent); font: 600 0.8125rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.ticket-rows b { font-weight: 700; overflow-wrap: anywhere; }
.ticket-rows i { color: var(--muted); font-size: 0.875rem; font-style: normal; }
.ticket .ticket-stamp { justify-self: end; margin-top: 4px; padding: 10px 14px; transform: rotate(-5deg); }

/* ---------- luggage-tag trip cards ---------- */
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }
.tag {
  position: relative; display: grid; align-content: start; gap: 4px; min-height: 148px;
  padding: 16px 16px 16px 54px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 34px 10px 10px 34px;
  text-decoration: none;
}
.tag::before {
  content: ""; position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: var(--paper); border: 1.5px solid var(--edge); border-radius: 50%;
}
.tag::after { content: ""; position: absolute; left: 0; top: 50%; width: 19px; height: 2px; margin-top: -1px; background: var(--accent); }
.tag:hover { border-color: var(--ink); }
.tag h3 { font-size: 1.4rem; overflow-wrap: anywhere; }
.tag-status { color: var(--accent); }
.tag.done .tag-status { color: var(--muted); }
.tag-line { color: var(--muted); font-size: 0.875rem; }
.tag-line.people { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--ink); }
.tag-photo { position: absolute; top: 0; right: 0; width: 32%; height: 100%; object-fit: cover; }
.tag:has(.tag-photo) { padding-right: calc(32% + 14px); }

/* ---------- trip header and tabs ---------- */
.trip-head { padding: 24px 0 0; }
.trip-head h1 { margin-top: 6px; font-size: clamp(2rem, 7vw, 3rem); overflow-wrap: anywhere; }
.trip-head.has-photo {
  margin-top: 16px; padding: 56px 20px 20px; border-radius: 14px;
  background-color: #14120e; background-size: cover; background-position: center; color: #ffffff;
}
.trip-head.has-photo .eyebrow, .trip-head.has-photo .sub { color: #f6ead8; }
.tabs {
  position: sticky; top: 0; z-index: 5; display: flex; margin: 16px 0 20px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.tabs a {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 6px;
  color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.over { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* ---------- plan ---------- */
.days-wrap { position: relative; }
.days { display: flex; gap: 8px; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: thin; }
/* more days off-screen: fade the edge and offer an arrow, so the strip never looks like it just ends */
.days-more {
  position: absolute; top: 2px; right: 0; bottom: 8px; display: flex; align-items: center; justify-content: flex-end;
  width: 60px; padding: 0 4px 0 0; border: 0; color: var(--ink);
  background: linear-gradient(to right, transparent, var(--paper) 58%);
}
.days-wrap.more-start::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 8px; z-index: 1; width: 28px;
  background: linear-gradient(to left, transparent, var(--paper)); pointer-events: none;
}
.day {
  flex: 0 0 auto; display: grid; justify-items: start; gap: 1px; min-width: 92px; min-height: 68px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-align: left;
}
.day small, .day i { color: var(--muted); font: 600 0.8125rem var(--mono); font-style: normal; }
.day b { font: 700 1.05rem var(--serif); }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.day[aria-pressed="true"] small, .day[aria-pressed="true"] i { color: inherit; }
.day-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 14px; }
.day-head h2 { font-size: 1.5rem; }
.seg { display: inline-flex; flex: none; min-height: 47px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg.wide { display: flex; }
.seg button { flex: 1 1 auto; min-height: 44px; padding: 0 16px; background: transparent; border: 0; font-weight: 600; font-size: 0.9375rem; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.block { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 14px; }
.block-title { color: var(--muted); }
h3.block-title { margin: 18px 0 8px; }
.block h3.block-title { margin: 0; }
.hollow { color: var(--muted); font-size: 0.9375rem; }
.timeline { display: grid; gap: 8px; margin-left: 6px; padding-left: 14px; border-left: 2px solid var(--ink); }
.event { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.event + .event { margin-top: 0; }
.event-main {
  flex: 1 1 auto; display: flex; align-items: flex-start; gap: 14px; min-width: 0; min-height: 56px; padding: 10px 12px;
  background: none; border: 0; border-radius: var(--radius); text-align: left;
}
.when { flex: 0 0 auto; min-width: 54px; font: 700 1rem var(--mono); }
.when small { display: block; color: var(--muted); font: 500 0.8125rem var(--sans); white-space: nowrap; }
.what { display: grid; gap: 2px; min-width: 0; }
.what strong { overflow-wrap: anywhere; }
.what small { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.what small.cost { color: var(--muted); font-weight: 600; }
.what small.warn { color: var(--accent); }
.map {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 56px; padding: 0 12px;
  border-left: 1px dashed var(--line); color: var(--accent); font: 600 0.8125rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none;
}
.gap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; min-height: 44px; padding: 10px 12px;
  background: transparent; border: 1.5px dashed var(--edge); border-radius: var(--radius); color: var(--muted); font-size: 0.875rem; text-align: left;
}
.gap span:first-child { font-family: var(--mono); }

/* ---------- ideas ---------- */
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quick input { flex: 1 1 200px; }
.idea { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.idea .what { flex: 1 1 auto; }
.vote {
  flex: 0 0 auto; display: grid; place-items: center; align-content: center; min-width: 48px; min-height: 56px;
  background: var(--paper); border: 1.5px solid var(--edge); border-radius: var(--radius); font-size: 0.8125rem; line-height: 1.1;
}
.vote b { font: 700 1.05rem var(--mono); }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- money ---------- */
.money-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 2px 0 0; font: 700 clamp(1.6rem, 6vw, 2.25rem)/1.1 var(--serif); }
.money-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; }
.balances li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.balances li span:last-child { color: var(--muted); text-align: right; }
.balances li.plus span:last-child { color: var(--ink); font-weight: 700; }
.balances li.minus span:last-child { color: var(--accent); font-weight: 600; }
.settle-list li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; padding: 10px 12px; background: var(--tint); border-radius: var(--radius);
}
.expense {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px;
  margin-bottom: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-align: left;
}
.expense.settle { border-style: dashed; flex-wrap: wrap; }
.expense.settle .what { flex: 1 1 140px; }

/* ---------- group ---------- */
.group-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.panel { display: grid; align-content: start; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.panel .section-title { margin: 0; }
.panel .quick { margin: 0; }
.panel.backup { margin-top: 32px; }
.members li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  color: var(--ink); font: 400 1rem var(--sans);
}
textarea { resize: vertical; }
::placeholder { color: var(--muted); opacity: 1; }
fieldset { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding: 0 6px; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pair.three { grid-template-columns: minmax(0, 1fr); }
.stop { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks.column { flex-direction: column; align-items: stretch; }
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--edge); border-radius: 999px; font-size: 0.9375rem; cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check:has(input:checked) { background: var(--tint); border-color: var(--accent); }
.shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.item { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
summary { padding: 12px 0; color: var(--accent); font-weight: 600; cursor: pointer; }
details .field { margin-bottom: 10px; }
.form-error { padding: 10px 16px; background: var(--tint); border-top: 2px solid var(--accent); font-weight: 600; }

/* ---------- sheet (dialog) ---------- */
dialog#sheet {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; color: var(--ink);
}
dialog#sheet::backdrop { background: rgba(20, 18, 14, 0.6); }
#sheet form { display: flex; flex-direction: column; max-height: 92dvh; }
#sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#sheet h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
/* max-content rows: a row holding a clipped child (.seg) must never be squeezed when the sheet scrolls */
.sheet-body { display: grid; grid-auto-rows: max-content; align-content: start; gap: 14px; min-height: 0; padding: 16px; overflow-y: auto; }
#sheet footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
#sheet footer .danger { margin-right: auto; }

/* ---------- passport ---------- */
/* seven figures: 4 + 3 on a phone, one row of 7 from tablet up; never a lone figure on its own row */
.figures { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 8px; margin: 20px 0; padding: 18px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.figures div { display: grid; align-content: start; gap: 4px; grid-column: span 3; min-width: 0; }
.figures div:nth-child(n+5) { grid-column: span 4; }
.figures dd { margin: 0; font: 700 2.25rem/1 var(--serif); }
.figures dt { color: var(--muted); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.map-wrap { margin: 0; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.world { display: block; width: 100%; height: auto; }
.world path, .world circle { fill: var(--land); stroke: var(--card); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.world .been { fill: var(--accent); }
.world .next { fill: var(--next); }
.map-wrap figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; min-height: 44px; margin-top: 4px; color: var(--muted); font-size: 0.8125rem; }
.key { display: inline-block; width: 12px; height: 12px; margin: 0 6px 0 0; border-radius: 3px; vertical-align: -1px; }
.key.been { background: var(--accent); }
.key.next { margin-left: 14px; background: var(--next); }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 4px; }
.stamp {
  display: grid; align-content: start; gap: 2px; padding: 14px; color: var(--accent);
  border: 2px solid var(--accent); border-radius: 12px; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--accent);
  transform: rotate(-1.4deg);
}
.stamp:nth-child(even) { transform: rotate(1.1deg); }
.stamp:nth-child(3n) { transform: rotate(-0.4deg); }
.stamp strong { font: 700 1.1rem/1.15 var(--serif); text-transform: uppercase; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.stamp span { font: 600 0.8125rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.stamp small { color: var(--ink); font-size: 0.8125rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.chips b { margin-left: 4px; color: var(--muted); font: 600 0.8125rem var(--mono); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 24px); padding: 10px 16px;
  background: var(--ink); color: var(--paper); border-radius: 14px; font-size: 0.9375rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
#toast .btn { border-color: var(--paper); color: var(--paper); }
#toast .btn:hover { background: transparent; text-decoration: underline; }

/* ---------- wider screens ---------- */
@media (max-width: 379px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .idea { flex-wrap: wrap; }
  .idea .what { flex-basis: 60%; }
  .figures div { grid-column: span 6; }
  .figures div:nth-child(n+5) { grid-column: span 4; }
}
@media (min-width: 480px) {
  .pair.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 600px) {
  dialog#sheet { width: min(580px, calc(100% - 32px)); max-height: min(88dvh, 780px); margin: auto; border-bottom: 1px solid var(--line); border-radius: 18px; }
  #sheet form { max-height: min(88dvh, 780px); }
  .tabs a { flex: 0 0 auto; padding: 0 20px; }
}
@media (min-width: 768px) {
  #app { padding: 0 24px; }
  ol.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .top nav a { padding: 0 14px; }
  .figures { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px 12px; }
  .figures div, .figures div:nth-child(n+5) { grid-column: auto; }
}
@media (min-width: 960px) {
  .blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .money-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); column-gap: 48px; align-items: center; }
  .ticket { order: 0; justify-self: end; margin: 26px 8px 0 0; transform: rotate(1.5deg); }
  ol.steps { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tag, .day, .vote, .seg button { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}


/* ---------- v2 additions ---------- */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; min-width: 56px; padding: 0 10px; }

/* The sample tag on the first screen is one big link to the sample trip. */
.ticket-open {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 44px; margin-top: 12px; padding: 0;
  background: transparent; border: 0; color: var(--accent); font: 600 0.9375rem var(--sans); cursor: pointer;
}
.ticket-open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ticket-open:focus-visible { outline: none; }
.ticket:has(.ticket-open:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
.ticket:has(.ticket-open:hover) { border-color: var(--accent); }
.ticket-open svg { transition: transform 0.15s; }
.ticket:has(.ticket-open:hover) .ticket-open svg { transform: translateX(3px); }

/* Trip header: invite from every tab, live and lock status. */
.trip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); font: 600 0.8125rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em;
}
.trip-head.has-photo .btn.invite { background: #fffdf8; border-color: #fffdf8; color: #1e1b16; }
.trip-head.has-photo .live-pill { border-color: #f6ead8; color: #f6ead8; }

/* Roles, lock switch, small print. */
.role { margin-left: 6px; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font: 600 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.04em; vertical-align: 2px; }
.members .row { flex-wrap: wrap; justify-content: flex-end; }
.check.switch { align-items: flex-start; margin-bottom: 12px; line-height: 1.4; border-radius: 12px; padding: 10px 12px; }
.check.switch input { flex: none; margin-top: 2px; }
.note.small { font-size: 0.8125rem; margin-top: 12px; }
fieldset.plain { padding: 0; border: 0; }
fieldset.plain[disabled] .field { opacity: 0.75; }

/* Places and collections. */
.lists { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.lists button {
  min-height: 40px; padding: 0 14px; background: var(--card); border: 1px solid var(--edge); border-radius: 999px; font-weight: 600; font-size: 0.875rem;
}
.lists button b { margin-left: 4px; color: var(--muted); font: 600 0.8125rem var(--mono); }
.lists button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lists button[aria-pressed="true"] b { color: var(--paper); }
.place .tagline { flex: none; align-self: center; padding: 0 10px; color: var(--muted); font: 600 0.8125rem var(--mono); text-transform: uppercase; }
.place > .btn.small { flex: none; align-self: center; height: auto; min-height: 40px; margin: 0 10px 0 4px; white-space: nowrap; }

/* Passport map: drag, pinch and zoom buttons. */
.map-wrap { position: relative; }
.world { touch-action: pan-y; cursor: grab; border-radius: 8px; }
.world:active { cursor: grabbing; }
.world:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.map-tools { position: absolute; top: 20px; right: 20px; display: grid; gap: 6px; }
.map-tools .icon-btn { width: 44px; padding: 0; background: var(--card); font: 600 1.25rem/1 var(--sans); }

/* Receipt scan. */
.scan-row { align-items: center; }
.scan-status { margin: 0; font-size: 0.875rem; }

/* Toast: moves to the top when it would cover what you are working with. */
#toast.top { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }
