:root {
  --font: "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  --petrol: #0e5a6b;
  --petrol-2: #127084;
  --petrol-soft: #e6f1f3;
  --orange: #e8762c;
  --orange-soft: #fdeee3;
  --bg: #ffffff;
  --surface: #ffffff;
  --page: #f6f9fa;
  --ink: #12303a;
  --ink-2: #4a5f66;
  --line: #d5e1e4;
  --good: #1e7d4f;
  --good-soft: #e5f4ec;
  --bad: #b23b2b;
  --bad-soft: #fbeae7;
  --note-soft: #fff6e0;
  --plot-bg: #ffffff;
  --grid: #e4edf0;
  --axis: #3f555c;
  --plot-f: #0e5a6b;
  --plot-g: #8e44ad;
  --plot-d1: #c2185b;
  --plot-d2: #2e86c1;
  --asymptote: #c0392b;
  --tangent: #e8762c;
  --normal: #8e44ad;
  --secant: #16a085;
  --left: #e8762c;
  --right: #127084;
  --accent: #e8762c;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.7;
  font-size: 16px;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; }
h2 { font-size: 1.15rem; color: var(--petrol); }
h3 { font-size: 1.02rem; margin-top: 14px; color: var(--petrol); }
small { color: var(--ink-2); font-weight: 400; }
[hidden] { display: none !important; }

