: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; }
.app-header-actions { display: grid; gap: 10px; justify-items: end; }
.admin-user-form { display: grid; gap: 10px; margin-top: 16px; }
.admin-user-form input, .admin-user-form button { font: inherit; }
.admin-user-list { display: grid; gap: 12px; margin-top: 16px; }
.admin-user-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.login-form label { display: block; margin-top: 12px; font-weight: 700; }
.login-form input, .login-form button { width: 100%; margin-top: 6px; }
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; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; font: inherit; background: white; resize: vertical; }
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-shell { display: grid; gap: 20px; }
.app-header-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.app-header h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.itinerary-strip { display: flex; gap: 12px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: thin; }
.itinerary-strip .itinerary-card { min-width: 220px; flex: 0 0 auto; }
.workspace { min-height: 60vh; }
.workspace-empty { padding: 24px 0; }
.workspace-head { display: grid; gap: 12px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.workspace-title-row { display: grid; grid-template-columns: 1fr minmax(120px, 180px) auto; gap: 10px; align-items: center; }
.workspace-title-form { display: grid; gap: 12px; }
.workspace-title-form label:not(.sr-only) { display: grid; gap: 6px; margin: 0; color: var(--accent); font-weight: 800; font-size: .9rem; }
.workspace-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.workspace-body { display: grid; grid-template-columns: minmax(280px, 42%) 1fr; gap: 20px; align-items: start; }
.workspace-map-panel { display: grid; gap: 12px; position: sticky; top: 16px; }
.workspace-map { min-height: 420px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: linear-gradient(135deg, #fffaf3, #efe2d2); padding: 16px; }
.workspace-stops-panel { display: grid; grid-template-rows: auto auto 1fr; gap: 12px; min-height: 520px; max-height: 78vh; }
.stop-editor-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.stop-editor-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.stop-editor-head h3 { margin: 4px 0 0; font-size: 1.15rem; line-height: 1.2; }
.stop-editor-address { margin: 0 0 12px; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.stop-nav { display: flex; gap: 8px; }
.stop-nav button { padding: 10px 14px; }
.stop-nav button:disabled { opacity: .45; cursor: not-allowed; }
.stop-edit-form { display: grid; gap: 10px; }
.stop-edit-form label { display: grid; gap: 6px; margin: 0; color: var(--accent); font-weight: 800; font-size: .85rem; }
.stop-category-tag { color: var(--muted); font-weight: 800; font-size: .85rem; }
.stops-list-toolbar { display: flex; gap: 10px; align-items: center; }
.stops-list-toolbar input[type="search"] { flex: 1; min-width: 0; }
.stops-count { color: var(--muted); font-weight: 800; font-size: .9rem; white-space: nowrap; }
.stops-compact-list { display: grid; gap: 4px; overflow: auto; padding-right: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.stops-empty { margin: 8px 0; }
.stop-compact-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.stop-compact-item:hover { border-color: var(--line); background: var(--bg); }
.stop-compact-item.active { border-color: var(--accent); background: #fff7f2; box-shadow: 0 0 0 1px rgba(122, 63, 38, .08); }
.stop-compact-item[data-category="vegan"] { border-left: 3px solid #4caf7d; }
.stop-compact-item[data-category="classic"] { border-left: 3px solid #d7a75f; }
.stop-compact-item[data-category="culture"] { border-left: 3px solid #6aa6ff; }
.stop-compact-item[data-category="park"] { border-left: 3px solid #94b986; }
.stop-compact-item[data-category="food"], .stop-compact-item[data-category="tapas"] { border-left: 3px solid #d86f55; }
.stop-compact-item[data-category="restaurant"], .stop-compact-item[data-category="restaurants"] { border-left: 3px solid #8b5e34; }
.stop-compact-item[data-category="wine"], .stop-compact-item[data-category="wine_bars"] { border-left: 3px solid #a978d6; }
.stop-compact-item[data-category="cocktail"], .stop-compact-item[data-category="cocktail_bars"] { border-left: 3px solid #58c4b8; }
.stop-compact-item[data-category="hotel"], .stop-compact-item[data-category="hotels"] { border-left: 3px solid #111827; }
.stop-compact-item[data-category="michelin"] { border-left: 3px solid #c41e3a; }
.stop-compact-text { display: grid; gap: 1px; min-width: 0; }
.stop-compact-text strong { font-size: .92rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-compact-text small { color: var(--muted); font-size: .78rem; line-height: 1.2; }
.stop-row-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stop-row-links a { color: var(--accent); font-weight: 800; text-decoration: none; }
.stop-index { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--bg); color: var(--accent); font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.search-drawer summary { cursor: pointer; font-weight: 800; color: var(--accent); list-style: none; }
.search-drawer summary::-webkit-details-marker { display: none; }
.search-drawer-body { margin-top: 16px; display: grid; gap: 14px; }
.search-tools { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.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; }
button.danger { color: #9b1c1c; border-color: #f0c7c7; }
.city-chip.active { color: #fff; background: var(--accent); }
@media (max-width: 900px) {
  .workspace-body, .workspace-title-row, .search-tools { grid-template-columns: 1fr; }
  .workspace-map-panel { position: static; }
  button { width: 100%; }
  .form-actions button, .workspace-actions .pill-link { width: auto; }
}
.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; } }
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 { color: var(--accent); background: #fff; border: 1px solid var(--line); }
button.secondary { margin-top: 0; }
.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; justify-content: flex-end; }
.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-dashboard { display: grid; gap: 16px; margin-top: 28px; }
.itinerary-dashboard h3, .selected-itinerary-header h3 { margin: 0 0 8px; }
.itinerary-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.itinerary-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.itinerary-card-actions button { width: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.itinerary-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(122, 63, 38, .12); }
.itinerary-card button { display: grid; gap: 4px; width: 100%; padding: 0; color: var(--text); background: transparent; border-radius: 0; text-align: left; white-space: normal; }
.itinerary-card span, .itinerary-card small { color: var(--muted); }
.itinerary-card a { color: var(--accent); font-weight: 800; text-decoration: none; }
.selected-itinerary-header { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.stop-section-header { margin-top: 24px; }
.itinerary-edit-form, .stop-edit-form { display: grid; gap: 12px; }
.itinerary-edit-form label, .stop-edit-form label { display: grid; gap: 6px; margin: 0; color: var(--accent); font-weight: 800; }
.itinerary-edit-form input, .itinerary-edit-form textarea, .stop-edit-form input, .stop-edit-form textarea { color: var(--text); font-weight: 500; }
.compact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-actions button { width: auto; }
.save-status { color: var(--accent); font-weight: 800; }
.save-status.error { color: #9b1c1c; }
.dashboard-stop-list { display: grid; gap: 12px; margin-top: 18px; max-height: 720px; overflow: auto; padding-right: 4px; }
.dashboard-stop p { margin: 8px 0 0; color: var(--text); line-height: 1.45; }
.stop-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.stop-actions a { color: var(--accent); font-weight: 800; text-decoration: none; }
.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="vegan"] { border-top: 5px solid #4caf7d; }
.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; }
