/* CIGAI — black & orange intelligence UI */
:root {
  --bg-0: #050505;
  --bg-1: #0c0c0c;
  --bg-2: #141414;
  --bg-3: #1c1c1c;
  --border: rgba(255, 122, 26, 0.18);
  --border-strong: rgba(255, 122, 26, 0.45);
  --orange: #ff7a1a;
  --orange-hot: #ff9520;
  --orange-dim: #c45a0a;
  --orange-glow: rgba(255, 122, 26, 0.35);
  --text: #f2f0eb;
  --text-muted: #9a958c;
  --danger: #ff4d4d;
  --ok: #3dd68c;
  --font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 12px;
  --shadow: 0 0 0 1px var(--border), 0 20px 50px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 122, 26, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 100, 0, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg-0), #080808 40%, #050505);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 122, 26, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 122, 26, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: 0;
  animation: gridPulse 12s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  from { opacity: 0.35; }
  to { opacity: 0.7; }
}

a {
  color: var(--orange-hot);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: #ffb060; }

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nav */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--text);
}
.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), #ff3d00);
  box-shadow: 0 0 18px var(--orange-glow);
  position: relative;
}
.brand .mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.nav-links a,
.nav-links .ghost-btn {
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 122, 26, 0.08);
}

.main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* Hero / landing */
.hero {
  display: grid;
  gap: 2rem;
  padding: 3rem 0 2rem;
  animation: fadeUp 0.7s var(--ease) both;
}
@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    min-height: 62vh;
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 0.75rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  background: linear-gradient(120deg, #fff 20%, var(--orange-hot) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 38ch;
  margin: 0 0 1.5rem;
}

.hero-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 122, 26, 0.08), rgba(20, 20, 20, 0.9));
  box-shadow: var(--shadow);
  padding: 1.5rem;
  animation: fadeUp 0.85s 0.1s var(--ease) both;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  color: var(--orange-hot);
  font-size: 1.1rem;
}
.stat span {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Cards & forms */
.card {
  background: rgba(14, 14, 14, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  animation: fadeUp 0.55s var(--ease) both;
}

.auth-wrap {
  width: min(420px, 100%);
  margin: 2.5rem auto;
}

label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.85rem 0 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}
textarea { min-height: 110px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--orange), #ff4d00);
  color: #120800;
  box-shadow: 0 8px 28px var(--orange-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--orange-hot), var(--orange));
  box-shadow: 0 10px 34px rgba(255, 122, 26, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255, 122, 26, 0.1);
}

.btn-block { width: 100%; margin-top: 1.25rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.35s var(--ease) both;
}
.flash-error {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.35);
  color: #ffb4b4;
}
.flash-ok {
  background: rgba(61, 214, 140, 0.1);
  border: 1px solid rgba(61, 214, 140, 0.35);
  color: #9cf0c5;
}

.muted { color: var(--text-muted); font-size: 0.9rem; }
.center { text-align: center; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.25rem; }
.stack { display: grid; gap: 1rem; }

/* Dashboard grid */
.dash-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .dash-grid.two { grid-template-columns: 1.1fr 0.9fr; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--border);
  color: var(--orange-hot);
  background: rgba(255, 122, 26, 0.08);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-admin { background: rgba(255, 122, 26, 0.2); color: var(--orange-hot); }
.badge-user { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-2);
}
tr:hover td { background: rgba(255, 122, 26, 0.04); }

.user-form {
  display: grid;
  gap: 0.5rem;
  min-width: 200px;
}
.user-form .checks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.user-form label.inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  cursor: pointer;
}
.user-form input[type="checkbox"] {
  accent-color: var(--orange);
  width: 1rem;
  height: 1rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-title h2 { font-size: 1.15rem; margin: 0; }

.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.scanline {
  position: relative;
  overflow: hidden;
}
.scanline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 40%;
  top: -40%;
  background: linear-gradient(transparent, rgba(255, 122, 26, 0.06), transparent);
  animation: scan 5.5s linear infinite;
  pointer-events: none;
}
@keyframes scan {
  to { top: 120%; }
}

