/* ============================================================================
   F5 AI Guardrails Demo — Runtime HUD V2
   Self-contained stylesheet. Rewritten from mock (docs/mockups/redesign-v2*.html).
   Paints the HUD layout while covering every class/ID app.js touches.
   ============================================================================ */

:root {
  /* Obsidian palette */
  --bg:       #05070b;
  --bg-1:     #0a0d13;
  --bg-2:     #11151d;
  --bg-3:     #171c25;
  --panel:    rgba(10, 13, 19, 0.68);
  --panel-2:  rgba(13, 17, 26, 0.82);

  --line:     rgba(255, 255, 255, 0.06);
  --line-hi:  rgba(255, 255, 255, 0.14);
  --line-xhi: rgba(0, 229, 255, 0.35);

  /* Ink */
  --ink:       #e9eef7;
  --ink-dim:   #99a3b8;
  --ink-fade:  #5d6678;
  --ink-mute:  #3b4253;

  /* Signals */
  --cyan:         #00e5ff;
  --cyan-dim:     #0099c4;
  --cyan-ghost:   rgba(0, 229, 255, 0.14);
  --violet:       #a989ff;
  --violet-ghost: rgba(169, 137, 255, 0.16);
  --coral:        #ff5a4d;
  --coral-ghost:  rgba(255, 90, 77, 0.16);
  --lime:         #b6ff5c;
  --lime-ghost:   rgba(182, 255, 92, 0.16);
  --amber:        #ffb23f;
  --amber-ghost:  rgba(255, 178, 63, 0.16);

  /* Radii */
  --r-lg:   18px;
  --r-md:   12px;
  --r-sm:   10px;
  --r-pill: 100px;

  /* Fonts */
  --font-display: "Unbounded", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body:    "Archivo", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Legacy color tokens used by app.js via inline style.color */
  --risk-low:     var(--lime);
  --risk-medium:  var(--amber);
  --risk-high:    var(--coral);
  --accent-green: var(--lime);
  --accent-yellow: var(--amber);
  --accent-cyan:  var(--cyan);
  --text-muted:   var(--ink-fade);
}

/* ============================================================================
   Reset + base
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overflow-x: hidden; position: relative; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
p { margin: 0; color: var(--ink-dim); }

input, select, textarea, button { font-family: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }

/* Aurora mesh — fixed behind everything */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 520px at 12% 18%, rgba(0, 229, 255, 0.18), transparent 60%),
    radial-gradient(720px 620px at 88% 8%, rgba(169, 137, 255, 0.16), transparent 60%),
    radial-gradient(800px 700px at 60% 90%, rgba(255, 90, 77, 0.10), transparent 60%),
    radial-gradient(480px 380px at 4% 72%, rgba(0, 229, 255, 0.08), transparent 55%);
  filter: blur(10px) saturate(140%);
  animation: v2-drift 28s ease-in-out infinite alternate;
}
@keyframes v2-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, -1%, 0) scale(1.05); }
}

/* Hairline grid overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
/* Grain */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Typography primitives */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow span {
  padding: 2px 8px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.08);
  border-radius: var(--r-pill);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--cyan);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ============================================================================
   Login gate — split view (art | form)
   ============================================================================ */
.login-gate {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
body.login-mode .app-shell { display: none !important; }
.login-gate[hidden] { display: none !important; }

.login-space {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.space-particle {
  position: absolute;
  top: calc(var(--y) * 1%);
  left: calc(var(--x) * 1%);
  width: calc(var(--size) * 1px);
  height: calc(var(--size) * 1px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, var(--alpha)), transparent 70%);
  filter: blur(calc(var(--blur) * 1px));
  animation: v2-particle var(--duration) ease-in-out infinite alternate;
  animation-delay: var(--delay);
}
@keyframes v2-particle {
  from { transform: translate(0, 0); }
  to   { transform: translate(calc(var(--drift-x) * 6px), calc(var(--drift-y) * 6px)); }
}

.login-panel {
  position: relative;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-1);
  box-shadow: 0 24px 80px -30px rgba(0, 229, 255, 0.25);
}

.login-art {
  position: relative;
  padding: 56px 48px;
  overflow: hidden;
  background:
    radial-gradient(500px 400px at 30% 40%, rgba(0, 229, 255, 0.22), transparent 60%),
    radial-gradient(400px 300px at 80% 80%, rgba(169, 137, 255, 0.20), transparent 60%),
    linear-gradient(135deg, #0a1020, #05070b);
}
.login-art-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}
.login-art h2 {
  margin-top: 28px;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  position: relative;
}
.login-art h2 .hl {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.25));
}
.login-meta {
  margin-top: 36px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-fade);
  max-width: 360px;
  position: relative;
  z-index: 1;
}
.login-meta dt { color: var(--cyan); letter-spacing: 0.14em; text-transform: uppercase; }
.login-meta dd { margin: 0; color: var(--ink-dim); }
.login-meta dd.ok { color: var(--lime); }

.orbit {
  position: absolute;
  top: 50%; right: -10%;
  width: 480px; height: 480px;
  transform: translateY(-50%);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}
