:root {
  --navy-950: #071c2d;
  --navy-900: #0b2740;
  --navy-800: #123b5a;
  --blue-700: #145f89;
  --teal-700: #087f7a;
  --teal-600: #0b9b91;
  --teal-100: #dff7f2;
  --green-100: #e8f8ee;
  --green-700: #1b7f47;
  --terracotta: #c25e3b;
  --terracotta-soft: rgba(194, 94, 59, 0.22);
  --terracotta-border: rgba(194, 94, 59, 0.56);
  --sand-50: #fcfbf7;
  --sand-100: #f6f3eb;
  --sand-200: #e9e3d5;
  --slate-900: #172230;
  --slate-700: #48596a;
  --slate-500: #728091;
  --slate-300: #ccd4dc;
  --slate-200: #e2e7ec;
  --slate-100: #f2f5f7;
  --white: #ffffff;
  --danger-100: #fff0ec;
  --danger-700: #a93a28;
  --shadow: 0 14px 34px rgba(7, 28, 45, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--slate-900);
  background: transparent;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 5% 0%, rgba(11, 155, 145, 0.12), transparent 28rem),
    linear-gradient(180deg, #f9fbfb 0%, var(--sand-50) 100%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1700px);
  margin: 0 auto;
  padding: 10px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  color: var(--white);
  background:
    linear-gradient(115deg, rgba(8, 127, 122, 0.94), rgba(11, 39, 64, 0.98)),
    var(--navy-900);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
}

.heading h2 {
  margin: 0;
}

.heading h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.month-controls {
  display: grid;
  grid-template-columns: auto minmax(176px, 210px);
  align-items: center;
  gap: 8px;
}

.today-button,
.month-picker-button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 11px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-weight: 750;
  transition: background 150ms ease, transform 150ms ease;
}

.today-button {
  padding: 0 14px;
  font-size: 0.82rem;
}

.month-picker {
  position: relative;
  min-width: 0;
}

.month-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 12px 0 14px;
  font-size: 0.88rem;
  text-align: left;
}

.month-picker-chevron {
  flex: none;
  font-size: 0.72rem;
}

.today-button:hover,
.today-button:focus-visible,
.month-picker-button:hover,
.month-picker-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.today-button:active,
.month-picker-button:active {
  transform: translateY(1px);
}

.month-picker-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 60;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 10px;
  border: 1px solid var(--sand-200);
  border-radius: 14px;
  color: var(--navy-900);
  background: var(--white);
  box-shadow: 0 14px 34px rgba(7, 28, 45, 0.22);
}

.month-picker-panel[hidden] {
  display: none;
}

.year-switcher {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.year-switcher strong {
  text-align: center;
  font-size: 0.92rem;
}

.year-switcher button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  color: var(--navy-900);
  background: var(--sand-50);
  font-size: 1.2rem;
  font-weight: 800;
}

.year-switcher button:disabled {
  cursor: default;
  opacity: 0.35;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.month-option {
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid var(--sand-200);
  border-radius: 9px;
  color: var(--navy-900);
  background: var(--sand-50);
  font-size: 0.72rem;
  font-weight: 750;
}

.month-option:hover,
.month-option:focus-visible {
  border-color: var(--teal-600);
  background: var(--teal-100);
  outline: none;
}

.month-option.selected {
  border-color: var(--teal-700);
  color: var(--white);
  background: var(--teal-700);
}

.month-option:disabled {
  cursor: default;
  opacity: 0.32;
}


.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
  padding: 5px 14px;
  border-right: 1px solid var(--sand-200);
  border-left: 1px solid var(--sand-200);
  background: rgba(255, 255, 255, 0.94);
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--slate-700);
  font-size: 0.68rem;
  font-weight: 700;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.available-dot {
  background: var(--teal-600);
  box-shadow: 0 0 0 3px var(--teal-100);
}

.blocked-dot {
  background: var(--terracotta);
  box-shadow: 0 0 0 3px var(--terracotta-soft);
}

.status {
  margin: 0;
  color: var(--slate-500);
  font-size: 0.68rem;
  text-align: right;
}

.calendar-frame {
  position: relative;
  overflow: auto;
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--sand-200);
  border-radius: 0 0 16px 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  scrollbar-color: var(--slate-300) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.calendar-frame::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.calendar-frame::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--slate-300);
  background-clip: padding-box;
}

.loading-state {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  color: var(--navy-800);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  font-weight: 750;
  backdrop-filter: blur(4px);
}

.loading-state[hidden] {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--teal-100);
  border-top-color: var(--teal-700);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.availability-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--white);
}

.availability-table th,
.availability-table td {
  border-right: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
}

.availability-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 68px;
  min-width: 68px;
  height: 46px;
  padding: 4px 3px;
  color: var(--slate-700);
  background: #fbfcfd;
  text-align: center;
}

