/* Atalaya · maqueta viva de la consola para el hero de harpe.live.
   Con el estilo del kit de la consola (las capturas ui-atalaya-*): el marco azul
   noche, la barra de arriba y el carril de la izquierda que salen del marco,
   el lienzo gris azulado y las tarjetas blancas redondeadas. Carlos, 26 de
   octubre de 2026, sobre el hero de Atalaya: «no se parece a la que debería
   ser, que abajo sí aparece mejor, debe de tener este estilo». Las medidas son
   las de las capturas de 1.600 px llevadas a los 1.160 px a los que se dibuja
   la consola; atalaya-mock.js la escala entera con --am-zoom.
   Todo con prefijo .am- para no chocar con site.css. Tema claro por defecto,
   como el kit; el oscuro solo redefine las variables. Bajo la CSP del sitio no
   hay estilos en línea: lo dinámico entra por variables que el JS escribe con
   style.setProperty (--h, --w, --i, --am-p). */

@property --am-p { syntax: "<number>"; inherits: true; initial-value: 0; }

.am {
  --am-frame: #011E2F;
  --am-frame-2: #12303F;
  --am-frame-ink: #B9CCD5;
  --am-frame-line: rgba(255, 255, 255, .14);
  --am-canvas: #E9EFF2;
  --am-card: #FFFFFF;
  --am-soft: #F2F7FA;
  --am-line: #E3EAEE;
  --am-line-2: #D3DDE2;
  --am-ink: #131718;
  --am-ink-2: #5B6468;
  --am-ink-3: #6B757A;
  --am-azure: #016590;
  --am-azure-hover: #014E70;
  --am-on-azure: #FFFFFF;
  --am-mist: #8DBACB;
  --am-seg: #DDE5E9;
  --am-track: #E8EEF1;
  --am-red: #A8352A;
  --am-red-soft: #F9E4DF;
  --am-red-strong: #B03D27;
  --am-red-line: #F0C8BF;
  --am-amber: #8A5A10;
  --am-amber-soft: #FBEBD6;
  --am-amber-strong: #CA891D;
  --am-blue: #0B5A7E;
  --am-blue-soft: #E2EFF3;
  --am-green: #1E7A4F;
  --am-green-soft: #E3F3EA;
  --am-dot-green: #3EBE75;
  --am-dot-red: #D64632;
  --am-ring-a: #D9902F;
  --am-ring-b: #B03D27;
  --am-focus: #016590;
  --am-shadow: 0 1px 2px rgba(1, 30, 47, .05);
  --am-dur: 250ms;
  --am-ease: cubic-bezier(.2, .7, .2, 1);

  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 7px;
  overflow: hidden; background: var(--am-frame); color: var(--am-ink);
  font-family: var(--font-sans, system-ui, sans-serif); font-size: 12px; line-height: 1.35;
  font-feature-settings: "cv11", "ss01", "tnum"; text-align: left;
  /* atalaya-mock.js escribe --am-zoom: el ancho del marco entre 1.160 px. */
  zoom: var(--am-zoom, 1);
}
.am[data-theme="dark"] {
  --am-frame: #000A10;
  --am-frame-2: #10232F;
  --am-frame-ink: #A9BCC6;
  --am-canvas: #0F1F29;
  --am-card: #162A36;
  --am-soft: #1C3442;
  --am-line: #24394A;
  --am-line-2: #2F4859;
  --am-ink: #E8EFF3;
  --am-ink-2: #A3B6C1;
  --am-ink-3: #93A8B4;
  --am-azure: #1F77A0;
  --am-azure-hover: #2A88B4;
  --am-mist: #8DBACB;
  --am-seg: #0A161E;
  --am-track: #24394A;
  --am-red: #F2A396;
  --am-red-soft: #3D2226;
  --am-red-strong: #E0624C;
  --am-red-line: #5C2E2E;
  --am-amber: #EBC27D;
  --am-amber-soft: #3A2F1C;
  --am-amber-strong: #D9A040;
  --am-blue: #93CBE5;
  --am-blue-soft: #18384C;
  --am-green: #82D8A6;
  --am-green-soft: #163628;
  --am-focus: #8DBACB;
  --am-shadow: none;
}
.am *, .am *::before, .am *::after { box-sizing: border-box; }
.am :focus-visible { outline: 2px solid var(--am-focus); outline-offset: 2px; }
:where(.am) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }   /* :where no pesa, y así .am-btn gana */
.am h2, .am h3, .am h4, .am p, .am ul, .am ol, .am dl, .am dt, .am dd { margin: 0; }
.am ul, .am ol { padding: 0; list-style: none; }
.am abbr { text-decoration: none; }
.am svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.am .am-vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.am-num { font-variant-numeric: tabular-nums; }
.am-muted { color: var(--am-ink-2); }

