:root {
  --bg: #f6f7fb;
  --ink: #172033;
  --muted: #667085;
  --line: #d9deea;
  --panel: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --mint: #e8f8f0;
  --sun: #fff4d6;
  --rose: #fff0f3;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.subject-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 76px;
  padding: 18px 12px;
  overflow: hidden;
  color: #f8fafc;
  background: #111827;
  transition: width 180ms ease;
}

.subject-nav:hover,
.subject-nav:focus-within {
  width: 212px;
}

.subject-nav.nav-dismissed {
  width: 76px;
}

.brand-mark,
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  color: inherit;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  white-space: nowrap;
}

.brand-mark {
  margin-bottom: 20px;
  color: #ffffff;
  font-weight: 800;
}

.brand-mark svg {
  color: #93c5fd;
}

.nav-item {
  margin: 6px 0;
  color: #cbd5e1;
  text-align: left;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  outline: 0;
}

.install-nav-item {
  margin-top: 18px;
}

.brand-mark span,
.nav-item span {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.subject-nav:hover span,
.subject-nav:focus-within span {
  opacity: 1;
  transform: translateX(0);
}

.workspace {
  width: 100%;
  margin-left: 76px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1420px;
  margin: 0 auto 16px;
}

.home-link {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  text-decoration: underline;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.section-view {
  display: none;
  max-width: 1420px;
  margin: 0 auto;
}

.section-view.active {
  display: block;
}

.landing-view {
  max-width: none;
}

.landing-shell {
  position: relative;
  display: grid;
  align-content: center;
  min-height: calc(100vh - 112px);
  padding: clamp(34px, 7vw, 82px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    #eef6ff;
  box-shadow: var(--shadow);
}

.landing-curves {
  position: absolute;
  inset: 0;
  color: rgba(37, 99, 235, 0.2);
  pointer-events: none;
}

.landing-curves svg {
  width: 100%;
  height: 100%;
  stroke-width: 2;
}

.landing-curves path:nth-child(2) {
  color: rgba(16, 185, 129, 0.18);
}

.landing-curves path:nth-child(3) {
  color: rgba(244, 63, 94, 0.15);
}

.landing-curves path:nth-child(4) {
  color: rgba(234, 179, 8, 0.16);
}

.landing-content,
.quick-access {
  position: relative;
}

.landing-content {
  max-width: 920px;
}

.landing-content h2 {
  max-width: 900px;
  margin: 0;
  color: #111827;
  font-size: clamp(2.55rem, 7vw, 5.85rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.landing-lede {
  max-width: 680px;
  margin: 22px 0 0;
  color: #344054;
  font-size: clamp(1.04rem, 2vw, 1.28rem);
  line-height: 1.45;
}

.landing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.landing-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 999px;
  color: #111827;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
}

.quick-access {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1120px;
  margin-top: clamp(34px, 6vw, 62px);
}

.quick-card {
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  color: #172033;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 35px rgba(23, 32, 51, 0.08);
}

.quick-card:hover,
.quick-card:focus-visible {
  border-color: rgba(17, 24, 39, 0.22);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  transform: translateY(-2px);
}

.quick-card strong {
  font-size: 1.15rem;
}

.quick-card > span:last-child {
  color: #475467;
  font-size: 0.95rem;
  line-height: 1.42;
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
}

.accent-green {
  border-top-color: #059669;
}

.accent-green .quick-icon {
  color: #047857;
  background: rgba(5, 150, 105, 0.1);
}

.accent-gold {
  border-top-color: #ca8a04;
}

.accent-gold .quick-icon {
  color: #a16207;
  background: rgba(202, 138, 4, 0.12);
}

.accent-rose {
  border-top-color: #e11d48;
}

.accent-rose .quick-icon {
  color: #be123c;
  background: rgba(225, 29, 72, 0.1);
}

.panel-strip {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 260px;
  gap: 18px;
  margin-bottom: 16px;
}

.controls-panel,
.tips-panel,
.placeholder-view {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tips-panel {
  background: #ffffff;
}

.tips-panel p,
.placeholder-view p {
  margin: 8px 0 0;
  color: #475467;
  line-height: 1.4;
}

.panel-heading,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 168px));
  gap: 14px;
  justify-content: start;
  margin-top: 18px;
}

.title-control {
  grid-column: span 2;
  min-width: 350px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 0.87rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #ffffff;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
}

details {
  min-width: 0;
}

legend {
  padding: 0 4px;
  color: #344054;
  font-size: 0.87rem;
  font-weight: 750;
}

input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
}

.english-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
}

.question-options {
  grid-column: span 3;
  min-width: 420px;
  padding: 12px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #ffffff;
}

.question-options summary {
  color: #344054;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.question-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin-top: 12px;
}

.question-type-grid label,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

.question-type-grid label > span,
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.question-type-count {
  width: 64px;
  min-height: 36px;
  padding: 6px 8px;
}

.toggle-control {
  align-self: end;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(37, 99, 235, 0.16);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.primary-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
}

.primary-button:hover,
.primary-icon-button:hover {
  background: var(--accent-dark);
}

.primary-icon-button {
  color: #ffffff;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
}

.secondary-button,
.ghost-button,
.icon-button {
  color: var(--ink);
  border: 1px solid #cfd6e4;
  background: #ffffff;
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: #9aa6bd;
}

.icon-button,
.primary-icon-button {
  width: 42px;
  padding: 0;
}

.page-status {
  display: block;
  min-height: 0;
  margin: 10px 0 0;
  padding: 14px;
  color: #155e35;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  font-weight: 800;
  line-height: 1.35;
}

.page-status.warning {
  color: #854d0e;
  border-color: #fde68a;
  background: #fffbeb;
}

.info-stack {
  display: grid;
  align-content: start;
  gap: 10px;
}

.worksheet-stage {
  padding: 26px;
  border-radius: 8px;
  background: #e6eaf2;
  overflow: auto;
}

.downloads-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.downloads-heading h2 {
  font-size: clamp(26px, 4vw, 36px);
  margin: 8px 0 12px;
}

.downloads-heading > p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(180px, 290px) minmax(0, 1fr);
  max-width: 1060px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.download-cover {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px;
  background: #e8f0eb;
}

.download-cover img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #cfd6e4;
  box-shadow: 0 8px 22px #17203318;
}

.download-details {
  padding: 28px;
}

.download-details h3 {
  margin: 10px 0 14px;
  font-size: 26px;
}

.download-details p,
.download-contents {
  line-height: 1.65;
}

.download-tags,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.download-tags span {
  padding: 5px 10px;
  border-radius: 6px;
  background: #f0f3f8;
  font-size: 12px;
  font-weight: 650;
}

.download-contents {
  padding-left: 22px;
  font-size: 14px;
}

.download-note {
  font-size: 13px;
  color: var(--muted);
}

.download-actions {
  margin-top: 22px;
}

.download-actions a {
  display: inline-block;
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.download-primary {
  color: white;
  background: var(--accent);
}

.download-primary:hover {
  background: var(--accent-dark);
}

.download-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
}

.download-actions a:focus-visible,
.download-cover:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .download-card { grid-template-columns: 1fr; }
  .download-cover img { max-width: 220px; }
  .download-details { padding: 22px; }
}

.worksheet-preview {
  display: grid;
  gap: 26px;
  justify-items: center;
}

.worksheet-page {
  display: flex;
  position: relative;
  flex-direction: column;
  width: 8.5in;
  height: 11in;
  margin: 0 auto;
  padding: 0.48in;
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(23, 32, 51, 0.18);
  overflow: hidden;
}

.worksheet-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: none;
}

.worksheet-header h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.student-fields {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  white-space: nowrap;
}

.student-fields p {
  margin: 0;
}

.field-line {
  color: var(--sheet-ink, #1D2330);
  font-size: 0.9rem;
  font-weight: 750;
}

.field-line span {
  display: inline-block;
  width: 132px;
  border-bottom: 1.5px solid #111827;
  transform: translateY(-2px);
}

.field-line.date span {
  width: 88px;
}

.continuation-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sheet-ink, #1D2330);
  color: var(--sheet-ink, #1D2330);
  font-weight: 800;
}

.phonics-header {
  grid-template-columns: 1fr;
  gap: 14px;
}

.phonics-header .student-fields {
  justify-content: flex-start;
}

.phonics-focus {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 8px;
}

.phonics-focus > span {
  font-size: 28px;
  letter-spacing: 5px;
}

.phonics-focus small {
  margin-left: auto;
}

.phonics-section {
  margin-top: 24px;
  break-inside: avoid;
}

.phonics-section h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.phonics-section p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}

.phonics-sound-rows {
  display: grid;
  gap: 10px;
}

.phonics-sound-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 6px;
  font-size: 32px;
}

.phonics-sound-row > strong {
  width: 30px;
}

.phonics-letter-choices {
  display: flex;
  justify-content: space-around;
  flex: 1;
}

.phonics-letter-choices > span {
  min-width: 28px;
  text-align: center;
}