.orbit::before,
.orbit::after {
  content: "";
  position: absolute; inset: 10%;
  border: 1px solid rgba(169, 137, 255, 0.12);
  border-radius: 50%;
}
.orbit::after { inset: 22%; border-color: rgba(255, 90, 77, 0.12); }
.orbit-dot {
  position: absolute;
  top: 0; left: 50%;
  width: 10px; height: 10px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--cyan);
  transform: translate(-50%, -50%);
  animation: v2-orbit 12s linear infinite;
  transform-origin: 0 240px;
}
@keyframes v2-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-form-pane {
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
    var(--bg);
  border-left: 1px solid var(--line);
}
.login-section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.login-form-pane h3 {
  margin-top: 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.login-form-pane .login-subtitle {
  margin: 6px 0 10px;
  color: var(--ink-dim);
  font-size: 14px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-state {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-fade);
}
.login-state.is-error   { color: var(--coral); }
.login-state.is-success { color: var(--lime); }

.login-btn {
  margin-top: 8px;
  justify-content: center;
  width: 100%;
}
.login-foot-note {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-fade);
  text-transform: uppercase;
}

/* ============================================================================
   App shell
   ============================================================================ */
.app-shell {
  position: relative; z-index: 2;
  width: min(1360px, calc(100% - 56px));
  margin: 0 auto;
  padding: 24px 0 120px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.app-shell[hidden] { display: none; }

/* ============================================================================
   HUD strip (sticky)
   ============================================================================ */

/* Full-width fade-to-dark mask behind the sticky HUD pill.
   Fixed to viewport, separate element (see .hud-backdrop in index.html)
   so it sits outside any stacking context that would fight with the pill. */
.hud-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(
    to bottom,
    var(--bg) 0%,
    rgba(5, 7, 11, 0.92) 45%,
    rgba(5, 7, 11, 0.55) 75%,
    transparent 100%
  );
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
  z-index: 35;
  pointer-events: none;
}
body.login-mode .hud-backdrop { display: none; }

.hud-strip {
  position: sticky;
  top: 16px;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(10, 13, 19, 0.7);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
          backdrop-filter: blur(16px) saturate(140%);
  color: var(--ink-dim);
  box-shadow: 0 12px 40px -20px rgba(0, 229, 255, 0.25);
}
.hud-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.hud-logo .f5 {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-radius: 8px;
  color: #05070b;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.45);
}
.hud-logo--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1;
}
.hud-logo--stacked .lead {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-fade);
  font-weight: 500;
}
.hud-logo--stacked .main {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hud-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(10, 13, 19, 0.6);
}
.hud-mode-tabs button {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-fade);
  transition: all 180ms;
}
.hud-mode-tabs button.is-active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(169, 137, 255, 0.18));
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.32);
}
.hud-mode-tabs button:hover:not(.is-active) { color: var(--ink-dim); }

.hud-stat {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
  max-width: 180px;
}
.hud-stat .lab {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--ink-fade);
  text-transform: uppercase;
}
.hud-stat .val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-stat .val.cyan  { color: var(--cyan); }
.hud-stat .val.coral { color: var(--coral); }
.hud-stat .val.lime  { color: var(--lime); }

.hud-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-fade);
  text-transform: uppercase;
  white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 var(--cyan);
  animation: v2-hudpulse 2s ease-in-out infinite;
}
@keyframes v2-hudpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.6); }
  50%     { box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
}

.logout-btn {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line-hi);
  border-radius: var(--r-pill);
  transition: all 180ms;
}
.logout-btn:hover {
  color: var(--coral);
  border-color: rgba(255, 90, 77, 0.4);
  background: rgba(255, 90, 77, 0.06);
}

/* ============================================================================
   Runtime banner (was "masthead hero" in the mock — trimmed from
   marketing copy to an operator console status strip)
   ============================================================================ */
.masthead {
  position: relative;
  margin-top: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.masthead::before {
  content: "";
  position: absolute;
  top: -60px; right: -40px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.09), transparent 70%);
  filter: blur(34px);
  pointer-events: none;
  z-index: -1;
}
.masthead h1 {
  margin: 12px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.runtime-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.runtime-meta span {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 20px;
  border-right: 1px solid var(--line);
}
.runtime-meta span:first-child { padding-left: 0; }
.runtime-meta span:last-child  { border-right: 0; padding-right: 0; }
.runtime-meta em {
  font-style: normal;
  color: var(--cyan);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 10px;
}

/* ============================================================================
   Glass card + plate head
   ============================================================================ */
.plate-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.plate-head h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}
.plate-head h3 { font-size: 18px; }
.plate-head .mono { color: var(--ink-fade); }

.glass {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 50%),
    rgba(10, 13, 19, 0.6);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border-radius: var(--r-lg);
  padding: 24px;
  overflow: hidden;
}
.glass::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi), transparent);
  pointer-events: none;
}

