/* ── Visuales de flujo: despacho, auto-resolución y capas ─────────────── */
.mb-wire { fill: none; stroke: #fff; stroke-opacity: .2; stroke-width: 1; vector-effect: non-scaling-stroke; }

/* despacho */
.mb-dispatch { margin: 0; width: 100%; }
.mb-dispatch-scene { position: relative; width: 100%; min-height: 560px; }
.mb-dispatch-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mb-packet { fill: none; stroke: #ff4a3d; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 12 88; stroke-dashoffset: 100; opacity: 0; stroke-linecap: round; }
.mb-dispatch[data-selected="0"] .mb-dispatch-route-0 .mb-wire, .mb-dispatch[data-selected="1"] .mb-dispatch-route-1 .mb-wire, .mb-dispatch[data-selected="2"] .mb-dispatch-route-2 .mb-wire, .mb-dispatch[data-selected="3"] .mb-dispatch-route-3 .mb-wire { stroke: #ff4a3d; stroke-opacity: .55; }
.mb-dispatch[data-selected="0"] .mb-dispatch-route-0 .mb-packet, .mb-dispatch[data-selected="1"] .mb-dispatch-route-1 .mb-packet, .mb-dispatch[data-selected="2"] .mb-dispatch-route-2 .mb-packet, .mb-dispatch[data-selected="3"] .mb-dispatch-route-3 .mb-packet { opacity: 1; animation: mb-flow 2s linear infinite; }
@keyframes mb-flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.mb-dispatch-source { position: absolute; left: 7.5%; right: 7.5%; top: 0; padding: 16px 18px; border: 1px solid rgba(255,255,255,.14); border-left: 3px solid #ff4a3d; background: #0b0b0c; }
.mb-dispatch-source > div { display: flex; align-items: center; gap: 8px; font: 600 11px/1 var(--mono, ui-monospace, monospace); letter-spacing: .14em; text-transform: uppercase; color: #ff4a3d; }
.mb-dispatch-source p { margin: 10px 0 0; font-size: 15px; font-weight: 600; color: #fff; }
.mb-dispatch-source code { display: block; margin-top: 6px; font: 500 11px/1.4 var(--mono, ui-monospace, monospace); color: #9a9da9; }
.mb-dispatch-tool { position: absolute; top: 42%; width: 20%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px; border: 0; background: transparent; cursor: pointer; color: #a7aabb; font: 500 12px/1.5 var(--mono, ui-monospace, monospace); letter-spacing: .04em; }
.mb-dispatch-tool-0 { left: 14.4%; } .mb-dispatch-tool-1 { left: 37.9%; } .mb-dispatch-tool-2 { left: 62.1%; } .mb-dispatch-tool-3 { left: 85.6%; }
.mb-dispatch-plate { display: grid; place-items: center; width: 68px; height: 68px; border: 1px solid rgba(255,255,255,.14); background: #0a0a0a; box-shadow: 5px 5px 0 rgba(255,255,255,.08); color: #fff; transition: transform .3s, box-shadow .3s, border-color .3s; }
.mb-dispatch-plate img { width: 30px; height: 30px; object-fit: contain; filter: brightness(0) invert(1); }
.mb-dispatch-tool[aria-pressed="true"] .mb-dispatch-plate { border-color: #ff4a3d; box-shadow: 5px 7px 0 rgba(255,74,61,.22), 0 0 30px rgba(255,74,61,.12); transform: perspective(600px) rotateX(8deg) rotateY(-8deg); }
.mb-dispatch-tool[aria-pressed="true"] > span:last-child { color: #ff4a3d; }
.mb-dispatch-preview { position: absolute; left: 7.5%; right: 7.5%; bottom: 0; min-height: 140px; padding: 16px 18px; border: 1px solid rgba(255,255,255,.14); background: #0b0b0c; box-shadow: 6px 6px 0 rgba(255,255,255,.05); }
.mb-dispatch-pv { display: none; }
.mb-dispatch[data-selected="0"] [data-pv="0"], .mb-dispatch[data-selected="1"] [data-pv="1"], .mb-dispatch[data-selected="2"] [data-pv="2"], .mb-dispatch[data-selected="3"] [data-pv="3"] { display: block; animation: mb-pv .35s ease; }
@keyframes mb-pv { from { opacity: 0; transform: translateY(6px); } }
.mb-dispatch-pv-head { display: flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mono, ui-monospace, monospace); color: #fff; }
.mb-dispatch-pv-head img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.mb-dispatch-pv-head span { margin-left: auto; font-weight: 500; font-size: 10.5px; color: #9a9da9; letter-spacing: .06em; text-transform: uppercase; }
.mb-dispatch-pv p { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: #d9dbe3; }
.mb-dispatch-pv p b { color: #fff; }
.mb-dispatch-ev { display: flex; align-items: center; gap: 7px; margin-top: 10px; font: 500 11px/1.5 var(--mono, ui-monospace, monospace); color: #39d98a; }

/* auto-resolución */
.mb-resolution { position: relative; margin: 0; width: 100%; min-height: 440px; }
.mb-resolution-rail { position: absolute; inset: 0; width: 100%; height: 100%; }
.mb-resolution-packet { fill: none; stroke: #39d98a; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 30 70; stroke-dashoffset: 100; opacity: 0; animation: mb-commit-flow 7s linear infinite paused; }
.mb-resolution-card { position: absolute; left: 9%; top: 0; width: 82%; padding: 22px 24px; border: 1px solid; color: var(--mb-accent); background: #0b0b0c; box-shadow: 7px 7px 0 rgba(255,255,255,.05); animation: mb-resolved 7s ease infinite paused; }
.mb-resolution-status { position: relative; min-height: 2.6rem; font: 600 11px/1.7 var(--mono, ui-monospace, monospace); letter-spacing: .14em; text-transform: uppercase; }
.mb-resolution-status > span { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; }
.mb-resolution-open { animation: mb-open 7s linear infinite paused; }
.mb-resolution-done { opacity: 0; animation: mb-done 7s linear infinite paused; }
.mb-resolution-title { margin: 0; font: 600 clamp(15px, 1.4vw, 19px)/1.35 var(--default-font, "Manrope", sans-serif); color: #fff; background-image: linear-gradient(#39d98a, #39d98a); background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 1px; animation: mb-strike 7s linear infinite paused; }
.mb-resolution-card code { display: block; margin-top: 16px; font: 500 11px/1.5 var(--mono, ui-monospace, monospace); color: #9a9da9; }
.mb-resolution-line { display: block; width: 85%; height: 2px; margin-top: 16px; background: rgba(255,255,255,.12); }
.mb-resolution-line.is-short { width: 60%; margin-top: 8px; }
.mb-resolution-commit { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.14); background: #0b0b0c; color: #39d98a; white-space: nowrap; font: 500 12px/1 var(--mono, ui-monospace, monospace); opacity: 0; animation: mb-commit 7s ease infinite paused; }
.mb-resolution[data-active="true"] .mb-resolution-card, .mb-resolution[data-active="true"] .mb-resolution-open, .mb-resolution[data-active="true"] .mb-resolution-done, .mb-resolution[data-active="true"] .mb-resolution-title, .mb-resolution[data-active="true"] .mb-resolution-commit, .mb-resolution[data-active="true"] .mb-resolution-packet { animation-play-state: running; }
@keyframes mb-resolved { 0%, 42%, 100% { color: var(--mb-accent); } 50%, 92% { color: #39d98a; } }
@keyframes mb-open { 0%, 42%, 100% { opacity: 1; } 47%, 95% { opacity: 0; } }
@keyframes mb-done { 0%, 42%, 100% { opacity: 0; } 47%, 92% { opacity: 1; } }
@keyframes mb-strike { 0%, 42%, 100% { background-size: 0% 1px; } 51%, 92% { background-size: 100% 1px; } }
@keyframes mb-commit { 0%, 22%, 100% { opacity: 0; } 30%, 92% { opacity: 1; } }
@keyframes mb-commit-flow { 0%, 28% { stroke-dashoffset: 100; opacity: 0; } 30% { opacity: 1; } 46% { stroke-dashoffset: 0; opacity: 1; } 50%, 100% { stroke-dashoffset: 0; opacity: 0; } }

/* capas */
.mb-layers { margin: 0; width: 100%; }
.mb-layers svg { display: block; width: 100%; height: auto; }
.mb-ly-plane path { fill: url(#mb-ly-top); stroke: rgba(255,255,255,.35); stroke-width: 1; animation: mb-ly-float 6s ease-in-out calc(var(--i) * -1.2s) infinite; }
@keyframes mb-ly-float { 50% { transform: translateY(-4px); } }
.mb-ly-labels text { font: 600 11px var(--mono, ui-monospace, monospace); letter-spacing: .14em; text-transform: uppercase; fill: #a7aabb; }
.mb-ly-labels line { stroke: rgba(255,255,255,.2); stroke-width: 1; }
.mb-ly-pin line { stroke: var(--mb-accent); stroke-width: 1.5; }
.mb-ly-pin path { fill: var(--mb-accent); }
.mb-ly-pin circle { fill: var(--mb-accent); }
.mb-ly-pulse { fill: none !important; stroke: var(--mb-accent); stroke-width: 1.5; animation: mb-ly-pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mb-ly-pulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.mb-ly-cube path { fill: #141418; stroke: rgba(255,255,255,.35); stroke-width: 1; }
.mb-ly-cube .is-left { fill: #0d0d10; } .mb-ly-cube .is-right { fill: #1b1c21; }
.mb-ly-link { fill: none !important; stroke: #0ad5ff !important; stroke-width: 1.2 !important; stroke-dasharray: 4 4; animation: mb-ly-dash 1.2s linear infinite; }
@keyframes mb-ly-dash { to { stroke-dashoffset: -8; } }
.mb-ly-cube text { font: 600 10.5px var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; fill: #0ad5ff; }
.mb-ly-caption { font: 600 11px var(--mono, ui-monospace, monospace); letter-spacing: .2em; text-transform: uppercase; fill: #fff; }

/* sección genérica de visual + texto */
.mb-visual { padding: 80px 0; }
.mb-visual + .mb-visual { padding-top: 0; }
.mb-visual-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: center; }
.mb-visual--left .mb-visual-copy { order: 2; }
.mb-visual-steps { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.mb-visual-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; font-size: 14px; line-height: 1.5; color: var(--text-color, #a7aabb); }
.mb-visual-steps li b { display: block; font-size: 14px; color: #fff; font-weight: 600; }
.mb-visual-steps li i { font: 600 11px/1 var(--mono, ui-monospace, monospace); color: var(--mb-accent); padding-top: 4px; font-style: normal; letter-spacing: .1em; }

@media (max-width: 991px) {
  .mb-visual { padding: 56px 0; }
  .mb-visual-grid { grid-template-columns: 1fr; gap: 24px; }
  .mb-visual--left .mb-visual-copy { order: 0; }
  .mb-dispatch-scene { min-height: 0; display: flex; flex-direction: column; gap: 18px; }
  .mb-dispatch-wires { display: none; }
  .mb-dispatch-source, .mb-dispatch-preview { position: static; }
  .mb-dispatch-tool { position: static; transform: none; width: auto; }
  .mb-dispatch-scene > .mb-dispatch-tool { display: inline-flex; }
  .mb-dispatch-tools-row { display: flex; }
  .mb-dispatch-scene { }
  .mb-dispatch-source + .mb-dispatch-tool { margin-top: 0; }
  .mb-dispatch-plate { width: 56px; height: 56px; }
  .mb-dispatch-plate img { width: 24px; height: 24px; }
  .mb-resolution { min-height: 400px; }
}
@media (max-width: 991px) {
  /* los cuatro destinos en una fila */
  .mb-dispatch-scene { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-areas: "s s s s" "t0 t1 t2 t3" "p p p p"; gap: 18px 8px; }
  .mb-dispatch-source { grid-area: s; } .mb-dispatch-preview { grid-area: p; }
  .mb-dispatch-tool-0 { grid-area: t0; } .mb-dispatch-tool-1 { grid-area: t1; } .mb-dispatch-tool-2 { grid-area: t2; } .mb-dispatch-tool-3 { grid-area: t3; }
  .mb-dispatch-tool { font-size: 10.5px; }
}

/* ── rutinas programadas ── */
.mb-schedule { margin: 0; border: 1px solid rgba(255,255,255,.12); background: #0b0b0c; font-family: var(--default-font, "Manrope", sans-serif); }
.mb-schedule-head, .mb-schedule-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; font: 500 11px/1.4 var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: #9a9da9; }
.mb-schedule-head { border-bottom: 1px solid rgba(255,255,255,.08); }
.mb-schedule-foot { border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.mb-schedule-head span:first-child, .mb-schedule-run { display: inline-flex; align-items: center; gap: 8px; color: #d9dbe3; }
.mb-schedule-head i, .mb-schedule-run i { width: 7px; height: 7px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 8px #39d98a; }
.mb-schedule-list { list-style: none; margin: 0; padding: 0; }
.mb-schedule-row { display: grid; grid-template-columns: 44px 1fr auto 92px; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.06); transition: background .3s; }
.mb-schedule-row:last-child { border-bottom: 0; }
.mb-schedule-row.is-running { background: rgba(var(--mb-accent-rgb), .07); }
.mb-schedule-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mb-schedule-name b { font-size: 14px; font-weight: 600; color: #fff; }
.mb-schedule-name em { font-style: normal; font-size: 11.5px; color: #9a9da9; }
.mb-schedule-every { font: 600 11px/1 var(--mono, ui-monospace, monospace); letter-spacing: .06em; padding: 6px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #d9dbe3; white-space: nowrap; }
.mb-schedule-next { font: 500 12px/1 var(--mono, ui-monospace, monospace); color: var(--mb-accent); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-schedule-row[data-on="off"] .mb-schedule-name b, .mb-schedule-row[data-on="off"] .mb-schedule-every { opacity: .45; }
.mb-schedule-row[data-on="off"] .mb-schedule-next { color: #6f7280; }
.mb-switch { position: relative; width: 40px; height: 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); cursor: pointer; padding: 0; transition: background .25s, border-color .25s; }
.mb-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #9a9da9; transition: transform .25s, background .25s; }
.mb-switch[aria-checked="true"] { background: rgba(var(--mb-accent-rgb), .25); border-color: var(--mb-accent); }
.mb-switch[aria-checked="true"] i { transform: translateX(18px); background: var(--mb-accent); box-shadow: 0 0 8px rgba(var(--mb-accent-rgb), .8); }

/* ── móvil ── */
.mb-phone { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mb-phone-shell { position: relative; width: 300px; max-width: 100%; border-radius: 40px; padding: 14px; background: #121214; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), inset 0 0 0 1px rgba(0,0,0,.6); font-family: var(--default-font, "Manrope", sans-serif); }
.mb-phone-notch { width: 96px; height: 26px; margin: 0 auto 6px; border-radius: 0 0 16px 16px; background: #060606; }
.mb-phone-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 12px; font-size: 13px; font-weight: 700; color: #fff; }
.mb-phone-paired { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/1 var(--mono, ui-monospace, monospace); letter-spacing: .08em; text-transform: uppercase; color: #9a9da9; }
.mb-phone-paired i { width: 6px; height: 6px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 6px #39d98a; }
.mb-phone-feed { display: flex; flex-direction: column; gap: 8px; }
.mb-phone-item { padding: 12px 12px 12px 14px; border-radius: 14px; background: #1a1a1e; border-left: 3px solid rgba(255,255,255,.18); display: flex; flex-direction: column; gap: 3px; opacity: 0; transform: translateY(10px); }
.mb-phone-item--alert { border-left-color: #ff4a3d; }
.mb-phone-item--ok { border-left-color: #39d98a; }
.mb-phone-meta { font: 500 9.5px/1.3 var(--mono, ui-monospace, monospace); letter-spacing: .06em; text-transform: uppercase; color: #9a9da9; }
.mb-phone-item b { font-size: 13px; font-weight: 600; color: #fff; }
.mb-phone-item small { font-size: 11px; color: #b6b8c3; line-height: 1.35; }
.mb-phone-actions { display: flex; gap: 6px; margin-top: 8px; }
.mb-phone-actions button { appearance: none; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; border-radius: 999px; padding: 7px 11px; font: 600 11px/1 var(--default-font, "Manrope", sans-serif); cursor: default; }
.mb-phone-actions button.is-primary { background: var(--mb-accent); border-color: var(--mb-accent); color: #06111a; }
.mb-phone-home { width: 110px; height: 4px; margin: 14px auto 2px; border-radius: 2px; background: rgba(255,255,255,.35); }
.mb-phone figcaption { font: 500 11px/1.4 var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: #9a9da9; text-align: center; }
.is-in .mb-phone-item { animation: mb-phone-in .5s ease var(--d, 0s) forwards; }
@keyframes mb-phone-in { to { opacity: 1; transform: none; } }

@media (max-width: 575px) {
  .mb-schedule-row { grid-template-columns: 44px 1fr; gap: 8px 12px; }
  .mb-schedule-every { grid-column: 2; justify-self: start; }
  .mb-schedule-next { grid-column: 2; text-align: left; }
}
