/* ==========================================================
   IMPACTOS — GLOBAL DESIGN SYSTEM
========================================================== */

/* ----------------------------------------------------------
   DESIGN TOKENS
---------------------------------------------------------- */
:root {
  /* Base Surfaces */
  --bg: #050814;
  --bg-elevated: #0b1020;
  --bg-soft: #090e1c;

  /* Template/Card Surfaces */
  --surface: #0b1020;
  --surface-hover: #1a2238;
  --border: #1c2536;

  /* Borders */
  --border-subtle: #1c2536;

  /* Accent System */
  --accent: #4f9cff;
  --accent-soft: rgba(79,156,255,0.12);
  --accent-strong: #86b9ff;
  --accent-stronger: #3b82f6;

  /* Text */
  --text-main: #e5e9f5;
  --text-muted: #8a94b8;

  /* Status */
  --danger: #f97373;

  /* Radius & Shadows */
  --radius-lg: 18px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(0,0,0,0.55);

  /* Font */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: radial-gradient(circle at top, #141a33 0, #050814 55%);
  height: 100%;
}

body {
  min-height: 100vh;
}

.site-shell {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================
   HEADER
========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(5, 8, 20, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

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

.brand-logo-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #7dd3fc, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  animation: glowPulse 3.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.65);
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
  }
  50% {
    box-shadow: 0 0 22px rgba(79, 70, 229, 0.9);
  }
  100% {
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
  }
}

.brand-inline-name {
  font-size: 17px;
  font-weight: 600;
}

.brand-inline-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-nav a:hover {
  color: #ffffff;
}

.credits-pill {
  background: #111727;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid #1e2636;
  color: #9db4d8;
  font-size: 12px;
}

/* ==========================================================
   HERO
========================================================== */
.hero {
  position: relative;
  height: 78vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  overflow: hidden;
}

.hero-bg .gradient {
  position: absolute;
  width: 200%;
  height: 200%;
  opacity: 0.35;
  background:
    radial-gradient(circle at 30% 20%, #4f46e5 0%, transparent 45%),
    radial-gradient(circle at 70% 80%, #3b82f6 0%, transparent 55%);
  animation: heroMove 18s ease-in-out infinite;
}

@keyframes heroMove {
  0%,
  100% {
    transform: translate(-20%, -20%);
  }
  50% {
    transform: translate(0, 0);
  }
}

#particle-canvas {
  position: absolute;
  inset: 0;
  opacity: 0.4;
}

#spotlight {
  position: absolute;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(79, 156, 255, 0.25), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-content {
  position: relative;
  max-width: 640px;
  z-index: 1;
}

.hero-title {
  font-size: 46px;
  font-weight: 700;
  background: linear-gradient(90deg, #4f46e5, #3b82f6);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: #a8b3cf;
  margin-top: 8px;
}

/* HERO HEALTH SNAPSHOT */
.hero-health {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}

.hero-health-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9ca3af;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.7);
}

.hero-health-label {
  font-weight: 600;
  color: #e5e9f5;
}

.hero-health-meta {
  color: var(--text-muted);
}

/* Sparkline container (canvas gets injected) */
.hero-sparkline {
  width: 120px;
  height: 16px;
  border-radius: 999px;
  background: #020617;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* CTA */
.hero-cta {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==========================================================
   BUTTONS
========================================================== */
.btn-primary {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.45);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-ghost {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 9px 18px;
  background: #0b1020;
  color: #9babd2;
  cursor: pointer;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

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

/* ==========================================================
   COMMAND CENTER
========================================================== */
.command-section {
  padding: 80px 0 60px;
}

.command-header h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.command-header p {
  font-size: 15px;
  color: var(--text-muted);
}

/* Layout shell */
.app-shell {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
}

/* Sidebar */
.sidebar {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0, #7dd3fc, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}

.nav-item.active {
  background: var(--accent-soft);
  color: #ffffff;
  border-color: rgba(79, 156, 255, 0.6);
}

/* Locked nav items */
.nav-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

.nav-item.locked:hover {
  opacity: 0.6;
}

.nav-item.locked .lock-icon {
  margin-left: 6px;
  font-size: 13px;
  opacity: 0.9;
}

/* Tooltip for locked items */
.nav-item.locked:hover::after {
  content: "Upgrade to access this feature";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.nav-item.locked:hover::before {
  content: "";
  position: absolute;
  left: calc(100% - 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #111827;
}

.feature-pill {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
}

.knowledge-open-btn {
  margin-top: 18px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: #050814;
  color: #cbd5f5;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.sidebar-footer {
  margin-top: 24px;
}

.user-block {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-initials {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main area */
.main {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 16px 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-soft);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.topbar-title {
  margin: 0;
  font-size: 17px;
}

.topbar-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a5b4fc;
}

.badge {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.badge-live {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.content {
  margin-top: 8px;
}

/* Panels */
.panel {
  display: none;
}

.panel-active {
  display: block;
}

/* Cards & grid */
.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: 1.2fr 1fr;
}

.card {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  border: 1px solid var(--border-subtle);
}

.output-card {
  min-height: 180px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.output-body {
  min-height: 140px;
  font-size: 13px;
  background: #020617;
  border-radius: var(--radius-md);
  padding: 10px;
  border: 1px solid #1e293b;
  white-space: pre-wrap;
}

/* ==========================================================
   BUSINESS HEALTH
========================================================== */
.bizhealth-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.biz-kpi-row {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.9fr 1.1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.biz-kpi-row input,
.biz-kpi-row select {
  font-size: 12px;
}

.biz-reserves-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bizhealth-thermo {
  display: flex;
  gap: 10px;
  align-items: center;
}

.thermo-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.thermo-segment {
  flex: 1;
  border-radius: 6px;
  background: #020617;
  border: 1px solid #1e293b;
  opacity: 0.5;
}

/* Active color levels */
.thermo-segment.active.level-0 { background: #ef4444; opacity: 1; }
.thermo-segment.active.level-1 { background: #f97316; opacity: 1; }
.thermo-segment.active.level-2 { background: #eab308; opacity: 1; }
.thermo-segment.active.level-3 { background: #22c55e; opacity: 1; }
.thermo-segment.active.level-4 { background: #16a34a; opacity: 1; }

.thermo-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* BizHealth history */
.bizhistory-wrapper {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bizhistory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bizhistory-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e5e9f5;
}

.bizhistory-count {
  font-size: 11px;
  color: var(--text-muted);
}

.bizhistory-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.bizhistory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.bizhistory-item {
  background: #020617;
  border-radius: 10px;
  padding: 8px 9px;
  border: 1px solid #1f2937;
}

.bizhistory-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.bizhistory-date {
  font-size: 11px;
  color: #9ca3af;
}

.bizhistory-level-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.bizhistory-bar-outer {
  margin: 4px 0;
  height: 6px;
  border-radius: 999px;
  background: #0b1120;
  overflow: hidden;
}

.bizhistory-bar-inner {
  height: 100%;
  width: 20%;
  border-radius: inherit;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.bizhistory-bar-inner.level-0 { background: #ef4444; }
.bizhistory-bar-inner.level-1 { background: #f97316; }
.bizhistory-bar-inner.level-2 { background: #eab308; }
.bizhistory-bar-inner.level-3 { background: #22c55e; }
.bizhistory-bar-inner.level-4 { background: #16a34a; }

.bizhistory-summary {
  font-size: 12px;
  color: #cbd5f5;
  margin-top: 2px;
}

/* =========================================
   BUSINESS HEALTH – EXPERT MODE STYLING
========================================= */
#section-bizhealth {
  --biz-accent: #22c55e;
  --biz-accent-soft: rgba(34, 197, 94, 0.14);
  --biz-thermo-low: #ef4444;
  --biz-thermo-mid: #eab308;
  --biz-thermo-high: #22c55e;
}

#section-bizhealth .output-title {
  color: var(--biz-accent);
}

/* Sector header & context */
.biz-sector-row {
  margin-bottom: 1.25rem;
}

.biz-sector-inputs {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.15fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

#bizhealth-sector-select {
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
}

#bizhealth-sector {
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.35);
  color: #e5e7eb;
}

.biz-sector-row .field-help {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* KPI rows */
.biz-kpi-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 0.7fr 0.7fr 0.9fr;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.biz-reserves-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

/* Thermometer + layout */
.bizhealth-layout {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bizhealth-thermo {
  padding: 0.6rem 0.75rem 0.55rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.85));
}

.thermo-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.thermo-segment {
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.85);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  transition: all 0.2s ease-out;
}

.thermo-segment.active {
  background: linear-gradient(
    135deg,
    var(--biz-thermo-low),
    var(--biz-thermo-mid),
    var(--biz-thermo-high)
  );
  box-shadow:
    0 0 12px rgba(34, 197, 94, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.thermo-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Smart / Raw blocks */
.bizhealth-smart-block,
.bizhealth-raw-block {
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88));
  max-height: 280px;
  overflow: auto;
}

.bizhealth-smart-body {
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.bizhealth-raw-block {
  font-size: 0.76rem;
  line-height: 1.4;
  background: #020617;
}

/* Placeholder text */
.smart-placeholder {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* History panel */
.bizhistory-wrapper {
  margin-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 0.75rem;
}

.bizhistory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.bizhistory-header h4 {
  font-size: 0.82rem;
  font-weight: 500;
}

.bizhistory-count {
  font-size: 0.75rem;
  color: #9ca3af;
}

.bizhistory-empty {
  font-size: 0.76rem;
  color: #6b7280;
}

.bizhistory-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.bizhistory-item {
  padding: 0.55rem 0.6rem;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(31, 41, 55, 0.95);
}

.bizhistory-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
}

.bizhistory-date {
  color: #9ca3af;
}

.bizhistory-level-tag {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
}

.bizhistory-bar-outer {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.bizhistory-bar-inner {
  height: 100%;
  border-radius: 999px;
  background: var(--biz-accent);
  transition: width 0.25s ease-out;
}

.bizhistory-summary {
  font-size: 0.74rem;
  color: #e5e7eb;
}

/* Sector tag on panel (optional visual) */
#section-bizhealth[data-sector] .panel-header h2::after {
  content: attr(data-sector);
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #9ca3af;
}

/* =======================
   BizHealth Layout
======================== */

.bizhealth-layout {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 1rem;
}

/* Thermometer block centered at top */

.bizhealth-thermo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.thermo-bar {
  width: 26px;
  height: 180px;
  border-radius: 999px;
  padding: 6px;
  background: radial-gradient(circle at 30% 0%, #ffffff22, #020617ff);
  border: 1px solid rgba(148, 163, 184, 0.33);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.thermo-segment {
  flex: 1;
  border-radius: 999px;
  margin: 2px 0;
  background: linear-gradient(to bottom, #020617ff, #020617ff);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
  opacity: 0.25;
  transition: opacity 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease, transform 0.25s ease;
}

.thermo-segment.active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* color bands from bottom to top (0–4) */
.thermo-segment:nth-child(1).active {
  background: linear-gradient(to bottom, #ef4444, #b91c1c);
}
.thermo-segment:nth-child(2).active {
  background: linear-gradient(to bottom, #f97316, #ea580c);
}
.thermo-segment:nth-child(3).active {
  background: linear-gradient(to bottom, #eab308, #ca8a04);
}
.thermo-segment:nth-child(4).active {
  background: linear-gradient(to bottom, #22c55e, #16a34a);
}
.thermo-segment:nth-child(5).active {
  background: linear-gradient(to bottom, #16a34a, #15803d);
}

.thermo-labels {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.7);
}

/* Smart output card under thermometer */

#bizhealth-smart-output {
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  background: radial-gradient(circle at top left, #1e293bff, #020617ff);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
  max-height: 360px;
  overflow-y: auto;
}

#bizhealth-smart-body {
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Raw JSON block */

#bizhealth-output {
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  background: radial-gradient(circle at top left, #020617ff, #020617ff);
  border: 1px solid rgba(30, 64, 175, 0.7);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.8);
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 340px;
  overflow: auto;
}

/* History panel */

.bizhistory-wrapper {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.bizhistory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.bizhistory-header h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.95);
}

.bizhistory-count {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
}

.bizhistory-empty {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.7);
}

.bizhistory-item {
  padding: 0.65rem 0;
  border-top: 1px dashed rgba(51, 65, 85, 0.7);
}

.bizhistory-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.bizhistory-date {
  color: rgba(148, 163, 184, 0.85);
}

.bizhistory-level-tag {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(30, 64, 175, 0.35);
  border: 1px solid rgba(96, 165, 250, 0.7);
}

.bizhistory-bar-outer {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.bizhistory-bar-inner {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* level colors */
.bizhistory-bar-inner.level-0 {
  background: linear-gradient(to right, #ef4444, #b91c1c);
}
.bizhistory-bar-inner.level-1 {
  background: linear-gradient(to right, #f97316, #ea580c);
}
.bizhistory-bar-inner.level-2 {
  background: linear-gradient(to right, #eab308, #ca8a04);
}
.bizhistory-bar-inner.level-3 {
  background: linear-gradient(to right, #22c55e, #16a34a);
}
.bizhistory-bar-inner.level-4 {
  background: linear-gradient(to right, #16a34a, #15803d);
}

.bizhistory-summary {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.88);
}

/* =======================
   Hero Business Health Bar
======================== */

#hero-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #020617ff, #020617ff);
  border: 1px solid rgba(51, 65, 85, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

#hero-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 0 0 rgba(148, 163, 184, 0.4);
}

.hero-health-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

#hero-health-label {
  font-size: 0.88rem;
  color: rgba(226, 232, 240, 0.96);
}

#hero-health-meta {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
}

#hero-sparkline {
  flex: 0 0 140px;
  height: 34px;
}
.hero-sparkline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===========================
   BizHealth v4 mini-metrics
=========================== */

.bizhealth-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.bizhealth-main-output {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bizhealth-mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bizhealth-mini-metrics .mini-card {
  flex: 1 1 140px;
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.mini-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}

.mini-bar-outer {
  width: 100%;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.9);
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.mini-bar-inner {
  height: 100%;
  width: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width 0.35s ease-out;
}

.mini-caption {
  font-size: 0.7rem;
  color: #e5e7eb;
  opacity: 0.9;
}

/* Ensure smart output card looks good under thermometer */
#bizhealth-smart-output {
  background: radial-gradient(circle at top, #020617, #020617);
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.9rem 1rem;
  max-height: 420px;
  overflow-y: auto;
}

#bizhealth-smart-body {
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ===========================
   BizHealth V3 Layout & Visuals
=========================== */

.biz-kpi-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.biz-reserves-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bizhealth-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

/* Thermometer */
.bizhealth-thermo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.thermo-bar {
  width: 26px;
  min-height: 150px;
  border-radius: 999px;
  padding: 4px;
  background: radial-gradient(circle at 0 0, rgba(255,255,255,0.18), transparent 45%),
              rgba(15,23,42,0.9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.thermo-segment {
  flex: 1;
  border-radius: 999px;
  margin: 2px 0;
  background: rgba(148,163,184,0.18);
  transition: background 0.28s ease, box-shadow 0.28s ease, transform 0.18s ease;
}

.thermo-segment[data-level="0"].active { background: #ef4444; box-shadow: 0 0 10px #ef4444aa; }
.thermo-segment[data-level="1"].active { background: #f97316; box-shadow: 0 0 10px #f97316aa; }
.thermo-segment[data-level="2"].active { background: #eab308; box-shadow: 0 0 10px #eab308aa; }
.thermo-segment[data-level="3"].active { background: #22c55e; box-shadow: 0 0 10px #22c55eaa; }
.thermo-segment[data-level="4"].active { background: #16a34a; box-shadow: 0 0 12px #16a34aaa; }

.thermo-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: rgba(226,232,240,0.9);
}

/* Smart & Raw blocks */
.bizhealth-smart-block,
.bizhealth-raw-block {
  width: 100%;
  margin-top: 6px;
}

.bizhealth-smart-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: radial-gradient(circle at 0 0, rgba(94,234,212,0.18), transparent 55%),
              rgba(15,23,42,0.9);
  min-height: 190px;
  font-size: 13px;
  line-height: 1.6;
}

.bizhealth-smart-body {
  white-space: pre-wrap;
}

.bizhealth-raw-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15,23,42,0.95);
  min-height: 190px;
  white-space: pre-wrap;
  font-size: 12px;
}

/* Placeholder text */
.smart-placeholder {
  opacity: 0.7;
  font-size: 13px;
}

/* History panel */
.bizhistory-wrapper {
  margin-top: 18px;
  border-top: 1px solid rgba(148,163,184,0.28);
  padding-top: 12px;
}

.bizhistory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.bizhistory-count {
  font-size: 12px;
  color: rgba(148,163,184,0.9);
}

.bizhistory-empty {
  font-size: 13px;
  color: rgba(148,163,184,0.8);
}

.bizhistory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.bizhistory-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15,23,42,0.9);
}

.bizhistory-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.bizhistory-date {
  color: rgba(148,163,184,0.9);
}

.bizhistory-level-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.6);
}

.bizhistory-bar-outer {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(30,64,175,0.45);
  overflow: hidden;
  margin-bottom: 4px;
}

.bizhistory-bar-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #a3e635);
}

.bizhistory-summary {
  font-size: 12px;
  color: rgba(226,232,240,0.92);
}

/* Hero health pill + sparkline */
#hero-health {
  display: flex;
  align-items: center;
  gap: 10px;
}

#hero-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 0 12px rgba(148,163,184,0.8);
}

#hero-health-label {
  font-size: 13px;
  font-weight: 500;
}

#hero-health-meta {
  font-size: 12px;
  color: rgba(148,163,184,0.9);
}

#hero-sparkline {
  margin-left: auto;
}

.hero-sparkline-canvas {
  width: 160px;
  height: 40px;
  display: block;
}

/* ============================================================
   BIZHEALTH 3.1 — PREMIUM UI STYLES
   Radar • Risk Ring • Reserve Bar • Thermometer • History
============================================================ */

/* -----------------------------------------------
   Layout Containers
----------------------------------------------- */
.bizhealth-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (min-width: 900px) {
    .bizhealth-layout {
        grid-template-columns: 250px 1fr;
    }
}

/* -----------------------------------------------
   Output Card + Tabs
----------------------------------------------- */
.output-card {
    background: #111827;
    border-radius: 12px;
    padding: 1.2rem;
    border: 1px solid #1f2937;
}

.output-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.output-title {
    color: #e5e7eb;
    font-weight: 600;
    font-size: 1.1rem;
}

.output-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.output-mode-btn {
    background: #1f2937;
    border: 1px solid #374151;
    padding: 4px 10px;
    border-radius: 6px;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.85rem;
}

.output-mode-btn.active {
    background: #2563eb;
    border-color: #1d4ed8;
}

.output-body {
    white-space: pre-wrap;
    color: #cbd5e1;
    padding: 1rem;
    background: #0f172a;
    border-radius: 10px;
    min-height: 140px;
}

/* -----------------------------------------------
   SMART MODE OUTPUT
----------------------------------------------- */
.smart-output {
    background: #0f172a;
    padding: 1rem;
    border-radius: 10px;
    color: #d1d5db;
    border: 1px solid #1e293b;
}

/* -----------------------------------------------
   THERMOMETER
----------------------------------------------- */
.bizhealth-thermo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.thermo-bar {
    display: flex;
    flex-direction: column;
    height: 180px;
    width: 22px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #374151;
    background: #0f172a;
}

.thermo-segment {
    flex: 1;
    background: #1f2937;
    border-bottom: 1px solid #111827;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.thermo-segment.active:nth-child(1) { background: #ef4444; box-shadow: 0 0 10px #ef4444aa; }
.thermo-segment.active:nth-child(2) { background: #f97316; box-shadow: 0 0 10px #f97316aa; }
.thermo-segment.active:nth-child(3) { background: #eab308; box-shadow: 0 0 10px #eab308aa; }
.thermo-segment.active:nth-child(4) { background: #22c55e; box-shadow: 0 0 10px #22c55eaa; }
.thermo-segment.active:nth-child(5) { background: #16a34a; box-shadow: 0 0 10px #16a34aaa; }

.thermo-labels {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: #9ca3af;
    font-size: 0.75rem;
}

/* -----------------------------------------------
   RADAR CHART
----------------------------------------------- */
#bizhealth-radar {
    width: 180px;
    height: 180px;
    background: #0f172a;
    border-radius: 12px;
    border: 1px solid #1f2937;
    padding: 10px;
}

/* -----------------------------------------------
   RISK RING
----------------------------------------------- */
#bizhealth-risk-ring {
    width: 160px;
    height: 160px;
    background: #0f172a;
    border-radius: 50%;
    border: 1px solid #1f2937;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -----------------------------------------------
   RESERVE BAR
----------------------------------------------- */
#bizhealth-reserve-bar {
    width: 100%;
    height: 22px;
    background: #1f2937;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #111827;
}

.reserve-bar-inner {
    height: 100%;
    width: 0%;
    background: #22c55e;
    transition: width 0.5s ease, background 0.5s ease;
}

#bizhealth-reserve-label {
    font-size: 0.85rem;
    margin-top: 0.3rem;
    color: #cbd5e1;
    text-align: right;
}

/* -----------------------------------------------
   HISTORY PANEL
----------------------------------------------- */
.bizhistory-wrapper {
    margin-top: 1.8rem;
    border-top: 1px solid #1f2937;
    padding-top: 1rem;
}

.bizhistory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bizhistory-count {
    font-size: 0.85rem;
    color: #9ca3af;
}

.bizhistory-empty {
    color: #6b7280;
    font-style: italic;
    margin-top: 0.6rem;
}

.bizhistory-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.85rem;
}

.bizhistory-item {
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 0.8rem;
}

.bizhistory-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.bizhistory-date {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.bizhistory-level-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 6px;
    color: #0f172a;
}

.bizhistory-level-tag:contains("Critical") { background: #ef4444; }
.bizhistory-level-tag:contains("Fragile") { background: #f97316; }
.bizhistory-level-tag:contains("Watch") { background: #eab308; }
.bizhistory-level-tag:contains("Healthy") { background: #22c55e; }
.bizhistory-level-tag:contains("Extremely healthy") { background: #16a34a; }

.bizhistory-bar-outer {
    height: 8px;
    background: #1f2937;
    border-radius: 4px;
    overflow: hidden;
}

.bizhistory-bar-inner {
    height: 100%;
    transition: width 0.4s ease;
}

.bizhistory-bar-inner.level-0 { background: #ef4444; }
.bizhistory-bar-inner.level-1 { background: #f97316; }
.bizhistory-bar-inner.level-2 { background: #eab308; }
.bizhistory-bar-inner.level-3 { background: #22c55e; }
.bizhistory-bar-inner.level-4 { background: #16a34a; }

.bizhistory-summary {
    margin-top: 0.4rem;
    color: #9ca3af;
    font-size: 0.8rem;
}

/* -----------------------------------------------
   AI INSIGHTS PANEL
----------------------------------------------- */
#bizhealth-ai-panel {
    background: #111827;
    border: 1px solid #1f2937;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

#bizhealth-ai-status {
    font-size: 0.85rem;
    color: #60a5fa;
    margin-bottom: 0.4rem;
}

#bizhealth-ai-body {
    color: #cbd5e1;
    line-height: 1.45;
    font-size: 0.9rem;
}

/* ==========================================================
   FORMS
========================================================== */
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.field-label {
  font-size: 12px;
  color: var(--text-muted);
}

textarea,
input {
  background: #020617;
  border-radius: var(--radius-md);
  border: 1px solid #1f2937;
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 13px;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* ==========================================================
   TEMPLATE LIBRARY
========================================================== */
#section-templates {
  margin-top: 40px;
}

.template-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-block {
  border-left: 3px solid #3b82f6;
  padding-left: 12px;
}

.template-block h3 {
  margin-bottom: 12px;
  color: #3b82f6;
  font-weight: 700;
  letter-spacing: 0.3px;
}

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

.template-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
  
  /* NEW — stronger readable color */
  color: #3b82f6;
  font-weight: 600;
}

.template-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent-stronger);
  color: #ffffff;
}

.template-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent-stronger);
  color: #ffffff;
}

.template-item::after {
  content: "→";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  transition: 0.2s;
}

.template-item:hover::after {
  opacity: 0.9;
  right: 10px;
}

/* ==========================================================
   PRICING
========================================================== */
.pricing-section {
  padding: 120px 0;
}

.pricing-header {
  text-align: center;
  margin-bottom: 50px;
}

.pricing-header h2 {
  font-size: 26px;
  margin-bottom: 8px;
}

.pricing-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* My Plan box (dynamic) */
.my-plan-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 22px;
  border-radius: 12px;
  margin: 20px auto 40px auto;
  max-width: 680px;
  backdrop-filter: blur(6px);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.my-plan-box strong {
  color: #fff;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.pricing-card {
  background: #0d1120;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 26px;
  border-radius: 16px;
  cursor: default;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  border-color: #3b82f6;
}

.pricing-featured {
  border: 1px solid #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.45);
}

.price-badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #e5e9f5;
  margin-bottom: 10px;
}

.badge-featured {
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
}

.pricing-card h3 {
  margin: 4px 0;
  font-size: 16px;
}

.price-amount {
  font-size: 22px;
  margin: 10px 0 14px;
  font-weight: 600;
}

.price-amount span {
  font-size: 13px;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 13px;
  color: #cbd5f5;
}

.plan-features li {
  margin-bottom: 6px;
}

/* ==========================================================
   SECURITY + FAQ
========================================================== */
.security-section {
  padding: 40px 0 30px;
}

.security-intro {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 620px;
}

.security-grid {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.accordion-item {
  background: #0d1120;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 2px;
  padding: 14px;
}

.accordion-summary {
  cursor: pointer;
  font-size: 15px;
  color: #e5e9f5;
}

.accordion-body {
  color: #a9b1c7;
  margin-top: 10px;
  line-height: 1.5;
}

.faq-section {
  padding: 0 0 60px;
}

.faq-intro {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 620px;
}

.faq-list {
  margin-top: 16px;
}

/* ==========================================================
   KNOWLEDGE DRAWER
========================================================== */

/* Overlay */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 890;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Drawer Panel */
.drawer {
  position: fixed;
  top: 0;
  right: -420px; /* Hidden by default */
  width: 420px;
  height: 100%;
  background: #0b1020;
  border-left: 1px solid #1f2937;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: right 0.28s ease;
}

.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 22px;
  border-bottom: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h2,
.drawer-header h3 {
  margin: 0;
  font-size: 16px;
}

.drawer-close {
  background: none;
  border: none;
  color: #cbd5f5;
  cursor: pointer;
  font-size: 13px;
}

.drawer-content,
.drawer-body {
  padding: 20px;
  overflow-y: auto;
}

/* Knowledge list */
#knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.knowledge-item {
  background: #020617;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #1f2937;
  font-size: 13px;
  color: #cbd5f5;
  white-space: pre-wrap;
}

.knowledge-meta {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.knowledge-status {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Optional usage block (if present) */
.usage-block {
  padding: 8px 0 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  margin-bottom: 10px;
}

.drawer-subtitle {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #e5e9f5;
}

.usage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-list-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.usage-item {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.usage-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.usage-tool {
  font-weight: 500;
  color: #e5e9f5;
}

.usage-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.usage-time {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

/* ==========================================================
   CREDITS BANNER (FLOATING)
========================================================== */
.credits-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  background: #020617;
  border-radius: 999px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.45);
  z-index: 60;
}

.credits-banner-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.credits-banner-link {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent-stronger);
  text-decoration: underline;
  cursor: pointer;
}

/* Important: hide when [hidden] attribute is set */
.credits-banner[hidden] {
  display: none !important;
}

/* ==========================================================
   FOOTER
========================================================== */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8992b0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
}

.footer-link a {
  color: #93c5fd;
  text-decoration: none;
}

.footer-link a:hover {
  text-decoration: underline;
}

/* ==========================================================
   RESPONSIVE
========================================================== */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .main {
    order: 1;
  }

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

  .hero {
    height: auto;
    padding: 60px 16px;
  }

  .drawer {
    width: 100%;
  }
}

/* =======================================
   SMART / RAW OUTPUT TOGGLE BUTTONS
======================================= */

.output-toggle-group {
  display: flex;
  gap: 6px;
}

.output-toggle {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid #1e293b;
  background: #0d1120;
  color: #9ca3af;
  cursor: pointer;
  transition: 0.15s;
}

.output-toggle:hover {
  color: #cbd5f5;
  border-color: #3b82f6;
}

.output-toggle-active {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #93c5fd;
  font-weight: 600;
}

.output-card-block {
  background: #0d1120;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 0 12px rgba(59,130,246,0.05); /* subtle SaaS glow */
}

/* ============================================
   EXPORT DROPDOWN
============================================ */
.export-wrapper {
  position: relative;
}

.export-btn {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #cbd5f5;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.export-btn:hover {
  background: #1e293b;
  border-color: #3b82f6;
}

.export-menu {
  position: absolute;
  top: 34px;
  right: 0;
  background: #0d1120;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 6px 0;
  width: 140px;
  display: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
  z-index: 50;
}

.export-wrapper.open .export-menu {
  display: block;
}

.export-item {
  padding: 8px 12px;
  font-size: 13px;
  color: #cbd5f5;
  cursor: pointer;
}

.export-item:hover {
  background: #1e2238;
  color: white;
}

/* TRANSLUCENT BLUE BUTTONS — Smart / Raw / Copy / Export */
.output-actions .output-mode-btn,
.output-actions .small-btn,
.export-toggle {
  background: rgba(59, 130, 246, 0.08); /* translucent blue */
  color: #3b82f6; /* brand blue */
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 6px 12px;
  border-radius: 8px;
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: 0.2s ease;
}

.output-actions .output-mode-btn:hover,
.output-actions .small-btn:hover,
.export-toggle:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
}

/* Active mode = bright blue tag */
.output-actions .output-mode-btn.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
  color: #fff;
}

/* Export dropdown container */
.export-dropdown.open .export-menu {
  display: flex;
}

.export-menu {
  display: none;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  position: absolute;
  right: 0;
  top: 34px;
  backdrop-filter: blur(6px);
  padding: 6px;
  z-index: 100;
}

.export-item {
  padding: 8px 12px;
  text-align: left;
  border: none;
  color: #3b82f6;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.export-item:hover {
  background: rgba(59, 130, 246, 0.2);
}

.logout-btn {
  width: 100%;
  background: #1f2937;
  color: #fff;
  border: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
  transition: 0.25s ease;
}

.logout-btn:hover {
  background: #374151;
}

.locked-feature {
  position: relative;
  filter: blur(3px);
  pointer-events: none;
  opacity: 0.6;
}

.upgrade-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  background: rgba(0,0,0,0.4);
  color: white;
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto;
}

.upgrade-box {
  background: rgba(0,0,0,0.7);
  padding: 10px 18px;
  border-radius: 8px;
  text-align: center;
}

.smart-flex {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

.smart-main,
.smart-side {
  background: rgba(255,255,255,0.03);
  padding: 18px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.05);
}

.smart-side {
  border-left: 2px solid rgba(255,255,255,0.08);
}

.smart-side h3 {
  font-size: 1rem;
  margin: 0 0 12px;
  font-weight: 600;
  opacity: 0.75;
}

/* Mobile-friendly collapse */
@media (max-width: 900px) {
  .smart-flex {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   PROMPT STUDIO — GLOBAL SECTION WRAPPER
========================================================== */
#section-prompt .panel-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

#section-prompt .panel-header p {
  color: var(--text-muted, #6c7178);
  font-size: .95rem;
}


/* ==========================================================
   GRID LAYOUT
========================================================== */
.grid.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

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


/* ==========================================================
   INPUT CARD
========================================================== */
#section-prompt .card h3 {
  font-size: 1.2rem;
  margin-bottom: .75rem;
  font-weight: 600;
}

#prompt-input {
  width: 100%;
  padding: .75rem;
  border-radius: .5rem;
  resize: vertical;
  border: 1px solid #d0d4d9;
  font-size: .95rem;
  line-height: 1.4;
}

#prompt-input:focus {
  outline: none;
  border-color: var(--accent, #2778f6);
  box-shadow: 0 0 0 2px rgba(39,120,246,.15);
}

/* ==========================================================
   PROMPT STUDIO — LOADING ANIMATION
========================================================== */

.smart-loading-animated {
  font-size: 15px;
  line-height: 1.5;
  color: #7c8ba1;
  opacity: 0.85;
  font-style: italic;
  position: relative;
  padding-left: 22px;
}

.smart-loading-animated::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4aa8ff;
  box-shadow:
    15px 0 0 #4aa8ff55,
    30px 0 0 #4aa8ff22;
  animation: pulseDots 1.4s infinite ease-in-out;
}

@keyframes pulseDots {
  0% { box-shadow: 15px 0 0 #4aa8ff55, 30px 0 0 #4aa8ff22; }
  50% { box-shadow: 15px 0 0 #4aa8ff22, 30px 0 0 #4aa8ff55; }
  100% { box-shadow: 15px 0 0 #4aa8ff55, 30px 0 0 #4aa8ff22; }
}

/* ==========================================================
   OUTPUT HEADER
========================================================== */
.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e3e3e3;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
}

.output-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.output-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.output-mode-btn {
  padding: .35rem .65rem;
  font-size: .85rem;
  border-radius: .4rem;
  border: 1px solid transparent;
  background: #f1f2f4;
  cursor: pointer;
}

.output-mode-btn.active {
  background: var(--accent, #2778f6);
  color: #fff;
}

.output-mode-btn:hover {
  background: #e0e1e4;
}


/* ==========================================================
   BUTTONS & SMALL CONTROLS
========================================================== */
.btn-ghost.small-btn {
  padding: .3rem .6rem;
  border-radius: .4rem;
  font-size: .8rem;
  background: #f6f7f8;
  border: 1px solid #e1e2e5;
  cursor: pointer;
}

.btn-ghost.small-btn:hover {
  background: #eceef0;
}

/* ==========================================================
   SMART MAIN SECTIONS
========================================================== */
.smart-section {
  margin-bottom: 1.25rem;
}

.smart-heading {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: .4rem;
}

.smart-preview {
  color: #373a40;
  font-size: .95rem;
  margin-bottom: .5rem;
}

.smart-bullets {
  padding-left: 1.2rem;
}

.smart-bullets li {
  margin-bottom: .3rem;
}

.smart-note {
  font-size: .85rem;
  color: #55585d;
  line-height: 1.35;
}


/* ==========================================================
   RAW OUTPUT
========================================================== */
#prompt-output {
  padding: 1rem;
  background: #f3f3f6;
  border-radius: .6rem;
  white-space: pre-wrap;
  font-size: .9rem;
  border: 1px solid #ddd;
}


/* ==========================================================
   EXPORT DROPDOWN
========================================================== */
.export-dropdown {
  position: relative;
}

.export-menu {
  position: absolute;
  right: 0;
  top: 110%;
  background: white;
  border: 1px solid #ddd;
  border-radius: .4rem;
  padding: .3rem 0;
  display: none;
  min-width: 150px;
  z-index: 10;
}

.export-dropdown.open .export-menu {
  display: block;
}

.export-item {
  width: 100%;
  padding: .4rem .75rem;
  background: #fff;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: .85rem;
}

.export-item:hover {
  background: #f0f2f5;
}

/* ==========================================================
   UNIFIED SMART OUTPUT SYSTEM (FIXES OVERLAP)
========================================================== */

.smart-output {
  background: #101522;
  border: 1px solid #1c2536;
  border-radius: 14px;
  padding: 18px;
  width: 100%;
  display: block;
  position: relative;
}

.smart-flex {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  width: 100%;
  position: relative;
}

.smart-main,
.smart-side {
  background: #0f1420;
  border: 1px solid #1b2334;
  border-radius: 12px;
  padding: 18px;
}

.smart-side-heading,
.smart-heading {
  color: #9ab6ff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.smart-preview,
.smart-note,
.smart-bullets li {
  color: #d6ddf3;
}

.smart-bullets {
  padding-left: 1.2rem;
}

.followup-btn {
  background: #0f1420;
  border: 1px solid #1e273a;
  border-radius: 8px;
  padding: 10px;
  font-size: .85rem;
  color: #c9d4f2;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.followup-btn:hover {
  background: #182033;
  border-color: #3b82f6;
  color: white;
}

/* MOBILE */
@media (max-width: 900px) {
  .smart-flex {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   IMPACTOS — PROMPT STUDIO (FULL CLEAN REBUILD)
   Replaces ALL previous prompt studio CSS
========================================================== */

/* ---- CARD WRAPPER ---- */
.output-card {
  background: #0d111f !important;
  border: 1px solid #1b2334 !important;
  border-radius: 14px !important;
  padding: 20px !important;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ---- HEADER BAR ---- */
.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e2738 !important;
  padding-bottom: 10px !important;
  margin-bottom: 16px !important;
}

.output-title {
  color: #e5e9f5 !important;
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---- ACTION BUTTONS ---- */
.output-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.output-actions .output-mode-btn,
.output-actions .small-btn,
.export-toggle {
  background: #141a2b !important;
  border: 1px solid #26324a !important;
  color: #96b4ff !important;
  padding: 7px 12px !important;
  border-radius: 8px !important;
  cursor: pointer;
  font-size: .85rem;
  transition: 0.2s ease;
}

.output-actions .output-mode-btn.active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-color: #3b82f6 !important;
}

/* ---- EXPORT MENU ---- */
.export-dropdown {
  position: relative;
}

.export-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 105%;
  background: #101522 !important;
  border: 1px solid #1d2740 !important;
  border-radius: 8px;
  padding: 6px 0;
  width: 160px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45) !important;
  z-index: 50;
}

.export-dropdown.open .export-menu {
  display: block;
}

.export-item {
  padding: 8px 12px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: #96b4ff !important;
  font-size: .85rem;
  cursor: pointer;
  border-radius: 6px;
}

.export-item:hover {
  background: #182033 !important;
  color: #ffffff !important;
}

/* ==========================================================
   SUMMARY PILLS
========================================================== */

.prompt-smart-summary-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-pill {
  background: #141a2b !important;
  border: 1px solid #1f273a !important;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 110px;
}

.summary-pill .label {
  color: #8a94b8 !important;
  font-size: .75rem;
}

.summary-pill .value {
  color: #ffffff !important;
  font-size: .9rem;
  font-weight: 600;
  margin-top: 2px;
}

/* ==========================================================
   SMART OUTPUT CONTAINER
========================================================== */

.smart-output {
  background: #101522 !important;
  border: 1px solid #1c2536 !important;
  border-radius: 14px !important;
  padding: 18px !important;
  width: 100%;
  display: block;
  position: relative;
}

/* ---- TWO-COLUMN LAYOUT ---- */
.smart-flex {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important;
  gap: 18px !important;
  width: 100%;
}

@media (max-width: 900px) {
  .smart-flex {
    grid-template-columns: 1fr !important;
  }
}

/* ---- MAIN COLUMN ---- */
.smart-main {
  background: #0f1420 !important;
  border: 1px solid #1b2334 !important;
  border-radius: 12px !important;
  padding: 18px !important;
}

/* ---- FOLLOW-UP COLUMN ---- */
.smart-side {
  background: #0f1420 !important;
  border: 1px solid #1b2334 !important;
  border-radius: 12px !important;
  padding: 18px !important;
}

/* ==========================================================
   CONTENT BLOCKS
========================================================== */

.smart-section {
  margin-bottom: 20px;
}

.smart-heading,
.smart-side-heading {
  color: #9ab6ff !important;
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.smart-preview,
.smart-note,
.smart-bullets li {
  color: #d6ddf3 !important;
  font-size: .95rem;
}

.smart-bullets {
  padding-left: 18px !important;
}

.smart-bullets li {
  margin-bottom: 4px;
}

.smart-note {
  font-size: .85rem !important;
  color: #97a3c6 !important;
}

/* ==========================================================
   FOLLOW-UP BUTTONS
========================================================== */

.followup-btn {
  background: #0f1420 !important;
  border: 1px solid #1e273a !important;
  border-radius: 8px !important;
  padding: 10px !important;
  font-size: .85rem !important;
  color: #c9d4f2 !important;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.followup-btn:hover {
  background: #182033 !important;
  border-color: #3b82f6 !important;
  color: white !important;
}

/* ==========================================================
   RAW OUTPUT VIEW
========================================================== */

#prompt-output {
  background: #0f1420 !important;
  border: 1px solid #1b2334 !important;
  color: #dbe1f5 !important;
  border-radius: 12px !important;
  padding: 16px;
  white-space: pre-wrap;
}

/* ==========================================================
   IMPACTOS — PROMPT STUDIO 3-COLUMN SYSTEM (Layout 2)
   CLEAN, ISOLATED, NO OVERLAP
========================================================== */

/* ==== GRID WRAPPER ==== */
.prompt-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

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

/* ==== CARDS ==== */
.prompt-card,
.output-card,
.followup-card {
  background: #0d111f;
  border: 1px solid #1b2334;
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ==== INPUT CARD ==== */
.prompt-card h3 {
  color: #ffffff;
  margin-bottom: 12px;
  font-weight: 600;
}

#prompt-input {
  width: 100%;
  height: 140px;
  padding: 12px;
  border-radius: 10px;
  background: #101522;
  border: 1px solid #1c2536;
  color: #e5e9f5;
  font-size: 0.95rem;
  resize: vertical;
}

#prompt-input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* ==== OUTPUT HEADER ==== */
.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e2738;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.output-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.output-mode-btn,
.small-btn,
.export-toggle {
  background: #141a2b;
  border: 1px solid #26324a;
  color: #96b4ff;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.output-mode-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.output-mode-btn:hover,
.small-btn:hover {
  background: #1d2538;
}

/* ==== SMART OUTPUT ==== */
.smart-output {
  background: #101522;
  border: 1px solid #1c2536;
  border-radius: 14px;
  padding: 18px;
}

.prompt-smart-summary-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-pill {
  background: #141a2b;
  border: 1px solid #1f273a;
  padding: 8px 12px;
  border-radius: 10px;
  min-width: 110px;
}

.summary-pill .label {
  color: #8a94b8;
  font-size: 0.75rem;
}

.summary-pill .value {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ==== SMART BODY AND FOLLOW-UPS ==== */
.smart-flex {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.smart-main {
  background: #0f1420;
  border: 1px solid #1b2334;
  border-radius: 12px;
  padding: 18px;
}

.smart-side {
  background: #0f1420;
  border: 1px solid #1b2334;
  border-radius: 12px;
  padding: 18px;
}

/* Headings */
.smart-heading,
.smart-side-heading {
  color: #9ab6ff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Text */
.smart-preview,
.smart-note,
.smart-bullets li {
  color: #d6ddf3;
  font-size: 0.95rem;
}

.smart-bullets {
  padding-left: 18px;
}

.smart-note {
  font-size: 0.85rem;
  color: #97a3c6;
}

/* ==== FOLLOW-UP BUTTONS ==== */
.followup-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.followup-btn {
  background: #0f1420;
  border: 1px solid #1e273a;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  color: #c9d4f2;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.followup-btn:hover {
  background: #182033;
  border-color: #3b82f6;
  color: #fff;
}

/* ==== RAW OUTPUT ==== */
#prompt-output {
  background: #0f1420;
  border: 1px solid #1b2334;
  border-radius: 12px;
  padding: 16px;
  color: #dbe1f5;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* ==========================================================
   IMPACTOS — LAYOUT OVERRIDES (1440px LOCK)
========================================================== */

/* Main container now uses 1440px max width */
.container {
  max-width: 1440px;
}

/* Ensure main content column behaves nicely next to sidebar */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

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

.main {
  min-width: 0; /* prevent weird horizontal squishing */
}

/* ==========================================================
   PROMPT STUDIO — 3-COLUMN LAYOUT (INPUT | OUTPUT | FOLLOW-UPS)
========================================================== */

/* Section header tweaks */
#section-prompt .panel-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

#section-prompt .panel-header p {
  color: var(--text-muted, #8a94b8);
  font-size: 0.95rem;
}

/* 3-column layout: 1fr | 1.4fr | 1fr */
#section-prompt .prompt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

@media (max-width: 1100px) {
  #section-prompt .prompt-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-auto-rows: auto;
  }
}

@media (max-width: 900px) {
  #section-prompt .prompt-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
#section-prompt .prompt-card,
#section-prompt .output-card,
#section-prompt .followup-card {
  background: #0d111f;
  border: 1px solid #1b2334;
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  min-width: 0; /* critical to avoid squish */
}

/* INPUT CARD */
#section-prompt .prompt-card h3 {
  color: #ffffff;
  margin-bottom: 12px;
  font-weight: 600;
}

#section-prompt #prompt-input {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  border-radius: 10px;
  background: #101522;
  border: 1px solid #1c2536;
  color: #e5e9f5;
  font-size: 0.95rem;
  resize: vertical;
}

#section-prompt #prompt-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

/* OUTPUT HEADER / CONTROLS */
#section-prompt .output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e2738;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

#section-prompt .output-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #e5e9f5;
}

#section-prompt .output-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#section-prompt .output-mode-btn,
#section-prompt .small-btn,
#section-prompt .export-toggle {
  background: #141a2b;
  border: 1px solid #26324a;
  color: #96b4ff;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
}

#section-prompt .output-mode-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

#section-prompt .output-mode-btn:hover,
#section-prompt .small-btn:hover,
#section-prompt .export-toggle:hover {
  background: #1d2538;
}

/* EXPORT MENU */
#section-prompt .export-dropdown {
  position: relative;
}

#section-prompt .export-menu {
  position: absolute;
  right: 0;
  top: 110%;
  background: #0e1322;
  border: 1px solid #1d2740;
  border-radius: 8px;
  padding: 6px 0;
  min-width: 150px;
  z-index: 30;
  display: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

#section-prompt .export-dropdown.open .export-menu {
  display: block;
}

#section-prompt .export-item {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: #96b4ff;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

#section-prompt .export-item:hover {
  background: #1e2639;
  color: #ffffff;
}

/* SMART OUTPUT WRAPPER */
#section-prompt #prompt-smart-output {
  background: #101522;
  border: 1px solid #1c2536;
  border-radius: 14px;
  padding: 18px;
}

#section-prompt .prompt-smart-summary-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

#section-prompt .summary-pill {
  background: #141a2b;
  border: 1px solid #1f273a;
  padding: 8px 12px;
  border-radius: 10px;
  min-width: 110px;
}

#section-prompt .summary-pill .label {
  color: #8a94b8;
  font-size: 0.75rem;
}

#section-prompt .summary-pill .value {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

/* SMART BODY */
#section-prompt .smart-section {
  margin-bottom: 16px;
}

#section-prompt .smart-heading {
  color: #9ab6ff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

#section-prompt .smart-preview {
  color: #d6ddf3;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

#section-prompt .smart-bullets {
  padding-left: 18px;
}

#section-prompt .smart-bullets li {
  margin-bottom: 4px;
  color: #d6ddf3;
}

#section-prompt .smart-note {
  font-size: 0.85rem;
  color: #97a3c6;
}

/* RAW OUTPUT */
#section-prompt #prompt-output {
  background: #0f1420;
  border: 1px solid #1b2334;
  border-radius: 12px;
  padding: 16px;
  color: #dbe1f5;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* FOLLOW-UP COLUMN */
#section-prompt .followup-card {
  display: flex;
  flex-direction: column;
}

#section-prompt .followup-card .smart-side-heading {
  color: #9ab6ff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

#section-prompt #prompt-followup-panel {
  flex: 1;
}

#section-prompt .followup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#section-prompt .followup-btn {
  background: #0f1420;
  border: 1px solid #1e273a;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  color: #c9d4f2;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

#section-prompt .followup-btn:hover {
  background: #182033;
  border-color: #3b82f6;
  color: #ffffff;
}

/* ==========================================================
   PROMPT STUDIO — 1440px GRID LAYOUT
========================================================== */

.prompt-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 24px;
  width: 100%;
}

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

/* Cards */
.prompt-input-card,
.prompt-output-card,
.prompt-followup-card {
  background: #0d111f;
  border: 1px solid #1c2536;
  padding: 20px;
  border-radius: 12px;
}

/* Output header */
.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1c2536;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

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

.output-title {
  color: #e5e9f5;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Mode buttons */
.output-mode-btn {
  background: #141a2b;
  border: 1px solid #26324a;
  color: #96b4ff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.output-mode-btn.active {
  background: #3b82f6;
  color: white;
}

/* Summary Pills */
.prompt-summary-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.summary-pill {
  background: #141a2b;
  padding: 10px 14px;
  border-radius: 10px;
  min-width: 110px;
  border: 1px solid #1f273a;
}

.summary-pill .label {
  font-size: 0.75rem;
  color: #8a94b8;
}

.summary-pill .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
}

/* Smart Output */
.smart-output {
  padding: 12px;
  background: #101522;
  border: 1px solid #1c2536;
  border-radius: 12px;
}

.smart-main {
  font-size: 0.96rem;
  color: #d6ddf3;
}

.smart-section {
  margin-bottom: 16px;
}

.smart-heading {
  color: #9ab6ff;
  margin-bottom: 6px;
}

.smart-bullets {
  padding-left: 20px;
}

.smart-note {
  color: #97a3c6;
}

/* Raw Output */
#prompt-output {
  background: #0f1420;
  padding: 14px;
  border-radius: 10px;
  color: #dbe1f5;
  border: 1px solid #1b2334;
  white-space: pre-wrap;
}

/* Follow-ups */
.prompt-followup-card h3 {
  color: #9ab6ff;
}

.followup-list {
  list-style: none;
  padding-left: 0;
}

.followup-btn {
  width: 100%;
  background: #0f1420;
  border: 1px solid #1e273a;
  padding: 10px;
  text-align: left;
  border-radius: 8px;
  color: #c9d4f2;
  margin-bottom: 8px;
}

.followup-btn:hover {
  background: #182033;
}

/* ==========================================================
   IMPACTOS — PROMPT STUDIO (LAYOUT A, 3-COLUMN, OPAQUE)
   All selectors are scoped under #section-prompt
========================================================== */

#section-prompt {
  padding: 72px 0 64px;
}

#section-prompt .prompt-header {
  margin-bottom: 28px;
}

#section-prompt .prompt-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

#section-prompt h2 {
  font-size: 26px;
  margin: 0 0 6px;
}

