/* Tutor pages (T-0029a). Builds on app.css (same tokens); loaded only by templates/tutor/*. */
.h-top { margin-top: 0; }
.nowrap { white-space: nowrap; }
.crumbs { margin: 0 0 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.flash-warn { background: var(--warn-soft); border-color: var(--line-warn); }
.notice { background: var(--warn-soft); border-color: var(--line-warn); }
.notice h2 { margin-top: 0; font-size: 1.05rem; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.tool-row form { margin: 0; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.subnav a { padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text);
            text-decoration: none; font-size: .88rem; }
.subnav a:hover { border-color: var(--accent); }
.strong-link { font-weight: 600; text-decoration: none; }
.field input[type=date], .inline-date, .tool-row select, .topic-select {
  font: inherit; font-size: 1rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); }
.field input[type=date] { width: 100%; }
.topic-select { width: 100%; min-height: 160px; }
.label { font-size: .85rem; font-weight: 600; color: var(--muted); }
details.sub { margin: 10px 0; }
details.sub > summary { cursor: pointer; font-weight: 600; }
/* a button-styled summary (class btn) keeps the button's own text colour and padding */
details.sub > summary:not(.btn) { color: var(--accent); padding: 4px 0; }
details.sub > form { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.tall { max-height: 460px; overflow-y: auto; }

/* status chips */
.lst-planned { background: var(--line); color: var(--text); }
.lst-in_progress { background: var(--accent-soft); color: var(--accent); }
.lst-done { background: var(--good-soft); color: var(--good); }
.lst-cancelled { background: var(--bad-soft); color: var(--bad); }
.ast-proposed, .ast-assigned { background: var(--line); color: var(--text); }
.ast-in_progress { background: var(--accent-soft); color: var(--accent); }
.ast-submitted, .ast-marked { background: var(--good-soft); color: var(--good); }
.ast-late { background: var(--bad-soft); color: var(--bad); }
.pst-draft { background: var(--line); color: var(--text); }
.pst-sent { background: var(--accent-soft); color: var(--accent); }
.pst-done { background: var(--good-soft); color: var(--good); }
.st-ok { background: var(--good-soft); color: var(--good); }
.st-warn { background: var(--warn-soft); color: var(--warn); }
.st-off { background: var(--bad-soft); color: var(--bad); vertical-align: middle; }
.st-today { background: var(--accent); color: var(--accent-ink); }
.ltype { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--bg);
         border: 1px solid var(--line); white-space: nowrap; }
.lt-revision { background: var(--purple-soft); border-color: var(--purple-line); color: var(--purple); }
.lt-exam_prep { background: var(--warn-soft); border-color: var(--line-warn); color: var(--warn); }
.lt-custom { background: var(--accent-soft); border-color: var(--line-accent); color: var(--accent); }
.pin { font-size: .72rem; color: var(--muted); border: 1px dashed var(--muted); border-radius: 6px; padding: 0 5px; white-space: nowrap; }

/* students list */
.students-table tr.inactive td { opacity: .55; }
.mchip { display: inline-block; min-width: 46px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700;
         font-size: .82rem; color: #fff; }

/* timeline */
.enrolment { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.enrolment:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.enrolment.ended { opacity: .75; }
.tl-h { margin: 12px 0 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.timeline tr.past td { color: var(--muted); }
.timeline tr.today td { background: var(--accent-soft); }
.timeline tr.cancelled td { text-decoration: line-through; color: var(--muted); }
.timeline tr.cancelled td.actions-cell { text-decoration: none; }
.add-enrol { margin-top: 18px; }

/* mastery heat map */
.m-strong { background: var(--st-strong); color: #fff; }
.m-adequate { background: var(--st-adequate); color: #fff; }
.m-weak { background: var(--st-weak); color: #1a1200; }
.m-critical { background: var(--st-critical); color: #fff; }
.m-none { background: var(--line); color: var(--text); }
.m-thin { background: var(--bg); color: var(--text); border: 1px dashed var(--muted); }
.strand { margin: 8px 0 12px; }
.strand-name { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.hcell { border-radius: 9px; padding: 7px 9px; display: flex; justify-content: space-between; gap: 6px; align-items: flex-start;
         font-size: .82rem; line-height: 1.25; min-height: 48px; }
.hcell .hname { flex: 1; }
.hcell .hval { font-weight: 800; font-variant-numeric: tabular-nums; }
.hcell.seed { outline: 2px dashed rgba(0, 0, 0, .35); outline-offset: -4px; }
.legend-chips .mchip { min-width: 0; }

/* lesson prep */
.start-card { border-color: var(--accent); }
.mode-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: 12px;
            cursor: pointer; background: var(--card); }
.mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-opt input { margin-top: 5px; width: 18px; height: 18px; }
.topic-list { margin: 0 0 8px; padding-left: 1.2rem; }
.note-body h2, .note-body h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
.note-body ul, .note-body ol { padding-left: 1.3rem; }
.note-body li { margin: .25rem 0; }
.paper-list { list-style: none; padding: 0; margin: 0; }
.paper-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.paper-list li span { display: block; }
.paper-list li .paper-links span { display: inline; }
.hw-repeat { margin: 6px 0 0; }
.opt-list { margin: 6px 0; padding-left: 1.6rem; }
.topic-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.topic-checks fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; }
.topic-checks legend { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 0 4px; }
.topic-checks label { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: .95rem; }
.topic-checks input { width: 18px; height: 18px; flex: none; }

/* live lesson */
.run-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px;
            position: sticky; top: 0; z-index: 15; }
.run-head h1 { font-size: 1.3rem; margin: 0; }
.run-head p { margin: 0; }
.run-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { font: inherit; font-size: .88rem; padding: 8px 12px; border: 0; background: var(--card); color: var(--text); cursor: pointer;
           min-height: 40px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); }
.seg-btn:disabled { cursor: default; }
.elapsed { font-variant-numeric: tabular-nums; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); }
.live { font-size: .8rem; color: var(--muted); }
.live-ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 5px; }
.live-err { color: var(--bad); font-weight: 600; }
.strip-card { padding: 12px 16px; }
.strip-head { margin-bottom: 8px; }
.strip { display: flex; flex-wrap: wrap; gap: 6px; }
.sq { min-width: 44px; min-height: 44px; border-radius: 9px; border: 2px solid var(--line); background: var(--card); color: var(--text);
      font: inherit; font-weight: 700; cursor: pointer; position: relative; }
.sq.s-ok { background: var(--good); border-color: var(--good); color: var(--good-ink); }
.sq.s-part { background: var(--st-weak); border-color: var(--st-weak); color: #1a1200; }
.sq.s-bad { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.sq.s-ticked { background: var(--accent-soft); border-color: var(--accent); }
.sq.cur { outline: 3px solid var(--text); outline-offset: 2px; }
.sq.rev::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #fff;
                 box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.run-q .q-head h2 { font-size: 1.3rem; }
.tchip { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.resp { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 1.05rem; }
.resp-lab { font-weight: 600; color: var(--muted); font-size: .85rem; margin-right: 4px; }
.resp-val { font-family: var(--mono); font-weight: 700; }
.resp-math { margin-left: 10px; padding: 1px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.resp-math-lab { color: var(--muted); font-size: .8rem; margin-right: 2px; }
.resp-wait { border-style: dashed; }
.waiting { color: var(--muted); font-style: italic; }
.dots::after { content: ""; animation: dots 1.5s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .dots::after { animation: none; content: "..."; } }
.automark { display: inline-block; margin: 2px 0 4px; padding: 3px 10px; border-radius: 8px; font-size: .92rem; }
.am-ok { background: var(--good-soft); color: var(--good); }
.am-part { background: var(--warn-soft); color: var(--warn); }
.am-bad { background: var(--bad-soft); color: var(--bad); }
.tools { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; }
.review { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.review h3 { margin: 0 0 6px; font-size: 1rem; }
.review-grid { margin: 8px 0; grid-template-columns: 1fr; }
.review-grid input, .review-grid textarea { max-width: 100%; }
.ticks .btn { min-height: 40px; }
.tick-ok { border-color: var(--good); color: var(--good); }
.tick-part { border-color: var(--st-weak); color: var(--warn); }
.tick-bad { border-color: var(--bad); color: var(--bad); }
.nav-row { justify-content: space-between; }
.qmsg { min-height: 1.2em; margin: 6px 0 0; font-weight: 600; }
.qmsg-ok { color: var(--good); }
.qmsg-err { color: var(--bad); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown.urgent { color: var(--bad); }
.mat { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; }
.mat-col, .note-body { min-width: 0; overflow-x: auto; }
.mat h3 { grid-column: 1 / -1; margin: 4px 0; }
.mat h4 { margin: 6px 0 2px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mat-col ul { padding-left: 1.2rem; margin: 0; }

/* homework / summary / assignment */
.hw-slot.approved { border-color: var(--good); }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 16px; min-width: 140px; }
.stat-v { display: block; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: .85rem; }
.login-box th { width: 38%; }

/* Tailored notes (Claude) */
pre.payload { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
              padding: 10px 12px; font-size: .8rem; max-height: 360px; overflow: auto; }
.tailored { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.tailored.approved { border-top-color: var(--good); }
.md-edit { width: 100%; min-height: 320px; font: .9rem/1.45 Consolas, "Courier New", monospace; padding: 10px; border: 1px solid var(--line);
           border-radius: 8px; background: var(--card); color: var(--text); }
.note-preview { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }

/* teacher dashboard card */
.tutor-card h2 { margin-top: 0; }
.tutor-card ul { margin: 0; padding-left: 1.1rem; }
.tutor-card li { margin: .3rem 0; }

@media (max-width: 760px) {
  .mat { grid-template-columns: minmax(0, 1fr); }
  .run-head { position: static; }
  .nav-row .btn { flex: 1; }
}
@media print {
  .run-head, .tools, .strip-card, #finish-card { display: none !important; }
}

/* ---- print sheets of a lesson: topic notes, question worksheet, answer key (lesson_print.html) */
.print-choose { margin-top: 12px; align-items: center; }
.lp-bar .tool-row { align-items: center; }
.lp-sheet { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 26px; }
.lp-head { border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 16px; }
.lp-title { font-size: 1.3rem; font-weight: 700; }
.lp-meta { color: var(--muted); }
.lp-name { margin-top: 10px; }
.lp-line { display: inline-block; min-width: 55mm; height: 1.2em; border-bottom: 1px solid var(--text); vertical-align: bottom; margin: 0 6px; }
.lp-line-name { min-width: 80mm; }
.lp-q { margin: 0 0 20px; break-inside: avoid; }
.lp-qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lp-qhead h2 { margin: 0 0 6px; font-size: 1.1rem; }
.lp-marks { font-weight: 400; }
.lp-calc { font-size: .85rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.lp-qmeta { color: var(--muted); font-size: .85rem; margin: 0 0 6px; }
.lp-stem, .lp-q .figure, .lp-table-wrap { margin: 0 0 10px; }
.lp-q .figure svg, .lp-q .figure img { max-width: 100%; height: auto; }
.lp-table { border-collapse: collapse; }
.lp-table th, .lp-table td { border: 1px solid var(--text); padding: 3px 9px; text-align: center; }
.lp-part { margin: 0 0 14px; break-inside: avoid; }
.lp-part-head { display: flex; gap: 8px; align-items: baseline; }
.lp-part-label { font-weight: 700; }
.lp-prompt { flex: 1; }
.lesson-notes p { margin: 4px 0 0; }
.lp-options { margin: 4px 0 0 26px; padding: 0; list-style: upper-alpha; }
.lp-answer, .lp-key, .lp-got { margin: 8px 0 0 26px; }
.lp-resp { font-family: var(--mono); font-weight: 700; margin: 0 8px; }
.lp-mark { border: 1px solid var(--text); border-radius: 6px; padding: 0 8px; white-space: nowrap; }
.lp-total { font-size: 1.1rem; font-weight: 700; margin-top: 6px; }
.as-sheet { break-before: page; margin-top: 24px; }
.as-title { margin: 0 0 8px; }
.as-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.as-table th { text-align: left; border-bottom: 2px solid var(--text); padding: 4px 8px; }
.as-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; break-inside: avoid; }
.as-n { width: 28mm; font-weight: 700; }
.as-line { min-width: 70mm; }
.as-choices span { display: inline-block; width: 1.8em; height: 1.8em; line-height: 1.8em; text-align: center; border: 1px solid var(--text); border-radius: 50%; margin-right: 8px; }
.lp-key { padding: 4px 8px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.lp-work { position: relative; margin: 8px 0 0 26px; border: 1px dashed var(--muted); border-radius: 4px; height: 24mm; }
.lp-work span { position: absolute; top: 2px; left: 6px; font-size: .75rem; color: var(--muted); }
.lp-work-1 { height: 18mm; } .lp-work-2 { height: 26mm; } .lp-work-3 { height: 34mm; }
.lp-work-4 { height: 42mm; } .lp-work-5 { height: 50mm; } .lp-work-6 { height: 58mm; }
.lp-note { margin: 0 0 22px; }
.lp-note + .lp-note { break-before: page; }
.lp-note h2 { font-size: 1.15rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
@media print {
  .lp-sheet { border: 0; border-radius: 0; padding: 0; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 1.5; }
  .lp-sheet, .lp-sheet * { color: #000 !important; }
  .lp-key { background: transparent; border-left-color: #000; }
  .lp-work-lab, .lp-work span { color: #555 !important; }
  .lp-q + .lp-q { margin-top: 6pt; }
}

/* ---- printed topic notes: title, name line, navy section headings, shaded formula bands, tables (A4) */
.lp-notes .lp-title { font-size: 1.6rem; color: var(--accent); }
.lp-notes .lp-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 6px; }
.lp-notes .lp-note { margin: 0; }
.lp-notes .lp-note h3 { color: var(--accent); font-size: 1.25rem; margin: 1.3rem 0 .45rem; }
.lp-notes .lp-note h4 { color: var(--accent); }
.lp-notes .lp-note-title { font-size: 1.6rem; color: var(--accent); border-bottom: 0; margin: 0 0 .2rem; }
.lp-notes .lp-note p { margin: .35rem 0; }
.lp-notes .lp-note ul, .lp-notes .lp-note ol { margin: .25rem 0 .5rem; }
@media print {
  .lp-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lp-notes { font-size: 10.5pt; line-height: 1.45; }
  .lp-notes .lp-title, .lp-notes .lp-note-title { font-size: 21pt; line-height: 1.2; }
  .lp-notes .lp-meta { font-size: 9pt; }
  .lp-notes .lp-name { margin: 8pt 0 2pt; }
  .lp-sheet .lp-note h3 { color: #1f3a5f !important; font-size: 14.5pt; margin: 15pt 0 5pt; }
  .lp-sheet .lp-note h4 { color: #1f3a5f !important; font-size: 10.5pt; margin: 10pt 0 3pt; }
  .lp-sheet .lp-title, .lp-sheet .lp-note-title { color: #1f3a5f !important; }
  .lp-sheet .lp-note h3, .lp-sheet .lp-note h4, .lp-sheet .lp-note h3 + p { break-after: avoid; }
  .lp-sheet .lp-note p:has(+ .fm), .lp-sheet .lp-note p:has(+ .nt-wrap), .lp-sheet .lp-note p:has(+ .callout) { break-after: avoid; }
  .lp-sheet .lp-note ul, .lp-sheet .lp-note ol { padding-left: 14pt; }
  .lp-sheet .lp-note li { margin: 2pt 0; }
  .lp-sheet .fm { background: #eaeff7; margin: 5pt 0; padding: 3pt 10pt; border-radius: 0; }
  .lp-sheet .nt th, .lp-sheet .nt th * { color: #fff !important; }
  .lp-sheet .nt th { background: #1f3a5f; border-color: #1f3a5f; padding: 4pt 7pt; }
  .lp-sheet .nt td { border-color: #cfd6e2; padding: 4pt 7pt; }
  .lp-sheet .nt tbody tr:nth-child(even) td { background: #eaeff7; }
  .lp-sheet .callout { background: #eaeff7; border-left: 0; border-radius: 0; padding: 4pt 10pt; }
  .lp-sheet .nt-wrap { overflow: visible; }
  .lp-sheet .fm { overflow: visible; }
}

/* ---- schedule editor + proposal (T-0037) */
.replan-banner { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
                 border-left: 4px solid var(--warn); background: var(--warn-soft); }
.replan-banner h3 { margin: 0 0 4px; }
.replan-banner p { margin: 0; }
.replan-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.replan-actions form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; }
.sess { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; background: var(--card); }
.sess-changed { border-left: 4px solid var(--warn); }
.sess-cancelled { opacity: .85; border-style: dashed; }
.sess-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sess-head a { margin-left: auto; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.topic-chip { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line-accent); border-radius: 999px;
              padding: 2px 10px; font-size: .85rem; font-weight: 600; }
.sess-tools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-start; margin-top: 6px; }
.sess-tools .st-more { margin-top: 0; }
.sess-form { margin: 8px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.st-more-add { margin-top: 14px; }
.pst-new { background: var(--good-soft); color: var(--good); }
.pst-changed { background: var(--warn-soft); color: var(--warn); }
.pst-same { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.prop-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.proposal-table td { vertical-align: top; }
.proposal-table tr.prop-new td { background: var(--good-soft); }
.proposal-table tr.prop-changed td { background: var(--warn-soft); }
.proposal-table input[type=date], .proposal-table select { width: 100%; min-width: 130px; font: inherit; font-size: .95rem; padding: 6px 8px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.prop-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

/* ---- calendars (calendar.js): Month / Week views, drag and drop edit mode */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav, .cal-tools { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.cal-title { margin: 0; font-size: 1.15rem; flex: 1; text-align: center; min-width: 150px; }
.cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .85rem; }
.cal-month { min-width: 560px; }
.cal-table th { padding: 6px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
                font-weight: 600; border-bottom: 1px solid var(--line); text-align: left; }
.cal-cell { vertical-align: top; border: 1px solid var(--line); padding: 4px; height: 104px; background: var(--card); }
.cal-day { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.cal-num { font-weight: 700; }
.cal-mon { font-size: .72rem; color: var(--muted); }
.cal-today { background: var(--accent-soft); }
.cal-today .cal-num { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; }
.cal-past { background: var(--bg); }
.cal-other { opacity: .55; }
.cal-items { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.cal-chip { display: block; width: 100%; text-align: left; font: inherit; font-size: .78rem; font-weight: 600; padding: 2px 6px;
            border-radius: 6px; border: 1px solid var(--line-accent); background: var(--accent-soft); color: var(--accent);
            text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-chip:hover { border-color: var(--accent); }
.cal-chip.cal-s-in_progress { background: var(--good-soft); border-color: var(--line-good); color: var(--good); }
.cal-chip.cal-s-done { background: var(--bg); border-color: var(--line); color: var(--muted); }
.cal-chip.cal-s-cancelled { background: var(--bad-soft); border-color: var(--line-bad); color: var(--bad); text-decoration: line-through; cursor: default; }
.cal-topics { display: block; font-weight: 400; font-size: .74rem; }
.cal-pin { font-size: .7rem; }
.cal-grip { opacity: .6; letter-spacing: -2px; }
.cal-drag { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }   /* dragged with pointer events */
.cal-float { opacity: .92; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); cursor: grabbing; border-color: var(--accent); }
.cal-editing .cal-chip:not(.cal-drag) { opacity: .7; }
.cal-selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.cal-dragging { opacity: .4; }
.cal-drop.cal-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.cal-more { font: inherit; font-size: .74rem; color: var(--accent); background: none; border: 0; padding: 0 2px; text-align: left; cursor: pointer; text-decoration: underline; }
.cal-hint { margin: 6px 0; font-size: .88rem; color: var(--muted); }
.cal-legend { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.cal-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-accent); background: var(--accent-soft); vertical-align: -1px; }
.cal-key.cal-s-in_progress { background: var(--good-soft); border-color: var(--line-good); }
.cal-key.cal-s-done { background: var(--bg); border-color: var(--line); }
.cal-key.cal-s-cancelled { background: var(--bad-soft); border-color: var(--line-bad); }
.cal-status { min-height: 1.3em; margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.cal-notice { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 8px; margin-top: 10px; }
/* the calendar's "Moved ... Undo" / "Added ..." / "Deleted ..." notice floats at the bottom of the screen where the tutor is looking,
   not under the 13-hour grid (audit P-07); it stays until the next action or Close */
#cal-root .cal-notice { position: fixed; z-index: 1100; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
                        box-sizing: border-box; margin: 0; padding: 12px 40px 12px 14px; border: 1px solid var(--line-warn); border-left: 4px solid var(--warn);
                        background: linear-gradient(var(--warn-soft), var(--warn-soft)), var(--card); border-radius: 10px;
                        box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
#cal-root .cal-notice-x { position: absolute; top: 6px; right: 6px; min-width: 32px; min-height: 32px; padding: 0; }
@media (max-width: 640px) { #cal-root .cal-notice, .cal-confirm { left: 12px; right: 84px; width: auto; transform: none; bottom: 12px; } }
.cal-notice p { margin: 0 0 8px; }
.cal-notice-actions, .cal-notice-actions form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.st-list-view { margin: 8px 0 12px; }
@media (max-width: 640px) {
  .cal-month .cal-cell { height: 84px; padding: 2px; }
  .cal-month .cal-chip { font-size: .68rem; padding: 1px 3px; }
}

/* ---- hour grid (Week / Day) with times of day */
.tg { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); }
.tg-week { min-width: 700px; }
.tg-corner, .tg-label { font-size: .7rem; color: var(--muted); padding: 6px 4px 0; }
.tg-head { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line); background: var(--card); }
.tg-head.cal-today { background: var(--accent-soft); }
.tg-daybtn { font: inherit; font-size: .85rem; font-weight: 700; background: none; border: 0; color: var(--text); cursor: pointer;
             text-decoration: underline dotted; padding: 2px 4px; }
.tg-untimed.cal-cell { height: auto; min-height: 36px; padding: 3px; display: flex; flex-direction: column; gap: 3px; }
.tg-gutter { position: relative; }
.tg-hour { position: absolute; left: 0; right: 6px; transform: translateY(-.6em); font-size: .7rem; color: var(--muted);
           text-align: right; font-variant-numeric: tabular-nums; }
.tg-col.cal-cell { position: relative; padding: 0; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, var(--line) 63px, var(--line) 64px); }
.tg-col.cal-today { background-color: var(--accent-soft); }
.tg-col.cal-past { background-color: var(--bg); }
.cal-block { position: absolute; overflow: hidden; white-space: normal; padding: 2px 5px; line-height: 1.2; box-sizing: border-box; width: auto; }
.cal-block .cal-topics { margin-top: 1px; }
.tg-ghost { position: absolute; left: 2px; right: 2px; z-index: 3; border: 2px dashed var(--accent); border-radius: 6px; background: var(--accent-soft);
            color: var(--accent); font-size: .75rem; font-weight: 700; padding: 1px 5px; pointer-events: none; box-sizing: border-box; }
.cal-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-selbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line-accent);
              background: var(--accent-soft); border-radius: 8px; }
.cal-selbar label { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; }
.cal-selbar input, .cal-selbar select { font: inherit; font-size: .95rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); }
.cal-warn { color: var(--warn); font-weight: 600; }
/* Add class form + "this class or all future classes" question */
.cal-add { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--line-accent);
           background: var(--accent-soft); border-radius: 8px; }
.cal-add-title { flex: 1 0 100%; }
.cal-add label { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; min-width: 0; }
.cal-add select, .cal-add input { font: inherit; font-size: .95rem; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--card);
                                  color: var(--text); max-width: 100%; }
.cal-add-fixed { align-self: center; font-size: .95rem; }
.cal-add-actions { display: flex; gap: 8px; margin-left: auto; }
.cal-add-note, .cal-add .cal-warn { flex: 1 0 100%; margin: 0; }
/* the question floats over the calendar (bottom centre) so the class stays visible at its new place */
.cal-confirm { position: fixed; z-index: 1100; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
               box-sizing: border-box; border: 1px solid var(--line-accent); border-left: 4px solid var(--accent); background: var(--card);
               padding: 12px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.cal-confirm p { margin: 0 0 8px; }
.cal-chip.cal-waiting { outline: 2px dashed var(--accent); outline-offset: 1px; opacity: .85; }
@media (max-width: 640px) { .cal-add label { flex: 1 0 45%; } .cal-add-actions { margin-left: 0; width: 100%; } }
.sess-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }

/* ---- one-time login QR (tutor: after registering a student, "New login QR code") */
.qr-card { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin: 14px 0; padding: 14px; border: 1px solid var(--line);
           border-radius: 12px; background: var(--card); }
.qr-box { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); line-height: 0; }   /* black on white in every theme */
.qr-box svg { width: 190px; height: 190px; display: block; }
.qr-text { flex: 1; min-width: 220px; }
.qr-text p { margin: 0 0 8px; }
@media print { .qr-card { border: 0; break-inside: avoid; } }
.btn[hidden] { display: none !important; }       /* the Share button stays hidden until the browser can share */
.qr-link { word-break: break-all; font-size: .8rem; }

/* ---- payments (A-0034): a scheduled class is green when paid and red when not (calendars); payment chips on the tutor pages */
.cal-chip.cal-paid { background: var(--good-soft); border-color: var(--line-good); color: var(--good); }
.cal-chip.cal-unpaid { background: var(--bad-soft); border-color: var(--line-bad); color: var(--bad); }
.cal-key.cal-paid { background: var(--good-soft); border-color: var(--line-good); }
.cal-key.cal-unpaid { background: var(--bad-soft); border-color: var(--line-bad); }
.cal-paidmark { font-size: .72rem; }
.pay-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .82rem; font-weight: 700; border: 1px solid var(--line); text-decoration: none; }
.pay-yes { background: var(--good-soft); border-color: var(--line-good); color: var(--good); }
.pay-no { background: var(--bad-soft); border-color: var(--line-bad); color: var(--bad); }
.pay-count { width: 4.6em; font: inherit; padding: 3px 6px; }
.pay-card p { margin: 0 0 8px; }
.pay-table td, .pay-table th { vertical-align: middle; }
/* owed (audit F11): taught, or a charged no-show, and not paid - solid red so it stands apart from "unpaid upcoming" */
.pay-owed { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.cal-chip.cal-owed { background: var(--bad-soft); border: 2px solid var(--bad); color: var(--bad); font-weight: 700; text-decoration: none; }
.cal-key.cal-owed { background: var(--bad-soft); border: 2px solid var(--bad); }
.owed-from { margin: 0 0 14px; }

/* close-out of past classes (audit P-03): Held / No-show (charge?) / Cancelled. The No-show question is a <details>, no script */
.closeout-acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.closeout-acts form { margin: 0; }
.closeout-noshow > summary { list-style: none; cursor: pointer; }
.closeout-noshow > summary::-webkit-details-marker { display: none; }
.closeout-noshow[open] { flex-basis: 100%; order: 3; }           /* the question opens on its own line under the buttons */
.closeout-noshow[open] > summary { border-color: var(--accent); }
.ui-row-closeout .ui-row-end { flex: 0 1 auto; max-width: 100%; }
.closeout-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 10px;
                border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.closeout-card { border-color: var(--line-warn); background: var(--warn-soft); }
.closeout-card p { margin: 0 0 10px; }
.att-held { background: var(--good-soft); color: var(--good); }
.att-no_show_charged, .att-no_show_free { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 520px) { .ui-row-closeout .ui-row-end { padding-left: 0; } }

/* handwriting board (T-0042): the Working out button and the pencil mark on questions that have working */
.board-row { align-items: center; gap: 12px; }
.board-has { margin-left: 6px; font-weight: 700; }
.sq.has-board::before { content: "\270E"; position: absolute; bottom: 1px; left: 4px; font-size: 11px; line-height: 1; }
.board-share { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }

/* Today: "Show all (N)" under the Needs attention list (audit P-09) */
.att-more { margin: 10px 0 0; }

/* Payments on a phone (audit P-06 / X-14): one block per student instead of a 7-column table that scrolled the
   "classes paid" button off a 375 px screen */
@media (max-width: 600px) {
  .pay-table thead { display: none; }
  .pay-table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; width: auto; }
  .pay-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .pay-table td { border: 0; padding: 2px 0; }
  .pay-table td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
  .pay-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
  .pay-table .pay-act .tool-row { margin: 4px 0 0; }
}

/* ---- new school year (audit F1 / P-01): one card per student, works at 375 px */
.ny-row { margin-bottom: 12px; }
.ny-head { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; }
.ny-head h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.ny-grade { font-weight: 600; }
.ny-list { margin: 8px 0 0; padding-left: 18px; }
.ny-list li { margin: 4px 0; overflow-wrap: anywhere; }
.ny-ticks { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; }
.ny-tick { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.ny-tick input { width: 20px; height: 20px; margin: 0; flex: none; }
.ny-course { display: flex; flex-direction: column; }
.ny-course .small { margin-top: -6px; max-width: 32em; }
.ny-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.ny-done-row { padding: 10px 0; border-top: 1px solid var(--line); }
.ny-done-row:first-child { border-top: 0; }
.ny-done-row .ui-row-title { margin-right: 8px; }
.ny-submit { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
