/* coursework area styles (wave 3, coursework builder). Use app.css tokens; keep the restrained house style. */

/* typed work */
.cw-rich { font-size: 14.5px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.cw-rich p { margin: 0 0 10px; }
.cw-rich h4 { font-size: 15px; margin: 14px 0 6px; }
.cw-rich ul, .cw-rich ol { margin: 0 0 10px; padding-left: 22px; }
.cw-brief { white-space: pre-line; margin-top: 6px; max-width: 72ch; }
.cw-editor .cw-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.cw-editor .cw-tools .btn { min-width: 32px; justify-content: center; }
.cw-preview { min-height: 160px; max-height: 420px; overflow: auto; }
.cw-h { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.cw-sub { margin: 14px 0 6px; color: var(--ink-2); }
.cw-more { margin-top: 12px; }
.cw-more summary { cursor: pointer; color: var(--ink-2); width: fit-content; }
.cw-rules { margin: 8px 0 10px; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 4px; }

/* assignment card (student) */
.cw-acard .cw-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.cw-result { display: flex; align-items: center; gap: 10px; }
.cw-result b { font-size: 22px; font-weight: 600; }
@media (max-width: 680px) { .cw-acard .cw-aside { align-items: flex-start; text-align: left; width: 100%; } .cw-acard .cw-aside .btn-row { justify-content: flex-start !important; } }

/* rubric */
.cw-rubric { display: grid; gap: 12px; }
.cw-band { border: 0; padding: 0; margin: 0; min-width: 0; }
.cw-band-k { display: inline-block; font: 650 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; padding: 0; }
.cw-band ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cw-band li { display: flex; gap: 8px; font-size: 13.5px; align-items: baseline; }
.cw-band li b, .cw-check .check b { font-variant-numeric: tabular-nums; min-width: 24px; }
.cw-band li.met { color: var(--ink); }
.cw-tick { display: inline-flex; flex: none; color: var(--ink-3); position: relative; top: 2px; }
.cw-band li.met .cw-tick, .cw-tick.ok { color: var(--ok); }
.cw-check .check { align-items: flex-start; font-size: 13.5px; padding: 6px 0; }
.cw-check .check input { margin-top: 2px; flex: none; }
.cw-rubric-ed .cw-rrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 220px) 32px; gap: 8px; align-items: center; }
@media (max-width: 680px) { .cw-rubric-ed .cw-rrow { grid-template-columns: 64px minmax(0, 1fr) 32px; } .cw-rubric-ed .cw-rrow [data-ro] { grid-column: 1 / -1; grid-row: 2; } }
.cw-grade { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.cw-grade .k { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cw-reasons { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 3px; }

/* marking layout */
.cw-mark-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 16px; align-items: start; margin-top: 16px; }
.cw-side { position: sticky; top: calc(var(--topbar) + 12px); }
@media (max-width: 1080px) { .cw-mark-layout { grid-template-columns: minmax(0, 1fr); } .cw-side { position: static; } }
.cw-2 { align-items: start; }
@media (max-width: 860px) { .grid.c2.cw-2, .grid.c3.cw-3 { grid-template-columns: minmax(0, 1fr); } }
.cw-hist summary { cursor: pointer; }
.cw-scroll { max-height: 320px; overflow: auto; }

/* versions, files, evidence */
.cw-versions { display: grid; gap: 8px; }
.cw-version, .cw-mark { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.cw-version > summary, .cw-mark > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; cursor: pointer; list-style: none; }
.cw-version > summary::-webkit-details-marker, .cw-mark > summary::-webkit-details-marker { display: none; }
.cw-version > summary .grow { flex: 1; }
.cw-version-body, .cw-mark > :not(summary) { padding: 0 12px 12px; }
.cw-marks { display: grid; gap: 8px; }
.cw-feedback { margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13.5px; white-space: pre-line; }
.cw-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cw-file { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; color: var(--ink); text-decoration: none; background: var(--surface); }
.cw-file span:not(.tiny) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
a.cw-file:hover { border-color: var(--line-2); background: var(--surface-2); }
.cw-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.cw-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); display: block; }
.cw-video { width: 100%; max-height: 360px; border-radius: var(--r); background: #000; margin-top: 8px; }
.cw-evidence { display: grid; gap: 10px; margin-top: 8px; }
.cw-ev-slot > .tiny { display: block; }
.cw-lrow { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; }
.cw-audio { display: grid; gap: 4px; }
.cw-audio audio, .cw-rec audio { width: 100%; height: 36px; }

/* audio recorder */
.cw-rec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cw-rec[data-state="review"] { flex-direction: column; align-items: stretch; }
.cw-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }

