/* A compact external feedback lane, sharing the reading case's visual grammar. */
#math-demo .math-evolution-layout { display:grid; grid-template-columns:minmax(0,2.15fr) minmax(280px,1fr); gap:16px; margin-top:14px; align-items:stretch; }
#math-demo .math-evolution-layout .learning-case { position:relative; margin:0; min-width:0; height:604px; display:grid; grid-template-rows:auto minmax(0,1fr); }
#math-demo .math-evolution-layout .player-toolbar { gap:5px; padding:0 10px; }
#math-demo .math-evolution-layout .player-tabs { min-width:0; }
#math-demo .math-evolution-layout .player-tabs > button { font-size:.875rem; padding-inline:5px; }
#math-demo .math-evolution-layout .player-tabs > button[aria-disabled=true] { color:#a1adbc; cursor:default; }
#math-demo .math-evolution-layout .player-controls { gap:0; }
#math-demo .math-evolution-layout .player-controls button { padding-inline:6px; }
#math-demo .math-evolution-layout .player-controls [data-play] { min-width:60px; }
#math-demo .math-evolution-layout #math-player-panel { display:grid; grid-template-rows:78px minmax(0,1fr); gap:10px; min-height:0; padding:12px; }
#math-demo .math-evolution-layout .model-analysis { min-height:0; margin:0; padding:0 0 0 10px; display:grid; grid-template-columns:minmax(0,1fr); gap:3px; align-content:start; overflow:hidden; }
#math-demo .math-evolution-layout .analysis-heading { display:flex; flex-wrap:nowrap; gap:6px; align-items:center; min-height:24px; }
#math-demo .math-evolution-layout .analysis-heading > span { font-size:.8125rem; flex-shrink:0; }
#math-demo .math-evolution-layout .analysis-heading h3 { min-width:0; flex:1; margin:0; font-size:.875rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#math-demo .math-evolution-layout .reader-toggle { margin-left:auto; font-size:.8125rem; min-height:27px; padding:3px 6px; }
#math-demo .math-evolution-layout #math-analysis-copy { grid-column:1; margin:0; font-size:.875rem; line-height:1.6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#math-demo .math-evolution-layout .analysis-sources { display:flex; gap:3px; min-height:22px; margin:0; }
#math-demo .math-evolution-layout .analysis-sources .source-chip { min-height:21px; padding:0 5px; font-size:.75rem; }
#math-demo .math-evolution-layout .textbook-workspace,
#math-demo .math-evolution-layout .learning-case.is-reader-open .textbook-workspace { min-height:0; height:100%; grid-template-columns:136px minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:10px; }
#math-demo .math-evolution-layout .textbook-pane { height:100%; min-height:0; }
#math-demo .math-evolution-layout .pane-heading { padding:9px 8px; gap:5px; }
#math-demo .math-evolution-layout .pane-heading h3 { font-size:.875rem; }
#math-demo .math-evolution-layout .toc-scope { display:none; }
#math-demo .math-evolution-layout .toc-branch > summary { font-size:.8125rem; padding-right:2px; }
#math-demo .math-evolution-layout .toc-leaf { font-size:.8125rem; }
#math-demo .math-evolution-layout .toc-level .toc-level { padding-left:5px; margin-left:2px; }
#math-demo .math-evolution-layout .book-chapter-count { display:none; }
#math-demo .math-evolution-layout .canvas-column { height:100%; min-height:0; display:grid; grid-template-rows:40px minmax(0,1fr); }
#math-demo .math-evolution-layout .tool-action { min-width:0; padding:7px 8px; gap:5px; font-size:.8125rem; }
#math-demo .math-evolution-layout .tool-action code { font-size:.75rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#math-demo .math-evolution-layout .learning-scroll { height:100%; min-height:0; }
#math-demo .math-evolution-layout .stage-window { height:var(--math-scene-height,400px); }
#math-demo .math-evolution-layout .math-scene { padding:12px; }
#math-demo .math-evolution-layout .read-scene { grid-template-columns:minmax(0,.7fr) minmax(0,1fr); gap:10px; }
#math-demo .math-evolution-layout .task-goals h4 { font-size:.9375rem; }
#math-demo .math-evolution-layout .task-goal { padding:10px; }
#math-demo .math-evolution-layout .task-goal strong { font-size:.875rem; }
#math-demo .math-evolution-layout .reader-pane { position:absolute; inset:134px 12px 12px; grid-column:auto; height:auto; z-index:10; box-shadow:0 8px 24px #355c8f18; background:#fff; }
#math-demo .math-evolution-layout .source-reader { background:#fff; }
#math-demo .math-evolution-layout .proof-scene { grid-template-columns:62px minmax(0,1fr); gap:12px 22px; }
#math-demo .math-evolution-layout .proof-origin { min-height:54px; padding:8px 4px; }
#math-demo .math-evolution-layout .proof-origin span { font-size:.75rem; }
#math-demo .math-evolution-layout .proof-steps { gap:7px; }
#math-demo .math-evolution-layout .proof-step { padding:7px 8px; }
#math-demo .math-evolution-layout .proof-step h4 { font-size:.8125rem; }
#math-demo .math-evolution-layout .proof-step .formula { min-height:38px; font-size:.9375rem; }
#math-demo .math-evolution-layout .proof-step .compact-estimate { font-size:.875rem; }
#math-demo .math-evolution-layout .math-proof-with-bridge { grid-template-rows:minmax(0,1fr) auto; align-items:center; }
#math-demo .math-evolution-layout .math-proof-with-bridge .proof-origins { gap:16px; }
#math-demo .math-proof-bridge { position:relative; grid-column:1/-1; z-index:2; padding:10px 11px; border:1px solid #bfd9cb; border-left:3px solid #6b9e88; border-radius:5px; background:#f2f9f5; opacity:var(--bridge-reveal,0); }
#math-demo .math-proof-bridge b { display:block; font-weight:500; color:#487f69; font-size:.8125rem; line-height:1.5; }
#math-demo .math-proof-bridge p { margin-top:4px; color:#4b705e; font-size:.875rem; line-height:1.6; }
#math-demo .math-proof-bridge > span { display:block; margin-top:4px; color:#708f7d; font-size:.8125rem; line-height:1.6; }
#math-demo .math-proof-bridge.is-incomplete { border-color:var(--failure-border); border-left-color:var(--failure-ink); background:var(--failure-soft); }
#math-demo .math-proof-bridge.is-incomplete b,
#math-demo .math-proof-bridge.is-incomplete p { color:var(--failure-ink); }
#math-demo .math-proof-bridge.is-incomplete > span { color:var(--failure-ink); }
#math-demo .math-near-scene { display:flex; flex-direction:column; justify-content:center; gap:13px; }
#math-demo .math-task-condition { padding:8px 2px; }
#math-demo .math-task-condition > span { color:#8494a8; font-size:.8125rem; }
#math-demo .math-task-condition h4 { margin-top:5px; font-size:1rem; }
#math-demo .math-task-condition p { margin-top:5px; color:#70849e; font-size:.875rem; line-height:1.7; }
#math-demo .math-candidate-section { padding:13px; border:1px solid var(--failure-border); border-radius:6px; background:var(--failure-soft); }
#math-demo .math-candidate-section > span { color:var(--failure-ink); font-size:.8125rem; line-height:1.6; }
#math-demo .math-candidate-section h4 { margin-top:5px; color:var(--failure-ink); font-size:.9375rem; line-height:1.7; }
#math-demo .math-candidate-section strong { display:block; color:var(--failure-ink); font-size:1rem; font-weight:500; margin-top:7px; }
#math-demo .math-candidate-section p { margin-top:7px; color:var(--failure-ink); font-size:.875rem; line-height:1.6; }
#math-demo .math-near-flag { padding:9px 11px; border-left:3px solid var(--failure-ink); background:var(--failure-soft); border-radius:0 4px 4px 0; opacity:var(--near-reveal,0); }
#math-demo .math-near-flag b { color:var(--failure-ink); font-weight:500; font-size:.8125rem; }
#math-demo .math-near-short { display:none; }
#math-demo .math-near-flag p { margin-top:4px; color:var(--failure-ink); font-size:.875rem; line-height:1.7; }
#math-demo .math-theorem-near { padding:12px; }
#math-demo .math-theorem-near > p { font-size:.875rem; line-height:1.7; color:#6b809a; }
#math-demo .math-original-object { text-align:center; padding:10px 0; color:#6c73a1; font:1.125rem/1.5 Georgia,serif; }
#math-demo .math-evolution-layout .theorem-checks > .math-unchecked { color:var(--failure-ink); border-bottom:1px dashed var(--failure-ink); }
#math-demo .math-wrong-formula { margin-top:7px; font:1.125rem/1.7 Georgia,serif; color:var(--failure-ink); text-align:center; }
#math-demo .math-wrong-formula small { font: .8125rem/1.5 var(--sans); display:block; }
#math-demo .math-evolution-layout .theorem-checks { gap:6px 10px; margin-top:9px; }
#math-demo .math-evolution-layout .theorem-checks > span { font-size:.8125rem; }
#math-demo .math-evolution-layout .theorem-paper { padding:12px; }
#math-demo .math-evolution-layout .parity-explainer { grid-template-columns:110px minmax(0,1fr); }
#math-demo .math-evolution-layout .search-hit { padding:8px; }
#math-demo .math-evolution-layout .dimension-card { padding:16px 5px; }
#math-demo .math-evolution-layout .dimension-card h5 { font-size:.875rem; }
#math-demo .math-evolution-layout .dimension-card strong { font-size:.8125rem; }
#math-demo .learning-case[data-evolution-mode=attempt] .analysis-heading > span { color:#a66e50; }
#math-demo .learning-case[data-evolution-mode=retry] .analysis-heading > span { color:#48866c; }
#math-demo .learning-case[data-evolution-mode=retry] .model-analysis { border-left-color:#6c9f87; }
#math-demo .learning-case[data-evolution-mode=diagnosis] .analysis-heading > span,
#math-demo .learning-case[data-evolution-mode=construct] .analysis-heading > span,
#math-demo .learning-case[data-evolution-mode=validate] .analysis-heading > span,
#math-demo .learning-case[data-evolution-mode=train] .analysis-heading > span { color:#4a75ac; }
#math-demo .math-evolution-layout .reading-feedback { height:604px; }
#math-demo .reading-feedback-header h4 { font-size:1rem; }
#math-demo .reading-feedback-detail h5 { margin:7px 0; }
#math-demo .reading-feedback-detail > p { margin-top:7px; }
#math-demo .reading-training-sample p { margin-top:3px; }
#math-demo .reading-agent-standby h5, #math-demo .reading-agent-complete h5 { margin-bottom:12px; }
#math-demo .reading-agent-complete .reading-agent-orbit { display:none; }
#math-demo .reading-feedback-comparison p { margin-top:4px; }
@media(max-width:1000px) {
  #math-demo .math-evolution-layout { grid-template-columns:minmax(0,1fr); gap:12px; }
  #math-demo .math-evolution-layout .reading-feedback { height:auto; }
  #math-demo .math-evolution-layout .textbook-workspace,
  #math-demo .math-evolution-layout .learning-case.is-reader-open .textbook-workspace { grid-template-columns:175px minmax(0,1fr); }
}
@media(max-width:760px) {
  #math-demo .math-evolution-layout .learning-case { height:740px; }
  #math-demo .math-evolution-layout #math-player-panel { grid-template-rows:78px minmax(0,1fr); padding:10px; }
  #math-demo .math-evolution-layout .analysis-heading { display:flex; flex-wrap:nowrap; }
  #math-demo .math-evolution-layout .analysis-heading > span { font-size:.75rem; }
  #math-demo .math-evolution-layout .analysis-heading h3 { margin:0; grid-column:auto; grid-row:auto; font-size:.8125rem; }
  #math-demo .math-evolution-layout .reader-toggle { grid-column:auto; grid-row:auto; width:27px; padding:4px; }
  #math-demo .math-evolution-layout .reader-toggle > span { display:none; }
  #math-demo .math-evolution-layout .textbook-workspace,
  #math-demo .math-evolution-layout .learning-case.is-reader-open .textbook-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:118px minmax(0,1fr); gap:10px; }
  #math-demo .math-evolution-layout .textbook-pane { height:100%; }
  #math-demo .math-evolution-layout .toc-book > summary { min-height:35px; }
  #math-demo .math-evolution-layout .pane-heading { min-height:32px; padding:6px 9px; }
  #math-demo .math-evolution-layout .canvas-column { height:100%; }
  #math-demo .math-evolution-layout .reader-pane { inset:192px 10px 10px; height:auto; }
  #math-demo .math-evolution-layout .math-scene { padding:10px; }
  #math-demo .math-evolution-layout .math-near-scene { gap:8px; }
  #math-demo .math-evolution-layout .math-task-condition { padding-block:4px; }
  #math-demo .math-evolution-layout .math-theorem-near { padding:10px; }
  #math-demo .math-evolution-layout .math-theorem-near > p { display:none; }
  #math-demo .math-evolution-layout .math-near-full { display:none; }
  #math-demo .math-evolution-layout .math-near-short { display:inline; }
  #math-demo .math-evolution-layout .math-original-object { padding-block:6px; }
  #math-demo .math-evolution-layout .math-candidate-section { padding:10px; }
  #math-demo .math-evolution-layout .math-proof-bridge { padding:8px; }
  #math-demo .math-evolution-layout .math-proof-bridge > span { font-size:.75rem; }
  #math-demo .math-evolution-layout .proof-scene { grid-template-columns:53px minmax(0,1fr); gap:10px 18px; }
  #math-demo .math-evolution-layout .proof-origin span { font-size:.6875rem; }
  #math-demo .math-evolution-layout .proof-step { padding:6px; }
  #math-demo .math-evolution-layout .proof-step .formula { min-height:32px; }
}
