/* ═══════════ OVERRIDE APP VIEWPORT LOCK ═══════════
   style.css locks html/body to 100vh overflow:hidden
   for the engine dashboard. The landing page needs
   normal scrolling, so we override it here. */
html {
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.lp-body {
  height: auto !important;
  min-height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* ============================================================
   AI POWER BOARD — Premium Command Bridge
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-0: #04060d;
  --bg-1: #080d1a;
  --bg-2: #0e1528;
  --bg-3: #161f3a;
  --bg-4: #1e2950;

  --line: #1b2545;
  --line-2: #2a3866;
  --line-3: #3b4d85;

  --text: #f0f4fc;
  --text-2: #aab6d4;
  --text-3: #6d7a9e;

  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --gold: #f5c542;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;

  --analyst: #06b6d4;
  --engineer: #10b981;
  --developer: #f59e0b;
  --qa: #8b5cf6;
  --astra: #f5c542;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);

  --fs-xs: clamp(12px, 0.7vw + 10px, 13px);
  --fs-sm: clamp(13px, 0.8vw + 11px, 14px);
  --fs-md: clamp(14px, 0.9vw + 12px, 16px);
  --fs-lg: clamp(16px, 1.2vw + 13px, 19px);
  --fs-xl: clamp(19px, 1.6vw + 14px, 24px);
  --fs-2xl: clamp(24px, 2.4vw + 16px, 34px);
}

html,
body {
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse 90% 60% at 15% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(ellipse 80% 50% at 95% 110%, rgba(6, 182, 212, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(245, 197, 66, 0.04), transparent 70%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-0));
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(27, 37, 69, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 37, 69, 0.22) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ═══════════ TOP BAR ═══════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 26, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.4),
    0 0 24px rgba(139, 92, 246, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: brandPulse 4s ease-in-out infinite;
}

@keyframes brandPulse {

  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4), 0 0 20px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }

  50% {
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.6), 0 0 32px rgba(139, 92, 246, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
}

.brand-name {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 5px;
  background: linear-gradient(90deg, #fff 0%, #c4b5fd 60%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub {
  color: var(--text-3);
  font-size: var(--fs-xs);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ═══════════ TOPBAR REDESIGN ═══════════ */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 21, 40, 0.6);
  font-size: 15px;
  color: var(--text-2);
  letter-spacing: 1px;
  font-weight: 600;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 21px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(30, 41, 80, 0.5);
  color: var(--text);
  font-family: inherit;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.topbar-link:hover {
  color: #fff;
  border-color: var(--violet);
  background: rgba(139, 92, 246, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}

.topbar-link-icon {
  font-size: 19px;
}

.topbar-link-label {
  display: inline-block;
}

.topbar-link-danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.topbar-link-danger:hover {
  color: #fff;
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

@media (max-width: 900px) {
  .topbar-link-label {
    display: none;
  }

  .topbar-link {
    padding: 10px 12px;
  }

  .topbar-status {
    padding: 8px 10px;
  }

  .topbar-status #statusText {
    display: none;
  }
}

/* ═══════════ ACCOUNT MODAL ═══════════ */
.account-modal {
  max-width: 560px;
}

.account-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 26, 0.5);
  overflow: hidden;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child {
  border-bottom: none;
}

.account-label {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 800;
}

.account-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

.account-usage {
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.account-usage-head {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--violet);
  font-weight: 800;
  margin-bottom: 12px;
}

.account-usage-unlimited {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  padding: 16px 0;
  text-shadow: 0 0 20px rgba(245, 197, 66, 0.5);
}

.account-usage-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-usage-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(8, 13, 26, 0.9);
  border: 1px solid var(--line-2);
  overflow: hidden;
}

.account-usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.6);
  transition: width .4s ease;
}

.account-usage-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
}

.account-usage-numbers b {
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
}

/* Max rows row inside account modal */
.account-usage-divider {
  height: 1px;
  background: rgba(139, 92, 246, 0.25);
  margin: 16px 0 12px;
}