@media (max-width: 640px) {
  .topnav { flex-direction: column; align-items: flex-start; }
  .stat-row { grid-template-columns: 1fr; }
}

/* Utility (replaces inline style usage where possible) */
.text-strong { color: var(--text); }
.h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.inline-form { display: inline; margin: 0; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.75rem; }
.row-detail { border-top: none; padding-top: 0; }

/* CIGAI tabs, modals, compact admin */
.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.tab {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.tab:hover { color: var(--text); border-color: var(--border); }
.tab.active {
  color: #120800;
  background: linear-gradient(135deg, var(--orange), #ff4d00);
  border-color: transparent;
}

.table-wrap.compact table { font-size: 0.85rem; }
.table-wrap.compact th, .table-wrap.compact td { padding: 0.5rem 0.65rem; }
.users-table .role-select {
  width: auto;
  min-width: 5.5rem;
  max-width: 6.5rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
}
.mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  margin: 0.1rem;
}
.mod-chip.on, .mod-chip:has(input:checked) {
  color: var(--orange-hot);
  border-color: var(--border-strong);
  background: rgba(255, 122, 26, 0.1);
}
.mod-chip input { accent-color: var(--orange); }

/* Admin user edit row */
.user-row-cell { padding: 0.85rem 0.75rem !important; }
.user-edit-form { margin: 0; }
.user-edit-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 140px 1fr auto auto auto;
  align-items: start;
}
@media (max-width: 960px) {
  .user-edit-grid { grid-template-columns: 1fr; }
}
.user-edit-grid .inline-mods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.user-pw { margin-top: 0.55rem; }

.report-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.report-btn-row:last-child { margin-bottom: 0; }

.mod-toggles {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
}
.mod-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.mod-toggles.is-hidden { display: none; }
.tiny { font-size: 0.72rem; }
.tiny-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-start;
}
.pw-details summary { list-style: none; cursor: pointer; }
.pw-details summary::-webkit-details-marker { display: none; }
.pw-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
  min-width: 10rem;
}
.pw-form input { font-size: 0.8rem; padding: 0.4rem 0.5rem; }
.inline-mods { margin: 0; }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-root[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  animation: fadeUp 0.3s var(--ease) both;
}
.ok { color: var(--ok); }
.fail { color: var(--danger); }
.ua-cell { max-width: 220px; word-break: break-all; font-size: 0.75rem; }
.danger-btn { border-color: rgba(255,77,77,0.4) !important; color: #ffb4b4 !important; }

.thread { display: grid; gap: 0.85rem; margin-top: 1rem; }
.thread-msg {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--bg-2);
}
.thread-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.thread-body { white-space: pre-wrap; word-break: break-word; }
.attach-list { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }

