/* ==========================================================================
   China Food & Heritage Roadbook — core stylesheet
   Palette: rice-white ground, vermilion accent, ink text, muted supply colors
   ========================================================================== */

:root {
  --cream: #fbf7f0;
  --cream-2: #f5eee3;
  --cream-3: #ede3d4;
  --paper: #fffdf8;
  --ink: #1d1b18;
  --ink-soft: #444038;
  --muted: #857d70;
  --line: #e3dacb;
  --line-strong: #d3c7b3;
  --vermilion: #b5342b;
  --vermilion-deep: #8c2620;
  --vermilion-soft: #f3e2dd;
  --gold: #b0803c;
  --gold-soft: #f2e7d3;

  --supply-fuel: #7b8c81;
  --supply-service: #82929f;
  --supply-toilet: #96a6b5;
  --supply-store: #b3a084;
  --supply-hotel: #a294b5;

  --shadow-sm: 0 1px 2px rgba(29, 27, 24, .05), 0 4px 12px rgba(29, 27, 24, .05);
  --shadow-md: 0 10px 30px rgba(29, 27, 24, .09);
  --shadow-lg: 0 24px 60px rgba(29, 27, 24, .16);

  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 68px;
  --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* inline icon slots filled by ui.js */
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
[data-icon] svg { width: 1em; height: 1em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--vermilion); color: #fff; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .wrap { padding: 0 18px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--vermilion); font-weight: 600;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--vermilion); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(22px, 3.2vw, 30px); }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.muted { color: var(--muted); }
.hr-rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(251, 247, 240, .88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-seal {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 8px;
  background: var(--vermilion);
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Noto Sans SC', var(--font);
  font-size: 20px; font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-name span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.header-nav { display: flex; align-items: center; gap: 26px; }
.header-nav a.nav-link { font-size: 13.5px; color: var(--ink-soft); position: relative; padding: 6px 0; }
.header-nav a.nav-link:hover { color: var(--vermilion); }
.header-nav a.nav-link::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--vermilion); transition: right .25s ease;
}
.header-nav a.nav-link:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--paper); padding: 3px;
  font-size: 11.5px; letter-spacing: .04em;
}
.lang-switch button {
  border: 0; background: transparent; border-radius: 999px;
  padding: 4px 10px; cursor: pointer; color: var(--muted); font-weight: 500;
  transition: all .18s ease;
}
.lang-switch button.is-active { background: var(--ink); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid transparent;
  padding: 10px 18px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--vermilion); color: #fff; box-shadow: 0 6px 18px rgba(181, 52, 43, .22); }
.btn-primary:hover { background: var(--vermilion-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper); border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-soft); padding: 8px 10px; }
.btn-quiet:hover { color: var(--vermilion); }
.btn-icon { padding: 9px; width: 38px; height: 38px; border-radius: 50%; }
.btn[disabled] { opacity: .55; cursor: default; }

