/* ==========================================================================
   classdoodle-paper.css -- "paper-type" visual system for ClassDoodle
   --------------------------------------------------------------------------
   Loaded after classdoodle.css + classdoodle-extensions.css (and before
   classdoodle-diagrams.css / classdoodle-focus.css, which may refine it).
   Pure CSS: every texture is a gradient, no images.

   Goal: studying should feel like working in a real exercise book / exam pad
   while staying calm and readable for long focus sessions.

   UTILITY CLASSES (safe for any template to adopt)
   ------------------------------------------------
   .paper-sheet   Off-white fibre sheet with a red exercise-book margin line.
                  Content is pushed right of the margin automatically.
   .ruled         Light-blue ruled writing lines. Works on <textarea> and on
                  any block (lines scroll with content: background-attachment
                  local). Line pitch = --rule (default 1.75rem). Text placed
                  inside must use line-height: var(--rule) to sit on lines.
   .graph-paper   mm-style grid: fine 10px + bold 50px lines. Put it on any
                  block or <svg>.
   .paper-figure  Wrapper <figure> for a diagram: "pasted-in figure" frame.
                  A <figcaption> gets an automatic "Figure n:" prefix
                  (counter resets per .exam-shell / .paper-document).
   .ink-note      Handwritten (Kalam) blue-ink annotation, e.g. a margin note.
   .teacher-mark  Handwritten red-pen mark, e.g. a tick or "(2)". Red is
                  reserved for teacher/marking feedback only.
   .stamp         Small rotated red rubber-stamp label ("MEMO", "MARKED").

   TOKENS (override on any ancestor)
   ---------------------------------
   --sheet, --sheet-edge, --rule, --rule-blue, --margin-red, --margin-x,
   --ink-blue, --ink-dot, --pencil, --teacher-red, --grid-fine, --grid-bold

   RULES OF USE
   ------------
   * Kalam (handwriting) is ONLY for annotation-style elements: kickers on
     paper, question meta / mark badges, memo headings, notes. Never for body
     text, question prompts or learner answers.
   * Blue ink = learner/diagram drawing. Pencil grey = axes/construction.
     Red = teacher marking only.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --sheet: #fffdf8;
  --sheet-edge: #e6e0d1;
  --desk: #f1eee5;
  --rule: 1.75rem;
  --rule-blue: rgba(86, 140, 200, .34);
  --margin-red: rgba(214, 64, 64, .5);
  --margin-x: 2.75rem;
  --ink-blue: #1d4ed8;
  --ink-dot: #1e3a8a;
  --pencil: #4b5563;
  --pencil-soft: #9ca3af;
  --teacher-red: #c2321f;
  --grid-fine: rgba(43, 118, 140, .10);
  --grid-bold: rgba(43, 118, 140, .24);
  --paper-shadow: 0 1px 2px rgba(23, 59, 54, .05), 0 12px 28px -18px rgba(23, 59, 54, .35);
  --hand: Kalam, "Segoe Print", "Comic Neue", cursive;
  --clean: Inter, "Segoe UI", Arial, sans-serif;

  /* Paper fibre: two faint cross-hatched fibre layers + soft light falloff. */
  --paper-fibre:
    repeating-linear-gradient(112deg, rgba(120, 98, 60, .022) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(23deg, rgba(120, 98, 60, .018) 0 1px, transparent 1px 9px),
    radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 70%);
}


/* --------------------------------------------------------------------------
   2. Calm-focus page defaults (only on study surfaces)
   -------------------------------------------------------------------------- */
body { counter-reset: cd-figure; }
.exam-shell { background: var(--desk); line-height: 1.65; counter-reset: cd-figure; }
main .paper-document { counter-reset: cd-figure; line-height: 1.65; }

/* Comfortable reading measure for prose. */
.lesson-summary,
.lesson-explanation p,
.question-card > p,
.worked-example p,
.memo > div > p,
.memo-sheet > p,
.exam-question > p,
.lesson-prereq { max-width: 70ch; }

