/* Well-gray stage; the window sits in from the top-left on one gutter and runs
   off the right (Friday, cut by more than half) and the bottom (the late
   afternoon). */
.lc .ss-stage {
  --gutter: 28px;
  overflow: hidden;
  /* The tile it sits in on the page */
  background: #131315;
}

.cal-window {
  position: absolute;
  top: var(--gutter);
  left: var(--gutter);
  width: 780px;
  height: 420px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 0 0 1px rgb(255 255 255 / 0.06);
}

.cal-window[data-layout='compact'] {
  top: 20px;
  left: 20px;
  width: 600px;
  height: 400px;
}

/* Compact type is set for the phone's column, drawn close to 1:1 */
.cal-window[data-layout='compact'] .cal-hours {
  width: 56px;
  font-size: 10.5px;
}

.cal-window[data-layout='compact'] .cal-head {
  margin-left: 56px;
}

.cal-window[data-layout='compact'] .cal-event__time {
  font-size: 10.5px;
}

.cal-window .ss-window__body {
  background: var(--ss-surface);
}

/* ---- Sidebar ---- */

.cal-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 10px 16px;
}

.cal-mini {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-mini__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  margin: 0 -3px;
}

.cal-mini__grid span {
  position: relative;
  height: 14px;
}

.cal-mini__grid span::after {
  content: '';
  position: absolute;
  inset: 5px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ss-ink-4);
}

.cal-mini__grid span[data-week] {
  background: var(--ss-ink-1);
}

.cal-mini__grid span[data-week]:first-of-type,
.cal-mini__grid span:nth-child(22) {
  border-radius: 7px 0 0 7px;
}

.cal-mini__grid span:nth-child(28) {
  border-radius: 0 7px 7px 0;
}

.cal-mini__grid span[data-today]::after {
  background: var(--ss-text-strong);
}

.cal-cals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-cal {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-cal__sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--ss-ink-4);
}

.cal-cal__sw[data-accent] {
  background: var(--ss-accent);
}

/* ---- Toolbar ---- */

.cal-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ss-icon);
}

.cal-today {
  margin-right: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--ss-line);
  font: 500 11px/1.3 var(--ss-font);
  color: var(--ss-text-strong);
}

.cal-prev {
  transform: scaleX(-1);
}

/* ---- Week grid ---- */

.cal-head {
  display: grid;
  grid-template-columns: repeat(5, 140px);
  /* The day labels share the title's left edge: the hours' width plus the label's inset */
  margin-left: 73.5px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--ss-line);
  font: 500 11px/1.3 var(--ss-font);
  color: var(--ss-text);
}

.cal-head span {
  padding-left: 0;
}

.cal-window[data-layout='compact'] .cal-head span {
  padding-left: 8px;
}

.cal-head span[data-today] {
  color: var(--ss-text-strong);
  font-weight: 600;
}

.cal-body {
  display: flex;
  padding-top: 8px;
}

.cal-hours {
  display: grid;
  grid-auto-rows: 40px;
  box-sizing: border-box;
  width: 64px;
  padding-left: 12px;
  padding-right: 8px;
  font: 500 9px/1 var(--ss-font);
  color: var(--ss-text-faint);
  text-align: right;
}

.cal-hours span {
  transform: translateY(-4px);
}

.cal-grid {
  position: relative;
  width: 700px;
  height: 280px;
  background:
    linear-gradient(var(--ss-line) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, var(--ss-line) 1px, transparent 1px) 0 0 / 140px 100%;
}

.cal-busy {
  position: absolute;
  padding: 9px 9px;
  border-radius: 6px;
  background: var(--ss-ink-1);
}

/* ---- The drop slot: appears in the landing cell and jumps, never travels ---- */

.cal-slot {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  border: 1.5px dashed color-mix(in srgb, var(--ss-accent) 55%, transparent);
  border-radius: 6px;
  background: var(--ss-accent-soft);
}

.cal-slot[data-show] {
  opacity: 1;
}

/* ---- The meeting ---- */

.cal-event {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 10px 9px 13px 9px;
  border-left: 3px solid var(--ss-accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--ss-accent) 11%, var(--ss-surface));
  transition:
    translate 0.8s cubic-bezier(0.45, 0, 0.1, 1),
    box-shadow 0.2s ease,
    scale 0.2s ease,
    rotate 0.2s ease;
}

/* Carried: no travel transition. Independent translate keeps the lift's
   scale and rotation from multiplying the card's grid coordinates. */
.cal-event[data-dragging] {
  transition: box-shadow 0.2s ease, scale 0.2s ease, rotate 0.2s ease;
}

.cal-event[data-lifted] {
  box-shadow: var(--ss-shadow-lift);
  scale: 1.03;
  rotate: -1.5deg;
}

.cal-event__title {
  font: 600 11px/1.3 var(--ss-font);
  color: color-mix(in srgb, var(--ss-accent) 35%, #fff);
}

.cal-event__time {
  font: 500 10px/1.3 var(--ss-font);
  color: color-mix(in srgb, var(--ss-accent) 55%, var(--ss-text));
}

.cal-event {
  /* Its text keeps one layer, so it never hops as the card lands */
  will-change: transform;
  flex-direction: row;
  gap: 8px;
  padding: 8px 9px 8px 8px;
}

.cal-event__thumb {
  flex: none;
  width: 34px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
}

.cal-event__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

/* The status is the third line of the item; its dot turns green */
.cal-event__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 500 10px/1.3 var(--ss-font);
  color: var(--ss-text);
  transition: color 0.2s ease;
}

.cal-event__status[data-planned] {
  color: var(--ss-success-text, var(--ss-success));
}

.cal-event__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ss-ink-5);
  transition: background 0.2s ease;
}

.cal-event__status[data-planned] .cal-event__dot {
  background: var(--ss-success);
}

/* The week's other posts: a quiet thumbnail and a line */
.cal-busy {
  display: flex;
  gap: 8px;
}

.cal-busy__thumb {
  flex: none;
  width: 22px;
  height: 38px;
  border-radius: 3px;
  background: var(--ss-ink-2);
}
