:root {
  --bg: #f3f2f0;
  --bg-2: #ebeae7;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --line: rgba(28, 27, 26, 0.08);
  --line-strong: rgba(28, 27, 26, 0.12);
  --text: #1c1b1a;
  --muted: #6f6b66;
  --champagne: #9a7d55;
  --champagne-2: #b8956c;
  --blush: #a86d70;
  --ok: #5f7d58;
  --danger: #b55656;
  --shadow: 0 12px 40px rgba(28, 27, 26, 0.06);
  --radius: 20px;
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-ui);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button, .nav-btn, .rank-row, .talk-bubble, .chip, .control-card {
  touch-action: manipulation;
}

.hidden { display: none !important; }

.login-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 24px;
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(184, 149, 108, 0.18), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(168, 109, 112, 0.12), transparent 50%),
    linear-gradient(165deg, #f7f5f2 0%, var(--bg) 45%, #ebe6df 100%);
}

.login-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: login-drift 14s ease-in-out infinite;
}

.login-orb-a {
  width: min(42vw, 340px);
  height: min(42vw, 340px);
  top: -8%;
  left: -6%;
  background: rgba(184, 149, 108, 0.35);
}

.login-orb-b {
  width: min(36vw, 280px);
  height: min(36vw, 280px);
  right: -4%;
  top: 18%;
  background: rgba(168, 109, 112, 0.22);
  animation-duration: 18s;
  animation-direction: reverse;
}

.login-orb-c {
  width: min(48vw, 380px);
  height: min(48vw, 380px);
  left: 30%;
  bottom: -18%;
  background: rgba(154, 125, 85, 0.16);
  animation-duration: 22s;
  animation-delay: -4s;
}

.login-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(rgba(28, 27, 26, 0.04) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
  animation: login-grain 8s steps(2) infinite;
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: 44px 40px 40px;
  box-shadow:
    0 20px 50px rgba(28, 27, 26, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: login-panel-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-logo {
  width: min(168px, 56%);
  height: auto;
  margin: 0 auto 22px;
  display: block;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  animation:
    login-logo-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both,
    login-logo-float 5.5s ease-in-out 0.9s infinite;
  box-shadow: 0 14px 28px rgba(17, 17, 17, 0.12);
  border: 1px solid var(--line-strong);
}

.login-reveal {
  animation: login-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--reveal, 0) * 90ms + 120ms);
}

.login-panel h1,
.topbar h2,
.hero-strip h3,
.academy-hero h3,
.control-card strong,
.stat strong,
.brand-meta strong {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-panel h1 {
  margin: 0 0 14px;
  font-size: clamp(2.6rem, 8vw, 3.25rem);
  font-style: italic;
  line-height: 0.95;
}

.login-copy {
  margin: 0 0 8px;
  max-width: 32ch;
  margin-inline: auto;
}

.login-copy, .muted, .top-sub {
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.login-form label {
  gap: 10px;
}

.login-form input {
  padding: 14px 16px;
  border-radius: 14px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.login-form input:focus {
  transform: translateY(-1px);
}

.login-submit {
  margin-top: 6px;
  width: 100%;
  padding: 15px 22px;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition:
    background 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease;
  box-shadow: 0 10px 24px rgba(28, 27, 26, 0.14);
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(28, 27, 26, 0.18);
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(28, 27, 26, 0.12);
}

.login-form .form-error {
  margin: 0;
  min-height: 1.2em;
  animation: login-shake 0.4s ease;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  color: var(--champagne);
  font-weight: 600;
}

label {
  display: grid;
  gap: 8px;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(154, 125, 85, 0.55);
  box-shadow: 0 0 0 3px rgba(154, 125, 85, 0.1);
}

.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover {
  border-color: var(--champagne);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text);
  color: #f7f5f2;
  border-color: transparent;
  font-weight: 600;
}

.btn-primary:hover {
  background: #2a2927;
  border-color: transparent;
}

.btn-danger {
  border-color: rgba(181, 86, 86, 0.35);
  color: var(--danger);
  background: #fff;
}

.btn-joke {
  background: rgba(154, 125, 85, 0.14);
  border-color: rgba(154, 125, 85, 0.4);
  color: var(--ink);
  font-weight: 600;
}

.btn-joke:hover {
  background: rgba(154, 125, 85, 0.24);
  border-color: rgba(154, 125, 85, 0.55);
}

.btn-joke:disabled {
  opacity: 0.55;
  transform: none;
  cursor: wait;
}

.btn-ghost { background: transparent; }

.form-error { color: var(--danger); margin: 10px 0 0; }
.form-ok { color: var(--ok); margin: 10px 0 0; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fafaf8;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: grid;
  gap: 12px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 132px;
  height: auto;
  background: #111;
  border-radius: 12px;
  padding: 8px;
}

.brand-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-meta strong {
  font-size: 1.55rem;
  font-style: italic;
}

.nav { display: grid; gap: 4px; }
.nav-label {
  margin: 14px 10px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9a958e;
}

.nav-btn {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-btn:hover,
.nav-btn.active {
  background: #efece7;
  color: var(--text);
}

.sidebar-foot {
  margin-top: auto;
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
  padding-bottom: 8px;
}

.dev-credit {
  margin: 0;
  padding: 0 8px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--muted);
}

.login-credit {
  margin-top: 28px;
  text-align: center;
  padding: 0;
}

.app-footer {
  margin-top: 40px;
  margin-bottom: 12px;
  padding: 20px 4px 28px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.app-footer-credit {
  margin: 0;
  max-width: 42rem;
}

.top-logout {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.side-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 8px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.pulse.on {
  background: var(--ok);
  animation: pulse 1.8s infinite;
}

.main {
  padding: 22px 28px 48px;
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow-x: clip;
}

.nav-open,
.nav-close,
.nav-backdrop {
  display: none;
}

.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 26px;
  animation: rise 0.4s ease both;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 2;
}

.top-action {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.18s ease;
}

.top-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.top-action:hover,
.top-action.is-current {
  border-color: rgba(184, 149, 108, 0.65);
  background: #f7f3ed;
  color: #8a6a3d;
}

.top-action.danger:hover,
.top-action.danger.is-current {
  border-color: rgba(180, 70, 70, 0.45);
  background: #fdf2f2;
  color: var(--danger);
}

.top-action.info {
  border-color: rgba(184, 149, 108, 0.35);
  background: rgba(184, 149, 108, 0.08);
  color: var(--champagne);
}

.top-action.info:hover {
  border-color: rgba(184, 149, 108, 0.65);
  background: #f7f3ed;
  color: #8a6a3d;
}

.top-action::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: #111;
  color: #f4efe8;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.15s ease;
  z-index: 5;
}

.top-action:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.session-chip {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 120px;
  text-align: right;
}

.session-chip strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.session-chip span {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  order: 3;
  margin-left: auto;
}

.topbar h2 {
  margin: 0;
  font-size: 2.55rem;
  font-style: italic;
}

.top-sub { margin: 4px 0 0; }

.pill {
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.pill[data-status="active"] { border-color: rgba(95,125,88,0.4); color: var(--ok); }
.pill[data-status="paused"],
.pill[data-status="sleeping"] { border-color: rgba(154,125,85,0.4); color: var(--champagne); }
.pill[data-status="off"] { border-color: rgba(181,86,86,0.4); color: var(--danger); }
.pill-muted { color: var(--muted); }

.hero-strip,
.academy-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 24px 26px;
  margin-bottom: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}

.hero-strip h3,
.academy-hero h3 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-style: italic;
}

.live-compose-panel {
  margin-bottom: 14px;
}

.live-compose-form {
  display: grid;
  gap: 10px;
}

.live-compose-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  line-height: 1.45;
}

