/* Aula Viva · estilos del bloque 4 (prefijo b4-) */

/* ---------- diagrama: lo que configuras / lo que existe ---------- */
.b4-rel { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.b4-pane { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; min-width: 0; }
.b4-pane { display: flex; flex-direction: column; }
.b4-pane h4 { font-size: 16px; margin: 0 0 8px; }
.b4-pane > svg.b4-hw { margin: auto 0; }
.b4-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font: 700 13px var(--display); color: var(--muted); }
.b4-mid i { display: block; width: 100%; height: 0; border-top: 3px dashed var(--muted); position: relative; }
.b4-mid i::after { content: ""; position: absolute; right: -2px; top: -8px; border: 6px solid transparent; border-left: 9px solid var(--muted); }
svg.b4-hw { width: 100%; height: auto; display: block; }
.b4-win { fill: var(--surface2); stroke: var(--line); stroke-width: 1.5; }
.b4-bar { fill: var(--accent); }
.b4-tb { fill: var(--accent-fg); font-family: var(--body); font-weight: 700; }
.b4-cell { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.b4-hl { fill: var(--accent-a); stroke: var(--accent); stroke-width: 1.5; }
.b4-tx { fill: var(--fg); font-family: var(--body); }
.b4-b { font-weight: 700; }
.b4-i { font-style: italic; }
.b4-mono { font-family: var(--mono); }
.b4-line { fill: none; stroke: var(--fg); stroke-width: 1.6; }
.b4-bus { fill: none; stroke: var(--fg); stroke-width: 3.2; }
.b4-dev { fill: var(--surface); stroke: var(--fg); stroke-width: 1.4; }
.b4-ic { fill: var(--c2); stroke: var(--fg); stroke-width: 1; }
.b4-bd { fill: var(--c3); stroke: var(--navy); stroke-width: 1.3; }
.b4-bt { fill: var(--navy); font-family: var(--display); font-weight: 700; }

.b4-eq { display: flex; flex-direction: column; align-items: center; gap: 0; }
.b4-r1 { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; width: 100%; }
.b4-r2 { display: flex; justify-content: space-around; width: 70%; }
.b4-r3 { display: flex; align-items: flex-end; justify-content: center; gap: 14px; flex-wrap: wrap; width: 100%; }
.b4-it { position: relative; text-align: center; max-width: 100%; }
.b4-cp { font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.b4-badge { position: absolute; top: -6px; left: -6px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; background: var(--c3); color: var(--navy); border: 2px solid var(--navy); font: 700 14px/20px var(--display); text-align: center; }
.b4-cab { display: block; width: 6px; height: 26px; background: #2FA84F; border: 1.5px solid #14532b; border-radius: 3px; flex: none; }
.b4-cab.b4-h { width: 26px; height: 6px; margin: 0 -2px; }

/* ---------- PG y CPU (4.4) ---------- */
.b4-pc { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; }
.b4-link { display: flex; align-items: center; }

/* ---------- laboratorio de nombres (4.2) ---------- */
.b4-h3 { font-size: 16px; margin: 14px 0 6px; }
.b4-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.b4-card { background: var(--surface2); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; text-align: center; min-width: 0; }
.b4-card-d { width: 100%; max-width: 170px; margin: 0 auto; }
.b4-plate { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 6px; background: var(--c2); color: var(--navy); font-weight: 600; font-size: 14px; border: 1.5px solid var(--navy); max-width: 100%; overflow-wrap: anywhere; }
.b4-plate-empty { background: transparent; color: var(--muted); border-style: dashed; font-family: var(--body); }
.b4-mini { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.4; text-align: left; overflow-wrap: anywhere; }
.b4-mini b { color: var(--fg); }
.b4-tbl { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
table.b4-t { width: 100%; border-collapse: collapse; }
table.b4-t td, table.b4-t th { padding: 6px 10px; }
.b4-rowbtn { border: 2px solid var(--line); background: var(--surface); border-radius: 8px; padding: 3px 10px; text-align: left; overflow-wrap: anywhere; }
.b4-rowbtn:hover { border-color: var(--accent); }
.b4-rowsel .b4-rowbtn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-a); }
.b4-rowbad { background: var(--bad-bg); }
.b4-st { font-weight: 700; white-space: nowrap; }
.b4-st-ok { color: var(--ok); } .b4-st-bad { color: var(--bad); } .b4-st-n { color: var(--muted); }
.b4-q { margin-top: 12px; }
.b4-qq { font: 700 17px var(--display); margin: 0 0 4px; }

/* ---------- laboratorio de carga (4.3) ---------- */
.b4-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 8px; }
.b4-fixed, .b4-sel { background: var(--surface2); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.b4-fixed span, .b4-sel span { font-size: 13.5px; color: var(--muted); }
.b4-fixed b { font: 700 20px var(--display); }
.b4-sel select { font: 700 18px var(--mono); padding: 4px 8px; border-radius: 8px; border: 2px solid var(--fg); background: var(--surface); color: var(--fg); }
.b4-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.b4-big { border-left: 5px solid var(--c); padding: 2px 0 2px 12px; }
.b4-big span { display: block; font-size: 13.5px; color: var(--muted); }
.b4-big b { font: 700 22px var(--display); overflow-wrap: anywhere; }
.b4-bar2 { position: relative; height: 22px; margin-top: 14px; border-radius: 99px; background: var(--surface2); border: 1.5px solid var(--line); overflow: hidden; }
.b4-fill { display: block; height: 100%; border-radius: 99px 0 0 99px; transition: width .25s; }
.b4-v-comodo { background: var(--ok); } .b4-v-ajustado { background: var(--c3); } .b4-v-pasado, .b4-v-imposible { background: var(--bad); }
.b4-bar2 u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--fg); opacity: .55; }
.b4-bar-l { position: relative; height: 18px; font: 500 12px var(--mono); color: var(--muted); }
.b4-bar-l span { white-space: nowrap; position: absolute; top: 2px; transform: translateX(-50%); }
.b4-bar-l span:last-child { transform: translateX(-100%); }
.b4-verd { margin: 6px 0 0; font-size: 17px; }
.b4-vt-comodo b { color: var(--ok); } .b4-vt-pasado b, .b4-vt-imposible b { color: var(--bad); }
.b4-det { margin-top: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface2); }
.b4-det summary { cursor: pointer; padding: 8px 12px; font-weight: 600; }
.b4-det div { padding: 0 12px 10px; font-size: 15px; color: var(--muted); }

