/* ==========================================================================
   Photon Academy, Worksheet Studio 2026 (/worksheet-studio/)
   One stylesheet for the whole page. It loads after css/site-2026-app.css and uses that file's tokens:
   --ink --ink2 --mute --navy --gold --goldt --line --chalk --canvas --ok --okbg --bad --warnbg --blue
   --r --ctl --hair --sh --fu --fd and the shell geometry --psh-top --psh-rail --psh-bottom.

   Rules of the road (plan/DOM_CONTRACT.md)
   - Every selector sits under a ws- class, so nothing leaks onto the shell.
   - Blocks ws-card, ws-pop, ws-row. Parts ws-card__meta. Variants ws-btn--gold.
   - States are attributes first (aria-pressed, aria-expanded, aria-current, hidden, disabled), then is-* classes.
   - body.app26 strips every <button> (no background, border or padding, text-align left) and every <a>
     (colour inherited, no underline). Those resets have zero specificity, so a ws- class always wins,
     but it also means each button and link here has to carry its own class.
   - Instrument Sans has weights 400, 500 and 600 only. Titles are Fraunces at 400.
   - Scripts hook on ids and data-act, never on a class from this file.

   0  Atoms          shared pieces used on every screen
   1  Frame          page bar, panes, bottom bar, Download menu, My worksheets drawer, one panel per step and mode, responsive rules
   2  Start screen
   3  Pick screen    type-it row, pickers, result bar and chips, result cards
   4  Panels         Subject, Topic, Source, More filters
   5  Type-it screen
   6  Layout step
   7  Assign step
   8  Right pane and side by side
   9  Additions to sections 0 to 4, written with the views
   ========================================================================== */


/* ==========================================================================
   0 Atoms
   Atom index
     ws-k          small capital label            ws-ic      16px line icon
     ws-btn        button: --dark --line --gold --quiet --sm --xs --icon
     ws-input      text box (also a wrapper with an icon): --num --yr, .is-set
     ws-field      label over a control           ws-select  button that looks like a select
     ws-anchor     box a panel or menu hangs from ws-check   tick box row, ws-check__t / __n / __sub
     ws-radio-card ws-seg   segmented buttons (aria-pressed): --sm --xs
     ws-opt        toggle button in a wrapping row (aria-pressed): --sm --lg, inside ws-opts
     ws-chip       removable chip: --lg --accent  ws-tag    status chip: --ok --warn --plain --info --dark --sm
     ws-pop        panel under a control: __head __body __foot __sum __acts __grp __sec __note
     ws-menu       list of actions: --up --down, __item __t __s __sq __rule
     ws-tile       gold question number: --sm     ws-link    navy link with a gold underline
     ws-note       status row with an icon: --ok --warn --plain, inside ws-notes
     ws-bars       Topics / Level / Source mix bars, colours ws-hue-1..5
     ws-empty      empty state                    ws-toast   message at the bottom (core.js)
     ws-q          box a rendered question or mark scheme goes in (--ms)
     ws-ask        type-it box (--lg)             ws-given   given-before label (.is-given)
     ws-scroll     a pane region that scrolls on its own
   ========================================================================== */

.ws-app,
.ws-drawer,
.ws-toast {
  --ws-qink: #1b2333;          /* ink of question text on screen */
  --ws-info: #e8eefb;          /* pale blue tint: default tag, the "for this student" chip */
  --ws-gold-line: #ecdcb6;     /* pale gold hairline on the small paper heads */
  --ws-thumb: #c5cdd9;         /* scroll bar thumb */
  --ws-hue-1: var(--navy);     /* mix bars */
  --ws-hue-2: #b9800a;
  --ws-hue-3: var(--blue);
  --ws-hue-4: #8fa3c4;
  --ws-hue-5: var(--ink);
  --ws-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ws-pop-sh: 0 1px 2px rgba(13, 31, 60, 0.07), 0 8px 22px rgba(13, 31, 60, 0.1);
}

/* ---- ws-k: small capital label ---- */
.ws-k {
  font: 600 10.5px/1 var(--fu);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.ws-k--sm {
  font-size: 10px;
}

/* ---- ws-ic: inline icon, viewBox 0 0 24 24, stroke only ---- */
.ws-ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- ws-btn: ink outline by default; --line hairline; --dark filled; --gold the one primary action; --quiet text only ---- */
.ws-btn {
  --h: var(--ctl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: 500 14px/1 var(--fu);
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.ws-btn:hover {
  background: var(--chalk);
}
.ws-btn--line {
  border-color: var(--line);
}
.ws-btn--line:hover {
  border-color: var(--ink2);
}
.ws-btn--dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}
.ws-btn--dark:hover {
  border-color: var(--navy);
  background: var(--navy);
}
.ws-btn--gold {
  --h: 48px;
  padding: 0 24px;
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
}
.ws-btn--gold:hover {
  border-color: #ffba2e;
  background: #ffba2e;
}
.ws-btn--quiet {
  padding: 0 8px;
  border-color: transparent;
  background: none;
  color: var(--navy);
  font-size: 13.5px;
}
.ws-btn--quiet:hover {
  background: var(--chalk);
}
.ws-btn--sm {
  --h: 36px;
  gap: 6px;
  font-size: 13.5px;
}
.ws-btn--xs {
  --h: 28px;
  gap: 6px;
  padding: 0 10px;
  border-color: var(--ink2);
  font-size: 12.5px;
}
.ws-btn--icon {
  width: var(--h);
  padding: 0;
}
/* a small chevron after the label (menus); it turns over when the button is open */
.ws-chev {
  width: 13px;
  height: 13px;
  color: var(--ink2);
  stroke-width: 2.2;
  transition: transform 0.15s;
}
.ws-btn:has(> .ws-chev:last-child) {
  padding-right: 12px;
}
.ws-btn[aria-expanded="true"] > .ws-chev {
  transform: rotate(180deg);
}
.ws-btn .ws-ic {
  width: 16px;
  height: 16px;
}
.ws-btn--sm .ws-ic {
  width: 14px;
  height: 14px;
}
.ws-btn .ws-chev {
  width: 13px;
  height: 13px;
}
.ws-btn--xs .ws-ic {
  width: 13px;
  height: 13px;
}
.ws-btn:disabled,
.ws-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ---- ws-input: a bare <input class="ws-input">, or a wrapper holding an icon and an <input> ---- */
.ws-input {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--ctl);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: 400 14px/1.2 var(--fu);
}
.ws-input:hover {
  border-color: var(--ink2);
}
.ws-input > input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.ws-input > .ws-ic {
  color: var(--ink2);
}
.ws-input::placeholder,
.ws-input > input::placeholder {
  color: var(--mute);
  opacity: 1;
}
.ws-input--num {
  width: 58px;
  padding: 0 8px;
  text-align: center;
}
.ws-input--yr {
  width: 66px;
}
.ws-input.is-set {
  border-color: var(--ink);
  font-weight: 600;
}

/* ---- ws-field: a label over a control; ws-anchor: the box a panel hangs from ---- */
.ws-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.ws-field__l {
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-anchor {
  position: relative;
  display: inline-flex;
}

/* ---- ws-select: a button that looks like a select and opens a panel ---- */
.ws-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: var(--ctl);
  padding: 0 11px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: 500 14px/1.2 var(--fu);
  text-align: left;
  cursor: pointer;
}
.ws-select:hover {
  border-color: var(--ink2);
}
.ws-select__v {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-select__chev {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: var(--ink2);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}
.ws-select.is-empty {
  color: var(--ink2);
  font-weight: 400;
}
.ws-select[aria-expanded="true"] {
  padding: 0 10px 0 11px;
  border: 2px solid var(--navy);
}
.ws-select[aria-expanded="true"] .ws-select__chev {
  transform: rotate(180deg);
}
.ws-select:disabled,
.ws-select[aria-disabled="true"] {
  cursor: default;
}

/* ---- ws-check: label with a tick box (or a radio) ---- */
.ws-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  cursor: pointer;
}
.ws-check > input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--navy);
  cursor: inherit;
}
.ws-check__t {
  flex: 1;
  min-width: 0;
}
.ws-check__sub {
  font-weight: 400;
  color: var(--ink2);
}
.ws-check__n {
  font-size: 12.5px;
  color: var(--mute);
}
.ws-check:has(> input:disabled) {
  color: var(--mute);
  cursor: default;
}
/* a dimmer label, for the default-on housekeeping choice */
.ws-check--quiet {
  color: var(--ink2);
}
/* a row in a picker panel (Subject, Source, topics): padded, and the ticked or chosen one is bold */
.ws-check--row {
  min-height: 37px;
  padding: 3px 14px;
}
.ws-check--row:has(> input:checked) .ws-check__t,
.ws-tree__topics .ws-check:has(> input:checked) .ws-check__t {
  font-weight: 600;
}

/* ---- ws-radio-card: a choice with a title and a line under it; the chosen one gets a 2px navy edge ---- */
.ws-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  cursor: pointer;
}
.ws-radio-card > input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--navy);
}
.ws-radio-card__t {
  display: block;
  font-weight: 600;
}
.ws-radio-card__d {
  display: block;
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-radio-card:has(> input:checked) {
  padding: 9px 12px;
  border: 2px solid var(--navy);
}

/* ---- ws-seg: segmented buttons, the pressed one is filled ink ---- */
.ws-seg {
  display: inline-flex;
  flex: none;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
}
.ws-seg > button {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: 500 13.5px/1 var(--fu);
  white-space: nowrap;
  cursor: pointer;
}
.ws-seg > button + button {
  border-left: 1px solid var(--line);
}
.ws-seg > button:hover {
  background: var(--chalk);
}
.ws-seg > button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
.ws-seg--sm > button {
  height: 34px;
  padding: 0 11px;
  font-size: 13px;
}
.ws-seg--xs > button {
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
}

/* ---- ws-opt: a toggle button in a wrapping row (Paper, How hard, schools, Start from) ---- */
.ws-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ws-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: 500 13px/1 var(--fu);
  white-space: nowrap;
  cursor: pointer;
}
.ws-opt:hover {
  border-color: var(--ink2);
}
.ws-opt[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.ws-opt__n {
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
}
.ws-opt[aria-pressed="true"] .ws-opt__n {
  color: rgba(255, 255, 255, 0.75);
}
.ws-opt--sm {
  height: 30px;
}
.ws-opt--lg {
  height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
}

/* ---- ws-chip: removable filter chip ---- */
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: 500 12.5px/1 var(--fu);
  white-space: nowrap;
}
.ws-chip__k {
  font: 600 10px/1 var(--fu);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.ws-chip__x {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--ink2);
  cursor: pointer;
}
.ws-chip__x:hover {
  background: var(--chalk);
  color: var(--ink);
}
.ws-chip__x .ws-ic {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
.ws-chip--lg {
  gap: 8px;
  height: 34px;
  font-size: 13.5px;
}
.ws-chip--lg .ws-chip__x {
  width: 24px;
  height: 24px;
}
.ws-chip--accent {
  border-color: var(--navy);
  background: var(--ws-info);
}
.ws-chip--accent .ws-chip__k,
.ws-chip--accent .ws-chip__x {
  color: var(--navy);
}

/* ---- ws-tag: status chip ---- */
.ws-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 8px;
  border: 0;
  border-radius: var(--r);
  font: 600 12px/1.45 var(--fu);
  white-space: nowrap;
}
.ws-tag--ok {
  background: var(--okbg);
  color: var(--ok);
}
.ws-tag--warn {
  background: var(--warnbg);
  color: var(--goldt);
}
.ws-tag--plain {
  border: 1px solid var(--line);
  background: var(--chalk);
  color: var(--ink2);
}
.ws-tag--info {
  background: var(--ws-info);
  color: var(--navy);
}
.ws-tag--dark {
  background: var(--ink);
  color: #fff;
}
.ws-tag--sm {
  height: 18px;
  padding: 0 6px;
  font-size: 10.5px;
  line-height: 1;
  letter-spacing: 0.04em;
}