.live-compose-form textarea:focus {
  outline: 2px solid rgba(184, 149, 108, 0.35);
  border-color: var(--champagne);
}

.live-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.dash-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.dash-main { min-width: 0; }

.security-rail {
  position: sticky;
  top: 18px;
}

.security-card {
  padding: 18px 16px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(154, 125, 85, 0.22);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(154,125,85,0.12), transparent 55%),
    linear-gradient(180deg, #1c1b1a 0%, #2a2724 100%);
  color: #f4efe8;
  box-shadow: 0 18px 40px rgba(28, 27, 26, 0.18);
  overflow: hidden;
}

.security-card .eyebrow { color: rgba(184, 149, 108, 0.9); }
.security-card .panel-head h3 {
  color: #f4efe8;
  font-size: 0.95rem;
  margin: 0;
}

.security-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.security-head strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.55rem;
}

.threat-pill {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  border: 1px solid rgba(95, 125, 88, 0.45);
  color: #b7d0b1;
  background: rgba(95, 125, 88, 0.15);
}

.threat-pill.alert {
  border-color: rgba(181, 86, 86, 0.5);
  color: #e8b4b4;
  background: rgba(181, 86, 86, 0.16);
  animation: pulse 1.4s infinite;
}

.radar-stage {
  display: grid;
  place-items: center;
  margin: 8px 0 18px;
}

.radar-core {
  position: relative;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(154,125,85,0.18) 0%, transparent 55%),
    repeating-radial-gradient(circle at center, rgba(244,239,232,0.08) 0 1px, transparent 1px 28px);
  border: 1px solid rgba(184, 149, 108, 0.35);
  box-shadow: inset 0 0 30px rgba(154, 125, 85, 0.15);
  overflow: hidden;
}

.radar-ring {
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(184, 149, 108, 0.22);
  border-radius: 50%;
}
.radar-ring.r2 { inset: 32%; }
.radar-ring.r3 { inset: 46%; }
.radar-ring.r4 { inset: 58%; opacity: 0.55; }
.radar-ring.r5 { inset: 70%; opacity: 0.35; }

.radar-pt-badge {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: rgba(184, 149, 108, 0.85);
}

.radar-pt-silhouette {
  position: absolute;
  inset: 22%;
  width: 56%;
  height: 56%;
  margin: auto;
  color: rgba(184, 149, 108, 0.08);
  pointer-events: none;
  z-index: 0;
}

.radar-sweep-2 {
  animation: radar-spin 5.5s linear infinite reverse;
  background: conic-gradient(from 180deg, transparent 0deg, rgba(184,149,108,0.15) 40deg, transparent 60deg);
  opacity: 0.7;
}

.radar-scan-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 1px;
  margin-top: -0.5px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(184,149,108,0.5), transparent);
  animation: radar-spin 3.2s linear infinite;
  mix-blend-mode: screen;
}

.radar-core.alert {
  border-color: rgba(181, 86, 86, 0.55);
  box-shadow:
    inset 0 0 30px rgba(181, 86, 86, 0.2),
    0 0 24px rgba(181, 86, 86, 0.25);
  animation: radar-alert-pulse 2s ease-in-out infinite;
}

.radar-core.alert .radar-sweep {
  animation-duration: 1.6s;
}