.question-card h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.55;
  max-width: 42em;
  margin: 1.4rem 0 1.6rem;
  overflow-wrap: break-word;
}
.lesson-explanation p { line-height: 1.7; }
.question-card, .exam-question, .buddy { overflow-wrap: break-word; }

/* Quiet down decorative shadows on study surfaces. */
main .paper-document { box-shadow: var(--paper-shadow); }

/* Strong, visible focus inside paper areas (blue ink ring + soft halo). */
.exam-shell :focus-visible,
.workspace-main :focus-visible {
  outline: 3px solid var(--ink-blue);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(29, 78, 216, .14);
}
.exam-shell textarea:focus-visible,
.exam-shell input:focus-visible { outline-offset: 2px; }


/* --------------------------------------------------------------------------
   3. Paper sheets: question / lesson cards, live-test questions, workspace
   -------------------------------------------------------------------------- */
.paper-sheet,
.question-card,
main .exam-question {
  position: relative;
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--margin-red), var(--margin-red)),
    var(--paper-fibre);
  background-size: 1.5px 100%, auto, auto, auto;
  background-position: var(--margin-x) 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
  border: 1px solid var(--sheet-edge);
  border-radius: 3px;
  box-shadow: var(--paper-shadow);
  padding-left: calc(var(--margin-x) + 1.25rem);
}

/* Workspace document as a whole is one big sheet (no margin line; the
   individual questions carry the margin). */
main .paper-document {
  background-color: var(--sheet);
  background-image: var(--paper-fibre);
}

/* Lesson notes: a slightly longer, calmer page. */
.lesson-card { padding-top: 2.4rem; padding-bottom: 2.4rem; }
.lesson-card h3 {
  font: 700 1.2rem/1.3 Georgia, serif;
  margin: 2.2rem 0 .8rem;
}

/* Worked examples look like a boxed section in the exercise book. */
.worked-example {
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--sheet-edge);
  border-left: 3px solid var(--rule-blue);
  border-radius: 2px;
}
.worked-example ol { line-height: 1.75; }

.lesson-prereq {
  background: rgba(201, 243, 223, .55);
  border-left: 3px solid #2b7668;
}

/* Live-test questions stack like separate sheets. */
.live-question { margin-bottom: 1.5rem; }

/* Workspace exam question: the question number sits on the margin. */
.exam-question .question-number { border-bottom-color: rgba(23, 59, 54, .55); }


/* --------------------------------------------------------------------------
   4. Ruled writing areas (textarea#attempt, #buddyMessage, live answers)
   -------------------------------------------------------------------------- */
.ruled,
.question-card textarea,
.buddy textarea,
textarea.ruled {
  --pad-top: .55rem;
  --ruled-margin: 2.25rem;
  display: block;
  width: 100%;
  font: 400 1rem/var(--rule) var(--clean);
  color: var(--ink);
  padding: var(--pad-top) .9rem var(--pad-top) calc(var(--ruled-margin) + .7rem);
  border: 1px solid var(--sheet-edge);
  border-radius: 2px;
  background-color: #fff;
  background-image:
    linear-gradient(var(--margin-red), var(--margin-red)),
    linear-gradient(to bottom, transparent calc(var(--rule) - 1px), var(--rule-blue) calc(var(--rule) - 1px));
  background-size: 1.5px 100%, 100% var(--rule);
  background-repeat: no-repeat, repeat;
  /* Shift ruling up slightly so text sits ON the line, as in a book. */
  background-position: var(--ruled-margin) 0, 0 calc(var(--pad-top) - 4px);
  background-attachment: local, local;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(23, 59, 54, .04);
}
.question-card textarea { min-height: calc(var(--rule) * 7 + 1.1rem); }
.buddy textarea { --ruled-margin: 1.6rem; min-height: calc(var(--rule) * 4 + 1.1rem); }

