:root {
  color-scheme: light;
  --bg: #f7f3ed;
  --card: #fffaf3;
  --text: #1d1b18;
  --muted: #6f675d;
  --accent: #7a3f26;
  --line: #e6d9ca;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0; }
.hero { min-height: 100svh; display: grid; place-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 4vw, 48px); box-shadow: 0 24px 80px rgba(45, 31, 18, .08); }
.hero-card { max-width: 760px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .78rem; }
h1 { font-size: clamp(2.2rem, 6vw, 5rem); line-height: .95; margin: 12px 0 20px; }
h2 { margin-top: 0; }
.muted { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.login-form, .search-box { margin-top: 28px; }
label { display: block; font-weight: 700; margin-bottom: 8px; }
.inline-form, .search-box { display: flex; gap: 12px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 14px 18px; font: inherit; background: white; }
button { border: 0; border-radius: 999px; padding: 14px 20px; font: inherit; font-weight: 700; color: white; background: var(--accent); cursor: pointer; white-space: nowrap; }
.notice { margin-top: 18px; color: var(--accent); font-weight: 700; }
.notice.error { color: #9b1c1c; }
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.map-placeholder { min-height: 420px; background: linear-gradient(135deg, #fffaf3, #efe2d2); }
@media (max-width: 760px) { .shell { width: min(100% - 20px, 1120px); padding: 20px 0; } .card { border-radius: 22px; } .inline-form, .search-box, .app-grid { display: grid; grid-template-columns: 1fr; } button { width: 100%; } }
select { border: 1px solid var(--line); border-radius: 999px; padding: 14px 18px; font: inherit; background: white; }
.result-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result-links a { color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; text-decoration: none; font-weight: 700; }
@media (max-width: 760px) { select { width: 100%; } }
.place-result { display: grid; gap: 4px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.place-result span, .place-result small { color: var(--muted); }
.place-result a { width: fit-content; }
.secondary { margin-top: 18px; color: var(--accent); background: #fff; border: 1px solid var(--line); }
.placeholder-grid { display: grid; gap: 18px; margin-top: 18px; }
.placeholder-city { display: grid; gap: 14px; }
.placeholder-city h3 { margin: 8px 0 0; }
.placeholder-category { display: grid; gap: 10px; }
.placeholder-category h4 { display: flex; justify-content: space-between; margin: 0; color: var(--accent); }
.placeholder-category h4 span { color: var(--muted); font-weight: 600; }
.itinerary-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; margin-top: 18px; }
.itinerary-page { display: grid; gap: 24px; }
.itinerary-map { margin-top: 24px; min-height: 280px; padding: 24px; }
.stop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stop-card h2 { font-size: 1.35rem; line-height: 1.15; }
.pill-link { display: inline-flex; width: fit-content; color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; text-decoration: none; font-weight: 700; }
@media (max-width: 900px) { .itinerary-actions, .stop-list { grid-template-columns: 1fr; } }
.resource-link { display: block; color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; font-weight: 700; }
.library-card { grid-column: 1 / -1; }
.library-summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.metric-row { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; color: var(--muted); font-weight: 700; }
.metric-row span, .city-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 14px; }
.city-chip { color: var(--accent); width: auto; cursor: pointer; }
.itinerary-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.filter-chip { width: auto; color: var(--accent); background: #fff; border: 1px solid var(--line); }
.filter-chip.active { color: #fff; background: var(--accent); }
.stop-card[hidden] { display: none; }
#itinerary-map { overflow: hidden; }
.stop-meta { color: var(--accent); font-weight: 800; margin: 4px 0 8px; }
.stop-summary, .stop-description { color: var(--text); line-height: 1.5; }
.place-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.place-facts span, .place-facts a { color: var(--accent); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; text-decoration: none; font-size: .9rem; font-weight: 800; }
.stop-description { border-top: 1px solid var(--line); padding-top: 12px; white-space: pre-line; }
.stop-card[data-category="classic"] { border-top: 5px solid #d7a75f; }
.stop-card[data-category="culture"] { border-top: 5px solid #6aa6ff; }
.stop-card[data-category="park"] { border-top: 5px solid #94b986; }
.stop-card[data-category="food"], .stop-card[data-category="tapas"] { border-top: 5px solid #d86f55; }
.stop-card[data-category="restaurant"], .stop-card[data-category="restaurants"] { border-top: 5px solid #8b5e34; }
.stop-card[data-category="wine"] { border-top: 5px solid #a978d6; }
.stop-card[data-category="cocktail"] { border-top: 5px solid #58c4b8; }
.stop-card[data-category="hotel"], .stop-card[data-category="hotels"] { border-top: 5px solid #111827; }
.stop-card[data-category="michelin"] { border-top: 5px solid #c41e3a; }
.static-pin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 18px; }
.static-pin { display: flex; align-items: center; gap: 8px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; text-decoration: none; font-weight: 700; }
.static-pin span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--pin, var(--accent)); color: #fff; font-size: 1rem; line-height: 1; }
.static-pin small { color: var(--muted); font-weight: 800; }
.map-location-control { margin: 10px !important; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: #fffaf3; color: var(--accent); font: 800 .92rem Inter, ui-sans-serif, system-ui, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; }
.map-location-control:disabled { opacity: .72; cursor: default; }
.map-popup { max-width: 260px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #1d1b18; }
.map-popup strong { display: block; margin-bottom: 6px; }
.map-popup p { margin: 8px 0; color: #5f574f; line-height: 1.35; }
.popup-links { display: flex; gap: 8px; flex-wrap: wrap; }
.popup-links a { color: #7a3f26; font-weight: 800; text-decoration: none; }

.itinerary-mode-panel { display: none; }
.itinerary-mode-panel.is-active { display: block; }
.stop-list.itinerary-mode-panel.is-active { display: grid; }
.itinerary-bottom-bar { position: sticky; bottom: 14px; z-index: 20; width: fit-content; margin: 0 auto; display: flex; gap: 6px; padding: 6px; border: 1px solid rgba(122, 63, 38, .16); border-radius: 999px; background: rgba(255, 250, 243, .92); box-shadow: 0 18px 48px rgba(45, 31, 18, .18); backdrop-filter: blur(18px); }
.mode-toggle { width: auto; min-width: 96px; padding: 11px 16px; color: var(--accent); background: transparent; border: 0; }
.mode-toggle.active { color: #fff; background: var(--accent); }
.stop-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 18px; overflow: hidden; }
.stop-card-media { min-height: 150px; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, #efe2d2, #fffaf3); }
.stop-card-media img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; display: block; }
.stop-card-placeholder { width: 100%; height: 100%; min-height: 150px; display: grid; place-items: center; color: #fffaf3; background: var(--accent); font-family: Georgia, serif; font-size: 3rem; font-weight: 800; }
.stop-card-body { min-width: 0; }
.stop-card-body .muted { font-size: .98rem; }
.stop-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.image-credit { color: var(--muted); font-size: .78rem; }
@media (max-width: 720px) {
  .itinerary-page { padding-bottom: 86px; }
  .itinerary-bottom-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); }
  .stop-card { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 22px; }
  .stop-card-media, .stop-card-media img, .stop-card-placeholder { min-height: 112px; }
  .stop-card-placeholder { font-size: 2.25rem; }
  .stop-card h2 { font-size: 1.08rem; }
  .stop-card .eyebrow { font-size: .68rem; }
  .place-facts { gap: 6px; }
  .place-facts span, .place-facts a { font-size: .78rem; padding: 6px 8px; }
}
@media (max-width: 460px) {
  .stop-card { grid-template-columns: 1fr; }
  .stop-card-media, .stop-card-media img, .stop-card-placeholder { min-height: 176px; }
}


.home-shell { display: grid; gap: 24px; }
.home-hero-card { max-width: none; }
.home-metrics { margin-top: 22px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.city-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.city-index-card { padding: clamp(20px, 3vw, 30px); }
.city-index-header { display: grid; gap: 14px; }
.city-index-header h2 { margin: 6px 0 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.city-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.city-counts span { color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; font-size: .9rem; font-weight: 800; }
.city-link-list { display: grid; gap: 10px; margin-top: 18px; }
@media (max-width: 760px) { .home-actions .pill-link { width: 100%; justify-content: center; } }


.quick-poi-panel { display: grid; gap: 16px; margin: 18px 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 255, 255, .52); }
.quick-poi-panel h3 { margin: 4px 0 6px; font-size: 1.35rem; }
.quick-poi-panel .muted { margin: 0; font-size: .98rem; }
.quick-poi-form { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(140px, .9fr) minmax(150px, .8fr) minmax(130px, .7fr) auto; gap: 10px; align-items: end; }
.quick-poi-status .notice { margin-top: 0; }
@media (max-width: 980px) { .quick-poi-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .quick-poi-form { grid-template-columns: 1fr; } }