.account-usage-rows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-usage-rows-label {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 800;
}

.account-usage-rows-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: -0.01em;
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.account-usage-warn {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-size: 12.5px;
  line-height: 1.5;
}

.account-usage-warn a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

.account-usage-warn a:hover {
  text-decoration: underline;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 8px currentColor;
  transition: background .3s, box-shadow .3s;
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: orbPulse 1.6s ease-in-out infinite;
}

.status-dot.busy {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
  animation: orbPulse 0.9s ease-in-out infinite;
}

@keyframes orbPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.55;
  }
}

/* ═══════════ PROCESSING INDICATOR ═══════════ */
.processing-pill {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 29, 58, 0.95), rgba(12, 18, 36, 0.95));
  border: 1px solid rgba(139, 92, 246, 0.55);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.15),
    0 10px 40px rgba(139, 92, 246, 0.35),
    0 0 60px rgba(6, 182, 212, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
  pointer-events: none;
  animation: pillEnter .32s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes pillEnter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.processing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: processingBlink 1s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes processingBlink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.25;
    transform: scale(0.8);
  }
}

.processing-label {
  background: linear-gradient(90deg, #fff 0%, var(--cyan) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.6px;
  transition: opacity .2s ease;
}

.processing-ellipsis {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.processing-ellipsis i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--violet);
  animation: dotBounce 1.2s infinite ease-in-out;
  box-shadow: 0 0 6px var(--violet);
}

.processing-ellipsis i:nth-child(2) {
  animation-delay: .15s;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.processing-ellipsis i:nth-child(3) {
  animation-delay: .3s;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .processing-pill {
    top: auto;
    bottom: 16px;
    left: 16px;
    right: 16px;
    transform: none;
    justify-content: center;
    animation: none;
  }
}

/* ═══════════ TICKER ═══════════ */
.ticker {
  position: relative;
  height: 38px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg,
      rgba(139, 92, 246, 0.08),
      rgba(6, 182, 212, 0.06),
      rgba(245, 197, 66, 0.06));
  flex-shrink: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.ticker::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0,
      rgba(139, 92, 246, 0.15) 50%,
      transparent 100%);
  mix-blend-mode: screen;
  animation: tickerSheen 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tickerSheen {

  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 0.6;
  }
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  white-space: nowrap;
  padding-left: 24px;
  height: 100%;
  font-size: var(--fs-sm);
  color: var(--text-2);
  letter-spacing: 1px;
  animation: tickerScroll 60s linear infinite;
  will-change: transform;
}

.ticker-track span {
  display: inline-flex;
  align-items: center;
}

.ticker-track b {
  color: var(--text);
  font-weight: 700;
  margin: 0 4px;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.35);
}

.ticker-track span:nth-child(3n) b {
  color: var(--cyan);
}

.ticker-track span:nth-child(3n+1) b {
  color: var(--gold);
}

.ticker-track span:nth-child(3n+2) b {
  color: var(--violet);
}

@keyframes tickerScroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ═══════════ LAYOUT ═══════════ */
.layout {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  min-height: 0;
  overflow: hidden;
}

/* ═══════════ LEFT PANEL ═══════════ */
.panel-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.85), rgba(12, 18, 36, 0.85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.panel-left::-webkit-scrollbar {
  width: 6px;
}

.panel-left::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}

.panel-left::before,
.panel-left::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--violet);
  opacity: 0.55;
  pointer-events: none;
}

.panel-left::before {
  top: 8px;
  left: 8px;
  border-top: 2px solid;
  border-left: 2px solid;
  border-top-left-radius: 6px;
}

.panel-left::after {
  bottom: 8px;
  right: 8px;
  border-bottom: 2px solid;
  border-right: 2px solid;
  border-bottom-right-radius: 6px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ═══════════ FILE LIMITS GRID ═══════════ */
.file-limits-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-limit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(8, 13, 26, 0.6);
  border: 1px solid var(--line);
}