.availability-table thead th.weekend {
  background: var(--sand-100);
}

.availability-table thead .cabin-column {
  left: 0;
  z-index: 10;
  width: 176px;
  min-width: 176px;
  padding: 7px 11px;
  color: var(--navy-900);
  background: var(--sand-50);
  text-align: left;
}

.date-weekday,
.date-day {
  display: block;
}

.date-weekday {
  margin-bottom: 1px;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.date-day {
  color: var(--navy-900);
  font-size: 0.86rem;
  font-weight: 850;
}

.availability-table tbody th {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 176px;
  min-width: 176px;
  height: 50px;
  padding: 5px 11px;
  color: var(--navy-900);
  background: var(--sand-50);
  text-align: left;
}

.cabin-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cabin-meta {
  display: block;
  margin-top: 2px;
  color: var(--slate-500);
  font-size: 0.56rem;
  font-weight: 650;
}

.availability-table td {
  width: 68px;
  min-width: 68px;
  height: 50px;
  padding: 3px;
  background: var(--white);
  vertical-align: middle;
}

.availability-table td.weekend {
  background: #fdfcf9;
}

.day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  border-radius: 8px;
  text-align: center;
}

button.day-cell {
  position: relative;
  overflow: hidden;
  padding: 0;
  appearance: none;
  border: 1px solid #bce7dc;
  color: var(--navy-900);
  background: linear-gradient(150deg, var(--white) 0%, var(--green-100) 100%);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

button.day-cell::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  content: "";
  background: var(--teal-600);
}

button.day-cell:hover,
button.day-cell:focus-visible {
  z-index: 2;
  border-color: var(--teal-600);
  outline: none;
  box-shadow: 0 6px 16px rgba(8, 127, 122, 0.16);
  transform: translateY(-1px);
}

button.day-cell.no-valid-start {
  cursor: not-allowed;
  opacity: 0.58;
}

button.day-cell.no-valid-start:hover,
button.day-cell.no-valid-start:focus-visible {
  border-color: #bce7dc;
  box-shadow: none;
  transform: none;
}

button.day-cell.selected-night {
  border-color: var(--teal-700);
  background: var(--teal-100);
  box-shadow: inset 0 0 0 1px var(--teal-700);
}

.booking-guide {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 7px 10px;
  border-right: 1px solid var(--sand-200);
  border-left: 1px solid var(--sand-200);
  border-bottom: 1px solid var(--sand-200);
  background: rgba(223, 247, 242, 0.56);
}

.booking-guide-title {
  flex: none;
  color: var(--navy-900);
  font-size: 0.68rem;
}

.booking-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.booking-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--slate-700);
  font-size: 0.62rem;
  white-space: nowrap;
}

.one-night-tip {
  margin-left: auto;
  color: var(--slate-700);
  font-size: 0.6rem;
  white-space: nowrap;
}

.selection-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 7px 10px;
  border-right: 1px solid var(--sand-200);
  border-left: 1px solid var(--sand-200);
  border-bottom: 1px solid var(--sand-200);
  background: var(--sand-50);
}

.selection-bar[hidden] {
  display: none;
}

.selection-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.selection-copy strong {
  color: var(--navy-900);
  font-size: 0.7rem;
  white-space: nowrap;
}

.selection-copy span {
  overflow: hidden;
  color: var(--slate-700);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-clear,
.selection-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.selection-clear {
  justify-self: end;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--sand-200);
  border-radius: 8px;
  color: var(--slate-700);
  background: var(--white);
  font-size: 0.64rem;
}

.selection-continue {
  justify-self: center;
  min-width: 150px;
  min-height: 48px;
  padding: 0 28px;
  border: 1px solid #c25e3b;
  border-radius: 11px;
  color: var(--white);
  background: #c25e3b;
  box-shadow: 0 7px 18px rgba(194, 94, 59, 0.28);
  font-size: 0.84rem;
}

.selection-continue:not([aria-disabled="true"]):hover,
.selection-continue:not([aria-disabled="true"]):focus-visible {
  background: #943100;
  outline: none;
  box-shadow: 0 8px 20px rgba(148, 49, 0, 0.28);
  transform: translateY(-1px);
}

.selection-continue[aria-disabled="true"] {
  border-color: var(--slate-300);
  color: var(--slate-500);
  background: var(--slate-100);
  box-shadow: none;
  pointer-events: none;
}