/* ---- La pantalla dentro del marco ----------------------------------------- */
/* Al escalar la consola, el lienzo se pinta una fila de píxeles más allá de
   donde llegan la barra de arriba y el carril, y por esa fila asomaba una
   línea clara junto a ellos. El propio fondo de la pantalla lleva, del color
   del marco, sus 2px de arriba bajo la barra (del 32 al 68 % del ancho) y sus
   2px de la izquierda junto al carril (del 18 al 61 % del alto), que se
   desvanecen antes del lienzo y no tocan las esquinas redondeadas. */
.am-screen {
  position: relative; height: 100%; border-radius: 16px; overflow: hidden;
  background: linear-gradient(90deg, transparent 20%, var(--am-frame) 32%, var(--am-frame) 68%, transparent 80%) top / 100% 2px no-repeat,
              linear-gradient(transparent 8%, var(--am-frame) 18%, var(--am-frame) 61%, transparent 71%) left / 2px 100% no-repeat,
              var(--am-canvas);
  transition: background-color var(--am-dur) var(--am-ease);
}

/* ---- Barra de arriba: sale del marco por el centro ------------------------ */
/* Empieza 2px por encima de la pantalla, que la recorta, y el carril 2px a la
   izquierda: así sus bordes no caen sobre el de la pantalla, donde asomaba el
   lienzo (lo cuenta el fondo de .am-screen). */
.am-top {
  position: absolute; z-index: 3; top: -2px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; height: 46px; padding: 2px 10px 0 14px;
  border-radius: 0 0 18px 18px; background: var(--am-frame); color: #fff; white-space: nowrap;
}
/* Las orejas: el codo cóncavo que une la barra con el marco. Cada una se mete
   2px bajo la barra, porque dos formas oscuras que solo se tocan dejaban ver
   el lienzo por la costura al escalar la consola: una línea clara en cada
   extremo, que Carlos vio en el hero de Atalaya. Miden 2px más de alto, lo que
   la barra sube, y el paso del degradado va centrado en 14px: la curva toca el
   borde de la pantalla y acaba justo en el de la barra. */
.am-top::before, .am-top::after {
  content: ""; position: absolute; top: 0; width: 16px; height: 16px; pointer-events: none;
}
.am-top::before { right: calc(100% - 2px); background: radial-gradient(circle at 0 100%, transparent 13.5px, var(--am-frame) 14.5px); }
.am-top::after { left: calc(100% - 2px); background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--am-frame) 14.5px); }
.am-brand { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; }
.am-brand__mark { width: 17px; height: 17px; background: url("../logo/harpe-mark-white.svg") center / contain no-repeat; }
.am-org {
  display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 6px;
  background: var(--am-mist); color: #011E2F; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
}
.am-top__sep { width: 1px; height: 20px; margin: 0 8px; background: var(--am-frame-line); }
.am-online {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--am-frame-2); font-size: 11.5px; color: var(--am-frame-ink);
}
.am-online b { color: #fff; font-weight: 700; font-size: 12px; }
.am-online__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--am-dot-green); box-shadow: 0 0 0 3px rgba(62, 190, 117, .18); }
.am-ibtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  color: #D6E2E8; transition: background-color var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease);
}
.am-ibtn svg { width: 15px; height: 15px; }
.am-ibtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.am-bell__dot { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--am-dot-red); box-shadow: 0 0 0 2px var(--am-frame); }
.am-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; margin: 0 2px; border-radius: 50%;
  background: var(--am-mist); color: #011E2F; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.am :where(.am-top, .am-rail) :focus-visible { outline-color: #fff; }