/* ============================================================================
   Settings
   ============================================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 14px;
  align-items: end;
}
.settings-grid + .settings-grid {
  margin-top: 14px;
  grid-template-columns: 1fr 1fr;
}
.settings-foot {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span,
.field > .k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.field--grow { flex: 1 1 auto; }
.field--connection { min-width: 190px; }

.field > input,
.field > select,
.field > textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 13px 14px;
  border-radius: var(--r-sm);
  outline: none;
  font-size: 13.5px;
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}
.field > input::placeholder,
.field > textarea::placeholder {
  color: var(--ink-mute);
}
.field > input:focus,
.field > select:focus,
.field > textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-ghost);
}
.field > select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path fill='%2399a3b8' d='M6 7L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.connection-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.connection-pill strong {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 0 12px currentColor;
  transition: text-shadow 200ms;
}
.connection-pill strong::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  margin-right: 8px;
  vertical-align: middle;
  animation: v2-conn-pulse 2.4s ease-in-out infinite;
}
@keyframes v2-conn-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn-primary,
.btn-secondary,
.scan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: transform 180ms, box-shadow 180ms, border-color 180ms, background 180ms;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #05070b;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.25), 0 12px 28px -12px rgba(0, 229, 255, 0.55);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.5), 0 18px 36px -14px rgba(0, 229, 255, 0.7);
}
.btn-primary svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.btn-secondary {
  background: var(--bg-1);
  color: var(--ink);
  border-color: var(--line-hi);
}
.btn-secondary:hover {
  border-color: var(--line-xhi);
  background: var(--bg-2);
  transform: translateY(-1px);
}

.scan-btn {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #05070b;
  padding: 13px 22px;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.25), 0 14px 32px -14px rgba(0, 229, 255, 0.65);
}
.scan-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.5), 0 18px 40px -12px rgba(0, 229, 255, 0.85);
}
.scan-btn svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.scan-btn.is-loading .scan-label { opacity: 0.4; }
.scan-btn.is-loading .scan-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(5, 7, 11, 0.3);
  border-top-color: #05070b;
  border-radius: 50%;
  animation: v2-spin 0.8s linear infinite;
}
.scan-spinner { display: none; }
@keyframes v2-spin { to { transform: rotate(360deg); } }

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.scan-state {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}

/* ============================================================================
   Mode selector tiles (app.js-driven via .mode-btn)
   ============================================================================ */
.mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mode-cell {
  position: relative;
  text-align: left;
  padding: 22px 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--ink);
  overflow: hidden;
  transition: transform 220ms cubic-bezier(.2, .9, .3, 1), border-color 220ms, background 220ms, box-shadow 220ms;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mode-cell:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.mode-cell.is-active {
  border-color: transparent;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(169, 137, 255, 0.08) 60%, transparent),
    var(--bg-1);
  box-shadow: 0 0 0 1px var(--line-xhi), 0 20px 50px -22px rgba(0, 229, 255, 0.55);
}
.mode-cell.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px 100px at 0 100%, var(--cyan-ghost), transparent 60%);
  pointer-events: none;
}
.mode-cell .idx {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-fade);
  text-transform: uppercase;
}
.mode-cell.is-active .idx { color: var(--cyan); }
.mode-cell .name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-top: 6px;
}
.mode-cell .desc {
  margin-top: 4px;
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.45;
}
.mode-cell .chev {
  position: absolute; top: 20px; right: 20px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-hi);
  display: grid; place-items: center;
  color: var(--ink-fade);
  font-size: 12px;
  transition: all 220ms;
}
.mode-cell.is-active .chev {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #05070b;
  box-shadow: 0 0 20px var(--cyan-ghost);
}

/* ============================================================================
   Architecture (radar sweep + inline + OOB diagrams)
   ============================================================================ */
.flow-panel[hidden] { display: none !important; }

.flow-board {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(0, 229, 255, 0.07), transparent 70%),
    var(--bg-1);
  padding: 28px 20px 24px;
  overflow: hidden;
}
.flow-board::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 140%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg, rgba(0, 229, 255, 0.08) 30deg, transparent 60deg);
  animation: v2-sweep 6s linear infinite;
  pointer-events: none;
  opacity: 0.8;
}
.flow-board[data-mode="oob"]::before {
  background: conic-gradient(from 0deg, transparent 0deg, rgba(169, 137, 255, 0.1) 35deg, transparent 70deg);
  animation-duration: 9s;
}
@keyframes v2-sweep {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.flow-board.is-running::before { opacity: 1; }

.flow-diagram {
  position: relative;
  z-index: 1;
  display: none;
  flex-direction: column;
  gap: 18px;
}
.flow-board[data-mode="inline"] .flow-diagram--inline { display: flex; }
.flow-board[data-mode="oob"]    .flow-diagram--oob    { display: flex; }

.diagram-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0;
}
.flow-board[data-mode="oob"] .flow-diagram--oob .diagram-tag { color: var(--violet); }