.radar-core.alert .radar-ring {
  animation: radar-ring-pulse 1.8s ease-in-out infinite;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 0.68rem;
  color: rgba(244, 239, 232, 0.55);
}

.radar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.radar-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.radar-legend i.spam { background: #c4a574; box-shadow: 0 0 6px rgba(196,165,116,0.6); }
.radar-legend i.flood { background: #7eb8d4; box-shadow: 0 0 6px rgba(126,184,212,0.6); }
.radar-legend i.phish { background: #e8a060; box-shadow: 0 0 6px rgba(232,160,96,0.6); }
.radar-legend i.abuse { background: #e87878; box-shadow: 0 0 6px rgba(232,120,120,0.6); }
.radar-legend i.auth { background: #b888e8; box-shadow: 0 0 6px rgba(184,136,232,0.6); }

.radar-blip.spam { background: #c4a574; box-shadow: 0 0 10px rgba(196,165,116,0.85); }
.radar-blip.flood { background: #7eb8d4; box-shadow: 0 0 10px rgba(126,184,212,0.85); }
.radar-blip.phish { background: #e8a060; box-shadow: 0 0 10px rgba(232,160,96,0.85); }
.radar-blip.abuse { background: #e87878; box-shadow: 0 0 10px rgba(232,120,120,0.85); }
.radar-blip.auth { background: #b888e8; box-shadow: 0 0 10px rgba(184,136,232,0.85); }
.radar-blip.other { background: #a8a8a8; box-shadow: 0 0 8px rgba(168,168,168,0.6); }

.radar-sweep {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(184,149,108,0.35) 50deg, transparent 70deg);
  animation: radar-spin 3.2s linear infinite;
  mix-blend-mode: screen;
}

.radar-cross-h,
.radar-cross-v {
  position: absolute;
  background: rgba(244, 239, 232, 0.08);
}
.radar-cross-h { left: 8%; right: 8%; top: 50%; height: 1px; }
.radar-cross-v { top: 8%; bottom: 8%; left: 50%; width: 1px; }

.radar-blips { position: absolute; inset: 0; }

.radar-blip {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #e8b4b4;
  box-shadow: 0 0 10px rgba(232, 180, 180, 0.8);
  animation: radar-blip 1.8s ease-in-out infinite;
}

.radar-center {
  position: absolute;
  inset: 50%;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: rgba(28, 27, 26, 0.72);
  border: 1px solid rgba(184, 149, 108, 0.35);
  backdrop-filter: blur(6px);
}

.radar-center small {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.58rem;
  color: rgba(244, 239, 232, 0.55);
}

.radar-center strong {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1;
}

.mod-toggles {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.mod-toggle {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 232, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.mod-toggle input { margin-top: 3px; accent-color: #b8956c; }
.mod-toggle strong { display: block; font-size: 0.88rem; font-weight: 600; }
.mod-toggle small { display: block; margin-top: 2px; color: rgba(244, 239, 232, 0.5); font-size: 0.75rem; }

.mod-host-name {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(184, 149, 108, 0.22);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(244, 239, 232, 0.72);
  font-size: 0.78rem;
}

.mod-host-name input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(184, 149, 108, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #f4efe8;
  font: inherit;
}

.mod-host-name input::placeholder {
  color: rgba(244, 239, 232, 0.35);
}

.mod-section { margin-top: 14px; }

.mod-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 10px 0;
}

.mod-add-row input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 239, 232, 0.14);
  color: #f4efe8;
}

.mod-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(184, 149, 108, 0.35);
  background: rgba(184, 149, 108, 0.12);
  font-size: 0.78rem;
}

.mod-chip button {
  border: 0;
  background: transparent;
  color: rgba(244, 239, 232, 0.7);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.mod-people-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.mod-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(244, 239, 232, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.mod-person strong { display: block; font-size: 0.88rem; }
.mod-person small { color: rgba(244, 239, 232, 0.5); }

.security-card .btn-primary {
  background: #b8956c;
  color: #1c1b1a;
}
.security-card .btn {
  color: #f4efe8;
  border-color: rgba(244, 239, 232, 0.2);
}
.security-card .btn-primary { color: #1c1b1a; border-color: transparent; }

@keyframes radar-spin {
  to { transform: rotate(360deg); }
}

@keyframes radar-blip {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes radar-alert-pulse {
  0%, 100% { box-shadow: inset 0 0 30px rgba(181, 86, 86, 0.15), 0 0 16px rgba(181, 86, 86, 0.2); }
  50% { box-shadow: inset 0 0 36px rgba(181, 86, 86, 0.28), 0 0 28px rgba(181, 86, 86, 0.35); }
}

@keyframes radar-ring-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.live-ops {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(247,243,237,0.92)),
    radial-gradient(120% 80% at 100% 0%, rgba(154,125,85,0.12), transparent 50%);
  animation: rise 0.45s ease both;
}

.live-ops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.live-ops-head strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-style: italic;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
  background: #fff;
}

.live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b0aaa3;
}

.live-badge.on {
  color: #3f5f3a;
  border-color: rgba(95,125,88,0.35);
  background: rgba(95,125,88,0.08);
}

.live-badge.on i {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(95,125,88,0.45);
  animation: pulse 1.6s infinite;
}

.pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pulse-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
}

.pulse-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.pulse-card strong {
  display: block;
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-style: italic;
  line-height: 1;
}

.pulse-card strong span {
  display: inline;
  margin-left: 4px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--muted);
}

.pulse-card small { display: block; }

.meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(28,27,26,0.06);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--champagne), var(--blush));
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.chart-panel { margin-top: 4px; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

.lg-comments { background: var(--champagne); }
.lg-replies { background: var(--ok); }
.lg-skipped { background: #c4b8a8; }

.chart-wrap {
  position: relative;
  margin-top: 10px;
  height: 260px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), rgba(243,242,240,0.9));
  overflow: hidden;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-grid line {
  stroke: rgba(28,27,26,0.06);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: chart-draw 1.1s ease forwards;
}

.chart-line-comments { stroke: var(--champagne); }
.chart-line-replies { stroke: var(--ok); animation-delay: 0.08s; }
.chart-line-skipped { stroke: #c4b8a8; stroke-dasharray: 5 5; animation-delay: 0.14s; }

.chart-dot {
  fill: #fff;
  stroke: var(--champagne);
  stroke-width: 1.5;
  animation: chart-dot-in 0.45s ease both;
}

.chart-axis {
  fill: var(--muted);
  font-size: 9px;
  font-family: var(--font-ui);
}

.chart-scan {
  position: absolute;
  inset: 0;
  width: 28%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  animation: chart-scan 3.8s linear infinite;
}

.rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(280px, 1.15fr);
  gap: 16px;
  margin-bottom: 16px;
}

.talk-panel {
  grid-column: auto;
}

.rank-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.rank-empty { padding: 12px 0; }

.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.rank-row:hover,
.rank-row.active {
  border-color: rgba(154,125,85,0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(28,27,26,0.05);
}

.rank-row.active {
  background: #faf6f1;
}

.rank-pos {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--champagne);
}

.rank-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rank-body strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-body small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(28,27,26,0.06);
  overflow: hidden;
}

.rank-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--champagne-2), var(--blush));
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
}

.talk-hint { margin: 0 0 12px; }

.talk-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f3ed;
  border: 1px solid var(--line);
}

.talk-meta strong {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
}

.talk-meta span { color: var(--muted); font-size: 0.85rem; }

.talk-thread {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 12px;
}

.talk-bubble {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.talk-bubble:hover,
.talk-bubble.selected {
  border-color: rgba(154,125,85,0.5);
  background: #fcfaf7;
}

.talk-bubble small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.talk-form {
  display: grid;
  gap: 12px;
}

.talk-form textarea {
  resize: vertical;
  min-height: 84px;
}

@keyframes chart-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes chart-dot-in {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes chart-scan {
  from { transform: translateX(-40%); }
  to { transform: translateX(380%); }
}

.stat, .panel, .control-card, .tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.stat {
  padding: 18px 18px 16px;
}

.stat::after { display: none; }

.stat span { color: var(--muted); font-size: 0.82rem; }
.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  font-style: italic;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.panel {
  padding: 22px;
  margin-bottom: 16px;
}

.panel h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-style: italic;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.quick-actions,
.control-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.control-card {
  text-align: left;
  padding: 22px;
  cursor: pointer;
  transition: 0.2s ease;
}

.control-card:hover {
  border-color: rgba(154,125,85,0.45);
  transform: translateY(-1px);
}

.control-kicker {
  display: block;
  color: var(--champagne);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

.control-card span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.control-card.danger:hover { border-color: rgba(181,86,86,0.45); }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(184, 149, 108, 0.95);
  color: #1c1712;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comments-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1.35fr);
  gap: 16px;
  align-items: stretch;
  min-height: min(70vh, calc(100vh - 130px));
}

.comments-aside { position: sticky; top: 12px; align-self: stretch; }

.comments-aside .panel,
.comments-aside .pending-panel {
  min-height: min(70vh, calc(100vh - 130px));
  height: auto;
  max-height: min(82vh, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
}

.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ops-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.ops-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ops-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.ops-stat.highlight {
  border-color: rgba(184, 149, 108, 0.45);
  background: rgba(184, 149, 108, 0.08);
}

.comment-filters { margin: 4px 0 14px; }
.comment-list.tall { max-height: min(82vh, 1100px); }

.knowledge-list.pending-list,
.pending-list {
  max-height: none !important;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
  gap: 8px;
}

.pending-list .pending-item,
.pending-list .knowledge-item {
  padding: 12px;
}

.users-list .knowledge-item {
  align-items: center;
}

.comment-item.is-expandable .manual-reply {
  display: none;
  margin-top: 10px;
  gap: 8px;
}
.comment-item.is-open .manual-reply { display: grid; }
.manual-reply textarea { width: 100%; min-height: 64px; }

.ops-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.ops-hero h3 {
  margin: 4px 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.8rem;
}
.ops-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 420px;
}
.ops-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.section-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.section-intro h3 {
  margin: 4px 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
}
.section-label {
  margin: 8px 0 10px;
  color: var(--champagne);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.control-card.is-current {
  border-color: rgba(184, 149, 108, 0.55);
  box-shadow: 0 0 0 1px rgba(184, 149, 108, 0.2);
}

.live-status-card {
  min-width: 200px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: right;
}
.live-status-card strong {
  display: block;
  margin: 4px 0;
  font-size: 0.95rem;
  word-break: break-all;
}
.tool-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.tool-card .muted { margin-bottom: 12px; }
.stack-sm {
  display: grid;
  gap: 10px;
}
.stack-sm label {
  display: grid;
  gap: 6px;
  text-align: left;
  font-size: 0.86rem;
  color: var(--muted);
}
.stack-sm input,
.stack-sm textarea,
.stack-sm select,
.panel input,
.panel textarea,
.panel select,
.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}
.stack-sm input:focus,
.stack-sm textarea:focus,
.panel input:focus,
.panel textarea:focus,
.form-grid input:focus,
.form-grid textarea:focus {
  outline: 2px solid rgba(184, 149, 108, 0.35);
  border-color: rgba(184, 149, 108, 0.55);
}
.login-form label {
  display: grid;
  gap: 8px;
  text-align: left;
  color: var(--text);
  font-weight: 500;
}
.login-form input {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}
.login-submit {
  width: 100%;
  margin-top: 4px;
}
.login-panel .eyebrow {
  color: var(--champagne);
  font-weight: 600;
}

@media (max-width: 1280px) {
  .comments-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .comments-aside {
    position: static;
  }

  .comments-aside .panel,
  .comments-aside .pending-panel {
    min-height: auto;
    height: auto;
    max-height: min(60vh, 520px);
  }

  .dash-shell {
    grid-template-columns: 1fr;
  }

  .security-rail {
    position: relative;
    top: 0;
  }

  .rank-grid {
    grid-template-columns: 1fr 1fr;
  }

  .talk-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  .comments-shell,
  .ops-panels { grid-template-columns: 1fr; }
  .comments-aside { position: static; }
  .ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-hero { flex-direction: column; }
  .ops-pills { justify-content: flex-start; }
  .section-intro { flex-direction: column; }
  .live-status-card { text-align: left; width: 100%; }
}

.tools-grid,
.academy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Ferramentas: workspace a ocupar o ecrã */
#view-tools {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#view-tools .tools-intro {
  margin-bottom: 4px;
}

#view-tools .tools-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: stretch;
  width: 100%;
}

#view-tools .tools-span {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

#view-tools .tool-card {
  margin-bottom: 0;
  padding: 26px 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#view-tools .tool-card-wide {
  grid-column: 1 / -1;
  min-height: 160px;
}

#view-tools .tool-card h3 {
  font-size: 1.55rem;
}

