/* Wizard shell, the rotation grid, and the year view. */

/* The timetable view makes #app a full-height flex column. The wizard runs
   its own layout, so hand it back. */
#app.is-wizard { display: block; height: auto; overflow: visible; }

.sample-link {
  position: fixed;
  left: 1.5rem;
  bottom: 1.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sample-link:hover { color: var(--text); }
.sample-link-right { left: auto; right: 1.5rem; }

.wiz {
  --panel-w: min(1000px, 78vw);
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.wiz::-webkit-scrollbar { width: 0; height: 0; }

.wiz-track {
  display: flex;
  align-items: stretch;
  gap: 2.5rem;
  padding-inline: calc(50% - var(--panel-w) / 2);
  width: max-content;
  min-height: 100%;
}

.wiz-panel {
  --away: 1;
  flex: 0 0 var(--panel-w);
  width: var(--panel-w);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem 0 4.5rem;
  /* Neighbours stay visible and clickable, just pushed back. */
  opacity: calc(1 - var(--away) * 0.72);
  transform: scale(calc(1 - var(--away) * 0.06));
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.wiz-panel.is-wide { --panel-w: min(1180px, 92vw); }
.wiz-panel:not(.is-centre) { cursor: pointer; }
.wiz-panel:not(.is-centre) .wiz-body { pointer-events: none; }

.wiz-body { min-height: 0; }

.wiz-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}
.wiz-note { font-size: 0.8rem; color: var(--text-dim); }
.wiz-errors { font-size: 0.8rem; color: var(--c-dept); margin: 0.5rem 0 0; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover:not(:disabled) { background: #000; border-color: #000; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.btn-sm.is-on, .btn.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-danger { color: var(--c-dept); border-color: var(--c-dept); }

.wiz-dots {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.wiz-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  padding: 0;
}
.wiz-dot.is-live { background: var(--text); }
.wiz-dot:disabled { opacity: 0.4; }

/* ── Step 1 ──────────────────────────────────────────────────── */

.wiz-choices { display: flex; gap: 1.25rem; }
.wiz-choice {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.wiz-choice:hover { border-color: var(--text); }
.wiz-choice.is-on { border-color: var(--text); background: #fafafa; }
.wiz-choice-n { font-size: 2.4rem; font-weight: 200; line-height: 1; letter-spacing: -0.04em; }
.wiz-choice-sub { font-size: 0.78rem; color: var(--text-dim); }

/* ── Step 2 ──────────────────────────────────────────────────── */

.per-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.8rem; }
.per-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px 60px 28px;
  gap: 0.5rem;
  align-items: center;
}
.per-len { font-size: 0.72rem; color: var(--text-dim); text-align: right; }
.per-del { position: static; opacity: 0.45; }
.per-del:hover { opacity: 1; }

/* ── Step 3: the grid ────────────────────────────────────────── */

.grid-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
.grid {
  display: grid;
  grid-template-columns: 76px repeat(var(--days), minmax(92px, 1fr));
  grid-auto-rows: minmax(46px, auto);
  gap: 3px;
  min-width: max-content;
}

.grid-corner { border-bottom: 1px solid var(--line); }
.grid-dayhead {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
}
.grid-week {
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 3px;
}
.grid-periodhead {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 0.5rem;
  text-align: right;
}
.grid-pname { font-size: 0.68rem; font-weight: 500; }
.grid-ptime { font-size: 0.6rem; color: var(--text-dim); }

.cell { border-radius: var(--radius-sm); min-width: 0; }
.cell.is-empty {
  border: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.cell.is-empty:hover { border-color: var(--text-dim); background: #fafafa; }
.cell-plus { font-size: 1.1rem; color: var(--line-strong); opacity: 0; transition: opacity 0.12s; }
.cell.is-empty:hover .cell-plus { opacity: 1; }

.cell.is-target { outline: 2px solid var(--text); outline-offset: 1px; }

.cell-entry {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  background: var(--c);
  color: var(--fg);
  line-height: 1.2;
  cursor: grab;
  touch-action: none;
}
.cell-name { font-size: 0.72rem; font-weight: 500; }
.cell-loc { font-size: 0.62rem; opacity: 0.82; }
.cell-detail { font-size: 0.58rem; opacity: 0.72; }
.cell-time { font-size: 0.56rem; opacity: 0.6; margin-top: auto; }

.cell-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  font-size: 0.85rem;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.12s;
}
.cell-entry:hover .cell-x { opacity: 1; }
.cell-x:hover { background: #fff; }

.cell-entry.is-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.9;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.cell-entry.is-source { opacity: 0.35; }
.grid.is-dragging .cell.is-empty { border-color: var(--text-dim); }

/* ── Step 4: the year ────────────────────────────────────────── */

.yv { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.yv-dates { display: flex; gap: 1.5rem; }
.yv-datefield { display: flex; flex-direction: column; gap: 0.3rem; }
.yv-tools { display: flex; align-items: center; gap: 0.75rem; }
.yv-modes { display: flex; gap: 0.35rem; }

.yv-weeks {
  overflow-y: auto;
  max-height: 46vh;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.yv-hint { font-size: 0.85rem; color: var(--text-dim); }
.yv-month {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 0.6rem;
}
.yv-week { display: flex; align-items: center; gap: 0.5rem; }
.yv-wk {
  flex: 0 0 34px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 2px 0;
}
.yv-wk:hover { border-color: var(--text); color: var(--text); }
.yv-wk.is-static { border: none; }

.yv-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; flex: 1; }
.yv-day.is-weekend { background: #fafafa; }
.yv-day.is-weekend.is-off { background: var(--line-strong); }
.grid-dayhead.is-weekend { color: var(--text-dim); }
.yv-day {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg);
  touch-action: none;
}
.yv-day:hover:not([disabled]) { border-color: var(--text-dim); }
.yv-day.is-outside { opacity: 0.25; }
.yv-day.is-off { background: var(--line-strong); color: var(--bg); }
.yv-day.is-am { background: linear-gradient(to bottom, var(--bg) 50%, var(--line-strong) 50%); }
.yv-day.is-pm { background: linear-gradient(to bottom, var(--line-strong) 50%, var(--bg) 50%); }

/* ── Step 5 ──────────────────────────────────────────────────── */

.wiz-nameinput { font-size: 1.05rem; padding: 0.7rem 0.8rem; width: 100%; }
.wiz-summary { font-size: 0.8rem; color: var(--text-dim); margin: 0.8rem 0 0; }