.question-card textarea::placeholder,
.buddy textarea::placeholder { color: #8a948f; opacity: 1; }

.question-card label[for="attempt"],
.question-card > label {
  font: 700 .95rem/1.4 var(--clean);
  color: var(--pencil);
}

/* Workspace printed answer space: blue ruled lines with a margin. */
main .answer-lines {
  gap: 0;
  margin: 1.6rem 0;
  padding-left: 0;
  background-image: linear-gradient(var(--margin-red), var(--margin-red));
  background-size: 1.5px 100%;
  background-repeat: no-repeat;
  background-position: 1.25rem 0;
}
main .answer-lines i { height: var(--rule); background: none; border-bottom: 1px solid var(--rule-blue); }

/* "Expected answer format" card = a ruled strip of the exercise book. */
.answer-layout-card {
  background-color: #fff;
  background-image: linear-gradient(to bottom, transparent calc(var(--rule) - 1px), var(--rule-blue) calc(var(--rule) - 1px));
  background-size: 100% var(--rule);
  border: 1px dashed var(--pencil-soft);
  line-height: var(--rule);
  padding: .4rem 1rem .6rem;
}
.answer-layout-card strong { font: 700 1rem/var(--rule) var(--hand); letter-spacing: 0; text-transform: none; color: var(--pencil); margin: 0; }


/* --------------------------------------------------------------------------
   5. Handwritten accents (Kalam) -- annotation-style elements only
   -------------------------------------------------------------------------- */
.ink-note {
  font: 400 1.05rem/1.4 var(--hand);
  color: var(--ink-blue);
}
.teacher-mark {
  font: 700 1.05rem/1.2 var(--hand);
  color: var(--teacher-red);
}
.stamp {
  display: inline-block;
  font: 700 .85rem/1 var(--hand);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teacher-red);
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: .25rem .5rem .15rem;
  transform: rotate(-4deg);
  opacity: .85;
}

/* Kicker on paper / buddy note reads as a pencilled heading. */
.question-card .kicker,
.paper-document .kicker,
.buddy .kicker {
  font: 700 1.05rem/1.3 var(--hand);
  letter-spacing: 0;
  text-transform: none;
  color: #2b7668;
}

/* Question meta + mark badges: "QUESTION 1 ........ [5]" in pencil/ink. */
.question-card .q-meta {
  font: 700 1rem/1.3 var(--hand);
  letter-spacing: .02em;
  color: var(--pencil);
  align-items: baseline;
  border-bottom: 1px dashed rgba(75, 85, 99, .35);
  padding-bottom: .35rem;
}
.question-card .q-meta span:last-child,
.question-number > span {
  font: 700 1.05rem/1 var(--hand);
  color: var(--ink-blue);
  letter-spacing: 0;
}


/* --------------------------------------------------------------------------
   6. Memo = teacher red-pen marking on paper
   -------------------------------------------------------------------------- */
.memo { border-top: 1px dashed rgba(75, 85, 99, .35); }
.memo summary,
.exam-question details > summary {
  font: 700 1.1rem/1.3 var(--hand);
  color: #216b5d;
  padding: .3rem 0;
}
.memo[open] summary,
.exam-question details[open] > summary { color: var(--teacher-red); }

.memo > div,
main .exam-question details .memo-sheet {
  position: relative;
  background-color: var(--sheet);
  background-image: var(--paper-fibre);
  border: 1px solid var(--sheet-edge);
  border-left: 3px solid var(--teacher-red);
  border-radius: 2px;
  padding: 1.4rem 1.2rem 1.2rem 1.4rem;
  line-height: 1.7;
}
main .exam-question details { background: transparent; border-left: 0; }

/* Red "MEMO" stamp in the corner once revealed. */
.memo > div::before,
.exam-question details .memo-sheet::before {
  content: "Memo";
  position: absolute;
  top: .6rem;
  right: .8rem;
  font: 700 .8rem/1 var(--hand);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teacher-red);
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: .25rem .45rem .15rem;
  transform: rotate(-5deg);
  opacity: .8;
  pointer-events: none;
}
.memo > div > p:first-child,
.memo-sheet > p:first-child { padding-right: 4.5rem; }

