/* =====================================================================
   EdgeWarden — página Hardware e dimensionamento (componentes exclusivos)
   Depende dos tokens e componentes de ew.css.
   ===================================================================== */

/* ---------- Hero: ficha comum a todos os papéis ---------- */
.hw-hero .split { align-items: end; }
.hw-facts { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(8,18,38,.78); padding: 6px 20px; }
.hw-facts__h { display: flex; align-items: center; gap: 8px; padding: 14px 0 10px; border-bottom: 1px solid var(--line); color: var(--text-1); font-weight: 600; font-size: var(--fs-sm); }
.hw-facts__h svg { width: 16px; height: 16px; color: var(--in); }
.hw-facts dl { margin: 0; }
.hw-facts dl > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hw-facts dl > div:last-child { border-bottom: 0; }
.hw-facts dt { font-size: var(--fs-xs); color: var(--text-3); padding-top: 2px; }
.hw-facts dd { margin: 0; font-size: var(--fs-sm); color: var(--text-1); line-height: 1.5; }
@media (max-width: 480px) { .hw-facts dl > div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Demanda por papel ---------- */
.lvl { display: inline-flex; align-items: center; gap: 9px; color: var(--text-1); font-weight: 500; white-space: nowrap; }
.lvl b { display: inline-flex; gap: 3px; align-items: flex-end; }
.lvl b i { display: block; width: 5px; border-radius: 1.5px; background: #1f3355; }
.lvl b i:nth-child(1) { height: 6px; }
.lvl b i:nth-child(2) { height: 9px; }
.lvl b i:nth-child(3) { height: 12px; }
.lvl b i:nth-child(4) { height: 15px; }
.lvl--1 b i:nth-child(-n+1),
.lvl--2 b i:nth-child(-n+2) { background: var(--in); }
.lvl--3 b i:nth-child(-n+3) { background: var(--warn); }
.lvl--4 b i { background: #ff8a6b; }
.lvl-note { display: block; margin-top: 4px; font-size: 12px; color: var(--text-3); line-height: 1.4; white-space: normal; }

.demand table { min-width: 0; }
.demand thead th { vertical-align: bottom; }
.demand tbody th { text-align: left; font-weight: 600; color: var(--text-1); white-space: nowrap; }
.demand .role-h { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: var(--fs-base); }
.demand .role-h svg { width: 17px; height: 17px; color: var(--in); flex: none; }
.demand tbody th small { display: block; margin-top: 2px; font: 400 12px var(--font-body); color: var(--text-3); white-space: normal; }
.demand td.why { color: var(--text-3); line-height: 1.55; min-width: 260px; }
.demand tr.is-module th, .demand tr.is-module td { background: rgba(182,156,255,.035); }
.demand tr.is-module .role-h svg { color: var(--out); }
.demand-foot { margin-top: 14px; font-size: var(--fs-xs); color: var(--text-4); }

/* Em telas estreitas a tabela vira cartões (papéis ARIA mantêm a semântica) */
@media (max-width: 760px) {
  .demand { border: 0; background: none; overflow: visible; }
  .demand table, .demand tbody { display: block; }
  .demand thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .demand tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
  .demand tbody th, .demand tbody td { display: block; border-bottom: 1px solid var(--line); }
  .demand tbody th { grid-column: 1 / -1; padding: 16px; background: rgba(16,32,61,.6); white-space: normal; }
  .demand tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-3); }
  .demand tbody td.why { grid-column: 1 / -1; min-width: 0; border-bottom: 0; }
  .demand tbody td.why::before { display: none; }
  .demand tbody td:nth-of-type(odd):not(.why) { border-right: 1px solid var(--line); }
  .demand tbody tr:last-child td { border-bottom: 1px solid var(--line); }
  .demand tbody tr:last-child td.why { border-bottom: 0; }
}

/* ---------- Topologia de dois nós ---------- */
.hw-topo-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); }
.hw-topo { margin: 0; border: 1px solid var(--line); border-radius: var(--r-xl); background: radial-gradient(520px 260px at 50% 0%, rgba(47,107,255,.12), transparent 70%), var(--surface); padding: clamp(14px, 2vw, 22px); }
.hw-topo svg { width: 100%; max-width: 1000px; height: auto; margin-inline: auto; }
.hw-topo__tall { display: none; }
@media (max-width: 620px) { .hw-topo__wide { display: none; } .hw-topo__tall { display: block; } }
.hw-topo figcaption { max-width: 1000px; margin: 12px auto 0; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.hw-topo .t-box { fill: #0b1830; stroke: var(--line-strong); stroke-width: 1.2; }
.hw-topo .t-box--an { stroke: rgba(60,198,228,.55); }
.hw-topo .t-box--sc { stroke: rgba(61,214,140,.55); }
.hw-topo .t-box--rt { fill: #10203d; stroke: rgba(47,107,255,.6); }
.hw-topo .t-box--ext { fill: #081226; stroke: var(--line); stroke-dasharray: 4 4; }
.hw-topo .t-zone { fill: none; stroke: var(--line); stroke-dasharray: 2 5; }
.hw-topo .t-h { font-family: var(--font-display); font-weight: 600; font-size: 15px; fill: var(--text-1); }
.hw-topo .t-s { font-family: var(--font-body); font-size: 12px; fill: var(--text-3); }
.hw-topo .t-m { font-family: var(--font-mono); font-size: 11.5px; fill: var(--text-2); }
.hw-topo .t-tag { font-family: var(--font-mono); font-size: 11px; }
.hw-topo .t-line { fill: none; stroke-width: 2; }
.hw-topo .t-in { stroke: var(--in); }
.hw-topo .t-mix { stroke: #8a7bb0; }
.hw-topo .t-dirty { stroke: var(--attack); }
.hw-topo .t-clean { stroke: var(--ok); }
.hw-topo .t-bgp { stroke: var(--out); }
.hw-topo .t-flow { stroke: var(--in); stroke-dasharray: 5 5; }
.hw-topo .t-health { stroke: var(--warn); stroke-dasharray: 3 5; }
.hw-topo .t-queue { stroke: var(--line-strong); stroke-dasharray: 8 5; }
.hw-topo .c-in { fill: var(--in); }
.hw-topo .c-dirty { fill: var(--attack); }
.hw-topo .c-clean { fill: var(--ok); }
.hw-topo .c-bgp { fill: var(--out); }
.hw-topo .c-warn { fill: var(--warn); }
.hw-topo .c-mute { fill: var(--text-3); }
.hw-topo .t-pkt { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 0.1 34; animation: hw-pkt 2.4s linear infinite; }
.hw-topo .t-pkt.t-dirty { animation-duration: 1.8s; }
@keyframes hw-pkt { to { stroke-dashoffset: -34.1; } }
.hw-topo .t-pulse { animation: hw-pulse 10s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hw-pulse { 0%, 6% { opacity: 1; } 18%, 100% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .hw-topo .t-pkt { display: none; }
  .hw-topo .t-pulse { animation: none; opacity: 1; }
}

.hw-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 clamp(18px, 2.4vw, 32px); }
.hw-legend li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-content: start; gap: 2px 12px; padding: 14px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-3); line-height: 1.55; }
.hw-legend strong { display: block; color: var(--text-1); font-weight: 600; }
.hw-key { width: 22px; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--c, var(--in)); }
.hw-key--dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 9px); }
.hw-key--box { width: 16px; height: 16px; margin-top: 3px; border-radius: 4px; background: transparent; border: 1.5px solid var(--c); }

