/* Math Word Problem Solver and question pages.
   Colours are tokens. Light values are the default; html.dark (set by js/theme.js) swaps them. */
:root {
  --s-surface: #ffffff;
  --s-page: #f8fafc;
  --s-line: #e2e8f0;
  --s-line-strong: #cbd5e1;
  --s-text: #0f172a;
  --s-text-2: #334155;
  --s-muted: #475569;
  --s-accent: #0f172a;
  --s-accent-hover: #334155;
  --s-accent-ink: #ffffff;
  --s-accent-soft: #f1f5f9;
  --s-focus: #cbd5e1;
  --s-input: #ffffff;
  --s-step: #f8fafc;
  --s-step-line: #94a3b8;
  --s-mono: #1e293b;
  --s-answer-bg: #f8fafc;
  --s-answer-line: #cbd5e1;
  --s-answer-kicker: #334155;
  --s-answer-value: #0f172a;
  --s-answer-text: #334155;
  --s-info-bg: #eff6ff;
  --s-info-text: #1e3a8a;
  --s-warn-bg: #fffbeb;
  --s-warn-line: #fcd34d;
  --s-warn-text: #92400e;
  --s-disabled: #94a3b8;
  --s-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

html.dark {
  --s-surface: #141418;
  --s-page: #0b0b0e;
  --s-line: #26262e;
  --s-line-strong: #3a3a45;
  --s-text: #f4f4ef;
  --s-text-2: #d6d6de;
  --s-muted: #9a9aa6;
  --s-accent: #e7edf5;
  --s-accent-hover: #ffffff;
  --s-accent-ink: #0b0b0e;
  --s-accent-soft: #1b1b21;
  --s-focus: #3a3a45;
  --s-input: #0b0b0e;
  --s-step: #1b1b21;
  --s-step-line: #6b6b78;
  --s-mono: #d6d6de;
  --s-answer-bg: #17171d;
  --s-answer-line: #2d2d37;
  --s-answer-kicker: #c3c3cc;
  --s-answer-value: #f4f4ef;
  --s-answer-text: #d6d6de;
  --s-info-bg: #15223a;
  --s-info-text: #bfdbfe;
  --s-warn-bg: #2a2112;
  --s-warn-line: #6b5314;
  --s-warn-text: #fde68a;
  --s-disabled: #4b5563;
  --s-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35);
}

/* Cards */
.solver-card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 16px; box-shadow: var(--s-shadow); padding: 20px; color: var(--s-text-2); }
.solver-card + .solver-card { margin-top: 20px; }

/* Input */
.solver-field label { display: block; font-weight: 700; color: var(--s-text); margin-bottom: 8px; }
.solver-field textarea { width: 100%; min-height: 150px; box-sizing: border-box; font: inherit; font-size: 17px; line-height: 1.5; padding: 14px; border: 1px solid var(--s-line-strong); border-radius: 12px; resize: vertical; color: var(--s-text); background: var(--s-input); }
.solver-field textarea::placeholder { color: var(--s-muted); opacity: .8; }
.solver-field textarea:focus { outline: 3px solid var(--s-focus); outline-offset: 1px; border-color: var(--s-accent); }
.solver-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--s-muted); }
.solver-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Buttons */
.solver-btn { appearance: none; border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 700; font-size: 16px; background: var(--s-accent); color: var(--s-accent-ink); cursor: pointer; min-height: 44px; }
.solver-btn:hover { background: var(--s-accent-hover); }
.solver-btn:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.solver-btn:disabled { background: var(--s-disabled); color: var(--s-accent-ink); cursor: not-allowed; }
.solver-btn-quiet { background: var(--s-step); color: var(--s-text); border: 1px solid var(--s-line-strong); }
.solver-btn-quiet:hover { background: var(--s-line); }

/* Examples */
.solver-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.solver-example { appearance: none; border: 1px solid var(--s-line-strong); background: var(--s-step); color: var(--s-text); border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.solver-example:hover { border-color: var(--s-accent); }

/* Notices */
.solver-notice { border-radius: 12px; padding: 14px; font-size: 16px; line-height: 1.5; }
.solver-notice-info { background: var(--s-info-bg); color: var(--s-info-text); }
.solver-notice-limit, .solver-notice-unavailable { background: var(--s-warn-bg); color: var(--s-warn-text); border: 1px solid var(--s-warn-line); }

/* Answer */
.solver-answer { background: var(--s-answer-bg); border: 1px solid var(--s-answer-line); border-radius: 14px; padding: 18px; }
.solver-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 800; color: var(--s-answer-kicker); margin: 0; }
.solver-value { font-size: clamp(2rem, 8vw, 2.75rem); font-weight: 800; color: var(--s-answer-value); margin: 6px 0; overflow-wrap: anywhere; }
.solver-label { margin: 0; color: var(--s-answer-text); }
.solver-verified { font-size: 14px; color: var(--s-answer-text); margin: 10px 0 0; }
.solver-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Steps */
.solver-h { font-size: 20px; font-weight: 800; color: var(--s-text); margin: 0 0 12px; }
.solver-step-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.solver-step { border-left: 4px solid var(--s-step-line); background: var(--s-step); padding: 12px 14px; border-radius: 10px; }
.solver-step-title { font-weight: 800; margin: 0 0 4px; color: var(--s-text); }
.solver-step-expr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 0 4px; color: var(--s-mono); overflow-wrap: anywhere; }
.solver-step-text { margin: 0; color: var(--s-muted); font-size: 15px; }
.solver-steps .solver-btn { margin-top: 12px; }
.solver-status { position: absolute; left: -9999px; }

/* Guide text */
.solver-guide p, .solver-guide li { color: var(--s-muted); line-height: 1.6; }
.solver-guide ul { padding-left: 20px; }
.solver-guide a { color: var(--s-accent); }
.solver-card a { color: var(--s-accent); }

/* Fixes found in review */
/* Empty results area should not show as an empty card. */
section.solver-card:empty { display: none; }
/* Numbered lists keep their numbers inside the guide cards. */
html body main .solver-guide ol { list-style: decimal; padding-left: 22px; }
/* Headings inside cards are plain text, not a second box. */
html body main section.solver-card > h2 { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 12px !important; color: var(--s-text) !important; }
/* Stronger rule for headings inside solver cards (site headings add a box). */
html body main section.solver-card > h2.solver-h { background: transparent !important; background-color: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 12px !important; display: block !important; width: auto !important; }

