:root {
  color-scheme: light;
  --ink: #16211f;
  --muted: #63706d;
  --paper: #f2f5f3;
  --panel: #ffffff;
  --line: #d8e1dd;
  --teal: #0f766e;
  --teal-dark: #0b4f49;
  --coral: #bd5342;
  --gold: #a8741e;
  --river: #266b8b;
  --shadow: 0 18px 45px rgba(20, 45, 39, 0.13);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.2, 1.35, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    "PingFang TC",
    system-ui,
    sans-serif;
  line-height: 1.65;
}

body.view-mode {
  scroll-padding-top: 82px;
}

body.view-mode .hero {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.hero {
  min-height: min(520px, 70vh);
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
  color: #fffdf7;
  background:
    linear-gradient(90deg, rgba(9, 28, 26, 0.82), rgba(9, 28, 26, 0.35) 62%, rgba(9, 28, 26, 0.18)),
    linear-gradient(0deg, rgba(9, 28, 26, 0.64), rgba(9, 28, 26, 0.04) 52%),
    url("assets/bangkok-hero.png") center 56% / cover no-repeat;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(16, 23, 20, 0.28);
  backdrop-filter: blur(14px);
}

.nav-links a {
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.94rem;
  text-align: center;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.nav-sync {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

.hero-sync-button {
  display: none;
}

.sync-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9ba9a5;
  box-shadow: 0 0 0 3px rgba(155, 169, 165, 0.18);
}

html[data-sync-state="synced"] .sync-dot {
  background: #2db5a5;
  box-shadow: 0 0 0 3px rgba(45, 181, 165, 0.2);
}

html[data-sync-state="syncing"] .sync-dot {
  background: #e3ad48;
  box-shadow: 0 0 0 3px rgba(227, 173, 72, 0.2);
  animation: sync-pulse 1.2s ease-in-out infinite;
}

html[data-sync-state="error"] .sync-dot {
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(189, 83, 66, 0.18);
}

.hero-copy {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  align-self: end;
  padding: 34px 0 58px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd27a;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(3.2rem, 7vw, 5.7rem);
  line-height: 0.98;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.hero-text {
  max-width: 640px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  font-weight: 750;
}

.hero-facts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-facts span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffd27a;
}

.hero-plan-button {
  gap: 8px;
}

.hero-plan-button svg,
.home-all-plan svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 800;
  transition:
    transform 160ms var(--ease-spring),
    box-shadow 180ms var(--ease-out),
    background 180ms var(--ease-out),
    border-color 180ms var(--ease-out);
}

.button:active,
.tool-button:active,
.action-link:active,
.dock-button:active,
.bottom-nav-item:active,
.fab:active,
.icon-button:active,
.appbar-button:active {
  transform: scale(0.96);
}

.button.primary {
  background: #ffd27a;
  color: #2a2116;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.48);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-appbar {
  display: none;
}

.app-dock {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  justify-content: center;
  overflow-x: auto;
  padding: 10px max(16px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(16px);
  animation: dock-drop 460ms var(--ease-out) both;
}

.dock-button,
.bottom-nav-item {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.dock-button {
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 40px;
  padding: 8px 14px;
  transition:
    transform 160ms var(--ease-spring),
    background 180ms var(--ease-out),
    color 180ms var(--ease-out),
    border-color 180ms var(--ease-out);
}

.dock-sync {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.dock-button.active,
.bottom-nav-item.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.section-panel[hidden] {
  display: none !important;
}

.section-panel:not([hidden]) {
  animation: panel-enter 240ms var(--ease-out) both;
}

.section,
.band {
  padding: 80px max(16px, calc((100% - 1180px) / 2));
}

.band {
  background: #f8faf9;
}

.home-hub {
  padding-top: 42px;
  padding-bottom: 64px;
}

.home-section-head,
.home-subhead,
.flight-card-head,
.flight-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-section-head {
  margin-bottom: 22px;
}

.home-section-head .eyebrow {
  margin-bottom: 5px;
}

.home-section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.home-all-plan {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 1px solid #bdd5cf;
  border-radius: 6px;
  background: #e8f3f0;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.home-all-plan svg {
  width: 15px;
  height: 15px;
}

.flight-section {
  margin-bottom: 18px;
}

.home-subhead {
  margin-bottom: 10px;
}

.home-subhead h3 {
  margin: 0;
  font-size: 1rem;
}

.home-subhead span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.flight-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flight-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 35, 32, 0.065);
}

.flight-card.inbound {
  border-top-color: var(--river);
}

.flight-card-head {
  justify-content: flex-start;
}

.flight-card-head strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.flight-card-head time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.flight-direction {
  min-width: 38px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #e5f2ef;
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
}

.inbound .flight-direction {
  background: #e9f1f6;
  color: #205f79;
}

.flight-route {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(70px, 1fr) minmax(64px, auto);
  gap: 10px;
  align-items: center;
  margin: 15px 0 13px;
}

.flight-airport {
  display: grid;
  line-height: 1.2;
}

.flight-airport.end {
  text-align: right;
}

.flight-airport strong {
  color: var(--ink);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.flight-airport span {
  margin-top: 3px;
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 950;
}

.flight-airport small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.flight-track {
  min-width: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
}

.flight-track > div {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
}

.flight-track i {
  height: 1px;
  background: #b8c7c2;
}

.flight-track svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inbound .flight-track svg {
  stroke: var(--river);
}

.flight-card-foot {
  padding-top: 10px;
  border-top: 1px solid #edf0ef;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.home-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.home-status div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  text-align: center;
}

.home-status div + div {
  border-left: 1px solid var(--line);
}

.home-status strong {
  color: var(--teal-dark);
  font-size: 1.2rem;
}

.home-status span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.sync-card {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  margin: -7px 0 18px;
  padding: 10px 12px;
  border: 1px solid #c7dcd7;
  border-radius: 8px;
  background: #edf6f3;
  color: var(--ink);
  text-align: left;
  transition:
    transform 160ms var(--ease-spring),
    border-color 180ms var(--ease-out),
    background 180ms var(--ease-out);
}

.sync-card:active {
  transform: scale(0.985);
}

.sync-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
}

.sync-card-icon svg,
.sync-state-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sync-card-copy {
  min-width: 0;
  display: grid;
  line-height: 1.3;
}

.sync-card-copy strong {
  font-size: 0.9rem;
}

.sync-card-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-card-action {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.trip-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.focus-card,
.home-shortcut {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 35, 32, 0.06);
}

.focus-card {
  padding: 20px;
  border-left: 5px solid var(--teal);
}

.focus-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.focus-card p {
  margin: 0;
  color: var(--muted);
}

.focus-next-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  margin: 10px 0 6px;
}

.focus-next-row span {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.focus-next-row strong {
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-shortcut {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  transition:
    transform 180ms var(--ease-spring),
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
}

.home-shortcut strong {
  display: block;
  font-size: 0.94rem;
}

.home-shortcut small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.home-shortcut-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7f2ef;
  color: var(--teal-dark);
}

.home-shortcut-icon svg,
.home-shortcut-arrow svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-shortcut-arrow {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #8ba29c;
}

.home-shortcut:active {
  transform: scale(0.98);
}

.summary-grid,
.booking-grid,
.shopping-layout,
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.summary-grid article,
.booking-card,
.quick-card,
.shopping-card,
.note,
.check-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 35, 32, 0.06);
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    border-color 220ms var(--ease-out);
}

