:root {
  --bg: #f4efe4;
  --panel: rgba(255, 251, 245, 0.82);
  --panel-strong: #fffaf0;
  --ink: #1f2c1d;
  --muted: #5f6b5d;
  --line: rgba(50, 70, 48, 0.16);
  --available: #87c77c;
  --available-ink: #123e12;
  --reserved: #b7beb6;
  --reserved-ink: #273128;
  --unavailable: #d66d61;
  --unavailable-ink: #4d130d;
  --accent: #205a56;
  --shadow: 0 18px 60px rgba(43, 56, 32, 0.13);
  --favorite: rgba(206, 161, 37, 0.18);
  --favorite-border: #c9951d;
  --tier2: rgba(147, 153, 160, 0.16);
  --tier2-border: #8d97a3;
  --lakefront: rgba(69, 126, 173, 0.16);
  --lakefront-border: #3f79a9;
  --weekend-tint: rgba(239, 210, 102, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 32%),
    linear-gradient(180deg, #d4e7ef 0%, #f4efe4 34%, #e9dfc5 100%);
}

.app-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.controls,
.legend,
.status-panel,
.summary-panel,
.table-shell {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.hero {
  padding: 28px 28px 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font: 600 0.8rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.9rem);
  line-height: 0.98;
}

.subtitle {
  width: min(720px, 100%);
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
  padding: 18px 20px;
}

.control {
  display: grid;
  gap: 6px;
  min-width: 220px;
  font: 600 0.9rem/1.3 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.control span {
  color: var(--muted);
}

select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--panel-strong);
  font: 500 0.98rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.meta {
  margin-left: auto;
  color: var(--muted);
  font: 500 0.95rem/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 18px;
  font: 600 0.92rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.available {
  background: var(--available);
}

.reserved {
  background: var(--reserved);
}

.unavailable {
  background: var(--unavailable);
}

.status-panel {
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--muted);
  font: 500 0.98rem/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.status-panel.error {
  color: var(--unavailable-ink);
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
}

.summary-group {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 248, 236, 0.74);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.summary-group h2 {
  margin: 0 0 12px;
  font: 700 1rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-entry {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
}

.summary-name {
  font: 700 0.95rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.summary-detail,
.summary-empty {
  color: var(--muted);
  font: 500 0.9rem/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.summary-empty {
  margin: 0;
}

.table-shell {
  margin-top: 18px;
  padding: 12px;
}

.table-scroll {
  overflow: auto;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8f1e0;
}

th.site-header,
td.site-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff9ef;
  min-width: 100px;
  max-width: 100px;
  width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.loop-header,
td.loop-cell {
  position: sticky;
  left: 100px;
  z-index: 4;
  background: #fbf5e8;
  min-width: 90px;
  max-width: 90px;
  width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th.site-header,
th.loop-header {
  z-index: 6;
}

th.stretch-header,
td.stretch-cell {
  min-width: 128px;
  background: #fff;
}

th {
  padding: 12px 10px;
  white-space: nowrap;
  text-align: left;
  font: 700 0.88rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

th.date-header {
  min-width: 58px;
  text-align: center;
}

th.date-header .day {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

th.date-header .weekday {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

td {
  height: 48px;
  text-align: center;
  background: #fff;
}

td.site-cell,
td.loop-cell {
  padding: 10px;
  text-align: left;
  white-space: nowrap;
  font: 600 0.9rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

td.loop-cell {
  color: var(--muted);
}

.stretch-cell {
  padding: 10px;
  text-align: left;
  white-space: nowrap;
  font: 600 0.86rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.status-cell {
  min-width: 58px;
  padding: 0;
  font: 700 0.92rem/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.status-cell a,
.status-cell span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.status-cell[data-status="A"] {
  background: var(--available);
  color: var(--available-ink);
}

.status-cell[data-status="R"] {
  background: var(--reserved);
  color: var(--reserved-ink);
}

.status-cell[data-status="X"] {
  background: var(--unavailable);
  color: var(--unavailable-ink);
}

.weekend-col {
  background-image: linear-gradient(180deg, var(--weekend-tint), rgba(255, 255, 255, 0.04));
}

.row-tier2 td.site-cell {
  border-left: 5px solid var(--tier2-border);
}

.row-tier2 td {
  background-color: color-mix(in srgb, var(--tier2) 55%, #fff);
}

.row-lakefront td.site-cell {
  border-left: 5px solid var(--lakefront-border);
}

.row-lakefront td {
  background-color: color-mix(in srgb, var(--lakefront) 58%, #fff);
}

.row-favorite td.site-cell {
  border-left: 5px solid var(--favorite-border);
}

.row-favorite td {
  background-color: color-mix(in srgb, var(--favorite) 60%, #fff);
}

.row-favorite .status-cell[data-status="A"],
.row-tier2 .status-cell[data-status="A"],
.row-lakefront .status-cell[data-status="A"] {
  background: var(--available);
}

.mobile-cards {
  display: none;
}

.site-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.site-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.site-card h3 {
  margin: 0;
  font: 700 1rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.site-card p,
.site-card-availability {
  margin: 6px 0 0;
  color: var(--muted);
  font: 500 0.88rem/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.tier-badge {
  align-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font: 700 0.74rem/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.badge-favorite {
  background: rgba(206, 161, 37, 0.18);
  color: #6c4a00;
}

.badge-tier2 {
  background: rgba(147, 153, 160, 0.18);
  color: #46505c;
}

.badge-lakefront {
  background: rgba(69, 126, 173, 0.16);
  color: #15486d;
}

.badge-standard {
  background: rgba(95, 107, 93, 0.12);
  color: var(--muted);
}

.date-dots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.date-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.date-dot.is-available {
  background: var(--available);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.mobile-empty {
  padding: 20px 8px;
  color: var(--muted);
}

.empty-state {
  padding: 28px 18px;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100vw - 18px, 1440px);
    padding-top: 18px;
  }

  .hero,
  .controls,
  .legend,
  .status-panel,
  .summary-panel,
  .table-shell {
    border-radius: 18px;
  }

  .controls {
    align-items: stretch;
  }

  .meta {
    width: 100%;
    margin-left: 0;
  }

  th.site-header,
  td.site-cell {
    left: 0;
    min-width: 140px;
  }

  th.loop-header,
  td.loop-cell {
    left: 140px;
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .summary-panel {
    grid-template-columns: 1fr;
  }

  .table-scroll {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px;
  }

  .status-cell {
    min-width: 36px;
    width: 36px;
    height: 36px;
  }

  .status-cell a,
  .status-cell span {
    min-width: 36px;
    min-height: 36px;
  }
}

/* Future (not yet bookable) cells */
.status-cell[data-status="FUTURE"] {
  background: #1a1a3e;
  color: #6699cc;
}
.status-cell[data-status="FUTURE"] .opens-label {
  font-size: 0.6rem;
  line-height: 1.1;
  display: block;
}