.price {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.night-label {
  margin-top: 0;
  color: var(--slate-500);
  font-size: 0.49rem;
  font-weight: 700;
  text-transform: uppercase;
}

.unavailable {
  border: 1px solid var(--terracotta-border);
  background: var(--terracotta-soft);
}

.past,
.missing-link,
.data-error {
  border: 1px solid var(--slate-200);
  color: var(--slate-500);
  background:
    repeating-linear-gradient(
      135deg,
      var(--slate-100),
      var(--slate-100) 8px,
      #e9edf1 8px,
      #e9edf1 16px
    );
  font-size: 0.61rem;
  font-weight: 750;
}

.past {
  opacity: 0.62;
}

.missing-link {
  border-color: #f0d5a0;
  color: #8a5b08;
  background: #fff8e8;
}

.missing-link .price {
  font-size: 0.78rem;
}

.data-error {
  border-color: #f0c2b9;
  color: var(--danger-700);
  background: var(--danger-100);
}

.error-panel {
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #f1c4bb;
  border-radius: 10px;
  color: var(--danger-700);
  background: var(--danger-100);
  font-size: 0.78rem;
}

.error-panel:not([hidden]) {
  display: flex;
}

.error-panel button {
  margin-left: auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--white);
  background: var(--danger-700);
  font-weight: 800;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 2px 0;
  color: var(--slate-500);
  font-size: 0.63rem;
}

footer p {
  margin: 0;
}

.footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.embed-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--teal-700);
  border-radius: 9px;
  color: var(--teal-700);
  background: var(--white);
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.embed-button:hover,
.embed-button:focus-visible {
  color: var(--white);
  background: var(--teal-700);
  outline: none;
}

@media (max-width: 1100px) {
  .app-shell {
    padding: 8px;
  }

  .calendar-header {
    gap: 12px;
    padding: 9px 12px;
  }

  .heading h2 {
    font-size: 1.28rem;
  }

  .availability-table thead .cabin-column,
  .availability-table tbody th {
    width: 154px;
    min-width: 154px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .availability-table thead th,
  .availability-table td {
    width: 64px;
    min-width: 64px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  .calendar-header {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 10px;
    border-radius: 14px 14px 0 0;
  }

  .heading {
    padding: 0 2px;
  }

  .heading h2 {
    font-size: 1.18rem;
  }

  .month-controls {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
  }

  .today-button {
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .month-picker-button {
    min-width: 0;
    padding-right: 10px;
    padding-left: 11px;
    font-size: 0.8rem;
  }

  .month-picker-panel {
    right: 0;
    width: min(300px, calc(100vw - 32px));
  }

  .status-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    min-height: 0;
    padding: 7px 12px;
  }

  .status {
    text-align: left;
  }

  .calendar-frame {
    min-height: 0;
    border-radius: 0 0 14px 14px;
  }

  .loading-state {
    min-height: 170px;
  }

  .availability-table thead .cabin-column,
  .availability-table tbody th {
    width: 112px;
    min-width: 112px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .availability-table thead th,
  .availability-table td {
    width: 56px;
    min-width: 56px;
  }

  .availability-table thead th {
    height: 44px;
  }

  .availability-table tbody th,
  .availability-table td {
    height: 48px;
  }

  .day-cell {
    height: 40px;
  }

  .cabin-name {
    font-size: 0.7rem;
  }

  .cabin-meta {
    font-size: 0.53rem;
  }

  .price {
    font-size: 0.72rem;
  }

  .night-label {
    font-size: 0.47rem;
  }

  .booking-guide {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 5px 8px;
    padding: 7px 8px;
  }

  .booking-steps {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px 7px;
  }

  .booking-step {
    white-space: nowrap;
  }

  .one-night-tip {
    grid-column: 1 / -1;
    margin-left: 0;
    white-space: normal;
  }

  .selection-bar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    padding: 7px 8px;
  }

  .selection-copy {
    grid-column: 1 / -1;
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .selection-copy span {
    white-space: normal;
  }

  .selection-continue {
    grid-column: 2;
    grid-row: 2;
    min-width: 138px;
    min-height: 48px;
    padding: 0 22px;
    font-size: 0.82rem;
  }

  .selection-clear {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    min-height: 34px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-top: 6px;
  }

  .footer-right {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 5px;
  }

  .calendar-header {
    padding: 9px;
  }

  .heading h2 {
    font-size: 1.08rem;
  }

  .month-controls {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .today-button,
  .month-picker-button {
    min-height: 42px;
  }

  .month-picker-panel {
    width: min(292px, calc(100vw - 20px));
  }

  .availability-table thead .cabin-column,
  .availability-table tbody th {
    width: 104px;
    min-width: 104px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .availability-table thead th,
  .availability-table td {
    width: 54px;
    min-width: 54px;
  }

  .cabin-name {
    font-size: 0.66rem;
  }

  .cabin-meta {
    font-size: 0.5rem;
  }

  .price {
    font-size: 0.68rem;
  }

  .night-label {
    font-size: 0.44rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}