/* KDS Schoolhouse: a 90s teen-sitcom classroom look. Neon on deep purple, thick ink outlines, hard offset shadows. */
:root {
  --ink: #14082e; --paper: #fffdf6; --muted: #5b4b7a;
  --pink: #ff2d95; --pink-deep: #e6007e; --cyan: #00e5ff; --purple: #7a2cff; --purple-deep: #2b0a5a;
  --yellow: #ffe500; --lime: #39ff14; --orange: #ff7a00;
  --link: #5b1fd0; --ok-bg: #d9ffe0; --ok-text: #0b5a22; --err-bg: #ffe0ee; --err-text: #8a0036;
  --radius: 14px; --font-head: "Arial Black", "Arial Rounded MT Bold", Impact, "Trebuchet MS", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.55 "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  background: url("/static/img/confetti.svg") center top / 260px, linear-gradient(160deg, #2b0a5a 0%, #4a1590 55%, #8a1fa8 100%) fixed;
  background-color: var(--purple-deep); min-height: 100vh;
}
a { color: var(--link); }
.container { max-width: 1040px; margin: 0 auto; padding: 18px 16px 48px; }
h1, h2, h3 { font-family: var(--font-head); font-style: italic; letter-spacing: -.5px; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); margin: 8px 0 12px; color: var(--yellow); text-shadow: 3px 3px 0 var(--pink), 5px 5px 0 var(--ink); text-transform: uppercase; }
h2 { font-size: 1.3rem; margin: 0 0 8px; }
.lead, .container > .muted { color: #f1e4ff; font-size: 1.05rem; }
.card .muted, .sheet .muted, .toolbar .muted { color: var(--muted); }
.muted { color: var(--muted); } .small-text { font-size: .9rem; }

/* header */
.topbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 16px 18px; color: #fff; position: relative;
  background: linear-gradient(90deg, #00b8d4 0%, #7a2cff 45%, #ff2d95 100%); border-bottom: 4px solid var(--ink); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 14px; background: url("/static/img/zigzag.svg") repeat-x; }
.topbar a, .topbar summary { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-style: italic; font-size: 1.2rem; text-shadow: 2px 2px 0 var(--ink); }
.brand small { display: block; font: 700 .72rem/1 "Trebuchet MS", sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--yellow); text-shadow: 1px 1px 0 var(--ink); margin-top: 3px; font-style: normal; }
nav { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; align-items: center; }
.menu { position: relative; }
.menu summary, .navlink { cursor: pointer; list-style: none; padding: 6px 12px; border: 3px solid var(--ink); border-radius: 999px; background: var(--purple-deep); font-weight: 700; box-shadow: 3px 3px 0 var(--ink); display: inline-block; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; }
.menu summary:hover, .menu[open] summary, .navlink:hover { background: var(--yellow); color: var(--ink); text-shadow: none; }
.menu-items { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 210px; background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--ink); padding: 6px; display: flex; flex-direction: column; }
.menu-items a { color: var(--ink); padding: 8px 10px; border-radius: 8px; font-weight: 700; }
.menu-items a:hover { background: var(--cyan); }
.menu-items hr { width: 100%; border: 0; border-top: 2px dashed var(--purple); margin: 4px 0; }
.who { display: flex; gap: 12px; align-items: center; text-shadow: 1px 1px 0 var(--ink); font-weight: 700; } .who form { margin: 0; }
.pill { background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; font-size: .78rem; font-weight: 800; text-shadow: none; }
.pill.alt { background: var(--cyan); }