.file-limit-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.file-limit-body {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex: 1;
  gap: 10px;
}

.file-limit-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.file-limit-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Numbered section headers ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.section-num {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #fff;
  text-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
  font-family: 'Inter', sans-serif;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.section-label {
  font-size: var(--fs-sm);
  letter-spacing: 2.4px;
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
}

.spacer {
  flex: 1 1 0;
  min-height: 6px;
}

/* File drop */
.file-drop {
  border: 1.5px dashed var(--line-2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 15, 30, 0.6), rgba(8, 13, 26, 0.6));
  cursor: pointer;
  position: relative;
  min-height: 110px;
  overflow: hidden;
  transition: border-color .25s, background .25s, transform .15s;
}

.file-drop:hover {
  border-color: var(--violet);
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.75), rgba(12, 18, 36, 0.75));
  transform: translateY(-1px);
}

.file-drop.dragging {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.06);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.35) inset;
}

.file-drop.dragging::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scanLine 1.2s linear infinite;
  box-shadow: 0 0 12px var(--cyan);
}

@keyframes scanLine {
  0% {
    top: 0;
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

.file-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  gap: 6px;
  text-align: center;
}

.drop-icon {
  font-size: 26px;
  opacity: 0.9;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.drop-title {
  font-weight: 700;
  font-size: var(--fs-sm);
}

.drop-sub {
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.3px;
}

.file-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(139, 92, 246, 0.08));
  border-radius: 14px;
}

.file-info-name {
  font-weight: 700;
  font-size: var(--fs-md);
}

.file-info-meta {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.btn-clear {
  align-self: flex-start;
  margin-top: 8px;
  background: rgba(30, 41, 80, 0.8);
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: var(--fs-xs);
  cursor: pointer;
  font-weight: 600;
  transition: color .2s, border-color .2s;
}

.btn-clear:hover {
  color: var(--red);
  border-color: var(--red);
}

/* Task input */
.task-wrap {
  position: relative;
}

#taskInput,
#feedbackInput {
  width: 100%;
  min-height: 200px;
  max-height: 200px;
  resize: none;
  background: rgba(8, 13, 26, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 14px 52px 14px 14px;
  font-family: inherit;
  font-size: var(--fs-md);
  line-height: 1.55;
  transition: border-color .2s, box-shadow .2s;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

#feedbackInput {
  min-height: 140px;
  max-height: 200px;
  padding-right: 14px;
}

#taskInput::-webkit-scrollbar,
#feedbackInput::-webkit-scrollbar {
  width: 6px;
}

#taskInput::-webkit-scrollbar-thumb,
#feedbackInput::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}

#taskInput::placeholder,
#feedbackInput::placeholder {
  color: var(--text-3);
}

#taskInput:focus,
#feedbackInput:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.mic-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(30, 41, 80, 0.95);
  color: var(--text-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.6px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mic-btn .mic-icon {
  font-size: 15px;
  line-height: 1;
}

.mic-btn:hover {
  background: #2b3866;
  color: var(--text);
  border-color: var(--violet);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.mic-btn.recording {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  color: #fff;
  border-color: #ef4444;
  animation: recPulse 1s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes recPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  }

  50% {
    box-shadow: 0 0 32px rgba(239, 68, 68, 0.9);
  }
}

.mic-btn.processing {
  background: rgba(59, 47, 19, 0.95);
  color: var(--amber);
  border-color: var(--amber);
}

/* ═══════════ MODE TOGGLE ═══════════ */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(8, 13, 26, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: left;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.mode-btn:hover {
  color: var(--text);
  background: rgba(30, 41, 80, 0.5);
}

.mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.25));
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35), inset 0 0 20px rgba(139, 92, 246, 0.08);
}

.mode-icon {
  font-size: 18px;
}

.mode-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.mode-title {
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.5px;
}

