/* trip.bamba.ci design system · components
   Every component: block class, --modifiers, .is-states. Uses tokens only. */

/* ═══════════════════════════════════════════════════════════
   BUTTON  .btn  --primary (default) --secondary --text --danger --inverse
                 --lg --sm --block  .is-loading  [disabled]
   ═══════════════════════════════════════════════════════════ */
.btn {
  --_bg: var(--color-primary); --_fg: var(--color-on-primary); --_shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--btn-h); padding: 0 18px;
  background: var(--_bg); color: var(--_fg);
  border: var(--border); border-radius: 0; box-shadow: var(--_shadow);
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear, background var(--dur-fast);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.04); }
.btn:active, .btn.is-pressed { transform: translate(var(--shadow-offset), var(--shadow-offset)); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; box-shadow: none; cursor: not-allowed; pointer-events: none; }
.btn--secondary { --_bg: var(--color-surface); --_fg: var(--color-text); --_shadow: none; }
.btn--secondary:active, .btn--secondary.is-pressed { transform: none; background: var(--color-surface-2); }
.btn--text { --_bg: transparent; --_fg: var(--color-text); --_shadow: none; border-color: transparent; padding: 0 var(--space-1);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.btn--text:active { transform: none; }
.btn--danger { --_bg: var(--color-danger); --_fg: var(--color-on-danger); }
.btn--inverse { --_bg: var(--color-inverse); --_fg: var(--color-inverse-accent); }
.btn--lg { min-height: var(--btn-h-lg); padding: 0 22px; font-size: 14px; }
.btn--sm { min-height: var(--btn-h-sm); padding: 0 12px; font-size: 12px; --_shadow: none; }
.btn--sm:active { transform: none; }
.btn--block { width: 100%; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label { opacity: 0.7; }
.btn__spinner { width: 18px; height: 18px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ICON BUTTON  .icon-btn  --square --primary */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); padding: 0;
  background: var(--color-surface); color: var(--color-text);
  border: var(--border); border-radius: 50%;
  transition: background var(--dur-press) linear;
}
.icon-btn:active { background: var(--color-primary); color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn--square { border-radius: var(--radius-card); }
.icon-btn--primary { background: var(--color-primary); color: var(--ink); }
.icon-btn--ghost { background: transparent; }

/* ACTION BAR  .action-bar  (sticky bottom of sheets and forms) */
.action-bar {
  position: sticky; bottom: 0; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-3) var(--gutter) calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--color-bg); border-top: var(--border);
}

/* ═══════════════════════════════════════════════════════════
   CHIP / TAG / STATUS / STICKER / BADGE
   ═══════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  background: var(--color-surface); color: var(--color-text); border: var(--border);
  font-size: var(--text-label); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase;
  white-space: nowrap; transition: background var(--dur-press) linear;
}
.chip--sm { height: 22px; padding: 0 8px; font-size: 10px; }
.chip:is(button):active { transform: translate(2px, 2px); }
.chip.is-selected, .chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--color-inverse); color: var(--color-on-inverse); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.chip--eyebrow { background: var(--color-inverse); color: var(--color-on-inverse); height: 22px; padding: 0 8px; font-size: 10px; }

/* Category & status tags: fixed colours */
.tag { composes: chip; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border: var(--border);
  font-size: var(--text-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.tag .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.tag--eat   { background: var(--color-eat);   color: var(--color-on-eat); }
.tag--see   { background: var(--color-see);   color: var(--color-on-see); }
.tag--walk  { background: var(--color-walk);  color: var(--color-on-walk); }
.tag--stay  { background: var(--color-stay);  color: var(--color-on-stay); }
.tag--flight{ background: var(--color-flight);color: var(--color-on-flight); }
.tag--ok    { background: var(--color-inverse); color: var(--color-on-inverse); }
.tag--pending { background: var(--color-primary); color: var(--ink); }
.tag--cancelled { background: var(--color-danger); color: var(--color-on-danger); }
.tag--neutral { background: var(--color-surface); color: var(--color-text); }

.sticker {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  background: var(--color-primary); color: var(--ink); border: var(--border); box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  transform: rotate(var(--rot, -4deg));
}
.sticker--pink { background: var(--color-stay); }
.sticker--red  { background: var(--color-danger); color: var(--color-on-danger); }
.sticker--blue { background: var(--color-see); color: var(--color-on-see); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--color-danger); color: var(--color-on-danger); border: var(--border);
  font-size: 11px; font-weight: 700; line-height: 1;
}
.has-badge { position: relative; }
.has-badge > .badge { position: absolute; top: -8px; right: -10px; }

/* ═══════════════════════════════════════════════════════════
   SELECTION  .checkbox .radio .switch .segmented .stepper .tile
   ═══════════════════════════════════════════════════════════ */
.check {          /* wrapper label for checkbox and radio */
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); cursor: pointer;
  font-weight: 500; -webkit-tap-highlight-color: transparent;
}
.check input { appearance: none; margin: 0; flex: none; width: 28px; height: 28px;
  background: var(--color-surface); border: var(--border); display: grid; place-content: center;
  transition: background var(--dur-press) linear; }
