/* The EP classroom shares the studio tokens and keeps its diagram in view. */
.ep-sidebar h2 { margin:9px 0 4px; font-size:19px; }
.ep-sidebar #ep-progress { margin:0 0 12px; }
.ep-nav-group { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:1px; margin:12px 0 5px; }
.ep-lesson { display:block; width:100%; background:transparent; color:var(--ink); text-align:left; padding:9px 10px; margin:2px 0; font-size:12px; font-weight:500; }
.ep-lesson:hover { background:var(--surface-soft); }
.ep-lesson[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-ink); box-shadow:inset 3px 0 var(--accent); }
.ep-parameters { border-top:1px solid var(--line); margin-top:16px; padding-top:12px; }
.ep-parameters h3 { font-size:12px; margin:0 0 14px; }
.ep-parameters label { display:flex; justify-content:space-between; gap:8px; }
.ep-parameters #ep-reset { padding:7px 0; font-size:11px; }
.ep-workspace { min-width:0; min-height:0; overflow:auto; padding:18px 22px; }
.ep-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.ep-heading h1 { font-size:25px; letter-spacing:-.6px; font-weight:550; margin:5px 0 0; }
.ep-heading .eyebrow { letter-spacing:1px; }
.ep-model-badge { font-size:10px; color:var(--muted); border:1px solid var(--line); border-radius:20px; padding:6px 10px; white-space:nowrap; }
.ep-metrics { display:flex; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.ep-metric { flex:1; min-width:100px; padding:9px 12px; border:1px solid var(--line); background:var(--surface); border-radius:9px; }
.ep-metric span { display:block; color:var(--muted); font-size:10px; }
.ep-metric strong { display:block; margin-top:3px; font-weight:600; font-size:15px; font-variant-numeric:tabular-nums; }
.ep-lab { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.ep-lab-toolbar { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.ep-lab-toolbar button { font-size:11px; padding:7px 9px; min-height:32px; }
.ep-lab-toolbar .segmented { padding:3px; border-radius:8px; }
.ep-playback { display:flex; gap:4px; }
.ep-figure { height:clamp(200px,30vh,320px); }
.ep-figure svg { display:block; width:100%; height:100%; }
.ep-grid { stroke:var(--line); stroke-width:1; }
.ep-conduction,.ep-bracket { fill:none; stroke:var(--accent); stroke-width:2; }
.ep-retro { fill:none; stroke:#a75e2b; stroke-width:2; stroke-dasharray:6 4; }
.ep-event { fill:var(--accent); stroke:var(--surface); stroke-width:1; }
.ep-svg-label { fill:var(--ink); font-size:16px; font-weight:600; }
.ep-svg-tick { fill:var(--muted); font-size:12px; }
.ep-svg-block { fill:var(--danger); font-size:27px; font-weight:600; }
.ep-cursor { stroke:var(--danger); stroke-width:1.5; opacity:.7; }
.ep-signal { fill:none; stroke:var(--ink); stroke-width:1.8; stroke-linejoin:round; }
.ep-signal.ep-H { stroke:var(--accent); stroke-width:2.4; }
.ep-timeline { display:flex; align-items:center; gap:12px; }
.ep-timeline label { white-space:nowrap; font-size:11px; color:var(--muted); }
.ep-timeline output { color:var(--ink); display:inline-block; min-width:55px; font-variant-numeric:tabular-nums; }
.ep-timeline input { flex:1; min-width:60px; }
.ep-timeline .help-text { white-space:nowrap; font-size:10px; }
.ep-event-description { color:var(--accent); font-size:11px; margin:5px 0; min-height:16px; }
#ep-diagram-note { margin:4px 0 0; font-size:10px; }
.ep-learning { display:grid; grid-template-columns:1.2fr 1fr; gap:18px; padding:13px 0 10px; font-size:12px; line-height:1.65; }
.ep-learning p { margin:0 0 6px; }
.ep-task { color:var(--accent); }
.ep-insight { border-left:2px solid var(--line); padding-left:16px; }
.ep-insight>strong { font-size:11px; }
.ep-insight button { padding:7px 10px; font-size:11px; margin-top:4px; }
.ep-check { padding:14px; margin:0 0 12px; border:1px solid var(--line); background:var(--surface); border-radius:10px; }
.ep-check h2 { font-size:14px; margin:0 0 10px; }
#ep-answers { display:flex; gap:7px; }
#ep-answers button { flex:1; font-size:12px; text-align:left; font-weight:500; }
.ep-answer.correct { background:var(--accent-soft); border-color:var(--accent); }
.ep-answer.incorrect { border-color:var(--danger); }
#ep-feedback { font-size:12px; line-height:1.6; margin:10px 0 0; }
.ep-footer { display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; color:var(--muted); font-size:10px; line-height:1.6; }
.ep-footer a { text-underline-offset:3px; }
@media (min-width:961px) and (max-height:780px), (min-width:901px) and (min-height:501px) and (max-height:780px) {
  .ep-workspace { padding:12px 18px; }
  .ep-heading { margin-bottom:9px; }.ep-heading h1 { font-size:21px; }
  .ep-figure { height:205px; }.ep-metrics { margin-bottom:9px; }.ep-learning { padding-top:10px; gap:14px; font-size:11px; }
  .ep-sidebar .ep-lesson { padding:7px 9px; }.ep-sidebar .ep-parameters { margin-top:11px; }
}
@media (max-width:900px), (max-width:960px) and (max-height:500px) {
  .ep-workspace { overflow:visible; padding:18px; }.ep-sidebar { padding:18px; }
  #ep-lessons { display:flex; flex-wrap:wrap; gap:5px; }.ep-nav-group { width:100%; margin-top:5px; }.ep-lesson { width:auto; border:1px solid var(--line); margin:0; }
  .ep-parameters { margin-top:14px; }#ep-controls { display:flex; gap:20px; }#ep-controls .control-group { flex:1; }
  .ep-learning { grid-template-columns:1fr; }.ep-insight { border-left:0; border-top:1px solid var(--line); padding:12px 0 0; }
  .ep-model-badge { white-space:normal; max-width:125px; }.ep-timeline .help-text { display:none; }
  #ep-answers { flex-direction:column; }.ep-figure { height:250px; }
}
@media (max-width:600px) {
  .ep-metric { min-width:40%; }.ep-lab { padding:10px; }.ep-lab-toolbar .segmented { width:auto; }.ep-heading { align-items:flex-start; }.ep-heading .eyebrow { font-size:9px; }
}
@media print { #view-ep:not(.view-hidden) { display:block; }.ep-sidebar,.ep-lab-toolbar,.ep-timeline,.ep-insight button,#ep-check { display:none!important; }.ep-workspace { overflow:visible; } }

#view-ep { display:flex; flex-direction:column; min-height:0; }
.ep-area-tabs { display:flex; gap:5px; padding:8px 18px; border-bottom:1px solid var(--line); background:var(--surface); flex-shrink:0; }
.ep-area-tabs button { font-size:12px; padding:8px 13px; background:transparent; color:var(--muted); }
.ep-area-tabs button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-ink); }
.ep-subarea { display:grid; grid-template-columns:280px minmax(0,1fr); min-height:0; flex:1; }
.atlas-sidebar h2 { margin:9px 0; font-size:19px; }
#atlas-search { width:100%; margin:6px 0 12px; font-size:12px; }
.atlas-category { border-top:1px solid var(--line); padding:8px 0; }
.atlas-category summary { cursor:pointer; font-size:12px; font-weight:600; line-height:1.5; padding:5px 0; }
.atlas-nav-item { width:100%; display:block; background:transparent; color:var(--ink); font-size:12px; line-height:1.5; text-align:left; padding:8px; margin:3px 0; font-weight:450; }
.atlas-nav-item:hover { background:var(--surface-soft); }
.atlas-nav-item[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-ink); }
.atlas-workspace { display:flex; flex-direction:column; padding:15px 20px 12px; min-height:0; min-width:0; overflow:hidden; }
.atlas-heading { display:flex; gap:15px; align-items:flex-start; justify-content:space-between; }
.atlas-heading h1 { font-size:22px; font-weight:550; line-height:1.25; letter-spacing:-.4px; margin:5px 0; }
.atlas-heading p { color:var(--muted); font-size:12px; margin:5px 0 9px; line-height:1.5; }
.atlas-page-nav { display:flex; gap:5px; flex-shrink:0; }
.atlas-page-nav button { padding:7px 12px; }
.atlas-variants { display:flex; gap:5px; flex-wrap:wrap; margin:2px 0 12px; }
.atlas-variants button { padding:7px 10px; font-size:12px; font-weight:500; }
.atlas-variants button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent-ink); border-color:var(--accent); }
.atlas-body { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:16px; flex:1; min-height:0; }
.atlas-visual { display:flex; flex-direction:column; min-width:0; min-height:0; }
.atlas-legend { display:flex; flex-wrap:wrap; gap:5px 12px; color:var(--muted); font-size:11px; margin-bottom:8px; }
.atlas-legend i { display:inline-block; width:16px; height:3px; vertical-align:middle; margin-right:5px; background:var(--ink); }
.atlas-legend .paced { background:var(--ep-paced); }.atlas-legend .critical { background:var(--ep-last); }.atlas-legend .blocked { background:var(--danger); }
.atlas-drawing { display:flex; align-items:center; justify-content:center; min-height:160px; flex:1; background:var(--surface); border:1px solid var(--line); border-radius:9px; overflow:auto; padding:8px 12px; }
.atlas-drawing svg { display:block; max-width:100%; max-height:100%; width:100%; height:auto; flex-shrink:0; }
.atlas-caption { border-left:3px solid var(--accent); padding-left:12px; font-size:13px; line-height:1.6; margin:12px 0 4px; max-height:100px; overflow:auto; }
.atlas-figure-actions { display:flex; gap:5px; }.atlas-figure-actions button { font-size:11px; padding:7px 8px; }
.atlas-explanations { min-height:0; overflow:auto; padding:0 5px 0 0; overscroll-behavior:contain; }
.atlas-explanations details { border-top:1px solid var(--line); padding:10px 0; }
.atlas-explanations summary { font-size:13px; font-weight:600; cursor:pointer; padding:4px 0; }
.atlas-explanations details[open]>summary { color:var(--accent); }
.atlas-explanations p,.atlas-explanations li { font-size:12px; line-height:1.65; margin:0 0 9px; overflow-wrap:anywhere; }
.atlas-explanations ul,.atlas-sources { padding-left:18px; margin:10px 0 0; }
.atlas-workspace>.ep-footer { padding-top:8px; flex-shrink:0; }
.atlas-focused .atlas-body { grid-template-columns:1fr; }.atlas-focused .atlas-explanations { display:none; }
@media (max-width:1100px) and (min-width:961px), (max-width:1100px) and (min-width:901px) and (min-height:501px) { .atlas-body { grid-template-columns:minmax(0,1fr) 220px; gap:10px; }.atlas-workspace { padding:12px; }.ep-subarea { grid-template-columns:250px minmax(0,1fr); } }
@media (max-width:900px), (max-width:960px) and (max-height:500px) {
  .ep-subarea { display:block; }.atlas-workspace { overflow:visible; padding:18px; }.atlas-body { display:block; }.atlas-drawing { min-height:240px; }.atlas-drawing svg { max-height:none; }.atlas-caption { max-height:none; }.atlas-explanations { margin-top:15px; overflow:visible; }.atlas-heading h1 { font-size:23px; }
  .atlas-sidebar { max-height:360px; overflow:auto; }.atlas-focused .atlas-body { display:block; }
}

