/* ============================================================
   AI AGENTS · CINEMATIC OPERATIONS BRIDGE
   Replaces the old hv2-theater with a real-photo-backed,
   cinematic command-bridge layout.
============================================================ */

.aat {
  position: relative;
  border: 1px solid var(--site-line, rgba(255,255,255,0.08));
  background: #05070f;
  overflow: hidden;
  isolation: isolate;
  border-radius: 4px;
}

/* === Backdrop layer: real photo + tint + grid === */
.aat-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.32;
  filter: saturate(0.85) contrast(1.05);
  z-index: 0;
}
.aat-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(0, 85, 255, 0.35), transparent 65%),
    radial-gradient(80% 60% at 50% 100%, rgba(94, 255, 164, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(5, 7, 15, 0.55) 0%, rgba(5, 7, 15, 0.82) 60%, rgba(5, 7, 15, 0.95) 100%);
}
.aat-grid {
  position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(rgba(79, 200, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 200, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, #000 30%, transparent 100%);
}
.aat-scan {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(94, 255, 164, 0.08) 50%,
    transparent 100%);
  height: 280px;
  animation: aat-scan 7.5s linear infinite;
}
@keyframes aat-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(700%); }
}
.aat-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 180px 30px rgba(0, 0, 0, 0.7);
}

/* Inner content sits above all backdrop layers */
.aat-inner { position: relative; z-index: 3; }