/* ---------- comparación: CPU con bastidor (A) / IM-CPU sin bastidor (B) ---------- */
.b4-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.b4-cc { background: var(--surface2); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; min-width: 0; display: flex; flex-direction: column; }
.b4-cch { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.b4-cch b { display: block; font: 700 17px var(--display); }
.b4-cch small { display: block; color: var(--muted); font-size: 14px; }
.b4-cl { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 17px var(--display); color: var(--navy); border: 2px solid var(--navy); }
.b4-cc-a .b4-cl { background: var(--c2); }
.b4-cc-b .b4-cl { background: var(--c3); }
.b4-cd { position: relative; padding: 22px 0 24px; max-width: 340px; width: 100%; margin: 0 auto; }
.b4-nb { position: absolute; transform: translateX(-50%); white-space: nowrap; font: 700 12.5px/1 var(--mono); color: var(--navy); background: var(--c6); border: 1.5px solid var(--navy); border-radius: 99px; padding: 3px 9px; }
.b4-nb-t { top: 0; }
.b4-nb-b { bottom: 0; }
.b4-cs { margin: 8px 0 0; padding-left: 22px; font-size: 15.5px; line-height: 1.4; }
.b4-cs li { margin: 3px 0; }
.b4-cs li::marker { font-weight: 700; color: var(--muted); }

/* ---------- laboratorio: Arma tu estación en HW Config ---------- */
.b4-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.b4-tab { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 14px 5px 6px; font-weight: 700; }
.b4-tab[aria-pressed="true"] { border-color: var(--fg); background: var(--surface2); }
.b4-tl { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--display); background: var(--c2); color: var(--navy); border: 1.5px solid var(--navy); }
.b4-tab[data-case="B"] .b4-tl { background: var(--c3); }
.b4-tok { color: var(--ok); }
.b4-goal { margin: 10px 0 0; color: var(--muted); max-width: 70ch; }
.b4-fbx { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface2); border-left: 5px solid var(--line); min-height: 42px; }
.b4-fbx.ok { border-left-color: var(--ok); } .b4-fbx.bad { border-left-color: var(--bad); }
.b4-hwl { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; margin-top: 10px; align-items: start; }
.b4-stw, .b4-cat { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; min-width: 0; }
.b4-wbar { background: var(--accent); color: var(--accent-fg); font: 700 14px var(--body); padding: 5px 12px; }
.b4-wbody { padding: 10px; background: var(--surface2); min-height: 250px; }
.b4-drop { width: 100%; min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 14px; border: 2px dashed var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.b4-drop b { color: var(--fg); font: 700 16px var(--display); }
.b4-drop span { font-size: 15px; }
.b4-rk { font: 700 14px var(--display); margin: 0 0 6px; }
.b4-slots { display: flex; flex-direction: column; gap: 4px; }
.b4-slot, .b4-row, .b4-sub { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; text-align: left; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); padding: 7px 10px; min-height: 40px; }
.b4-slot i { color: var(--muted); }
.b4-slot.f, .b4-row.f { background: var(--ok-bg); border-color: var(--ok); }
.b4-sn { font: 700 14px var(--mono); color: var(--muted); }
.b4-sm { font-weight: 600; overflow-wrap: anywhere; }
.b4-sr { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.b4-sub { min-height: 32px; padding: 3px 10px; border-style: dashed; background: transparent; font-style: italic; color: var(--muted); font-size: 14.5px; }
.b4-sub.nx { border-color: var(--accent); border-style: solid; background: var(--accent-a); color: var(--fg); font-style: normal; font-weight: 700; }
.b4-slot.tgt, .b4-drop.tgt { border-color: var(--accent); border-style: dashed; box-shadow: 0 0 0 3px var(--accent-a); cursor: pointer; }
.b4-slot:not(.f):hover, .b4-drop:hover { border-color: var(--accent); }
.b4-note { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.b4-cath { background: var(--surface2); border-bottom: 1.5px solid var(--line); font: 700 14px var(--body); padding: 5px 12px; }
.b4-find { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; font-size: 14px; color: var(--muted); }
.b4-find input { flex: 1; min-width: 0; font: 500 15px var(--body); padding: 5px 9px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
.b4-tree { padding: 4px 0 8px; max-height: 360px; overflow-y: auto; }
.b4-cf { font-weight: 700; font-size: 14.5px; padding-top: 3px; padding-bottom: 3px; padding-right: 8px; color: var(--muted); }
.b4-ci { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 3px; padding-bottom: 3px; padding-right: 8px; margin: 1px 6px; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer; font-size: 15.5px; user-select: none; }
.b4-ci small { font: 500 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
.b4-ci:hover { border-color: var(--accent); }
.b4-ci.sel { background: var(--accent-a); border-color: var(--accent); font-weight: 700; }
.b4-none { margin: 8px 12px; color: var(--muted); font-size: 14.5px; }
.b4-resc { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; margin-top: 14px; padding: 14px; border: 2px solid var(--ok); border-radius: 14px; background: var(--ok-bg); align-items: center; }
.b4-resd { min-width: 0; text-align: center; }
.b4-resd .b4-cp { margin-top: 4px; }
.b4-rest h4 { font-size: 18px; margin-bottom: 4px; }
.b4-rest ul { margin: 0 0 8px; padding-left: 20px; }
.b4-rest p { margin: 0 0 4px; }

/* ---------- catálogo de ejemplo (mini-reto GSD) ---------- */
svg.b4-tr { display: block; width: 100%; height: auto; }
.b4-trbg { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.b4-trf { fill: var(--c3); stroke: var(--navy); stroke-width: 1; }
.b4-tri { fill: var(--c2); stroke: var(--navy); stroke-width: 1; }

@media (max-width: 760px) {
  .b4-cmp { grid-template-columns: minmax(0, 1fr); }
  .b4-hwl { grid-template-columns: minmax(0, 1fr); }
  .b4-resc { grid-template-columns: minmax(0, 1fr); }
  .b4-tree { max-height: 300px; }
  .b4-rel { grid-template-columns: minmax(0, 1fr); }
  .b4-mid { flex-direction: row; justify-content: center; }
  .b4-mid i { width: 0; height: 34px; border-top: 0; border-left: 3px dashed var(--muted); }
  .b4-mid i::after { right: auto; left: -8px; top: auto; bottom: -4px; border: 6px solid transparent; border-top: 9px solid var(--muted); border-left-color: transparent; }
  .b4-pc { flex-direction: column; }
  .b4-link { flex-direction: column; }
  .b4-link .b4-cab.b4-h { width: 6px; height: 22px; margin: -2px 0; }
}

/* tablas de 3 o más columnas: en pantallas chicas se deslizan en vez de apretar el texto */
@media (max-width: 720px) {
  .b4-wt td, .b4-wt th { min-width: 150px; }
  .b4-wt td:first-child, .b4-wt th:first-child { min-width: 96px; }
}