.mode-sub {
  font-size: var(--fs-xs);
  opacity: 0.75;
  margin-top: 2px;
}

/* Stats + convene */
.stats-line {
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-align: center;
  letter-spacing: 1.5px;
}

.btn-convene {
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .25s;
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.45);
  font-family: inherit;
}

.btn-convene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s;
}

.btn-convene:hover:not(:disabled)::before {
  transform: translateX(100%);
}

.btn-convene:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.65);
}

.btn-convene:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-convene-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}


/* ═══════════ TOP-UP TOPBAR BUTTON ═══════════ */
.topbar-link-topup {
  color: var(--gold) !important;
  border-color: rgba(245, 197, 66, 0.5) !important;
  background: rgba(245, 197, 66, 0.08) !important;
}

.topbar-link-topup:hover {
  color: #fff !important;
  background: rgba(245, 197, 66, 0.2) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 8px 24px rgba(245, 197, 66, 0.4) !important;
}

/* ═══════════ TOP-UP MODAL ═══════════ */
.topup-modal {
  max-width: 820px;
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .topup-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 460px) {
  .topup-grid {
    grid-template-columns: 1fr;
  }
}

.topup-pack {
  position: relative;
  padding: 20px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.7), rgba(12, 18, 36, 0.9));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.topup-pack:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.2);
}

.topup-pack.selected {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(38, 24, 68, 0.8), rgba(12, 8, 32, 0.95));
  box-shadow: 0 0 40px rgba(245, 197, 66, 0.3);
}

.topup-featured {
  border-color: rgba(139, 92, 246, 0.5);
}

.topup-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5);
}

.topup-pack-name {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 800;
  margin-bottom: 8px;
}

.topup-pack-price {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topup-pack-runs {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
  margin: 8px 0 4px;
  text-shadow: 0 0 12px rgba(245, 197, 66, 0.4);
}

.topup-pack-per {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.3px;
}

.topup-pack-per b {
  color: var(--gold);
}

.topup-crypto-note {
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 197, 66, 0.4);
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.55;
  text-align: center;
  margin-bottom: 16px;
}

.topup-crypto-note b {
  color: var(--gold);
}

.topup-contact {
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.topup-contact-title {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: 8px;
}

.topup-contact-body {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
}

/* Account modal Top-up button */
.btn-topup {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #1a1205;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 197, 66, 0.45);
  transition: all .2s;
  margin-right: auto;
}

.btn-topup:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(245, 197, 66, 0.7);
}


/* ═══════════ RIGHT PANEL ═══════════ */
.panel-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.boardroom {
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.6), rgba(8, 13, 26, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex: 0 0 auto;
  /* shrink to content */
  min-height: 0;
  overflow: hidden;
}

.boardroom-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.boardroom-title {
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 5px;
  background: linear-gradient(90deg, #fff, var(--violet) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.boardroom-sub {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* ── Agents grid ── */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-height: 0;
  flex-shrink: 0;
}

.agent-card {
  position: relative;
  background: linear-gradient(180deg, rgba(22, 31, 58, 0.9), rgba(10, 16, 32, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 320px;
  min-height: 320px;
  max-height: 320px;
  overflow: hidden;
  transition: border-color .35s, box-shadow .35s, transform .25s;
}

.agent-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--agent-color, #4FC3F7) 70%, transparent),
      transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}

.agent-card[data-agent="analyst"] {
  --agent-color: var(--analyst);
}

.agent-card[data-agent="engineer"] {
  --agent-color: var(--engineer);
}

.agent-card[data-agent="developer"] {
  --agent-color: var(--developer);
}

.agent-card[data-agent="qa"] {
  --agent-color: var(--qa);
}

.agent-card.active::before {
  opacity: 1;
}

.agent-card.active {
  border-color: color-mix(in srgb, var(--agent-color) 60%, transparent);
  box-shadow:
    0 0 32px color-mix(in srgb, var(--agent-color) 35%, transparent),
    inset 0 0 32px color-mix(in srgb, var(--agent-color) 8%, transparent);
  transform: translateY(-2px);
}

.agent-card.done {
  border-color: color-mix(in srgb, var(--agent-color) 45%, var(--line));
  box-shadow: 0 0 20px color-mix(in srgb, var(--agent-color) 18%, transparent);
}

.agent-card[data-agent="analyst"].active::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: conic-gradient(from 0deg,
      transparent 0deg,
      color-mix(in srgb, var(--cyan) 30%, transparent) 30deg,
      transparent 70deg);
  animation: radarSpin 3.6s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.55;
}

@keyframes radarSpin {
  to {
    transform: rotate(360deg);
  }
}

.agent-card[data-agent="engineer"].active {
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--green) 55%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  animation: dotFlow 2s linear infinite;
}