/* === TOP BAR — chrome === */
.aat-bar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 26px;
  border-bottom: 1px solid rgba(79, 200, 255, 0.15);
  background: linear-gradient(180deg, rgba(5,9,22,0.7), rgba(5,9,22,0.3));
  backdrop-filter: blur(8px);
}
.aat-bar-l, .aat-bar-c, .aat-bar-r {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10.5px; letter-spacing: 0.22em;
  color: rgba(180, 200, 240, 0.7);
  text-transform: uppercase;
}
.aat-bar-c { text-align: center; color: #fff; }
.aat-bar-r { text-align: right; }
.aat-bar-r .pulse {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 999px;
  background: #5EFFA4;
  margin-right: 8px;
  box-shadow: 0 0 12px rgba(94, 255, 164, 0.9);
  animation: aat-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes aat-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.78); }
}
.aat-bar-r .live { color: #5EFFA4; font-weight: 600; letter-spacing: 0.28em; }

/* === HEADLINE === */
.aat-head {
  padding: 38px 36px 28px;
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: end;
  border-bottom: 1px solid rgba(79, 200, 255, 0.1);
}
@media (max-width: 900px) { .aat-head { grid-template-columns: 1fr; } }
.aat-head-eyebrow {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px; letter-spacing: 0.28em;
  color: #5EFFA4; text-transform: uppercase;
  margin-bottom: 18px;
}
.aat-head-h {
  font-family: var(--font-display, "Söhne", Inter, system-ui, sans-serif);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.0; letter-spacing: -0.028em;
  color: #fff; margin: 0;
  text-wrap: balance;
}
.aat-head-h em {
  font-style: normal;
  background: linear-gradient(92deg, #5EFFA4 0%, #4FC8FF 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.aat-head-sub {
  font-size: 14.5px; line-height: 1.5;
  color: rgba(220, 230, 250, 0.7);
  text-wrap: pretty;
  max-width: 420px;
}

/* === TELEMETRY — big numbers === */
.aat-tele {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid rgba(79, 200, 255, 0.1);
  background: linear-gradient(180deg, rgba(5, 11, 28, 0.5), rgba(5, 11, 28, 0.2));
}
@media (max-width: 800px) { .aat-tele { grid-template-columns: repeat(2, 1fr); } }
.aat-tele-cell {
  padding: 22px 22px;
  border-right: 1px solid rgba(79, 200, 255, 0.08);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.aat-tele-cell:last-child { border-right: 0; }
.aat-tele-cell .l {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.22em;
  color: rgba(160, 180, 220, 0.6);
  text-transform: uppercase;
}
.aat-tele-cell .v {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1; color: #fff; font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.aat-tele-cell .d {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.18em;
  color: rgba(94, 255, 164, 0.8);
}
.aat-tele-cell.warn .v { color: #FFB020; }
.aat-tele-cell.warn .d { color: rgba(255, 176, 32, 0.85); }

/* === MAIN BAY: roster · mission · status === */
.aat-bay {
  display: grid;
  grid-template-columns: 330px 1fr 320px;
  min-height: 540px;
  border-bottom: 1px solid rgba(79, 200, 255, 0.1);
}
@media (max-width: 1100px) { .aat-bay { grid-template-columns: 300px 1fr; }
  .aat-status-col { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(79, 200, 255, 0.1); }
}
@media (max-width: 700px) {
  .aat-bay { grid-template-columns: 1fr; }
  .aat-roster-col { border-right: 0; border-bottom: 1px solid rgba(79, 200, 255, 0.1); }
}

/* ---- Column header (shared) ---- */
.aat-col-h {
  padding: 14px 18px 12px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(79, 200, 255, 0.08);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.24em;
  color: rgba(160, 180, 220, 0.55);
  text-transform: uppercase;
}
.aat-col-h .accent { color: #5EFFA4; }

/* === LEFT: AGENT ROSTER === */
.aat-roster-col {
  border-right: 1px solid rgba(79, 200, 255, 0.1);
  background: rgba(3, 6, 16, 0.5);
}
.aat-roster {
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.aat-agent {
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: rgba(8, 14, 32, 0.55);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  text-align: left;
  font: inherit;
}
.aat-agent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: transparent;
  transition: background 0.2s ease;
}
.aat-agent:hover {
  background: rgba(15, 25, 55, 0.7);
  border-color: rgba(79, 200, 255, 0.25);
}
.aat-agent.on {
  background: linear-gradient(90deg, rgba(15, 35, 75, 0.85), rgba(8, 14, 32, 0.55));
  border-color: rgba(94, 255, 164, 0.45);
  transform: translateX(2px);
}
.aat-agent.on::before { background: linear-gradient(180deg, #5EFFA4, #4FC8FF); }
.aat-agent-ico {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 2px;
  background: rgba(79, 200, 255, 0.08);
  border: 1px solid rgba(79, 200, 255, 0.2);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px; letter-spacing: 0.15em;
  color: #4FC8FF; font-weight: 600;
}
.aat-agent.on .aat-agent-ico {
  background: rgba(94, 255, 164, 0.12);
  border-color: rgba(94, 255, 164, 0.45);
  color: #5EFFA4;
  box-shadow: 0 0 18px rgba(94, 255, 164, 0.3);
}
.aat-agent-body { min-width: 0; }
.aat-agent-name {
  font-size: 14px; color: #fff; font-weight: 500; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aat-agent-st {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.12em;
  color: rgba(180, 200, 240, 0.55);
  margin-top: 3px;
  display: flex; align-items: center; gap: 6px;
}
.aat-agent-st .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: #4FC8FF; box-shadow: 0 0 8px rgba(79, 200, 255, 0.7);
}
.aat-agent-st.am .dot { background: #FFB020; box-shadow: 0 0 8px rgba(255, 176, 32, 0.8); }
.aat-agent-st.mt .dot { background: #5EFFA4; box-shadow: 0 0 8px rgba(94, 255, 164, 0.8); }
.aat-agent-tag {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 9.5px; letter-spacing: 0.2em;
  color: rgba(180, 200, 240, 0.5);
  padding: 4px 8px;
  border: 1px solid rgba(180, 200, 240, 0.15);
  border-radius: 2px;
}

/* === CENTER: ACTIVE MISSION === */
.aat-stage {
  position: relative;
  display: flex; flex-direction: column;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(0, 85, 255, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(8, 14, 30, 0.3), rgba(5, 9, 22, 0.6));
}
.aat-stage-head {
  padding: 22px 28px 16px;
  border-bottom: 1px solid rgba(79, 200, 255, 0.08);
}
.aat-stage-eyebrow {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.24em;
  color: rgba(94, 255, 164, 0.8);
  text-transform: uppercase; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.aat-stage-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: #5EFFA4; box-shadow: 0 0 10px rgba(94, 255, 164, 0.9);
  animation: aat-pulse 1.4s ease-in-out infinite;
}
.aat-stage-name {
  font-family: var(--font-display, "Söhne", Inter, system-ui, sans-serif);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.05; letter-spacing: -0.02em;
  color: #fff; font-weight: 400; margin: 0;
}
.aat-stage-meta {
  margin-top: 10px;
  display: flex; gap: 18px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10.5px; letter-spacing: 0.16em;
  color: rgba(180, 200, 240, 0.55);
}
.aat-stage-meta span b { color: #fff; font-weight: 500; }

/* Flow steps */
.aat-flow {
  padding: 24px 28px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 0; align-items: stretch;
}
.aat-flow-step {
  position: relative;
  padding: 14px 12px 14px 16px;
  border: 1px solid rgba(79, 200, 255, 0.12);
  border-right: 0;
  background: rgba(5, 11, 28, 0.55);
}
.aat-flow-step:first-child { border-radius: 2px 0 0 2px; }
.aat-flow-step:last-child { border-right: 1px solid rgba(79, 200, 255, 0.12); border-radius: 0 2px 2px 0; }
.aat-flow-step.done { background: rgba(94, 255, 164, 0.06); border-color: rgba(94, 255, 164, 0.25); }
.aat-flow-step.on {
  background: linear-gradient(180deg, rgba(0, 85, 255, 0.35), rgba(94, 255, 164, 0.15));
  border-color: rgba(94, 255, 164, 0.65);
  box-shadow: 0 0 22px rgba(0, 85, 255, 0.35) inset, 0 0 18px rgba(94, 255, 164, 0.18);
}
.aat-flow-num {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 9.5px; letter-spacing: 0.2em;
  color: rgba(160, 180, 220, 0.55);
}
.aat-flow-step.on .aat-flow-num { color: #5EFFA4; }
.aat-flow-step.done .aat-flow-num { color: rgba(94, 255, 164, 0.7); }
.aat-flow-name {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  color: #fff;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.aat-flow-step.on .aat-flow-name { color: #fff; }
.aat-flow-step .aat-flow-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(94, 255, 164, 0.15);
  overflow: hidden;
}
.aat-flow-step.on .aat-flow-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #5EFFA4, #4FC8FF);
  animation: aat-fill 2.4s linear infinite;
}
@keyframes aat-fill { 0% { transform: translateX(-100%); } 100% { transform: translateX(0); } }

/* Terminal stream */
.aat-term {
  margin: 6px 28px 24px;
  border: 1px solid rgba(79, 200, 255, 0.12);
  border-radius: 3px;
  background: rgba(2, 4, 12, 0.85);
  overflow: hidden;
}
.aat-term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(79, 200, 255, 0.1);
  background: rgba(5, 9, 22, 0.6);
}
.aat-term-bar .dots { display: flex; gap: 5px; }
.aat-term-bar .dots span {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(180, 200, 240, 0.2);
}
.aat-term-bar .dots span:nth-child(1) { background: #FF6058; }
.aat-term-bar .dots span:nth-child(2) { background: #FFBD2E; }
.aat-term-bar .dots span:nth-child(3) { background: #28C940; }
.aat-term-bar .ttl {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.18em;
  color: rgba(180, 200, 240, 0.5);
  margin-left: 6px;
}
.aat-term-body {
  padding: 14px 16px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 12px;
  line-height: 1.75;
  color: rgba(220, 230, 250, 0.85);
  min-height: 160px;
}
.aat-term-line { display: flex; gap: 10px; align-items: baseline; }
.aat-term-line .ts { color: rgba(160, 180, 220, 0.5); letter-spacing: 0.06em; font-size: 11px; }
.aat-term-line .arr { color: #5EFFA4; }
.aat-term-line .v { color: rgba(220, 230, 250, 0.9); }
.aat-term-line.cy .arr { color: #4FC8FF; }
.aat-term-line.am .arr { color: #FFB020; }
.aat-term-line.am .v { color: #FFD580; }
.aat-term-line .caret {
  display: inline-block; width: 7px; height: 14px;
  background: #5EFFA4; margin-left: 2px; vertical-align: -2px;
  animation: aat-blink 1s steps(1) infinite;
}
@keyframes aat-blink { 50% { opacity: 0; } }

/* === RIGHT: STATUS COLUMN === */
.aat-status-col {
  border-left: 1px solid rgba(79, 200, 255, 0.1);
  background: rgba(3, 6, 16, 0.5);
  display: flex; flex-direction: column;
}

.aat-card {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(79, 200, 255, 0.08);
}
.aat-card:last-child { border-bottom: 0; }
.aat-card-h {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.22em;
  color: rgba(160, 180, 220, 0.55);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.aat-card-h .badge {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 9.5px; letter-spacing: 0.18em;
  padding: 3px 8px; border-radius: 2px;
  background: rgba(255, 176, 32, 0.14);
  color: #FFB020;
  border: 1px solid rgba(255, 176, 32, 0.35);
}

/* HITL */
.aat-hitl-task {
  border: 1px solid rgba(255, 176, 32, 0.3);
  background: linear-gradient(180deg, rgba(255, 176, 32, 0.06), rgba(255, 176, 32, 0.02));
  border-radius: 3px; padding: 14px;
}
.aat-hitl-name {
  font-size: 14px; color: #fff; font-weight: 500;
  margin-bottom: 4px; letter-spacing: -0.005em;
}
.aat-hitl-action {
  font-size: 13px; color: rgba(220, 230, 250, 0.7); line-height: 1.5;
}
.aat-hitl-meta {
  margin-top: 10px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.18em;
  color: #FFB020;
}
.aat-hitl-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px;
}
.aat-hitl-btn {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 10px 12px; border-radius: 2px; cursor: pointer;
  background: rgba(15, 25, 55, 0.7); color: rgba(220, 230, 250, 0.85);
  border: 1px solid rgba(79, 200, 255, 0.2);
  transition: all 0.2s ease;
}
.aat-hitl-btn:hover { border-color: rgba(94, 255, 164, 0.45); color: #fff; }
.aat-hitl-btn.ok { background: rgba(94, 255, 164, 0.12); border-color: rgba(94, 255, 164, 0.45); color: #5EFFA4; }
.aat-hitl-btn.ok:hover { background: rgba(94, 255, 164, 0.22); }

/* Gauges */
.aat-gauges {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.aat-gauge {
  border: 1px solid rgba(79, 200, 255, 0.12);
  background: rgba(8, 14, 32, 0.55);
  border-radius: 3px;
  padding: 12px;
}
.aat-gauge-l {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 9.5px; letter-spacing: 0.18em;
  color: rgba(160, 180, 220, 0.55);
  text-transform: uppercase;
}
.aat-gauge-v {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 22px; line-height: 1.1; color: #fff;
  margin-top: 4px; font-variant-numeric: tabular-nums;
}
.aat-gauge-bar {
  margin-top: 8px; height: 4px; border-radius: 999px;
  background: rgba(79, 200, 255, 0.1);
  overflow: hidden;
}
.aat-gauge-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #4FC8FF, #5EFFA4);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.aat-gauge.warn .aat-gauge-v { color: #FFB020; }
.aat-gauge.warn .aat-gauge-bar > div { background: linear-gradient(90deg, #FFB020, #FF6058); }

/* Tools */
.aat-tools {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.aat-tool {
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 10px; letter-spacing: 0.12em;
  padding: 8px 8px;
  border: 1px solid rgba(79, 200, 255, 0.15);
  background: rgba(8, 14, 32, 0.55);
  color: rgba(220, 230, 250, 0.7);
  border-radius: 2px;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.aat-tool.on {
  background: rgba(94, 255, 164, 0.12);
  border-color: rgba(94, 255, 164, 0.5);
  color: #5EFFA4;
  box-shadow: 0 0 14px rgba(94, 255, 164, 0.25);
}

/* === BOTTOM TICKER === */
.aat-ticker {
  padding: 14px 20px;
  background: rgba(2, 4, 12, 0.85);
  border-top: 1px solid rgba(79, 200, 255, 0.1);
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px; letter-spacing: 0.14em;
  color: rgba(220, 230, 250, 0.7);
  overflow: hidden;
  white-space: nowrap;
}
.aat-ticker .lbl {
  color: #5EFFA4;
  padding: 4px 10px;
  border: 1px solid rgba(94, 255, 164, 0.4);
  border-radius: 2px;
  letter-spacing: 0.2em;
  flex-shrink: 0;
}
.aat-ticker-stream {
  display: inline-flex; gap: 32px;
  animation: aat-stream 38s linear infinite;
}
@keyframes aat-stream {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.aat-ticker-item .arr { color: #4FC8FF; margin-right: 6px; }
.aat-ticker-item .ts { color: rgba(160, 180, 220, 0.4); margin-right: 8px; }