.health-grid { display: grid; gap: 0.85rem; margin-top: 1rem; }
@media (min-width: 700px) {
  .health-grid { grid-template-columns: 1fr 1fr; }
}
.health-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
}
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.6);
  animation: pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(61, 214, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); }
}
.status-pill {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.status-pill.online {
  color: #0a2e1c;
  background: var(--ok);
}

.btn-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.65rem;
}
.chip-warn {
  color: #3a2200;
  background: var(--orange-hot);
  border-color: transparent;
}
.chip-ok {
  color: #0a2e1c;
  background: var(--ok);
  border-color: transparent;
}
.row-unread td {
  background: rgba(255, 122, 26, 0.06);
}
.thread-meta {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.thread-meta form { margin-left: auto; }

.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.hero-simple {
  min-height: 48vh;
  display: flex;
  align-items: center;
}

/* ── Landing ── */
.landing {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -0.25rem;
  min-height: calc(100vh - 7.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.landing-inner {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0 1.25rem;
  flex: 1;
  display: flex;
  align-items: center;
}
.landing-hero {
  width: 100%;
  padding: 3rem 0 2.5rem;
  animation: fadeUp 0.55s var(--ease) both;
  text-align: left;
}
.landing-title {
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  margin: 0 0 0.35rem;
  letter-spacing: 0.14em;
}
.landing-sub {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  letter-spacing: 0.04em;
  color: var(--orange-hot);
  margin: 0 0 1.15rem;
  font-weight: 500;
}
.landing-lede {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 42ch;
  margin: 0 0 1.75rem;
  line-height: 1.65;
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

/* Bottom logo marquee — seamless infinite scroll */
.brand-rail {
  position: relative;
  margin-top: auto;
  border-top: 1px solid rgba(255, 122, 26, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 122, 26, 0.04), transparent 70%),
    rgba(7, 7, 7, 0.96);
  padding: 1.35rem 0 1.5rem;
  overflow: hidden;
}
.brand-rail-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(140px, 14vw);
  z-index: 3;
  pointer-events: none;
}
.brand-rail-fade-l {
  left: 0;
  background: linear-gradient(90deg, #050505 15%, transparent);
}
.brand-rail-fade-r {
  right: 0;
  background: linear-gradient(270deg, #050505 15%, transparent);
}
.brand-rail-viewport {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.brand-rail-track {
  display: flex;
  width: max-content;
  animation: brandScroll 90s linear infinite;
  will-change: transform;
}
.brand-rail:hover .brand-rail-track {
  animation-play-state: paused;
}
@keyframes brandScroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
/* Two identical groups; gap lives as padding-inline-end so -50% loops cleanly */
.brand-rail-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.85rem;
  padding-inline-end: 0.85rem;
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 52px;
  min-width: 96px;
  padding: 0 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.brand-chip:hover {
  border-color: rgba(255, 122, 26, 0.35);
  background: rgba(255, 122, 26, 0.06);
  transform: translateY(-1px);
}
.brand-chip img {
  display: block;
  width: auto;
  height: 26px;
  max-width: 110px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
/* Force light marks on dark rail when source asset is black */
.brand-chip img.logo-light {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .brand-rail-track {
    animation: none !important;
    transform: none !important;
  }
  .brand-rail-viewport {
    overflow-x: auto;
  }
}

.ping-card { overflow: hidden; }
.ping-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.ping-orbit {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 122, 26, 0.35);
  position: relative;
  flex-shrink: 0;
  animation: orbitSpin 4s linear infinite;
}
.ping-orbit span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange-hot);
  top: -4px;
  left: 50%;
  margin-left: -4px;
  box-shadow: 0 0 12px var(--orange-glow);
}
@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}
.ping-form { margin-bottom: 0.75rem; }
.ping-btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}
.ping-stage {
  min-height: 4rem;
  position: relative;
}
.ping-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0;
  animation: fadeUp 0.35s var(--ease) both;
}
.ping-loader.is-active {
  display: flex;
}
.is-hidden { display: none !important; }
.ping-out.is-hidden { display: none !important; }
.ping-radar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 122, 26, 0.25);
  position: relative;
  overflow: hidden;
}
.ping-radar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 122, 26, 0.55) 100%);
  animation: radar 1s linear infinite;
}
.ping-radar i {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 16px var(--orange-glow);
}
@keyframes radar {
  to { transform: rotate(360deg); }
}
.ping-out {
  background: linear-gradient(160deg, rgba(255, 122, 26, 0.06), rgba(8, 8, 8, 0.95));
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  color: #e8e4dc;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.05);
}
.ping-out.reveal {
  animation: pingReveal 0.55s var(--ease) both;
}
@keyframes pingReveal {
  from { opacity: 0; transform: translateY(10px) scale(0.98); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}

.disabled-panel {
  opacity: 0.45;
  pointer-events: none;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-top: 1rem;
}
.disabled-form input {
  opacity: 0.7;
}
.email-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}