.check input[type="radio"] { border-radius: 50%; }
.check input::before { content: ""; width: 18px; height: 18px; transform: scale(0); transition: transform var(--dur-press) linear; }
.check input[type="checkbox"]::before {
  background: currentColor;
  clip-path: polygon(14% 50%, 0 66%, 40% 100%, 100% 20%, 86% 6%, 40% 70%);
}
.check input[type="radio"]::before { width: 14px; height: 14px; border-radius: 50%; background: var(--color-text); }
.check input:checked { background: var(--_fill, var(--color-inverse)); color: var(--_fill-fg, var(--color-on-inverse)); }
.check input[type="radio"]:checked { background: var(--color-surface); }
.check input:checked::before { transform: scale(1); }
.check input:indeterminate { background: var(--color-inverse); }
.check input:indeterminate::before { transform: scale(1); background: var(--color-on-inverse); clip-path: inset(40% 20%); }
.check input:disabled { opacity: 0.4; cursor: not-allowed; background: var(--color-surface-2); }
.check input:disabled + * { opacity: 0.6; }
.check input:checked ~ .check__label { color: var(--color-text-muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.check--no-strike input:checked ~ .check__label { color: inherit; text-decoration: none; }
.check--eat  { --_fill: var(--color-eat);  --_fill-fg: var(--color-on-eat); }
.check--see  { --_fill: var(--color-see);  --_fill-fg: var(--color-on-see); }
.check--walk { --_fill: var(--color-walk); --_fill-fg: var(--color-on-walk); }
.check--stay { --_fill: var(--color-stay); --_fill-fg: var(--color-on-stay); }

.switch { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); cursor: pointer; font-weight: 500; }
.switch input { appearance: none; margin: 0; flex: none; width: 56px; height: 32px; border-radius: 16px;
  background: var(--color-surface); border: var(--border); position: relative; transition: background var(--dur-fast); }
.switch input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-text); transition: transform var(--dur-fast) var(--ease-out); }
.switch input:checked { background: var(--color-primary); }
.switch input:checked::before { transform: translateX(24px); background: var(--ink); }
.switch input:disabled { opacity: 0.4; cursor: not-allowed; }

.segmented { display: flex; border: var(--border); box-shadow: var(--shadow); background: var(--color-surface); }
.segmented > * {
  flex: 1 1 0; min-height: 40px; padding: 0 var(--space-2);
  background: transparent; color: var(--color-text); border: 0; border-left: var(--border);
  font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase;
  transition: background var(--dur-press) linear;
}
.segmented > :first-child { border-left: 0; }
.segmented > [aria-selected="true"], .segmented > .is-selected { background: var(--color-inverse); color: var(--color-inverse-accent); }
.segmented--flat { box-shadow: none; }

.stepper { display: inline-flex; align-items: stretch; border: var(--border); background: var(--color-surface); }
.stepper button { width: var(--tap); height: var(--tap); border: 0; background: transparent; font-size: 20px; font-weight: 700; color: var(--color-text); }
.stepper button:first-child { border-right: var(--border); }
.stepper button:last-child  { border-left: var(--border); background: var(--color-primary); color: var(--ink); }
.stepper button:disabled { opacity: 0.4; }
.stepper input, .stepper output { width: 52px; border: 0; text-align: center; background: transparent;
  font-family: var(--font-display); font-size: 18px; display: grid; place-content: center; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; }