/* ---- ws-pop: a panel that opens under a control ---- */
.ws-pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  width: 408px;
  max-width: calc(100vw - 32px);
  max-height: min(582px, calc(100dvh - var(--ws-pop-off, 318px)));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--ws-pop-sh);
  overflow: hidden;
}
.ws-pop--tall {
  min-height: min(360px, calc(100dvh - var(--ws-pop-off, 318px)));
}
/* the More filters panel hangs from the result bar, which sits lower than the pickers */
.ws-result .ws-pop {
  --ws-pop-off: 368px;
}
.ws-pop__head {
  flex: none;
  padding: 12px 12px 8px;
}
.ws-pop__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
}
.ws-pop__head + .ws-pop__body {
  border-top: 1px solid var(--line);
}
.ws-pop__foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ws-pop__sum {
  font-size: 13px;
  color: var(--ink2);
}
.ws-pop__sum strong {
  font-weight: 600;
  color: var(--ink);
}
.ws-pop__acts {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.ws-pop__acts .ws-btn--dark {
  padding: 0 13px;
  font-size: 13.5px;
}
.ws-pop__lab {
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-pop__grp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px 0;
}
.ws-pop__grp--rule {
  min-height: 40px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.ws-pop__grp .ws-ic {
  width: 13px;
  height: 13px;
  color: var(--mute);
  stroke-width: 2.2;
}
.ws-pop__sec {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.ws-pop__sec:last-child {
  border-bottom: 0;
}
.ws-pop__sec .ws-k {
  display: block;
  margin-bottom: 8px;
}
.ws-pop__sec--cols {
  display: flex;
  gap: 20px;
}
.ws-pop__sec--cols > div {
  flex: 1;
  min-width: 0;
}
.ws-pop__note {
  margin: 2px 14px 0;
  padding: 8px 0 8px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--mute);
}

/* ---- ws-menu: a list of actions (Download, sort). Hung from a ws-anchor. ---- */
.ws-menu {
  position: absolute;
  z-index: 10;
  right: 0;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 1px 2px rgba(13, 31, 60, 0.07), 0 8px 22px rgba(13, 31, 60, 0.12);
  overflow-y: auto;          /* a menu given less room than it needs (a very short window) scrolls */
}
.ws-menu--up {
  bottom: calc(100% + 8px);
}
.ws-menu--down {
  top: calc(100% + 6px);
  width: 200px;
}
.ws-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 500 14px/1.3 var(--fu);
  text-align: left;
  cursor: pointer;
}
.ws-menu__item:hover {
  background: var(--chalk);
}
.ws-menu__item--two {
  min-height: 48px;
}
.ws-menu__item > .ws-ic {
  margin-left: -4px;
  color: var(--ink2);
}
.ws-menu__item[aria-selected="true"],
.ws-menu__item[aria-checked="true"] {
  font-weight: 600;
}
.ws-menu__item > .ws-ic:last-child:not(:first-child) {
  margin: 0 -2px 0 auto;
  color: var(--navy);
}
.ws-menu__sq {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 1px;
  background: var(--navy);
}
.ws-menu__sq--ok {
  background: var(--ok);
}
.ws-menu__t {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.ws-menu__s {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink2);
}
.ws-menu__rule {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

/* ---- ws-tile: the gold question number ---- */
.ws-tile {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: var(--r);
  background: var(--gold);
  color: var(--ink);
  font: 600 12.5px/1 var(--fu);
}
.ws-tile--sm {
  min-width: 19px;
  height: 19px;
  font-size: 12px;
}

/* ---- ws-link: navy text with a gold underline ---- */
.ws-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 500 13px/1.45 var(--fu);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
  cursor: pointer;
}
.ws-link:hover {
  color: var(--ink);
}

/* ---- ws-note: an inline status row with an icon; ws-notes stacks several in one hairline box ---- */
.ws-notes {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.ws-notes > * + * {
  border-top: 1px solid var(--line);
}
.ws-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
}
.ws-note > .ws-ic {
  margin-top: 2px;
  color: var(--ink2);
}
.ws-note strong {
  font-weight: 600;
}
.ws-note__t {
  flex: 1 1 260px;
  min-width: 0;
}
.ws-note--ok > .ws-ic {
  color: var(--ok);
  stroke-width: 2.2;
}
.ws-note--warn {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 12px;
  background: var(--warnbg);
}
.ws-note--warn > .ws-ic {
  margin-top: 0;
  color: var(--goldt);
}
.ws-note--plain > .ws-ic {
  color: var(--ink2);
}

/* ---- ws-bars: the Topics / Level / Source mix bars. Each segment: style="flex-grow: N" and a ws-hue-N class ---- */
.ws-hue-1 {
  --c: var(--ws-hue-1);
}
.ws-hue-2 {
  --c: var(--ws-hue-2);
}
.ws-hue-3 {
  --c: var(--ws-hue-3);
}
.ws-hue-4 {
  --c: var(--ws-hue-4);
}
.ws-hue-5 {
  --c: var(--ws-hue-5);
}
.ws-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.ws-bars__item {
  flex: 1 1 180px;
  min-width: 0;
}
.ws-bars__bar {
  display: flex;
  height: 6px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.ws-bars__seg {
  flex: 1 1 0;
  min-width: 0;
  background: var(--c, var(--ws-hue-1));
}
.ws-bars__legend {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink2);
}
.ws-bars__key::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 1px;
  background: var(--c, var(--ws-hue-1));
}
.ws-bars__key + .ws-bars__key {
  margin-left: 10px;
}
/* one row per bar: label, bar, legend (the List view of the right pane) */
.ws-bars--row {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
}
.ws-bars--row .ws-bars__item {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-bars--row .ws-k {
  flex: none;
  width: 50px;
}
.ws-bars--row .ws-bars__bar {
  flex: 1;
  height: 8px;
  margin-top: 0;
}
.ws-bars--row .ws-bars__legend {
  flex: none;
  width: 236px;
  margin-top: 0;
  font-size: 12.5px;
}
.ws-bars--row .ws-bars__key::before {
  width: 8px;
  height: 8px;
  margin-right: 5px;
}
.ws-bars--row .ws-bars__key + .ws-bars__key {
  margin-left: 12px;
}

/* ---- ws-empty: an empty state ---- */
.ws-empty {
  padding: 32px 24px;
  color: var(--ink2);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.ws-empty__t {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font: 400 22px/1.2 var(--fd);
}
.ws-empty__p {
  max-width: 420px;
  margin: 0 auto;
  text-wrap: balance;
}

/* ---- ws-toast: the short message core.js puts at the bottom of the screen ---- */
.ws-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--psh-bottom) + 84px);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font: 500 14px/1.4 var(--fu);
  box-shadow: var(--sh);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
}
.ws-toast.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
.ws-toast.is-bad {
  background: var(--bad);
}
.ws-toast-text {
  min-width: 0;
}
.ws-toast-btn {
  flex: none;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #ffba2e;
  font: 600 14px/1.2 var(--fu);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ws-toast-btn:hover {
  color: #fff;
}

/* ---- ws-q: the box a rendered question (or mark scheme, ws-q--ms) is put in.
   The site's own code draws what is inside it; css/question-layout.css lays out parts and marks.
   Only the box is styled here, plus images, tables, KaTeX size and the colour of the mark badge. ---- */
.ws-q {
  min-width: 0;
  color: var(--ws-qink);
  font: 400 var(--ws-qfs, 14.5px)/1.5 var(--ws-serif);
}
.ws-q.is-loading {
  color: var(--ink2);
}
.ws-q img,
.ws-q svg {
  max-width: 100%;
  height: auto;
}
.ws-q table {
  max-width: 100%;
  border-collapse: collapse;
}
.ws-q td,
.ws-q th {
  padding: 3px 8px;
  border: 1px solid var(--line);
}
.ws-q .katex {
  font-size: 1.05em;
}
.ws-q .marks-badge {
  color: var(--ink2);
}
.ws-q--ms .marks-badge {
  color: var(--ink);
  font: 600 10.5px/1 var(--fu);
}

/* ---- ws-ask: the type-it box (Start, Pick and the Type-it screen) ---- */
.ws-ask {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--ink2);
  border-radius: var(--r);
  background: #fff;
}
.ws-ask:has(.ws-ask__in:focus) {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}
.ws-ask__ic {
  width: 18px;
  height: 18px;
  color: var(--ink2);
}
.ws-ask__in {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 400 15px/1.2 var(--fu);
}
.ws-ask__in::placeholder {
  color: var(--mute);
  opacity: 1;
}
.ws-ask .ws-btn {
  --h: 36px;
  padding: 0 15px;
  font-size: 14px;
}
.ws-ask--lg {
  height: 56px;
  padding: 0 8px 0 16px;
}
.ws-ask--lg .ws-ask__in {
  font-size: 16px;
}
.ws-ask--lg .ws-btn {
  --h: 40px;
  padding: 0 17px;
  font-size: 14.5px;
}

/* ---- ws-given: the given-before label on a card or a list row (Never given, Given to Ben, 2 Nov, Given to 3 students) ---- */
.ws-given {
  color: var(--ink2);
}
.ws-given.is-given {
  color: var(--goldt);
  font-weight: 600;
}

/* ---- ws-scroll: a region of a pane that scrolls on its own ---- */
.ws-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
}

/* ---- focus: a 2px navy ring on every control (inside the control where it sits in a clipped box) ---- */
.ws-btn:focus-visible,
.ws-select:focus-visible,
.ws-link:focus-visible,
.ws-chip__x:focus-visible,
.ws-opt:focus-visible,
.ws-check > input:focus-visible,
.ws-radio-card > input:focus-visible,
.ws-input:focus-visible,
.ws-step:focus-visible,
.ws-sort:focus-visible,
.ws-try:focus-visible,
.ws-row:focus-visible,
.ws-card__tool:focus-visible,
.ws-bottom__layout:focus-visible,
.ws-toast-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.ws-input:focus-within {
  outline: 2px solid var(--navy);
  outline-offset: 0;
}
.ws-radio-card:has(> input:focus-visible) {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.ws-seg > button:focus-visible,
.ws-tree__area:focus-visible,
.ws-menu__item:focus-visible,
.ws-card:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}
.ws-seg > button[aria-pressed="true"]:focus-visible {
  outline-color: var(--gold);
}
.ws-ask__in:focus-visible {
  outline: 0;
}