/* Keep the area switch above the left navigation, leaving diagram height free. */
@media (min-width:961px), (min-width:901px) and (min-height:501px) {
  #view-ep { position:relative; }
  .ep-area-tabs { position:absolute; top:0; left:0; width:280px; z-index:2; padding:10px 12px; gap:3px; border-right:1px solid var(--line); }
  .ep-area-tabs button { padding:8px 7px; font-size:11px; }
  #view-ep .ep-subarea>.controls { padding-top:66px; }
}
@media (min-width:961px) and (max-width:1100px), (min-width:901px) and (min-height:501px) and (max-width:1100px) { .ep-area-tabs { width:250px; padding:10px 5px; }.ep-area-tabs button { font-size:10px; } }
.ep-background { margin-top:7px; }.ep-background summary { font-size:12px; color:var(--muted); cursor:pointer; padding:4px 0; }.ep-background p { margin-top:8px; }
.ep-svg-label { font-size:20px; }.ep-svg-tick { font-size:17px; }

.ep-clear-progress { font-size:11px; padding:3px 0 8px; color:var(--muted); }
@media (min-width:961px) and (max-height:780px), (min-width:901px) and (min-height:501px) and (max-height:780px) { .ep-workspace { padding-bottom:8px; }.ep-learning { padding-bottom:6px; }.ep-nav-group { margin-top:8px; } }