/* Answer appears directly under the buttons. */
#solverOutput:empty { display: none; }
#solverOutput { margin-top: 16px; display: grid; gap: 16px; }

/* Visually hidden, still read by screen readers. */
.solver-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Solver layout v4: larger type, stronger borders and labels, one-column lists. ---- */
.sv-main { max-width: 1200px; margin: 0 auto; padding: 28px 16px 48px; display: grid; gap: 24px; color: var(--s-text-2); font-size: 17px; }
.sv-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sv-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 800; color: var(--s-text); letter-spacing: -0.02em; line-height: 1.15; }
.sv-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--s-accent); color: var(--s-accent-ink); font-size: 24px; flex: 0 0 56px; }
.sv-sub { margin: -12px 0 0; font-size: 18px; line-height: 1.5; color: var(--s-text-2); max-width: 60ch; }
.sv-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sv-card { background: var(--s-surface); border: 1.5px solid var(--s-line-strong); border-radius: 20px; box-shadow: var(--s-shadow); padding: 24px; min-width: 0; }
.sv-recent { position: sticky; top: 16px; }
.sv-h2 { margin: 0 0 12px; font-size: 19px; font-weight: 800; color: var(--s-text); line-height: 1.3; }
.sv-label { display: block; margin: 0 0 10px; font-size: 19px; font-weight: 800; color: var(--s-text); }
.sv-form textarea { width: 100%; min-height: 170px; box-sizing: border-box; font: inherit; font-size: 18px; line-height: 1.55; padding: 16px; border: 2px solid var(--s-line-strong); border-radius: 16px; resize: vertical; background: var(--s-input); color: var(--s-text); }
.sv-form textarea::placeholder { color: var(--s-muted); opacity: 1; }
.sv-form textarea:focus { outline: 3px solid var(--s-focus); outline-offset: 2px; border-color: var(--s-accent); }
.sv-meta { text-align: right; font-size: 15px; color: var(--s-muted); margin-top: 6px; }
.sv-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.sv-btn { appearance: none; border: 2px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-text); border-radius: 12px; padding: 13px 22px; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; min-height: 52px; }
.sv-btn:hover { border-color: var(--s-accent); }
.sv-btn:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.sv-btn-primary { flex: 1 1 200px; background: var(--s-accent); border-color: var(--s-accent); color: var(--s-accent-ink); }
.sv-btn-primary:hover { background: var(--s-accent-hover); border-color: var(--s-accent-hover); }
.sv-btn-primary:disabled { background: var(--s-line); border-color: var(--s-line-strong); color: var(--s-text-2); cursor: not-allowed; }
.sv-output:empty { display: none; }
.sv-output { margin-top: 18px; display: grid; gap: 14px; }
.sv-output .solver-answer { padding: 20px; border-width: 2px; }
.sv-output .solver-kicker { font-size: 14px; }
.sv-output .solver-value { font-size: clamp(2.2rem, 6vw, 3rem); }
.sv-output .solver-label { font-size: 17px; }
.sv-output .solver-verified { font-size: 15px; }
.sv-output .solver-actions .solver-btn { font-size: 16px; min-height: 48px; }
.sv-output .solver-steps { padding: 0; background: none; border: 0; box-shadow: none; }
.sv-output .solver-h { font-size: 19px; margin-bottom: 10px; }
.sv-output .solver-step { border-left-width: 5px; padding: 14px 16px; }
.sv-output .solver-step-title { font-size: 17px; }
.sv-output .solver-step-expr { font-size: 17px; }
.sv-output .solver-step-text { font-size: 16px; color: var(--s-text-2); }
.sv-examples { margin-top: 22px; }
.sv-chips { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sv-chip { appearance: none; display: block; width: 100%; text-align: left; border: 1.5px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-text); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; cursor: pointer; line-height: 1.45; min-height: 48px; box-sizing: border-box; }
.sv-chip span { display: block; }
.sv-chip:hover, .sv-chip:focus-visible { border-color: var(--s-accent); background: var(--s-accent-soft); outline: none; }
.sv-note { font-size: 15px; color: var(--s-muted); margin: 16px 0 0; line-height: 1.55; }
.sv-note a { color: var(--s-accent); font-weight: 700; }
.sv-recent .sv-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sv-tab { appearance: none; border: 2px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-text); border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; min-height: 44px; }
.sv-tab:hover { border-color: var(--s-accent); }
.sv-tab[aria-pressed="true"] { background: var(--s-accent); border-color: var(--s-accent); color: var(--s-accent-ink); }
.sv-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.sv-item { display: grid; grid-template-columns: 30px 1fr 16px; align-items: center; gap: 12px; text-decoration: none; border: 1.5px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-text); border-radius: 12px; padding: 12px 14px; min-height: 56px; box-sizing: border-box; }
.sv-item:hover, .sv-item:focus-visible { border-color: var(--s-accent); background: var(--s-accent-soft); outline: none; }
.sv-item-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: #15803d; color: #ffffff; font-size: 15px; font-weight: 800; }
.sv-item-text { font-size: 16px; line-height: 1.4; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sv-item-arrow { color: var(--s-muted); font-size: 22px; font-weight: 800; }
.sv-empty { font-size: 16px; color: var(--s-text-2); }
.sv-more { margin-top: 14px; width: 100%; appearance: none; border: 2px solid var(--s-accent); background: var(--s-accent-soft); color: var(--s-text); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; min-height: 48px; }
.sv-more[hidden] { display: none; }
.sv-guides { display: grid; gap: 12px; }
.sv-guide { background: var(--s-surface); border: 1.5px solid var(--s-line-strong); border-radius: 16px; padding: 16px 20px; }
.sv-guide summary { cursor: pointer; font-size: 18px; font-weight: 800; color: var(--s-text); min-height: 44px; display: flex; align-items: center; }
.sv-guide[open] summary { margin-bottom: 12px; }
.sv-guide p, .sv-guide li { color: var(--s-text-2); line-height: 1.65; font-size: 16px; }
.sv-guide p { margin: 0 0 10px; }
.sv-guide ol, .sv-guide ul { padding-left: 22px; margin: 0 0 10px; }
.sv-guide a { color: var(--s-accent); font-weight: 700; }
.sv-faq-title { font-size: 22px; font-weight: 800; color: var(--s-text); margin: 8px 0 0; }
.sv-faq { display: grid; gap: 10px; }
.sv-faq details { background: var(--s-surface); border: 1.5px solid var(--s-line-strong); border-radius: 16px; padding: 14px 20px; }
.sv-faq details summary { cursor: pointer; font-size: 17px; font-weight: 800; color: var(--s-text); min-height: 44px; display: flex; align-items: center; }
.sv-faq details[open] summary { margin-bottom: 8px; }
.sv-faq details p { color: var(--s-text-2); font-size: 16px; line-height: 1.65; margin: 0; }
.sv-faq details summary > span:first-child { color: var(--s-text); }
@media (max-width: 860px) {
  .sv-grid { grid-template-columns: 1fr; }
  .sv-recent { position: static; }
}
@media (max-width: 520px) {
  .sv-main { font-size: 16px; padding: 20px 14px 40px; }
  .sv-card { padding: 18px; }
  .sv-btn-primary { flex-basis: 100%; }
  .sv-actions .sv-btn:not(.sv-btn-primary) { flex: 1 1 100%; }
}

/* ---- Worked-solution paper: ruled lines, a margin line and handwritten answers. ---- */
:root { --s-paper: #fffdf7; --s-rule: #d9e6f2; --s-margin: #f3a6a6; --s-pen: #1d4ed8; --s-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive; }
html.dark { --s-paper: #17171d; --s-rule: #2a3a52; --s-margin: #7f3b3b; --s-pen: #93c5fd; }
.sv-output .solver-steps { position: relative; background: var(--s-paper); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--s-rule) 31px, var(--s-rule) 32px); border: 1px solid var(--s-line-strong); border-radius: 6px; box-shadow: var(--s-shadow); padding: 32px 24px 16px 56px; max-width: 720px; }
.sv-output .solver-steps::before { content: ""; position: absolute; top: 0; bottom: 0; left: 40px; width: 1px; background: var(--s-margin); }
.sv-output .solver-steps .solver-h { font-family: var(--s-hand); font-size: 30px; font-weight: 700; line-height: 32px; margin: 0 0 0; color: var(--s-pen); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sv-output .solver-step-list { gap: 0; }
.sv-output .solver-step { border: 0; background: none; padding: 0; margin-bottom: 32px; border-radius: 0; }
.sv-output .solver-step-title { font-family: var(--s-hand); font-size: 25px; font-weight: 700; line-height: 32px; margin: 0; color: var(--s-text); }
.sv-output .solver-step-expr { font-family: var(--s-hand); font-size: 30px; font-weight: 600; line-height: 32px; margin: 0; color: var(--s-pen); font-variant-numeric: normal; overflow-wrap: anywhere; }
.sv-output .solver-step-text { font-family: var(--s-hand); font-size: 22px; line-height: 32px; margin: 0; color: var(--s-text-2); }
.sv-output .solver-steps .solver-btn { font-family: var(--s-hand); font-size: 20px; margin: 16px 0 0; }
.sv-output .solver-value { font-family: var(--s-hand); font-size: clamp(3rem, 9vw, 4.25rem); font-weight: 700; line-height: 1.05; color: var(--s-pen); }
.sv-output .solver-answer { background: var(--s-paper); }
@media (max-width: 520px) {
  .sv-output .solver-steps { padding: 24px 14px 12px 52px; }
  .sv-output .solver-step-expr { font-size: 26px; }
}

/* ---- Final answer: value, units and one copy button on a deep gradient panel. ---- */
.sv-output .solver-answer { background: #15803d; border: 0; border-radius: 16px; color: #ffffff; box-shadow: var(--s-shadow); padding: 24px 24px; width: fit-content; min-width: min(100%, 300px); max-width: 100%; box-sizing: border-box; }
.solver-answer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sv-output .solver-answer .solver-value { font-family: inherit; font-size: clamp(2.25rem, 6vw, 3rem); font-weight: 700; line-height: 1.05; color: #ffffff; margin: 0; font-variant-numeric: tabular-nums; }
.solver-copy { appearance: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: #ffffff; color: #0b4d3a; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); transition: transform .15s ease, box-shadow .15s ease; }
.solver-copy:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(0,0,0,.4); }
.solver-copy:focus-visible { outline: 3px solid #bbf7d0; outline-offset: 3px; }
.solver-copy i { font-size: 14px; }
.solver-page-link { display: inline-block; margin-top: 12px; font-size: 16px; font-weight: 700; color: var(--s-text); text-decoration: underline; text-underline-offset: 4px; }
html.dark .sv-output .solver-answer { background: #166534; box-shadow: none; }
html.dark .solver-copy { color: #052e22; }
@media (prefers-reduced-motion: reduce) { .solver-copy { transition: none; } }

/* ---- Question page answer: regular site font, with a modern copy button beside it. ---- */
.qa-card { background: var(--s-surface); border: 1px solid var(--s-line-strong); border-radius: 14px; box-shadow: var(--s-shadow); padding: 14px 18px; }
.qa-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.qa-text { min-width: 0; }
.qa-label { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--s-muted); }
.qa-value { margin: 0; font-size: 22px; font-weight: 600; color: var(--s-text); overflow-wrap: anywhere; }
.qa-copy { appearance: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--s-line-strong); border-radius: 10px; background: var(--s-surface); color: var(--s-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.qa-copy:hover { background: var(--s-step); border-color: var(--s-text-2); }
.qa-copy:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.qa-copy i { font-size: 15px; color: var(--s-muted); }
.qa-status:empty { display: none; }
.qa-status { margin: 6px 0 0; font-size: 13px; color: var(--s-muted); }

/* ---- Navigator button: opens the question page, with a short line of information. ---- */
.solver-nav { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--s-line-strong); border-radius: 14px; background: var(--s-surface); color: var(--s-text); text-decoration: none; box-shadow: var(--s-shadow); transition: border-color .15s, transform .15s; }
.solver-nav:hover { border-color: var(--s-text-2); transform: translateY(-1px); text-decoration: none; }
.solver-nav:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 3px; }
.solver-nav-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--s-step); color: var(--s-text); font-size: 18px; }
.solver-nav-text { display: grid; gap: 2px; min-width: 0; }
.solver-nav-title { font-size: 17px; font-weight: 800; color: var(--s-text); }
.solver-nav-info { font-size: 14px; line-height: 1.45; color: var(--s-muted); }
.solver-nav-arrow { font-size: 22px; font-weight: 700; color: var(--s-text); }
@media (max-width: 420px) { .solver-nav { grid-template-columns: 40px 1fr; } .solver-nav-arrow { display: none; } .solver-nav-icon { width: 40px; height: 40px; } }

/* ---- Question page layout: same design as the solver. ---- */
.sv-q-title { margin: 0; font-size: clamp(1.7rem, 4.5vw, 2.3rem); font-weight: 800; line-height: 1.2; color: var(--s-text); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.sv-q-meta { margin: 10px 0 0; font-size: 15px; color: var(--s-muted); }
.sv-head-block { display: grid; gap: 4px; }
.sv-nav-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .sv-nav-group { grid-template-columns: 1fr; } }

/* ==== Solver and question pages, v5: simple cards, one green for actions, plain text. ==== */
.v5-head { display: flex; align-items: center; gap: 16px; }
.v5-head h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 800; color: var(--s-text); letter-spacing: -0.02em; line-height: 1.15; }
.v5-sub { margin: 4px 0 0; font-size: 16px; color: var(--s-muted); }
.v5-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--s-accent-soft); color: var(--s-accent); font-size: 24px; flex: 0 0 56px; }