/* ==========================================================================
   1 Frame
   .ws-app fills what the shell leaves. Page bar and bottom bar never shrink; the panes between them each
   scroll on their own. boot.js keeps data-step / data-mode / data-view / data-sbs on #wsApp and this file
   alone decides what shows.
   ========================================================================== */

.ws-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
}

/* ---- page bar: title, the three steps, save status, My worksheets ---- */
.ws-bar {
  flex: none;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 8px 20px 0;
  background: #fff;
}
.ws-bar__title {
  margin: 0 6px 0 0;
  padding-bottom: 7px;
  font: 400 26px/1.15 var(--fd);
  letter-spacing: -0.012em;
}
.ws-steps {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}
.ws-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink2);
  font: 500 14px/1 var(--fu);
  white-space: nowrap;
  cursor: pointer;
}
.ws-step:hover {
  color: var(--ink);
}
.ws-step__n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--chalk);
  color: var(--ink2);
  font: 600 12px/1 var(--fu);
}
.ws-step[aria-current="step"] {
  border-bottom-color: var(--navy);
  color: var(--ink);
  font-weight: 600;
}
.ws-step[aria-current="step"] .ws-step__n {
  border-color: transparent;
  background: var(--ink);
  color: #fff;
}
.ws-bar__tools {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-left: auto;
}
.ws-bar__tools > .ws-btn {
  margin-bottom: 6px;
}
.ws-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 14px;
  color: var(--ok);
  font: 500 12.5px/1.45 var(--fu);
}
.ws-save .ws-ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}
.ws-save__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
}
.ws-save.is-dirty {
  color: var(--goldt);
}
.ws-save.is-busy {
  color: var(--ink2);
}
/* "Not saved yet" and its Save button sit close together */
.ws-save.is-dirty + .ws-btn {
  margin-left: -14px;
}

/* ---- the two panes ---- */
.ws-panes {
  flex: 1;
  min-height: 0;
  display: flex;
  border-top: 1px solid var(--line);
}
.ws-left {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.ws-right {
  flex: none;
  width: 636px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--canvas);
}
.ws-sbs {
  display: none;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  background: var(--canvas);
}

/* one panel per step and mode */
.ws-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.ws-app[data-step="questions"][data-mode="start"] #wsStart,
.ws-app[data-step="questions"][data-mode="pick"] #wsPick,
.ws-app[data-step="questions"][data-mode="ask"] #wsAsk,
.ws-app[data-step="layout"] #wsLayout,
.ws-app[data-step="assign"] #wsAssign {
  display: flex;
}
/* side by side replaces both panes */
.ws-app[data-sbs="1"] .ws-left,
.ws-app[data-sbs="1"] .ws-right {
  display: none;
}
.ws-app[data-sbs="1"] .ws-sbs {
  display: flex;
}

/* ---- bottom bar ---- */
.ws-bottom {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 64px;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ws-bottom__count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.ws-bottom__count strong {
  font-size: 15px;
  font-weight: 600;
}
.ws-bottom__count span {
  color: var(--ink2);
}
.ws-bottom__rule {
  width: 1px;
  height: 22px;
  background: var(--line);
}
.ws-bottom__layout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink2);
  font: 400 13.5px/1.3 var(--fu);
  white-space: nowrap;
  cursor: pointer;
}
.ws-bottom__lv {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
.ws-bottom__act {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-left: auto;
}
/* The Download menu is a ws-menu (section 0) hung from a ws-anchor in this bar. With it open the button is filled chalk. */
.ws-bottom .ws-btn[aria-expanded="true"] {
  border-color: var(--ink);
  background: var(--chalk);
}
/* a button label that goes away on a phone but stays for screen readers */
@media (max-width: 599px) {
  .ws-bottom .ws-btn__t {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---- My worksheets drawer ---- */
.ws-drawer {
  position: fixed;
  top: var(--psh-top);
  left: var(--psh-rail);
  right: 0;
  bottom: var(--psh-bottom);
  z-index: 880;
  display: flex;
  justify-content: flex-end;
}
.ws-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 60, 0.32);
}
.ws-drawer__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 440px;
  max-width: 100%;
  height: 100%;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--sh);
}
.ws-drawer__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 12px 8px 20px;
  border-bottom: 1px solid var(--line);
}
.ws-drawer__title {
  flex: 1;
  margin: 0;
  font: 400 22px/1.2 var(--fd);
  letter-spacing: -0.01em;
}
.ws-drawer__body {
  flex: 1;
  min-height: 0;
  padding: 0 20px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
}

/* ---- responsive: under 980px the panes stack (left, then right) and the page scrolls ---- */
@media (min-width: 980px) and (max-width: 1279px) {
  .ws-open {
    flex-direction: column;
  }
  /* a narrow left pane: let the three pickers share the row instead of keeping their widths */
  .ws-pickers .ws-field {
    flex: 1 1 150px;
    width: auto;
  }
}
@media (max-width: 979px) {
  .ws-app {
    overflow-x: hidden;
    overflow-y: auto;
  }
  .ws-bar {
    flex: none;
  }
  .ws-panes {
    flex: 1 0 auto;
    flex-direction: column;
  }
  .ws-left,
  .ws-right {
    flex: none;
    width: auto;
  }
  /* no stacking context here, so an open panel can rise above the pinned bottom bar */
  .ws-left {
    position: static;
    z-index: auto;
  }
  .ws-right {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .ws-panel {
    flex: none;
  }
  .ws-scroll {
    flex: none;
    overflow: visible;
  }
  .ws-bottom {
    position: sticky;
    bottom: 0;
  }
  /* panels open across the pane instead of under their own button */
  .ws-pickers,
  .ws-result {
    position: relative;
  }
  .ws-pickers .ws-field,
  .ws-result .ws-anchor {
    position: static;
  }
  .ws-pickers .ws-pop,
  .ws-result .ws-pop {
    left: 20px;
    right: 20px;
    width: auto;
    max-width: 408px;
  }
  .ws-input,
  .ws-ask__in,
  .ws-ask--lg .ws-ask__in,
  .ws-select {
    font-size: 16px;
  }
}
@media (max-width: 699px) {
  .ws-open {
    flex-direction: column;
  }
}
@media (max-width: 599px) {
  /* the shell's top bar already says Worksheet Studio */
  .ws-bar__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .ws-bar {
    padding: 4px 12px 0;
    gap: 0 12px;
  }
  .ws-steps {
    gap: 16px;
  }
  .ws-bar__tools {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 6px 14px;
  }
  .ws-bottom {
    gap: 2px 12px;
    min-height: 0;
    padding: 8px 12px;
  }
  .ws-bottom__count {
    flex: 1 1 100%;
  }
  .ws-bottom__rule {
    display: none;
  }
  .ws-bottom__layout {
    flex: 1 1 100%;
    min-height: 28px;
  }
  .ws-bottom__act {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 4px;
  }
  .ws-bottom__act .ws-btn:not(.ws-btn--gold) {
    padding: 0 12px;
  }
  .ws-bottom__act .ws-btn--gold {
    flex: 1;
    padding: 0 16px;
  }
  .ws-drawer__panel {
    width: 100%;
    border-left: 0;
  }
}
@media (pointer: coarse) {
  .ws-btn--sm,
  .ws-btn--xs,
  .ws-opt,
  .ws-opt--sm,
  .ws-opt--lg,
  .ws-seg > button {
    min-height: 44px;
  }
  /* a chip stays small; only the hit area of its cross grows */
  .ws-chip__x {
    position: relative;
  }
  .ws-chip__x::after {
    content: "";
    position: absolute;
    inset: -11px -8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-btn,
  .ws-select__chev,
  .ws-toast {
    transition: none;
  }
}


/* ==========================================================================
   2 Start screen   (#wsStart)
   ========================================================================== */

.ws-start {
  padding: 30px 32px 24px;
}
.ws-start__in {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.ws-start__h {
  margin: 0 0 14px;
  font: 400 30px/1.15 var(--fd);
  letter-spacing: -0.015em;
}
.ws-start__help {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--mute);
}
.ws-start__lead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 10px;
}
.ws-start__lead--split {
  justify-content: space-between;
  margin-bottom: 4px;
}
.ws-start__lead--tight {
  margin-bottom: 4px;
}
.ws-start__hint {
  font-size: 12.5px;
  color: var(--mute);
}
/* the three example sentences */
.ws-try {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 400 14.5px/1.45 var(--fu);
  text-align: left;
  cursor: pointer;
}
.ws-try > span {
  flex: 1;
}
.ws-try .ws-ic {
  width: 15px;
  height: 15px;
  color: var(--ink2);
  stroke-width: 2;
}
.ws-try:hover {
  color: var(--navy);
}
/* subject, topic and source by hand */
.ws-hand {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.ws-hand .ws-field--subject {
  width: 160px;
}
.ws-hand .ws-field--topic,
.ws-hand .ws-field--source {
  width: 140px;
}
/* Subject is the only panel on this screen and the picker row sits low, so its panel opens upward. That is only where it
   starts: PWS.util.placePanel then puts it where all of it shows (above, below, or over its own control). */
@media (min-width: 600px) {
  .ws-hand .ws-pop {
    top: auto;
    right: auto;
    bottom: calc(100% + 6px);
    left: 0;
    width: 408px;
    max-width: calc(100vw - 96px);
    max-height: min(420px, calc(100dvh - 420px));
  }
}
.ws-hand .ws-btn {
  padding: 0 16px;
}
.ws-hand .ws-btn .ws-ic {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}
/* a saved worksheet in a list (Start, and the My worksheets drawer) */
.ws-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: 400 14px/1.45 var(--fu);
  text-align: left;
  cursor: pointer;
}
.ws-row__main {
  flex: 1;
  min-width: 0;
}
.ws-row__t {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 600;
}
.ws-row__sub {
  display: block;
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-row:hover .ws-row__t {
  color: var(--navy);
}
@media (max-width: 979px) {
  /* the boxes go to 16px text here, so give them a little more room */
  .ws-hand .ws-field--subject {
    width: 190px;
  }
  .ws-hand .ws-field--topic,
  .ws-hand .ws-field--source {
    width: 150px;
  }
}
@media (max-width: 599px) {
  .ws-start {
    padding: 20px 16px 20px;
  }
  .ws-start__h {
    font-size: 26px;
  }
  .ws-hand .ws-field--subject {
    width: 100%;
  }
  .ws-hand .ws-field--topic,
  .ws-hand .ws-field--source {
    width: calc(50% - 6px);
  }
  .ws-hand .ws-btn {
    width: 100%;
  }
}


/* ==========================================================================
   3 Pick screen   (#wsPick)
   Type-it row, the three pickers, the result bar with its chips, then the result cards.
   ========================================================================== */

.ws-pick__ask {
  flex: none;
  padding: 14px 20px 12px;
}
.ws-pickers {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 4px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.ws-pickers .ws-field--subject {
  width: 168px;
}
.ws-pickers .ws-field--topic {
  width: 250px;
}
.ws-pickers .ws-field--source {
  width: 220px;
}
.ws-result {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--chalk);
}
.ws-result__n {
  margin-right: 4px;
  font-size: 14px;
  font-weight: 600;
}
.ws-result__sort {
  margin-left: auto;
}
.ws-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink2);
  font: 500 13px/1 var(--fu);
  white-space: nowrap;
  cursor: pointer;
}
.ws-sort:hover {
  color: var(--ink);
}
.ws-sort .ws-ic {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}
.ws-sort[aria-expanded="true"] .ws-ic {
  transform: rotate(180deg);
}
.ws-pick__msg {
  flex: none;
  margin: 12px 20px 0;
}