.tile-select { position: relative; display: block; cursor: pointer; }
.tile-select input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.tile-select__face {
  width: 112px; height: 104px; padding: var(--space-3); border: var(--border); background: var(--color-surface); color: var(--color-text);
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--font-display); font-size: 14px; text-transform: uppercase;
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear;
}
.tile-select input:checked + .tile-select__face { box-shadow: var(--shadow); transform: rotate(-2deg);
  background: var(--_fill, var(--color-inverse)); color: var(--_fill-fg, var(--color-on-inverse)); }
.tile-select input:focus-visible + .tile-select__face { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.tile-select__check { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; display: none; place-content: center;
  background: var(--color-inverse); color: var(--color-on-inverse); border: var(--border); }
.tile-select input:checked ~ .tile-select__check { display: grid; }
.tile-select--eat  { --_fill: var(--color-eat);  --_fill-fg: var(--color-on-eat); }
.tile-select--see  { --_fill: var(--color-see);  --_fill-fg: var(--color-on-see); }
.tile-select--walk { --_fill: var(--color-walk); --_fill-fg: var(--color-on-walk); }
.tile-select--stay { --_fill: var(--color-stay); --_fill-fg: var(--color-on-stay); }

/* ═══════════════════════════════════════════════════════════
   FIELD  .field > .field__label + .field__control + .field__help
   ═══════════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { display: flex; align-items: center; gap: 4px; font-size: var(--text-label); font-weight: 700;
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text); }
.field__label abbr { color: var(--color-danger); text-decoration: none; }
.field__control {
  position: relative; display: flex; align-items: center; min-height: var(--control-h);
  background: var(--color-surface); border: var(--border);
  transition: box-shadow var(--dur-press) linear;
}
.field__control:focus-within { box-shadow: var(--shadow-focus); outline: 3px solid var(--color-focus); outline-offset: 2px; }
.field__control > input, .field__control > select, .field__control > textarea {
  flex: 1 1 auto; min-width: 0; width: 100%; padding: 0 var(--space-3); border: 0; background: transparent; outline: 0;
  font-size: var(--text-input); color: var(--color-text); min-height: calc(var(--control-h) - 2 * var(--border-w));
}
.field__control > textarea { padding: var(--space-3); min-height: 108px; resize: vertical; line-height: 1.4; }
.field__control > select { appearance: none; padding-right: 40px; cursor: pointer; }
/* native date/time pickers: keep the tap target, hide the browser glyph, show ours */
.field__control > input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.field__control > input[type="search"]::-webkit-search-cancel-button { appearance: none; }
.field__control > input::placeholder, .field__control > textarea::placeholder { color: var(--color-text-faint); }
.field__prefix { display: grid; place-content: center; align-self: stretch; width: var(--tap); border-right: var(--border);
  background: var(--color-surface-2); font-weight: 700; }
.field__suffix { display: grid; place-content: center; padding-right: var(--space-3); color: var(--color-text); pointer-events: none; }
.field__suffix--btn { pointer-events: auto; padding: 0; }
.field__help { font-size: var(--text-caption); color: var(--color-text-muted); }
.field__error { display: none; align-items: center; gap: 6px; font-size: var(--text-caption); font-weight: 600; color: var(--color-danger); }
.field__error .icon { width: 14px; height: 14px; }
.field.is-invalid .field__control { border-color: var(--color-danger); }
.field.is-invalid .field__prefix { border-right-color: var(--color-danger); }
.field.is-invalid .field__error { display: flex; }
.field.is-invalid .field__help { display: none; }
.field.is-readonly .field__control { background: var(--color-surface-2); }
.field.is-disabled { opacity: 0.45; }
.field.is-disabled .field__control { background: var(--color-surface-2); }
.field-row { display: flex; gap: var(--space-3); }
.field-row > .field { flex: 1 1 0; }
.field-row > .field--narrow { flex: 0 0 132px; }

/* ═══════════════════════════════════════════════════════════
   RAIL  .rail  — the only thing that scrolls horizontally
   ═══════════════════════════════════════════════════════════ */
.rail {
  display: flex; gap: var(--rail-gap, var(--space-2)); align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: var(--space-2) var(--gutter); margin: 0 calc(-1 * var(--gutter));
  scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; }
.rail--cards { --rail-gap: var(--space-3); }
.rail--tiles { --rail-gap: var(--space-3); }
.rail--people { --rail-gap: var(--space-4); }

/* Day box */
.day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
  min-width: 52px; height: 60px; padding: 0; border: var(--border); border-radius: var(--radius-card);
  background: var(--color-surface); color: var(--color-text);
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear;
}
.day__dow { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.day__num { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.day.is-selected, .day[aria-selected="true"] { background: var(--color-danger); color: var(--color-on-danger); box-shadow: var(--shadow); transform: rotate(-3deg); }
.day.is-selected .day__dow { color: inherit; opacity: 0.85; }
.day.has-plans::after { content: ""; position: absolute; bottom: 5px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-primary); border: 1px solid var(--ink); }

/* Person */
.person { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); min-width: 64px; cursor: pointer; }
.person input { position: absolute; opacity: 0; width: 0; height: 0; }
.person__avatar {
  width: 56px; height: 56px; border-radius: 50%; border: var(--border);
  background: var(--_bg, var(--color-inverse)); color: var(--_fg, var(--color-on-inverse));
  display: grid; place-content: center; font-family: var(--font-display); font-size: 22px;
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear;
}
.person__name { font-size: 12px; font-weight: 500; }
.person input:checked ~ .person__avatar { box-shadow: var(--shadow); transform: rotate(-4deg); }
.person input:checked ~ .person__name { font-weight: 700; }
.person input:focus-visible ~ .person__avatar { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.person--pink   { --_bg: var(--color-stay); --_fg: var(--ink); }
.person--blue   { --_bg: var(--color-see);  --_fg: var(--white); }
.person--yellow { --_bg: var(--color-walk); --_fg: var(--ink); }
.person--add .person__avatar { background: transparent; color: var(--color-text); border-style: dashed; }

/* Time chip */
.slot { min-height: var(--tap); padding: 0 14px; border: var(--border); background: var(--color-surface); color: var(--color-text);
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot[aria-pressed="true"], .slot.is-selected { background: var(--color-inverse); color: var(--color-inverse-accent); box-shadow: var(--shadow); }

/* ═══════════════════════════════════════════════════════════
   CARDS & ROWS
   ═══════════════════════════════════════════════════════════ */
.card {
  display: block; background: var(--color-surface); color: inherit; border: var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow); text-decoration: none; text-align: left; width: 100%; padding: 0;
  transition: transform var(--dur-press) linear, box-shadow var(--dur-press) linear;
}
.card:is(a, button):active, .card.is-pressed { transform: translate(var(--shadow-offset), var(--shadow-offset)); box-shadow: none; }
.card--flat { box-shadow: none; }
.card--inverse { background: var(--color-inverse); color: var(--color-on-inverse); box-shadow: var(--shadow-danger); }
.card__body { padding: var(--space-4); }

/* Boarding pass */
.pass { overflow: hidden; }
.pass__head { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; border-bottom: var(--border);
  background: var(--_head, var(--color-primary)); color: var(--_head-fg, var(--ink)); }
.pass--see  { --_head: var(--color-see);  --_head-fg: var(--color-on-see); }
.pass--stay { --_head: var(--color-stay); --_head-fg: var(--color-on-stay); }
.pass__route { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.pass__code { font-family: var(--font-display); font-size: 40px; line-height: 1; letter-spacing: -0.02em; }
.pass__city { font-size: 11px; font-weight: 600; color: var(--color-text-muted); }
.pass__mid { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; padding: 0 12px; font-size: 11px; font-weight: 600; color: var(--color-text-muted); }
.pass__mode { width: 36px; height: 36px; border-radius: 50%; border: var(--border); background: var(--color-see); color: var(--color-on-see); display: grid; place-content: center; }
.pass__mode .icon { width: 20px; height: 20px; }
.pass__perf { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.pass__perf::before, .pass__perf::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--color-bg); border: var(--border); }
.pass__perf::before { margin-left: -14px; } .pass__perf::after { margin-right: -14px; }
.pass__perf span { flex: 1; border-top: 2px dashed var(--color-border); }
.pass__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px 16px 14px; }