.summary-grid article:hover,
.focus-card:hover,
.home-shortcut:hover,
.booking-card:hover,
.quick-card:hover,
.shopping-card:hover,
.note:hover,
.check-card:hover,
.map-card:hover,
.timeline-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(28, 35, 32, 0.1);
}

.summary-grid article {
  padding: 22px;
}

.metric {
  display: block;
  margin-bottom: 14px;
  color: var(--teal);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.summary-grid p,
.booking-card p,
.quick-card p,
.shopping-card li,
.note p,
.check-card span {
  margin: 0;
  color: var(--muted);
}

.section-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 0.88fr);
  gap: 20px;
  align-items: end;
  margin-bottom: 28px;
}

.section-top .section-heading {
  margin-bottom: 0;
}

.planner-shell {
  position: sticky;
  top: 62px;
  z-index: 12;
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 28px rgba(28, 35, 32, 0.08);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: end;
}

.search-field {
  display: grid;
  gap: 4px;
  min-width: min(100%, 230px);
}

.search-field span,
.trip-form label > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-field input,
.trip-form input,
.trip-form select,
.trip-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

.trip-form textarea {
  min-height: 96px;
  resize: vertical;
}

.tool-button,
.action-link,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  transition:
    transform 160ms var(--ease-spring),
    background 180ms var(--ease-out),
    color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
}