.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line-strong); background: var(--paper);
  border-radius: 999px; padding: 4px 6px 4px 4px; cursor: pointer;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.user-chip .user-name { font-size: 12.5px; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.trip-badge {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft); border: 1px solid var(--line-strong);
  background: var(--paper); border-radius: 999px; padding: 7px 12px; cursor: pointer;
}
.trip-badge .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--vermilion); color: #fff; font-size: 10.5px; display: grid; place-items: center; font-weight: 600;
}
.trip-badge.is-empty .count { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 74px 0 40px; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(900px 420px at 78% -10%, rgba(181, 52, 43, .10), transparent 65%),
    radial-gradient(700px 380px at 8% 10%, rgba(176, 128, 60, .10), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(29, 27, 24, .045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(29, 27, 24, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 20%, transparent 80%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-inner { max-width: 780px; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.06; letter-spacing: -.03em; margin: 18px 0 18px;
  font-weight: 600;
}
.hero h1 em { font-style: normal; color: var(--vermilion); position: relative; z-index: 1; }
.hero h1 em::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 8px;
  background: rgba(181, 52, 43, .16); z-index: -1; border-radius: 3px;
}
.hero-sub { font-size: 16px; color: var(--ink-soft); max-width: 540px; line-height: 1.7; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; font-size: 12px; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 15px; height: 15px; stroke: var(--muted); }

.hero-legend {
  position: absolute; right: 28px; top: 84px; width: 316px;
  background: rgba(255, 253, 248, .9); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 20px 16px; box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
@media (max-width: 1180px) { .hero-legend { display: none; } }
.hero-legend-head .eyebrow { font-size: 10px; }
.hero-legend-head p { margin-top: 9px; font-size: 15px; font-weight: 500; color: var(--ink); }
.hero-legend-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-legend-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line); }
.hero-legend-list li:first-child { border-top: 0; padding-top: 0; }
.hero-legend-list .lg-stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; width: 44px; flex: 0 0 44px; }
.hero-legend-list b { display: block; font-size: 13px; font-weight: 500; }
.hero-legend-list span.zh { display: block; font-size: 11px; color: var(--muted); font-family: 'Noto Sans SC', var(--font); }
.hero-legend-list small { margin-left: auto; font-size: 9px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.hero-legend-list li div > span { font-size: 11px; color: var(--muted); }
.hero-legend-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* ---------- Search / planner card ---------- */
.planner {
  position: relative; z-index: 2;
  margin-top: 34px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 26px;
  max-width: 880px;
}
.planner-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.planner-top .step-no {
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: .16em;
  color: var(--muted); text-transform: uppercase;
}
.planner-top h3 { font-size: 17px; }
.planner-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field-control {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--cream); padding: 0 12px; height: 48px;
  transition: border-color .18s, background .18s;
}
.field-control:focus-within { border-color: var(--vermilion); background: #fff; }
.field-control svg { width: 18px; height: 18px; stroke: var(--muted); flex: 0 0 auto; }
.field-control input, .field-control select {
  border: 0; background: transparent; outline: none; width: 100%; height: 100%;
  font-size: 14px; color: var(--ink); appearance: none;
}
.field-control select { cursor: pointer; }
.loc-btn { height: 48px; padding: 0 16px; border-radius: 12px; font-size: 13px; }
.loc-btn svg { width: 16px; height: 16px; }
.planner-themes { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.planner-themes .label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-right: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 8px 14px; font-size: 12.5px; cursor: pointer;
  transition: all .18s ease;
}
.chip svg { width: 15px; height: 15px; stroke: currentColor; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-active svg { stroke: #fff; }
.planner-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); }
.planner-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.planner-note svg { width: 14px; height: 14px; stroke: var(--muted); }
.planner-submit { min-height: 48px; padding: 0 26px; font-size: 14px; }

.city-suggest { position: relative; }
.suggest-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); overflow: hidden;
  display: none;
}
.suggest-list.is-open { display: block; }
.suggest-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; cursor: pointer; font-size: 13.5px;
}
.suggest-item:hover, .suggest-item.is-hover { background: var(--cream-2); }
.suggest-item small { color: var(--muted); font-size: 11.5px; }

/* ---------- Route cards ---------- */
.results { padding: 54px 0 30px; }
.results[hidden] { display: none; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .route-grid { grid-template-columns: 1fr; } }