@keyframes dotFlow {
  to {
    background-position: 22px 22px;
  }
}

.agent-card[data-agent="developer"].active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  box-shadow: 0 0 14px var(--amber);
  animation: codeScan 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes codeScan {
  0% {
    top: 0%;
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

.agent-card[data-agent="qa"].active::after {
  content: '01 10 11 00 01 10 11 00 01 10 11 00 01 10';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: color-mix(in srgb, var(--violet) 80%, transparent);
  text-shadow: 0 0 6px var(--violet);
  white-space: nowrap;
  animation: matrixFall 3.2s linear infinite;
  pointer-events: none;
  opacity: 0.55;
}

@keyframes matrixFall {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  15% {
    opacity: 0.65;
  }

  100% {
    transform: translateY(360px);
    opacity: 0;
  }
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--agent-color) 22%, #0a1020);
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid color-mix(in srgb, var(--agent-color) 45%, transparent);
  transition: all .3s;
  flex-shrink: 0;
}

.agent-card.active .agent-avatar {
  background: color-mix(in srgb, var(--agent-color) 35%, #0a1020);
  box-shadow: 0 0 20px color-mix(in srgb, var(--agent-color) 55%, transparent);
  animation: avatarPulse 1.4s ease-in-out infinite;
}

@keyframes avatarPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

.agent-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agent-name {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 2px;
  color: color-mix(in srgb, var(--agent-color) 90%, #fff);
}

.agent-role {
  font-size: var(--fs-xs);
  color: var(--text-3);
  letter-spacing: 0.4px;
}

/* ── Model badge per agent ── */
.agent-model {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  width: fit-content;
  color: color-mix(in srgb, var(--agent-color) 95%, #fff);
  background: color-mix(in srgb, var(--agent-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--agent-color) 40%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--agent-color) 20%, transparent);
}

.agent-model::before {
  content: '◆';
  font-size: 8px;
  color: var(--agent-color);
  text-shadow: 0 0 8px var(--agent-color);
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  padding: 6px 10px;
  background: rgba(8, 13, 26, 0.6);
  border-radius: 999px;
  border: 1px solid var(--line);
  width: fit-content;
}

.agent-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all .3s;
}

.agent-card.active .agent-status .dot {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: orbPulse 0.9s ease-in-out infinite;
}

.agent-card.done .agent-status .dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.agent-body {
  flex: 1 1 0;
  min-height: 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-2);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.agent-body::-webkit-scrollbar {
  width: 6px;
}

.agent-body::-webkit-scrollbar-track {
  background: transparent;
}

.agent-body::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}

.agent-body::-webkit-scrollbar-thumb:hover {
  background: var(--line-3);
}

/* ── Astra6 ── */
.astra-card {
  position: relative;
  background: linear-gradient(135deg, rgba(30, 18, 54, 0.95), rgba(12, 8, 32, 0.95));
  border: 1px solid #3a2552;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  flex: 0 0 auto;
  /* shrink to content, don't grow */
  min-height: 0;
  /* allow shrink if space is tight */
  transition: border-color .35s, box-shadow .35s, transform .35s;
}

.astra-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 197, 66, 0.22), transparent 60%);
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
}