#section-prompt .prompt-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* ------------ GRID LAYOUT ------------ */

#section-prompt .prompt-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.2fr) minmax(
      260px,
      0.9fr
    );
  gap: 22px;
  align-items: flex-start;
}

#section-prompt .prompt-card {
  background: #050814;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 18px 18px 20px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* left: input */
#section-prompt .prompt-input-card {
  position: relative;
}

/* middle: output */
#section-prompt .prompt-output-card {
  position: relative;
}

/* right: follow-ups */
#section-prompt .prompt-followup-card {
  position: relative;
}

/* ------------ INPUT CARD ------------ */

#section-prompt .prompt-card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

#section-prompt .prompt-card-help {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

#section-prompt .prompt-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-prompt #prompt-input {
  width: 100%;
  resize: vertical;
  min-height: 220px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e9f5;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

#section-prompt #prompt-input::placeholder {
  color: #6b7280;
}

#section-prompt #prompt-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
}

/* generate button */
#section-prompt .prompt-submit-btn {
  align-self: flex-start;
  border-radius: 999px;
  padding-inline: 20px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#section-prompt .prompt-submit-btn.is-loading {
  opacity: 0.8;
  cursor: default;
}

/* ------------ OUTPUT HEADER ------------ */

#section-prompt .output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

#section-prompt .output-title {
  font-size: 15px;
  font-weight: 600;
}