/* Timeline row */
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.trow__time { min-width: 56px; }
.trow__time .t-data { display: block; }
.trow__rule { width: 2px; align-self: stretch; background: var(--color-border); }
.trow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.trow__title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.trow__title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* List row */
.lrow { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: var(--border); }
.lrow:last-child { border-bottom: 0; }
.lrow__dot { width: 14px; height: 14px; border-radius: 50%; border: var(--border); background: var(--_c, var(--color-inverse)); flex: none; }
.lrow__main { flex: 1; min-width: 0; }
.lrow__amount { font-family: var(--font-display); font-size: 18px; font-variant-numeric: tabular-nums; }

/* Tile */
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2); min-height: 96px; padding: var(--space-3); }
.tile .split { flex-wrap: wrap; row-gap: 6px; }
.tile--add { border-style: dashed; box-shadow: none; background: transparent; align-items: center; justify-content: center; flex-direction: row;
  font-size: var(--text-label); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; }

/* Place card (horizontal rail) */
.place { width: 220px; }
.place__media { height: 90px; border-bottom: var(--border); position: relative; background: var(--_c, var(--color-see)); overflow: hidden; }
.place__media::after { content: ""; position: absolute; inset: 0; background-image: var(--halftone); background-size: var(--halftone-size); opacity: 0.22; }
.place__num { position: absolute; left: 10px; top: 10px; font-family: var(--font-display); font-size: 28px; color: var(--_fg, var(--white)); z-index: 1; }