/* Inline: 7-column lane (chatbot · conn · nginx · conn · core · conn · llm) */
.flow-lane {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.3fr auto 1fr;
  align-items: center;
  gap: 4px;
}
/* OOB: 5-column lane (chatbot · conn · nginx+gate · conn · llm). */
/* The SaaS core lives in the async-bridge row above, so main lane stays 3 nodes. */
/* Center NGINX (1.3fr) so it aligns under the top core. */
.flow-diagram--oob .flow-lane {
  grid-template-columns: 1fr auto 1.3fr auto 1fr;
}

.flow-node {
  position: relative;
  border: 1px solid var(--line-hi);
  background: rgba(10, 13, 19, 0.85);
  border-radius: var(--r-md);
  padding: 16px 14px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--ink);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  transition: all 260ms ease;
}
.flow-node--nginx-oob {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}
.flow-node-title { display: block; font-family: var(--font-display); font-weight: 500; font-size: 14px; }

.flow-core {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(169, 137, 255, 0.08) 70%),
    var(--bg-1);
  padding: 18px 16px 14px;
  text-align: center;
  box-shadow: 0 0 0 1px var(--line-xhi), 0 20px 60px -22px rgba(0, 229, 255, 0.5);
  transition: all 260ms ease;
}
.flow-core p {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.flow-node--scanner {
  margin-top: 6px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-hi);
  background: rgba(10, 13, 19, 0.7);
  font-size: 13px;
}

.flow-conn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 86px;
  padding: 0 4px;
}
.flow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  color: var(--ink-fade);
}

.step-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  transition: all 260ms ease;
}
.step-circle--response {
  background: var(--lime-ghost);
  border-color: var(--lime);
  color: var(--lime);
}
.step-circle--async {
  background: var(--violet-ghost);
  border-color: var(--violet);
  color: var(--violet);
}

.flow-arrow {
  width: 100%;
  height: 20px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.5;
}
.flow-arrow--request  { stroke: var(--cyan); }
.flow-arrow--response { stroke: var(--lime); }
.flow-arrow--async    { stroke: var(--violet); }

/* Animated packet line under hop rows */
.flow-step::after {
  content: "";
  display: none;
}
.flow-step svg.flow-arrow {
  position: relative;
}
.flow-step svg.flow-arrow::after {
  /* no-op for style uniformity */
}

/* OOB scan row */
.oob-scan-row {
  display: flex;
  justify-content: center;
}
.oob-scan-core {
  min-width: 360px;
  padding: 16px;
  border-radius: var(--r-md);
  background:
    linear-gradient(135deg, rgba(169, 137, 255, 0.2), rgba(0, 229, 255, 0.06) 70%),
    var(--bg-1);
  border: 1px solid transparent;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(169, 137, 255, 0.35), 0 20px 50px -24px rgba(169, 137, 255, 0.6);
}
.oob-scan-core p {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}
.oob-scan-engine {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-hi);
  background: rgba(10, 13, 19, 0.75);
  font-family: var(--font-display);
  font-weight: 500;
}

.flow-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  padding: 6px 0;
}
.flow-bridge-label { opacity: 0.85; }

.flow-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.flow-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.5);
  color: var(--ink-dim);
}
.flow-note--warn {
  color: var(--coral);
  border-color: rgba(255, 90, 77, 0.3);
  background: rgba(255, 90, 77, 0.05);
}
.flow-note--ok {
  color: var(--lime);
  border-color: rgba(182, 255, 92, 0.3);
  background: rgba(182, 255, 92, 0.05);
}

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 6px;
  color: var(--ink-fade);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.legend-pill { display: inline-flex; align-items: center; gap: 8px; }
.legend-pill svg {
  width: 14px; height: 14px;
  stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.legend-pill--request  { color: var(--cyan); }   .legend-pill--request  svg { stroke: var(--cyan); }
.legend-pill--response { color: var(--lime); }   .legend-pill--response svg { stroke: var(--lime); }
.legend-pill--async    { color: var(--violet); } .legend-pill--async    svg { stroke: var(--violet); }

/* OOB strict gate toggle */
.oob-gate-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.6);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms, background 180ms;
}
.oob-gate-toggle:hover { border-color: var(--line-hi); }
.oob-gate-toggle__copy { flex: 1; min-width: 0; }
.oob-gate-toggle__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.oob-gate-toggle__hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-fade);
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
.oob-gate-toggle__input { display: none; }
.oob-gate-toggle__track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line-hi);
  transition: all 200ms;
  flex-shrink: 0;
}
.oob-gate-toggle__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: all 200ms;
}
.oob-gate-toggle__input:checked + .oob-gate-toggle__track {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-color: transparent;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}
.oob-gate-toggle__input:checked + .oob-gate-toggle__track .oob-gate-toggle__thumb {
  transform: translateX(18px);
  background: #05070b;
}

/* ============================================================================
   Flow active / done states (app.js-driven)
   ============================================================================ */