/* ---- result cards (.ws-list is also .ws-scroll: it scrolls on its own, 20 cards at a time) ---- */
.ws-card {
  padding: 12px 20px 10px 17px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: #fff;
}
.ws-card.is-added {
  border-left-color: var(--navy);
}
.ws-card.is-current,
.ws-card.is-open {
  background: var(--chalk);
}
.ws-card.is-open {
  padding-bottom: 12px;
}
.ws-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.ws-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
}
.ws-card__src {
  font-size: 12.5px;
  font-weight: 600;
}
/* the line of facts: source details, topic, level, Has a diagram, given-before label.
   The dots are drawn here, so a missing level leaves no stray dot. */
.ws-card__meta {
  flex: 1 1 14em;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-card__meta > :not(:last-child)::after {
  content: "\00a0\00b7\00a0";
}
/* a given-before label that is set (gold-brown) stands apart: a gap instead of a dot before it */
.ws-card__meta > :has(+ .ws-given.is-given)::after {
  content: "";
  display: inline-block;
  width: 10px;
}
.ws-card__act {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-card__marks {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ws-card__add {
  padding: 0 14px;
}
.ws-card__add .ws-ic {
  stroke-width: 2.2;
}
.ws-card__add[aria-pressed="true"] {
  padding: 0 12px;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}
.ws-card__add[aria-pressed="true"]:hover {
  border-color: var(--navy);
  background: var(--navy);
}
.ws-card__add[aria-pressed="true"] .ws-ic {
  stroke-width: 2.4;
}
.ws-card > .ws-q {
  max-width: 660px;
  margin-top: 2px;
}
/* the actions under the card that is current (keyboard or last clicked) */
.ws-card__tools {
  display: none;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}
.ws-card.is-current:not(.is-open) .ws-card__tools,
.ws-card:not(.is-open):has(:focus-visible) .ws-card__tools {
  display: flex;
}
.ws-card__tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 500 13px/1 var(--fu);
  cursor: pointer;
}
.ws-card__tool:hover {
  color: var(--ink);
}
.ws-card__tool .ws-ic {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}
.ws-card__tool[aria-expanded="true"] .ws-ic {
  transform: rotate(180deg);
}
.ws-card__hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--mute);
}

/* ---- an opened card: the question beside its mark scheme, then where it sits and how to move on ---- */
.ws-open {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--canvas);
}
.ws-open__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-open__k {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 11.5px/1 var(--fu);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ws-open__k::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--navy);
}
.ws-open__col--ms .ws-open__k::before {
  background: var(--ok);
}
.ws-open__sheet {
  --ws-qfs: 13.5px;
  flex: 1;
  min-width: 0;
  padding: 14px 16px 16px;
  background: #fff;
  box-shadow: var(--sh);
  color: var(--ws-qink);
  font: 400 13.5px/1.5 var(--ws-serif);
}
.ws-open__qh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--fu);
  line-height: 1;
}
.ws-open__qn {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.ws-open__qrule {
  width: 1px;
  height: 12px;
  background: var(--ws-gold-line);
}
.ws-open__qt {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ws-hue-2);
}
.ws-open__qm {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--mute);
}
.ws-open__qm b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.ws-open__path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-open__path > * + *::before {
  content: "\00b7";
  margin-right: 14px;
}
.ws-open__path > .ws-given.is-given::before {
  color: var(--ink2);
  font-weight: 400;
}
.ws-open__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.ws-open__nav .ws-btn--quiet {
  margin-left: 8px;
  padding: 0;
  font-size: 13px;
}
.ws-open__nav .ws-btn--quiet:hover {
  background: none;
  color: var(--ink);
}
.ws-open__nav .ws-card__hint {
  margin-left: auto;
}
@media (max-width: 599px) {
  .ws-pick__ask {
    padding: 12px 12px 10px;
  }
  .ws-pickers {
    padding: 4px 12px 12px;
  }
  .ws-pickers .ws-field--subject {
    width: 100%;
  }
  .ws-pickers .ws-field--topic,
  .ws-pickers .ws-field--source {
    width: calc(50% - 7px);
  }
  .ws-result {
    padding: 6px 12px;
  }
  .ws-card {
    padding: 12px 12px 10px 9px;
  }
  .ws-open {
    padding: 10px;
  }
  .ws-card__tools .ws-card__hint {
    display: none;
  }
}
/* a narrow left pane (a phone, or the panes side by side under 1280px): the facts get a line to themselves,
   then marks and the Add button */
@media (min-width: 980px) and (max-width: 1279px), (max-width: 699px) {
  .ws-card__head {
    flex-wrap: wrap;
  }
  .ws-card__info {
    flex: 1 1 100%;
  }
  .ws-card__act {
    margin-left: auto;
  }
  .ws-open__nav {
    flex-wrap: wrap;
  }
  .ws-open__nav .ws-card__hint {
    flex: 1 1 100%;
    margin-left: 0;
  }
}


/* ==========================================================================
   4 Panels   Subject, Topic, Source and More filters. Each is one .ws-pop hung from its control.
   ========================================================================== */

/* ---- Topic: a search box, the syllabus areas (open and close) with topics under them, then Match / Clear / Show ---- */
.ws-tree__area {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: 500 14px/1.2 var(--fu);
  text-align: left;
  cursor: pointer;
}
.ws-tree__area:hover {
  background: var(--chalk);
}
.ws-tree__area > .ws-ic {
  width: 14px;
  height: 14px;
  color: var(--mute);
  stroke-width: 2.2;
}
.ws-tree__t {
  flex: 1;
  min-width: 0;
}
.ws-tree__area[aria-expanded="true"] {
  border-bottom-color: transparent;
  background: var(--chalk);
  font-weight: 600;
}
.ws-tree__area[aria-expanded="true"] > .ws-ic {
  color: var(--ink);
  transform: rotate(90deg);
}
/* how many are ticked in this area */
.ws-tree__n {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font: 600 12px/1 var(--fu);
}
.ws-tree__topics {
  border-bottom: 1px solid var(--line);
}
.ws-tree__topics .ws-check {
  min-height: 34px;
  padding: 3px 14px 3px 36px;
}
.ws-tree__empty {
  padding: 18px 14px;
  font-size: 13px;
  color: var(--mute);
}

/* ---- Subject and Source: groups of rows (ws-check--row) with a count on the right; school chips under School papers ---- */
.ws-pop__chips {
  padding: 0 14px 8px 40px;
}

/* ---- More filters ---- */
.ws-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-range > span {
  color: var(--ink2);
}
.ws-pop__sec--cols .ws-opt {
  padding: 0 8px;
}
.ws-pop__sec--checks {
  padding-bottom: 12px;
}
.ws-pop__sec--checks .ws-k {
  margin-bottom: 4px;
}
@media (max-width: 599px) {
  /* on a phone a panel is a sheet that sits above the tab bar */
  .ws-pop {
    position: fixed;
    top: auto;
    right: 8px;
    bottom: calc(var(--psh-bottom) + 8px);
    left: 8px;
    width: auto;
    max-width: none;
    max-height: min(640px, calc(100dvh - var(--psh-top) - var(--psh-bottom) - 24px));
    box-shadow: 0 -2px 6px rgba(13, 31, 60, 0.08), 0 8px 30px rgba(13, 31, 60, 0.22);
  }
  .ws-pop--tall {
    min-height: 0;
  }
  .ws-pop__sec--cols {
    flex-direction: column;
    gap: 14px;
  }
}


/* ==========================================================================
   5 Type-it screen   (#wsAsk)
   ========================================================================== */

/* ---- the sentence box: the same box as the Start and Pick screens, with the navy 2px edge always on ---- */
.ws-askbox {
  flex: none;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.ws-askbox .ws-ask {
  border: 2px solid var(--navy);
  padding: 0 6px 0 14px;
  box-shadow: none;
}
.ws-askbox .ws-ask:has(.ws-ask__in:focus) {
  box-shadow: none;
}
.ws-askbox .ws-ask:has(.ws-ask__in:focus-visible) {
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.18);
}
.ws-askbox .ws-ask .ws-btn {
  padding: 0 14px;
}
/* a button that is working: full strength, a small ring in front of the words (the same look as the bottom bar) */
.ws-askbox .ws-btn.is-busy,
.ws-draft .ws-btn.is-busy {
  opacity: 1;
  cursor: progress;
}
.ws-askbox .ws-btn.is-busy::before,
.ws-draft .ws-btn.is-busy::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ws-ask-spin 0.8s linear infinite;
}
@keyframes ws-ask-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-askbox .ws-btn.is-busy::before,
  .ws-draft .ws-btn.is-busy::before {
    animation: none;
  }
}