.phonics-write-line {
  display: inline-block;
  min-width: 80px;
  height: 36px;
  border-bottom: 1px solid var(--sheet-ink, #1D2330);
}

.phonics-word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.phonics-blend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 12px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 6px;
}

.phonics-sound-boxes {
  display: flex;
  gap: 8px;
  font-size: 30px;
}

.phonics-sound-boxes > span {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 20px;
}

.phonics-sound-boxes i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #111827;
}

.phonics-read-word {
  font-size: 25px;
}

.phonics-blend-card .phonics-write-line {
  min-width: 60px;
}

.phonics-word-bank {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--sheet-ink, #1D2330);
  font-size: 23px;
}

.phonics-missing-card {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 8px 16px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 6px;
  font-size: 38px;
  letter-spacing: 8px;
}

.phonics-missing-card small {
  font-size: 14px;
  letter-spacing: 0;
}

.phonics-letter-blank {
  display: inline-block;
  width: 32px;
  margin-right: 8px;
  border-bottom: 1px solid var(--sheet-ink, #1D2330);
}

.phonics-mixed .phonics-section {
  margin-top: 12px;
}

.phonics-mixed .phonics-sound-rows {
  gap: 6px;
}

.phonics-mixed .phonics-sound-row {
  padding: 2px 16px;
  font-size: 28px;
}

.phonics-mixed .phonics-blend-card {
  padding: 6px 12px;
}

.phonics-mixed .phonics-missing-card {
  min-height: 48px;
  font-size: 32px;
}

.phonics-answer-list li {
  margin: 14px 0;
  line-height: 1.5;
}

.worksheet-page-body {
  flex: 1;
  min-height: 0;
}

.problem-grid {
  display: grid;
  gap: 22px 30px;
  margin-top: 28px;
}

.ten-frame-grid {
  gap: 14px 22px;
}

.mult-table-grid {
  display: block;
  margin-top: 24px;
}

.problem-grid.columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.problem-grid.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.problem-grid.columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 14px;
}

.problem {
  min-width: 0;
  min-height: 46px;
  break-inside: avoid;
  page-break-inside: avoid;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.28rem;
  color: #111827;
}

.problem.horizontal {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.4;
  min-width: 0;
}