#section-prompt .output-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* toggle buttons */
#section-prompt .output-mode-btn {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #9ca3af;
  cursor: pointer;
  transition: 0.16s ease;
}

#section-prompt .output-mode-btn:hover {
  border-color: #3b82f6;
  color: #e5e9f5;
}

#section-prompt .output-mode-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

/* small utility buttons */
#section-prompt .small-btn {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
}

/* ------------ SUMMARY PILLS ------------ */

#section-prompt .prompt-summary-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

#section-prompt .summary-pill {
  background: #020617;
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 6px 10px;
  min-width: 120px;
}

#section-prompt .summary-pill .label {
  font-size: 11px;
  color: #9ca3af;
}

#section-prompt .summary-pill .value {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
}

/* ------------ SMART / RAW OUTPUT ------------ */

#section-prompt .smart-output {
  border-radius: 14px;
  background: #020617;
  border: 1px solid #1f2937;
  padding: 14px;
}

#section-prompt .smart-main {
  font-size: 13px;
  color: #e5e9f5;
}

#section-prompt .smart-section {
  margin-bottom: 14px;
}

#section-prompt .smart-heading {
  font-weight: 600;
  color: #9ab6ff;
  font-size: 14px;
  margin-bottom: 6px;
}

#section-prompt .smart-preview {
  font-size: 13px;
  color: #e5e9f5;
  margin: 0 0 4px;
}