/* ── xAI Score ── */
.xai-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 122, 26, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.08), 0 24px 60px rgba(0, 0, 0, 0.45);
}
.xai-card::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 122, 26, 0.14), transparent 70%);
  pointer-events: none;
  animation: xaiGlow 6s ease-in-out infinite alternate;
}
@keyframes xaiGlow {
  from { opacity: 0.45; transform: translate(0, 0); }
  to { opacity: 1; transform: translate(12%, 8%); }
}
.xai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.xai-eyebrow {
  color: var(--orange-hot);
  letter-spacing: 0.14em;
}
.xai-orb {
  width: 52px;
  height: 52px;
  position: relative;
  flex-shrink: 0;
}
.xai-orb span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 122, 26, 0.35);
  animation: xaiOrb 2.4s ease-in-out infinite;
}
.xai-orb span:nth-child(2) { inset: 8px; animation-delay: 0.3s; border-color: rgba(255, 149, 32, 0.5); }
.xai-orb span:nth-child(3) {
  inset: 18px;
  background: var(--orange);
  box-shadow: 0 0 18px var(--orange-glow);
  border: none;
  animation: xaiPulse 1.6s ease-in-out infinite;
}
@keyframes xaiOrb {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes xaiPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1); opacity: 1; }
}
.xai-form { position: relative; z-index: 1; margin-bottom: 1.1rem; }
.xai-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.xai-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.xai-input {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border-color: var(--border-strong) !important;
}
.xai-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.2);
}
.xai-btn { min-width: 9.5rem; }
.xai-btn-gold {
  position: relative;
  background: linear-gradient(145deg, #ffd76a 0%, #f0a500 38%, #d4890a 72%, #b8730a 100%) !important;
  border: 1px solid rgba(255, 220, 140, 0.65) !important;
  color: #1a1200 !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow:
    0 0 0 1px rgba(255, 200, 80, 0.25),
    0 0 22px rgba(255, 190, 60, 0.45),
    0 0 48px rgba(255, 160, 20, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
  animation: goldAura 2.4s ease-in-out infinite;
}
.xai-btn-gold:hover {
  filter: brightness(1.06);
  box-shadow:
    0 0 0 1px rgba(255, 220, 120, 0.4),
    0 0 28px rgba(255, 200, 70, 0.55),
    0 0 60px rgba(255, 170, 30, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
.xai-btn-gold:disabled,
.xai-btn-gold.is-loading {
  filter: saturate(0.85);
  opacity: 0.92;
}
@keyframes goldAura {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,200,80,0.25), 0 0 18px rgba(255,190,60,0.4), 0 0 40px rgba(255,160,20,0.18), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 0 0 1px rgba(255,220,120,0.45), 0 0 30px rgba(255,200,70,0.6), 0 0 64px rgba(255,170,30,0.32), inset 0 1px 0 rgba(255,255,255,0.55); }
}
.xai-input-query {
  font-size: 1.02rem !important;
  padding: 0.8rem 1rem !important;
}
.xai-input-scenario {
  font-size: 0.86rem !important;
  padding: 0.55rem 0.85rem !important;
  max-width: 100%;
  opacity: 0.95;
}
.xai-row-actions { margin-top: 0.85rem; justify-content: flex-start; }
.topup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.topup-btn:disabled,
.topup-btn[disabled] {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.35);
}
.credits-edit {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 6.5rem;
}
.credits-input {
  width: 6.5rem !important;
  max-width: 7rem;
  padding: 0.35rem 0.5rem !important;
  font-size: 0.88rem !important;
  font-family: var(--font-mono);
}
.xai-summary-cell {
  max-width: 16rem;
  line-height: 1.35;
  font-size: 0.78rem !important;
}
.xai-scenario-cell {
  max-width: 11rem;
  line-height: 1.3;
}
.xai-btn.is-loading {
  pointer-events: none;
  opacity: 0.88;
}
.xai-jobs {
  display: grid;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}
.xai-job {
  background: linear-gradient(145deg, rgba(255, 122, 26, 0.06), rgba(12, 12, 12, 0.95));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  animation: fadeUp 0.4s var(--ease) both;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.xai-job.is-running {
  border-color: rgba(255, 122, 26, 0.55);
  box-shadow: 0 0 24px rgba(255, 122, 26, 0.12);
}
.xai-job.is-done { border-color: rgba(61, 214, 140, 0.35); }
.xai-job.is-failed { border-color: rgba(255, 77, 77, 0.4); }
.xai-job-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.xai-job-q { font-size: 1.02rem; letter-spacing: 0.02em; }
.xai-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.xai-status {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange-hot);
}
.xai-job.is-done .xai-status { color: var(--ok); }
.xai-job.is-failed .xai-status { color: var(--danger); }
.xai-score-pill {
  min-width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  border: 2px solid var(--orange);
  color: var(--orange-hot);
  background: rgba(255, 122, 26, 0.1);
  box-shadow: 0 0 16px rgba(255, 122, 26, 0.2);
}
.xai-progress {
  margin-top: 0.15rem;
  height: 10px;
  background: #121212;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255, 180, 60, 0.22);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  position: relative;
}
.xai-progress i {
  display: block;
  height: 100%;
  min-width: 2%;
  background: linear-gradient(90deg, #c45a0a, #ff9a1a, #ffd060, #ff7a1a, #ff4d00);
  background-size: 220% 100%;
  border-radius: 99px;
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  animation: xaiBar 1.1s linear infinite;
  box-shadow: 0 0 12px rgba(255, 170, 40, 0.55);
}
@keyframes xaiBar {
  to { background-position: 200% 0; }
}
.xai-live-track {
  position: relative;
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.xai-scan {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 122, 26, 0.18), transparent);
  animation: xaiScan 2.2s ease-in-out infinite;
}
@keyframes xaiScan {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}
.xai-live-msg { position: relative; margin: 0; }
.xai-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.xai-err {
  margin: 0.55rem 0 0;
  word-break: break-word;
  line-height: 1.4;
}

/* Admin xAI status panel */
.xai-status-card .xai-status-result {
  background: linear-gradient(160deg, rgba(255,122,26,0.07), rgba(8,8,8,0.95));
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  animation: fadeUp 0.4s var(--ease) both;
}
.xai-status-result.is-hidden { display: none !important; }
.xai-status-grid {
  display: grid;
  gap: 0.55rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 0.85rem;
}
.xai-status-grid .kv b {
  display: block;
  color: var(--orange-hot);
  font-size: 0.95rem;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.xai-status-grid .kv span {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.xai-status-notes { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--text-muted); }
.xai-status-notes li { margin: 0.2rem 0; }
.xai-status-ok { color: var(--ok); }
.xai-status-bad { color: var(--danger); }
.xai-status-warn { color: var(--warn, #ffb020); }
.xai-status-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.status-pill.degraded {
  background: rgba(255, 176, 32, 0.15);
  color: #ffb020;
  border-color: rgba(255, 176, 32, 0.4);
}
.status-pill.offline {
  background: rgba(255, 77, 77, 0.12);
  color: #ff8a8a;
  border-color: rgba(255, 77, 77, 0.35);
}

/* xAI Score history table */
.xai-hint { margin: 0.55rem 0 0; }

/* Identity candidate picker */
.id-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 122, 26, 0.35);
  background: linear-gradient(165deg, rgba(255, 122, 26, 0.08), rgba(14, 14, 14, 0.95));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.35s var(--ease) both;
}
.id-panel.is-hidden,
.id-panel[hidden] { display: none !important; }
.id-panel-head { margin-bottom: 0.65rem; }
.id-panel-head strong {
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--orange-hot);
}
.id-panel-head p { margin: 0.35rem 0 0; }
.id-list {
  display: grid;
  gap: 0.5rem;
}
.id-option {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.65rem;
  align-items: start;
  text-align: left;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.id-option:hover,
.id-option:focus-visible {
  border-color: rgba(255, 122, 26, 0.55);
  background: rgba(255, 122, 26, 0.1);
  outline: none;
  transform: translateY(-1px);
}
.id-option-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 122, 26, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.id-option-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.id-option-photo-empty,
.id-option-photo.is-missing {
  background: radial-gradient(circle at 35% 30%, rgba(255, 122, 26, 0.15), rgba(20, 20, 20, 0.9));
}
.id-option-photo.is-missing img { display: none; }
.id-option-body { min-width: 0; display: grid; gap: 0.15rem; }
.id-option-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; }
.id-option-role {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.id-option-dob {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--orange-hot);
  letter-spacing: 0.02em;
}
.id-option-summary {
  display: block;
  font-size: 0.84rem;
  color: #d8d4cc;
  line-height: 1.45;
  margin: 0.15rem 0 0.1rem;
}
.id-option-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.id-handle { color: var(--orange-hot); font-family: var(--font-mono); }
.id-note {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.id-option-why {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.id-panel-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}
.xai-history { margin-top: 1.25rem; position: relative; z-index: 1; }
.xai-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.xai-history-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-hot);
}
.xai-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  background: rgba(0,0,0,0.25);
}
.xai-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.xai-table th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,122,26,0.05);
  white-space: nowrap;
}
.xai-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}
.xai-table tr:last-child td { border-bottom: none; }
.xai-table tr:hover td { background: rgba(255,122,26,0.04); }
.xai-row-focus td { background: rgba(255,122,26,0.08) !important; }
.xai-report-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 11rem;
}
.xai-score-cell {
  display: inline-grid;
  place-items: center;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 2px solid var(--orange);
  color: var(--orange-hot);
  font-family: var(--font-display);
  font-size: 0.85rem;
  background: rgba(255,122,26,0.1);
}
.xai-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.xai-badge-done { color: var(--ok); border-color: rgba(61,214,140,0.4); background: rgba(61,214,140,0.08); }
.xai-badge-running { color: var(--orange-hot); border-color: var(--border-strong); background: rgba(255,122,26,0.1); }
.xai-badge-queued { color: #ffb020; border-color: rgba(255,176,32,0.35); }
.xai-badge-failed { color: var(--danger); border-color: rgba(255,77,77,0.4); background: rgba(255,77,77,0.08); }
.xai-progress-row td { padding-top: 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.xai-progress-row .xai-progress { margin: 0 0 0.55rem; }
.xai-empty { padding: 0.5rem 0 0.25rem; }
.xai-score-pending { opacity: 0.5; font-size: 1.1rem; }
.xai-err {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.xai-active { display: grid; gap: 0.65rem; margin-bottom: 0.5rem; }
@media (max-width: 800px) {
  .xai-report-btns { min-width: 0; }
  .xai-table th:nth-child(4), .xai-table td:nth-child(4) { display: none; }
}
.help-q {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(255,122,26,0.12);
  color: var(--orange-hot);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  padding: 0;
  line-height: 1;
}
.help-q:hover { background: rgba(255,122,26,0.25); }
.help-steps { color: var(--text-muted); padding-left: 1.2rem; }
.help-steps li { margin: 0.45rem 0; }
.help-steps strong { color: var(--text); }

.xai-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--orange) 50%),
    linear-gradient(135deg, var(--orange) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem !important;
  cursor: pointer;
}
.xai-pipe {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--orange-hot);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  background: rgba(255,122,26,0.08);
  white-space: nowrap;
}
#cig-form .xai-input { margin-bottom: 0.55rem; }
#cig-form .xai-row { margin-top: 0.15rem; }
.stop-btn {
  border-color: rgba(255, 176, 32, 0.45) !important;
  color: #ffb060 !important;
}
.stop-btn:hover { background: rgba(255,176,32,0.12) !important; }
.xai-badge-cancelled { color: #ffb060; border-color: rgba(255,176,32,0.4); }
.xai-actions-cell { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.btn-xs {
  padding: 0.28rem 0.55rem !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em;
}
.escalate-btn {
  border-color: rgba(120, 120, 120, 0.35) !important;
  color: rgba(180, 180, 180, 0.75) !important;
  background: rgba(20, 20, 20, 0.55) !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
}
.escalate-btn:hover {
  border-color: rgba(255, 122, 26, 0.35) !important;
  color: #d8d4cc !important;
  background: rgba(40, 40, 40, 0.7) !important;
}
.xai-actions-cell .danger-btn {
  padding: 0.28rem 0.55rem !important;
  font-size: 0.7rem !important;
}
.xai-report-btns .btn-sm { font-size: 0.74rem; }
.xai-badge-failed { /* keep */ }
