/* Wapu Auth Broker — status público y páginas de error.
   Un único asset local, compatible con CSP estricta y sin dependencias. */

:root {
    --bg: #030711;
    --bg-2: #07111e;
    --surface: rgba(8, 19, 33, 0.88);
    --surface-strong: rgba(10, 25, 43, 0.96);
    --surface-soft: rgba(12, 30, 50, 0.66);
    --border: rgba(103, 181, 224, 0.17);
    --border-bright: rgba(78, 231, 255, 0.34);
    --text: #ecf7ff;
    --muted: #91a9bf;
    --muted-strong: #b5c9da;
    --operational: #35e6ad;
    --degraded: #ffcc66;
    --unavailable: #ff6b7d;
    --unknown: #93a4b8;
    --disabled: #74869b;
    --accent: #4ee7ff;
    --accent-2: #4285ff;
    --accent-3: #1bc8a8;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    color-scheme: dark;
}

body {
    min-height: 100%;
    overflow-x: hidden;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    background:
        radial-gradient(900px 520px at 78% -8%, rgba(66, 133, 255, 0.18), transparent 65%),
        radial-gradient(760px 500px at 2% 96%, rgba(27, 200, 168, 0.09), transparent 68%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 54%, #050b14 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.13;
    background-image:
        linear-gradient(rgba(97, 187, 232, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(97, 187, 232, 0.08) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 84%);
    mask-image: linear-gradient(to bottom, black, transparent 84%);
}

/* Red ambiental compartida por status y páginas de error. */

.net {
    position: fixed;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.34;
    pointer-events: none;
}

.page-status > .net {
    display: none;
}

.net line {
    stroke: rgba(96, 165, 250, 0.16);
    stroke-width: 1;
}

.net .flow {
    stroke: rgba(56, 189, 248, 0.44);
    stroke-width: 1.4;
    stroke-dasharray: 4 14;
    animation: ambient-flow 3.2s linear infinite;
}

.net .flow.f2 {
    stroke: rgba(52, 211, 153, 0.35);
    animation-duration: 4.6s;
    animation-delay: -1.2s;
}

.net .flow.f3 {
    stroke: rgba(96, 165, 250, 0.35);
    animation-duration: 5.8s;
    animation-delay: -2.4s;
}

.net circle {
    fill: rgba(96, 165, 250, 0.55);
    animation: ambient-pulse 3.4s ease-in-out infinite;
}

.net circle.n2 {
    fill: rgba(56, 189, 248, 0.5);
    animation-delay: -1.1s;
}

.net circle.n3 {
    fill: rgba(52, 211, 153, 0.45);
    animation-delay: -2.2s;
}

@keyframes ambient-flow {
    to { stroke-dashoffset: -180; }
}

@keyframes ambient-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Estructura compartida. */

.shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 44px 20px 60px;
}

.page-status .shell {
    width: min(100%, 1280px);
    padding-top: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.page-status .brand {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(103, 181, 224, 0.12);
}

.brand-logo {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(78, 231, 255, 0.2), rgba(66, 133, 255, 0.11));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 10, 30, 0.24);
}

.brand h1 {
    font-size: 18px;
    font-weight: 670;
    letter-spacing: 0.01em;
}

.brand .chip {
    margin-left: auto;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(8, 19, 33, 0.6);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card {
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    backdrop-filter: blur(8px);
}

.val {
    color: var(--text);
    font-weight: 600;
}

.muted {
    color: var(--muted);
}

/* Estados compartidos. */

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.dot-operational {
    background: var(--operational);
    box-shadow: 0 0 12px rgba(53, 230, 173, 0.64);
}

.dot-degraded {
    background: var(--degraded);
    box-shadow: 0 0 12px rgba(255, 204, 102, 0.54);
}

.dot-unavailable {
    background: var(--unavailable);
    box-shadow: 0 0 12px rgba(255, 107, 125, 0.58);
}

.dot-unknown {
    background: var(--unknown);
}

.dot-disabled {
    background: var(--disabled);
}

.page-status.motion-enabled .dot-live {
    animation: status-beat 2.4s ease-in-out infinite;
}

@keyframes status-beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

.state-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 10.5px;
    font-weight: 700;
}

.state-operational {
    color: var(--operational);
    border-color: rgba(53, 230, 173, 0.16);
    background: rgba(53, 230, 173, 0.08);
}

.state-degraded {
    color: var(--degraded);
    border-color: rgba(255, 204, 102, 0.16);
    background: rgba(255, 204, 102, 0.08);
}