#section-prompt .smart-bullets {
  padding-left: 18px;
}

#section-prompt .smart-bullets li {
  margin-bottom: 4px;
}

#section-prompt .smart-note {
  font-size: 12px;
  color: #9ca3af;
}

#section-prompt .smart-loading {
  font-size: 13px;
  color: #9ca3af;
}

/* raw block */
#section-prompt .prompt-raw-output {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: #020617;
  border: 1px solid #1f2937;
  font-size: 13px;
  white-space: pre-wrap;
}

/* ------------ FOLLOW-UPS ------------ */

#section-prompt .followup-panel {
  margin-top: 6px;
}

#section-prompt .followup-empty {
  font-size: 12px;
  color: #9ca3af;
}

#section-prompt .followup-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#section-prompt .followup-btn {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e9f5;
  padding: 10px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.16s ease;
}

#section-prompt .followup-btn:hover {
  border-color: #3b82f6;
  background: #0b1120;
}

/* ------------ EXPORT DROPDOWN (PROMPT-ONLY) ------------ */

#section-prompt .prompt-export-dropdown {
  position: relative;
}

#section-prompt .prompt-export-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#section-prompt .prompt-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: #020617;
  border-radius: 10px;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  padding: 6px 0;
  display: none;
  z-index: 40;
}