#view-tools .tool-card .muted {
  flex: 0 0 auto;
}

#view-tools .tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.emoji-tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.emoji-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.emoji-pack-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.emoji-pack-btn:hover {
  border-color: rgba(154, 125, 85, 0.45);
  background: rgba(154, 125, 85, 0.1);
  transform: translateY(-1px);
}

.emoji-pack-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.emoji-pack-btn .emoji-preview {
  font-size: 1.35rem;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.emoji-pack-btn .emoji-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.emoji-custom-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.emoji-custom-row input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .emoji-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .emoji-custom-row {
    flex-direction: column;
    align-items: stretch;
  }
}

#view-tools .stack-sm {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#view-tools .stack-sm .btn,
#view-tools .tool-card > .btn {
  margin-top: auto;
}

#view-tools textarea {
  min-height: 120px;
  resize: vertical;
}

#view-tools .live-status-card {
  min-width: 260px;
  padding: 18px 20px;
}

@media (min-width: 1200px) {
  #view-tools .tools-workspace {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  #view-tools .tool-card {
    min-height: 300px;
    padding: 28px 30px;
  }
}

@media (min-width: 1600px) {
  #view-tools .tools-workspace {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
  }

  #view-tools .tool-card {
    min-height: 320px;
  }
}

.host-listen-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.host-listen-panel.is-listening {
  outline: 1px solid rgba(184, 149, 108, 0.55);
  box-shadow: 0 0 0 1px rgba(184, 149, 108, 0.15);
}

