/* =========================================================
   AGENT COUNCIL — INTERACTIVE ROUNDTABLE & NEURAL ROOM
   ========================================================= */
.council-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  align-items: start;
}

.council-stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.council-room {
  position: relative;
  width: 100%;
  height: 590px;
  overflow: hidden;
  background:
    radial-gradient(420px 300px at 50% 50%, rgba(99, 102, 241, 0.13), transparent 72%),
    radial-gradient(240px 200px at 18% 22%, rgba(6, 182, 212, 0.08), transparent 70%),
    radial-gradient(260px 200px at 84% 78%, rgba(16, 185, 129, 0.07), transparent 70%),
    var(--bg-canvas);
}

[data-theme="light"] .council-room {
  background:
    radial-gradient(420px 300px at 50% 50%, rgba(79, 70, 229, 0.09), transparent 72%),
    radial-gradient(260px 200px at 20% 25%, rgba(6, 182, 212, 0.06), transparent 70%),
    #f3f5fb;
}

/* Subtle floor grid inside the room */
.council-room::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.65) 18%, transparent 78%);
  pointer-events: none;
}

/* Illuminated Roundtable Ring */
.council-table-ring {
  position: absolute;
  left: 50%;
  top: 41%;
  width: 330px;
  height: 220px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid var(--border-default);
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.09) 0%, rgba(15, 18, 25, 0.45) 75%);
  box-shadow:
    inset 0 0 38px rgba(99, 102, 241, 0.11),
    0 0 50px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

[data-theme="light"] .council-table-ring {
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.06) 0%, rgba(255, 255, 255, 0.7) 75%);
  box-shadow: inset 0 0 28px rgba(79, 70, 229, 0.07), 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* SVG Neural Wires Overlay */
.council-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.council-wire {
  stroke: var(--border-default);
  stroke-width: 1.4;
  fill: none;
  opacity: 0.55;
  transition: stroke 0.25s ease, opacity 0.25s ease;
}

.council-wire.active {
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 1;
  stroke-dasharray: 7 5;
  animation: wireFlow 0.85s linear infinite;
}
.council-wire.active.veto { stroke: var(--red); }
.council-wire.active.exec { stroke: var(--green); }
.council-wire.active.lesson { stroke: #c084fc; }

@keyframes wireFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.signal-packet {
  filter: drop-shadow(0 0 6px currentColor);
}

/* Center Holographic Decision Core */
.council-core {
  position: absolute;
  left: 50%;
  top: 41%;
  transform: translate(-50%, -50%);
  width: 186px;
  padding: 14px 14px;
  border-radius: 18px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42), 0 0 0 5px var(--accent-soft);
  text-align: center;
  z-index: 6;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.council-core:hover { transform: translate(-50%, -50%) scale(1.03); }
.council-core.verdict-executed,
.council-core.verdict-approved {
  border-color: var(--green);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.22), 0 0 0 5px var(--green-soft);
}
.council-core.verdict-vetoed,
.council-core.verdict-rejected {
  border-color: var(--red);
  box-shadow: 0 14px 40px rgba(244, 63, 94, 0.22), 0 0 0 5px var(--red-soft);
}
.council-core.speaking {
  transform: translate(-50%, -50%) scale(1.06);
}

.core-kicker {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.core-sym {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: -0.02em;
}

.core-score {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  margin: 4px 0 6px;
}

.core-meta {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Seated Agent Nodes Around the Council Table */
.council-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 146px;
  padding: 10px 11px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-default);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.council-seat:hover {
  transform: translate(-50%, -52%);
  border-color: var(--accent);
}

.council-seat.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md);
}

.council-seat.verdict-approve { border-left: 3px solid var(--green); }
.council-seat.verdict-veto,
.council-seat.verdict-reject { border-left: 3px solid var(--red); }
.council-seat.verdict-warn { border-left: 3px solid var(--amber); }

.council-seat.speaking {
  transform: translate(-50%, -54%) scale(1.06);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 12px 28px rgba(99, 102, 241, 0.3);
  z-index: 9;
}
.council-seat.speaking.is-veto {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft), 0 12px 28px rgba(244, 63, 94, 0.3);
}
.council-seat.listening {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.22);
}

.seat-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat-top .agent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 10px;
}

.seat-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.seat-role {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.seat-foot {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
}

.seat-mini-bar {
  height: 3.5px;
  border-radius: 99px;
  background: var(--bg-subtle);
  margin-top: 6px;
  overflow: hidden;
}
.seat-mini-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}
.seat-mini-fill.high { background: var(--green); }
.seat-mini-fill.mid { background: var(--amber); }
.seat-mini-fill.low { background: var(--red); }

/* Floating Live Speech Banner Inside the Room */
.council-speech-dock {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 12;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 11px 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  backdrop-filter: blur(10px);
  animation: msgSlide 0.2s ease;
}

.speech-route {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.speech-quote {
  font-size: 12.8px;
  color: var(--text-primary);
  line-height: 1.42;
}

/* Playback Step Scrubber Strip */
.council-steps-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.step-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.step-pill {
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.step-pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
.step-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.step-pill.done {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--text-primary);
}

/* Right Brain Inspector Card */
.brain-inspector {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.brain-hero {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brain-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.brain-section:last-child { border-bottom: none; }

.brain-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

.brain-metric-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 10px;
}
.brain-metric-key {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: capitalize;
}
.brain-metric-val {
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .council-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .council-room {
    height: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .council-table-ring,
  .council-svg { display: none; }
  .council-core {
    position: static;
    transform: none !important;
    grid-column: 1 / -1;
    width: 100%;
    order: -1;
  }
  .council-seat {
    position: static;
    transform: none !important;
    width: 100%;
  }
  .council-speech-dock {
    position: static;
    grid-column: 1 / -1;
  }
}