/* ---- Carril de la izquierda: sale del marco por el lado ------------------ */
.am-rail {
  position: absolute; z-index: 3; left: -2px; top: 142px; width: 54px; padding: 10px 0 10px 2px;
  border-radius: 0 22px 22px 0; background: var(--am-frame);
}
/* Las mismas orejas que la barra de arriba, y por lo mismo metidas 2px bajo el
   carril y 2px más anchas, lo que el carril sale por la izquierda. */
.am-rail::before, .am-rail::after { content: ""; position: absolute; left: 0; width: 16px; height: 16px; pointer-events: none; }
.am-rail::before { bottom: calc(100% - 2px); background: radial-gradient(circle at 100% 0, transparent 13.5px, var(--am-frame) 14.5px); }
.am-rail::after { top: calc(100% - 2px); background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--am-frame) 14.5px); }
.am-rail__list { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.am-railbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  color: var(--am-frame-ink); transition: background-color var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease);
}
.am-railbtn svg { width: 16px; height: 16px; }
.am-railbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.am-railbtn[aria-selected="true"] { background: #fff; color: #011E2F; }
.am-badge {
  position: absolute; top: -1px; right: -2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
  background: #C8452F; color: #fff; font-size: 9px; font-weight: 700; line-height: 15px; text-align: center; box-shadow: 0 0 0 2px var(--am-frame);
}
.am-badge[hidden] { display: none; }
.am-rail__sep { display: block; width: 22px; height: 1px; margin: 4px 0; background: var(--am-frame-line); }

/* ---- Zona de trabajo y cabecera de cada sección -------------------------- */
.am-main { position: absolute; inset: 0; padding: 14px 22px 16px 76px; }
.am-panel { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.am-panel[hidden] { display: none; }
.am-panel:focus-visible { outline-offset: -2px; }
.am-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 50px; flex: none; }
.am-head__text { max-width: 300px; }
.am-title { font-size: 23px; font-weight: 650; letter-spacing: -.015em; line-height: 1.15; color: var(--am-ink); }
.am-sub { margin-top: 3px; font-size: 12.5px; color: var(--am-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-head__right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; max-width: 340px; padding-top: 4px; }
.am-head__chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.am-head--crumbs { align-items: center; min-height: 40px; }
.am-crumbs { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--am-ink-2); }
.am-crumbs b { color: var(--am-ink); font-weight: 600; }
.am-crumbs__s { color: var(--am-ink-3); }
.am-back {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--am-card); color: var(--am-ink); box-shadow: 0 0 0 1px var(--am-line-2);
  transition: background-color var(--am-dur) var(--am-ease);
}
.am-back svg { width: 15px; height: 15px; }
.am-back:hover { background: var(--am-soft); }

/* ---- Tarjetas ------------------------------------------------------------- */
.am-card {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 16px; border-radius: 16px;
  background: var(--am-card); box-shadow: var(--am-shadow); transition: background-color var(--am-dur) var(--am-ease);
}
.am-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex: none; }
.am-card__t { font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: var(--am-ink); }
.am-card__note { font-size: 11.5px; color: var(--am-ink-2); white-space: nowrap; }
.am-link { font-size: 11.5px; font-weight: 600; color: var(--am-azure); }
.am[data-theme="dark"] .am-link { color: var(--am-blue); }
.am-link:hover { text-decoration: underline; }
.am-empty { padding: 18px 8px; text-align: center; color: var(--am-ink-2); }

