/* Packet Lab + presentation staging — scoped to avoid changing legacy dashboard. */
#packetlab-launch {margin-left:6px;display:inline-flex;align-items:center;gap:7px;border:1px solid #52749c;
 background:linear-gradient(135deg,#17334b,#12304a);color:#e9f5ff;border-radius:7px;
 padding:8px 12px;cursor:pointer;font:600 11px system-ui;box-shadow:0 2px 12px #0003}
#packetlab-launch:hover{border-color:#79c7ee;transform:translateY(-1px)}
#presentation-launch {display:inline-flex;align-items:center;gap:7px;border:1px solid #876a46;
 background:linear-gradient(135deg,#36281d,#27231f);color:#ffe4ba;border-radius:7px;
 padding:8px 12px;cursor:pointer;font:600 11px system-ui}
#presentation-launch:hover{border-color:#ffc778}
.packetlab-overlay,.stage-overlay{position:fixed;inset:0;z-index:5500;background:#060c17dd;
 backdrop-filter:blur(9px);display:flex;align-items:center;justify-content:center;padding:22px;color:#e9f1ff}
.packetlab-overlay[hidden],.stage-overlay[hidden]{display:none}
.packetlab-dialog{width:min(1040px,98vw);max-height:min(860px,95vh);overflow:auto;
 border:1px solid #46607e;border-radius:18px;background:linear-gradient(135deg,#142235,#0c1421 70%);
 box-shadow:0 35px 120px #000a;padding:26px;display:grid;gap:18px}
.packetlab-heading{display:flex;align-items:start;justify-content:space-between;gap:16px}
.packetlab-kicker,.stage-kicker{color:#7bc7ee;text-transform:uppercase;letter-spacing:2.4px;font-size:10px;font-weight:800}
.packetlab-heading h2,.stage-panel h2{font-size:clamp(22px,3vw,33px);line-height:1.14;margin:7px 0;font-weight:800;letter-spacing:-.6px}
.packetlab-muted{color:#a7b8cc;line-height:1.6;font-size:12px}
.packetlab-close,.stage-close{border:1px solid #49576d;background:#162236;color:#dbe9f7;border-radius:9px;
 padding:9px 13px;cursor:pointer;font:700 12px system-ui}
.packetlab-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.packetlab-controls label{display:grid;gap:6px;color:#a8bbd0;font-size:11px;font-weight:700}
.packetlab-controls select,.packetlab-controls input{width:100%;min-width:0;border:1px solid #3a536b;
 background:#101d2f;color:#eef8ff;border-radius:8px;padding:11px;font:500 13px system-ui}
.packetlab-presets{display:flex;flex-wrap:wrap;gap:9px;align-items:center}
.packetlab-btn{border:1px solid #3f5d76;background:#20354f;color:#e8f4ff;border-radius:8px;
 padding:10px 14px;font:700 12px system-ui;cursor:pointer;transition:background .2s,transform .2s}
.packetlab-btn:hover{background:#2e5375;transform:translateY(-1px)}
.packetlab-btn.primary{background:#09789a;border-color:#30b7d7}
.packetlab-btn.danger{border-color:#9c5360;background:#4c2433;color:#ffdce1}
.packetlab-btn[disabled]{cursor:not-allowed;opacity:.4}
.packetlab-result{border-radius:13px;border:1px solid #3a5670;background:#101f31;padding:18px}
.packetlab-result.allowed{border-color:#2c866f;background:#102d29}
.packetlab-result.denied{border-color:#a25865;background:#301b27}
.packetlab-result-title{font-size:16px;font-weight:800;display:flex;justify-content:space-between;gap:8px}
.packetlab-trace{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin-top:16px}
.packetlab-hop{border:1px solid #36536d;background:#162b42;border-radius:9px;padding:12px;min-height:95px}
.packetlab-hop.blocked{border-color:#9b4e5b;background:#3c2130}
.packetlab-hop-title{font-size:12px;font-weight:800;margin-bottom:8px}
.packetlab-hop-detail{color:#a8bad0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.packetlab-footnote{color:#90a4bc;font-size:11px;line-height:1.5;border-top:1px solid #284055;padding-top:10px}
.stage-overlay{z-index:5600;background:radial-gradient(circle at 50% 10%,#123551,#060c17 70%);padding:28px}
.stage-panel{width:min(1160px,95vw);height:min(720px,93vh);display:flex;flex-direction:column;gap:24px;
 border:1px solid #42617b;border-radius:23px;background:#0c1727e8;padding:clamp(22px,4vw,46px);
 box-shadow:0 50px 150px #000c}
.stage-top{display:flex;justify-content:space-between;align-items:center;gap:16px}
.stage-content{flex:1;display:grid;grid-template-columns:1.25fr .75fr;align-items:center;gap:30px}
.stage-panel h2{font-size:clamp(34px,5vw,64px);margin:16px 0;line-height:1.08}
.stage-description{font-size:clamp(15px,1.7vw,22px);color:#b9c9dc;max-width:690px;line-height:1.5}
.stage-facts{display:grid;gap:12px}
.stage-fact{border:1px solid #34526f;border-radius:12px;background:#142b43;padding:20px;
 font-size:16px;font-weight:700}
.stage-nav{display:flex;align-items:center;justify-content:space-between;gap:12px}
.stage-progress{color:#a8c7df;font-size:13px}
.stage-footer{border-top:1px solid #365169;padding-top:12px;color:#82a0bd;font-size:12px}
@media(max-width:700px){
 .packetlab-overlay,.stage-overlay{padding:8px}
 .packetlab-dialog{padding:16px;max-height:97vh;border-radius:10px}
 .packetlab-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
 .packetlab-trace{grid-template-columns:repeat(2,minmax(0,1fr))}
 .stage-panel{height:96vh;padding:18px;border-radius:10px}
 .stage-content{grid-template-columns:1fr;gap:12px;align-content:start}
 .stage-facts{grid-template-columns:repeat(2,1fr)}
 .stage-panel h2{font-size:clamp(24px,7vw,38px)}
 .stage-fact{padding:12px;font-size:13px}
}

/* Progress-review speaker UI. Notes are opt-in and never part of the projected
 * scenes by default; no PowerPoint, and no overflow on a classroom projector. */
.stage-panel{overflow-y:auto}
.stage-content{min-height:0}
.stage-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:24px;align-items:center}
.stage-actions .packetlab-btn{text-decoration:none;display:inline-flex;align-items:center}
.stage-speaker-notes{border:1px solid #4b657f;background:#14283e;color:#d5e8f5;
 border-radius:12px;padding:14px 18px;max-height:150px;overflow-y:auto;
 flex-shrink:0;font-size:12px;line-height:1.55}
.stage-speaker-notes strong{display:block;margin-bottom:7px;color:#91ddf5}
.stage-speaker-notes[hidden],#stage-ci[hidden]{display:none!important}
@media(max-width:700px){
 .stage-content{grid-template-columns:1fr;overflow-y:auto;align-items:start}
 .stage-actions{margin-top:12px}
 .stage-facts{grid-template-columns:repeat(2,1fr)}
 .stage-speaker-notes{max-height:125px;padding:10px;font-size:11px}
 .stage-actions .packetlab-btn{font-size:11px;padding:8px}
}

/* The packet tool is now inside "Ver topología interna completa".
 * No second simulator window or competing dashboard controls. */
#sm-packet-host{width:100%;min-width:0;padding:8px 3px 18px}
#sm-packet-host .packetlab-dialog{width:100%;max-height:none;overflow:visible;
 border:1px solid #385775;box-shadow:none;border-radius:12px;
 padding:clamp(14px,2vw,24px);margin:0}
#sm-packet-host .packetlab-controls{grid-template-columns:repeat(3,minmax(0,1fr))}
#sm-packet-host #pl-site:disabled{opacity:.72;cursor:not-allowed}
#sm-packet-host .packetlab-heading h2{font-size:clamp(20px,2.5vw,29px)}
#sm-packet-host .packetlab-result{margin-top:3px}
@media(max-width:780px){
 #sm-packet-host .packetlab-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
 #sm-packet-host .packetlab-trace{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:450px){
 #sm-packet-host .packetlab-controls{grid-template-columns:1fr}
}

/* Polish after moving Packet Lab into the original site modal.
 * Avoid inherited dashboard text metrics and label/status collisions. */
#sm-packet-host,#sm-packet-host *{box-sizing:border-box}
#sm-packet-host .packetlab-dialog{display:flex;flex-direction:column;gap:18px;min-width:0}
#sm-packet-host .packetlab-dialog > *{min-width:0;max-width:100%}
#sm-packet-host .packetlab-heading{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px}
#sm-packet-host .packetlab-heading > div{min-width:0;flex:1 1 260px}
#sm-packet-host .packetlab-heading h2{line-height:1.2;overflow-wrap:break-word}
#sm-packet-host .packetlab-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:14px}
#sm-packet-host .packetlab-controls label{min-width:0;max-width:100%;line-height:1.45;
 display:flex;flex-direction:column;gap:7px;overflow-wrap:break-word}
#sm-packet-host .packetlab-controls select,
#sm-packet-host .packetlab-controls input{min-width:0;width:100%;max-width:100%;height:43px;
 line-height:normal;text-overflow:ellipsis}
#sm-packet-host .packetlab-controls input[readonly]{color:#91d9b5}
#sm-packet-host .packetlab-presets{display:flex;flex-wrap:wrap;gap:9px;justify-content:flex-start}
#sm-packet-host .packetlab-presets .packetlab-btn{flex:0 1 auto;min-height:40px;
 white-space:normal;text-align:center;line-height:1.35}
#sm-packet-host .packetlab-result{min-width:0;width:100%;position:relative;
 display:flex;flex-direction:column;gap:10px;overflow:visible}
#sm-packet-host .packetlab-result-title{display:flex;align-items:center;
 justify-content:space-between;flex-wrap:wrap;gap:10px;min-width:0;line-height:1.4}
#sm-packet-host #pl-verdict{display:block;flex:1 1 170px;min-width:0;overflow-wrap:anywhere;
 font-size:clamp(15px,1.9vw,20px);line-height:1.3}
#sm-packet-host #pl-state{display:block;flex:0 1 auto;max-width:100%;
 font-size:11px;font-weight:700;line-height:1.35;letter-spacing:.35px;
 padding:5px 10px;border:1px solid #57778b;border-radius:8px;
 white-space:normal;overflow-wrap:anywhere;text-align:right}
#sm-packet-host #pl-reason{margin:0;max-width:100%;line-height:1.6;overflow-wrap:anywhere}
#sm-packet-host .packetlab-execution{color:#b8d5e9;font-size:11px;font-weight:700;
 line-height:1.5;letter-spacing:.2px;overflow-wrap:anywhere;
 padding:8px 11px;border:1px solid #37526a;border-radius:7px;background:#152a3e}
#sm-packet-host .packetlab-trace{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));
 gap:10px;margin-top:5px;min-width:0}
#sm-packet-host .packetlab-hop{min-width:0;height:auto;min-height:104px;overflow:visible;
 display:flex;flex-direction:column;gap:9px}
#sm-packet-host .packetlab-hop-title{margin:0;color:#a0edbd;
 line-height:1.5;min-width:0;overflow-wrap:anywhere;word-break:normal}
#sm-packet-host .packetlab-hop.blocked .packetlab-hop-title{color:#ff9aa9}
#sm-packet-host .packetlab-hop-detail{font-size:11px;line-height:1.55;min-width:0;
 overflow-wrap:anywhere;word-break:normal}
#sm-packet-host .packetlab-footnote{margin:0;line-height:1.55}
#sm-packet-host .packetlab-result.packetlab-updated{
 animation:packetlab-result-flash .65s ease-out}
#sm-packet-host .packetlab-result.packetlab-updated .packetlab-hop{
 animation:packetlab-hop-reveal .35s ease-out both}
#sm-packet-host .packetlab-result.packetlab-updated .packetlab-hop:nth-child(2){animation-delay:.055s}
#sm-packet-host .packetlab-result.packetlab-updated .packetlab-hop:nth-child(3){animation-delay:.11s}
#sm-packet-host .packetlab-result.packetlab-updated .packetlab-hop:nth-child(4){animation-delay:.165s}
#sm-packet-host .packetlab-result.packetlab-updated .packetlab-hop:nth-child(5){animation-delay:.22s}
@keyframes packetlab-result-flash{0%{box-shadow:0 0 0 3px #39bde879}
 100%{box-shadow:0 0 0 0 transparent}}
@keyframes packetlab-hop-reveal{from{opacity:.45;transform:translateY(5px)}
 to{opacity:1;transform:translateY(0)}}
/* Long green WAN state no longer overlays topology instructions/buttons. */
#sm-body .topo-toolbar{flex-wrap:wrap;row-gap:9px;min-height:48px;height:auto}
#sm-body .topo-toolbar > *{min-width:0}
#sm-body .topo-toolbar .topo-state{overflow-wrap:anywhere;white-space:normal;
 max-width:100%;line-height:1.5;margin-left:0}
#sm-body .topo-toolbar .topo-zoom{flex-wrap:wrap;gap:4px}
@media(max-width:800px){
 #sm-packet-host .packetlab-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
 #sm-packet-host .packetlab-trace{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:510px){
 #sm-packet-host .packetlab-controls{grid-template-columns:1fr}
 #sm-packet-host .packetlab-trace{grid-template-columns:1fr}
 #sm-packet-host #pl-state{text-align:left}
 #sm-body .topo-toolbar .topo-zoom{margin-left:0}
}
@media(prefers-reduced-motion:reduce){
 #sm-packet-host .packetlab-updated,
 #sm-packet-host .packetlab-updated .packetlab-hop{animation:none!important}
}