/* Marking notes: red-pen ticks; common errors: red crosses. Item text stays
   in the clean body font for readability. */
.memo ol li::marker,
.memo-sheet ul:first-of-type li::marker {
  content: "\2713  ";
  color: var(--teacher-red);
  font-family: var(--hand);
  font-weight: 700;
}
.memo ul li::marker,
.memo-sheet h4 + ul ~ ul li::marker {
  content: "\2717  ";
  color: var(--teacher-red);
  font-family: var(--hand);
  font-weight: 700;
}
.memo-sheet ol li::marker { color: var(--ink-blue); font-family: var(--hand); font-weight: 700; }
.memo li, .memo-sheet li { margin: .35rem 0; }

.memo h3,
.exam-question .memo-sheet h4 {
  font: 700 1.1rem/1.3 var(--hand);
  letter-spacing: 0;
  text-transform: none;
  color: var(--teacher-red);
  margin: 1.4rem 0 .4rem;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .2em;
}

@keyframes cd-paper-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.memo[open] > div,
.exam-question details[open] .memo-sheet { animation: cd-paper-in .22s ease-out; }


/* --------------------------------------------------------------------------
   7. Graph paper + "pasted-in figure" frames for every diagram
   -------------------------------------------------------------------------- */
.graph-paper,
svg.math-diagram,
svg.econ-graph,
svg.series-chart,
svg.force-diagram,
.process-flow,
.described-schematic {
  background-color: #fcfdfb;
  background-image:
    linear-gradient(var(--grid-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
}

/* Frame: a white "matte" with a thin edge and a soft lift -- like a figure
   cut out and pasted into the book. No rotation (keeps reading steady). */
svg.math-diagram,
svg.econ-graph,
svg.series-chart,
svg.force-diagram {
  display: block;
  max-width: 100%;
  height: auto;
  padding: 6px;
  border: 1px solid var(--sheet-edge);
  border-radius: 2px;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--sheet-edge), 0 6px 16px -10px rgba(23, 59, 54, .35);
  margin: 1.6rem 0;
  overflow: visible;
}

.process-flow,
.described-schematic {
  border: 1px solid var(--sheet-edge);
  border-radius: 2px;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--sheet-edge), 0 6px 16px -10px rgba(23, 59, 54, .35);
  margin: 1.6rem 0;
  max-width: 100%;
}
.described-schematic { border-style: solid; }
.described-schematic strong { font-weight: 700; line-height: 1.5; }
.described-schematic dd { line-height: 1.55; }
.described-schematic dt,
.described-schematic dd { overflow-wrap: anywhere; }

/* Flow steps = index cards on the grid; arrows in pencil, not red. */
.flow-step {
  background: #fff;
  border: 1px solid var(--sheet-edge);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(23, 59, 54, .06);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.flow-step span {
  background: transparent;
  color: var(--ink-blue);
  border: 1.5px solid var(--ink-blue);
  font: 700 .8rem/1 var(--hand);
}
.flow-arrow { color: var(--pencil); font-size: 1.15rem; line-height: 1; }
.flow-rule {
  background: rgba(201, 243, 223, .5);
  border-left: 3px solid #2b7668;
  max-width: 70ch;
}

/* Data tables: ruled table pasted on faint grid; scroll on small screens. */
.diagram-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  background-color: #fcfdfb;
  background-image:
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 10px 10px;
  border: 1px solid var(--sheet-edge);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--sheet-edge);
  margin: 1.6rem 0;
  padding: .6rem;
}
.diagram-table caption {
  font: 700 1rem/1.4 var(--hand);
  color: var(--pencil);
  text-align: left;
  padding: 0 0 .4rem;
}
.diagram-table th,
.diagram-table td { border-color: rgba(75, 85, 99, .3); background: rgba(255, 255, 255, .78); line-height: 1.5; }
.diagram-table th { background: rgba(201, 243, 223, .7); }