/* ---- Pastillas: estado, gravedad y tiempos -------------------------------- */
.am-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--am-soft); color: var(--am-ink-2);
}
.am-chip svg { width: 12px; height: 12px; stroke-width: 2; }
.am-chip--red { background: var(--am-red-soft); color: var(--am-red); }
.am-chip--amber { background: var(--am-amber-soft); color: var(--am-amber); }
.am-chip--blue { background: var(--am-blue-soft); color: var(--am-blue); }
.am-chip--green { background: var(--am-green-soft); color: var(--am-green); }
.am-chip--line { background: transparent; box-shadow: inset 0 0 0 1px var(--am-line-2); color: var(--am-ink-2); }
.am-pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; flex: none;
  background: var(--am-card); box-shadow: inset 0 0 0 1px var(--am-line-2); font-size: 11px; font-weight: 600; color: var(--am-ink); white-space: nowrap;
}

/* ---- Botones, segmentos y buscador --------------------------------------- */
.am-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 15px; border-radius: 999px;
  background: var(--am-card); color: var(--am-ink); box-shadow: inset 0 0 0 1px var(--am-line-2);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease), box-shadow var(--am-dur) var(--am-ease);
}
.am-btn svg { width: 13px; height: 13px; stroke-width: 2; }
.am-btn:hover { background: var(--am-soft); }
.am-btn--primary { background: var(--am-azure); color: var(--am-on-azure); box-shadow: 0 4px 12px rgba(1, 101, 144, .22); }
.am-btn--primary:hover { background: var(--am-azure-hover); }
.am-btn--lg { height: 36px; padding: 0 18px; font-size: 12.5px; }
.am-btn[disabled] { opacity: .45; cursor: not-allowed; }
.am-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.am-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--am-seg); }
.am-seg__btn {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--am-ink-2); white-space: nowrap;
  transition: background-color var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease);
}
.am-seg__btn:hover { color: var(--am-ink); }
.am-seg__btn[aria-pressed="true"] { background: var(--am-card); color: var(--am-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(1, 30, 47, .12); }
.am-seg__n { color: var(--am-ink-3); font-weight: 500; }
.am-search { position: relative; display: flex; align-items: center; color: var(--am-ink-3); }
.am-search svg { position: absolute; left: 11px; width: 13px; height: 13px; pointer-events: none; }
.am-search input {
  width: 230px; height: 30px; padding: 0 12px 0 31px; border-radius: 999px; border: 0;
  background: var(--am-soft); color: var(--am-ink); font: inherit; font-size: 12px;
}
.am-search input::placeholder { color: var(--am-ink-3); opacity: 1; }
.am-search input::-webkit-search-cancel-button { appearance: none; }
.am-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex: none; }

/* ---- Actividad ------------------------------------------------------------ */
.am-dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; flex: 1; min-height: 0; }
.am-kpi { justify-content: center; gap: 4px; padding: 14px 18px; }
.am-kpi--cov { flex-direction: row; align-items: center; gap: 14px; }
.am-kpi__l { font-size: 12px; color: var(--am-ink-2); }
.am-kpi__n { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; color: var(--am-ink); }
.am-kpi__of { font-size: 15px; font-weight: 500; color: var(--am-ink-2); }
.am-kpi__s { font-size: 11.5px; color: var(--am-ink-2); }
.am-kpi__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.am-kpi--cov .am-chip { margin-top: 5px; }
.am-meter { position: relative; height: 5px; margin: 3px 0 2px; border-radius: 999px; background: var(--am-track); overflow: hidden; }
.am-meter i { position: absolute; inset: 0 auto 0 0; width: calc(var(--w, 12) * 1%); border-radius: 999px; background: var(--am-azure); transition: width 1.6s var(--am-ease); }
.am-card--chart { grid-column: span 2; }
.am-card--inc { grid-column: span 2; }
.am-card--sys, .am-card--agent { grid-column: span 2; }

