/* Interaction-first practice layout. No animation is restarted on a keystroke,
   tile tap, save notification, or feedback update. */
.learning-shell { display:flex;flex-direction:column;gap:10px;min-height:calc(var(--study-viewport,100dvh) - 24px); }
.learning-shell .card { animation:none; }
.learning-card { flex:1;display:flex;flex-direction:column;gap:16px;min-width:0; }
.learning-prompt { display:flex;flex-direction:column;gap:12px; }
.learning-prompt h2 { font:600 clamp(23px,5.8vw,31px)/1.35 var(--sans);margin:0;overflow-wrap:anywhere; }
.learning-prompt .prompt { margin:0;color:var(--muted);font-size:16px; }
.learning-prompt .note { font-size:14px; }
.learning-footer { margin-top:auto;padding-top:12px; }
.learning-primary { display:flex;flex-wrap:wrap;align-items:center;gap:10px; }
.learning-primary .primary-answer, .learning-feedback .primary-answer { min-height:48px;flex:1 0 100%; }
.learning-feedback { display:flex;flex-direction:column;gap:10px;border-top:2px solid var(--line);padding-top:14px; }
.learning-feedback.positive { border-color:var(--good); }
.learning-feedback > strong { font-size:17px; }
.learning-feedback [lang=de] { font-size:22px;line-height:1.4; }
.learning-feedback p { margin:0; }
.learning-feedback details { font-size:14px; }
.learning-feedback .note { font-size:15px; }
#practice-answer { width:100%;box-sizing:border-box;min-height:54px;padding:13px 14px;font:400 21px/1.3 var(--sans);color:var(--ink);background:var(--surface);border:2px solid var(--line);border-radius:10px;outline:none;scroll-margin:100px; }
#practice-answer:focus { border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent); }
.input-note { min-height:20px;font-size:13px;color:var(--muted);margin-top:6px!important; }
.practice-progress { height:5px;width:100%;accent-color:var(--accent);border:0;border-radius:4px; }
.learning-shell button, .learning-shell summary { touch-action:manipulation;-webkit-tap-highlight-color:transparent; }
.learning-shell button:active:not(:disabled) { transform:translateY(1px);filter:brightness(.94); }
.learning-shell .btn, .learning-shell .opt { transition:background-color 90ms ease,border-color 90ms ease; }
.learning-shell .opt { min-height:54px;padding:13px 15px;font-size:18px; }
.learning-options { grid-template-columns:1fr!important; }
.tile-answer, .tile-bank { display:flex;flex-wrap:wrap;gap:8px;min-height:62px;align-content:flex-start; }
.tile-answer { padding:12px 0 16px;border-bottom:2px solid var(--line);margin-bottom:16px; }
.tile-bank { padding:4px 0; }
.word-tile { padding:10px 13px;min-width:42px;min-height:46px;border:1px solid var(--line);border-bottom-width:3px;border-radius:9px;background:var(--surface);font-size:18px;line-height:1.2; }
.word-tile:disabled { opacity:.25; }
.word-tile.selected { border-color:var(--accent); }
.word-tile.selected:disabled { opacity:.8; }
.learning-feedback .btn { width:100%; }
.listen-prompt { display:flex;gap:10px;align-items:center;min-height:72px; }
.listen-prompt > .btn { min-height:54px;min-width:140px; }
.study-sync-status { font-size:13px;color:var(--hard);padding:8px;border:1px solid var(--line);border-radius:8px; }
.visually-hidden { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
@media(min-width:900px) { .app:has(.learning-shell) { max-width:720px; }.learning-shell { min-height: min(760px, calc(100dvh - 24px)); } }
@media(prefers-reduced-motion:reduce) { .learning-shell * { transition:none!important;animation:none!important; }.learning-shell button:active { transform:none; } }

/* Keep the study dashboard focused on decisions, not instructional boilerplate. */
.learning-home { display:flex;flex-direction:column;gap:12px; }
.learning-home .card { gap:12px;padding:16px; }
.learning-home h2 { margin:0;font-size:21px;line-height:1.25; }
.learning-home .top { margin:0; }
.learning-home .btn { min-height:44px; }
.learning-home-review { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 3px; }
.learning-home-review strong { font-size:15px;font-weight:500; }
.learning-home-more { color:var(--muted);font-size:14px;padding:4px 3px; }
.learning-home-more > summary { padding:9px 0;cursor:pointer; }
.learning-home-more[open] { display:flex;flex-direction:column;gap:10px; }
.learning-home-more p { margin:0; }
.learning-home-more .btn { width:100%; }
.learning-units { display:flex;flex-direction:column;gap:8px; }
.learning-unit { display:flex;flex-direction:column;gap:9px;padding:12px 14px;background:var(--surface);border:1px solid var(--line);border-radius:10px; }
.learning-unit-title { display:flex;justify-content:space-between;align-items:baseline;gap:12px; }
.learning-unit-title strong { font-weight:600;line-height:1.35; }
.learning-unit-title span { font-size:13px;color:var(--muted);white-space:nowrap; }
.learning-unit-actions { display:flex;gap:8px;align-items:center;flex-wrap:wrap; }
.learning-unit-actions .btn { min-height:38px;font-size:14px;padding:0 13px; }
.learning-unit-actions details { margin-left:auto;color:var(--muted);font-size:14px; }
.learning-unit-actions details[open] { flex:1 0 100%; }
.learning-unit-actions details summary { padding:6px 2px; }
.learning-unit-actions details .link { margin:5px 8px 0 0;display:inline-flex; }
/* Feedback is a compact answer and diagnostic, not another teaching card. */
.learning-feedback { gap:9px; }
.learning-feedback .learning-model { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.learning-feedback .learning-model > span { flex:1;font-size:22px;line-height:1.35; }
.learning-feedback .learning-model .btn { flex:none;width:auto;min-height:36px;padding:5px 10px;font-size:13px; }
.learning-feedback .learning-word-change { display:flex;align-items:center;gap:8px;font-size:17px; }
.learning-feedback .learning-word-change span { text-decoration:line-through;text-decoration-color:var(--again); }
.learning-feedback .learning-feedback-reason { font-size:15px;line-height:1.4; }
.learning-feedback .learning-actions { margin-top:auto;display:flex;flex-wrap:wrap;gap:9px; }
.learning-feedback .learning-actions > .btn:not(.primary-answer) { width:auto;min-height:44px; }
.learning-feedback details { margin-top:2px; }
.learning-feedback details p { margin-top:6px; }
#practice-answer[readonly] { color:var(--muted);border-color:var(--line);box-shadow:none; }
@media(max-width:360px){.learning-feedback .learning-actions { flex-wrap:wrap; }.learning-feedback .learning-actions > .btn { flex:1 0 100%; }}

.learning-home-settings { font-size:14px;color:var(--muted);padding:4px 3px; }
.learning-home-settings > summary { cursor:pointer;padding:9px 0; }
.learning-home-settings[open] { display:flex;flex-direction:column;gap:10px; }
.learning-home-settings[open] .tools { margin:4px 0; }
.learning-home-settings .settings { border-top:1px solid var(--line);padding-top:12px; }
/* Feedback follows the answer. The primary action remains at the bottom of
   the same flexible card; long prompts and compact keyboards can scroll. */
.learning-card:has(.learning-feedback) .learning-footer { flex:1;display:flex;flex-direction:column;margin-top:0;padding-top:3px; }
.learning-footer > .learning-feedback { flex:1; }
.reply-starter { padding:8px 12px;border-left:3px solid var(--accent); }
.reply-starter p { margin:4px 0; }
@media (max-height:500px) {
  .learning-shell,.learning-card,.learning-prompt,.learning-feedback { gap:6px; }
  .learning-card { padding:10px 12px; }
  .learning-prompt p { margin:0; }
  .learning-feedback { padding-top:6px; }
}

.context-pieces { margin:4px 0;color:var(--muted);font-size:14px;line-height:1.45; }
.context-pieces > span { display:inline-block; }
.context-pieces > span:first-child { margin-right:4px; }

.word-order-memory { margin:0;padding:6px 10px;border-left:2px solid var(--line);line-height:1.4; }
.word-order-memory strong { display:block;font-size:13px;color:var(--muted); }
.frame-functions { margin:0;font-size:15px;line-height:1.45; }

.exchange-piece {padding:.75rem 0;border-bottom:1px solid var(--line,#d9dcda)}
.exchange-piece b,.exchange-line {font-size:1.22rem}
.exchange-piece .note {margin:.25rem 0}
.exchange-field {display:block;font-weight:600;margin:.75rem 0 .4rem}
.exchange-help {padding:.5rem 0}
.exchange-help summary {cursor:pointer}
.exchange-help button {display:block;margin:.55rem 0}
.learning-card .learning-actions {flex-wrap:wrap}
.exchange-shell .learning-actions {display:flex;gap:8px;align-items:center;margin-top:auto;padding-top:12px}
.exchange-shell .learning-actions .primary-answer {order:1;flex:1 0 100%;min-height:48px}
.exchange-shell .learning-actions .ghost {width:auto;min-height:42px}
.exchange-shell .study-top {align-items:center;gap:6px}
.exchange-shell .study-top>span {margin-right:auto}
.direct-piece {display:block;border-left:2px solid var(--line);padding:.25rem .75rem}
.direct-piece b {font-size:1.2rem}
.direct-piece p {margin:.25rem 0}
.direct-bridge,.direct-help {display:grid;gap:.5rem}
.direct-shell .learning-actions {margin-top:auto}
.direct-shell .learning-prompt > .btn {align-self:flex-start}
.direct-microphone .btn {min-height:48px;min-width:9rem;background:var(--surface);border:2px solid var(--accent);font-weight:600}
.direct-shell .learning-options .word-tile {text-align:left;min-height:48px}

.direct-progress{display:flex;align-items:center;gap:.65rem;font-size:.84rem;color:var(--muted);margin:.3rem 0 .7rem}
.direct-progress progress{width:5rem;height:.4rem;accent-color:var(--accent)}

.direct-shell .direct-piece summary, .word-help-popup summary { padding:8px 0;cursor:pointer; }
.direct-shell .direct-help p {margin:0}
.direct-shell .direct-help {padding:10px;border-left:2px solid var(--accent)}
.direct-shell .learning-actions .ghost, .direct-shell .study-top button {min-height:44px}
.direct-shell .learning-prompt .direct-help b {font-size:1.2rem}

/* A compact real course path: position is conveyed by text, shape and colour. */
.course-path {margin:1.25rem 0;text-align:left;}
.course-path>progress {width:100%;height:.45rem;accent-color:var(--accent);}
.course-path ol {list-style:none;margin:1rem 0 0;padding:0;}
.course-path-stop {position:relative;display:flex;align-items:center;gap:.8rem;min-height:52px;padding:0 0 .6rem;font-size:.95rem;}
.course-path-stop:not(:last-child):before {content:"";position:absolute;left:14px;top:29px;bottom:0;width:2px;background:var(--line);}
.course-path-dot {z-index:1;flex:0 0 28px;width:28px;height:28px;display:grid;place-items:center;border:2px solid var(--line);border-radius:50%;background:var(--surface);font-size:.85rem;}
.course-path-stop small {display:block;color:var(--muted);font-size:.7rem;line-height:1.3;}
.course-path-stop.current {font-weight:600;}
.course-path-stop.current .course-path-dot {background:var(--accent);border-color:var(--accent);color:var(--accent-ink);}
.course-path-stop.complete .course-path-dot {background:var(--good-bg);border-color:var(--good);color:var(--good);}
.course-path-stop.future {color:var(--muted);}

/* One reachable control dock. It stays visible on long cards without covering
   their content; a keyboard shrinks the viewport rather than hiding the actions. */
.direct-shell .learning-actions {
  position:sticky;bottom:max(8px,env(safe-area-inset-bottom));z-index:3;
  background:var(--surface);padding:10px 0 0;box-shadow:0 -12px 12px var(--surface);
}
.direct-shell .learning-actions > .btn {min-height:48px;flex:1;}
.direct-shell .direct-response {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;order:2;}
.direct-shell .direct-response > .primary-answer {order:0;flex:1;min-height:54px;}
.direct-response .direct-microphone {flex:1;display:flex;}
.direct-response .direct-microphone .btn {flex:1;min-width:0;min-height:54px;font-size:18px;}
.direct-microphone[data-listening="true"] .btn {background:var(--accent);color:var(--accent-ink);}
.microphone-status {min-height:20px;margin:0;}
button,summary {touch-action:manipulation;}
.tabs button {min-height:54px;}
button:active:not(:disabled) {filter:brightness(.94);}

.direct-response:not(:has(.direct-microphone)) {grid-template-columns:1fr;}
.progress-saved {font-size:13px;color:var(--muted);margin:8px 3px;}
