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

:root {
  --color-primary: #7ccdcb;
  --color-primary-dark: #3f9294;
  --color-primary-soft: #e4f6f5;
  --color-background: #f2fbfa;
  --color-surface: #ffffff;
  --color-text: #183336;
  --color-muted: #5f7d7e;
  --color-border: #c5e6e5;
  --color-shadow: rgba(24, 51, 54, 0.12);
  --color-busy: #f3d9d4;
  --color-busy-text: #8a3d30;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #dff4f3 0%, var(--color-background) 38%, #ffffff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 72px;
  color: var(--color-text);
}

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

/* ── Header ───────────────────────────────────────────── */
.profile {
  position: relative;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.back-link {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.profile-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-surface);
  box-shadow: 0 4px 24px var(--color-shadow);
}

.profile-name {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── Legend ───────────────────────────────────────────── */
.legend {
  display: flex;
  gap: 18px;
  list-style: none;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 20px;
}

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

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* ── Places ───────────────────────────────────────────── */
.places {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 760px;
}

.place {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 4px 16px var(--color-shadow);
  padding: 16px;
  min-width: 0;
}

.place-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.place-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-primary-soft);
}

.place-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.place-sub {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, calc((100% - 32px) / 3));
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

@media (max-width: 600px) {
  .months {
    grid-auto-columns: minmax(220px, 85%);
  }
}

.month {
  scroll-snap-align: start;
}

.month-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.weekdays,
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  list-style: none;
  text-align: center;
}

.weekdays {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 4px;
}

/* Contains the absolutely positioned .sr-only text inside the scrolling month row. */
.day {
  position: relative;
  font-size: 0.78rem;
  line-height: 28px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.is-free {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

.is-busy {
  background: var(--color-busy);
  color: var(--color-busy-text);
}

.day.is-busy {
  text-decoration: line-through;
}

.is-past {
  color: #b5c6c6;
}

.is-today {
  box-shadow: inset 0 0 0 2px var(--color-primary-dark);
  font-weight: 700;
}

.calendar-unavailable {
  font-size: 0.85rem;
  color: var(--color-muted);
  background: var(--color-background);
  border-radius: 10px;
  padding: 14px;
}

.place-cta {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.place-cta::after {
  content: " →";
}

/* ── Footer ───────────────────────────────────────────── */
.note {
  max-width: 760px;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
}

.note a {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.footer {
  margin-top: 32px;
  font-size: 0.72rem;
  color: var(--color-muted);
}
