/* ACS Studie: only what ACS does not have yet. Colors, panels, buttons, fields,
   sidebar and page states come from the ACS copies in /assets/acs/ (theme.css,
   theme-light.css, shell19.css). Every color here is an ACS token, so both
   themes work. No inline styles anywhere: the CSP forbids them. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ux-blue); color: #07111f; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }
body.studie :focus-visible { outline: 3px solid var(--ux-blue); outline-offset: 2px; }
body.studie a { color: var(--ux-blue); }
body.studie .hint { color: var(--ux-mute); font-size: 13px; }
body.studie [hidden] { display: none !important; }
body.studie .page-content > .card, body.studie .page-content .card + .card { margin-bottom: 16px; }
body.studie h2 { font-size: 19px; margin: 0 0 12px; }
body.studie h2.meta-h { font-size: 11px; margin: 0 0 8px; }
body.studie h3 { font-size: 16px; margin: 18px 0 8px; }
body.studie .card ul, body.studie .card ol { padding-left: 22px; }
body.studie .card li { margin: 4px 0; }
body.studie .card p { margin: 0 0 10px; line-height: 1.6; }
.card-kicker, .blk-kicker, .sc-kicker, body.studie .meta-h { font: 700 11px/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ux-mute); margin: 0 0 8px; }
.logout-form { display: contents; }
.logout-form .side-action { width: 100%; }

/* Status chips (honest readiness + personal progress). */
.st-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--ux-border); background: var(--ux-panel-2); color: var(--ux-soft); white-space: nowrap; }
.st-planned { color: var(--ux-mute); border-style: dashed; }
.st-draft, .st-review { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: var(--amber-soft); }
.st-available, .st-published { color: var(--ux-blue); border-color: color-mix(in srgb, var(--ux-blue) 45%, transparent); background: var(--blue-soft); }
.st-progress { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.st-studied, .st-passed { color: var(--green); border-color: color-mix(in srgb, var(--green) 50%, transparent); background: var(--green-soft); }
.st-failed { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-soft); }
.head-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Home. */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.home-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.lead { font-size: 16px; }
.path-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; margin: 12px 0; }
.path-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--ux-border); border-radius: 10px; background: var(--ux-panel-2); font-weight: 700; margin: 0 !important; }
.path-steps li + li::before { content: '→'; color: var(--ux-mute); margin-right: 4px; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-soft); color: var(--ux-blue); font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { display: grid; gap: 2px; padding: 10px; border-radius: 10px; background: var(--ux-panel-2); border: 1px solid var(--ux-border); }
.kpi b { font-size: 22px; }
.kpi small { font-size: 12px; color: var(--ux-mute); font-weight: 600; }
.kpi span { font-size: 12px; color: var(--ux-soft); }
.mod-list, .lec-list, .lab-grid, .search-results { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 8px; }
.mod-card, .lec-row, .lab-card, .search-results li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--ux-border); border-radius: 12px; background: var(--ux-panel-2); padding: 0 12px 0 0; margin: 0 !important; }
.mod-card > a, .lec-row > a, .lab-card > a, .search-results li > a { flex: 1 1 auto; display: grid; gap: 3px; padding: 12px 14px; color: var(--ux-text); text-decoration: none; min-width: 0; }
.mod-card > a:hover b, .lec-row > a:hover .row-title, .lab-card > a:hover b, .search-results li > a:hover b { color: var(--ux-blue); }
.mod-n { font: 700 11px "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .06em; color: var(--ux-mute); text-transform: uppercase; }
.row-title { font-weight: 700; }
.row-sub { font-size: 13px; color: var(--ux-soft); }
.row-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: 0 0 auto; max-width: 50%; }
.is-planned > a { opacity: .78; }
.is-planned { border-style: dashed; }
.lab-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.lab-card { flex-direction: column; align-items: stretch; padding: 0 0 12px; }
.lab-card .row-chips { justify-content: flex-start; padding: 0 14px; max-width: none; }
.exp-kind { font: 700 10.5px "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ux-mute); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.final-test { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topics { columns: 2; column-gap: 28px; }

/* Lecture. */
.lecture-meta .meta-grid, .exp-head .meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.concepts { display: flex; flex-wrap: wrap; gap: 6px; }
.term-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--ux-border); background: var(--ux-panel-2); font-size: 13px; text-decoration: none; }
.lecture-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.lecture-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 16px !important; }
.lecture-toc ol { padding-left: 20px; margin: 0 0 12px; }
.lecture-toc a { color: var(--ux-soft); text-decoration: none; display: block; padding: 3px 0; font-size: 14px; }
.lecture-toc a.current { color: var(--ux-blue); font-weight: 700; }
.toc-actions { display: grid; gap: 8px; }
.toc-actions .btn { width: 100%; justify-content: center; }
.draft-banner { margin-bottom: 16px; }
.lecture-body { font-size: 16.5px; line-height: 1.7; max-width: 100%; }
.lecture-body > * { max-width: 46em; }
.lecture-body h2 { font-size: 22px; margin: 34px 0 12px; padding-top: 6px; border-top: 1px solid var(--ux-border); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; scroll-margin-top: 16px; }
.lecture-body h2:first-child { margin-top: 0; border-top: 0; }
.lecture-body h3 { font-size: 18px; margin: 24px 0 8px; scroll-margin-top: 16px; }
.lecture-body p { margin: 0 0 14px; }
.lecture-body ul, .lecture-body ol { margin: 0 0 14px; padding-left: 26px; }
.lecture-body li { margin: 5px 0; }
.lecture-body code { font: 14px "IBM Plex Mono", ui-monospace, monospace; background: var(--ux-panel-2); padding: 1px 5px; border-radius: 5px; }
.lecture-body .code { background: var(--ux-panel-2); padding: 12px; border-radius: 10px; overflow: auto; }
.section-report { flex: 0 0 auto; font-size: 12px; min-height: 28px !important; height: 28px; padding: 0 10px !important; opacity: .75; }
.section-report:hover, .section-report:focus-visible { opacity: 1; }
.lecture-body a.term { color: inherit; text-decoration: underline dotted var(--ux-blue); text-underline-offset: 3px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--ux-border); border-radius: 10px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th, .table-wrap td { padding: 8px 12px; border-bottom: 1px solid var(--ux-border); text-align: left; vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }
.al-center { text-align: center !important; } .al-right { text-align: right !important; }
.lecture-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.lecture-nav .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--ux-border); border-radius: 12px; background: var(--ux-panel-2); }
.exp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.exp-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--ux-border); border-radius: 12px; background: var(--ux-panel-2); color: var(--ux-text); text-decoration: none; margin: 0 0 14px; }
.exp-card:hover b { color: var(--ux-blue); }
.exp-card span:last-child { font-size: 13px; color: var(--ux-soft); }

