/* Reading layout and original, functional course diagrams. */
.page-course .academic-shell { max-width: 1320px; }
.course-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 36px; align-items: start; }
.course-toc { position: sticky; top: 16px; font-size: 11px; }
.course-toc summary { font-size: 12px; color: var(--ink); padding: 0 0 12px; cursor: pointer; }
.course-toc ol { list-style: none; margin: 0; padding: 0; }
.course-toc li { border-bottom: 1px solid #eceef0; }
.course-toc a { display: block; padding: 8px 0; text-decoration: none; color: #59646e; }
.course-toc a:hover, .course-toc a[aria-current] { color: var(--accent); }
.course-toc .course-other { margin-top: 16px; color: var(--link); }
.course-body { min-width: 0; }
.course-body section { padding: 0 0 28px; margin: 0 0 28px; border-bottom: 1px solid var(--rule); scroll-margin-top: 20px; }
.course-body h2 { border-top: 2px solid #aa6770; padding-top: 14px; margin: 0 0 16px; font: 21px/1.35 Georgia, serif; }
.chapter-no { font: 11px/1.4 Verdana, sans-serif; color: var(--accent); display: block; margin-bottom: 7px; }
.course-body h3 { font: 13px/1.5 Verdana, sans-serif; margin: 22px 0 10px; color: #283d4d; }
.course-body h4 { font: 12px/1.5 Verdana, sans-serif; margin: 18px 0 8px; }
.course-body p, .course-body li { font-size: 12px; line-height: 1.75; }
.course-body p { margin: 10px 0; }
.course-body li { padding-left: 4px; margin-bottom: 8px; }
.course-body ol, .course-body ul { padding-left: 22px; }
.course-body code { font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; color: #244965; overflow-wrap: anywhere; }
.course-body pre { margin-block: 14px; background: #f5f7f9; padding: 14px 16px; border: 0; border-left: 2px solid #cbd8e5; border-radius: 0; white-space: pre; }
.course-body pre code { color: #283b4a; overflow-wrap: normal; }
.course-body table { width: 100%; border-collapse: collapse; font-size: 11px; line-height: 1.6; }
.course-body :is(th, td) { padding: 9px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.course-body th { background: #f5f7f9; color: #465b6b; }
.course-body td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll, .diagram-scroll { overflow-x: auto; max-width: 100%; margin-block: 16px; }
.course-body .table-scroll table { min-width: 460px; }
.course-body figure { margin: 20px 0; padding: 16px 0; border-block: 1px solid var(--rule); }
.course-body figcaption { font-size: 10px; line-height: 1.6; color: #68717a; margin-top: 12px; }
.course-body figure svg { display: block; width: 100%; height: auto; color: #526979; }
.course-body figure svg text { font-family: Verdana, sans-serif; fill: #2f4658; }
.course-body .network-diagram { min-width: 600px; }
.course-body .lab-topology { display: block; width: 100%; min-width: 720px; max-width: none; }
.reading-note { padding: 10px 15px; margin-block: 16px; border-left: 2px solid #b8cbd8; background: #f5f8fa; }
.reading-note p { margin: 0; }
.lab-boundary { border-color: #c5a154; background: #fcf9f0; }
.deliverable { padding: 12px 0 0; border-top: 1px solid var(--rule); margin-top: 18px; }
.deliverable strong { color: var(--accent); font-weight: 400; }
.course-body details { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 10px; }
.course-body summary { color: var(--link); cursor: pointer; padding: 4px 0; }
.course-body details[open] { padding-bottom: 12px; }
.lab-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.lab-tools label { display: grid; gap: 5px; font-size: 11px; }
.lab-tools input { width: 170px; }
.lab-tools select { min-width: 85px; }
.lab-tools button { flex-shrink: 0; }
.icon-command { width: 32px; height: 32px; padding: 7px; }
.icon-command svg { width: 16px; height: 16px; }
.calc-result { min-height: 145px; padding: 12px 16px; background: #f5f7f9; border-left: 2px solid #b8cbd8; }
.calc-result dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 11px; }
.calc-result dt { color: #65717c; }
.calc-result dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-result p { font-size: 11px; }
.packet-switch { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--rule); margin-top: 18px; }
.packet-switch button { border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; background: #fff; color: #55626e; }
.packet-switch button[aria-pressed="true"] { border-color: #245d7b; color: #245d7b; background: #f1f6f9; }
.packet-strip { display: flex; min-height: 72px; align-items: stretch; margin-top: 18px; }
.packet-strip span { padding: 12px 8px; display: grid; place-items: center; text-align: center; font-size: 11px; border-right: 2px solid #fff; background: #e6eef5; flex: 1; }
.packet-strip span:nth-child(2) { background: #f3e9ec; }
.packet-strip span:nth-child(3) { background: #f6edcf; }
.packet-strip span:last-child { flex: 2; background: #edf0f2; border: 0; }
.packet-detail { min-height: 76px; }
.tcp-diagram { max-width: 720px; margin: auto; }
.tcp-step { opacity: .24; transition: opacity .25s; }
.tcp-step.is-visible { opacity: 1; }
.tcp-status { min-height: 62px; color: #354e60; }
.course-body .sources { font-size: 11px; }
.course-body math { font-size: 1.12em; color: #173f78; vertical-align: baseline; }
.course-entry { padding: 14px 0 20px; }
.course-entry h3 { margin-bottom: 8px; }
.course-entry-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 24px; }
.course-entry-links a { display: block; border-bottom: 1px solid var(--rule); padding: 9px 0; text-decoration: none; }
.course-entry-links small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
@media (max-width: 900px) {
 .course-layout { grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 650px) {
 .course-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
 .course-toc { position: static; border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
 .course-toc ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
 .course-toc a { padding: 7px 0; }
 .course-body h2 { font-size: 20px; }
 .calc-result { min-height: 180px; padding: 12px; }
 .calc-result dl { grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; }
 .packet-switch button { padding: 10px; font-size: 11px; }
 .packet-strip span { font-size: 10px; padding: 8px 4px; }
 .packet-detail { min-height: 116px; }
 .tcp-diagram { min-width: 480px; }
 .course-entry-links { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { .tcp-step { transition: none; } }
@media print {
 .academic-nav, .course-toc, .lab-tools, .packet-switch { display: none; }
 .course-layout { display: block; }
 .academic-shell { width: 100%; }
 .course-body section { break-before: auto; }
 .course-body :is(figure, pre, tr) { break-inside: avoid; }
 .tcp-step { opacity: 1; }
 .course-body .network-diagram, .course-body .lab-topology, .tcp-diagram { min-width: 0; }
 .table-scroll, .diagram-scroll, .course-body pre { overflow: visible; }
 .course-body pre { white-space: pre-wrap; }
 .course-body a { text-decoration: underline; }
}