.v5-input, .v5-answer, .v5-steps, .v5-side, .v5-tip, .v5-main > .sv-output > .v5-empty { background: var(--s-surface); border: 1px solid var(--s-line-strong); border-radius: 16px; box-shadow: var(--s-shadow); }
.v5-input { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 20px; padding: 20px; }
.v5-form { min-width: 0; }
.v5-label { display: block; margin: 0 0 8px; font-size: 16px; font-weight: 700; color: var(--s-text); }
.v5-form textarea { width: 100%; min-height: 120px; box-sizing: border-box; font: inherit; font-size: 17px; line-height: 1.5; padding: 14px; border: 1.5px solid var(--s-line-strong); border-radius: 12px; resize: vertical; background: var(--s-input); color: var(--s-text); }
.v5-form textarea:focus { outline: 3px solid var(--s-focus); outline-offset: 1px; border-color: var(--s-accent); }
.v5-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.v5-form-foot > span { font-size: 14px; color: var(--s-muted); }
.v5-actions { display: flex; gap: 10px; }
.v5-btn, .v5-btn-ghost, .v5-copy { appearance: none; min-height: 44px; padding: 0 20px; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.v5-btn { border: 0; background: var(--s-accent); color: var(--s-accent-ink); }
.v5-btn:hover { background: var(--s-accent-hover); }
.v5-btn:focus-visible, .v5-btn-ghost:focus-visible, .v5-copy:focus-visible, .v5-chip:focus-visible, .v5-nav:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.v5-btn:disabled { background: var(--s-line); color: var(--s-muted); cursor: not-allowed; }
.v5-btn-ghost { border: 1.5px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-text); }
.v5-btn-ghost:hover { border-color: var(--s-text-2); }
.v5-tip { padding: 18px; background: var(--s-step); box-shadow: none; }
.v5-tip-title { margin: 0 0 4px; font-size: 17px; font-weight: 800; color: var(--s-text); }
.v5-tip-text { margin: 0 0 12px; font-size: 15px; color: var(--s-muted); }
.v5-chips { display: grid; gap: 8px; }
.v5-chip { appearance: none; display: block; width: 100%; text-align: left; border: 1px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.4; cursor: pointer; min-height: 44px; box-sizing: border-box; }
.v5-chip:hover { border-color: var(--s-accent); }

