/* UX batch 2026-10-26, area: ipad (one file per area so parallel work does not collide) */

/* Line under «Handschrift / Formel tippen»: each tab submits only its own content. */
.mode-tabs + .mode-note { margin: 0 0 0.5rem; font-size: 0.85rem; }

/* Quiz pages: the open «Aufgabe» bar (statement + options) stays short, so the notes below remain usable. */
body:has(#solution[data-notes-only]) .task-dock-body { max-height: min(30vh, 340px); }
body:has(#solution[data-notes-only]) .task-dock-body .dock-options { font-size: 0.9rem; }
.task-dock-body .guided-toggle, .task-dock-body > .card > p.small.muted { display: none; } /* stay on the page itself */
.task-dock-body > .card { padding: 0.7rem 0.9rem; }
body:has(#solution[data-notes-only]) .task-dock-body table.dock-options td { padding: 0.2rem 0.4rem; }

/* Handwriting: the gap ux-ipad.js opens above the tools while the «Aufgabe» bar is expanded (no ink under it).
   No scroll anchoring here, or the browser would scroll the gap away again. */
#solution:not([data-notes-only]) { overflow-anchor: none; }
.dock-gap { height: 0; }

/* Landscape tablet (1000–1279 px) on handwriting exercises: a narrower statement column, so the pad gets
   ~800 px and both tool rows fit in one line each (before: 655 px, «Rückgängig» cut, options in two rows). */
@media (min-width: 1000px) and (max-width: 1279px) {
  body:not(.theory-open) .solve.is-split:has(#solution:not([data-notes-only])) { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 1rem; }
  .solve.is-split:has(#solution:not([data-notes-only])) .ex-statement-card { padding: 1rem; }
  .solve.is-split #solution:not([data-notes-only]) .pen-options { gap: 0.3rem 0.3rem; }
  .solve.is-split #solution:not([data-notes-only]) .pen-options .opt-group { gap: 0.1rem; }
  .solve.is-split #solution:not([data-notes-only]) .paper-select select { padding: 0 0.3rem; }
  .solve.is-split #solution:not([data-notes-only]) .clear-btn .tool-label { display: none; }
  .solve.is-split #solution:not([data-notes-only]) .zoom-label { min-width: 3.4rem; padding-inline: 0.2rem; }
  .solve.is-split #solution:not([data-notes-only]) .pen-options .swatch,
  .solve.is-split #solution:not([data-notes-only]) .pen-options .width-btn,
  .solve.is-split #solution:not([data-notes-only]) .pen-options .tool { min-width: 40px; min-height: 40px; }
  .solve.is-split #solution:not([data-notes-only]) .toolbar { gap: 0.25rem; }
  .solve.is-split #solution:not([data-notes-only]) .toolbar > .tool { padding: 0.4rem 0.5rem; }
}

/* On-screen maths keyboard open (ux-ipad.js sets --mathkb-h): room below the page, «Einreichen» sticks above it. */
html.mathkb-open body { padding-bottom: var(--mathkb-h, 0px); }
html.mathkb-open #keyboard-form > p:last-child { position: sticky; bottom: var(--mathkb-h, 0px); z-index: 4; margin: 0; padding: 0.5rem 0; background: var(--paper); border-top: 1px solid var(--line); }
html.mathkb-open .confirm-form { position: sticky; bottom: var(--mathkb-h, 0px); z-index: 4; padding: 0.5rem 0; background: var(--paper); }

/* «falsch gelesen?»: the formula editor instead of a LaTeX field (same look as «Formel tippen»). */
.fix math-field.confirm-field { display: block; width: 100%; min-height: 3rem; margin-top: 0.3rem; font-size: 1.3rem; padding: 0.35rem 0.6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  --caret-color: var(--accent); --selection-background-color: var(--accent-soft); --contains-highlight-background-color: transparent; }
.fix math-field.confirm-field:focus-within { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.fix math-field.confirm-field::part(virtual-keyboard-toggle), .fix math-field.confirm-field::part(menu-toggle) { color: var(--muted); }

/* «Ihr letzter Versuch»: the «Mehr Hilfe» explanation, folded. */
.last-more-help h3 { font-size: 1rem; margin: 0.8rem 0 0.3rem; }
