:root {
  --bg: #f7faf9;
  --surface: #ffffff;
  --text: #13201d;
  --muted: #5b6b67;
  --line: #dde6e3;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --accent: #e76f51;
  --warn-bg: #fff4e5;
  --warn-ink: #7a4100;
  --ok-bg: #e7f6f3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513; --surface: #16201d; --text: #e7efec; --muted: #9fb0ab; --line: #26332f;
    --brand: #2bb3a6; --brand-ink: #062622; --warn-bg: #3a2a12; --warn-ink: #ffd9a3; --ok-bg: #133029;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--brand); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand b { color: var(--brand); }
.topbar nav { display: flex; gap: 16px; }
.topbar nav a { text-decoration: none; font-weight: 600; }

main { max-width: 860px; margin: 0 auto; padding: 16px; }
.hero { padding: 32px 0 16px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.pillars { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 24px; }
.pillars li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.pillars strong { display: block; }
.pillars span { color: var(--muted); font-size: .95rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 20px 0; }
.card h2 { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; margin-bottom: 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; margin-bottom: 12px; flex: 1; }
input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); min-height: 44px; }
input:focus, select:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row label { min-width: 180px; }
small, .hint { color: var(--muted); font-size: .9rem; }

.btn { font: inherit; font-weight: 700; border-radius: 999px; padding: 12px 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: progress; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--brand); }
.chip.love { background: var(--brand); color: var(--brand-ink); }
.chip.love::after { content: " ♥"; }

.notice { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: 10px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); }
.kpis strong { color: var(--text); }
.warnings { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px 10px 32px; font-size: .92rem; }

.day { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
.day h3 { margin: 0 0 8px; }
.day h3::first-letter { text-transform: uppercase; }
.weather { color: var(--accent); font-weight: 600; margin: 0 0 8px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.item:last-child { border-bottom: 0; }
.time { font-variant-numeric: tabular-nums; font-weight: 700; }
.time span { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.title { margin: 0; font-weight: 600; }
.tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.t-visit .tag, .t-activity .tag { color: var(--brand); border-color: var(--brand); }
.t-transfer, .t-buffer { opacity: .8; }
.t-transfer .title, .t-buffer .title { font-weight: 400; }
.conf { font-size: .78rem; background: var(--warn-bg); color: var(--warn-ink); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.why, .cost { color: var(--muted); margin: 2px 0 0; font-size: .92rem; }
.fallback { margin: 6px 0 0; font-size: .92rem; background: var(--ok-bg); border-radius: 8px; padding: 6px 10px; }
details summary { cursor: pointer; color: var(--brand); font-size: .92rem; }
details ul { margin: 6px 0 0; padding-left: 20px; font-size: .92rem; color: var(--muted); }
#excluded-box { margin-top: 20px; }

.footer { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; color: var(--muted); font-size: .9rem; }
.fine { font-size: .82rem; }

@media (max-width: 480px) {
  .topbar { padding: 10px 12px; }
  .brand { font-size: 1rem; }
  .topbar nav { gap: 12px; font-size: .9rem; white-space: nowrap; }
  .card { padding: 16px; }
}

@media print {
  .topbar, .hero, #planificar, #mis-viajes, .actions, .footer nav { display: none !important; }
  .card { box-shadow: none; border: 0; }
  details { display: block; }
}

/* ---------------- catálogo de destinos ---------------- */
[hidden] { display: none !important; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; }
.filters label { min-width: 160px; }
.dest-grid { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dest { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--bg); }
.dest-name { margin: 0; font-weight: 700; font-size: 1.05rem; }
.dest-meta, .dest-pop { margin: 0; color: var(--muted); font-size: .9rem; }
.dest-status { margin: 4px 0 8px; font-size: .82rem; font-weight: 600; color: var(--warn-ink); }
.dest-status.pilot { color: var(--brand); }
.dest .btn { margin-top: auto; align-self: flex-start; }
.btn.small { padding: 8px 14px; min-height: 36px; font-size: .9rem; background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