/* ═══════════════════════════════════════════════════════════
   NAVIGATION  .bottom-nav .top-bar .page-header .tabs
   ═══════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: flex; background: var(--color-inverse); border-top: var(--border);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px;
  color: var(--color-on-inverse); text-decoration: none; background: none; border: 0;
  font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
}
.bottom-nav [aria-current="page"] { color: var(--color-inverse-accent); font-weight: 700; }
.bottom-nav--static { position: static; }

.top-bar { position: sticky; top: 0; z-index: var(--z-topbar); display: flex; align-items: center; gap: var(--space-2);
  height: var(--topbar-h); padding: 0 var(--space-2); background: var(--color-bg); border-bottom: var(--border-w) solid transparent; }
.top-bar.is-scrolled { border-bottom-color: var(--color-border); }
.top-bar__title { flex: 1; text-align: center; font-family: var(--font-display); font-size: 16px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar__spacer { width: var(--tap); }

.page-header { position: relative; overflow: hidden; padding: var(--space-5) 0 0; display: flex; flex-direction: column; gap: 10px; }
.page-header::before { content: ""; position: absolute; right: -30px; top: 0; width: 150px; height: 150px; border-radius: 50%;
  background-image: var(--halftone); background-size: var(--halftone-size); opacity: 0.16; pointer-events: none; }
.page-header > * { position: relative; }

.tabs { display: flex; border-bottom: var(--border); }
.tabs > * { flex: 1; min-height: var(--tap); background: none; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px;
  color: var(--color-text-muted); font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.tabs > [aria-selected="true"] { color: var(--color-text); border-bottom-color: var(--color-border); }

/* ═══════════════════════════════════════════════════════════
   OVERLAYS  dialog.dialog  dialog.sheet  .menu  .toast  .banner
   ═══════════════════════════════════════════════════════════ */
dialog { color: inherit; }
dialog::backdrop { background: var(--scrim); }
.dialog {
  width: min(342px, calc(100vw - 2 * var(--gutter))); padding: 22px 20px 20px; border: var(--border); background: var(--color-surface);
  box-shadow: var(--shadow); margin: auto;
}
.dialog[open] { animation: dialog-in var(--dur-fast) var(--ease-out); }
.dialog.is-closing { animation: dialog-out var(--dur-exit) var(--ease-in) forwards; }
@keyframes dialog-in  { from { opacity: 0; transform: scale(0.96); } }
@keyframes dialog-out { to   { opacity: 0; transform: scale(0.96); } }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.dialog__glyph { width: 40px; height: 40px; border-radius: 50%; border: var(--border); display: grid; place-content: center; flex: none;
  background: var(--color-danger); color: var(--color-on-danger); }
.dialog__glyph .icon { width: 20px; height: 20px; }
.dialog__actions { display: flex; flex-direction: column; gap: 10px; padding-top: var(--space-1); }

