:root {
  --sea: #0e7c9b;
  --sea-deep: #0a5e76;
  --sand: #f6efe3;
  --ink: #1c2b33;
  --muted: #5d7079;
  --card: #ffffff;
  --line: #e3ddd0;
  --accent: #e3503e;
  --shadow: 0 8px 24px rgba(12, 60, 75, 0.10);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.5;
}

a { color: var(--sea-deep); }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(160deg, rgba(14,124,155,0.92), rgba(10,94,118,0.92)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20 Q10 10 20 20 T40 20' fill='none' stroke='%23ffffff22' stroke-width='2'/%3E%3C/svg%3E");
  color: #fff;
  padding: 38px 20px 30px;
  text-align: center;
}
.hero__inner { max-width: 920px; margin: 0 auto; }
.hero__badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 5px 14px; border-radius: 999px; font-size: 14px; margin-bottom: 10px;
}
.hero h1 { margin: 4px 0; font-size: clamp(30px, 6vw, 50px); letter-spacing: 1px; }
.hero__sub { margin: 0; opacity: 0.95; font-size: clamp(15px, 2.5vw, 19px); }
.hero__stats {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px;
}
.stat {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px; padding: 10px 16px; min-width: 92px;
}
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Tabs ---------- */
.tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  justify-content: center;
}
.tab {
  border: none; background: transparent; color: var(--muted);
  font-size: 15px; font-weight: 600; padding: 9px 16px; border-radius: 10px;
  cursor: pointer; white-space: nowrap; transition: 0.15s;
}
.tab:hover { background: var(--sand); color: var(--ink); }
.tab--active { background: var(--sea); color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 22px 16px 60px; }
.panel { display: none; animation: fade 0.3s ease; }
.panel--active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h2.section-title { font-size: 22px; margin: 8px 0 16px; }
.lead { color: var(--muted); margin-top: -6px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 18px; }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.flight-card { border-left: 5px solid var(--sea); }
.flight-card.back { border-left-color: var(--accent); }
.route-big { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.time-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; }
.time-row .t { font-size: 24px; font-weight: 700; }
.time-row .l { font-size: 12px; color: var(--muted); }

.note {
  background: #fff7ed; border: 1px solid #f4d8b0; border-radius: 12px;
  padding: 12px 14px; font-size: 14px; margin-top: 12px;
}
.note b { color: #b4530f; }

/* ---------- Itinerary ---------- */
.day {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 12px; overflow: hidden;
}
.day__head {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  cursor: pointer; user-select: none;
}
.day__num {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
}
.day__meta { flex: 1; min-width: 0; }
.day__title { font-weight: 700; font-size: 17px; }
.day__date { font-size: 13px; color: var(--muted); }
.day__drive { font-size: 13px; color: var(--sea-deep); margin-top: 2px; }
.day__chev { transition: 0.2s; color: var(--muted); font-size: 20px; }
.day.open .day__chev { transform: rotate(90deg); }
.day__body { display: none; padding: 0 18px 16px 76px; }
.day.open .day__body { display: block; }
.day__body ul { margin: 6px 0 12px; padding-left: 18px; }
.day__body li { margin-bottom: 5px; }
.day__section-title { font-size: 14px; font-weight: 700; color: var(--sea-deep); margin: 14px 0 8px; }
.poi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: var(--sand); border: 1px solid var(--line); cursor: pointer;
  text-decoration: none; color: var(--ink);
}
.chip:hover { background: #fff; border-color: var(--sea); }
.chip.opt { opacity: 0.75; font-style: italic; }
.poi-list { display: grid; gap: 10px; }
.poi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  background: #fcfbf7;
}
.poi-card--optional { opacity: 0.9; background: #faf8f1; }
.poi-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.poi-card__time {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; background: #e8f4f7; color: var(--sea-deep); font-size: 12px; font-weight: 700;
}
.poi-card h4 { margin: 0 0 8px; font-size: 16px; }
.poi-card__why, .poi-card__note { margin: 6px 0 0; font-size: 14px; }
.muted-inline { color: var(--muted); font-weight: 500; }

/* ---------- Map ---------- */
.map-wrap { display: grid; grid-template-columns: 1fr 240px; gap: 14px; }
#leaflet { height: 600px; border-radius: var(--radius); box-shadow: var(--shadow); }
.map-legend {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; font-size: 14px; align-self: start;
}
.map-legend h4 { margin: 0 0 10px; font-size: 15px; }
.legend-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; cursor: pointer; }
.legend-row .dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }
.legend-row span { flex: 1; }
.legend-row small { color: var(--muted); }
.legend-row.off { opacity: 0.4; }
.legend-note { font-size: 12px; color: var(--muted); margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.map-status {
  background: #eef6f8; border: 1px solid #d5e6eb; color: var(--sea-deep);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; margin-bottom: 10px;
}

.leaflet-popup-content { font-size: 14px; }
.leaflet-popup-content b { font-size: 15px; }
.pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); font-size: 12px; font-weight: 700; color: #fff; }

/* ---------- Stay ---------- */
.stay-card { display: grid; grid-template-columns: 8px 1fr; gap: 0; overflow: hidden; }
.stay-card__bar { width: 8px; }
.stay-card__in { padding: 16px 20px; }
.stay-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stay-head h3 { margin: 0; }
.stay-nights { background: var(--sea); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.stay-dates { color: var(--muted); font-size: 14px; }
.stay-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--sea); color: #fff; border: none; cursor: pointer;
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.btn:hover { background: var(--sea-deep); }
.btn--air { background: #ff5a5f; }
.btn--air:hover { background: #e0484d; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--sand); }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.stay-progress { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 18px 0 6px; box-shadow: var(--shadow); }
.stay-progress div { color: #fff; font-size: 11px; display: grid; place-items: center; }
.stay-copy {
  margin: 8px 0 0; font-size: 14px; color: var(--ink);
}
.query-box {
  margin-top: 10px; background: #f2f6f7; border: 1px solid #d9e5e8;
  border-radius: 12px; padding: 10px 12px; font-size: 14px;
}

/* ---------- Docs ---------- */
.doc-group h3 { margin: 18px 0 10px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.doc {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px; display: flex; gap: 12px; align-items: center;
  cursor: pointer; transition: 0.15s;
}
.doc:hover { border-color: var(--sea); transform: translateY(-2px); }
.doc__ico { font-size: 26px; }
.doc__t { font-weight: 600; font-size: 14px; }
.doc__x { font-size: 12px; color: var(--muted); text-transform: uppercase; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10,40,50,0.6); }
.modal__box {
  position: relative; background: #fff; border-radius: 14px; width: min(960px, 100%);
  height: min(86vh, 900px); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
}
.modal__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal__actions { display: flex; gap: 8px; }
.modal__body { flex: 1; overflow: auto; background: #f0eadf; }
.modal__body iframe, .modal__body img { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; }
.modal__body pre { margin: 0; padding: 18px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; font-family: "Segoe UI", system-ui, sans-serif; }

/* ---------- Footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .map-wrap { grid-template-columns: 1fr; }
  #leaflet { height: 440px; }
  .day__body { padding-left: 18px; }
  .kv { grid-template-columns: 110px 1fr; }
  .poi-card__top { align-items: flex-start; flex-direction: column; }
}