.v5-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.v5-main { min-width: 0; }
.v5-main > .sv-output { display: grid; gap: 16px; }
.v5-main > .sv-output > .v5-empty { margin: 0; padding: 28px 22px; font-size: 16px; color: var(--s-muted); box-shadow: none; border-style: dashed; }
.v5-answer { padding: 20px 22px; background: var(--s-answer-bg); border-color: var(--s-answer-line); box-shadow: none; }
.v5-answer-top { display: flex; align-items: center; gap: 10px; }
.v5-check { width: 28px; height: 28px; border-radius: 50%; background: var(--s-accent); color: var(--s-accent-ink); display: grid; place-items: center; font-size: 13px; }
.v5-answer-label { font-size: 16px; font-weight: 800; color: var(--s-answer-kicker); }
.v5-answer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.v5-value { margin: 0; font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 800; line-height: 1.1; color: var(--s-answer-value); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v5-copy { border: 1.5px solid var(--s-accent); background: var(--s-surface); color: var(--s-accent); }
.v5-copy:hover { background: var(--s-accent-soft); }
.v5-copy i { font-size: 15px; }
.v5-steps { padding: 20px 22px; }
.v5-h2 { margin: 0 0 14px; font-size: 19px; font-weight: 800; color: var(--s-text); }
.v5-step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.v5-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.v5-step-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--s-accent); color: var(--s-accent-ink); font-size: 15px; font-weight: 800; }
.v5-step-body { min-width: 0; }
.v5-step-title { margin: 4px 0 6px; font-size: 17px; font-weight: 700; color: var(--s-text); }
.v5-expr { display: inline-block; margin: 0 0 8px; padding: 6px 12px; border-radius: 8px; background: var(--s-step); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; color: var(--s-text); overflow-wrap: anywhere; }
.v5-step-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--s-muted); }
.v5-toggle { margin-top: 14px; }
.v5-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border: 1.5px solid var(--s-line-strong); border-radius: 14px; background: var(--s-surface); color: var(--s-text); font-size: 16px; font-weight: 700; text-decoration: none; }
.v5-nav:hover { border-color: var(--s-accent); text-decoration: none; }
.v5-nav-arrow { color: var(--s-accent); font-size: 20px; }

.v5-side { padding: 18px; min-width: 0; }
.v5-side-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.v5-side-head .v5-h2 { margin: 0; }
.v5-side .sv-tabs { display: flex; gap: 4px; }
.v5-side .sv-tab { font-size: 13px; padding: 6px 10px; min-height: 36px; }
.v5-side .sv-item { grid-template-columns: 36px minmax(0, 1fr) 14px; border-radius: 12px; padding: 10px 12px; }
.v5-side .sv-item-icon { width: 36px; height: 36px; background: var(--s-accent-soft); color: var(--s-accent); font-size: 16px; }
.v5-side .sv-item-text { font-size: 15px; font-weight: 600; color: var(--s-text); }
.v5-side .sv-item-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--s-muted); margin-top: 2px; }
.v5-side .sv-item-arrow { color: var(--s-muted); }
.v5-side .sv-item-body { display: grid; gap: 2px; min-width: 0; }
.v5-side .sv-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--s-step); color: var(--s-text-2); font-size: 12px; font-weight: 700; }
.v5-side .sv-item:hover { border-color: var(--s-accent); background: var(--s-surface); }
.v5-side .sv-more { font-size: 15px; background: var(--s-surface); color: var(--s-accent); border: 1.5px solid var(--s-line-strong); }
.v5-side .sv-note { margin-top: 10px; }