.host-transcript {
  margin: 10px 0 0;
  max-height: 160px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(244, 239, 232, 0.82);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

#host-listen-status.is-on {
  color: #c4a574;
}

@media (min-width: 1400px) {
  .academy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .control-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .security-rail {
    min-height: calc(100vh - 40px);
  }
  .chart-wrap { height: 300px; }
}

.tool-card { padding: 22px; }

.stack, .stack-sm { display: grid; gap: 12px; }
.stack-sm { margin-top: 12px; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.chip:hover, .chip.active {
  border-color: var(--champagne);
  color: var(--champagne);
  background: #f7f3ed;
}

.academy-stats {
  display: flex;
  gap: 18px;
}

.academy-stats div {
  min-width: 88px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
}

.academy-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.academy-stats strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-style: italic;
}

.academy-intel-grid {
  margin-bottom: 18px;
}

.intel-bullets {
  margin: 10px 0 14px;
  padding-left: 1.1rem;
  color: var(--text);
  line-height: 1.55;
}

.intel-bullets li {
  margin-bottom: 6px;
}

.academy-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.academy-chat-log {
  flex: 1;
  min-height: 200px;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7f5f1;
  margin: 10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.academy-chat-empty {
  margin: auto;
  text-align: center;
  padding: 24px 12px;
}

.academy-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.academy-chat-bubble.cliente {
  align-self: flex-start;
}

.academy-chat-bubble.kiko {
  align-self: flex-end;
  background: #111;
  color: #f4efe8;
  border-color: #111;
}

.academy-chat-bubble span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 4px;
}

.academy-chat-bubble p {
  margin: 0;
  line-height: 1.4;
  font-size: 0.95rem;
}

.academy-chat-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.academy-chat-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
}

@media (max-width: 720px) {
  .academy-chat-form {
    grid-template-columns: 1fr;
  }
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.checklist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.checklist li:last-child { border-bottom: 0; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }

.activity-list,
.knowledge-list,
.comment-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.activity-item,
.knowledge-item,
.comment-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-2);
}

.activity-item small,
.knowledge-item small,
.comment-item small { color: var(--muted); }

.activity-item strong,
.knowledge-item strong,
.comment-item strong {
  display: block;
  margin: 4px 0;
}

