/* Vacation Finder. Phone first (390 px), then laptop. Colours and pin shape from v17. */
:root {
  --ink: #1e1b18; --muted: #5e574e; --line: #dcd6cb; --bg: #f6f4ef; --card: #fff;
  --accent: #2f2c28;
  --green: #1e8a4c; --yellow: #d9a21b; --orange: #e07b1a; --red: #c0392b; --grey: #8a8a8a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; }

/* header */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px 4px; }
.top h1 { font-size: 1.2rem; margin: 0; }
.top a { color: var(--accent); font-weight: 600; }

/* controls */
.controls { padding: 4px 12px 8px; display: grid; gap: 6px; }
.regions, .ratings { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.regions button { background: #fff; border: 1px solid var(--accent); color: var(--accent); padding: 5px 11px; border-radius: 99px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.regions button.on { background: var(--accent); color: #fff; }
.ratings button { background: #fff; border: 1px solid var(--line); padding: 4px 10px 4px 6px; border-radius: 99px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.ratings button[aria-pressed="false"] { opacity: 0.5; text-decoration: line-through; }
.ratings.paused button { opacity: 0.35; pointer-events: none; }
.paused-note { font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.c-green { background: var(--green); } .c-yellow { background: var(--yellow); } .c-orange { background: var(--orange); }
.c-red { background: var(--red); } .c-grey { background: var(--grey); }

/* booking dates */
.dates { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.dates summary { padding: 6px 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.dates summary span { font-weight: 400; }
.dates-body { padding: 4px 10px 10px; display: grid; gap: 8px; font-size: 14px; }
.dates-body label { display: grid; gap: 2px; }
.dates-body label.inline { display: flex; gap: 6px; align-items: center; }
.dates-body input[type="date"], .dates-body input[type="number"] { font: inherit; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; max-width: 12rem; }
.dates .nights { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.dates .nights input { width: 5rem; }
.dates .quick { display: flex; gap: 6px; }
.dates .quick button { background: #fff; border: 1px solid var(--accent); border-radius: 99px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.dates .quick button.on { background: var(--accent); color: #fff; }
.past-note { margin: 0; color: #9e281e; font-size: 13px; font-weight: 600; }
.dates .hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* layout: phone = map on top (about half the screen), list below */
.layout { display: block; }
#map-wrap { position: relative; }
#map { height: 50vh; min-height: 280px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #e9e6df; }
#map-offline { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; background: #f3f1ec; z-index: 1001; font-weight: 600; }
#map-offline[hidden] { display: none; }
#list-wrap { padding: 8px 12px 24px; }

/* laptop: list beside the map */
@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; height: calc(100vh - var(--top-h, 140px)); }
  #map { height: 100%; border: 1px solid var(--line); }
  #map-wrap { height: 100%; }
  #list-wrap { overflow-y: auto; height: 100%; border-top: 1px solid var(--line); }
}

/* list */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 8px; }
.list-head .count { font-size: 15px; }
.sort { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sort button { background: #fff; border: 1px solid var(--accent); color: var(--accent); padding: 3px 10px; font-size: 13px; cursor: pointer; }
.sort button:first-of-type { border-radius: 99px 0 0 99px; }
.sort button:last-of-type { border-radius: 0 99px 99px 0; border-left: none; }
.sort button.on { background: var(--accent); color: #fff; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 12px; margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rows button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.rows button:hover, .rows button:focus-visible { border-color: var(--accent); }
.marks { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; min-height: 28px; }
.badge { flex: 0 0 auto; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.badge.c-yellow { color: #2a1f00; }
.info { display: grid; min-width: 0; }
.info .name { font-weight: 600; }
.info .meta, .info .rent { font-size: 13px; color: var(--muted); }
/* warnings (burger strip, shuts for winter…): always visible, never change the colour */
.info .warn, .vf-pop .p-warn, #detail .d-warn { color: var(--red); font-weight: 700; font-size: 13px; }

/* pins (v17 teardrop) */
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.pin span { transform: rotate(45deg); font-weight: 800; font-size: 10.5px; color: #fff; letter-spacing: -0.3px; }
.pin-green { background: var(--green); } .pin-yellow { background: var(--yellow); } .pin-yellow span { color: #2a1f00; }
.pin-orange { background: var(--orange); } .pin-red { background: var(--red); } .pin-grey { background: var(--grey); }

/* price tag (SPEC §3): the price-mode shape for pins, list badges and the legend */
.tag { display: inline-flex; align-items: center; box-sizing: border-box; height: 24px; min-width: 34px; padding: 0 13px 0 6px; border-radius: 4px 0 0 4px;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); position: relative; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: -0.3px; }
.tag::after { content: ''; position: absolute; right: 5px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #fff; }
.tag.c-yellow { color: #2a1f00; }
.tagpin { display: flex; justify-content: center; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.badge.tag { height: 26px; min-width: 38px; padding: 0 14px 0 7px; border: none; box-shadow: none; border-radius: 4px 0 0 4px; justify-content: flex-start; }
.tag.mini { height: 13px; min-width: 19px; padding: 0; }
.tag.mini::after { right: 4px; width: 3px; height: 3px; margin-top: -1.5px; }
.round.mini { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.vf-legend .tag.mini { height: 11px; min-width: 16px; }

/* map controls: colour switch and price legend, small, top right */
.vf-box { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,.2); font-size: 12px; transition: opacity .15s; }
.vf-box.under-popup { opacity: 0; pointer-events: none; }
.vf-switch { display: flex; overflow: hidden; padding: 0; }
.vf-switch button { border: none; background: #fff; padding: 5px 9px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--accent); }
.vf-switch button.on { background: var(--accent); color: #fff; }
.vf-legend { padding: 5px 8px; line-height: 1.5; }
.vf-legend .t { font-weight: 600; margin-bottom: 1px; }
.vf-legend .r { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.vf-legend .dot { width: 10px; height: 10px; }
.vf-note { background: rgba(255,255,255,.9); padding: 2px 6px; border-radius: 4px; font-size: 11.5px; color: var(--muted); }

.leaflet-control-attribution { font-size: 10px; }

/* popups (SPEC §4) */
.leaflet-popup-content { font-size: 13.5px; line-height: 1.45; margin: 10px 12px; }
.vf-pop { display: grid; gap: 5px; }
.vf-pop .p-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-right: 12px; }
.vf-pop .p-title strong { font-size: 14.5px; }
.vf-pop .p-title small { color: var(--muted); white-space: nowrap; }
.vf-pop .p-line { color: var(--muted); }
.vf-pop .p-line .dot { width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.vf-pop .p-rent { font-weight: 600; }
.vf-pop .p-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.vf-pop .p-chips span { background: #f1efea; border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; font-size: 12px; white-space: nowrap; }
/* Details / List: an outlined pill button, the same look as the panel's ‹ List */
.p-details { justify-self: start; margin-top: 2px; background: #fff; border: 1px solid var(--accent); border-radius: 99px; padding: 3px 12px; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 13.5px; }
.vf-pop .p-buttons { display: flex; justify-content: space-between; gap: 8px; }
.vf-pop .p-flights { text-decoration: none; }
.p-details:hover, .back:hover { background: #f4f7fb; }
.vf-pop .p-links { border-top: 1px solid var(--line); padding-top: 5px; }
.vf-pop .p-links a { color: var(--accent); font-weight: 700; }

/* detail panel (SPEC §5): takes the list's place until Back */
#detail { padding: 8px 12px 24px; }
#detail[hidden] { display: none; }
.detail-head { display: grid; gap: 4px; margin-bottom: 6px; }
.detail-head h2 { font-size: 1.15rem; margin: 0; }
.detail-head h2 small { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.back { justify-self: start; background: #fff; border: 1px solid var(--accent); border-radius: 99px; padding: 4px 12px; font-weight: 600; cursor: pointer; }
#detail section { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
#detail h3 { font-size: 1rem; margin: 0 0 4px; }
#detail p { margin: 0; }
#detail .d-circle { color: var(--muted); font-size: 13px; margin-top: 2px; }
#detail .not-yet { color: var(--muted); font-style: italic; }
@media (min-width: 900px) { #detail { overflow-y: auto; height: 100%; border-top: 1px solid var(--line); } }
/* weather table in the detail panel: five months fit 390 px */
#detail .wx { border-collapse: collapse; width: 100%; max-width: 360px; font-size: 14px; }
#detail .wx th, #detail .wx td { padding: 3px 4px; text-align: center; }
#detail .wx thead th { color: var(--muted); font-weight: 600; }
#detail .wx tbody th { text-align: left; font-weight: 600; }
#detail .wx tbody tr + tr { border-top: 1px solid var(--line); }
#detail .wx-note { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* detail panel: rating score and its seven factors */
#detail .d-score .dot { width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
#detail .d-cap { color: var(--muted); font-size: 13px; }
#detail .factors { border-collapse: collapse; width: 100%; max-width: 360px; font-size: 14px; margin-top: 4px; }
#detail .factors th { text-align: left; font-weight: 400; padding: 2px 4px 2px 0; }
#detail .factors td { text-align: right; padding: 2px 0 2px 8px; white-space: nowrap; }
#detail .factors td + td { color: var(--muted); }
#detail .factors tr + tr { border-top: 1px solid var(--line); }
#detail .d-rating a { color: var(--accent); font-weight: 600; }

/* detail panel: flights (SPEC §5) */
#detail .d-flights p + p { margin-top: 6px; }
#detail .d-flights a { color: var(--accent); font-weight: 600; }

/* Flights page (SPEC §13) */
.top-links { display: flex; gap: 14px; }
.fl-chips button .dot { border: none; box-shadow: none; }
.fl-YUL { background: #1f5fa8; } .fl-YYZ { background: #b0302a; } .fl-YOW { background: #2e7d4f; }
.fl-line { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--accent); vertical-align: middle; }
.fl-line.daily { border-top-width: 5px; } .fl-line.several { border-top-width: 2.5px; }
.fl-line.weekly { border-top: 2.5px dotted var(--accent); } .fl-line.hop { border-top: 1.5px solid #6f6a62; }
.fl-layout #map { height: 62vh; min-height: 320px; }
/* The side column (SPEC §13): what was tapped, on a wide screen; the help and sources everywhere. */
.fl-side { padding: 8px 12px 24px; font-size: 13.5px; color: var(--muted); max-width: 760px; }
.fl-side p { margin: 0 0 6px; }
.fl-side-content { display: none; }
.fl-help { margin: 0 0 8px; }
.fl-help summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 4px 0; }
.fl-help[open] summary { margin-bottom: 4px; }
@media (min-width: 900px) {
  .fl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100vh - 150px); }
  .fl-layout #map-wrap, .fl-layout #map { height: 100%; }
  .fl-side { overflow-y: auto; border-left: 1px solid var(--line); }
  .fl-side-content { display: block; color: var(--ink); margin-bottom: 14px; }
  .fl-side-content .fl-card { max-width: none; padding: 10px 0; }
  .fl-side-content .fl-card + .fl-card { border-top: 1px solid var(--line); }
  .fl-side-empty { color: var(--muted); padding: 10px 0; }
  /* The column shows the Details, so the bar's button and the floating box aren't needed. */
  #fl-bar-details, .fl-details { display: none !important; }
}
.fl-ap { display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; color: #fff; border-radius: 4px; height: 18px; border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.fl-gate { background: #3b3833; }
.fl-beach { width: 12px; height: 12px; border-radius: 50%; background: #e6007e; } /* hot pink: never mixed up with the yellow places */
.fl-card { display: grid; gap: 3px; font-size: 13.5px; max-width: 270px; }
.fl-card ul { margin: 2px 0; padding-left: 18px; }
.fl-card .fl-places { color: var(--muted); }
.fl-tier b { font-weight: 800; }
.fl-fares, .fl-card a { color: var(--accent); font-weight: 700; }
#detail .d-flights ul { margin: 2px 0 0; padding-left: 18px; }
#detail .d-flights li { margin: 1px 0; }
/* Flights page: focus bar and details (SPEC §13) */
#map-wrap { position: relative; }
.fl-bar { position: absolute; left: 8px; right: 8px; bottom: 22px; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px;
  background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: 7px 10px; font-size: 14px; }
.fl-bar[hidden], .fl-details[hidden] { display: none; }
.fl-bar-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.fl-bar button { background: #fff; border: 1px solid var(--accent); color: var(--accent); border-radius: 99px; padding: 3px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.fl-bar button[aria-pressed="true"] { background: var(--accent); color: #fff; }
#fl-bar-close { border-color: var(--line); color: var(--muted); }
.fl-details { position: absolute; left: 8px; right: 8px; bottom: 76px; z-index: 1000; max-height: 45%; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: 10px 12px; }
.fl-details .fl-card { max-width: none; }
.fl-details .fl-card + .fl-card { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; } /* a place with two airports */
@media (min-width: 600px) { .fl-bar, .fl-details { right: auto; max-width: 460px; } }
.fl-focus { outline: 3px solid #e6007e; outline-offset: 1px; }
.fl-beach.fl-focus { outline-color: #1e1b18; }
.fl-faded { opacity: .35; }
.fl-placedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px #fff, 0 0 0 2px rgba(0,0,0,.25); }