/* Optional wrapper for diagrams (see header). */
.paper-figure {
  counter-increment: cd-figure;
  margin: 1.6rem 0;
  max-width: 100%;
}
.paper-figure > svg,
.paper-figure > .process-flow,
.paper-figure > .described-schematic,
.paper-figure > .diagram-table { margin: 0 0 .5rem; }
.paper-figure figcaption {
  font: 400 .95rem/1.4 var(--clean);
  color: var(--pencil);
  max-width: 70ch;
}
.paper-figure figcaption::before {
  content: "Figure " counter(cd-figure) ": ";
  font: 700 1rem/1 var(--hand);
  color: var(--ink-blue);
}

/* Small meta lines under diagrams (scales, distances). */
.meta-line { font-size: .88rem; color: var(--pencil); }


/* --------------------------------------------------------------------------
   8. Ink styling inside SVG drawings
   -------------------------------------------------------------------------- */
/* Text: clean font, readable, with a paper-coloured halo so labels stay
   legible over grid lines. */
svg.math-diagram text,
svg.econ-graph text,
svg.series-chart text,
svg.force-diagram text {
  font-family: var(--clean);
  font-size: 14px;
  font-weight: 600;
  fill: #1f2937;
  paint-order: stroke;
  stroke: #fcfdfb;
  stroke-width: 3px;
  stroke-linejoin: round;
}
svg.econ-graph .axis-label,
svg.series-chart .axis-label { fill: var(--pencil); font-weight: 600; }
svg.econ-graph .equilibrium-label { fill: var(--ink-dot); font-weight: 700; }

