/* The schedule screens: today, week, month, approve (js/screens/{today,week,month,approve}.js).
   Same system as app.css and motion.css: one curve (--ease), durations --t1/--t2/--t3, logical properties only, 44px
   targets. Board green for the "tomorrow" board and the primary actions, chalk yellow only for now / today / success. */

/* Class colors: --k0..--k5 (app.css), set per element as --kc (kcStyle in today.js); .kdot is in classes.css. */
.sch .ic.xs, .chip .ic.xs { width: 14px; height: 14px; stroke-width: 2; }
.sch .spin { display: inline-block; flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- state chips ---------- */
.chip.sm { font-size: 13px; padding: 1px 8px; }
.chip.st-ready { background: var(--board-soft); color: var(--board); }
.chip.st-approved { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.chip.st-approve { background: transparent; color: var(--board); border: 1px solid color-mix(in srgb, var(--board) 45%, transparent); }
.chip.st-topic { background: color-mix(in srgb, var(--meh) 14%, var(--surface)); color: var(--meh); }
.chip.st-off { background: var(--danger-soft); color: var(--danger); }
.chip.st-held { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.chip.st-ask { background: var(--paper-2); color: var(--muted); border: 1px dashed var(--line); }
.chip.st-sub { background: var(--paper-2); color: var(--muted); }
.chip.st-now { background: var(--chalk-soft); color: var(--ink); }

/* ---------- the head of the day and week views: the title and the switch on one line, the summary under them ---------- */
.sch-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; margin-bottom: 24px; }
.sch-head p { grid-column: 1 / -1; margin-top: 0; }

/* ---------- the view switch (יום / שבוע) and the step arrows ---------- */
.vswitch { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.vs-o {
  position: relative; isolation: isolate; display: grid; place-items: center; min-height: 44px; min-width: 76px; padding: 0 18px;
  border-radius: 999px; font-weight: 600; color: var(--muted); text-decoration: none;
  transition: color var(--t2) var(--ease), transform var(--t1) var(--ease);
}
a.vs-o:hover { color: var(--ink); }
a.vs-o:active { transform: scale(.96); }
.vs-o[aria-current] { color: var(--ink); }
.vs-pill { position: absolute; inset: 0; z-index: -1; border-radius: 999px; background: var(--surface-2); box-shadow: var(--shadow-1), var(--hi); view-transition-name: view-pill; }

.stepnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sn-b {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); text-decoration: none;
  transition: background var(--t2) var(--ease), color var(--t2) var(--ease), transform var(--t1) var(--ease);
}
.sn-b.sn-w { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 14px; border-radius: 999px; font-weight: 600; }
.sn-m { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 700; color: var(--ink); text-decoration: none; transition: background var(--t2) var(--ease), transform var(--t1) var(--ease); }
.sn-m .ic { color: var(--board); }
.sn-b:hover, a.sn-m:hover { background: var(--paper-2); color: var(--ink); }
.sn-b:active, a.sn-m:active { transform: scale(.95); }

/* ---------- the day strip (א' to ו') ---------- */
.daynav { margin-bottom: 24px; }
.strip {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1), var(--hi);
}
.dc {
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 70px; padding: 8px 0 7px;
  border-radius: var(--r-m); color: var(--muted); text-decoration: none;
  transition: background var(--t2) var(--ease), color var(--t2) var(--ease), transform var(--t1) var(--ease);
}
a.dc:hover { background: var(--paper-2); }
a.dc:active { transform: scale(.95); }
.dc-l { font-size: 13px; font-weight: 700; line-height: 1; }
.dc-n { font-family: var(--display); font-size: 22px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.dc-m { display: flex; gap: 3px; align-items: center; height: 6px; margin-top: auto; }
.dc-m i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.dc-m .dc-off { width: 12px; height: 2px; border-radius: 1px; }
.dc.is-off .dc-n { color: var(--faint); }
.dc.is-today .dc-n { position: relative; }
.dc.is-today .dc-n::after { content: ""; position: absolute; inset-inline: -3px; bottom: -3px; height: 3px; border-radius: 2px; background: var(--chalk); }
.dc.is-sel { color: color-mix(in srgb, var(--board-ink) 80%, transparent); }
.dc.is-sel .dc-n { color: var(--board-ink); }
.dc.is-sel .dc-m i { background: color-mix(in srgb, var(--board-ink) 70%, transparent); }
.dc-pill { position: absolute; inset: 0; z-index: -1; border-radius: var(--r-m); background: var(--board); box-shadow: 0 2px 6px rgba(24, 48, 40, .2); view-transition-name: day-pill; }

/* ---------- the week waiting for approval ---------- */
.wk-banner {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; margin-bottom: 20px;
  border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--board);
  box-shadow: var(--shadow-1), var(--hi); color: var(--ink); text-decoration: none;
  transition: transform var(--t1) var(--ease), box-shadow var(--t2) var(--ease), background var(--t2) var(--ease);
}
.wk-banner:hover { box-shadow: var(--shadow-2), var(--hi); }
.wk-banner:active { transform: scale(.99); background: var(--board-soft); }
.wk-banner .grow { flex: 1; min-width: 0; display: grid; }
.wk-banner .grow > span { color: var(--muted); font-size: 15px; }
.wk-banner > .ic { color: var(--faint); }
.wb-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--board-soft); color: var(--board); }