.state-unavailable {
    color: var(--unavailable);
    border-color: rgba(255, 107, 125, 0.16);
    background: rgba(255, 107, 125, 0.08);
}

.state-unknown {
    color: var(--unknown);
    border-color: rgba(147, 164, 184, 0.16);
    background: rgba(147, 164, 184, 0.08);
}

.state-disabled {
    color: var(--disabled);
    border-color: rgba(116, 134, 155, 0.16);
    background: rgba(116, 134, 155, 0.08);
}

/* Cabecera de la página de status. */

.status-dashboard {
    display: grid;
    gap: 24px;
}

.status-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: 34px;
    align-items: end;
    padding: 10px 2px 6px;
}

.overview-copy {
    max-width: 760px;
}

.eyebrow,
.section-kicker {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.eyebrow-mark {
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    box-shadow: 0 0 10px rgba(78, 231, 255, 0.75);
}

.overview-copy h2 {
    max-width: 720px;
    margin-top: 12px;
    font-size: clamp(32px, 4.2vw, 52px);
    font-weight: 690;
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.overview-copy p {
    max-width: 650px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.overview-console {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(12, 29, 49, 0.88), rgba(5, 14, 25, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 6, 20, 0.22);
}

.overview-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 15px;
    border-bottom: 1px solid rgba(103, 181, 224, 0.11);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overall-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
}

.overall-state-operational { color: var(--operational); }
.overall-state-degraded { color: var(--degraded); }
.overall-state-unavailable { color: var(--unavailable); }
.overall-state-unknown { color: var(--unknown); }

.overview-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 7px 14px;
    padding: 13px 15px 15px;
    color: var(--muted);
    font-size: 10.5px;
}

.overview-meta strong,
.overview-meta time {
    overflow: hidden;
    color: var(--muted-strong);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Panel principal de red. */

.traffic-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--border-bright);
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(12, 28, 47, 0.82), rgba(4, 12, 22, 0.94)),
        var(--surface-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 90px rgba(0, 7, 24, 0.42),
        0 0 80px rgba(66, 133, 255, 0.05);
}

.traffic-panel::before {
    position: absolute;
    z-index: -1;
    top: -180px;
    left: 28%;
    width: 560px;
    height: 280px;
    border-radius: 50%;
    background: rgba(78, 231, 255, 0.08);
    filter: blur(70px);
    content: "";
}

.traffic-head {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 20px 24px 18px;
    border-bottom: 1px solid rgba(103, 181, 224, 0.12);
    background: rgba(5, 15, 27, 0.56);
}

.traffic-head h3,
.components-heading h2 {
    margin-top: 3px;
    font-size: 20px;
    font-weight: 660;
    letter-spacing: -0.02em;
}

.traffic-head p,
.components-heading p {
    max-width: 720px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
}

.traffic-mode {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--muted-strong);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.traffic-bars {
    display: inline-flex;
    height: 14px;
    align-items: end;
    gap: 2px;
}

.traffic-bars i {
    display: block;
    width: 2px;
    height: 6px;
    border-radius: 4px;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(78, 231, 255, 0.72);
}

.traffic-bars i:nth-child(2) {
    height: 12px;
    animation-delay: -0.4s;
}

.traffic-bars i:nth-child(3) {
    height: 9px;
    animation-delay: -0.8s;
}

.page-status.motion-enabled .traffic-bars i {
    animation: signal-bar 1.2s ease-in-out infinite alternate;
}

@keyframes signal-bar {
    from { opacity: 0.35; transform: scaleY(0.45); }
    to { opacity: 1; transform: scaleY(1); }
}

.traffic-stage {
    position: relative;
    min-height: clamp(480px, 45vw, 570px);
    overflow: hidden;
    contain: paint;
    background:
        radial-gradient(circle at 48% 46%, rgba(66, 133, 255, 0.13), transparent 19%),
        radial-gradient(circle at 48% 46%, rgba(78, 231, 255, 0.05), transparent 38%),
        linear-gradient(180deg, rgba(3, 12, 22, 0.36), rgba(2, 8, 15, 0.76));
}

.traffic-stage::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(90deg, transparent 49.88%, rgba(78, 231, 255, 0.05) 50%, transparent 50.12%),
        linear-gradient(transparent 49.82%, rgba(78, 231, 255, 0.04) 50%, transparent 50.18%);
}

.traffic-stage::after {
    position: absolute;
    z-index: 0;
    top: 46%;
    left: 48%;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(78, 231, 255, 0.08);
    border-radius: 50%;
    opacity: 0.5;
    transform: translate(-50%, -50%);
    content: "";
}

