:root {
  --nnl-ink: #102532;
  --nnl-muted: #526c7a;
  --nnl-blue: #087eaf;
  --nnl-line: #c7d7df;
  --nnl-gold: #e8a51a;
  --nnl-touch: 48px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--nnl-ink); background: #edf5f9; font-family: Arial, Helvetica, sans-serif; }
button, input, select { font: inherit; }
.app { min-height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.topbar { min-height: 72px; display: grid; grid-template-columns: minmax(250px, 1fr) auto; align-items: center; gap: 16px; padding: 11px 18px; color: #fff; background: #071018; }
.brand { min-width: 0; display: flex; align-items: center; gap: 14px; }
.brand-logo { display: inline-flex; border-radius: 6px; }
.brand-logo img { width: 142px; height: auto; display: block; }
.brand h1 { margin: 0; color: #fff; font-size: clamp(1.3rem, 2vw, 2rem); line-height: 1.05; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.icon-button, .home-button { min-width: var(--nnl-touch); min-height: var(--nnl-touch); display: inline-flex; align-items: center; justify-content: center; border: 2px solid #263d51; border-radius: 8px; color: #fff; background: #122436; cursor: pointer; }
.icon-button { padding: 0; }
.icon-button .icon { width: 24px; height: 24px; pointer-events: none; }
.home-button { padding: 0 14px; font-weight: 800; text-decoration: none; }
.icon-button:hover, .icon-button:focus-visible, .home-button:hover, .home-button:focus-visible { border-color: #8fd8f3; color: #06111a; background: #8fd8f3; }

#negativeNumberLineModel { min-width: 0; min-height: 0; }
.negative-number-lab { min-width: 0; min-height: calc(100vh - 72px); display: grid; grid-template-rows: auto minmax(0, 1fr); color: var(--nnl-ink); background: #edf5f9; }
.nnl-toolbar { position: relative; min-height: 68px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--nnl-line); background: #fff; overflow: visible; }
.nnl-session-representation-toggle { display: none; align-items: center; gap: 0; }
.negative-number-lab[data-session-representation-toggle="true"] .nnl-session-representation-toggle { display: flex; }
.nnl-session-representation-toggle .nnl-button { border-radius: 0; }
.nnl-session-representation-toggle .nnl-button:first-child { border-radius: 8px 0 0 8px; }
.nnl-session-representation-toggle .nnl-button:last-child { margin-left: -1px; border-radius: 0 8px 8px 0; }
.nnl-session-representation-toggle .nnl-button[aria-pressed="true"] { z-index: 1; border-color: var(--nnl-blue); color: #fff; background: var(--nnl-blue); }
.toolbar-group { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.toolbar-group.questions { margin-left: 0; }
.nnl-toolbar-field, .nnl-menu-field { display: grid; gap: 4px; color: var(--nnl-muted); font-size: .8rem; font-weight: 800; }
.nnl-toolbar-field select, .nnl-menu-field input { min-width: 0; min-height: var(--nnl-touch); padding: 8px 10px; border: 1px solid #9fb8c8; border-radius: 8px; color: var(--nnl-ink); background: #fff; font-weight: 800; }
.nnl-toolbar-field select { min-width: 160px; }
.nnl-view-control { align-self: center; }
.nnl-activity-control { align-self: center; }
.nnl-activity-control select { min-width: 230px; }
.nnl-button, .nnl-toolbar summary { min-height: var(--nnl-touch); display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid #9fb8c8; border-radius: 8px; color: var(--nnl-ink); background: #fff; font-weight: 800; cursor: pointer; }
.nnl-button:hover, .nnl-button:focus-visible, .nnl-toolbar summary:hover, .nnl-toolbar summary:focus-visible { border-color: #006b99; outline: 0; box-shadow: 0 0 0 3px rgba(20, 155, 215, .18); }
.nnl-button.primary { border-color: var(--nnl-blue); color: #fff; background: var(--nnl-blue); }
.nnl-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.nnl-toolbar details { position: relative; }
.nnl-toolbar summary { list-style: none; }
.nnl-toolbar summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(330px, calc(100vw - 28px)); padding: 13px; border: 1px solid var(--nnl-line); border-radius: 9px; background: #fff; box-shadow: 0 14px 32px rgba(7, 16, 24, .2); }
.nnl-settings { width: min(520px, calc(100vw - 28px)); max-height: min(620px, calc(100vh - 100px)); overflow-y: auto; overscroll-behavior: contain; }
.nnl-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.nnl-settings-wide { grid-column: 1 / -1; }
.nnl-choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.nnl-choice-group legend { margin-bottom: 4px; padding: 0; color: var(--nnl-muted); font-size: .8rem; font-weight: 800; }
.nnl-choice-options { display: grid; gap: 6px; }
.nnl-choice-options.is-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nnl-choice-options.is-paired { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nnl-choice-options.is-labels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nnl-choice-options label { position: relative; min-width: 0; cursor: pointer; }
.nnl-choice-options input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.nnl-choice-options span { min-height: var(--nnl-touch); display: flex; align-items: center; justify-content: center; padding: 6px 8px; border: 1px solid #9fb8c8; border-radius: 8px; color: var(--nnl-ink); background: #fff; font-size: .82rem; font-weight: 800; line-height: 1.15; text-align: center; }
.nnl-choice-options label:hover span { border-color: #006b99; }
.nnl-choice-options input:focus-visible + span { border-color: #006b99; outline: 0; box-shadow: 0 0 0 3px rgba(20, 155, 215, .18); }
.nnl-choice-options input:checked + span { border-color: var(--nnl-blue); color: #fff; background: var(--nnl-blue); }
.nnl-settings .nnl-button { width: 100%; }
.nnl-settings p { margin: 10px 0 0; color: var(--nnl-muted); font-size: .82rem; line-height: 1.35; }
.nnl-settings-toggles { display: grid; gap: 8px; margin: 3px 0 10px; }
.nnl-settings-toggles[hidden] { display: none; }
.nnl-settings-toggles label { min-height: 38px; display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 800; }
.nnl-settings-toggles input { width: 22px; height: 22px; margin: 0; }
.nnl-chosen-toggle { min-height: 42px; display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 800; }
.nnl-chosen-toggle[hidden], .nnl-chosen-fields[hidden] { display: none; }
.nnl-chosen-toggle input { width: 22px; height: 22px; margin: 0; }
.nnl-chosen-fields { margin: 8px 0 10px; padding: 9px; border: 1px solid #c7d7df; border-radius: 8px; background: #f8fbfd; }
.nnl-settings .nnl-chosen-heading { margin: 0 0 7px; color: var(--nnl-ink); font-weight: 900; }
.nnl-chosen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.nnl-workspace { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; padding: 14px; overflow: hidden; }
.nnl-pupil-panel, .nnl-model-panel { min-width: 0; min-height: 0; border: 1px solid var(--nnl-line); border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(7, 32, 48, .07); }
.nnl-pupil-panel { align-content: start; display: grid; gap: 12px; padding: 14px; }
.nnl-task { padding: 11px 13px; border-left: 6px solid var(--nnl-gold); border-radius: 8px; background: #fff8e8; }
.nnl-kicker { margin: 0 0 4px; color: #8b5f00; font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.nnl-task h2 { margin: 0; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.25; }
.nnl-response-panel { min-width: 0; display: grid; align-content: start; gap: 10px; padding: 12px; border: 1px solid #d7e3ea; border-radius: 9px; background: #f8fbfd; font-size: 1rem; }
.nnl-response-panel[hidden] { display: none; }
.nnl-response-panel p { margin: 0; }
.nnl-reading strong { display: block; margin-top: 3px; color: #006b99; font-size: 2rem; }
.nnl-order { display: flex; flex-wrap: wrap; gap: 8px; }
.nnl-card { min-width: 56px; min-height: 52px; padding: 7px 11px; border: 2px solid #9b6a00; border-radius: 9px; color: var(--nnl-ink); background: #fff0c9; font-size: 1.3rem; font-weight: 900; cursor: grab; }
.nnl-card:active { cursor: grabbing; }
.nnl-card.is-located { border-color: #ef4f5f; background: #fff1f2; box-shadow: 0 0 0 3px rgba(239, 79, 95, .18); }
.nnl-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 900; }
.nnl-answer-form { margin: 0; }
.nnl-answer input, .nnl-sequence input { width: 82px; min-height: var(--nnl-touch); padding: 7px 9px; border: 2px solid #9bb0bc; border-radius: 8px; color: var(--nnl-ink); background: #fff; font-size: 1.15rem; font-weight: 900; }
.nnl-sequence { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 1.18rem; font-weight: 900; }
.nnl-sequence span { min-width: 46px; padding: 8px; border: 1px solid #9bb0bc; border-radius: 8px; background: #eef8fb; text-align: center; }
.nnl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nnl-feedback { min-height: var(--nnl-touch); margin: 0; padding: 11px 12px; border-radius: 9px; color: var(--nnl-muted); font-weight: 800; line-height: 1.35; }
.nnl-feedback:empty { display: none; }
.nnl-feedback:not(:empty) { border-left: 5px solid #006b99; background: #eef8fb; }
.nnl-feedback[data-tone="error"] { border-left-color: #b4232f; color: #8c1d27; background: #fff1f2; }
.nnl-feedback[data-tone="success"] { border-left-color: #357a46; color: #235b31; background: #e7f5e9; }
.nnl-feedback[data-tone="reveal"] { border-left-color: #9b6a00; color: #6d4a00; background: #fff0c9; }
.nnl-model-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; place-items: stretch; overflow: hidden; padding: 12px; }
.negative-number-lab:is([data-representation="thermometer"], [data-representation="both"]) .nnl-model-panel { padding: 6px; }
.nnl-representations { min-width: 0; min-height: 0; display: grid; place-items: stretch; overflow: hidden; }
.nnl-representations[hidden] { display: none; }
.nnl-representations.is-single { grid-template-columns: minmax(0, 1fr); }
.nnl-representations.is-both { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 8px; }
.nnl-representation { min-width: 0; min-height: 0; display: grid; place-items: stretch; overflow: hidden; }
.nnl-model-panel figure { align-self: stretch; width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; overflow: hidden; }
.nnl-model-panel figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.nnl-model-panel svg { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: none; max-height: none; object-fit: contain; overflow: hidden; }
.negative-number-lab[data-session-representation-toggle="true"] .nnl-representations.is-single,
.negative-number-lab[data-session-representation-toggle="true"] .nnl-representation,
.negative-number-lab[data-session-representation-toggle="true"] .nnl-representation .question-visual,
.negative-number-lab[data-session-representation-toggle="true"] .nnl-representation .diagram-frame { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-workspace {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}
.negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-pupil-panel {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, .7fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px;
}
.negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-pupil-panel:has(.nnl-response-panel[hidden]) {
  grid-template-columns: minmax(240px, 1fr) auto;
}
.negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-pupil-panel > * { min-width: 0; }
.negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-actions {
  align-self: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-feedback { grid-column: 1 / -1; }
.negative-number-lab .zoom-line-label-pill { display: none; }
.nnl-task-canvas { min-width: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(8px, 1.3vw, 18px); margin-top: 8px; padding: clamp(12px, 2vw, 24px); border-top: 1px solid var(--nnl-line); background: #fffdf8; }
.nnl-task-canvas[hidden] { display: none; }
.nnl-sequence-form { display: contents; }
.nnl-task-canvas.is-order .nnl-card { min-width: clamp(72px, 7vw, 108px); min-height: clamp(62px, 7vh, 82px); padding: 9px 16px; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.nnl-inequality-symbol { width: 1em; color: #006b99; font-size: clamp(2rem, 3.6vw, 3.25rem); font-weight: 900; line-height: 1; text-align: center; }
.nnl-inequality-symbol.is-hidden { visibility: hidden; }
.nnl-sequence-card { min-width: clamp(68px, 7vw, 104px); min-height: clamp(60px, 7vh, 78px); display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 2px solid #087eaf; border-radius: 9px; color: var(--nnl-ink); background: #eef8fb; font-size: clamp(1.65rem, 2.8vw, 2.55rem); font-weight: 900; text-align: center; }
button.nnl-sequence-card { cursor: pointer; }
.nnl-sequence-card[aria-pressed="true"], .nnl-sequence-card.is-selected { border-color: #ef4f5f; background: #fff1f2; box-shadow: 0 0 0 3px rgba(239, 79, 95, .18); }
.nnl-sequence-card input { width: clamp(58px, 6vw, 88px); min-height: 48px; padding: 5px 7px; border: 0; border-bottom: 3px solid #087eaf; border-radius: 0; color: var(--nnl-ink); background: transparent; font-size: inherit; font-weight: 900; text-align: center; }
.nnl-sequence-card.is-repaired { gap: 10px; border-color: #357a46; background: #e7f5e9; }
.nnl-sequence-card.is-repaired s { color: #8c1d27; font-size: .72em; }
.nnl-sequence-card.is-repaired strong { color: #235b31; }
.nnl-sequence-separator { color: var(--nnl-muted); font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 900; }
.negative-number-lab[data-representation="cards"] .nnl-model-panel { grid-template-rows: minmax(0, 1fr) auto; padding: 8px; }
.negative-number-lab[data-representation="cards"] .nnl-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.negative-number-lab[data-representation="cards"][data-sentence-visible="false"]:not([data-activity="order"]):not([data-activity="sequence-continue"]):not([data-activity="sequence-repair"]) .nnl-workspace { grid-template-rows: minmax(0, 1fr); }
.negative-number-lab[data-representation="cards"][data-sentence-visible="false"]:not([data-activity="order"]):not([data-activity="sequence-continue"]):not([data-activity="sequence-repair"]) .nnl-model-panel { display: none; }
.negative-number-lab[data-representation="cards"][data-sentence-visible="false"]:not([data-activity="order"]):not([data-activity="sequence-continue"]):not([data-activity="sequence-repair"]) .nnl-pupil-panel { align-content: center; }
.negative-number-lab[data-representation="cards"] .nnl-task-canvas { align-self: stretch; margin: 0; border: 0; border-radius: 8px; }
.negative-number-lab[data-representation="cards"] .nnl-task-canvas.is-order .nnl-card { min-width: clamp(92px, 10vw, 150px); min-height: clamp(82px, 13vh, 126px); font-size: clamp(2.5rem, 5vw, 4.75rem); }
.negative-number-lab[data-representation="cards"] .nnl-inequality-symbol { font-size: clamp(2.8rem, 5.5vw, 5rem); }
.negative-number-lab[data-representation="cards"] .nnl-sequence-card { min-width: clamp(86px, 9vw, 136px); min-height: clamp(76px, 11vh, 108px); font-size: clamp(2.2rem, 4vw, 3.8rem); }
.negative-number-lab[data-representation="cards"] .nnl-sequence-separator { font-size: clamp(2.4rem, 4.5vw, 4rem); }
.nnl-number-sentence { min-width: 0; margin: 6px 0 0; padding: 10px 14px 6px; border-top: 1px solid var(--nnl-line); color: var(--nnl-ink); font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 900; line-height: 1.15; text-align: center; }
.nnl-number-sentence-primary, .nnl-number-sentence-support { display: block; }
.nnl-number-sentence-support { margin-top: 3px; color: var(--nnl-muted); font-size: .62em; font-weight: 800; }
.nnl-number-sentence[hidden] { display: none; }
.nnl-button:focus-visible, .nnl-card:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid #ffd84a; outline-offset: 2px; }

.nnl-instructions { width: min(700px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 0; border: 0; border-radius: 10px; color: var(--nnl-ink); box-shadow: 0 24px 64px rgba(7, 16, 24, .35); }
.nnl-instructions::backdrop { background: rgba(7, 16, 24, .58); }
.nnl-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; color: #fff; background: #071018; }
.nnl-dialog-heading h2 { margin: 0; color: #fff; font-size: 1.25rem; }
.nnl-dialog-heading .nnl-button { border-color: #8fd8f3; color: #fff; background: #122436; }
.nnl-dialog-body { padding: 17px 20px; line-height: 1.5; overflow: auto; }
.nnl-dialog-body li { margin-bottom: 7px; }
.nnl-dialog-note { margin: 0; padding: 0 20px 17px; font-weight: 800; line-height: 1.4; }
.nnl-print-brand { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (min-width: 901px) and (min-height: 650px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  .app { width: 100%; height: 100vh; min-height: 0; overflow: hidden; }
  #negativeNumberLineModel, .negative-number-lab { height: 100%; min-height: 0; overflow: hidden; }
  .negative-number-lab[data-representation="both"] .nnl-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px; overflow: hidden; }
  .negative-number-lab[data-representation="cards"] .nnl-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px; overflow: hidden; }
  .negative-number-lab[data-representation="both"] .nnl-pupil-panel { grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.25fr) auto; align-items: start; gap: 8px; padding: 8px; }
  .negative-number-lab[data-representation="cards"] .nnl-pupil-panel { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 8px; }
  .negative-number-lab[data-representation="both"][data-activity="explore"] .nnl-pupil-panel,
  .negative-number-lab[data-representation="both"][data-activity="opposites"] .nnl-pupil-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .negative-number-lab[data-representation="both"][data-activity="order"] .nnl-pupil-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .negative-number-lab[data-representation="both"][data-activity="sequence-continue"] .nnl-pupil-panel,
  .negative-number-lab[data-representation="both"][data-activity="sequence-repair"] .nnl-pupil-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .negative-number-lab[data-representation="both"] .nnl-pupil-panel > * { min-width: 0; }
  .negative-number-lab[data-representation="cards"] .nnl-pupil-panel > * { min-width: 0; }
  .negative-number-lab[data-representation="both"] .nnl-actions { align-self: center; justify-content: flex-end; }
  .negative-number-lab[data-representation="cards"] .nnl-actions { align-self: center; justify-content: flex-end; }
  .negative-number-lab[data-representation="both"] .nnl-feedback { grid-column: 1 / -1; }
  .negative-number-lab[data-representation="cards"] .nnl-feedback { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .app { display: block; }
  .topbar { grid-template-columns: 1fr; }
  .top-actions { justify-content: flex-start; flex-wrap: wrap; }
  .negative-number-lab { display: block; min-height: 0; }
  .nnl-toolbar { align-items: stretch; flex-wrap: wrap; }
  .nnl-toolbar-field { flex: 1 1 180px; }
  .nnl-toolbar-field select { width: 100%; }
  .nnl-settings { left: auto; right: 0; width: min(390px, calc(100vw - 28px)); max-height: none; overflow-y: visible; }
  .toolbar-group.questions { margin-left: 0; }
  .nnl-workspace { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .nnl-model-panel { min-height: 380px; }
  .nnl-model-panel svg { max-height: 520px; }
  .negative-number-lab[data-representation="both"] .nnl-model-panel { min-height: 720px; }
  .negative-number-lab[data-representation="cards"] .nnl-model-panel { min-height: 420px; }
  .nnl-representations.is-both { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(240px, .75fr) minmax(360px, 1.25fr); }
  .negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-pupil-panel,
  .negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-pupil-panel:has(.nnl-response-panel[hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }
  .negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-actions { flex-wrap: wrap; justify-content: flex-start; }
  .negative-number-lab[data-session-representation-toggle="true"][data-representation="line"] .nnl-feedback { grid-column: auto; }
}

@media (max-width: 620px) {
  .topbar { padding: 9px 10px; }
  .brand { align-items: flex-start; flex-direction: column; gap: 7px; }
  .brand-logo img { width: 126px; }
  .brand h1 { font-size: 1.12rem; }
  .top-actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 5px; }
  .icon-button, .home-button { min-width: 44px; min-height: 44px; }
  .home-button { padding-inline: 4px; font-size: .78rem; }
  .nnl-toolbar { padding: 7px 10px; }
  .toolbar-group { width: 100%; }
  .toolbar-group > details, .toolbar-group.questions > .nnl-button { flex: 1 1 96px; }
  .nnl-toolbar details { position: static; }
  .nnl-toolbar summary { width: 100%; }
  .menu-panel { top: calc(100% + 6px); right: 10px; left: 10px; width: auto; }
  .nnl-settings-grid { grid-template-columns: 1fr; }
  .nnl-settings-wide { grid-column: auto; }
  .nnl-choice-options.is-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nnl-workspace { gap: 8px; padding: 8px; }
  .nnl-pupil-panel { gap: 9px; padding: 9px; }
  .nnl-model-panel { min-height: 310px; padding: 5px; }
  .negative-number-lab[data-representation="both"] .nnl-model-panel { min-height: 650px; }
  .negative-number-lab[data-representation="cards"] .nnl-model-panel { min-height: 360px; }
  .nnl-task-canvas { padding: 12px 8px; }
  .negative-number-lab[data-representation="cards"] .nnl-task-canvas.is-order .nnl-card { min-width: 70px; min-height: 70px; font-size: clamp(1.8rem, 10vw, 3rem); }
  .negative-number-lab[data-representation="cards"] .nnl-inequality-symbol { font-size: clamp(2rem, 10vw, 3.2rem); }
  .negative-number-lab[data-representation="cards"] .nnl-sequence-card { min-width: 64px; min-height: 68px; font-size: clamp(1.7rem, 9vw, 2.8rem); }
  .negative-number-lab[data-representation="cards"] .nnl-sequence-separator { font-size: clamp(1.8rem, 9vw, 3rem); }
  .nnl-actions .nnl-button { flex: 1 1 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .negative-number-lab * { animation-duration: .001ms !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

@page { size: A4 landscape; margin: 8mm; }
@media print {
  html, body { width: 100%; height: auto !important; overflow: visible !important; background: #fff !important; }
  .topbar, .nnl-toolbar, .nnl-actions, .nnl-feedback, .nnl-instructions, .classroom-tools-layer, .annotation-toolbar { display: none !important; }
  .app, #negativeNumberLineModel, .negative-number-lab, .nnl-workspace { min-height: 0 !important; height: auto !important; overflow: visible !important; }
  .negative-number-lab { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 3mm; background: #fff; }
  .nnl-workspace { height: 160mm !important; display: grid; grid-template-columns: 70mm minmax(0, 1fr); gap: 5mm; padding: 0; }
  .nnl-pupil-panel, .nnl-model-panel { overflow: hidden; border: 1px solid #93a9b7; box-shadow: none; }
  .nnl-pupil-panel { padding: 3mm; }
  .nnl-model-panel { padding: 4mm; }
  .nnl-model-panel svg { max-height: 144mm; }
  .nnl-representations.is-both { grid-template-columns: minmax(0, 1fr) 68mm; grid-template-rows: minmax(0, 1fr); gap: 3mm; }
  .nnl-task-canvas { margin-top: 2mm; padding: 3mm; gap: 3mm; }
  .nnl-task-canvas.is-order .nnl-card { min-width: 18mm; min-height: 15mm; padding: 2mm 3mm; font-size: 20pt; }
  .nnl-inequality-symbol { font-size: 24pt; }
  .negative-number-lab[data-representation="cards"] .nnl-workspace { grid-template-columns: 70mm minmax(0, 1fr); }
  .negative-number-lab[data-representation="cards"] .nnl-task-canvas.is-order .nnl-card { min-width: 26mm; min-height: 22mm; font-size: 28pt; }
  .negative-number-lab[data-representation="cards"] .nnl-inequality-symbol { font-size: 32pt; }
  .nnl-sequence-card { min-width: 18mm; min-height: 15mm; padding: 2mm; font-size: 18pt; }
  .negative-number-lab[data-representation="cards"] .nnl-sequence-card { min-width: 24mm; min-height: 20mm; font-size: 24pt; }
  .nnl-number-sentence { margin-top: 2mm; padding: 2mm 3mm 0; font-size: 18pt; }
  .nnl-print-brand { display: flex !important; align-items: center; justify-content: space-between; padding-top: 3mm; border-top: 1px solid #9bb0bc; font-size: 9pt; }
  .nnl-print-brand img { width: auto; height: 8mm; }
}
