:root {
  --bg: #edf1f2;
  --card: #ffffff;
  --ink: #13212b;
  --soft: #6d7c87;
  --accent: #0f9f7c;
  --band: #13212b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #f6f9fa, var(--bg));
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px;
}

.card {
  width: min(372px, 100%);
  padding: 16px 12px 12px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff, #fbfcfc);
  box-shadow:
    inset 0 0 0 1px rgba(19, 33, 43, 0.06),
    0 1px 2px rgba(19, 33, 43, 0.05),
    0 18px 36px -18px rgba(19, 60, 80, 0.26),
    0 44px 80px -44px rgba(19, 60, 80, 0.34);
}

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 0 6px 10px; }
.head__place { font-size: 11.5px; font-weight: 560; color: var(--soft); letter-spacing: 0.02em; }
.head__title { font-size: 21px; line-height: 26px; font-weight: 680; font-stretch: 106%; letter-spacing: -0.015em; }

/* ---- the switch that shows the cheapest nights ---- */
.flex { display: inline-flex; align-items: center; gap: 8px; height: 30px; border: 0; background: none; color: var(--soft); font: inherit; font-size: 12.5px; font-weight: 580; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color 0.3s ease; }
.flex[aria-checked="true"], .flex.is-hot { color: var(--ink); }
.flex:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 99px; }
.flex__track { position: relative; width: 40px; height: 24px; border-radius: 99px; background: rgba(19, 33, 43, 0.14); box-shadow: inset 0 1px 2px rgba(19, 33, 43, 0.12); transition: background-color 0.35s ease; }
.flex[aria-checked="true"] .flex__track { background: var(--accent); }
.flex__knob { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; box-shadow: 0 2px 4px rgba(19, 33, 43, 0.3); }

.week, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week { padding-bottom: 2px; font-size: 10.5px; font-weight: 600; color: var(--soft); text-align: center; }

/* ---- the days ---- */
.day {
  position: relative;
  height: 40px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.day__bg { position: absolute; inset: 2px 0; background: transparent; transition: background-color 0.3s ease, border-radius 0.3s ease; }
.day__tile { position: absolute; inset: 2px 2px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, #ffffff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent); opacity: 0; transform: scale(0.6); }
.day__n { position: relative; font-size: 13.5px; line-height: 16px; font-weight: 620; transition: color 0.3s ease; }
.day__p { position: relative; font-size: 10.5px; line-height: 12px; font-weight: 540; color: var(--soft); transition: color 0.3s ease, opacity 0.3s ease; }
.day.is-void { visibility: hidden; }
.day.is-hot .day__bg { background: rgba(19, 33, 43, 0.06); border-radius: 12px; }
@media (hover: hover) { .day:not(.is-in):hover .day__bg { background: rgba(19, 33, 43, 0.06); border-radius: 12px; } }
.card.is-flex .day:not(.is-cheap):not(.is-in) .day__n, .card.is-flex .day:not(.is-cheap):not(.is-in) .day__p { opacity: 0.45; }
.day.is-cheap .day__p { color: var(--accent); font-weight: 700; }
/* the stay: a band from the arrival to the departure, round at the two ends */
.day.is-in .day__bg { background: color-mix(in srgb, var(--band) 9%, transparent); }
.day.is-from .day__bg { border-radius: 12px 0 0 12px; background: var(--band); }
.day.is-to .day__bg { border-radius: 0 12px 12px 0; background: var(--band); }
.day.is-from.is-to .day__bg { border-radius: 12px; }
.day.is-from .day__n, .day.is-to .day__n { color: #ffffff; }
.day.is-from .day__p, .day.is-to .day__p { color: rgba(255, 255, 255, 0.72); font-weight: 540; }
.day.is-in .day__tile { opacity: 0 !important; }

.foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 6px 0; border-top: 1px solid rgba(19, 33, 43, 0.07); }
.foot__what { height: 20px; overflow: hidden; font-size: 13.5px; line-height: 20px; font-weight: 560; color: var(--soft); }
.foot__total { height: 26px; overflow: hidden; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.01em; }
.foot span { display: block; white-space: nowrap; }

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

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-height: 420px) {
  .card { padding-top: 12px; padding-bottom: 10px; }
  .head { padding-bottom: 6px; }
  .day { height: 37px; }
  .foot { margin-top: 5px; padding-top: 7px; }
}
@media (min-width: 900px) and (min-height: 680px) {
  .card { zoom: 1.3; }
}