#section-prompt .prompt-export-dropdown.open .prompt-export-menu {
  display: block;
}

#section-prompt .prompt-export-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #e5e9f5;
  padding: 6px 10px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

#section-prompt .prompt-export-item:hover {
  background: #0b1120;
}

/* ------------ RESPONSIVE ------------ */

@media (max-width: 1100px) {
  #section-prompt .prompt-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    grid-template-areas:
      "input output"
      "follow output";
  }

  #section-prompt .prompt-input-card {
    grid-area: input;
  }

  #section-prompt .prompt-output-card {
    grid-area: output;
  }

  #section-prompt .prompt-followup-card {
    grid-area: follow;
  }
}

@media (max-width: 780px) {
  #section-prompt .prompt-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "input"
      "output"
      "follow";
  }

  #section-prompt .prompt-card {
    padding: 16px;
  }

  #section-prompt .output-actions {
    justify-content: flex-start;
  }
}

/* ==========================================================
   PROMPT STUDIO V2 — LAYOUT
========================================================== */

.prompt-studio-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.3fr) minmax(260px, 0.9fr);
  gap: 20px;
  align-items: flex-start;
}

/* Cards */
.prompt-card {
  background: #0b1020;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 16px 18px 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.55);
}

.prompt-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.prompt-card-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted, #8a94b8);
}