.sheet {
  width: 100%; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; padding: 0;
  border: 0; border-top: var(--border); background: var(--color-bg);
  display: flex; flex-direction: column;
}
.sheet:not([open]) { display: none; }
.sheet[open] { animation: sheet-in var(--dur-sheet) var(--ease-out); }
.sheet.is-closing { animation: sheet-out var(--dur-exit) var(--ease-in) forwards; }
@keyframes sheet-in  { from { transform: translateY(100%); } }
@keyframes sheet-out { to   { transform: translateY(100%); } }
.sheet__grab { display: flex; justify-content: center; padding: 10px 0 4px; }
.sheet__grab::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--color-border); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px var(--gutter); }
.sheet__body { overflow-y: auto; padding: var(--space-2) var(--gutter) var(--space-4); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 600px) { .sheet { max-width: 480px; margin: auto; border: var(--border); box-shadow: var(--shadow); } }

.menu { padding: 0; border: var(--border); background: var(--color-surface); box-shadow: var(--shadow); width: min(342px, calc(100vw - 2 * var(--gutter))); margin: auto; }
.menu__title { padding: 14px 16px 10px; border-bottom: var(--border); font-family: var(--font-display); font-size: 14px; text-transform: uppercase; }
.menu__item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px; padding: 0 16px;
  background: none; border: 0; border-bottom: var(--border); color: var(--color-text); font-size: 15px; font-weight: 600; text-align: left; }
.menu__item:last-child { border-bottom: 0; }
.menu__item:active { background: var(--color-surface-2); }
.menu__item .icon { width: 20px; height: 20px; }
.menu__item--danger { color: var(--color-danger); }

.toast-region { position: fixed; top: var(--space-3); left: var(--gutter); right: var(--gutter); z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2); pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 12px 14px; pointer-events: auto;
  background: var(--color-inverse); color: var(--color-on-inverse); border: var(--border); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; animation: toast-in var(--dur-fast) var(--ease-out); }
.toast.is-closing { animation: toast-out var(--dur-exit) var(--ease-in) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(-12px); } }
.toast .icon { width: 22px; height: 22px; stroke-width: 2.5; color: var(--color-inverse-accent); }
.toast__text { flex: 1; }
.toast__action { background: none; border: 0; padding: 0; min-height: var(--tap); color: var(--color-inverse-accent);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.toast--danger { background: var(--color-danger); color: var(--color-on-danger); }
.toast--danger .icon, .toast--danger .toast__action { color: var(--color-on-danger); }
.toast--surface { background: var(--color-surface); color: var(--color-text); }
.toast--surface .icon, .toast--surface .toast__action { color: var(--color-text); }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); background: var(--color-primary); color: var(--ink);
  border-bottom: var(--border); font-size: 13px; font-weight: 700; }
.banner .icon { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════════════════════
   FEEDBACK  .skeleton .empty .progress
   ═══════════════════════════════════════════════════════════ */
.skeleton { background-image: var(--halftone); background-size: var(--halftone-size); opacity: 0.35; border-radius: 2px;
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.18; } }
.skeleton--text { height: 14px; }
.skeleton--text-sm { height: 10px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: var(--space-8) var(--gutter); text-align: center; }
.empty__art { width: 120px; height: 120px; border-radius: 50%; border: var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: grid; place-content: center; background: var(--_c, var(--color-stay)); color: var(--ink); }
.empty__art::after { content: ""; position: absolute; inset: 0; background-image: var(--halftone); background-size: var(--halftone-size); opacity: 0.25; }
.empty__art .icon { width: 48px; height: 48px; position: relative; z-index: 1; }
.empty .t-note { max-width: 260px; }

.progress { height: 14px; border: var(--border); background: var(--color-surface); position: relative; overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; width: var(--value, 0%); background: var(--color-primary); border-right: var(--border);
  transition: width var(--dur-fast) var(--ease-out); }

/* ═══════════════════════════════════════════════════════════
   SHELF  .shelf — a titled horizontal collection (exhibitors, places, restaurants)
   .shelf > .shelf__head + .rail.rail--shelf > .spot*
   ═══════════════════════════════════════════════════════════ */