.sv-guides, .sv-faq { margin-top: 4px; }

@media (max-width: 900px) {
  .v5-grid { grid-template-columns: 1fr; }
  .v5-input { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .v5-icon { width: 46px; height: 46px; flex-basis: 46px; font-size: 20px; }
  .v5-answer-row { flex-direction: column; align-items: flex-start; }
  .v5-copy { width: 100%; justify-content: center; }
  .v5-btn { flex: 1 1 auto; justify-content: center; }
}
.v5-chip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Mockup colours: green check circles, step numbers, solve button and recent icons. */
.v5-check, .v5-step-num, .v5-side .sv-item-icon { background: #15803d; color: #ffffff; }
.v5-btn { background: #15803d; color: #ffffff; }
.v5-btn:hover { background: #166534; }
.v5-side .sv-item-icon { background: #dcfce7; color: #15803d; }
html.dark .v5-check, html.dark .v5-step-num, html.dark .v5-btn { background: #22c55e; color: #052e16; }
html.dark .v5-side .sv-item-icon { background: #14291c; color: #86efac; }

/* ==== Mockup 214 solver: exact colours and items. ==== */
.m214 { --m-green: #16a34a; --m-green-ink: #15803d; --m-dark: #14532d; --m-mint: #f0fdf4; --m-mint-2: #dcfce7; --m-mint-line: #bbf7d0; --m-ink: #111827; --m-muted: #6b7280; --m-line: #e5e7eb; --m-card: #ffffff; --m-page: #ffffff; max-width: 1200px; padding: 28px 16px 48px; gap: 20px; font-size: 16px; color: var(--m-ink); }
html.dark .m214 { --m-green: #22c55e; --m-green-ink: #4ade80; --m-dark: #bbf7d0; --m-mint: #0f2a1b; --m-mint-2: #14361f; --m-mint-line: #1f5532; --m-ink: #f3f4f6; --m-muted: #9ca3af; --m-line: #2a2f3a; --m-card: #111418; }

.m214 .m-head { display: flex; align-items: center; gap: 16px; }
.m214 .m-head h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 800; color: var(--m-ink); letter-spacing: -0.02em; }
.m214 .m-sub { margin: 4px 0 0; color: var(--m-muted); font-size: 16px; max-width: 70ch; }
.m214 .m-tile { width: 64px; height: 64px; border-radius: 18px; background: var(--m-green); color: #ffffff; display: grid; place-items: center; font-size: 26px; flex: 0 0 64px; box-shadow: 0 6px 16px -8px rgba(22,163,74,.6); }

.m214 .m-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px; align-items: stretch; }
.m214 .m-input, .m214 .m-tip, .m214 .m-right, .m214 .m-notebook, .m214 .m-note-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 16px; }
.m214 .m-input { padding: 16px 18px; min-width: 0; }
.m214 .m-form { display: flex; align-items: center; gap: 12px; border: 1px solid var(--m-line); border-radius: 12px; padding: 6px 6px 6px 14px; position: relative; }
.m214 .m-input-icon { color: var(--m-muted); font-size: 16px; }
.m214 .m-form textarea { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 16px; color: var(--m-ink); padding: 10px 0; min-height: 44px; max-height: 160px; }
.m214 .m-form textarea::placeholder { color: var(--m-muted); opacity: 1; }
.m214 .m-form:focus-within { border-color: var(--m-green); box-shadow: 0 0 0 3px var(--m-mint-2); }
.m214 .m-solve { appearance: none; border: 0; border-radius: 10px; background: var(--m-green); color: #ffffff; font: inherit; font-weight: 700; font-size: 16px; min-height: 48px; padding: 0 22px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.m214 .m-solve:hover { filter: brightness(.95); }
.m214 .m-solve:disabled { background: var(--m-line); color: var(--m-muted); cursor: not-allowed; }
.m214 .m-input-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; color: var(--m-muted); }
.m214 .m-link { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; color: var(--m-green-ink); font-weight: 700; cursor: pointer; text-decoration: none; }
.m214 .m-link:hover { text-decoration: underline; }

.m214 .m-tip { padding: 16px 18px; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; background: var(--m-mint); border-color: var(--m-mint-line); }
.m214 .m-bulb { width: 40px; height: 40px; border-radius: 12px; background: var(--m-card); color: var(--m-green-ink); display: grid; place-items: center; font-size: 18px; }
.m214 .m-tip-title { margin: 0 0 2px; font-weight: 800; color: var(--m-ink); }
.m214 .m-tip-text { margin: 0; font-size: 14px; color: var(--m-muted); line-height: 1.5; }
.m214 .m-tip-text a { color: var(--m-green-ink); font-weight: 700; }
.m214 .m-examples { grid-column: 1 / -1; }
.m214 .m-examples summary { cursor: pointer; font-weight: 700; color: var(--m-green-ink); font-size: 14px; }
.m214 .m-chips { display: grid; gap: 6px; margin-top: 8px; }
.m214 .m-chip { appearance: none; text-align: left; border: 1px solid var(--m-mint-line); background: var(--m-card); color: var(--m-ink); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; cursor: pointer; line-height: 1.4; }
.m214 .m-chip:hover { border-color: var(--m-green); }

.m214 .m-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.m214 .m-left { min-width: 0; }
.m214 .m-notebook { position: relative; padding: 22px 22px 22px 40px; display: grid; gap: 18px; }
.m214 .m-notebook::before { content: ""; position: absolute; left: 10px; top: 14px; bottom: 14px; width: 12px; background: radial-gradient(circle, var(--m-line) 0 4px, transparent 5px) 0 0 / 12px 26px repeat-y; }
.m214 .m-empty { margin: 0; padding: 28px 8px; color: var(--m-muted); }
.m214 .m-answer { display: grid; gap: 10px; }
.m214 .m-answer-head { display: flex; align-items: center; gap: 8px; }
.m214 .m-check { width: 22px; height: 22px; border-radius: 50%; background: var(--m-green); color: #ffffff; display: grid; place-items: center; font-size: 11px; }
.m214 .m-answer-label { font-weight: 800; color: var(--m-green-ink); font-size: 16px; }
.m214 .m-value-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--m-mint); border: 1px solid var(--m-mint-line); border-radius: 14px; padding: 14px 18px; }
.m214 .m-value { margin: 0; font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 800; color: var(--m-dark); font-variant-numeric: tabular-nums; line-height: 1.1; }
.m214 .m-copy { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--m-mint-line); background: var(--m-card); color: var(--m-dark); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.m214 .m-copy:hover { border-color: var(--m-green); }
.m214 .m-steps { display: grid; gap: 14px; }
.m214 .m-h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--m-ink); }
.m214 .m-step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.m214 .m-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.m214 .m-step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--m-green); color: #ffffff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.m214 .m-step-title { margin: 3px 0 4px; font-weight: 800; color: var(--m-ink); font-size: 16px; }
.m214 .m-step-text { margin: 0 0 8px; color: var(--m-muted); font-size: 15px; line-height: 1.5; }
.m214 .m-expr { display: inline-block; margin: 0; padding: 6px 12px; border-radius: 8px; background: var(--m-mint-2); color: var(--m-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.m214 .m-toggle { justify-self: start; }
.m214 .m-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--m-line); padding-top: 14px; }
.m214 .m-foot-meta { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--m-muted); flex-wrap: wrap; }
.m214 .m-foot-tag { padding: 3px 10px; border-radius: 999px; background: var(--m-mint); color: var(--m-green-ink); font-weight: 700; font-size: 13px; }
.m214 .m-foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.m214 .m-btn-quiet { appearance: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--m-mint-line); background: var(--m-card); color: var(--m-dark); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.m214 .m-btn-quiet:hover { border-color: var(--m-green); text-decoration: none; }

.m214 .m-right { padding: 16px 18px; min-width: 0; }
.m214 .m-right-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.m214 .m-right-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--m-ink); }
.m214 .m-view { font-size: 14px; font-weight: 700; color: var(--m-green-ink); text-decoration: none; border: 1px solid var(--m-mint-line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.m214 .m-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m214 .m-list .sv-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) 14px; gap: 12px; align-items: center; border: 1px solid var(--m-line); border-radius: 12px; padding: 12px; background: var(--m-card); color: var(--m-ink); text-decoration: none; }
.m214 .m-list .sv-item:hover { border-color: var(--m-green); }
.m214 .sv-item-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; }
.m214 .sv-tile-green { background: #dcfce7; color: #15803d; }
.m214 .sv-tile-orange { background: #ffedd5; color: #c2410c; }
.m214 .sv-tile-purple { background: #ede9fe; color: #6d28d9; }
.m214 .sv-tile-teal { background: #ccfbf1; color: #0f766e; }
.m214 .sv-tile-pink { background: #fce7f3; color: #be185d; }
.m214 .sv-tile-blue { background: #dbeafe; color: #1d4ed8; }
.m214 .sv-item-body { display: grid; gap: 4px; min-width: 0; }
.m214 .sv-item-text { font-size: 15px; font-weight: 700; color: var(--m-ink); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m214 .sv-item-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--m-muted); }
.m214 .sv-tag { padding: 1px 8px; border-radius: 999px; background: var(--m-line); color: var(--m-ink); font-size: 12px; font-weight: 700; }
.m214 .sv-item-arrow { color: var(--m-muted); font-size: 20px; }
.m214 .m-more { margin-top: 12px; width: 100%; appearance: none; min-height: 44px; border: 1px solid var(--m-mint-line); border-radius: 12px; background: var(--m-mint); color: var(--m-dark); font: inherit; font-weight: 700; cursor: pointer; }
.m214 .m-note { font-size: 14px; color: var(--m-muted); margin: 14px 0 0; line-height: 1.55; }
.m214 .m-note a { color: var(--m-green-ink); font-weight: 700; }
.m214 .solver-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .m214 .m-top, .m214 .m-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .m214 .m-head { align-items: flex-start; } .m214 .m-tile { width: 52px; height: 52px; flex-basis: 52px; font-size: 22px; } .m214 .m-solve { width: 100%; justify-content: center; } .m214 .m-form { flex-wrap: wrap; } }

/* ==== Mockup 213 question page: uses the mockup 214 colours. ==== */
.m213 { max-width: 1200px; }
.m213 .m213-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--m-muted); }
.m213 .m213-crumbs a { color: var(--m-muted); text-decoration: none; }
.m213 .m213-crumbs a:hover { color: var(--m-green-ink); text-decoration: underline; }
.m213 .m213-crumbs [aria-current] { color: var(--m-ink); font-weight: 600; }
.m213 .m213-title { display: grid; gap: 10px; }
.m213 .m213-h1 { margin: 0; font-size: clamp(1.5rem, 3.6vw, 2rem); font-weight: 800; line-height: 1.25; color: var(--m-ink); overflow-wrap: anywhere; }
.m213 .m213-meta { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--m-muted); font-size: 15px; }
.m213 .m213-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.m213 .m213-col { display: grid; gap: 16px; min-width: 0; }
.m213 .m213-side { display: grid; gap: 16px; min-width: 0; }
.m213 .m213-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 14px; }
.m213 .m213-h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--m-ink); }
.m213 .m213-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--m-mint-2); color: var(--m-green-ink); display: grid; place-items: center; font-size: 17px; flex: 0 0 40px; }
.m213 .m213-answer { padding: 18px 20px; background: var(--m-card); border-color: var(--m-line); }
.m213 .m213-answer .m-answer-head { gap: 12px; }
.m213 .m213-answer .m-value-box { background: var(--m-mint); }
.m213 .m213-steps .m-step-title { color: var(--m-green-ink); font-size: 17px; }
.m213 .m213-steps .m-expr { background: #fef9c3; color: #713f12; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
html.dark .m213 .m213-steps .m-expr { background: #3a3210; color: #fde68a; }
.m213 .m213-steps .m-step-num { background: var(--m-green); }
.m213 .m213-rel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m213 .m213-rel-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 12px; align-items: center; border: 1px solid var(--m-line); border-radius: 12px; padding: 10px 12px; color: var(--m-ink); text-decoration: none; font-weight: 700; }
.m213 .m213-rel-row:hover { border-color: var(--m-green); }
.m213 .m213-rel-label { font-size: 15px; }
.m213 .m213-arrow { color: var(--m-muted); }
.m213 .m213-try-head { display: flex; align-items: center; gap: 12px; }
.m213 .m213-text { margin: 0; color: var(--m-muted); font-size: 15px; line-height: 1.5; }
.m213 .m213-btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--m-green); background: var(--m-card); color: var(--m-green-ink); font-weight: 800; text-decoration: none; font-size: 16px; }
.m213 .m213-btn:hover { background: var(--m-mint); }
.m213 .m213-more-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.m213 .m213-view { color: var(--m-green-ink); font-weight: 800; text-decoration: none; font-size: 15px; }
@media (max-width: 900px) { .m213 .m213-grid { grid-template-columns: 1fr; } }
.m213 .m213-more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.m213 .m213-more-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 84px; border: 1px solid var(--m-line); border-radius: 12px; padding: 14px; color: var(--m-ink); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.4; }
.m213 .m213-more-card:hover { border-color: var(--m-green); }
.m213 .m213-more-text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
@media (max-width: 760px) { .m213 .m213-more-list { grid-template-columns: 1fr; } }