/* Input form */
.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

#prompt-input {
  width: 100%;
  resize: vertical;
  min-height: 140px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e9f5;
  font-size: 13px;
  line-height: 1.4;
}

#prompt-input::placeholder {
  color: #6b7280;
}

#prompt-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.85);
}

.prompt-submit-btn {
  margin-top: 2px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prompt-submit-btn .btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin-prompt 0.7s linear infinite;
}

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

/* ==========================================================
   PROMPT STUDIO V2 — OUTPUT
========================================================== */

.prompt-output-col {
  min-height: 260px;
}

.prompt-summary-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.summary-pill {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-pill .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.summary-pill .value {
  font-size: 12px;
  font-weight: 600;
  color: #e5e9f5;
}

.prompt-smart-shell {
  border-radius: 14px;
  background: #020617;
  border: 1px solid #1f2937;
  padding: 12px 12px 14px;
  min-height: 190px;
}

.prompt-smart-body {
  font-size: 13px;
  color: #e5e9f5;
}

.prompt-empty-state {
  font-size: 13px;
  color: #9ca3af;
}

/* Sections */
.smart-section {
  margin-bottom: 14px;
}

.smart-heading {
  font-size: 14px;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 4px;
}

.smart-preview {
  font-size: 13px;
  line-height: 1.5;
  color: #e5e9f5;
}

.smart-markdown {
  margin-top: 4px;
}

.smart-markdown p {
  margin: 0 0 6px;
}

.smart-markdown ul,
.smart-markdown ol {
  margin: 0 0 6px 16px;
  padding-left: 14px;
}

.smart-markdown li {
  margin-bottom: 3px;
}

/* Execution notes */
.smart-note {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

/* AI typing indicator */
.prompt-typing-indicator {
  display: inline-flex;
  gap: 3px;
  margin-top: 8px;
}

.prompt-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #60a5fa;
  opacity: 0.25;
  animation: pulse-typing 1.1s infinite ease-in-out;
}

.prompt-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.prompt-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse-typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.2;
  }
  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Raw output */
