/* ============================================================
   Arduino lesson-page styles
   Loaded alongside the site-wide styles.css.
   ============================================================ */

:root {
  --ard: #00979D;
  --ard-soft: #E0F2F3;
  --ard-dark: #006D71;
  --ard-ink: #0B3A3C;
}

body.lesson {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: #FAFCFD;
  color: var(--ink, #0F172A);
  margin: 0;
  line-height: 1.55;
}

/* Per-level accent strip */
body.lesson--level-1 { --lvl: #10B981; --lvl-soft: #E7FBF3; }
body.lesson--level-2 { --lvl: #3B82F6; --lvl-soft: #E8F1FE; }
body.lesson--level-3 { --lvl: #F59E0B; --lvl-soft: #FEF4E0; }
body.lesson--level-4 { --lvl: #EC4899; --lvl-soft: #FDE8F1; }

/* ---------- Header ---------- */
.lesson-header {
  background: linear-gradient(135deg, var(--ard) 0%, var(--ard-dark) 100%);
  color: #fff;
  padding: 48px 32px 40px;
  border-bottom: 6px solid var(--lvl, var(--ard));
}
.lesson-header .lesson-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.22);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  backdrop-filter: blur(4px);
}
.lesson-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  max-width: 900px;
}
.lesson-header .lesson-sub {
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0;
}

/* ---------- Main column ---------- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---------- Sections ---------- */
.lesson-section {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 28px 28px 24px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.lesson-section::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--lvl, var(--ard));
}
.lesson-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ard-ink);
}
.lesson-section h2 .time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--ard-soft);
  color: var(--ard-dark);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: auto;
}
.lesson-section h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--ard-ink);
}
.lesson-section p,
.lesson-section li,
.lesson-section dd { font-size: 0.95rem; }

/* ---------- Lists ---------- */
.lesson-section ul,
.lesson-section ol { padding-left: 22px; }
.lesson-section li { margin-bottom: 6px; }

/* ---------- Code blocks (Arduino IDE colour scheme) ---------- */
pre.code {
  background: #FFFFFF;
  color: #434F54;             /* Arduino IDE default text */
  padding: 16px 18px;
  border: 1px solid #DCE9EB;
  border-left: 4px solid var(--ard);
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Courier New', ui-monospace, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 14px 0;
  white-space: pre;
}
pre.code code { font-family: inherit; color: inherit; background: none; padding: 0; }