.flow-active,
.flow-active-request,
.flow-active-response,
.flow-active-scan,
.flow-active-block,
.flow-active-async {
  box-shadow: 0 0 0 1px var(--cyan), 0 0 24px -4px var(--cyan) !important;
  border-color: transparent !important;
}
.flow-active-response { box-shadow: 0 0 0 1px var(--lime), 0 0 24px -4px var(--lime) !important; }
.flow-active-scan     { box-shadow: 0 0 0 1px var(--cyan), 0 0 36px -2px var(--cyan) !important; }
.flow-active-block    { box-shadow: 0 0 0 1px var(--coral), 0 0 32px -4px var(--coral) !important; }
.flow-active-async    { box-shadow: 0 0 0 1px var(--violet), 0 0 28px -4px var(--violet) !important; }
.step-circle.flow-active,
.step-circle.flow-active-request {
  animation: v2-pulse 1.3s ease-in-out infinite;
}
@keyframes v2-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 var(--cyan-ghost); }
  50%     { transform: scale(1.1); box-shadow: 0 0 0 8px transparent; }
}

.flow-done,
.flow-done-request,
.flow-done-response,
.flow-done-scan,
.flow-done-async {
  border-color: var(--cyan) !important;
  color: var(--cyan);
}
.flow-done-response { border-color: var(--lime) !important; color: var(--lime); }
.flow-done-block {
  border-color: var(--coral) !important;
  color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral), 0 0 24px -6px var(--coral);
}
.flow-done-async { border-color: var(--violet) !important; color: var(--violet); }

/* ============================================================================
   Workbench — 2-col grid (prompt/scenarios | result)
   ============================================================================ */
.prompt-result-grid[hidden] { display: none !important; }

.prompt-result-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
}
.workbench-left { display: flex; flex-direction: column; gap: 20px; }

/* Prompt panel */
.prompt-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prompt-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.prompt-panel-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.prompt-panel textarea {
  min-height: 170px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background:
    linear-gradient(180deg, rgba(0, 229, 255, 0.04), transparent 30%),
    var(--bg);
}

/* Scenario grid */
.scenario-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scenario-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  counter-reset: scn;
}
.scenario-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--r-md);
  color: var(--ink);
  text-align: left;
  font: inherit;
  transition: all 180ms;
}
.scenario-card:hover {
  border-color: var(--line-hi);
  transform: translateY(-1px);
}
.scenario-card.is-active {
  border-color: transparent;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.12), transparent 70%),
    var(--bg-1);
  box-shadow: 0 0 0 1px var(--line-xhi);
}
.scenario-card::before {
  counter-increment: scn;
  content: counter(scn, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.1em;
  min-width: 22px;
}
.scenario-text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.45;
}

.scenario-language-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-1);
}
.scenario-lang-btn {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-fade);
  border-radius: var(--r-pill);
  transition: all 180ms;
}
.scenario-lang-btn.is-active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(169, 137, 255, 0.15));
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.3);
}

/* ============================================================================
   Result zone
   ============================================================================ */
.result-zone {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.result-head-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.result-req-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-fade);
}

.result-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-1);
  width: fit-content;
}
.result-tab {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
  transition: all 180ms;
}
.result-tab.is-active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(169, 137, 255, 0.15));
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.3);
}

.result-panel-content { display: none; }
.result-panel-content.is-active { display: flex; flex-direction: column; gap: 14px; }
.result-panel-content[hidden] { display: none; }

/* Verdict hero card */
.verdict {
  position: relative;
  padding: 22px;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 90, 77, 0.16), rgba(255, 90, 77, 0.04) 50%, transparent),
    var(--bg-1);
  border: 1px solid rgba(255, 90, 77, 0.35);
  box-shadow: 0 20px 60px -30px var(--coral);
}
.verdict.ok {
  background:
    linear-gradient(135deg, rgba(182, 255, 92, 0.16), rgba(182, 255, 92, 0.03) 50%, transparent),
    var(--bg-1);
  border-color: rgba(182, 255, 92, 0.35);
  box-shadow: 0 20px 60px -30px rgba(182, 255, 92, 0.5);
}
.verdict.warn {
  background:
    linear-gradient(135deg, rgba(255, 178, 63, 0.16), rgba(255, 178, 63, 0.03) 50%, transparent),
    var(--bg-1);
  border-color: rgba(255, 178, 63, 0.35);
  box-shadow: 0 20px 60px -30px rgba(255, 178, 63, 0.5);
}
.verdict::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0 2px,
    transparent 2px 4px
  );
  pointer-events: none;
}
.verdict-head { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.v-glyph {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255, 90, 77, 0.14);
  border: 1px solid rgba(255, 90, 77, 0.4);
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 24px -4px var(--coral);
  flex-shrink: 0;
}
.verdict.ok .v-glyph {
  background: rgba(182, 255, 92, 0.14);
  border-color: rgba(182, 255, 92, 0.4);
  color: var(--lime);
  box-shadow: 0 0 24px -4px rgba(182, 255, 92, 0.6);
}
.verdict.warn .v-glyph {
  background: rgba(255, 178, 63, 0.14);
  border-color: rgba(255, 178, 63, 0.4);
  color: var(--amber);
  box-shadow: 0 0 24px -4px rgba(255, 178, 63, 0.6);
}
.v-body { flex: 1; min-width: 0; }
.v-body .kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-fade);
  text-transform: uppercase;
}
.v-body h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.v-body h3 .hl { color: var(--coral); }
.verdict.ok   .v-body h3 .hl { color: var(--lime); }
.verdict.warn .v-body h3 .hl { color: var(--amber); }
.v-meta {
  margin: 6px 0 0;
  color: var(--ink-dim);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

/* Result summary row (Verdict / Outcome / Scanners lines) */
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.45);
}
.result-row > span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.result-row > strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 13.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Risk badges */
.risk-badge {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  font-weight: 600;
}
.risk-low {
  color: var(--lime);
  border-color: rgba(182, 255, 92, 0.35);
  background: rgba(182, 255, 92, 0.08);
  box-shadow: 0 0 20px -8px rgba(182, 255, 92, 0.6);
}
.risk-medium {
  color: var(--amber);
  border-color: rgba(255, 178, 63, 0.35);
  background: rgba(255, 178, 63, 0.08);
  box-shadow: 0 0 20px -8px rgba(255, 178, 63, 0.6);
}
.risk-high {
  color: var(--coral);
  border-color: rgba(255, 90, 77, 0.35);
  background: rgba(255, 90, 77, 0.08);
  box-shadow: 0 0 20px -8px rgba(255, 90, 77, 0.6);
}