/* ---------- Portes de referência ---------- */
.hw-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 22px); align-items: stretch; }
@media (max-width: 980px) { .hw-tiers { grid-template-columns: minmax(0, 1fr); max-width: 620px; } }
.hw-tier { display: flex; flex-direction: column; }
.hw-tier__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hw-tier__head h3 { margin: 0; font-size: var(--fs-lg); }
.hw-tier__head p { margin: 0; width: 100%; font-size: var(--fs-sm); color: var(--text-3); }
.hw-tier__vol { margin: 16px 0 6px; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); color: var(--text-1); line-height: 1.25; }
.hw-tier__vol small { display: block; margin-top: 2px; font-family: var(--font-body); font-weight: 400; font-size: var(--fs-sm); color: var(--text-3); }
.hw-tier dl { margin: 6px 0 0; display: grid; }
.hw-tier dl > div { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid rgba(27,44,74,.6); }
.hw-tier dt { font-size: var(--fs-xs); color: var(--text-3); padding-top: 2px; }
.hw-tier dd { margin: 0; font-size: var(--fs-sm); color: var(--text-1); }
.hw-notes { list-style: none; margin: clamp(24px, 3vw, 36px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); }
.hw-notes li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-3); line-height: 1.55; }
.hw-notes li svg { width: 18px; height: 18px; color: var(--in); margin-top: 2px; }
.hw-notes strong { color: var(--text-1); font-weight: 600; }
@media (max-width: 720px) { .hw-notes { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Centro de limpeza R760 ---------- */
.hw-r760 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 1000px) { .hw-r760 { grid-template-columns: minmax(0, 1fr); } }
.hw-spec { margin: 0; border-top: 1px solid var(--line); }
.hw-spec > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 6px 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.hw-spec dt { display: flex; align-items: flex-start; gap: 9px; color: var(--text-1); font-weight: 600; font-size: var(--fs-sm); }
.hw-spec dt svg { width: 16px; height: 16px; color: var(--ok); margin-top: 3px; flex: none; }
.hw-spec dd { margin: 0; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.6; }
@media (max-width: 560px) { .hw-spec > div { grid-template-columns: minmax(0, 1fr); } }
.hw-side h3 { font-size: var(--fs-md); margin-bottom: 14px; }
.hw-side h3 + .table-wrap, .hw-side h3 + .hw-edges { margin-top: 0; }
.hw-side > * + h3 { margin-top: 32px; }
.hw-modes th[scope="row"] { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.hw-modes thead th { white-space: normal; vertical-align: bottom; }
.hw-modes table { min-width: 460px; }
.hw-edges { display: grid; gap: 10px; }
.hw-edge { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(12,24,48,.6); }
.hw-edge strong { color: var(--text-1); font-weight: 600; }
.hw-edge p { grid-column: 1 / -1; margin: 0; font-size: var(--fs-sm); color: var(--text-3); }
.hw-status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.hw-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hw-status--ok { color: var(--ok); border: 1px solid rgba(61,214,140,.35); background: rgba(61,214,140,.08); }
.hw-status--warn { color: var(--warn); border: 1px solid rgba(244,203,85,.35); background: rgba(244,203,85,.08); }
@media (max-width: 480px) { .hw-edge { grid-template-columns: 1fr; } .hw-edge .hw-status { justify-self: start; } }

.hw-cap { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(28px, 3vw, 40px); border-top: 1px solid var(--line); }
.hw-cap > h3 { font-size: var(--fs-md); margin-bottom: 22px; }
.hw-cap__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px clamp(16px, 3vw, 40px); }
@media (max-width: 820px) { .hw-cap__row { grid-template-columns: minmax(0, 1fr); } }
.hw-cap .stat__label { max-width: 34ch; }
.hw-cap .stat--ref { border-left-style: dashed; }
.hw-ref { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 5px; border: 1px dashed var(--line-strong); font: 500 11px var(--font-body); color: var(--text-3); vertical-align: 4px; letter-spacing: 0; }

/* ---------- Placas de rede ---------- */
.hw-nic table { min-width: 760px; }
.hw-nic td:first-child { color: var(--text-1); font-weight: 600; white-space: nowrap; }
.hw-nic td.drv { font-family: var(--font-mono); font-size: 13px; color: #9be6f5; white-space: nowrap; }
.hw-nic td.spd { white-space: nowrap; color: var(--text-1); }
.hw-nic td.obs { color: var(--text-3); }
.hw-nic .table-group td { padding-block: 9px; }
.hw-xdp { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.hw-xdp--native { color: var(--ok); border-color: rgba(61,214,140,.35); background: rgba(61,214,140,.08); }
.hw-xdp--basic { color: var(--warn); border-color: rgba(244,203,85,.35); background: rgba(244,203,85,.07); }
.hw-xdp--lab { color: var(--text-2); border-color: var(--line-strong); background: rgba(255,255,255,.02); }
.hw-nic-notes { margin-top: clamp(24px, 3vw, 36px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(16px, 3vw, 28px); }
.hw-nic-notes .note { margin: 0 0 16px; }
@media (max-width: 860px) { .hw-nic-notes { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Verificação ---------- */
.hw-verify { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 1000px) { .hw-verify { grid-template-columns: minmax(0, 1fr); } }
.hw-verify .code { margin-top: 0; }
.code__copy svg { width: 14px; height: 14px; flex: none; }
.hw-expect h3 { font-size: var(--fs-md); margin-bottom: 8px; }
.hw-expect ul.ticks li { margin: 12px 0; }
.hw-expect code { white-space: nowrap; }

/* ---------- CTA ---------- */
.hw-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(47,107,255,.25); }
.hw-links a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 500; }
.hw-links svg { width: 16px; height: 16px; }