/* Math (MathML from temml). */
math { font-size: 1.08em; }
math.tml-display { display: block math; margin: 2px 0; }
.math-display { overflow-x: auto; margin: 6px 0 16px; padding: 8px 0; }
.math-error { color: var(--red); border-bottom: 1px dashed var(--red); }
.formula { margin: 8px 0 18px; padding: 12px 16px; border: 1px solid var(--ux-border); border-left: 4px solid var(--ux-blue); border-radius: 10px; background: var(--ux-panel-2); }
.formula figcaption { font-weight: 700; margin-bottom: 4px; }
.formula-math { overflow-x: auto; padding: 4px 0; }
.formula-legend { font-size: 15px; color: var(--ux-soft); }
.formula-legend p { margin: 4px 0; }
.formula-when { font-size: 14px; color: var(--ux-soft); margin-top: 6px; }

/* Content blocks. */
.blk { margin: 10px 0 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--ux-border); background: var(--ux-panel-2); }
.blk > :last-child { margin-bottom: 0; }
.blk-title { font-weight: 800; margin-bottom: 6px; }
.blk-def { border-left: 4px solid var(--ux-blue); }
.blk-example { border-left: 4px solid var(--green); }
.blk-mistakes { border-left: 4px solid var(--red); }
.blk-note { border-left: 4px solid var(--amber); }
.blk-summary { border-left: 4px solid var(--ux-blue); }
.blk-practice { border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--ux-border)); background: color-mix(in srgb, var(--amber) 8%, var(--ux-panel-2)); }
.blk-practice .blk-kicker { color: var(--amber); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.blk-origin { color: var(--ux-mute); font-weight: 600; text-transform: none; letter-spacing: 0; }
.blk-details summary { cursor: pointer; font-weight: 700; }
blockquote { margin: 0 0 14px; padding: 6px 14px; border-left: 3px solid var(--ux-border-strong); color: var(--ux-soft); }
.fig { margin: 10px 0 18px; }
.fig img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--ux-border); background: #fff; }
.fig figcaption { font-size: 14px; color: var(--ux-soft); margin-top: 6px; }

