/* ============================================================================
   Wayfarer — travel journal portal
   Design language: warm paper, ink, and one deep accent. Deliberately NOT the
   emerald/dark console look of the ITAM portal next door: this portal is read
   on a phone in an airport at 6am, so it is light-first, high-contrast, and
   large-touch-target by default.
   ========================================================================= */

/* ---------- tokens ---------- */
:root {
  /* paper + ink */
  --bg:            #faf7f2;
  --bg-sunk:       #f3ede3;
  --surface:       #ffffff;
  --surface-2:     #fdfaf5;
  --surface-3:     #f6f0e6;
  --ink:           #1f1b16;
  --ink-2:         #4a423a;
  --ink-3:         #6f655a;
  --ink-4:         #948a7d;
  --line:          #e6ded1;
  --line-strong:   #d3c8b7;

  /* brand — terracotta, the colour of roof tiles and stamped tickets */
  --brand:         #b4512f;
  --brand-deep:    #8f3d22;
  --brand-ink:     #8f3d22;
  --brand-soft:    #f6e6df;
  --brand-tint:    rgba(180, 81, 47, .10);

  /* supporting */
  --ok:            #2f6b46;
  --ok-ink:        #245537;
  --ok-soft:       #e4efe7;
  --warn:          #a86b12;
  --warn-ink:      #8a570f;
  --warn-soft:     #faf0dc;
  --danger:        #a8342c;
  --danger-ink:    #8d2921;
  --danger-soft:   #fbe8e6;
  --info:          #2f6075;
  --info-ink:      #274f60;
  --info-soft:     #e3eef2;

  /* per-trip accents, chosen from a fixed set so nothing clashes */
  --acc-terracotta: #b4512f;
  --acc-ocean:      #2f6f8f;
  --acc-olive:      #5f7440;
  --acc-plum:       #7a4266;
  --acc-sand:       #a8873f;
  --acc-slate:      #4d5f70;

  /* type — a serif for headings reads as a journal, not a dashboard */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(31, 27, 22, .06);
  --sh-2: 0 1px 3px rgba(31, 27, 22, .07), 0 4px 12px rgba(31, 27, 22, .05);
  --sh-3: 0 2px 6px rgba(31, 27, 22, .08), 0 12px 32px rgba(31, 27, 22, .10);
  --sh-pop: 0 8px 20px rgba(31, 27, 22, .14), 0 2px 6px rgba(31, 27, 22, .08);

  --sidebar-w: 252px;
  --topbar-h: 60px;
  --maxw: 1240px;
  --pad: 24px;
}

/* Dark theme exists because a phone at night matters, and because a redeye flight is dark.
   It is a warm dark, not the blue-black of a code editor. */
:root[data-theme="dark"] {
  --bg:            #16130f;
  --bg-sunk:       #100e0b;
  --surface:       #201c17;
  --surface-2:     #262119;
  --surface-3:     #2d271e;
  --ink:           #f4efe6;
  --ink-2:         #d8cfc1;
  --ink-3:         #ab9f8d;
  --ink-4:         #857a6b;
  --line:          #332c23;
  --line-strong:   #463c2f;

  --brand:         #d9764f;
  --brand-deep:    #e8875f;
  --brand-ink:     #f0a184;
  --brand-soft:    #3a241b;
  --brand-tint:    rgba(217, 118, 79, .14);

  --ok:            #64ab7d;
  --ok-ink:        #8cc79f;
  --ok-soft:       #1c2c22;
  --warn:          #d8a445;
  --warn-ink:      #e3ba6e;
  --warn-soft:     #332a17;
  --danger:        #d3705f;
  --danger-ink:    #e79a8c;
  --danger-soft:   #3a201c;
  --info:          #6fa5bb;
  --info-ink:      #96c2d3;
  --info-soft:     #1b2a30;

  --acc-terracotta: #d9764f;
  --acc-ocean:      #5a9dc0;
  --acc-olive:      #93aa6d;
  --acc-plum:       #b378a1;
  --acc-sand:       #cbaa63;
  --acc-slate:      #7d93a8;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .40);
  --sh-2: 0 1px 3px rgba(0, 0, 0, .45), 0 4px 14px rgba(0, 0, 0, .35);
  --sh-3: 0 2px 8px rgba(0, 0, 0, .50), 0 14px 38px rgba(0, 0, 0, .45);
  --sh-pop: 0 10px 26px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .40);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }

