:root {
  --bg: #ffffff;
  --ink: #16171c;
  --soft: rgba(22, 23, 28, 0.54);
  --line: rgba(22, 23, 28, 0.08);
  --accent: #5b5bf0;
  --now: #e0452f;
  --row: clamp(25px, 8.200vh, 33px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 8px 12px;
}

.wk { width: min(326px, 100%); padding: 13px 12px 12px 8px; border-radius: 24px; background: #ffffff; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(22, 23, 28, 0.05), 0 34px 60px -38px rgba(22, 23, 28, 0.5); }
.wk__roll { display: block; overflow: hidden; }
.wk__roll > span { display: block; white-space: nowrap; }

.wk__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-left: 6px; }
.wk__title b { display: block; font-size: 15px; line-height: 19px; font-weight: 680; font-stretch: 104%; }
.wk__title span { display: block; font-size: 11.5px; line-height: 15px; font-weight: 560; color: var(--soft); white-space: nowrap; }
.wk__note { font-size: 11.5px; font-weight: 640; color: var(--soft); }
.wk__note .wk__roll { height: 16px; line-height: 16px; }
.wk__note.is-on { color: var(--accent); }

.wk__days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: clamp(4px, 1.800vh, 9px) 0 4px 28px; }
.wk__day { display: flex; align-items: baseline; justify-content: center; gap: 4px; height: 24px; font-size: 11px; line-height: 24px; font-weight: 620; color: var(--soft); }
.wk__day b { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.wk__day.is-today b { min-width: 22px; height: 22px; border-radius: 8px; background: var(--ink); color: #ffffff; line-height: 22px; text-align: center; }

.wk__body { display: grid; grid-template-columns: 28px minmax(0, 1fr); }
.wk__hours span { display: block; height: var(--row); padding-right: 6px; font-size: 10px; line-height: 12px; font-weight: 600; color: var(--soft); text-align: right; transform: translateY(-6px); }
/* the grid is drawn with two gradients: one line per hour, one per day */
.wk__grid { position: relative; height: calc(var(--row) * 6); border-radius: 10px; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 100% var(--row), 20% 100%; box-shadow: inset 0 0 0 1px var(--line); touch-action: none; }

.wk__slot { position: absolute; left: 0; top: 0; border-radius: 9px; background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 55%, transparent); opacity: 0; pointer-events: none; }
.wk__slot.is-taken { background: color-mix(in srgb, var(--now) 8%, transparent); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--now) 55%, transparent); }

.wk__ev { position: absolute; left: 0; top: 0; padding: 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: grab; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.wk__ev.is-up { cursor: grabbing; z-index: 3; }
/* the child takes the colour and the shadow, so GSAP can move and lift the parent */
.wk__ev > span { display: flex; flex-direction: column; height: 100%; padding: 4px 6px; border-radius: 8px; background: color-mix(in srgb, var(--tone) 16%, #ffffff); color: color-mix(in srgb, var(--tone) 72%, #16171c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 24%, transparent); overflow: hidden; transition: box-shadow 0.25s ease, background-color 0.25s ease; }
.wk__ev.is-up > span { background: color-mix(in srgb, var(--tone) 24%, #ffffff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent), 0 14px 22px -10px color-mix(in srgb, var(--tone) 70%, #16171c); }
.wk__ev b { font-size: 11px; line-height: 14px; font-weight: 700; white-space: nowrap; }
.wk__ev i { font-style: normal; font-size: 9.500px; line-height: 12px; font-weight: 620; opacity: 0.8; white-space: nowrap; }
.wk__ev:focus-visible > span { box-shadow: 0 0 0 2px var(--ink); }

/* the line of now: across today's column, with its time in a small flat tag */
.wk__now { position: absolute; left: 0; top: 0; height: 1.500px; background: var(--now); pointer-events: none; z-index: 2; }
.wk__now i { position: absolute; left: 3px; top: -17px; height: 15px; padding: 0 4px; border-radius: 4px; background: var(--now); color: #ffffff; font-style: normal; font-size: 9px; line-height: 15px; font-weight: 700; white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #16171c;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(22, 23, 28, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
