/* R5 — Give feedback wizard (GiveFeedbackWizard in pages/manage_teachers.rs,
   + the /feedback/:walkId page in pages/give_feedback.rs; prototype ?page=feedback).
   The wizard renders inline on /feedback/:walkId (.fb-inline) and in a modal
   on the oversight pages (.fb-modal, a paper surface). Steps are torn labels
   (.tl-steps / .tl-stepl); the Write step is two columns: the feedback on a
   ruled, taped white card + the current step (Done / Keep) on the left,
   "Your notes" (＋ rows) + "Your judgement" (tick boxes) on the right.
   Page classes are prefixed `fb-`. */

/* ── page wrapper ─────────────────────────────────────────────────────── */
.fb-page { padding-bottom: 56px; }
.fb-page-msg { margin-top: 24px; }
.fb-page-card { max-width: 620px; margin-top: 28px; font-size: 15px; }
.fb-page-card p { margin: 0 0 8px; }
.fb-page-card p:last-child { margin-bottom: 0; }
.fb-page-link a { color: var(--tl-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── modal surface (oversight pages) ─────────────────────────────────── */
.modal-overlay.fb-overlay { background: rgba(29,36,72,.5); }
.modal.fb-modal {
    width: min(1120px, 100%); max-height: 90vh; color: var(--tl-ink);
    background: var(--tl-paper); border: 0; border-radius: 4px; padding: 6px 32px 28px;
    box-shadow: 0 24px 48px -18px rgba(29,36,72,.65);
}
.fb-modal .tl-ph { margin-top: 18px; }
/* Paper on paper: lift the labels and paper cards inside the modal. */
.fb-modal .tl-label, .fb-modal .tl-stepl:not(.on) { background: var(--tl-white); }
.fb-modal .tl-card:not(.white) { background: #f3eee2; }
@media (max-width: 640px) {
    .modal.fb-modal { padding: 4px 16px 24px; border-radius: 0; box-shadow: none; }
}

/* ── shared bits ──────────────────────────────────────────────────────── */
.fb-wiz { color: var(--tl-ink); }
ol.fb-steps { list-style: none; padding: 0; }
.fb-q { font: 500 22px/1.3 var(--tl-font-body); letter-spacing: -.01em; margin: 0 0 6px; color: var(--tl-ink); }
.fb-sub { font-size: 14.5px; line-height: 1.45; opacity: .72; margin: 0 0 12px; }
.fb-note { font-size: 14.5px; line-height: 1.45; margin: 0 0 12px; padding: 10px 12px; background: #eef5f4; border-left: 3px solid var(--tl-teal); }
.fb-err { margin: 10px 0 0; font-size: 14px; }
.fb-card { max-width: 760px; }
.fb-acts { justify-content: flex-end; margin-top: 0; }
.fb-acts .btn { min-width: 104px; justify-content: center; }

/* Visually hidden, still announced + focusable (real checkboxes behind .tl-box). */
.fb-sr, .fb-q-sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.fb-sr { opacity: 0; }
label.fb-check, label.tl-toggle { position: relative; }
.fb-sr:focus-visible + .tl-box { outline: 3px dashed var(--tl-coral); outline-offset: 2px; }
.fb-sr:checked + .tl-box { color: var(--tl-ink); }
.fb-check strong { font-weight: 600; }

/* Choice cards (Delivery / Target / Basis). */
.fb-choices { display: grid; gap: 12px; }
.fb-choices > .fb-q { margin-bottom: 0; }
.fb-choice {
    display: block; width: 100%; text-align: left; cursor: pointer;
    background: var(--tl-white); color: var(--tl-ink); border: 1.5px solid var(--tl-ink); border-radius: 4px;
    padding: 14px 16px; font: inherit; line-height: 1.35;
}
.fb-choice:hover { background: #fffdf6; }
.fb-choice.on { background: #eef5f4; box-shadow: inset 0 0 0 2px var(--tl-teal); }
.fb-choice b { display: block; font-weight: 600; font-size: 16px; margin-bottom: 3px; }
.fb-choice span { display: block; font-size: 14px; opacity: .72; }
.fb-pick { margin: 0; padding: 12px 14px 14px; background: #fffdf6; border-left: 4px solid var(--tl-mustard); }

/* ── Write ───────────────────────────────────────────────────────────── */
.fb-cols.tl-cols { margin-top: 6px; gap: 28px; }
.fb-col { min-width: 0; }
.fb-ref.tl-card { padding: 22px 26px; font-size: 14.5px; }
.fb-letter-card .tl-k { cursor: text; }
textarea.tl-ruled.fb-comment { min-height: 204px; }
.fb-rated { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.fb-rated-k { font-size: 12.5px; opacity: .7; }

.fb-current { margin-bottom: 16px; }
.fb-step-text { font-size: 15px; line-height: 1.5; margin: 0; }
.fb-step-text .tl-stamp { margin-left: 4px; vertical-align: 2px; }
.fb-step-card label.fb-check { margin: 4px 0 12px; }
.fb-newstep { margin: 0 0 4px; }
.fb-slots { font-size: 14.5px; }
.fb-slots p { margin: 4px 0 8px; line-height: 1.45; }
.fb-slots p:last-child { margin-bottom: 0; }
.fb-slots label.fb-check { margin: 8px 0; }

/* "Your notes": ＋ rows grouped under small kickers. */
.fb-k-hint { font: 400 12px/1.2 var(--tl-font-body); text-transform: none; letter-spacing: 0; color: var(--tl-ink); opacity: .7; }
.fb-notes-sub { font-size: 13px; line-height: 1.4; opacity: .65; margin: -4px 0 6px; }
.fb-group { margin-top: 10px; }
.fb-group-k {
    display: block; margin: 4px 0 2px; font: 600 11px/1.2 var(--tl-font-body);
    text-transform: uppercase; letter-spacing: .1em; opacity: .55;
}
.fb-frag-t { flex: 1; min-width: 0; line-height: 1.4; overflow-wrap: anywhere; }
.fb-frag .tl-plus { line-height: 1.3; }
.fb-frag .tl-plus:hover { background: var(--tl-mustard); }
.fb-frag.is-in .fb-frag-t { color: var(--tl-teal); }
.fb-frag.is-in .tl-plus { background: var(--tl-teal); border-color: var(--tl-teal); color: var(--tl-white); }
.fb-rchips { margin-top: 6px; }
.fb-rchips .tl-chip { font-size: 13px; text-align: left; }

/* "Your judgement — private unless you share it". */
.fb-judge-hand.tl-hand { padding: 0 0 4px; margin-top: -6px; font-size: 20px; }
label.tl-toggle { margin: 0; font-weight: 400; color: inherit; cursor: pointer; white-space: nowrap; }
.fb-judge .tl-share { flex-wrap: wrap; }

/* ── Confirm ─────────────────────────────────────────────────────────── */
.fb-confirm.tl-cols { margin-top: 6px; }
.fb-confirm .fb-card { max-width: none; }
.fb-shared ul { margin: 6px 0 4px; padding-left: 1.2em; font-size: 14.5px; line-height: 1.45; }
.fb-shared .fb-sub { margin: 4px 0 0; }
.fb-preview-k { margin: 0 0 12px; }
.fb-preview.tl-letter { margin-top: 0; margin-bottom: 32px; }
.fb-preview-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.fb-preview-from.tl-from { margin: 0 0 0 auto; font-size: 21px; }
.fb-preview-body { white-space: pre-wrap; }
.fb-preview-step.tl-stepbox { margin-top: 22px; }
.tl-letter .fb-preview-step p { line-height: 1.5; }

/* ── mobile: single column ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .fb-page { padding: 0 16px 40px; }
    .fb-wiz .tl-card { padding: 22px 18px 20px; margin-bottom: 24px; }
    .fb-wiz .tl-choose { grid-template-columns: 1fr; }
    .fb-wiz .tl-steps { gap: 6px; }
    .fb-wiz .tl-stepl { font-size: 13px; padding: 7px 11px 8px; }
    .fb-acts .btn { flex: 1; }
}