/* Arduino IDE token classes */
.t-type  { color: #00979C; }                       /* data types: void, int, const */
.t-fn    { color: #D35400; }                       /* built-in functions: pinMode, digitalWrite, delay */
.t-const { color: #00979C; }                       /* HIGH, LOW, OUTPUT, INPUT, true, false */
.t-num   { color: #005C5F; }                       /* numeric literals */
.t-str   { color: #005C5F; }                       /* string literals */
.t-cmt   { color: #95A5A6; font-style: italic; }   /* comments */

/* Inline code (outside <pre>) — keep light-grey chip style */
code:not(pre code) {
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
  color: #0F172A;
}

/* ---------- Wiring / parts tables ---------- */
table.wiring {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.9rem;
}
table.wiring th,
table.wiring td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #E2E8F0;
}
table.wiring thead th {
  background: var(--ard-soft);
  color: var(--ard-dark);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Callouts ---------- */
.callout {
  background: #FEF3C7;
  border-left: 4px solid #F59E0B;
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.92rem;
}
.callout strong { color: #92400E; }

/* ---------- Reveal blocks (text answer reveals) ---------- */
details {
  background: var(--ard-soft);
  border-radius: 10px;
  padding: 10px 16px;
  margin: 12px 0;
}
details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ard-dark);
}
details[open] summary { margin-bottom: 8px; }

/* ---------- Wiring diagrams ---------- */
figure.wiring-diagram {
  background: #FBF9F2;
  border: 1px solid #DCE9EB;
  border-radius: 12px;
  padding: 18px 20px 14px;
  margin: 16px 0;
  overflow: hidden;
}
figure.wiring-diagram > svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
}
figure.wiring-diagram > figcaption {
  font-size: 0.85rem;
  color: var(--muted, #64748B);
  text-align: center;
  margin-top: 10px;
  line-height: 1.45;
}

/* ---------- Wiring-answer reveal (button-styled <details>) ---------- */
details.wiring-reveal {
  background: transparent;
  padding: 0;
  margin: 16px 0;
  border-radius: 12px;
}
details.wiring-reveal > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ard);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  transition: background .15s ease, transform .15s ease;
  user-select: none;
}
details.wiring-reveal > summary::-webkit-details-marker { display: none; }
details.wiring-reveal > summary::before {
  content: "🔧";
  font-size: 1rem;
}
details.wiring-reveal > summary:hover {
  background: var(--ard-dark);
  transform: translateY(-1px);
}
details.wiring-reveal[open] > summary {
  background: var(--ard-dark);
}
details.wiring-reveal[open] > summary::before {
  content: "✓";
}
details.wiring-reveal[open] > summary::after {
  content: " — answer below";
  font-weight: 500;
  opacity: 0.85;
}
details.wiring-reveal > figure.wiring-diagram {
  margin-top: 12px;
}

/* ---------- Schematic-answer reveal (navy pill — distinct from wiring-reveal) ---------- */
details.schematic-reveal {
  background: transparent;
  padding: 0;
  margin: 16px 0;
  border-radius: 12px;
}
details.schematic-reveal > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1E3A8A;
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  transition: background .15s ease, transform .15s ease;
  user-select: none;
}
details.schematic-reveal > summary::-webkit-details-marker { display: none; }
details.schematic-reveal > summary::before {
  content: "📐";
  font-size: 1rem;
}
details.schematic-reveal > summary:hover {
  background: #1E40AF;
  transform: translateY(-1px);
}
details.schematic-reveal[open] > summary {
  background: #1E40AF;
}
details.schematic-reveal[open] > summary::before {
  content: "✓";
}
details.schematic-reveal[open] > summary::after {
  content: " — schematic below";
  font-weight: 500;
  opacity: 0.85;
}
details.schematic-reveal > figure.circuit-diagram {
  margin-top: 12px;
}

/* ---------- Circuit-diagram figure (schematic on white background) ---------- */
figure.circuit-diagram {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
  text-align: center;
}
figure.circuit-diagram svg {
  max-width: 100%;
  height: auto;
}
figure.circuit-diagram figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ard-fg-muted, #475569);
  text-align: left;
}

/* ---------- Tasks (Try It Yourself) ---------- */
.task {
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
  background: #FAFCFD;
}
.task-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.task--easy    .task-tag { background: #DCFCE7; color: #166534; }
.task--medium  .task-tag { background: #FEF3C7; color: #92400E; }
.task--stretch .task-tag { background: #FEE2E2; color: #991B1B; }

/* ---------- Vocabulary card ---------- */
dl.vocab {
  background: var(--ard-soft);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0 0;
}
dl.vocab dt {
  font-weight: 700;
  color: var(--ard-dark);
  margin-top: 8px;
}
dl.vocab dt:first-child { margin-top: 0; }
dl.vocab dd {
  margin: 2px 0 0 0;
  color: var(--ink, #0F172A);
}

/* ---------- Footer ---------- */
.lesson-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid #E2E8F0;
  background: #fff;
}
.lesson-footer a {
  color: var(--ard-dark);
  font-weight: 600;
  text-decoration: none;
}
.lesson-footer a:hover { text-decoration: underline; }

/* ============================================================
   Lesson chrome added during Next.js / TSX migration
   - .lesson-crumbs : breadcrumb above the teal title, white on gradient
   - .lesson-foot   : prev/next navigation card pair below the lesson body
   ============================================================ */

.lesson-header .lesson-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 14px;
}
.lesson-header .lesson-crumbs a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}
.lesson-header .lesson-crumbs a:hover {
  color: #fff;
  text-decoration: underline;
}
.lesson-header .lesson-crumbs .sep { opacity: 0.55; }
.lesson-header .lesson-crumbs .here { color: #fff; font-weight: 600; }

.lesson-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 36px auto 48px;
  max-width: 980px;
  padding: 0 32px;
}
.lesson-foot__btn {
  flex: 1;
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid #DCE9EB;
  background: #fff;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink, #0F172A);
  display: block;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.lesson-foot__btn:hover {
  transform: translateY(-2px);
  border-color: #00979D;
  box-shadow: 0 10px 24px -16px rgba(0, 151, 157, 0.5);
  text-decoration: none;
}
.lesson-foot__btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}
.lesson-foot__dir {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 4px;
}
.lesson-foot__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink, #0F172A);
}
.lesson-foot__btn--next { text-align: right; }

@media (max-width: 720px) {
  .lesson-foot { flex-direction: column; margin: 28px 18px 36px; padding: 0; }
  .lesson-foot__btn--next { text-align: left; }
}

/* ============================================================
   Assessment runner (ARD-L01-assessment)
   Class prefix: .as-*  ·  Multi-screen single-page flow.
   ============================================================ */

.hide { display: none !important; }

.as-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---------- Card panels ---------- */
.as-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.as-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ard-ink);
}
.as-sub {
  font-size: 0.95rem;
  color: #475569;
  margin: 0 0 14px;
}
.as-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ard-ink);
}
.as-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ard-ink);
  margin: 0 0 10px;
}
.as-card ul { padding-left: 22px; }
.as-card ul li { margin-bottom: 6px; font-size: 0.95rem; }