/* ---- What I understood ---- */
.ws-got {
  flex: none;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.ws-got__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 34px;
}
.ws-got__h {
  margin: 0 auto 0 0;
  font: 400 19px/1.2 var(--fd);
  letter-spacing: -0.01em;
}
.ws-got__head .ws-link {
  white-space: nowrap;
}
.ws-got__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.ws-got .ws-chip {
  max-width: 100%;
}
.ws-got .ws-chip__v {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the Subject chip has no cross, so it gets the same room on the right as on the left */
.ws-got__fixed {
  padding-right: 12px;
}
.ws-got .ws-chip__x:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Add a rule: a dashed button, and a small panel of choices that hangs from it (right edge to right edge) */
.ws-btn.ws-got__addbtn {
  --h: 32px;
  gap: 6px;
  padding: 0 12px;
  border: 1px dashed var(--mute);
  color: var(--ink2);
  font-size: 13px;
}
.ws-btn.ws-got__addbtn:hover {
  border-color: var(--ink2);
}
.ws-btn.ws-got__addbtn .ws-ic {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}
.ws-btn.ws-got__addbtn[aria-expanded="true"] {
  border: 1px solid var(--navy);
  background: var(--chalk);
  color: var(--ink);
}
.ws-got__pop {
  --ws-pop-off: 300px;
}
@media (min-width: 600px) {
  .ws-got__pop {
    left: auto;
    right: 0;
    width: 352px;
  }
}
/* the left pane beside the 636px right pane can be only 280px wide: the panel then spans the pane under the heading row */
@media (min-width: 980px) and (max-width: 1279px) {
  .ws-got__head {
    position: relative;
  }
  .ws-got__head .ws-anchor {
    position: static;
  }
  .ws-got__pop {
    left: 20px;
    right: 20px;
    width: auto;
    max-width: 408px;
  }
}
.ws-got__none {
  font-size: 13px;
  color: var(--mute);
}

/* ---- notes: what could not be followed, in one warm band above the draft ---- */
.ws-note.ws-asknote {
  flex: none;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.ws-asknote > .ws-ic {
  margin-top: 2px;
}
.ws-asknote .ws-note__t {
  flex: 1;
}
.ws-asknote p + p {
  margin-top: 2px;
}

/* ---- the draft: header with Try again and Undo, then the three mix bars ---- */
.ws-draft {
  flex: none;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--chalk);
}
.ws-draft__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 36px;
}
.ws-draft__h {
  margin: 0;
  font: 400 20px/1.2 var(--fd);
  letter-spacing: -0.01em;
}
.ws-draft__sum {
  font-size: 13px;
  color: var(--ink2);
}
.ws-draft__acts {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.ws-btn.ws-draft__again {
  gap: 7px;
  padding: 0 12px;
  border-color: var(--line);
}
.ws-btn.ws-draft__again:hover {
  border-color: var(--ink2);
}
.ws-btn.ws-draft__again .ws-ic {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.ws-link.ws-draft__undo {
  height: 36px;
  padding: 0 4px;
  font-size: 13.5px;
  text-decoration-color: currentColor;
}
.ws-draft__bars {
  margin-top: 8px;
}
.ws-draft .ws-bars__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.ws-draft .ws-bars__key {
  white-space: nowrap;
}
.ws-draft .ws-bars__key + .ws-bars__key {
  margin-left: 0;
}
.ws-draft.is-busy .ws-draft__head > :not(.ws-draft__acts),
.ws-draft.is-busy .ws-draft__bars {
  opacity: 0.45;
}
/* two more colours for the bars: a pale one (Easy, Other) and a hatched one (No level) */
.ws-draft .ws-hue-pale {
  --c: var(--ws-thumb);
}
.ws-draft .ws-hue-none {
  --c: var(--ws-thumb);
}
.ws-draft .ws-bars__seg.ws-hue-none,
.ws-draft .ws-bars__key.ws-hue-none::before {
  background: repeating-linear-gradient(135deg, var(--ws-hue-4) 0 2px, #fff 2px 4px);
}
.ws-draft .ws-bars__key.ws-hue-none::before {
  box-shadow: inset 0 0 0 1px var(--ws-thumb);
}

/* ---- the list of picks ---- */
.ws-draftlist {
  background: #fff;
}
.ws-draftlist__ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ws-pickrow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  padding: 5px 12px 5px 20px;
  border-bottom: 1px solid var(--line);
}
.ws-pickrow__main {
  flex: 1;
  min-width: 0;
}
.ws-pickrow__t {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
.ws-pickrow__why {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-pickrow__why .ws-ic {
  width: 12px;
  height: 12px;
  color: var(--ok);
  stroke-width: 2.6;
}
.ws-pickrow__why > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-pickrow__src {
  flex: none;
  width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink2);
}
.ws-pickrow__m {
  flex: none;
  min-width: 30px;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.ws-btn.ws-pickrow__swap {
  --h: 34px;
  flex: none;
  padding: 0 10px;
  border-color: var(--line);
  font-size: 13px;
}
.ws-btn.ws-pickrow__swap:hover {
  border-color: var(--ink2);
}
.ws-pickrow__x {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--ink2);
  cursor: pointer;
}
.ws-pickrow__x:hover {
  background: var(--chalk);
  color: var(--ink);
}
.ws-pickrow__x:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.ws-pickrow__x .ws-ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.ws-draftfoot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 12px 20px 16px;
  font-size: 13px;
  color: var(--ink2);
}
.ws-draftfoot > span {
  flex: 1 1 300px;
}
.ws-draftfoot .ws-link:disabled {
  opacity: 0.5;
  cursor: default;
}
.ws-draftlist .ws-empty {
  padding: 28px 24px 12px;
}

/* ---- while it builds: grey placeholder rows (same height as the real ones, so nothing jumps) ---- */
.ws-pickrow.is-ghost {
  pointer-events: none;
}
.ws-ghost {
  display: block;
  flex: none;
  border-radius: 2px;
  background: var(--line);
}
.ws-ghost--tile {
  width: 22px;
  height: 22px;
}
.ws-ghost--t {
  width: 56%;
  height: 12px;
  margin: 4px 0 7px;
}
.ws-ghost--s {
  width: 36%;
  height: 10px;
  margin-bottom: 4px;
}
.ws-ghost--src {
  width: 78px;
  height: 10px;
  margin-right: 26px;
}
.ws-ghost--m {
  width: 26px;
  height: 10px;
}
.ws-ghost--b {
  width: 52px;
  height: 34px;
  border: 1px solid var(--line);
  background: none;
}
.ws-ghost--x {
  width: 32px;
  height: 10px;
}
@media (prefers-reduced-motion: no-preference) {
  .ws-ghost {
    animation: ws-ghost 1.3s ease-in-out infinite;
  }
  @keyframes ws-ghost {
    50% {
      opacity: 0.45;
    }
  }
}

/* ---- a finger: bigger targets (the chip crosses already grow in section 0) ---- */
@media (pointer: coarse) {
  .ws-askbox .ws-ask .ws-btn {
    --h: 40px;
  }
  .ws-btn.ws-got__addbtn,
  .ws-btn.ws-pickrow__swap {
    --h: 44px;
  }
  .ws-pickrow__x {
    width: 44px;
    height: 44px;
  }
  .ws-link.ws-draft__undo {
    height: 44px;
  }
  .ws-got__head .ws-link,
  .ws-draftfoot .ws-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ---- a cramped left pane (side by side under 1280px) or a short window: the whole pane scrolls and the list is not squeezed away ---- */
@media (min-width: 980px) and (max-width: 1279px), (min-width: 1280px) and (max-height: 700px) {
  .ws-askview {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ws-thumb) transparent;
  }
  .ws-askview .ws-draftlist {
    flex: none;
    overflow: visible;
  }
}

/* ---- a narrow left pane (the panes side by side under 1280px, or a phone): the title and its reason take the whole
   row, then the source, marks, Swap and the cross sit on a line under them ---- */
@media (min-width: 980px) and (max-width: 1279px), (max-width: 699px) {
  .ws-pickrow {
    flex-wrap: wrap;
    row-gap: 2px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .ws-pickrow__main {
    flex: 1 1 calc(100% - 32px);
  }
  .ws-pickrow__src {
    flex: 1 1 0;
    width: auto;
    margin-left: 32px;
  }
  .ws-ghost--src {
    margin-right: auto;
    margin-left: 32px;
  }
  .ws-pickrow.is-ghost .ws-ghost--b,
  .ws-pickrow.is-ghost .ws-ghost--x {
    display: none;
  }
}
@media (max-width: 599px) {
  .ws-askbox {
    padding: 12px 12px 10px;
  }
  .ws-got {
    padding: 10px 12px 12px;
  }
  .ws-note.ws-asknote {
    padding: 10px 12px;
  }
  .ws-draft {
    padding: 10px 12px 12px;
  }
  .ws-pickrow {
    padding-right: 4px;
    padding-left: 12px;
  }
  .ws-pickrow__src {
    margin-left: 32px;
  }
  .ws-draftfoot {
    padding: 12px 12px 16px;
  }
  .ws-draft__bars {
    gap: 10px 20px;
  }
}


/* ==========================================================================
   6 Layout step   (#wsLayout)
   ========================================================================== */

.ws-lay {
  container: ws-lay / inline-size;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font: 400 14px/1.45 var(--fu);
  /* colours that only the little drawings on the tiles use */
  --lay-deep: #12294b;
  --lay-edge: #9aa3b5;
  --lay-ans: #cfeadd;
}

/* the part above the footer; it scrolls on its own when the pane is too short (ws-scroll) */
.ws-lay__scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 20px 12px;
}
.ws-lay__sec {
  min-width: 0;
}
.ws-lay__k {
  display: block;
  margin: 0 0 8px;
}
.ws-lay__k--tight {
  margin-bottom: 6px;
}
.ws-lay__lead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-bottom: 8px;
}
.ws-lay__lead .ws-k {
  margin: 0;
}
.ws-lay__hint {
  font-size: 12.5px;
  line-height: 1;
  color: var(--ink2);
}

/* ---- Start from: one button per style, the starting style is pressed ---- */
.ws-lay__start {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ws-lay__start > .ws-k {
  margin: 0 4px 0 0;
}
.ws-lay__presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ws-lay__saved {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--mute);
}
.ws-lay__preset {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
}
.ws-lay__preset > .ws-opt {
  min-width: 0;
  max-width: 100%;
}
.ws-lay__pn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the small cross that deletes a saved style: on a corner of its button, seen when the button is pointed at or focused */
.ws-lay__x {
  position: absolute;
  z-index: 1;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink2);
  opacity: 0;
  cursor: pointer;
}
.ws-lay__x .ws-ic {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}
.ws-lay__preset:hover > .ws-lay__x,
.ws-lay__preset:focus-within > .ws-lay__x,
.ws-lay__x:focus-visible {
  opacity: 1;
}
.ws-lay__x:hover {
  border-color: var(--ink2);
  background: var(--chalk);
  color: var(--ink);
}
.ws-lay__x:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
/* "Delete this style? Yes No" in the place of the button */
.ws-lay__ask {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--ink2);
  border-radius: var(--r);
  background: var(--chalk);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* ---- tiles: Style and What goes in the PDF. The pressed one has a 2px navy edge. ---- */
.ws-lay__tiles {
  display: grid;
}
.ws-lay__tiles--style {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ws-lay__tiles--files {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.ws-lay__tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ws-lay__tile:hover {
  border-color: var(--ink2);
}
.ws-lay__tile[aria-pressed="true"] {
  padding: 10px;
  border: 2px solid var(--navy);
}
.ws-lay__tile:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.ws-lay__tn {
  font-size: 13.5px;
  font-weight: 600;
}
.ws-lay__ts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink2);
}
.ws-lay__tiles--files .ws-lay__tn {
  font-size: 13px;
  line-height: 1.25;
}
.ws-lay__tiles--files .ws-lay__ts {
  line-height: 1.45;
}
.ws-lay__note {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink2);
}

