:root {
  --bg: #fffaf7;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #6a6a6a;
  --line: #ece6e0;
  --red: #ff385c;
  --red-dark: #d90f45;
  --sand: #f7efe8;
  --blue: #dff3ff;
  --green: #dff4e6;
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px, rgba(0, 0, 0, 0.10) 0 4px 8px;
  --shadow-lg: rgba(34, 34, 34, 0.12) 0 18px 50px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff0f3 0, transparent 34rem), linear-gradient(180deg, #fffaf7 0%, #fff 45%);
}
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.body-menu-open, .body-print-modal-open, .body-map-fullscreen { overflow: hidden; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}
.brand strong { display: block; font-size: 16px; letter-spacing: -.2px; }
.brand em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.menu-toggle, .menu-close {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}
.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  padding: 11px 16px;
}
.menu-toggle span:first-child { font-size: 18px; line-height: 1; }
.menu-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(34, 34, 34, .34);
  backdrop-filter: blur(3px);
}
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: min(340px, calc(100vw - 38px));
  height: 100vh;
  padding: 22px;
  background: rgba(255, 255, 255, .96);
  border-right: 1px solid rgba(0, 0, 0, .08);
  box-shadow: var(--shadow-lg);
  transform: translateX(-105%);
  transition: transform .22s ease;
  overflow-y: auto;
}
.side-menu.open { transform: translateX(0); }
.side-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.side-menu-head strong { display: block; margin-top: 4px; font-size: 24px; letter-spacing: -.8px; }
.quick-nav { display: grid; gap: 10px; }
.quick-nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 900;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: rgba(0, 0, 0, .03) 0 2px 8px;
}
.quick-nav a:hover, .quick-nav a:focus-visible { border-color: #ffc2cf; background: #fff7f9; }

.print-modal-backdrop[hidden], .print-modal[hidden] { display: none !important; }
.print-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(34, 34, 34, .42);
  backdrop-filter: blur(4px);
}
.print-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 42px);
  overflow-y: auto;
}
.print-modal-card {
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  overflow-y: auto;
  border-radius: 32px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 4vw, 34px);
}
.print-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.print-modal-head h2 { margin-bottom: 8px; }
.print-modal-head p { margin: 0; }
.print-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.print-picker-grid label {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: #fffaf7;
  font-weight: 900;
  cursor: pointer;
}
.print-picker-grid input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  flex: 0 0 auto;
}
.print-modal-hint { margin: 16px 0 0; font-size: 14px; }
.print-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