/* ── M0 mobile shell: EP on phones, tablets and landscape phones (EP-W1–W6) ── */
/* EP-W6: series colours of the atlas drawing (ep-atlas-renderer.js THEME), light and dark */
:root { --ep-paced:#146da6; --ep-last:#873f93; }
:root[data-theme="dark"] { --ep-paced:#7cc0ee; --ep-last:#d9a2e2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ep-paced:#7cc0ee; --ep-last:#d9a2e2; } }
/* EP-W2 / EP-02: the time scrubber takes the row */
.ep-timeline .range-exact { flex:1; min-width:0; }
#atlas-pick { display:none; }
/* EP-W5: touch targets */
@media (pointer:coarse) {
  #ep-time { height:44px; }
  .ep-lab-toolbar button { min-height:44px; font-size:13px; }
  .atlas-category summary,.atlas-explanations summary,.ep-background summary { min-height:44px; display:flex; align-items:center; gap:8px; }
  .atlas-category summary::before,.atlas-explanations summary::before,.ep-background summary::before { content:'▸'; color:var(--muted); transition:transform .15s; }
  .atlas-category[open] > summary::before,.atlas-explanations details[open] > summary::before,.ep-background[open] > summary::before { transform:rotate(90deg); }
}
/* EP-W4 / EP-10: sources as list rows */
.atlas-sources li { padding:8px 0; }
/* Sheets and the zoomed drawing (dialogs.js backdrop rule) */
.atlas-dialog .atlas-sidebar { display:block; flex:1; min-height:0; max-height:none; overflow:auto; overscroll-behavior:contain; padding:0 0 8px; border:0; background:none; }
.atlas-dialog .atlas-sidebar > .eyebrow,.atlas-dialog .atlas-sidebar > h2 { display:none; }
.atlas-dialog .atlas-nav-item { min-height:44px; }
.atlas-zoom-dialog { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; padding:0 calc(12px + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) calc(12px + env(safe-area-inset-left, 0px)); border:0; border-radius:0; }
.atlas-zoom-dialog[open] { display:flex; flex-direction:column; }
.atlas-zoom-dialog .sheet-dialog-head { padding-top:env(safe-area-inset-top, 0px); flex-basis:auto; min-height:52px; }
.atlas-zoom-dialog .sheet-dialog-head h2 { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.atlas-zoom-scroller { flex:1; min-height:0; overflow:auto; touch-action:pan-x pan-y pinch-zoom; overscroll-behavior:contain; background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:8px; }
.atlas-zoom-scroller svg { display:block; max-width:none; }

@media (max-width:900px), (max-width:960px) and (max-height:500px) {
  /* EP-W3 / EP-03: Grundlagen — lesson chips above the heading, the lab first, the parameters under the figure */
  #ep-basics:not([hidden]) { display:flex; flex-direction:column; gap:12px; padding:12px 16px 16px; }
  #ep-basics > .ep-sidebar,#ep-basics > .ep-workspace { display:contents; }
  #ep-basics .ep-sidebar > .eyebrow,#ep-basics .ep-sidebar > h2 { display:none; }
  #ep-lessons { order:1; display:flex; flex-wrap:nowrap; gap:6px; margin:0 -16px; padding:0 16px; overflow-x:auto; scrollbar-width:none; overscroll-behavior-x:contain; }
  #ep-lessons::-webkit-scrollbar { display:none; }
  #ep-lessons[data-overflow="end"] { mask-image:linear-gradient(to right,#000 calc(100% - 24px),transparent); }
  #ep-lessons[data-overflow="start"] { mask-image:linear-gradient(to left,#000 calc(100% - 24px),transparent); }
  #ep-lessons[data-overflow="both"] { mask-image:linear-gradient(to right,transparent,#000 24px,#000 calc(100% - 24px),transparent); }
  #ep-lessons .ep-nav-group { flex:0 0 auto; align-self:center; width:auto; margin:0 2px 0 8px; white-space:nowrap; }
  #ep-lessons .ep-nav-group:first-child { margin-left:0; }
  #ep-lessons .ep-lesson { flex:0 0 auto; width:auto; min-height:44px; margin:0; white-space:nowrap; border:1px solid var(--line); }
  #ep-basics .ep-heading { order:2; margin:0; }
  #ep-basics .ep-heading h1 { font-size:21px; }
  #ep-basics .ep-lab { order:3; }
  #ep-basics .ep-metrics { order:4; margin:0; }
  #ep-basics .ep-learning { order:5; padding:0; }
  #ep-basics #ep-check { order:6; margin:0; }
  #ep-basics .ep-footer { order:7; }
  #ep-basics #ep-progress { order:8; margin:0; }
  #ep-basics #ep-clear-progress { order:9; align-self:flex-start; min-height:44px; }
  .ep-lab .ep-parameters { margin:10px 0 0; padding-top:10px; border-top:1px solid var(--line); }
  .ep-lab .ep-parameters h3 { margin:0 0 8px; }
  /* EP-W4 / EP-04: Bildatlas — the manoeuvre first; the list behind "Manöver wählen" */
  #ep-atlas > .atlas-sidebar { display:none; }
  #ep-atlas .atlas-workspace { padding:12px 16px 16px; }
  #ep-atlas .atlas-heading { flex-wrap:wrap; gap:0; }
  #ep-atlas .atlas-heading > div:first-child { order:2; flex:1 1 100%; min-width:0; }
  #ep-atlas .atlas-page-nav { order:1; flex:1 1 100%; gap:6px; }
  #atlas-pick { display:inline-flex; align-items:center; flex:1; min-width:0; min-height:44px; justify-content:flex-start; }
  #ep-atlas .atlas-page-nav button { min-width:44px; min-height:44px; }
  #ep-atlas #atlas-group { display:none; }
  #ep-atlas .atlas-heading h1 { font-size:20px; margin:8px 0 2px; }
  #ep-atlas .atlas-heading p { margin:2px 0 8px; }
  #ep-atlas .atlas-variants { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin:0 -16px 8px; padding:0 16px; }
  #ep-atlas .atlas-variants button { flex:0 0 auto; min-height:44px; white-space:nowrap; }
  #ep-atlas .atlas-legend { margin-bottom:6px; }
  #ep-atlas .atlas-drawing { min-height:0; padding:6px 8px; }
  #ep-atlas .atlas-figure-actions button { min-height:44px; }
}
@media (max-width:960px) and (max-height:500px) {
  /* EP-06: landscape phones — the EP content starts right under the header */
  #ep-basics:not([hidden]),#ep-atlas .atlas-workspace { padding-top:4px; }
}
@media (max-width:767px) {
  /* EP-W1 / EP-17: readable lab texts on phones */
  #view-ep .ep-lab-toolbar button,#view-ep .ep-timeline label,#view-ep #ep-event,#view-ep #ep-diagram-note,#view-ep #ep-question-toggle { font-size:13px; }
}
@media (max-width:600px) {
  /* EP-W3 / EP-13: one slider per row; the scrubber gets its own row under the label */
  #view-ep #ep-controls { display:block; }
  .ep-timeline { flex-wrap:wrap; gap:4px 12px; }
  .ep-timeline .range-exact { flex:1 1 100%; }
}

.diagram-download { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.diagram-download button,.diagram-download select { min-height:36px; padding:6px 10px; font-size:12px; width:auto; }
.diagram-download [role="status"] { font-size:12px; }
@media print { .diagram-download { display:none!important; } }

.diagram-download { position:relative; }
.download-format-menu { position:absolute; left:0; top:100%; z-index:20; display:flex; flex-wrap:wrap; gap:6px; padding:10px; min-width:260px; border:1px solid var(--line); border-radius:9px; background:var(--surface); box-shadow:0 4px 16px #0002; }
.download-format-menu[hidden] { display:none; }
.diagram-download .download-format-change { font-size:11px; padding:4px 6px; text-decoration:underline; }

.ep-workstation { display:grid; grid-template-columns:230px minmax(0,1fr); gap:16px; padding:16px; width:100%; box-sizing:border-box; }
#ep-simulator { display:block; }
#ep-simulator[hidden] { display:none; }
.ws-controls { display:flex; flex-direction:column; gap:12px; padding:14px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.ws-controls h1 { font-size:20px; margin:0; }
.ws-controls label,.ws-toolbar label { display:flex; flex-direction:column; gap:4px; font-size:12px; }
.ws-controls select,.ws-controls input,.ws-toolbar select { width:100%; min-height:36px; }
.ws-main { min-width:0; }
.ws-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin-bottom:10px; }
.ws-toolbar button { min-height:36px; font-size:12px; }
.ws-screen { overflow-x:auto; border-radius:8px; background:#101a24; }
.ws-screen svg { display:block; width:100%; min-width:650px; height:auto; }
.ws-screen.measuring { cursor:crosshair; }
.ws-readout { display:flex; align-items:center; flex-wrap:wrap; gap:16px; padding:8px 0; font-size:13px; font-variant-numeric:tabular-nums; }
.ws-scrubber { display:flex; gap:10px; align-items:center; font-size:12px; }
.ws-scrubber input { flex:1; }
.ws-channel-list { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding-top:10px; }
.ws-channel-list label { flex-direction:row; align-items:center; }
.ws-channel-list input { width:auto; min-height:0; }
@media(max-width:960px) { .ep-workstation { grid-template-columns:1fr; padding:10px; }.ws-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }.ws-controls h1 { grid-column:1/-1; } }
/* The standalone workstation has no chapter sidebar for overlaid lesson tabs. */
#view-ep:has(#ep-area-simulator[aria-pressed="true"]) .ep-area-tabs { position:static; width:auto; flex-wrap:wrap; }