/* ---- the little drawings on the tiles (decoration only, so nothing here is read out) ---- */
.ws-lay__pv {
  display: block;
  height: 62px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.ws-lay__pv--modern {
  padding: 0 9px 8px;
}
/* Photon classic: a thin rule, a title bar, two numbered lines */
.ws-lay__c-top {
  display: flex;
  height: 2px;
}
.ws-lay__c-gold {
  width: 14px;
  background: var(--gold);
}
.ws-lay__c-deep {
  flex: 1;
  background: var(--lay-deep);
}
.ws-lay__c-title {
  display: block;
  width: 58%;
  height: 6px;
  margin-top: 6px;
  background: var(--lay-deep);
}
.ws-lay__c-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}
.ws-lay__c-row + .ws-lay__c-row {
  margin-top: 7px;
}
.ws-lay__c-sq {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--gold);
}
.ws-lay__c-ln {
  flex: 1;
  height: 3px;
  background: var(--ws-thumb);
}
/* Modern: a colour band, big numbers */
.ws-lay__m-band {
  display: block;
  height: 24px;
  margin: 0 -9px;
  padding: 8px 9px 0;
  border-bottom: 3px solid var(--gold);
  background: var(--navy);
}
.ws-lay__m-t {
  display: block;
  width: 50%;
  height: 5px;
  background: #fff;
}
.ws-lay__m-row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 8px;
}
.ws-lay__m-row + .ws-lay__m-row {
  margin-top: 6px;
}
.ws-lay__m-num {
  width: 7px;
  height: 11px;
  background: var(--ws-hue-2);
}
.ws-lay__m-ln {
  flex: 1;
  height: 3px;
  margin-top: 4px;
  background: var(--ws-thumb);
}
/* Minimal: black and white, small dots */
.ws-lay__n-rule {
  display: block;
  height: 1px;
  background: var(--ink);
}
.ws-lay__n-title {
  display: block;
  width: 48%;
  height: 6px;
  margin-top: 7px;
  background: var(--ink);
}
.ws-lay__n-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
}
.ws-lay__n-row + .ws-lay__n-row {
  margin-top: 8px;
}
.ws-lay__n-dot {
  width: 3px;
  height: 3px;
  background: var(--ink);
}
.ws-lay__n-ln {
  flex: 1;
  height: 2px;
  background: var(--mute);
}
/* Exam: candidate boxes at the top, a marks column on the right */
.ws-lay__e-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-lay__e-ln {
  flex: 1;
  height: 3px;
  background: var(--ink);
}
.ws-lay__e-boxes {
  display: flex;
}
.ws-lay__e-box {
  width: 7px;
  height: 9px;
  border: 1px solid var(--ink);
}
.ws-lay__e-box + .ws-lay__e-box {
  margin-left: -1px;
}
.ws-lay__e-body {
  display: flex;
  gap: 6px;
  height: 30px;
  margin-top: 7px;
}
.ws-lay__e-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 4px;
}
.ws-lay__e-line {
  height: 2px;
  background: var(--mute);
}
.ws-lay__e-side {
  width: 13px;
  border-left: 1px solid var(--ink);
}
/* What goes in the PDF: one or two small pages, the answer part in green */
.ws-lay__fv {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 40px;
}
.ws-lay__pg {
  display: flex;
  flex-direction: column;
  width: 28px;
  height: 36px;
  border: 1px solid var(--lay-edge);
  border-top: 4px solid var(--navy);
  background: #fff;
}
.ws-lay__pg--ms {
  border-top-color: var(--ok);
}
.ws-lay__pg--back {
  justify-content: flex-end;
}
.ws-lay__pg--under {
  gap: 3px;
  padding: 4px 3px 0;
}
.ws-lay__pg--two {
  flex-direction: row;
  width: 42px;
}
.ws-lay__ans {
  height: 12px;
  border-top: 1px solid var(--ok);
  background: var(--lay-ans);
}
.ws-lay__pg--under .ws-lay__ans {
  height: 5px;
  border-top: 0;
}
.ws-lay__gl {
  height: 3px;
  background: var(--lay-edge);
}
.ws-lay__half {
  flex: 1;
}
.ws-lay__half--ans {
  border-left: 1px solid var(--ok);
  background: var(--lay-ans);
}

/* ---- Space to write answers: two segmented groups; the second is dimmed while there is no space ---- */
.ws-lay__ctl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.ws-lay__seg > button:disabled {
  cursor: default;
}
.ws-lay__seg.is-off {
  opacity: 0.45;
}
.ws-lay__seg.is-off > button:hover {
  background: #fff;
}
.ws-lay__seg.is-off > button[aria-pressed="true"]:hover {
  background: var(--ink);
}

/* ---- Show on the page: tick boxes in as many columns as fit (the mockup's rule) ---- */
.ws-lay__checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 0 16px;
}
.ws-lay__flag {
  gap: 9px;
  min-height: 30px;
}

/* ---- Paper size, Text, Question numbers, Date on the page ---- */
.ws-lay__opts {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.ws-lay__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.ws-lay__col > .ws-k {
  display: block;
}
.ws-lay__date {
  width: 164px;
  padding: 0 10px 0 12px;
}
.ws-lay__dnote {
  display: block;
  margin-top: -3px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--mute);
}
.ws-lay__dnote .ws-link {
  font-size: 12px;
}

/* ---- the footer: what changed, and the three actions ---- */
.ws-lay__foot {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: 56px;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: var(--chalk);
}
.ws-lay__say {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink2);
}
.ws-lay__say strong {
  font-weight: 600;
  color: var(--ink);
}
.ws-lay__acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.ws-lay__btn {
  padding: 0 12px;
  font-size: 13.5px;
}
/* the name form takes the place of the three buttons */
.ws-lay__form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.ws-lay__name {
  flex: 1 1 190px;
  width: auto;
  min-width: 150px;
  max-width: 260px;
}
.ws-lay__name.is-bad {
  border-color: var(--bad);
}
.ws-lay__form-msg {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12.5px;
  color: var(--bad);
}

/* ---- narrower panes ---- */
@container ws-lay (max-width: 639px) {
  .ws-lay__tiles--files {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@container ws-lay (max-width: 559px) {
  .ws-lay__tiles--style {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container ws-lay (max-width: 479px) {
  .ws-lay__scroll {
    padding: 14px 12px;
  }
  .ws-lay__foot {
    padding: 8px 12px;
  }
}
@container ws-lay (max-width: 419px) {
  .ws-lay__tiles--files {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ws-lay__start {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .ws-lay__start > .ws-k {
    margin-right: 0;
  }
  .ws-lay__saved {
    margin-left: 0;
  }
  /* a long row of segmented buttons becomes separate buttons that wrap */
  .ws-lay__seg {
    flex-wrap: wrap;
    gap: 6px;
    border: 0;
    border-radius: 0;
    background: none;
    overflow: visible;
  }
  .ws-lay__seg > button,
  .ws-lay__seg > button + button {
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--r);
  }
  .ws-lay__seg > button[aria-pressed="true"] {
    border-color: var(--ink);
  }
  .ws-lay__seg > button:hover {
    border-color: var(--ink2);
  }
  .ws-lay__acts,
  .ws-lay__form {
    flex: 1 1 100%;
  }
  .ws-lay__name {
    max-width: none;
  }
}
@media (hover: none) {
  /* nothing to point at with a finger: the delete cross is always there, with a larger hit area */
  .ws-lay__x {
    opacity: 1;
  }
  .ws-lay__x::after {
    content: "";
    position: absolute;
    inset: -10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-lay__tile {
    transition: none;
  }
}


/* ==========================================================================
   7 Assign step   (#wsAssign)
   ========================================================================== */

.ws-assign {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 18px;
}
/* text for screen readers only */
.ws-assign__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* the form is one fieldset, so everything on it goes inert at once while the worksheet is being assigned.
   Spacing is by margin, not gap: older browsers do not let a fieldset be a flex box. */
.ws-assign__form {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ws-assign__fields,
.ws-assign__checks {
  margin-top: 16px;
}
.ws-assign__form:disabled {
  opacity: 0.55;
}
.ws-assign__form:focus,
.ws-assign__checks:focus,
.ws-assign__h:focus {
  outline: 0;
}

/* progress words, the red note after a failure, the no-questions prompt */
.ws-assign__msg {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ws-assign__msg:empty {
  display: none;
}
.ws-assign__busy {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--chalk);
  font-size: 13.5px;
  font-weight: 500;
}
.ws-assign__spin {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: ws-assign-spin 0.8s linear infinite;
}
@keyframes ws-assign-spin {
  to {
    transform: rotate(360deg);
  }
}
.ws-assign__err {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--bad);
  border-radius: var(--r);
  background: var(--badbg);
  color: var(--bad);
  font-size: 13.5px;
  font-weight: 500;
}
.ws-assign__err .ws-ic {
  margin-top: 2px;
}

/* ---- Who gets it | How they do it ---- */
.ws-assign__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.ws-assign__col {
  flex: 1 1 300px;
  min-width: 0;
}
.ws-assign__col > .ws-k {
  display: block;
  margin-bottom: 8px;
}

/* a search box is drawn by the atom (ws-input); this only takes the browser's own search-box look off */
.ws-assign__search > input {
  -webkit-appearance: none;
  appearance: none;
}
.ws-assign__search > input::-webkit-search-decoration {
  -webkit-appearance: none;
}
/* the clear cross: Chrome draws its own blue one; this is the same cross as the chips, in the page's ink */
.ws-assign__search > input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  background: var(--ink2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6 6 18' stroke='black' stroke-width='2.6' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6 6 18' stroke='black' stroke-width='2.6' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
}

/* the students: one bordered box, a tick box and two lines in each row. A long list scrolls inside the box. */
.ws-assign__list {
  max-height: 332px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
}
.ws-assign__stu {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  background: #fff;
  cursor: pointer;
}
.ws-assign__stu + .ws-assign__stu {
  border-top: 1px solid var(--line);
}
.ws-assign__stu > input {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy);
  cursor: inherit;
}
.ws-assign__stu > .ws-tag {
  grid-area: 1 / 3;
}
.ws-assign__stu:has(> input:checked) {
  background: var(--chalk);
}
.ws-assign__who {
  grid-area: 1 / 2;
  min-width: 0;
}
.ws-assign__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.ws-assign__stu:has(> input:checked) .ws-assign__name {
  font-weight: 600;
}
.ws-assign__line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink2);
}
/* a chosen outsider the worksheet cannot go to: the row turns gold, like the warning in the checks box */
.ws-assign__list .ws-assign__stu.is-blocked {
  background: var(--warnbg);
}
.ws-assign__block {
  grid-area: 2 / 2 / auto / -1;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--goldt);
}
.ws-assign__empty {
  margin: 0;
  padding: 14px 12px;
  font-size: 13.5px;
  color: var(--ink2);
}
.ws-assign__count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
}
.ws-assign__n {
  color: var(--ink2);
}
.ws-assign__n strong {
  font-weight: 600;
  color: var(--ink);
}
.ws-assign__all {
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 500 13px/1 var(--fu);
  white-space: nowrap;
  cursor: pointer;
}
.ws-assign__all:hover {
  color: var(--ink);
}

/* the three ways to do it, and the minutes box under Timed quiz */
.ws-assign__modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-assign__min {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 12px;
}
.ws-assign__min .ws-input--num {
  flex: none;
}
.ws-assign__hint {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--mute);
}

/* ---- title, due date, note ---- */
.ws-assign__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.ws-assign__fields .ws-field {
  gap: 6px;
}
.ws-assign__f-title {
  flex: 2 1 220px;
}
.ws-assign__f-due {
  flex: 1 1 130px;
}
.ws-assign__f-note {
  flex: 3 1 260px;
}
/* an empty date box says dd/mm/yyyy in the same ink as a date, so grey it until a date is chosen */
.ws-assign__f-due .ws-input.is-empty::-webkit-datetime-edit {
  color: var(--mute);
}

/* ---- the checks box (a ws-notes with ws-note rows, then the two tick boxes) ---- */
.ws-assign__s {
  color: var(--ink2);
}
.ws-assign__hint2 {
  display: block;
  color: var(--ink2);
}
.ws-assign__muted {
  color: var(--mute);
}
/* Swap it and Keep it sit in the warning row */
.ws-assign .ws-note .ws-btn {
  --h: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.ws-assign__undo {
  flex: none;
}
.ws-assign__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  padding: 2px 12px;
}
.ws-assign__opts .ws-check {
  min-height: 40px;
  font-size: 13.5px;
}
/* why a tick box is off (no name line, a timed quiz): a muted line under its label */
.ws-assign__why {
  display: block;
  font-size: 12.5px;
  color: var(--mute);
}