/* Self-check. */
.selfcheck { margin: 14px 0 22px; padding: 14px 16px; border: 1px solid var(--ux-border); border-radius: 12px; background: var(--ux-panel-2); }
.sc-q { font-weight: 700; margin-bottom: 8px; }
.sc-options { border: 0; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.sc-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--ux-border); border-radius: 9px; cursor: pointer; background: var(--ux-panel); font-size: 15.5px; }
.sc-opt input { min-height: 0 !important; margin-top: 4px; accent-color: var(--ux-blue); }
.sc-opt.ok { border-color: var(--green); background: var(--green-soft); }
.sc-opt.bad { border-color: var(--red); background: var(--red-soft); }
.sc-feedback:empty { display: none; }
.sc-feedback { margin-top: 10px; padding: 10px 12px; border-radius: 9px; font-size: 15px; }
.sc-feedback.ok { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 50%, transparent); }
.sc-feedback.bad { background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); }
.sc-feedback ul { margin: 6px 0 0; }

/* Visualizations. */
.viz-embed { margin: 14px 0 22px; max-width: none !important; }
.viz-embed > figcaption { font-size: 13px; color: var(--ux-mute); margin-top: 6px; }
.viz { border: 1px solid var(--ux-border); border-radius: 14px; background: var(--ux-panel); overflow: hidden; }
.viz-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--ux-border); background: var(--ux-panel-2); }
.viz-toolbar .viz-title { font-weight: 800; margin-right: auto; font-size: 14px; }
.viz-toolbar .btn { min-height: 32px !important; height: 32px; padding: 0 10px !important; font-size: 12.5px !important; }
.viz-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 0; }
.viz-stage { position: relative; min-height: 300px; background: var(--ux-bg); }
.viz-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viz-stage canvas:focus-visible { outline-offset: -3px; }
.viz-controls { padding: 12px; border-left: 1px solid var(--ux-border); display: grid; gap: 12px; align-content: start; min-width: 0; overflow-x: auto; }
.viz-controls > *, .viz-ctrl > * { min-width: 0; max-width: 100%; }
.viz-under { padding: 10px 12px; overflow-x: auto; border-top: 1px solid var(--ux-border); }
.viz-ctrl { display: grid; gap: 4px; font-size: 13px; }
.viz-ctrl label, .viz-ctrl .lbl { font-weight: 700; color: var(--ux-soft); display: flex; justify-content: space-between; gap: 8px; }
.viz-ctrl output { font-weight: 800; color: var(--ux-text); font-variant-numeric: tabular-nums; }
.viz-ctrl input[type=range] { width: 100%; min-height: 28px !important; padding: 0 !important; accent-color: var(--ux-blue); background: transparent !important; border: 0 !important; }
.viz-ctrl select, .viz-ctrl input[type=text], .viz-ctrl input[type=number] { min-height: 36px !important; padding: 6px 8px !important; font-size: 14px !important; width: 100%; }
.viz-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.viz-seg button { flex: 1 1 auto; min-height: 32px; border-radius: 8px; border: 1px solid var(--ux-border-strong); background: var(--ux-panel-2); color: var(--ux-soft); font-weight: 700; cursor: pointer; padding: 0 8px; font-size: 12.5px; }
.viz-seg button[aria-pressed="true"] { background: var(--ux-blue); border-color: var(--ux-blue); color: #07111f; }
.viz-readout { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13.5px; padding: 10px; border: 1px solid var(--ux-border); border-radius: 10px; background: var(--ux-panel-2); font-variant-numeric: tabular-nums; }
.viz-readout dt { color: var(--ux-soft); }
.viz-readout dd { margin: 0; font-weight: 700; text-align: right; }
.viz-readout .chg { font-weight: 600; color: var(--ux-mute); font-size: 12px; }
.viz-desc { margin: 0; padding: 10px 12px; border-top: 1px solid var(--ux-border); font-size: 13.5px; color: var(--ux-soft); }
.viz-assumptions { padding: 0 12px 10px; font-size: 13px; color: var(--ux-soft); }
.viz-assumptions summary { cursor: pointer; font-weight: 700; padding: 8px 0 4px; }
.viz-assumptions ul { margin: 4px 0 0; padding-left: 20px; }
.viz-error { margin: 12px; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.viz-table td, .viz-table th { padding: 4px 6px; border-bottom: 1px solid var(--ux-border); text-align: right; }
.viz-table td:first-child, .viz-table th:first-child { text-align: left; }
.viz-table tr.hl td { color: var(--ux-blue); font-weight: 800; }

/* Predict -> check. */
.predict-task { margin: 16px 0 24px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--ux-blue) 45%, var(--ux-border)); border-radius: 14px; background: color-mix(in srgb, var(--ux-blue) 6%, var(--ux-panel)); }
.pt-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; padding: 0; list-style: none; }
.pt-steps li { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--ux-border); color: var(--ux-mute); margin: 0; }
.pt-steps li.on { color: var(--ux-blue); border-color: var(--ux-blue); }
.pt-steps li.done { color: var(--green); border-color: var(--green); }
.pt-q { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.pt-instr { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--ux-panel-2); border: 1px dashed var(--ux-border-strong); }
.pt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Tests. */
.test-root { display: grid; gap: 14px; }
.tq { padding: 16px !important; }
.tq-n { font: 700 11px "IBM Plex Mono", ui-monospace, monospace; color: var(--ux-mute); letter-spacing: .06em; }
.tq-text { font-weight: 700; font-size: 16px; margin: 6px 0 10px; }
.tq-num { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tq-num input { max-width: 260px; }
.tq-match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.tq-review.ok { border-color: color-mix(in srgb, var(--green) 55%, var(--ux-border)) !important; }
.tq-review.bad { border-color: color-mix(in srgb, var(--red) 55%, var(--ux-border)) !important; }
.rv-verdict { font-weight: 800; }
.rv-verdict.ok { color: var(--green); } .rv-verdict.bad { color: var(--red); }
.rv-box { margin-top: 8px; padding: 10px 12px; border-radius: 9px; background: var(--ux-panel-2); border: 1px solid var(--ux-border); font-size: 15px; }
.rv-opt { padding: 6px 10px; border-radius: 8px; margin: 4px 0; border: 1px solid var(--ux-border); font-size: 15px; }
.rv-opt.correct { border-color: var(--green); }
.rv-opt.chosen.wrong { border-color: var(--red); background: var(--red-soft); }
.rv-opt .fb { font-size: 14px; color: var(--ux-soft); margin-top: 4px; }
.result-banner { padding: 16px !important; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.result-banner .big { font-size: 30px; font-weight: 800; }
.result-banner.ok { border-color: var(--green) !important; } .result-banner.bad { border-color: var(--amber) !important; }
.hist table { width: 100%; border-collapse: collapse; } .hist td, .hist th { padding: 6px 8px; border-bottom: 1px solid var(--ux-border); text-align: left; }

/* Experiments. */
.exp-form table { width: 100%; border-collapse: collapse; }
.exp-form th, .exp-form td { padding: 6px 8px; border-bottom: 1px solid var(--ux-border); text-align: left; }
.exp-form td input { width: 100%; min-height: 38px !important; }
.exp-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.exp-params label { display: grid; gap: 4px; font-weight: 700; font-size: 13px; color: var(--ux-soft); }
.exp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.result-main { font-size: 24px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.safety { border-left: 3px solid var(--amber); padding-left: 12px; }
.exp-head .meta-grid > div > ul { margin: 0; }

/* Glossary, search, editor. */
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters a { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border: 1px solid var(--ux-border); border-radius: 8px; text-decoration: none; font-weight: 700; }
.glossary { margin: 0; }
.gl-letter { font-size: 20px; font-weight: 800; color: var(--ux-mute); margin: 16px 0 6px; }
.gl-item { padding: 10px 0; border-bottom: 1px solid var(--ux-border); scroll-margin-top: 16px; }
.gl-item:target { background: var(--blue-soft); border-radius: 8px; padding: 10px; }
.gl-item dt { font-weight: 800; }
.gl-item dd { margin: 4px 0 0; }
td.sym { font-size: 17px; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form input { flex: 1 1 260px; }
.search-results li { flex-wrap: wrap; }
.issues { list-style: none; padding: 0 !important; }
.issues li.error b { color: var(--red); } .issues li.warning b { color: var(--amber); }
.slide-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--ux-border); }

/* Dialog (error report). */
dialog.studie-dialog { border: 1px solid var(--ux-border-strong); border-radius: 14px; background: var(--ux-panel); color: var(--ux-text); padding: 20px; width: min(560px, calc(100vw - 32px)); }
dialog.studie-dialog::backdrop { background: rgba(3, 9, 18, .6); }
dialog.studie-dialog form { display: grid; gap: 10px; }
dialog.studie-dialog textarea { min-height: 120px; font: inherit; width: 100%; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Bare pages (login, sign-in errors). */
.studie-bare .bare-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.studie-bare .bare-card { width: min(520px, 100%); display: grid; gap: 12px; }
.bare-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--ux-soft); }
.bare-brand img { width: 34px; height: 34px; }
.studie-bare h1 { font-size: 24px; margin: 0; }
.dev-login { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ux-border); }
.dev-login h2 { font-size: 15px; margin: 0; }
.dev-login label { display: grid; gap: 4px; font-size: 13px; }