/* Anillos: cobertura y riesgo, con conic-gradient y una máscara */
.am-ring { position: relative; display: grid; place-items: center; width: 64px; aspect-ratio: 1; flex: none; border-radius: 50%; transition: --am-p .9s var(--am-ease); }
.am-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--am-ring-a) 0, var(--am-ring-b) calc(var(--am-p) * 1%), var(--am-track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6.5px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6.5px), #000 calc(100% - 6px));
}
.am-ring--cov { --am-ring-a: var(--am-azure); --am-ring-b: #2E86AE; }
.am-ring__v { position: relative; display: grid; justify-items: center; line-height: 1.05; }
.am-ring__v b { font-size: 14px; font-weight: 700; color: var(--am-ink); }
.am-ring__v small { font-size: 9.5px; color: var(--am-ink-2); }
.am-ring--risk { width: 80px; }
.am-ring--risk .am-ring__v b { font-size: 19px; letter-spacing: -.02em; }
.am-ring--risk::before { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7.5px)); }
.am-ring--low { --am-ring-a: #6FA6BF; --am-ring-b: var(--am-azure); }
.am-ring--medium { --am-ring-a: #E0B04F; --am-ring-b: var(--am-amber-strong); }

/* Gráfico de barras */
.am-chartbox { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.am-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; flex: 1; min-height: 60px; padding-top: 6px; border-bottom: 1px solid var(--am-line); }
.am-bar { position: relative; height: calc(var(--h, 20) * 1%); min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--am-mist); transform-origin: bottom; transition: height .5s var(--am-ease); }
.am-bar--alert { background: var(--am-red-strong); }
.am-bar--now { background: var(--am-azure); }
.am-chart__x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-top: 6px; font-size: 10.5px; color: var(--am-ink-3); flex: none; }
.am-chart__x span { justify-self: center; white-space: nowrap; }
.am-chart__x span:last-child { justify-self: end; }
.am-chart.will-in .am-bar { transform: scaleY(0); }
.am-chart.is-in .am-bar { transform: none; transition: transform .6s var(--am-ease), height .5s var(--am-ease); transition-delay: calc(var(--i, 0) * 22ms), 0s; }

/* Filas de incidente, como en «Incidentes abiertos» del kit */
.am-irows { display: grid; gap: 7px; align-content: start; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--am-line-2) transparent; }
.am-irow {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 11px; width: 100%;
  padding: 8px 12px 8px 10px; border-radius: 12px; background: var(--am-soft); text-align: left; color: inherit;
  transition: box-shadow var(--am-dur) var(--am-ease);
}
.am-irow:hover { box-shadow: inset 0 0 0 1px var(--am-line-2); }
.am-irow__ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; }
.am-irow__ic svg { width: 14px; height: 14px; }
.am-irow__ic--high { background: var(--am-red-soft); color: var(--am-red); }
.am-irow__ic--medium { background: var(--am-amber-soft); color: var(--am-amber); }
.am-irow__ic--low { background: var(--am-blue-soft); color: var(--am-blue); }
.am-irow__t { display: block; font-size: 12.5px; font-weight: 600; color: var(--am-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-irow__s { display: block; margin-top: 1px; font-size: 11px; color: var(--am-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-irow.is-new { animation: am-in .55s var(--am-ease) both; }

/* Sistemas y agente */
.am-sysrows { display: grid; gap: 9px; }
.am-sys { display: grid; grid-template-columns: 70px minmax(0, 1fr) 48px; align-items: center; gap: 10px; }
.am-sys__n { font-weight: 500; }
.am-sys__bar { position: relative; height: 7px; border-radius: 999px; background: var(--am-track); overflow: hidden; }
.am-sys__bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--w, 10) * 1%); border-radius: 999px; background: var(--am-mist); }
.am-sys b { text-align: right; font-weight: 600; }
.am-mode { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 10px; font-size: 11.5px; color: var(--am-ink-2); }
.am-mode__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--am-dot-green); }
.am-arows { display: grid; gap: 6px; }
.am-arow { display: flex; align-items: center; gap: 8px; min-height: 26px; padding: 0 10px; border-radius: 10px; background: var(--am-soft); }
.am-arow > span:first-child { flex: 1; color: var(--am-ink-2); }
.am-arow b { font-weight: 600; color: var(--am-ink); }