/* ---- the done state ---- */
.ws-assign__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 560px;
  padding-top: 8px;
}
.ws-assign__done .ws-notes {
  align-self: stretch;
}
.ws-assign__badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--okbg);
  color: var(--ok);
}
.ws-assign__badge .ws-ic {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}
.ws-assign__h {
  margin: 0;
  font: 400 30px/1.15 var(--fd);
  letter-spacing: -0.015em;
}
.ws-assign__names {
  margin: -4px 0 0;
  font-size: 14.5px;
  color: var(--ink2);
}
.ws-assign__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}
.ws-assign__acts .ws-btn .ws-ic:last-child {
  margin-right: -2px;
}

/* ---- focus (the atoms cover ws-btn, ws-link, ws-check and ws-radio-card; these are this screen's own controls) ---- */
.ws-assign__stu > input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.ws-assign__all:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ---- narrow screens ---- */
@media (max-width: 599px) {
  .ws-assign {
    padding: 16px 16px 18px;
  }
  .ws-assign__h {
    font-size: 26px;
  }
  .ws-assign__acts > * {
    flex: 1 1 100%;
  }
}
@media (pointer: coarse) {
  .ws-assign__stu {
    min-height: 48px;
  }
  .ws-assign__all {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-assign__spin {
    animation: none;
    border-right-color: var(--navy);
  }
}


/* ==========================================================================
   8 Right pane and side by side   (#wsPane, #wsSbs)
   ========================================================================== */

/* the colour of the engine's page shell (#e7eaef): the canvas around the pages and the shell are one grey */
.ws-right,
.ws-sbs {
  --ws-shell: #e7eaef;
}

@keyframes ws-pane-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes ws-pane-new {
  from {
    border-color: var(--gold);
    background: rgba(240, 165, 0, 0.12);
  }
  to {
    border-color: transparent;
    background: transparent;
  }
}

/* ---- header: Title label, the title box, and the List | Question paper | Mark scheme switch ---- */
.ws-pane__head {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: 52px;
  padding: 7px 12px 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.ws-pane__title {
  flex: 1 1 160px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: 600 14.5px/1.2 var(--fu);
}
.ws-pane__title:hover {
  border-color: var(--ink2);
}
.ws-pane__title::placeholder {
  color: var(--mute);
  opacity: 1;
}
.ws-pane__title:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 0;
}

/* ---- the draft banner (the type-it box built the picks) and the one-line note above a mark scheme nobody prints ---- */
.ws-pane__draft,
.ws-pane__note {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.ws-pane__draft {
  background: var(--warnbg);
}
.ws-pane__badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font: 600 10.5px/1.45 var(--fu);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ws-pane__note {
  background: var(--chalk);
  color: var(--ink2);
}
.ws-pane__note .ws-ic {
  width: 15px;
  height: 15px;
}

.ws-pane__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---- List view ---- */
.ws-pane__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
}
.ws-pane__tiles {
  display: flex;
  gap: 8px;
  padding: 14px 16px 12px;
}
.ws-pane__tile {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--chalk);
}
.ws-pane__num {
  font: 400 24px/1.1 var(--fd);
}
.ws-pane__tile .ws-k {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-pane__mix {
  padding: 0 16px 14px;
}
/* a bar part that has no name (No topic, No level): hatched; Easy is the light end of the Level bar */
.ws-pane__hue-easy {
  --c: #c4cfe0;
}
.ws-pane__hue-none {
  --c: #aeb8c9;
}
.ws-bars__seg.ws-pane__hue-none,
.ws-bars__key.ws-pane__hue-none::before {
  background: repeating-linear-gradient(135deg, #aeb8c9 0 3px, #dce2ea 3px 6px);
}
/* a legend too long for its place beside the bar goes under the bar; a key never breaks in two */
.ws-pane__mix .ws-bars__legend {
  line-height: 1.7;
}
.ws-pane__mix .ws-bars__key {
  display: inline-block;
  white-space: nowrap;
}
.ws-pane__mix .ws-bars__item.is-long {
  flex-wrap: wrap;
  row-gap: 3px;
}
.ws-pane__mix .ws-bars__item.is-long .ws-bars__legend {
  flex: 1 1 100%;
  width: auto;
  padding-left: 60px;
}
.ws-pane__none {
  margin: 0;
  padding: 28px 20px;
  border-top: 1px solid var(--line);
  color: var(--ink2);
  text-align: center;
}
.ws-pane__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ws-pane__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 7px 8px 7px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  cursor: grab;
}
.ws-pane__row:hover {
  background: var(--chalk);
}
.ws-pane__row.is-drag {
  opacity: 0.45;
}
.ws-pane__row.is-before {
  box-shadow: inset 0 2px 0 var(--navy);
}
.ws-pane__row.is-after {
  box-shadow: inset 0 -2px 0 var(--navy);
}
.ws-pane__main {
  flex: 1;
  min-width: 0;
}
.ws-pane__t {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* source, topic, level and the given-before label on one line. Only the topic gives way when the line is too long. */
.ws-pane__sub {
  display: flex;
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--ink2);
  white-space: nowrap;
}
.ws-pane__sub > * {
  flex: none;
}
.ws-pane__sub > .ws-pane__give {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the dots between the parts are drawn here, so a missing part leaves no stray dot */
.ws-pane__sub > * + *::before {
  content: "\00a0\00b7\00a0";
}
/* a given-before label that is set stands apart: a gap instead of a dot (as on the result cards) */
.ws-pane__sub > * + .ws-given.is-given::before {
  content: "";
  display: inline-block;
  width: 10px;
}
.ws-pane__marks {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ws-pane__acts {
  flex: none;
  display: inline-flex;
}
.ws-pane__ib {
  display: grid;
  place-items: center;
  width: 34px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--ink2);
  cursor: pointer;
}
.ws-pane__ib:hover {
  background: var(--chalk);
  color: var(--ink);
}
.ws-pane__ib:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.ws-pane__ib .ws-ic {
  stroke-width: 2;
}
.ws-pane__ib[data-act="row-remove"] .ws-ic {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}
.ws-pane__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 8px 16px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ws-pane__fb {
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--navy);
  font: 500 13px/1 var(--fu);
  cursor: pointer;
}
.ws-pane__fb:hover {
  color: var(--ink);
}
.ws-pane__hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--mute);
}
.ws-pane__ib:focus-visible,
.ws-pane__fb:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 0;
}

/* ---- Question paper and Mark scheme: a scrolling canvas, the host box for the real pages, and the boxes laid over it ---- */
.ws-paper {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ws-shell);
}
/* No side padding of the host itself: the engine fits the pages to the host's width. The shell (#e7eaef) adds its own margin.
   The host is a direct child of this box; the boxes laid over it (.ws-paper__ovl) are positioned from the top left corner of the content. */
.ws-paper__scroll {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  padding: 0 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
  scrollbar-gutter: stable both-edges;
}
.ws-paper__scroll:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}
/* the host: nothing but a box. A page is 794px (A4) or 816px (Letter) plus 28px of shell, so it is never wider than that and sits in the middle. */
.ws-pages {
  position: relative;
  max-width: var(--ws-nat, 822px);
  margin: 0 auto;
}

/* "Updating…" while pages are being drawn. It is there from the first change, but fades in only after half a second,
   so a quick redraw shows nothing at all. */
.ws-paper__chip {
  position: absolute;
  top: 10px;
  right: 18px;
  z-index: 5;
  pointer-events: none;
  animation: ws-pane-in 0.15s 0.5s both;
}
.ws-paper__err {
  position: absolute;
  top: 12px;
  right: 16px;
  left: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border: 1px solid #e6b8b3;
  border-radius: var(--r);
  background: var(--badbg);
  color: var(--bad);
  font-size: 13.5px;
  box-shadow: var(--sh);
}
.ws-paper__errt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ws-paper__errt > strong {
  font-weight: 600;
}
.ws-paper__errt > span {
  font-size: 12.5px;
  color: var(--ink2);
}

/* the empty sheet: shown with no picks, and while the first pages of a worksheet are being drawn.
   Its sizes follow the sheet's own width (cqw), so it keeps the proportions of a page at any pane width. */