.astra-card.active {
  border-color: var(--gold);
  box-shadow:
    0 0 60px rgba(245, 197, 66, 0.35),
    inset 0 0 60px rgba(245, 197, 66, 0.05);
  transform: translateY(-2px);
}

.astra-card.active .astra-glow {
  opacity: 1;
  animation: haloBreathe 2.4s ease-in-out infinite;
}

@keyframes haloBreathe {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.55;
  }

  50% {
    transform: translateX(-50%) scale(1.15);
    opacity: 0.9;
  }
}

.astra-card.done {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(38, 24, 68, 0.98), rgba(16, 10, 40, 0.98));
  box-shadow: 0 0 40px rgba(245, 197, 66, 0.28);
}

.astra-card.done .astra-glow {
  opacity: 0.5;
}

.astra-card.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
      transparent 30%,
      rgba(245, 197, 66, 0.14) 50%,
      transparent 70%);
  animation: shimmer 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.astra-head {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.astra-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #b8860b);
  display: grid;
  place-items: center;
  font-size: 26px;
  box-shadow:
    0 0 0 1px rgba(245, 197, 66, 0.5),
    0 0 24px rgba(245, 197, 66, 0.5);
  transition: box-shadow .4s;
}

.astra-card.active .astra-avatar {
  box-shadow:
    0 0 0 1px rgba(245, 197, 66, 0.8),
    0 0 40px rgba(245, 197, 66, 0.9);
  animation: crownPulse 1.6s ease-in-out infinite;
}

@keyframes crownPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.astra-name {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(90deg, var(--gold), #fff 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.astra-role {
  font-size: var(--fs-xs);
  color: var(--text-3);
  letter-spacing: 2px;
  margin-top: 3px;
}

.astra-model {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  width: fit-content;
  color: var(--gold);
  background: rgba(245, 197, 66, 0.10);
  border: 1px solid rgba(245, 197, 66, 0.5);
  box-shadow: 0 0 16px rgba(245, 197, 66, 0.35);
  text-shadow: 0 0 8px rgba(245, 197, 66, 0.5);
}

.astra-model::before {
  content: '👑';
  font-size: 11px;
}

.astra-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  letter-spacing: 1.4px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 66, 0.35);
  background: rgba(30, 18, 54, 0.7);
}

.astra-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: orbPulse 1.5s ease-in-out infinite;
}

/* ── ASTRA thinking phrases bar ── */
.astra-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg,
      rgba(245, 197, 66, 0.12),
      rgba(245, 197, 66, 0.04));
  border: 1px solid rgba(245, 197, 66, 0.28);
  color: var(--gold);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: var(--fs-sm);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  flex-shrink: 0;
}

.astra-thinking::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
      transparent 30%,
      rgba(245, 197, 66, 0.25) 50%,
      transparent 70%);
  transform: translateX(-100%);
  animation: thinkingShimmer 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes thinkingShimmer {
  to {
    transform: translateX(100%);
  }
}

.thinking-caret {
  font-weight: 700;
  animation: caretBlink 0.9s steps(2) infinite;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

.thinking-text {
  font-weight: 500;
  text-shadow: 0 0 10px rgba(245, 197, 66, 0.5);
  transition: opacity .18s ease;
}

.astra-body {
  flex: 0 1 auto;
  /* don't grow, but can shrink */
  min-height: 0;
  max-height: 160px;
  /* cap so long AI text doesn't balloon the card */
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  position: relative;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: #4a3560 transparent;
}

.astra-body::-webkit-scrollbar {
  width: 6px;
}

.astra-body::-webkit-scrollbar-thumb {
  background: #4a3560;
  border-radius: 3px;
}

/* ═══════════ ASTRA6 ACTION BAR ═══════════ */
.astra-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  animation: astraActionsIn .4s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes astraActionsIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.astra-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .25s, border-color .2s, background .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.astra-action-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.astra-action-label {
  display: inline-block;
}

/* Download — violet/cyan gradient (primary action) */
.astra-action-download {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.astra-action-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.6);
}

