:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #ffffff;
  --text: #17212b;
  --muted: #66707a;
  --accent: #0f766e;
  --accent-soft: #d9f0ee;
  --busy: #ef4444;
  --free: #16a34a;
  --border: #d9e1e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8f5ef 0%, var(--bg) 100%);
  color: var(--text);
}

.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.lead {
  margin: 8px 0 0;
  color: var(--muted);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-bar p {
  margin: 0;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.filters label {
  color: var(--muted);
  font-size: 0.9rem;
}

.filters input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.filters button {
  border: 1px solid #b8ced7;
  border-radius: 10px;
  padding: 7px 12px;
  background: #edf6f8;
  color: #0f4b47;
  cursor: pointer;
  font: inherit;
}

.filters button:hover {
  background: #d9edf1;
}

.filters button:active {
  transform: translateY(1px);
}

.errors {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f5c2c7;
  background: #fff5f5;
  color: #9f1239;
  font-size: 0.9rem;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ruler {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: end;
  margin-bottom: 8px;
}

.ruler-track {
  position: relative;
  height: 24px;
  border-bottom: 1px solid var(--border);
}

.ruler-cells {
  position: absolute;
  inset: 0 0 0 0;
  display: grid;
  pointer-events: none;
}

.ruler-cell {
  border-right: 1px solid #cfd8e3;
}

.ruler-label {
  position: absolute;
  transform: translateX(-50%);
  bottom: 2px;
  color: #4b5563;
  font-size: 0.78rem;
}

.room-line {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: center;
}

.room-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.room-head h2 {
  margin: 0;
  font-size: 1rem;
}

.room-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-detail {
  margin: 0;
  color: #5f6b76;
  font-size: 0.8rem;
  line-height: 1.2;
}

.status-indicator {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.status-indicator.busy {
  background: #fee2e2;
  color: #b91c1c;
}

.status-indicator.free {
  background: #dcfce7;
  color: #166534;
}

.copy-email-btn {
  border: 1px solid #bfd0db;
  border-radius: 8px;
  background: #f3f8fa;
  color: #114b53;
  font-size: 0.75rem;
  padding: 4px 8px;
  cursor: pointer;
}

.copy-email-btn:hover {
  background: #dff0f4;
}

.copy-email-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.busy {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.free {
  background: #dcfce7;
  color: #166534;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline {
  position: relative;
  height: 52px;
  border-radius: 10px;
  background: #f7fbff;
  border: 1px solid var(--border);
  overflow: hidden;
}

.timeline-cells {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}

.timeline-cell {
  border-right: 1px solid #d9e6f2;
  background: linear-gradient(
    to bottom,
    rgba(15, 118, 110, 0.03) 0%,
    rgba(15, 118, 110, 0.01) 100%
  );
}

.slot {
  position: absolute;
  top: 8px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  z-index: 2;
}

.slot-busy { background: color-mix(in srgb, var(--busy) 88%, black); }
.slot-free { background: color-mix(in srgb, var(--free) 85%, black); }

.timeline-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  font-size: 0.85rem;
}

.skeleton .timeline {
  background: #eef4f8;
}

@media (max-width: 760px) {
  .ruler {
    grid-template-columns: 1fr;
  }

  .ruler-track {
    margin-top: 8px;
  }

  .room-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .room-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .status-bar {
    flex-direction: column;
  }

  .filters {
    flex-wrap: wrap;
  }

  .slot {
    font-size: 0.75rem;
  }
}
