:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-muted: #ebe7dd;
  --ink: #17201c;
  --muted: #69736d;
  --line: #d8d2c4;
  --accent: #147b75;
  --accent-dark: #0d5753;
  --accent-soft: #e8f5f2;
  --coral: #d85f48;
  --gold: #b88735;
  --warn-bg: #fdeee9;
  --warn-ink: #b3492f;
  --shadow: 0 18px 55px rgba(37, 42, 38, 0.12);
  --shadow-sm: 0 8px 28px rgba(37, 42, 38, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
h2, h3, h4 { letter-spacing: 0; }
a { color: var(--accent-dark); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Shell ---------- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #17201c;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent);
  font-weight: 800;
}
.brand strong, .brand span, .trip-card strong, .trip-card span { display: block; }
.brand span, .trip-card span { color: rgba(255,255,255,0.64); font-size: 13px; line-height: 1.5; }

.nav-list { display: grid; gap: 6px; }
.nav-list a {
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.nav-list a.active, .nav-list a:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.nav-more { display: none; }

/* ---------- More sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 30;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(23,32,28,0.5);
}
.sheet.open { display: flex; }
.sheet-box {
  width: min(520px, 100%);
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head strong { font-size: 18px; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-muted); color: var(--ink); font-size: 22px; }
.more-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-list a {
  display: grid; place-items: center; min-height: 58px;
  border: 1px solid var(--line); border-radius: 12px; background: #fffdf8;
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.more-list a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.trip-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
}

.workspace { padding: 24px; display: grid; gap: 22px; }

/* ---------- Tabs ---------- */
.tab-panel[hidden] { display: none !important; }
#home:not([hidden]) { display: grid; gap: 22px; }

/* ---------- Topbar / hero ---------- */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.topbar h1 { max-width: 880px; margin: 4px 0 0; font-size: clamp(26px, 4vw, 46px); line-height: 1.05; }

.eyebrow {
  margin: 0; color: var(--accent-dark);
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}

.primary-action {
  min-height: 44px; padding: 0 16px;
  border-radius: 999px;
  background: var(--coral); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
}
.primary-action span {
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.6);
}

.hero-panel {
  position: relative; min-height: 280px; overflow: hidden;
  border-radius: 14px; background: #26342f; box-shadow: var(--shadow);
}
.hero-panel img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px; color: #fff;
  background: linear-gradient(90deg, rgba(5,18,17,0.78), rgba(5,18,17,0.12));
}
.hero-overlay .eyebrow { color: #9be0d7; }
.hero-overlay h2 { max-width: 640px; margin: 8px 0 0; font-size: clamp(24px, 4vw, 40px); line-height: 1.08; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.status-strip span {
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(8px); font-size: 13px;
}

/* ---------- Cards / panels ---------- */
.focus-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric, .panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.metric { min-height: 110px; padding: 16px; display: grid; align-content: space-between; gap: 6px; }
.metric span, .metric small { color: var(--muted); }
.metric strong { font-size: 22px; line-height: 1.15; }
.metric.warn { border-color: var(--warn-ink); background: var(--warn-bg); }
.metric.warn small { color: var(--warn-ink); }

.panel { padding: 18px; }
.panel h2 { margin: 4px 0 0; font-size: 21px; }
.panel h3 { margin: 2px 0 0; font-size: 18px; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }

.install-card {
  display: grid; gap: 4px; padding: 14px 16px;
  border: 1px solid rgba(20,123,117,0.24); border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.install-card span { color: #31514d; line-height: 1.5; }

/* ---------- Section blocks ---------- */
.section-block { display: grid; gap: 14px; scroll-margin-top: 16px; }
.section-head h2 { margin: 2px 0 0; font-size: clamp(20px, 3vw, 28px); }
.subhead { margin: 18px 0 8px; font-size: 15px; color: var(--accent-dark); }
.helper-text { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.text-link { display: inline-block; margin-top: 8px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.roma { color: #51615b; }

/* ---------- Prep ---------- */
.prep-groups { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.prep-group h3 { margin: 0 0 8px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.grp-icon { font-size: 20px; line-height: 1; }
.item-icon { margin-right: 6px; }
.point-list { margin: 8px 0 0; padding-left: 4px; list-style: none; display: grid; gap: 5px; }
.point-list li { position: relative; padding-left: 18px; color: #3d4742; line-height: 1.55; }
.point-list li::before {
  content: ""; position: absolute; left: 3px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.prep-item { padding: 12px 0; border-top: 1px solid var(--line); }
.prep-item:first-of-type { border-top: 0; }
.prep-item strong { display: block; }
.prep-item p { margin: 6px 0 0; color: #3d4742; line-height: 1.6; }
.prep-item small { display: block; margin-top: 4px; color: var(--muted); }
.verify-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: 11px; font-weight: 700;
  vertical-align: middle;
}

/* ---------- Stay / Booking ---------- */
.book-grid { display: grid; gap: 10px; }
.book-link {
  display: grid; gap: 4px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fffdf8;
  text-decoration: none; color: var(--ink);
}
.book-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.book-link strong { color: var(--accent-dark); }
.book-link span { color: #3d4742; font-size: 13px; line-height: 1.5; }

/* ---------- Explore ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
  border: 1px solid rgba(20,123,117,0.24); font-weight: 600; font-size: 14px;
}
.chip:hover { background: var(--accent); color: #fff; }
.explore-list { display: grid; gap: 10px; }
.explore-card {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8;
}
.explore-card strong { display: block; }
.explore-card small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.45; }
.explore-card .coupon { color: var(--accent-dark); font-weight: 600; }
.card-btns { display: flex; gap: 6px; align-items: center; }
.arrival-actions { margin-top: 8px; }
.picks { display: grid; gap: 8px; margin: 10px 0 4px; }
.pick { padding: 10px 12px; border: 1px solid rgba(20,123,117,0.24); border-radius: 10px; background: var(--accent-soft); }
.pick strong { display: block; color: var(--accent-dark); }
.pick small { display: block; margin-top: 3px; color: #31514d; line-height: 1.45; }
.prep-item .text-link + .text-link { margin-left: 16px; }
.mini-btn.ghost { background: transparent; color: var(--coral); border: 1px solid var(--line); }
a.mini-btn { display: inline-grid; place-items: center; text-decoration: none; }

/* ---------- Flights ---------- */
.flight-trip { padding: 14px 0; border-top: 1px solid var(--line); }
.flight-trip:first-of-type { border-top: 0; }
.flight-trip-head { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 10px; }
.flight-trip-head strong { color: var(--ink); }
.flight-leg {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8;
}
.flight-time { display: grid; }
.flight-time strong { font-size: 20px; }
.flight-time span { color: var(--muted); font-size: 13px; }
.flight-mid { display: grid; justify-items: center; color: var(--muted); font-size: 12px; }
.flight-arrow { font-size: 18px; color: var(--accent); }
.flight-note { display: block; margin: 6px 2px 0; color: var(--muted); font-size: 12px; }
.layover { margin: 8px 0; padding: 6px 10px; border-radius: 8px; background: var(--surface-muted); color: var(--muted); font-size: 13px; }
.layover.tight { background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }

/* ---------- Checklist ---------- */
.check-group { margin-bottom: 10px; }
.check-group h4 { margin: 12px 0 4px; font-size: 14px; color: var(--accent-dark); }
.checklist-panel label {
  min-height: 44px; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line); line-height: 1.45; padding: 8px 0;
}
.checklist-panel input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.score {
  min-width: 62px; height: 38px; display: grid; place-items: center;
  border-radius: 8px; color: #fff; background: var(--gold); font-weight: 800;
}

/* ---------- Itinerary ---------- */
.planner-layout { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(300px,0.7fr); gap: 14px; }
.day-tabs, .segmented { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-muted); }
.day-tabs { flex-wrap: wrap; }
.day-tabs button, .segmented button {
  min-height: 36px; padding: 0 12px; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600;
}
.day-tabs button.active, .segmented button.active {
  background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(37,42,38,0.1);
}
.day-tabs button { display: grid; line-height: 1.1; padding: 6px 12px; }
.day-tabs button small { font-size: 10px; font-weight: 600; opacity: 0.7; }
.day-title { margin: 12px 0 0; font-size: 16px; font-weight: 800; color: var(--accent-dark); }
.timeline { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.timeline li {
  display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8;
}
.timeline time { color: var(--accent-dark); font-weight: 800; }
.timeline strong, .timeline span { display: block; }
.timeline span { color: var(--muted); line-height: 1.45; margin-top: 2px; }
.timeline-actions { display: grid; gap: 6px; justify-items: end; }
.tag { padding: 5px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 12px; white-space: nowrap; }
.sub-block { margin-top: 16px; }
.sub-block h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent-dark); }
.sub-block ul { margin: 0; padding-left: 18px; color: #3d4742; line-height: 1.6; }

/* ---------- Spots ---------- */
.spot-list { display: grid; gap: 10px; }
.spot-list article { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; display: grid; gap: 6px; }
.spot-list small { color: var(--muted); line-height: 1.45; }

/* ---------- Buttons ---------- */
.panel button { min-height: 40px; padding: 0 14px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; white-space: nowrap; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button-row button { min-height: 44px; }
.button-row .solid { background: var(--accent); }
.mini-btn { min-height: 36px !important; padding: 0 12px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }
.mini-btn.ghost { background: transparent; color: var(--coral); border: 1px solid var(--line); }
.speak-btn { min-height: 40px; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 12px; font-weight: 600; }

/* ---------- Translator ---------- */
.translator textarea {
  width: 100%; min-height: 104px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; line-height: 1.6;
}
.camera-input { display: none; }
.translation-output { margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--accent-soft); display: grid; gap: 6px; }
.translation-output span, .translation-output small { color: var(--muted); }
.translation-output strong { font-size: 22px; line-height: 1.35; }

/* ---------- Money / weather ---------- */
.two-column { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,0.8fr); gap: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }
.converter { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.converter label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.converter input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); }
.weather-list { display: grid; gap: 8px; }
.wx { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; }
.wx small { color: var(--muted); }
.wx.warn { border-color: var(--warn-ink); background: var(--warn-bg); }
.wx-alert { margin: 0 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; line-height: 1.5; }

/* ---------- Phrasebook ---------- */
.phrase-cat h4 { margin: 14px 0 8px; font-size: 14px; color: var(--accent-dark); }
.phrase-cat:first-child h4 { margin-top: 0; }
.phrase-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.phrase-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; display: grid; align-content: start; gap: 6px; }
.phrase-grid strong, .phrase-grid span { display: block; }
.phrase-grid span { color: var(--ink); line-height: 1.45; }
.phrase-grid small { display: block; color: #51615b; line-height: 1.35; }
.phrase-grid .speak-btn { width: 100%; margin-top: 2px; }

/* ---------- Field guide ---------- */
.issue-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.issue-list article {
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center;
}
.issue-list strong, .issue-list span, .issue-list small { display: block; }
.issue-list span { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.issue-list small { margin-top: 4px; color: #51615b; line-height: 1.35; }

/* ---------- Trip form ---------- */
.trip-form { display: grid; gap: 12px; margin-top: 12px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
.field input { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); }
.primary-save { min-height: 46px; background: var(--accent); color: #fff; border-radius: 10px; font-weight: 700; }

/* ---------- Emergency ---------- */
.call-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.call-btn {
  display: grid; gap: 2px; padding: 14px; border-radius: 12px;
  background: var(--coral); color: #fff; text-decoration: none; text-align: center;
}
.call-btn strong { font-size: 26px; }
.call-btn span { font-weight: 700; }
.call-btn small { color: rgba(255,255,255,0.85); }
.em-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.em-actions .mini-btn { min-height: 44px !important; }
.num-list { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; color: #3d4742; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; display: none; place-items: center; padding: 24px; background: rgba(23,32,28,0.55); z-index: 20; }
.modal.open { display: grid; }
.modal-box { position: relative; width: min(480px, 100%); padding: 28px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-muted); color: var(--ink); font-size: 24px; }
.address-text { margin: 12px 0 0; font-size: 24px; line-height: 1.5; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav-list { grid-template-columns: repeat(10, minmax(0,1fr)); }
  .focus-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .prep-groups, .planner-layout, .two-column, .phrase-grid, .issue-list { grid-template-columns: 1fr; }
  .phrase-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
  body { background: #f8f6f0; }
  .app-shell { display: block; }
  .sidebar {
    position: static; height: auto;
    padding: max(14px, env(safe-area-inset-top)) 14px 8px;
    background: #f8f6f0; color: var(--ink); gap: 10px;
  }
  .brand span, .trip-card { display: none; }
  .nav-list {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
    grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0;
    padding: 7px 2px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.95); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 26px rgba(23,32,28,0.1); backdrop-filter: blur(18px);
  }
  .nav-list a { display: grid; place-items: center; min-height: 48px; padding: 0 1px; font-size: 12px; color: var(--muted); }
  .nav-list a.active, .nav-list a:hover { background: var(--accent-soft); color: var(--accent-dark); }
  .nav-list .nav-secondary { display: none; }
  .nav-more {
    display: grid; place-items: center; min-height: 48px; padding: 0 1px;
    font-size: 12px; color: var(--muted); background: transparent; border-radius: 0;
  }
  .nav-more.active { background: var(--accent-soft); color: var(--accent-dark); }
  .workspace { padding: 8px 14px calc(92px + env(safe-area-inset-bottom)); gap: 18px; }
  .topbar { align-items: center; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 24px; line-height: 1.1; }
  .focus-grid, .call-grid { grid-template-columns: 1fr; }
  .phrase-grid { grid-template-columns: 1fr; }
  .hero-panel, .hero-panel img { min-height: 220px; }
  .hero-overlay { padding: 18px; }
  .status-strip { display: grid; }
  .timeline li, .converter, .flight-leg { grid-template-columns: 1fr; }
  .timeline li { gap: 6px; }
  .timeline-actions { justify-items: start; grid-auto-flow: column; }
  .issue-list article { grid-template-columns: 1fr; }
  .issue-list .speak-btn { width: 100%; }
  .day-tabs, .segmented { width: 100%; overflow-x: auto; }
  .panel { padding: 14px; }
  .call-btn strong { font-size: 30px; }
  .flight-mid { justify-self: start; }
  .flight-arrow { transform: rotate(90deg); }
}

/* =========================================================
   Design refinements (frontend-design skill, 2026-05-30)
   - Inter variable + JetBrains Mono
   - ring borders > solid 1px lines
   - monospace eyebrows, tighter heading tracking
   - staggered tab fade-in motion
   ========================================================= */
:root {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ring: 0 0 0 1px rgba(23, 32, 28, 0.06);
  --ring-strong: 0 0 0 1px rgba(23, 32, 28, 0.1);
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  font-feature-settings: "cv01", "cv02", "cv03", "cv04", "ss03";
  font-variation-settings: "opsz" 14;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Monospace eyebrows — Steve Schoger style */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.hero-overlay .eyebrow { color: rgba(255,255,255,0.78); }
.install-card .eyebrow { color: var(--accent-dark); }

/* Tighter tracking + balanced wrap on big headings (display optical size) */
.topbar h1,
.hero-overlay h2,
.section-head h2 {
  letter-spacing: -0.022em;
  font-weight: 700;
  text-wrap: balance;
  font-variation-settings: "opsz" 32;
}
.panel h3 { letter-spacing: -0.01em; font-weight: 650; }
.metric strong { letter-spacing: -0.015em; font-weight: 700; }

/* Ring-style borders (subtle, not muddy) */
.metric, .panel {
  border-color: transparent;
  box-shadow: var(--ring), var(--shadow-sm);
}
.timeline li, .spot-list article, .phrase-grid article, .issue-list article,
.flight-leg, .wx, .book-link, .explore-card, .pick {
  border-color: transparent;
  box-shadow: var(--ring);
}
.metric.warn, .wx.warn { box-shadow: 0 0 0 1px var(--warn-ink), var(--shadow-sm); }
.layover.tight { box-shadow: inset 0 0 0 1px var(--warn-ink); }
.book-link:hover, .more-list a:hover, .explore-card:hover {
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

/* Hero gets a crisp inner ring for the photo frame */
.hero-panel {
  box-shadow: var(--ring-strong), var(--shadow);
  border: 0;
}
.hero-overlay::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Modal / sheet — slightly stronger ring + crisper shadow */
.modal-box, .sheet-box {
  box-shadow: var(--ring-strong), 0 30px 80px rgba(15, 22, 19, 0.28);
}

/* Secondary mini-btn: ring instead of solid 1px */
.mini-btn.ghost {
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(23,32,28,0.12);
}
.mini-btn { font-size: 13px; font-weight: 600; padding: 0 12px; }
a.mini-btn { padding: 0 12px; }

/* Tab fade-in (no motion if user prefers reduced) */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.tab-panel:not([hidden]) {
  animation: panelIn 0.32s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}
.focus-grid .metric { animation: panelIn 0.42s cubic-bezier(0.2,0.6,0.2,1) both; }
.focus-grid .metric:nth-child(1) { animation-delay: 0.04s; }
.focus-grid .metric:nth-child(2) { animation-delay: 0.09s; }
.focus-grid .metric:nth-child(3) { animation-delay: 0.14s; }
.focus-grid .metric:nth-child(4) { animation-delay: 0.19s; }

@media (prefers-reduced-motion: reduce) {
  .tab-panel:not([hidden]), .focus-grid .metric { animation: none; }
}

/* Topbar feels lighter: subtle backdrop on desktop */
.topbar { padding: 4px 0 2px; }

/* Pretty body copy in points lists */
.point-list li { text-wrap: pretty; }

/* Active nav pill on desktop sidebar — refine */
.sidebar .nav-list a.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16); }

/* ---------- Packing list ---------- */
.chip.chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.chip-off { opacity: 0.55; }
.pack-cat { margin-top: 14px; }
.pack-cat h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 17px; }
.pack-items { display: grid; gap: 4px; }
.pack-row {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center;
  min-height: 40px; padding: 6px 4px; border-radius: 8px; line-height: 1.45;
}
.pack-row:hover { background: rgba(20,123,117,0.04); }
.pack-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.pack-row.is-done span { color: var(--muted); text-decoration: line-through; }
.pack-rm {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(23,32,28,0.12);
}
.pack-rm:hover { color: var(--coral); }
.pack-add { margin-top: 10px; }
.pack-input {
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 10px; background: var(--surface-muted);
  box-shadow: inset 0 0 0 1px rgba(23,32,28,0.08);
  font-size: 14px;
}
.pack-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); background: #fff; }

/* ---------- Bus routes / Restaurants / Drinks ---------- */
.bus-row {
  padding: 12px; margin-bottom: 10px;
  border-radius: 10px; background: #fffdf8;
  box-shadow: var(--ring);
  display: grid; gap: 4px;
}
.bus-row strong { display: block; font-size: 15px; }
.bus-row small { display: block; color: #3d4742; line-height: 1.5; font-size: 13px; }
.bus-row .mini-btn { justify-self: start; margin-top: 4px; }
.rest-list { display: grid; gap: 12px; }
.rest-card {
  padding: 14px; border-radius: 12px; background: #fffdf8;
  box-shadow: var(--ring);
  display: grid; gap: 4px;
}
.rest-card h4 { margin: 0; font-size: 16px; line-height: 1.3; }
.rest-card small { display: block; color: #3d4742; line-height: 1.5; font-size: 13px; }
.rest-card .rest-type { color: var(--accent-dark); font-weight: 600; margin-bottom: 4px; }
.rest-card .card-btns { margin-top: 8px; }
.drink-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 11px; font-weight: 600; vertical-align: middle;
}

/* ---------- AI 行程助理（floating chat） ---------- */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 25;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #147b75 0%, #1ea69d 100%);
  color: #fff; font-size: 24px; line-height: 1;
  box-shadow: 0 12px 32px rgba(20,123,117,0.45), 0 0 0 1px rgba(255,255,255,0.18) inset;
  display: grid; place-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.chat-panel[hidden] { display: none !important; }
.chat-panel {
  position: fixed; right: 18px; bottom: 86px; z-index: 26;
  width: min(420px, calc(100vw - 36px));
  max-height: min(640px, calc(100vh - 120px));
  background: #fff; border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(23,32,28,0.08), 0 30px 80px rgba(15,22,19,0.28);
  display: flex; flex-direction: column; overflow: hidden;
  animation: chatIn 0.22s cubic-bezier(0.2,0.6,0.2,1);
}
@keyframes chatIn { from { opacity:0; transform: translateY(8px) scale(0.98); } to { opacity:1; transform: none; } }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid rgba(23,32,28,0.06);
}
.chat-head h3 { margin: 2px 0 0; font-size: 16px; letter-spacing: -0.01em; }
.chat-close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-muted); color: var(--ink); font-size: 20px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 90%; padding: 10px 12px; border-radius: 12px; line-height: 1.55; font-size: 14px; }
.chat-msg p { margin: 0; }
.chat-msg ul { margin: 6px 0 0; padding-left: 20px; color: #3d4742; }
.chat-msg-ai { background: var(--accent-soft); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg-user { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg-sys { background: var(--warn-bg); color: var(--warn-ink); align-self: center; font-size: 12px; padding: 6px 10px; border-radius: 999px; }
.chat-actions-applied {
  margin-top: 6px; padding: 6px 10px; border-radius: 999px;
  background: rgba(20,123,117,0.12); color: var(--accent-dark);
  font-size: 12px; font-weight: 600; display: inline-block;
}
.chat-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(23,32,28,0.06); }
.chat-input-row textarea {
  resize: none; padding: 10px 12px; border: 0; border-radius: 10px;
  background: var(--surface-muted); box-shadow: inset 0 0 0 1px rgba(23,32,28,0.08);
  font: inherit; line-height: 1.4;
}
.chat-input-row textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); background: #fff; }
.chat-input-row button { min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; }
.chat-input-row button:disabled { opacity: 0.55; }
.chat-foot { margin: 0 14px 10px; font-size: 11px; }

@media (max-width: 700px) {
  .chat-fab { right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
  .chat-panel {
    right: 8px; left: 8px; bottom: calc(132px + env(safe-area-inset-bottom));
    width: auto; max-height: 60vh;
  }
}