/* Needs changes — amber warning */
.astra-action-changes {
  background: linear-gradient(135deg, #92400e, var(--amber));
  color: #fff;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.astra-action-changes:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.55);
}

/* Start new task — bright emerald green (primary reset action) */
.astra-action-new {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

.astra-action-new:hover {
  background: linear-gradient(135deg, #10b981, #34d399);
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.7), 0 0 40px rgba(16, 185, 129, 0.35);
}

/* Save Recipe — indigo/violet, distinct from Download's violet/cyan */
.astra-action-recipe {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.astra-action-recipe:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.7);
}

/* Mobile: stack buttons vertically */
@media (max-width: 640px) {
  .astra-actions {
    grid-template-columns: 1fr;
  }

  .astra-action {
    justify-content: flex-start;
    padding: 14px 16px;
  }
}
/* ═══════════ CONSOLE ═══════════ */
.console-box {
  flex: 1 1 0;
  min-height: 200px;
  /* ← was 120px, bump it */
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #04060d, #02030a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs);
  letter-spacing: 3px;
  color: var(--text-3);
  font-weight: 700;
  background: rgba(8, 13, 26, 0.8);
  flex-shrink: 0;
}

.console-copy {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 600;
  font-family: inherit;
}

.console-copy:hover {
  color: var(--text);
  border-color: var(--violet);
}

.console-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 12px 18px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: #7ee787;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.console-body::-webkit-scrollbar {
  width: 6px;
}

.console-body::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}

.console-body .line-warn {
  color: var(--amber);
}

.console-body .line-err {
  color: var(--red);
}

.console-body .line-info {
  color: var(--cyan);
}

.console-body .line-gold {
  color: var(--gold);
  font-weight: 600;
}

/* ═══════════ MODALS ═══════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 4, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .22s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.98), rgba(8, 13, 26, 0.98));
  border: 1px solid var(--line-2);
  border-radius: 18px;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.8), 0 0 60px rgba(139, 92, 246, 0.15);
  animation: slideUp .32s cubic-bezier(.2, .9, .3, 1.15);
  overflow: hidden;
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-head {
  padding: 24px 28px 14px;
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.4px;
}

.modal-sub {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-top: 6px;
  line-height: 1.55;
}

.modal-body {
  padding: 10px 28px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(8, 13, 26, 0.6);
  flex-shrink: 0;
}

/* ── Review modal: no clipping, wrap buttons ── */
.review-modal {
  max-width: 720px;
}

.review-modal .modal-body {
  overflow: visible;
  padding-bottom: 28px;
}

.review-buttons {
  margin-bottom: 22px;
  display: flex;
  justify-content: center;
}

.review-download {
  padding: 16px 32px;
  font-size: var(--fs-md);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.review-ask {
  text-align: center;
  color: var(--text-2);
  font-size: var(--fs-sm);
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}

.review-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.review-options .btn-success,
.review-options .btn-warn {
  flex: 1 1 200px;
  min-height: 52px;
  padding: 14px 20px;
}

.feedback-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.feedback-actions .mic-btn {
  position: static;
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .15s, box-shadow .25s;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(30, 41, 80, 0.8);
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: var(--fs-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--violet);
}

.btn-success {
  background: linear-gradient(135deg, #047857, var(--green));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 26px;
  font-weight: 700;
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: transform .15s, box-shadow .25s;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  font-family: inherit;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.55);
}

.btn-warn {
  background: linear-gradient(135deg, #92400e, var(--amber));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 26px;
  font-weight: 700;
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: transform .15s, box-shadow .25s;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
  font-family: inherit;
}

.btn-warn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.55);
}

