@keyframes sidebar-enter {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes lesson-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.packet-hub { padding: 78px 0 92px; }
.packet-hub-intro { max-width: 620px; margin-bottom: 39px; }
.packet-hub-intro h1 { margin-bottom: 20px; font-size: clamp(2.8rem, 6vw, 5rem); }

.modality-overview {
  max-width: 920px;
  margin: 0 0 28px;
  padding: 23px 25px;
  border: 1px solid rgba(46, 234, 255, .2);
  background: linear-gradient(145deg, rgba(15, 24, 35, .74), rgba(7, 11, 17, .74));
}
.modality-overview > span {
  display: block;
  margin-bottom: 9px;
  color: var(--orange);
  font: 500 .62rem "DM Mono", monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.modality-overview h2 { margin: 0 0 18px; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.outcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.outcome-grid article { min-width: 0; padding: 15px 16px; border: 1px solid var(--line); background: rgba(5, 9, 14, .5); }
.outcome-grid strong { display: block; margin-bottom: 6px; color: var(--cyan); font-size: .8rem; }
.outcome-grid p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.6; }

.category-panel {
  padding: 25px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 26, 37, .88), rgba(9, 13, 20, .88));
}

.category-panel-title { margin-bottom: 18px; color: var(--muted); font: .72rem "DM Mono", monospace; }
.category-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }

.category-button {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(8, 12, 18, .62);
  font: inherit;
  text-align: left;
}