/* ---- Incidente: la página del kit ---------------------------------------- */
.am-idet { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1.16fr) minmax(0, .84fr); gap: 12px; flex: 1; min-height: 0; }
.am-ihead { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 18px; padding: 14px 18px; }
.am-ihead__main { flex: 1; min-width: 0; }
.am-ihead__t { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--am-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-fields { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.am-field { padding: 5px 10px 6px; border-radius: 10px; background: var(--am-soft); }
.am-field dt { font-size: 10.5px; color: var(--am-ink-2); }
.am-field dd { margin-top: 1px; font-size: 12.5px; font-weight: 600; color: var(--am-ink); white-space: nowrap; }
.am-ihead__side { display: flex; align-items: center; gap: 14px; padding-left: 18px; border-left: 1px solid var(--am-line); }
.am-decision h3 { font-size: 13.5px; font-weight: 700; color: var(--am-red); }
.am-decision--medium h3 { color: var(--am-amber); }
.am-decision--low h3 { color: var(--am-blue); }
.am-decision p { margin-top: 3px; font-size: 11.5px; color: var(--am-ink-2); white-space: nowrap; }
.am-tl { display: grid; gap: 5px; align-content: start; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--am-line-2) transparent; }
.am-tl li { display: grid; grid-template-columns: auto minmax(0, 1fr) 36px auto; align-items: center; gap: 10px; min-height: 29px; }
.am-tl__t { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--am-soft); font-size: 11px; color: var(--am-ink); }
.am-tl__x { font-size: 12px; font-weight: 600; color: var(--am-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-tl li.is-bad .am-tl__x { color: var(--am-red); }
.am-tl__r { font-size: 12.5px; font-weight: 700; text-align: right; color: var(--am-ink); }
.am-tl li > .am-chip { justify-self: end; }
.am-tl.is-anim li { animation: am-step .4s var(--am-ease) both; animation-delay: calc(var(--i, 0) * 320ms); }
.am-acts { display: grid; gap: 7px; align-content: start; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--am-line-2) transparent; }
.am-act { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--am-soft); }
.am-act__ok { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--am-azure); color: #fff; }
.am-act__ok svg { width: 13px; height: 13px; stroke-width: 2.4; }
.am-act__txt b { display: block; font-size: 12px; font-weight: 600; color: var(--am-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-act__txt span { display: block; margin-top: 1px; font-size: 11px; color: var(--am-ink-2); }
.am-tree { display: grid; gap: 7px; align-content: start; }
.am-node {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; height: 30px; padding: 0 11px;
  border-radius: 10px; background: var(--am-soft); font-size: 12px; white-space: nowrap; overflow: hidden;
}
.am-node svg { width: 14px; height: 14px; color: var(--am-ink-2); }
.am-node b { font-weight: 600; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }
.am-node__pid { color: var(--am-ink-2); }
.am-node--child { position: relative; margin-left: 20px; }
.am-node--child::before { content: ""; position: absolute; left: -12px; top: -8px; width: 9px; height: 22px; border-left: 1.5px solid var(--am-line-2); border-bottom: 1.5px solid var(--am-line-2); border-bottom-left-radius: 6px; }
.am-node--child + .am-node--child { margin-left: 40px; }
.am-node.is-bad { background: var(--am-red-soft); box-shadow: inset 0 0 0 1px var(--am-red-line); }
.am-node.is-bad svg { color: var(--am-red); }
.am-node__end { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--am-red); }
.am-node__end svg { width: 12px; height: 12px; color: var(--am-red); stroke-width: 2.2; }
.am-fxs { display: grid; align-content: start; }
.am-fx { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 34px; border-bottom: 1px solid var(--am-line); }
.am-fx:last-child { border-bottom: 0; }
.am-fx svg { width: 14px; height: 14px; color: var(--am-ink-2); }
.am-fx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Tablas: equipos y usuarios ------------------------------------------- */
.am-card--table, .am-card--fill { flex: 1; min-height: 0; }
.am-card__body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.am-card--fill > .am-irows, .am-card--fill > .am-audit { flex: 1; }
.am-tablewrap { flex: 1; min-height: 0; overflow: auto; margin: 0 -16px -14px; scrollbar-width: thin; scrollbar-color: var(--am-line-2) transparent; }
.am-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.am-table th, .am-table td { padding: 7px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--am-line); }
.am-table th:first-child, .am-table td:first-child { padding-left: 16px; }
.am-table th { position: sticky; top: 0; z-index: 1; height: 34px; background: var(--am-card); font-size: 11.5px; font-weight: 500; color: var(--am-ink-3); }
.am-table tbody tr:last-child td { border-bottom: 0; }
.am-table tbody tr:hover td { background: var(--am-soft); }
.am-td-id { font-weight: 600; letter-spacing: .01em; }
.am-td-u { display: block; font-weight: 600; }
.am-td-g { display: block; margin-top: 1px; font-size: 11px; color: var(--am-ink-2); }
.am-risk { display: inline-flex; align-items: center; gap: 9px; }
.am-risk i { position: relative; width: 74px; height: 6px; border-radius: 999px; background: var(--am-track); overflow: hidden; }
.am-risk i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--w, 2) * 1%); border-radius: 999px; background: var(--am-mist); }
.am-risk--medium i::before { background: var(--am-amber-strong); }
.am-risk--high i::before { background: var(--am-red-strong); }
.am-risk span { font-weight: 600; }
.am-uav { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 9px; border-radius: 50%; background: var(--am-blue-soft); color: var(--am-blue); font-size: 9.5px; font-weight: 700; vertical-align: middle; }