.problem-number {
  color: var(--sheet-ink, #1D2330);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
}

.answer-line {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 54px;
  min-height: 1.25em;
  padding-bottom: 1px;
  border-bottom: 2px solid #111827;
  line-height: 1;
  text-align: center;
  transform: translateY(0.14em);
}

.columns-4 .problem {
  font-size: 1.08rem;
}

.columns-4 .problem.horizontal {
  gap: 5px;
}

.columns-4 .problem-number {
  font-size: 0.78rem;
}

.columns-4 .answer-line {
  min-width: 34px;
}

.missing-problem {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.missing-blank {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 52px;
  min-height: 1.25em;
  padding-bottom: 1px;
  border-bottom: 2px solid #111827;
  line-height: 1;
  text-align: center;
  transform: translateY(0.14em);
}

.visual-problem {
  display: grid;
  gap: 8px;
  min-height: 122px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
}

.ten-frame-problem {
  min-height: 130px;
}

.visual-model-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.visual-equation {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.15rem;
}

.rounding-problem {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 76px;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.05rem;
  line-height: 1.35;
}

.rounding-problem > span:nth-child(2) {
  flex: 1;
}

.multiplication-table {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  width: min(100%, 7.4in);
  margin: 0 auto;
  border: 2px solid #111827;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 750;
}

.multiplication-table .key-answer { color: var(--key-ink); font-weight: 500; }

.multiplication-table.size-12 {
  grid-template-columns: repeat(13, minmax(0, 1fr));
  font-size: 0.86rem;
}

.multiplication-table span {
  display: grid;
  place-items: center;
  min-height: 0.6in;
  border-right: 1px solid var(--sheet-ink, #1D2330);
  border-bottom: 1px solid var(--sheet-ink, #1D2330);
}

.multiplication-table.size-12 span {
  min-height: 0.5in;
}

.multiplication-table span:nth-child(11n) {
  border-right: 0;
}

.multiplication-table.size-12 span:nth-child(11n) {
  border-right: 1px solid var(--sheet-ink, #1D2330);
}

.multiplication-table.size-12 span:nth-child(13n) {
  border-right: 0;
}

.table-corner,
.table-header-cell {
  background: #E6E6E6; /* the one tint (Verify R9: grey 238 was off-tint) */
  color: #111827;
}

.table-product-cell {
  color: #111827;
}

.ten-frame-equation {
  justify-content: center;
  width: calc(100% - 34px);
  margin-left: 34px;
  font-size: 1.35rem;
}

.ten-frame-set {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  grid-template-rows: repeat(2, 26px);
  gap: 0;
  border: 2px solid var(--sheet-ink, #1D2330);
  background: #ffffff;
}

.ten-cell {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border-right: 2px solid var(--sheet-ink, #1D2330);
  border-bottom: 2px solid var(--sheet-ink, #1D2330);
}

.ten-cell:nth-child(5n) {
  border-right: 0;
}

.ten-cell:nth-child(n + 6) {
  border-bottom: 0;
}

.ten-cell.filled::before {
  display: block;
  width: 0;
  height: 0;
  margin: 0;
  border: 8.5px solid #111111;
  border-radius: 50%;
  content: "";
}

.ten-cell.crossed::after {
  position: absolute;
  width: 26px;
  height: 0;
  border-top: 2px solid #b91c1c;
  content: "";
  transform: rotate(-35deg);
}

.ten-cell {
  position: relative;
}

.picture-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.picture-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 190px;
}

.picture-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
}

.picture-icon.apple {
  color: #dc2626;
}

.picture-icon.orange {
  color: #ea580c;
}

.picture-icon.star {
  color: #ca8a04;
}

.picture-icon.heart {
  color: #e11d48;
}

.picture-icon.book {
  color: #2563eb;
}

.picture-icon.pencil {
  color: var(--sheet-ink, #1D2330);
}

.crossed-icon {
  position: relative;
  display: inline-flex;
}

.crossed-icon::after {
  position: absolute;
  top: 50%;
  left: -2px;
  width: calc(100% + 4px);
  height: 2px;
  background: #b91c1c;
  content: "";
  transform: rotate(-35deg);
}

.vertical-problem {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  align-items: end;
  min-width: 86px;
  text-align: right;
}

.vertical-problem .operator {
  text-align: left;
}

.vertical-problem .rule {
  grid-column: 1 / -1;
  border-top: 2px solid #111827;
  min-height: 10px;
}

.vertical-problem .vertical-answer {
  grid-column: 1 / -1;
  min-height: 26px;
  text-align: right;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px 18px;
  margin-top: 28px;
  color: var(--sheet-ink, #1D2330);
  font-weight: 700;
}

.geo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 150px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.geo-tile .problem-number {
  align-self: flex-start;
}

.shape-icon {
  width: 84px;
  height: 84px;
  stroke: var(--sheet-ink, #1D2330);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
}

.geo-match-shapes .shape-icon,
.geo-fev-shape .shape-icon {
  width: 46px;
  height: 46px;
}

.geo-name-line,
.geo-count-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 90px;
  min-height: 1.3em;
  padding-bottom: 2px;
  border-bottom: 2px solid #111827;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  color: #111827;
}

.geo-match-columns {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 60px;
  margin-top: 10px;
}

.geo-match-shapes,
.geo-match-names {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.geo-match-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.geo-match-number,
.geo-match-letter {
  min-width: 22px;
  font-weight: 800;
  color: var(--sheet-ink, #1D2330);
}

.geo-match-name {
  font-size: 1.05rem;
  color: #111827;
  font-weight: 600;
}

.geo-match-answer {
  margin-left: auto;
  font-weight: 800;
  color: #1d4ed8;
}

.geo-fev-table {
  grid-column: 1 / -1;
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.geo-fev-table th,
.geo-fev-table td {
  border: 1px solid var(--sheet-ink, #1D2330);
  padding: 10px 12px;
  text-align: center;
}

.geo-fev-table th {
  background: #f2f4f7;
  font-size: 0.85rem;
  color: var(--sheet-ink, #1D2330);
}

.geo-fev-shape {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 600;
}

.geo-fev-blank {
  min-width: 60px;
  font-weight: 700;
}

.reading-passage {
  margin-top: 18px;
  color: #111827;
  font-size: 1.02rem;
  line-height: 1.55;
}

.reading-passage p {
  margin: 0 0 12px;
}

.passage-word-bank {
  float: right;
  width: 2.45in;
  margin: 0 0 10px 16px;
  padding: 10px;
  border: 1.5px solid #111827;
  background: #f8fafc;
}

.passage-word-bank h3 {
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--sheet-ink, #1D2330);
  font-size: 0.95rem;
  line-height: 1.1;
  text-align: center;
}

.passage-word-bank span {
  display: block;
  margin: 5px 0;
  color: #111827;
  font-size: 0.94rem;
  font-weight: 750;
}

.passage-word-bank em {
  color: var(--sheet-ink, #1D2330);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 650;
}

.passage-word-bank em strong {
  color: #111827;
  font-weight: 850;
}

.compact-reading-page .reading-passage {
  font-size: 0.96rem;
  line-height: 1.45;
}

.compact-reading-page .reading-passage p {
  margin-bottom: 9px;
}

.compact-reading-page .passage-word-bank {
  width: 2.35in;
  padding: 8px;
}

.compact-reading-page .passage-word-bank span {
  margin: 3px 0;
  font-size: 0.88rem;
}

.reading-questions {
  display: grid;
  gap: 12px;
  margin: 8px 0 0;
  padding-left: 22px;
  color: #111827;
  font-size: 0.98rem;
  line-height: 1.4;
}

.reading-questions li {
  break-inside: avoid;
  page-break-inside: avoid;
}

.reading-question-groups {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  clear: both;
}

.question-group {
  break-inside: auto;
  page-break-inside: auto;
}

.question-group h3 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  line-height: 1.2;
}

.section-word-bank {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 8px;
  color: var(--sheet-ink, #1D2330);
  background: #f8fafc;
  font-size: 0.92rem;
}

.section-word-bank strong {
  color: #111827;
}

.section-word-bank span {
  font-weight: 750;
}

.word-search-page-content {
  margin-top: 28px;
}

.word-search-page-content .question-group {
  min-height: 7.2in;
}

.wide-blank {
  display: inline-block;
  width: 1.9in;
  border-bottom: 2px solid #111827;
  transform: translateY(0.08em);
}

.short-answer-lines {
  display: grid;
  gap: 28px;
  margin-top: 18px;
  margin-bottom: 8px;
}

.short-answer-lines span {
  display: block;
  width: min(100%, 5.9in);
  min-height: 16px;
  border-bottom: 1.5px solid #111827;
}

.choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  margin-top: 7px;
  color: var(--sheet-ink, #1D2330);
}

.matching-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 8px;
}

.question-note {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 8px;
  color: var(--sheet-ink, #1D2330);
  font-weight: 750;
}

.somali-vocabulary-page {
  margin-top: 24px;
}

.somali-double-vowel-groups {
  display: grid;
  gap: 14px;
}

.somali-vowel-part {
  break-inside: avoid;
  page-break-inside: avoid;
}

.somali-vowel-part h3,
.somali-practice-section h3,
.somali-question-block h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.somali-mini-card-grid,
.somali-picture-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.somali-picture-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 112px;
  padding: 8px;
  border: 1px solid var(--sheet-ink, #1D2330);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.somali-picture-card strong {
  color: #111827;
  font-size: 1.08rem;
}

.somali-alphabet-sheet {
  display: grid;
  align-content: start;
  min-height: 840px;
}

.somali-alphabet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.somali-alphabet-card {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #ffffff;
}

.somali-alphabet-card strong {
  color: #111827;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  letter-spacing: 0;
}

.somali-activity-sheet {
  display: grid;
  align-content: start;
  gap: 28px;
  min-height: 840px;
}

.somali-activity-instruction {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #111827;
  border-radius: 8px;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 850;
}

.somali-odd-one-grid,
.somali-connect-grid {
  display: grid;
  gap: 26px;
}

.somali-activity-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 160px;
  padding: 12px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #ffffff;
}

.somali-connect-grid .somali-activity-row {
  min-height: 150px;
}

.somali-activity-cell {
  display: grid;
  place-items: center;
  min-height: 122px;
}

.somali-activity-icon {
  display: inline-grid;
  place-items: center;
  width: 104px;
  height: 104px;
  color: #111827;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 4.2rem;
  line-height: 1;
}

.somali-activity-icon-fish-reverse {
  transform: scaleX(-1);
}

.somali-path-grid {
  display: grid;
  gap: 30px;
}

.somali-path-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  align-items: center;
  min-height: 170px;
  padding: 14px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #ffffff;
}

.somali-path-row .somali-activity-icon {
  width: 112px;
  height: 112px;
}

.somali-path-drawing-space {
  min-height: 130px;
}

.somali-pattern-grid {
  display: grid;
  gap: 28px;
}

.somali-pattern-row {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 18px;
  min-height: 170px;
  padding: 14px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #ffffff;
}

.somali-pattern-start,
.somali-pattern-blanks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.somali-pattern-row .somali-activity-icon {
  width: 92px;
  height: 92px;
}

.somali-pattern-blank {
  min-height: 112px;
  border-bottom: 2px solid #111827;
}

.somali-picture {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: #111827;
  stroke: #111827;
}

.somali-emoji-picture {
  font-size: 3.6rem;
  line-height: 1;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.somali-picture .fill-yellow {
  fill: #facc15;
}

.somali-picture .fill-blue {
  fill: #60a5fa;
}

.somali-picture .fill-green {
  fill: #65a30d;
}

.somali-picture .fill-brown {
  fill: #92400e;
}

.somali-picture .fill-rose {
  fill: #f9a8d4;
}

.somali-picture .fill-slate {
  fill: #9ca3af;
}

.somali-question-block {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--sheet-ink, #1D2330);
}

.somali-practice-section {
  break-inside: avoid;
  page-break-inside: avoid;
}

.somali-example-row,
.somali-sentence-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
}

.somali-example-row {
  color: #111827;
  font-size: 1.06rem;
  font-weight: 800;
}

.somali-example-row .somali-picture,
.somali-sentence-prompt .somali-picture,
.somali-picture-list .somali-picture {
  width: 58px;
  height: 58px;
}

.somali-example-row .somali-emoji-picture,
.somali-sentence-prompt .somali-emoji-picture,
.somali-picture-list .somali-emoji-picture {
  font-size: 3rem;
}

.somali-vocab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}

.somali-word-list,
.somali-meaning-list,
.somali-fill-list {
  gap: 18px;
  font-size: 1.08rem;
}

.somali-fill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.somali-fill-list li {
  break-inside: avoid;
  page-break-inside: avoid;
}

.somali-fill-list .somali-sentence-prompt {
  gap: 8px;
}

.somali-fill-list .wide-blank {
  min-width: 48px;
}

.somali-fill-list .somali-picture {
  width: 48px;
  height: 48px;
}

.somali-fill-list .somali-emoji-picture {
  font-size: 2.45rem;
}

.somali-spelling-sheet {
  display: grid;
  gap: 16px;
}

.somali-spelling-section {
  padding: 12px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #ffffff;
}

.somali-spelling-section h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 1rem;
}

.somali-spelling-study-grid,
.somali-spelling-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.somali-spelling-study-item,
.somali-spelling-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: 12px;
  min-height: 82px;
}

.somali-spelling-study-item strong,
.somali-spelling-question span {
  color: #111827;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0;
}

.somali-spelling-question span {
  font-family: "Comic Sans MS", "Trebuchet MS", sans-serif;
}

.somali-writing-prompt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 4px;
}

.somali-writing-prompt strong {
  font: inherit;
}

.somali-writing-prompt span {
  display: block;
  min-width: 190px;
  border-bottom: 2px solid #111827;
  transform: translateY(-4px);
}

.somali-spelling-sheet .somali-picture {
  width: 66px;
  height: 66px;
}

.somali-spelling-sheet .somali-emoji-picture {
  font-size: 3.2rem;
}

.somali-picture-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 0;
  padding-left: 26px;
}

.somali-picture-list li {
  min-height: 66px;
}

.somali-word-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 4px;
  border: 2px solid #111827;
  font-size: 1.08rem;
}

.somali-word-table span {
  min-height: 42px;
  padding: 9px 12px;
  border-right: 1px solid var(--sheet-ink, #1D2330);
  border-bottom: 1px solid var(--sheet-ink, #1D2330);
}

.somali-word-table span:nth-child(2n) {
  border-right: 0;
}

.somali-word-table span:nth-child(-n + 2) {
  background: #eef2f7;
  font-weight: 850;
}

.somali-copy-lines {
  margin-top: 30px;
}

.worksheet-footer {
  padding-top: 12px;
  color: var(--sheet-ink, #1D2330);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.placeholder-view {
  min-height: 420px;
  background: linear-gradient(135deg, #ffffff, var(--rose));
}

@media (max-width: 980px) {
  .panel-strip,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-access {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-strip {
    grid-template-columns: 1fr;
  }

  .worksheet-page {
    width: 8.5in;
    height: 11in;
  }
}

@media (max-width: 720px) {
  .subject-nav {
    width: 64px;
    padding-inline: 8px;
  }

  .subject-nav:hover,
  .subject-nav:focus-within {
    width: 188px;
  }

  .workspace {
    margin-left: 64px;
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .worksheet-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .title-control {
    grid-column: auto;
    min-width: 0;
  }

  .question-options {
    grid-column: auto;
    min-width: 0;
  }

  .question-type-grid {
    grid-template-columns: 1fr;
  }

  .worksheet-stage {
    padding: 12px;
  }

  .landing-shell {
    min-height: auto;
    padding: 30px;
  }

  .quick-access {
    grid-template-columns: 1fr;
  }

  .quick-card {
    min-height: 142px;
  }

  .worksheet-page {
    min-width: 8.5in;
  }
}

@media print {
  @page {
    size: letter;
    margin: 0;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  html,
  body {
    width: 8.5in;
    min-height: 0;
    margin: 0;
    background: #ffffff;
  }

  .app-shell {
    display: block;
    min-height: 0;
  }

  .subject-nav,
  .topbar,
  .panel-strip,
  .controls-panel,
  .info-stack {
    display: none !important;
  }

  .workspace,
  .section-view,
  .worksheet-stage {
    display: block !important;
    margin: 0;
    padding: 0;
    max-width: none;
    background: #ffffff;
    overflow: visible !important;
  }

  .section-view:not(.active) {
    display: none !important;
  }

  .worksheet-preview {
    display: block;
  }

  .worksheet-page {
    width: 8.5in;
    height: 10.98in;
    margin: 0;
    box-shadow: none;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
    page-break-after: always;
    break-after: page;
  }

  /* The footer stays in the page's flex flow so the body (and fill-rows grids) ends above it, as on screen. */

  .worksheet-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .problem-grid.columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .columns-4 .problem {
    font-size: 1.02rem;
  }

  .columns-4 .answer-line {
    min-width: 30px;
  }
}

/* ===== Prairie Page worksheet template (references/design/WORKSHEET_TEMPLATE.md) ===== */
/* Atkinson Hyperlegible Next only ships a slashed zero (no OpenType feature to turn it off),
   so digits 0-9 come from Andika (plain zero) inside the same family, with Atkinson's line metrics so lines do not grow. Two weight bands keep bold digits bold. */
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 200 549; font-display: block; unicode-range: U+0000-002F, U+003A-FFFF; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 550 800; font-display: block; unicode-range: U+0000-002F, U+003A-FFFF; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/andika-latin-regular.woff2") format("woff2"); font-weight: 200 549; font-display: block; unicode-range: U+0030-0039; ascent-override: 98.4%; descent-override: 31.6%; line-gap-override: 0%; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/andika-latin-bold.woff2") format("woff2"); font-weight: 550 800; font-display: block; unicode-range: U+0030-0039; ascent-override: 98.4%; descent-override: 31.6%; line-gap-override: 0%; }
@font-face {
  font-family: "Andika";
  src: url("fonts/andika-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Andika";
  src: url("fonts/andika-latin-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

.worksheet-page {
  --sheet-ink: #1D2330;
  --sheet-muted: var(--sheet-ink); /* print ink rule (WORKSHEET_STYLE 3.8): one solid ink; hierarchy by size and weight */
  --font-ui: "Atkinson Hyperlegible Next", "Segoe UI", sans-serif;
  --font-child: "Andika", "Atkinson Hyperlegible Next", sans-serif;
  color: var(--sheet-ink);
  font-family: var(--font-ui);
}
.worksheet-page-body { display: flex; flex-direction: column; }
.worksheet-page-body > * { flex: 0 0 auto; }

.worksheet-header h2 { font-family: var(--font-ui); font-size: 22pt; font-weight: 700; color: var(--sheet-ink); letter-spacing: 0; }
.field-line { font-family: var(--font-ui); font-size: 11pt; font-weight: 700; color: var(--sheet-ink); }
.field-line span { border-bottom-width: 1px; }
.continuation-header { font-family: var(--font-ui); font-size: 13pt; font-weight: 700; color: var(--sheet-ink); border-bottom: 0.5pt solid var(--sheet-ink, #1D2330); align-items: center; }
.teacher-pill { padding: 1px 9px; border: 1px solid var(--sheet-ink); border-radius: 999px; font-size: 9pt; font-weight: 700; white-space: nowrap; }

.sheet-instruction { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 0; font-family: var(--font-ui); font-size: 12.5pt; line-height: 1.4; color: var(--sheet-ink); }
.sheet-instruction strong { font-weight: 700; }
.step-number { display: inline-grid; flex: 0 0 auto; place-items: center; width: 22px; height: 22px; border: 0.75pt solid var(--sheet-ink); border-radius: 50%; font-size: 10.5pt; font-weight: 700; line-height: 1; }
.phonics-section p, .game-instructions p, .game-focus { font-family: var(--font-ui); }
.phonics-section p { font-size: 12.5pt; }

.worksheet-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 0.3in; padding-top: 6px; border-top: 0.5pt solid var(--sheet-ink, #1D2330); color: var(--sheet-ink, #1D2330); font-family: var(--font-ui); font-size: 8.5pt; font-weight: 400; text-align: left; }
.footer-brand { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.footer-brand > span:first-of-type { font-weight: 700; }
.footer-mark { width: 13px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.footer-mark .dotted { stroke-dasharray: 1.4 1.6; }
.footer-subject { display: inline-block; width: 6pt; height: 6pt; background: #4C5266; }
.footer-subject.subject-math { background: #A63D26; }
.footer-subject.subject-english { background: #2B579E; }
.footer-subject.subject-arabic { background: #17704F; }
.footer-page { white-space: nowrap; font-weight: 700; }

/* Math pages: child-facing numbers in Andika; rows spread over the page instead of bunching at the top. */
.math-page .problem,
.math-page .visual-equation,
.math-page .rounding-problem,
.math-page .vertical-problem,
.math-page .geo-name-line,
.math-page .geo-count-line,
.math-page .geo-match-name,
.math-page .multiplication-table { font-family: var(--font-child); }
.math-page .problem { font-size: 1.4rem; color: #111; }
.math-page .columns-4 .problem { font-size: 1.22rem; }
.math-page .problem-number,
.math-page .geo-match-number,
.math-page .geo-match-letter { font-family: var(--font-ui); color: var(--sheet-ink, #1D2330); }
.math-page .problem-grid { margin-top: 18px; }
.problem-grid.fill-rows { flex: 1 1 auto; grid-template-rows: repeat(var(--rows), 1fr); row-gap: 6px; align-items: center; }
.problem-grid.fill-rows > .problem { min-height: 0; }
.math-page .geo-fev-table, .math-page .geo-match-columns { font-family: var(--font-ui); }
.answer-key-page .answer-line,
.answer-key-page .missing-blank,
.answer-key-page .vertical-answer,
.answer-key-page .mx-answer,
.answer-key-page .geo-name-line,
.answer-key-page .geo-count-line,
.answer-key-page .geo-fev-blank,
.answer-key-page .geo-match-answer,
.answer-key-page .mx-circle,
.answer-key-page .mx-skip-cell:not(.given),
.answer-key-page .frac:not(.frac-blank) { color: var(--key-ink); font-family: var(--font-child); }
.answer-key-page .geo-match-answer { font-size: 1.2rem; }

/* Rounding: the student writes the rounded factor and the estimate. */
.math-page .rounding-problem { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 10px 8px; min-height: 0; font-size: 1.3rem; }
.rounding-problem .rounding-estimate { grid-column: 2; }
.rounding-problem .rounding-fact { min-width: 4.6em; font-weight: 700; }
.rounding-problem .rounding-estimate { display: inline-flex; align-items: baseline; gap: 8px; }
.answer-line.wide { min-width: 76px; }

/* Geometry: larger, clearer solids; hidden edges dashed. */
.shape-icon .hidden-edge { stroke-dasharray: 6 5; stroke-width: 2.6; }
.math-page .shape-icon { width: 104px; height: 104px; stroke-width: 3.2; }
.math-page .geo-tile { min-height: 0; gap: 10px; }
.math-page .geo-match-columns { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 2.4in minmax(0, 1.25fr); gap: 0; flex: 1 1 auto; margin-top: 14px; }
.math-page .geo-match-shapes, .math-page .geo-match-names { display: grid; grid-template-rows: repeat(var(--match-count, 7), minmax(0, 1fr)); align-items: center; gap: 0; }
.math-page .geo-match-shapes { grid-column: 1; }
.math-page .geo-match-names { grid-column: 3; }
.math-page .geo-match-shapes .geo-match-item { justify-content: flex-end; }
.math-page .geo-match-dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; background: var(--sheet-ink); }
.math-page .geo-match-shapes .geo-match-dot { margin-right: -5.5px; }
.math-page .geo-match-names .geo-match-dot { margin-left: -5.5px; }
.math-page .geo-match-lines { grid-column: 2; grid-row: 1; width: 100%; height: 100%; overflow: visible; }
.math-page .geo-match-lines .key-match-line { vector-effect: non-scaling-stroke; }
.math-page .geo-match-key-note { margin: 6px 0 0; font-family: var(--font-ui); font-size: 10pt; color: var(--key-ink); }
.math-page .geo-match-shapes .shape-icon { width: min(112px, calc(720px / var(--match-count, 7))); height: min(112px, calc(720px / var(--match-count, 7))); }
.math-page .geo-match-item { min-height: 0; }
.math-page .geo-match-name { font-size: 1.3rem; font-weight: 400; }
.math-page .geo-fev-table { margin-top: 16px; }
.math-page .geo-fev-table td { padding: 8px 12px; font-size: 1.25rem; }
.math-page .geo-fev-table th { background: none; color: var(--sheet-ink); font-size: 11pt; border-bottom: 1px solid var(--sheet-ink, #1D2330); }
.math-page .geo-fev-shape .shape-icon { width: 92px; height: 92px; }
.math-page .geo-fev-shape { font-size: 1.05rem; }

/* ===== math-extra.js types ===== */
.math-page .answer-line.long { min-width: 230px; }
.math-page .answer-line.short { min-width: 42px; }
.mx-vertical { display: flex; gap: 10px; align-items: flex-start; }
.mx-stack { display: inline-grid; grid-template-columns: auto auto; column-gap: 10px; row-gap: 2px; text-align: right; font-size: 22pt; letter-spacing: 0.06em; }
.mx-stack .mx-carry { height: 22px; }
.mx-stack .operator { text-align: left; }
.mx-stack .rule { grid-column: 1 / -1; border-top: 2px solid #111; }
.mx-stack .mx-answer { display: flex; align-items: flex-end; justify-content: flex-end; min-height: 0.6in; }
.mx-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mx-line .answer-line { flex: 1 1 auto; max-width: 260px; }
.mx-digits u { text-decoration-thickness: 2px; text-underline-offset: 4px; }
.mx-compare { display: flex; align-items: center; gap: 12px; }
.mx-circle { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid #111; border-radius: 50%; font-size: 1.5rem; line-height: 1; }
.mx-order { display: grid; gap: 14px; }
.mx-order-given { display: flex; gap: 10px; align-items: baseline; font-weight: 700; }
.mx-order-answer { display: flex; align-items: baseline; gap: 4px; padding-left: 28px; }
.mx-order-answer .answer-line { min-width: 62px; }
.mx-comma { font-size: 1.3rem; }
.mx-skip { display: flex; align-items: center; gap: 12px; }
.mx-skip-label { flex: 0 0 92px; font-family: var(--font-ui); font-size: 11pt; font-weight: 700; color: var(--sheet-ink, #1D2330); }
.mx-skip-row { display: flex; gap: 6px; }
.mx-skip-cell { display: inline-grid; place-items: center; width: 64px; height: 50px; border: 1.25px solid #111; border-radius: 4px; font-size: 1.3rem; }
.mx-skip-cell.given { font-weight: 700; }
.mx-number-pattern { flex-wrap: nowrap; gap: 10px; }
.mx-number-pattern .mx-skip-cell { width: 60px; }
.mx-number-pattern .mx-skip-row { gap: 5px; }
.mx-rule { display: inline-flex; gap: 8px; align-items: baseline; font-family: var(--font-ui); font-size: 11pt; font-weight: 700; padding-left: 4px; }
.mx-rule .answer-line { font-size: 1.15rem; min-width: 128px; font-weight: 400; }
.math-page .mx-number-pattern .mx-rule .answer-line.long { min-width: 128px; }
.mx-pattern { display: flex; align-items: center; gap: 12px; }
.mx-pattern-row { display: flex; gap: 6px; align-items: center; }
.mx-pattern-cell, .mx-pattern-blank { display: inline-grid; place-items: center; width: 52px; height: 52px; }
.mx-pattern-blank { border: 1.5px dashed var(--sheet-ink, #1D2330); border-radius: 4px; }
.mx-pattern-shape { width: 44px; height: 44px; fill: none; stroke: #111; stroke-width: 2.4; stroke-linejoin: round; }
.mx-pattern-row { gap: 4px !important; }
/* Colour PDF: colour is the attribute (TEMPLATE_DECISIONS §2). The filled dot is red, the open circle stays open, and
   every other shape has its own crayon; B/W keeps filled vs open and the shape. */
[data-ink="colour"] .mx-pattern-shape .solid { fill: var(--crayon-red); }
[data-ink="colour"] .mx-pattern-shape.ps-square { fill: var(--crayon-blue); }
[data-ink="colour"] .mx-pattern-shape.ps-triangle { fill: var(--crayon-yellow); }
[data-ink="colour"] .mx-pattern-shape.ps-star { fill: var(--crayon-orange); }
[data-ink="colour"] .mx-pattern-shape.ps-heart { fill: var(--crayon-purple); }
.mx-pattern-shape .solid { fill: #111; }
/* round 9: colour rows keep the dark outline; the square and circle there take the crayon (pattern in B/W), never the shape colour */
[data-ink="colour"] .mx-pattern-shape.ps-coloured { fill: none; }
.answer-key-page .mx-pattern-blank .mx-pattern-shape { stroke: var(--key-ink); }
.mx-clock-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mx-clock-item .problem-number { align-self: flex-start; }
.mx-clock { width: 168px; height: 168px; }
.mx-clock .face { fill: #fff; stroke: #111; stroke-width: 3; }
.mx-clock .tick-minute { stroke: #111; stroke-width: 1.2; }
.mx-clock .tick-hour { stroke: #111; stroke-width: 3; }
.mx-clock text { font-family: var(--font-child); font-size: 19px; text-anchor: middle; fill: #111; }
.mx-clock .hand-hour { stroke: #111; stroke-width: 8; stroke-linecap: round; }
.mx-clock .hand-minute { stroke: #111; stroke-width: 4; stroke-linecap: round; }
.mx-clock .hub { fill: #111; }
.answer-key-page .mx-clock .hand-hour, .answer-key-page .mx-clock .hand-minute { stroke: var(--key-ink); }
.mx-time-answer { display: inline-flex; align-items: baseline; gap: 4px; font-size: 1.4rem; }
.mx-clock-label { font-size: 1.6rem; font-weight: 700; }
.mx-fraction { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.mx-fraction .problem-number { align-self: start; }
.mx-fraction-picture { display: grid; place-items: center; min-width: 0; }
.mx-fraction-picture > svg { max-width: 100%; }
.mx-fraction-shape, .mx-fraction-set, .mx-fraction-bar { stroke: #111; stroke-width: 1.6; }
.mx-fraction-shape { width: 124px; height: 124px; }
.mx-fraction-shape.bar { width: 140px; height: 47px; }
.mx-fraction-set { width: 140px; height: auto; max-height: 110px; }
.mx-fraction-bar { width: 130px; height: 43px; }
.frac { display: inline-grid; grid-template-rows: auto auto; justify-items: center; min-width: 38px; font-size: 1.45rem; line-height: 1.15; }
.frac > span:first-child { border-bottom: 2px solid #111; padding: 0 6px; min-width: 100%; text-align: center; }
.frac-blank > span { min-height: 1.35em; min-width: 42px; border: 1.25px dashed var(--sheet-ink, #1D2330); border-radius: 3px; margin: 3px 0; }
.frac-blank > span:first-child { border-bottom: 1.25px dashed var(--sheet-ink, #1D2330); padding: 0; }
.frac-blank { position: relative; row-gap: 10px; }
.frac-blank::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; border-top: 2px solid #111; }
.mx-fraction-compare { display: flex; align-items: center; gap: 12px; }
.mx-fc-side { display: inline-grid; justify-items: center; gap: 4px; }
.mx-base-ten { display: grid; grid-template-columns: auto 1fr 210px; gap: 6px 16px; align-items: center; }
.mx-base-ten .problem-number { align-self: start; }
.mx-base-ten .bt-counts { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; }
.mx-base-ten .bt-total { grid-column: 3; }
.bt-model { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; grid-column: 2; grid-row: 1 / span 3; }
.bt-group { display: inline-flex; flex-wrap: wrap; align-items: flex-end; gap: 3px; max-width: 100%; }
.bt-ones { max-width: 70px; }
.bt-model svg { fill: #fff; stroke: var(--sheet-ink); stroke-width: 1.67; }
.bt-model svg * { vector-effect: non-scaling-stroke; }
.bt-model .bt-grid { stroke: var(--sheet-ink, #1D2330); stroke-width: 0.67; }
.bt-thousand { width: 52px; height: 52px; }
.bt-flat { width: 46px; height: 46px; }
.bt-rod { width: 7px; height: 46px; }
.bt-unit { width: 9px; height: 9px; }
.bt-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-ui); font-size: 11pt; }
.bt-count .answer-line { font-size: 1.2rem; }
.bt-total { font-family: var(--font-ui); font-size: 11pt; font-weight: 700; }
.bt-total .answer-line { font-size: 1.3rem; min-width: 90px; font-weight: 400; }
.mx-money { display: flex; align-items: center; gap: 14px; }
.mx-coins { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; flex: 1 1 auto; }
.mx-coin { flex: 0 0 auto; fill: #fff; stroke: #111; stroke-width: 1.5; } /* never shrink: coin sizes are to scale */
.mx-coin .coin-ring { stroke-width: 1; }
.mx-coin text { font-family: var(--font-ui); font-size: 12px; font-weight: 700; text-anchor: middle; fill: #111; stroke: none; }
.mx-money-answer { flex: 0 0 auto; display: inline-flex; gap: 8px; align-items: baseline; font-family: var(--font-ui); font-size: 11pt; font-weight: 700; }
.mx-money-answer .answer-line { min-width: 96px; font-size: 1.35rem; font-weight: 400; }
.math-page .geo-fev-grid,
.math-page .geo-match-grid { display: flex; flex: 1 1 auto; flex-direction: column; }
.math-page .geo-fev-grid .geo-fev-table { flex: 1 1 auto; height: 100%; }
.math-page .geo-fev-table td.geo-fev-blank { min-width: 90px; }
.phonics-mixed .phonics-section p { font-size: 11.5pt; margin-bottom: 6px; line-height: 1.35; }
.phonics-mixed .phonics-focus { margin: 12px 0; }
.math-page .geo-fev-table td { padding: 5px 12px; }
.math-page .geo-fev-shape .shape-icon { width: 80px; height: 80px; }
.math-page .geo-fev-table td.geo-fev-shape { display: table-cell; vertical-align: middle; text-align: left; }
.math-page .geo-fev-table td.geo-fev-shape .shape-icon { vertical-align: middle; margin-right: 12px; }

/* ===== Shared three-line writing guide (solid top, dotted middle, solid bottom; 68px beginner minimum) ===== */
.write-guide { position: relative; display: block; box-sizing: border-box; height: 68px; min-height: 68px; border-top: 1px solid var(--sheet-ink, #1D2330); border-bottom: 1px solid var(--sheet-ink, #1D2330); }
.write-guide::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dotted var(--sheet-ink, #1D2330); }
.write-guide.inline { flex: 0 0 2.3in; width: 2.3in; }

/* One header rule for every sheet (round 4): the title (and its subtitle line) takes the full width and Name/Date
   always sit on their own row underneath, starting at the reading edge (the right on Arabic sheets). Title length no
   longer decides the layout, so short and long titles, phonics lessons and module sheets all look the same. */
.worksheet-header, .worksheet-header.long-title { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.worksheet-header .student-fields { justify-content: flex-start; }

/* ===== Reading comprehension on the standard template ===== */
.reading-page .worksheet-page-body { gap: 0; }
.reading-page .sheet-instruction { margin-top: 14px; }
.rq-passage { margin-top: 8px; font-family: var(--font-child); font-size: 15pt; line-height: 1.6; color: var(--sheet-ink); }
.rq-passage p { margin: 0 0 10px; }
.rq-groups { display: flex; flex: 1 1 auto; flex-direction: column; }
.rq-group { display: flex; flex-direction: column; }
.rq-groups > .rq-group:last-child { flex: 1 1 auto; }
.rq-list { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: space-evenly; gap: 10px; margin: 8px 0 0; padding: 0 0 0 4px; list-style: none; font-family: var(--font-child); font-size: 15pt; line-height: 1.35; }
.rq-item { display: flex; align-items: flex-start; gap: 8px; }
.rq-num { flex: 0 0 28px; padding-top: 3px; font-family: var(--font-ui); font-size: 11pt; font-weight: 700; color: var(--sheet-ink, #1D2330); }
.rq-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 6px; min-width: 0; align-self: stretch; }
.rq-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.rq-choices b, .rq-match b { display: inline-block; min-width: 22px; font-family: var(--font-ui); font-size: 12pt; }
.rq-fill { display: flex; align-items: flex-end; gap: 8px; }
.rq-fill > span:not(.write-guide) { padding-bottom: 6px; }
.rq-bank { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 28px; margin: 8px 0 0; font-family: var(--font-child); font-size: 16pt; }
.rq-bank-label { font-family: var(--font-ui); font-size: 11pt; font-weight: 700; color: var(--sheet-ink, #1D2330); }
.rq-match { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 22px 90px; margin-top: 6px; }
.rq-tf { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.rq-tf-choices { display: inline-flex; gap: 34px; flex: 0 0 auto; font-family: var(--font-ui); font-size: 13pt; font-weight: 700; }
.rq-tf-choices span { padding: 2px 8px; }
.rq-guides { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: space-evenly; gap: 18px; }
.rq-short-answer, .rq-main-idea { flex: 1 1 auto; }
.rq-key { display: grid; gap: 10px; margin: 18px 0 0; padding-left: 30px; font-family: var(--font-child); font-size: 14pt; color: var(--key-ink); }
.rq-key-note { margin-top: 18px; font-size: 11pt; color: var(--sheet-ink, #1D2330); }
.rq-item.rq-fill-blank { align-items: flex-end; }
.rq-item.rq-fill-blank .rq-num { padding-bottom: 8px; }
.rq-short-answer .rq-guides { margin-top: 8px; }

/* Bigger base-ten blocks (round 2): 2x for tens and ones, 1.4x with hundreds; thousands stay 1x so four fit a page. */
/* To 100 (TEMPLATE_DECISIONS §2): unit cube 0.2 in, rod 2 in; tens and ones side by side, answers centred beside them */
.bt-scale-2 .bt-model { flex-direction: row; align-items: flex-end; gap: 22px; align-self: center; }
.bt-scale-2 .bt-rod { width: 0.18in; height: 1.8in; }
.bt-scale-2 .bt-unit { width: 0.18in; height: 0.18in; }
.bt-scale-2 .bt-ones { display: grid; grid-template-columns: repeat(2, 0.18in); gap: 6px; max-width: none; }
.bt-scale-2 .bt-group { gap: 7px; }
.mx-base-ten.bt-scale-2 { grid-template-columns: auto 1fr 230px; grid-template-rows: 1fr auto auto 1fr; }
.mx-base-ten.bt-scale-2 .bt-model { grid-row: 1 / span 4; }
.mx-base-ten.bt-scale-2 .bt-counts { grid-row: 2; grid-column: 3; }
.mx-base-ten.bt-scale-2 .bt-total { grid-row: 3; grid-column: 3; }
.mx-base-ten.bt-scale-2 .problem-number { grid-row: 1 / span 4; align-self: center; }
.bt-scale-2 .bt-counts { font-size: 13pt; gap: 10px; }
.bt-scale-2 .bt-total { font-size: 13pt; margin-top: 8px; }
.bt-scale-3 .bt-flat { width: 64px; height: 64px; }
.bt-scale-3 .bt-rod { width: 10px; height: 64px; }
.bt-scale-3 .bt-unit { width: 13px; height: 13px; }
.bt-scale-3 .bt-ones { max-width: 100px; }
.bt-scale-3 .bt-group { gap: 4px; }
/* Coins at 1.5x (relative sizes kept); a long row wraps instead of shrinking. */
.mx-money { flex-wrap: wrap; row-gap: 6px; }
.mx-coins { flex: 1 1 auto; flex-wrap: wrap; gap: 8px; }
.mx-money-answer { flex: 0 0 auto; margin-left: auto; justify-content: flex-end; }
/* Skip counting: fixed-width item numbers so row 10 lines up with rows 1-9. */
.mx-skip .problem-number, .mx-number-pattern .problem-number { flex: 0 0 30px; text-align: right; }
/* One answer-key hand across all keys: Andika in dark grey. */
.game-answer-page .game-answers, .phonics-answer-list { font-family: var(--font-child); color: var(--key-ink); }
/* Word problems: story in Andika, open work space, answer line with the unit. */
.mx-word { display: flex; align-items: flex-start; gap: 10px; min-height: 0; }
.mx-word-body { display: flex; flex: 1 1 auto; flex-direction: column; align-self: stretch; }
.mx-word-text { margin: 0; font-family: var(--font-child); font-size: 15pt; line-height: 1.45; }
.mx-word-work { flex: 1 1 auto; min-height: 40px; padding-top: 8px; }
.mx-word-equation { font-family: var(--font-child); font-size: 1.3rem; color: var(--key-ink); }
.mx-word-answer { margin: 0; align-self: flex-end; font-family: var(--font-ui); font-size: 12pt; font-weight: 700; }
.mx-word-answer .answer-line { min-width: 90px; font-size: 1.3rem; font-weight: 400; }
.problem-grid.fill-rows > .mx-word { align-self: stretch; }
.answer-key-page .mx-word-work { min-height: 0; }
.mx-word-answer { padding-bottom: 6px; line-height: 1.5; }
.ten-frame-problem .problem-number { flex: 0 0 20px; text-align: right; }
.ten-frame-problem .visual-model-row { gap: 4px; }
.ten-frame-problem .ten-frame-set { flex-wrap: nowrap; gap: 8px; }
/* Ten frames 20% larger, eight a page (TEMPLATE_DECISIONS §2) */
.math-page .ten-frame { grid-template-columns: repeat(5, 34px); grid-template-rows: repeat(2, 31px); }
.math-page .ten-cell { width: 34px; height: 31px; }
.math-page .ten-frame-equation { width: auto; margin: 0; font-size: 18pt; }
.math-page .ten-frame-grid { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none !important; grid-auto-rows: minmax(0, 1fr); }
.math-page .ten-frame-problem { display: flex; align-items: center; gap: 28px; min-height: 0; }

/* Library subtitle line on app.js sheets (matches .mm-subtitle / .ee-subtitle). */
.sheet-subtitle { margin: 2px 0 0; font-family: var(--font-ui); font-size: 11pt; line-height: 1.25; color: var(--sheet-ink, #1D2330); }
.worksheet-header:has(.sheet-subtitle) { gap: 4px; }
.sheet-subtitle.inline { display: inline; margin: 0 0 0 10px; font-weight: 400; vertical-align: 0.2em; }
/* Coins: original simple drawings (no Mint artwork). Light tints so they print on any printer. */
/* Coins (TEMPLATE_DECISIONS §2, user taste call A): outline only in B/W; size, edge and the toonie's two rings carry
   identity. The colour PDF adds silver, the gold loonie and the two-tone toonie. */
.mx-coin .coin-silver, .mx-coin .coin-gold { fill: #fff; }
[data-ink="colour"] .mx-coin .coin-silver { fill: #D5DAE0; }
[data-ink="colour"] .mx-coin .coin-gold { fill: #E9C45C; }
.mx-coin .coin-rim { fill: none; stroke-width: 0.8; stroke: var(--sheet-ink, #1D2330); }
.mx-coin .coin-reed line { stroke-width: 0.6; stroke: var(--sheet-ink, #1D2330); }
.mx-coin-cap { display: inline-flex; flex: 0 0 auto; flex-direction: column; align-items: center; align-self: stretch; gap: 1px; }
.mx-coin-cap > svg { margin-block: auto; } /* coins stay centred in the row; the values share one line under them */
.mx-coin-cap small { font-family: var(--font-child); font-size: 11pt; font-weight: 700; color: var(--key-ink); line-height: 1.1; }
.mx-coin-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 4px; }
.mx-coin-key { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

/* ---- Design tokens and the key hand (references/design/TEMPLATE_DECISIONS.md §1.3–1.7, 2026-11-16) ----
   One template renders both inks: <html data-ink="bw|colour">. B/W is the default and must work alone. */
.worksheet-page, .pk-defs {
  --key-ink: #1D2330;        /* the key hand (told apart by the hand font); marking red in a colour PDF */
  --given-ink: #1D2330;      /* printed givens: solid ink too (WORKSHEET_STYLE 3.8); the key hand stands out by font and weight */
  --tint: #E6E6E6;           /* the one tint (ink tier 2): only where the fill is the question */
  --hairline: #1D2330;       /* hairlines stay thin (--w-hair), never grey (WORKSHEET_STYLE 3.8) */
  --guide-ink: #1D2330;
  --guide-dot: #1D2330;      /* the midline is told apart by its dots, not by grey */
  --pattern-ink: #1D2330;
  --w-hair: 0.5pt;
  --w-guide: 0.75pt;
  --w-object: 1.25pt;
  --w-emph: 2pt;
  --w-loop: 1.5pt;
  --crayon-red: #D9482B;
  --crayon-blue: #2F6DB5;
  --crayon-yellow: #F2C230;
  --crayon-green: #3F9B5B;
  --crayon-orange: #EE8A2B;
  --crayon-purple: #7A5AA6;
  /* grade bands: K–1, Grades 2–3, Grades 4–6 */
  --child-k1: 20pt; --child-23: 15.5pt; --child-46: 13pt;
  --choice-k1: 21pt; --choice-23: 16pt; --choice-46: 13pt;
  --label-k1: 11pt; --label-23: 10pt; --label-46: 8.5pt;
  --blank-k1: 0.7in; --blank-23: 0.6in; --blank-46: 0.5in;
}
[data-ink="colour"] .worksheet-page, [data-ink="colour"] .pk-defs, .worksheet-page[data-ink="colour"] { --key-ink: #B3261E; }

.pk-defs .pk-bg { fill: #ffffff; stroke: none; }
.pk-defs .pk-line { stroke: var(--pattern-ink); stroke-width: 0.9; }
.pk-defs .pk-dot { fill: var(--pattern-ink); stroke: none; }
.pk-defs .pk-key-line { stroke: var(--key-ink); stroke-width: 1.3; }

/* Key marks */
.key-given { color: var(--given-ink) !important; }
.key-hand { color: var(--key-ink); font-family: var(--font-child); }
.key-loop { border: var(--w-loop) solid var(--key-ink); border-radius: 999px; }
svg .key-capsule { fill: none; stroke: var(--key-ink); stroke-width: 2; }
svg .key-match-line { stroke: var(--key-ink); stroke-width: 1.7; stroke-linecap: round; }
svg .key-match-dot, .key-match-dot { fill: var(--sheet-ink); }
.pk-hatch { fill: url(#pk-hatch); }
.key-fix, .key-fix-old, .key-add, .key-caret { text-indent: 0; }
.key-fix { position: relative; display: inline-block; }
.key-fix-old { position: relative; display: inline-block; line-height: 1.15; }
.key-fix-old::after { content: ""; position: absolute; inset: 12% -4% 6%; background: linear-gradient(to bottom right, transparent calc(50% - 0.9pt), var(--key-ink) calc(50% - 0.9pt), var(--key-ink) calc(50% + 0.9pt), transparent calc(50% + 0.9pt)); }
.key-fix-new { position: absolute; left: 50%; bottom: 92%; transform: translateX(-50%); font-family: var(--font-child); font-size: 0.7em; font-weight: 700; line-height: 1; color: var(--key-ink); white-space: nowrap; }
.key-add { position: relative; display: inline-grid; place-items: center; min-width: 0.78em; height: 0.78em; margin: 0 0.04em; padding: 0 0.05em; border: 1.25pt solid var(--key-ink); border-radius: 999px; color: var(--key-ink); font-family: var(--font-child); font-weight: 700; line-height: 0.5; vertical-align: -0.08em; }
/* round 9: a full stop is drawn as a dot in the centre of its circle (the glyph sits on the baseline) */
.key-add-stop { color: transparent; }
.key-add-stop::after { content: ""; position: absolute; left: 50%; top: 50%; width: 0.17em; height: 0.17em; border-radius: 50%; background: var(--key-ink); transform: translate(-50%, -50%); }
.key-caret { position: relative; display: inline-block; width: 0.5em; height: 1em; vertical-align: -0.15em; }
.key-caret::before { content: "^"; position: absolute; left: 0; right: 0; bottom: -0.35em; text-align: center; color: var(--key-ink); font-family: var(--font-child); font-weight: 700; }
.key-caret-text { position: absolute; left: 50%; bottom: 95%; transform: translateX(-50%); font-family: var(--font-child); font-size: 0.7em; font-weight: 700; color: var(--key-ink); white-space: nowrap; }

/* Crayon fills: pattern in B/W, crayon in colour (HTML elements; SVG uses the pk-svg-* classes) */
.pk-fill-red { background: repeating-linear-gradient(-45deg, #fff 0 7.4px, var(--pattern-ink) 7.4px 8.4px); }
.pk-fill-green { background: repeating-linear-gradient(45deg, #fff 0 7.4px, var(--pattern-ink) 7.4px 8.4px); }
.pk-fill-purple { background: repeating-linear-gradient(90deg, #fff 0 4.2px, var(--pattern-ink) 4.2px 5.2px); }
.pk-fill-orange { background: repeating-linear-gradient(45deg, transparent 0 7.9px, var(--pattern-ink) 7.9px 8.9px), repeating-linear-gradient(-45deg, #fff 0 7.9px, var(--pattern-ink) 7.9px 8.9px); }
.pk-fill-blue { background: radial-gradient(circle, var(--pattern-ink) 1.05px, transparent 1.5px) 0 0 / 7px 7px, #fff; }
.pk-fill-yellow { background: #fff; }
[data-ink="colour"] .pk-fill-red { background: var(--crayon-red); }
[data-ink="colour"] .pk-fill-blue { background: var(--crayon-blue); }
[data-ink="colour"] .pk-fill-yellow { background: var(--crayon-yellow); }
[data-ink="colour"] .pk-fill-green { background: var(--crayon-green); }
[data-ink="colour"] .pk-fill-orange { background: var(--crayon-orange); }
[data-ink="colour"] .pk-fill-purple { background: var(--crayon-purple); }
svg .pk-svg-red { fill: url(#pk-red); } svg .pk-svg-blue { fill: url(#pk-blue); } svg .pk-svg-yellow { fill: url(#pk-yellow); }
svg .pk-svg-green { fill: url(#pk-green); } svg .pk-svg-orange { fill: url(#pk-orange); } svg .pk-svg-purple { fill: url(#pk-purple); }
[data-ink="colour"] svg .pk-svg-red { fill: var(--crayon-red); } [data-ink="colour"] svg .pk-svg-blue { fill: var(--crayon-blue); }
[data-ink="colour"] svg .pk-svg-yellow { fill: var(--crayon-yellow); } [data-ink="colour"] svg .pk-svg-green { fill: var(--crayon-green); }
[data-ink="colour"] svg .pk-svg-orange { fill: var(--crayon-orange); } [data-ink="colour"] svg .pk-svg-purple { fill: var(--crayon-purple); }
/* Colouring answer keys are always in colour, in the B/W variant too (user decision 2026-11-19; TEMPLATE_DECISIONS 1.7).
   Child pages are untouched. Scoped to the colour-by-word key page; fraction/area shading keys keep hatch. */
.ee-type-colour.answer-key-page .pk-fill-red, .ee-type-colour.answer-key-page svg .pk-svg-red { background: var(--crayon-red); fill: var(--crayon-red); }
.ee-type-colour.answer-key-page .pk-fill-blue, .ee-type-colour.answer-key-page svg .pk-svg-blue { background: var(--crayon-blue); fill: var(--crayon-blue); }
.ee-type-colour.answer-key-page .pk-fill-yellow, .ee-type-colour.answer-key-page svg .pk-svg-yellow { background: var(--crayon-yellow); fill: var(--crayon-yellow); }
.ee-type-colour.answer-key-page .pk-fill-green, .ee-type-colour.answer-key-page svg .pk-svg-green { background: var(--crayon-green); fill: var(--crayon-green); }
.ee-type-colour.answer-key-page .pk-fill-orange, .ee-type-colour.answer-key-page svg .pk-svg-orange { background: var(--crayon-orange); fill: var(--crayon-orange); }
.ee-type-colour.answer-key-page .pk-fill-purple, .ee-type-colour.answer-key-page svg .pk-svg-purple { background: var(--crayon-purple); fill: var(--crayon-purple); }
.ee-type-colour.answer-key-page .ee-cbw-blob { color: var(--sheet-ink); }
.pk-swatch { display: inline-block; width: 0.95em; height: 0.95em; margin: 0 0.1em; border: var(--w-object) solid var(--sheet-ink); border-radius: 3px; vertical-align: -0.12em; }
.pk-cue { white-space: nowrap; }
/* Flattened pattern fills (key-marks.js flattenPatterns, print renders) */
svg .pk-flat .pk-l { stroke: var(--pattern-ink); stroke-width: 0.9; fill: none; }
svg .pk-flat-pk-hatch .pk-l { stroke: var(--key-ink); stroke-width: 1.3; }
svg .pk-flat .pk-d { fill: var(--pattern-ink); stroke: none; }

/* ===== Shimmle chrome (references/design/WORKSHEET_STYLE.md, treatment A, approved 2026-11-17; sheet-chrome.js) =====
   Title in Nunito Black with a hand-drawn rule; a character spot at the top right of page 1 (K-2 1.1 in, 3-6 0.85 in,
   never taller than the header, never on keys, continuation, teacher or cut-out pages); the footer is the small hedgehog
   mark, the brand name from site-config.js and the subject's ink mark (no hairline, no coloured square). Colour lives
   only in the spot and the mark. Arabic pages mirror: the grid puts the spot on the left. */
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: block; }
.worksheet-page.ws-chrome { --ws-spot: 0in; }
.worksheet-page.ws-chrome[data-ws-band="k2"] { --ws-spot: 1.1in; }
.worksheet-page.ws-chrome[data-ws-band="36"] { --ws-spot: 0.85in; }
.worksheet-page.ws-chrome .worksheet-header h2,
.worksheet-page.ws-chrome .rf-head h2 { font-family: "Nunito", var(--font-ui); font-weight: 900; letter-spacing: 0.003em; }
.worksheet-page.ws-chrome.ar-sheet .worksheet-header h2 { font-family: "PP Naskh Arabic", serif; font-weight: 700; }
.worksheet-page.ws-chrome .worksheet-header { padding-bottom: 6px; }
.worksheet-page.ws-chrome .ws-rule { display: block; width: 100%; height: 9px; margin: 3px 0 1px; color: var(--sheet-ink, #1D2330); overflow: visible; }
.worksheet-page.ws-chrome .worksheet-header.ws-has-spot { grid-template-columns: minmax(0, 1fr) var(--ws-spot); column-gap: 0.25in; align-items: stretch; }
.worksheet-page.ws-chrome .ws-has-spot.ws-measure { grid-template-columns: minmax(0, 1fr) 0; column-gap: 0; }
.worksheet-page.ws-chrome .ws-has-spot.ws-measure .rf-pills { display: flex; }
.worksheet-page.ws-chrome .ws-titleblock { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; min-width: 0; }
.worksheet-page.ws-chrome .ws-titleblock .student-fields { justify-content: flex-start; }
.worksheet-page.ws-chrome .rf-head.ws-has-spot { grid-template-columns: minmax(0, 1fr) auto var(--ws-spot); }
.worksheet-page.ws-chrome .rf-head.ws-has-spot.ws-measure { grid-template-columns: minmax(0, 1fr) auto 0; }
.worksheet-page.ws-chrome .ws-has-spot.ws-measure .ws-spot { display: none; }
/* Long titles step down before the spot is dropped (sheet-chrome.js settle, E79): a 0.85 in spot, then a 20pt title. */
.worksheet-page.ws-chrome[data-ws-band][data-ws-spot="small"] { --ws-spot: 0.85in; }
.worksheet-page.ws-chrome .ws-title-fit h2 { font-size: 20pt; }
/* K-1 floor (E84): written steps on a K-1 sheet without its own picture cues are notes for the adult to read out. */
.worksheet-page.ws-chrome .sheet-instruction.ws-adult-note { font-size: 10.5pt; line-height: 1.35; color: var(--sheet-ink, #1D2330); }
.worksheet-page.ws-chrome .ws-adult-note .step-number { width: 18px; height: 18px; font-size: 9pt; }
.worksheet-page.ws-chrome .ws-adult-note > span:last-child::before { content: "Read aloud: "; font-style: italic; font-weight: 800; }
/* Colour PDFs only (E85): photocopied, the task colours go near-black, so the footer says what the page is for. */
[data-ink="colour"] .worksheet-page.ws-chrome .footer-page::before { content: "Print in colour · "; font-weight: 400; }
.worksheet-page.ws-chrome .ws-spot { position: relative; align-self: stretch; width: var(--ws-spot); min-height: 0.6in; }
.worksheet-page.ws-chrome .ws-spot img { position: absolute; right: 0; bottom: 0; width: 100%; height: 100%; max-height: var(--ws-spot); object-fit: contain; object-position: right bottom; }
.worksheet-page.ws-chrome[dir="rtl"] .ws-spot img, .worksheet-page.ws-chrome .ar-header .ws-spot img, [dir="rtl"] .worksheet-page.ws-chrome .ws-spot img { right: auto; left: 0; object-position: left bottom; }
.worksheet-page.ws-chrome .continuation-header { border-bottom: 0; padding-bottom: 4px; align-items: flex-start; }
.worksheet-page.ws-chrome .ws-cont-title { display: inline-block; font-family: "Nunito", var(--font-ui); font-weight: 900; color: var(--sheet-ink, #1D2330); }
.worksheet-page.ws-chrome.ar-sheet .ws-cont-title { font-family: inherit; font-weight: 700; }
.worksheet-page.ws-chrome .ws-rule-short { width: 2.4in; max-width: 100%; height: 7px; margin: 3px 0 0; }
.worksheet-page.ws-chrome .worksheet-footer { margin-top: 0.15in; padding-top: 0; border-top: 0; }
.worksheet-page.ws-chrome .ws-mark { display: block; flex: 0 0 auto; height: 0.3in; width: auto; }
.worksheet-page.ws-chrome .ar-footer-brand { display: inline-flex; align-items: center; gap: 6px; }
.worksheet-page.ws-chrome .ws-word { font-family: "Nunito", var(--font-ui); font-weight: 900; font-size: 10.5pt; color: var(--sheet-ink, #1D2330); letter-spacing: 0.01em; }
.worksheet-page.ws-chrome .ws-subj { font-family: "Nunito", "PP Naskh Arabic", var(--font-ui); font-weight: 900; font-size: 9pt; color: var(--sheet-ink, #1D2330); }

/* Worked example box (sheet-chrome.js SheetChrome.example; WORKED_EXAMPLE_AUDIT.md). Moved from english-more.css
   (.em-example) unchanged, so context clues render the same. Solid ink only (WORKSHEET_STYLE.md 3.8). */
.ws-example { margin: 0 0 8px; padding: 6px 12px 7px; border: 1.5px dashed var(--sheet-ink, #1D2330); border-radius: 6px; }
.ws-ex-head { margin: 0 0 2px; font-family: var(--font-ui); font-size: 10.5pt; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sheet-ink, #1D2330); }
.ws-ex-why { margin: 4px 0 0; font-family: var(--font-ui); font-size: 11pt; line-height: 1.35; color: var(--sheet-ink); }
