/* Printable worksheets (in the app and as static pages). Plain black on
   white with one accent colour, sized for A4 / Letter. */

.ws {
  --ws-ink: #1b1d24;
  --ws-muted: #5d6270;
  --ws-line: #c9c6bd;
  --ws-accent: #2a51c0;
  box-sizing: border-box;
  max-width: 210mm; margin: 0 auto; padding: 14mm 14mm 10mm;
  background: #fff; color: var(--ws-ink);
  font: 11pt/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.ws * { box-sizing: border-box; }
.ws h1 { font-size: 20pt; margin: 2mm 0 3mm; line-height: 1.2; }
.ws h2 { font-size: 13pt; margin: 0 0 3mm; display: flex; align-items: center; gap: 6px; }
.ws p { margin: 0 0 1.5mm; }
.ws .ru { font-size: 1.12em; font-weight: 600; }
.ws .st { position: relative; }
.ws .st::after { content: ""; position: absolute; left: 50%; top: -.05em; width: .28em; height: .09em; background: currentColor; transform: translateX(-30%) rotate(-55deg); border-radius: 1px; }

.ws-head { border-bottom: 2px solid var(--ws-ink); padding-bottom: 3mm; margin-bottom: 5mm; }
.ws-brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 11pt; }
.ws-logo { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--ws-accent); color: #fff; font-size: 10pt; }
.ws-course { font-weight: 600; color: var(--ws-muted); margin-left: auto; }
.ws-kicker { color: var(--ws-muted); font-size: 9.5pt; text-transform: uppercase; letter-spacing: .06em; margin-top: 3mm !important; }
.ws-name { display: flex; justify-content: space-between; gap: 8mm; color: var(--ws-muted); font-size: 10pt; }

.ws-sec { margin-bottom: 6mm; break-inside: avoid; }
.ws-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ws-ink); color: #fff; font-size: 10pt; }
.ws-hint, .ws-sub { color: var(--ws-muted); font-size: 9pt; }
.ws-sub { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ws-pron { color: var(--ws-muted); font-size: 9.5pt; }

.ws-letters { display: grid; gap: 4mm; }
.ws-letter { display: grid; grid-template-columns: 22mm 1fr; gap: 2mm 5mm; align-items: center; padding: 3mm; border: 1px solid var(--ws-line); border-radius: 3mm; break-inside: avoid; }
.ws-glyph .ru { font-size: 26pt; font-weight: 700; }
.ws-trace { grid-column: 1 / -1; display: flex; gap: 2mm; flex-wrap: wrap; }
.ws-trace-l, .ws-box { width: 12mm; height: 14mm; border-bottom: 1px solid var(--ws-line); display: grid; place-items: center; font-size: 22pt; font-weight: 300; color: #d4d1c8; }
.ws-box { border: 1px dashed var(--ws-line); border-radius: 2mm; }

.ws-table { width: 100%; border-collapse: collapse; }
.ws-table th { text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: .05em; color: var(--ws-muted); border-bottom: 1.5px solid var(--ws-ink); padding: 1.5mm 2mm; }
.ws-table td { border-bottom: 1px solid var(--ws-line); padding: 2mm; vertical-align: top; }
.ws-table small { color: var(--ws-muted); }
.ws-phrases { padding-left: 6mm; margin: 0; display: grid; gap: 3mm; }

.ws-ex-title { font-size: 16pt !important; margin-bottom: 5mm !important; }
.ws-match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8mm; }
.ws-match ol { margin: 0; padding-left: 7mm; display: grid; gap: 3mm; }
.ws-blank-s { color: var(--ws-line); margin-left: 2mm; }
.ws-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8mm; }
.ws-two ol, .ws-copy, .ws-scramble { margin: 0; padding-left: 6mm; display: grid; gap: 4mm; }
.ws-line { display: inline-block; vertical-align: bottom; width: 30mm; border-bottom: 1px solid var(--ws-ink); height: 1.2em; margin-left: 2mm; }
.ws-line-wide { width: 70mm; }
.ws-line-full { display: block; width: 100%; margin: 3mm 0 0; }
.ws-tiles { display: flex; flex-wrap: wrap; gap: 2mm; }
.ws-tiles span { padding: 1mm 3mm; border: 1px solid var(--ws-line); border-radius: 2mm; font-weight: 600; }
.ws-en { color: var(--ws-muted); }
.ws-answers p { font-size: 10pt; }
.ws-foot { margin-top: 8mm; padding-top: 3mm; border-top: 1px solid var(--ws-line); color: var(--ws-muted); font-size: 8.5pt; }
.ws-page-break { break-before: page; height: 0; }

