:root {
  --bg-0: #f6f1e8;
  --bg-1: #e8edf8;
  --ink: #171717;
  --ink-soft: #4a4a4a;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.85);
  --free: #0f766e;
  --busy: #b91c1c;
  --unknown: #92400e;
  --shadow: 0 24px 80px rgba(16, 24, 40, 0.12);
  --hour-slot: 56px;
  --visible-hours: 8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background:
    radial-gradient(1200px 700px at -10% 0%, rgba(94, 234, 212, 0.32), transparent 60%),
    radial-gradient(900px 600px at 110% 100%, rgba(251, 191, 36, 0.36), transparent 62%),
    linear-gradient(145deg, var(--bg-0), var(--bg-1));
  display: grid;
  place-items: center;
}

.layout {
  width: min(1360px, 98vw);
  position: relative;
  padding: 2rem;
}

.status-card {
  backdrop-filter: blur(8px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 4vw, 2.2rem);
  position: relative;
  overflow: hidden;
  animation: rise 700ms ease-out both;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.status-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

h1 {
  margin: 0.8rem 0 1.4rem;
  font-family: "DM Serif Display", serif;
  font-size: clamp(1.65rem, 4.5vw, 3rem);
  line-height: 1.1;
  font-weight: 400;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 3rem;
  padding: 0.4rem 1.2rem;
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 700;
  color: white;
  transition: transform 180ms ease, background-color 180ms ease;
  white-space: nowrap;
}

.status-pill.free {
  background: var(--free);
}

.status-pill.busy {
  background: var(--busy);
}

.status-pill.unknown {
  background: var(--unknown);
}

.refresh-btn {
  border: 1px solid rgba(23, 23, 23, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border-radius: 999px;
  min-height: 3rem;
  padding: 0.4rem 0.95rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.detail-line {
  margin: 1rem 0 0;
  font-size: 0.96rem;
}

.calendar-toolbar {
  margin-top: 1.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.view-switch {
  display: inline-flex;
  border: 1px solid rgba(23, 23, 23, 0.16);
  border-radius: 999px;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.66);
}

.switch-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.switch-btn.active {
  background: rgba(23, 23, 23, 0.92);
  color: white;
}

.nav-actions {
  display: inline-flex;
  gap: 0.45rem;
}

.nav-btn {
  border: 1px solid rgba(23, 23, 23, 0.18);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.48rem 0.68rem;
  cursor: pointer;
}

.nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.range-caption {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.84rem;
}

.calendar-shell {
  margin-top: 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  background: rgba(255, 255, 255, 0.65);
  overflow-y: auto;
  overflow-x: auto;
  max-height: calc((var(--hour-slot) * var(--visible-hours)) + 44px);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 78px repeat(var(--day-columns, 1), minmax(150px, 1fr));
  min-width: 1128px;
}

.calendar-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(248, 248, 248, 0.94);
  border-bottom: 1px solid rgba(23, 23, 23, 0.12);
  padding: 0.58rem 0.54rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.calendar-header.today {
  color: #0f766e;
  font-weight: 700;
}

.calendar-header.out-window {
  opacity: 0.44;
}

.time-column {
  position: relative;
  border-right: 1px solid rgba(23, 23, 23, 0.1);
  background: rgba(250, 250, 250, 0.8);
}

.time-slot {
  font-size: 0.72rem;
  color: var(--ink-soft);
  padding: 0.18rem 0.32rem;
  border-bottom: 1px dashed rgba(23, 23, 23, 0.1);
}

.day-column {
  position: relative;
  border-right: 1px solid rgba(23, 23, 23, 0.08);
}

.day-column.out-window {
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.1),
    rgba(148, 163, 184, 0.1) 10px,
    rgba(148, 163, 184, 0.04) 10px,
    rgba(148, 163, 184, 0.04) 20px
  );
}

.hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed rgba(23, 23, 23, 0.08);
}

.event-block {
  position: absolute;
  left: 0.3rem;
  right: 0.3rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(29, 78, 216, 0.86));
  border-radius: 12px;
  color: white;
  padding: 0.38rem 0.45rem;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.event-title {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 700;
}

.event-time {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  opacity: 0.9;
}

.muted {
  color: var(--ink-soft);
}

.meta-row {
  margin-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-soft);
  border-top: 1px dashed rgba(23, 23, 23, 0.2);
  padding-top: 0.7rem;
}

.glow {
  position: absolute;
  filter: blur(16px);
  z-index: -1;
}

.glow-a {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.26);
  top: 8%;
  right: 6%;
  animation: drift 6s ease-in-out infinite;
}

.glow-b {
  width: 180px;
  height: 180px;
  border-radius: 38% 62% 58% 42% / 36% 44% 56% 64%;
  background: rgba(251, 191, 36, 0.3);
  bottom: -8%;
  left: 8%;
  animation: drift 8s ease-in-out infinite reverse;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.04);
  }
}

@media (max-width: 640px) {
  .layout {
    width: 94vw;
    padding: 1rem;
  }

  .status-card {
    border-radius: 22px;
    padding: 1rem;
  }

  .top-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .status-pill {
    font-size: 1rem;
  }

  .calendar-toolbar {
    align-items: flex-start;
  }

  .calendar-grid {
    min-width: 520px;
  }

  .meta-row {
    flex-direction: column;
    gap: 0.25rem;
  }
}