/* Toasts (ACS markup: .toast-host/.toast). */
#studie-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: grid; gap: 8px; }
#studie-toasts .studie-toast { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--ux-border-strong); background: var(--ux-panel); color: var(--ux-text); max-width: 380px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
#studie-toasts .studie-toast.err { border-color: var(--red); }
#studie-toasts .studie-toast.ok { border-color: var(--green); }

@media (max-width: 1100px) {
  .home-grid, .two-col { grid-template-columns: 1fr; }
  .home-side { position: static; }
  .lecture-grid { grid-template-columns: 1fr; }
  .lecture-toc { position: static; max-height: none; }
  .viz-body { grid-template-columns: 1fr; }
  .viz-controls { border-left: 0; border-top: 1px solid var(--ux-border); }
}
@media (max-width: 780px) {
  .lecture-meta .meta-grid, .exp-head .meta-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr 1fr; }
  .mod-card, .lec-row { flex-direction: column; align-items: stretch; padding: 0 0 10px; }
  .row-chips { justify-content: flex-start; padding: 0 14px; max-width: none; }
  .topics { columns: 1; }
  .lecture-body { font-size: 16px; }
  .tq-match { grid-template-columns: 1fr; }
  .lecture-nav .btn { max-width: 100%; }
  /* ACS keeps .page 24px + .card 24px padding on phones; for long lecture text
     that leaves ~265px per line at 390px, so Studie trims both. */
  body.studie .page-content.page { padding: 4px 0 40px; }
  body.studie .page-content .card { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .side, .lecture-toc, .lecture-nav, .viz-toolbar, .shell-mobile-toggle, .section-report { display: none !important; }
  .lecture-grid { grid-template-columns: 1fr; }
}
