.knowledge-detail-block.prerequisites,.knowledge-detail-block.steps,.knowledge-detail-block.pitfalls { grid-column:1/-1; }
.knowledge-detail-block.prerequisites { background:#f8fafc; border-color:#dde5ef; }
.knowledge-detail-block.pitfalls { background:#fff9ee; border-color:#ecdcb7; }
.knowledge-detail-block.pitfalls>b { color:#84621f; }
.teaching-text { margin:6px 0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.75; }
.teaching-code { max-width:100%; overflow:auto; margin:10px 0; padding:12px 14px; border:1px solid #d8e3f2; border-radius:9px; background:#f4f7fc; color:#203d65; font:12px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; text-align:left; white-space:pre; }
.teaching-inline-code { padding:1px 4px; border-radius:4px; background:#eaf0f8; color:#234776; font-size:.95em; }
.knowledge-detail-block.steps ol { margin:8px 0; padding-left:24px; }
.knowledge-detail-block.steps li { margin:6px 0; }
.knowledge-detail-block.source { grid-column:1/-1; padding:0; background:#fafbfd; }
.knowledge-detail-block.source>summary { padding:12px 14px; cursor:pointer; color:#68788c; font-weight:600; font-size:12px; }
.knowledge-detail-block.source>.teaching-text { padding:0 14px 12px; }
.quick-review-detail .teaching-text { margin:0; }
.quick-review-detail .teaching-code { font-size:11px; }
.quick-review-detail.prerequisites,.quick-review-detail.steps,.quick-review-detail.pitfalls { grid-column:1/-1; }
.quick-review-detail.source { grid-column:1/-1; border:1px solid #e1e7f0; border-radius:9px; padding:9px 12px; background:#fafbfd; }
.quick-review-detail.source>summary { cursor:pointer; color:#64758c; font-size:11px; font-weight:600; }
.quick-review-detail.source ul { margin-top:8px; }
.review-walkthrough { margin:8px 0; }
.review-walkthrough>small { color:#647a98; font-size:12px; }
.review-walkthrough ol { display:grid; gap:5px; padding-left:20px; color:#5d6d81; font-size:13px; line-height:1.7; }
.teaching-upgrade-note { margin:8px 0; padding:12px 14px; border:1px solid #dce5f2; border-radius:10px; background:#f1f6fd; color:#4d6385; font-size:12px; line-height:1.6; }
.knowledge-detail-block.material,.quick-review-detail.material { grid-column:1/-1; min-width:0; background:#f4f7fc; border-color:#cddbef; }
.teaching-material-origin { display:block; margin:5px 0 9px; color:#536b8b; font-size:12px; }
.teaching-material-translation { margin-top:12px; padding-top:12px; border-top:1px solid #d2def0; }
.knowledge-detail-block.material>small:last-child { display:block; margin-top:8px; color:#536b8b; }
.review-material { min-width:0; margin-top:14px; }
.review-material+.review-material { padding-top:14px; border-top:1px solid #d2def0; }

.knowledge-concept-fold { min-width: 0; width: 100%; }
.knowledge-concept-toggle { display: block; cursor: pointer; position: relative; padding-right: 30px; list-style: none; }
.knowledge-concept-toggle::-webkit-details-marker { display: none; }
.knowledge-concept-toggle::after { content: "⌄"; position: absolute; right: 4px; top: 4px; color: #5275b6; font-size: 22px; }
.knowledge-concept-fold[open] > .knowledge-concept-toggle::after { transform: rotate(180deg); }
.knowledge-concept-toggle:focus-visible { outline: 2px solid #4d70ea; outline-offset: 5px; border-radius: 8px; }
.knowledge-concept-preview { color: #64748b; margin: 8px 0 0; font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.knowledge-concept-fold[open] .knowledge-concept-preview { display: none; }
.knowledge-concept-fold[open] > .knowledge-detail-grid { margin-top: 16px; }
.teaching-connections { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0; color: #64748b; font-size: 13px; }
.teaching-connections button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.teaching-page-return { margin-bottom: 14px; }
@media (prefers-reduced-motion: reduce) { .knowledge-concept-toggle::after { transition: none; } }

.teaching-mode-code > .material, .teaching-mode-problem > .material,
.teaching-mode-passage > .material, .teaching-mode-data > .material,
.teaching-mode-code > .explanation, .teaching-mode-problem > .explanation,
.teaching-mode-code > .example, .teaching-mode-problem > .example { grid-column: 1 / -1; }

.material-reading { display:grid; gap:14px; margin-top:10px; min-width:0; }
.material-reading-group { min-width:0; padding-left:12px; border-left:3px solid #d5e0f2; }
.material-reading-group h5 { margin:0 0 6px; font-size:13px; color:#3e5e86; }
.material-reading-group .teaching-text { margin:6px 0; }
.material-source-notes,.material-original { min-width:0; border-top:1px solid #d7e1f0; padding-top:10px; }
.material-source-notes>summary,.material-original>summary { cursor:pointer; font-size:12px; color:#5d7494; }
.material-source-notes .teaching-text { margin-top:10px; }
.material-table-wrap { overflow-x:auto; max-width:100%; }
.material-data-table { border-collapse:collapse; width:100%; font-size:13px; font-variant-numeric:tabular-nums; }
.material-data-table th,.material-data-table td { border:1px solid #d5e0ed; padding:8px 10px; text-align:left; }
.material-data-table th { font-weight:600; color:#3b587b; background:#eaf0f8; }
.material-data-table td { background:#fff; }
.material-original-text { margin:12px 0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px;line-height:1.7;font-family:inherit; }

.teaching-term-link { display:inline; padding:0; margin:0; border:0; border-radius:3px; background:transparent; color:#285aa7; font:inherit; line-height:inherit; text-align:inherit; text-decoration:underline; text-decoration-style:dotted; text-underline-offset:4px; cursor:pointer; overflow-wrap:anywhere; }
.teaching-term-link:hover { color:#173e85; text-decoration-style:solid; }
.teaching-term-link:focus-visible { outline:2px solid #4d70ea; outline-offset:3px; }


.teaching-term-dialog { width:540px; max-width:calc(100% - 32px); max-height:80%; box-sizing:border-box; margin:auto; padding:0; border:1px solid #d6e1f2; border-radius:16px; background:#fff; color:#334155; box-shadow:0 18px 60px #172b4d33; }
.teaching-term-dialog[open] { display:flex; flex-direction:column; }
.teaching-term-dialog::backdrop { background:#24354b26; }
.teaching-term-dialog-header { display:flex; align-items:flex-start; gap:16px; justify-content:space-between; padding:18px 20px; border-bottom:1px solid #e3eaf4; flex-shrink:0; }
.teaching-term-dialog-header h3 { margin:0; color:#203e6c; font-size:1.1rem; line-height:1.5; min-width:0; overflow-wrap:anywhere; }
.teaching-term-dialog-header button { flex-shrink:0; }
.teaching-term-dialog-body { padding:16px 20px 20px; overflow:auto; overscroll-behavior:contain; min-height:0; }
.teaching-term-dialog-body>small { color:#64748b; }
.teaching-term-dialog .knowledge-detail-grid { display:grid; grid-template-columns:minmax(0,1fr); margin-top:12px; gap:12px; }
.teaching-term-dialog .knowledge-detail-block { padding:12px 14px; border:1px solid #e0e7f1; border-radius:10px; min-width:0; }
.teaching-term-dialog .knowledge-detail-block>b { color:#426394; }
