:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1c2526;
  --muted: #5d6a6c;
  --line: #e2dfd6;
  --accent: #0e7c74;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ef;
  --ok: #17803d;
  --ok-soft: #e7f5ec;
  --warn: #9a5a06;
  --warn-soft: #fbf0dc;
  --over: #b42318;
  --over-soft: #fdecea;
  --c-flight: #0e7c74;
  --c-apt: #3b6fd8;
  --c-levy: #9db8ee;
  --c-car: #d98a1c;
  --c-ins: #c94f7c;
  --c-ed: #8a63d2;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101516;
    --surface: #172022;
    --surface-2: #1f292b;
    --text: #e8eeee;
    --muted: #9aabad;
    --line: #2b3739;
    --accent: #3cc3b4;
    --accent-ink: #062b28;
    --accent-soft: #163a37;
    --ok: #5ad48a;
    --ok-soft: #14301f;
    --warn: #f0b45a;
    --warn-soft: #3a2c13;
    --over: #ff8a7a;
    --over-soft: #3d1c19;
    --c-flight: #3cc3b4;
    --c-apt: #6c97ef;
    --c-levy: #3a5a99;
    --c-car: #e9a23b;
    --c-ins: #e87fa6;
    --c-ed: #a888e6;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

.wrap {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hero */

.hero {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.025em;
}

.lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.lead strong {
  color: var(--text);
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.toc a {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */

.section {
  padding: 52px 0 4px;
  scroll-margin-top: 12px;
}

.section-head {
  max-width: 800px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.015em;
}

.section h3 {
  margin: 32px 0 12px;
  font-size: 18px;
}

.muted {
  margin: 6px 0 0;
  color: var(--muted);
}

.sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.note-top {
  margin: 0 0 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Badges and tags */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.rec {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.cheap {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.direct,
.badge.premium {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.over {
  background: var(--over-soft);
  color: var(--over);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.07);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
}

.btn.small {
  padding: 5px 10px;
  font-size: 13px;
}

.btn.is-active {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.btn:focus-visible,
.seg button:focus-visible,
select:focus-visible,
input:focus-visible,
.toc a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Segmented controls */

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--surface-2);
}

.seg button {
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.seg button:hover:not(:disabled) {
  color: var(--text);
}

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--line);
}

.seg button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Packages */

.packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.package {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.package.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.package-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.package-head .sub {
  display: inline;
}

.package h3 {
  margin: 0;
  font-size: 20px;
}

.package-text,
.package-extra {
  margin: 0;
  color: var(--muted);
}

.package-text {
  font-size: 14.5px;
}

.package-extra {
  font-size: 13px;
}

.package-lines {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 14px;
}

.package-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.package-lines dt {
  color: var(--muted);
}

.package-lines dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.package-total strong {
  display: block;
  font-size: 26px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.package .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* Calculator */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px;
  align-items: start;
}

.calc-controls {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.control {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.control-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  cursor: pointer;
}

.check input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.check input:disabled + span {
  color: var(--muted);
}

.calc-result {
  position: sticky;
  top: 16px;
  padding: 22px;
}

.calc-result.flash {
  animation: flash 1.4s ease-out;
}

@keyframes flash {
  from {
    box-shadow: 0 0 0 5px var(--accent-soft);
  }
  to {
    box-shadow: 0 0 0 0 transparent;
  }
}

.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.total {
  margin: 6px 0 4px;
  font-size: clamp(38px, 5vw, 50px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.per-person {
  margin: 0;
  color: var(--muted);
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.status.is-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.status.is-over {
  background: var(--over-soft);
  color: var(--over);
}

.budget {
  position: relative;
  margin: 22px 0 36px;
}

.budget-bar {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.budget-bar span {
  height: 100%;
}

.budget-bar span + span {
  border-left: 2px solid var(--surface);
}

.budget-cap {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
}

.budget-cap span {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.c-flight {
  background: var(--c-flight);
}

.c-apt {
  background: var(--c-apt);
}

.c-levy {
  background: var(--c-levy);
}

.c-car {
  background: var(--c-car);
}

.c-ins {
  background: var(--c-ins);
}

.c-ed {
  background: var(--c-ed);
}

.breakdown {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breakdown li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.breakdown li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.breakdown .dot {
  width: 12px;
  height: 12px;
  align-self: center;
  border-radius: 4px;
}

.breakdown strong {
  display: block;
  font-size: 15px;
}

.breakdown b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-notes {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
}

.result-notes p {
  margin: 0;
}

.result-notes p + p {
  margin-top: 6px;
}

/* Toolbars */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}

/* Tables */

.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th.num,
td.num {
  text-align: right;
}

td.num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

td.num strong {
  font-size: 16px;
}

tr.is-selected td {
  background: var(--accent-soft);
}

.airline {
  font-weight: 700;
}

.flights-table td:nth-child(1) {
  min-width: 210px;
}

.flights-table td:nth-child(2),
.flights-table td:nth-child(3) {
  min-width: 165px;
}

.flights-table td:nth-child(4) {
  min-width: 130px;
}

.ins-table td:nth-child(1) {
  min-width: 200px;
}

.ins-table td:nth-child(3) {
  min-width: 230px;
}

.row-note {
  margin-top: 6px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
}

.nowrap {
  white-space: nowrap;
}

/* Apartments */

.apts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.apt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.apt.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.apt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.apt h3 {
  margin: 0;
  font-size: 17px;
}

.apt h3 a {
  color: var(--text);
  text-decoration: none;
}

.apt h3 a:hover {
  color: var(--accent);
}

.rating {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.rating span {
  color: var(--muted);
  font-weight: 500;
}

.apt-title {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  font-style: italic;
}

.apt .sub {
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
}

.apt-price strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.apt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

/* Checklist */

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.checklist strong {
  display: block;
  margin-bottom: 4px;
}

.checklist span {
  color: var(--muted);
  font-size: 14.5px;
}

/* Footer */

.footer {
  margin-top: 56px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer p {
  margin: 0;
}

.footer ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.footer li + li {
  margin-top: 4px;
}

@media (max-width: 960px) {
  .packages,
  .calc,
  .checklist {
    grid-template-columns: 1fr;
  }

  .calc-result {
    position: static;
  }
}

@media (max-width: 820px) {
  .stack thead {
    display: none;
  }

  .stack,
  .stack tbody,
  .stack tr,
  .stack td {
    display: block;
  }

  .stack tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .stack tbody tr:last-child {
    border-bottom: 0;
  }

  .table-wrap .stack td {
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .stack td + td {
    margin-top: 10px;
  }

  .stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .stack tr.is-selected {
    background: var(--accent-soft);
  }

  .stack tr.is-selected td {
    background: transparent;
  }

  .stack .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 40px;
  }

  .section {
    padding-top: 40px;
  }

  th,
  td {
    padding: 11px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .calc-result.flash {
    animation: none;
  }
}