/* similarity */
.cw-simscore { display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--r-lg); background: var(--surface-2); min-width: 150px; }
.cw-simscore b { font-size: 26px; font-weight: 650; }
.cw-simscore.mid { background: var(--warn-tint); color: var(--warn); }
.cw-simscore.hi { background: var(--bad-tint); color: var(--bad); }
.cw-sim { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 860px) { .cw-sim { grid-template-columns: minmax(0, 1fr); } }
.cw-sim-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.7; max-height: 60vh; overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.cw-sim mark, .cw-swatch { --m: var(--sky); background: var(--m); color: inherit; border-radius: 3px; padding: 0 1px; cursor: pointer; }
.cw-sim mark.s0, .cw-swatch.s0 { --m: color-mix(in srgb, var(--bad) 22%, transparent); }
.cw-sim mark.s1, .cw-swatch.s1 { --m: color-mix(in srgb, var(--info) 24%, transparent); }
.cw-sim mark.s2, .cw-swatch.s2 { --m: color-mix(in srgb, var(--warn) 30%, transparent); }
.cw-sim mark.s3, .cw-swatch.s3 { --m: color-mix(in srgb, var(--ok) 26%, transparent); }
.cw-sim mark.s4, .cw-swatch.s4 { --m: var(--lilac); }
.cw-sim mark.s5, .cw-swatch.s5 { --m: var(--peach); }
.cw-sim mark.own, .cw-swatch.own { --m: transparent; outline: 1px dashed var(--line-2); }
.cw-sim-text mark:not(.on) { opacity: .5; }
.cw-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; padding: 0; }
.cw-src { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; border-radius: 0; }
.cw-src.on { background: var(--surface-2); }
.cw-src .main b { white-space: normal; }
.cw-passages { max-height: 46vh; overflow: auto; }
.cw-passage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.cw-passage p { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 680px) { .cw-passage { grid-template-columns: minmax(0, 1fr); } }

/* projects */
.cw-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; counter-reset: none; }
.cw-steps li { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cw-steps li > span:last-child { display: grid; min-width: 0; }
.cw-steps li b { font-size: 13px; font-weight: 600; }
.cw-steps li .tiny { color: var(--ink-3); }
.cw-steps .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 650 11.5px/1 var(--font-ui); background: var(--surface-3); color: var(--ink-2); }
.cw-steps .st-approved .dot { background: var(--ink); color: var(--bg); }
.cw-steps .st-submitted { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.cw-steps .st-changes { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
@media (max-width: 680px) { .cw-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cw-pcard, .cw-spcard { text-decoration: none; color: inherit; display: grid; gap: 10px; }
.cw-ptitle { font-weight: 600; font-size: 15px; }
.cw-pbar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.cw-pbar span { min-width: 0; }
.cw-pbar .seg-proposal { background: color-mix(in srgb, var(--ink) 25%, transparent); }
.cw-pbar .seg-progress { background: color-mix(in srgb, var(--ink) 45%, transparent); }
.cw-pbar .seg-final { background: color-mix(in srgb, var(--ink) 70%, transparent); }
.cw-pbar .seg-marked { background: var(--ink); }
.cw-slotrow { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto auto auto auto 32px; gap: 8px; align-items: center; }
.cw-slotrow .check { font-size: 12.5px; white-space: nowrap; }
@media (max-width: 860px) {
  .cw-slotrow { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .cw-slotrow [data-sl] { flex: 1 1 calc(100% - 46px); min-width: 0; }
  .cw-slotrow [data-st] { flex: 1 1 100%; min-width: 0; order: 2; }
  .cw-slotrow .check { order: 3; }
}
.chip.cw-wrap { height: auto; min-height: 22px; white-space: normal; padding-block: 3px; }
.cw-score { display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
@media (max-width: 680px) { .cw-score { grid-template-columns: minmax(0, 1fr) 72px; } .cw-score input[name^="comment"] { grid-column: 1 / -1; } }

/* practicals */
.cw-slot { display: grid; gap: 8px; text-decoration: none; color: inherit; text-align: left; font: inherit; cursor: pointer; align-content: start; min-height: 120px; }
.cw-slot.empty { border-style: dashed; background: transparent; color: var(--ink-2); }
.cw-slot.empty:hover, a.cw-slot:hover { border-color: var(--line-2); }
.cw-pgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .cw-pgrid { grid-template-columns: minmax(0, 1fr); } }
.cw-checklist { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.cw-checklist.plain { list-style: none; padding-left: 0; }
.cw-checklist.plain li { display: flex; gap: 8px; }
.cw-pev { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cw-pev-item { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); display: grid; }
.cw-pev-item img, .cw-pev-item video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.cw-pev-item .cw-file { margin: 8px; }
.cw-pev-item figcaption { display: grid; gap: 2px; padding: 8px 10px; }
.cw-pev-item figcaption .btn { justify-self: start; margin-top: 4px; }
.cw-upload { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cw-upload .input { flex: 1; min-width: 160px; }

/* fieldsets used as plain groups */
fieldset.cw-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.cw-fs > legend { padding: 0; margin-bottom: 6px; }