.route-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}
.route-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.route-card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream-3); }
.route-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.route-card:hover .route-card-media img { transform: scale(1.04); }
.route-card-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 16, .06) 0%, rgba(20, 18, 16, .38) 100%);
}
.route-card-tags { position: absolute; z-index: 2; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(255, 253, 248, .94); color: var(--ink);
  backdrop-filter: blur(6px);
}
.tag svg { width: 12px; height: 12px; stroke: currentColor; }
.tag-vermilion { background: var(--vermilion); color: #fff; }
.tag-gold { background: var(--gold-soft); color: #6f4d1b; }
.route-card-city { position: absolute; z-index: 2; bottom: 12px; left: 14px; color: #fff; font-size: 12px; letter-spacing: .05em; display: flex; align-items: center; gap: 7px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.route-card-city svg { width: 13px; height: 13px; }
.route-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.route-card-body h3 { font-size: 18px; line-height: 1.3; }
.route-card-body h3 a:hover { color: var(--vermilion); }
.route-card-body .zh-name { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.route-card-sum { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.route-card-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-soft); margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }
.route-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.route-card-meta svg { width: 14px; height: 14px; stroke: var(--muted); }
.route-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.route-card-link { position: absolute; inset: 0; z-index: 3; font-size: 0; color: transparent; }
.route-card .save-btn { position: relative; z-index: 4; }
.route-card-tags, .route-card-city { z-index: 2; }
.stars { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-size: 13px; letter-spacing: 1px; line-height: 1; }
.stars .off { color: #d9cfbe; }
.rating-value { font-size: 11px; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.save-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px;
  padding: 6px 11px; font-size: 11.5px; color: var(--ink-soft); cursor: pointer;
  transition: all .18s ease;
}
.save-btn svg { width: 13px; height: 13px; stroke: currentColor; }
.save-btn:hover { border-color: var(--vermilion); color: var(--vermilion); }
.save-btn.is-saved { border-color: var(--vermilion); background: var(--vermilion-soft); color: var(--vermilion-deep); }
.save-btn.is-saved svg { fill: var(--vermilion); }
.btn.btn-primary.save-btn { background: var(--vermilion); border-color: var(--vermilion); color: #fff; padding: 10px 18px; font-size: 13.5px; }
.btn.btn-primary.save-btn:hover { background: var(--vermilion-deep); }
.btn.btn-primary.save-btn.is-saved { background: var(--vermilion-soft); border-color: var(--vermilion); color: var(--vermilion-deep); }

.empty-state {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 34px; text-align: center; color: var(--muted); font-size: 13.5px;
  background: var(--paper);
}
.loading-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 10px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--vermilion); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- City strip ---------- */
.cities-section { padding: 56px 0 60px; border-top: 1px solid var(--line); }
.city-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .city-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .city-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.city-tile { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; border: 1px solid var(--line); }
.city-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.city-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(18, 16, 14, .72) 100%); }
.city-tile:hover img { transform: scale(1.05); }
.city-tile-label { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 13px; color: #fff; }
.city-tile-label b { display: block; font-size: 16px; font-weight: 600; }
.city-tile-label span { font-size: 11px; opacity: .82; }

/* ---------- How it works ---------- */
.how-section { padding: 56px 0 70px; background: var(--cream-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 780px) { .how-grid { grid-template-columns: 1fr; gap: 18px; } }
.how-item { padding: 24px; border-left: 2px solid var(--line-strong); }
.how-item b { display: block; font-size: 11px; letter-spacing: .16em; color: var(--vermilion); text-transform: uppercase; margin-bottom: 10px; }
.how-item h4 { font-size: 17px; margin-bottom: 8px; }
.how-item p { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #e9e3d9; padding: 46px 0 30px; margin-top: 0; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand b { font-size: 17px; color: #fff; }
.footer-brand p { font-size: 12px; color: #a9a29a; margin-top: 8px; max-width: 320px; line-height: 1.7; }
.footer-links { display: flex; gap: 46px; flex-wrap: wrap; }
.footer-links h5 { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8e877e; margin: 0 0 12px; font-weight: 600; }
.footer-links a { display: block; font-size: 12.5px; color: #cfc9c0; padding: 3px 0; }
.footer-links a:hover { color: #fff; }
.footer-bottom { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 11px; color: #8e877e; }

/* ---------- Stars / badges ---------- */
.star-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gold-soft); color: #6d4b18; border-radius: 999px;
  padding: 5px 11px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.star-badge .glyph { color: var(--gold); font-size: 12px; letter-spacing: 1.5px; }
.star-badge.lvl-3 { background: #f0e2c4; color: #5f3f10; }
.star-badge.lvl-0 { background: var(--cream-3); color: var(--muted); }

.type-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 10px; font-size: 11px; color: var(--ink-soft); background: var(--paper);
}
.type-badge svg { width: 13px; height: 13px; stroke: currentColor; }
.type-food { border-color: #e2c3bd; color: #964238; }
.type-heritage { border-color: #ddd0b2; color: #7c5d24; }
.type-folk { border-color: #c6d0c9; color: #466253; }

/* ---------- Route detail page ---------- */
.route-page { background: var(--cream); }
.route-hero { border-bottom: 1px solid var(--line); padding: 26px 0 24px; }
.route-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--vermilion); }
.breadcrumb svg { width: 12px; height: 12px; stroke: var(--muted); }
.route-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.route-title-row h1 { font-size: clamp(24px, 3.6vw, 36px); line-height: 1.18; }
.route-title-row .zh { font-size: 14px; color: var(--muted); margin-top: 6px; }
.route-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: 16px; font-size: 12.5px; color: var(--ink-soft); }
.route-meta-row span { display: inline-flex; align-items: center; gap: 7px; }
.route-meta-row svg { width: 15px; height: 15px; stroke: var(--muted); }
.route-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.route-workspace { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(360px, 1fr); align-items: start; }
@media (max-width: 1024px) { .route-workspace { grid-template-columns: 1fr; } }

.map-column { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); align-self: start; z-index: 5; }
@media (max-width: 1024px) { .map-column { position: sticky; top: var(--header-h); height: 52vh; min-height: 340px; z-index: 20; } }
#map { width: 100%; height: 100%; background: var(--cream-3); }
.map-shell { position: relative; height: 100%; }
.map-frame { position: absolute; inset: 0; }

.map-overlay-top { position: absolute; z-index: 500; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.map-overlay-top > * { pointer-events: auto; }
.map-pill {
  background: rgba(255, 253, 248, .94); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 11.5px; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); display: inline-flex; align-items: center; gap: 7px;
  backdrop-filter: blur(8px);
}
.map-pill svg { width: 14px; height: 14px; stroke: var(--muted); }

.layer-panel {
  position: absolute; z-index: 500; left: 14px; top: 62px;
  background: rgba(255, 253, 248, .96); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-md); padding: 12px;
  max-width: calc(100% - 28px);
  backdrop-filter: blur(10px);
}
.layer-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.layer-panel-head b { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.layer-panel-head button { border: 0; background: transparent; font-size: 10.5px; color: var(--vermilion); cursor: pointer; padding: 0; }
.layer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--cream); border-radius: 999px;
  padding: 5px 10px; font-size: 11px; cursor: pointer; color: var(--muted);
  transition: all .16s ease;
}
.layer-chip svg { width: 13px; height: 13px; }
.layer-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.layer-chip.is-on { background: #fff; border-color: currentColor; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.layer-chip.is-on .dot { opacity: 1; }
.layer-chip[data-layer="fuel"] { color: var(--supply-fuel); }
.layer-chip[data-layer="service"] { color: var(--supply-service); }
.layer-chip[data-layer="toilet"] { color: var(--supply-toilet); }
.layer-chip[data-layer="store"] { color: var(--supply-store); }
.layer-chip[data-layer="hotel"] { color: var(--supply-hotel); }
.layer-chip .lbl { color: var(--ink-soft); }
.layer-chip .n {
  font-size: 9.5px; line-height: 1; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: rgba(29, 27, 24, .08); color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 500;
}
.route-card-link:focus-visible { outline: 2px solid var(--vermilion); outline-offset: -4px; border-radius: var(--radius); }

.detail-panel {
  position: absolute; z-index: 600; top: 0; bottom: 0; left: 0;
  width: min(392px, 88%);
  background: var(--paper); border-right: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(-104%);
  transition: transform .32s cubic-bezier(.22, .61, .36, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.detail-panel.is-open { transform: translateX(0); }
.detail-panel-media { position: relative; height: 42%; flex: 0 0 auto; overflow: hidden; }
.detail-panel-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-panel-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.5)); }
.detail-panel-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 253, 248, .95); display: grid; place-items: center;
}
.detail-panel-close svg { width: 16px; height: 16px; stroke: var(--ink); }
.detail-panel-media-label { position: absolute; z-index: 2; left: 16px; bottom: 14px; right: 16px; color: #fff; }
.detail-panel-media-label b { display: block; font-size: 17px; }
.detail-panel-media-label span { font-size: 12px; opacity: .85; }
.detail-panel-body { padding: 18px 18px 20px; overflow-y: auto; flex: 1; }
.detail-panel-body .desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; margin: 10px 0 14px; }
.detail-panel-facts { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.detail-panel-facts span { display: flex; gap: 8px; align-items: flex-start; }
.detail-panel-facts svg { width: 14px; height: 14px; stroke: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.detail-panel-actions { display: flex; gap: 8px; margin-top: 16px; }
.detail-panel-actions .btn { flex: 1; padding: 9px 12px; font-size: 12px; }

.panel-column { background: var(--paper); border-left: 1px solid var(--line); min-height: calc(100vh - var(--header-h)); }
@media (max-width: 1024px) { .panel-column { border-left: 0; border-top: 1px solid var(--line); min-height: 0; } }
.panel-inner { padding: 26px 28px 40px; }
@media (max-width: 640px) { .panel-inner { padding: 20px 18px 34px; } }

.panel-block + .panel-block { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head h2 { font-size: 18px; }
.panel-head .sub { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* Timeline */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 13px; top: 12px; bottom: 12px; width: 1px;
  background: linear-gradient(180deg, var(--vermilion) 0%, var(--line-strong) 100%);
}
.tl-item { position: relative; padding: 0 0 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: attr(data-index);
  position: absolute; left: -34px; top: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--muted); z-index: 1;
  transition: all .18s ease;
}
.tl-item.is-active::before { background: var(--vermilion); border-color: var(--vermilion); color: #fff; box-shadow: 0 0 0 4px rgba(181, 52, 43, .12); }
.tl-card {
  display: flex; gap: 12px; padding: 10px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  text-align: left; width: 100%; background: transparent;
}
.tl-card:hover { background: var(--cream); border-color: var(--line); }
.tl-item.is-active .tl-card { background: var(--cream-2); border-color: var(--line-strong); }
.tl-thumb { width: 76px; height: 76px; flex: 0 0 76px; border-radius: 9px; overflow: hidden; background: var(--cream-3); position: relative; }
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-content { min-width: 0; flex: 1; }
.tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-content h3 { font-size: 14.5px; line-height: 1.35; }
.tl-content .zh { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; font-size: 11px; color: var(--ink-soft); }
.tl-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tl-meta svg { width: 12px; height: 12px; stroke: var(--muted); }
.tl-arrow { align-self: center; color: var(--muted); }
.tl-arrow svg { width: 16px; height: 16px; stroke: currentColor; }

/* Tips */
.tips-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .tips-grid { grid-template-columns: 1fr; } }
.tip-card {
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; display: flex; gap: 10px; align-items: flex-start;
}
.tip-card .ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; border: 1px solid var(--line); }
.tip-card .ic svg { width: 15px; height: 15px; stroke: var(--vermilion); }
.tip-card b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.tip-card p { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }

/* Supply list */
.supply-list { display: flex; flex-direction: column; gap: 8px; }
.supply-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--cream); font-size: 12.5px;
  transition: all .16s ease;
}
.supply-row:hover { border-color: var(--line-strong); background: var(--paper); }
.supply-row .ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.supply-row .ic svg { width: 15px; height: 15px; stroke: #fff; }
.supply-row .txt { min-width: 0; flex: 1; }
.supply-row .txt b { display: block; font-size: 12.5px; font-weight: 500; }
.supply-row .txt span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.supply-row .goto { color: var(--muted); }
.supply-row .goto svg { width: 15px; height: 15px; stroke: currentColor; }
.supply-row[data-type="fuel"] .ic { background: var(--supply-fuel); }
.supply-row[data-type="service"] .ic { background: var(--supply-service); }
.supply-row[data-type="toilet"] .ic { background: var(--supply-toilet); }
.supply-row[data-type="store"] .ic { background: var(--supply-store); }
.supply-row[data-type="hotel"] .ic { background: var(--supply-hotel); }
.supply-row.is-off { opacity: .42; }

/* ---------- Leaflet skin ---------- */
.leaflet-container { font-family: var(--font); background: var(--cream-3); }
.leaflet-tile-pane { filter: saturate(.78) sepia(.14) brightness(1.02) contrast(.95); }
.leaflet-control-zoom { border: 1px solid var(--line) !important; box-shadow: var(--shadow-sm) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--paper) !important; color: var(--ink) !important; border-bottom-color: var(--line) !important; width: 32px !important; height: 32px !important; line-height: 32px !important; font-size: 16px !important; }
.leaflet-control-attribution { background: rgba(255,253,248,.8) !important; color: var(--muted) !important; font-size: 9.5px !important; }
.leaflet-control-attribution a { color: var(--ink-soft) !important; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-md); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 210px !important; }
.leaflet-popup-tip { box-shadow: none; }
.map-pop { background: var(--paper); }
.map-pop img { width: 100%; height: 96px; object-fit: cover; }
.map-pop-body { padding: 10px 12px 12px; }
.map-pop-body b { font-size: 12.5px; display: block; }
.map-pop-body small { font-size: 10.5px; color: var(--muted); display: block; margin-top: 1px; }
.map-pop-body .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.map-pop-body a { font-size: 10.5px; color: var(--vermilion); font-weight: 500; }

.poi-marker-wrap, .supply-marker-wrap { background: transparent; border: 0; }
.poi-marker {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: grid; place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.24);
  transition: transform .18s ease;
}
.poi-marker svg { transform: rotate(45deg); width: 16px; height: 16px; stroke: #fff; }
.poi-marker .num {
  position: absolute; top: -7px; right: -7px; transform: rotate(45deg);
  width: 17px; height: 17px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 9px; display: grid; place-items: center; border: 1.5px solid #fff;
}
.poi-marker.is-food { background: var(--vermilion); }
.poi-marker.is-heritage { background: #a87c2c; }
.poi-marker.is-folk { background: #4f7160; }
.poi-marker.is-active { transform: rotate(-45deg) scale(1.16); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.supply-marker {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.supply-marker svg { width: 11px; height: 11px; stroke: #fff; }
.supply-marker.is-fuel { background: var(--supply-fuel); }
.supply-marker.is-service { background: var(--supply-service); }
.supply-marker.is-toilet { background: var(--supply-toilet); }
.supply-marker.is-store { background: var(--supply-store); }
.supply-marker.is-hotel { background: var(--supply-hotel); }

/* ---------- POI detail page ---------- */
.poi-hero { position: relative; height: clamp(320px, 48vh, 520px); overflow: hidden; background: var(--cream-3); }
.poi-hero img { width: 100%; height: 100%; object-fit: cover; }
.poi-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,14,12,.18) 0%, rgba(15,14,12,.06) 35%, rgba(15,14,12,.72) 100%); }
.poi-hero-inner { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding-bottom: 30px; color: #fff; }
.poi-hero .breadcrumb { color: rgba(255,255,255,.78); }
.poi-hero .breadcrumb a:hover { color: #fff; }
.poi-hero .breadcrumb svg { stroke: rgba(255,255,255,.7); }
.poi-hero h1 { font-size: clamp(26px, 4.4vw, 44px); margin-top: 12px; color: #fff; }
.poi-hero .zh { font-size: 14px; opacity: .85; margin-top: 6px; }
.poi-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.poi-hero-meta .type-badge { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; backdrop-filter: blur(6px); }
.poi-hero-meta .star-badge { backdrop-filter: blur(6px); }

.poi-body { padding: 38px 0 60px; }
.poi-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; align-items: start; }
@media (max-width: 980px) { .poi-grid { grid-template-columns: 1fr; gap: 26px; } }
.poi-main > section + section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.poi-main h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.poi-main h2 svg { width: 17px; height: 17px; stroke: var(--vermilion); }
.prose p { font-size: 14.5px; line-height: 1.85; color: var(--ink-soft); }
.prose p + p { margin-top: 12px; }
.prose .zh-text { font-family: 'Noto Sans SC', var(--font); font-size: 14px; color: var(--muted); margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--line-strong); line-height: 1.9; }

.poi-tips { display: grid; gap: 10px; }
.poi-tip { display: flex; gap: 11px; padding: 13px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.65; }
.poi-tip .n { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: var(--cream-2); display: grid; place-items: center; font-size: 10.5px; color: var(--vermilion); font-weight: 600; }

.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.review-head { display: flex; align-items: center; gap: 11px; }
.review-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--cream-2); display: grid; place-items: center; font-size: 16px; border: 1px solid var(--line); }
.review-id { flex: 1; min-width: 0; }
.review-id b { display: block; font-size: 13px; font-weight: 500; }
.review-id span { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); margin-top: 1px; }
.review-score { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--gold); }
.review-score .num { color: var(--ink-soft); font-size: 11px; }
.review-text { font-size: 13px; line-height: 1.75; color: var(--ink-soft); margin-top: 10px; }
.review-text .zh { display: block; font-family: 'Noto Sans SC', var(--font); font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.poi-side { position: sticky; top: calc(var(--header-h) + 22px); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 980px) { .poi-side { position: static; } }
.info-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.info-card-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.info-rows { padding: 6px 16px 14px; }
.info-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.info-row:last-child { border-bottom: 0; }
.info-row svg { width: 15px; height: 15px; stroke: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.info-row .k { color: var(--muted); font-size: 11px; display: block; text-transform: uppercase; letter-spacing: .06em; }
.info-row .v { color: var(--ink); }
.info-card-actions { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--cream); border-top: 1px solid var(--line); }
.info-card-actions .btn { width: 100%; }
.poi-side-note { font-size: 11px; color: var(--muted); line-height: 1.6; padding: 0 4px; }

.related-strip { margin-top: 46px; padding-top: 30px; border-top: 1px solid var(--line); }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 780px) { .related-grid { grid-template-columns: 1fr; } }
.related-item { display: flex; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.related-item img { width: 62px; height: 62px; flex: 0 0 62px; border-radius: 7px; object-fit: cover; }
.related-item b { font-size: 12.5px; display: block; }
.related-item span { font-size: 11px; color: var(--muted); }

/* ---------- Modal / auth ---------- */
.modal-root { position: fixed; inset: 0; z-index: 900; display: none; }
.modal-root.is-open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(24, 21, 18, .48); backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s ease; }
.modal-root.is-open .modal-backdrop { opacity: 1; }
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
  width: min(430px, calc(100% - 32px));
  background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  opacity: 0; transition: opacity .22s ease, transform .28s cubic-bezier(.22,.61,.36,1);
  overflow: hidden;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal-root.is-open .modal { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-wide { width: min(560px, calc(100% - 32px)); }
.modal-head { padding: 22px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h3 { font-size: 19px; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; flex: 0 0 32px; }
.modal-close svg { width: 15px; height: 15px; stroke: var(--ink); }
.modal-body { padding: 18px 24px 24px; overflow-y: auto; }
.auth-tabs { display: flex; gap: 4px; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; border-radius: 7px; padding: 8px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.auth-tabs button.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-row input {
  width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--cream); padding: 0 13px; font-size: 13.5px; outline: none;
  transition: border-color .18s, background .18s;
}
.form-row input:focus { border-color: var(--vermilion); background: #fff; }
.form-error { display: none; font-size: 11.5px; color: var(--vermilion); background: var(--vermilion-soft); border-radius: 8px; padding: 8px 11px; margin-bottom: 12px; }
.form-error.is-on { display: block; }
.auth-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 12px; display: flex; gap: 7px; }
.auth-note svg { width: 13px; height: 13px; stroke: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.modal-actions { display: flex; gap: 9px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

.saved-list, .trip-list { display: flex; flex-direction: column; gap: 9px; }
.saved-item { display: flex; gap: 11px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); }
.saved-item img { width: 62px; height: 50px; border-radius: 7px; object-fit: cover; flex: 0 0 62px; }
.saved-item .info { flex: 1; min-width: 0; }
.saved-item b { display: block; font-size: 12.5px; }
.saved-item span { font-size: 11px; color: var(--muted); }
.saved-item .remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; }
.saved-item .remove:hover { color: var(--vermilion); }
.saved-item .remove svg { width: 15px; height: 15px; stroke: currentColor; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; z-index: 950; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 420px; }
.toast {
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px;
  font-size: 12.5px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in .28s cubic-bezier(.22,.61,.36,1);
}
.toast svg { width: 14px; height: 14px; stroke: currentColor; }
.toast-out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Utility ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.stack-y > * + * { margin-top: 12px; }
.nowrap { white-space: nowrap; }

/* Mobile header */
@media (max-width: 860px) {
  .header-nav { display: none; }
  .brand-name b { font-size: 13.5px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-name span { display: none; }
}
@media (max-width: 560px) {
  :root { --header-h: 60px; }
  .brand-seal { width: 34px; height: 34px; flex-basis: 34px; font-size: 18px; }
  .brand-name b { max-width: 132px; font-size: 12.5px; }
  .lang-switch button { padding: 4px 8px; font-size: 11px; }
  .header-actions { gap: 6px; }
  #authBtn { padding: 8px 12px; font-size: 12px; }
  .trip-badge { padding: 7px 9px; }
  .trip-badge .lbl { display: none; }
  .hero { padding: 48px 0 32px; }
  .planner { padding: 18px; border-radius: 16px; margin-top: 24px; }
  .planner-grid { grid-template-columns: 1fr; }
  .loc-btn { width: 100%; }
  .planner-actions { flex-direction: column; align-items: stretch; }
  .planner-submit { width: 100%; }
  .results { padding: 38px 0 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .route-hero { padding: 18px 0; }
  .map-column { height: 46vh; }
  .detail-panel { width: 100%; }
  .detail-panel-media { height: 38%; }
  .layer-panel { bottom: 12px; top: auto; left: 10px; right: 10px; max-width: none; }
  .layer-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .layer-chip { flex: 0 0 auto; }
  .route-title-row h1 { font-size: 23px; }
  .route-hero-actions { width: 100%; }
  .poi-body { padding: 26px 0 46px; }
  .poi-hero-inner { padding-bottom: 20px; }
  .review-card { padding: 14px; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .footer-links { gap: 30px; }
  .footer-bottom { font-size: 10.5px; }
}

/* Print-friendly */
@media print {
  .site-header, .map-column, .layer-panel, .detail-panel, .planner, .save-btn, .site-footer { display: none !important; }
  .panel-column { border: 0; }
  body { background: #fff; }
}

/* Map fallback when Leaflet cannot load (offline / blocked CDN) */
.map-fallback { display: flex; align-items: center; justify-content: center; background: #f3ece2; padding: 24px; }
.map-fallback > div { max-width: 340px; text-align: center; color: #6b6258; }
.map-fallback b { display: block; color: #1d1b18; font-size: 15px; margin-bottom: 6px; }
.map-fallback p { font-size: 13px; line-height: 1.6; margin: 0; }

/* --- Mobile header fit: keep brand, language switch and sign-in on one row --- */
@media (max-width: 560px) {
  .site-header .wrap { gap: 8px; }
  .brand { gap: 8px; min-width: 0; }
  .brand-name b { display: none; }
  .brand-name span { display: block; font-size: 9.5px; letter-spacing: .14em; }
  .header-actions { gap: 6px; flex: 0 0 auto; }
  .lang-switch button { padding: 4px 7px; font-size: 10.5px; }
  #authBtn { padding: 8px 12px; font-size: 12px; }
}

/* --- Compact rating legend so it never collides with the planner card --- */
.hero-legend { top: 64px; padding: 18px 20px 16px; }
.hero-legend-head p { margin-top: 6px; font-size: 14px; }
.hero-legend-list { margin-top: 10px; gap: 2px; }
.hero-legend-list li { padding: 8px 0; }
.hero-legend-list b { font-size: 12.5px; }
.hero-legend-list div > span { font-size: 10.5px; }
.hero-legend-list small { font-size: 9px; }
.hero-legend-note { margin-top: 10px; font-size: 10px; line-height: 1.5; }
@media (max-width: 1180px) { .hero-legend { display: none; } }

/* --- Detail panel: float above the map at full viewport height so the
       Navigate button never falls below the fold --- */
.detail-panel.is-open {
  position: fixed;
  top: var(--header-h);
  left: 0;
  height: calc(100vh - var(--header-h));
  z-index: 1200;
}

/* --- Anchor offset so the results heading is not hidden under the header --- */
#results, #cities, #how { scroll-margin-top: calc(var(--header-h) + 18px); }

/* --- Legend note stays on one line above the planner card --- */
.hero-legend-note { white-space: nowrap; font-size: 9.5px; }

/* --- Mobile supply layer chips: wrap instead of clipping --- */
@media (max-width: 560px) {
  .layer-chips { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  .layer-chip { flex: 0 0 auto; font-size: 11px; padding: 6px 9px; }
  .layer-panel { padding: 10px 12px 8px; }
}

/* --- Detail panel action icons: keep the buttons compact --- */
.detail-panel-actions svg { width: 15px; height: 15px; flex: 0 0 15px; stroke-width: 1.7; }
.detail-panel-actions .btn { min-height: 40px; }

/* --- Desktop: push the planner below the rating card --- */
.hero .planner { margin-top: 66px; }
@media (max-width: 560px) { .hero .planner { margin-top: 24px; } }

/* --- Mobile layer chips: tighter, two rows max --- */
@media (max-width: 560px) {
  .layer-chips { gap: 6px; }
  .layer-chip { font-size: 10.5px; padding: 5px 8px; gap: 5px; }
  .layer-panel-head { margin-bottom: 8px; }
}

/* --- Final hero alignment: rating card clears the planner on both locales --- */
.hero-legend { top: 44px; }
.hero .planner { margin-top: 88px; }
@media (max-width: 1180px) { .hero .planner { margin-top: 34px; } }
@media (max-width: 560px) { .hero .planner { margin-top: 24px; } }