/* ---- Políticas ------------------------------------------------------------ */
.am-policies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 12px; flex: 1; min-height: 0; align-content: start; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--am-line-2) transparent; }
.am-pol__head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 8px; }
.am-pol__ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: #011E2F; color: #fff; }
.am-pol__ic svg { width: 15px; height: 15px; }
.am-pol__sub { display: block; margin-top: 1px; font-size: 11px; color: var(--am-ink-2); }
.am-policy.is-off .am-rules { opacity: .55; }
.am-rules { display: grid; gap: 2px; }
/* La fila entera es el interruptor (role=switch): el nombre accesible es su texto y
   el objetivo de toque es toda la fila, no el dibujo */
.am-rule { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 0 8px; margin: 0 -8px; border-radius: 9px; font-size: 12px; color: var(--am-ink-2); text-align: left; transition: background-color var(--am-dur) var(--am-ease); }
.am-rule:hover { background: var(--am-soft); }
.am-switch { position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 999px; background: var(--am-line-2); flex: none; transition: background-color var(--am-dur) var(--am-ease); }
.am-switch::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform var(--am-dur) var(--am-ease); }
.am-rule[aria-checked="true"] { color: var(--am-ink); }
.am-rule[aria-checked="true"] .am-switch { background: var(--am-azure); }
.am-rule[aria-checked="true"] .am-switch::before { transform: translateX(14px); }

/* ---- Auditoría ------------------------------------------------------------ */
.am-audit { display: grid; align-content: start; min-height: 0; overflow: auto; margin: 0 -16px -14px; padding: 0 16px; scrollbar-width: thin; scrollbar-color: var(--am-line-2) transparent; }
.am-audit li { display: grid; grid-template-columns: 76px 92px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 36px; border-bottom: 1px solid var(--am-line); font-size: 12px; }
.am-audit li:last-child { border-bottom: 0; }
.am-audit .am-chip { justify-self: start; }
.am-audit li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-audit li.is-new { animation: am-in .55s var(--am-ease) both; }