/* Focus is visible everywhere, never removed. This is a keyboard-usable portal. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--brand-soft); color: var(--ink); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100%; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.1;
}
.brand-sub {
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-4);
}

.nav { padding: 10px 10px 16px; overflow-y: auto; flex: 1 1 auto; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-4); padding: 14px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  border: 0; background: none;
  width: 100%; text-align: left;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav-item.is-active {
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-weight: 600;
}
.nav-item .nav-ico { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11.5px;
  background: var(--surface-3);
  color: var(--ink-3);
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.nav-item.is-active .nav-count { background: var(--brand-soft); color: var(--brand-ink); }

.sidebar-foot { border-top: 1px solid var(--line); padding: 10px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 19px; }
.topbar .spacer { flex: 1 1 auto; }

.content { padding: var(--pad); max-width: var(--maxw); width: 100%; }
.content-wide { max-width: none; }

.menu-toggle { display: none; }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { min-height: 34px; width: 34px; padding: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-pad { padding: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.chip-planning  { background: var(--info-soft);   color: var(--info-ink); }
.chip-booked    { background: var(--warn-soft);   color: var(--warn-ink); }
.chip-travelling{ background: var(--brand-soft);  color: var(--brand-ink); }
.chip-completed { background: var(--ok-soft);     color: var(--ok-ink); }
.chip-cancelled { background: var(--surface-3);   color: var(--ink-4); text-decoration: line-through; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny  { font-size: 11.5px; }
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num   { font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--ink-4); }
.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: none; padding-right: 30px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ---------- trip cards ---------- */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.trip-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.trip-card:hover { box-shadow: var(--sh-3); transform: translateY(-2px); border-color: var(--line-strong); }
.trip-card-band {
  height: 78px;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 10px 14px;
  color: #fff;
}
.trip-card-band::after {
  /* a subtle printed-paper grain, so the band is not a flat colour block */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: .5;
}
.trip-card-band .band-inner { position: relative; z-index: 1; display: flex; flex-direction: column; }
.trip-card-band .band-country {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .11em;
  opacity: .9; font-weight: 600;
}
.trip-card-band .band-dest {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; line-height: 1.15;
}
.trip-card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1 1 auto; }
.trip-card-title { font-size: 15.5px; font-weight: 600; }
.trip-card-meta { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 12.5px; }
.trip-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-3);
}
.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brand-ink);
}
.countdown.is-now { color: var(--ok-ink); }
.countdown.is-past { color: var(--ink-4); font-weight: 600; }

.trip-card-tools {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: flex; gap: 4px;
  opacity: 0; pointer-events: none;
  transition: opacity .13s;
}
.trip-card:hover .trip-card-tools,
.trip-card:focus-within .trip-card-tools { opacity: 1; pointer-events: auto; }
.trip-card-tools .btn {
  min-height: 28px; width: 28px; padding: 0;
  background: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.6);
  color: #40382f;
  box-shadow: var(--sh-1);
}
.trip-card-tools .btn:hover { background: #fff; }

/* ---------- itinerary ---------- */
.itin-day {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin-bottom: 14px;
  overflow: hidden;
}
.itin-day-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.itin-day-num {
  width: 42px; flex: 0 0 42px;
  text-align: center;
}
.itin-day-num .n {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; line-height: 1;
  color: var(--brand-ink);
}
.itin-day-num .lbl {
  font-size: 9px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-4); font-weight: 600;
}
.itin-day-date { display: flex; flex-direction: column; min-width: 0; }
.itin-day-date .d { font-size: 14px; font-weight: 600; }
.itin-day-date .w { font-size: 11.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .07em; }
.itin-day-head .spacer { flex: 1 1 auto; }
.itin-day-body { padding: 8px 10px 12px; }