.traffic-stage.is-live::after {
    animation: radar-ring 4s ease-out infinite;
}

@keyframes radar-ring {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.45); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

.traffic-map {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-grid path {
    fill: none;
    stroke: rgba(85, 164, 203, 0.075);
    stroke-width: 0.85;
    vector-effect: non-scaling-stroke;
}

.world-land path {
    fill: rgba(54, 125, 158, 0.075);
    stroke: rgba(94, 196, 230, 0.2);
    stroke-width: 0.85;
    vector-effect: non-scaling-stroke;
}

.map-pops circle {
    fill: var(--accent);
    opacity: 0.48;
    transform-box: fill-box;
    transform-origin: center;
}

.traffic-stage.is-live .map-pops circle {
    animation: map-pop 3.2s ease-in-out infinite;
}

.traffic-stage.is-live .map-pops circle:nth-child(2n) { animation-delay: -1.1s; }
.traffic-stage.is-live .map-pops circle:nth-child(3n) { animation-delay: -2.2s; }

@keyframes map-pop {
    0%, 100% { opacity: 0.2; transform: scale(0.7); }
    50% { opacity: 0.9; transform: scale(1.35); }
}

.route-set-mobile {
    display: none;
}

.route-base,
.route-flow {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.route-base {
    stroke-width: 1.2;
    stroke-opacity: 0.27;
}

.route-flow {
    stroke-width: 2.2;
    stroke-dasharray: 1 11;
    stroke-opacity: 0.88;
}

.route-operational { stroke: var(--operational); }
.route-degraded { stroke: var(--degraded); }
.route-unavailable { stroke: var(--unavailable); }
.route-unknown { stroke: var(--unknown); }
.route-disabled { stroke: var(--disabled); }

.route-speed-1 { --route-duration: 3.1s; }
.route-speed-2 { --route-duration: 4.2s; }
.route-speed-3 { --route-duration: 5.1s; }
.route-degraded.route-speed-1 { --route-duration: 4.2s; }
.route-degraded.route-speed-2 { --route-duration: 5.7s; }
.route-degraded.route-speed-3 { --route-duration: 6.9s; }

.traffic-stage.is-live .route-flow.route-operational,
.traffic-stage.is-live .route-flow.route-degraded {
    animation: route-travel var(--route-duration, 4s) linear infinite;
}

@keyframes route-travel {
    to { stroke-dashoffset: -100; }
}

/* Nodos superpuestos a la topología. */

.network-nodes {
    position: absolute;
    z-index: 2;
    inset: 0;
}

.node-operational,
.component-card-operational { --status-color: var(--operational); --status-rgb: 53, 230, 173; }

.node-degraded,
.component-card-degraded { --status-color: var(--degraded); --status-rgb: 255, 204, 102; }

.node-unavailable,
.component-card-unavailable { --status-color: var(--unavailable); --status-rgb: 255, 107, 125; }

.node-unknown,
.component-card-unknown { --status-color: var(--unknown); --status-rgb: 147, 164, 184; }

.node-disabled,
.component-card-disabled { --status-color: var(--disabled); --status-rgb: 116, 134, 155; }

.node-neutral { --status-color: var(--accent); --status-rgb: 78, 231, 255; }

.network-node {
    position: absolute;
    display: flex;
    min-width: 152px;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid rgba(var(--status-rgb), 0.3);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(11, 28, 47, 0.94), rgba(4, 14, 25, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 12px 36px rgba(0, 5, 18, 0.34),
        0 0 28px rgba(var(--status-rgb), 0.07);
    transform: translate(-50%, -50%);
}

.network-node::before {
    position: absolute;
    z-index: -1;
    inset: -7px;
    border: 1px solid rgba(var(--status-rgb), 0.16);
    border-radius: 17px;
    opacity: 0.42;
    content: "";
}

.traffic-stage.is-live .network-node.node-operational::before,
.traffic-stage.is-live .network-node.node-degraded::before {
    animation: node-breathe 3.4s ease-in-out infinite;
}

.traffic-stage.is-live .network-node:nth-child(2n)::before { animation-delay: -1.2s; }
.traffic-stage.is-live .network-node:nth-child(3n)::before { animation-delay: -2.4s; }

@keyframes node-breathe {
    0%, 100% { opacity: 0.18; transform: scale(0.96); }
    50% { opacity: 0.62; transform: scale(1.03); }
}

.node-emblem {
    position: relative;
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(var(--status-rgb), 0.34);
    border-radius: 10px;
    color: var(--status-color);
    background: rgba(var(--status-rgb), 0.08);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: inset 0 0 15px rgba(var(--status-rgb), 0.06);
}

.node-emblem-broker {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 15px;
}

.node-emblem-broker::before {
    position: absolute;
    inset: -6px;
    border: 1px dashed rgba(var(--status-rgb), 0.42);
    border-radius: 50%;
    content: "";
}

.traffic-stage.is-live .node-emblem-broker::before {
    animation: broker-orbit 10s linear infinite;
}

@keyframes broker-orbit {
    to { transform: rotate(360deg); }
}

.node-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.node-copy strong {
    color: var(--text);
    font-size: 11px;
    font-weight: 680;
    line-height: 1.2;
    white-space: nowrap;
}

.node-copy small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
    line-height: 1.25;
}

.node-copy small .dot {
    width: 6px;
    height: 6px;
}

.network-node-client { top: 43.75%; left: 12.5%; }
.network-node-broker { top: 44.65%; left: 48%; min-width: 184px; }
.network-node-facebook { top: 24.1%; left: 80.5%; }
.network-node-google { top: 36.6%; left: 82%; }
.network-node-database { top: 50.9%; left: 82%; }
.network-node-cache { top: 76.8%; left: 66%; }
.network-node-storage { top: 76.8%; left: 30%; }

.network-node-broker {
    padding: 12px 14px;
    border-color: rgba(var(--status-rgb), 0.46);
    background: linear-gradient(145deg, rgba(15, 40, 63, 0.97), rgba(5, 18, 31, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 16px 46px rgba(0, 5, 18, 0.44),
        0 0 42px rgba(var(--status-rgb), 0.14);
}

.stage-readout {
    position: absolute;
    z-index: 3;
    right: 18px;
    bottom: 14px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: rgba(181, 201, 218, 0.62);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stage-readout span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stage-readout span:last-child {
    margin-left: auto;
}

.stage-readout i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(78, 231, 255, 0.7);
}

/* Cards secundarias. */

.components-section {
    margin-top: 8px;
}

.components-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 15px;
    padding: 0 2px;
}

.status-legend {
    display: flex;
    max-width: 530px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px 15px;
    color: var(--muted);
    font-size: 9.5px;
}

.status-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-legend .legend-title {
    width: 100%;
    justify-content: flex-end;
    color: var(--muted-strong);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-legend .dot {
    width: 7px;
    height: 7px;
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.component-card {
    position: relative;
    display: flex;
    min-height: 210px;
    overflow: hidden;
    flex-direction: column;
    padding: 17px;
    border: 1px solid rgba(103, 181, 224, 0.15);
    border-radius: 16px;
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--status-rgb), 0.08), transparent 34%),
        linear-gradient(150deg, rgba(12, 29, 48, 0.86), rgba(5, 15, 27, 0.93));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 15px 42px rgba(0, 7, 22, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.component-card::before {
    position: absolute;
    top: 0;
    right: 18%;
    left: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--status-rgb), 0.7), transparent);
    content: "";
}

.component-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.component-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(var(--status-rgb), 0.24);
    border-radius: 12px;
    color: var(--status-color);
    background: rgba(var(--status-rgb), 0.07);
}