/* Scanner details block */
.scanner-details,
.llm-response-section,
.result-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.5);
}
.scanner-details-label,
.llm-response-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.scanner-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.scanner-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-fade);
  font-size: 12.5px;
}

.scanner-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.6);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  overflow: hidden;
}

/* Blocked / failed — vivid coral with left bar accent */
.scanner-item.scanner-item--blocked,
.scanner-item.scanner-level-high {
  border-color: rgba(255, 90, 77, 0.55);
  background: linear-gradient(90deg, rgba(255, 90, 77, 0.18), rgba(255, 90, 77, 0.05) 60%, transparent);
  box-shadow: 0 0 0 1px rgba(255, 90, 77, 0.25) inset, 0 0 22px -10px var(--coral);
}
.scanner-item.scanner-item--blocked::before,
.scanner-item.scanner-level-high::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: var(--coral);
  box-shadow: 0 0 10px var(--coral);
}

/* Flagged / warning — amber */
.scanner-item.scanner-item--flagged,
.scanner-item.scanner-level-medium {
  border-color: rgba(255, 178, 63, 0.45);
  background: linear-gradient(90deg, rgba(255, 178, 63, 0.14), rgba(255, 178, 63, 0.04) 60%, transparent);
}
.scanner-item.scanner-item--flagged::before,
.scanner-item.scanner-level-medium::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

/* Passed — lime */
.scanner-item.scanner-item--passed,
.scanner-item.scanner-level-low {
  border-color: rgba(182, 255, 92, 0.35);
  background: rgba(182, 255, 92, 0.05);
}

.scanner-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  flex-shrink: 0;
}
.scanner-item--blocked .scanner-dot,
.scanner-level-high .scanner-dot {
  background: var(--coral);
  box-shadow: 0 0 12px var(--coral);
  animation: v2-dot-alert 1.6s ease-in-out infinite;
}
.scanner-item--flagged .scanner-dot,
.scanner-level-medium .scanner-dot {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}
@keyframes v2-dot-alert {
  0%, 100% { box-shadow: 0 0 10px var(--coral); }
  50%      { box-shadow: 0 0 18px var(--coral), 0 0 4px var(--coral); }
}

.scanner-info { min-width: 0; }
.scanner-name {
  display: block;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.scanner-item--blocked .scanner-name,
.scanner-level-high .scanner-name   { color: var(--coral); text-shadow: 0 0 8px rgba(255, 90, 77, 0.5); }
.scanner-item--flagged .scanner-name,
.scanner-level-medium .scanner-name { color: var(--amber); }
.scanner-item--passed .scanner-name,
.scanner-level-low .scanner-name    { color: var(--lime); }

.scanner-outcome {
  display: block;
  margin-top: 2px;
  color: var(--ink-fade);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.scanner-item--blocked .scanner-outcome { color: var(--coral); }
.scanner-item--flagged .scanner-outcome { color: var(--amber); }
.scanner-item--passed .scanner-outcome  { color: var(--lime); }

.scanner-policy-type {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* LLM response */
.llm-response-content {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.llm-response-model {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.llm-response-section--blocked {
  border-color: rgba(255, 90, 77, 0.32);
  background: rgba(255, 90, 77, 0.05);
}
.llm-response-section--blocked .llm-response-content { color: var(--ink-dim); }
.llm-response-section--blocked .llm-response-label   { color: var(--coral); }

/* Context preview */
.result-preview {
  background: rgba(10, 13, 19, 0.55);
}
.result-preview > span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.result-preview p {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Raw JSON */
.raw-json-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.6);
}
.raw-json-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.copy-json-btn {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--line-hi);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: all 180ms;
}
.copy-json-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan-ghost);
  background: rgba(0, 229, 255, 0.06);
}
.raw-json {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre;
  background: transparent;
}

/* ============================================================================
   Battle mode
   ============================================================================ */
.battle-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.battle-panel[hidden] { display: none !important; }

.battle-score {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(169, 137, 255, 0.05) 70%),
    var(--bg-1);
}
.battle-score-label { display: flex; flex-direction: column; gap: 4px; }
.battle-score-label .eyebrow { color: var(--cyan); }
.battle-score-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-fade);
  text-transform: uppercase;
}
.battle-score-readout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
}
.battle-score-readout .score-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.6);
  min-width: 140px;
}
.battle-score-readout .score-chip.f5 {
  border-color: rgba(0, 229, 255, 0.32);
  background: rgba(0, 229, 255, 0.05);
}
.battle-score-readout .score-chip.llmguard {
  border-color: rgba(169, 137, 255, 0.32);
  background: rgba(169, 137, 255, 0.05);
}
.battle-score-readout .score-chip.f5.leader       { box-shadow: 0 0 24px -4px rgba(0, 229, 255, 0.55); }
.battle-score-readout .score-chip.llmguard.leader { box-shadow: 0 0 24px -4px rgba(169, 137, 255, 0.55); }
.battle-score-readout .score-chip .name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.battle-score-readout .score-chip .val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.battle-score-readout .score-chip.f5 .val       { color: var(--cyan); }
.battle-score-readout .score-chip.llmguard .val { color: var(--violet); }
.battle-score-readout .vs {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--ink-fade);
  text-transform: uppercase;
}