/* ---------- Warning / info callout ---------- */
.as-warn {
  background: #FEF3C7;
  border-left: 4px solid #F59E0B;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0 0;
  font-size: 0.92rem;
  color: #78350F;
}
.as-warn strong { color: #78350F; }

/* ---------- Top bar (question screen) ---------- */
.as-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: #334155;
}
.as-progress {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}
.as-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--ard) 0%, var(--ard-dark) 100%);
  width: 0%;
  transition: width .25s ease;
}
.as-timer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ard-dark);
  background: var(--ard-soft);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

/* ---------- Part banner inside question card ---------- */
.as-part-banner {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: #E2E8F0;
  color: #334155;
}
.as-part-banner.A { background: #DBEAFE; color: #1E40AF; }
.as-part-banner.B { background: #FEF3C7; color: #92400E; }
.as-part-banner.C { background: #FCE7F3; color: #9D174D; }

/* ---------- Nav button row ---------- */
.as-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.as-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease, border-color .15s ease;
  user-select: none;
  line-height: 1.2;
}
.as-btn:hover { transform: translateY(-1px); }
.as-btn.primary {
  background: var(--ard);
  color: #fff;
}
.as-btn.primary:hover { background: var(--ard-dark); }
.as-btn.ghost {
  background: #fff;
  color: var(--ard-dark);
  border-color: #CBD5E1;
}
.as-btn.ghost:hover { border-color: var(--ard); color: var(--ard); }
.as-btn.warn {
  background: #B45309;
  color: #fff;
}
.as-btn.warn:hover { background: #92400E; }

/* ---------- Review screen ---------- */
.as-rev-section { margin-bottom: 18px; }
.as-rev-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.as-rev-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  background: #FEF3C7;
  color: #92400E;
  transition: transform .12s ease, border-color .12s ease;
}
.as-rev-cell.answered { background: #DCFCE7; color: #166534; }
.as-rev-cell:hover { transform: translateY(-1px); border-color: var(--ard); }

/* ---------- Results: score blocks ---------- */
.as-score {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--ard-soft);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 6px;
}
.as-score .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ard-dark);
  line-height: 1;
}
.as-score .pct {
  font-size: 0.95rem;
  color: #334155;
}
.as-score .pct strong { color: var(--ard-ink); }