.prompt-raw-output {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #020617;
  font-size: 12px;
  color: #e5e9f5;
  max-height: 420px;
  overflow-y: auto;
}

/* ==========================================================
   PROMPT STUDIO V2 — FOLLOW-UPS
========================================================== */

.prompt-followup-panel {
  margin-top: 6px;
}

.prompt-followup-empty {
  font-size: 13px;
  color: #9ca3af;
}

.followup-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.followup-btn {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: 1px solid #1f2937;
  background: #020617;
  padding: 8px 10px;
  color: #e5e9f5;
  font-size: 12px;
  cursor: pointer;
  transition: 0.16s ease;
}

.followup-btn:hover {
  background: #111827;
  border-color: #3b82f6;
}

/* ==========================================================
   PROMPT STUDIO V2 — LOADING & ERROR
========================================================== */

.prompt-loading-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-loading-line {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(55, 65, 81, 0.4),
    rgba(30, 64, 175, 0.8),
    rgba(55, 65, 81, 0.4)
  );
  background-size: 160% 100%;
  animation: shimmer-line 1.3s infinite;
}

.prompt-loading-line.short {
  width: 55%;
}

.prompt-loading-line.medium {
  width: 80%;
}

.prompt-loading-line.long {
  width: 95%;
}

@keyframes shimmer-line {
  0% {
    background-position: -40% 0;
  }
  100% {
    background-position: 140% 0;
  }
}

.prompt-error {
  font-size: 13px;
  color: #fecaca;
}

/* ==========================================================
   PROMPT STUDIO V2 — OUTPUT HEADER BUTTONS
========================================================== */

.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.output-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.output-title {
  font-size: 14px;
  font-weight: 600;
}

.output-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.output-mode-btn {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #1e293b;
  background: #0b1120;
  color: #cbd5f5;
  cursor: pointer;
  transition: 0.18s ease;
}

.output-mode-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

.output-mode-btn:hover:not(.active) {
  background: #111827;
}

/* ===== Prompt Studio Depth Toggle ===== */

.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.output-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.output-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.depth-toggle {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #1f2933, #020617);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.depth-mode-btn {
  border: none;
  background: transparent;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: #cbd5f5;
  opacity: 0.7;
  transition: background 0.16s ease, opacity 0.16s ease, transform 0.08s ease;
}

.depth-mode-btn:hover {
  opacity: 1;
  transform: translateY(-0.5px);
}

.depth-mode-btn.active {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #0b1120;
  opacity: 1;
}

/* Keep output-mode-btn behaving like your current pills */
.output-actions .output-mode-btn {
  border-radius: 999px;
  padding: 4px 12px;
}

/* ==========================================================
   RESPONSIVE — STACK COLUMNS ON SMALL SCREENS
========================================================== */

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

  .prompt-card {
    margin-bottom: 6px;
  }

  .prompt-output-col {
    order: 2;
  }

  .prompt-followup-col {
    order: 3;
  }

  .prompt-input-col {
    order: 1;
  }
}

/* ===== DEPTH MODE TOGGLE (REQUIRED) ===== */