.comment-item .reply {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--champagne);
}

.comment-main,
.reply-kiko {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-body {
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8dfd2;
  border: 1px solid var(--line);
}

.avatar-kiko {
  border-color: rgba(154, 125, 85, 0.45);
  box-shadow: 0 0 0 2px rgba(154, 125, 85, 0.12);
}

.reply-kiko {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(154, 125, 85, 0.08);
  border: 1px solid rgba(154, 125, 85, 0.18);
}

.reply-kiko.mini {
  margin-top: 8px;
  padding: 8px;
}

.reply-kiko strong {
  color: var(--champagne);
  letter-spacing: 0.04em;
}

.skip-reason {
  display: block;
  margin-top: 6px;
}

.rank-row .avatar {
  width: 32px;
  height: 32px;
  margin-top: 2px;
}

#talk-person-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.kiko-mode-row {
  margin: 14px 0 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.kiko-mode-row .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kiko-mode-row .chip {
  min-height: 36px;
  padding: 8px 14px;
  font-weight: 600;
}

.kiko-mode-row .chip.active {
  background: rgba(154, 125, 85, 0.18);
  border-color: rgba(154, 125, 85, 0.45);
  color: var(--ink);
}

.pending-item .knowledge-actions {
  margin-top: 12px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  border: 1px solid var(--line-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.replied { color: var(--ok); border-color: rgba(95,125,88,0.35); }
.badge.skipped, .badge.pending, .badge.queued { color: var(--champagne); border-color: rgba(154,125,85,0.35); }
.badge.error, .badge.rejected { color: var(--danger); border-color: rgba(181,86,86,0.35); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full,
.form-grid .checkbox { grid-column: 1 / -1; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox input { width: auto; }

.inline-field { max-width: 220px; }

.knowledge-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.test-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #f7f3ed;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes login-panel-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-logo-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes login-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -22px, 0) scale(1.06); }
}

@keyframes login-grain {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1px, 1px); }
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .login-orb,
  .login-grain,
  .login-logo,
  .login-panel,
  .login-reveal,
  .login-form .form-error,
  .chart-line,
  .chart-dot,
  .chart-scan,
  .live-badge.on i,
  .radar-sweep,
  .radar-sweep-2,
  .radar-scan-line,
  .radar-blip,
  .radar-core.alert,
  .radar-core.alert .radar-ring,
  .ops-sonar-beam,
  .ops-matrix-wrap canvas,
  .ops-meter-needle,
  .threat-pill.alert {
    animation: none !important;
  }
  .chart-line { stroke-dasharray: none; stroke-dashoffset: 0; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(95,125,88,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(95,125,88,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,125,88,0); }
}

@media (max-width: 1100px) {
  .dash-shell {
    grid-template-columns: 1fr;
  }
  .security-rail { position: relative; top: 0; }
  .rank-grid { grid-template-columns: 1fr 1fr; }
  .talk-panel { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(28, 27, 26, 0.42);
    backdrop-filter: blur(2px);
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  .nav-backdrop[hidden] { display: none !important; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 300px);
    height: 100vh;
    height: 100dvh;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 12px 0 40px rgba(28, 27, 26, 0.18);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-open {
    display: inline-grid;
    gap: 5px;
    width: 44px;
    height: 44px;
    place-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
  }

  .nav-open span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
  }

  .nav-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
  }

  .brand {
    position: relative;
    padding-right: 48px;
  }

  .brand-logo { width: 108px; }

  .main {
    padding: 16px 14px calc(140px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 0 12px;
    background: linear-gradient(180deg, var(--bg) 70%, transparent);
  }

  .topbar-left {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar h2 {
    font-size: 1.65rem;
    line-height: 1.1;
  }

  .top-sub {
    display: none;
  }

  .topbar-status {
    order: 3;
    width: 100%;
    gap: 6px;
    justify-content: flex-start;
  }

  .topbar-actions {
    order: 2;
    width: auto;
    flex-shrink: 0;
    gap: 6px;
    justify-content: flex-start;
  }

  .top-action {
    width: 38px;
    height: 38px;
  }

  .top-action.info {
    order: -1;
  }

  .session-chip {
    text-align: left;
    min-width: 0;
    padding: 6px 10px;
  }

  .session-chip strong {
    font-size: 0.82rem;
  }

  .session-chip span {
    font-size: 0.68rem;
  }

  .topbar-status .pill {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .hpill {
    height: 1.35rem;
    padding: 0 6px;
    font-size: 0.58rem;
  }

  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -8px 24px rgba(28, 27, 26, 0.08);
    gap: 4px;
  }

  .dock-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 6px 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: 0.18s ease;
  }

  .dock-btn:hover,
  .dock-btn.active {
    background: rgba(184, 149, 108, 0.12);
    color: var(--champagne);
  }

  .dock-btn.active {
    font-weight: 600;
  }

  .dock-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 28px);
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--champagne-2);
    color: #1c1712;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid,
  .pulse-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .rank-grid,
  .panel-grid,
  .control-grid,
  .tools-grid,
  .academy-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  #view-tools .tools-workspace {
    grid-template-columns: 1fr;
  }

  #view-tools .tool-card {
    min-height: 0;
  }

  .hero-strip,
  .academy-hero,
  .live-ops-head,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .quick-actions .btn,
  .row-actions .btn,
  .control-card,
  .nav-btn,
  .login-submit {
    min-height: 44px;
  }

  .live-ops { padding: 16px 14px; }
  .pulse-card strong { font-size: 1.45rem; }
  .chart-wrap { height: 160px; }
  .radar-core { width: 180px; height: 180px; }

  .talk-form .row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .comment-item,
  .rank-row,
  .mod-toggle {
    padding: 12px;
  }

  .dev-credit { font-size: 0.62rem; }
  .app-footer {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 48px;
    margin-bottom: 24px;
    padding: 24px 8px 36px;
  }

  .sidebar-foot {
    margin-bottom: 28px;
    padding-bottom: 16px;
  }
}

