

@font-face { font-family: "Andika"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/Andika-Regular-latin.woff2) format("woff2"); }
@font-face { font-family: "Andika"; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/Andika-Bold-latin.woff2) format("woff2"); }

:root {
    --paper: #f4f1ff;
    --ink: #1e1b3a;
    --muted: #6b6892;
    --blue: #5b4ee6;
    --blue-dark: #3a2c9e;
    --yellow: #ffc83d;
    --green: #1fb57a;
    --red: #ef5b6b;
    --line: #e5e0f7;
    --card: #ffffff;
    --pink: #ff6fae;
    --shadow: 0 8px 24px rgba(58, 44, 158, 0.10), 0 1px 2px rgba(58, 44, 158, 0.08);
    --round: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }


.nd-top {
    background: linear-gradient(160deg, var(--blue), var(--blue-dark));
    color: #fff;
    padding: calc(10px + env(safe-area-inset-top)) 16px 14px;
    text-align: center;
    position: relative;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.nd-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nd-back {
    color: #fff; text-decoration: none; font-size: 0.85rem; font-weight: 600;
    padding: 5px 9px; border: 1.5px solid rgba(255, 255, 255, 0.5); border-radius: 999px;
}
.nd-music {
    font: inherit; font-weight: 700; font-size: 0.78rem; cursor: pointer; touch-action: manipulation;
    color: #fff; background: transparent; padding: 5px 9px;
    border: 1.5px solid rgba(255, 255, 255, 0.5); border-radius: 999px;
}
.nd-music.off { opacity: 0.6; }
body.display .nd-music { display: none; }
.nd-top h1 { margin: 10px 0 2px; font-size: 1.9rem; letter-spacing: 0.02em; font-weight: 800; }
.nd-top h1 span { font-weight: 400; font-size: 1.1rem; opacity: 0.85; }
.nd-date { font-size: 0.92rem; opacity: 0.9; }


.nd-main { max-width: 640px; margin: 0 auto; padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); }
.nd-label { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.nd-panel { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.nd-grade-row { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; margin: 8px 0 6px; }
.nd-grade {
    font: inherit; font-weight: 800; font-size: 0.9rem; padding: 9px 0;
    border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer;
    touch-action: manipulation;
}
.nd-grade.on { background: var(--yellow); border-color: #d9a520; }
.nd-blurb { font-size: 0.86rem; color: var(--muted); }

.nd-hero {
    text-align: center; padding: 14px 10px 12px; margin-bottom: 12px;
    background: var(--card); border: 2px dashed var(--blue); border-radius: 18px;
}

.nd-board { display: flex; justify-content: center; align-items: flex-start; gap: 4px; flex-wrap: wrap; margin: 6px 0 4px; }
.nd-tile {
    position: relative; display: grid; place-items: center;
    min-width: clamp(38px, 12vw, 62px); padding: 6px 4px 2px;
    background: var(--blue-dark); border-radius: 8px; border: 2px solid #17406e;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.nd-tile-face {
    font-size: clamp(2rem, 11vw, 3.4rem); font-weight: 900; line-height: 1.05;
    color: #fff; font-variant-numeric: tabular-nums; opacity: 0;
}
.nd-tile.up .nd-tile-face { opacity: 1; }
.nd-tile-place { font-size: clamp(0.42rem, 1.8vw, 0.56rem); letter-spacing: 0.08em; text-transform: uppercase; color: #bcd6f2; font-weight: 700; opacity: 0; }
.nd-tile.up .nd-tile-place { opacity: 1; }
.nd-tile.sep { background: none; border: none; box-shadow: none; min-width: 0; padding-left: 0; padding-right: 0; }
.nd-tile.sep .nd-tile-face { color: var(--blue-dark); }
.nd-tile.landing { animation: ndFlip 0.42s ease-out; }
.nd-tile.calling { background: var(--yellow); border-color: #d9a520; animation: ndCall 0.6s ease-out; }
.nd-tile.calling .nd-tile-face { color: var(--ink); }
.nd-tile.calling .nd-tile-place { color: #7a5c0a; }
@keyframes ndFlip {
    0% { transform: rotateX(-90deg) scale(0.9); }
    60% { transform: rotateX(12deg) scale(1.04); }
    100% { transform: none; }
}
@keyframes ndCall { 0% { transform: translateY(-6px) scale(1.09); } 100% { transform: none; } }
.nd-board.long .nd-tile { min-width: clamp(28px, 8vw, 46px); }
.nd-board.long .nd-tile-face { font-size: clamp(1.5rem, 7.5vw, 2.5rem); }

.nd-board.long { flex-wrap: nowrap; gap: 3px; }
.nd-board.long .nd-tile { min-width: clamp(28px, 9.5vw, 46px); padding: 6px 3px 2px; flex: 0 1 auto; }   
.nd-board.long .nd-tile.sep { min-width: 0; }
.nd-board.long .nd-tile-place { font-size: clamp(0.34rem, 1.45vw, 0.5rem); letter-spacing: 0.02em; }


.nd-compare-blocks { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 4px 0 10px; }
.nd-compare-side { flex: 1 1 0; min-width: 0; text-align: center; }
.nd-compare-side .nd-model { max-width: 170px; }
.nd-compare-num { font-size: 1.4rem; font-weight: 900; color: var(--blue-dark); }
.nd-compare-gap { font-size: 1.6rem; font-weight: 900; color: #d63b7a; padding-bottom: 28px; }

.nd-chant { font-size: clamp(0.95rem, 4vw, 1.25rem); font-weight: 800; color: var(--blue-dark); margin: 2px 0 8px; transition: opacity 0.4s ease; }
.nd-chant.quiet { opacity: 0.25; }
.nd-hero-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.nd-hero-row .nd-btn { font-size: 0.82rem; padding: 7px 13px; }


.nd-display-exit { display: none; }
body.display { background: var(--blue-dark); }
body.display .nd-top, body.display .nd-panel, body.display .nd-tasks,
body.display .nd-done, body.display .nd-tools, body.display .nd-foot, body.display .nd-promise-row,
body.display .nd-progress-wrap { display: none !important; }
body.display .nd-main { max-width: none; padding: 0; display: grid; min-height: 100dvh; place-items: center; }
body.display .nd-hero { background: none; border: none; width: 100%; }
body.display .nd-label { color: #9fc2e8; font-size: 0.9rem; }
body.display .nd-tile { min-width: clamp(60px, 13vw, 150px); border-color: #0d2b4d; background: #123a66; }
body.display .nd-tile-face { font-size: clamp(3rem, 13vw, 9rem); }
body.display .nd-tile-place { font-size: clamp(0.6rem, 1.4vw, 1rem); }
body.display .nd-tile.sep { background: none; border: none; }
body.display .nd-tile.sep .nd-tile-face { color: #9fc2e8; }
body.display .nd-chant { color: #fff; font-size: clamp(1.2rem, 4vw, 2.4rem); }
body.display .nd-hero-row { display: none; }
body.display .nd-display-exit {
    display: block; position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 5;
    font: inherit; font-weight: 800; font-size: 0.85rem; padding: 8px 14px; cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.55); border-radius: 999px; background: transparent; color: #fff;
}
.nd-progress-wrap { display: flex; align-items: center; gap: 10px; }
.nd-progress-track { flex: 1; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.nd-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #63d08c); transition: width 0.3s ease; }
.nd-progress { font-weight: 800; font-size: 0.9rem; color: var(--muted); min-width: 4.2em; text-align: right; }


.nd-tasks { display: flex; flex-direction: column; gap: 10px; }
.nd-card {
    background: var(--card); border: 1.5px solid var(--line); border-left: 6px solid var(--blue);
    border-radius: 12px; padding: 10px 12px 12px;
}
.nd-card.ok { border-left-color: var(--green); background: #f3fbf5; }
.nd-card.no { border-left-color: var(--red); }
.nd-card.pop { animation: ndPop 0.35s ease; }
@keyframes ndPop { 40% { transform: scale(1.02); } }
.nd-card-head { display: flex; align-items: center; gap: 8px; }
.nd-card-num { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; font-size: 0.8rem; display: grid; place-items: center; flex: none; }
.nd-card.ok .nd-card-num { background: var(--green); }
.nd-card.no .nd-card-num { background: var(--red); }
.nd-card-title { font-weight: 800; font-size: 0.98rem; }
.nd-card-mark { margin-left: auto; font-weight: 900; font-size: 1.2rem; }
.nd-card.ok .nd-card-mark { color: var(--green); }
.nd-card.no .nd-card-mark { color: var(--red); }
.nd-prompt { margin: 8px 0 8px; font-size: 1.02rem; line-height: 1.35; }
.nd-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nd-hint, .nd-work { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

.nd-input {
    font: inherit; font-size: 1.1rem; font-weight: 700; padding: 8px 10px; width: 6.5em; max-width: 100%;
    border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.nd-input.wide { flex: 1 1 8em; width: auto; }
.nd-input:focus { outline: none; border-color: var(--blue); }
.nd-input:disabled { background: #f4f4f4; color: var(--muted); }
.nd-fields { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.nd-field { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.nd-field .nd-input { width: 3.7em; text-align: center; padding-left: 4px; padding-right: 4px; }
.nd-check, .nd-btn {
    font: inherit; font-weight: 800; font-size: 0.92rem; padding: 9px 16px; cursor: pointer; touch-action: manipulation;
    border: 2px solid var(--blue); border-radius: 999px; background: #fff; color: var(--blue-dark);
}
.nd-check:disabled { opacity: 0.4; cursor: default; }
.nd-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-choice {
    font: inherit; font-weight: 700; font-size: 1rem; padding: 9px 14px; cursor: pointer; touch-action: manipulation;
    border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%;
}
.nd-choice.picked { border-color: var(--blue); background: #eaf2fb; }
.nd-card.ok .nd-choice.picked { border-color: var(--green); background: #e3f6ea; }
.nd-card.no .nd-choice.picked { border-color: var(--red); background: #fdeaea; }
.nd-choice:disabled { cursor: default; }

.nd-line { width: 100%; height: auto; color: var(--ink); touch-action: manipulation; }
.nd-tick { cursor: pointer; }
.nd-dot { fill: var(--blue); stroke: #fff; stroke-width: 3; }
.nd-card.ok .nd-dot { fill: var(--green); }
.nd-card.no .nd-dot { fill: var(--red); }

.nd-frame { display: grid; gap: 4px; }
.nd-frame.cells-10 { grid-template-columns: repeat(5, 40px); }

.nd-frame.cells-20 { grid-template-columns: repeat(10, minmax(0, 30px)); max-width: 100%; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 6) { margin-left: 10px; }
.nd-frame.cells-20 .nd-cell { font: 800 0.8rem/1 "Andika", var(--round); color: #fff; }
.nd-frame.cells-100 { grid-template-columns: repeat(10, 24px); }
.nd-cell { width: 100%; aspect-ratio: 1; border: 2px solid var(--ink); background: #fff; padding: 0; cursor: pointer; touch-action: manipulation; border-radius: 3px; }
.nd-cell.filled { background: var(--yellow); }
.nd-count { font-weight: 800; font-size: 1rem; min-width: 2em; text-align: center; color: var(--muted); }


.nd-shade { display: grid; gap: 2px; width: 100%; max-width: 300px; touch-action: none; }
.nd-shade.parts-10 { grid-template-columns: repeat(10, 1fr); aspect-ratio: 10 / 7; }
.nd-shade.parts-100 { grid-template-columns: repeat(10, 1fr); aspect-ratio: 1; }
.nd-piece { border: 1.5px solid var(--ink); background: #fff; padding: 0; cursor: pointer; border-radius: 2px; }
.nd-shade.parts-10 .nd-piece { border-width: 2px; }
.nd-piece.on { background: var(--blue); border-color: var(--blue-dark); }
.nd-card.ok .nd-piece.on { background: var(--green); }
.nd-card.no .nd-piece.on { background: var(--red); }
.nd-card.ok .nd-shade { pointer-events: none; }   

.nd-model { width: 100%; max-width: 360px; height: auto; color: var(--ink); }
.nd-model-dots { max-width: 230px; }
.nd-model-decimal { max-width: 210px; }
.nd-model-tally { max-width: 300px; }
.nd-model-array { max-width: 280px; }
.nd-dotfill { fill: var(--blue); }
.nd-flat { fill: #b9d4f2; stroke: var(--ink); stroke-width: 1.2; }
.nd-rod { fill: #f6c445; stroke: var(--ink); stroke-width: 1.2; }
.nd-unit { fill: #2e9e5b; stroke: var(--ink); stroke-width: 0.8; }
.nd-empty { fill: #fff; stroke: var(--ink); stroke-width: 0.5; }


.nd-prompt.speakable { cursor: pointer; border-radius: 8px; margin-left: -6px; margin-right: -6px; padding: 2px 6px; transition: background 0.2s; }
.nd-prompt.speakable:hover { background: #f3f7fc; }
.nd-prompt.speaking { background: #eaf2fb; box-shadow: inset 3px 0 0 var(--blue); }
.nd-speaker { margin-left: 6px; font-size: 0.95em; opacity: 0.75; white-space: nowrap; }
.nd-prompt.speaking .nd-speaker { opacity: 1; }


.nd-tenframe { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.nd-tf-step { font-weight: 700; font-size: 0.92rem; color: var(--blue-dark); }
.nd-tf-grid .nd-cell.filled { background: radial-gradient(circle, var(--blue) 0 55%, #fff 58%); }
.nd-tf-grid .nd-cell.added { background: radial-gradient(circle, #f08a24 0 55%, #fff 58%); }
.nd-tf-grid .nd-cell.struck {
    background:
        linear-gradient(135deg, transparent 0 44%, var(--red) 44% 56%, transparent 56%),
        radial-gradient(circle, rgba(47, 111, 179, 0.45) 0 55%, #fff 58%);
}
.nd-tenframe.done .nd-cell { cursor: default; }
.nd-tf-again { font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--muted); background: none; border: none; padding: 2px 0; text-decoration: underline; cursor: pointer; }
.nd-tenframe.done .nd-tf-again { display: none; }


.nd-build { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.nd-build-row { display: flex; gap: 4px; align-items: flex-end; }
.nd-block {
    padding: 0; cursor: pointer; touch-action: manipulation; border: 2px solid #b8bfcc; border-radius: 3px;
    background-color: #eef0f4; transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.nd-block.flat {
    flex: 1 1 0; max-width: 44px; aspect-ratio: 1;
    background-image: repeating-linear-gradient(90deg, transparent 0 9%, rgba(31, 36, 48, 0.12) 9% 10%), repeating-linear-gradient(0deg, transparent 0 9%, rgba(31, 36, 48, 0.12) 9% 10%);
}
.nd-block.rod { flex: 0 0 22px; height: 110px; background-image: repeating-linear-gradient(0deg, transparent 0 9%, rgba(31, 36, 48, 0.15) 9% 10%); }
.nd-block.unit { flex: 0 0 22px; height: 22px; }
.nd-block.lit { border-color: var(--ink); transform: translateY(-2px); }
.nd-block.flat.lit { background-color: #5b9be0; box-shadow: 0 0 10px rgba(91, 155, 224, 0.8); }
.nd-block.rod.lit { background-color: var(--yellow); box-shadow: 0 0 10px rgba(246, 196, 69, 0.9); }
.nd-block.unit.lit { background-color: var(--green); box-shadow: 0 0 10px rgba(46, 158, 91, 0.8); }
.nd-block:disabled { cursor: default; }
.nd-build-sum { text-align: left; color: var(--ink); }


.nd-done { margin-top: 12px; padding: 14px; border-radius: 14px; background: #fff8dc; border: 2px solid var(--yellow); text-align: center; }
.nd-done-text { font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; }
.nd-done-row, .nd-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.nd-btn.primary { background: var(--blue); color: #fff; }
.nd-tools { margin-top: 18px; }
.nd-foot { font-size: 0.8rem; color: var(--muted); text-align: center; margin: 12px 0 0; }


.nd-print { display: none; font-family: "Andika", Georgia, "Times New Roman", serif; }
@media print {
    @page { margin: 14mm; }
    html, body, body.printing { background: #fff !important; color: #000; }
    body::before, body::after { display: none !important; }
    body.printing .nd-top, body.printing .nd-main { display: none; }
    body.printing .nd-print { display: block; }
}

.pr-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 6px; flex-wrap: wrap; }
.pr-brand { font-size: 20pt; font-weight: 700; }
.pr-meta { font-size: 10pt; }
.pr-name { margin-left: auto; font-size: 11pt; }
.pr-number-wrap { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; }
.pr-number-label { font-size: 12pt; font-style: italic; }
.pr-number { font-size: 26pt; font-weight: 700; min-width: 2.2in; border: 2px solid #000; border-radius: 50%; padding: 6px 18px; text-align: center; min-height: 0.6in; }
.pr-tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pr-task { border: 1px solid #000; border-radius: 6px; padding: 6px 8px; break-inside: avoid; min-height: 0.95in; }
.pr-title { font-weight: 700; font-size: 10.5pt; }
.pr-prompt { font-size: 10pt; margin: 2px 0 6px; }
.pr-options, .pr-line { font-size: 10pt; }
.pr-answer { border-bottom: 1px solid #000; height: 0.45in; }
.pr-answer.tall { height: 1.4in; border: 1px solid #000; font-size: 9pt; padding: 3px; }
.pr-frame { display: grid; gap: 2px; }
.pr-frame.cells-10 { grid-template-columns: repeat(5, 0.28in); }
.pr-frame.cells-20 { grid-template-columns: repeat(10, 0.22in); }
.pr-frame.cells-100 { grid-template-columns: repeat(10, 0.16in); }
.pr-frame span { display: block; aspect-ratio: 1; border: 1px solid #000; }
.pr-grid { display: grid; gap: 1px; grid-template-columns: repeat(10, 0.15in); }
.pr-grid.parts-10 { grid-template-columns: repeat(10, 0.15in); }
.pr-grid span { display: block; border: 1px solid #000; }
.pr-grid.parts-10 span { height: 0.5in; }
.pr-grid.parts-100 span { aspect-ratio: 1; }


.nd-explore-tabs { display: flex; gap: 6px; margin: 8px 0 10px; flex-wrap: wrap; }
.nd-tab {
    font: inherit; font-weight: 800; font-size: 0.85rem; padding: 8px 12px; cursor: pointer; touch-action: manipulation;
    border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.nd-tab.on { background: var(--blue); border-color: var(--blue-dark); color: #fff; }


.nd-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nd-pick-lead { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.nd-pick {
    font: inherit; display: grid; justify-items: center; gap: 1px; padding: 5px 8px; cursor: pointer; touch-action: manipulation;
    border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.nd-pick.on { border-color: var(--blue); background: #eaf2fb; }
.nd-pick-digit { font-size: 1.4rem; font-weight: 900; line-height: 1; }
.nd-pick-place { font-size: 0.52rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.nd-worth { margin: 10px 0 6px; font-size: 1rem; }
.nd-worth-big { color: var(--blue-dark); font-size: 1.25rem; }
.nd-ladder { display: grid; gap: 6px; margin-top: 8px; }
.nd-rung-row { display: grid; grid-template-columns: 11em 1fr; align-items: center; gap: 10px; }
.nd-rung-boxes { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.nd-rung { height: 22px; border: 2px solid var(--line); border-radius: 4px; background: #fff; }
.nd-rung.on { background: var(--yellow); border-color: #d9a520; }
.nd-rung.under { background: #dce8f6; border-color: #a8c6e8; }
.nd-rung-label { font-size: 0.78rem; font-weight: 700; line-height: 1.2; }
@media (max-width: 460px) {
    .nd-rung-row { grid-template-columns: 1fr; gap: 3px; }
    .nd-rung { height: 18px; }
}
.nd-ladder-note, .nd-far { font-size: 0.86rem; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }
.nd-far { color: var(--ink); background: #f3f7fc; border-left: 4px solid var(--blue); border-radius: 0 8px 8px 0; padding: 8px 10px; margin-top: 10px; }


.nd-pieces-bar { display: grid; gap: 8px; }
.nd-cuts .nd-choice { display: grid; gap: 1px; text-align: left; font-size: 0.92rem; }
.nd-cuts .nd-choice small { font-weight: 500; font-size: 0.68rem; color: var(--muted); }
.nd-slide-row { display: flex; align-items: center; gap: 10px; }
.nd-slider { flex: 1; accent-color: var(--blue); height: 26px; }
.nd-pieces-value { font-weight: 900; font-size: 1.3rem; color: var(--blue-dark); min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }
.nd-pieces-stage { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 10px 0 8px; }
.nd-whole { width: 100%; max-width: 260px; height: auto; }
.nd-whole-bg { fill: #fff; }
.nd-whole-edge { fill: none; stroke: var(--ink); stroke-width: 3; }
.nd-fill-t { fill: #2f6fb3; }
.nd-fill-h { fill: #f6c445; }
.nd-fill-th { fill: #2e9e5b; }
.nd-cut-t { stroke: var(--ink); stroke-width: 1.6; }
.nd-cut-h { stroke: var(--ink); stroke-width: 0.8; opacity: 0.55; }
.nd-cut-th { stroke: var(--ink); stroke-width: 0.35; opacity: 0.28; }
.nd-cat { width: 92px; height: auto; }
.nd-cat-body { fill: #ece5d6; }
.nd-cat-fill { fill: #2f6fb3; opacity: 0.85; }
.nd-cat-edge { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.nd-cat-label { font-size: 8px; font-weight: 700; fill: var(--muted); font-family: inherit; }
.nd-pieces-sum { font-size: 0.98rem; margin-bottom: 10px; }
.nd-pieces-sum .p-t { color: #2f6fb3; }
.nd-pieces-sum .p-h { color: #b98c05; }
.nd-pieces-sum .p-th { color: #2e9e5b; }
.nd-compare { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.nd-compare-one { flex: 1 1 180px; }
.nd-compare-head { font-weight: 900; font-size: 1.2rem; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.nd-compare-note { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.nd-compare-verdict { flex: 1 1 100%; font-size: 0.92rem; background: #fff8dc; border: 2px solid var(--yellow); border-radius: 10px; padding: 9px 11px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
    .nd-tile.landing, .nd-tile.calling { animation: none; }
}


body {
    font-family: var(--round);
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(255, 111, 174, 0.16), transparent 60%),
        radial-gradient(800px 600px at -10% 110%, rgba(91, 78, 230, 0.14), transparent 60%),
        radial-gradient(circle, rgba(91, 78, 230, 0.10) 1.2px, transparent 1.4px) 0 0 / 22px 22px,
        var(--paper);
    background-attachment: fixed;
}
.nd-top {
    background: linear-gradient(125deg, #4f3fd9 0%, #7a3fe0 55%, #d9459a 100%);
    border-radius: 0 0 28px 28px;
    padding-bottom: 20px;
    box-shadow: 0 10px 30px rgba(79, 63, 217, 0.35);
    overflow: hidden;
}

.nd-top::after {
    content: "7 3 + 9 = 1 2 8 \00D7 4 5 \00F7 6";
    position: absolute; left: -10%; right: -10%; bottom: -18px;
    font: 900 4.4rem/1 var(--round); letter-spacing: 0.25em; white-space: nowrap;
    color: rgba(255, 255, 255, 0.07); pointer-events: none;
}
.nd-top h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); font-weight: 900; letter-spacing: 0.01em; text-shadow: 0 3px 0 rgba(30, 20, 110, 0.35); }
.nd-top h1 span { color: var(--yellow); font-style: italic; font-weight: 800; opacity: 1; }
.nd-date { font-weight: 700; opacity: 0.92; }
.nd-back, .nd-music { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); }

.nd-main { padding-top: 18px; }
.nd-label { color: var(--blue); letter-spacing: 0.2em; }
.nd-panel { border: none; border-radius: 20px; box-shadow: var(--shadow); padding: 14px 16px; }
.nd-grade {
    border: none; border-radius: 12px; background: #f1eeff; color: var(--blue-dark);
    box-shadow: inset 0 -3px 0 rgba(58, 44, 158, 0.12); transition: transform 0.12s, background 0.15s;
}
.nd-grade:hover { background: #e7e2ff; }
.nd-grade:active { transform: translateY(2px); }
.nd-grade.on { background: linear-gradient(180deg, #ffd766, #ffb81f); color: #4a3200; box-shadow: inset 0 -3px 0 rgba(150, 90, 0, 0.35), 0 4px 12px rgba(255, 184, 31, 0.45); }


.nd-hero {
    border: 3px solid transparent; border-radius: 26px; padding: 18px 12px 16px;
    background: linear-gradient(#fff, #fff) padding-box, linear-gradient(125deg, #5b4ee6, #b04ee0, #ff6fae) border-box;
    box-shadow: 0 14px 36px rgba(91, 78, 230, 0.18);
}
.nd-tile {
    border: none; border-radius: 14px;
    background: linear-gradient(180deg, #6a5cf0 0%, #3a2c9e 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 6px 14px rgba(58, 44, 158, 0.35);
}
.nd-tile::after {   
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.25);
}
.nd-tile.sep::after { display: none; }
.nd-tile-face { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.nd-tile-place { color: #d9d3ff; }
.nd-tile.calling { background: linear-gradient(180deg, #ffe07a, #ffb81f); }
.nd-chant { color: var(--blue-dark); font-weight: 900; }
.nd-progress-track { height: 12px; background: #ece8ff; box-shadow: inset 0 1px 2px rgba(58, 44, 158, 0.15); }
.nd-progress-bar { background: linear-gradient(90deg, #1fb57a, #3fd6b0, #5bc8ff); border-radius: 999px; }
.nd-progress { color: var(--blue-dark); }


.nd-check, .nd-btn {
    border: none; border-radius: 14px; padding: 10px 18px; font-weight: 900;
    background: #fff; color: var(--blue-dark);
    box-shadow: inset 0 0 0 2px #dcd5ff, 0 4px 0 #cfc6ff, 0 8px 16px rgba(58, 44, 158, 0.12);
    transition: transform 0.1s, box-shadow 0.1s;
}
.nd-check:active, .nd-btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px #dcd5ff, 0 1px 0 #cfc6ff; }
.nd-check, .nd-btn.primary {
    background: linear-gradient(180deg, #7163f5, #4f3fd9); color: #fff;
    box-shadow: 0 4px 0 #2f2396, 0 8px 18px rgba(79, 63, 217, 0.35);
}
.nd-check:active, .nd-btn.primary:active { box-shadow: 0 1px 0 #2f2396; }
.nd-check:disabled { box-shadow: none; }


.nd-tasks { gap: 14px; }
.nd-card {
    border: none; border-radius: 20px; padding: 16px 16px 16px; box-shadow: var(--shadow);
    position: relative; overflow: hidden; transition: box-shadow 0.2s, background 0.2s;
}
.nd-card::before {   
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
    background: linear-gradient(90deg, #5b4ee6, #b04ee0, #ff6fae);
}
.nd-card.ok { background: linear-gradient(180deg, #effcf6, #fff 60%); box-shadow: 0 0 0 2px rgba(31, 181, 122, 0.45), var(--shadow); }
.nd-card.ok::before { background: linear-gradient(90deg, #1fb57a, #5bd6a4); }
.nd-card.no { box-shadow: 0 0 0 2px rgba(239, 91, 107, 0.45), var(--shadow); }
.nd-card.no::before { background: linear-gradient(90deg, #ef5b6b, #ff9a6b); }
.nd-card.pop { animation: ndPopBig 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes ndPopBig { 0% { transform: scale(1); } 35% { transform: scale(1.035) rotate(-0.4deg); } 100% { transform: none; } }
.nd-card-num {
    width: 30px; height: 30px; font-size: 0.9rem;
    background: linear-gradient(135deg, #7163f5, #b04ee0); box-shadow: 0 3px 8px rgba(91, 78, 230, 0.35);
}
.nd-card.ok .nd-card-num { background: linear-gradient(135deg, #1fb57a, #3fd6b0); }
.nd-card.no .nd-card-num { background: linear-gradient(135deg, #ef5b6b, #ff9a6b); }
.nd-card-title { font-size: 1.05rem; font-weight: 900; color: var(--blue-dark); }
.nd-card-mark { font-size: 1.5rem; }
.nd-card.ok .nd-card-mark { animation: ndMark 0.5s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes ndMark { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: none; } }
.nd-prompt { font-size: 1.06rem; }

.nd-input { border: 2px solid #e1dbfb; border-radius: 12px; background: #faf9ff; transition: border-color 0.15s, box-shadow 0.15s; }
.nd-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(91, 78, 230, 0.18); background: #fff; }
.nd-field { color: var(--blue); letter-spacing: 0.02em; }
.nd-choice { border: 2px solid #e1dbfb; border-radius: 12px; box-shadow: 0 3px 0 #e1dbfb; transition: transform 0.1s, box-shadow 0.1s; }
.nd-choice:active { transform: translateY(2px); box-shadow: 0 1px 0 #e1dbfb; }
.nd-choice.picked { border-color: var(--blue); background: #f0edff; box-shadow: 0 3px 0 var(--blue); }
.nd-tab { border: none; background: #f1eeff; color: var(--blue-dark); }
.nd-tab.on { background: linear-gradient(180deg, #7163f5, #4f3fd9); color: #fff; box-shadow: 0 3px 10px rgba(79, 63, 217, 0.35); }
.nd-done { border: none; border-radius: 22px; background: linear-gradient(135deg, #fff6d6, #ffe7f2); box-shadow: 0 10px 28px rgba(255, 184, 31, 0.25); }
.nd-done-text { color: var(--blue-dark); font-size: 1.15rem; }


body.nd-at-start { overflow: hidden; }
.nd-start {
    position: fixed; inset: 0; z-index: 60; overflow: hidden;
    display: flex; flex-direction: column;
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
    background: radial-gradient(120% 80% at 50% 0%, #7a4df0 0%, #4b2fc4 45%, #2a1a7a 100%);
    color: #fff; font-family: var(--round);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.nd-start.leaving { opacity: 0; transform: scale(1.06); pointer-events: none; }
.nd-start-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.nd-sky-num {
    position: absolute; bottom: -3rem; font-weight: 900; line-height: 1;
    color: hsl(var(--hue) 95% 72%); opacity: 0.35; text-shadow: 0 0 18px hsl(var(--hue) 95% 60% / 0.6);
    animation: ndSkyRise linear infinite;
}
@keyframes ndSkyRise {
    from { transform: translateY(0) rotate(-10deg); }
    to { transform: translateY(-115vh) rotate(14deg); }
}
.nd-start-top { position: relative; display: flex; }
.nd-start-back { color: #fff; }
.nd-start-body {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(18px, 4vh, 34px); text-align: center;
}
.nd-start-title {
    margin: 0; font-weight: 900; line-height: 0.95; letter-spacing: 0.01em;
    font-size: clamp(2.8rem, 13vw, 5.2rem);
    text-shadow: 0 5px 0 rgba(20, 10, 80, 0.45), 0 12px 30px rgba(0, 0, 0, 0.35);
    animation: ndTitleIn 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.nd-st-word { display: inline-block; color: #fff; }
.nd-st-of { display: block; font-size: 0.42em; font-style: italic; color: var(--yellow); margin: 0.12em 0; }
@keyframes ndTitleIn { from { opacity: 0; transform: translateY(-20px) scale(0.9); } to { opacity: 1; transform: none; } }

.nd-bob { display: flex; align-items: flex-end; justify-content: center; gap: 6px; max-width: min(620px, 100%); animation: ndBobIn 0.9s 0.25s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.nd-bob-face {
    width: clamp(120px, min(50vw, 27vh), 300px); height: auto; display: block; flex: none;   
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
    transform-origin: 50% 100%; animation: ndBobSway 3.2s ease-in-out infinite;
}
.nd-bob-bubble {
    position: relative; margin-bottom: clamp(40px, 14vw, 90px); background: #fff; color: var(--ink);
    border-radius: 20px; padding: 12px 16px; font-weight: 900; font-size: clamp(0.98rem, 4.2vw, 1.25rem); line-height: 1.3;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 -4px 0 #ece8ff; max-width: 250px; text-align: left;
}
.nd-bob-bubble::before {
    content: ""; position: absolute; left: -13px; bottom: 18px;
    border: 9px solid transparent; border-right: 14px solid #fff; border-left: 0;
}
@keyframes ndBobIn { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes ndBobSway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-4px); } }
.nd-enter {
    font: 900 clamp(1.2rem, 5.2vw, 1.6rem)/1 var(--round); letter-spacing: 0.02em;
    padding: 18px 40px; border: none; border-radius: 999px; cursor: pointer; touch-action: manipulation;
    color: #4a3200; background: linear-gradient(180deg, #ffe27a, #ffb81f);
    box-shadow: 0 6px 0 #c77f00, 0 14px 30px rgba(255, 184, 31, 0.5);
    animation: ndEnterIn 0.8s 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both, ndEnterPulse 2.2s 1.4s ease-in-out infinite;
}
.nd-enter:active { transform: translateY(4px); box-shadow: 0 2px 0 #c77f00; }
.nd-enter:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes ndEnterIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes ndEnterPulse {
    0%, 100% { box-shadow: 0 6px 0 #c77f00, 0 14px 30px rgba(255, 184, 31, 0.5); }
    50% { box-shadow: 0 6px 0 #c77f00, 0 14px 44px rgba(255, 200, 60, 0.85); }
}
@media (prefers-reduced-motion: reduce) {
    .nd-sky-num, .nd-bob-face, .nd-enter, .nd-start-title, .nd-bob, .nd-card.pop, .nd-card.ok .nd-card-mark { animation: none; }
}
body.display .nd-start, body.printing .nd-start { display: none; }
@media print { .nd-start { display: none; } }



.nd-help-btn {
    flex: none; width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer; touch-action: manipulation;
    font: 900 1rem/1 var(--round); color: #fff; background: linear-gradient(135deg, #ff8a3d, #ff5fa2);
    box-shadow: 0 3px 0 #c2410c, 0 4px 10px rgba(255, 95, 162, 0.35);
}
.nd-help-btn.on { background: linear-gradient(135deg, #7163f5, #4f3fd9); box-shadow: 0 3px 0 #2f2396; }
.nd-help-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.nd-help {
    margin: 2px 0 10px; padding: 12px 14px; border-radius: 14px; background: #fff;
    border: 2px solid #e1dbfb; box-shadow: 0 6px 16px rgba(58, 44, 158, 0.10);
}
.nd-help-title { font-weight: 900; font-size: 1.1rem; color: #d9480f; text-align: center; }
.nd-help-blurb { font-size: 0.86rem; color: var(--muted); text-align: center; margin: 2px 0 10px; }
.nd-help-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.nd-help-label { font-size: 0.78rem; font-weight: 800; color: var(--blue); min-width: 7.5em; }
.nd-help-label2 { color: #d9480f; }
.nd-help-std { font-weight: 900; font-size: 1.15rem; color: var(--blue-dark); letter-spacing: 0.03em; }
.nd-help-parts { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.nd-help-tile { padding: 3px 8px; border-radius: 6px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.nd-help-plus { font-weight: 900; color: var(--muted); }



.nd-build-row.cubes { display: grid; grid-template-columns: repeat(5, minmax(0, 64px)); gap: 6px; }
.nd-block.cube {
    width: 100%; aspect-ratio: 1; border: none; background: none; border-radius: 0; box-shadow: none;
    transition: transform 0.15s, filter 0.15s;
}
.nd-block.cube svg { display: block; width: 100%; height: 100%; }
.nd-block.cube .f-top { fill: #f4f5f8; }
.nd-block.cube .f-left { fill: #dde1e8; }
.nd-block.cube .f-right { fill: #c6ccd6; }
.nd-block.cube .f-grid { fill: none; stroke: rgba(31, 36, 48, 0.16); stroke-width: 0.6; }
.nd-block.cube .f-edge { fill: none; stroke: #9aa2b1; stroke-width: 2; stroke-linejoin: round; }
.nd-block.cube.lit { background: none; box-shadow: none; filter: drop-shadow(0 0 6px rgba(232, 121, 185, 0.85)); }
.nd-block.cube.lit .f-top { fill: #fbb7da; }
.nd-block.cube.lit .f-left { fill: #e879b9; }
.nd-block.cube.lit .f-right { fill: #c9559a; }
.nd-block.cube.lit .f-grid { stroke: rgba(80, 10, 50, 0.25); }
.nd-block.cube.lit .f-edge { stroke: #7a1f55; }


.nd-fields.cols { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 16px; }
.nd-fields.inline { flex-wrap: nowrap; align-items: center; gap: 8px; }
.nd-fields.inline .nd-field { flex-direction: row; align-items: center; gap: 8px; font-size: 1.5rem; font-weight: 900; color: var(--ink); }


.nd-ones { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.nd-ones-part { display: flex; flex-direction: column; gap: 4px; }
.nd-ones-label { font-weight: 800; font-size: 0.8rem; color: var(--muted); }
.nd-ones-grid { display: grid; grid-template-columns: repeat(10, 24px); gap: 3px; }
.nd-ones-grid .nd-block.unit { width: 24px; height: 24px; }
.nd-block.unit.nd-ones-extra { border-style: dashed; }
.nd-block.unit.nd-ones-extra.lit { background-color: #ff8a3d; border-style: solid; box-shadow: 0 0 10px rgba(255, 138, 61, 0.8); }
.nd-block.unit.struck { opacity: 0.45; background-image: linear-gradient(135deg, transparent 0 42%, var(--red) 42% 58%, transparent 58%); }


.nd-coins { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.nd-coin-row { display: flex; flex-wrap: wrap; gap: 5px; }
.nd-coin {
    border-radius: 50%; padding: 0; cursor: pointer; touch-action: manipulation; font: 900 0.62rem/1 var(--round);
    color: #7b8190; background: #eef0f4; border: 2px dashed #b8bfcc; opacity: 0.8;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.nd-coin.dime { width: 30px; height: 30px; }
.nd-coin.penny { width: 32px; height: 32px; }
.nd-coin.lit { opacity: 1; border-style: solid; transform: translateY(-2px); }
.nd-coin.dime.lit { color: #3a4150; background: radial-gradient(circle at 35% 30%, #ffffff, #c9ced6 55%, #9097a4); border-color: #7d8492; box-shadow: 0 0 8px rgba(160, 170, 190, 0.9); }
.nd-coin.penny.lit { color: #fff3e6; background: radial-gradient(circle at 35% 30%, #f2b27c, #c46a2c 55%, #8d4418); border-color: #7a3a14; box-shadow: 0 0 8px rgba(196, 106, 44, 0.8); }


.nd-tens { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.nd-tens-row { align-items: flex-end; flex-wrap: wrap; }
.nd-tens-units { display: grid; grid-template-columns: repeat(5, 22px); gap: 3px; margin-left: 8px; }
.nd-tens-units .nd-block.unit { display: block; }
.nd-tens-extra { background-color: #eef0f4; border-style: dashed; }
.nd-block.rod.nd-tens-extra.lit { background-color: #ff8a3d; border-style: solid; box-shadow: 0 0 10px rgba(255, 138, 61, 0.8); }
.nd-block.rod.struck {
    opacity: 0.45;
    background-image: linear-gradient(135deg, transparent 0 46%, var(--red) 46% 54%, transparent 54%);
}


.nd-hc { width: 100%; }
.nd-hc-open {
    display: inline-flex; align-items: center; gap: 8px; font: 800 0.88rem/1 var(--round); color: var(--blue-dark);
    padding: 8px 12px; border: none; border-radius: 12px; background: #f1eeff; cursor: pointer;
    box-shadow: inset 0 -3px 0 rgba(58, 44, 158, 0.12);
}
.nd-hc-open.on { background: #e2dcff; }
.nd-hc-icon {
    width: 18px; height: 18px; border-radius: 3px;
    background: repeating-linear-gradient(90deg, #7163f5 0 2px, transparent 2px 6px), repeating-linear-gradient(0deg, #7163f5 0 2px, #fff 2px 6px);
}
.nd-hc-panel { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.nd-hc-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; max-width: 420px; }
.nd-hc-cell {
    position: relative; aspect-ratio: 1; padding: 0; border: 1px solid #d9d3f5; border-radius: 4px; background: #fff;
    font: 800 clamp(0.62rem, 2.6vw, 0.8rem)/1 var(--round); color: var(--ink); cursor: pointer; touch-action: manipulation;
}
.nd-hc-cell.start { background: var(--yellow); border-color: #d9a520; }
.nd-hc-cell.counted { background: #5bd6a4; border-color: var(--green); color: #fff; }
.nd-hc-cell.counted::after {
    content: attr(data-step); position: absolute; top: -2px; right: 1px; font-size: 0.5rem; color: #06402a;
}


.warp-overlay { position: fixed; inset: 0; z-index: 1000; background: #04040c; opacity: 0; transition: opacity 0.25s ease; }
.warp-overlay.show { opacity: 1; }
.warp-overlay.landed { background: #ffffff; }
.warp-overlay canvas { display: block; width: 100%; height: 100%; }


.nd-confetti { position: fixed; inset: 0; z-index: 900; pointer-events: none; overflow: hidden; transition: opacity 0.6s ease; }
.nd-confetti.fade { opacity: 0; }
.nd-bit { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: ndConfetti linear forwards; }
.nd-bit.round { width: 11px; height: 11px; border-radius: 50%; }
@keyframes ndConfetti {
    0% { transform: translate(0, 0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--drift, 0), 110vh) rotate(var(--spin, 540deg)); opacity: 1; }
}



.nd-strike-hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.nd-strike-row { display: flex; align-items: stretch; gap: 6px; width: 100%; }
.nd-strike-row .nd-choice { flex: 1; min-width: 0; }
.nd-strike { flex: none; width: 44px; font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--muted); background: #fff; border: 2px solid #e1dbfb; border-radius: 12px; cursor: pointer; touch-action: manipulation; }
.nd-strike.on { color: #fff; background: var(--muted); border-color: var(--muted); }
.nd-choice.struck:not(.right) { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); opacity: 0.65; }
.nd-choices.spent .nd-strike, .nd-card:has(.nd-choices.spent) .nd-strike-hint { display: none; }
.nd-choice.tally { padding: 6px 10px; }
.nd-choice.tally svg { height: 40px; width: auto; display: block; color: var(--ink); }

.nd-sliver-cap { font-size: 0.8rem; color: var(--muted); margin: 10px 0 4px; font-weight: 700; }
.nd-slivers { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: min(100%, 260px); height: 56px; padding: 3px; border: 2px solid var(--blue-dark); border-radius: 4px; background: #fff; }
.nd-sliver { border: 1px solid var(--line); background: #fff; padding: 0; border-radius: 1px; cursor: pointer; touch-action: manipulation; }
.nd-sliver.on { background: var(--blue); border-color: var(--blue-dark); }

body.plain { background: #fff; }
body.plain .nd-top { background: #fff; color: var(--ink); border-bottom: 2px solid var(--line); box-shadow: none; }
body.plain .nd-top * { color: var(--ink); }
body.plain .nd-panel, body.plain .nd-card { box-shadow: none; }



.nd-prompt, .nd-choice, .nd-input, .nd-field span, .nd-count, .nd-order-tile, .nd-slot, .nd-checkbox span, .nd-help-std, .nd-help-tile, .nd-pv-chart td {
    font-family: "Andika", var(--round);
}
.nd-choice { display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.25; }
.nd-blurb.hidden { display: none; }

.nd-frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; margin: 0 0.12em; font-size: 0.86em; }
.nd-frac .nd-num { padding: 0 0.15em 0.08em; border-bottom: 0.1em solid currentColor; }
.nd-frac .nd-den { padding: 0.08em 0.15em 0; }

.nd-fields.plus { align-items: flex-start; gap: 6px; }
.nd-plus { font: 900 1.3rem/1 var(--round); color: var(--blue-dark); padding-top: 9px; }

.nd-fields.plus.beside { align-items: center; row-gap: 10px; }
.nd-fields.beside .nd-field { flex-direction: row; align-items: center; gap: 4px; font-size: 0.92rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.nd-fields.beside .nd-plus { padding-top: 0; }

.nd-choice.right { border-color: var(--green) !important; background: #e3f6ea !important; box-shadow: 0 3px 0 var(--green) !important; }
.nd-one-try { margin-top: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 700; }

.nd-errs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nd-errs .nd-plus { padding-top: 0; }
.nd-noerr { margin-left: 4px; background: #fff7e0; }

.nd-fracin { display: flex; align-items: center; gap: 10px; }
.nd-fracin .nd-input { width: 3.6em; text-align: center; font-size: 1.15rem; }
.nd-fracin .nd-input.whole { width: 4.6em; height: 3.2em; font-size: 1.3rem; }
.nd-fracstack { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nd-fracbar { width: 4.2em; height: 3px; border-radius: 2px; background: var(--ink); }

.nd-order { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.nd-order-pool, .nd-order-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nd-order-tile, .nd-slot { min-width: 4.6em; min-height: 2.5em; padding: 6px 8px; border-radius: 12px; font-weight: 800; font-size: 1rem; cursor: pointer; touch-action: manipulation; }
.nd-order-tile { border: 2px solid #e1dbfb; background: #fff; box-shadow: 0 3px 0 #e1dbfb; }
.nd-order-tile.used { visibility: hidden; }
.nd-slot { border: 2px dashed #b9b0ef; background: #f7f5ff; color: var(--ink); }
.nd-slot:empty::before { content: attr(data-i); color: #b9b0ef; }
.nd-order-arrow { font: 900 1.2rem/1 var(--round); color: var(--blue-dark); }
.nd-order-ends { display: flex; justify-content: space-between; max-width: 26em; font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.nd-pv-chart { border-collapse: collapse; margin-top: 8px; font-size: 1.05rem; }
.nd-pv-chart th, .nd-pv-chart td { border: 1px solid #d9d2fa; padding: 4px 6px; text-align: center; min-width: 1.6em; }
.nd-pv-chart th button { border: none; background: #f1eeff; border-radius: 6px; padding: 3px 5px; font: 800 0.62rem/1.1 var(--round); color: var(--blue-dark); cursor: pointer; max-width: 5.5em; }
.nd-pv-chart .nd-pv-dot { border-left: none; border-right: none; min-width: 0.6em; padding: 4px 1px; font-weight: 900; }
.nd-pv-chart .lit { background: #bfeccd; }
.nd-pv-chart th.lit button { background: #2fa84a; color: #fff; }

.nd-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-checkbox { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 2px solid #e1dbfb; border-radius: 12px; background: #fff; cursor: pointer; font-weight: 800; font-size: 1.1rem; }
.nd-checkbox input { width: 1.2em; height: 1.2em; accent-color: var(--blue); }
.nd-checkbox.bonus { border-color: #ffd23f; background: #fffbe8; }
.nd-bonus-cap, .nd-bonus-note { margin-top: 6px; font-size: 0.85rem; font-weight: 700; color: #a8790a; }

.nd-trace { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.nd-trace-pad { position: relative; width: 100%; border: 2px solid #e1dbfb; border-radius: 14px; background: #fff; overflow: hidden; }
.nd-trace-pad canvas { display: block; }
.nd-trace-pad .nd-trace-ink { position: absolute; top: 0; left: 0; touch-action: none; cursor: crosshair; }
.nd-trace-pad .nd-tf-again { position: absolute; right: 6px; bottom: 6px; }

.nd-scatter { width: 100%; max-width: 360px; touch-action: manipulation; }
.nd-scatter-dot { fill: #d7d2f7; stroke: #8b7fe0; stroke-width: 2; cursor: pointer; transition: fill 0.12s; }
.nd-scatter-dot.marked { fill: var(--blue); stroke: var(--blue-dark); }

.nd-piece.split { display: flex; gap: 1px; padding: 1px; background: #fff; border: 2px solid #ff8a3d; cursor: default; }
.nd-piece.split span { flex: 1; background: #fff; border-right: 1px solid #ffc49a; }
.nd-piece.split span:last-child { border-right: none; }
.nd-piece.split span.on { background: #ff8a3d; }

.nd-card.nd-bonus.hidden { display: none; }
.nd-card.bonus-in { animation: ndBonusIn 0.9s 2.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; box-shadow: 0 0 0 3px #ffd23f, var(--shadow); }
@keyframes ndBonusIn { from { opacity: 0; transform: scale(0.8) translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nd-card.bonus-in { animation: none; } }

.pr-options { white-space: pre-line; }

.pr-wide { grid-column: 1 / -1; }
.pr-eq { font-size: 13pt; font-weight: 700; }
.pr-box { display: inline-block; width: 0.82in; height: 0.36in; border: 1.5px solid #000; border-radius: 5px; vertical-align: middle; }
.pr-counters { display: grid; gap: 8px; }
.pr-counters.places-2 { grid-template-columns: repeat(2, 1fr); }
.pr-counters.places-3 { grid-template-columns: repeat(3, 1fr); }
.pr-counters.places-4 { grid-template-columns: repeat(4, 1fr); }
.pr-ct { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10pt; }
.pr-disc { display: flex; align-items: center; justify-content: center; width: 0.48in; height: 0.48in; border-radius: 50%; color: #fff; font-size: 9pt; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pr-disc.w1000 { background: #8a3fd8; }
.pr-disc.w100 { background: #e0702a; }
.pr-disc.w10 { background: #2f5fd8; }
.pr-disc.w1 { background: #2fa84a; }
.pr-ct-box { display: block; width: 100%; height: 1.35in; box-sizing: border-box; border: 2px dashed #555; border-radius: 8px; }
.pr-blocks { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: flex-start; }
.pr-block-row { display: flex; align-items: center; gap: 3px; }
.pr-block-row.cubes, .pr-block-row.flats { flex: 0 0 100%; }
.pr-block-row b { width: 0.8in; flex: none; font-size: 9.5pt; }
.pr-block-row.rods b, .pr-block-row.units b { width: auto; margin-right: 4px; }
.pr-block { display: block; flex: none; }
.pr-block svg { display: block; width: 100%; height: 100%; }
.pr-block path { fill: none; stroke: #333; stroke-width: 0.8; }
.pr-block.cube, .pr-block.flat { width: 0.64in; height: 0.64in; }
.pr-block.rod { width: 0.15in; height: 0.64in; }
.pr-block.unit { width: 0.15in; height: 0.15in; }
.pr-block.cube .f-top, .pr-block.cube .f-left, .pr-block.cube .f-right { fill: #fff; }
.pr-block.cube .f-grid { fill: none; stroke: #999; stroke-width: 0.5; }
.pr-block.cube .f-edge { fill: none; stroke: #333; stroke-width: 2; }
.pr-numline { margin-top: auto; }
.pr-numline svg { display: block; width: 100%; height: 0.5in; margin-top: 8px; }
.pr-numline path { fill: none; stroke: #000; stroke-width: 1.2; }
.pr-numline.ticks svg { height: auto; }
.pr-numline text { font-size: 9px; text-anchor: middle; fill: #000; }

.pr-tasks { display: block; }
.pr-grid, .pr-grid.parts-10 { grid-template-columns: repeat(10, 0.125in); }
.pr-grid.parts-10 span { height: 0.45in; }
.pr-page { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pr-page.first { gap: 14px; }
.pr-page:not(:last-child) { break-after: page; }
.pr-page.second { --pr2: 14pt; height: 9.3in; grid-auto-rows: auto; align-content: stretch; gap: 12px 14px; }   
.pr-page.dense { gap: 7px 14px; }
.pr-head { flex-wrap: nowrap; white-space: nowrap; }
.pr-brand { font-size: 17pt; }
.pr-name { font-size: 10pt; }
.pr-number-wrap { margin: 6px 0; }
.pr-number { font-size: 21pt; min-height: 0; padding: 3px 18px; }
.pr-number:empty { height: 0.45in; }   
.pr-page.dense .pr-grid { grid-template-columns: repeat(10, 0.095in); }
.pr-page.dense .pr-grid.parts-10 span { height: 0.34in; }
.pr-round-ans { display: flex; align-items: center; gap: 6px; font-size: 11pt; font-weight: 700; margin-top: 6px; }
.pr-round-ans .pr-box { width: 1.3in; }
.pr-task { display: flex; flex-direction: column; min-width: 0; }
.pr-page.second .pr-title { font-size: var(--pr2); }
.pr-page.second .pr-prompt, .pr-page.second .pr-options { font-size: var(--pr2); line-height: 1.3; }
.pr-page.second .pr-options.long { font-size: calc(var(--pr2) - 1.5pt); }   
.pr-page.second .pr-answer { height: 0.75in; flex: none; }   
.pr-page.second .pr-fields, .pr-page.second .pr-round-ans { font-size: var(--pr2); }
.pr-page.second .pr-eq { font-size: calc(var(--pr2) + 1pt); }
.pr-page.second .pr-eq.many { font-size: var(--pr2); }
.pr-page.second .pr-chart { font-size: calc(var(--pr2) - 2pt); }
.pr-page.second .pr-numline svg { overflow: visible; }
.pr-page.second .pr-numline text { font-size: 13px; }
.pr-order-nums { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pr-order-line { display: flex; align-items: flex-end; gap: 6px; margin-top: 0.14in; }
.pr-order-line i { flex: 1; height: 1.1em; border-bottom: 1.5px solid #000; }
.pr-answer { margin-top: auto; }
.pr-term { white-space: nowrap; }
.pr-eq { line-height: 1.5; }
.pr-eq.many { font-size: 12pt; }
.pr-eq.many .pr-box { width: 0.6in; }
.pr-fields { display: grid; grid-template-columns: 1fr; gap: 8px; font-size: 11pt; margin-top: auto; margin-bottom: auto; }
.pr-fields.two { grid-template-columns: 1fr 1fr; }
.pr-field { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.pr-field .pr-box { width: 1in; flex: none; }
.pr-chart { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
.pr-chart th, .pr-chart td { border: 1.5px solid #000; padding: 3px; text-align: center; font-weight: 700; }
.pr-chart td { height: 0.42in; }
.pr-model { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 3px; margin: 2px 0 6px; }
.pr-model > svg { max-width: 100%; max-height: 1.5in; }
.pr-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.pr-compare-side { min-width: 0; }
.pr-coins { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 8px; }
.pr-coins div { display: flex; flex-wrap: wrap; gap: 3px; }
.pr-coin { display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 7pt; font-weight: 700; border: 1.5px solid #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pr-coin.dime { width: 0.3in; height: 0.3in; background: #dfe2e8; }
.pr-coin.penny { width: 0.3in; height: 0.3in; background: #e0a06a; }
.pr-tallies { display: flex; flex-wrap: wrap; gap: 0.3in; margin-top: 6px; }
.pr-tally { display: inline-flex; align-items: center; gap: 6px; font-size: 13pt; }
.pr-tally svg { height: 0.5in; width: auto; max-width: none; margin: 0; color: #000; }
.pr-task .nd-scatter { display: block; height: 1.3in; width: auto; max-width: 100%; margin: 4px 0; }
.pr-task .nd-scatter-dot { fill: #fff; stroke: #000; stroke-width: 2; }
.pr-trace { font: 700 2.4rem/1.3 "Andika", sans-serif; color: transparent; -webkit-text-stroke: 1.5px #555; letter-spacing: 0.1em; }


.pr-burstbox { display: contents; }
.pr-art, .pr-head2 { display: none; }
.pr-task.c0 { --c: #e8453c; } .pr-task.c1 { --c: #e8782a; } .pr-task.c2 { --c: #b88a00; } .pr-task.c3 { --c: #2a9a44; }
.pr-task.c4 { --c: #12948a; } .pr-task.c5 { --c: #2f6fd8; } .pr-task.c6 { --c: #8a3fd8; } .pr-task.c7 { --c: #d6338a; }
.fun .pr-head { border-bottom: 4px solid #2f6fd8; border-image: linear-gradient(90deg, #e8453c, #f08a24, #ffd23f, #2fa84a, #2f6fd8, #8a3fd8, #d6338a) 1; align-items: center; }
.fun .pr-brand { font-size: 21pt; font-weight: 700; letter-spacing: 0.01em; }
.fun .pr-number-wrap { position: relative; align-items: center; margin: 2px 0 4px; }
.fun .pr-number-label { font-weight: 700; font-style: normal; font-size: 13pt; color: #2f6fd8; }
.fun .pr-burstbox { display: grid; place-items: center; position: relative; flex: none; width: 2.75in; height: 0.8in; }
#printBurst { display: contents; }
.fun .pr-burst { position: absolute; inset: 0; width: 100%; height: 100%; }
.fun .pr-number { position: relative; border: none; min-width: 0; padding: 0; font-size: 22pt; line-height: 1; background: none; }
.fun .pr-number:empty { height: auto; }
.fun .pr-art { display: block; flex: 1; min-width: 0; }
.fun .pr-art svg { display: block; width: 100%; height: 0.7in; }
.fun .pr-head2 { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-size: 10pt; padding-bottom: 5px; margin-bottom: 8px; border-bottom: 4px solid #2f6fd8; border-image: linear-gradient(90deg, #e8453c, #f08a24, #ffd23f, #2fa84a, #2f6fd8, #8a3fd8, #d6338a) 1; }
.fun .pr-head2 .pr-brand { font-size: 15pt; }
.fun .pr-head2 .pr-name { margin-left: auto; }
.fun .pr-task { border: 2.5px solid var(--c); border-radius: 14px; padding: 0 9px 7px; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fun .pr-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -9px 5px; padding: 3px 9px 3px 10px; background: var(--c); color: #fff; font-size: 11.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fun .pr-ico svg { display: block; width: 0.19in; height: 0.19in; }
.fun .pr-page.second { height: 9.15in; }   
.fun .pr-page.second .pr-title { padding-top: 2px; padding-bottom: 2px; }
.fun .pr-page.second .pr-ico svg { width: 1.3em; height: 1.3em; }
.fun .pr-order-line i { border-bottom: 2px solid var(--c); }
.fun .pr-page.first { gap: 8px 14px; }
.fun .pr-options { white-space: pre-wrap; }
.fun .pr-chart td { height: 0.36in; }
.fun .pr-page.first .pr-task { padding-bottom: 4px; }
.fun .pr-page.first .pr-box { height: 0.3in; }
.fun .pr-page.first .pr-title { padding-top: 2px; padding-bottom: 2px; }
.fun .pr-page.first .pr-prompt { margin-bottom: 4px; }
.fun .pr-box, .fun .pr-frame span, .fun .pr-grid span { border-color: var(--c); }
.fun .pr-box { border-radius: 8px; border-width: 2px; }
.fun .pr-answer { border-bottom: 2px solid var(--c); }
.fun .pr-answer.tall { border: 2px dashed var(--c); border-radius: 10px; }
.fun .pr-chart th { color: var(--c); }
.fun .pr-chart th, .fun .pr-chart td { border-color: var(--c); }
.fun .pr-numline path { stroke: var(--c); stroke-width: 1.6; }
.fun .pr-disc.w1000 + .pr-ct-box { border-color: #8a3fd8; }
.fun .pr-disc.w100 + .pr-ct-box { border-color: #e0702a; }
.fun .pr-disc.w10 + .pr-ct-box { border-color: #2f5fd8; }
.fun .pr-disc.w1 + .pr-ct-box { border-color: #2fa84a; }
.fun .pr-ct b { color: var(--c); }


.nd-fields.after { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), max-content)); gap: 8px 12px; }
.nd-fields.after .nd-field { flex-direction: row; align-items: center; gap: 5px; font-size: 0.92rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.nd-fields.after .nd-field .nd-input { width: 3.4em; }
.nd-fields.cols.after { grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), max-content)); }
.nd-tens-units .nd-block.unit.struck { opacity: 0.45; background-image: linear-gradient(135deg, transparent 0 42%, var(--red) 42% 58%, transparent 58%); }
.nd-tens-units .nd-block.unit.nd-tens-extra.lit { background-color: #ff8a3d; border-style: solid; box-shadow: 0 0 10px rgba(255, 138, 61, 0.8); }


.nd-bob.hidden { display: none; }

.nd-input.bad { background: #ffe3e6; border-color: #ef5b6b; }

.nd-help-btn.locked { background: #ef5b6b !important; opacity: 0.85; }
.nd-help-btn.unlocked { background: #1fb57a !important; box-shadow: 0 0 0 3px rgba(31, 181, 122, 0.3); }
.nd-try-first { margin-left: 6px; font-size: 0.72rem; font-weight: 800; color: #c0392b; transition: opacity 0.3s; }
.nd-try-first.gone { opacity: 0; }

.nd-rules { margin: 0 0 10px; padding-left: 1.1em; font: 700 0.95rem/1.45 "Andika", var(--round); color: var(--ink); }

.nd-pv-chart td.nd-pv-empty { cursor: pointer; background: #fbfaff; }
.nd-pv-chart td.zero { color: #ff6a1a; font-weight: 900; }
.nd-pv-chart .nd-pv-strike { border: none; padding: 2px; min-width: 0; }
.nd-pv-chart .nd-pv-strike button { border: none; border-radius: 6px; background: #f1eeff; color: #8a7fd6; font-weight: 900; cursor: pointer; padding: 3px 6px; }
.nd-pv-chart tr.struck td:not(.nd-pv-strike) { color: #9c95bd; background: linear-gradient(transparent calc(50% - 1.5px), #1e1b3a calc(50% - 1.5px), #1e1b3a calc(50% + 1.5px), transparent calc(50% + 1.5px)), #f4f2fa; }
.nd-pv-chart .nd-pv-strike button.ranked { background: #5b4ee6; color: #fff; }
.nd-pv-chart tr.struck .nd-pv-strike button { background: #8a7fd6; color: #fff; }

.nd-arethere-fix { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; font-weight: 800; }
.nd-arethere-fix.hidden { display: none; }
.nd-arethere-fix .nd-input { width: 4em; text-align: center; }

.nd-way { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed #e1dbfb; }
.nd-way-eq .nd-input { width: 3.2em; text-align: center; font-size: 1.2rem; }
.nd-way-n { font: 900 1.3rem/1 var(--round); color: var(--ink); }
.nd-tf-grid .nd-cell.struck { background: radial-gradient(circle, var(--blue) 0 55%, #fff 58%); position: relative; }
.nd-tf-grid .nd-cell.struck::after { content: ''; position: absolute; inset: 20% 0; background: linear-gradient(135deg, transparent 44%, var(--red) 44% 56%, transparent 56%); }

.nd-units-pair { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.nd-units-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nd-units-grid { display: grid; grid-template-columns: repeat(10, 13px); gap: 2px; }
.nd-units-grid .nd-block.unit { width: 13px; height: 13px; padding: 0; border-width: 1.5px; }

.nd-pv-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nd-pv-chart { font-size: 0.98rem; }
.nd-pv-chart th, .nd-pv-chart td { padding: 3px 2px; min-width: 1.35em; }
.nd-pv-chart th button { font-size: 0.5rem; padding: 3px 2px; max-width: 4.6em; white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: manual; line-height: 1.05; }



.nd-streak { position: fixed; left: 50%; top: 18%; z-index: 60; transform: translateX(-50%); padding: 12px 22px; border-radius: 999px;
    font: 900 1.3rem/1 var(--round); color: #fff; background: linear-gradient(90deg, #ff7a3d, #ff3f7f); box-shadow: 0 10px 26px rgba(255, 90, 90, 0.45);
    white-space: nowrap; pointer-events: none; animation: ndStreak 2.2s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.nd-streak.big { background: linear-gradient(90deg, #5b4ee6, #ff3f9f); font-size: 1.45rem; }
@keyframes ndStreak { 0% { opacity: 0; transform: translateX(-50%) scale(0.5); } 15% { opacity: 1; transform: translateX(-50%) scale(1.08); } 25% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
.nd-star { position: absolute; left: 50%; top: 50%; font-size: 1.4rem; animation: ndStar 1.2s ease-out forwards; }
@keyframes ndStar { from { transform: translate(-50%, -50%) scale(0.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(180deg); opacity: 0; } }

.nd-won { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px 14px; border-radius: 16px; background: #fff7d6; box-shadow: inset 0 0 0 2px #ffd23f; }
.nd-won.pop { animation: ndWon 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes ndWon { from { opacity: 0; transform: scale(0.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
.nd-won-icon { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.2)); }
.nd-won-text { font: 800 1rem/1.3 var(--round); color: #6a4a00; }
.nd-book { position: fixed; inset: 0; z-index: 70; background: rgba(20, 12, 50, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.nd-book-card { background: #fff; border-radius: 22px; padding: 18px; width: min(520px, 100%); max-height: 86vh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); text-align: center; }
.nd-book-title { font: 900 1.4rem/1.2 var(--round); color: var(--blue-dark); }
.nd-book-sub { margin: 4px 0 12px; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.nd-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-bottom: 14px; }
.nd-book-sticker { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: #f7f4ff; box-shadow: inset 0 0 0 2px #e6e0ff; }
.nd-book-icon { font-size: 2.2rem; line-height: 1.1; }
.nd-book-num { font: 900 0.95rem/1.1 "Andika", var(--round); color: var(--ink); }
.nd-book-when { font-size: 0.7rem; font-weight: 700; color: var(--muted); }

.nd-welcome-grade { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity 0.5s; }
.nd-welcome-grade.gone { opacity: 0; }
.nd-wg-card { padding: 22px 30px; border-radius: 26px; text-align: center; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); animation: ndWg 0.8s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.nd-wg-up { font: 900 1rem/1 var(--round); letter-spacing: 0.08em; opacity: 0.9; }
.nd-wg-name { margin-top: 8px; font: 900 clamp(1.6rem, 7vw, 2.6rem)/1.1 var(--round); }
@keyframes ndWg { from { opacity: 0; transform: scale(0.5) translateY(30px); } to { opacity: 1; transform: none; } }

.nd-countdown { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(20, 12, 60, 0.85); }
.nd-cd-num { font: 900 clamp(8rem, 40vw, 22rem)/1 var(--round); color: #ffd23f; text-shadow: 0 10px 0 rgba(0, 0, 0, 0.25), 0 0 40px rgba(255, 210, 63, 0.6); animation: ndCd 0.9s ease-out both; }
@keyframes ndCd { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(0.7); opacity: 0; } }
#numberBoard.waiting { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .nd-streak, .nd-won.pop, .nd-wg-card, .nd-cd-num { animation: none; } }



.nd-frame.cells-20 { grid-template-columns: repeat(5, minmax(0, 30px)) 12px repeat(5, minmax(0, 30px)); }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 6) { margin-left: 0; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 1) { grid-column: 1; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 2) { grid-column: 2; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 3) { grid-column: 3; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 4) { grid-column: 4; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 5) { grid-column: 5; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 6) { grid-column: 7; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 7) { grid-column: 8; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 8) { grid-column: 9; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 9) { grid-column: 10; }
.nd-frame.cells-20 .nd-cell:nth-child(10n + 10) { grid-column: 11; }

.nd-fields.after, .nd-fields.cols.after { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.nd-fields.after .nd-field { flex: 1 0 calc(50% - 11px); min-width: max-content; }

.nd-help-row.rule { display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; gap: 8px; margin-top: 7px; text-align: left; }
.nd-help-row.rule .nd-help-label { min-width: 0; font-size: 1rem; font-weight: 900; text-align: right; }
.nd-help-row.rule .nd-help-std { font-size: 0.92rem; font-weight: 700; letter-spacing: 0; line-height: 1.35; color: var(--ink); }

.nd-paper-btn {
    flex: none; width: 32px; height: 32px; padding: 2px; margin-left: 6px; border-radius: 9px; cursor: pointer;
    border: 2px solid #e1dbfb; background: #fff; color: var(--blue-dark); touch-action: manipulation;
}
.nd-paper-btn svg { width: 100%; height: 100%; display: block; }
.nd-paper-btn:hover, .nd-paper-btn.speaking { border-color: var(--blue); background: #f4f1ff; }
.nd-paper-note {
    margin: 2px 0 10px; padding: 8px 12px; border-radius: 12px; background: #fff7d6;
    border: 2px solid #ffd23f; font-weight: 800; color: #6a4a00;
}
.nd-paper-note.hidden { display: none; }
.nd-paper-note.pop { animation: ndWon 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.nd-work { display: none; }
@media print { .nd-paper-btn, .nd-paper-note { display: none !important; } }


.nd-grades .nd-label { text-align: center; }
.nd-grade-row { display: flex; justify-content: center; flex-wrap: wrap; }
.nd-grade-row .nd-grade { flex: 0 0 calc((100% - 40px) / 9); min-width: 44px; }

.nd-checkbox.none span { white-space: nowrap; }

.nd-board.longest .nd-tile { padding-left: 1px; padding-right: 1px; }
.nd-board.longest .nd-tile-place { font-size: clamp(0.3rem, 1.25vw, 0.46rem); letter-spacing: -0.02em; line-height: 1.05; white-space: normal; overflow-wrap: normal; word-break: keep-all; }

.nd-ones .nd-prompt.nd-ones-q { margin: 6px 0 4px; }
.nd-ones-part + .nd-ones-part { margin-top: 6px; }

.nd-complete { position: fixed; inset: 0; z-index: 72; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(20, 12, 50, 0.55); transition: opacity 0.3s; }
.nd-complete.gone { opacity: 0; }
.nd-complete-card { width: min(420px, 100%); max-height: 90vh; overflow: auto; padding: 22px 20px 18px; border-radius: 26px; text-align: center;
    background: #fff; box-shadow: 0 0 0 6px var(--blue), 0 24px 60px rgba(0, 0, 0, 0.4); animation: ndCompleteIn 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes ndCompleteIn { from { transform: scale(0.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.nd-complete-burst { font-size: 3.4rem; line-height: 1; }
.nd-complete-title { margin-top: 6px; font: 900 clamp(2rem, 9vw, 2.8rem)/1.05 var(--round); color: var(--blue-dark); }
.nd-complete-line { margin-top: 8px; font: 800 1.08rem/1.3 var(--round); color: #2b2750; }
.nd-complete-num { display: inline-block; margin-top: 12px; padding: 6px 18px; border-radius: 16px; color: #fff; font: 900 clamp(1.6rem, 8vw, 2.3rem)/1.1 var(--round);
    background: linear-gradient(135deg, var(--blue), var(--blue-dark)); }
.nd-complete-day { margin-top: 6px; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.nd-complete-sticker { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 14px; border-radius: 14px; background: #fff7d6; box-shadow: inset 0 0 0 2px #ffd23f; }
.nd-complete-icon { font-size: 2rem; line-height: 1; }
.nd-complete-name { font: 800 0.95rem/1.2 var(--round); color: #6a4a00; }
.nd-complete-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .nd-complete-card { animation: none; } }



.nd-tile:not(.sep) { flex: 1 1 0; min-width: 0; max-width: clamp(40px, 14vw, 64px); align-self: stretch; }
.nd-board.long .nd-tile:not(.sep) { flex: 1 1 0; min-width: 0; max-width: 48px; }
body.display .nd-tile:not(.sep) { max-width: 150px; min-width: 0; }
.nd-tile-place { white-space: normal; word-break: keep-all; text-align: center; line-height: 1.05; }

.nd-ones-answer { margin-top: 6px; }

.nd-field-given .nd-input { background: #eef0ff; color: var(--ink); font-weight: 900; border-style: solid; }
.nd-plus.nd-step { font-size: 0.95rem; color: var(--blue); }
.nd-fields.plus:has(.nd-step) { flex-wrap: nowrap; gap: 4px; }
.nd-fields.plus:has(.nd-step) .nd-field { flex: 1 1 0; min-width: 0; }
.nd-fields.plus:has(.nd-step) .nd-field .nd-input { width: 100%; box-sizing: border-box; min-width: 0; }
.nd-fields.plus:has(.nd-step) .nd-plus.nd-step { flex: none; }


.nd-compare-eq { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 12px; flex-wrap: wrap; flex-basis: 100%; width: 100%; }
.nd-compare-n { font-size: 1.5rem; font-weight: 800; color: var(--ink, #2b2560); font-variant-numeric: tabular-nums; }
.nd-compare-slot {
    display: inline-flex; align-items: center; justify-content: center; min-width: 58px; height: 58px;
    border: 3px dashed #b7acf2; border-radius: 14px; background: #f6f3ff; font-size: 1.8rem; font-weight: 800;
    color: var(--blue, #5b4ee6); transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.nd-compare-slot.over { background: #e9e3ff; border-color: var(--blue, #5b4ee6); transform: scale(1.1); }
.nd-compare-slot.filled { border-style: solid; }
.nd-compare-slot.good { border-color: #2fa86a; background: #e5f7ec; color: #1d7a4b; }
.nd-compare-slot.bad { border-color: #e2575a; background: #fdeaea; color: #b8383b; }
.nd-drag-row { justify-content: center; }
.nd-drag-row .nd-choice { cursor: grab; touch-action: none; }
.nd-drag-ghost {
    position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 8px 18px rgba(40, 30, 120, 0.3); opacity: 0.95; cursor: grabbing;
}
@media print { .nd-compare-eq { display: none; } }


.nd-dd { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.nd-dd-tray { display: flex; gap: 14px; justify-content: center; min-height: 64px; padding: 6px 14px; border-radius: 16px; background: linear-gradient(160deg, var(--blue), var(--blue-dark)); }
.nd-dd-chip {
    min-width: 64px; height: 56px; padding: 0 10px; border: none; border-radius: 12px; background: #fff; color: var(--blue-dark);
    font: inherit; font-size: 1.9rem; font-weight: 800; cursor: grab; box-shadow: 0 3px 0 rgba(0,0,0,0.18); font-variant-numeric: tabular-nums;
}
.nd-dd-chip.picked { outline: 4px solid var(--yellow); }
.nd-dd-chip.dragging { opacity: 0.35; }
.nd-dd-board, .nd-ct-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 420px; border: 2px dashed #b7acf2; border-radius: 14px; padding: 10px; box-sizing: border-box; }
.nd-dd-col, .nd-ct-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.nd-dd-label { font-size: 0.8rem; font-weight: 800; color: var(--blue-dark); background: #ece8ff; border-radius: 8px; padding: 3px 10px; text-align: center; }
.nd-dd-slot { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 70px; border: 3px dashed #b7acf2; border-radius: 12px; background: #f6f3ff; transition: transform 0.12s, background 0.12s; }
.nd-dd-slot.over, .nd-ct-area.over { background: #e9e3ff; border-color: var(--blue); transform: scale(1.04); }
.nd-dd-slot.bad { border-color: #e2575a; background: #fdeaea; }
.nd-card.ok .nd-dd-slot { border-style: solid; border-color: #2fa86a; background: #e5f7ec; }
.nd-dd-line { font-size: 1.6rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.nd-dd-line span { display: inline-block; min-width: 1.6em; text-align: center; border-bottom: 3px solid var(--blue); }
.nd-dd-line i { color: #b7acf2; font-style: normal; }
.nd-ct { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.nd-ct-src { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 420px; }
.nd-ct-srcbox { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.nd-ct-area { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 6px; width: 100%; min-height: 96px; padding: 6px; box-sizing: border-box; border: 3px dashed #b7acf2; border-radius: 12px; background: #f6f3ff; transition: transform 0.12s, background 0.12s; }
.nd-card.ok .nd-ct-area { border-style: solid; border-color: #2fa86a; background: #e5f7ec; }
.nd-ct-coin { width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(0,0,0,0.15); color: #fff; font: inherit; font-size: 1.2rem; font-weight: 800; cursor: grab; padding: 0; box-shadow: 0 3px 0 rgba(0,0,0,0.18); }
.nd-ct-coin.w10 { background: radial-gradient(circle at 35% 30%, #6fa8ff, #2f5fd8); }
.nd-ct-coin.w1 { background: radial-gradient(circle at 35% 30%, #7ee08f, #2fa84a); }
.nd-ct-area .nd-ct-coin { width: 40px; height: 40px; font-size: 0.95rem; }
.nd-ct-coin.dragging { opacity: 0.6; }
.nd-dd, .nd-ct { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nd-dd-tray:empty { display: none; }


.nd-dd-board.places-3, .nd-ct-board.places-3, .nd-ct-src.places-3 { grid-template-columns: repeat(3, 1fr); }
.nd-dd-board.places-4, .nd-ct-board.places-4, .nd-ct-src.places-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nd-dd-board.places-4 .nd-dd-label, .nd-ct-board.places-4 .nd-dd-label, .nd-ct-src.places-4 .nd-dd-label { font-size: 0.7rem; padding: 3px 4px; }
.nd-dd-slot .nd-dd-chip.placed { min-width: 0; max-width: 100%; font-size: clamp(1rem, 5.2vw, 1.9rem); padding: 0 6px; }
.nd-dd-board.places-4 .nd-dd-slot .nd-dd-chip.placed { font-size: clamp(0.8rem, 3.8vw, 1.5rem); }
.nd-ct-coin.w100 { background: radial-gradient(circle at 35% 30%, #ffb46a, #e0702a); }
.nd-ct-coin.w1000 { background: radial-gradient(circle at 35% 30%, #d49bff, #8a3fd8); font-size: 0.8rem; }
.nd-ct-board.places-3 .nd-ct-coin, .nd-ct-board.places-4 .nd-ct-coin { width: 34px; height: 34px; font-size: 0.75rem; }
.nd-ct-board .nd-ct-coin.w1000 { font-size: 0.55rem; }
.nd-dd-line { text-align: center; }
.nd-dd-col .nd-dd-label { min-height: 2.6em; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.nd-dd:has(.places-4) .nd-dd-line { font-size: clamp(1.05rem, 5.4vw, 1.6rem); white-space: nowrap; }
.nd-dd:has(.places-3) .nd-dd-line { font-size: clamp(1.2rem, 6vw, 1.6rem); white-space: nowrap; }
.nd-dd-line span { min-width: 1.2em; }
.nd-dd-board .nd-dd-col { justify-content: space-between; }
.nd-dd-slot .nd-dd-chip.placed { min-width: min(100%, 46px); }


.nd-dd-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; }
.nd-dd-in { width: 2.9em; padding: 0 2px 2px; border: 0; border-bottom: 3px solid var(--blue); border-radius: 0; background: transparent;
    font: inherit; font-size: 1.4rem; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; outline: none; }
.nd-dd-in:disabled { border-bottom-color: #cfc8f5; opacity: 1; }
.nd-dd-in:focus { background: #f1eeff; }
.nd-dd-in.ok { border-bottom-color: #2fa86a; color: #1f7a4c; }
.nd-dd-in.bad { border-bottom-color: #e2575a; background: #fdeaea; }
.nd-dd-board.places-4 ~ .nd-dd-line .nd-dd-in { width: 3.3em; font-size: 1.2rem; }


.nd-fields.nd-pv-chart { display: grid; grid-template-columns: repeat(var(--pv-cols), minmax(0, 1fr)); gap: 0; flex-wrap: nowrap;
    border: 2px solid #b7acf2; border-radius: 10px; overflow: hidden; background: #fff; }
.nd-pv-chart .nd-pv-col { gap: 0; min-width: 0; border-left: 1.5px solid #d9d2fb; position: relative; }
.nd-pv-chart .nd-pv-col:first-child { border-left: 0; }
.nd-pv-chart .nd-pv-col > span { display: flex; align-items: center; justify-content: center; width: 100%; height: 3.1em; padding: 2px 1px;
    box-sizing: border-box; font-size: clamp(0.44rem, 1.95vw, 0.72rem); line-height: 1.1; text-align: center; text-transform: capitalize;
    color: var(--ink); letter-spacing: -0.01em; overflow: hidden; border-bottom: 1.5px solid #d9d2fb; }
.nd-pv-chart .nd-pv-col input { width: 100%; min-width: 0; height: 3.2rem; border: 0; border-radius: 0; background: #fff; text-align: center;
    font-size: 1.5rem; font-weight: 800; padding: 0; box-sizing: border-box; }
.nd-pv-chart .nd-pv-col input.bad { background: #fdeaea; }
.nd-card.ok .nd-pv-chart .nd-pv-col input { background: #e5f7ec; }
.nd-pv-chart .pv-after-point { border-left: 3px solid var(--blue); }
.nd-pv-chart .pv-after-point::before { content: '.'; position: absolute; left: -0.32em; bottom: 0.15rem; font-size: 1.8rem; font-weight: 900; color: var(--blue); line-height: 1; }

.pv-thousands > span { background: #f1e3ff; }
.pv-hundreds > span { background: #ffe9d6; }
.pv-tens > span { background: #e1ecff; }
.pv-ones > span { background: #e0f6e4; }
.pv-tenths > span { background: #ffe0f0; }
.pv-hundredths > span { background: #dcf1fb; }
.pv-thousandths > span { background: #f8f0c8; }
.pv-tenthousands > span { background: #ffe1e1; }
.pv-hundredthousands > span { background: #d8f5f2; }
.pv-millions > span { background: #f6ead2; }


.nd-cas { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nd-cas-chart, .nd-cas-stack { display: grid; grid-template-columns: repeat(var(--cas-cols), minmax(0, 1fr)); }
.nd-cas-chart { border: 2px solid #b7acf2; border-radius: 10px; overflow: hidden; background: #fff; }
.nd-cas-head { grid-row: 1; display: flex; align-items: center; justify-content: center; height: 3.1em; padding: 2px 1px; box-sizing: border-box;
    font-size: clamp(0.44rem, 1.95vw, 0.72rem); line-height: 1.1; text-align: center; text-transform: capitalize; color: var(--ink);
    border-bottom: 1.5px solid #d9d2fb; border-left: 1.5px solid #d9d2fb; background: var(--cas-tint, #f1eeff); overflow: hidden; }
.nd-cas-digit { grid-row: 2; height: 3.2rem; border: 0; border-left: 1.5px solid #d9d2fb; background: #fff; font: 800 1.6rem/1 var(--round);
    color: var(--ink); cursor: grab; position: relative; padding: 0; }
.nd-cas-head:first-child, .nd-cas-digit[style*="grid-column: 1;"] { border-left: 0; }
.nd-cas-digit.zero { color: #b9b3d6; cursor: default; }
.nd-cas-digit.used { color: #b9b3d6; cursor: default; }
.nd-cas-digit.dragging { opacity: 0.35; }
.nd-cas-digit:not(.zero):not(.used) { box-shadow: inset 0 -4px 0 var(--cas-tint, #e9e3ff); }
.nd-cas-digit.nope { animation: ndCasNope 0.4s; }
@keyframes ndCasNope { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.nd-cas-chart .pv-after-point { border-left: 3px solid var(--blue); }
.nd-cas-digit.pv-after-point::before { content: '.'; position: absolute; left: -0.32em; bottom: 0.15rem; font-size: 1.8rem; font-weight: 900; color: var(--blue); line-height: 1; }
.nd-cas-stack { gap: 6px 0; min-height: 64px; padding: 8px 0; border: 3px dashed #b7acf2; border-radius: 12px; background: #f6f3ff; align-content: start; }
.nd-cas-stack.over { background: #e9e3ff; border-color: var(--blue); }
.nd-cas-hint { grid-column: 1 / -1; align-self: center; text-align: center; font-size: 0.85rem; font-weight: 700; color: #8a7fd6; padding: 10px 6px; }
.nd-cas-bar { display: grid; grid-template-columns: repeat(var(--cas-span, 1), minmax(0, 1fr)); align-items: center; height: 2.2rem; padding: 0; box-sizing: border-box; border-radius: 8px 0 0 8px;
    background: var(--cas-bar, #c9bdfc); color: var(--ink); font: 800 clamp(0.85rem, 3.6vw, 1.25rem)/1 var(--round); white-space: nowrap;
    overflow: hidden; animation: ndCasIn 0.35s ease-out; }
.nd-cas-bar.frac { border-radius: 8px; }
.nd-cas-cell { position: relative; text-align: center; font-size: clamp(1rem, 4.6vw, 1.5rem); }
.nd-cas-cell.pv-after-point::before { content: '.'; position: absolute; left: -0.18em; bottom: -0.1em; font-weight: 900; }
.nd-cas-cell.pv-comma::after { content: ','; position: absolute; right: -0.12em; bottom: 0.02em; font-weight: 900; }
@keyframes ndCasIn { from { transform: translateY(-14px); } }
.nd-card.ok .nd-cas-stack { border-style: solid; border-color: #2fa86a; background: #e5f7ec; }
.nd-cas-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; font-size: 1.25rem; }
.nd-cas-line .nd-dd-in { width: 5.2em; font-size: 1.05rem; }




.nd-tabs { position: sticky; top: 0; z-index: 50; display: none; gap: 6px; padding: 8px max(12px, calc((100% - 616px) / 2)); background: #fff; box-shadow: 0 3px 12px rgba(50, 30, 120, 0.18); }
.nd-mtab { flex: 1; padding: 11px 6px; border: none; border-radius: 13px; font: inherit; font-weight: 800; font-size: 1rem; color: var(--blue); background: #f1eeff; cursor: pointer; }
.nd-mtab.on { color: #fff; background: linear-gradient(135deg, #6d4df0, #4a3bd0); box-shadow: 0 3px 0 rgba(40, 20, 120, 0.3); }
.nd-games { display: none; max-width: 640px; margin: 0 auto; padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); box-sizing: border-box; }
body.nd-on-games .nd-games { display: flex; flex-direction: column; gap: 12px; }
body.nd-on-games .nd-main { display: none; }
body.display .nd-tabs, body.display .nd-games { display: none !important; }
@media print { .nd-tabs, .nd-games { display: none !important; } }
.nd-games-h { margin: 2px 2px 0; font-weight: 900; font-size: 1.3rem; color: #3b2fb5; }
.nd-game-today { display: flex; align-items: center; gap: 12px; padding: 13px; border: 2px solid #f6c445; border-radius: 18px; background: linear-gradient(135deg, #fff3c4, #ffe08a); font: inherit; text-align: left; cursor: pointer; }
.nd-gt-num { flex: none; padding: 9px 10px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 900; font-size: 1.25rem; }
.nd-gt-words { min-width: 0; }
.nd-gt-words b { display: block; font-size: 1.02rem; color: #3a2c00; }
.nd-gt-words small { font-size: 0.84rem; color: #6b5510; }
.nd-game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.nd-game-card { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 112px; padding: 14px 12px; border: none; border-radius: 18px; color: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14); }
.nd-game-grid.solo { grid-template-columns: 1fr; }
.nd-game-card i { font-style: normal; font-weight: 900; font-size: 2.1rem; line-height: 1; }
.nd-gc-words b { display: block; font-size: 1.02rem; line-height: 1.15; }
.nd-gc-words small { font-size: 0.76rem; font-weight: 600; opacity: 0.93; }
.nd-game-card.mul { background: linear-gradient(145deg, #a665f0, #7a35cf); }
.nd-game-card.add { background: linear-gradient(145deg, #5a93f5, #2f5fd8); }
.nd-game-card.div { background: linear-gradient(145deg, #f7a04f, #e0702a); }
.nd-game-card.mix { background: linear-gradient(145deg, #55c97a, #2a9e4c); }
.nd-game-list { display: flex; flex-direction: column; gap: 10px; }
.nd-game-row { padding: 14px; border: 2px solid #d9d2fb; border-radius: 16px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.nd-game-row b { display: block; font-size: 1.1rem; color: #3b2fb5; }
.nd-game-row span { font-size: 0.86rem; color: var(--muted); }
.nd-games > .nd-btn { align-self: center; }
.nd-round-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; color: #3b2fb5; }
.nd-round-q { padding: 26px 12px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-weight: 900; font-size: clamp(1.5rem, 8vw, 2.4rem); line-height: 1.2; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.nd-round-form { display: flex; gap: 8px; }
.nd-round-in { flex: 1; min-width: 0; font-size: 1.3rem; text-align: center; }
.nd-round-note { min-height: 1.4em; font-weight: 800; text-align: center; color: var(--muted); }
.nd-round-note.ok { color: #1f8f5f; }
.nd-round-note.bad { color: #c0392b; }


.nd-block.flat.lit { background-color: #f08a3a; border-color: #a8501a; box-shadow: 0 0 10px rgba(240, 138, 58, 0.8); }
.nd-block.rod.lit { background-color: #4a86e8; border-color: #1f4fa8; box-shadow: 0 0 10px rgba(74, 134, 232, 0.8); }
.nd-block.cube.lit { filter: drop-shadow(0 0 6px rgba(138, 63, 216, 0.75)); }
.nd-block.cube.lit .f-top { fill: #d9b8ff; }
.nd-block.cube.lit .f-left { fill: #a46ae8; }
.nd-block.cube.lit .f-right { fill: #7a3cc4; }
.nd-block.cube.lit .f-grid { stroke: rgba(40, 10, 80, 0.25); }
.nd-block.cube.lit .f-edge { stroke: #4b1d85; }

.nd-block.rod.nd-tens-extra.lit { background-color: #4a86e8; box-shadow: 0 0 0 3px #ffcf3f, 0 0 10px rgba(255, 207, 63, 0.9); }
.nd-tens-units .nd-block.unit.nd-tens-extra.lit, .nd-block.unit.nd-ones-extra.lit { background-color: var(--green); box-shadow: 0 0 0 3px #ffcf3f, 0 0 10px rgba(255, 207, 63, 0.9); }


.nd-ball {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2.3em; height: 2.3em; padding: 0 0.45em; box-sizing: border-box;
    border-radius: 999px; border: 2px solid rgba(0, 0, 0, 0.15); color: #fff; font: 800 0.7rem/1 var(--round); white-space: nowrap;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); background: var(--ball);
}
.nd-ball.long { font-size: 0.56rem; }
.nd-ball .nd-frac { font-size: 0.62rem; }
.nd-ball.p0 { --ball: radial-gradient(circle at 35% 30%, #7ee08f, #2fa84a); }
.nd-ball.p1 { --ball: radial-gradient(circle at 35% 30%, #6fa8ff, #2f5fd8); }
.nd-ball.p2 { --ball: radial-gradient(circle at 35% 30%, #ffb46a, #e0702a); }
.nd-ball.p3 { --ball: radial-gradient(circle at 35% 30%, #d49bff, #8a3fd8); }
.nd-ball.p4 { --ball: radial-gradient(circle at 35% 30%, #ff9a9a, #d03c3c); }
.nd-ball.p5 { --ball: radial-gradient(circle at 35% 30%, #6fe0d4, #12948a); }
.nd-ball.p6 { --ball: radial-gradient(circle at 35% 30%, #e8c27a, #9a6b1f); }
.nd-ball.pm1 { --ball: radial-gradient(circle at 35% 30%, #ff9ccf, #d6338a); }
.nd-ball.pm2 { --ball: radial-gradient(circle at 35% 30%, #8fd6f5, #2a8fc0); }
.nd-ball.pm3 { --ball: radial-gradient(circle at 35% 30%, #e6d06a, #a88400); }
table.nd-pv-chart.balls th { padding: 4px 2px; }
table.nd-pv-chart.balls th button.nd-ball, table.nd-pv-chart.balls th.lit button.nd-ball { max-width: none; height: 2.3em; min-width: 2.3em; padding: 0 0.4em; cursor: pointer; color: #fff; background: var(--ball); font-size: 0.62rem; line-height: 1; white-space: nowrap; }
table.nd-pv-chart.balls th button.nd-ball.long { font-size: 0.5rem; }
.nd-help .nd-pv-wrap { display: flex; justify-content: center; }
table.nd-pv-chart.balls th.lit { background: #fff3b0; }
table.nd-pv-chart.balls th.lit button.nd-ball { outline: 3px solid #ffcf3f; outline-offset: 1px; }
table.nd-pv-chart.balls td.lit { background: #fff3b0; }
table.nd-pv-chart.balls td.mark { background: #ffe08a; color: #7a3a00; font-weight: 900; box-shadow: inset 0 0 0 2px #ff9f1a; }
table.nd-pv-chart.balls td { font-size: 1.2rem; font-weight: 800; }
.nd-help-expr { text-align: center; font: 900 1.5rem/1.2 var(--round); color: var(--blue-dark); margin-top: 10px; letter-spacing: 0.04em; }


.nd-wt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; }
.nd-wt-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nd-wt-balls { display: flex; gap: 2px; min-height: 2.3em; align-items: center; }
.nd-wt-tile { font: 900 1.15rem/1 var(--round); color: var(--blue-dark); background: #fff; border: 2px solid #c9c0f5; border-radius: 10px; padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.nd-wt-tile span { font-size: 0.8rem; }
.nd-wt-tile.speaking { background: #fff3b0; border-color: #ffcf3f; }
.nd-wt-col.point .nd-wt-tile { border-style: dashed; font-size: 0.95rem; }


.nd-pairs { text-align: center; }
.nd-pairs-lab { font-weight: 800; color: var(--blue-dark); font-size: 0.9rem; margin-bottom: 8px; }
.nd-pairs-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 34px; }
.nd-pair-cube { width: 30px; height: 30px; padding: 0; border-radius: 5px; border: 2px solid #1f7a3a; background: var(--green); box-shadow: 0 2px 0 #1f7a3a; cursor: pointer; }
.nd-pair-cube.picked { outline: 3px solid #ffcf3f; outline-offset: 2px; transform: translateY(-3px); }
.nd-pair { display: inline-flex; gap: 3px; padding: 4px; border: 2px dashed #2fa84a; border-radius: 9px; background: #e5f7ec; }


.nd-rule-num { text-align: center; font: 900 2rem/1.2 var(--round); color: var(--ink); letter-spacing: 0.04em; margin-top: 4px; }
.nd-rule-num .lit { background: #ffe08a; color: #7a3a00; border-radius: 6px; box-shadow: inset 0 0 0 2px #ff9f1a; padding: 0 2px; }
.nd-seven { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border: 1.5px dashed #c9c0f5; border-radius: 12px; background: #fbfaff; }
.nd-seven-q { flex-basis: 100%; font-weight: 800; color: #8a6d00; font-size: 0.9rem; }
.nd-choice.small { padding: 6px 16px; font-size: 0.95rem; }
.nd-seven .nd-bonus-note { flex-basis: 100%; }


.nd-ct-total { min-width: 5em; margin: 4px auto 0; padding: 6px 18px; border: 2px solid #c9c0f5; border-radius: 14px; background: #fff; text-align: center;
    font: 900 2rem/1.1 var(--round); color: var(--blue-dark); font-variant-numeric: tabular-nums; }


.nd-line .nd-dot-tag rect { fill: #fff; stroke: var(--blue); stroke-width: 2.5; }
.nd-line .nd-dot-tag path { fill: var(--blue); }
.nd-line .nd-dot-tag text { font: 900 19px var(--round); fill: var(--blue-dark); }
.nd-line { cursor: pointer; touch-action: none; }
.nd-card.ok .nd-line .nd-dot-tag rect { stroke: var(--green); }
.nd-card.ok .nd-line .nd-dot-tag path { fill: var(--green); }


.nd-bw { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.nd-bw-grid { display: grid; grid-template-columns: 3.6rem repeat(var(--bw-cols), minmax(0, 1fr)); border: 2px solid #c9c0f5; border-radius: 12px; overflow: hidden; background: #fff; }
.nd-bw-grid.one { grid-template-columns: repeat(var(--bw-cols), minmax(0, 1fr)); flex: 1; }
.nd-bw-head { display: flex; justify-content: center; padding: 5px 2px; background: #f6f3ff; border-left: 1px solid #e3ddfb; }
.nd-bw-lab { display: flex; align-items: center; justify-content: flex-end; padding: 4px 6px; font: 900 0.82rem/1.1 var(--round); color: var(--blue-dark); border-top: 1px solid #e3ddfb; text-align: right; }
.nd-bw-cell { position: relative; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; min-height: 48px; padding: 4px 3px;
    border-top: 1px solid #e3ddfb; border-left: 1px solid #e3ddfb; transition: background 0.12s; }
.nd-bw-cell.ans { background: #fbfaff; }
.nd-bw.add .nd-bw-cell.ans { border-top: 2px solid #9d90ec; }
.nd-bw-cell.over { background: #e9e3ff; box-shadow: inset 0 0 0 2px var(--blue); }
.nd-bw-cell.take { background: #fff7f7; }
.nd-bw-b { display: inline-block; padding: 0; border: 1.5px solid rgba(0, 0, 0, 0.3); border-radius: 2px; box-sizing: border-box; flex: none; touch-action: none; }
button.nd-bw-b { cursor: pointer; }
.nd-bw-b.p0 { width: 10px; height: 10px; background: var(--green); }
.nd-bw-b.p1 { width: 7px; height: 40px; background: #4a86e8 repeating-linear-gradient(0deg, transparent 0 3.6px, rgba(0, 0, 0, 0.2) 3.6px 4px); }
.nd-bw-b.p2 { width: 24px; height: 24px; background-color: #f08a3a; background-image: repeating-linear-gradient(90deg, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 2.4px), repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 2.4px); }
.nd-bw-b.p3, .nd-bw-b.p4 { width: 26px; height: 26px; border: none; background: none; }
.nd-bw-b.p4 { width: 36px; height: 36px; }
.nd-bw-b.p3 svg, .nd-bw-b.p4 svg { display: block; width: 100%; height: 100%; }
.nd-bw-b.p3 .f-top { fill: #d9b8ff; } .nd-bw-b.p3 .f-left { fill: #a46ae8; } .nd-bw-b.p3 .f-right { fill: #7a3cc4; }
.nd-bw-b.p4 .f-top { fill: #c49be8; } .nd-bw-b.p4 .f-left { fill: #7d3fc0; } .nd-bw-b.p4 .f-right { fill: #55238f; }
.nd-bw-b .f-grid { fill: none; stroke: rgba(40, 10, 80, 0.25); stroke-width: 0.6; }
.nd-bw-b .f-edge { fill: none; stroke: #4b1d85; stroke-width: 2; stroke-linejoin: round; }
.nd-bw-b.carry { outline: 3px solid #ffcf3f; outline-offset: 2px; animation: ndBwCarry 1.1s ease-in-out infinite; }
@keyframes ndBwCarry { 50% { outline-color: #ff9f1a; outline-offset: 4px; } }   
.nd-bw-b.struck { opacity: 0.35; background-image: linear-gradient(135deg, transparent 0 40%, var(--red) 40% 60%, transparent 60%); }
.nd-bw-b.p3.struck, .nd-bw-b.p4.struck { background: linear-gradient(135deg, transparent 0 44%, var(--red) 44% 56%, transparent 56%); }
.nd-bw-b.ghost { opacity: 0.28; border-style: dashed; filter: grayscale(0.4); }
.nd-bw-b.ghost.gone { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--red); }
.nd-bw-b.dragging { opacity: 0.4; }
.nd-bw-b.nope, .nd-bw-trade.nope { animation: ndCasNope 0.4s; }
.nd-bw-trade { position: absolute; right: -11px; top: 50%; transform: translateY(-50%); z-index: 2; width: 22px; height: 22px; padding: 0; border-radius: 50%;
    border: 2px solid var(--blue); background: #fff; color: var(--blue-dark); font: 900 0.8rem/1 var(--round); cursor: pointer; }
.nd-bw-tools { display: flex; gap: 16px; justify-content: flex-end; }
.nd-bw .nd-tf-step:empty { display: none; }
.nd-card.ok .nd-bw-tools { display: none; }

.nd-tm-top { display: flex; gap: 8px; align-items: stretch; }
.nd-tm-src { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border: 2px dashed #9dbbf2; border-radius: 12px; background: #f2f7ff; }
.nd-tm-lab { font: 800 0.72rem/1.1 var(--round); color: #1f4fa8; text-align: center; }
.nd-tm-src .nd-bw-b.source { width: 12px; height: 56px; background-size: 100% 5.6px; box-shadow: 0 0 0 3px rgba(74, 134, 232, 0.25); }
.nd-tm-src .nd-bw-b.used { opacity: 0.3; cursor: default; }
.nd-tm .nd-bw-cell { min-height: 64px; }


.nd-bn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.nd-bn.places-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.nd-bn-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.nd-bn-col .nd-bn-group { flex: 1; }   
.nd-bn-group { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; gap: 4px; width: 100%; min-height: 96px; padding: 6px 4px; box-sizing: border-box;
    border: 2px dashed #c9c0f5; border-radius: 12px; background: #fbfaff; }
.nd-bn-group.bad { border-color: var(--red); border-style: solid; }
.nd-card.ok .nd-bn-group { border-style: solid; border-color: #2fa86a; background: #e5f7ec; }
.nd-bn-group .nd-bw-b.p0 { width: 15px; height: 15px; }
.nd-bn-group .nd-bw-b.p1 { width: 11px; height: 46px; background-size: 100% 4.6px; }
.nd-bn-group .nd-bw-b.p2, .nd-bn-group .nd-bw-b.p3 { width: 30px; height: 30px; }
.nd-bn.places-4 .nd-bn-group .nd-bw-b.p2, .nd-bn.places-4 .nd-bn-group .nd-bw-b.p3 { width: 24px; height: 24px; }
.nd-bn-group .nd-bw-b.dim { background-color: #eef0f4; border-color: #c3c9d4; box-shadow: none; }
.nd-bn-group .nd-bw-b.dim .f-top { fill: #f4f5f8; } .nd-bn-group .nd-bw-b.dim .f-left { fill: #dde1e8; } .nd-bn-group .nd-bw-b.dim .f-right { fill: #c6ccd6; }
.nd-bn-group .nd-bw-b.dim .f-edge { stroke: #9aa2b1; } .nd-bn-group .nd-bw-b.dim .f-grid { stroke: rgba(31, 36, 48, 0.16); }
.nd-bn-group .nd-bw-b:not(.dim) { box-shadow: 0 0 6px rgba(0, 0, 0, 0.25); }
.nd-bn-eq { display: flex; align-items: center; gap: 4px; font: 800 1rem/1 var(--round); color: var(--blue-dark); white-space: nowrap; }
.nd-bn-eq .nd-input { width: 2.4em; min-width: 0; text-align: center; padding: 6px 2px; }
.nd-bn.places-4 .nd-bn-eq { flex-direction: column; font-size: 0.85rem; gap: 3px; }
.nd-bn.places-4 .nd-bn-eq .nd-input { width: 2.4em; }
.nd-fields.plus.long:has(.nd-step) { flex-wrap: wrap; row-gap: 10px; }
.nd-fields.plus.long:has(.nd-step) .nd-field { flex: 0 0 4.2em; }
@media print { .nd-bw, .nd-bn, .nd-seven { display: none; } }


.nd-round-line { margin: 4px 0 10px; padding: 6px 8px 0; border-radius: 14px; background: #fff; border: 2px solid #e1dbfb; }
.nd-round-line svg { display: block; width: 100%; height: auto; color: var(--ink); }
.nd-round-line.unlocked { border-color: #b9b0f5; animation: ndRoundIn 0.5s ease-out; }
@keyframes ndRoundIn { from { box-shadow: 0 0 0 6px rgba(91, 78, 230, 0.35); } to { box-shadow: 0 0 0 0 rgba(91, 78, 230, 0); } }
@media print { .nd-round-line { display: none; } }

.nd-round-line svg.probe { cursor: pointer; touch-action: none; }
.nd-probe rect { fill: #eaf4ff; stroke: #3b9bf5; stroke-width: 2; }
.nd-probe path, .nd-probe circle { fill: #3b9bf5; }
.nd-probe circle { stroke: #fff; stroke-width: 2.5; }
.nd-probe text { font: 900 13px var(--round); fill: #14569e; }


.nd-help-btn.asleep { background: #c9cdd6; box-shadow: 0 3px 0 #a3a9b6; cursor: default; opacity: 0.6; }
.nd-help-btn.woke { animation: ndHelpWake 0.9s ease-out 2; }
@keyframes ndHelpWake { 30% { transform: scale(1.3); } 60% { transform: scale(0.92); } }

.nd-build.big .nd-block, .nd-tens.big .nd-block { box-sizing: border-box; }
.nd-build.big .nd-block.rod, .nd-tens.big .nd-block.rod { flex: 0 0 26px; width: 26px; height: 204px;
    background-image: repeating-linear-gradient(0deg, transparent 0 18px, rgba(20, 28, 48, 0.6) 18px 20px); }
.nd-build.big .nd-block.unit, .nd-tens.big .nd-block.unit { flex: 0 0 26px; width: 26px; height: 24px; }
.nd-tens.big .nd-tens-units { grid-template-columns: repeat(5, 26px); }
.nd-build.big .nd-block.rod.lit, .nd-tens.big .nd-block.rod.lit { border-color: #14306e; }
.nd-tens.big .nd-block.rod.struck { background-image: linear-gradient(135deg, transparent 0 46%, var(--red) 46% 54%, transparent 54%),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(20, 28, 48, 0.6) 18px 20px); }

.nd-cm { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.nd-cm-bank { display: flex; gap: 22px; justify-content: center; padding: 8px; border-radius: 14px; background: #f6f3ff; }
.nd-cm-spot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nd-cm-name { font: 800 0.8rem/1 var(--round); color: var(--muted); }
.nd-cm-coin { display: inline-block; flex: none; padding: 0; border: none; background: none; border-radius: 50%; touch-action: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
button.nd-cm-coin { cursor: grab; }
.nd-cm-coin svg { display: block; width: 100%; height: 100%; }
.nd-cm-coin.dime { width: 47px; height: 47px; }
.nd-cm-coin.penny { width: 50px; height: 50px; }
.nd-cm-bank .nd-cm-coin.dime { width: 56px; height: 56px; }
.nd-cm-bank .nd-cm-coin.penny { width: 60px; height: 60px; }
.nd-cm-coin.nope { animation: ndCasNope 0.4s; }
.nd-cm-coin.dragging { opacity: 0.4; }
.nd-cm-mat { min-height: 84px; display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 6px; padding: 12px;
    border: 3px dashed #9fd3b0; border-radius: 16px; background: #eaf7ee; transition: background 0.12s; }
.nd-cm-mat.over, .nd-cm-bank.over { background: #d6f0de; box-shadow: inset 0 0 0 2px #2e9e5b; }
.nd-cm-empty { width: 100%; text-align: center; font: 800 0.95rem/1 var(--round); color: #5f9a72; }
.nd-cm-gap { width: 10px; }
.nd-cm-count { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 1.6em; font: 900 1.05rem/1.3 var(--round); color: var(--ink); }
.nd-cm-step.dime { color: #5d6470; }
.nd-cm-step.penny { color: #a4501f; }
.nd-cm-step.last { padding: 1px 8px; border-radius: 10px; background: #fff3c4; font-size: 1.25rem; }
.nd-cm-arrow { color: var(--muted); font-weight: 700; }


.nd-bw-cell.need { background: #ffe1e4 !important; box-shadow: inset 0 0 0 2px #ef5b6b; }
.nd-bw-cell.goal { box-shadow: inset 0 0 0 2px #ffcf3f; }
.nd-bw-zoom { padding: 10px; border: 2px solid #c9c0f5; border-radius: 14px; background: #fbfaff; animation: ndZoomIn 0.25s ease-out; }
.nd-bw-zoom.hidden { display: none; }
@keyframes ndZoomIn { from { transform: scale(0.92); opacity: 0; } }
.nd-bw-ztitle { margin-bottom: 8px; text-align: center; font: 900 1.05rem/1.25 var(--round); color: #c0392b; }
.nd-bw-zrow { display: flex; align-items: stretch; justify-content: center; gap: 8px; }
.nd-bw-zcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 12px; background: #fff; border: 2px solid #e3ddfb; }
.nd-bw-zcol.need { background: #fff1f2; border-color: #ef5b6b; }
.nd-bw-zcol.drop { border-style: dashed; border-color: var(--blue); }
.nd-bw-zcol.over, .nd-bw-zbox.over { background: #e9e3ff; box-shadow: inset 0 0 0 2px var(--blue); }
.nd-bw-zhead { display: flex; align-items: center; justify-content: center; gap: 6px; font: 900 0.85rem/1 var(--round); color: #c0392b; }
.nd-bw-zpile { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px; min-height: 70px; max-width: 100%; }
.nd-bw-zbox { flex: 0 0 26%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px; min-height: 90px;
    border: 3px dashed #9d90ec; border-radius: 12px; background: #fff; }
.nd-bw-zhint { text-align: center; font: 800 0.82rem/1.2 var(--round); color: var(--muted); }
.nd-bw-zhint.below { margin-top: 6px; font-size: 0.95rem; color: var(--blue-dark); }
.nd-bw-zarrow { align-self: center; font: 900 1.6rem/1 var(--round); color: var(--blue); }
.nd-bw-ztools { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; }
.nd-bw-zcount { font: 900 0.95rem/1 var(--round); color: var(--blue-dark); }
.nd-bw-zbtn { padding: 8px 14px; border: none; border-radius: 12px; background: linear-gradient(135deg, #7163f5, #4f3fd9); color: #fff;
    font: 900 0.92rem/1 var(--round); cursor: pointer; box-shadow: 0 3px 0 #2f2396; }
.nd-bw-zbtn:disabled { opacity: 0.4; cursor: default; }

.nd-bw-b.big.p0 { width: 24px; height: 24px; }
.nd-bw-b.big.p1 { width: 16px; height: 96px; background-image: repeating-linear-gradient(0deg, transparent 0 8.2px, rgba(0, 0, 0, 0.45) 8.2px 9.6px); }
.nd-bw-b.big.p2 { width: 38px; height: 38px; }
.nd-bw-b.big.p3 { width: 42px; height: 42px; }
.nd-bw-b.big.p4 { width: 52px; height: 52px; }
.nd-bw-b.picked { outline: 3px solid #ffcf3f; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 207, 63, 0.45); }


.nd-pm { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 8px; }
.nd-pm-start { display: flex; align-items: baseline; gap: 8px; font: 900 1.3rem/1 var(--round); color: var(--blue-dark); }
.nd-pm-tag { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nd-pm-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 340px; }
.nd-pm-op { padding: 9px 4px; border: 2px solid #c9c0f5; border-radius: 12px; background: #fff; color: var(--blue-dark); font: 900 1rem/1 var(--round); cursor: pointer; }
.nd-pm-op.on { border-color: var(--blue); background: #ece9ff; box-shadow: 0 0 0 3px rgba(91, 75, 230, 0.2); }
.nd-pm-op.done { border-color: #2e9e5b; background: #e3f6ea; color: #1f7a45; }
.nd-pm-op.done::after { content: " ✓"; }
.nd-pm-op.nope, .nd-pm-ops.nope { animation: ndCasNope 0.4s; }
.nd-pm-eq { min-height: 1.4em; font: 800 1.05rem/1.3 var(--round); color: var(--ink); text-align: center; }
.nd-pm-eq b { color: var(--blue-dark); font-size: 1.15rem; }
.nd-pm-chart { display: flex; gap: 3px; justify-content: center; width: 100%; }
.nd-pm-col { flex: 0 1 46px; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 2px; }

.nd-pm-ops { margin: 10px 0 6px; }
.nd-pm-comma { flex: none; align-self: flex-end; margin: 0 -1px 32px; font: 900 1.6rem/1 var(--round); color: var(--ink); }
.nd-pm-head { display: flex; justify-content: center; min-height: 30px; align-items: center; }
.nd-pm-head .nd-ball { transform: scale(0.82); }
.nd-pm-digit { height: 48px; border: 2px solid #c9c0f5; border-radius: 10px; background: #fff; color: var(--ink); font: 900 1.6rem/1 var(--round); cursor: pointer; padding: 0; }
.nd-pm-digit.changed { background: #fff3c4; border-color: #f0b400; color: #8a5a00; }
.nd-pm-digit.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91, 75, 230, 0.3); }
.nd-pm-arrow { height: 30px; border: none; border-radius: 8px; background: #ece9ff; color: var(--blue-dark); font: 900 0.95rem/1 var(--round); cursor: pointer; padding: 0; }
.nd-pm-arrow.off { visibility: hidden; }
.nd-pm-note { min-height: 1.3em; font: 800 0.95rem/1.3 var(--round); color: var(--muted); text-align: center; }
.nd-pm-note.ok { color: #1f8f5f; }
.nd-pm-note.bad { color: #c0392b; }


.nd-tools { flex-direction: column; align-items: center; gap: 12px; }
.nd-tool-main { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; padding: 14px 26px; border-radius: 999px;
    background: linear-gradient(180deg, #fff3c4, #ffe08a); color: var(--blue-dark);
    box-shadow: inset 0 0 0 2px #b9adf5, 0 4px 0 #9d90ec, 0 8px 18px rgba(58, 44, 158, 0.18); }
.nd-tool-main:active { box-shadow: inset 0 0 0 2px #b9adf5, 0 1px 0 #9d90ec; }
.nd-spark { display: inline-block; width: 12px; height: 18px; background:
    linear-gradient(#f5b800, #f5b800) 0 2px / 9px 3px no-repeat, linear-gradient(#f5b800, #f5b800) 2px 8px / 10px 3px no-repeat, linear-gradient(#f5b800, #f5b800) 0 14px / 9px 3px no-repeat; }
.nd-spark:last-child { transform: scaleX(-1); }
.nd-tool-pair { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.nd-tool-pair .nd-btn { border-radius: 999px; font-size: 1rem; padding: 11px 18px; }
.nd-tool-small { border-radius: 999px; font-size: 0.9rem; padding: 8px 16px; min-width: min(100%, 15.5rem); }
.nd-promise-row { text-align: center; margin: 22px 0 0; }
.nd-promise { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 14px; background: #fff;
    border: 2px solid #c9c0f5; color: var(--blue-dark); font-size: 1.05rem; font-weight: 900; text-decoration: none; line-height: 1.3; }
.nd-promise:hover { border-color: var(--blue); }
.nd-foot a { color: var(--blue-dark); font-weight: 700; }
.nd-foot-btn { border: none; background: none; padding: 0; font: inherit; color: var(--blue-dark); text-decoration: underline; cursor: pointer; }
body.plain .nd-tool-main { background: #fff; }


.nd-cb { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; justify-items: center; column-gap: 10px; row-gap: 8px; margin: 4px 0 12px; }
.nd-cb-model { grid-row: 1; display: flex; align-items: flex-end; justify-content: center; gap: 6px; min-width: 0; }
.nd-cb-rods { display: grid; grid-template-columns: repeat(5, 13px); gap: 3px; align-items: end; }
.nd-cb-rods:empty { display: none; }
.nd-cb-ones { display: grid; grid-template-columns: repeat(3, 13px); gap: 2px; align-content: end; }
.nd-cb .nd-block { cursor: default; transform: none; box-sizing: border-box; }
.nd-cb .nd-block.rod { width: 13px; height: 132px; border-width: 1.5px; box-shadow: none;
    background-image: repeating-linear-gradient(0deg, transparent 0 11.4px, rgba(20, 28, 48, 0.6) 11.4px 12.9px); }
.nd-cb .nd-block.unit { width: 13px; height: 13px; border-width: 1.5px; box-shadow: none; }
.nd-cb .nd-block.rod.lit { border-color: #14306e; }
.nd-cb .nd-compare-n { grid-row: 2; }
.nd-cb .nd-compare-slot { grid-row: 2; grid-column: 2; }
@media print { .nd-cb { display: none; } }
.nd-cb > span:nth-of-type(1) { grid-column: 1; }
.nd-cb > span:nth-of-type(3) { grid-column: 3; }


.nd-tm .nd-tm-top { flex-direction: column; }
.nd-tm .nd-tm-src { flex-direction: row; justify-content: center; gap: 12px; padding: 6px 10px; }
.nd-tm .nd-tm-src .nd-bw-b.source { width: 90px; height: 9px; background-color: #8fd0ff;
    background-image: repeating-linear-gradient(90deg, transparent 0 7.6px, rgba(0, 0, 0, 0.35) 7.6px 9px); }
.nd-tm .nd-bw-grid.one { grid-template-columns: repeat(var(--bw-cols), auto); justify-content: stretch; }
.nd-tm .nd-bw-head .nd-ball { min-width: 1.9em; height: 1.9em; font-size: 0.6rem; }
.nd-tm .nd-bw-head { padding: 3px 2px; }
.nd-tm .nd-bw-cell { min-height: 104px; align-content: flex-end; align-items: flex-end; gap: 3px; padding: 6px 4px; }
.nd-tm .nd-bw-b.p0 { width: 9px; height: 9px; border-width: 1px; }
.nd-tm .nd-bw-b.p1 { width: 9px; height: 90px; border-width: 1px; background-color: #2f5fd8;
    background-image: repeating-linear-gradient(0deg, transparent 0 7.6px, rgba(0, 0, 0, 0.45) 7.6px 9px); }
.nd-tm .nd-bw-b.p1.new { background-color: #8fd0ff; border-color: #2a7fd0; box-shadow: 0 0 6px rgba(80, 180, 255, 0.8); }
.nd-tm .nd-bw-b.p2 { width: 90px; height: 90px; border-width: 1px;
    background-image: repeating-linear-gradient(90deg, transparent 0 7.6px, rgba(0, 0, 0, 0.3) 7.6px 9px), repeating-linear-gradient(0deg, transparent 0 7.6px, rgba(0, 0, 0, 0.3) 7.6px 9px); }
.nd-tm .nd-bw-cell.p2 { display: grid; justify-items: start; align-items: start; align-content: center; justify-content: center; }
.nd-tm .nd-bw-cell.p2 .nd-bw-b.p2 { grid-area: 1 / 1; margin: calc(var(--i, 0) * 6px) 0 0 calc(var(--i, 0) * 6px); box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35); }
.nd-tm .nd-bw-cell.p0 { display: grid; grid-template-columns: repeat(3, 9px); gap: 3px; justify-content: center; align-content: end; }


.nd-bw-outer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.nd-bw-show { padding: 6px 14px; border: 2px solid #c9c0f5; border-radius: 999px; background: #fff; color: var(--blue-dark);
    font: 800 0.88rem/1.1 var(--round); cursor: pointer; }
.nd-bw-show.on { background: #ece9ff; border-color: var(--blue); }
.nd-bw-outer .nd-bw { margin-bottom: 0; animation: ndZoomIn 0.2s ease-out; }
.nd-bw.hidden { display: none; }
.nd-bw-act { display: flex; justify-content: center; }
.nd-bw-act:empty { display: none; }
.nd-bw-b.grouping { outline: 3px solid #ffcf3f; outline-offset: 1px; box-shadow: 0 0 8px rgba(255, 207, 63, 0.95); animation: ndGather 0.75s ease-in forwards; }
@keyframes ndGather { 0% { transform: none; } 45% { transform: scale(1.15); } 100% { transform: scale(0.3); opacity: 0; } }
.nd-bw-b.breaking { animation: ndBreak 0.65s ease-in forwards; }
@keyframes ndBreak { 0% { transform: none; } 30% { transform: scale(1.2); box-shadow: 0 0 10px #ffcf3f; } 60% { transform: scale(1.2) rotate(-6deg); } 100% { transform: scale(0.2); opacity: 0; } }
.nd-bw-b.arrive { animation: ndArrive 0.4s ease-out both; animation-delay: var(--d, 0ms); }
.nd-bw-b.arrive.from-right { --from: 26px; }
.nd-bw-b.arrive.from-left { --from: -26px; }
@keyframes ndArrive { from { transform: translateX(var(--from, 0)) scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nd-bw-b.grouping, .nd-bw-b.breaking, .nd-bw-b.arrive { animation-duration: 0.01s; } }
.nd-bw.sub .nd-bw-cell.work { min-height: 56px; }


.nd-sc { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.nd-sc-panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; box-sizing: border-box;
    border: 2px solid #c9c0f5; border-radius: 14px; background: #fbfaff; animation: ndZoomIn 0.2s ease-out; }
.nd-sc-panel.hidden, .nd-sc-two.hidden { display: none; }
.nd-sc-q { font: 900 1rem/1.25 var(--round); color: var(--blue-dark); text-align: center; }
.nd-sc-ask { display: flex; gap: 8px; align-items: center; }
.nd-sc-in { width: 3em; text-align: center; font-size: 1.2rem; }
.nd-sc-in.good { border-color: #2fa86a; background: #e5f7ec; }
.nd-sc-note { min-height: 1.2em; font: 800 0.9rem/1.2 var(--round); color: #c0392b; text-align: center; }
.nd-sc-note:empty { display: none; }
.nd-sc-two { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nd-sc-pile { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 40px; padding: 6px; border-radius: 12px; }
.nd-sc-pile.over { background: #e9e3ff; }
.nd-sc-pile.empty { min-height: 0; padding: 0; }
.nd-sc-none { font: 800 0.9rem/1.2 var(--round); color: var(--muted); align-self: center; }
.nd-sc-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.nd-sc-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; min-height: 92px; border: 3px dashed #9fd3b0;
    border-radius: 14px; background: #eef9f1; cursor: pointer; }
.nd-sc-box.over { background: #d6f0de; border-color: #2e9e5b; }
.nd-sc-in-box { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 6px; width: 100%; }
.nd-sc-count { font: 900 1.1rem/1 var(--round); color: #1f7a45; }
.nd-sc-cube { width: 30px; height: 30px; padding: 0; border: 2px solid #1f7a45; border-radius: 4px; background: var(--green); cursor: grab; touch-action: none;
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.15), 0 2px 0 rgba(0, 0, 0, 0.2); }
.nd-sc-cube.picked { outline: 3px solid #ffcf3f; outline-offset: 2px; }
.nd-sc-cube.dragging { opacity: 0.4; }
@media print { .nd-bw-outer, .nd-sc { display: none; } }

.nd-bw-outer .nd-bw-b.p0 { width: 8px; height: 8px; border-width: 1px; position: relative; }
.nd-bw-outer .nd-bw-b.p1 { width: 8px; height: 80px; border-width: 1px; position: relative; background-color: #4a86e8;
    background-image: repeating-linear-gradient(0deg, transparent 0 6.8px, rgba(0, 0, 0, 0.4) 6.8px 8px); }
.nd-bw-outer button.nd-bw-b.p0::after, .nd-bw-outer button.nd-bw-b.p1::after { content: ""; position: absolute; inset: -5px -3px; }
.nd-bw-outer .nd-bw-b.p2 { width: 44px; height: 44px; border-width: 1px;
    background-image: repeating-linear-gradient(90deg, transparent 0 3.5px, rgba(0, 0, 0, 0.25) 3.5px 4.4px), repeating-linear-gradient(0deg, transparent 0 3.5px, rgba(0, 0, 0, 0.25) 3.5px 4.4px); }
.nd-bw-outer .nd-bw-cell { align-content: flex-end; align-items: flex-end; gap: 3px; min-height: 56px; }
.nd-bw-outer .nd-bw-b.p3 { width: 34px; height: 34px; }
.nd-bw-outer .nd-bw-grid { grid-template-columns: 2.9rem repeat(var(--bw-cols), minmax(0, 1fr)); }
.nd-bw-outer .nd-bw-b.p2 { width: 34px; height: 34px; background-image: repeating-linear-gradient(90deg, transparent 0 2.6px, rgba(0, 0, 0, 0.25) 2.6px 3.4px), repeating-linear-gradient(0deg, transparent 0 2.6px, rgba(0, 0, 0, 0.25) 2.6px 3.4px); }   

.nd-bw-outer .nd-bw-cell.p2 { flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }


.nd-sc-cube.left { background: #e5483d; border-color: #9e2219; }
.nd-bw-val { font: 900 0.78rem/1.1 var(--round); color: var(--blue-dark); text-align: center; padding: 2px 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nd-bw-val.zero { color: var(--muted); }
.nd-bw-val.changed { animation: ndValPop 0.45s ease-out; }
@keyframes ndValPop { 0% { transform: scale(1.35); color: #2fa86a; } 100% { transform: none; } }
.nd-ml-num { font: 900 1.5rem/1.2 var(--round); color: var(--blue-dark); text-align: center; letter-spacing: 0.02em; margin: 2px 0 6px; }
.nd-ml-show { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.nd-ml-panel { max-width: 100%; overflow-x: auto; animation: ndZoomIn 0.2s ease-out; }
.nd-ml-panel.hidden { display: none; }
.nd-ml-eq { margin-top: 10px; font: 900 1.2rem/1.3 var(--round); color: var(--blue-dark); text-align: center; font-variant-numeric: tabular-nums; }
.nd-ml-eq .chg { color: #fff; background: #2fa86a; border-radius: 4px; padding: 0 2px; }
@media print { .nd-ml-show, .nd-ml-eq { display: none; } }
.nd-ml-eq:not(.shown) { display: none; }


.nd-bw-vert { width: 100%; box-sizing: border-box; display: grid; grid-template-columns: 2.9rem repeat(var(--bw-cols), minmax(0, 1fr));
    border: 2px solid #c9c0f5; border-radius: 12px; background: #fff; padding: 4px 0 6px; }
.nd-bw-vlab, .nd-bw-vd { display: flex; align-items: center; justify-content: center; height: 2.3rem; font: 900 1.7rem/1 var(--round);
    font-variant-numeric: tabular-nums; color: var(--blue-dark); position: relative; }
.nd-bw-vlab { justify-content: flex-end; padding-right: 6px; }
.nd-bw-vlab.bot, .nd-bw-vd.bot { border-bottom: 3px solid var(--blue-dark); }
.nd-bw-vd.p0 { color: #2fa84a; } .nd-bw-vd.p1 { color: #2f5fd8; } .nd-bw-vd.p2 { color: #e0702a; } .nd-bw-vd.p3 { color: #8a3fd8; } .nd-bw-vd.p4 { color: #d03c3c; }
.nd-bw-vd.comma::after { content: ","; position: absolute; right: -0.12em; color: var(--blue-dark); }
button.nd-bw-vd { padding: 0; margin: 0 auto 0; width: 100%; background: none; border: none; border-bottom: 3px solid var(--blue-dark); cursor: pointer; }
button.nd-bw-vd::before { content: ""; position: absolute; inset: 3px 12%; border: 2px dashed #d8d1fb; border-radius: 9px; }
button.nd-bw-vd.on { color: #fff; }
button.nd-bw-vd.on::before { inset: 2px 10%; border: none; z-index: -1; background: currentColor; }
button.nd-bw-vd.on.p0::before { background: #2fa84a; } button.nd-bw-vd.on.p1::before { background: #2f5fd8; } button.nd-bw-vd.on.p2::before { background: #e0702a; }
button.nd-bw-vd.on.p3::before { background: #8a3fd8; } button.nd-bw-vd.on.p4::before { background: #d03c3c; }
button.nd-bw-vd.on { isolation: isolate; }
.nd-bw-b.hl { outline: 3px solid #ffcf3f; outline-offset: 1px; box-shadow: 0 0 7px rgba(255, 190, 40, 0.95); }


.nd-bw-outer ~ .nd-input.wide { min-width: 0; }


.nd-say-choices { flex-direction: column; }
.nd-say-row { display: flex; align-items: stretch; gap: 6px; width: 100%; }
.nd-say-row > .nd-choice, .nd-say-row > .nd-strike-row { flex: 1; min-width: 0; }
.nd-say { flex: none; width: 44px; font: inherit; font-size: 1.05rem; background: #fff; border: 2px solid #e1dbfb; border-radius: 12px; cursor: pointer; touch-action: manipulation; opacity: 0.85; }
.nd-say.speaking { background: #eaf2fb; border-color: var(--blue); opacity: 1; }


.nd-mtab-fixit { display: none; }
body.nd-fixit-day .nd-tabs { display: flex; }
body.nd-fixit-day .nd-mtab[data-tab="games"] { display: none; }
body.nd-fixit-day .nd-mtab-fixit { display: block; }
.nd-mtab-fixit:not(.on) { color: #8a5a00; background: #fff4c2; }
.nd-fixit { display: none; max-width: 640px; margin: 0 auto; padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); box-sizing: border-box; }
body.nd-on-fixit .nd-fixit { display: flex; flex-direction: column; gap: 12px; }
body.nd-on-fixit .nd-main { display: none; }
body.display .nd-fixit { display: none !important; }
@media print { .nd-fixit { display: none !important; } }
.nd-fx-head { background: var(--card, #fff); border-radius: 18px; padding: 14px; text-align: center; box-shadow: 0 3px 12px rgba(50, 30, 120, 0.12); }
.nd-fx-title { margin: 0; font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 900; color: var(--ink); }
.nd-fx-word { background: linear-gradient(transparent 35%, #ffd84d 35%, #ffd84d 88%, transparent 88%); padding: 0 6px; }
.nd-fx-zap { font-size: 0.7em; margin: 0 4px; }
.nd-fx-meta { font-size: 0.85rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
.nd-fx-num { margin: 10px auto 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nd-fx-num b { font-family: "Andika", sans-serif; font-size: 2.1rem; color: var(--blue-dark); letter-spacing: 0.03em; }
.nd-fx-how { margin: 6px 0; font-size: 0.98rem; line-height: 1.4; }
.nd-fx-tries { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; font-size: 0.92rem; margin-top: 8px; }
.nd-fx-tries b { color: var(--blue-dark); }
.nd-fx-pips { display: inline-flex; gap: 4px; }
.nd-fx-pips i { width: 12px; height: 12px; border-radius: 50%; background: #ffcf3f; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15); }
.nd-fx-pips i.used { background: #ddd8f0; box-shadow: none; }
.nd-fx-note { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.nd-fx-list { display: flex; flex-direction: column; gap: 10px; }
.nd-fx-card { background: var(--card, #fff); border: 1.5px solid var(--line); border-left: 6px solid #f2a90f; border-radius: 14px; padding: 12px 14px; }
.nd-fx-card-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 4px; }
.nd-fx-card .nd-card-num { background: #f2a90f; }
.nd-fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 1.15rem; margin: 6px 0; }
.nd-fx-lead { font-weight: 700; }
.nd-fx-sep { font-weight: 800; color: var(--muted); }
.nd-fx-pencil { font-family: "Andika", sans-serif; color: #2f5fd0; border: 2px solid #c9d6f5; border-radius: 9px; padding: 1px 10px; background: #f7f9ff; min-width: 1.6em; text-align: center; }
.nd-fx-row.words .nd-fx-pencil { border-style: none none dashed; border-radius: 0; background: none; padding: 1px 2px; }
.nd-fx-in { width: auto; min-width: 0; max-width: 9em; text-align: center; font-size: 1.05rem; padding: 6px 4px; }
.nd-fx-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.nd-fx-flag { font: inherit; font-weight: 800; font-size: 0.95rem; color: #c0392b; background: #fff; border: 2px solid #f1b8b1; border-radius: 999px; padding: 7px 16px; cursor: pointer; touch-action: manipulation; }
.nd-fx-flag:active { background: #fdeceb; }
.nd-fx-msg { font-weight: 800; font-size: 0.92rem; }
.nd-fx-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.nd-fx-opts.words { flex-direction: column; }
.nd-fx-opts .nd-choice { min-width: 3.2em; }
.nd-fx-card.found { border-left-color: #e74c3c; background: #fff8f7; }
.nd-fx-card.found .nd-fx-msg { color: #c0392b; }
.nd-fx-card.fixed { border-left-color: #2fa86a; background: #eefaf3; }
.nd-fx-card.fixed .nd-fx-msg, .nd-fx-card.shown .nd-fx-msg { color: #1f8a53; }
.nd-fx-card.fixed .nd-fx-pencil, .nd-fx-card.shown .nd-fx-pencil { color: #1f8a53; border-color: #9fdcb9; background: #fff; }
.nd-fx-card.shown { border-left-color: #2fa86a; }
.nd-fx-card.was-right { border-left-color: #9a95c0; opacity: 0.8; }
.nd-fx-card.was-right .nd-fx-msg { color: var(--muted); }
.nd-fx-card.missed { border-left-color: #e74c3c; }
.nd-fx-card.missed > .nd-fx-answer .nd-fx-pencil { text-decoration: line-through; color: #c0392b; border-color: #f1b8b1; }
.nd-fx-card.missed .nd-fx-msg { color: #c0392b; }
.nd-fx-card.missed .nd-fx-foot .nd-fx-pencil { color: #1f8a53; border-color: #9fdcb9; }
.nd-fx-done { background: var(--card, #fff); border-radius: 18px; padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 3px 12px rgba(50, 30, 120, 0.12); }
.nd-fx-done-big { font-size: 1.35rem; font-weight: 900; color: var(--blue-dark); }


.nd-bw-outer { --bwu: 13px; }
@media (min-width: 600px) { .nd-bw-outer { --bwu: 18px; } }
.nd-bw-outer .nd-bw-cell { gap: 4px 3px; padding: 6px 3px; }
.nd-bw-outer .nd-bw-cell.tap { cursor: pointer; }
.nd-bw-outer .nd-bw-b.p0 { width: var(--bwu); height: var(--bwu); border-width: 1.5px; border-radius: 3px; }
.nd-bw-outer .nd-bw-b.p1 { width: var(--bwu); height: calc(var(--bwu) * 10); border-width: 1.5px; border-radius: 3px;
    background-image: repeating-linear-gradient(0deg, transparent 0 calc(var(--bwu) - 1.2px), rgba(0, 0, 0, 0.35) calc(var(--bwu) - 1.2px) var(--bwu)); }
.nd-bw-outer .nd-bw-b.p2 { width: calc(var(--bwu) * 3.4); height: calc(var(--bwu) * 3.4); border-width: 1.5px;
    background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--bwu) * 0.34 - 0.9px), rgba(0, 0, 0, 0.25) calc(var(--bwu) * 0.34 - 0.9px) calc(var(--bwu) * 0.34)),
        repeating-linear-gradient(0deg, transparent 0 calc(var(--bwu) * 0.34 - 0.9px), rgba(0, 0, 0, 0.25) calc(var(--bwu) * 0.34 - 0.9px) calc(var(--bwu) * 0.34)); }
.nd-bw-outer .nd-bw-b.p3, .nd-bw-outer .nd-bw-b.p4 { width: calc(var(--bwu) * 3.4); height: calc(var(--bwu) * 3.4); }
.nd-bw-outer button.nd-bw-b.p0::after, .nd-bw-outer button.nd-bw-b.p1::after { inset: -2px; }
.nd-bw-outer .nd-bw-grid { grid-template-columns: 2.6rem repeat(var(--bw-cols), minmax(0, 1fr)); }
.nd-bw-outer .nd-bw-lab { padding: 4px 3px; font-size: 0.74rem; }


.nd-pvh-outer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 10px; }
.nd-pvh-btn { font: inherit; font-weight: 800; font-size: 1rem; color: var(--blue-dark); background: #fff; border: 2px solid #7d5cf0; border-radius: 999px; padding: 8px 18px; cursor: pointer; touch-action: manipulation; }
.nd-pvh-btn[aria-expanded="true"] { background: #f4f0ff; }
.nd-pvh { width: 100%; box-sizing: border-box; padding: 10px; border: 2px solid #ddd3fb; border-radius: 14px; background: #faf8ff; display: flex; flex-direction: column; gap: 10px; }
.nd-pvh.hidden { display: none; }
.nd-pvh-why { margin: 0; font-size: 0.92rem; line-height: 1.35; }
.nd-pvh-scroll { overflow-x: auto; }
.nd-pvh-table { border-collapse: collapse; margin: 0 auto; font-variant-numeric: tabular-nums; }
.nd-pvh-table th, .nd-pvh-table td { text-align: center; padding: 4px 3px; min-width: 2.1em; border-left: 1px solid #ddd3fb; }
.nd-pvh-table th { font-size: clamp(0.58rem, 2.5vw, 0.8rem); font-weight: 800; color: var(--blue-dark); background: #ece6ff; padding: 6px 3px; }
.nd-pvh-table td { font: 900 clamp(1.3rem, 6vw, 1.8rem)/1.2 var(--round); color: var(--ink); background: #fff; }
.nd-pvh-table .nd-pvh-sign { border-left: none; background: none; min-width: 1em; color: var(--blue-dark); }
.nd-pvh-table .nd-pvh-point { min-width: 0.7em; padding: 4px 0; }
.nd-pvh-second td { border-bottom: 3px solid var(--blue-dark); }
.nd-pvh-second td.nd-pvh-sign { border-bottom: none; }
.nd-pvh-table .lit { background: #efe7ff; color: #5a2fc2; box-shadow: inset 2px 0 0 #8b5cf6, inset -2px 0 0 #8b5cf6; }
.nd-pvh-table th.lit { box-shadow: inset 2px 2px 0 #8b5cf6, inset -2px 0 0 #8b5cf6; }
.nd-pvh-second td.lit { box-shadow: inset 2px -2px 0 #8b5cf6, inset -2px 0 0 #8b5cf6; }
.nd-pvh-think { background: #fff6c9; border: 2px solid #f3dc7a; border-radius: 12px; padding: 8px 12px; font-size: 0.92rem; }
.nd-pvh-think b { color: #5a2fc2; }
.nd-pvh-think ul { margin: 4px 0 0; padding-left: 1.2em; }
@media print { .nd-pvh-outer { display: none; } }
.nd-pvh-outer ~ .nd-input.wide { min-width: 0; }   


.nd-help.closable { position: relative; }
.nd-help.closable .nd-help-title { padding: 0 40px; text-align: center; }
.nd-help-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #ddd3fb; background: #fff; color: #5a2fc2; font: 900 1.05rem/1 var(--round); cursor: pointer; touch-action: manipulation; }
.nd-hm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.nd-hm { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.nd-hm + .nd-hm { border-left: 2px solid #e6e0fb; padding-left: 12px; }
.nd-hm-tag { display: flex; flex-direction: column; align-items: center; padding: 4px 12px; border-radius: 10px; background: #fff3b8; line-height: 1.15; }
.nd-hm-tag b { font: 900 1.3rem/1.1 var(--round); color: #3a2c9e; }
.nd-hm-tag span { font-size: 0.82rem; color: var(--ink); }
.nd-hm-grid { display: grid; grid-template-columns: repeat(10, 1fr); width: min(130px, 100%); aspect-ratio: 1; border: 2px solid #2b2160; background: #2b2160; gap: 1px; }
.nd-hm-grid span { background: #fff; }
.nd-hm-grid span.on { background: #8b4fe0; }



.nd-drag-row { justify-content: center; gap: 14px; flex-wrap: nowrap; }
.nd-drag-row .nd-choice { width: 64px; height: 56px; padding: 0; font-size: 1.6rem; display: inline-flex; align-items: center; justify-content: center; }

.nd-ones-digit.red { color: var(--red, #e2575a); font-weight: 900; }

.nd-help-row.example { justify-content: center; gap: 8px; }
.nd-help-row.example .nd-help-label { min-width: 3.4em; text-align: right; font-size: 1.15rem; font-weight: 900; color: var(--blue-dark); }
.nd-help-row.example .nd-help-std { min-width: 6.2em; }

.nd-pz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; align-items: start; }
.nd-pz-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nd-pz-col svg { width: 100%; max-width: 120px; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18)); }

.nd-pv-flash { min-height: 1.6em; margin: 6px 0 2px; text-align: center; font: 900 1.4rem/1.2 var(--round); color: var(--blue-dark); letter-spacing: 0.03em; }

.nd-zoom { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 2px 0 10px; }
.nd-zoom-box { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 2px solid #e4def9; border-radius: 12px; background: #fbfaff; padding: 4px 0; }
.nd-zoom-box.hidden { display: none; }
.nd-zoom-line { display: block; width: 640px; height: auto; color: var(--blue-dark); }

.nd-mod { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; }
.nd-mod-panel { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid #e4def9; border-radius: 14px; background: #fbfaff; }
.nd-mod-panel.hidden { display: none; }
.nd-mod-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding-bottom: 8px; border-bottom: 1px dashed #e4def9; }
.nd-mod-row:last-child { border-bottom: none; padding-bottom: 0; }
.nd-mod-ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.nd-mod-ctl .nd-ball { min-width: 3.6em; }
.nd-mod-btn { width: 40px; height: 40px; border-radius: 10px; border: 2px solid #c9c0f5; background: #fff; color: var(--blue-dark); font: 900 1.3rem/1 var(--round); cursor: pointer; touch-action: manipulation; padding: 0; }
.nd-mod-btn:disabled { opacity: 0.35; cursor: default; }
.nd-mod-count { min-width: 1.2em; text-align: center; font: 900 1.2rem/1 var(--round); color: var(--blue-dark); }
.nd-mod-pieces { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 3px; min-width: 0; flex: 1; }
.nd-mod-pieces.mm3 { flex-direction: column-reverse; flex-wrap: nowrap; align-items: flex-start; gap: 2px; flex: none; }
.nd-mod-dec { display: block; flex: none; background: #3cb371; border: 1px solid #1f7a49; box-sizing: border-box; }
.nd-mod-dec.m1 { width: 10px; height: 100px; background-image: repeating-linear-gradient(0deg, transparent 0 9px, rgba(0, 0, 0, 0.22) 9px 10px); }
.nd-mod-dec.m2 { width: 10px; height: 10px; }
.nd-mod-dec.m3 { width: 10px; height: 1px; border: none; background: #1f7a49; }
.nd-mod-whole { display: flex; align-items: center; gap: 10px; padding-top: 2px; font: 800 0.9rem/1.2 var(--round); color: #1f7a49; }
.nd-mod-wholegrid { width: 100px; height: 100px; flex: none; box-sizing: border-box; border: 2px solid #1f7a49; background-color: #e3f5ea;
    background-image: repeating-linear-gradient(90deg, transparent 0 9px, rgba(31, 122, 73, 0.35) 9px 10px), repeating-linear-gradient(0deg, transparent 0 9px, rgba(31, 122, 73, 0.35) 9px 10px); }
@media print { .nd-zoom, .nd-mod, .nd-pv-flash { display: none !important; } }

.nd-bn { display: flex; flex-direction: column; gap: 10px; }
.nd-bn .nd-bn-col { flex-direction: row; align-items: center; gap: 8px; }
.nd-bn .nd-bn-col .nd-bn-group { flex: 1; }
.nd-bn .nd-bn-group { display: grid; grid-template-columns: repeat(5, max-content); justify-content: center; align-content: center; align-items: end; gap: 8px 7px; min-height: 0; padding: 8px 6px; }
.nd-bn .nd-bn-group .nd-bw-b { position: relative; }
.nd-bn .nd-bn-group .nd-bw-b::before { content: ''; position: absolute; inset: -4px; }
.nd-bn .nd-bn-group .nd-bw-b.p3, .nd-bn.places-4 .nd-bn-group .nd-bw-b.p3 { width: 38px; height: 38px; }
.nd-bn .nd-bn-group .nd-bw-b.p2, .nd-bn.places-4 .nd-bn-group .nd-bw-b.p2 { width: 36px; height: 36px; background-size: auto;
    background-image: repeating-linear-gradient(90deg, transparent 0 3.05px, rgba(0, 0, 0, 0.16) 3.05px 3.6px), repeating-linear-gradient(0deg, transparent 0 3.05px, rgba(0, 0, 0, 0.16) 3.05px 3.6px); }
.nd-bn .nd-bn-group .nd-bw-b.p1 { width: 11px; height: 32px; background-size: auto; background-image: repeating-linear-gradient(0deg, transparent 0 2.75px, rgba(0, 0, 0, 0.22) 2.75px 3.2px); }
.nd-bn .nd-bn-group .nd-bw-b.p0 { width: 18px; height: 18px; }
.nd-bn .nd-bn-eq, .nd-bn.places-4 .nd-bn-eq { flex: none; flex-direction: column; gap: 4px; width: 5.2em; font-size: 0.9rem; }
.nd-bn .nd-bn-eq .nd-input { width: 2.6em; }
.nd-drag-row { width: 100%; }
.nd-bn .nd-bn-group .nd-bw-b.p3.dim { background-color: transparent; border-color: transparent; }
.nd-help-expr { font-size: clamp(1rem, 4.6vw, 1.5rem); }


.nd-bw-outer { width: calc(100% + 20px); max-width: none; margin: 10px -10px 0; box-sizing: border-box; flex: none; }
.nd-bw-outer .nd-bw-grid, .nd-bw-vert { grid-template-columns: 1.15rem repeat(var(--bw-cols), minmax(0, 1fr)); }
.nd-bw-outer .nd-bw-lab { justify-content: center; padding: 4px 0; font-size: 1.1rem; }
.nd-bw-vlab { justify-content: center; padding-right: 0; }
.nd-bw-outer .nd-bw-cell { display: grid; grid-template-columns: repeat(5, max-content); justify-content: center; align-content: end; align-items: end;
    gap: 3px; padding: 5px 2px; }
.nd-bw-outer .nd-bw-cell.p2, .nd-bw-outer .nd-bw-cell.p3, .nd-bw-outer .nd-bw-cell.p4 { grid-template-columns: repeat(3, max-content); flex-direction: initial; }
.nd-bw-outer .nd-bw-b.p0 { width: 9px; height: 9px; }
.nd-bw-outer .nd-bw-b.p1 { width: 7px; height: 50px; background-image: repeating-linear-gradient(0deg, transparent 0 4.2px, rgba(0, 0, 0, 0.4) 4.2px 5px); }
.nd-bw-outer .nd-bw-b.p2, .nd-bw-outer .nd-bw-b.p3 { width: 22px; height: 22px; }
.nd-bw-outer .nd-bw-b.p2 { background-image: repeating-linear-gradient(90deg, transparent 0 1.7px, rgba(0, 0, 0, 0.22) 1.7px 2.2px), repeating-linear-gradient(0deg, transparent 0 1.7px, rgba(0, 0, 0, 0.22) 1.7px 2.2px); }
.nd-bw-outer .nd-bw-grid.five .nd-bw-b.p2, .nd-bw-outer .nd-bw-grid.five .nd-bw-b.p3, .nd-bw-outer .nd-bw-grid.five .nd-bw-b.p4 { width: 18px; height: 18px; }
.nd-bw-outer .nd-bw-grid.five .nd-bw-b.p2 { background-image: repeating-linear-gradient(90deg, transparent 0 1.3px, rgba(0, 0, 0, 0.22) 1.3px 1.8px), repeating-linear-gradient(0deg, transparent 0 1.3px, rgba(0, 0, 0, 0.22) 1.3px 1.8px); }
.nd-bw-outer .nd-bw-grid.five .nd-bw-b.p1 { width: 6px; height: 44px; background-image: repeating-linear-gradient(0deg, transparent 0 3.6px, rgba(0, 0, 0, 0.4) 3.6px 4.4px); }
.nd-bw-outer .nd-bw-grid.five .nd-bw-cell { gap: 2px; }
.nd-bw-outer button.nd-bw-b.p2::after, .nd-bw-outer button.nd-bw-b.p3::after { content: ""; position: absolute; inset: -2px; }
.nd-bw-outer .nd-bw-b.p2, .nd-bw-outer .nd-bw-b.p3 { position: relative; }
.nd-bw-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 6px 8px;
    border-top: 1px solid #e3ddfb; background: #f6f3ff; }
.nd-bw-strip .nd-tf-step { flex: 1 1 100%; margin: 0; text-align: center; font-size: 0.9rem; }
.nd-bw-strip .nd-tf-step:empty { display: none; }
.nd-bw-strip .nd-bw-act { display: contents; }
.nd-bw-strip .nd-tf-again { margin: 0; }
.nd-card.ok .nd-bw-strip .nd-tf-again { display: none; }
.nd-bw-outer .nd-bw-val { padding: 4px 0 6px; font-size: 0.85rem; border-top: 1px solid #e3ddfb; }
.nd-bw-outer .nd-bw-grid > .nd-bw-lab:last-of-type { border-top: 1px solid #e3ddfb; }

.nd-bw-outer .nd-bw-grid { --fs: min(22px, calc((100vw - 70px) / (var(--bw-cols) * 3) - 4px)); }
.nd-bw-outer .nd-bw-b.p2, .nd-bw-outer .nd-bw-b.p3, .nd-bw-outer .nd-bw-grid.five .nd-bw-b.p2, .nd-bw-outer .nd-bw-grid.five .nd-bw-b.p3,
.nd-bw-outer .nd-bw-grid.five .nd-bw-b.p4 { width: var(--fs); height: var(--fs); background-size: auto; }
.nd-bw-outer .nd-bw-b.p2, .nd-bw-outer .nd-bw-grid.five .nd-bw-b.p2 { background-image: linear-gradient(90deg, transparent 0 calc(100% - 0.5px), transparent),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--fs) / 10 - 0.5px), rgba(0, 0, 0, 0.22) calc(var(--fs) / 10 - 0.5px) calc(var(--fs) / 10)),
    repeating-linear-gradient(0deg, transparent 0 calc(var(--fs) / 10 - 0.5px), rgba(0, 0, 0, 0.22) calc(var(--fs) / 10 - 0.5px) calc(var(--fs) / 10)); }
.nd-bw-outer .nd-bw-b.p1 { height: 40px; background-image: repeating-linear-gradient(0deg, transparent 0 3.3px, rgba(0, 0, 0, 0.4) 3.3px 4px); }
.nd-bw-outer .nd-bw-grid.five .nd-bw-b.p1 { height: 36px; background-image: repeating-linear-gradient(0deg, transparent 0 2.9px, rgba(0, 0, 0, 0.4) 2.9px 3.6px); }
.nd-bw-outer .nd-bw-cell { min-height: 30px; }
.nd-bw-outer { gap: 6px; }
.nd-bw-strip { flex-wrap: nowrap; justify-content: space-between; padding: 4px 8px; }
.nd-bw-strip .nd-tf-step { flex: 1 1 auto; text-align: left; font-size: 0.82rem; line-height: 1.2; }
.nd-bw-strip .nd-bw-zbtn { padding: 6px 10px; font-size: 0.9rem; white-space: nowrap; }
.nd-bw-strip .nd-tf-again { flex: none; font-size: 0.8rem; }
.nd-bw-outer .nd-bw-head { padding: 3px 2px; }
.nd-bw-vlab, .nd-bw-vd { height: 2rem; font-size: 1.5rem; }


.nd-tm .nd-bw-cell.p2 .nd-bw-b.p2 { margin: calc(var(--i, 0) * 11px) 0 0 calc(var(--i, 0) * 11px); border: 2.5px solid #7a3510; border-radius: 2px;
    box-shadow: -1px -1px 0 #fff, 2px 2px 3px rgba(60, 25, 5, 0.45); }
.nd-tm .nd-bw-cell.p2 { padding-right: 6px; }


.nd-chg { display: grid; justify-items: center; gap: 2px; margin: 4px 0 8px; }
.nd-chg-lab { font: 800 0.8rem/1.2 var(--round); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nd-chg-num { font: 900 1.9rem/1.15 var(--round); color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.nd-chg-num.to { color: #8a3fd8; margin-bottom: 2px; }
.nd-choice.sel { outline: 3px solid var(--blue); outline-offset: 1px; background: #ece9ff; }
.nd-card[data-id="changed"] .nd-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.nd-card[data-id="changed"] .nd-check { margin-top: 10px; }


.nd-ml-regroup { margin-top: 10px; }
.nd-ml-note { min-height: 1.2em; margin-top: 6px; font: 800 0.95rem/1.2 var(--round); color: #c0392b; text-align: center; }
.nd-ml-note:empty { display: none; }
.nd-ml-panel { display: flex; flex-direction: column; align-items: center; }
.nd-ml-panel.hidden { display: none; }
.nd-pv-chart td.swap { color: #c0392b; animation: ndValPop 0.45s ease-out; }


.nd-rg-outer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.nd-rg { width: 100%; box-sizing: border-box; padding: 8px 6px; border: 2px solid #c9c0f5; border-radius: 14px; background: #fbfaff; animation: ndZoomIn 0.2s ease-out; }
.nd-rg.hidden { display: none; }
.nd-rg-tip { text-align: center; font: 800 0.9rem/1.2 var(--round); color: var(--blue-dark); margin-bottom: 6px; }
.nd-rg-grid { display: grid; grid-template-columns: 1.1rem repeat(var(--rg-cols), minmax(0, 1fr)); align-items: end; }
.nd-rg-head { display: flex; justify-content: center; padding-bottom: 4px; }
.nd-rg-head .nd-ball { font-size: 0.55rem; min-width: 2em; }
.nd-rg-gut { font: 900 1.5rem/1 var(--round); color: var(--blue-dark); text-align: center; }
.nd-rg-gut.sign { border-bottom: 3px solid var(--blue-dark); padding-bottom: 4px; }
.nd-rg-mark { height: 1.2rem; text-align: center; font: 900 1rem/1.2 var(--round); color: #c0392b; }
.nd-rg-d { position: relative; height: 2.3rem; padding: 0; margin: 0; background: none; border: none; font: 900 clamp(1.15rem, 5.4vw, 1.6rem)/1 var(--round);
    color: var(--blue-dark); font-variant-numeric: tabular-nums; text-align: center; display: flex; align-items: center; justify-content: center; }
button.nd-rg-d { cursor: pointer; touch-action: manipulation; }
button.nd-rg-d:not(:disabled)::before { content: ""; position: absolute; inset: 2px 8%; border: 2px dashed #d8d1fb; border-radius: 8px; }
.nd-rg-d.bot { border-bottom: 3px solid var(--blue-dark); padding-bottom: 4px; }
.nd-rg-d.crossed { color: #9aa2b1; text-decoration: line-through 3px #c0392b; }
button.nd-rg-d { isolation: isolate; }
button.nd-rg-d.traded::before { border: 2px solid #2fa86a; background: #e5f7ec; z-index: -1; }
.nd-rg-cm { position: absolute; right: -0.12em; bottom: 0.2em; font-size: 0.8em; line-height: 1; color: var(--blue-dark); text-decoration: none; }
.nd-rg-d.bot .nd-rg-cm { bottom: 0.4em; }
.nd-rg-d.p0 { color: #2fa84a; } .nd-rg-d.p1 { color: #2f5fd8; } .nd-rg-d.p2 { color: #e0702a; } .nd-rg-d.p3 { color: #8a3fd8; }
.nd-rg-d.p4 { color: #d03c3c; } .nd-rg-d.p5 { color: #b5527a; } .nd-rg-d.p6 { color: #2a8f8f; }
.nd-rg-d.crossed { color: #9aa2b1; }
.nd-rg-d.nope { animation: ndCasNope 0.4s; }
.nd-rg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.nd-rg-note { font: 800 0.9rem/1.2 var(--round); color: #c0392b; }
.nd-rg-foot .nd-tf-again { margin: 0 0 0 auto; flex: none; }
@media print { .nd-rg-outer { display: none; } }


.nd-fx-work { background: #f7f9ff; border: 1.5px dashed #c9d6f5; border-radius: 12px; padding: 4px 10px; margin: 4px 0 10px; }
.nd-fx-row.line { display: block; }
.nd-fx-line { width: 100%; max-width: 420px; display: block; margin: 0 auto; color: var(--ink); touch-action: none; }
.nd-fx-line .nd-fx-dot { fill: #2f5fd0; stroke: #fff; stroke-width: 2; }
.nd-fx-line.pick { cursor: pointer; }
.nd-fx-pair { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.nd-fx-paren { font-weight: 800; font-size: 1.25rem; color: var(--muted); }
.nd-fx-judgerow { display: flex; gap: 12px; align-items: flex-start; }
.nd-fx-judge { display: flex; flex-direction: column; gap: 8px; flex: none; width: 150px; }
.nd-fx-call { min-height: 52px; font: 900 1.05rem/1 var(--round); border-radius: 14px; cursor: pointer; touch-action: manipulation; border: 2.5px solid; background: #fff; }
.nd-fx-call.ok { color: #1f8a53; border-color: #9fdcb9; }
.nd-fx-call.no { color: #c0392b; border-color: #f1b8b1; }
.nd-fx-call.ok.picked { background: #2fa86a; border-color: #2fa86a; color: #fff; }
.nd-fx-call.no.picked { background: #e74c3c; border-color: #e74c3c; color: #fff; }
.nd-fx-call:disabled { cursor: default; }
.nd-fx-call:disabled:not(.picked) { opacity: 0.4; }
.nd-fx-tools { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 0; flex: 1; }
.nd-fx-tool { min-height: 44px; text-align: center; }
.nd-fx-panels { display: flex; flex-direction: column; gap: 8px; }
.nd-fx-panels:has(> :not(.hidden):not(:has(> .hidden))) { margin-top: 8px; }
.nd-fx-panel.nd-mod, .nd-fx-panel.nd-rg-outer { width: 100%; margin: 0; }
.nd-fx-sup { padding: 10px; border: 2px solid #e1dbfb; border-radius: 14px; background: #fff; }
.nd-fx-sup.hidden { display: none; }
.nd-fx-sup .nd-pv-wrap { overflow-x: auto; }
.nd-fx-sup-tip { font-size: 0.85rem; color: var(--muted); font-weight: 700; text-align: center; margin-top: 4px; }
.nd-fx-msg { font-weight: 800; font-size: 0.98rem; margin-top: 8px; }
.nd-fx-msg:empty { display: none; }
.nd-fx-msg.yes { color: #1f8a53; }
.nd-fx-msg.try { color: #b35c00; }
.nd-fx-msg.told { color: var(--blue-dark); }
.nd-fx-card.wrongcall { border-left-color: #ff9f1c; }
.nd-fx-card.good { border-left-color: #2fa86a; }
.nd-fx-card.bad { border-left-color: #e74c3c; }
.nd-fx-card.bad > .nd-fx-work .nd-fx-pencil { color: #c0392b; border-color: #f1b8b1; }
.nd-fx-card.fixed { border-left-color: #2fa86a; background: #eefaf3; }
.nd-fx-fix { margin-top: 10px; padding: 10px 12px; border: 2.5px solid #ffcf3f; border-radius: 14px; background: #fffbea; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.nd-fx-fix.hidden { display: none; }
.nd-fx-fix .nd-fx-row.line, .nd-fx-fix > .nd-fx-line { width: 100%; }
.nd-fx-fix-title { font: 900 1.15rem/1 var(--round); color: #b35c00; }
.nd-fx-fix-msg { font-weight: 800; font-size: 0.92rem; color: #1f8a53; }
.nd-fx-fix-msg.try { color: #b35c00; }
.nd-fx-card.fixed .nd-fx-fix .nd-fx-pencil, .nd-fx-card.shown .nd-fx-fix .nd-fx-pencil { color: #1f8a53; border-color: #9fdcb9; background: #fff; }
.nd-fx-headtools { display: flex; justify-content: center; margin-top: 8px; }
.nd-fx-done-text.q { font-style: italic; color: var(--muted); }
@media (max-width: 360px) { .nd-fx-judge { width: 128px; } }


.nd-fxi { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; overflow: hidden; cursor: pointer;
    background: radial-gradient(circle at 50% 45%, #ffcf3f 0%, #ff8a3d 38%, #7d3cff 100%); animation: ndFxiIn 0.25s ease-out; }
.nd-fxi.out { animation: ndFxiOut 0.32s ease-in forwards; }
.nd-fxi-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(rgba(255, 255, 255, 0.16) 0 10deg, transparent 10deg 20deg); animation: ndFxiSpin 6s linear infinite; }
.nd-fxi-card { position: relative; text-align: center; padding: 0 16px; }
.nd-fxi-l1, .nd-fxi-l2 { font: 900 clamp(3rem, 17vw, 7rem)/0.95 var(--round); color: #fff; letter-spacing: 0.02em;
    text-shadow: 0 5px 0 #c2410c, 0 10px 18px rgba(60, 20, 120, 0.45); -webkit-text-stroke: 2px #5b21b6; }
.nd-fxi-l2 { color: #ffe14d; }
.nd-fxi-l1 span, .nd-fxi-l2 span { display: inline-block; animation: ndFxiPop 0.5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 70ms); }
.nd-fxi-sub { margin-top: 14px; font: 800 clamp(1rem, 4.5vw, 1.5rem)/1.2 var(--round); color: #fff; text-shadow: 0 2px 6px rgba(60, 20, 120, 0.5);
    animation: ndFxiPop 0.45s ease-out 0.95s both; }
.nd-fxi-glass { position: absolute; top: -10%; left: 0; font-size: clamp(3rem, 14vw, 5.5rem); animation: ndFxiSweep 1.9s ease-in-out 0.2s both; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3)); }
.nd-fxi-skip { position: absolute; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); font: 800 1rem/1 var(--round); color: #5b21b6; background: #fff;
    border: none; border-radius: 999px; padding: 12px 20px; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); }
@keyframes ndFxiIn { from { opacity: 0; } }
@keyframes ndFxiOut { to { opacity: 0; transform: scale(1.06); } }
@keyframes ndFxiSpin { to { transform: rotate(360deg); } }
@keyframes ndFxiPop { 0% { opacity: 0; transform: translateY(-60px) scale(0.4) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
@keyframes ndFxiSweep { 0% { transform: translate(-30vw, 20px) rotate(-20deg); opacity: 0; } 15% { opacity: 1; } 55% { transform: translate(45vw, 60px) rotate(10deg); }
    85% { transform: translate(70vw, 10px) rotate(-5deg); opacity: 1; } 100% { transform: translate(110vw, 30px); opacity: 0; } }
.nd-fxi.calm *, .nd-fxi.calm { animation: none !important; }
.nd-fxi.calm .nd-fxi-glass { display: none; }


.nd-fx-print { display: none; }
@media print {
    body.fx-printing > :not(.nd-fx-print) { display: none !important; }
    body.fx-printing .nd-fx-print { display: block; color: #000; font-family: "Andika", Arial, sans-serif; }
    .fxp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid #000; padding-bottom: 6px; }
    .fxp-brand { font-size: 20pt; font-weight: 700; }
    .fxp-meta { font-size: 10pt; }
    .fxp-name { margin-left: auto; font-size: 11pt; }
    .fxp-number { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
    .fxp-number-label { font-style: italic; font-size: 11pt; }
    .fxp-number b { font-size: 22pt; border: 2px solid #000; border-radius: 50%; padding: 4px 18px; }
    .fxp-how { font-size: 10.5pt; margin: 4px 0 8px; }
    .fxp-tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
    .fxp-task { border: 1px solid #000; border-radius: 6px; padding: 6px 8px; break-inside: avoid; display: flex; flex-direction: column; gap: 4px; }
    .fxp-title { font-weight: 700; font-size: 10.5pt; }
    .fxp-prompt { font-size: 9.5pt; }
    .fxp-work .nd-fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11pt; margin: 0; }
    .fxp-work .nd-fx-pencil { border: 1px solid #777; border-radius: 4px; padding: 0 5px; color: #000; background: none; }
    .fxp-work .nd-fx-row.words .nd-fx-pencil { border: none; border-bottom: 1px dashed #777; border-radius: 0; }
    .fxp-work .nd-fx-line { max-width: 3.2in; color: #000; }
    .fxp-work .nd-fx-dot { fill: #000; }
    .fxp-call { font-size: 10.5pt; }
    .fxp-fix { font-size: 10pt; font-weight: 700; border: 1px solid #000; border-radius: 4px; min-height: 0.75in; padding: 3px 5px; }
}


.nd-fb { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; }
.nd-fb-bar { display: grid; grid-template-columns: repeat(10, 1fr); width: min(100%, 300px); height: 40px; border: 2.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.nd-fb-bar span { border-right: 1.5px solid var(--ink); background: #fff; }
.nd-fb-bar span:last-child { border-right: none; }
.nd-fb-bar span.on { background: var(--blue); }
.nd-fb-eq { font: 900 1.5rem/1 var(--round); color: var(--ink); display: flex; align-items: center; gap: 6px; }
.nd-fb-places { display: flex; gap: 14px; justify-content: center; }
.nd-fb-places > div { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.78rem; font-weight: 800; color: var(--muted); }

.nd-dp { --dps: 18px; display: flex; align-items: flex-start; justify-content: center; gap: 14px; margin-top: 10px; }
.nd-dp-point { font: 900 2.6rem/1 var(--round); color: #d9480f; margin: -6px -8px 0 0; }
.nd-dp-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; }
.nd-dp-digit { font: 900 2rem/1 var(--round); color: var(--ink); }
.nd-dp-name { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-align: center; }
.nd-dp-model.m1 { display: grid; grid-template-rows: repeat(10, var(--dps)); width: var(--dps); gap: 2px; }
.nd-dp-model.m1 span, .nd-dp-model.m2 { width: var(--dps); height: var(--dps); box-sizing: border-box; background: var(--blue); border: 1.5px solid var(--blue-dark); border-radius: 2px; }
.nd-dp-model.m3 { width: var(--dps); height: var(--dps); box-sizing: border-box; display: flex; gap: 0; border: 2px solid #ff8a3d; background: #fff; border-radius: 2px; }
.nd-dp-model.m3 span { flex: 1; border-right: 1px solid #ffb27a; }
.nd-dp-model.m3 span:last-child { border-right: none; }
.nd-dp-model.m3 span.on { background: #7d3cff; }

.nd-shade-stage { position: relative; width: 100%; max-width: 300px; }
.nd-piece.split { position: relative; gap: 0; padding: 0; cursor: zoom-in; }
.nd-piece.split span { border-right: 1px solid #ffb27a; }
.nd-piece.split span.on { background: #7d3cff; }
.nd-piece.split.zooming { outline: 3px solid #7d3cff; outline-offset: 1px; }
.nd-zoom-tag { position: absolute; right: -7px; top: -9px; font-style: normal; font-size: 13px; line-height: 1; background: #fff; border-radius: 50%; padding: 1px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); pointer-events: none; }
.nd-sqzoom { position: absolute; right: 0; bottom: calc(10% + 10px); z-index: 5; width: min(100%, 270px); box-sizing: border-box; padding: 10px; background: #fff;
    border: 3px solid #ff8a3d; border-radius: 14px; box-shadow: 0 10px 24px rgba(40, 20, 100, 0.25); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nd-sqzoom.hidden { display: none; }
.nd-sqzoom::after { content: ""; position: absolute; right: 8px; bottom: -11px; border: 9px solid transparent; border-top-color: #ff8a3d; border-bottom: 0; }
.nd-sqzoom .nd-slivers { width: 100%; height: auto; aspect-ratio: 1; padding: 0; gap: 0; border: 2.5px solid #ff8a3d; border-radius: 3px; }
.nd-sqzoom .nd-sliver { border: none; border-right: 1.5px solid #ffb27a; border-radius: 0; }
.nd-sqzoom .nd-sliver:last-child { border-right: none; }
.nd-sqzoom .nd-sliver.on { background: #7d3cff; border-color: #5b21b6; }
.nd-sqzoom-done { font: 800 0.95rem/1 var(--round); color: #fff; background: #7d3cff; border: none; border-radius: 999px; padding: 10px 22px; cursor: pointer; min-height: 40px; }


.nd-pzs-outer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 10px; }
.nd-pzs { width: 100%; box-sizing: border-box; padding: 12px 10px; border: 2px solid #ffd7a8; border-radius: 14px; background: #fffaf2; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nd-pzs.hidden { display: none; }
.nd-pzs-eq { font: 900 1.6rem/1 var(--round); color: var(--ink); display: flex; align-items: center; gap: 6px; }
.nd-pzs-row { display: flex; align-items: flex-start; justify-content: center; gap: 8px; width: 100%; }
.nd-pzs-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nd-pzs-side.whole { flex: 2; }
.nd-pzs-side.part { flex: 1; }
.nd-pzs-num { font: 900 1.8rem/1 var(--round); color: #b8322a; }
.nd-pzs-pies { display: flex; gap: 6px; justify-content: center; }
.nd-pzs-pies svg { width: clamp(64px, 22vw, 110px); height: auto; }
.nd-pzs-lab { font-size: 0.82rem; font-weight: 800; color: var(--muted); text-align: center; display: flex; align-items: center; gap: 4px; }
.nd-pzs-point { font: 900 3.4rem/1 var(--round); color: #d9480f; margin-top: -14px; }


.nd-bn-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.nd-bn.side { display: grid; grid-template-rows: auto auto; column-gap: 4px; row-gap: 8px; width: max-content; min-width: 100%; align-items: stretch; }
.nd-bn.side .nd-bn-group { grid-template-columns: repeat(3, max-content); align-content: end; padding: 8px 6px; }
.nd-bn.side .nd-bn-eq, .nd-bn.side.places-4 .nd-bn-eq { flex-direction: row; justify-content: center; align-items: center; gap: 3px; width: auto; font-size: 1rem; white-space: nowrap; }
.nd-bn.side .nd-bn-eq .nd-input { width: 2.2em; padding: 6px 2px; }
.nd-bn-plus { align-self: center; font: 900 1.1rem/1 var(--round); color: var(--blue-dark); padding: 0 1px; }


.nd-rg-anscell { position: relative; display: flex; justify-content: center; padding-top: 6px; }
.nd-rg-ans { width: min(2.3rem, 92%); height: 2.6rem; box-sizing: border-box; text-align: center; font: 900 clamp(1.15rem, 5.4vw, 1.6rem)/1 var(--round);
    border: 2px solid #c9c0f5; border-radius: 9px; background: #fff; color: var(--ink); padding: 0; }
.nd-rg-ans:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.nd-rg-anscell .nd-rg-cm { right: -0.18em; bottom: 0.15em; font: 900 1.4rem/1 var(--round); }
.nd-rg-ans.p0 { color: #2fa84a; } .nd-rg-ans.p1 { color: #2f5fd8; } .nd-rg-ans.p2 { color: #e0702a; } .nd-rg-ans.p3 { color: #8a3fd8; } .nd-rg-ans.p4 { color: #d03c3c; } .nd-rg-ans.p5 { color: #b5527a; }
.nd-rg-btns { display: flex; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.nd-rg-btns .nd-tf-again, .nd-rg-btns .nd-check { margin: 0; }
.nd-rg-work .nd-rg-note:empty { display: none; }
.nd-card.ok .nd-rg-ans { border-color: #2fa86a; background: #e5f7ec; }
.nd-card.no .nd-rg-ans { border-color: var(--red); }
@media print { .nd-rg-outer:has(.nd-rg-work) { display: block; } }


.nd-fx-cards { width: 100%; }

.nd-card[data-fix] .nd-body .nd-check { display: none !important; }
.nd-card[data-fix] .nd-one-try { display: none; }
.nd-fx-judge { display: flex; flex-direction: row; gap: 10px; width: auto; margin-top: 12px; }
.nd-fx-judge .nd-fx-call { flex: 1 1 0; width: auto; max-width: 220px; }
.nd-card.fx-try { box-shadow: 0 0 0 3px #ffcf7a; }
.nd-card.fx-bad { box-shadow: 0 0 0 3px #f1b8b1; }
.nd-card.fx-good, .nd-card[data-fix].ok { box-shadow: 0 0 0 3px #9fdcb9; }
.nd-card.fx-shown { box-shadow: 0 0 0 3px #b9b2dd; }
.nd-card[data-fix] .nd-fx-msg:empty { display: none; }



.nd-pvb { display: flex; flex-wrap: wrap; gap: 14px; width: 100%; align-items: flex-start; }
.nd-pvb-sec { flex: 1 1 290px; min-width: 0; box-sizing: border-box; padding: 10px 8px 12px; border: 2px solid #e4def9; border-radius: 14px; background: #fbfaff; }
.nd-pvb-head { margin: 0 0 8px; text-align: center; font: 900 0.95rem/1.2 var(--round); color: var(--blue-dark); }
.nd-pvb-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.nd-pvb-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.nd-pvb-col .nd-ball { min-width: 3.2em; }
.nd-pvb-pieces { position: relative; width: 74px; max-width: 100%; height: 76px; }
.nd-pvb-pieces .nd-bw-b { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.nd-pvb-pieces.p3 .nd-bw-b, .nd-pvb-pieces.p2 .nd-bw-b { position: absolute; width: 42px; height: 42px; }
.nd-pvb-pieces.p3 .nd-bw-b { box-shadow: none; }
.nd-pvb-pieces.p2 .nd-bw-b { width: 40px; height: 40px; background-size: auto;
    background-image: repeating-linear-gradient(90deg, transparent 0 3.6px, rgba(0, 0, 0, 0.18) 3.6px 4px), repeating-linear-gradient(0deg, transparent 0 3.6px, rgba(0, 0, 0, 0.18) 3.6px 4px); }
.nd-pvb-pieces.p1 { display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.nd-pvb-pieces.p1 .nd-bw-b { width: 7px; height: 40px; background-size: auto; background-image: repeating-linear-gradient(0deg, transparent 0 3.6px, rgba(0, 0, 0, 0.22) 3.6px 4px); }
.nd-pvb-pieces.p0 { display: grid; grid-template-columns: repeat(3, 9px); grid-auto-rows: 9px; gap: 3px; align-content: end; justify-content: center; }
.nd-pvb-pieces.p0 .nd-bw-b { width: 9px; height: 9px; }
.nd-pvb-ctl { display: flex; align-items: center; gap: 3px; }
.nd-pvb-ctl .nd-mod-btn { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 9px; }
.nd-pvb-ctl .nd-mod-count { min-width: 0.9em; font-size: 1rem; }
.nd-pvb-eq, .nd-pvb-deq { display: flex; align-items: center; gap: 3px; font: 800 0.9rem/1 var(--round); color: var(--blue-dark); white-space: nowrap; }
.nd-pvb-eq { flex-direction: column; gap: 4px; }
.nd-pvb-box { width: 2.3em; text-align: center; padding: 6px 2px; font-size: 1.15rem; border-width: 3px; }
.nd-pvb-box.p3 { border-color: #b98ae8; } .nd-pvb-box.p2 { border-color: #f2a865; } .nd-pvb-box.p1 { border-color: #7fa6ef; } .nd-pvb-box.p0 { border-color: #7fd08e; }
.nd-pvb-box.pm1 { border-color: #f08cbf; background: #fff3f9; } .nd-pvb-box.pm2 { border-color: #6fc3e8; background: #f0f9fd; } .nd-pvb-box.pm3 { border-color: #d8b93a; background: #fffbe8; }
.nd-pvb-box.bad { border-color: var(--red); }
.nd-card.ok .nd-pvb-box { border-color: #2fa86a; background: #e5f7ec; }
.nd-pvb-decbody { display: flex; gap: 12px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.nd-pvb-flatcol { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nd-pvb-flat { display: grid; grid-template-rows: repeat(10, 15px); grid-auto-flow: column; grid-auto-columns: 15px; gap: 1px; padding: 2px; background: #9aa2b1; border: 2px solid #3a3f4b; border-radius: 3px; touch-action: manipulation; }
.nd-pvb-sq { position: relative; display: block; background: #fff; cursor: pointer; }
.nd-pvb-sq.ten { background: #f06aa9; }
.nd-pvb-sq.hun { background: #3fa9dc; }
.nd-pvb-sq.next { background: linear-gradient(90deg, #e2bb1c 0 var(--th), #fff var(--th)); }
.nd-pvb-lens { position: absolute; left: 11px; top: -15px; width: 26px; height: 26px; padding: 0; border: 2px solid #a88400; border-radius: 50%; background: #fffbe8; font-size: 14px; line-height: 1; cursor: pointer; z-index: 2; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.nd-pvb-zoom { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 167px; box-sizing: border-box; padding: 8px; background: #fff; border: 2px solid #a88400; border-radius: 12px; }
.nd-pvb-zoom.hidden { display: none; }
.nd-pvb-zoomcap { font: 800 0.85rem/1.2 var(--round); color: #7a6000; text-align: center; }
.nd-pvb-big { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 140px; height: 140px; padding: 3px; border: 2px solid #3a3f4b; background: #9aa2b1; box-sizing: border-box; }
.nd-pvb-strip { padding: 0; border: none; background: #fff; cursor: pointer; touch-action: manipulation; }
.nd-pvb-strip.on { background: #e2bb1c; }
.nd-pvb-under { display: flex; flex-direction: column; gap: 6px; }
.nd-pvb-decrow { display: flex; align-items: center; gap: 6px; }
.nd-pvb-decrow .nd-ball { min-width: 2.6em; }
.nd-pvb-decboxes { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.nd-pvb-deq { display: grid; grid-template-columns: auto auto; column-gap: 5px; row-gap: 3px; justify-items: start; align-items: center; }
.nd-pvb-name { grid-column: 1 / -1; font-size: 0.85rem; }
.nd-pvb-deq.pm1 .nd-pvb-name { color: #c4307a; } .nd-pvb-deq.pm2 .nd-pvb-name { color: #1f7fae; } .nd-pvb-deq.pm3 .nd-pvb-name { color: #8a6c00; }
.nd-pvb-cols.cols-4 .nd-pvb-ctl { gap: 1px; }
.nd-pvb-cols.cols-4 .nd-mod-btn { width: 25px; height: 30px; font-size: 1rem; border-radius: 7px; }
@media (max-width: 360px) { .nd-pvb-cols { gap: 3px; } .nd-pvb-pieces { width: 64px; } .nd-pvb-pieces.p3 .nd-bw-b { width: 36px; height: 36px; } .nd-pvb-pieces.p2 .nd-bw-b { width: 34px; height: 34px; } .nd-pvb-ctl .nd-mod-btn { width: 28px; height: 28px; } }
@media print { .nd-pvb { display: none; } }


.nd-probe.here rect { fill: #e5f7ec; stroke: #2fa86a; }
.nd-probe.here path, .nd-probe.here circle { fill: #2fa86a; }
.nd-probe.here text { fill: #1d7a48; }
.nd-round-nudge { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 0 0 8px; }
.nd-round-nudge .nd-mod-btn { width: 40px; height: 34px; }
.nd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


.nd-fex-ex { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 2px; }
.nd-fex-row { display: flex; align-items: flex-end; gap: 6px; }
.nd-fex-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nd-fex-d { font: 900 1.6rem/1 var(--round); }
.nd-fex-col.p0 .nd-fex-d, .nd-fex-w { color: #5b6b5e; }
.nd-fex-col.pm1 .nd-fex-d, .nd-fex-ex .pm1 { color: #c4307a; } .nd-fex-col.pm2 .nd-fex-d, .nd-fex-ex .pm2 { color: #1f7fae; } .nd-fex-col.pm3 .nd-fex-d, .nd-fex-ex .pm3 { color: #8a6c00; }
.nd-fex-point { font: 900 1.8rem/1 var(--round); color: #d03c3c; padding-bottom: 2px; }
.nd-fex-eq { display: flex; align-items: center; gap: 8px; font: 900 1.6rem/1 var(--round); color: var(--ink); }
.nd-fex-frac { display: inline-flex; flex-direction: column; align-items: center; font-size: 1.25rem; }
.nd-fex-num { padding: 0 4px 3px; border-bottom: 3px solid var(--ink); }
.nd-fex-den { padding-top: 3px; }
.nd-tint { margin: 8px auto 4px; padding: 8px 14px; width: fit-content; border-radius: 12px; background: #fff; border: 2px solid #e4def9; font: 900 1.8rem/1.2 var(--round); letter-spacing: 0.02em; color: var(--ink); }
.nd-tint.hidden { display: none; }
.nd-tint .d { padding: 0 1px; border-radius: 5px; }
.nd-tint .d.p3 { background: #f1e3ff; color: #6a2fb0; } .nd-tint .d.p2 { background: #ffe9d6; color: #b8561a; }
.nd-tint .d.p1 { background: #e1ecff; color: #2550b5; } .nd-tint .d.p0 { background: #e0f6e4; color: #217a37; }
.nd-tint .dec { color: #a3a8b4; }


.pr-pvb { display: flex; gap: 0.25in; align-items: flex-start; }
.pr-pvb-sec { border: 1.5px solid #000; border-radius: 6px; padding: 5px 7px 7px; }
.pr-pvb-sec.whole { flex: 1 1 auto; }
.pr-pvb-head { font-size: 10pt; font-weight: 800; text-align: center; margin-bottom: 4px; }
.pr-pvb-cols { display: flex; gap: 0.12in; justify-content: space-around; }
.pr-pvb-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pr-pvb-col b { font-size: 9pt; }
.pr-pvb-blocks { display: grid; grid-template-columns: repeat(3, auto); gap: 2px; justify-content: center; align-content: end; height: 0.95in; }
.pr-pvb-blocks.rods { grid-template-columns: repeat(9, auto); }
.pr-pvb-blocks .pr-block.cube, .pr-pvb-blocks .pr-block.flat { width: 0.28in; height: 0.28in; }
.pr-pvb-blocks .pr-block.rod { width: 0.08in; height: 0.6in; }
.pr-pvb-blocks .pr-block.unit { width: 0.1in; height: 0.1in; }
.pr-box.sm { width: 0.42in; height: 0.36in; }
.pr-pvb-decbody { display: flex; gap: 0.15in; align-items: flex-start; }
.pr-pvb .pr-grid.parts-100 { grid-template-columns: repeat(10, 0.12in); }
.pr-pvb-thou { font-size: 8pt; margin-top: 4px; }
.pr-pvb-strips { display: grid; grid-template-columns: repeat(10, 0.1in); height: 0.5in; border: 1px solid #000; width: max-content; margin-top: 2px; }
.pr-pvb-strips span { border-right: 1px solid #000; }
.pr-pvb-strips span:last-child { border-right: none; }
.pr-pvb-decboxes { display: flex; flex-direction: column; gap: 8px; font-size: 10pt; }
.pr-pvb-decboxes b { display: block; font-size: 9pt; }
.pr-numline.round svg { height: auto; max-height: 0.8in; }
.pr-numline.round path { fill: none; stroke: #000; stroke-width: 1.6; }
.pr-numline.round text { font-size: 11px; font-weight: 700; text-anchor: middle; }


.nd-rg-anscell.carrying { cursor: grab; touch-action: none; align-items: center; gap: 1px; }
.nd-rg-anscell.carrying .nd-rg-ans { width: min(2rem, 46%); pointer-events: none; }
.nd-rg-chip { font: 900 clamp(1.15rem, 5.4vw, 1.6rem)/1 var(--round); padding: 0 3px; border-radius: 8px; background: #fff6c8; box-shadow: 0 0 0 2px #f2c94c; animation: ndChipNudge 1.4s ease-in-out infinite; }
.nd-rg-chip.lifted { opacity: 0.25; animation: none; }
@keyframes ndChipNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3px); } }
.nd-rg-chip.p0 { color: #2fa84a; } .nd-rg-chip.p1 { color: #2f5fd8; } .nd-rg-chip.p2 { color: #e0702a; } .nd-rg-chip.p3 { color: #8a3fd8; } .nd-rg-chip.p4 { color: #d03c3c; } .nd-rg-chip.p5 { color: #b5527a; }
.nd-rg-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -60%); font: 900 1.7rem/1 var(--round); padding: 4px 10px; border-radius: 12px; background: #fff; box-shadow: 0 6px 16px rgba(40, 30, 120, 0.3); white-space: nowrap; }
.nd-rg-ghost.p1 { color: #2f5fd8; } .nd-rg-ghost.p2 { color: #e0702a; } .nd-rg-ghost.p3 { color: #8a3fd8; } .nd-rg-ghost.p4 { color: #d03c3c; } .nd-rg-ghost.p5 { color: #b5527a; } .nd-rg-ghost.p6 { color: #2a8f8f; } .nd-rg-ghost.p7 { color: #6b4e1e; }
.nd-rg-grid .over { background: #efeaff; border-radius: 8px; }
button.nd-rg-d.took::before { z-index: -1; }
.nd-rg-d.pop { animation: ndTookPop 0.3s ease-out; }
@keyframes ndTookPop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .nd-rg-chip, .nd-rg-d.pop { animation: none; } }


.nd-compare-eq { flex-wrap: nowrap; gap: 10px; margin: 8px 0 26px; }
.nd-compare-n { white-space: nowrap; font-size: var(--cmp-fs, 1.5rem); }
.nd-compare-eq .nd-compare-slot { flex: none; }
@media print { .nd-compare-eq { display: flex !important; } .nd-compare-slot { background: #fff; } }

.pr-cmp { display: flex; align-items: center; justify-content: center; gap: 0.14in; white-space: nowrap; font-size: 14pt; font-weight: 800; margin-top: 0.06in; }
.pr-cmp-box { display: inline-block; width: 0.5in; height: 0.44in; border: 1.5px solid #000; border-radius: 6px; flex: none; }
.pr-cmp-syms { display: flex; justify-content: center; gap: 0.3in; margin-top: 0.16in; font-size: 18pt; font-weight: 800; }
.pr-cmp-syms span { display: inline-flex; align-items: center; justify-content: center; width: 0.42in; height: 0.36in; border: 1.2px dashed #777; border-radius: 6px; }


.nd-vpop { position: absolute; left: 50%; top: 0; z-index: 30; transform: translate(-50%, calc(-100% - 6px)); pointer-events: none; white-space: nowrap;
    font: 900 1.25rem/1 var(--round); color: var(--blue-dark); background: #fff6c8; padding: 6px 10px; border-radius: 10px;
    box-shadow: 0 0 0 2px #f2c94c, 0 6px 14px rgba(40, 30, 120, 0.22); animation: ndVpopIn 0.18s ease-out; transition: opacity 0.4s; }
.nd-vpop.out { opacity: 0; }
@keyframes ndVpopIn { from { opacity: 0; transform: translate(-50%, calc(-100% + 4px)); } }
.nd-cas, .nd-ct-digit, .nd-cas-digit { position: relative; }
.nd-ct-num { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin-top: 30px; }
.nd-ct-digit { min-width: 44px; height: 54px; padding: 0 6px; border: 2px solid currentColor; border-radius: 10px; background: #fff;
    font: 900 2rem/1 var(--round); cursor: pointer; font-variant-numeric: tabular-nums; }
.nd-ct-digit.p0 { color: #2fa84a; } .nd-ct-digit.p1 { color: #2f5fd8; } .nd-ct-digit.p2 { color: #e0702a; } .nd-ct-digit.p3 { color: #8a3fd8; }
.nd-ct-digit:active { transform: translateY(1px); }
.nd-ct-comma { font: 900 2rem/1 var(--round); color: var(--ink); padding-bottom: 4px; }
.nd-ct-numtip { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-align: center; margin-top: -4px; }
@media print { .nd-ct-num, .nd-ct-numtip { display: none; } }


.nd-hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #b7acf2 transparent; padding-bottom: 6px; }
.nd-hscroll::-webkit-scrollbar { height: 6px; }
.nd-hscroll::-webkit-scrollbar-thumb { background: #b7acf2; border-radius: 3px; }
.nd-swipe-cue { flex: 0 0 100%; width: 100%; box-sizing: border-box; font-size: 0.8rem; font-weight: 800; color: var(--blue-dark); text-align: right; margin-top: -2px; animation: ndCue 1.6s ease-in-out infinite; }
.nd-swipe-cue[hidden] { display: none; }
@keyframes ndCue { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-5px); } }
@media (prefers-reduced-motion: reduce) { .nd-swipe-cue { animation: none; } }
@media print { .nd-swipe-cue { display: none; } }

.nd-fields.beside.nd-hscroll { flex-wrap: nowrap; justify-content: flex-start; width: 100%; }
.nd-fields.beside.nd-hscroll > :first-child { margin-left: auto; }
.nd-fields.beside.nd-hscroll > :last-child { margin-right: auto; }
.nd-fields.beside.nd-hscroll .nd-field { flex: none; }

.nd-pvb.nd-hscroll { flex-wrap: nowrap; }
.nd-pvb.nd-hscroll .nd-pvb-sec { flex: 1 0 300px; }
.nd-pvb.nd-hscroll .nd-pvb-sec.whole { flex-basis: max(300px, calc(var(--pvb-cols, 4) * 74px)); }


.nd-dd-col, .nd-ct-col { justify-content: flex-start; }
.nd-dd-col .nd-dd-label, .nd-ct-col .nd-dd-label { width: 100%; min-height: 2.7em; display: flex; align-items: center; justify-content: center; box-sizing: border-box; line-height: 1.15; }
.nd-dd-slot { min-height: 72px; flex: none; }
.nd-ct-area { min-height: 100px; }
.nd-dd-tray { max-width: 100%; box-sizing: border-box; gap: clamp(6px, 2.5vw, 14px); padding: 6px clamp(6px, 2.5vw, 14px); }
.nd-dd-tray .nd-dd-chip { min-width: clamp(48px, 15vw, 64px); }
.nd-ct-src.places-4 .nd-ct-srcbox { padding: 8px 2px; min-width: 0; }
.nd-ct-src.places-4 .nd-ct-coin { width: clamp(40px, 12vw, 52px); height: clamp(40px, 12vw, 52px); font-size: 1rem; }
.nd-ct-src.places-4 .nd-ct-coin.w1000 { font-size: 0.72rem; }
.nd-ct-src .nd-ct-srcbox, .nd-ct-col { min-width: 0; }
.nd-ct-coin, .nd-dd-chip { display: inline-flex; align-items: center; justify-content: center; }


.pr-nline { display: flex; align-items: flex-end; justify-content: center; gap: 0.06in; margin-top: 0.06in; }
.pr-ncol { display: flex; flex-direction: column; align-items: center; gap: 0.06in; min-width: 0; }
.pr-nterm { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11pt; font-weight: 800; white-space: nowrap; }
.pr-nterm .pr-box { width: 0.72in; height: 0.42in; }
.pr-nline.places-6 .pr-nterm .pr-box, .pr-nline.places-7 .pr-nterm .pr-box { width: 0.62in; }
.pr-nline.places-7 .pr-nterm { font-size: 10pt; }
.pr-nplus { font-size: 14pt; font-weight: 800; align-self: flex-end; padding-bottom: 0.3in; }
.pr-nline.blocks { justify-content: space-between; }
.pr-nline.blocks .pr-ncol { flex: 1 1 0; }
.pr-nblocks { display: grid; grid-template-columns: repeat(3, max-content); gap: 3px; justify-content: center; align-content: end; }
.pr-nblocks .pr-block.cube, .pr-nblocks .pr-block.flat { width: 0.42in; height: 0.42in; }
.pr-nblocks.rods { gap: 3px 6px; }
.pr-nblocks .pr-block.rod { width: 0.11in; height: 0.48in; }
.pr-nblocks .pr-block.unit { width: 0.16in; height: 0.16in; }
.pr-nline.places-2 .pr-nblocks .pr-block.flat, .pr-nline.places-3 .pr-nblocks .pr-block.flat { width: 0.5in; height: 0.5in; }
.pr-cols { display: grid; grid-template-columns: 0.3in repeat(var(--k), 0.42in); justify-content: center; align-items: center; row-gap: 0.04in;
    font-size: 17pt; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0.04in auto 0; }
.pr-cd, .pr-cop { display: flex; align-items: center; justify-content: center; height: 0.4in; }
.pr-carry { display: block; width: 0.26in; height: 0.24in; border: 1.2px dashed #777; border-radius: 4px; }
.pr-crule { grid-column: 1 / -1; border-top: 2px solid #000; height: 0; }
.pr-cols .pr-box { width: 0.34in; height: 0.38in; }
.pr-cols.many { grid-template-columns: 0.24in repeat(var(--k), 0.36in); font-size: 14pt; }
.pr-cols.many .pr-box { width: 0.3in; height: 0.34in; }
.pr-cols.many .pr-carry { width: 0.22in; height: 0.22in; }
.pr-cols.many .pr-cd, .pr-cols.many .pr-cop { height: 0.36in; }

@media (max-width: 360px) {
    .nd-cb { column-gap: 4px; }
    .nd-cb-model { gap: 3px; }
    .nd-cb-rods { grid-template-columns: repeat(5, 11px); gap: 2px; }
    .nd-cb-ones { grid-template-columns: repeat(3, 11px); }
    .nd-cb .nd-block.rod, .nd-cb .nd-block.unit { width: 11px; }
    .nd-cb .nd-block.unit { height: 11px; }
}


.nd-xn-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.nd-xn { display: grid; grid-template-rows: auto auto; column-gap: 4px; row-gap: 8px; align-items: end; min-width: min-content; margin: 0 auto; }
.nd-xn-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; align-self: stretch; justify-content: flex-end; }
.nd-xn-tray { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; min-height: 128px; padding: 6px 4px; box-sizing: border-box;
    border: 2px dashed #b9b3e6; border-radius: 12px; background: #fff; cursor: pointer; touch-action: manipulation; font: inherit; color: inherit; flex: 1; }
.nd-xn-tray:active { background: #f3f1ff; }
.nd-xn-tray.empty::after { content: 'Tap to add'; font-size: 0.72rem; color: var(--muted, #6b6892); margin-top: auto; }
.nd-xn-tray.bad, .nd-xn-flat.bad { border-color: var(--red, #e5484d); border-style: solid; }
.nd-card.ok .nd-xn-tray { border-style: solid; border-color: #2fa86a; background: #e5f7ec; }
.nd-xn-pile { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; gap: 3px; width: 100%; flex: 1; }
.nd-xn-pile .nd-bw-b { pointer-events: none; }
.nd-xn-pile .nd-bw-b.p0 { width: 13px; height: 13px; }
.nd-xn-pile .nd-bw-b.p1 { width: 9px; height: 38px; background-size: 100% 3.8px; }
.nd-xn-pile .nd-bw-b.p2 { width: 24px; height: 24px; }
.nd-xn-pile .nd-bw-b.p3 { width: 26px; height: 26px; }
.nd-xn-pile .nd-bw-b.p4 { width: 28px; height: 28px; }
.nd-xn-big { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 22px; padding: 0 3px; border-radius: 5px; font: 800 0.6rem/1 var(--round, sans-serif); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.nd-xn-big.p5 { background: #b5527a; } .nd-xn-big.p6 { background: #2a8f8f; }
.nd-xn-minus { width: 38px; height: 30px; border-radius: 10px; border: 2px solid #d6d1f3; background: #fff; font: 800 1.1rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); cursor: pointer; }
.nd-xn-minus:disabled { opacity: 0.3; cursor: default; }
.nd-xn-eq { display: flex; align-items: center; justify-content: center; gap: 4px; font: 800 0.98rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); white-space: nowrap; }
.nd-xn-eq .nd-input { width: 2.3em; min-width: 0; text-align: center; padding: 6px 2px; }
.nd-xn-plus { font: 800 1.1rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); align-self: center; padding: 0 1px; }
.nd-xn-deccell { padding: 0 4px; }
.nd-xn-flatlab { font: 800 0.8rem/1 var(--round, sans-serif); color: var(--muted, #6b6892); }
.nd-xn-flat { display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr); grid-auto-flow: column; width: 180px; height: 180px;
    border: 2px solid #3a2c9e; background: #fff; box-sizing: content-box; touch-action: manipulation; }
.nd-xn-sq { position: relative; box-sizing: border-box; cursor: pointer; }
.nd-xn-flat.lv0 .nd-xn-sq { cursor: default; }
.nd-xn-flat.lv1 .nd-xn-sq { border-right: 1px solid #8f86d6; }
.nd-xn-flat.lv2 .nd-xn-sq, .nd-xn-flat.lv3 .nd-xn-sq { border-right: 1px solid #b2abe6; border-bottom: 1px solid #b2abe6; }
.nd-xn-flat.lv3 .nd-xn-sq { background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 0.5px), rgba(58, 44, 158, 0.18) calc(10% - 0.5px) 10%); }
.nd-xn-sq.ten { background-color: #ff9fc4; }
.nd-xn-sq.hun { background-color: #8fb8ff; }
.nd-xn-flat.lv3 .nd-xn-sq.next { background-image: linear-gradient(90deg, #ffc83d 0 var(--th), transparent var(--th)), repeating-linear-gradient(90deg, transparent 0 calc(10% - 0.5px), rgba(58, 44, 158, 0.35) calc(10% - 0.5px) 10%);
    outline: 2px dashed #d99a00; outline-offset: -1px; z-index: 1; }
.nd-xn-cut { display: flex; align-items: center; justify-content: center; gap: 8px; }
.nd-xn-step { width: 40px; height: 34px; border-radius: 10px; border: 2px solid #d6d1f3; background: #fff; font: 800 1.2rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); cursor: pointer; }
.nd-xn-step:disabled { opacity: 0.3; cursor: default; }
.nd-xn-level { min-width: 7.2em; text-align: center; font: 800 0.95rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); }
@media print { .nd-xn-scroll, .nd-xn { display: none; } }

.pr-xn { display: grid; grid-template-rows: auto auto; column-gap: 0.04in; row-gap: 0.06in; align-items: end; margin-top: 0.06in; }
.pr-xn .pr-nterm { white-space: nowrap; }
.pr-xn.places-6 .pr-nterm, .pr-xn.places-7 .pr-nterm, .pr-xn.dec2 .pr-nterm, .pr-xn.dec3 .pr-nterm { font-size: 10pt; }
.pr-xn.places-6 .pr-nterm .pr-box, .pr-xn.places-7 .pr-nterm .pr-box, .pr-xn.dec3 .pr-nterm .pr-box { width: 0.42in; }
.pr-xn-draw { height: 0.8in; border: 1.5px dashed #888; border-radius: 6px; display: flex; align-items: flex-start; justify-content: center; font-size: 8pt; color: #555; padding-top: 2px; box-sizing: border-box; }
.pr-xn-flat { display: flex; flex-direction: column; align-items: center; gap: 0.03in; font-size: 9pt; text-align: center; }
.pr-xn-sq { width: 1.25in; height: 1.25in; border: 2px solid #333; }
.pr-xn-flat small { font-size: 8pt; color: #444; max-width: 2.6in; }


.nd-drag-ghost.nd-lift { transform: translate(-50%, -50%) scale(1.3); z-index: 1001; }
.nd-rg-ghost.nd-lift { transform: translate(-50%, -50%) scale(1.15); }
.nd-lift-tag { position: fixed; z-index: 1002; pointer-events: none; transform: translate(-50%, -100%); padding: 4px 10px; border-radius: 999px;
    background: #3a2c9e; color: #fff; font: 900 1.2rem/1.1 var(--round, sans-serif); white-space: nowrap; box-shadow: 0 4px 12px rgba(40, 30, 120, 0.35); }
.nd-lift-tag.hidden { display: none; }
.nd-target { outline: 3px dashed #8b7fe8; outline-offset: 2px; }
.nd-target.over { outline: 3px solid #ffb800; outline-offset: 2px; background-color: #fff6d6; }
.nd-drop-flash { position: fixed; z-index: 1002; pointer-events: none; transform: translate(-50%, -110%); padding: 4px 10px; border-radius: 999px; background: #3a2c9e; color: #fff;
    font: 900 1.2rem/1.1 var(--round, sans-serif); white-space: nowrap; animation: ndDropFlash 1.5s ease forwards; }
@keyframes ndDropFlash { 0%, 55% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -150%); } }
@media (prefers-reduced-motion: reduce) { .nd-drop-flash { animation: ndDropFlashStill 1.5s step-end forwards; } @keyframes ndDropFlashStill { to { opacity: 0; } } }
.nd-xn.dec3 .nd-xn-flat { width: 230px; height: 230px; }   
.pr-xn .pr-nblocks { gap: 2px; }
.pr-xn .pr-nblocks .pr-block.cube, .pr-xn .pr-nblocks .pr-block.flat { width: 0.27in; height: 0.27in; }
.pr-xn .pr-nblocks .pr-block.rod { width: 0.08in; height: 0.36in; }
.pr-xn .pr-nblocks .pr-block.unit { width: 0.12in; height: 0.12in; }
.pr-xn .pr-nblocks, .pr-xn .pr-xn-draw { justify-self: center; max-width: 100%; }
.pr-xn-flat small, .pr-xn-flat b { text-transform: none; }



.nd-pvd { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nd-pvd-num { display: flex; flex-wrap: nowrap; justify-content: center; align-items: flex-end; gap: 3px; }
.nd-pvd-chip { position: relative; flex: 0 1 44px; min-width: 30px; height: 52px; padding: 0; border: 2px solid #e4def9; border-radius: 12px; background: #fff; color: var(--blue-dark, #3a2c9e);
    font: 900 1.9rem/1 var(--round, sans-serif); cursor: grab; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18), inset 0 -4px 0 var(--pvd-tint, #e9e3ff); font-variant-numeric: tabular-nums; }
.nd-pvd-chip.picked { outline: 4px solid var(--yellow, #ffcf3f); }
.nd-pvd-chip.dragging { opacity: 0.35; }
.nd-pvd-chip.used { opacity: 0.38; cursor: default; box-shadow: none; }
.nd-pvd-chip.nope, .nd-pvd-slot.nope { animation: ndCasNope 0.4s; }
.nd-pvd-sep { flex: none; font: 900 1.9rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); padding-bottom: 6px; }
.nd-pvd-scroll { width: 100%; }
.nd-pvd-chart { display: grid; grid-template-columns: repeat(var(--pv-cols), minmax(78px, 1fr)); min-width: min-content; border: 2px solid #b7acf2; border-radius: 10px;
    overflow: hidden; background: #fff; }
.nd-pvd-col { display: flex; flex-direction: column; border-left: 1.5px solid #d9d2fb; position: relative; min-width: 0; }
.nd-pvd-col:first-child { border-left: 0; }
.nd-pvd-head { display: flex; align-items: center; justify-content: center; height: 2.9em; padding: 2px 3px; box-sizing: border-box; font: 800 0.74rem/1.1 var(--round, sans-serif);
    text-align: center; text-transform: capitalize; color: var(--ink); border-bottom: 1.5px solid #d9d2fb; }
.nd-pvd-slot { display: flex; align-items: center; justify-content: center; height: 3.4rem; padding: 0 4px; box-sizing: border-box; font: 900 1.25rem/1 var(--round, sans-serif);
    color: var(--blue-dark, #3a2c9e); white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer; }
.nd-pvd-slot.long { font-size: 1.05rem; }
.nd-pvd-slot.full { background: #eef9f2; color: #1f7a4c; cursor: default; }
.nd-pvd-chart .pv-after-point { border-left: 3px solid var(--blue); }
.nd-pvd-chart .pv-after-point::before { content: '.'; position: absolute; left: -0.32em; bottom: 0.15rem; font-size: 1.8rem; font-weight: 900; color: var(--blue); line-height: 1; z-index: 1; }
.nd-pvd-note { min-height: 1.2em; text-align: center; font: 700 0.9rem/1.3 var(--round, sans-serif); color: #b8561a; }
.nd-pvd-chip.p0 { --pvd-tint: #c9efd3; } .nd-pvd-chip.p1 { --pvd-tint: #cfe0ff; } .nd-pvd-chip.p2 { --pvd-tint: #ffdcbd; } .nd-pvd-chip.p3 { --pvd-tint: #ead4ff; }
.nd-pvd-chip.p4 { --pvd-tint: #ffd0d0; } .nd-pvd-chip.p5 { --pvd-tint: #c6f0ec; } .nd-pvd-chip.p6 { --pvd-tint: #f1e2c4; }
.nd-pvd-chip.pm1 { --pvd-tint: #ffd3ea; } .nd-pvd-chip.pm2 { --pvd-tint: #cdebf9; } .nd-pvd-chip.pm3 { --pvd-tint: #f3eab8; }
@media (max-width: 360px) { .nd-pvd-chip { min-width: 27px; height: 46px; font-size: 1.55rem; } .nd-pvd-sep { font-size: 1.55rem; } }
.nd-card.ok .nd-pvd-chip.used { opacity: 0.6; }

.nd-drag-ghost.nd-lift-value { width: auto; padding: 0 12px; white-space: nowrap; font-size: 1.6rem; display: inline-flex; align-items: center; justify-content: center; opacity: 1; }


.nd-dv { display: flex; justify-content: center; align-items: flex-end; gap: 1px; margin: 2px auto 12px; font: 900 2.4rem/1.1 var(--round, sans-serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.nd-dv-mark { padding: 0 6px; border-radius: 10px; box-shadow: 0 0 0 3px currentColor inset; }
.nd-dv-mark.p0 { background: #e0f6e4; color: #217a37; } .nd-dv-mark.p1 { background: #e1ecff; color: #2550b5; } .nd-dv-mark.p2 { background: #ffe9d6; color: #b8561a; }
.nd-dv-mark.p3 { background: #f1e3ff; color: #6a2fb0; } .nd-dv-mark.p4 { background: #ffe1e1; color: #b02f2f; } .nd-dv-mark.p5 { background: #d8f5f2; color: #0f7a72; }
.nd-dv-mark.p6 { background: #f6ead2; color: #82591a; }
.nd-dv-mark.pm1 { background: #ffe0f0; color: #b02a73; } .nd-dv-mark.pm2 { background: #dcf1fb; color: #1f739c; } .nd-dv-mark.pm3 { background: #f8f0c8; color: #7d6300; }


.nd-xn-eq.active { background: #fff6d6; border-radius: 8px; box-shadow: 0 0 0 3px #ffb800; }
.nd-xn-flat.act1 { box-shadow: 0 0 0 3px #ff9fc4; } .nd-xn-flat.act2 { box-shadow: 0 0 0 3px #8fb8ff; } .nd-xn-flat.act3 { box-shadow: 0 0 0 3px #ffc83d; }
.nd-xn-flat.nope { animation: ndCasNope 0.4s; }
.nd-xn-tip { min-height: 1.2em; max-width: 230px; text-align: center; font: 700 0.78rem/1.25 var(--round, sans-serif); color: var(--muted, #6b6892); }
.nd-xn-tip.warn { color: #b8561a; }
.nd-xn-zoombtn { padding: 8px 14px; border-radius: 999px; border: 2px solid #ffc83d; background: #fff8de; font: 800 0.95rem/1 var(--round, sans-serif); color: #7d6300; cursor: pointer; }
.nd-xn-zoombtn[hidden] { display: none; }

.nd-xn-zoom { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(24, 18, 70, 0.55); }
.nd-xn-zoompanel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 20px; border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3); max-width: 100%; }
.nd-xn-zoomhead { font: 900 1.05rem/1.2 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); text-align: center; }
.nd-xn-zoomsq { display: grid; grid-template-columns: repeat(10, 1fr); width: min(280px, 78vw); aspect-ratio: 1; border: 3px solid #3a2c9e; border-radius: 4px; overflow: hidden; background: #fff; }
.nd-xn-strip { border: 0; border-right: 1.5px solid #b2abe6; background: #fff; padding: 0; cursor: pointer; }
.nd-xn-strip:last-child { border-right: 0; }
.nd-xn-strip.on { background: #ffc83d; }
.nd-xn-zoomread { font: 900 1.3rem/1 var(--round, sans-serif); color: #7d6300; }
.nd-xn-zoomnote { font: 700 0.85rem/1.2 var(--round, sans-serif); color: var(--muted, #6b6892); }
.nd-xn-zoomdone { padding: 10px 26px; border-radius: 999px; border: 0; background: var(--blue, #5b4bdb); color: #fff; font: 800 1rem/1 var(--round, sans-serif); cursor: pointer; }
.nd-xn-zoomsq.nope { animation: ndCasNope 0.4s; }

.pr-pvchart th { font-size: 8.5pt; text-transform: capitalize; }
.pr-pvchart td { height: 0.5in; }
.pr-pvchart th.pt, .pr-pvchart td.pt { border-left-width: 4px; }
.pr-dv { font-size: 22pt; font-weight: 900; letter-spacing: 0.04em; margin: 2px 0 6px; }
.pr-dv b { display: inline-block; padding: 0 4px; border: 2.5px solid #000; border-radius: 50%; }


.nd-xn-cell { position: relative; }
.nd-xn-ref { position: absolute; top: 34px; right: 2px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 3px; border: 0; background: transparent; cursor: grab; touch-action: none; }
.nd-xn-ref[hidden] { display: none; }
.nd-xn-refcube { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 4px; background: linear-gradient(145deg, #7ee08f, #2fa84a);
    color: #fff; font: 900 0.8rem/1 var(--round, sans-serif); box-shadow: 0 2px 0 #1f7a37, 0 0 0 2px #fff; }
.nd-xn-reflab { font: 800 0.62rem/1 var(--round, sans-serif); color: #217a37; white-space: nowrap; }
.nd-xn-reflab:empty { display: none; }
.nd-xn-refarrow { font: 900 1rem/1 var(--round, sans-serif); color: #2fa84a; }
.nd-xn-ref.zero { flex-direction: row; }
.nd-xn-ref.pulse .nd-xn-refcube { animation: ndRefPulse 1.1s ease-in-out 3; }
.nd-xn-ref.pulse .nd-xn-refarrow { animation: ndRefNudge 1.1s ease-in-out 3; }
@keyframes ndRefPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); box-shadow: 0 2px 0 #1f7a37, 0 0 0 2px #fff, 0 0 0 7px rgba(47, 168, 74, 0.25); } }
@keyframes ndRefNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.nd-xn-ref.dragging .nd-xn-refcube { opacity: 0.4; }
.nd-xn-refghost { position: fixed; z-index: 1001; pointer-events: none; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; border-radius: 5px;
    background: linear-gradient(145deg, #7ee08f, #2fa84a); color: #fff; font: 900 1rem/1 var(--round, sans-serif); box-shadow: 0 8px 18px rgba(30, 90, 40, 0.35); }
.nd-xn-flat.over { outline: 3px solid #2fa84a; outline-offset: 3px; }
.nd-xn-flat.grown { animation: ndFlatGrow 0.6s ease; }
@keyframes ndFlatGrow { 0% { transform: scale(0.94); box-shadow: 0 0 0 6px rgba(47, 168, 74, 0.45); } 100% { transform: scale(1); } }
.nd-xn-deccell { position: relative; }
.nd-xn-same { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 4; padding: 6px 12px; border-radius: 999px; background: #2fa84a; color: #fff;
    font: 900 1rem/1.1 var(--round, sans-serif); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.6s ease; }
.nd-xn-same.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .nd-xn-ref.pulse .nd-xn-refcube, .nd-xn-ref.pulse .nd-xn-refarrow, .nd-xn-flat.grown { animation: none; } }

.nd-shrink { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
.nd-shrink-stage { position: relative; width: 140px; height: 140px; }
.nd-shrink-flat { position: absolute; inset: 0; border: 2px solid #3a2c9e; background: #fff repeating-linear-gradient(90deg, transparent 0 13px, #b2abe6 13px 14px); transform-origin: 0% 100%; }
.nd-shrink-unit { position: absolute; left: 0; bottom: 0; width: 24px; height: 24px; border-radius: 4px; background: linear-gradient(145deg, #7ee08f, #2fa84a); color: #fff;
    display: flex; align-items: center; justify-content: center; font: 900 0.8rem/1 var(--round, sans-serif); opacity: 0; }
.nd-shrink-cap { font: 900 0.95rem/1 var(--round, sans-serif); color: #217a37; }
.nd-shrink.run .nd-shrink-flat { animation: ndShrink 3.2s ease forwards; }
.nd-shrink.run .nd-shrink-unit { animation: ndShrinkUnit 3.2s ease forwards; }
@keyframes ndShrink { 0%, 15% { transform: scale(1); opacity: 1; } 55% { transform: scale(0.17); opacity: 1; } 65%, 80% { transform: scale(0.17); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ndShrinkUnit { 0%, 50% { opacity: 0; } 60%, 80% { opacity: 1; } 100% { opacity: 0; } }


.nd-ord { display: flex; flex-direction: column; gap: 10px; width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nd-ord-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 52px; padding: 8px; border: 2px dashed #cfc8f5; border-radius: 12px; background: #f8f6ff; }
.nd-ord-tray.done { min-height: 0; padding: 0; border: 0; background: none; }
.nd-ord-tray.over { border-color: #ffb800; background: #fff6d6; }
.nd-ord-tile { padding: 8px 14px; min-height: 44px; border: 2px solid #e4def9; border-radius: 12px; background: #fff; color: var(--blue-dark, #3a2c9e);
    font: 900 1.25rem/1 var(--round, sans-serif); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15); cursor: grab; font-variant-numeric: tabular-nums; }
.nd-ord-tile[hidden] { display: none; }
.nd-ord-tile.dragging { opacity: 0.35; }
.nd-ord-scroll { width: 100%; }
.nd-ord-chart { display: grid; row-gap: 6px; column-gap: 0; align-items: center; min-width: min-content; padding: 6px 4px; border: 2px solid #b7acf2; border-radius: 12px; background: #fff; }
.nd-ord-hcell { display: flex; justify-content: center; padding-bottom: 2px; }
.nd-ord-hcell .nd-ball.on { box-shadow: 0 0 0 3px #ffcf3f; }
.nd-ord-cell { display: flex; align-items: center; justify-content: center; height: 48px; font: 900 1.55rem/1 var(--round, sans-serif); color: var(--ink);
    font-variant-numeric: tabular-nums; border-top: 2px solid #ece8fc; border-bottom: 2px solid #ece8fc; cursor: pointer; transition: opacity 0.2s, background-color 0.2s; }
.nd-ord-cell.dot { color: var(--blue, #5b4bdb); }
.nd-ord-cell.ph { color: #c4c0d6; }
.nd-ord-cell.empty { background: repeating-linear-gradient(90deg, transparent 0 8px, #f1eefc 8px 10px); cursor: default; }
.nd-ord-cell.lit { background-color: #fff3b8; }
.nd-ord-cell.sel { background-color: #e9e3ff; }
.nd-ord-cell.sel.lit { background-color: #ffe98a; }
.nd-ord-cell.dim, .nd-ord-handle.dim, .nd-ord-rank.dim { opacity: 0.25; }

.nd-ord-cell.placed { color: #9aa0ab; }
.nd-ord-cell.placed.dot { color: #b4b0cc; }
.nd-ord-menu { position: fixed; z-index: 60; display: flex; gap: 4px; padding: 6px; background: #fff; border: 2px solid #7a6fd0; border-radius: 12px; box-shadow: 0 6px 18px rgba(40, 30, 110, 0.22); }
.nd-ord-mopt { min-width: 44px; height: 44px; padding: 0 6px; border: 2px solid #c9c1f3; border-radius: 10px; background: #fff; font: 900 0.95rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); cursor: pointer; }
.nd-ord-mopt.on { background: #efeaff; border-color: #7a6fd0; }
.nd-ord-mopt.none { color: #6b6785; font-weight: 700; }
@media print { .nd-ord-menu { display: none; } }
.nd-ord-cell.over { background-color: #fff6d6; border-color: #ffb800; }
.nd-ord-cell.lifted { opacity: 0.35; }
.nd-ord-handle { width: 36px; height: 48px; border: 0; border-radius: 10px; background: #f1eeff; cursor: grab; display: flex; align-items: center; justify-content: center; padding: 0; }
.nd-ord-handle svg { width: 12px; height: 20px; fill: #7a6fd0; }
.nd-ord-handle:disabled { opacity: 0.3; cursor: default; }
.nd-ord-rank { justify-self: end; width: 48px; height: 40px; border: 2px dashed #c9c1f3; border-radius: 10px; background: #fff; font: 900 0.95rem/1 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); cursor: pointer; }
.nd-ord-rank.set { border-style: solid; border-color: #7a6fd0; background: #efeaff; }
.nd-ord-rank:disabled { opacity: 0.35; cursor: default; }
.nd-ord-rank.nope { animation: ndCasNope 0.4s; }
.nd-ord-tray.nope { animation: ndCasNope 0.4s; }
.nd-ord-note { min-height: 1.2em; text-align: center; font: 800 0.95rem/1.3 var(--round, sans-serif); color: #b8561a; }
.nd-ord-note.good { color: #1f7a4c; }
.nd-ord-ghost { position: fixed; z-index: 1001; pointer-events: none; transform: translate(-50%, -50%) scale(1.15); padding: 8px 14px; border-radius: 12px; background: #fff;
    border: 2px solid #8b7fe8; color: var(--blue-dark, #3a2c9e); font: 900 1.4rem/1 var(--round, sans-serif); white-space: nowrap; box-shadow: 0 10px 22px rgba(40, 30, 120, 0.35); }
.nd-ord-follow { margin-top: 12px; padding-top: 12px; border-top: 2px dashed #e4def9; }
.nd-ord-follow.hidden { display: none; }
.nd-ord-fopts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nd-ord-fopts .nd-choice.bad { border-color: #e2575a; background: #fdeaea; }
.pr-orderchart th, .pr-orderchart td { height: 0.36in; }
.pr-orderchart th { font-size: 8.5pt; }
.pr-orderchart .pt { width: 0.14in; border-left-width: 1.5px; border-right-width: 1.5px; }
.pr-orderchart .rk { width: 0.7in; }
.pr-order-fq { margin-top: 6px; font-weight: 700; }
.pr-order-fq span { display: block; margin-top: 4px; font-weight: 400; }
.pr-task:not(.pr-wide) .pr-orderchart th { font-size: 7pt; padding: 1px; }
.pr-task:not(.pr-wide) .pr-orderchart .rk { width: 0.5in; }
.pr-task:not(.pr-wide) .pr-order-nums { font-size: 10pt; }


img.nd-book-icon { width: 64px; height: 64px; object-fit: contain; }
img.nd-won-icon { width: 64px; height: 64px; object-fit: contain; flex: none; }
img.nd-complete-icon { width: 52px; height: 52px; object-fit: contain; }


.nd-ac { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nd-ac-scroll { width: 100%; }
.nd-ac-chart { position: relative; display: grid; grid-template-columns: repeat(var(--ac-cols), minmax(54px, 1fr)); grid-template-rows: auto 64px;
    min-width: min-content; border: 2px solid #b7acf2; border-radius: 10px; background: #fff; overflow: hidden; }
.nd-ac-head { grid-row: 1; display: flex; align-items: center; justify-content: center; height: 2.9em; padding: 2px 2px; box-sizing: border-box; text-align: center;
    font: 800 0.7rem/1.1 var(--round, sans-serif); overflow-wrap: anywhere; hyphens: auto; background: var(--ac-bg); color: var(--ac-ink); border-left: 1.5px solid #d9d2fb; }
.nd-ac-head:first-child { border-left: 0; }
.nd-ac-guide { grid-row: 2; border-left: 1.5px dashed #d9d2fb; cursor: pointer; transition: background 0.12s; }
.nd-ac-guide:first-of-type { border-left: 0; }
.nd-ac-guide.pt { border-left: 3px solid var(--blue); }
.nd-ac-guide.nd-target { background: #faf8ff; }
.nd-ac-guide.over { background: #fff3c2; }
.nd-ac-dot { grid-row: 1 / 3; justify-self: start; align-self: end; transform: translateX(-50%); margin-bottom: 4px; font: 900 2rem/1 var(--round, sans-serif); color: var(--blue); z-index: 40; pointer-events: none; }
.nd-ac-card { grid-row: 2; display: flex; align-self: center; height: 52px; box-sizing: border-box; border: 2px solid var(--ac-ink); border-radius: 8px; background: var(--ac-bg);
    box-shadow: -3px 2px 0 rgba(40, 30, 90, 0.18); position: relative; pointer-events: none; animation: ndAcIn 0.28s ease-out; }
.nd-ac-cell { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; font: 900 clamp(1.25rem, 5.4vw, 1.75rem)/1 var(--round, sans-serif); color: var(--ac-ink); }
.nd-ac-cell:not(.own) { opacity: 0.8; }
.nd-ac-cell.comma::after { content: ','; position: absolute; right: -0.1em; bottom: 0.32em; font-size: 0.8em; }
@keyframes ndAcIn { from { transform: translateY(-12px) scale(1.04); } to { transform: none; } }
.nd-ac-ghost { position: fixed; z-index: 9999; transform: translate(-50%, -50%) scale(1.05); pointer-events: none; animation: none; box-shadow: 0 10px 24px rgba(40, 30, 90, 0.3); opacity: 0.96; }
.nd-ac-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; font: 800 1.1rem/1.2 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); }
.nd-ac-term { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2em; height: 1.9em; padding: 0 6px; box-sizing: border-box; border-bottom: 2.5px dashed #b7acf2; }
.nd-ac-term.full { background: var(--ac-bg); color: var(--ac-ink); border-radius: 8px; border-bottom-color: transparent; animation: ndAcIn 0.28s ease-out; }
.nd-ac .p0 { --ac-bg: #e0f6e4; --ac-ink: #217a37; } .nd-ac .p1 { --ac-bg: #e1ecff; --ac-ink: #2550b5; } .nd-ac .p2 { --ac-bg: #ffe9d6; --ac-ink: #b8561a; }
.nd-ac .p3 { --ac-bg: #f1e3ff; --ac-ink: #6a2fb0; } .nd-ac .p4 { --ac-bg: #ffe1e1; --ac-ink: #b02f2f; } .nd-ac .p5 { --ac-bg: #d8f5f2; --ac-ink: #0f7a72; }
.nd-ac .p6 { --ac-bg: #f6ead2; --ac-ink: #82591a; }
.nd-ac .pm1 { --ac-bg: #ffe0f0; --ac-ink: #b02a73; } .nd-ac .pm2 { --ac-bg: #dcf1fb; --ac-ink: #1f739c; } .nd-ac .pm3 { --ac-bg: #f8f0c8; --ac-ink: #7d6300; }
.nd-ac-ghost.p0 { --ac-bg: #e0f6e4; --ac-ink: #217a37; } .nd-ac-ghost.p1 { --ac-bg: #e1ecff; --ac-ink: #2550b5; } .nd-ac-ghost.p2 { --ac-bg: #ffe9d6; --ac-ink: #b8561a; }
.nd-ac-ghost.p3 { --ac-bg: #f1e3ff; --ac-ink: #6a2fb0; } .nd-ac-ghost.p4 { --ac-bg: #ffe1e1; --ac-ink: #b02f2f; } .nd-ac-ghost.p5 { --ac-bg: #d8f5f2; --ac-ink: #0f7a72; }
.nd-ac-ghost.p6 { --ac-bg: #f6ead2; --ac-ink: #82591a; }
.nd-ac-ghost.pm1 { --ac-bg: #ffe0f0; --ac-ink: #b02a73; } .nd-ac-ghost.pm2 { --ac-bg: #dcf1fb; --ac-ink: #1f739c; } .nd-ac-ghost.pm3 { --ac-bg: #f8f0c8; --ac-ink: #7d6300; }
@media (max-width: 400px) { .nd-ac-line { font-size: 1rem; } .nd-ac-term { padding: 0 4px; } }


.nd-then { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 2px dashed #d9d2fb; }
.nd-then.hidden { display: none; }
.nd-then.in { animation: ndThenIn 0.35s ease-out; }
@keyframes ndThenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.nd-then-done { font: 800 0.92rem/1.2 var(--round, sans-serif); color: #1f7a4c; }
.nd-then-title { font: 900 1.05rem/1.2 var(--round, sans-serif); color: var(--blue-dark, #3a2c9e); }
.nd-then-q { margin: 0; text-align: center; }
.nd-then-note { min-height: 1.2em; text-align: center; font: 700 0.9rem/1.3 var(--round, sans-serif); color: #b8561a; }
.nd-card.ok .nd-then-done, .nd-card.ok .nd-then-note { display: none; }

.nd-card.then-open .nd-body * { pointer-events: none; }
.nd-card.then-open .nd-body .nd-hscroll, .nd-card.then-open .nd-body .nd-xn-scroll, .nd-card.then-open .nd-body .nd-pvd-scroll { pointer-events: auto; }
.nd-card.then-open .nd-body > .nd-check { display: none; }
.pr-then { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-weight: 700; line-height: 1.1; }
.pr-then .pr-dv { margin: 0; font-size: 15pt; }
.pr-then .pr-box { height: 0.3in; }


.nd-pvd-slot { position: relative; font-size: 1.5rem; }
.nd-pvd-slot.full { background: #eef9f2; color: #1f3a6b; }   
.nd-pvd-slot.comma::after { content: ','; position: absolute; right: -0.18em; bottom: 0.55em; font-size: 1.3rem; font-weight: 900; color: #1f3a6b; z-index: 2; }
.nd-pvd-slot.over { background: #fff3c2; }
.nd-pvd-slot.fresh { animation: ndPvFresh 0.5s ease-out; }
@keyframes ndPvFresh { 0% { background: #fff1a8; transform: scale(1.08); } 100% { background: #eef9f2; transform: none; } }
.nd-pvd-ghost { position: fixed; z-index: 9999; display: flex; pointer-events: none; box-sizing: border-box; border: 2px solid #7b6be8; border-radius: 8px;
    background: #fff; box-shadow: 0 10px 24px rgba(40, 30, 90, 0.3); overflow: visible; }
.nd-pvd-gcell { position: relative; flex: none; box-sizing: border-box; height: 100%; display: flex; align-items: center; justify-content: center; font: 900 1.5rem/1 var(--round, sans-serif); color: #1f3a6b;
    border-left: 1.5px dashed #d9d2fb; }
.nd-pvd-gcell:first-child { border-left: 0; }
.nd-pvd-gcell.own { background: var(--pvd-tint, #ece7ff); border-radius: 6px; }
.nd-pvd-gcell.comma::after { content: ','; position: absolute; right: -0.18em; bottom: 0.3em; font-size: 1.3rem; }
.nd-pvd-gcell.pt::before { content: '.'; position: absolute; left: -0.2em; bottom: 0.1em; font-size: 1.6rem; color: var(--blue); }
.nd-pvd-ghost.p0 .own { --pvd-tint: #c9efd3; } .nd-pvd-ghost.p1 .own { --pvd-tint: #cfe0ff; } .nd-pvd-ghost.p2 .own { --pvd-tint: #ffdcbd; }
.nd-pvd-ghost.p3 .own { --pvd-tint: #ead4ff; } .nd-pvd-ghost.p4 .own { --pvd-tint: #ffd0d0; } .nd-pvd-ghost.p5 .own { --pvd-tint: #c6f0ec; }
.nd-pvd-ghost.p6 .own { --pvd-tint: #f1e2c4; } .nd-pvd-ghost.pm1 .own { --pvd-tint: #ffd3ea; } .nd-pvd-ghost.pm2 .own { --pvd-tint: #cdebf9; }
.nd-pvd-ghost.pm3 .own { --pvd-tint: #f3eab8; }


.nd-hero-row .nd-voice.off { opacity: 0.7; }
.nd-fraction-link[hidden] { display: none; }


.nd-gb { position: relative; }
.nd-gb-vert { padding-top: 2px; }
.nd-gb-mark { display: flex; align-items: flex-end; justify-content: center; height: 1.25rem; font: 900 1rem/1 var(--round); color: #c0392b;
    font-variant-numeric: tabular-nums; }
button.nd-gb-mark { width: auto; min-width: 26px; margin: 0 auto; padding: 0 6px; border: 2px solid #ffcf3f; border-radius: 8px; background: #fff8dc;
    font: 900 0.95rem/1 var(--round); cursor: pointer; align-self: end; height: 1.3rem; }
.nd-gb-mark.p0 { color: #2fa84a; } .nd-gb-mark.p1 { color: #2f5fd8; } .nd-gb-mark.p2 { color: #e0702a; } .nd-gb-mark.p3 { color: #8a3fd8; } .nd-gb-mark.p4 { color: #d03c3c; }
.nd-bw-vd.nd-gb-x { color: #9aa2b1 !important; }
.nd-bw-vd.nd-gb-x::before { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; border-top: 3px solid #c0392b; transform: rotate(-24deg); }
.nd-bw-vd.nd-gb-on { background: #fff4c7; border-radius: 9px 9px 0 0; }
.nd-gb-acell { display: flex; align-items: center; justify-content: center; padding: 6px 1px 2px; position: relative; }
.nd-gb-acell.comma::after { content: ","; position: absolute; right: -0.15em; bottom: 0.1em; font: 900 1.5rem/1 var(--round); color: var(--blue-dark); }
.nd-gb-ans { width: 100%; max-width: 2.6rem; height: 2.6rem; box-sizing: border-box; padding: 0; text-align: center; font: 900 1.5rem/1 var(--round);
    font-variant-numeric: tabular-nums; border: 2px solid #d8d1fb; border-radius: 10px; background: #faf9ff; color: var(--blue-dark); }
.nd-gb-ans.p0 { color: #2fa84a; } .nd-gb-ans.p1 { color: #2f5fd8; } .nd-gb-ans.p2 { color: #e0702a; } .nd-gb-ans.p3 { color: #8a3fd8; } .nd-gb-ans.p4 { color: #d03c3c; }
.nd-gb-ans:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91, 78, 230, 0.2); }
.nd-gb-ans.act { border-color: #ffb400; background: #fff8dc; box-shadow: 0 0 0 4px rgba(255, 190, 40, 0.35); }
.nd-gb-ans.good { border-color: #2fa86a; background: #e5f7ec; }
.nd-gb-ans.bad { border-color: #ef5b6b; background: #ffe3e6; }
.nd-gb-ans.lead { border-style: dashed; opacity: 0.5; }
.nd-gb-ans.nope { animation: ndCasNope 0.4s; }

.nd-gb .dim { opacity: 0.45; transition: opacity 0.25s; }
.nd-gb .nd-bw-cell.act, .nd-gb .nd-bw-head.act { background: #fffbe6; }
.nd-gb .nd-bw-cell.act { box-shadow: inset 0 0 0 2px #ffd34d; }
.nd-gb .nd-bw-val.act { color: #b07800; }

.nd-gb-strip { gap: 4px 8px; }
.nd-gb-sayrow { flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 2.6em; }
.nd-gb-strip .nd-gb-say { flex: 0 1 auto; font-size: 1rem; font-weight: 900; text-align: center; }
.nd-gb-hear { flex: none; padding: 2px 4px; border: none; background: none; font-size: 1.05rem; cursor: pointer; }
.nd-gb-hear.hidden, .nd-gb-help.hidden { display: none; }
.nd-gb-tools { display: flex; align-items: center; justify-content: center; gap: 14px; flex: 1 1 100%; }
.nd-gb-help { padding: 4px 12px; border: 2px solid #c9c0f5; border-radius: 999px; background: #fff; color: var(--blue-dark); font: 800 0.82rem/1.2 var(--round); cursor: pointer; }
.nd-gb-undo:disabled { opacity: 0.35; cursor: default; }
.nd-card.ok .nd-gb-tools { display: none; }
.nd-gb-strip.nd-gb-over .nd-gb-sayrow { min-height: 0; }

.nd-bw-b.nd-gb-src, .nd-bw-b.nd-gb-flat { cursor: grab; }
.nd-gb-nudge { animation: ndGbNudge 1.3s ease-in-out 2; }
@keyframes ndGbNudge { 50% { box-shadow: 0 0 0 5px rgba(255, 190, 40, 0.75); transform: scale(1.04); } }
.nd-bw-b.nd-gb-win { box-shadow: 0 0 0 2px #ffcf3f, 0 0 8px rgba(255, 190, 40, 0.9); }

.nd-gb-flash { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: grid; grid-template-columns: 1.15rem repeat(var(--bw-cols), minmax(0, 1fr));
    pointer-events: none; opacity: 0; font: 900 1.2rem/1 var(--round); text-align: center; }
.nd-gb-flash.show { animation: ndGbFlash 2.4s ease-out forwards; }
.nd-gb-flash span { padding-top: 2px; }
.nd-gb-flash .zero { animation: ndGbZero 2.4s ease-out forwards; }
.nd-gb-flash.p0 span, .nd-gb-flash .p0 { color: #2fa84a; } .nd-gb-flash .p1 { color: #2f5fd8; } .nd-gb-flash .p2 { color: #e0702a; } .nd-gb-flash .p3 { color: #8a3fd8; } .nd-gb-flash .p4 { color: #d03c3c; }
@keyframes ndGbFlash { 0% { opacity: 0; transform: translateY(6px); } 12%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes ndGbZero { 0%, 45% { opacity: 1; } 75%, 100% { opacity: 0; } }
.nd-gb-checkrow { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; }
.nd-gb-note:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .nd-gb-nudge, .nd-gb-flash.show, .nd-gb-flash .zero { animation-duration: 0.01s; } }
@media print { .nd-gb-flash { display: none; } }

.nd-gb .nd-bw-b.struck { position: relative; opacity: 0.4; filter: grayscale(0.6); cursor: default; }
.nd-gb .nd-bw-b.struck::before { content: ""; position: absolute; left: 50%; top: 50%; width: 140%; min-width: 14px; height: 3px; background: #d0283a; border-radius: 2px;
    transform: translate(-50%, -50%) rotate(-40deg); pointer-events: none; z-index: 1; }
.nd-gb .nd-bw-b.p1.struck::before { width: 18px; transform: translate(-50%, -50%) rotate(-62deg); }


.nd-ch-outer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0 10px; }
.nd-ch { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 10px 8px; border: 2px solid #c9c0f5;
    border-radius: 14px; background: #fbfaff; animation: ndZoomIn 0.2s ease-out; }
.nd-ch.hidden { display: none; }
.nd-ch-say { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 2.7em; text-align: center;
    font: 900 1.02rem/1.25 var(--round); color: var(--blue-dark); }
.nd-ch-show { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; min-height: 2.6em; align-items: center;
    font: 900 1.15rem/1.2 var(--round); color: #7a3f12; font-variant-numeric: tabular-nums; }
.nd-ch-show:empty { visibility: hidden; }
.nd-ch-frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: 0.85em; line-height: 1; margin: 0 2px; }
.nd-ch-frac span:first-child { border-bottom: 2px solid currentColor; padding: 0 2px 1px; }
.nd-ch-frac span:last-child { padding-top: 1px; }
.nd-ch-chart { display: grid; grid-template-columns: minmax(0, 1fr) 1.3rem repeat(var(--ch-cols), minmax(0, 1fr)); border: 2px solid #e3ddfb;
    border-radius: 12px; background: #fff; overflow: hidden; }
.nd-ch-side { padding: 5px 2px; text-align: center; font: 900 0.8rem/1.1 var(--round); }
.nd-ch-side.whole { background: #fde7c8; color: #8a4b0f; }
.nd-ch-side.pieces { grid-column: span var(--ch-cols); background: #ffe1ef; color: #9c2459; }
.nd-ch-gap { background: #fff; }
.nd-ch-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 1px; border-top: 1px solid #e3ddfb;
    font: 800 0.7rem/1 var(--round); color: var(--muted); }
.nd-ch-pointhead { border-top: 1px solid #e3ddfb; }
.nd-ch-cell { min-height: 132px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 6px;
    padding: 6px 2px; border-top: 1px solid #e3ddfb; border-left: 1px solid #f0ecfd; }
.nd-ch-cell.p0 { border-left: none; }
.nd-ch-cell.over { background: #ffe1ef; box-shadow: inset 0 0 0 2px #e05597; }
.nd-ch-point { display: flex; align-items: center; justify-content: center; font: 900 3rem/0.6 var(--round); color: #c0392b; border-top: 1px solid #e3ddfb; }

.nd-ch-bar { display: grid; grid-template-columns: repeat(2, 15px); grid-auto-rows: 18px; gap: 2px; padding: 3px; border-radius: 4px;
    background: #4a2511; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); touch-action: none; }
.nd-ch-seg { border-radius: 2px; background: linear-gradient(145deg, #a8653a, #7b4220); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.22), inset -1px -1px 0 rgba(0, 0, 0, 0.25); }
.nd-ch-seg.empty { background: #f3e7dc; box-shadow: inset 0 0 0 1px #d9c1ad; }
.nd-ch-seg.gone { visibility: hidden; }
.nd-ch-bar:has(.nd-ch-seg.empty) { background: #d9c1ad; }
.nd-ch-bar.ref { opacity: 0.35; filter: grayscale(0.5); }
.nd-ch-bar.whole { cursor: grab; }
.nd-ch-pulse { animation: ndChPulse 1.4s ease-in-out infinite; cursor: grab; }
@keyframes ndChPulse { 50% { transform: scale(1.07); box-shadow: 0 0 0 4px rgba(255, 190, 40, 0.7); } }
.nd-ch-pieces { display: grid; grid-template-columns: repeat(2, 15px); grid-auto-rows: 18px; gap: 5px; }
.nd-ch-piece { border-radius: 2px; background: linear-gradient(145deg, #a8653a, #7b4220); box-shadow: 0 1px 0 #4a2511, inset 1px 1px 0 rgba(255, 255, 255, 0.22); touch-action: none; }
.nd-ch-piece.moved { background: none; box-shadow: inset 0 0 0 1px #d9c1ad; animation: none; }
.nd-ch-pieces.breaking .nd-ch-piece { animation: ndChBreak 0.6s ease-out both; }
.nd-ch-pieces.breaking .nd-ch-piece:nth-child(odd) { --bx: -5px; } .nd-ch-pieces.breaking .nd-ch-piece:nth-child(even) { --bx: 5px; }
@keyframes ndChBreak { 0% { transform: translateX(calc(var(--bx, 0px) * -1)) scale(0.96); filter: brightness(1.3); } 100% { transform: none; } }
.nd-ch-pieces.breaking .nd-ch-piece.nd-ch-pulse { animation: ndChPulse 1.4s ease-in-out infinite; }

.nd-ch-zoom { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; border: 2px dashed #e05597; border-radius: 10px; background: #fff7fb; }
.nd-ch-zlab { font: 800 0.62rem/1 var(--round); color: #9c2459; white-space: nowrap; }
.nd-ch-strips { display: grid; gap: 2px; }
.nd-ch-strips.s1 { grid-template-columns: repeat(10, 5px); grid-auto-rows: 44px; }
.nd-ch-strips.s2 { grid-template-columns: repeat(2, 12px); grid-auto-rows: 9px; }
.nd-ch-strip { border-radius: 1px; background: linear-gradient(145deg, #a8653a, #7b4220); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.2); touch-action: none; }
.nd-ch-strip.moved { background: none; box-shadow: inset 0 0 0 1px #d9c1ad; animation: none; }
.nd-ch-zoom.breaking .nd-ch-strip { animation: ndChBreak 0.6s ease-out both; }
.nd-ch-zoom.breaking .nd-ch-strip.nd-ch-pulse { animation: ndChPulse 1.4s ease-in-out infinite; }

.nd-ch-example { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nd-ch-exnum, .nd-ch-daynum { font: 900 2.4rem/1 var(--round); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.nd-ch-exnum .w, .nd-ch-daynum .w { color: #8a4b0f; background: #fde7c8; border-radius: 8px; padding: 0 6px; }
.nd-ch-exnum .pt, .nd-ch-daynum .pt { color: #c0392b; padding: 0 2px; }
.nd-ch-exnum .f, .nd-ch-daynum .f { color: #9c2459; background: #ffe1ef; border-radius: 8px; padding: 0 6px; }
.nd-ch-exrow { display: flex; align-items: stretch; justify-content: center; gap: 6px; }
.nd-ch-exrow .nd-ch-point { border: none; font-size: 2.6rem; }
.nd-ch-exside { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px 4px; border-radius: 12px; }
.nd-ch-exside.w { background: #fde7c8; } .nd-ch-exside.f { background: #ffe1ef; }
.nd-ch-exlab { flex: 1 1 100%; text-align: center; font: 900 0.72rem/1.1 var(--round); color: #6b3d16; }
.nd-ch-exside.f .nd-ch-exlab { color: #9c2459; }
.nd-ch-ask { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: ndZoomIn 0.2s ease-out; }
.nd-ch-q { font: 900 1rem/1.25 var(--round); color: var(--blue-dark); text-align: center; }
.nd-ch-opts { display: flex; gap: 10px; }
.nd-ch-opt { min-width: 64px; min-height: 48px; padding: 6px 14px; border: 2px solid #c9c0f5; border-radius: 14px; background: #fff; color: var(--blue-dark);
    font: 900 1.3rem/1 var(--round); cursor: pointer; }
.nd-ch-opt.good { border-color: #2fa86a; background: #e5f7ec; } .nd-ch-opt.bad { border-color: #ef5b6b; background: #ffe3e6; }
.nd-ch-opt.nope { animation: ndCasNope 0.4s; }

.nd-ch-day { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nd-ch-daynum { font-size: clamp(1.6rem, 8vw, 2.4rem); }
.nd-ch-daysplit { display: flex; gap: 10px; justify-content: center; }
.nd-ch-daysplit > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; border-radius: 12px; }
.nd-ch-daysplit b { font: 900 1.4rem/1.1 var(--round); font-variant-numeric: tabular-nums; }
.nd-ch-daysplit span { font: 800 0.75rem/1.1 var(--round); }
.nd-ch-daysplit .w { background: #fde7c8; color: #8a4b0f; } .nd-ch-daysplit .f { background: #ffe1ef; color: #9c2459; }
.nd-ch-again { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .nd-ch-pulse, .nd-ch-pieces.breaking .nd-ch-piece, .nd-ch-zoom.breaking .nd-ch-strip { animation-duration: 0.01s; } }
@media print { .nd-ch-outer { display: none; } }

.nd-ch-point { font-size: 0 !important; }
.nd-ch-point::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #d0283a; box-shadow: 0 0 0 3px #ffd9dd; }
.nd-ch-stage { min-height: 262px; display: flex; flex-direction: column; justify-content: center; }

.nd-ch-zoom { max-width: 100%; box-sizing: border-box; padding: 3px; }
.nd-ch-zlab { font-size: 0.55rem; }
.nd-ch-strips.s1 { grid-template-columns: repeat(10, 4px); gap: 1.5px; }
.nd-ch-head span { font-size: clamp(0.5rem, 2.4vw, 0.7rem); overflow-wrap: anywhere; text-align: center; }


.nd-fraction-top { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
    font: 900 0.9rem/1.1 var(--round); color: #3a2400; background: linear-gradient(180deg, #ffd65a, #ffb21e); border: 2px solid #fff3c4;
    box-shadow: 0 3px 0 #c98200, 0 4px 14px rgba(255, 190, 40, 0.55); animation: ndFracGlow 2.6s ease-in-out infinite; }
.nd-fraction-top[hidden] { display: none; }
.nd-fraction-top:active { transform: translateY(2px); box-shadow: 0 1px 0 #c98200; }
@keyframes ndFracGlow { 50% { box-shadow: 0 3px 0 #c98200, 0 4px 22px rgba(255, 200, 60, 0.95); } }
.nd-top-row .nd-music { margin-left: auto; }
.nd-start-top { display: flex; align-items: center; gap: 8px; }
.nd-start-top .nd-fraction-top { margin-left: auto; }
body.display .nd-fraction-top { display: none; }
@media (prefers-reduced-motion: reduce) { .nd-fraction-top { animation: none; } }
@media print { .nd-fraction-top { display: none; } }


.nd-cnt-glow { animation: ndCntGlow 0.9s ease-out; }
@keyframes ndCntGlow {
    0% { filter: brightness(1.55) drop-shadow(0 0 7px #ffd34d); transform: scale(1.12); }
    55% { filter: brightness(1.25) drop-shadow(0 0 5px #ffd34d); transform: scale(1.04); }
    100% { filter: none; transform: none; }
}
.nd-cnt-say { outline: 3px solid #f5b400; outline-offset: 2px; border-radius: 8px; box-shadow: 0 0 0 6px rgba(245, 180, 0, 0.18); transition: outline-color 0.2s ease, box-shadow 0.2s ease; }
.nd-cnt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 2px; }
.nd-cnt-btn {
    font: inherit; font-size: 0.86rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer;
    border: 2px solid #c9c2f5; background: #f4f2ff; color: #3d3392; min-height: 36px;
}
.nd-cnt-btn:focus-visible { outline: 3px solid #5b4ee6; outline-offset: 2px; }
.nd-cnt-btn.off { opacity: 0.72; border-style: dashed; }
@media (prefers-reduced-motion: reduce) {
    .nd-cnt-glow { animation: none; filter: brightness(1.35) drop-shadow(0 0 5px #ffd34d); }
}
@media print { .nd-cnt-row { display: none; } }


.nd-dv-mark.nd-dv-focus { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 6px; }
.nd-dv.nd-dv-whole { background: rgba(255, 214, 92, 0.22); border-radius: 10px; box-shadow: 0 0 0 3px rgba(255, 214, 92, 0.45); }
.nd-dv-pulse { animation: ndDvPulse 1.1s ease-in-out infinite; }
@keyframes ndDvPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 196, 40, 0); filter: none; }
    50% { box-shadow: 0 0 0 4px rgba(255, 196, 40, 0.75), 0 0 14px 4px rgba(255, 196, 40, 0.45); filter: brightness(1.12); }
}
@media (prefers-reduced-motion: reduce) { .nd-dv-pulse { animation: none; box-shadow: 0 0 0 4px rgba(255, 196, 40, 0.75); } }


.mc { margin: 0.6rem 0 0.2rem; }
.mc-grid { display: grid; grid-template-columns: repeat(var(--mc-n, 11), minmax(0, 1fr)); gap: 2px; width: 100%; max-width: 440px; margin: 0 auto; }
.mc-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(0.62rem, 2.9vw, 0.95rem); font-variant-numeric: tabular-nums;
    background: #fff; color: #2b2b44; border-radius: 4px; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.mc-head { background: #6d4fd8; color: #fff; font-weight: 700; }
.mc-corner { background: #3a2a7a; color: #fff; font-weight: 700; }
.mc-lit { background: #ffb21e; color: #2b2b44; box-shadow: 0 0 0 2px #fff, 0 0 10px 2px rgba(255, 178, 30, 0.8); }
.mc-path { background: #ffe7a8; }
.mc-meet { background: #2fbf71; color: #fff; font-weight: 800; box-shadow: 0 0 0 3px #fff, 0 0 14px 3px rgba(47, 191, 113, 0.85); }
.mc-play { display: block; margin: 0.55rem auto 0; font: inherit; font-size: 0.85rem; padding: 0.35rem 0.8rem; border-radius: 999px; border: 2px solid #6d4fd8;
    background: #fff; color: #3a2a7a; cursor: pointer; }
@media print { .mc-play { display: none; } }


.nd-rg-mark.drag { height: 2.1rem; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.nd-rg-mark.new { font: 900 1.25rem/1 var(--round); cursor: pointer; }
.nd-rg-mark.new { position: relative; }
.nd-rg-mark.new { background: #fff3a6; border: 2px solid #f2c94c; border-radius: 10px; min-width: 1.6em; padding: 0 0.15em; margin-inline: auto; box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.28); }
.nd-rg-mark.new.p0 { color: #2fa84a; } .nd-rg-mark.new.p1 { color: #2f5fd8; } .nd-rg-mark.new.p2 { color: #e0702a; } .nd-rg-mark.new.p3 { color: #8a3fd8; }
.nd-rg-mark.new.p4 { color: #d03c3c; } .nd-rg-mark.new.p5 { color: #b5527a; } .nd-rg-mark.new.p6 { color: #2a8f8f; }
.nd-rg-mark.new.pop { animation: ndTookPop 0.3s ease-out; }
button.nd-rg-d.took::before { border-color: transparent; background: transparent; }
@media (prefers-reduced-motion: reduce) { .nd-rg-mark.new.pop { animation: none; } }