/* Battle prompt block */
.battle-prompt {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.battle-prompt textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 14px 16px;
  border-radius: var(--r-sm);
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  min-height: 110px;
  resize: vertical;
  transition: border-color 180ms, box-shadow 180ms;
}
.battle-prompt textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-ghost);
}
.battle-prompt-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.battle-reset-btn { margin-left: auto; }

/* Contenders */
.battle-contenders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}
.battle-contender {
  position: relative;
  padding: 20px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 50%),
    var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.battle-contender.f5::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.battle-contender.llmguard::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), transparent);
}
.contender-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.contender-title { display: flex; gap: 10px; align-items: center; }
.name-badge {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  font-weight: 600;
}
.name-badge.f5 {
  color: var(--cyan);
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.08);
}
.name-badge.llmguard {
  color: var(--violet);
  border-color: rgba(169, 137, 255, 0.35);
  background: rgba(169, 137, 255, 0.08);
}

.verdict.idle,
.verdict.pending,
.verdict.block,
.verdict.allow,
.verdict.review,
.verdict.error {
  /* verdict as inline chip (battle contender local) — override the hero verdict card look */
  padding: 16px 18px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.verdict.idle {
  background: var(--bg-1);
  border: 1px solid var(--line);
  box-shadow: none;
}
.verdict.idle::after { display: none; }
.verdict.idle .label { color: var(--ink-fade); }

.verdict.pending {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), transparent 70%);
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 0 0 transparent;
  animation: v2-pending 2s ease-in-out infinite;
}
.verdict.pending::after { display: none; }
@keyframes v2-pending {
  0%,100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
  50%     { box-shadow: 0 0 22px -6px rgba(0, 229, 255, 0.55); }
}

.verdict.block {
  background: linear-gradient(135deg, rgba(255, 90, 77, 0.12), transparent 70%);
  border: 1px solid rgba(255, 90, 77, 0.35);
  box-shadow: 0 12px 30px -18px var(--coral);
}
.verdict.block::after { display: none; }
.verdict.block .label { color: var(--coral); }

.verdict.allow {
  background: linear-gradient(135deg, rgba(182, 255, 92, 0.12), transparent 70%);
  border: 1px solid rgba(182, 255, 92, 0.35);
  box-shadow: 0 12px 30px -18px rgba(182, 255, 92, 0.6);
}
.verdict.allow::after { display: none; }
.verdict.allow .label { color: var(--lime); }

.verdict.review {
  background: linear-gradient(135deg, rgba(255, 178, 63, 0.12), transparent 70%);
  border: 1px solid rgba(255, 178, 63, 0.35);
  box-shadow: 0 12px 30px -18px rgba(255, 178, 63, 0.6);
}
.verdict.review::after { display: none; }
.verdict.review .label { color: var(--amber); }

.verdict.error {
  background: linear-gradient(135deg, rgba(255, 90, 77, 0.1), transparent 70%);
  border: 1px solid rgba(255, 90, 77, 0.25);
}
.verdict.error::after { display: none; }
.verdict.error .label { color: var(--coral); }

.verdict .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.correctness {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}
.correctness.ok {
  color: var(--lime);
  border-color: rgba(182, 255, 92, 0.35);
  background: rgba(182, 255, 92, 0.08);
}
.correctness.wrong {
  color: var(--coral);
  border-color: rgba(255, 90, 77, 0.35);
  background: rgba(255, 90, 77, 0.08);
}
.correctness.placeholder { border-color: transparent; color: transparent; }

.contender-meta {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-fade);
}
.contender-meta strong { color: var(--ink); font-weight: 600; }