.depth-toggle {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.depth-mode-btn {
  cursor: pointer;
  padding: 6px 14px;
  font-size: 13px;
  background: #1f1f1f;
  border: 1px solid #444;
  color: #ddd;
  border-radius: 6px;
  transition: 0.15s ease;
}

.depth-mode-btn:hover {
  background: #2a2a2a;
}

.depth-mode-btn.active {
  background: #4a90e2;
  border-color: #4a90e2;
  color: white;
}

/* Smart vs Raw output button styling */
.output-mode-btn.active {
  background: #4a90e2 !important;
  color: white !important;
}

/* DEPTH MODE BUTTONS */
.depth-toggle {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.depth-mode-btn {
  cursor: pointer;
  padding: 6px 14px;
  font-size: 13px;
  background: #1f1f1f;
  border: 1px solid #444;
  color: #ddd;
  border-radius: 6px;
  transition: 0.15s ease;
}

.depth-mode-btn:hover {
  background: #2a2a2a;
}

.depth-mode-btn.active {
  background: #4a90e2;
  border-color: #4a90e2;
  color: white;
}

/* ================================
   FIX: Smart Output Should Expand
   ================================ */

#prompt-smart-output,
.prompt-smart-body {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* Remove any limiting from output-card */
#section-prompt .prompt-output-card,
.output-card {
    height: auto !important;
    min-height: 0 !important;
}

/* Ensure columns expand with content */
#section-prompt .prompt-grid {
    align-items: start !important;
}

.smart-text-block p {
  margin-bottom: 8px;
  line-height: 1.45;
}

.smart-bullets li {
  margin-bottom: 6px;
  line-height: 1.45;
}

.smart-sub {
  margin-left: 20px;
  opacity: 0.85;
  font-size: 0.95em;
}

.smart-paragraph {
  margin: 6px 0 10px 0;
  opacity: 0.9;
}

.smart-phase {
  margin: 14px 0 6px;
  font-weight: 600;
  font-size: 1.05em;
  color: #71c7ff; /* your glowing blue secondary color */
}

.smart-notes li {
  margin-bottom: 6px;
}

/* ===========================
   EXPORT DROPDOWN FIX
=========================== */
.prompt-export-dropdown {
  position: relative;
  display: inline-block;
}

.prompt-export-toggle {
  cursor: pointer;
}

.prompt-export-menu {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 6px;
  background: #0f1116;
  border: 1px solid #2a2d34;
  border-radius: 8px;
  padding: 6px;
  min-width: 150px;
  z-index: 9999;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}

.prompt-export-menu .prompt-export-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  color: #d7dae0;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
}

.prompt-export-menu .prompt-export-item:hover {
  background: #1b1e25;
}

.prompt-export-dropdown.open .prompt-export-menu {
  display: block;
}

.prompt-library-card {
  background: rgba(255,255,255,0.03);
  padding: 16px;
  border-radius: 12px;
  margin-top: 24px;
  backdrop-filter: blur(8px);
}

.strategy-item {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 12px;
}

.strategy-snippet {
  opacity: 0.8;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* =========================
   FIX: BizHealth Smart Output Spacing
========================= */

.bizhealth-layout {
  display: block !important;   /* Break the side-by-side squeeze */
  width: 100%;
}

.bizhealth-thermo {
  margin-bottom: 20px;         /* Space between bar and text */
}

#bizhealth-smart-output {
  width: 100%;
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  font-size: 14px;
  line-height: 1.6;
  max-height: none !important;
}

.bizhealth-smart-body {
  white-space: pre-wrap;
}

/* Raw output matches spacing */
#bizhealth-output {
  margin-top: 12px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
}

#bizhealth-smart-output {
  background: linear-gradient(
    135deg,
    rgba(59,130,246,0.18),
    rgba(147,197,253,0.08)
  );
  border: 1px solid rgba(96,165,250,0.35);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

/* ============================
   KPI DRILLDOWN CARDS (Option F)
============================ */
.bizhealth-drilldown-wrapper {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drill-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 14px 18px;
  border-radius: 10px;
}

.drill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.drill-title {
  font-weight: 600;
  font-size: 15px;
}

.drill-badge {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.drill-badge.met {
  background: rgba(34,197,94,0.2);
  color: #22c55e;
}

.drill-badge.in-progress {
  background: rgba(234,179,8,0.2);
  color: #eab308;
}

.drill-badge.not-met {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
}

.drill-content {
  margin-top: 12px;
  line-height: 1.45;
  font-size: 14px;
  display: none;
}

.drill-card.open .drill-content {
  display: block;
}

/* =====================================================================
   BIZHEALTH — V4 UI BUNDLE
   Matches full HTML + JS from Option E Enhanced
   ===================================================================== */

/* -------------------------------
   CORE LAYOUT
--------------------------------- */
#section-bizhealth .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

#section-bizhealth .card {
  background: rgba(30, 35, 45, 0.7);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 0 22px rgba(0,0,0,0.25);
  backdrop-filter: blur(14px);
}

/* -------------------------------
   FORM FIELDS
--------------------------------- */
#section-bizhealth .field {
  margin-bottom: 22px;
}

#section-bizhealth .field-label {
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 6px;
  display: block;
}

#section-bizhealth input,
#section-bizhealth select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  font-size: 14px;
}

#section-bizhealth .field-help {
  color: #64748b;
  font-size: 12px;
  margin-top: 4px;
}

/* -------------------------------
   KPI ROWS
--------------------------------- */
.biz-kpi-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.biz-reserves-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* -------------------------------
   BUTTONS
--------------------------------- */
.btn-primary {
  background: linear-gradient(90deg, #4f46e5, #3b82f6);
  color: white;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  transition: opacity .25s;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

/* -------------------------------
   OUTPUT HEADER
--------------------------------- */
.output-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.output-title {
  font-size: 17px;
  font-weight: 600;
  color: #f1f5f9;
}

.output-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.output-mode-btn {
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
}

.output-mode-btn.active {
  background: #3b82f6;
  color: white;
}

/* -------------------------------
   EXPORT DROPDOWN
--------------------------------- */
.export-dropdown {
  position: relative;
}

.export-toggle {
  cursor: pointer;
}

.export-menu {
  position: absolute;
  top: 32px;
  right: 0;
  background: rgba(17, 22, 30, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  display: none;
  min-width: 150px;
  overflow: hidden;
}

.export-dropdown:hover .export-menu {
  display: block;
}

.export-item {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background: none;
  border: none;
  text-align: left;
  color: #e2e8f0;
  cursor: pointer;
}

.export-item:hover {
  background: rgba(255,255,255,0.07);
}

/* -------------------------------
   SNAPSHOT LAYOUT
--------------------------------- */
.bizhealth-layout {
  margin-top: 10px;
}

/* -------------------------------
   THERMOMETER
--------------------------------- */
.bizhealth-thermo {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.thermo-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 20px;
}

.thermo-segment {
  height: 20px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background .25s, box-shadow .3s;
}

.thermo-segment.active[data-level="0"] { background: #ef4444; box-shadow: 0 0 8px #ef444466; }
.thermo-segment.active[data-level="1"] { background: #f97316; box-shadow: 0 0 8px #f9731666; }
.thermo-segment.active[data-level="2"] { background: #eab308; box-shadow: 0 0 8px #eab30866; }
.thermo-segment.active[data-level="3"] { background: #22c55e; box-shadow: 0 0 8px #22c55e66; }
.thermo-segment.active[data-level="4"] { background: #16a34a; box-shadow: 0 0 8px #16a34a66; }

.thermo-labels {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thermo-labels span {
  color: #cbd5e1;
  font-size: 11px;
}

/* -------------------------------
   MINI METRICS (Momentum / Reserves / Risk)
--------------------------------- */
.bizhealth-mini-metrics {
  display: flex;
  gap: 12px;
  margin: 18px 0;
}

.mini-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px;
  flex: 1;
}

.mini-label {
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 6px;
}

.mini-bar-outer {
  background: rgba(255,255,255,0.1);
  height: 7px;
  border-radius: 6px;
  overflow: hidden;
}

.mini-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  width: 0%;
  transition: width .4s ease;
}

.mini-caption {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 6px;
  text-align: right;
}

/* -------------------------------
   SMART OUTPUT
--------------------------------- */
.bizhealth-smart-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  white-space: pre-wrap;
}

.bizhealth-smart-body {
  color: #e2e8f0;
  line-height: 1.5;
  font-size: 14px;
}

/* -------------------------------
   DRILLDOWNS
--------------------------------- */
.bizhealth-drilldown-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.drill-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px;
  border-radius: 10px;
}

.drill-card h4 {
  font-size: 14px;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.drill-card p {
  margin: 2px 0;
  font-size: 12px;
  color: #cbd5e1;
}

/* -------------------------------
   RAW OUTPUT
--------------------------------- */
.bizhealth-raw-block {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  border-radius: 10px;
  color: #94a3b8;
  max-height: 450px;
  overflow-y: auto;
}

/* -------------------------------
   HISTORY PANEL
--------------------------------- */
.bizhistory-wrapper {
  margin-top: 22px;
}

.bizhistory-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bizhistory-header h4 {
  color: #e2e8f0;
  margin: 0;
}

.bizhistory-count {
  color: #94a3b8;
  font-size: 12px;
}

.bizhistory-empty {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 20px;
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
  text-align: center;
}

.bizhistory-item {
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-bottom: 12px;
}

.bizhistory-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bizhistory-date {
  color: #cbd5e1;
  font-size: 13px;
}

.bizhistory-level-tag {
  font-size: 12px;
  color: #3b82f6;
}

.bizhistory-bar-outer {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  margin-bottom: 6px;
}

.bizhistory-bar-inner {
  height: 100%;
  border-radius: 6px;
  transition: width .3s;
}

.bizhistory-bar-inner.level-0 { background: #ef4444; }
.bizhistory-bar-inner.level-1 { background: #f97316; }
.bizhistory-bar-inner.level-2 { background: #eab308; }
.bizhistory-bar-inner.level-3 { background: #22c55e; }
.bizhistory-bar-inner.level-4 { background: #16a34a; }

.bizhistory-summary {
  color: #94a3b8;
  font-size: 13px;
}