:root {
  color-scheme: light;
  --bg: #f3efe7;
  --bg-accent: #e8f0ea;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(27, 38, 34, 0.12);
  --text: #13201c;
  --muted: #5a6b64;
  --blocked: #f3c9c9;
  --available: #4aa61f;
  --selected: #1e7c39;
  --group: #d7f0d0;
  --shadow: 0 22px 60px rgba(21, 33, 28, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(121, 181, 134, 0.26), transparent 32%),
    radial-gradient(circle at top right, rgba(232, 158, 97, 0.18), transparent 30%),
    linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
}

body {
  padding: 28px;
}

.shell {
  max-width: 1540px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: #5a725f;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.6rem, 4vw, 4.5rem);
  line-height: 0.95;
}

.lede {
  max-width: 60ch;
  margin-bottom: 0;
  font-size: 1.04rem;
  color: var(--muted);
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  border-radius: var(--radius);
  padding: 22px;
}

.hero-card__title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 800;
}

.hero-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
}

.panel {
  border-radius: var(--radius);
  padding: 18px;
}

.panel--wide {
  min-width: 0;
}

.panel__header {
  margin-bottom: 16px;
}

.panel__header--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.panel__header h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.panel__header p,
.window-list,
.summary-row span,
legend {
  color: var(--muted);
}

.window-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.window-form label,
.participant-bar label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(19, 32, 28, 0.16);
  background: rgba(255, 255, 255, 0.9);
  padding: 11px 12px;
  color: var(--text);
}

button {
  border: 0;
  border-radius: 14px;
  background: var(--selected);
  color: white;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 10px 28px rgba(30, 124, 57, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.ghost-button {
  width: 100%;
  background: rgba(19, 32, 28, 0.08);
  color: var(--text);
  box-shadow: none;
}

.window-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.window-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(19, 32, 28, 0.08);
  padding: 12px;
}

.window-item strong {
  display: block;
  margin-bottom: 2px;
}

.window-item button {
  padding: 8px 10px;
  box-shadow: none;
  background: rgba(19, 32, 28, 0.1);
  color: var(--text);
}

.panel__footer {
  border-top: 1px solid rgba(19, 32, 28, 0.08);
  padding-top: 14px;
}

.participant-bar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: end;
  gap: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  font-weight: 700;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend__box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(19, 32, 28, 0.15);
}

.legend__box--blocked {
  background: var(--blocked);
}

.legend__box--available {
  background: var(--available);
}

.legend__box--selected {
  background: var(--selected);
}

.legend__box--group {
  background: var(--group);
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-row > div {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(19, 32, 28, 0.08);
}

.summary-row strong {
  display: block;
  font-size: 1.45rem;
  margin-bottom: 2px;
}

.grid-shell {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
}

.time-labels {
  display: grid;
  grid-template-rows: repeat(var(--rows), 18px);
  align-items: start;
  padding-top: 32px;
  color: var(--muted);
  font-size: 0.84rem;
}

.time-labels span {
  transform: translateY(-8px);
}

.calendar-wrap {
  min-width: 0;
}

.day-headings {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 0;
  padding-left: 1px;
  margin-bottom: 2px;
}

.day-headings span {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  grid-template-rows: repeat(var(--rows), 18px);
  border: 1px solid rgba(19, 32, 28, 0.26);
  border-bottom: 0;
  border-right: 0;
  position: relative;
  touch-action: none;
}

.cell {
  position: relative;
  border-right: 1px solid rgba(19, 32, 28, 0.26);
  border-bottom: 1px solid rgba(19, 32, 28, 0.26);
  background: rgba(255, 255, 255, 0.72);
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
  min-width: 0;
}

.cell--blocked {
  background: rgba(243, 201, 201, 0.95);
}

.cell--available {
  background: rgba(74, 166, 31, 0.92);
}

.cell--selected {
  background: rgba(30, 124, 57, 0.98);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.cell--group {
  background: linear-gradient(180deg, rgba(215, 240, 208, 0.98), rgba(181, 226, 170, 0.98));
}

.cell:hover {
  transform: scale(1.01);
  z-index: 1;
}

.cell.is-disabled {
  cursor: not-allowed;
  opacity: 0.95;
}

.cell.is-selectable {
  cursor: pointer;
}

.cell.is-group-overlap::after,
.cell.is-selected::after {
  content: attr(data-count);
  position: absolute;
  right: 4px;
  top: 2px;
  font-size: 0.7rem;
  font-weight: 900;
  color: rgba(19, 32, 28, 0.8);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  padding: 2px 5px;
}

.hover-card {
  margin-top: 14px;
  min-height: 42px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(19, 32, 28, 0.08);
  color: var(--muted);
}

.hover-card strong {
  color: var(--text);
}

@media (max-width: 1180px) {
  body {
    padding: 16px;
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .panel--narrow {
    order: 2;
  }
}

@media (max-width: 780px) {
  .panel__header--split,
  .participant-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .grid-shell {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .day-headings,
  .calendar-grid {
    grid-template-columns: repeat(5, minmax(72px, 1fr));
  }
}