/* Axes and construction lines: dark pencil grey. */
svg.math-diagram path.axis,
svg.econ-graph path.axis,
svg.series-chart path.axis {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Curves / plotted lines: blue ink. */
svg.math-diagram path.curve,
svg.econ-graph path.curve,
svg.series-chart path.curve,
svg.force-diagram path.curve {
  fill: none;
  stroke: var(--ink-blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Force arrows: slightly thinner -- arrowheads scale with stroke width. */
svg.force-diagram path.curve { stroke-width: 2; }

/* Points: ink dots. */
svg.math-diagram circle,
svg.series-chart circle,
svg.econ-graph circle {
  fill: var(--ink-dot);
  stroke: #fcfdfb;
  stroke-width: 1.5;
}

/* Arrowheads follow the ink colour (they were coral). */
svg.force-diagram marker path,
svg.series-chart marker path { fill: var(--ink-blue); stroke: none; }
svg.series-chart marker[id$="-north"] path { fill: var(--pencil); }

/* Physics bodies: pencil-shaded block, slope drawn in pencil. */
svg.force-diagram rect {
  fill: #e5e7eb;
  stroke: var(--pencil);
  stroke-width: 1.5;
}
svg.force-diagram > path:not(.curve) {
  fill: rgba(156, 163, 175, .18);
  stroke: var(--pencil);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* Teacher annotations inside a diagram, if a template adds them. */
svg .teacher-mark,
svg text.teacher-mark { fill: var(--teacher-red); font-family: var(--hand); }
svg path.teacher-mark { stroke: var(--teacher-red); fill: none; }


/* --------------------------------------------------------------------------
   9. Buddy panel -- a calm sticky-note beside the sheet
   -------------------------------------------------------------------------- */
.buddy {
  border: 1px solid #b9dccb;
  border-radius: 3px;
  box-shadow: var(--paper-shadow);
  line-height: 1.6;
}
.buddy h2 { font-size: 1.6rem; line-height: 1.15; }
.buddy-reply {
  border-left-color: #2b7668;
  line-height: 1.65;
}


/* --------------------------------------------------------------------------
   10. Responsive (works down to 360px with no horizontal scroll)
   -------------------------------------------------------------------------- */
@media (max-width: 850px) {
  .exam-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Workspace: the 1fr column let the rail's 4x120px nav force a ~530px page
   at 360px wide. minmax(0,1fr) lets the nav scroll inside itself instead. */
@media (max-width: 900px) {
  main.workspace { grid-template-columns: minmax(0, 1fr); }
  main.workspace .workspace-rail { min-width: 0; }
}

@media (max-width: 620px) {
  :root { --margin-x: 1.4rem; --rule: 1.7rem; }
  .question-card,
  main .exam-question,
  .paper-sheet { padding-left: calc(var(--margin-x) + .8rem); padding-right: 1rem; }
  .question-card textarea { --ruled-margin: 1.2rem; padding-right: .6rem; }
  .buddy textarea { --ruled-margin: 1.2rem; }
  .memo > div,
  main .exam-question details .memo-sheet { padding: 1.2rem .9rem 1rem 1rem; }
  .memo > div > p:first-child,
  .memo-sheet > p:first-child { padding-right: 0; padding-top: 1.2rem; }
  svg.math-diagram,
  svg.econ-graph,
  svg.series-chart,
  svg.force-diagram { padding: 4px; }
  /* SVG text is in viewBox units; bump it a little for phones (larger
     values make neighbouring labels collide). */
  svg.math-diagram text,
  svg.econ-graph text,
  svg.series-chart text,
  svg.force-diagram text { font-size: 15px; }
  .process-flow { padding: .9rem; }
  .flow-arrow { transform: rotate(90deg); flex-basis: 100%; text-align: left; padding-left: 1rem; }
  .key-terms { grid-template-columns: minmax(0, 1fr); }
  .key-terms dd { margin-bottom: .5rem; }
}

/* Long MathJax formulas can't wrap; let the text block scroll sideways
   instead of widening the whole page. Display math scrolls on its own. */
.question-card h2,
.exam-question h3,
.memo > div > p,
.memo-sheet > p,
.worked-example p { overflow-x: auto; overflow-y: hidden; }
mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; }


/* --------------------------------------------------------------------------
   11. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .memo[open] > div,
  .exam-question details[open] .memo-sheet { animation: none; }
  .stamp,
  .memo > div::before,
  .exam-question details .memo-sheet::before { transform: none; }
}


/* --------------------------------------------------------------------------
   12. Print -- keep it clean and ink-light
   -------------------------------------------------------------------------- */
@media print {
  .exam-shell { background: #fff; }
  .paper-sheet,
  .question-card,
  main .exam-question,
  main .paper-document,
  .memo > div,
  main .exam-question details .memo-sheet {
    background: #fff none;
    box-shadow: none;
  }
  .question-card,
  main .exam-question,
  .paper-sheet { padding-left: 0; border: 0; }
  .question-card textarea,
  .buddy textarea,
  .ruled {
    background-image: linear-gradient(to bottom, transparent calc(var(--rule) - 1px), #d5dbe3 calc(var(--rule) - 1px));
    background-size: 100% var(--rule);
    background-position: 0 calc(var(--pad-top) - 4px);
    padding-left: .5rem;
    border: 0;
    resize: none;
  }
  /* Grid prints only the bold 50px lines, very lightly (and only when the
     browser's "background graphics" option is on). */
  .graph-paper,
  svg.math-diagram,
  svg.econ-graph,
  svg.series-chart,
  svg.force-diagram,
  .process-flow,
  .described-schematic,
  .diagram-table {
    background-image:
      linear-gradient(rgba(0, 0, 0, .08) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 0, 0, .08) 1px, transparent 1px);
    background-size: 50px 50px;
    box-shadow: none;
    break-inside: avoid;
  }
  .memo > div::before,
  .exam-question details .memo-sheet::before { opacity: 1; }
  main .answer-lines { background-image: none; }
  main .answer-lines i { border-bottom-color: #c9ced6; }
}