a.category-button { color: inherit; text-decoration: none; cursor: pointer; transition: transform .22s, border-color .22s, background .22s; }
a.category-button:hover { transform: translateY(-3px); border-color: rgba(46, 234, 255, .58); background: rgba(46, 234, 255, .07); }
.category-button[disabled] { cursor: not-allowed; opacity: .56; }
.category-number { color: var(--magenta); font: .68rem "DM Mono", monospace; }
.category-name { color: #dce5f1; font-size: .82rem; font-weight: 700; }
.category-arrow { color: var(--cyan); font-size: 1.15rem; }
.category-status { padding: 4px 6px; color: var(--orange); border: 1px solid rgba(255, 157, 46, .24); font: .58rem "DM Mono", monospace; text-transform: uppercase; }

.learning-shell { position: fixed; top: 86px; right: 0; bottom: 0; left: 252px; display: flex; flex-direction: column; align-items: center; width: auto; min-width: 0; margin: 0; padding: 34px 36px 0; overflow-x: hidden; overflow-y: auto; }
.guide-sidebar { position: fixed; z-index: 1; top: 0; bottom: 0; left: 0; width: 252px; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; border: 1px solid rgba(46, 234, 255, .2); border-bottom: 0; border-left: 0; background: linear-gradient(165deg, rgba(18, 27, 41, .97), rgba(8, 11, 17, .97)); animation: .45s cubic-bezier(.2, .8, .2, 1) both sidebar-enter; }
.sidebar-brand, .sidebar-categories, .lesson-nav, .sidebar-back, .sidebar-standalone { flex-shrink: 0; }
.sidebar-brand { display: block; padding: 108px 21px 18px; color: inherit; border-bottom: 1px solid var(--line); text-decoration: none; }
.sidebar-brand small { display: block; margin-bottom: 7px; color: var(--orange); font: .63rem "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-brand strong { font-size: .9rem; }
.sidebar-categories, .lesson-nav { display: block; min-width: 0; }
.sidebar-categories { padding: 10px; border-bottom: 1px solid var(--line); }
.sidebar-category { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 7px; width: 100%; min-height: 39px; padding: 8px 9px; color: var(--muted); font-size: .68rem; text-decoration: none; }
a.sidebar-category:hover { color: var(--text); background: rgba(46, 234, 255, .05); }
.sidebar-category.active { color: var(--cyan); background: rgba(46, 234, 255, .08); }
.sidebar-category span:first-child { color: var(--magenta); font: .59rem "DM Mono", monospace; }
.sidebar-category em { color: var(--orange); font: .55rem "DM Mono", monospace; font-style: normal; text-transform: uppercase; }
.sidebar-category.is-soon { opacity: .52; }
.sidebar-standalone { width: auto; margin: auto 10px 13px; border-top: 1px solid var(--line); }
.lesson-nav::before { content: "Módulos"; display: block; padding: 9px 10px 6px; color: var(--muted); font: .59rem "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.lesson-nav { padding: 10px; }
.lesson-nav[hidden] { display: none; }
.lesson-nav a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; width: 100%; padding: 11px 10px; color: var(--muted); text-decoration: none; font-size: .75rem; line-height: 1.35; transition: color .2s, background .2s; }
.lesson-nav a:hover { color: var(--text); background: rgba(46, 234, 255, .05); }
.lesson-nav a.active { color: var(--cyan); background: rgba(46, 234, 255, .08); }
.lesson-nav span { color: var(--magenta); font: .63rem "DM Mono", monospace; }
.sidebar-back { display: block; margin: 3px 10px 13px; padding: 10px; color: #b8c2ce; border-top: 1px solid var(--line); font: .68rem "DM Mono", monospace; text-decoration: none; }
.sidebar-back:hover { color: var(--cyan); }

.sidebar-toggle { display: none; }
.lesson-content { width: min(900px, 100%); min-width: 0; min-height: 600px; padding: clamp(27px, 5vw, 58px) 0; border: 0; background: transparent; }
.lesson-content.is-changing { opacity: 0; transform: translateY(9px); }
.lesson-content .eyebrow { margin-bottom: 18px; }
.lesson-content h1 { max-width: 780px; margin-bottom: 21px; font-size: clamp(2.15rem, 4.5vw, 4.2rem); }
.lesson-content h2 { margin: 43px 0 16px; font-size: clamp(1.3rem, 3vw, 1.85rem); }
.lesson-content p { max-width: 720px; color: #c0cad7; font-size: 1rem; line-height: 1.82; }
.lesson-content .topic-link { color: var(--cyan); text-decoration: none; }
.lesson-content .topic-link:hover { color: var(--orange); }
.assumed-topic-shortcuts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; max-width: 720px; margin: -3px 0 20px; }
.lesson-content .assumed-topic-shortcuts > p { margin: 0; color: #8e9aaa; font: .66rem/1.45 "DM Mono", monospace; }
.assumed-topic-links { display: flex; flex-wrap: wrap; gap: 7px; }
.assumed-topic-links a { position: relative; padding: 6px 9px; color: #9eabba; border: 1px solid rgba(183, 205, 228, .15); background: rgba(14, 20, 29, .46); font: .62rem "DM Mono", monospace; text-decoration: none; transition: color .18s, border-color .18s, background .18s; }
.assumed-topic-links a:hover { color: var(--cyan); border-color: rgba(46, 234, 255, .32); background: rgba(46, 234, 255, .045); }
.assumed-topic-links a::after { content: attr(data-help); position: absolute; z-index: 4; bottom: calc(100% + 9px); left: 50%; width: max-content; max-width: 190px; padding: 7px 9px; color: #c7d1dd; border: 1px solid rgba(46, 234, 255, .24); background: rgba(7, 12, 18, .98); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); font: .61rem/1.45 "DM Mono", monospace; text-align: center; white-space: normal; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .18s ease, transform .18s ease; }
.assumed-topic-links a:hover::after, .assumed-topic-links a:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.assumed-topic-links a:first-child::after { left: 0; transform: translate(0, 4px); }
.assumed-topic-links a:first-child:hover::after, .assumed-topic-links a:first-child:focus-visible::after { transform: translate(0, 0); }
.assumed-topic-links a:last-child::after { right: 0; left: auto; transform: translate(0, 4px); }
.assumed-topic-links a:last-child:hover::after, .assumed-topic-links a:last-child:focus-visible::after { transform: translate(0, 0); }
.lesson-lead { color: var(--muted) !important; font-size: 1.05rem !important; }
.lesson-content ul, .lesson-content ol { max-width: 720px; padding-left: 20px; color: #c0cad7; line-height: 1.85; }
.lesson-content li::marker { color: var(--magenta); }
.lesson-content > p code { padding: .08em .25em; color: var(--cyan); background: rgba(46, 234, 255, .055); font: .82em "DM Mono", monospace; }
.topology-card { max-width: 720px; margin: 28px 0 34px; padding: 20px; border: 1px solid rgba(46, 234, 255, .38); background: radial-gradient(circle at 50% 45%, rgba(46, 234, 255, .065), transparent 52%), linear-gradient(135deg, rgba(14, 24, 37, .9), rgba(5, 9, 14, .9)); }
.topology-card figcaption { display: grid; gap: 5px; margin-bottom: 12px; }
.topology-card figcaption span { color: var(--orange); font: .62rem "DM Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
.topology-card figcaption strong { color: var(--text); font-size: .91rem; }
.topology-map { position: relative; min-height: clamp(178px, 25vw, 230px); }
.topology-cables { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.topology-cables path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 11 8; }
.topology-cables .cable-direct { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(46, 234, 255, .18)); }
.topology-cables .cable-crossed { stroke: var(--orange); filter: drop-shadow(0 0 5px rgba(255, 157, 46, .16)); }
.topology-node { position: absolute; top: 50%; display: grid; justify-items: center; width: 19%; transform: translate(-50%, -34%); text-align: center; }
.node-one { left: 8%; }
.node-two { left: 38%; }
.node-three { left: 62%; }
.node-four { left: 92%; }
.device-icon { display: block; box-sizing: border-box; width: clamp(56px, 9.5vw, 82px); height: clamp(44px, 7vw, 62px); padding: 4px; object-fit: contain; }
.router-icon { width: clamp(60px, 9.5vw, 84px); }
.switch-icon { width: clamp(62px, 10.5vw, 90px); }
.topology-node b { margin-top: 5px; color: #e4edf5; font: calc(.75rem + 2px) "DM Mono", monospace; }
.topology-node small { margin-top: 4px; color: #aebdcd; font: clamp(calc(.58rem + 2px), calc(1.4vw + 2px), calc(.7rem + 2px)) "DM Mono", monospace; white-space: nowrap; }
.topology-link { position: absolute; top: calc(50% - 48px); transform: translateX(-50%); display: grid; gap: 3px; text-align: center; white-space: nowrap; }
.link-one { left: 23%; }
.link-two { left: 50%; }
.link-three { left: 77%; }
.topology-link span { color: #dfe9f3; font: clamp(calc(.48rem + 2px), calc(1.35vw + 2px), calc(.66rem + 2px)) "DM Mono", monospace; }
.topology-legend { display: flex; justify-content: center; gap: 0; width: fit-content; max-width: 100%; margin: 1px auto 20px; border: 1px solid rgba(46, 234, 255, .32); background: rgba(5, 10, 16, .46); }
.topology-legend span { display: flex; align-items: center; gap: 9px; padding: 10px 14px; color: #c1cddb; font-size: .72rem; white-space: nowrap; }
.topology-legend span + span { border-left: 1px solid rgba(46, 234, 255, .26); }
.topology-legend i { display: block; width: 45px; border-top: 3px dashed var(--cyan); }
.topology-legend .legend-crossed i { border-color: var(--orange); }
.topology-caption { max-width: none !important; margin: 6px 0 0; color: var(--muted) !important; font-size: .78rem !important; line-height: 1.55 !important; }
.topology-caption code { color: var(--magenta); font: inherit; }
.stp-topology .topology-map { min-height: clamp(245px, 38vw, 330px); }
.stp-topology .topology-cables .stp-forwarding { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(46, 234, 255, .18)); }
.stp-topology .topology-cables .stp-blocked { stroke: var(--magenta); filter: drop-shadow(0 0 5px rgba(255, 46, 123, .22)); }
.stp-topology .topology-cables .stp-block-mark { stroke: var(--magenta); stroke-width: 7; stroke-dasharray: none; }
.stp-topology .stp-node-root { top: 25%; left: 50%; }
.stp-topology .stp-node-left { top: 75%; left: 19%; }
.stp-topology .stp-node-right { top: 75%; left: 81%; }
.stp-topology .topology-node { width: 26%; }
.stp-topology .topology-node small { white-space: normal; }
.topology-legend .legend-blocked i { border-color: var(--magenta); }
.etherchannel-workshop-topology .topology-map { min-height: clamp(440px, 68vw, 540px); }
.etherchannel-workshop-topology .topology-cables .workshop-pagp { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(46, 234, 255, .2)); }
.etherchannel-workshop-topology .topology-cables .workshop-lacp { stroke: var(--orange); filter: drop-shadow(0 0 5px rgba(255, 157, 46, .18)); }
.etherchannel-workshop-topology .topology-cables .workshop-access { stroke: #8e9aaa; stroke-width: 2; stroke-dasharray: none; }
.etherchannel-workshop-topology .workshop-switch { width: 23%; transform: translate(-50%, -50%); }
.etherchannel-workshop-topology .workshop-sw1 { top: 20%; left: 25%; }
.etherchannel-workshop-topology .workshop-sw2 { top: 20%; left: 75%; }
.etherchannel-workshop-topology .workshop-sw3 { top: 60%; left: 25%; }
.etherchannel-workshop-topology .workshop-sw4 { top: 60%; left: 75%; }
.workshop-top-copy { position: absolute; right: -18%; bottom: calc(100% + 5px); left: -18%; display: grid; justify-items: center; }
.workshop-top-copy b, .workshop-top-copy small { margin-top: 2px; }
.workshop-top-copy small { white-space: normal; }
.workshop-group { position: absolute; z-index: 2; display: grid; gap: 2px; padding: 3px 6px; color: #c8d3df; background: rgba(7, 12, 18, .94); font: .58rem/1.25 "DM Mono", monospace; text-align: center; transform: translate(-50%, -50%); }
.workshop-group strong { color: var(--magenta); font-size: .6rem; text-transform: uppercase; }
.workshop-group small { color: #8f9dad; font: .52rem "DM Mono", monospace; white-space: nowrap; }
.workshop-group.group-one { top: 7%; left: 50%; }
.workshop-group.group-two { top: 40%; left: 8%; }
.workshop-group.group-three { top: 70%; left: 50%; }
.workshop-group.group-four { top: 40%; left: 92%; }
.etherchannel-workshop-topology .workshop-pc { top: 90%; width: 13%; transform: translate(-50%, -50%); }
.etherchannel-workshop-topology .workshop-pc b { margin-top: 1px; font-size: clamp(.58rem, 1.3vw, .7rem); }
.etherchannel-workshop-topology .workshop-pc small { margin-top: 1px; font-size: clamp(.52rem, 1.2vw, .63rem); white-space: normal; }
.etherchannel-workshop-topology .pc-one { left: 8%; }
.etherchannel-workshop-topology .pc-two { left: 22%; }
.etherchannel-workshop-topology .pc-three { left: 36%; }
.etherchannel-workshop-topology .pc-four { left: 64%; }
.etherchannel-workshop-topology .pc-five { left: 78%; }
.etherchannel-workshop-topology .pc-six { left: 92%; }
.topology-legend .legend-lacp i { border-color: var(--orange); }
.topology-legend .legend-access-solid i { border-top-style: solid; border-color: #8e9aaa; }
.stp-practice-topology .topology-map { min-height: clamp(360px, 52vw, 455px); }
.stp-practice-topology .topology-cables .stp-trunk { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(46, 234, 255, .18)); }
.stp-practice-topology .topology-cables .stp-access { stroke: var(--orange); filter: drop-shadow(0 0 5px rgba(255, 157, 46, .16)); }
.stp-practice-topology .practice-switch { width: 27%; }
.stp-practice-topology .practice-switch small { white-space: normal; }
.stp-practice-topology .practice-switch { transform: translate(-50%, -50%); }
.stp-practice-topology .practice-node-copy { position: absolute; right: 0; bottom: calc(100% + 5px); left: 0; display: grid; justify-items: center; }
.stp-practice-topology .practice-node-copy b, .stp-practice-topology .practice-node-copy small { margin-top: 2px; }
.stp-practice-topology .practice-bottom-switch .practice-node-copy { bottom: calc(100% + 8px); width: 145px; }
.stp-practice-topology .practice-sw3 .practice-node-copy { right: calc(50% + 38px); left: auto; justify-items: end; text-align: right; }
.stp-practice-topology .practice-sw4 .practice-node-copy { right: auto; left: calc(50% + 38px); justify-items: start; text-align: left; }
.stp-practice-topology .practice-sw1 { top: 18%; left: 26.5%; }
.stp-practice-topology .practice-sw2 { top: 18%; left: 73.5%; }
.stp-practice-topology .practice-sw3 { top: 68%; left: 26.5%; }
.stp-practice-topology .practice-sw4 { top: 68%; left: 73.5%; }
.stp-practice-topology .practice-pc { top: 93%; width: 17%; transform: translate(-50%, -50%); }
.stp-practice-topology .practice-pc1 { left: 13.5%; }
.stp-practice-topology .practice-pc2 { left: 35.5%; }
.stp-practice-topology .practice-pc3 { left: 64.5%; }
.stp-practice-topology .practice-pc4 { left: 86.5%; }
.endpoint-icon { display: block; width: clamp(34px, 6vw, 48px); color: var(--cyan); }
.endpoint-icon rect { fill: rgba(8, 15, 23, .98); }
.endpoint-icon rect, .endpoint-icon path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.endpoint-icon path { fill: none; }
.stp-practice-topology .practice-pc b { margin-top: 1px; font-size: clamp(.61rem, 1.5vw, .73rem); }
.stp-practice-topology .practice-pc small { margin-top: 1px; font-size: clamp(.56rem, 1.35vw, .67rem); white-space: normal; }
.stp-practice-topology .topology-legend { margin-top: 30px; }
.topology-legend .legend-access i { border-color: var(--orange); }
.cli-block { position: relative; box-sizing: border-box; width: 100%; min-width: 0; max-width: 720px; margin: 25px 0; padding: 39px 20px 19px; overflow-x: hidden; border: 1px solid rgba(46, 234, 255, .25); background: #04070b; color: #dbe7ef; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025); font: .78rem/1.9 "DM Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.cli-block::before { content: "Cisco IOS · CLI"; position: absolute; top: 0; right: 0; left: 0; padding: 9px 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(18, 27, 41, .72); font: .59rem "DM Mono", monospace; letter-spacing: .07em; }
.cli-block::after { content: "# en verde = explicación de la guía; no se escribe en la CLI."; display: block; margin-top: 13px; padding-top: 10px; border-top: 1px solid rgba(46, 234, 255, .12); color: #009d00; font: .64rem/1.45 "DM Mono", monospace; white-space: normal; }
.command-reference .reference-guide { margin: 26px 0 20px; padding: 6px 0 6px 18px; border-left: 2px solid var(--cyan); }
.command-reference .reference-guide p { max-width: 780px; margin: 0 0 6px; font-size: .83rem; line-height: 1.7; color: var(--muted); }
.command-reference .reference-guide p:last-child { margin-bottom: 0; }
.command-reference p code { color: var(--cyan); font: .86em "DM Mono", monospace; }
.reference-directory { margin: 24px 0 38px; border: 1px solid var(--line); background: rgba(12, 19, 28, .7); }
.reference-directory.is-unfolding, .reference-note.is-unfolding { overflow: hidden; overflow-anchor: none; }
.reference-directory > summary { padding: 17px 18px; color: var(--text); cursor: pointer; font-size: .85rem; font-weight: 700; }
.reference-directory > summary::marker, .reference-note > summary::marker { color: var(--cyan); }
.reference-directory > summary > span { margin-left: 10px; color: var(--muted); font: .65rem "DM Mono", monospace; white-space: nowrap; }
.reference-index { display: block; column-count: 2; column-gap: 1px; margin: 0; padding: 0 10px 10px; }
.reference-index a { display: flex; break-inside: avoid; align-items: baseline; gap: 10px; padding: 12px 10px; border: 1px solid transparent; color: var(--muted); font-size: .78rem; text-decoration: none; }
.reference-index a > span { color: var(--cyan); font: .65rem "DM Mono", monospace; }
.reference-index a:hover, .reference-index a:focus-visible { border-color: var(--line); color: var(--text); background: rgba(46, 234, 255, .035); }
.reference-help { position: fixed; z-index: 60; width: max-content; max-width: min(240px, calc(100vw - 24px)); padding: 8px 10px; color: #c7d1dd; border: 1px solid rgba(46, 234, 255, .24); background: rgba(7, 12, 18, .98); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); font: .61rem/1.5 "DM Mono", monospace; text-align: center; white-space: normal; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; }
.reference-help.is-visible { opacity: 1; transform: translateY(0); }
.reference-help[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .reference-help { transition: none; } }
.reference-directory { scroll-margin-top: 25px; }
.reference-return { position: fixed; z-index: 20; right: calc(24px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid rgba(151, 163, 181, .5); border-radius: 50%; background: transparent; color: var(--muted); backdrop-filter: blur(6px); cursor: pointer; animation: reference-return-enter .25s ease-out both; transition: color .2s, border-color .2s, background .2s; }
.reference-return svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.reference-return:hover, .reference-return:focus-visible { color: var(--cyan); border-color: var(--cyan); background: rgba(46, 234, 255, .045); }
@keyframes reference-return-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .reference-return { animation: none; transition: none; } }
.command-reference section { margin: 40px 0; scroll-margin-top: 25px; }
.command-reference section h3 { margin: 28px 0 10px; font-size: 1rem; }
.reference-terminal { position: relative; width: 100%; min-width: 0; max-width: 720px; margin: 25px 0; }
.hsrp-table-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.hsrp-map-scroll { width: 100%; min-width: 0; max-width: 100%; }

/* Redes inalámbricas: diagramas lógicos que se apilan sin scroll lateral. */
.wifi-lesson .wifi-diagram, .wifi-lesson .wifi-channel-plan { max-width: 820px; margin: 28px 0; }
.wifi-lesson .wifi-flow { display: flex; align-items: stretch; gap: 26px; margin: 26px 0; padding: 0; list-style: none; }
.wifi-lesson .wifi-flow > li, .wifi-lesson .wifi-flow > div { position: relative; flex: 1; min-width: 0; padding: 16px 10px; border: 1px solid var(--line); background: rgba(46,234,255,.035); color: var(--cyan); font: .76rem/1.65 "DM Mono", monospace; text-align: center; overflow-wrap: anywhere; }
.wifi-lesson .wifi-flow > :not(:last-child)::after { content: "→"; position: absolute; left: calc(100% + 5px); top: 50%; width: 16px; color: var(--orange); transform: translateY(-50%); }
.wifi-lesson .wifi-flow b, .wifi-lesson .wifi-flow span { display: block; }
.wifi-lesson .wifi-flow span { margin-top: 6px; color: var(--muted); }
.wifi-lesson .wifi-channel-plan .wifi-flow > div::after { display: none; }
.wifi-lesson .topology-card > p { margin: 12px 0 0; font-size: .78rem; line-height: 1.7; }
.wifi-lesson .reference-note p { margin: 14px 0 20px; }
.wifi-lesson h3 { margin: 28px 0 14px; }
.wifi-lesson li { margin-bottom: 12px; }
.wifi-lesson .wifi-flow > li { margin-bottom: 0; }
@media (max-width: 600px) {
  .wifi-lesson .wifi-flow { flex-direction: column; gap: 28px; }
  .wifi-lesson .wifi-flow > :not(:last-child)::after { content: "↓"; top: calc(100% + 4px); left: calc(50% - 8px); transform: none; }
}

/* Seguridad de capa 2: reutiliza la guía y conserva tablas sin scroll lateral. */
.l2-lesson .lesson-note { margin-bottom: 24px; }
.l2-lesson .reference-terminal-bar { height: auto; min-height: 32px; gap: 12px; }
.l2-lesson .reference-terminal-label { flex-wrap: wrap; row-gap: 6px; }
.l2-topology { box-sizing: border-box; width: 100%; max-width: 820px; margin: 30px 0; }
.l2-topology svg { display: block; width: 100%; height: auto; margin: 22px 0 8px; }
.l2-topology .l2-map-mobile { display: none; }
.l2-topology > p { margin: 12px 0 0; font-size: .76rem; line-height: 1.7; }
.l2-map-copy { fill: #a9bdca; text-anchor: middle; font: 13px "DM Mono", monospace; }
.l2-map-copy .l2-map-name { fill: #dce5f1; font-size: 16px; font-weight: 500; }
.l2-table-wrap { max-width: 100%; margin: 26px 0; border: 1px solid var(--line); }
.l2-table { width: 100%; border-collapse: collapse; table-layout: fixed; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.l2-table th, .l2-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.l2-table th { color: var(--cyan); background: rgba(46,234,255,.035); font-weight: 600; }
.l2-table tr:last-child td { border-bottom: 0; }
.l2-output { box-sizing: border-box; max-width: 100%; margin: 24px 0 10px; padding: 20px; border: 1px solid var(--line); background: #04070b; color: #a9bdca; font: .76rem/1.85 "DM Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.l2-output code { color: inherit; font: inherit; background: none; padding: 0; }
.l2-lesson .l2-output-caption, .l2-lesson .l2-source { font-size: .76rem; line-height: 1.7; color: var(--muted); }
@media (max-width: 600px) {
  .l2-topology .l2-map-desktop { display: none; }
  .l2-topology .l2-map-mobile { display: block; }
  .l2-table thead { display: none; }
  .l2-table, .l2-table tbody, .l2-table tr, .l2-table td { display: block; width: auto; }
  .l2-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .l2-table tr:last-child { border-bottom: 0; }
  .l2-table td { border: 0; padding: 5px 16px; }
  .l2-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--cyan); font: .65rem/1.5 "DM Mono", monospace; }
}
.hsrp-table-scroll { margin: 24px 0; border: 1px solid var(--line); }
.hsrp-table { width: 100%; min-width: 560px; border-collapse: collapse; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.hsrp-table th, .hsrp-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hsrp-table th { color: var(--cyan); background: rgba(46,234,255,.035); font-weight: 600; }
.hsrp-table tr:last-child td { border-bottom: 0; }
.hsrp-topology { box-sizing: border-box; width: 100%; max-width: 820px; margin: 30px 0; }
.hsrp-map { display: block; width: 100%; min-width: 0; max-width: 100%; height: auto; }
.hsrp-wire { fill: none; stroke: #8499a7; stroke-width: 2; }
.hsrp-copy { fill: #a9bdca; text-anchor: middle; font: 12px "DM Mono", monospace; }
.hsrp-copy .hsrp-name { fill: #dce5f1; font-size: 14px; font-weight: 500; }
.hsrp-copy .hsrp-accent { fill: var(--cyan); font-size: 16px; }
.hsrp-pc { fill: none; stroke: var(--cyan); stroke-width: 1.6; }
.hsrp-topology > p { margin: 12px 0 0; font-size: .76rem; line-height: 1.7; }
.hsrp-lesson .reference-terminal-bar { height: auto; min-height: 32px; }
.hsrp-topology--basic .hsrp-map { margin: 12px 0 4px; }
.hsrp-virtual-card rect { fill: rgba(46,234,255,.025); stroke: rgba(46,234,255,.22); }
.hsrp-virtual-card text { fill: #a9bdca; text-anchor: middle; font: 11px "DM Mono", monospace; }
.hsrp-virtual-card .hsrp-virtual-ip { fill: var(--cyan); font-size: 17px; }
.reference-terminal-bar { position: absolute; z-index: 1; top: 1px; right: 1px; left: 1px; display: flex; align-items: center; justify-content: space-between; height: 32px; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: rgba(18, 27, 41, .72); }
.reference-terminal-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 14px; min-width: 0; line-height: 1; }
.reference-terminal-label > span { color: var(--muted); font: .59rem "DM Mono", monospace; letter-spacing: .07em; }
.reference-terminal-label > strong { color: var(--muted); font: 400 .59rem "DM Mono", monospace; }
.command-reference .cli-command[data-cli-prompt]::before { content: attr(data-cli-prompt); color: var(--magenta); user-select: none; }
.reference-copy { align-self: stretch; display: inline-flex; align-items: center; flex-shrink: 0; margin: -9px -6px -9px 0; padding: 0 6px; border: 0; color: var(--muted); background: transparent; font: .59rem "DM Mono", monospace; cursor: pointer; }
.reference-copy[hidden] { display: none; }
.reference-copy:hover, .reference-copy:focus-visible { color: var(--cyan); background: rgba(46, 234, 255, .05); }
.reference-copy:disabled { cursor: wait; opacity: .7; }
.command-reference .reference-terminal .cli-block { margin: 0; tab-size: 2; }
.command-reference .cli-block::before { display: none; }
.command-reference .cli-block::after { content: "! en verde = separador o comentario; se puede copiar en la CLI."; }
.command-reference .reference-copy-status { max-width: none; margin: 0; padding: 0 18px 10px; color: var(--cyan); font-size: .74rem; line-height: 1.5; }
.command-reference .reference-copy-status:empty { display: none; }
.reference-note { margin: 10px 0 24px; border-left: 1px solid var(--line); padding-left: 14px; }
.reference-module-links { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 12px 0 0; }
.reference-module-links > span { margin-right: 3px; color: var(--muted); font: .6rem "DM Mono", monospace; }
.reference-module-links a { padding: 8px 10px; border: 1px solid var(--line); color: var(--muted); background: transparent; font: .66rem/1.5 "DM Mono", monospace; text-decoration: none; }
.reference-module-links a:hover, .reference-module-links a:focus-visible { color: var(--cyan); border-color: var(--cyan); background: rgba(46, 234, 255, .035); }
.reference-module-links small { flex-basis: 100%; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.reference-note > summary { padding: 8px 0; color: var(--muted); cursor: pointer; font-size: .78rem; }
.command-reference .reference-note p { margin: 6px 0 12px; font-size: .83rem; line-height: 1.75; }
@media (max-width: 600px) {
  .reference-terminal-label > span { display: none; }
  .reference-index { column-count: 1; }
  .reference-directory > summary > span { display: block; margin: 7px 0 0 18px; }
}
.reference-table { max-width: 100%; overflow-x: auto; margin: 22px 0; }
.lab-topology { width: 100%; margin: 30px 0 34px; padding: 22px; border: 1px solid rgba(46, 234, 255, .25); background: linear-gradient(135deg, #0d1721, #080d14); }
.command-reference .lab-topology-kicker { margin: 0 0 8px; color: var(--orange); font: .62rem "DM Mono", monospace; letter-spacing: .07em; }
.command-reference .lab-topology h2 { margin: 0 0 10px; font-size: clamp(1.05rem, 2.5vw, 1.45rem); }
.command-reference .lab-topology figcaption > p:last-child { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.lab-topology-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0 18px; }
.lab-view-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.lab-topology-controls button { min-height: 34px; padding: 8px 10px; border: 1px solid var(--line); color: var(--muted); background: transparent; font: .62rem "DM Mono", monospace; cursor: pointer; }
.lab-topology-controls button:hover, .lab-topology-controls button:focus-visible, .lab-topology-controls button[aria-pressed="true"] { border-color: rgba(46, 234, 255, .6); color: var(--cyan); background: rgba(46, 234, 255, .05); }
.lab-topology-stage { overflow: hidden; min-width: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #080f17; }
.lab-topology-svg { display: block; width: 100%; height: auto; aspect-ratio: 2180 / 1030; overflow: hidden; }
@media (min-width: 761px) {
  /* En escritorio el zoom cambia el encuadre, no la altura del recuadro. */
  .lab-topology:not(.is-expanded) .lab-topology-stage { position: relative; aspect-ratio: 16 / 9; }
  .lab-topology:not(.is-expanded) .lab-topology-svg { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; }
}
.lab-topology-svg text { font-family: "DM Mono", monospace; paint-order: stroke fill; stroke: #080f17; stroke-width: 4px; stroke-linejoin: round; }
.lab-topology-svg .lab-device-name { fill: var(--text); font-size: 22px; font-weight: 500; }
.lab-topology-svg .lab-device-meta { fill: #acbac9; font-size: 18px; }
.lab-topology-svg .lab-zone-title { fill: #6d8ba0; font-size: 17px; letter-spacing: 1.5px; }
.lab-zone-borders path { fill: none; stroke: #284151; stroke-width: 1px; stroke-dasharray: 5 10; opacity: .45; }
.lab-wire { fill: none; stroke-width: 3px; stroke-linecap: round; stroke-linejoin: round; }
.lab-pagp { stroke: var(--cyan); stroke-dasharray: 14 9; }
.lab-lacp { stroke: var(--orange); stroke-dasharray: 14 9; }
.lab-trunk { stroke: #839dad; stroke-dasharray: 14 9; }
.lab-serial { stroke: var(--magenta); }
.lab-routed, .lab-access { stroke: #8f9eac; }
.lab-topology-svg .lab-label, .lab-topology-svg .lab-port { fill: #b8c7d3; font-size: 17px; }
.lab-topology-svg .lab-small { fill: #7d94a7; font-size: 16px; }
.lab-topology-svg .lab-channel-mode { fill: #b9c9d7; font-size: 16px; }
.lab-topology-svg .lab-network { fill: var(--text); font-size: 18px; }
.lab-topology-svg .lab-group-pagp { fill: var(--cyan); font-size: 18px; }
.lab-topology-svg .lab-group-lacp { fill: var(--orange); font-size: 18px; }
.lab-pc { fill: #0b1b26; stroke: var(--cyan); stroke-width: 2px; }
.lab-map-note rect { fill: #0b1722; stroke: #244354; stroke-width: 1px; }
.lab-topology-svg .lab-note-title { fill: var(--orange); font-size: 16px; }
.lab-topology-svg .lab-note-line { fill: #b9c9d7; font-size: 16px; }
.lab-topology-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 18px 0 8px; }
.lab-topology-legend > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .65rem; }
.lab-topology-legend i { width: 25px; height: 0; border-top: 2px solid #8f9eac; }
.lab-topology-legend .lab-legend-pagp { border-color: var(--cyan); border-top-style: dashed; }
.lab-topology-legend .lab-legend-lacp { border-color: var(--orange); border-top-style: dashed; }
.lab-topology-legend .lab-legend-trunk { border-color: #839dad; border-top-style: dashed; }
.lab-topology-legend .lab-legend-serial { border-color: var(--magenta); }
.command-reference .lab-topology-caption { max-width: none; margin: 12px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.75; }
.command-reference .lab-topology-status { margin: 8px 0 0; color: var(--orange); font-size: .72rem; }
.lab-topology-status:empty { display: none; }
.lab-topology-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 0; background: transparent; }
.lab-topology-overlay::backdrop { background: transparent; }
.lab-topology-backdrop { position: absolute; inset: -16px; overflow: hidden; pointer-events: none; filter: blur(12px); opacity: .65; animation: lab-backdrop-in 460ms ease both; }
.lab-backdrop-page { position: absolute; left: 16px; pointer-events: none; }
body.lab-expanded-page > :not(.lab-topology-overlay) { visibility: hidden; }
html:has(body.lab-expanded-page), body.lab-expanded-page .learning-shell { overflow: hidden; }
.lab-topology-overlay.is-closing .lab-topology-backdrop { animation: lab-backdrop-out 240ms ease both; }
.lab-topology.is-expanded { position: relative; display: flex; flex-direction: column; gap: 0; width: min(96vw, calc(94dvh * 16 / 9)); height: min(54vw, 94dvh); margin: 0; padding: clamp(12px, 1.3vw, 24px); border: 0; background: transparent; box-shadow: none; overflow: auto; }
.lab-topology.is-expanded .lab-topology-stage { display: flex; flex: 1; min-height: 0; justify-content: center; overflow: hidden; border: 0; background: transparent; }
.lab-topology.is-expanded .lab-map-note rect { fill: transparent; stroke: rgba(46, 234, 255, .15); }
.lab-topology.is-expanded .lab-pc { fill: transparent; }
.lab-topology.is-expanded .lab-topology-svg { width: 100%; height: 100%; min-width: 0; max-height: none; }
.command-reference .lab-topology.is-expanded .lab-topology-caption { margin: 12px 0 0; }
.lab-topology.is-expanded .lab-topology-controls { margin-top: 14px; }
@keyframes lab-backdrop-in { from { opacity: 0; filter: blur(0); } to { opacity: .65; filter: blur(12px); } }
@keyframes lab-backdrop-out { from { opacity: .65; } to { opacity: 0; } }
@media (max-aspect-ratio: 4/3) {
  .lab-topology.is-expanded { width: 96vw; height: 94dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-topology-backdrop, .lab-topology-overlay.is-closing .lab-topology-backdrop { animation: none; }
}
.lab-optional { padding-left: 0; border: 0; }
.command-reference .lab-source-note { font-size: .72rem; color: var(--muted); }
.lab-source-note a { color: var(--cyan); }
@media (max-width: 600px) {
  .lab-topology { padding: 14px; }
  .lab-topology-controls button { min-height: 44px; }
  .lab-topology-stage { margin-right: -5px; margin-left: -5px; overflow-x: auto; scrollbar-color: #284759 #080f17; }
  .lab-topology-svg { min-width: 600px; }
  .lab-topology-svg[data-lab-view]:not([data-lab-view="general"]) { max-height: none; }
  .lab-topology:fullscreen { padding: 12px; }
}
.reference-table table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.reference-table caption { padding: 10px; text-align: left; color: var(--muted); }
.reference-table th, .reference-table td { padding: 12px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.cli-block code { color: inherit; font: inherit; }
.cli-prompt { color: var(--magenta); }
.cli-command { color: var(--text); }
.cli-comment { color: #009d00; }
.lesson-note { margin-top: 30px; padding: 17px 18px; border-left: 2px solid var(--cyan); color: var(--muted); background: rgba(46, 234, 255, .045); font-size: .84rem; line-height: 1.65; }
.lesson-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.lesson-actions a { color: var(--cyan); font: .7rem "DM Mono", monospace; text-decoration: none; }
.lesson-actions a:hover { color: var(--orange); }
.lesson-content > footer { width: 100%; margin-top: 48px; color: #c2cbd7; font-size: .78rem; font-weight: 700; }
.lesson-content > footer p { max-width: none; margin: 0; color: inherit; font-size: inherit; line-height: normal; }
.lesson-content > footer small { color: var(--muted); font-size: .78em; font-weight: 500; }
.lesson-content > footer .site-credit { color: var(--muted); font-size: .7rem; font-weight: 500; line-height: 1.4; }
.lesson-content > footer > p:last-child { color: var(--muted); font: .7rem "DM Mono", monospace; }

html:has(.learning-shell) { background: var(--bg); color-scheme: dark; scrollbar-color: #284759 var(--bg); }
html:has(.learning-shell), body:has(.learning-shell) { overflow-x: hidden; }
.learning-shell, .guide-sidebar, .lab-topology.is-expanded { scrollbar-color: #284759 var(--bg); scrollbar-width: thin; }
.learning-shell::-webkit-scrollbar, .guide-sidebar::-webkit-scrollbar, .lab-topology.is-expanded::-webkit-scrollbar { width: 8px; height: 8px; }
.learning-shell::-webkit-scrollbar-track, .guide-sidebar::-webkit-scrollbar-track, .lab-topology.is-expanded::-webkit-scrollbar-track { background: var(--bg); }
.learning-shell::-webkit-scrollbar-thumb, .guide-sidebar::-webkit-scrollbar-thumb, .lab-topology.is-expanded::-webkit-scrollbar-thumb { background: #284759; border: 2px solid var(--bg); border-radius: 8px; }
/* La ampliación no muestra barras; los paneles normales conservan su desplazamiento. */
html:has(body.lab-expanded-page), body.lab-expanded-page,
body.lab-expanded-page .learning-shell, body.lab-expanded-page .guide-sidebar,
body.lab-expanded-page .lab-topology-overlay,
body.lab-expanded-page .lab-topology.is-expanded,
body.lab-expanded-page .lab-topology-stage { scrollbar-width: none; -ms-overflow-style: none; }
html:has(body.lab-expanded-page)::-webkit-scrollbar,
body.lab-expanded-page::-webkit-scrollbar,
body.lab-expanded-page .learning-shell::-webkit-scrollbar,
body.lab-expanded-page .guide-sidebar::-webkit-scrollbar,
body.lab-expanded-page .lab-topology-overlay::-webkit-scrollbar,
body.lab-expanded-page .lab-topology.is-expanded::-webkit-scrollbar,
body.lab-expanded-page .lab-topology-stage::-webkit-scrollbar { display: none; width: 0; height: 0; }
body:has(.learning-shell) { overflow-y: hidden; }
/* El encabezado conserva el diseño del inicio; solo se fija para la navegación lateral. */
body:has(.learning-shell) .site-header { position: fixed; z-index: 2; top: 0; right: 0; left: 252px; width: auto; margin: 0; padding: 0 36px; transform: none; background: transparent; }

@media (max-width: 760px) {
  .packet-hub { padding: 58px 0 63px; }
  .modality-overview { padding: 18px 16px; }
  .outcome-grid { grid-template-columns: 1fr; }
  .category-panel { padding: 17px; }
  .category-grid { grid-template-columns: 1fr; }
  body:has(.learning-shell) { overflow: auto; }
  body:has(.learning-shell) .site-header { position: relative; right: auto; left: auto; width: min(calc(100% - 28px), 1120px); margin: auto; padding: 0; transform: none; }
  .learning-shell { position: relative; top: auto; right: auto; bottom: auto; left: auto; display: grid; grid-template-columns: 1fr; gap: 12px; width: min(100% - 34px, 1120px); margin: auto; padding: 20px 0 0; overflow: visible; }
  .sidebar-toggle { display: inline-flex; align-items: center; gap: 9px; width: 100%; padding: 13px 15px; color: var(--cyan); border: 1px solid rgba(46, 234, 255, .3); background: rgba(46, 234, 255, .05); font: .71rem "DM Mono", monospace; cursor: pointer; }
  .guide-sidebar { position: relative; top: 0; bottom: auto; width: auto; display: none; border: 1px solid rgba(46, 234, 255, .2); }
  .sidebar-brand { padding: 22px 21px 18px; }
  .guide-sidebar.is-open { display: flex; }
  .lesson-content { min-height: auto; padding: 28px 21px 38px; }
  .topology-card { margin-top: 24px; padding: 15px 10px; }
  .topology-node { transform: translate(-50%, -34%); }
  .topology-link { top: calc(50% - 42px); }
  .topology-legend { margin-bottom: 16px; }
  .topology-legend span { gap: 6px; padding: 8px 7px; font-size: .63rem; }
  .topology-legend i { width: 26px; }
  .topology-caption { padding: 0 5px; }
  .stp-practice-topology .topology-map { min-height: 335px; }
  .stp-practice-topology .practice-switch { width: 31%; }
  .stp-practice-topology .practice-pc { width: 22%; }
  .stp-practice-topology .practice-bottom-switch .practice-node-copy { width: 72px; }
  .stp-practice-topology .practice-sw3 .practice-node-copy { right: calc(50% - 1px); }
  .stp-practice-topology .practice-sw4 .practice-node-copy { left: calc(50% - 1px); }
  .stp-practice-topology .practice-bottom-switch .practice-node-copy small { line-height: 1.25; }
  .lesson-actions { flex-direction: column; }
  .lesson-content > footer { width: 100%; margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), .guide-sidebar, .lesson-content { animation: none; }
}