/* ==== Solver v7: no side tip box; visible cards; answer fills a reserved card. ==== */
.m214 .m-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 16px; }
.m214 .m-examples-row { margin-top: 14px; }
.m214 .m-label { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--m-muted); text-transform: uppercase; letter-spacing: .04em; }
.m214 .m-examples-row .m-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
@media (max-width: 900px) { .m214 .m-examples-row .m-chips { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .m214 .m-examples-row .m-chips { grid-template-columns: 1fr; } }
.m214 .m-notebook { min-height: 320px; align-content: start; }
.m214 .m-notebook .m-empty { display: grid; place-items: center; min-height: 260px; text-align: center; border: 1.5px dashed var(--m-line); border-radius: 12px; margin: 0; padding: 24px; }
.m214 .m-body { display: grid; gap: 16px; }
.m214 .m-body-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 10px; }
.m214 .m-body-card p, .m214 .m-body-card li { margin: 0; color: var(--m-muted); line-height: 1.6; font-size: 16px; }
.m214 .m-body-card ol, .m214 .m-body-card ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.m214 .m-body-card a { color: var(--m-green-ink); font-weight: 700; }
.m214 .m-body-card ol { list-style: decimal; }
.m214 .m-body-card ul { list-style: disc; }

/* ==== Solver v8: full width, recent list under the input, guides as plain text. ==== */
.m214 .m-recent { padding: 18px 20px; display: grid; gap: 12px; }
.m214 .m-recent .m-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m214 .m-recent .m-note { margin: 0; }
.m214 .m-answer-zone { min-width: 0; }
.m214 .m-text { background: none; border: 0; border-radius: 0; padding: 0; display: grid; gap: 8px; }
.m214 .m-text .m-h2 { margin-top: 12px; }
.m214 .m-body { display: grid; gap: 4px; }
@media (max-width: 720px) { .m214 .m-recent .m-list { grid-template-columns: 1fr; } }