/* On screen: paper on a grey desk. */
@media screen {
  .ws { margin: 16px auto; border-radius: 6px; border: 1px solid #ddd9cf; }
  .ws-page-break { border-top: 2px dashed #ddd9cf; margin: 8mm -14mm; height: 0; }
}
@media screen and (max-width: 640px) {
  .ws { padding: 18px 14px; margin: 0; border: 0; border-radius: 0; font-size: 10.5pt; }
  .ws-match, .ws-two { grid-template-columns: 1fr; gap: 4mm; }
  .ws-page-break { margin: 6mm -14px; }
}
@page { size: A4; margin: 10mm; }
@media print {
  .ws { padding: 0; max-width: none; border: 0; margin: 0; }
}

/* QR code to the online lesson (class link) */
.ws-head.has-qr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6mm; align-items: start; }
.ws-qr { width: 26mm; display: flex; flex-direction: column; align-items: center; gap: 1mm; text-align: center; font-size: 7.5pt; line-height: 1.2; color: var(--ws-muted); }
.ws-qr svg { width: 26mm; height: 26mm; display: block; }

/* Math problems */
.ws-math { margin: 0; padding-left: 8mm; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5mm 10mm; font-size: 12pt; }
.ws-math .ws-line { width: 22mm; }
.ws-ans { white-space: nowrap; }
@media screen and (max-width: 640px) {
  .ws-math { grid-template-columns: 1fr; }
  .ws-qr { width: 22mm; } .ws-qr svg { width: 22mm; height: 22mm; }
}

/* Gapped texts */
.ws-cloze { line-height: 2.3; font-size: 11.5pt; margin: 3mm 0 !important; }
.ws-read { line-height: 1.6; font-size: 11.5pt; margin: 2mm 0 3mm !important; }
.ws-qs { margin: 0; padding-left: 6mm; display: flex; flex-direction: column; gap: 2.5mm; }
.ws-qs p { margin: 0; }
.ws-choices { display: flex; flex-wrap: wrap; gap: 1mm 6mm; margin-top: 1mm !important; }
.ws-box { display: inline-block; width: 3.2mm; height: 3.2mm; border: 1px solid #444; border-radius: .6mm; vertical-align: -0.4mm; margin-right: 1mm; }
.ws-gap { display: inline-block; min-width: 26mm; border-bottom: 1px solid var(--ws-ink); text-align: left; font-size: 7pt; color: var(--ws-muted); vertical-align: baseline; line-height: 1; margin: 0 1mm; }

/* Small screens: writing lines shrink with the page. */
@media screen and (max-width: 640px) {
  .ws-line { max-width: 40%; }
  .ws-line-wide { max-width: 60%; }
  .ws-match, .ws-two { grid-template-columns: minmax(0, 1fr); }
  .ws-name { flex-wrap: wrap; }
  .ws { overflow-wrap: anywhere; }
}
.ws-copy, .ws-scramble, .ws-two ol, .ws-match ol, .ws-phrases { grid-template-columns: minmax(0, 1fr); }

/* Whole math tasks (FOS): stem, table, parts a) b) c), worked solutions */
.ws-tab { border-collapse: collapse; margin: 6px 0; }
.ws-tab th, .ws-tab td { border: 1px solid var(--ws-line); padding: 2px 8px; text-align: center; }
.ws-parts { padding-left: 1.2em; list-style: none; }
.ws-parts li { margin: 6px 0; }
.ws-choices { display: block; margin-top: 2px; }
.ws-sol h3 { margin: 10px 0 2px; font-size: 1rem; }