/* Ambiguity item */
.amb-item {
  background: rgba(10, 16, 32, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.amb-q {
  font-weight: 700;
  font-size: var(--fs-md);
  margin-bottom: 8px;
}

.amb-ctx {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-bottom: 14px;
  line-height: 1.55;
}

.amb-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(15, 21, 48, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: all .15s;
}

.amb-opt:hover {
  background: rgba(21, 28, 61, 0.95);
  border-color: var(--violet);
}

.amb-opt input {
  accent-color: var(--violet);
  width: 18px;
  height: 18px;
}

.amb-other {
  width: 100%;
  margin-top: 10px;
  background: rgba(8, 13, 26, 0.8);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ═══════════ LOGIN / OUT-OF-RUNS / HOME ═══════════ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(6, 182, 212, 0.12), transparent 60%),
    #04060d;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(20, 29, 58, 0.95), rgba(8, 13, 26, 0.95));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(139, 92, 246, 0.15);
}

.login-card-wide {
  max-width: 560px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  color: var(--text);
}

.login-sub {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.login-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 14px 0 6px;
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.login-input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

textarea.login-input {
  resize: vertical;
  min-height: 90px;
}

.login-btn {
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.4);
  transition: transform .15s, box-shadow .25s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(139, 92, 246, 0.6);
}

.login-btn-arrow {
  font-size: 16px;
}

.login-foot {
  margin-top: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}

.login-foot a {
  color: var(--cyan);
  text-decoration: none;
}

.login-foot a:hover {
  text-decoration: underline;
}

.login-flash {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}

.login-flash-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.login-flash-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.oor-badge {
  font-size: 44px;
  text-align: center;
  margin-bottom: 12px;
}

.oor-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0 24px;
}

.oor-stat {
  padding: 16px;
  background: rgba(8, 13, 26, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
}

.oor-stat-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.oor-stat-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}

.oor-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.oor-btn {
  padding: 14px 18px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: transform .15s, box-shadow .25s, background .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.oor-btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.4);
}

.oor-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(139, 92, 246, 0.6);
}

.oor-btn-secondary {
  background: rgba(30, 41, 80, 0.85);
  color: var(--text-2);
  border: 1px solid var(--line-2);
}

.oor-btn-secondary:hover {
  color: var(--text);
  border-color: var(--violet);
}

.oor-btn-whatsapp {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.oor-btn-whatsapp:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
}

.topbar-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(30, 41, 80, 0.4);
  transition: all .2s;
}

.topbar-link:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.08);
}



/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {

  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
    overflow: visible;
  }

  .panel-right {
    overflow: visible;
  }

  .agents-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .agent-card {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }

    .astra-card {
      min-height: 0;
      max-height: none;
    }
  
        .astra-body {
          max-height: 180px;
        }
    
        .console-box {
          min-height: 240px;
        }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
    min-height: 62px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .brand-name {
    font-size: var(--fs-md);
    letter-spacing: 3px;
  }

  .brand-sub {
    display: none;
  }

  .topbar-right {
    padding: 6px 10px;
    font-size: var(--fs-xs);
  }

  .ticker {
    height: 32px;
  }

  .ticker-track {
    font-size: var(--fs-xs);
    gap: 32px;
    animation-duration: 45s;
  }

  .layout {
    padding: 12px;
    gap: 14px;
  }

  .panel-left {
    padding: 18px;
  }

  .boardroom {
    padding: 16px;
  }

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

  .agent-card {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    padding: 14px;
  }

  .astra-card {
    padding: 16px;
  }

  .astra-avatar {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .astra-name {
    font-size: var(--fs-lg);
    letter-spacing: 4px;
  }

  #taskInput {
    min-height: 200px;
    max-height: 200px;
  }

  .console-body {
    font-size: var(--fs-xs);
  }

  .review-options {
    flex-direction: column;
  }

  .review-options>* {
    width: 100%;
  }

  .modal-body,
  .modal-head,
  .modal-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 640px) {
  #taskInput {
    min-height: 160px;
    max-height: 160px;
  }
}

/* ═══════════ ACCESSIBILITY ═══════════ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}