/* ==== Solver v9: main column plus a Recently Solved sidebar. ==== */
.m214 .m-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.m214 .m-main { display: grid; gap: 20px; min-width: 0; }
.m214 .m-sidebar { position: sticky; top: 16px; padding: 18px; display: grid; gap: 12px; max-height: calc(100vh - 32px); overflow: auto; }
.m214 .m-sidebar .m-list { grid-template-columns: 1fr; }
.m214 .m-sidebar .m-right-head h2 { font-size: 17px; }
@media (max-width: 900px) { .m214 .m-layout { grid-template-columns: 1fr; } .m214 .m-sidebar { position: static; max-height: none; overflow: visible; } }

/* ==== The answer card appears only when there is an answer; it pushes the guides down. ==== */
.m214 .m-answer-zone:has(> #solverOutput:empty) { display: none; }
.m214 #solverOutput:empty { display: none; }

/* ==== Shimmer while the answer is being worked out. ==== */
.m214 .m-skeleton { display: grid; gap: 14px; padding: 22px; background: var(--m-card); border: 1px solid var(--m-line); border-radius: 16px; }
.m214 .m-sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--m-line) 0%, var(--m-mint-2) 50%, var(--m-line) 100%); background-size: 200% 100%; animation: m-shimmer 1.4s ease-in-out infinite; }
.m214 .m-sk-kicker { width: 120px; height: 14px; }
.m214 .m-sk-value { width: min(260px, 70%); height: 44px; border-radius: 12px; }
.m214 .m-sk-lines { display: grid; gap: 10px; }
.m214 .m-sk-line { width: 100%; height: 14px; }
.m214 .m-sk-line.short { width: 60%; }
@keyframes m-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .m214 .m-sk { animation: none; } }

/* ==== Answer paper: cream sheet with ruled lines and a margin line (replaces the spiral dots). ==== */
.m214 .m-notebook { background: #fffbeb; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #e3ebf5 31px, #e3ebf5 32px); border-color: #e5e7eb; padding: 22px 22px 22px 56px; }
.m214 .m-notebook::before { content: ""; position: absolute; left: 44px; top: 0; bottom: 0; width: 1px; background: #f3a6a6; background-image: none; }
html.dark .m214 .m-notebook { background-color: #17171d; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #2a3a52 31px, #2a3a52 32px); }
html.dark .m214 .m-notebook::before { background: #7f3b3b; }
.m214 .m-example-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.m214 .m-chip-one { flex: 1 1 320px; width: auto; }
.m214 .m-example-line .m-link { white-space: nowrap; }
.m214 .m-icon-btn { appearance: none; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--m-mint-line); background: var(--m-card); color: var(--m-green-ink); display: inline-grid; place-items: center; font-size: 16px; cursor: pointer; }
.m214 .m-icon-btn:hover { border-color: var(--m-green); background: var(--m-mint); }
.m214 .m-icon-btn:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.m214 .m-form textarea { min-height: 84px; max-height: 360px; overflow-y: auto; }
.m214 .m-clear { appearance: none; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--m-muted); font-size: 16px; cursor: pointer; display: inline-grid; place-items: center; }
.m214 .m-clear:hover { color: var(--m-ink); background: var(--m-line); }
.m214 .m-clear:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
/* Solve sits at the top right of the question box; Clear sits in the bottom row. */
.m214 .m-form { align-items: flex-start; }
.m214 .m-form .m-solve { margin-top: 6px; }
.m214 .m-input-foot .m-clear { width: 36px; height: 36px; }
.m214 .m-solve.m-solve-icon { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; font-size: 18px; }
/* Solve at the top, Clear directly below it, both inside the question box. */
.m214 .m-actions { display: grid; gap: 8px; justify-items: center; flex: 0 0 auto; align-self: flex-start; margin-top: 2px; }
.m214 .m-input-foot .m-clear { display: none; }
.m214 .m-actions .m-clear { width: 44px; height: 36px; }

/* ==== Solver guide: heading hierarchy, plain text, no boxes. ==== */
.m214 .m-guide { display: grid; gap: 10px; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--m-line); }
.m214 .m-guide-title { margin: 0 0 6px; font-size: 24px; font-weight: 800; color: var(--m-ink); letter-spacing: -0.01em; }
.m214 .m-guide .m-h3 { margin: 14px 0 2px; font-size: 18px; font-weight: 800; color: var(--m-ink); }
.m214 .m-guide p, .m214 .m-guide li { margin: 0; color: var(--m-muted); line-height: 1.65; font-size: 16px; }
.m214 .m-guide ul { margin: 4px 0 0; padding-left: 22px; list-style: disc; display: grid; gap: 4px; }
.m214 .m-guide strong { color: var(--m-ink); }
.m214 .m-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--m-muted); }
.m214 .m-crumbs a { color: var(--m-muted); text-decoration: none; }
.m214 .m-crumbs a:hover { color: var(--m-green-ink); text-decoration: underline; }
.m214 .m-crumbs [aria-current] { color: var(--m-ink); font-weight: 600; }
.m214 a.m-more { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--m-dark); }