.tool-button.strong,
.tool-button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.tool-button.danger {
  color: #9c392b;
}

.tool-button.danger:hover,
.tool-button.danger:focus-visible {
  border-color: var(--coral);
  background: #fbe3dc;
}

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 14px;
  margin-bottom: 18px;
}

.day-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.current-day {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--teal-dark);
  font-weight: 900;
  text-align: center;
}

.day-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-width: 126px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms var(--ease-spring),
    background 180ms var(--ease-out),
    border-color 180ms var(--ease-out);
}

.day-tab strong,
.day-tab span,
.day-tab small {
  display: block;
}

.day-tab span,
.day-tab small {
  color: var(--muted);
  font-size: 0.8rem;
}

.day-tab small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.18);
}

.day-tab.active span,
.day-tab.active small {
  color: rgba(255, 255, 255, 0.78);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline.fresh .timeline-item,
.timeline.fresh .timeline-connector,
.timeline.fresh .empty-state {
  animation: card-rise 260ms var(--ease-out) both;
}

.timeline.fresh .timeline-item:nth-child(2) {
  animation-delay: 24ms;
}

.timeline.fresh .timeline-item:nth-child(3) {
  animation-delay: 48ms;
}

.timeline.fresh .timeline-item:nth-child(4) {
  animation-delay: 72ms;
}

.timeline.fresh .timeline-item:nth-child(n + 5) {
  animation-delay: 90ms;
}

.timeline-item {
  position: relative;
  display: block;
  margin-bottom: 0;
  padding: 12px 14px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(26, 46, 40, 0.055);
  transform-origin: center top;
}

.timeline-item.priority-item {
  border-left-color: var(--coral);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item:not(:last-child)::after {
  content: none;
}

.timeline-connector {
  position: relative;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 6px 0 8px;
  color: var(--teal-dark);
}

.connector-arrow {
  grid-column: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.connector-label {
  grid-column: 3;
  justify-self: start;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf2;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(28, 35, 32, 0.06);
}

.time {
  color: var(--teal-dark);
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.transport {
  justify-self: end;
  min-width: 84px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf4f7;
  color: #205f79;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.item-summary {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
  text-align: left;
}

.detail-preview {
  min-width: 0;
}

.summary-chevron {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf5f2;
  color: var(--teal-dark);
  transition: transform 160ms var(--ease-spring), background 180ms var(--ease-out);
}

.summary-chevron svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item-summary:hover .summary-chevron,
.item-summary:focus-visible .summary-chevron {
  background: #dcefe9;
  transform: translateX(2px);
}

.hours-line {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 7px;
  color: #71501d;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
}

.hours-line svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hours-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hours-line b {
  margin-right: 6px;
  color: var(--gold);
  font-size: 0.69rem;
  font-weight: 900;
}

.hours-line.conditional {
  color: #98513f;
}

.hours-line.conditional svg,
.hours-line.conditional b {
  color: var(--coral);
  stroke: var(--coral);
}

.item-head {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.item-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fbe3dc;
  color: #9c392b;
  font-size: 0.76rem;
  font-weight: 900;
}

.status-dot.confirmed {
  background: #e4f2ed;
  color: var(--teal-dark);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.item-meta .tags {
  margin-top: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f4eadc;
  color: #735126;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.must {
  background: #fbe3dc;
  color: #9c392b;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.compact-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 0;
  margin-left: auto;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  line-height: 1.2;
}

.action-link:hover,
.action-link:focus-visible {
  border-color: var(--teal);
  background: #e8f5f2;
}

.action-link.primary-action {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.action-link.primary-action:hover,
.action-link.primary-action:focus-visible {
  background: var(--teal-dark);
  color: #fff;
}

.action-link.delete {
  color: #9c392b;
}

.compact-actions .action-link {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.compact-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-item .tag,
.timeline-item .transport,
.timeline-item .status-dot {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 0.72rem;
}

.timeline-item .transport {
  justify-self: auto;
  min-width: 0;
}

.empty-state {
  padding: 22px;
  border-left: 5px solid var(--gold);
}

.empty-state p {
  margin: 0 0 14px;
  color: var(--muted);
}

.quick-card {
  padding: 20px;
  border-top: 4px solid var(--river);
}

.map-gallery {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1.18fr);
  gap: 18px;
  align-items: stretch;
}

.map-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 35, 32, 0.06);
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.map-frame {
  background: #ebe5da;
  border-bottom: 1px solid var(--line);
}

.map-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-frame.portrait {
  height: clamp(420px, 58vw, 640px);
}

.map-frame.landscape {
  height: clamp(320px, 43vw, 520px);
}

.map-copy {
  padding: 18px;
}

.map-copy p {
  margin: 0;
  color: var(--muted);
}

.booking-card {
  padding: 20px;
  border-top: 4px solid var(--gold);
}

.booking-card.high {
  border-top-color: var(--coral);
}

.booking-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px;
  align-items: start;
}

.note-list {
  display: grid;
  gap: 14px;
}

.note {
  padding: 20px;
}

.note.urgent {
  border-left: 5px solid var(--coral);
}

.shopping-card {
  padding: 20px;
}

.shopping-card h3 {
  color: var(--teal-dark);
}

.shopping-card ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.shopping-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.shopping-check input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.shopping-check input:checked + span,
.check-card input:checked + label {
  opacity: 0.58;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
}

.check-card input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.check-card label {
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.check-card strong {
  line-height: 1.35;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px max(16px, calc((100% - 1180px) / 2));
  background: #17211f;
  color: rgba(255, 255, 255, 0.82);
}

footer p {
  margin: 0;
}

footer a {
  font-weight: 800;
}

.floating-actions {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 25;
  display: grid;
  gap: 8px;
  animation: float-in 520ms var(--ease-spring) both;
}

.fab {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 900;
  transition:
    transform 160ms var(--ease-spring),
    box-shadow 180ms var(--ease-out),
    background 180ms var(--ease-out);
}

.fab.quiet {
  border-color: var(--line);
  background: #fff;
  color: var(--teal-dark);
}

.bottom-nav {
  display: none;
}

.trip-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.trip-dialog[open] {
  animation: dialog-pop 260ms var(--ease-spring) both;
}

.trip-dialog::backdrop {
  background: rgba(14, 20, 18, 0.58);
  animation: fade-in 180ms var(--ease-out) both;
}

.detail-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: var(--shadow);
}

.detail-dialog[open] {
  animation: dialog-pop 260ms var(--ease-spring) both;
}

.detail-dialog::backdrop {
  background: rgba(11, 27, 23, 0.62);
  backdrop-filter: blur(3px);
  animation: fade-in 180ms var(--ease-out) both;
}

.sync-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: var(--shadow);
}

.sync-dialog[open] {
  animation: dialog-pop 260ms var(--ease-spring) both;
}

.sync-dialog::backdrop {
  background: rgba(11, 27, 23, 0.62);
  backdrop-filter: blur(3px);
  animation: fade-in 180ms var(--ease-out) both;
}

.sync-sheet {
  padding: 22px;
  background: #fff;
}

.sync-dialog-head {
  margin-bottom: 16px;
}

.sync-dialog-head .icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.sync-state {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #d6e5e1;
  border-radius: 8px;
  background: #eff7f5;
}

.sync-state-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
}

.sync-state span:last-child {
  min-width: 0;
  display: grid;
  line-height: 1.35;
}

.sync-state strong {
  font-size: 0.94rem;
}

.sync-state small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.sync-state[data-state="error"] {
  border-color: #e8c2bb;
  background: #fff2ef;
}

.sync-state[data-state="error"] .sync-state-icon {
  background: var(--coral);
}

.sync-state[data-state="offline"] {
  border-color: #dfd6c3;
  background: #faf6ed;
}

.sync-state[data-state="offline"] .sync-state-icon {
  background: #8a7655;
}

.sync-form {
  margin-top: 18px;
}

.sync-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 900;
}

.sync-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sync-code-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.sync-form p,
.sync-feedback {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.sync-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.sync-actions [hidden] {
  display: none;
}

.sync-main-action {
  grid-column: 1 / -1;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.sync-feedback:not(:empty) {
  padding: 9px 11px;
  border-radius: 6px;
  background: #f2f5f3;
  color: var(--teal-dark);
}

.detail-sheet {
  padding: 22px;
  background: #fff;
}

.sheet-handle {
  display: none;
}

.detail-head {
  margin-bottom: 16px;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.detail-kicker span,
.detail-transport {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf5f2;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.detail-dialog-text {
  margin: 0;
  color: #4f5e5a;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;
}

.detail-hours {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid #eadfc9;
  border-radius: 8px;
  background: #fffaf0;
}

.detail-hours[hidden] {
  display: none;
}

.detail-hours-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3e5c8;
  color: #865e18;
}

.detail-hours-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-hours span,
.detail-hours strong,
.detail-hours p,
.detail-hours a {
  display: block;
}

.detail-hours span {
  color: #8a6a30;
  font-size: 0.7rem;
  font-weight: 900;
}

.detail-hours strong {
  margin-top: 1px;
  color: #4f3b18;
  font-size: 0.94rem;
  line-height: 1.4;
}

.detail-hours p {
  margin: 5px 0 0;
  color: #716548;
  font-size: 0.8rem;
  line-height: 1.5;
}

.detail-hours a {
  width: fit-content;
  margin-top: 7px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.detail-dialog-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.detail-action {
  min-width: 0;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.detail-action.primary-action {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.detail-action svg,
.detail-head .icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-dialog {
  width: min(1040px, calc(100% - 24px));
  height: min(820px, calc(100vh - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-dialog[open] {
  animation: dialog-pop 260ms var(--ease-spring) both;
}

.map-dialog::backdrop {
  background: rgba(14, 20, 18, 0.68);
  animation: fade-in 180ms var(--ease-out) both;
}

.map-dialog-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: #fffaf2;
}

.map-dialog-frame {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ebe5da;
}

.map-dialog-frame img {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.trip-form {
  padding: 24px;
  background: #fff;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.dialog-head h2 {
  font-size: 1.7rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
}

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

.trip-form label {
  display: grid;
  gap: 5px;
}

.trip-form label.wide {
  grid-column: 1 / -1;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--teal);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 860px) {
  body.view-mode {
    scroll-padding-top: 72px;
  }

  body.view-mode main {
    padding-top: 62px;
  }

  body.view-mode .mobile-appbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 32;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 252, 251, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(28, 35, 32, 0.1);
    animation: dock-drop 280ms var(--ease-out) both;
  }

  .appbar-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
  }

  .appbar-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .appbar-button.strong {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
  }

  .appbar-actions {
    display: flex;
    gap: 6px;
  }

  .sync-appbar {
    position: relative;
  }

  .sync-appbar .sync-dot {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    box-shadow: none;
  }

  .appbar-title {
    min-width: 0;
    display: grid;
    gap: 0;
    line-height: 1.18;
    text-align: center;
  }

  .appbar-title span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
  }

  .appbar-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--teal-dark);
    font-size: 0.95rem;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    padding: max(16px, env(safe-area-inset-top)) 0 0;
  }

  .nav-links {
    display: none;
  }

  .hero-sync-button {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(11, 27, 23, 0.34);
    color: #fff;
    backdrop-filter: blur(10px);
  }

  .hero-sync-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .hero-sync-button .sync-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 7px;
    height: 7px;
    border: 2px solid #26443d;
    box-shadow: none;
  }

  .hero {
    min-height: 300px;
    background-position: 62% 58%;
  }

  .hero-copy {
    align-self: end;
    padding: 24px 0 30px;
  }

  .hero .eyebrow {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }

  .hero h1 {
    max-width: 320px;
    font-size: 2.65rem;
    line-height: 1.02;
  }

  .hero-facts {
    display: grid;
    gap: 3px;
    margin-top: 11px;
    font-size: 0.76rem;
  }

  .hero-facts span + span::before {
    display: none;
  }

  .hero-actions {
    margin-top: 15px;
  }

  .hero-plan-button {
    min-height: 40px;
    padding: 8px 13px;
    font-size: 0.84rem;
  }

  .app-dock {
    display: none;
  }

  .section,
  .band {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .home-hub {
    padding-top: 22px;
    padding-bottom: 42px;
  }

  .home-section-head {
    margin-bottom: 17px;
  }

  .home-section-head h2 {
    font-size: 1.45rem;
  }

  .home-all-plan {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 0.76rem;
  }

  .home-subhead {
    align-items: baseline;
  }

  .flight-board {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .flight-card {
    padding: 13px 14px;
  }

  .flight-route {
    margin: 12px 0 10px;
  }

  .flight-airport strong {
    font-size: 1.25rem;
  }

  .home-status {
    margin: 16px 0 18px;
  }

  .home-status div {
    display: grid;
    gap: 0;
    padding: 9px 4px;
  }

  .trip-dashboard {
    margin-bottom: 0;
  }

  body.view-mode .section,
  body.view-mode .band {
    padding-top: 22px;
  }

  body.view-mode #itinerary {
    padding-top: 6px;
  }

  body.view-mode #itinerary > .section-top {
    display: none;
  }

  .section-top,
  .summary-grid,
  .booking-grid,
  .quick-grid,
  .map-gallery,
  .shopping-layout,
  .checklist,
  .trip-dashboard,
  .split {
    grid-template-columns: 1fr;
  }

  .home-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-shell {
    top: 58px;
    gap: 7px;
    margin: 0 -16px 10px;
    padding: 8px 10px 9px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 8px 18px rgba(28, 35, 32, 0.08);
  }

  .toolbar {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    align-items: center;
    padding-bottom: 0;
  }

  .planner-shell .search-field {
    flex: 1 1 190px;
    min-width: 0;
  }

  .planner-shell .search-field span {
    display: none;
  }

  .planner-shell .search-field input {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.92rem;
  }

  .planner-shell .tool-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .planner-shell [data-add-trip],
  .planner-shell #exportTrip,
  .planner-shell #resetTrip {
    display: none;
  }

  .day-controls {
    display: none;
  }

  .day-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 0;
    padding: 0 2px 1px;
    overflow: visible;
  }

  .day-tab {
    min-width: 0;
    min-height: 42px;
    padding: 6px 2px;
    border-radius: 9px;
    text-align: center;
  }

  .day-tab strong {
    font-size: 0.83rem;
    line-height: 1.1;
  }

  .day-tab span {
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .day-tab small {
    display: none;
  }

  .timeline {
    padding-top: 2px;
  }

  .timeline-item {
    margin-bottom: 0;
    padding: 10px 10px 9px;
  }

  .timeline-item:not(:last-child)::after {
    content: none;
  }

  .timeline-connector {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    gap: 7px;
    min-height: 32px;
    margin: 5px 0 7px;
  }

  .connector-arrow {
    width: 22px;
    height: 22px;
    font-size: 0.86rem;
  }

  .connector-label {
    min-height: 22px;
    max-width: 100%;
    padding: 2px 8px;
    font-size: 0.7rem;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
  }

  .detail-preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .item-summary {
    padding-top: 5px;
    font-size: 0.84rem;
  }

  .hours-line {
    gap: 6px;
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .hours-line svg {
    width: 15px;
    height: 15px;
  }

  .item-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 7px;
    align-items: center;
  }

  .time {
    font-size: 0.88rem;
  }

  .item-head h3 {
    overflow: visible;
    font-size: 0.92rem;
    text-overflow: clip;
    white-space: normal;
  }

  .compact-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 3px;
    margin-left: 0;
  }

  .compact-actions .action-link {
    width: 26px;
    min-width: 26px;
    min-height: 26px;
    font-size: 0.72rem;
  }

  .compact-actions svg {
    width: 14px;
    height: 14px;
  }

  .timeline-item .tag,
  .timeline-item .transport,
  .timeline-item .status-dot {
    min-height: 20px;
    padding: 1px 6px;
    font-size: 0.68rem;
  }

  footer {
    flex-direction: column;
  }

  .floating-actions {
    display: none;
  }

  .fab.quiet {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 24;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(250, 252, 251, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 -12px 28px rgba(28, 35, 32, 0.12);
    animation: bottom-rise 360ms var(--ease-out) both;
  }

  .bottom-nav-item {
    min-width: 0;
    min-height: 48px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
    padding: 4px 2px;
    border-radius: 8px;
    font-size: 0.66rem;
    line-height: 1.1;
    transition:
      transform 160ms var(--ease-spring),
      background 180ms var(--ease-out),
      color 180ms var(--ease-out),
      border-color 180ms var(--ease-out);
  }

  .bottom-nav-item svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .bottom-nav-item.active {
    border-color: #b9d8d1;
    background: #e3f1ed;
    color: var(--teal-dark);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.04);
  }

  body {
    padding-bottom: 70px;
  }

  .trip-dialog,
  .detail-dialog,
  .sync-dialog {
    width: 100%;
    max-width: none;
    max-height: min(82dvh, 760px);
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .trip-form,
  .detail-sheet,
  .sync-sheet {
    max-height: min(82dvh, 760px);
    overflow-y: auto;
    padding: 14px 16px max(18px, env(safe-area-inset-bottom));
  }

  .trip-form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .sync-sheet {
    overflow-y: auto;
  }

  .trip-form .form-grid {
    min-height: 0;
    overflow-y: auto;
    padding: 1px 2px 14px 0;
  }

  .trip-form .dialog-actions {
    margin: 0 -16px -18px;
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
  }

  .trip-form .dialog-actions .tool-button {
    flex: 1 1 0;
  }

  .sheet-handle {
    width: 42px;
    height: 5px;
    display: block;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #cbd5d1;
  }

  .detail-head h2 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .detail-dialog-text {
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .map-dialog {
    width: calc(100% - 12px);
    height: calc(100vh - 12px);
  }

  .map-dialog-shell {
    padding: 12px;
  }

  .map-frame.portrait,
  .map-frame.landscape {
    height: min(62vh, 520px);
  }
}

@media (max-width: 520px) {
  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  h1 {
    font-size: clamp(2.65rem, 15vw, 4.3rem);
  }

  .section-top .search-field {
    flex: 1 1 100%;
  }

  .toolbar:not(.dialog-actions) .tool-button {
    flex: 0 0 auto;
  }

  .planner-shell .search-field {
    flex: 1 1 180px;
    flex-basis: auto;
  }

  .day-controls {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .current-day {
    grid-column: auto;
    grid-row: auto;
  }

  .action-link {
    flex: 1 1 calc(50% - 8px);
  }

  .compact-actions .action-link {
    flex: 0 0 26px;
    width: 26px;
    min-width: 26px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-direction: column;
  }

  .trip-form .dialog-actions {
    flex-direction: row;
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dock-drop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bottom-rise {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sync-pulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