/* ---------- the day's lessons, by the bell ---------- */
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lb { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 14px; animation: rise var(--t3) var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
.lb-time { display: grid; align-content: start; justify-items: center; padding-top: 16px; font-variant-numeric: tabular-nums; }
.lb-time b { font-size: 18px; line-height: 1.2; }
.lb-time span { color: var(--faint); font-size: 14px; }
.lb-card {
  position: relative; min-width: 0; overflow: hidden; border-radius: var(--r-m); background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--kc, var(--line)); box-shadow: var(--shadow-1), var(--hi);
  transition: box-shadow var(--t2) var(--ease);
}
.lb-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px 0; }
.lb-row { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 14px 16px; color: inherit; text-decoration: none; transition: background var(--t2) var(--ease); }
a.lb-row:hover { background: var(--paper-2); }
a.lb-row:active { background: var(--board-soft); }
.lb-row + .lb-row { border-top: 1px dashed var(--line); }
.lb-main { flex: 1; min-width: 0; display: grid; gap: 2px; justify-items: start; }
.lb-k { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.lb-t { font-weight: 700; font-size: 18px; line-height: 1.35; }
.lb-why { color: var(--muted); font-size: 14px; }
.lb-side { flex: none; display: flex; align-items: center; gap: 8px; }
.lb-go { color: var(--faint); }
.lb-tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.lb-tag.now { background: var(--chalk); color: #1c2925; }
.lb-tag.next { background: var(--board-soft); color: var(--board); }
/* The focal point is the next lesson: raised, with the book-title type. The lesson now has the yellow chalk line. */
.lb.is-next .lb-card { box-shadow: var(--shadow-2), var(--hi); }
.lb.is-next .lb-t { font-family: var(--display); font-size: 23px; line-height: 1.3; }
.lb.is-now .lb-card { box-shadow: var(--shadow-2), var(--hi); }
.lb.is-now .lb-row, .lb.is-now .lb-top { padding-inline-start: 24px; }
/* The yellow chalk line of the lesson now: drawn down the card's edge, with the same chalk texture as the logo. */
.now-line { position: absolute; inset-inline-start: 7px; top: 10px; bottom: 10px; width: 5px; border-radius: 3px; background: var(--chalk); filter: url(#chalk); pointer-events: none; transform-origin: top; animation: now-draw 700ms var(--ease) 200ms both; }
@keyframes now-draw { from { transform: scaleY(0); } }
.lb.is-past .lb-t, .lb.is-past .lb-time b { color: var(--muted); }
.lb.is-past .lb-card { box-shadow: none; }
.lb-row.is-off .lb-t { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--faint); }
.lb.is-off .lb-card { background: transparent; box-shadow: none; border-style: dashed; border-top-style: solid; }
.lb.is-off .lb-time { color: var(--faint); }
.brk { display: flex; align-items: center; gap: 10px; padding-inline-start: 74px; color: var(--faint); font-size: 13px; font-weight: 600; animation: rise var(--t3) var(--ease) both; }
.brk::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
@media (max-width: 560px) {
  .lb { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; }
  .lb-time b { font-size: 16px; }
  .lb-row { padding: 12px 12px 12px 10px; gap: 8px; align-items: flex-start; }
  .lb-side { flex-direction: column; align-items: flex-end; gap: 6px; }
  .lb-side .lb-go { display: none; }
  .lb.is-next .lb-t { font-size: 21px; }
  .brk { padding-inline-start: 56px; }
}

/* ---------- the quiet states: no timetable, a day off, no lessons ---------- */
.quiet { text-align: center; padding: 32px 24px 30px; }
.quiet h3 { margin: 14px 0 6px; }
.quiet p { color: var(--muted); max-width: 52ch; margin: 0 auto 18px; }
.board-art { display: block; width: 140px; height: 98px; margin: 0 auto; }
.board-art .ba-bg { fill: #23463b; }
.board-art .ba-chalk { fill: none; stroke: #eef3f0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: url(#chalk); }
.board-art .ba-chalk > * { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 1.1s var(--ease) 200ms forwards; }
.board-art .ba-line { fill: none; stroke: var(--chalk); stroke-width: 3; stroke-linecap: round; filter: url(#chalk); stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 600ms var(--ease) 900ms forwards; }
:root[data-theme="dark"] .board-art .ba-bg { fill: #2a4a3e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board-art .ba-bg { fill: #2a4a3e; } }

/* ---------- "מחר: מה להכין": the green board ---------- */
.board {
  --board-bg: #23463b; --chalk-ink: #eef3f0; --chalk-dim: #b8cbc2;
  position: relative; margin-bottom: 24px; padding: 24px 28px 20px; border-radius: var(--r-l); overflow: hidden;
  background-color: var(--board-bg); background-image: radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, .055), transparent 60%);
  border: 1px solid rgba(0, 0, 0, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 0 rgba(0, 0, 0, .12), var(--shadow-2);
  color: var(--chalk-ink);
}
:root[data-theme="dark"] .board { --board-bg: #21392f; border-color: #2f4a3f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board { --board-bg: #21392f; border-color: #2f4a3f; } }
.board .k { color: var(--chalk-dim); font-weight: 700; font-size: 15px; }
.board h2 { color: var(--chalk-ink); font-size: 30px; }
.board .board-line { height: 14px; max-width: 240px; margin: 0 0 10px; }
.board .board-line svg { display: block; width: 100%; height: 100%; overflow: visible; }
.board .board-line .chalk-draw { animation-delay: 250ms; }
.btn.on-board { --bg: rgba(255, 255, 255, .08); --fg: var(--chalk-ink); --bd: rgba(255, 255, 255, .18); box-shadow: none; }
.btn.on-board:hover { --bg: rgba(255, 255, 255, .15); }
@media (hover: none) { .btn.on-board:hover { --bg: rgba(255, 255, 255, .08); } }
.input.on-board { background: rgba(0, 0, 0, .2); border-color: rgba(255, 255, 255, .18); color: var(--chalk-ink); box-shadow: none; }
.input.on-board::placeholder { color: var(--chalk-dim); opacity: .75; }
.input.on-board:focus { border-color: var(--chalk-ink); box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.board :focus-visible { outline-color: var(--chalk-ink); }

.prep-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.prep-count { color: var(--chalk-dim); font-size: 15px; padding-bottom: 4px; }
.prep-count b { font-family: var(--display); font-size: 22px; color: var(--chalk-ink); font-variant-numeric: tabular-nums; }
.prep-sub { color: var(--chalk-dim); }
.prep-prog { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.prep-prog i { display: block; height: 100%; border-radius: 2px; background: var(--chalk-ink); transform-origin: right; transition: transform var(--t3) var(--ease); }
.pg { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t3) var(--ease) 420ms, opacity var(--t3) var(--ease) 420ms; }
.pg-in { min-height: 0; overflow: hidden; padding-top: 16px; }
.prep:not(.show-done) .pg:not(:has(.pi:not(.is-done))) { grid-template-rows: 0fr; opacity: 0; }
.pg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.pg-h h3 { font-family: var(--text); font-size: 15px; font-weight: 700; color: var(--chalk-dim); }
.pg-l { list-style: none; margin: 0; padding: 0; }
/* A checked line is crossed out, then the rows close up after it. */
.pi { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t3) var(--ease) 260ms, opacity var(--t2) var(--ease) 260ms; }
.pi-in { min-height: 0; overflow: hidden; }
.pi-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.pi:first-child .pi-row { border-top: 0; }
.prep:not(.show-done) .pi.is-done { grid-template-rows: 0fr; opacity: 0; }
.pi.is-new { animation: rise var(--t3) var(--ease); }
.pi-l { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pi-l input { position: absolute; inset-inline-start: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pi-box {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--chalk-dim); color: transparent;
  transition: background var(--t2) var(--ease), border-color var(--t2) var(--ease), color var(--t2) var(--ease), transform var(--t1) var(--ease);
}
.pi-box .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.pi-l:active .pi-box { transform: scale(.9); }
.pi-l input:checked + .pi-box { background: var(--chalk-ink); border-color: var(--chalk-ink); color: var(--board-bg); animation: pop var(--t2) var(--ease); }
.pi-l input:focus-visible + .pi-box { outline: 2px solid var(--chalk-ink); outline-offset: 2px; }
.pi-t { min-width: 0; display: grid; gap: 1px; font-weight: 600; text-decoration-line: line-through; text-decoration-color: transparent; text-decoration-thickness: 2px;
  transition: text-decoration-color var(--t2) var(--ease), color var(--t2) var(--ease); }
.pi-t small { font-size: 14px; font-weight: 400; color: var(--chalk-dim); text-decoration: inherit; }
.pi.is-done .pi-t { color: var(--chalk-dim); text-decoration-color: var(--chalk-dim); }
.pi-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--chalk-dim); cursor: pointer; transition: background var(--t2) var(--ease), transform var(--t1) var(--ease); }
.pi-x:hover { background: rgba(255, 255, 255, .1); }
.pi-x:active { transform: scale(.9); }
.prep-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.prep-add { display: flex; gap: 8px; flex: 1 1 320px; }
.prep-add .input { flex: 1; min-width: 0; min-height: 46px; }
.lnk { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--chalk-dim); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lnk:hover { color: var(--chalk-ink); }
/* Everything is ready: the board shrinks to one line with the chalk check. */
.prep.is-done { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 18px 24px; animation: rise var(--t3) var(--ease); }
.prep.is-done .grow { flex: 1; min-width: 200px; }
.prep.is-done h2 { font-size: 24px; }
.prep-check svg { display: block; overflow: visible; }
@media (max-width: 560px) {
  .board { padding: 20px 18px 16px; }
  .board h2 { font-size: 26px; }
  .prep-add { flex-basis: 100%; }
  .prep.is-done .btn { width: 100%; }
}

/* ---------- "לא אהיה ביום הזה" ---------- */
.absent { padding: 18px 20px; margin-bottom: 24px; border-inline-start: 4px solid var(--meh); }
.ab-h { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ab-h .grow { flex: 1; min-width: 220px; }
.ab-h h2 { font-size: 21px; }
.ab-h p { color: var(--muted); margin-top: 2px; max-width: 64ch; }
.ab-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--meh) 15%, var(--surface)); color: var(--meh); }
.ab-list { list-style: none; margin: 14px 0 0; padding: 0; }
.ab { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.ab .grow { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.ab-time { min-width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ab-t { font-weight: 700; }
.ab-no { color: var(--muted); font-size: 14px; }
.ab-a { display: flex; gap: 6px; }
@media (max-width: 560px) { .ab-a .lbl { display: none; } .ab-a { margin-inline-start: 56px; } }

/* ---------- "לבדוק" ---------- */
.review { margin-top: 40px; }
.review .sec-head { justify-content: flex-start; gap: 10px; margin-bottom: 4px; }
.review .sec-head h2 { font-size: 24px; }
.rv-lead { margin-bottom: 12px; }
.rv-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.rv + .rv .rv-row { border-top: 1px solid var(--line); }
.rv-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 14px 16px; }
.rv-row .grow { flex: 1; min-width: 220px; display: grid; gap: 2px; justify-items: start; }
.rv-t { font-weight: 700; }
.rv-q { color: var(--muted); font-size: 15px; }
.rv-a { display: flex; gap: 6px; }
/* A row that leaves closes its gap (closeRow in today.js measures it first). */
.is-leaving { overflow: hidden; opacity: 0; transition: max-height var(--t3) var(--ease), opacity var(--t2) var(--ease), margin var(--t3) var(--ease), padding var(--t3) var(--ease); }

.day-body + .board { margin-top: 28px; }
.day-foot { display: flex; justify-content: center; margin-top: 32px; }
.day-foot .btn { color: var(--muted); }

/* ---------- the week ---------- */
.week-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.week-bar .stepnav { margin: 0; flex: 1; max-width: 420px; }
.lock-tag { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 12px; padding: 2px 10px; border-radius: 999px; background: var(--board-soft); color: var(--board); font: 600 14px/1.6 var(--text); vertical-align: middle; }
.lock-tag.is-new { animation: pop var(--t3) var(--ease); }
.wk-list { display: none; }
@media (max-width: 1023px) { .wk-grid { display: none; } .wk-list { display: block; } }

.wg { position: relative; display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(0, 1fr)); padding: 8px 8px 10px; }
.wg-corner { display: grid; place-items: center; color: var(--board); }
.wg-h { position: relative; z-index: 1; padding: 6px 6px 12px; text-align: center; }
.wg-dn { display: block; font-weight: 700; }
.wg-dd { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.wg-h.is-off .wg-dn { color: var(--muted); }
.wg-line { position: absolute; inset-inline: 22%; bottom: 2px; height: 10px; }
.wg-line svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wg-today { z-index: 0; margin: 0 2px; border-radius: 8px; background: color-mix(in srgb, var(--chalk) 8%, transparent); }
.wg-rl { z-index: 0; border-top: 1px solid var(--line); pointer-events: none; }
.wg-p { position: relative; z-index: 1; display: grid; align-content: start; justify-items: center; min-height: 84px; padding-top: 8px; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.wg-p b { font-size: 15px; color: var(--muted); }
.wg-brk { height: 12px; }
.wg-c { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 4px 3px; }
.wg-off { z-index: 1; display: grid; place-items: center; margin: 4px 3px; border-radius: 8px; color: var(--muted); font-weight: 700; text-align: center; padding: 8px;
  background: repeating-linear-gradient(135deg, var(--paper-2) 0 8px, transparent 8px 16px); border: 1px dashed var(--line); }
.wl {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--kc, var(--line)) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--kc, var(--line)) 22%, var(--line));
  border-top: 3px solid var(--kc, var(--line)); transition: box-shadow var(--t2) var(--ease), transform var(--t1) var(--ease);
}
.wl:hover { box-shadow: var(--shadow-1); }
.wl-k { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; }
.wl-k .kdot { width: 8px; height: 8px; }
.wl-k b { color: var(--ink); }
.wl-row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 44px; padding: 2px 0; color: var(--ink); text-decoration: none; border-radius: 6px; }
.wl-row + .wl-row { border-top: 1px dashed color-mix(in srgb, var(--kc, var(--line)) 30%, var(--line)); padding-top: 6px; }
a.wl-row:active { transform: scale(.98); }
a.wl-row:hover .wl-t { text-decoration: underline; text-underline-offset: 3px; }
.wl-t { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wl.is-off { background: transparent; border-style: dashed; border-top-style: solid; }
.wl-row.is-off .wl-t { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--faint); }
.wl.is-now { box-shadow: 0 0 0 2px var(--chalk), var(--shadow-1); }
.wg .wl { animation: rise var(--t3) var(--ease) both; }

.wd { margin-top: 22px; }
.wd:first-child { margin-top: 0; }
.wd-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wd-h h2 { font-size: 21px; }
.wd-d { color: var(--muted); font-variant-numeric: tabular-nums; }
.wd-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wd-l > li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: start; animation: rise var(--t3) var(--ease) both; }
.wd-time { padding-top: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wd-l .wl { padding: 8px 12px; background: var(--surface); box-shadow: var(--shadow-1), var(--hi); border-color: var(--line); border-top-color: var(--kc, var(--line)); }
.wd-l .wl-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.wd-l .wl-t { font-size: 16px; -webkit-line-clamp: 3; }
.wd-off { padding: 10px 14px; border-radius: var(--r-m); color: var(--muted); font-weight: 600; background: repeating-linear-gradient(135deg, var(--paper-2) 0 8px, transparent 8px 16px); border: 1px dashed var(--line); }

/* ---------- the month ---------- */
.month-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.month-bar .stepnav { margin: 0; gap: 4px; }
.mg { padding: 8px; }
.mg-w { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, .6fr); gap: 4px; }
.mg-w + .mg-w { margin-top: 4px; }
.mg-dl { text-align: center; padding: 2px 0 4px; color: var(--muted); font-size: 14px; font-weight: 700; }
.mg-dl.is-sat { color: var(--faint); }
.mc {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 88px; padding: 6px 8px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform var(--t1) var(--ease), border-color var(--t2) var(--ease), box-shadow var(--t2) var(--ease);
}
a.mc:hover { border-color: var(--board); box-shadow: var(--shadow-1); }
a.mc:active { transform: scale(.96); }
.mc.is-out { opacity: .42; }
.mc.is-sat { background: transparent; border-style: dashed; color: var(--faint); }
.mc.is-off:not(.is-sat) { background: repeating-linear-gradient(135deg, var(--paper-2) 0 7px, transparent 7px 14px), var(--surface); color: var(--muted); }
.mc.is-mine { border-color: color-mix(in srgb, var(--meh) 55%, var(--line)); }
.mc.is-abs { border-color: color-mix(in srgb, var(--meh) 55%, var(--line)); }
.mc-n { display: grid; place-items: center; width: 28px; height: 28px; margin-inline-start: -4px; border-radius: 50%; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.mc.is-today .mc-n { background: var(--chalk); color: #1c2925; }
.mc-r { font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mc-abs { color: var(--meh); }
.mc-once { color: var(--board); }
.mc-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.mc-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--kc, var(--faint)); }
.mg-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 4px 0; padding: 0; color: var(--muted); font-size: 14px; }
.mg-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mg-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.lg-dot { border-radius: 50% !important; width: 8px !important; height: 8px !important; background: var(--k0); }
.lg-off { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); border: 1px solid var(--line); }
.lg-abs { border: 2px solid var(--meh); }
.lg-today { border-radius: 50% !important; background: var(--chalk); }
@media (max-width: 560px) {
  .mg { padding: 5px; }
  .mg-w { gap: 3px; }
  .mc { min-height: 56px; padding: 4px 2px; align-items: center; }
  .mc-n { margin: 0; width: 26px; height: 26px; font-size: 14px; }
  .mc-r { display: none; }
  .mc-dots { justify-content: center; gap: 2px; }
  .mc-dots i { width: 5px; height: 5px; }
  .month-bar .btn { width: 100%; }
}
.month-days { margin-top: 36px; }
.month-days h2 { font-size: 24px; margin-bottom: 12px; }
.sd-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.sd + .sd .sd-row { border-top: 1px solid var(--line); }
.sd-row { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 12px 16px; color: inherit; text-decoration: none; transition: background var(--t2) var(--ease); }
a.sd-row:hover { background: var(--paper-2); }
a.sd-row:active { background: var(--board-soft); }
.sd-row .grow { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sd-t { font-weight: 700; }
.sd-s { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.sd-s .kdot { width: 8px; height: 8px; }
.sd-mark { flex: none; width: 14px; height: 14px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--faint) 0 3px, transparent 3px 6px); border: 1px solid var(--line); }
.sd-mine .sd-mark { background: color-mix(in srgb, var(--meh) 70%, var(--surface)); border: 0; }
.sd-absence .sd-mark { background: transparent; border: 2px solid var(--meh); }
.sd-removed .sd-mark { background: transparent; border: 2px dashed var(--faint); }
.sd-once .sd-mark { background: var(--kc, var(--board)); border: 0; border-radius: 50%; }

/* ---------- approving a week ---------- */
.ap-info { display: grid; gap: 10px; margin: -14px 0 24px; }
.ap-pace { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 15px; }
.ap-pace .ic { margin-top: 3px; color: var(--board); }
.ap-mk { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ap-mk li { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px dashed color-mix(in srgb, var(--meh) 50%, var(--line)); }
.ap-mk .grow { flex: 1; min-width: 200px; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ap-day { margin-top: 24px; }
.ap-dh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ap-dh h2 { font-size: 21px; }
.ap-day.is-off .wd-off { margin-top: 0; }
.ap-l { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ap {
  position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 16px;
  border-inline-start: 3px solid var(--kc, var(--line)); transition: background var(--t3) var(--ease);
}
.ap + .ap { border-top: 1px solid var(--line); }
.ap-time { align-self: start; padding-top: 1px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ap-main { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.ap-t { font-weight: 700; font-size: 17px; line-height: 1.4; }
.ap-side { display: flex; align-items: center; gap: 4px 8px; }
.ap-act { display: flex; gap: 2px; transition: opacity var(--t2) var(--ease); }
.ap.is-quiet .ap-t, .ap.is-quiet .ap-time { color: var(--muted); }
.ap.is-off .ap-t { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--faint); }
.ap-topic { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.ap-topic .input { flex: 1; min-width: 0; min-height: 44px; }
/* The cards check in turn: the chalk check draws itself where the actions were. */
.ap-ok { position: absolute; inset-inline-end: 16px; top: 50%; translate: 0 -50%; opacity: 0; pointer-events: none; transition: opacity var(--t2) var(--ease); }
.ap-ok svg { display: block; overflow: visible; }
.ap-ok .chalk-draw { animation: none; }
.ap.is-ok .ap-ok, .ap.is-approved .ap-ok { opacity: 1; }
.ap.is-ok .ap-ok .chalk-draw, .ap.is-approved .ap-ok .chalk-draw { animation: draw 450ms var(--ease) forwards; }
.ap.is-approved .ap-ok .chalk-line { stroke: var(--faint); }
.ap.is-ok .ap-act, .ap.is-approved .ap-act, .ap.is-writing .ap-act { opacity: 0; pointer-events: none; }
.ap.is-ok { background: color-mix(in srgb, var(--chalk) 7%, transparent); }
.ap.is-writing { background: var(--board-soft); }
.ap.is-writing::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--board), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: writing 1.2s linear infinite; }
@keyframes writing { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.ap.is-failed { background: var(--danger-soft); }
@media (max-width: 560px) {
  .ap { grid-template-columns: 44px minmax(0, 1fr); padding: 12px; }
  .ap-side { grid-column: 2; justify-self: start; flex-wrap: wrap; }
  .ap-ok { top: 18px; translate: none; }
}
.ap-bar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2), var(--hi);
}
/* On a phone the bar would cover a third of the list: it waits at the end, after the lessons were read. */
@media (max-width: 860px) { .ap-bar { position: relative; bottom: auto; } }
.ap-sum { display: grid; gap: 2px; flex: 1 1 260px; }
.ap-sum span { color: var(--muted); font-size: 15px; }
.ap-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-note { flex-basis: 100%; max-width: 52ch; color: var(--muted); font-size: 14px; }
.ap-wait { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; color: var(--muted); font-size: 15px; }
.ap-prog { flex: 1; display: grid; gap: 8px; min-width: 240px; }
.ap-pt { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.ap-pt .spin { color: var(--board); }
.ap-bar .err { flex: 1; }
.ap-bar .err .actions { margin-top: 10px; }
.ap-bar.is-done { justify-content: flex-start; animation: rise var(--t3) var(--ease); }
.ap-done-ic svg { display: block; overflow: visible; }
@media (max-width: 560px) { .ap-btns { width: 100%; } .ap-btns .btn { flex: 1; } }

/* ---------- sheets of the schedule screens ---------- */
.sheet .sh-h { font-size: 24px; margin-bottom: 4px; }
.sheet .sh-sub { margin-bottom: 18px; }
.sheet .field { margin-bottom: 18px; }
.sheet .fields { margin-bottom: 18px; }
.sheet .fields .field { margin-bottom: 0; }
.sheet .sh-acts { margin-top: 8px; }
.sheet .sh-note { margin: -4px 0 16px; padding: 10px 14px; border-radius: var(--r-m); background: var(--paper-2); color: var(--muted); font-size: 15px; }
.sheet .sh-err { margin-bottom: 12px; color: var(--danger); font-weight: 600; }
.opt-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 14px;
  border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface-2); text-align: start; font-weight: 600; cursor: pointer;
  transition: background var(--t2) var(--ease), border-color var(--t2) var(--ease), transform var(--t1) var(--ease);
}
.opt:hover { border-color: var(--board); }
.opt:active { transform: scale(.98); }
.opt[aria-pressed="true"] { border-color: var(--board); background: var(--board-soft); }
.opt > span:first-child { flex: 1; }
.opt .small { font-weight: 400; }
.opt-new { margin-bottom: 12px; }
.opt-new label { font-weight: 600; font-size: 15px; }
.opt-new-r { display: flex; gap: 8px; margin-top: 6px; }
.opt-new-r .input { flex: 1; min-width: 0; }
.btn.danger-fill { --bg: var(--danger); --fg: #fff; }
.btn.danger-fill:hover { --bg: color-mix(in srgb, var(--danger) 88%, var(--ink)); }
