/* Networking: estilos propios de la guía (globo, espectro, capas, encapsulado y viaje del paquete, más los recuadros y las tablas de riesgo).
   Lo común de las guías con índice lateral viene de /css/base.css y /css/guide-kit.css; se carga después de ellos. */
/* Portada */
.globe { margin: 0; min-width: 0; display: grid; gap: 10px; justify-items: center; }
.globe-stage { position: relative; width: 100%; max-width: 520px; }
.gl { position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; white-space: nowrap; line-height: 1.25; font-size: 12.5px; color: #0B1330; background: var(--surface); border: 1px solid rgba(0, 0, 0, .16); border-radius: 6px; padding: 3px 7px 4px; box-shadow: 0 1px 4px rgba(11, 19, 48, .10); -webkit-font-smoothing: auto; }
.gl b { display: block; font-family: var(--font-mono); font-weight: 700; font-size: .95em; text-transform: uppercase; letter-spacing: .07em; }
.gl span { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 11.5px; }
:root[data-theme="dark"] .gl { color: #F2F6FF; border-color: rgba(255, 255, 255, .22); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gl { color: #F2F6FF; border-color: rgba(255, 255, 255, .22); }
}
@media (max-width: 640px) {
  .gl { font-size: 11.5px; }
  .gl span { font-size: 11px; }
}
.globe canvas { display: block; width: 100%; aspect-ratio: 4 / 3; cursor: grab; touch-action: pan-y; border-radius: 16px; }
/* Diseño principal */
.sub { display: grid; gap: 16px; margin-top: 18px; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.sub > * { margin: 0; min-width: 0; }
/* El recuadro de la introducción cuelga directo de un h2, así que su título es un h3 con el aspecto de los h4 */
.kicker { font-weight: 700; margin-bottom: -8px; }
.sub .table-wrap { background: var(--sea); }
/* Texto solo para lectores de pantalla (la esquina de las tablas comparativas) */
td.risk-yes { color: var(--f-orange); font-weight: 700; }
/* Widget: espectro */
.wave { display: block; width: 100%; height: 120px; border-radius: 10px; background: var(--sea); }
.band-area { display: grid; gap: 6px; }
.ion { position: relative; height: 18px; font-size: .78rem; color: var(--muted); }
.ion span { position: absolute; left: 65.9%; top: 0; border-left: 2px dashed var(--f-orange); padding-left: 6px; color: var(--f-orange); font-weight: 700; white-space: nowrap; height: 40px; }
/* En pantallas angostas el texto no entra a la derecha de la línea y ensanchaba la página: pasa a la izquierda */
@media (max-width: 640px) { .ion span { left: auto; right: 34.1%; border-left: 0; border-right: 2px dashed var(--f-orange); padding-left: 0; padding-right: 6px; text-align: right; } }
.band { position: relative; height: 46px; border-radius: 8px; cursor: crosshair; touch-action: none; }
.band .cursor { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; pointer-events: none; box-shadow: 0 0 0 2px var(--surface); }
.ticks { position: relative; height: 18px; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.energy { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.sp-info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.sp-ex { margin: 0 0 8px; color: var(--muted); }
.sp-txt { margin: 0; }
.sp-data { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: .92rem; }
.sp-data dt { color: var(--muted); }
.sp-data dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-data dd.danger { color: var(--f-orange); }
/* Widget: capas */
.layers-wrap { display: grid; gap: 14px; }
.layers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(7, minmax(40px, auto)); gap: 6px 10px; }
.col-head { font-family: var(--font-display); font-variation-settings: "wdth" 100; font-weight: 700; font-size: .86rem; color: var(--muted); display: flex; justify-content: space-between; }
.layer { font: inherit; font-size: .92rem; text-align: left; border: 1px solid var(--rule); background: var(--sea); color: var(--ink); border-radius: 8px; padding: .45rem .7rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: background-color .2s, color .2s, border-color .2s; }
.layer .num { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.layer.tcp { justify-content: center; font-weight: 700; }
.layer.lit { background: color-mix(in srgb, var(--strand) 16%, var(--sea)); border-color: var(--strand); }
.layer.active { background: var(--strand); border-color: var(--strand); color: var(--on-strand); }
.layer.active .num { color: var(--on-strand); }
.layer-detail { background: var(--tint); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; }
.layer-detail h4 { margin: 0; font-family: var(--font-display); font-variation-settings: "wdth" 110; font-size: 1.1rem; }
.layer-detail p { margin: 0; }
.layer-detail .meta { font-size: .9rem; color: var(--muted); }
.layer-detail .meta b { color: var(--ink); }
.enc { display: grid; gap: 8px; }
.enc-row { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr) 5.6rem; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; transition: background-color .3s, border-color .3s; }
.enc-row.on { background: var(--tint); border-color: var(--strand); }
.enc-row .lname { font-size: .86rem; color: var(--muted); }
.enc-row .pdu { font-family: var(--font-display); font-variation-settings: "wdth" 100; font-weight: 700; font-size: .88rem; text-align: right; }
.blocks { display: flex; gap: 3px; flex-wrap: wrap; min-width: 0; }
.blk { font-family: var(--font-mono); font-size: .74rem; padding: .28rem .5rem; border-radius: 5px; color: var(--on-strand); white-space: nowrap; }
.blk.d { background: var(--f-slate); }
.blk.t { background: var(--f-orange); }
.blk.i { background: var(--f-green); }
.blk.e { background: var(--f-blue); }
.bits { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enc-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Widget: viaje */
.journey { --strand: var(--f-aqua); }
.track { position: relative; height: 54px; margin-inline: 14px; }
.track .line { position: absolute; left: 0; right: 0; top: 26px; height: 3px; background: var(--rule); border-radius: 2px; }
.track .fill { position: absolute; left: 0; top: 26px; height: 3px; background: var(--strand); border-radius: 2px; width: 0; transition: width .8s ease; }
.track .stop { position: absolute; top: 14px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; border: 2px solid var(--rule); background: var(--surface); font: 700 .78rem var(--font-display); color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; transition: border-color .3s, background-color .3s, color .3s; }
.track .stop.done { border-color: var(--strand); color: var(--ink); }
.track .stop.on { background: var(--strand); border-color: var(--strand); color: var(--on-strand); }
.track .pkt { position: absolute; top: 20px; width: 15px; height: 15px; margin-left: -7.5px; border-radius: 50%; background: var(--strand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--strand) 25%, transparent), 0 0 18px var(--strand); transition: left .8s ease; pointer-events: none; z-index: 2; opacity: 0; }
.steps .go { font-size: .85rem; color: var(--muted); }
/* Teléfono y tablet */
@media (max-width: 640px) {
  .sp-info { grid-template-columns: minmax(0, 1fr); }
  .enc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .enc-row .lname { grid-column: 1; }
  .enc-row .pdu { grid-column: 2; grid-row: 1; }
  .enc-row .blocks, .enc-row .bits { grid-column: 1 / -1; }
  .layers { gap: 5px 6px; }
  .layer { font-size: .84rem; padding: .4rem .5rem; }
  .sub { padding: 16px; }
}