@media (max-width: 640px) {
  .login-shell { padding: 16px 12px; }
  .login-panel { padding: 28px 20px 24px; border-radius: 22px; }
  .login-logo { width: min(140px, 52%); margin-bottom: 16px; }
  .login-panel h1 { font-size: 2.4rem; }

  .stat-grid,
  .pulse-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat,
  .pulse-card {
    padding: 12px;
  }

  .stat strong {
    font-size: 1.55rem;
    margin-top: 6px;
  }

  .topbar-status .pill {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .top-sub { display: none; }

  .hero-strip h3,
  .live-ops-head strong {
    font-size: 1.35rem;
  }

  .form-grid label.full,
  .form-grid label {
    grid-column: 1 / -1;
  }

  .chip-row {
    gap: 6px;
  }

  .security-card { padding: 14px 12px 16px; }
}

@media (max-width: 420px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .stat-grid,
  .pulse-grid {
    grid-template-columns: 1fr;
  }
}

/* System health monitor */
.health-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.hpill {
  display: inline-flex;
  align-items: center;
  height: 1.55rem;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface);
}
.hpill[data-state="ok"] {
  color: #2f5a2f;
  border-color: rgba(95, 125, 88, 0.45);
  background: rgba(95, 125, 88, 0.12);
}
.hpill[data-state="warn"] {
  color: #7a5a20;
  border-color: rgba(184, 149, 108, 0.55);
  background: rgba(184, 149, 108, 0.16);
}
.hpill[data-state="error"] {
  color: #7a2e2e;
  border-color: rgba(181, 86, 86, 0.5);
  background: rgba(181, 86, 86, 0.12);
}
.health-board { margin-bottom: 16px; }
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.health-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.health-card[data-state="ok"] { border-color: rgba(95, 125, 88, 0.35); }
.health-card[data-state="warn"] { border-color: rgba(184, 149, 108, 0.45); }
.health-card[data-state="error"] { border-color: rgba(181, 86, 86, 0.45); }
.health-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.health-card strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 1.05rem;
  font-family: var(--font-display);
}
.health-bar {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(28, 27, 26, 0.08);
  overflow: hidden;
}
.health-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--champagne);
  transition: width 0.35s ease;
}
.health-card[data-state="ok"] .health-bar i { background: var(--ok); }
.health-card[data-state="warn"] .health-bar i { background: var(--champagne-2); }
.health-card[data-state="error"] .health-bar i { background: var(--danger); }
.health-problems {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.health-problems li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.88rem;
}
.health-problems li[data-level="error"] {
  border-color: rgba(181, 86, 86, 0.35);
  background: rgba(181, 86, 86, 0.06);
}
.health-problems li[data-level="warn"] {
  border-color: rgba(184, 149, 108, 0.4);
  background: rgba(184, 149, 108, 0.08);
}
.health-problems .tag {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(28, 27, 26, 0.06);
}
@media (max-width: 1100px) {
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .health-grid { grid-template-columns: 1fr; }
  .health-pills { display: none; }
}

/* Info view */
.info-hero {
  align-items: flex-start;
}

.info-hero h3 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-style: italic;
}

.info-panel {
  margin-bottom: 16px;
}

.info-steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  counter-reset: info-step;
}

.info-steps li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  counter-increment: info-step;
}

.info-steps li::before {
  content: counter(info-step);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(184, 149, 108, 0.16);
  color: var(--champagne);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 600;
}

.info-steps li strong {
  grid-column: 2;
  display: block;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.info-steps li span,
.info-steps li > span {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.info-steps li span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.info-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.info-card strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--champagne);
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.info-tips-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  line-height: 1.55;
  color: var(--text);
}

.info-tips-list li {
  margin-bottom: 8px;
}

.info-tips-list li:last-child {
  margin-bottom: 0;
}

/* Mobile bottom dock — hidden on desktop */
.mobile-dock {
  display: none;
}

/* ─── Ops Meta (dark cinematic, scoped) ─── */
#view-ops.ops-meta {
  --ops-bg: #121110;
  --ops-surface: #1a1816;
  --ops-line: rgba(184, 149, 108, 0.18);
  --ops-text: #f0ebe3;
  --ops-muted: rgba(240, 235, 227, 0.52);
  --ops-green: #6fcf8a;
  --ops-champagne: #c4a574;
  color: var(--ops-text);
}

.ops-hero-strip {
  padding: 22px 24px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--ops-line);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(196, 165, 116, 0.14), transparent 55%),
    linear-gradient(165deg, #1e1c1a 0%, var(--ops-bg) 100%);
}

.ops-hero-strip h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-style: italic;
  color: var(--ops-champagne);
}

.ops-hero-strip .eyebrow { color: rgba(196, 165, 116, 0.75); }
.ops-sub { margin: 0; color: var(--ops-muted); line-height: 1.5; }
.ops-disclaimer { margin: 8px 0 0; font-size: 0.78rem; }
.ops-disclaimer-inline { font-size: 0.72rem; color: var(--ops-muted); }