.risk-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(var(--battle-scanner-rows, 6) * 32px);
  overflow: auto;
  padding-right: 4px;
}
.risk-bars.is-placeholder {
  opacity: 0.65;
  min-height: calc(var(--battle-scanner-rows, 6) * 32px);
}
.risk-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.5);
}
.risk-row--placeholder {
  border-style: dashed;
  color: var(--ink-fade);
}
.rl-name {
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rl-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.rl-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 300ms ease;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.rl-fill.high {
  background: var(--coral);
  box-shadow: 0 0 8px var(--coral);
}
.rl-fill.low {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  width: 18%;
}
.rl-fill.idle {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
.rl-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-fade);
  min-width: 44px;
  text-align: right;
}
.rl-val.fail { color: var(--coral); }
.rl-val.pass { color: var(--lime); }

/* Samples list */
.battle-samples-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.battle-samples-head h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.battle-samples-head p {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-fade);
  text-transform: uppercase;
}

.battle-sample-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.battle-sample-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-1);
  cursor: pointer;
  transition: all 180ms;
}
.battle-sample-row:hover {
  border-color: var(--line-hi);
  transform: translateY(-1px);
}
.battle-sample-row.is-active {
  border-color: transparent;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.12), transparent 70%),
    var(--bg-1);
  box-shadow: 0 0 0 1px var(--line-xhi);
}
.battle-sample-row .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.1em;
}
.battle-sample-row .content { min-width: 0; }
.battle-sample-row .title {
  font-size: 13.5px;
  color: var(--ink);
}
.battle-sample-row .excerpt {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-fade);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.battle-sample-row .tag {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-fade);
}
.battle-sample-row .tag.allow {
  color: var(--lime);
  border-color: rgba(182, 255, 92, 0.35);
  background: rgba(182, 255, 92, 0.06);
}
.battle-sample-row .tag.block {
  color: var(--coral);
  border-color: rgba(255, 90, 77, 0.35);
  background: rgba(255, 90, 77, 0.06);
}
.battle-sample-row .results {
  display: inline-flex;
  gap: 6px;
}
.battle-dot {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line-hi);
  background: rgba(10, 13, 19, 0.7);
  color: var(--ink-fade);
}
.battle-dot.ok {
  color: var(--lime);
  border-color: rgba(182, 255, 92, 0.4);
  background: rgba(182, 255, 92, 0.1);
}
.battle-dot.wrong {
  color: var(--coral);
  border-color: rgba(255, 90, 77, 0.4);
  background: rgba(255, 90, 77, 0.1);
}

/* ============================================================================
   Ticker (decorative)
   ============================================================================ */
.ticker {
  margin-top: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-fade);
  mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
}
.ticker-track {
  display: inline-block;
  animation: v2-ticker 40s linear infinite;
  padding-left: 100%;
}
.ticker-track span { margin-right: 48px; }
.ticker-track .hit  { color: var(--coral); }
.ticker-track .pass { color: var(--lime); }
.ticker-track .warn { color: var(--amber); }
@keyframes v2-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================================
   Incident / engineer (defensive — optional DOM, app.js guards these)
   ============================================================================ */
.incident-item {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.55);
  margin-bottom: 6px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.incident-item--block  { border-color: rgba(255, 90, 77, 0.32);  color: var(--coral); }
.incident-item--allow  { border-color: rgba(182, 255, 92, 0.32); color: var(--lime); }
.incident-item--review { border-color: rgba(255, 178, 63, 0.32); color: var(--amber); }
.incident-item--error  { border-color: rgba(255, 90, 77, 0.2);   color: var(--ink-dim); }
.incident-headline { display: block; color: inherit; }
.incident-detail { display: block; color: var(--ink-fade); margin-top: 2px; font-size: 10.5px; }
.incident-empty {
  margin: 0; padding: 10px; color: var(--ink-fade); font-style: italic; font-size: 12px;
}

/* Threat list */
#threatList {
  margin: 0; padding-left: 18px;
  color: var(--ink-dim);
  font-size: 12.5px;
  line-height: 1.6;
}
#threatList li { padding: 2px 0; }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 1100px) {
  .prompt-result-grid { grid-template-columns: 1fr; }
  .battle-score       { grid-template-columns: 1fr; }
  .settings-grid      { grid-template-columns: 1fr 1fr; }
  .settings-grid + .settings-grid { grid-template-columns: 1fr 1fr; }
  .flow-lane {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .flow-conn { flex-direction: row; min-width: 0; justify-content: center; }
}
@media (max-width: 820px) {
  .app-shell { width: calc(100% - 24px); padding: 16px 0 80px; }
  .hud-strip {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .hud-mode-tabs { grid-column: 1 / -1; justify-content: center; }
  .hud-stat { display: none; }
  .mode-row      { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .scanner-list  { grid-template-columns: 1fr; }
  .login-panel   { grid-template-columns: 1fr; }
  .login-art, .login-form-pane { padding: 36px 28px; }
  .login-art .orbit { display: none; }
  .settings-grid, .settings-grid + .settings-grid { grid-template-columns: 1fr; }
  .masthead h1 { font-size: 44px; }
}