.component-icon svg {
    width: 22px;
    height: 22px;
    overflow: visible;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.component-card h3 {
    margin-top: 18px;
    font-size: 14px;
    font-weight: 680;
    letter-spacing: -0.01em;
}

.component-card > p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.55;
}

.component-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid rgba(103, 181, 224, 0.09);
    color: rgba(200, 218, 231, 0.78);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (hover: hover) {
    .component-card:hover {
        border-color: rgba(var(--status-rgb), 0.32);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 20px 50px rgba(0, 7, 22, 0.25);
        transform: translateY(-3px);
    }
}

/* Páginas de error: se mantienen aisladas del dashboard. */

.error-card {
    max-width: 640px;
    margin: 6vh auto 0;
    padding: 56px 28px;
    text-align: center;
}

.error-code {
    color: transparent;
    font-size: 64px;
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: 2px;
    background: linear-gradient(120deg, var(--accent), #38bdf8);
    background-clip: text;
    -webkit-background-clip: text;
}

.error-card h2 {
    margin-top: 10px;
    font-size: 20px;
    font-weight: 650;
}

.error-card p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.error-node {
    display: grid;
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(17, 25, 43, 0.7);
}

.error-actions {
    margin-top: 26px;
}

.btn {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(56, 189, 248, 0.08));
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.btn:hover {
    border-color: rgba(96, 165, 250, 0.45);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

footer {
    margin-top: 38px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

/* Laptop y tablet. */

@media (max-width: 1080px) {
    .components-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .component-card {
        min-height: 190px;
    }

    .network-node {
        min-width: 136px;
        padding: 8px 9px;
    }

    .network-node-broker {
        min-width: 172px;
    }

    .node-copy strong {
        font-size: 10px;
    }
}

@media (max-width: 840px) {
    .page-status .shell {
        padding: 24px 18px 52px;
    }

    .status-overview {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .overview-console {
        display: grid;
        grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1fr);
    }

    .overview-state {
        border-right: 1px solid rgba(103, 181, 224, 0.11);
        border-bottom: 0;
    }

    .traffic-head,
    .components-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .status-legend {
        max-width: none;
        justify-content: flex-start;
    }

    .status-legend .legend-title {
        justify-content: flex-start;
    }

    .components-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .traffic-stage {
        min-height: 500px;
    }

    .node-emblem {
        width: 32px;
        height: 32px;
    }

    .node-emblem-broker {
        width: 38px;
        height: 38px;
    }
}

/* En móvil la topología se reorganiza y usa rutas propias. */

@media (max-width: 700px) {
    .page-status > .net {
        display: none;
    }

    .traffic-head {
        padding: 18px;
    }

    .traffic-mode {
        align-self: flex-start;
    }

    .traffic-stage {
        min-height: 610px;
    }

    .route-set-desktop {
        display: none;
    }

    .route-set-mobile {
        display: block;
    }

    .world-land {
        display: none;
    }

    .map-grid {
        opacity: 0.65;
    }

    .map-pops {
        display: none;
    }

    .traffic-stage::after {
        top: 39%;
        left: 50%;
        width: 180px;
        height: 180px;
    }

    .network-node {
        min-width: 126px;
        max-width: 145px;
        gap: 7px;
        padding: 8px;
    }

    .network-node-client { top: 16%; left: 25%; }
    .network-node-broker { top: 39%; left: 50%; min-width: 176px; }
    .network-node-facebook { top: 57%; left: 75%; }
    .network-node-google { top: 16%; left: 75%; }
    .network-node-database { top: 68%; left: 50%; }
    .network-node-cache { top: 57%; left: 25%; }
    .network-node-storage { top: 87%; left: 50%; }

    .node-copy strong {
        font-size: 9.5px;
        white-space: normal;
    }

    .node-copy small {
        font-size: 9px;
    }

    .stage-readout {
        display: none;
    }
}

@media (max-width: 620px) {
    .overview-console {
        display: block;
    }

    .overview-state {
        border-right: 0;
        border-bottom: 1px solid rgba(103, 181, 224, 0.11);
    }
}

@media (max-width: 520px) {
    body::before {
        background-size: 38px 38px;
    }

    .page-status .shell {
        padding-right: 14px;
        padding-left: 14px;
    }

    .page-status .brand {
        margin-bottom: 22px;
    }

    .page-status .brand h1 {
        font-size: 15px;
    }

    .page-status .brand .chip {
        display: none;
    }

    .overview-copy h2 {
        font-size: clamp(30px, 9vw, 38px);
    }

    .overview-copy p {
        font-size: 12.5px;
    }

    .overview-meta {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .overview-meta strong,
    .overview-meta time {
        margin-bottom: 7px;
        text-align: left;
    }

    .traffic-panel {
        border-radius: 20px;
    }

    .traffic-head h3,
    .components-heading h2 {
        font-size: 18px;
    }

    .traffic-head p,
    .components-heading p {
        font-size: 10.5px;
    }

    .traffic-stage {
        min-height: 620px;
    }

    .network-node {
        min-width: 112px;
        max-width: 132px;
    }

    .network-node-broker {
        min-width: 158px;
    }

    .node-emblem {
        width: 29px;
        height: 29px;
        border-radius: 8px;
        font-size: 8px;
    }

    .node-emblem-broker {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .network-node-client { left: 25%; }
    .network-node-facebook { left: 75%; }
    .network-node-google { left: 75%; }
    .network-node-cache { left: 25%; }

    .components-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .component-card {
        min-height: 184px;
    }

    .status-legend {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .status-legend .legend-title {
        grid-column: 1 / -1;
    }
}

/* Accesibilidad de movimiento. */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .net .flow,
    .net circle,
    .dot-live,
    .traffic-bars i,
    .traffic-stage.is-live::after,
    .traffic-stage.is-live .map-pops circle,
    .traffic-stage.is-live .route-flow,
    .traffic-stage.is-live .network-node::before,
    .traffic-stage.is-live .node-emblem-broker::before {
        animation: none !important;
    }

    .component-card,
    .btn {
        transition: none !important;
    }
}