/* ==== Recently solved questions page: same look as the solver. ==== */
.m214 .m-feed-card { padding: 18px 20px; display: grid; gap: 12px; }
.m214 .m-feed-card .m-list { grid-template-columns: 1fr; }
.m214 .sv-item-answer { font-size: 18px; font-weight: 800; color: var(--m-dark); }
.m214 .m-btn-primary { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; background: var(--m-green); color: #ffffff; text-decoration: none; font-weight: 700; }
.m214 .m-btn-primary:hover { filter: brightness(.95); }
/* Question list: plain rectangular cards, question text only. */
.m214 .m-feed-card .feed-card { display: block; border: 1px solid var(--m-line); border-radius: 16px; background: var(--m-card); padding: 18px 20px; color: var(--m-ink); text-decoration: none; box-shadow: var(--s-shadow); }
.m214 .m-feed-card .feed-card:hover { border-color: var(--m-green); }
.m214 .m-feed-card .feed-card-text { font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--m-ink); }
/* Question list: each question on one line, with an ellipsis when it is longer. */
.m214 .m-feed-card .feed-card-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Question list: the one-line text must not widen the column, so the sidebar stays beside it. */
.m214 .m-feed-card .m-list { grid-template-columns: minmax(0, 1fr); }
.m214 .m-feed-card .m-list > li { min-width: 0; }
.m214 .m-feed-card .feed-card { min-width: 0; overflow: hidden; }

/* ==== Question page: smaller title and breadcrumbs, sidebar clearly separate. ==== */
.m214 .m-crumbs ol { font-size: 13px; }
.m214 .m-crumbs { margin-bottom: 4px; }
.m214 .m-layout:has(.m-sidebar) { gap: 36px; }
.m214 .m-sidebar { box-shadow: 0 1px 2px rgba(15, 23, 42, .06); margin-left: 4px; }
.m214 .m-side-block { display: grid; gap: 8px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--m-line); }
.m214 .m-side-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m214 .m-side-block a { color: var(--m-green-ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.m214 .m-side-block a:hover { text-decoration: underline; }

/* Question page matches the solver: same title size, same sidebar heading size. */
.m214 .m-right-head h2, .m214 .m-side-block .m-h2 { font-size: 18px; font-weight: 800; margin: 0; color: var(--m-ink); }

/* Question page title: smaller, and kept inside the content width. */
.m214.m-qpage .m-head { min-width: 0; }
.m214.m-qpage .m-head > div { min-width: 0; flex: 1 1 auto; }
.m214.m-qpage .m-head h1 { font-size: clamp(1.1rem, 2.2vw, 1.4rem); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; max-width: 100%; }
.m214.m-qpage .m-sub { font-size: 14px; }
/* Question page: the title and header stay inside the page width and wrap within it. */
.m214.m-qpage { max-width: 1200px; width: 100%; box-sizing: border-box; min-width: 0; overflow-x: hidden; }
.m214.m-qpage .m-head { max-width: 100%; box-sizing: border-box; }
.m214.m-qpage .m-head h1 { max-width: 100%; font-size: clamp(1.05rem, 2vw, 1.3rem); overflow-wrap: anywhere; word-break: break-word; }
/* Question page: the title header is as wide as the answer column, not the whole page. */
.m214.m-qpage .m-head { max-width: calc(100% - 376px); }
@media (max-width: 900px) { .m214.m-qpage .m-head { max-width: 100%; } }
/* Removed from the math pages: the Show more button and the Related calculators block. */
#recentMore, .m214 .m-more, .m214 a.m-more, .m214 .m-side-block { display: none !important; }

/* Solver card polish: a little more room and a soft lift, a tinted input that lights up when you
   type, a neutral example row, and a quieter character count. Focus uses a calm blue, and the
   example controls stay neutral so green is kept for the answer. */
.m214 { --m-soft: #f8fafc; --m-edge: #94a3b8; }
html.dark .m214 { --m-soft: #1b1b21; --m-edge: #5b6577; }
.m214 .m-input { padding: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04); }
html.dark .m214 .m-input { box-shadow: none; }
.m214 .m-form { background: var(--m-soft); border-radius: 14px; padding: 8px 8px 8px 16px; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.m214 .m-form:focus-within { background: var(--m-card); border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); }
.m214 .m-input-icon { margin-top: 14px; font-size: 15px; }
.m214 .m-form textarea { line-height: 1.5; }
.m214 .m-input-foot { justify-content: flex-end; margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.m214 .m-examples-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--m-line); }
.m214 .m-label { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.m214 .m-chip-one { border-color: var(--m-line); background: var(--m-soft); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.5; transition: border-color .15s ease, background-color .15s ease; }
.m214 .m-chip-one:hover { border-color: var(--m-edge); background: var(--m-card); }
.m214 .m-chip-one:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.m214 .m-icon-btn { border-color: var(--m-line); background: var(--m-card); color: var(--m-muted); transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.m214 .m-icon-btn:hover { border-color: var(--m-edge); background: var(--m-soft); color: var(--m-ink); }
@media (max-width: 640px) { .m214 .m-input { padding: 16px; } .m214 .m-example-line { flex-wrap: nowrap; align-items: flex-start; gap: 10px; } .m214 .m-chip-one { flex: 1 1 0; min-width: 0; } }