/* the school band: identity, credits and contact in one horizontal strip */
.school-band {
  --gold: #f6c453;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 22px;
  padding: 14px clamp(16px, 3vw, 32px);
  color: #fff;
  background:
    radial-gradient(circle at 12% 120%, rgba(232, 118, 44, .35), transparent 42%),
    radial-gradient(circle at 92% -30%, rgba(255, 255, 255, .14), transparent 40%),
    linear-gradient(115deg, #072f3a 0%, #0b4655 45%, #0e5a6b 100%);
}
.sb-id { display: flex; align-items: center; gap: 12px; }
.sb-logo { width: 68px; height: 68px; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 0 0 3px rgba(246, 196, 83, .55), 0 4px 14px rgba(0, 0, 0, .3); flex: none; }
.sb-titles { display: grid; gap: 2px; justify-items: start; }
.sb-gov { margin: 0; font-size: .78rem; color: rgba(255, 255, 255, .78); }
.sb-gov i { font-style: normal; color: var(--gold); padding: 0 2px; }
.sb-school { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.35; }
.sb-pill { font-size: .78rem; font-weight: 700; padding: 1px 12px; border-radius: 999px; background: var(--orange); color: #fff; }
.sb-credits {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
}
.sb-credits li {
  display: grid; justify-items: center; gap: 0;
  padding: 4px 11px 2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
}
.sb-credits li.sb-lead { background: rgba(246, 196, 83, .14); border-color: rgba(246, 196, 83, .45); }
.sb-credits span { font-size: .7rem; color: rgba(255, 255, 255, .72); white-space: nowrap; }
.sb-credits b { font-family: "Aref Ruqaa", var(--font); font-weight: 700; font-size: 1.05rem; color: var(--gold); white-space: nowrap; line-height: 1.6; }
.sb-contact { display: grid; gap: 6px; justify-items: end; }
.sb-contact a { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font-size: .88rem; padding: 3px 10px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.sb-contact a:hover { background: rgba(255, 255, 255, .2); }
.sb-contact svg { width: 15px; height: 15px; fill: var(--gold); flex: none; }
@media (max-width: 1700px) {
  .school-band { grid-template-columns: minmax(0, 1fr) auto; }
  .sb-credits { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 700px) {
  .school-band { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .sb-contact { justify-items: start; grid-template-columns: repeat(auto-fit, minmax(0, max-content)); grid-auto-flow: column; overflow-x: auto; }
  /* on a phone the credits slide sideways in one row */
  .sb-credits { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .sb-credits li { scroll-snap-align: start; }
  .sb-school { font-size: 1.15rem; }
}

.flag-band { height: 6px; background: linear-gradient(to left, var(--petrol) 0 70%, var(--orange) 70% 100%); }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 3vw, 32px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand h1 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); color: var(--petrol); }
.brand p { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }
.top-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface); }
.switch input { width: 18px; height: 18px; accent-color: var(--orange); }

.modes {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px clamp(16px, 3vw, 32px) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.modes button {
  border: 0; background: none; padding: 10px 16px; border-bottom: 3px solid transparent;
  font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.modes button[aria-selected="true"] { color: var(--petrol); border-bottom-color: var(--orange); }
.mode-hint { margin: 10px clamp(16px, 3vw, 32px) 0; color: var(--ink-2); font-size: .95rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 410px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 32px) 32px;
  align-items: start;
}
.layout > .questions { grid-column: 1 / -1; }
@media (min-width: 1500px) {
  .layout { grid-template-columns: minmax(320px, 400px) minmax(0, 1.4fr) minmax(380px, 1fr); }
  .layout > .questions { grid-column: auto; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

.field { display: grid; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field label, .field > span { font-weight: 600; font-size: .92rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field.checks { align-content: end; }
.field.checks label { font-weight: 400; }
input[type="text"], input:not([type]), input[type="number"], select {
  width: 100%; min-height: 42px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
input:focus-visible, select:focus-visible, button:focus-visible, canvas:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 55%, transparent); outline-offset: 1px;
}
.math-input { font-family: "Cascadia Mono", Consolas, var(--font); font-size: 1.05rem; text-align: left; }
/* an empty field shows its Arabic example from right to left; typed mathematics stays left to right */
.math-input:placeholder-shown { direction: rtl; text-align: right; font-family: var(--font); font-size: .95rem; }

button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; min-height: 40px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--petrol-2); }
button.accent { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
button.ghost { background: var(--surface); }
button.ghost:hover { border-color: var(--petrol); }
button.small { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
button.icon { width: 40px; padding: 0; font-size: 1.25rem; line-height: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.seg button { border: 0; border-radius: 0; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--petrol); color: #fff; }

.piece-head, .piece-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 36px; gap: 6px; align-items: center; }
.piece-head { font-size: .85rem; color: var(--ink-2); }
.piece-row { margin-bottom: 6px; }
.piece-row button { min-height: 38px; padding: 0; }

/* left to right, so < and ( are not mirrored and match what they insert */
.keypad { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; direction: ltr; }
.keypad button { min-height: 34px; min-width: 38px; padding: 2px 8px; font-size: .95rem; background: var(--petrol-soft); border-color: transparent; }
.keypad button:hover { border-color: var(--petrol); }

.preview { min-height: 44px; padding: 8px 10px; background: var(--petrol-soft); border-radius: 8px; overflow-x: auto; }
.msg { padding: 8px 12px; border-radius: 8px; margin: 8px 0; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg.good { background: var(--good-soft); color: var(--good); }
.msg.note { background: var(--note-soft); }
.hint { color: var(--ink-2); font-size: .93rem; }

.analysis { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.analysis h3 { margin: 0 0 4px; }
.analysis dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; }
.analysis dt { color: var(--ink-2); font-size: .9rem; }
.analysis dd { margin: 0; min-width: 0; overflow-x: auto; }
.suggest { margin: 0; padding-inline-start: 18px; }
.suggest li { margin-bottom: 4px; }
.suggest button { min-height: 30px; padding: 0 8px; font-size: .85rem; margin-inline-start: 6px; }

.plot-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.zoom { display: flex; gap: 6px; align-items: center; }
.toggles { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; }
.toggles label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.toggles input { accent-color: var(--petrol); width: 17px; height: 17px; }
#plot { width: 100%; height: clamp(320px, 52vh, 560px); display: block; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: grab; }
#plot:active { cursor: grabbing; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: .92rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 22px; height: 4px; border-radius: 2px; display: inline-block; }
.trace-row, .lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.trace-row input[type="range"], .lab-row input[type="range"] { flex: 1 1 180px; accent-color: var(--orange); }
.trace-row output, .lab-row output { min-width: 120px; font-weight: 600; }

.lab-tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.lab-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; font-weight: 600; color: var(--ink-2); }
.lab-tabs button[aria-selected="true"] { color: var(--petrol); border-bottom-color: var(--orange); }
.lab { padding-top: 6px; }
.limit-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.limit-cards .card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; overflow-x: auto; }
.limit-cards .card b { display: block; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.limit-cards .card.left { border-top: 4px solid var(--left); }
.limit-cards .card.right { border-top: 4px solid var(--right); }
.limit-cards .card.value { border-top: 4px solid var(--petrol); }
.limit-cards .card.total { border-top: 4px solid var(--ink-2); }
.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: 4px 8px; text-align: center; }
th { background: #c9d9df; }
.tables caption { font-weight: 700; padding-bottom: 4px; }
.tables .table-kind { grid-column: 1 / -1; margin: 0; color: var(--petrol); }
.tables .left-t caption { color: var(--left); }
.tables .right-t caption { color: var(--right); }
.quotient { margin-top: 10px; display: grid; gap: 8px; overflow-x: auto; }

/* the national ribbon after a correct answer: the flag of Oman and a phrase */
.cheer {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 7px 16px 7px 12px;
  border-radius: 999px;
  color: #fff; font-weight: 700;
  background: linear-gradient(to left, #0b4655, #0e5a6b 60%, #127084);
  border-inline-start: 5px solid #d52b1e;
  box-shadow: 0 6px 16px rgba(14, 90, 107, .25), inset 0 -3px 0 #008a3e;
  animation: cheer-in .45s cubic-bezier(.2, .9, .3, 1.3);
}
.cheer-flag { width: 30px; height: 20px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.cheer-comeback { background: linear-gradient(to left, #8a3a0d, #b8541a 60%, #e8762c); }
.cheer-hinted { background: linear-gradient(to left, #3d4d53, #4f6870 60%, #5f7d86); }
@keyframes cheer-in {
  from { opacity: 0; transform: translateY(8px) scale(.92); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cheer { animation: none; } }

/* why some skills were left out: a quiet line */
.skipped { margin: 0 0 10px; font-size: .9rem; color: var(--ink-2); }
.skipped summary { cursor: pointer; padding: 4px 0; }
.skipped ul { margin: 4px 0 0; padding: 8px 24px 8px 12px; background: var(--note-soft); border-radius: 8px; }

/* the student's result */
.score { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; background: var(--petrol-soft); display: grid; gap: 10px; }
.score-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.score-head h3 { margin: 0; }
.score-head input { max-width: 280px; }
.score-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.score-card { background: var(--surface); border-radius: 8px; padding: 8px 10px; border-top: 4px solid var(--petrol); display: grid; }
.score-card b { font-size: 1.5rem; color: var(--petrol); line-height: 1.3; }
.score-card span { font-size: .85rem; color: var(--ink-2); }
.score-card.first { border-top-color: var(--good); }
.score-card.hint { border-top-color: var(--orange); }
.score-card.seen { border-top-color: var(--plot-g); }
.score-card.wrong { border-top-color: var(--bad); }
.score-table { background: var(--surface); }

/* questions */
.q-nav { display: flex; align-items: center; gap: 8px; }
.qcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.qhead { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--petrol-soft); color: var(--petrol); font-weight: 600; }
.badge.book { background: var(--orange-soft); color: #9a4510; }
.badge.gen { background: #eef0f2; color: var(--ink-2); }
.qintro { margin-bottom: 10px; font-size: 1.05rem; }
.part { border-top: 1px dashed var(--line); padding: 10px 0; }
.part-prompt { display: flex; gap: 8px; align-items: baseline; }
.part-label { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--petrol); color: #fff; font-weight: 700; flex: none; }
.answer-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; align-items: center; }
.answer-row input { flex: 1 1 220px; width: auto; }
.quick { display: flex; flex-wrap: wrap; gap: 4px; }
.quick button, .choices button { min-height: 36px; padding: 2px 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.choices button[aria-pressed="true"] { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.part-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.feedback { margin-top: 6px; }
.hints { margin-top: 6px; display: grid; gap: 6px; }
.hints .msg b { color: #9a4510; }
.solution { margin-top: 8px; padding: 10px 12px; background: var(--petrol-soft); border-radius: 8px; display: grid; gap: 6px; overflow-x: auto; }
.solution .final { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; }
.qfoot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.validity { font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.validity summary { cursor: pointer; }

.fn-block { display: inline-flex; align-items: center; gap: 8px; direction: rtl; vertical-align: middle; flex-wrap: wrap; }
.piecewise { display: inline-flex; align-items: stretch; gap: 6px; vertical-align: middle; }
.piecewise .brace { font-size: 2.6em; line-height: 1; display: flex; align-items: center; color: var(--ink-2); transform: scaleY(1.1); }
.piecewise .rows { display: grid; grid-template-columns: auto auto; gap: 2px 14px; align-items: center; }
.piecewise .cond { color: var(--ink-2); }
.hidden-fn { padding: 2px 10px; background: var(--orange-soft); border-radius: 6px; }

.sign-table { width: auto; min-width: 280px; margin: 4px 0; direction: ltr; }
.sign-table th:last-child, .sign-table td:last-child { direction: rtl; background: #c9d9df; font-weight: 600; }
.sign-table .pos { color: var(--good); font-weight: 700; }
.sign-table .neg { color: var(--bad); font-weight: 700; }

/* Arabic mathematics reads from right to left; each equation is isolated from the text around it */
.katex { font-size: 1.12em; unicode-bidi: isolate; }
.katex .katex-html { direction: rtl; }

/* book */
.book-view { margin: 14px clamp(16px, 3vw, 32px) 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 10px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.gallery button { padding: 0; border: 0; border-radius: 0; display: block; width: 100%; }
.gallery img { width: 100%; display: block; aspect-ratio: 595 / 794; object-fit: cover; object-position: top; }
.gallery figcaption { padding: 6px 8px; font-size: .85rem; }
.gallery figcaption b { color: var(--orange); }
.gallery .links { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gallery .links button { width: auto; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: .8rem; min-height: 28px; }
.gallery .none { color: var(--ink-2); font-size: .8rem; }
.book-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.book-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.book-item button { justify-self: start; }

.lightbox { position: fixed; inset: 0; background: rgba(10, 30, 36, .88); z-index: 50; display: grid; grid-template-rows: auto 1fr; }
.lightbox-bar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; background: var(--surface); }
.lightbox-bar span { flex: 1; font-weight: 600; }
.lightbox-body { overflow: auto; padding: 16px; text-align: center; }
.lightbox-body img { width: min(900px, 100%); background: #fff; transition: width .15s; }

/* teacher */
.teacher-view { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; padding: 14px clamp(16px, 3vw, 32px) 32px; align-items: start; }
@media (max-width: 900px) { .teacher-view { grid-template-columns: minmax(0, 1fr); } }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 8px 12px; }
legend { font-weight: 700; color: var(--petrol); padding: 0 6px; }
.lesson-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; }
.lesson-picks label, .level-picks label { display: flex; gap: 6px; align-items: center; font-size: .92rem; }
.level-picks { display: flex; gap: 16px; flex-wrap: wrap; }
.ws-list { display: grid; gap: 12px; }
.ws-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.ws-edit textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.ws-edit { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 6px; margin-top: 8px; align-items: end; }
@media (max-width: 600px) { .ws-edit { grid-template-columns: minmax(0, 1fr); } }

.print-root { display: none; }

@media (max-width: 600px) {
  body { font-size: 15px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 12px; }
}

/* classroom screen: larger text when the window is very wide */
@media (min-width: 1900px) {
  body { font-size: 18px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12.5pt; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .ws-qr { float: left; display: flex; align-items: center; gap: 8px; margin: 0 0 6px 6px; padding: 6px 8px; border: 1px solid #c9d9df; border-radius: 8px; }
  .ws-qr img { width: 26mm; height: 26mm; display: block; }
  .ws-qr div { display: grid; font-size: 9pt; color: var(--ink-2); line-height: 1.5; }
  .ws-qr b { color: var(--petrol); font-size: 10pt; }
  .ws-qr bdi { font-family: Consolas, monospace; color: var(--ink); }
  .ws-page-title { text-align: center; color: var(--petrol); margin-bottom: 4px; }
  .ws-meta { text-align: center; color: var(--ink-2); margin-bottom: 14px; }
  .ws-q { break-inside: avoid; border: 1px solid #bbb; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
  .ws-q img { width: 70%; display: block; margin: 6px auto; border: 1px solid #ddd; }
  .ws-lines { margin-top: 6px; }
  .ws-lines div { border-bottom: 1px solid #bbb; height: 26px; }
  .ws-solutions { break-before: page; }
  .ws-sol { break-inside: avoid; margin-bottom: 10px; border-bottom: 1px solid #ddd; padding-bottom: 8px; }
  .badge { border: 1px solid #ccc; }
}