.ws-paper__sheet {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 210 / 297;
  margin: 20px 10px 28px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 26px rgba(16, 26, 48, 0.2), 0 1px 3px rgba(16, 26, 48, 0.14);
}
.ws-paper__in {
  position: relative;
  height: 100%;
  padding: 4.25cqw 6.12cqw;
}
.ws-paper__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.36cqw;
  height: 5.6cqw;
  border-bottom: 1px solid #12294b;
}
.ws-paper__top::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 5.8cqw;
  height: 2px;
  background: var(--gold);
}
.ws-paper__logo {
  flex: none;
  width: 3.74cqw;
  height: 3.74cqw;
}
.ws-paper__org {
  flex: 1;
  color: #12294b;
  font: 600 1.7cqw/1.2 var(--fu);
}
.ws-paper__site {
  padding-top: 1cqw;
  color: #12294b;
  font: 600 1.45cqw/1.2 var(--fu);
}
.ws-paper__prod {
  margin-top: 2.4cqw;
  color: #12294b;
  font: 600 2.55cqw/1.2 var(--fd);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.ws-paper__prod > b {
  color: #b9800a;
  font-weight: 600;
}
.ws-paper__stitle {
  margin-top: 1.7cqw;
  overflow-wrap: anywhere;
  color: #12294b;
  font: 600 3.9cqw/1.15 var(--fd);
}
.ws-paper__sheet.is-untitled .ws-paper__stitle {
  color: var(--mute);
}
.ws-paper__rule {
  height: 1px;
  margin-top: 2cqw;
  background: var(--ws-gold-line);
}
.ws-paper__msg {
  position: absolute;
  top: 51cqw;
  right: 10.2cqw;
  left: 10.2cqw;
  text-align: center;
}
.ws-paper__sheet.is-wait .ws-paper__msg {
  display: none;
}
.ws-paper__msgt {
  color: var(--ink);
  font: 400 max(16px, 3.74cqw)/1.2 var(--fd);
}
.ws-paper__msgp {
  margin: 8px 0 0;
  color: var(--ink2);
  font: 400 max(13px, 2.38cqw)/1.5 var(--fu);
}

/* ---- the focus buttons and the tool strip, laid over each question card (question paper view only) ---- */
.ws-paper__ovl {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 0;
  z-index: 2;
  pointer-events: none;
}
.ws-paper__ov {
  position: absolute;
  pointer-events: none;
}
.ws-paper__hit {
  position: absolute;
  top: -5px;
  right: -6px;
  bottom: -5px;
  left: -8px;
  z-index: 1;
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}
.ws-paper__ov:hover > .ws-paper__hit,
.ws-paper__ov:focus-within > .ws-paper__hit,
.ws-paper__ov.is-cur > .ws-paper__hit {
  border-color: var(--navy);
}
.ws-paper__hit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.ws-paper__ov.is-new > .ws-paper__hit {
  animation: ws-pane-new 1.8s ease-out backwards;
}
.ws-paper__tools {
  position: absolute;
  top: -3px;
  left: calc(100% + 6px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 30px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(13, 31, 60, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}
.ws-paper__ov:hover > .ws-paper__tools,
.ws-paper__ov:focus-within > .ws-paper__tools,
.ws-paper__ov.is-cur > .ws-paper__tools {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
/* no room beside the page (a narrow pane): the strip sits inside the card, at its right edge */
.ws-paper__ov.is-in > .ws-paper__tools {
  top: 4px;
  right: 4px;
  left: auto;
}
.ws-paper__tool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
.ws-paper__tool + .ws-paper__tool {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.ws-paper__tool:hover {
  background: rgba(255, 255, 255, 0.14);
}
.ws-paper__tool:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.ws-paper__tool:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.ws-paper__tool .ws-ic {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}
@media (pointer: coarse) {
  .ws-paper__tools {
    width: 40px;
  }
  .ws-paper__tool {
    width: 40px;
    height: 40px;
  }
}

/* ---- Side by side (#wsSbs): the question paper and the mark scheme, each in its own scrolling column ---- */
.ws-sbs__cols {
  flex: 1;
  min-height: 0;
  display: flex;
}
.ws-sbs__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ws-sbs__rule {
  flex: none;
  width: 1px;
  background: var(--line);
}
.ws-sbs__head {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-height: 48px;
  padding: 6px 12px 6px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.ws-sbs__name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1.2 var(--fu);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* on a narrow column the button drops to its own row, still at the right */
.ws-sbs__open {
  margin-left: auto;
}
.ws-sbs__sq {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 1px;
  background: var(--navy);
}
.ws-sbs__sq--ms {
  background: var(--ok);
}
.ws-sbs__n {
  color: var(--ink2);
  font: 500 13px/1.2 var(--fu);
  white-space: nowrap;
}

/* ---- narrow screens: the pane stacks under the left pane and the page scrolls, so nothing scrolls inside the pane ---- */
@media (max-width: 979px) {
  .ws-pane__body,
  .ws-paper {
    flex: none;
  }
  .ws-pane__list,
  .ws-paper__scroll {
    flex: none;
    overflow: visible;
  }
  .ws-pane__foot {
    position: static;
  }
  .ws-sbs__cols {
    flex: none;
  }
}
@media (max-width: 759px) {
  .ws-sbs__cols {
    flex-direction: column;
  }
  .ws-sbs__rule {
    width: auto;
    height: 1px;
  }
}
@media (max-width: 599px) {
  .ws-pane__head {
    padding: 7px 12px 8px;
  }
  .ws-pane__head .ws-seg {
    flex: 1 1 100%;
  }
  .ws-pane__head .ws-seg > button {
    flex: 1;
    padding: 0 6px;
  }
  .ws-pane__tile .ws-k {
    white-space: normal;
    line-height: 1.3;
  }
  .ws-pane__mix .ws-bars__item {
    flex-wrap: wrap;
  }
  .ws-pane__mix .ws-bars__bar {
    min-width: 0;
  }
  .ws-pane__mix .ws-bars__legend {
    flex: 1 1 100%;
    width: auto;
    padding-left: 60px;
  }
  /* a row has little room here: the title and the line of facts wrap instead of being cut off */
  .ws-pane__t {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .ws-pane__sub {
    display: block;
    white-space: normal;
  }
  .ws-pane__sub > .ws-pane__give {
    overflow: visible;
  }
  .ws-pane__hint {
    flex: 1 1 100%;
    margin-left: 0;
  }
}
@media (pointer: coarse) {
  .ws-pane__ib {
    width: 40px;
    height: 44px;
  }
  .ws-pane__fb {
    height: 44px;
  }
}


/* ==========================================================================
   9 Additions to sections 0 to 4, written with the views
   ========================================================================== */

/* ---- page frame (frame.js) ---- */

@keyframes ws-frame-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- page bar: "Checking: <title>" while Side by side is on ---- */
.ws-bar__check {
  min-width: 0;
  max-width: min(440px, 100%);
  padding-bottom: 13px;
  overflow: hidden;
  color: var(--ink2);
  font-size: 13.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-bar__check strong {
  font-weight: 600;
  color: var(--ink);
}

/* ---- a button that is working: full strength, a small ring in front of the words ---- */
.ws-bottom .ws-btn.is-busy,
.ws-drawer .ws-btn.is-busy {
  opacity: 1;
  cursor: progress;
}
.ws-bottom .ws-btn.is-busy::before,
.ws-drawer .ws-btn.is-busy::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ws-frame-spin 0.8s linear infinite;
}

/* ---- bottom bar ---- */
.ws-bottom .ws-btn--gold {
  min-width: 0;
  max-width: 360px;
}
.ws-gold__t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the one small line under the Download choices */
.ws-menu__note {
  margin: 4px 0 0;
  padding: 8px 14px 4px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 12px;
  line-height: 1.4;
  text-wrap: balance;
}

/* ---- My worksheets ---- */
.ws-drawer__top {
  padding: 16px 0 4px;
}
.ws-drawer__guard {
  margin: 12px 0 4px;
}
.ws-drawer__foot {
  flex: none;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ws-drawer__foot .ws-link {
  color: var(--ink2);
}
.ws-drawer__foot .ws-link:hover {
  color: var(--ink);
}
.ws-drawer__state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 0;
  color: var(--ink2);
  font-size: 14px;
}
.ws-drawer__retry {
  margin-top: 14px;
}
.ws-wk__spin {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: ws-frame-spin 0.8s linear infinite;
}

/* a saved worksheet: title (and a chip), a line of facts, and Open / Delete */
.ws-wk-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.ws-wk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ws-wk__t {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-wk > .ws-tag {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.ws-wk:has(> .ws-tag) .ws-wk__t {
  grid-column: 1;
}
.ws-wk__sub {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  color: var(--ink2);
  font-size: 12.5px;
  line-height: 1.4;
}
.ws-wk__acts {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.ws-wk__ask {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.ws-wk__ask.is-busy {
  color: var(--ink2);
  font-weight: 400;
}
.ws-wk .ws-btn.ws-wk__yes {
  border-color: var(--bad);
  color: var(--bad);
}
.ws-wk .ws-btn.ws-wk__yes:hover {
  background: var(--badbg);
}

@media (max-width: 599px) {
  /* the Download menu hangs from the whole bar here, because its button sits mid-row and the menu is wider than the room to its left */
  .ws-bottom .ws-anchor {
    position: static;
  }
  .ws-bottom .ws-menu {
    right: 12px;
    width: min(280px, calc(100vw - 24px));
  }
  .ws-bottom .ws-btn--gold {
    max-width: none;
  }
  /* a long progress message in the gold button is cut with an ellipsis instead of pushing the bar wider than the screen */
  .ws-bottom__act {
    min-width: 0;
  }
  /* "Not saved yet" and Save: the main sheet pulls Save 14px left, which is the whole gap here */
  .ws-bar__tools > .ws-save.is-dirty + .ws-btn {
    margin-left: -8px;
  }
  /* "Checking: <title>" gets a line to itself under the tabs */
  .ws-bar__check {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    padding-bottom: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-bottom .ws-btn.is-busy::before,
  .ws-drawer .ws-btn.is-busy::before,
  .ws-wk__spin {
    animation: none;
  }
}


/* ---- start and pick screens (pick.js) ---- */

/* a select that is busy (the subject is loading): the words change, the box stays where it is */
.ws-select.is-busy {
  color: var(--ink2);
  font-weight: 400;
  cursor: progress;
}
.ws-btn.is-busy {
  cursor: progress;
}
.ws-row:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* an announcement for screen readers only (Added as Q3, Removed from your worksheet) */
.ws-pick__live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* chips sit in the result bar's own row: their wrapper takes no box */
.ws-result__chips {
  display: contents;
}

/* a muted line inside a panel */
.ws-pick__muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--mute);
}
/* under the "leave out what this student has had" picker: what the record covers */
.ws-pick__since {
  margin-top: 8px;
}

/* Start: the error under the three pickers */
.ws-start__err:not(:empty) {
  margin-top: 12px;
}
.ws-start__err .ws-note {
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* ---- the results area: loading, error, nothing chosen, nothing found ---- */
.ws-pick__state {
  padding: 28px 20px;
  color: var(--ink2);
  font-size: 14px;
}
.ws-pick__state .ws-note {
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.ws-pick__spin {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 10px;
  border: 2px solid var(--line);
  border-top-color: var(--navy);
  border-radius: 50%;
  vertical-align: -3px;
  animation: ws-pick-spin 0.8s linear infinite;
}
@keyframes ws-pick-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-pick__spin {
    animation: none;
  }
}
.ws-list .ws-empty .ws-btn {
  margin-top: 16px;
}
.ws-list__more {
  display: flex;
  justify-content: center;
  padding: 16px 20px 28px;
}

/* the line above the list while it shows "More like this" */
.ws-pick__like {
  flex: none;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink2);
}
.ws-pick__like strong {
  font-weight: 600;
  color: var(--ink);
}
@media (max-width: 599px) {
  .ws-pick__like {
    padding: 9px 12px;
  }
}

/* Topic and Source wait for a subject: dimmed until then */
.ws-hand .ws-select:disabled,
.ws-pickers .ws-select:disabled {
  opacity: 0.55;
}

/* ---- cards ---- */
.ws-card > .ws-q {
  cursor: pointer;
}
/* the small paper head: one line, the topic gives way first */
.ws-open__qh {
  min-width: 0;
}
.ws-open__qn,
.ws-open__qm {
  flex: none;
  white-space: nowrap;
}
.ws-open__qt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-open__none {
  margin: 0;
  padding: 2px 0;
  font: 400 13.5px/1.5 var(--fu);
  color: var(--ink2);
}

/* ---- Topic: the third level (a topic with its own sub-topics) and a root topic ---- */
.ws-tree__area .ws-check__n {
  margin-left: auto;
}
.ws-tree__area--sub {
  height: 34px;
  gap: 12px;
  padding: 0 14px 0 36px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-size: 14px;
}
.ws-tree__topics.ws-tree__topics--sub {
  border-bottom: 0;
}
.ws-tree__topics.ws-tree__topics--sub .ws-check {
  padding-left: 58px;
}
.ws-check.is-zero .ws-check__t {
  color: var(--mute);
}
.ws-tree__empty {
  margin: 0;
}

/* ---- More filters: the list of students opens in the panel (a panel inside a panel would be clipped) ---- */
.ws-pick__students {
  position: static;
  width: auto;
  max-width: none;
  max-height: 224px;
  margin-top: 6px;
  overflow-y: auto;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: var(--ws-thumb) transparent;
}
.ws-pick__students .ws-menu__item {
  min-height: 40px;
}
.ws-pick__students .ws-menu__item--two {
  min-height: 48px;
}
.ws-pick__students .ws-menu__item > span:first-child {
  flex: 1;
  min-width: 0;
}

/* the sort menu is short: keep it under its button, never wider than the pane */
.ws-result__sort .ws-menu--down {
  right: 0;
  max-width: calc(100vw - 40px);
}

/* paragraphs inside a result card sit a little closer than on a printed page */
.ws-q .ltx-paragraph {
  margin-bottom: 0.25em;
}

/* the way out on the "did not load" screen */
body.app26 .fp-overlay .ws-gate__old {
  margin-top: 18px;
  color: var(--navy);
  font: 500 14.5px/1.4 var(--fu);
  text-decoration: underline;
  text-underline-offset: 3px;
}
