/* Shared answer pad (svarpanel): compact talpanel + Godkend, and a letter layout. */
.answer-pad { display: grid; gap: 8px; width: 100%; min-width: 0; max-width: 30rem; margin-inline: auto; }
.pad-grid[hidden] { display: none !important; }
.pad-digits { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pad-letters { display: grid; gap: 6px; }
.pad-row { display: flex; justify-content: center; gap: 5px; }
.pad-key { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 56px; padding: 0 4px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font: inherit; font-size: 1.5rem; font-weight: 700; line-height: 1; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pad-key .luxi-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.pad-key:active:not(:disabled) { transform: translateY(1px); background: var(--lavender); }
.pad-key:disabled { opacity: .45; cursor: default; }
.pad-key.pad-submit:disabled { opacity: .55; }
.pad-backspace, .pad-switch, .pad-shift { font-size: 1rem; }
.pad-shift[aria-pressed="true"] { background: var(--lavender); border-color: var(--purple); }
.pad-submit { background: var(--theme-primary, var(--purple)); border-color: var(--theme-primary, var(--purple)); color: #fff; font-size: 1rem; }
.pad-submit:active:not(:disabled) { background: var(--theme-strong, var(--purple-dark)); }
.pad-row .pad-key { flex: 1 1 0; max-width: 3.2rem; min-height: 50px; font-size: 1.3rem; }
.pad-row .pad-shift, .pad-row .pad-backspace, .pad-row .pad-switch { flex: 1.5 1 0; max-width: 4.6rem; }
.pad-row .pad-space { flex: 4 1 0; max-width: none; min-width: 0; overflow: hidden; font-size: .95rem; font-weight: 600; }
.pad-row .pad-submit { flex: 2.5 1 0; max-width: 8rem; }
/* Sign keys after the digits (− and comma for decimals, fractions, points): Godkend fills the rest of its row. */
.pad-digits .pad-symbol + .pad-submit { grid-column: span 6; }
.pad-digits .pad-symbol + .pad-symbol + .pad-submit { grid-column: span 5; }
@media (max-width: 430px) {
  .pad-digits { gap: 6px; }
  .pad-key { min-height: 52px; }
  .pad-row { gap: 3px; }
  .pad-row .pad-key { min-height: 46px; padding: 0 2px; font-size: 1.15rem; }
  .pad-submit span { font-size: .9rem; }
}
.answer-pad { container-type: inline-size; }
@container (max-width: 520px) {
  .pad-digits .pad-submit span { display: none; }
  .pad-digits .pad-submit .luxi-icon { width: 30px; height: 30px; flex-basis: 30px; }
}

/* Number answers: the answer box sits above the pad, as in the kladde prototype. */
.uses-answer-pad .response-fields { gap: 12px; }
.uses-answer-pad .response-hint { text-align: center; color: var(--muted); }
.mode-numeric .response-slots { align-items: center; gap: 12px; }
.response-answer-label { font-weight: 700; }
.mode-numeric .response-slot[aria-pressed] { outline: 0; border-color: var(--purple); border-width: 2px; }
.mode-numeric .response-slot { min-width: 9rem; min-height: 58px; font-size: 1.9rem; letter-spacing: .06em; }
.response-keyboard { display: grid; }
.response-keyboard[hidden] { display: none; }
.with-answer-pad .task-actions:not(:has(button:not([hidden]), form)) { display: none; }

/* Sortable order list with move buttons (Flyt op / Flyt ned). */
.order-list { display: grid; gap: 14px; }
.order-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--panel); }
.order-item.dragging { opacity: .6; border-style: dashed; }
.order-item.drop-target { border-color: var(--purple); }
/* Flyt op / Flyt ned (user note 28.09): the moved row lights up for a moment
   while the rows slide into place (order_list_controller#showMove). The light
   is a colour fade only, so it also shows with reduced motion. */
.order-item.order-moved { position: relative; z-index: 1; animation: order-moved 1.1s ease-out; }
@keyframes order-moved {
  0%, 35% { border-color: var(--theme-primary, var(--purple)); background: var(--lavender); box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-primary, var(--purple)) 25%, transparent); }
  100% { border-color: var(--line); background: var(--panel); box-shadow: 0 0 0 0 transparent; }
}
.order-number { font-weight: 800; color: var(--purple-dark); text-align: center; }
.order-text { min-width: 0; overflow-wrap: anywhere; padding: 6px 0; cursor: grab; touch-action: none; }
.order-moves { display: flex; gap: 6px; }
.order-moves .button { min-width: 48px; min-height: 48px; padding: 6px 8px; }
.order-moves .button .luxi-icon { width: 22px; height: 22px; }
.order-moves .order-move-label { font-size: .85rem; }
.order-list ol[hidden], .order-pool .button[hidden] { display: none; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.order-pool .button { text-align: left; }
/* Cards with their own read-aloud: the speaker sits beside the text (pool and rows). */
.order-body { display: flex; align-items: center; gap: 4px; min-width: 0; }
.order-body .order-text { flex: 1; }
.order-speech { flex: none; }
.order-speech[hidden], .order-pool-card[hidden] { display: none; }
.order-pool-card { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; }
.order-pool-card .order-add { min-width: 0; }
.order-speech.icon-speech .spoken-button { width: 48px; height: 48px; }
@media (max-width: 480px) { .order-moves .order-move-label { display: none; } }
/* A card with its own speaker on a phone: the text keeps the row's width and the
   arrows go on a line below, so words are not broken letter by letter (UI audit 29.09). */
@media (max-width: 480px) {
  .order-item:has(.order-speech:not([hidden])) { grid-template-columns: 2.2rem minmax(0, 1fr); row-gap: 2px; }
  .order-item:has(.order-speech:not([hidden])) .order-moves { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Kladde (scratchpad) */
.scratchpad-launch { display: flex; justify-content: center; margin: 0 0 18px; }
.scratchpad-toggle { position: relative; border-color: var(--purple); color: var(--purple-dark); }
.scratchpad-toggle[aria-expanded="true"] { background: var(--lavender); }
.scratchpad-toggle .luxi-icon { width: 24px; height: 24px; }
.scratchpad-has-content { position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; border-radius: 50%; background: var(--gold, #ffd77d); border: 2px solid var(--panel); }
.scratchpad-sheet { display: flex; flex-direction: column; min-height: 0; background: var(--panel); container-type: inline-size; }
@container (max-width: 700px) { .scratchpad-tool-label { display: none; } }
.scratchpad-sheet[hidden] { display: none !important; }
.scratchpad-handle { flex: 0 0 auto; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.scratchpad-handle::before { content: ""; width: 46px; height: 5px; border-radius: 3px; background: #cfc4dc; }
/* The whole question on top of the kladde (note on cbf59033 29.09): shown in full by default, a long one
   scrolls inside the strip (at most about a third of the screen, less when the one keyboard is open);
   the chevron folds it to two lines to give the drawing more room. */
.scratchpad-pinned { flex: 0 1 auto; display: flex; align-items: flex-start; gap: 6px; min-height: 3.4em; max-height: 34dvh; margin: 0 12px 6px; padding: 8px 6px 8px 12px; border-radius: 14px; background: var(--lavender); color: var(--ink); font-weight: 600; overflow: hidden; }
.scratchpad-pinned-text { flex: 1 1 auto; min-width: 0; max-height: 100%; margin: 0; overflow-y: auto; overscroll-behavior: contain; align-self: stretch; }
.scratchpad-pinned.is-folded { min-height: 0; }
.scratchpad-pinned.is-folded .scratchpad-pinned-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scratchpad-pinned-toggle { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; margin: -4px 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; touch-action: manipulation; }
.scratchpad-pinned-toggle .luxi-icon { width: 24px; height: 24px; transform: rotate(180deg); transition: transform .15s ease; }
.scratchpad-pinned.is-folded .scratchpad-pinned-toggle .luxi-icon { transform: none; }
.scratchpad-pinned-context { font-weight: 400; }
.scratchpad-pinned-expression { font-family: Georgia, serif; font-size: 1.3rem; font-weight: 400; white-space: nowrap; }
.scratchpad-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding: 0 12px 8px; min-width: 0; }
@media (max-width: 400px) { .scratchpad-tools { gap: 4px; padding-inline: 8px; } .scratchpad-tool { min-width: 42px; padding-inline: 6px; } .scratchpad-modes { margin-right: 0; } }
.scratchpad-modes { display: inline-flex; gap: 4px; margin-right: 4px; }
.scratchpad-spacer { flex: 1; }
.scratchpad-tool { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px; padding: 6px 9px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.scratchpad-tool[hidden] { display: none; }
.scratchpad-tool .luxi-icon { width: 21px; height: 21px; flex: 0 0 21px; }
.scratchpad-tool[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #fff; }
.scratchpad-tool:disabled { opacity: .4; cursor: default; }
.scratchpad-close { border-color: var(--purple); color: var(--purple-dark); }
.scratchpad-paper { position: relative; flex: 1 1 auto; min-height: 170px; margin: 0 12px 10px; overflow: hidden; border: 1.5px solid var(--line); border-radius: 16px;
  background-color: #fffefb; background-image: linear-gradient(#e3dcef 1px, transparent 1px), linear-gradient(90deg, #e3dcef 1px, transparent 1px); background-size: 26px 26px; background-position: -1px -1px; }
.scratchpad-paper canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.scratchpad-erasing .scratchpad-paper canvas { cursor: cell; }
.scratchpad-paper .scratchpad-text { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; padding: 3px 14px; border: 0; border-radius: 0; resize: none;
  background: #fffefb repeating-linear-gradient(transparent 0 31px, #d9d0e8 31px 32px); background-attachment: local; color: var(--ink); font: inherit; font-size: 1.25rem; line-height: 32px; }
.scratchpad-paper [hidden] { display: none !important; }
/* Skriv mode: LUXI's own compact pad under the lined paper (never the phone keyboard). */
.scratchpad-pad { flex: 0 0 auto; padding: 0 12px 10px; }
.scratchpad-pad[hidden] { display: none; }
.scratchpad-pad .pad-key { min-height: 42px; font-size: 1.15rem; background: #fbf9ff; }
.scratchpad-pad .pad-digits, .scratchpad-pad .pad-letters { gap: 5px; }
.scratchpad-pad .pad-row .pad-key { min-height: 40px; }
.scratchpad-hint { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center; font-size: .9rem; color: var(--muted); pointer-events: none; }

/* Phone and portrait: the kladde fills the screen above a fixed answer dock
   (answer + compact pad + Godkend), with a pinned copy of the task on top. */
@media (max-width: 899.98px), (orientation: portrait) {
  .task-panel.scratchpad-open { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; padding: env(safe-area-inset-top) 0 0; border: 0; border-radius: 0; overflow: hidden; overscroll-behavior: contain; }
  .task-panel.scratchpad-open > * { display: none; }
  .task-panel.scratchpad-open > .scratchpad-sheet { display: flex; order: 0; flex: 1 1 auto; min-height: 0; }
  .task-panel.scratchpad-open > .task-body { display: contents; }
  .task-panel.scratchpad-open > .task-body > * { display: none; }
  .task-panel.scratchpad-open > .task-body > .answer-form { display: block; order: 2; flex: 0 1 auto; max-height: 55%; overflow: auto; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel); }
  .task-panel.scratchpad-open > .task-feedback:has(.feedback-result-mark) { display: flex; order: 1; height: auto; margin: 0; padding: 4px 12px; gap: 8px; border-top: 1px solid var(--line); }
  .task-panel.scratchpad-open > .task-feedback h2 { font-size: 1rem; margin: 0; }
  .task-panel.scratchpad-open > .task-action-bar:has(.task-actions button:not([hidden]), .task-actions form) { display: block; order: 3; position: static; margin: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-radius: 0; box-shadow: none; background: var(--panel); }
  .task-panel.scratchpad-open .task-action-listening { display: none; }
  .task-panel.scratchpad-open[data-task-state-value] .answer-form .answer-pad:has(.pad-submit) { position: static; width: 100%; max-width: 30rem; margin-inline: auto; padding: 0; border: 0; box-shadow: none; background: none; }
  .task-panel.scratchpad-open .response-hint, .task-panel.scratchpad-open .response-tools, .task-panel.scratchpad-open .response-clear, .task-panel.scratchpad-open .response-fields > legend { display: none; }
  .task-panel.scratchpad-open .response-fields { gap: 6px; }
  .task-panel.scratchpad-open .pad-digits { gap: 6px; }
  .task-panel.scratchpad-open .pad-key { min-height: 46px; font-size: 1.3rem; }
  .task-panel.scratchpad-open .pad-submit span { display: none; }
  .task-panel.scratchpad-open .pad-submit .luxi-icon { width: 28px; height: 28px; }
  .task-panel.scratchpad-open .mode-numeric .response-slot { min-height: 46px; font-size: 1.5rem; }
  .task-panel.scratchpad-open .response-slot { min-height: 48px; }
  .task-panel.scratchpad-open .answer-choices { gap: 8px; }
}

/* Wide screens (tablet landscape, desktop): task, kladde and answer side by side. */
@media (min-width: 900px) and (orientation: landscape) {
  .task-panel.scratchpad-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: repeat(14, auto) 1fr; column-gap: 22px; align-items: start; }
  .task-panel.scratchpad-open > * { grid-column: 1; min-width: 0; }
  .task-panel.scratchpad-open > .scratchpad-sheet { grid-column: 2; grid-row: 1 / -1; position: sticky; top: 12px; height: min(calc(100vh - 24px), 720px); padding-top: 10px; border: 1px solid var(--line); border-radius: 20px; }
  .task-panel.scratchpad-open .scratchpad-handle, .task-panel.scratchpad-open .scratchpad-pinned { display: none; }
  .task-panel.scratchpad-open .task-body { padding-top: 12px; }
  .task-panel.scratchpad-open .task-prompt { font-size: 1.3rem; margin-bottom: 14px; }
  .task-panel.scratchpad-open .math-expression { margin: 12px 0; }
  .task-panel.scratchpad-open .task-feedback { height: auto; min-height: 64px; margin-top: 12px; }
  .task-panel.scratchpad-open .task-image { height: min(22vh, 200px); margin-bottom: 12px; }
  .task-panel.scratchpad-open .response-hint, .task-panel.scratchpad-open .progress-meter { display: none; }
  .task-panel.scratchpad-open .scratchpad-launch { margin-bottom: 10px; }
  .task-panel.scratchpad-open .pad-key { min-height: 48px; }
  .task-panel.scratchpad-open > .task-action-bar { margin-right: 0; border-bottom-right-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .scratchpad-sheet { transition: transform .18s ease; }
}
@media (max-width: 899.98px), (orientation: portrait) {
  .task-panel.scratchpad-open:not([data-task-state-value="unanswered"]) .answer-form .answer-pad { display: none; }
}

/* One keyboard in Skriv mode (user decision 27.09): the kladde keyboard types in
   the kladde (gold) or in the answer (purple). The answer's own pad is hidden. */
.task-panel { --kladde-aim: #c98a00; --kladde-aim-soft: #fff1c9; --answer-aim: var(--theme-primary, var(--purple)); }
.task-panel.scratchpad-writing .answer-form .answer-pad,
.task-panel.scratchpad-writing .answer-form .response-keyboard { display: none !important; }
.kladde-keyboard { --aim: var(--kladde-aim); padding: 8px 12px 10px; border-top: 5px solid var(--aim); background: var(--panel); }
.task-panel[data-typing="answer"] .kladde-keyboard { --aim: var(--answer-aim); }
.kladde-aims { display: flex; gap: 8px; max-width: 30rem; margin: 0 auto 8px; }
.kladde-aim { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 52px; padding: 0 10px;
  border: 2.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--muted); font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.kladde-aim .luxi-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.kladde-aim[hidden], .kladde-submit[hidden] { display: none; }
.kladde-aim:disabled { opacity: .4; cursor: default; }
.kladde-aim-kladde[aria-pressed="true"] { background: var(--gold, #ffd77d); border-color: var(--kladde-aim); color: #3b2800; box-shadow: 0 0 0 3px var(--kladde-aim-soft); }
.kladde-aim-answer[aria-pressed="true"] { background: var(--answer-aim); border-color: var(--answer-aim); color: #fff; box-shadow: 0 0 0 3px var(--lavender); }
.kladde-aims .kladde-submit { flex: 0 0 auto; min-height: 52px; padding: 0 14px; }
@container (max-width: 380px) { .kladde-aims .kladde-submit span { display: none; } }
.kladde-keyboard { container-type: inline-size; }
/* Keys the answer does not accept (e.g. letters for a number answer). */
.pad-key.pad-key-blocked { opacity: .22; border-style: dashed; background: repeating-linear-gradient(135deg, #f6f3fa 0 6px, #e8e2f0 6px 12px); }
/* The field being typed in: coloured frame, a "Du skriver her" tag and a visible caret. */
.task-panel[data-typing] .scratchpad-paper { transition: box-shadow .15s ease; }
.task-panel[data-typing="kladde"] .scratchpad-paper { border: 3px solid var(--kladde-aim); box-shadow: 0 0 0 4px var(--kladde-aim-soft); }
.task-panel[data-typing="kladde"] .scratchpad-paper::after,
.task-panel[data-typing="answer"] .answer-form::before { content: "Du skriver her"; font-size: .8rem; font-weight: 800; line-height: 1; padding: 4px 8px; border-radius: 999px; pointer-events: none; }
.task-panel[data-typing="kladde"] .scratchpad-paper::after { position: absolute; top: 6px; right: 8px; z-index: 1; background: var(--kladde-aim); color: #fff; }
.task-panel[data-typing="answer"] .answer-form { position: relative; }
.task-panel[data-typing="answer"] .answer-form::before { display: table; margin: 0 auto 6px; background: var(--answer-aim); color: #fff; }
.task-panel[data-typing="answer"] .answer-form .response-fields,
.task-panel[data-typing="answer"] .answer-form .answer-field,
.task-panel[data-typing="answer"] .answer-form .discrete-text { border-radius: 16px; outline: 3px solid var(--answer-aim); outline-offset: 4px; box-shadow: 0 0 0 9px var(--lavender); }
.task-panel[data-typing="answer"] .response-slot[aria-pressed="true"] { border-color: var(--answer-aim); border-width: 3px; }
.task-panel[data-typing="answer"] .response-slot[aria-pressed="true"]::after { content: ""; display: inline-block; width: 3px; height: 1.1em; margin-left: 3px; vertical-align: middle; background: var(--answer-aim); }
.task-panel[data-typing="kladde"] .answer-form { opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .task-panel[data-typing="answer"] .response-slot[aria-pressed="true"]::after { animation: kladde-caret 1.1s steps(1) infinite; }
}
@keyframes kladde-caret { 50% { opacity: 0; } }
/* Phone and portrait: kladde, answer, then the one keyboard at the bottom. */
@media (max-width: 899.98px), (orientation: portrait) {
  .task-panel.scratchpad-open > .kladde-keyboard:not([hidden]) { display: block; order: 3; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .task-panel.scratchpad-open.scratchpad-writing > .task-action-bar:has(.task-actions button:not([hidden]), .task-actions form) { order: 4; }
  .task-panel.scratchpad-writing > .task-body > .answer-form { max-height: 40%; }
}
/* Wide screens (side by side): the one keyboard sits under the answer, next to the kladde. */
@media (min-width: 900px) and (orientation: landscape) {
  .task-panel.scratchpad-open > .kladde-keyboard { margin-top: 12px; border: 1px solid var(--line); border-top: 5px solid var(--aim); border-radius: 18px; }
}
.kladde-aims .kladde-submit { background: var(--answer-aim); border-color: var(--answer-aim); color: #fff; font-size: 1rem; }

/* Fixed action bar (user decision 28.09, "ja prøv det!"): the main action –
   Godkend, Prøv igen, Se svar, Næste – is always on screen without scrolling,
   on phone, tablet and desktop. The bar is the task panel's last visible child
   and sticks to the bottom of the viewport; it takes its own place in the flow,
   so nothing ends up hidden behind it once the page is scrolled to the end.
   Tasks with Godkend in the answer pad (talpanel/tastatur) stick the pad itself
   instead, so there is only ever one Godkend on screen. */
.task-panel { --task-pad: 26px; --task-surface: #fffefa; }
@media (max-width: 650px) { .task-panel { --task-pad: 18px; } }
@media (max-width: 430px) { .task-panel { --task-pad: 12px; } }
.task-action-bar {
  position: sticky; bottom: 0; z-index: 4; display: grid; gap: 6px;
  margin: 16px calc(-1 * var(--task-pad)) calc(-1 * var(--task-pad));
  padding: 10px var(--task-pad) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); border-radius: 0 0 23px 23px;
  background: var(--task-surface); box-shadow: 0 -12px 20px -16px #071a2466;
}
.task-action-bar .task-action-listening { margin-top: 0; }
.task-action-bar .task-action-listening:not(:has(button)) { display: none; }
.task-action-bar:not(:has(button:not([hidden]), form)) { display: none; }
@media (max-width: 430px) {
  .task-action-bar .task-primary-slot, .task-action-bar .task-secondary-slot, .task-action-bar .task-action { height: 76px; }
}
/* The pad with Godkend sticks to the bottom while the answer is open. */
.task-panel[data-task-state-value="unanswered"] .answer-form .answer-pad:has(.pad-submit) {
  position: sticky; bottom: 0; z-index: 4; width: auto; max-width: none;
  margin-inline: calc(-1 * var(--task-pad));
  padding: 10px max(var(--task-pad), calc((100% - 30rem) / 2 + var(--task-pad))) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--task-surface); box-shadow: 0 -12px 20px -16px #071a2466;
}
/* Focus and scrollIntoView keep a field clear of the bar. */
html:has(.task-action-bar) { scroll-padding-bottom: 170px; }
/* Short landscape screens (tablet on its side): a slightly lower task picture
   leaves room for the answer and its docked pad above the fold. */
@media (orientation: landscape) and (max-height: 900px) {
  .task-image { height: clamp(140px, 28vh, 280px); }
}

/* Kladde on coordinate tasks: the task's coordinate system is drawn on the canvas under the strokes. */
.scratchpad-paper.scratchpad-coordinates { background-image: none; }
/* Figure tasks: the task's picture, scaled to fit with its aspect ratio, under the transparent drawing canvas. */
.scratchpad-paper .scratchpad-figure { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; pointer-events: none; user-select: none; -webkit-user-select: none; }
.scratchpad-grid-toggle { position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .92); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.scratchpad-grid-toggle .luxi-icon { width: 24px; height: 24px; }
.scratchpad-grid-toggle[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Pilot feedback "Dårlig opgave" (docs/PILOT_FEEDBACK.md): quiet, small icon,
   44px hit area, beside the progress meter so it never covers the answer pad
   or the kladde. aria-pressed shows the state (filled icon). */
.task-topline { display: flex; align-items: center; gap: 6px; }
.task-topline > .progress-meter { flex: 1 1 auto; }
.task-flag-slot { flex: 0 0 auto; margin-left: auto; }
.task-flag {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -6px -8px -6px 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted, #56666b); opacity: .55; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.task-flag .luxi-icon { width: 18px; height: 18px; }
.task-flag:hover, .task-flag:focus-visible { opacity: 1; }
.task-flag:focus-visible { outline: 3px solid var(--theme-primary, #17635f); outline-offset: -3px; }
.task-flag[aria-pressed="true"] { opacity: 1; color: var(--theme-accent, #c65a3a); }
.task-flag[aria-pressed="true"] .luxi-icon { fill: currentColor; }