/* controls */
button, .btn { font: 800 .95rem/1.2 "Trebuchet MS", sans-serif; letter-spacing: .3px; text-transform: uppercase; background: var(--pink-deep); color: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
button:hover, .btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
button:active, .btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); box-shadow: 4px 4px 0 var(--cyan), 4px 4px 0 3px var(--ink); }
button.secondary.on { background: var(--yellow); }
button.danger { background: #fff; color: var(--err-text); }
button.link { background: none; color: #fff; padding: 0; border: 0; box-shadow: none; text-transform: none; text-decoration: underline; text-shadow: 1px 1px 0 var(--ink); }
button.small, .btn.small { padding: 5px 10px; font-size: .8rem; box-shadow: 3px 3px 0 var(--ink); }
button:disabled { opacity: .7; cursor: progress; }
form.inline { display: inline-block; margin: 0; }
label { display: block; margin: 12px 0; font-weight: 700; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
input:not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 10px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--pink-deep); flex: none; }
:focus-visible { outline: 4px solid var(--cyan); outline-offset: 2px; }
fieldset { border: 3px dashed var(--purple); border-radius: 12px; margin: 16px 0; padding: 4px 14px 10px; }
legend { font-family: var(--font-head); font-style: italic; padding: 0 8px; color: var(--purple); }

/* cards */
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); padding: 20px; margin: 16px 0; box-shadow: 7px 7px 0 var(--pink); }
.card.narrow { max-width: 480px; margin: 32px auto; box-shadow: 7px 7px 0 var(--cyan); }
.card.narrow h1 { color: var(--purple); text-shadow: 2px 2px 0 var(--yellow); }
.hero-bell { display: block; margin: -62px auto 0; filter: drop-shadow(3px 3px 0 var(--ink)); animation: ring 3.5s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(10deg); } 94% { transform: rotate(-9deg); } 97% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .hero-bell { animation: none; } button, .btn { transition: none; } }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.locker { position: relative; padding-top: 24px; border-top-width: 14px; }
.locker.c-cyan { border-top-color: var(--cyan); box-shadow: 7px 7px 0 var(--cyan); } .locker.c-pink { border-top-color: var(--pink); } .locker.c-yellow { border-top-color: var(--yellow); box-shadow: 7px 7px 0 var(--yellow); }
.locker .icon { position: absolute; right: 14px; top: 10px; filter: drop-shadow(2px 2px 0 rgba(20, 8, 46, .35)); transform: rotate(8deg); }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 5px 0; border-bottom: 2px dotted #d6c8f0; } ul.plain li:last-child { border: 0; } ul.plain a { font-weight: 700; }
.alert { padding: 10px 14px; border: 3px solid var(--ink); border-radius: 10px; margin: 14px 0; font-weight: 700; box-shadow: 4px 4px 0 var(--ink); }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); } .alert.err { background: var(--err-bg); color: var(--err-text); } .alert ul { margin: 0; padding-left: 18px; }
.alert a { color: inherit; }
.tabs a { margin-right: 12px; color: #fff; font-weight: 700; } .tabs a.on { color: var(--yellow); text-decoration-thickness: 3px; }
.table-wrap { overflow-x: auto; border: 3px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 6px 6px 0 var(--cyan); }
table { border-collapse: collapse; width: 100%; background: #fff; }
th { background: var(--purple-deep); color: #fff; font-family: var(--font-head); font-style: italic; font-weight: 400; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 2px solid #e6dcf7; vertical-align: top; }
.actions form { display: inline-block; margin: 0 4px 4px 0; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #eee; border: 2px solid var(--ink); } .badge.pending { background: var(--yellow); } .badge.approved { background: var(--lime); }
code { background: #efe7ff; padding: 2px 6px; border-radius: 4px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0 20px; }
.toolbar .btn, .toolbar button { margin: 0; }
ul.items { list-style: none; margin: 0; padding: 0; } ul.items li { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 2px dotted #d6c8f0; } ul.items li:last-child { border: 0; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qrow { border: 2px dashed #cdb8f5; border-radius: 10px; padding: 0 12px 4px; margin: 10px 0; background: #fbf8ff; }

/* worksheets: always black on white, like the paper they print on */
.sheet { background: #fff; color: #000; border: 3px solid var(--ink); border-radius: 8px; padding: 28px 34px; margin: 0 0 24px; min-height: 9in; box-shadow: 7px 7px 0 var(--cyan); }
.sheet h1 { margin: 0; font-size: 1.6rem; color: #000; text-shadow: none; text-transform: none; font-family: Arial, Helvetica, sans-serif; font-style: normal; letter-spacing: 0; } .sheet h2 { font-family: Arial, Helvetica, sans-serif; font-style: normal; }
.sheet-sub { margin: 2px 0 8px; color: #333; }
.namedate { display: flex; justify-content: space-between; gap: 24px; margin: 8px 0 18px; font-weight: 400; }
.blank { display: inline-block; border-bottom: 1.5px solid #000; width: 200px; height: 1em; vertical-align: baseline; } .blank.short { width: 90px; }
.legend { font-style: italic; margin: 0 0 12px; }
ol.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px 12px; grid-template-columns: repeat(5, 1fr); }
ol.problems.horizontal { grid-template-columns: repeat(3, 1fr); }
ol.problems li { position: relative; padding-left: 26px; min-height: 90px; }
ol.problems .pn { position: absolute; left: 0; top: 0; font-size: .85rem; }
.vp { display: inline-block; font-variant-numeric: tabular-nums; font-size: 1.25rem; }
.vp .row { display: flex; justify-content: flex-end; gap: 10px; } .vp .opsym { min-width: 1ch; }
/* --lh / --space are the line height and answer space; print sets them per fit-* class below. wN = N extra lines of work space */
ol.problems { --lh: 30px; --fs: 20px; --space: 34px; }
.vp .rule { border-top: 2px solid #000; margin-top: 2px; height: var(--space); }
.vp .rule.w1 { height: calc(var(--space) + var(--lh)); } .vp .rule.w2 { height: calc(var(--space) + 2 * var(--lh)); } .vp .rule.w3 { height: calc(var(--space) + 3 * var(--lh)); }
.hp { font-size: 1.25rem; padding-top: 6px; }
.div-bracket { display: inline-flex; align-items: flex-start; font-size: 1.25rem; font-variant-numeric: tabular-nums; margin-top: 8px; }
.div-bracket .divisor { padding: 6px 8px 0 0; } .div-bracket .dividend { border-left: 2px solid #000; border-top: 2px solid #000; padding: 6px 12px var(--space) 8px; border-top-left-radius: 8px; }
.div-bracket.w2 .dividend { padding-bottom: calc(var(--space) + 2 * var(--lh)); } .div-bracket.w3 .dividend { padding-bottom: calc(var(--space) + 3 * var(--lh)); }
.words-problems { padding-left: 22px; } .words-problems li { margin-bottom: 8px; break-inside: avoid; font-size: 1.1rem; }
.workspace { height: 100px; border: 1px dashed #aaa; border-radius: 6px; margin: 6px 0; } .answerline { margin: 4px 0 16px; }
.keylist { columns: 2; font-size: 1.05rem; } .keylist.single { columns: 1; } .keylist.single li { margin-bottom: 10px; break-inside: avoid; }
.tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; border: 1px solid #000; border-radius: 4px; padding: 0 5px; margin-right: 4px; }
.wordgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: w; }
.wordgrid li { counter-increment: w; font-size: 1.6rem; padding: 6px 0; } .wordgrid li::before { content: counter(w) "."; font-size: .75rem; margin-right: 6px; color: #444; }
.wordgrid.write { grid-template-columns: repeat(2, 1fr); } .wordgrid.write .blank { width: 55%; margin-left: 12px; }
.mark { font-size: 1rem; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); } .cards li { border: 1px dashed #666; height: 1.6in; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; break-inside: avoid; }
.tracelist { list-style: none; padding: 0; margin: 0; } .tracelist li { display: grid; grid-template-columns: 1.5fr 1.5fr 2fr; gap: 12px; align-items: end; font-size: 1.7rem; padding: 6px 0; } .trace { color: #aaa; } .tracelist .blank { width: 100%; }
.prompt { margin-bottom: 20px; break-inside: avoid; }
.lines .line { height: 34px; border-bottom: 1.5px solid #555; } .lines.primary .line { height: 46px; background: linear-gradient(transparent 49%, #bbb 49%, #bbb 51%, transparent 51%); }
.reading .passage { font-size: 1.15rem; line-height: 1.75; margin: 4px 0 18px; } .reading .passage p { margin: 0 0 .8em; }
.vocab-box { display: inline-block; border: 2px solid #000; border-radius: 8px; padding: 4px 14px; margin: 0 0 12px; font-size: 1.15rem; }
.q-head { font-size: 1.1rem; border-bottom: 2px solid #000; padding-bottom: 2px; }
ol.questions { padding-left: 24px; } ol.questions li { margin-bottom: 14px; break-inside: avoid; font-size: 1.05rem; } ol.questions p { margin: 0 0 4px; }

/* phones and tablets */
@media screen and (max-width: 1000px) { ol.problems { grid-template-columns: repeat(3, 1fr); } ol.problems.horizontal { grid-template-columns: repeat(2, 1fr); } }
/* screen only: a printed Letter page is ~720px wide, which must NOT trigger the phone layout */
@media screen and (max-width: 760px) {
  .container { padding: 12px 12px 40px; }
  .topbar { padding: 8px 12px 20px; gap: 8px 10px; } .brand { flex: 1; font-size: 1.05rem; } .brand img { width: 32px; height: 32px; }
  .who { order: 2; font-size: .9rem; gap: 8px; } .who a { display: none; } nav { order: 3; width: 100%; gap: 6px; }
  .menu summary, .navlink { padding: 4px 10px; font-size: .85rem; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
  .menu-items { position: static; box-shadow: 3px 3px 0 var(--ink); margin-top: 8px; min-width: 0; }
  .menu { flex: 0 0 auto; } .menu[open] { flex-basis: 100%; }
  .card { padding: 16px; box-shadow: 5px 5px 0 var(--pink); }
  .locker .icon { width: 48px; height: 48px; }
  .sheet { padding: 16px 14px; min-height: 0; overflow-x: auto; }
  ol.problems { grid-template-columns: repeat(2, 1fr); }
  ol.problems.horizontal { grid-template-columns: 1fr; }
  .wordgrid, .cards { grid-template-columns: repeat(2, 1fr); } .wordgrid.write { grid-template-columns: 1fr; }
  .keylist { columns: 1; } .tracelist li { font-size: 1.3rem; }
  .toolbar { gap: 8px; } .toolbar .btn, .toolbar button { flex: 1 1 auto; text-align: center; }
  .namedate { flex-direction: column; gap: 6px; } .blank { width: 150px; }
}

/* print: plain black ink on white paper, no chrome */
@page { size: letter; margin: .5in; }
@media print {
  body { background: #fff !important; color: #000; }
  .no-print, .topbar, .toolbar { display: none !important; }
  .container { max-width: none; padding: 0; margin: 0; }
  .sheet { border: 0; box-shadow: none; padding: 0; margin: 0; min-height: 0; border-radius: 0; overflow: visible; }
  .sheet + .sheet { break-before: page; }
  .sheet.key { break-before: page; }
  ol.problems li, .words-problems li, .prompt, ol.questions li { break-inside: avoid; }
  .reading .passage, .lines .line, .blank { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* pep-talk bubble under the home page greeting */
.greeting { display: inline-block; position: relative; margin: 6px 0 14px; padding: 10px 16px; max-width: 46em; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--pink); font: 800 1.05rem/1.35 "Trebuchet MS", sans-serif; transform: rotate(-.6deg); }
.greeting::before { content: ""; position: absolute; left: 22px; top: -13px; border: 7px solid transparent; border-bottom: 10px solid var(--ink); }

/* Printing math worksheets: vertical = 5 columns x 5 rows (25 per page); horizontal = 3 columns x 5 rows (15 per page).
   The server splits longer sheets into one .sheet per page (lib/sheets.js PER_PAGE), so a page never has more rows than this. */
@media print {
  ol.problems { grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1.6in; gap: 0 10px; --lh: 26px; --fs: 18px; --space: 20px; }
  ol.problems.horizontal { grid-template-columns: repeat(3, 1fr); }
  ol.problems.d6, ol.problems.d7, ol.problems.d8 { --fs: 16px; --lh: 24px; } /* 6-7 digit numbers: keep five columns readable */
  ol.problems li { min-height: 0; padding-left: 23px; }
  ol.problems .pn { font-size: .7rem; }
  ol.problems .vp { font-size: var(--fs); }
  ol.problems .vp .row { line-height: var(--lh); }
  ol.problems .hp { font-size: var(--fs); line-height: var(--lh); padding-top: 0; }
  ol.problems .div-bracket { font-size: var(--fs); line-height: var(--lh); margin-top: 0; }
  ol.problems .div-bracket .divisor { padding-top: 4px; }
  .sheet-head h1 { font-size: 1.3rem; } .namedate { margin: 4px 0 10px; } .sheet-sub { margin-bottom: 2px; }
}

/* stacked fractions and mixed numbers */
.mn { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.mn .wh { font-size: 1.1em; }
.fr { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
.fr .nu { border-bottom: 2px solid currentColor; padding: 0 4px; }
.fr .de { padding: 0 4px; }
.vp .pad { visibility: hidden; } /* invisible zeros that line up the decimal points */
.fvp .row { align-items: center; padding: 3px 0; }
.fhp { display: flex; align-items: center; gap: 8px; }

/* ---------- Spiral Review: a ten-box test page ---------- */
.spiral-sheet { --space: 16px; --lh: 24px; padding: 18px 22px; page: spiral; }
.sp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 2px; }
.sp-name { flex: 1; max-width: 55%; border: 2px solid #000; border-radius: 10px; padding: 5px 12px; font: 600 1.05rem Arial, sans-serif; display: flex; gap: 8px; align-items: flex-end; } .sp-name .blank { flex: 1; width: auto; }
.sp-tag { border: 2px solid #000; border-radius: 10px; padding: 5px 18px; font: 700 1.4rem Arial, sans-serif; letter-spacing: .02em; }
.sp-sub { margin: 3px 2px 6px; font-size: .8rem; color: #444; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(1.78in, auto); border: 2px solid #000; }
.sp-box { position: relative; border: 1px solid #000; padding: 4px 6px 4px 24px; min-width: 0; display: flex; overflow: hidden; }
.sp-n { position: absolute; left: 6px; top: 4px; font: 700 .95rem Arial, sans-serif; }
.sp-parts { display: flex; flex: 1; min-width: 0; } .sp-parts.stack { flex-direction: column; }
.sp-part { flex: 1; min-width: 0; padding: 0 6px; } .sp-parts:not(.stack) .sp-part + .sp-part { border-left: 1px solid #000; }
.sp-parts.stack .sp-part + .sp-part { margin-top: 4px; }
.sp-t, .sp-c, .sp-note { margin: 0 0 4px; font: 400 .88rem/1.28 Arial, Helvetica, sans-serif; color: #000; }
.sp-c { text-align: center; font-size: 1.1rem; margin: 5px 0; } .sp-note { font-size: .74rem; font-style: italic; }
.sp-line { margin: 5px 0 2px; font: 400 .88rem Arial, sans-serif; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 6px; clear: both; } .sp-parts.multi .sp-line .blank { flex-basis: 52px; } .sp-line .blank { flex: 0 0 90px; }
.sp-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 6px; clear: both; } .sp-lines .blank { width: 100%; }
.sp-svg { margin: 2px 0; text-align: center; } .sp-svg svg { max-width: 100%; height: auto; }
.sp-split { display: flex; gap: 8px; align-items: flex-start; } .sp-sl { flex: 1; min-width: 0; } .sp-sr { flex: 0 0 auto; } .sp-sr .sp-svg { margin: 0; }
.sp-t .mn, .sp-c .mn { vertical-align: middle; } .sp-t .mn { margin: -4px 0; } .sp-t .fr { font-size: .82em; line-height: 1.05; } .sp-t .mn .wh { font-size: 1em; }
.sp-vp, .sp-ld { font-size: 1.3rem; margin: 4px auto; display: block; width: max-content; }
.sp-table { border-collapse: collapse; margin: 3px auto; font: 400 .8rem Arial, sans-serif; } .sp-table th, .sp-table td { border: 1.5px solid #000; padding: 2px 10px; min-width: 56px; height: 19px; text-align: center; background: none; color: #000; font-style: normal; text-transform: none; font-weight: 400; } .sp-table th { font-weight: 700; }
.sp-cmps { display: grid; gap: 4px; margin-top: 3px; } .sp-cmp { display: flex; align-items: center; justify-content: center; gap: 10px; font: 400 .92rem Arial, sans-serif; } .sp-cmp .a { min-width: 62px; text-align: right; } .sp-cmp .b { min-width: 62px; }
.circ { display: inline-block; width: 24px; height: 24px; border: 1.8px solid #000; border-radius: 50%; }
.sp-match { display: flex; justify-content: space-between; gap: 40px; margin: 3px 8px; font: 400 .85rem Arial, sans-serif; } .sp-match ul { list-style: none; margin: 0; padding: 0; } .sp-match li { display: flex; align-items: center; gap: 6px; padding: 2px 0; } .sp-match .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #000; }
.sp-list { margin: 3px 0; } .sp-row { font: 400 .95rem Arial, sans-serif; margin: 5px 0; line-height: 1.2; } .sp-row .blank { width: 70px; margin-left: 6px; }
.sp-wholes { border-collapse: collapse; width: 100%; margin-top: 4px; table-layout: fixed; } .sp-wholes td { border: 1.5px solid #000; height: 26px; text-align: center; font: 400 .72rem Arial, sans-serif; } .sp-wholes td.w { background: #d8d8d8; }
.sp-boxdraw { width: 1in; height: 1in; border: 1.5px solid #000; margin: 4px auto; }
.sp-bul { margin: 2px 0 3px 16px; padding: 0; font: 400 .82rem/1.3 Arial, sans-serif; } .sp-bul.plain { list-style: none; margin-left: 4px; font-size: .8rem; line-height: 1.15; } .sp-bul .blank { width: 36px; }
.sp-bul.inline { display: flex; flex-wrap: nowrap; gap: 4px 8px; margin: 3px 0 2px 2px; font-size: .78rem; } .sp-bul.inline li { white-space: nowrap; } .sp-bul.inline .blank { width: 22px; border-bottom: 1.5px solid #000; }
.sp-points { font: 400 .82rem/1.4 Arial, sans-serif; margin: 2px 0 4px; }
.sp-side .sp-table th, .sp-side .sp-table td { min-width: 0; padding: 2px 5px; font-size: .74rem; }
.sp-side { display: flex; gap: 8px; align-items: flex-start; } .sp-side .sl { flex: 1; min-width: 0; } .sp-side .sr { flex: 0 0 auto; }
.sp-space.s { height: 18px; } .sp-space.m { height: 40px; } .sp-space.l { height: 80px; }
.sp-key span { display: block; }
.sp-parts.multi .sp-table th, .sp-parts.multi .sp-table td { min-width: 0; padding: 2px 5px; } .sp-and .blank { flex: 1 1 36px; width: auto; min-width: 36px; }
@media screen and (max-width: 760px) { .sp-grid { grid-template-columns: 1fr; } .sp-head { flex-direction: column; align-items: stretch; } .sp-name { max-width: none; } .sp-box { overflow: visible; } .sp-split { flex-direction: column; } }
@page spiral { size: letter; margin: .45in; }
@media print {
  .spiral-sheet { padding: 0; }
  .sp-grid { height: 8.85in; grid-template-rows: repeat(5, minmax(0, 1fr)); grid-auto-rows: 0; }
  .sp-box { break-inside: avoid; }
  .sp-svg svg { max-height: 1.5in; width: auto; }
  .sp-svg.wide svg { max-height: .92in; } .sp-svg.wide.tall svg { max-height: 1.2in; }
  .sp-sub { margin: 2px 2px 3px; }
}

/* Place value and rounding sheets */
.ns-heading { font-size: 1.15rem; margin: 6px 0 10px; font-weight: 600; }
.ns-list { list-style: decimal; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 36px; padding-left: 38px; margin: 8px 0; }
.ns-list li { break-inside: avoid; font-size: 1.1rem; min-height: 1.35in; }
.ns-q { margin: 0 0 4px; } .ns-num { margin: 4px 0 6px; font-size: 1.55rem; letter-spacing: .03em; } .ns-ans { margin: 6px 0 0; }
.ns-ans .blank { width: 150px; }
.ns-s-list li { min-height: .55in; display: flex; align-items: baseline; gap: 12px; }
.ns-s-list .ns-num { font-size: 1.3rem; margin: 0; min-width: 120px; }
.ns-s-list .blank { width: 130px; }