.shelf { display: flex; flex-direction: column; gap: var(--space-1); }
.shelf__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap); }
.shelf__title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.shelf__title .t-section { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf__count { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: var(--border); background: var(--color-primary); color: var(--ink);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.shelf__more { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 var(--space-1); background: none; border: 0; color: var(--color-text);
  font-size: var(--text-label); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; white-space: nowrap; }
.shelf__more .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.shelf__more:hover { color: var(--color-danger); }
.rail--shelf { --rail-gap: var(--space-3); padding-top: var(--space-3); padding-bottom: 14px; /* room for the shadow */ }
.shelf__sub { font-family: var(--font-note); font-style: italic; font-size: 14px; color: var(--color-text-muted); margin-top: -4px; }

/* SPOT — compact card for a shelf. 160px; --wide 240px. Whole card opens; the pick sits above the link. */
.spot { position: relative; width: 160px; display: flex; flex-direction: column; text-align: left; }
.spot--wide { width: 240px; }
.spot__link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.spot__link::after { content: ""; position: absolute; inset: 0; }              /* stretched link */
.spot__media { position: relative; height: 84px; border-bottom: var(--border); background: var(--_c, var(--color-see)); color: var(--_fg, var(--color-on-see)); overflow: hidden; display: grid; place-content: center; }
.spot--wide .spot__media { height: 100px; }
.spot__media::after { content: ""; position: absolute; inset: 0; background-image: var(--halftone); background-size: var(--halftone-size); opacity: 0.22; pointer-events: none; }
.spot__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot__mono { position: relative; z-index: 1; font-family: var(--font-display); font-size: 28px; letter-spacing: -0.02em; text-transform: uppercase; }
.spot__stand { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; background: var(--color-surface); color: var(--color-text); border: var(--border);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-variant-numeric: tabular-nums; box-shadow: 2px 2px 0 var(--color-shadow); }
.spot__body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; }
.spot__name { font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spot__meta { font-size: var(--text-caption); color: var(--color-text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spot__meta .tag { height: 20px; padding: 0 6px 0 5px; font-size: 9px; }
.spot__meta .icon { width: 14px; height: 14px; }
.spot__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.spot__price { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.04em; }
.spot--eat  { --_c: var(--color-eat);  --_fg: var(--color-on-eat); }
.spot--see  { --_c: var(--color-see);  --_fg: var(--color-on-see); }
.spot--walk { --_c: var(--color-walk); --_fg: var(--color-on-walk); }
.spot--stay { --_c: var(--color-stay); --_fg: var(--color-on-stay); }
.spot--ink  { --_c: var(--color-inverse); --_fg: var(--color-on-inverse); }
.spot.is-done .spot__media { filter: grayscale(1); opacity: 0.7; }
.spot.is-done .spot__name { color: var(--color-text-muted); text-decoration: line-through; text-decoration-thickness: 2px; }

/* PICK — corner checkbox that marks a card as wanted. Sits above the stretched link. */
.pick { position: absolute; top: 8px; left: 8px; z-index: 2; width: 32px; height: 32px; cursor: pointer; }
.pick input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.pick__face { position: absolute; inset: 0; border-radius: 50%; border: var(--border); background: var(--color-surface); color: var(--color-text); display: grid; place-content: center;
  transition: transform var(--dur-press) linear, background var(--dur-press) linear; }
.pick__face .icon { width: 16px; height: 16px; stroke-width: 3; }
.pick__face .icon--on { display: none; }
.pick input:checked + .pick__face { background: var(--color-primary); color: var(--ink); transform: rotate(-8deg); box-shadow: 2px 2px 0 var(--color-shadow); }
.pick input:checked + .pick__face .icon--off { display: none; }
.pick input:checked + .pick__face .icon--on { display: block; }
.pick input:focus-visible + .pick__face { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.pick:active .pick__face { transform: scale(0.92); }
.spot .pick { top: 8px; left: 8px; }
.spot:has(.pick) .spot__media { padding-left: 0; }

/* Add card at the end of a shelf */
.spot--add { justify-content: center; align-items: center; gap: var(--space-2); border-style: dashed; box-shadow: none; background: transparent; min-height: 150px;
  font-size: var(--text-label); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text); }
.spot--add:active { transform: none; }