main { max-width: 1440px; margin: 0 auto; padding: 34px clamp(18px, 4vw, 56px) 80px; }
.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .72fr);
  gap: 32px;
  align-items: stretch;
}
.hero-copy {
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 246, 239, .9));
  padding: clamp(32px, 5vw, 70px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero-copy > * { position: relative; z-index: 1; }
.hero-copy:after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -140px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 56, 92, .09);
  pointer-events: none;
  z-index: 0;
}
.eyebrow, .mini { color: var(--red-dark); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
h1 { margin: 14px 0 18px; font-size: clamp(44px, 8vw, 96px); line-height: .92; letter-spacing: -4px; max-width: 870px; }
h2 { margin: 6px 0 10px; font-size: clamp(30px, 4vw, 52px); line-height: 1; letter-spacing: -1.8px; }
h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.5px; }
h4 { margin: 0 0 8px; font-size: 13px; color: var(--red-dark); text-transform: uppercase; letter-spacing: .08em; }
p { color: var(--muted); line-height: 1.55; }
.lead { font-size: clamp(18px, 2.2vw, 24px); max-width: 780px; color: #3f3f3f; }
.hero-actions { position: relative; z-index: 2; display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-action-status { min-height: 22px; margin: 10px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.primary, .ghost, .muted-button, .danger-button {
  appearance: none;
  border: 0;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}
.primary { background: var(--ink); color: white; }
.ghost { background: white; color: var(--ink); box-shadow: var(--shadow); }
.muted-button { background: #f4f0ec; color: var(--ink); }
.danger-button { background: #ffe7ed; color: #b9002d; padding: 10px 14px; font-size: 13px; }
.action-btn { width: fit-content; }

.trip-card {
  position: relative;
  min-height: 520px;
  border-radius: 36px;
  padding: 34px;
  color: white;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .42)), url('https://images.unsplash.com/photo-1502175353174-a7a70e73b362?auto=format&fit=crop&w=1300&q=80') center/cover;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.trip-chip, .energy, .stay-status, .priority {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
}
.private-chip { background: #fff3df; }
.topbar-logout { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.topbar-action { padding: 10px 16px; }
.trip-card h2 { font-size: 38px; color: white; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.trip-card p { color: rgba(255, 255, 255, .88); }
.countdown {
  margin-top: 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  padding: 20px;
  display: flex;
  align-items: end;
  gap: 12px;
  width: fit-content;
}
.countdown strong { font-size: 58px; line-height: .8; letter-spacing: -2px; }
.countdown span { max-width: 90px; font-weight: 800; color: var(--muted); }

.score-grid, .live-grid, .security-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.score-grid { margin: 28px 0 16px; }
.live-grid { margin: 0 0 28px; }
.security-summary-grid { margin: 0 0 22px; }
.score-card, .panel, .day-card, .stay-card, .place-card, .pack-card, .live-card {
  background: var(--surface);
  border-radius: 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, .04);
}
.score-card, .live-card { padding: 22px; }
.score-card span, .live-card span { color: var(--muted); font-weight: 800; font-size: 13px; }
.score-card strong, .live-card strong { display: block; margin: 8px 0; font-size: 34px; letter-spacing: -1px; }
.score-card small, .live-card small { color: var(--muted); }

.trip-mode-section { scroll-margin-top: 96px; }
.trip-mode-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 34px;
  background: linear-gradient(135deg, #202b52, #2f59ff 54%, #35c9ff);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.trip-mode-panel p { color: rgba(255,255,255,.9); margin: 0 0 18px; }
.trip-mode-panel .mini { color: rgba(255,255,255,.78); }
.trip-mode-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 8px 0 10px; }
.trip-mode-title-row h2 { color: #fff; margin: 0; max-width: 880px; }
.trip-mode-title-row .trip-chip { background: rgba(255,255,255,.92); color: #202b52; flex: 0 0 auto; }
.trip-mode-timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.trip-mode-timeline div, .trip-mode-card {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 22px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  padding: 14px;
}
.trip-mode-timeline strong, .trip-mode-card > span { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 1000; color: rgba(255,255,255,.75); margin-bottom: 8px; }
.trip-mode-timeline span { display: block; color: #fff; font-weight: 800; line-height: 1.35; margin: 6px 0; }
.trip-mode-side { display: grid; gap: 12px; align-content: start; }
.trip-mode-card strong { display: block; color: #fff; font-size: 17px; line-height: 1.25; }
.trip-mode-card small { display: block; color: rgba(255,255,255,.82); font-weight: 800; margin-top: 6px; }
.trip-mode-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.trip-mode-actions .primary { background: #fff; color: #202b52; }
.trip-mode-actions .ghost { background: rgba(255,255,255,.9); color: #202b52; box-shadow: none; }
.reminders-card ul { color: #fff; padding-left: 18px; }
.reminders-card li { margin: 7px 0; font-weight: 800; line-height: 1.35; }

.two-column, .wallet-grid, .workspace-grid, .share-grid, .security-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  margin: 30px 0;
  align-items: start;
}
.spending-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
  margin: 22px 0 0;
  align-items: start;
}
.secondary-grid { margin-top: 18px; }
.panel { padding: 26px; }
.section { margin-top: 58px; }
#calendar { scroll-margin-top: 96px; }
#security { scroll-margin-top: 96px; }
.section-heading.wide { max-width: 900px; margin-bottom: 20px; }

.access-log-list { display: grid; gap: 12px; }
.access-log-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf5;
}
.access-log-row div { min-width: 0; display: grid; gap: 4px; }
.access-log-row strong, .access-log-row span, .access-log-row small { overflow-wrap: anywhere; }
.access-log-row span { color: #3f3f3f; font-weight: 800; }
.access-log-row small { color: var(--muted); }
.compact-log { max-height: 620px; overflow: auto; padding-right: 4px; }
.compact-row { display: block; }

.gap-list { display: grid; gap: 12px; }
.gap {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: #fff8f5;
  border: 1px solid #f3dfd8;
}
.gap p { margin: 0 0 6px; }
.gap small { color: var(--muted); font-weight: 700; }
.priority-high .priority { background: #ffe0e7; color: #b9002d; }
.priority-medium .priority { background: #fff2cd; color: #896300; }
.priority-low .priority { background: #eaf7ef; color: #1c7640; }
.link-stack { display: grid; gap: 10px; margin-top: 18px; }
.link-stack a { text-decoration: none; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 4px; }
.link-stack span { color: var(--muted); font-size: 13px; }
.helper-list { margin: 14px 0 0; padding-left: 18px; color: #3f3f3f; }
.helper-list li { margin: 8px 0; }
.helper-list.compact li { margin: 6px 0; }

.day-controls {
  position: sticky;
  top: 82px;
  z-index: 10;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  margin-bottom: 18px;
}
.filter {
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
}
.filter.active { background: var(--red); color: #fff; }
.timeline { display: grid; gap: 16px; }
.day-card { display: grid; grid-template-columns: 112px 1fr; padding: 18px; transition: opacity .2s, transform .2s; }
.day-card.hidden { display: none; }
.date-block {
  min-height: 100%;
  border-radius: 20px;
  background: var(--sand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.date-block span { color: var(--red-dark); font-weight: 900; }
.date-block strong { font-size: 24px; line-height: 1.05; }
.day-main { padding: 4px 0 4px 18px; }
.day-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.energy { background: #f2f2f2; color: var(--ink); }
.base { margin: 0 0 16px; }
.day-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.day-columns div { background: #fbfaf8; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
ul { margin: 0; padding-left: 18px; color: #3f3f3f; }
li { margin: 5px 0; }
.day-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 700; }

.drive-section { scroll-margin-top: 96px; }
.drive-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; }
.drive-summary-card {
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(135deg, #202b52, #3d62ff);
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 6px;
}
.drive-summary-card.accent { background: linear-gradient(135deg, #ff385c, #ff8a3d); }
.drive-summary-card.poi-accent { background: linear-gradient(135deg, #0f8b5f, #35c9ff); }
.drive-summary-card span { font-size: 12px; text-transform: uppercase; letter-spacing: .11em; font-weight: 1000; opacity: .82; }
.drive-summary-card strong { font-size: clamp(36px, 5vw, 62px); letter-spacing: -2px; line-height: .95; }
.drive-summary-card small { color: rgba(255,255,255,.86); font-weight: 800; }
.drive-route-list { display: grid; gap: 14px; }
.drive-leg {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,.04);
  box-shadow: var(--shadow);
}
.drive-date {
  border-radius: 20px;
  background: #f4f8ff;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  min-height: 124px;
  padding: 14px;
}
.drive-date span { color: var(--red-dark); font-weight: 1000; }
.drive-date strong { font-size: 32px; line-height: 1; letter-spacing: -1px; }
.drive-leg-main { display: grid; gap: 14px; }
.drive-leg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drive-leg-top p { margin: 0; }
.drive-pill { flex: 0 0 auto; border-radius: 999px; padding: 8px 12px; background: #f2f2f2; font-size: 12px; font-weight: 1000; }
.drive-long .drive-pill { background: #ffe7ed; color: #b9002d; }
.drive-medium .drive-pill { background: #fff3df; color: #925500; }
.drive-easy .drive-pill { background: #e7f8ed; color: #14733b; }
.drive-metrics { display: grid; grid-template-columns: .8fr .7fr 1.4fr; gap: 10px; }
.drive-metrics div { border-radius: 18px; background: #fbfaf8; border: 1px solid var(--line); padding: 13px; display: grid; gap: 5px; }
.drive-metrics span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.drive-metrics strong { font-size: 17px; }
.drive-source-note { margin: 14px 0 0; padding: 14px 18px; border-radius: 18px; background: #fff7f9; border: 1px solid #ffd4df; font-weight: 800; color: #5b4a4f; }

.map-layout { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.map-card {
  position: sticky;
  top: 152px;
  min-height: 660px;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, #f6fbff, #eef7ff);
  border: 1px solid rgba(61, 98, 255, .16);
}
.map-card-live { display: grid; grid-template-rows: auto minmax(520px, 1fr) auto; }
.map-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(244,249,255,.92));
  border-bottom: 1px solid rgba(61, 98, 255, .14);
}
.map-toolbar div { display: grid; gap: 4px; }
.map-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.map-fullscreen-toggle, .map-fullscreen-close { padding: 10px 14px; font-size: 13px; }
.map-fullscreen-close { display: none; }
.map-card.map-fullscreen {
  position: fixed;
  inset: 0;
  top: 0;
  z-index: 70;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  border: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.map-card.map-fullscreen .trip-map {
  min-height: 0;
  height: 100%;
}
.map-card.map-fullscreen .map-toolbar {
  align-items: center;
  padding: 14px clamp(14px, 3vw, 28px);
}
.map-card.map-fullscreen .map-fullscreen-toggle { display: none; }
.map-card.map-fullscreen .map-fullscreen-close { display: inline-flex; }
.map-card.map-fullscreen .map-footnote { padding: 10px clamp(14px, 3vw, 28px); }
.map-toolbar small, .map-footnote { color: var(--muted); }
.trip-map { width: 100%; min-height: 560px; height: 100%; }
.map-footnote { margin: 0; padding: 12px 18px 18px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.88); }
.map-mobile-controls-toggle { display: none; }
.route-story-panel {
  position: absolute;
  left: 18px;
  bottom: 58px;
  z-index: 460;
  width: min(390px, calc(100% - 36px));
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .7);
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(243,248,255,.9));
  box-shadow: 0 22px 55px rgba(18, 31, 70, .26);
  backdrop-filter: blur(14px);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.route-story-head { display: grid; gap: 4px; }
.route-story-head strong { font-size: 18px; letter-spacing: -.4px; }
.route-story-head small { color: var(--muted); font-weight: 800; }
.route-story-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.route-story-actions .action-btn { padding: 9px 12px; font-size: 12px; }
.route-story-actions button:disabled { opacity: .45; cursor: not-allowed; }
.route-speed-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 16px;
  background: rgba(47,89,255,.08);
  border: 1px solid rgba(47,89,255,.12);
  color: #1d2d5b;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.route-speed-control select {
  border: 1px solid rgba(29,45,91,.16);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  color: #1d2d5b;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}
.route-progress-bar { height: 8px; border-radius: 999px; background: rgba(47,89,255,.13); overflow: hidden; }
.route-progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ff385c, #ffb000, #18a982); transition: width .25s ease; }
.route-story-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: stretch; }
.route-story-card img, .route-story-placeholder { width: 96px; height: 112px; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }
.route-story-card img { object-fit: cover; }
.route-story-placeholder { display: grid; place-items: center; font-size: 34px; background: linear-gradient(145deg, #fff2d7, #e8f2ff); }
.route-story-copy { display: grid; gap: 4px; min-width: 0; }
.route-story-copy span { color: var(--red-dark); font-weight: 1000; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.route-story-copy h4 { margin: 0; color: #1d2d5b; text-transform: none; letter-spacing: -.3px; font-size: 14px; }
.route-story-copy p { margin: 0; font-size: 12px; line-height: 1.35; color: #4d5668; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.route-story-copy small { color: var(--muted); font-weight: 800; font-size: 11px; }
.route-arrow-icon-wrapper, .route-travel-icon-wrapper { background: transparent; border: 0; }
.route-arrow-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2f59ff, #1d2d5b);
  border: 2px solid rgba(255,255,255,.96);
  box-shadow: 0 8px 18px rgba(29,45,91,.32);
  font-size: 18px;
  line-height: 1;
}
.poi-route-arrow { background: linear-gradient(135deg, #ff9f1c, #ff385c); }
.route-travel-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, #ffe9ef 42%, #ff385c 100%);
  border: 3px solid #fff;
  box-shadow: 0 0 0 5px rgba(255,56,92,.18), 0 14px 34px rgba(16, 30, 64, .35);
  font-size: 20px;
}
.animated-route-trail { filter: drop-shadow(0 0 8px rgba(255, 56, 92, .72)); }
.chronological-route-leg { filter: drop-shadow(0 2px 5px rgba(47, 89, 255, .26)); }
.poi-route-leg { filter: drop-shadow(0 2px 5px rgba(255, 159, 28, .28)); }
.map-card.map-fullscreen .route-story-panel { left: clamp(14px, 3vw, 28px); bottom: 56px; width: min(440px, calc(100vw - 28px)); }
.leaflet-container {
  font: inherit;
  background: #dceefe;
}
.leaflet-control-layers,
.leaflet-bar,
.leaflet-popup-content-wrapper {
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(28, 42, 82, .18);
}
.leaflet-control-layers-expanded {
  padding: 12px 14px;
  min-width: 188px;
}
.leaflet-control-layers label { font-weight: 700; }
.leaflet-popup-content { margin: 14px 16px; min-width: 220px; }
.leaflet-popup-content h3 { margin: 0 0 6px; font-size: 16px; }
.leaflet-popup-content p { margin: 0 0 8px; }
.leaflet-popup-content small { display: block; color: var(--muted); margin-top: 4px; }
.map-popup-link { display: inline-flex; margin-top: 10px; font-weight: 900; color: var(--red-dark); text-decoration: none; }
.map-popup-link:hover { text-decoration: underline; }
.hotel-map-marker,
.poi-map-marker {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 1000;
  border: 3px solid rgba(255,255,255,.96);
  box-shadow: 0 10px 24px rgba(21, 33, 64, .28);
}
.hotel-map-marker {
  width: 42px;
  height: 42px;
  border-radius: 16px 16px 16px 4px;
  background: linear-gradient(135deg, #202b52, #3d62ff);
  transform: rotate(-8deg);
}
.hotel-map-marker span { transform: rotate(8deg); }
.poi-map-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5d74, #ff385c);
  font-size: 11px;
}
.poi-map-marker span { transform: translateY(-.5px); }
.place-list { display: grid; gap: 12px; }
.place-card { text-decoration: none; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px; }
.place-index { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 1000; }
.hotel-place-card { grid-template-columns: 88px 1fr; border: 1px solid rgba(61, 98, 255, .24); background: linear-gradient(135deg, #ffffff, #f3f6ff); }
.hotel-place-media { position: relative; width: 88px; height: 88px; }
.hotel-place-photo { width: 88px; height: 88px; border-radius: 18px; object-fit: cover; display: block; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.hotel-place-media .hotel-index { position: absolute; left: 8px; bottom: 8px; }
.hotel-index { border-radius: 14px 14px 14px 4px; background: linear-gradient(135deg, #202b52, #3d62ff); }
.place-card p { margin: 0 0 6px; }
.place-card small { display: block; color: var(--muted); font-weight: 800; }
.poi-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}
.poi-info-grid span {
  border-radius: 14px;
  background: #fffaf5;
  border: 1px solid #efe4d8;
  padding: 9px 10px;
  color: #3f3f3f;
  font-size: 12px;
  font-weight: 800;
}
.poi-info-grid strong { display: block; color: var(--red-dark); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.poi-drive-time {
  margin: 10px 0 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f4fbff, #fff7f9);
  border: 1px solid rgba(61, 98, 255, .14);
  display: grid;
  gap: 3px;
}
.poi-drive-time strong { color: var(--ink); font-size: 15px; }
.poi-drive-time span { color: #2d5e85; font-size: 13px; font-weight: 900; }
.poi-drive-time small { color: var(--muted); font-size: 12px; }

.stay-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.stay-card { min-height: 360px; padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 14px; justify-content: space-between; }
.stay-photo-wrap { position: relative; }
.stay-photo { width: 100%; height: 164px; border-radius: 22px; object-fit: cover; display: block; }
.stay-status { width: fit-content; background: #f2f2f2; }
.stay-photo-wrap .stay-status { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); }
.stay-copy { display: grid; gap: 10px; }
.stay-copy div { display: grid; gap: 4px; }
.stay-copy span, .stay-copy small { color: var(--muted); font-size: 13px; }
.stay-confirmation { margin-top: 8px; padding: 10px 12px; border: 1px solid rgba(13, 110, 253, .18); border-radius: 14px; background: rgba(13, 110, 253, .06); }
.stay-confirmation small { color: var(--ink); }

.flight-overview { display: grid; grid-template-columns: .95fr 1.05fr; gap: 16px; margin-bottom: 16px; }
.flight-summary-chips, .flight-party { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.traveler-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.traveler-card { border: 1px solid rgba(61, 98, 255, .16); border-radius: 18px; padding: 14px; background: #fff; display: grid; gap: 4px; }
.traveler-card small, .flight-fact-list small, .flight-detail-grid small, .wallet-copy { color: var(--muted); }
.flight-fact-list { display: grid; gap: 14px; margin-top: 12px; }
.flight-fact-list div { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid rgba(20, 20, 20, .08); }
.flight-fact-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.flight-grid { display: grid; gap: 12px; }
.flight-grid-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flight-card { border: 1px solid rgba(61, 98, 255, .16); border-radius: 22px; padding: 16px; background: linear-gradient(180deg, #ffffff, #f8fbff); display: grid; gap: 10px; }
.flight-card-section { min-height: 100%; }
.flight-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flight-card-top small { color: var(--muted); font-weight: 800; }
.flight-route { margin: 0; font-size: 24px; font-weight: 1000; letter-spacing: -.8px; }
.flight-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flight-times div { display: grid; gap: 4px; }
.flight-times span, .flight-card small { color: var(--muted); }
.flight-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flight-detail-grid > div { display: grid; gap: 4px; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.72); }
.flight-travelers-row { grid-column: 1 / -1; }
.seat-list { display: grid; gap: 8px; margin-top: 4px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.72); border: 1px solid rgba(61, 98, 255, .14); }
.seat-list h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.seat-list p { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.seat-row { display: grid; gap: 3px; }
.seat-row small { color: var(--muted); font-weight: 800; }
.wallet-copy { margin: 8px 0 16px; }
.wallet-subtitle { margin: 22px 0 12px; }

.reservation-list { display: grid; gap: 12px; }
.reservation { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 18px; }
.reservation > span { color: var(--red-dark); font-weight: 1000; font-size: 12px; text-transform: uppercase; }
.reservation small { display: block; color: var(--muted); margin-top: 4px; }
.document-panel { grid-column: 1 / -1; }
.document-list { display: grid; gap: 12px; }
.document-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(61, 98, 255, .18);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  color: var(--ink);
  text-decoration: none;
}
.document-card:hover, .document-card:focus-visible { border-color: var(--blue); box-shadow: var(--shadow); }
.document-type { color: var(--red-dark); font-weight: 1000; font-size: 12px; text-transform: uppercase; }
.document-card small { display: block; color: var(--muted); margin-top: 4px; font-weight: 800; }
.document-card p { margin: 6px 0 0; color: var(--muted); }
.document-card em { color: var(--blue); font-style: normal; font-weight: 1000; white-space: nowrap; }
.budget-total { font-size: 54px; font-weight: 1000; letter-spacing: -2px; margin: 8px 0 18px; }
.budget-bars { display: grid; gap: 13px; }
.budget-row { display: grid; gap: 6px; }
.budget-row div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.budget-row div span { color: var(--muted); font-weight: 800; }
.budget-row i { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--red) var(--pct), #f2f2f2 var(--pct)); }
.budget-row small { color: var(--muted); }
.budget-row-unspecified i { background: repeating-linear-gradient(90deg, #e9edf3 0 10px, #f6f7fa 10px 20px); }
.budget-row-unspecified div span { color: #7d8795; }

.field { display: grid; gap: 8px; }
.field span { font-weight: 800; color: #3f3f3f; }
.field-wide { grid-column: 1 / -1; }
.text-input, .select-input, .textarea-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.textarea-input { resize: vertical; min-height: 120px; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.status-line { min-height: 20px; margin: 12px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.status-line.success { color: #1c7640; }
.status-line.error { color: #b9002d; }

.saved-notes-list { display: grid; gap: 10px; margin-top: 18px; }
.saved-note-card {
  border: 1px solid var(--line);
  background: #fffaf7;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.saved-note-card strong { font-size: 14px; }
.saved-note-card span { color: var(--muted); }
.empty-state {
  border: 1px dashed #d9cfc6;
  border-radius: 20px;
  padding: 18px;
  color: var(--muted);
  background: #fbfaf8;
}

.expense-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-group {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  margin: 0;
}
.check-group legend { padding: 0 8px; font-weight: 900; color: var(--red-dark); }
.check-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fffaf7;
  cursor: pointer;
}
.check-pill input { accent-color: var(--red); }

.expense-list { display: grid; gap: 12px; }
.expense-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fff;
}
.expense-top { display: flex; justify-content: space-between; gap: 16px; }
.expense-top p { margin: 4px 0 0; }
.expense-money-wrap { display: grid; gap: 10px; justify-items: end; align-content: start; }
.expense-money { font-size: 26px; letter-spacing: -.5px; }
.expense-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.expense-meta span {
  background: #f4f0ec;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  color: #4d4d4d;
}

.balance-list, .budget-compare-list, .expense-type-list { display: grid; gap: 12px; }
.balance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  align-items: center;
}
.balance-row small { display: block; color: var(--muted); margin-top: 4px; }
.balance-row.positive span { color: #1c7640; font-weight: 900; }
.balance-row.negative span { color: #b9002d; font-weight: 900; }
.balance-row.even span { color: var(--muted); font-weight: 900; }

.compare-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfaf8;
}
.compare-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.compare-head span { color: var(--muted); font-weight: 800; }
.compare-bar { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--red) var(--pct), #efe8e1 var(--pct)); }
.compare-row small { color: var(--muted); }
.panel-note { color: var(--muted); margin: -4px 0 14px; font-size: 14px; }
.expense-type-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, #fbfaf8);
}
.expense-type-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.expense-type-head span { font-weight: 1000; font-size: 20px; color: var(--red); }
.expense-type-bar { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--ink) var(--pct), #efe8e1 var(--pct)); }
.expense-type-row small { color: var(--muted); font-weight: 800; }

.packing-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.pack-card { padding: 20px; }
.pack-card label { display: flex; gap: 10px; margin: 10px 0; color: #3f3f3f; cursor: pointer; }
.pack-card input { accent-color: var(--red); }
.pack-card label.done span { text-decoration: line-through; color: #999; }

.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.footer { max-width: 1440px; margin: 0 auto; padding: 24px clamp(18px, 4vw, 56px) 40px; color: var(--muted); }
.app-version { margin-top: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6f6b66; }
code { background: #f4f0ec; padding: 3px 6px; border-radius: 8px; }

.login-body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, #fff0f3 0, transparent 34rem), linear-gradient(180deg, #fffaf7 0%, #fff 45%);
}
.login-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px clamp(18px, 4vw, 56px) 80px;
}
.login-shell {
  max-width: 760px;
  margin: 0 auto;
}
.login-panel { padding: 28px; }
.login-title {
  margin: 8px 0 12px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: .98;
  letter-spacing: -2px;
}
.login-form { display: grid; gap: 16px; margin-top: 20px; }
.auth-status {
  margin: 0;
  border-radius: 18px;
  border: 1px solid #efe4d8;
  background: #fffaf5;
  padding: 14px 16px;
}
.auth-status-error {
  border-color: #ffc7d2;
  background: #fff1f4;
  color: #b9002d;
}
.auth-status-pending {
  border-color: #ffe08a;
  background: #fff8d8;
  color: #7a5200;
}
.security-actions { display: grid; gap: 8px; justify-items: end; }
.security-actions form { margin: 0; }
.device-row.pending-device { border-color: #f3cf72; background: #fff8df; }
.login-footer { margin-top: 0; }
.login-actions { margin-top: 0; }

@media (max-width: 1180px) {
  .hero, .two-column, .wallet-grid, .workspace-grid, .share-grid, .security-grid, .map-layout, .spending-grid, .flight-overview, .flight-grid-section, .drive-summary-grid, .login-shell { grid-template-columns: 1fr; }
  .score-grid, .live-grid, .security-summary-grid, .stay-grid, .packing-grid, .traveler-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-card { position: relative; top: auto; min-height: 520px; }
  .flight-times, .flight-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { align-items: center; gap: 14px; }
  .topbar-left { flex: 1; }
  .brand em { display: none; }
  .topbar-actions, .topbar-logout { justify-content: flex-start; }
  .menu-toggle { padding: 10px 13px; }
  .menu-toggle span:last-child { display: none; }
  main { padding-top: 18px; }
  .login-main { padding-top: 18px; }
  .hero { display: block; }
  .traveler-grid { grid-template-columns: 1fr; }
  .trip-card { margin-top: 18px; min-height: 440px; }
  h1 { letter-spacing: -2px; }
  .score-grid, .live-grid, .security-summary-grid, .stay-grid, .packing-grid, .form-grid { grid-template-columns: 1fr; }
  .day-card { grid-template-columns: 1fr; }
  .drive-leg { grid-template-columns: 1fr; }
  .drive-date { min-height: auto; grid-template-columns: auto 1fr; justify-content: start; gap: 10px; }
  .drive-leg-top { display: grid; }
  .drive-metrics { grid-template-columns: 1fr; }
  .poi-info-grid { grid-template-columns: 1fr; }
  .day-main { padding: 16px 0 0; }
  .day-columns, .day-footer { grid-template-columns: 1fr; }
  #calendar { scroll-margin-top: 146px; }
  .day-controls { border-radius: 24px; top: 132px; }
  .map-card { min-height: 460px; }
  .expense-top, .compare-head, .balance-row { flex-direction: column; align-items: flex-start; }
  .document-card { grid-template-columns: 1fr; }
  .document-card em { white-space: normal; }
  .expense-money-wrap { justify-items: start; }
  .access-log-row { display: grid; }
  .hero-action-status { text-align: center; }
  .print-picker-grid { grid-template-columns: 1fr; }
  .print-modal { align-items: start; padding: 14px; }
  .print-modal-card { border-radius: 24px; max-height: none; }
  .print-modal-head, .print-modal-actions { display: grid; }
  .share-actions, .inline-actions, .topbar-logout { flex-direction: column; align-items: stretch; }
  .action-btn, .primary, .ghost, .muted-button { width: 100%; text-align: center; }
  .map-mobile-controls-toggle {
    display: inline-flex;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(29,45,91,.92);
    color: #fff;
    box-shadow: 0 12px 28px rgba(18,31,70,.28);
    font-weight: 1000;
    font-size: 12px;
    letter-spacing: .02em;
  }
  .map-card.map-controls-hidden .route-story-panel,
  .map-card.map-controls-hidden .leaflet-control-layers { display: none !important; }
  .route-story-panel { left: 10px; right: 10px; bottom: 48px; width: auto; padding: 12px; border-radius: 20px; }
  .route-story-card { grid-template-columns: 72px 1fr; }
  .route-story-card img, .route-story-placeholder { width: 72px; height: 92px; border-radius: 16px; }
  .route-story-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .route-story-actions .action-btn { width: 100%; }
  .route-speed-control { display: grid; align-items: stretch; }
  .route-speed-control select { width: 100%; }
  .route-story-head strong { font-size: 15px; }
  .route-story-copy p { -webkit-line-clamp: 2; }
}

@media print {
  .topbar, .side-menu, .menu-backdrop, .print-modal, .print-modal-backdrop, .hero-actions, .day-controls, .share-actions, .status-line, .danger-button, #clearDayNoteBtn, #saveTripNoteBtn, #saveDayNoteBtn { display: none !important; }
  body { background: #fff; }
  .print-exclude { display: none !important; }
  .panel, .day-card, .stay-card, .place-card, .pack-card, .score-card, .live-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .map-card { display: none; }
}

@media (max-width: 980px) {
  .trip-mode-panel { grid-template-columns: 1fr; }
  .trip-mode-title-row { display: grid; }
  .trip-mode-timeline { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .trip-mode-panel { border-radius: 26px; padding: 18px; }
  .trip-mode-actions .action-btn { width: 100%; text-align: center; }
}