/* ---- Aviso breve ---------------------------------------------------------- */
.am-toast {
  position: absolute; left: 50%; bottom: 16px; z-index: 5; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  padding: 9px 16px; border-radius: 999px; background: #011E2F; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(1, 30, 47, .3); transition: opacity var(--am-dur) var(--am-ease), transform var(--am-dur) var(--am-ease);
}
.am-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@keyframes am-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes am-step { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes am-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
.am-meter.is-live i { animation: am-breathe 3s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .am { --am-dur: 0ms; }
  .am-ring { transition: none; }
  .am-irow.is-new, .am-audit li.is-new, .am-tl.is-anim li, .am-meter.is-live i { animation: none; }
  .am-chart.will-in .am-bar, .am-chart.is-in .am-bar { transform: none; transition: none; }
  .am-bar, .am-meter i, .am-toast { transition: none; }
}
@media (forced-colors: active) {
  .am-ring::before { background: CanvasText; }
  .am-railbtn[aria-selected="true"] { outline: 2px solid CanvasText; }
}

/* ---- Pantallas estrechas: la consola se recoloca en lugar de escalarse --- */
@media (max-width: 1023px) {
  .am { zoom: 1; aspect-ratio: auto; height: min(760px, 88vh); padding: 6px; }
  /* Aquí el carril va en fila bajo la barra: la banda de la izquierda sobra. */
  .am-screen { display: flex; flex-direction: column; background: linear-gradient(var(--am-frame), var(--am-frame)) top / 100% 2px no-repeat, var(--am-canvas); }
  .am-top { position: relative; top: auto; left: auto; transform: none; flex: none; justify-content: flex-start; gap: 2px; width: 100%; height: 46px; padding: 0 8px 0 12px; border-radius: 0; overflow-x: auto; scrollbar-width: none; }
  .am-top::before, .am-top::after { display: none; }
  .am-top .am-avatar, .am-top .am-org { display: none; }
  .am-rail { position: relative; top: auto; left: auto; width: 100%; padding: 6px 8px; border-radius: 0 0 14px 14px; flex: none; overflow-x: auto; scrollbar-width: none; }
  .am-rail::before, .am-rail::after { display: none; }
  .am-rail__list { flex-direction: row; justify-content: flex-start; gap: 6px; }
  .am-rail__sep { width: 1px; height: 22px; margin: 0 2px; }
  .am-railbtn { width: 40px; height: 40px; flex: none; }
  .am-main { position: relative; inset: auto; flex: 1; min-height: 0; padding: 14px; overflow: auto; scrollbar-width: thin; }
  .am-panel { height: auto; }
  .am-head { flex-wrap: wrap; min-height: 0; }
  .am-head__text { max-width: none; }
  .am-head__right { max-width: none; justify-content: flex-start; }
  .am-sub { white-space: normal; }
  .am-dash { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .am-card--chart, .am-card--inc, .am-card--sys, .am-card--agent { grid-column: 1 / -1; }
  .am-card--chart { min-height: 200px; }
  .am-idet { grid-template-columns: 1fr; grid-template-rows: none; }
  .am-ihead { flex-direction: column; align-items: flex-start; }
  .am-ihead__t { white-space: normal; }
  .am-ihead__side { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--am-line); width: 100%; }
  .am-decision p { white-space: normal; }
  .am-node { height: auto; min-height: 30px; padding: 6px 11px; flex-wrap: wrap; white-space: normal; }
  .am-tl, .am-acts, .am-irows, .am-audit, .am-policies, .am-tablewrap { overflow: visible; }
  .am-card--table, .am-card--fill { flex: none; }
  .am-tablewrap { overflow-x: auto; }
  .am-policies { grid-template-columns: 1fr 1fr; }
  .am-search input { width: 200px; }
}
@media (max-width: 699px) {
  .am { height: min(720px, 86vh); }
  .am-dash { grid-template-columns: 1fr; }
  .am-policies { grid-template-columns: 1fr; }
  .am-toolbar .am-search, .am-toolbar .am-search input { width: 100%; }
  .am-tl li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .am-tl__x, .am-act__txt b, .am-irow__t, .am-irow__s { white-space: normal; }
  .am-tl__r { display: none; }
  .am-audit li { grid-template-columns: 70px minmax(0, 1fr); }
  .am-audit li > .am-chip { display: none; }
  .am-btn, .am-seg__btn, .am-rule, .am-search input { min-height: 36px; }
  .am-ibtn { width: 36px; height: 36px; }
  .am-toast { white-space: normal; max-width: calc(100% - 28px); text-align: center; border-radius: 14px; }
}