/* ---------- Per-part totals grid ---------- */
.as-part-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.as-part-totals > div {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}
.pt-big {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ard-ink);
  line-height: 1.1;
}
.pt-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748B;
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Badge (final grade band) ---------- */
.as-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 6px;
  background: #E2E8F0;
  color: #334155;
}
.as-badge.pending     { background: #E2E8F0; color: #475569; }
.as-badge.pass        { background: #DCFCE7; color: #166534; }
.as-badge.distinction { background: #FEF3C7; color: #92400E; }
.as-badge.fail        { background: #FEE2E2; color: #991B1B; }

/* ---------- Modal overlay ---------- */
.as-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.as-modal-bg.show { display: flex; }
.as-modal {
  background: #fff;
  border-radius: 14px;
  padding: 24px 26px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.35);
}
.as-modal h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--ard-ink);
}
.as-modal p {
  margin: 0 0 18px;
  font-size: 0.95rem;
  color: #475569;
}
.as-modal-acts {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Question body (rendered by runner JS) ---------- */
.as-q-stem {
  margin: 0 0 14px;
  font-size: 0.98rem;
  color: #1E293B;
}
.as-q-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ard-ink);
}
.as-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 4px;
}
.as-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  background: #FAFCFD;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color .12s ease, background .12s ease;
}
.as-opt:hover { border-color: var(--ard); background: #fff; }
.as-opt input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--ard);
}
.as-opt:has(input:checked) {
  border-color: var(--ard);
  background: var(--ard-soft);
}
.as-textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  color: #0F172A;
  font-family: 'JetBrains Mono', 'Courier New', ui-monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}
.as-textarea:focus {
  outline: 2px solid var(--ard);
  outline-offset: -1px;
}

/* ---------- Part A per-question result rows ---------- */
.as-result-row {
  display: grid;
  grid-template-columns: 32px 1fr 28px;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  margin-bottom: 8px;
  align-items: start;
  background: #fff;
}
.as-result-row.ok  { background: #F0FDF4; border-color: #BBF7D0; }
.as-result-row.bad { background: #FEF2F2; border-color: #FECACA; }
.as-result-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  color: #475569;
}
.as-result-q p { margin: 0 0 4px; font-size: 0.92rem; }
.as-result-line { color: #475569; font-size: 0.9rem; }
.as-result-line.ok { color: #166534; }
.as-result-mark {
  text-align: right;
  font-size: 1.25rem;
  font-weight: 700;
}
.as-result-row.ok  .as-result-mark { color: #16A34A; }
.as-result-row.bad .as-result-mark { color: #DC2626; }

/* ---------- Teacher mark blocks (Parts B & C) ---------- */
.as-mark-block {
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: #FAFCFD;
}
.as-mark-block h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--ard-ink);
}
.as-student-label {
  margin-top: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748B;
}
.as-student-answer {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 6px 0 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 360px;
  overflow: auto;
  color: #0F172A;
}

/* ---------- Rubric (per-criterion teacher inputs) ---------- */
.as-rubric {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #CBD5E1;
}
.as-rubric-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
}
.as-rubric-label { color: #1E293B; flex: 1; }
.as-rubric-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.as-rubric-input input {
  width: 56px;
  padding: 6px 8px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.92rem;
  text-align: center;
}
.as-rubric-input input:focus { outline: 2px solid var(--ard); }
.as-rubric-max { color: #94A3B8; }

/* ---------- Small-screen tweaks ---------- */
@media (max-width: 600px) {
  .as-shell { padding: 20px 14px 60px; }
  .as-card { padding: 20px 18px; }
  .as-bar { flex-wrap: wrap; }
  .as-nav { flex-direction: column-reverse; align-items: stretch; }
  .as-nav .as-btn { width: 100%; justify-content: center; }
  .as-rubric-row { flex-direction: column; align-items: flex-start; }
}

/* Print: clean record for teacher / PDF export */
@media print {
  .topnav, .site-footer, .as-bar, .as-nav, #screen-start, #screen-q, #screen-review { display: none !important; }
  .as-modal-bg { display: none !important; }
  .as-card { border-color: #94A3B8; break-inside: avoid; }
  .as-shell { padding: 0; }
}
