/* SpecPoint: hand in homework online (pilot), student side. Everything here is added by /js/hw-submit.js.
   On screen the printed answer lines are hidden and a textarea takes their place; in print every .hw-ui element
   is hidden and the sheet prints exactly as before. */

.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hw-ui[hidden], .hw-ui [hidden] { display: none !important; }

@media screen {
  .hw-live [data-answer-space], .hw-live .tp-head .tp-fill { display: none; }
}

.hw-box { border: 2px solid var(--leaf); border-radius: 12px; background: #fff; padding: 16px 18px; margin: 0 0 22px; display: grid; gap: 12px; }
.hw-box h2 { font-size: 1.35rem; }
.hw-fields { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .hw-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.hw-field { display: grid; gap: 4px; align-content: start; }
.hw-field label { font-weight: 600; }
.hw-hint { font-size: 0.9rem; color: var(--ink-3); }
.hw-privacy { font-size: 0.9rem; color: var(--ink-2); background: var(--paper); border-radius: 8px; padding: 8px 12px; }
.hw-away-note { font-size: 0.92rem; color: var(--ink); background: var(--paper); border-left: 3px solid var(--ink-3); border-radius: 0 8px 8px 0; padding: 8px 12px; margin: 0; }
.hw-input, .hw-text {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--ink-3); border-radius: 10px; background: #fff;
  font: 400 1rem/1.5 var(--font-body); color: var(--ink);
}
.hw-input { min-height: 46px; }
.hw-code { text-transform: uppercase; letter-spacing: 0.14em; font-family: var(--font-mono); max-width: 14em; }
.hw-input:focus, .hw-text:focus { border-color: var(--leaf); outline: 3px solid var(--leaf-tint); outline-offset: 0; }
.hw-input[aria-invalid="true"] { border-color: var(--red); }
.hw-input[readonly], .hw-text[readonly] { background: var(--paper); border-color: var(--line); color: var(--ink-2); }
.hw-err { color: #8f2a19; font-size: 0.92rem; font-weight: 600; }
.hw-err:empty { display: none; }

.hw-ans { display: grid; }
.hw-text { resize: vertical; min-height: 3.4em; }

.hw-badge { justify-self: end; display: inline-flex; align-items: baseline; gap: 6px; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--leaf-tint); color: var(--leaf-strong); font-size: 0.95rem; }
.hw-badge-k { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.hw-result { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.hw-result-total { font-size: 1.15rem; }
.hw-result-total b { font-size: 1.35rem; color: var(--leaf-strong); }
.hw-comment { background: var(--leaf-tint); border-radius: 10px; padding: 10px 14px; }
.hw-comment-k { font-weight: 600; font-size: 0.9rem; color: var(--leaf-strong); }
.hw-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.hw-end { border: 2px solid var(--leaf); border-radius: 12px; background: #fff; padding: 16px 18px; margin-top: 22px; display: grid; gap: 12px; justify-items: start; }
.hw-end h2 { font-size: 1.35rem; }
.hw-confirm { display: grid; gap: 10px; background: var(--amber-tint); border-radius: 10px; padding: 12px 14px; width: 100%; }
.hw-confirm p { font-weight: 600; }
.hw-confirm p:focus { outline: none; }
.hw-row { display: flex; flex-wrap: wrap; gap: 10px; }
.hw-status:empty { display: none; }
.hw-status { width: 100%; border-radius: 10px; padding: 10px 14px; background: var(--paper); }
.hw-status--ok { background: var(--leaf-tint); color: var(--leaf-strong); font-weight: 600; }
.hw-status--error { background: var(--red-tint); color: #7a2617; font-weight: 600; }
.hw-link { background: none; border: 0; padding: 4px 0; font: 600 1rem var(--font-body); color: var(--leaf); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.hw-link:hover { color: var(--leaf-strong); }
.hw-end .btn[disabled] { opacity: 0.55; cursor: progress; }

@media print {
  .hw-ui { display: none !important; }
}

/* Model answers held back until the student has handed in (boxes marked data-ms-for). Hidden on screen only, and
   kept closed by hw-submit.js, so in print they show as the same closed boxes as before. */
@media screen { .hw-ms-hidden { display: none !important; } }
.hw-ms-note { margin: 0 0 10px; font-size: 0.95rem; color: var(--ink-3); font-style: italic; }
.hw-ms-note--on { font-style: normal; font-weight: 600; color: var(--leaf-strong); }
.hw-reg { font-family: var(--font-mono); letter-spacing: 0.12em; max-width: 8em; }

/* Self-marked work (9 Nov 2026): once the student has finished, a row of marks 0 to max under each part; and the one
   line that stands where the box would be on a page with no hand-in for this visitor */
.hw-self { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--leaf-tint); }
.hw-self-k { font-weight: 600; font-size: 0.92rem; color: var(--leaf-strong); margin-right: 4px; }
.hw-self-b { min-width: 44px; min-height: 44px; padding: 0 8px; border: 1.5px solid var(--leaf-strong); border-radius: 10px; background: #fff; font: 600 1rem var(--font-body); color: var(--leaf-strong); cursor: pointer; }
.hw-self-b[aria-pressed="true"] { background: var(--leaf-strong); color: #fff; }
.hw-self-b[disabled] { cursor: default; opacity: 0.45; }
.hw-self-b[disabled][aria-pressed="true"] { opacity: 1; }
.hw-end .hw-save[disabled] { cursor: not-allowed; }
.hw-off { border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); padding: 12px 16px; margin: 0 0 22px; font-weight: 600; }

/* Photos of handwritten work under a written part (class work, 10 Nov 2026). .hw-ui, so hidden in print. */
.hw-photos { display: grid; gap: 8px; margin: 8px 0 0; }
.hw-photo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.hw-photo-add { min-height: 44px; }
.hw-photo-add[disabled] { opacity: 0.55; cursor: progress; }
.hw-photo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hw-photo-list:empty { display: none; }
.hw-photo { display: grid; justify-items: start; gap: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; max-width: 100%; }
.hw-photo-img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 6px; background: var(--paper); }
.hw-photo-line { font-size: 0.92rem; color: var(--ink-2); }
.hw-photo-rm { min-height: 36px; font-size: 0.92rem; }
.hw-photo-msg { font-size: 0.92rem; border-radius: 8px; }
.hw-photo-msg:empty { display: none; }
.hw-photo-msg.hw-status--ok, .hw-photo-msg.hw-status--error { padding: 6px 10px; }

/* The line under the tools that says why "Show all answers" opens nothing yet: room before the note below it (the two
   overlapped on a phone; Ego, 9 Nov 2026) */
#lp-all-note { margin: 6px 0 22px; }

/* A test's mark scheme, opened for the student after marking and the due date (F20, js/hw-submit.js): the row without
   its question number, so the answer column must wrap (test.css keeps a first column on one line) */
.hw-ms-test .ms-table td:first-child { white-space: normal; font-weight: inherit; }
.hw-ms-test .ms-table { margin: 0; }

/* "Set as homework" for a signed-in teacher, at the top of a homework page (Laura, 12 Nov 2026) */
.hw-setbar { margin: 10px 0 18px; }
.hw-setpanel { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line, #ddd5c2); border-radius: 10px; background: #fff; }
.hw-setpanel p { margin: 0 0 10px; }
.hw-setpanel label { font-weight: 600; }
.hw-setpanel select, .hw-setpanel input[type="date"] { font: inherit; padding: 6px 8px; border: 1px solid var(--line, #ddd5c2); border-radius: 8px; }
.hw-hint--ok { color: #3B6255; }
.hw-hint--error { color: #9b4a45; }
@media print { .hw-setbar { display: none !important; } }