.ops-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.ops-kpi {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--ops-line);
  background: var(--ops-surface);
}

.ops-kpi span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ops-muted);
}

.ops-kpi strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-style: italic;
  line-height: 1.1;
}

.ops-kpi strong span { font-size: 0.75rem; font-family: var(--font-ui); font-style: normal; }
.ops-kpi small { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--ops-muted); }
.ops-kpi[data-state="ok"] strong { color: var(--ops-green); }
.ops-kpi[data-state="warn"] strong { color: #e8c060; }
.ops-kpi[data-state="error"] strong { color: #e87878; }

.ops-viz-row,
.ops-charts-row {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.ops-viz-row { grid-template-columns: 1fr 1fr; }
.ops-charts-row { grid-template-columns: 1.2fr 1fr 0.8fr; }

.ops-panel {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--ops-line);
  background: var(--ops-surface);
  min-width: 0;
}

.ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ops-panel-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ops-champagne);
}

.ops-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
}

.ops-live-dot.on {
  background: var(--ops-green);
  box-shadow: 0 0 8px rgba(111, 207, 138, 0.6);
  animation: pulse 1.6s infinite;
}

.ops-pt-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: rgba(196, 165, 116, 0.8);
}

.ops-matrix-wrap {
  position: relative;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0c0a;
  border: 1px solid rgba(111, 207, 138, 0.12);
}

.ops-matrix-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ops-matrix-terminal {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.68rem;
  line-height: 1.45;
  color: rgba(111, 207, 138, 0.88);
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.ops-matrix-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.ops-matrix-line.warn { color: #e8c060; }
.ops-matrix-line.alert { color: #e87878; }
.ops-matrix-line.champagne { color: var(--ops-champagne); }

.ops-sonar-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.ops-sonar-svg {
  width: 100%;
  max-width: 240px;
  height: auto;
}

.ops-sonar-rings .sonar-ring {
  fill: none;
  stroke: rgba(196, 165, 116, 0.18);
  stroke-width: 1;
}

.ops-pt-outline {
  fill: rgba(196, 165, 116, 0.06);
  stroke: rgba(196, 165, 116, 0.35);
  stroke-width: 1.2;
}

.ops-sonar-beam {
  transform-origin: 100px 100px;
  animation: radar-spin 4s linear infinite;
}

.ops-sonar-blip {
  animation: radar-blip 1.6s ease-in-out infinite;
}

.ops-sonar-blip.spam { fill: #c4a574; }
.ops-sonar-blip.flood { fill: #7eb8d4; }
.ops-sonar-blip.phish { fill: #e8a060; }
.ops-sonar-blip.abuse { fill: #e87878; }
.ops-sonar-blip.auth { fill: #b888e8; }
.ops-sonar-blip.other { fill: #888; }

.ops-sonar-center-label {
  fill: rgba(196, 165, 116, 0.65);
  font-size: 8px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.ops-spark-wrap {
  height: 80px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.ops-spark-wrap svg { width: 100%; height: 100%; display: block; }
.ops-spark-bar { fill: rgba(111, 207, 138, 0.55); }
.ops-spark-bar-skipped { fill: rgba(232, 120, 120, 0.45); }

.ops-threat-bars {
  display: grid;
  gap: 8px;
  min-height: 80px;
}

.ops-threat-bar-row {
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  gap: 8px;
  align-items: center;
  font-size: 0.72rem;
}

.ops-threat-bar-row .bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ops-threat-bar-row .bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ops-threat-bar-row.spam .bar-fill { background: #c4a574; }
.ops-threat-bar-row.flood .bar-fill { background: #7eb8d4; }
.ops-threat-bar-row.phish .bar-fill { background: #e8a060; }
.ops-threat-bar-row.abuse .bar-fill { background: #e87878; }
.ops-threat-bar-row.auth .bar-fill { background: #b888e8; }

.ops-speed-meter {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 80px;
}

.ops-meter-svg { width: 120px; height: auto; }
.ops-meter-arc {
  fill: none;
  stroke: rgba(196, 165, 116, 0.2);
  stroke-width: 6;
  stroke-linecap: round;
}

.ops-meter-needle {
  stroke: var(--ops-green);
  stroke-width: 2;
  stroke-linecap: round;
  transform-origin: 60px 60px;
  transition: transform 0.5s ease;
}

.ops-meter-hub { fill: var(--ops-champagne); }

.ops-meter-readout {
  text-align: center;
}

.ops-meter-readout strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  color: var(--ops-green);
}

.ops-meter-readout small { color: var(--ops-muted); font-size: 0.72rem; }

.ops-threat-table-wrap {
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
}

.ops-threat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.ops-threat-table th,
.ops-threat-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ops-threat-table th {
  color: var(--ops-muted);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  background: var(--ops-surface);
}

.ops-threat-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ops-threat-badge.spam { background: rgba(196,165,116,0.2); color: #c4a574; }
.ops-threat-badge.flood { background: rgba(126,184,212,0.2); color: #7eb8d4; }
.ops-threat-badge.phish { background: rgba(232,160,96,0.2); color: #e8a060; }
.ops-threat-badge.abuse { background: rgba(232,120,120,0.2); color: #e87878; }
.ops-threat-badge.auth { background: rgba(184,136,232,0.2); color: #b888e8; }
.ops-threat-badge.other { background: rgba(168,168,168,0.15); color: #aaa; }

@media (max-width: 1100px) {
  .ops-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .ops-viz-row,
  .ops-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .ops-kpi-strip { grid-template-columns: 1fr 1fr; }
}