.act-row {
  display: grid;
  grid-template-columns: 62px 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px 8px;
  border-radius: var(--r-md);
  position: relative;
}
.act-row:hover { background: var(--surface-2); }
.act-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
  padding-top: 2px;
  white-space: nowrap;
}
.act-time .end { color: var(--ink-4); font-size: 11px; display: block; }
.act-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11px;
  margin-top: -1px;
}
.act-main { min-width: 0; padding-top: 1px; }
.act-title { font-size: 14px; font-weight: 500; }
.act-title.is-done { text-decoration: line-through; color: var(--ink-4); }
.act-sub { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-cost { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.act-tools {
  display: flex; gap: 2px;
  opacity: 0; pointer-events: none;
  transition: opacity .12s;
}
.act-row:hover .act-tools, .act-row:focus-within .act-tools { opacity: 1; pointer-events: auto; }

.kind-transport { background: var(--info-soft);   color: var(--info-ink); }
.kind-sight     { background: var(--brand-soft);  color: var(--brand-ink); }
.kind-food      { background: var(--warn-soft);   color: var(--warn-ink); }
.kind-activity  { background: var(--ok-soft);     color: var(--ok-ink); }
.kind-rest      { background: var(--surface-3);   color: var(--ink-3); }
.kind-checkin   { background: var(--ok-soft);     color: var(--ok-ink); }
.kind-checkout  { background: var(--surface-3);   color: var(--ink-3); }
.kind-shopping  { background: var(--brand-soft);  color: var(--brand-ink); }
.kind-note      { background: var(--surface-3);   color: var(--ink-3); }

.empty-day {
  padding: 14px 10px 10px;
  color: var(--ink-4);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}

/* ---------- booking / stay rows ---------- */
.booking {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.booking-rail { width: 5px; flex: 0 0 5px; }
.booking-body { padding: 12px 14px; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.booking-leg { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.booking-leg .arrow { color: var(--ink-4); font-weight: 400; }
.booking-times { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.booking-times b { color: var(--ink-2); font-weight: 600; }

.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-4); font-size: 12px; }
.kv dd { margin: 0; }

/* ---------- dashboard ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.hero-next {
  border-radius: var(--r-xl);
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 168px;
}
.hero-next::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 5px 5px; opacity: .45;
}
.hero-next > * { position: relative; z-index: 1; }
.hero-next .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; opacity: .92; font-weight: 700; }
.hero-next .dest { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1.08; }
.hero-next .when { font-size: 13.5px; opacity: .95; }
.hero-next .big-count { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.hero-next .big-count .n { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  display: flex; flex-direction: column; gap: 3px;
}
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); font-weight: 600; }
.stat .v { font-family: var(--font-display); font-size: 25px; font-weight: 700; line-height: 1.1; }
.stat .s { font-size: 11.5px; color: var(--ink-3); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-head h2 { font-size: 18px; }

/* money bar */
.money-row { display: flex; flex-direction: column; gap: 5px; }
.money-bar { height: 7px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.money-bar > span { display: block; height: 100%; border-radius: var(--r-full); background: var(--brand); }
.money-bar > span.is-over { background: var(--danger); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(22, 19, 15, .48);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px 16px;
  overflow-y: auto;
  animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  width: 100%; max-width: 520px;
  animation: rise .16s ease;
  margin-bottom: 5vh;
}
.modal.modal-lg { max-width: 720px; }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; flex: 1 1 auto; }
.modal-body { padding: 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed; z-index: 300;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  box-shadow: var(--sh-3);
  animation: rise .16s ease;
  max-width: min(90vw, 520px);
}
.toast.is-error { background: var(--danger); color: #fff; }
.toast.is-ok { background: var(--ok); color: #fff; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, var(--brand-tint), transparent 46%),
    radial-gradient(circle at 82% 88%, var(--brand-tint), transparent 42%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 384px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 30px 28px 26px;
}
.login-card .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 24px; margin-bottom: 16px; }
.login-card h1 { font-size: 25px; margin-bottom: 5px; }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 3px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px;
  border: 0; background: none;
  color: var(--ink-3);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand-ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- timeline ---------- */
.tl { position: relative; padding-left: 0; }
.tl-row {
  display: grid;
  grid-template-columns: 88px 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 0;
  position: relative;
}
.tl-date { font-size: 12px; color: var(--ink-3); text-align: right; padding-top: 10px; font-variant-numeric: tabular-nums; }
.tl-spine { position: relative; display: flex; justify-content: center; min-height: 42px; }
.tl-spine::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--line);
}
.tl-row:first-child .tl-spine::before { top: 12px; }
.tl-row:last-child .tl-spine::before { bottom: calc(100% - 12px); }
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--bg);
  margin-top: 7px;
  position: relative; z-index: 1;
}
.tl-card { padding: 9px 0 16px; min-width: 0; }
.tl-title { font-size: 14px; font-weight: 500; }
.tl-sub { font-size: 12px; color: var(--ink-3); }

/* ---------- misc ---------- */
.attach-row, .pack-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.pack-row.is-packed .pack-name { text-decoration: line-through; color: var(--ink-4); }
.check {
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer; padding: 0;
  color: transparent;
}
.check.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

.scrim {
  display: none;
  position: fixed; inset: 0; z-index: 39;
  background: rgba(22,19,15,.42);
  backdrop-filter: blur(2px);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--sh-3);
    width: min(84vw, 300px);
    flex-basis: auto;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  .menu-toggle { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .hero-next .dest { font-size: 27px; }
  .act-row { grid-template-columns: 52px 24px minmax(0, 1fr); }
  .act-tools { grid-column: 3; opacity: 1; pointer-events: auto; justify-content: flex-end; }
  .tl-row { grid-template-columns: 62px 16px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* print: a trip itinerary is the most printable thing in here */
@media print {
  .sidebar, .topbar, .trip-card-tools, .act-tools, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .itin-day { break-inside: avoid; box-shadow: none; }
}
