:root{
  --af-bg: #0b1220;
  --af-surface: #0f172a;
  --af-surface-2: #111c33;
  --af-card: #ffffff;
  --af-card-2: #fbfcff;
  --af-border: rgba(15, 23, 42, 0.10);
  --af-border-2: rgba(15, 23, 42, 0.14);
  --af-text: #0f172a;
  --af-muted: rgba(15, 23, 42, 0.70);
  --af-muted-2: rgba(15, 23, 42, 0.55);

  --af-primary: #2563eb;
  --af-primary-2: #4f46e5;
  --af-success: #16a34a;
  --af-warning: #f59e0b;
  --af-danger: #ef4444;

  --af-radius: 18px;
  --af-radius-sm: 12px;

  --af-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  --af-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.af-body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1000px 600px at 20% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
              radial-gradient(800px 500px at 90% 0%, rgba(79, 70, 229, 0.16), transparent 45%),
              #f6f8ff;
  color: var(--af-text);
}

.af-shell{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

/* Collapsed/hidden primary sidebar ("focus" / full-width mode) */
.af-shell.af-shell-collapsed{
  grid-template-columns: 0 1fr;
}

.af-shell.af-shell-collapsed .af-sidebar{
  display: none;
}

.af-shell-no-nav{
  grid-template-columns: 1fr;
}


.af-sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 16px;
  background: linear-gradient(180deg, #0b1220 0%, #0a1020 55%, #080f1c 100%);
  color: rgba(255,255,255,0.92);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.af-brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 8px 8px 4px 8px;
}

.af-brand-link{
  display:flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
  color: rgba(255,255,255,0.95);
}

.af-brand-mark{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: radial-gradient(circle at 20% 20%, rgba(37,99,235,0.95), rgba(79,70,229,0.95));
  box-shadow: 0 10px 18px rgba(0,0,0,0.25);
  flex: 0 0 auto;
}

.af-brand-text{
  font-family: Montserrat, Inter, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.af-icon-btn{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border-radius: 12px;
  padding: 8px 10px;
}

.af-icon-btn:hover{
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.98);
}

.af-nav{
  display:flex;
  flex-direction:column;
  gap: 6px;
  padding: 4px 6px;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

.af-nav-link{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration:none;
  color: rgba(255,255,255,0.86);
  transition: background 120ms ease, color 120ms ease;
}

.af-nav-link i{
  width: 18px;
  text-align:center;
  opacity: 0.95;
}

.af-nav-link span{
  font-weight: 600;
  letter-spacing: 0.1px;
}

.af-nav-link:hover{
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.98);
}

.af-nav-divider{
  height: 1px;
  margin: 10px 10px;
  background: rgba(255,255,255,0.10);
}

.af-badge{
  margin-left: auto;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.86);
}

.af-sidebar-footer{
  margin-top: 16px;
  margin-bottom: 8px;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  flex: 0 0 auto;
  position: static;
  z-index: 0;
  overflow-wrap: anywhere;
}

.af-subtle{
  color: var(--af-muted-2);
  font-size: 13px;
  line-height: 1.45;
}

.af-sidebar .af-subtle{
  color: rgba(255,255,255,0.72);
  white-space: normal;
  overflow-wrap: break-word;
}

.af-main{
  display:flex;
  flex-direction:column;
  min-width: 0;
}

.af-topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 16px 18px;
  background: rgba(246, 248, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,23,42,0.08);
}

.af-topbar-kicker{
  font-size: 12px;
  color: var(--af-muted-2);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.af-topbar-headline{
  font-size: 16px;
  font-weight: 700;
  margin-top: 1px;
}

.af-primary-btn{
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--af-primary) 0%, var(--af-primary-2) 100%);
  border: none;
  box-shadow: 0 10px 16px rgba(37, 99, 235, 0.18);
}

.af-primary-btn:hover{
  filter: brightness(1.03);
}

.af-user-btn{
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid rgba(15,23,42,0.10);
  background: #ffffff;
  border-radius: 14px;
  padding: 8px 12px;
}

.af-user-avatar{
  font-size: 20px;
  color: rgba(15,23,42,0.72);
}

.af-user-name{
  font-weight: 700;
  color: rgba(15,23,42,0.86);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.af-dropdown{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--af-shadow-soft);
}

.af-dropdown-header{
  font-weight: 700;
  color: rgba(15,23,42,0.74);
}

.af-content{
  padding: 18px;
}

.af-footer{
  padding: 14px 18px;
  color: var(--af-muted-2);
  font-size: 12px;
}

.af-card{
  background: var(--af-card);
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius);
  box-shadow: var(--af-shadow-soft);
  overflow: hidden;
}

.af-card-header{
  padding: 18px 18px 14px 18px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(15,23,42,0.07);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.af-card-title{
  font-weight: 800;
  font-size: 16px;
}

.af-card-sub{
  color: var(--af-muted-2);
  font-size: 13px;
  margin-top: 2px;
}

.af-card-accent .af-card-header{
  background: radial-gradient(1000px 380px at 10% 20%, rgba(37,99,235,0.12), transparent 60%),
              radial-gradient(700px 260px at 90% 20%, rgba(79,70,229,0.10), transparent 55%),
              #ffffff;
}

.af-thead th{
  color: rgba(15,23,42,0.62);
  font-weight: 800;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  background: #fbfcff;
}

.table td{
  border-top: 1px solid rgba(15,23,42,0.06);
}

.af-pill{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15px;
}

.af-pill-success{
  background: rgba(22,163,74,0.10);
  color: rgba(22,163,74,1);
  border: 1px solid rgba(22,163,74,0.18);
}

.af-pill-neutral{
  background: rgba(15,23,42,0.06);
  color: rgba(15,23,42,0.70);
  border: 1px solid rgba(15,23,42,0.10);
}

.af-alert{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--af-shadow-soft);
}

.af-empty{
  padding: 34px 18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.af-empty-icon{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(37,99,235,0.10);
  color: rgba(37,99,235,1);
  font-size: 24px;
  margin-bottom: 14px;
}

.af-empty-title{
  font-weight: 900;
  font-size: 16px;
}

.af-empty-sub{
  color: var(--af-muted-2);
  font-size: 13px;
  margin-top: 4px;
  max-width: 520px;
}

.af-label{
  font-weight: 800;
  color: rgba(15,23,42,0.78);
}

.af-input{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.12);
  padding: 10px 12px;
}

.af-input:focus{
  border-color: rgba(37,99,235,0.50);
  box-shadow: 0 0 0 0.25rem rgba(37,99,235,0.12);
}

.af-callout{
  border-radius: 16px;
  padding: 14px 14px;
  border: 1px solid rgba(15,23,42,0.10);
  background: radial-gradient(900px 260px at 10% 10%, rgba(37,99,235,0.10), transparent 60%),
              #fbfcff;
}

.af-callout-title{
  font-weight: 900;
  color: rgba(15,23,42,0.82);
}

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

.af-chip{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(15,23,42,0.10);
  font-size: 12px;
  font-weight: 800;
  color: rgba(15,23,42,0.76);
}

.af-timeline{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.af-timeline-item{
  display:flex;
  gap: 12px;
  align-items:flex-start;
}

.af-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--af-primary), var(--af-primary-2));
  margin-top: 5px;
  flex: 0 0 auto;
  box-shadow: 0 6px 10px rgba(37,99,235,0.18);
}

.af-kpi-grid{
  padding: 16px 18px 18px 18px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.af-kpi{
  border-radius: 16px;
  padding: 12px 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background: #ffffff;
}

.af-kpi-value{
  font-weight: 900;
  font-size: 14px;
}

.af-kpi-label{
  color: var(--af-muted-2);
  font-size: 12px;
  margin-top: 2px;
}

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

.af-mini{
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background: #ffffff;
}

.af-section-title{
  font-weight: 900;
  color: rgba(15,23,42,0.82);
  margin-bottom: 6px;
}

.af-section-body{
  color: rgba(15,23,42,0.82);
  line-height: 1.55;
}

.af-markdown{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.10);
  background: #0b1220;
  color: rgba(255,255,255,0.92);
  padding: 14px;
  overflow: auto;
  box-shadow: var(--af-shadow-soft);
}

.af-markdown pre{
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.af-link{
  text-decoration: none;
  font-weight: 800;
  color: rgba(37,99,235,1);
}

.af-link:hover{
  text-decoration: underline;
}

.af-hero{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
  padding: 24px 8px;
}

.af-hero-inner{
  background: radial-gradient(1000px 460px at 0% 0%, rgba(37,99,235,0.14), transparent 62%),
              radial-gradient(900px 460px at 100% 0%, rgba(79,70,229,0.12), transparent 58%),
              #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 26px;
  padding: 34px;
  box-shadow: var(--af-shadow);
}

.af-hero-badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37,99,235,0.10);
  color: rgba(37,99,235,1);
  font-weight: 900;
  letter-spacing: 0.2px;
}

.af-hero-title{
  font-family: Montserrat, Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 4vw, 50px);
  margin-top: 14px;
}

.af-hero-lead{
  color: rgba(15,23,42,0.70);
  font-size: 16px;
  line-height: 1.65;
  max-width: 680px;
  margin-top: 10px;
}

.af-hero-stats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.af-stat{
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.68);
}

.af-stat-value{
  font-weight: 900;
}

.af-stat-label{
  color: rgba(15,23,42,0.58);
  font-size: 12.5px;
  margin-top: 2px;
  line-height: 1.4;
}

.af-hero-panel{
  border-radius: 26px;
  padding: 0;
}

.af-panel-card{
  height: 100%;
  border-radius: 26px;
  padding: 26px;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, #0b1220, #080f1c);
  color: rgba(255,255,255,0.92);
  box-shadow: var(--af-shadow);
}

.af-panel-title{
  font-weight: 900;
  font-size: 16px;
}

.af-panel-sub{
  color: rgba(255,255,255,0.70);
  font-size: 13px;
  margin-top: 2px;
}

.af-panel-list{
  list-style: none;
  padding: 0;
  margin: 18px 0 0 0;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.af-panel-list li{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  color: rgba(255,255,255,0.86);
}

.af-panel-list i{
  color: rgba(34,197,94,0.95);
  margin-top: 2px;
}

.af-panel-cta{
  margin-top: 18px;
}

.af-auth{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-top: 12px;
}

.af-auth-left{
  border-radius: 26px;
  padding: 26px;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--af-shadow);
}

.af-auth-brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

.af-auth-brand-title{
  font-family: Montserrat, Inter, system-ui, sans-serif;
  font-weight: 800;
}

.af-auth-headline{
  font-family: Montserrat, Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 28px;
  margin-top: 18px;
}

.af-auth-copy{
  color: rgba(15,23,42,0.70);
  margin-top: 8px;
  line-height: 1.6;
}

.af-auth-points{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.af-auth-point{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  color: rgba(15,23,42,0.78);
  font-weight: 700;
}

.af-auth-point i{
  color: rgba(37,99,235,1);
  margin-top: 2px;
}

.af-auth-right{
  display:flex;
  align-items: stretch;
}

.af-auth-card{
  width: 100%;
  border-radius: 26px;
  padding: 26px;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--af-shadow);
}

.af-auth-card-title{
  font-weight: 900;
  font-size: 18px;
}

.af-auth-footer{
  display:flex;
  gap: 8px;
  justify-content:center;
}

@media (max-width: 992px){
  .af-shell{ grid-template-columns: 1fr; }
  .af-sidebar{
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(320px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    transform: translateX(-102%);
    transition: transform 160ms ease;
    z-index: 50;
    padding-bottom: 18px;
  }
  .af-nav{
    overflow: visible;
    flex: 0 0 auto;
    padding-bottom: 0;
  }
  .af-sidebar-footer{
    margin-top: 16px;
    margin-bottom: 12px;
  }
  .af-sidebar.af-open{ transform: translateX(0); }
  .af-topbar{ position: sticky; }
  .af-hero{ grid-template-columns: 1fr; padding: 12px 0; }
  .af-auth{ grid-template-columns: 1fr; }
}




/* =========================================================
   Theme system (default: dark, user-selectable dark/light)
   ========================================================= */
html[data-theme="dark"],
html:not([data-theme]) {
  color-scheme: dark;
}
html[data-theme="light"] {
  color-scheme: light;
}

/* Theme toggle button */
.af-theme-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 700;
  border: 1px solid var(--af-border-2);
  background: var(--af-card);
  color: var(--af-text);
  box-shadow: var(--af-shadow-soft);
}
.af-theme-btn:hover{ filter: brightness(1.03); }
.af-theme-btn .af-theme-icon{ font-size: 0.95rem; }

/* DARK MODE DEFAULT OVERRIDES */
html[data-theme="dark"]{
  --af-bg: #060b16;
  --af-surface: #0b1220;
  --af-surface-2: #101a33;
  --af-card: #111a30;
  --af-card-2: #0f1730;
  --af-border: rgba(255, 255, 255, 0.09);
  --af-border-2: rgba(255, 255, 255, 0.13);
  --af-text: #edf3ff;
  --af-muted: rgba(237,243,255,0.78);
  --af-muted-2: rgba(237,243,255,0.62);
  --af-primary: #6f7dff;
  --af-primary-2: #8b5cf6;
  --af-success: #22c55e;
  --af-warning: #fbbf24;
  --af-danger: #ef4444;
  --af-shadow: 0 14px 34px rgba(0,0,0,.35);
  --af-shadow-soft: 0 10px 24px rgba(0,0,0,.28);

  /* Bootstrap variable alignment for dark theme (fixes bg-body / low-contrast cards) */
  --bs-body-bg: #070d1a;
  --bs-body-color: #edf3ff;
  --bs-border-color: rgba(255,255,255,0.10);
  --bs-secondary-color: rgba(237,243,255,0.70);
  --bs-tertiary-bg: rgba(255,255,255,0.03);
  --bs-card-bg: #111a30;
  --bs-card-color: #edf3ff;
}

html[data-theme="dark"] .af-body{
  background:
    radial-gradient(1100px 700px at 15% -10%, rgba(111, 125, 255, 0.20), transparent 55%),
    radial-gradient(900px 560px at 90% -5%, rgba(139, 92, 246, 0.18), transparent 48%),
    linear-gradient(180deg, #070d1a 0%, #060b16 100%);
  color: var(--af-text);
}

html[data-theme="dark"] .af-sidebar{
  background: linear-gradient(180deg, #070d1a 0%, #060b16 55%, #050914 100%);
  border-right-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .af-nav-link{ color: rgba(237,243,255,0.88); }
html[data-theme="dark"] .af-nav-link:hover{ background: rgba(255,255,255,0.08); color: #fff; }
html[data-theme="dark"] .af-sidebar-footer{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.10);
}
html[data-theme="dark"] .af-sidebar .af-subtle{ color: rgba(237,243,255,0.74); }

html[data-theme="dark"] .af-topbar{
  background: rgba(7, 13, 26, 0.82);
  border-bottom-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .af-topbar-kicker{ color: var(--af-muted-2); }
html[data-theme="dark"] .af-topbar-headline{ color: var(--af-text); }

html[data-theme="dark"] .af-content{ color: var(--af-text); }
html[data-theme="dark"] .af-footer{ color: var(--af-muted-2); }

html[data-theme="dark"] .af-card,
html[data-theme="dark"] .af-kpi,
html[data-theme="dark"] .af-mini,
html[data-theme="dark"] .af-auth-left,
html[data-theme="dark"] .af-auth-card,
html[data-theme="dark"] .af-user-btn,
html[data-theme="dark"] .af-dropdown,
html[data-theme="dark"] .af-alert,
html[data-theme="dark"] .af-callout,
html[data-theme="dark"] .af-hero-inner,
html[data-theme="dark"] .af-stat{
  background: linear-gradient(180deg, var(--af-card), var(--af-card-2));
  color: var(--af-text);
  border-color: var(--af-border);
  box-shadow: var(--af-shadow-soft);
}

html[data-theme="dark"] .af-card-header{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-bottom-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .af-card-accent .af-card-header{
  background:
    radial-gradient(1000px 380px at 10% 20%, rgba(111,125,255,0.18), transparent 60%),
    radial-gradient(700px 260px at 90% 20%, rgba(139,92,246,0.14), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
}

html[data-theme="dark"] .af-card-title,
html[data-theme="dark"] .af-section-title,
html[data-theme="dark"] .af-empty-title,
html[data-theme="dark"] .af-label,
html[data-theme="dark"] .af-auth-card-title,
html[data-theme="dark"] .af-auth-headline,
html[data-theme="dark"] .af-auth-brand-title,
html[data-theme="dark"] .af-callout-title,
html[data-theme="dark"] .af-topbar-headline,
html[data-theme="dark"] .af-user-name{ color: var(--af-text); }

html[data-theme="dark"] .af-card-sub,
html[data-theme="dark"] .af-empty-sub,
html[data-theme="dark"] .af-kpi-label,
html[data-theme="dark"] .af-section-body,
html[data-theme="dark"] .af-hero-lead,
html[data-theme="dark"] .af-auth-copy,
html[data-theme="dark"] .af-stat-label,
html[data-theme="dark"] .af-dropdown-header,
html[data-theme="dark"] .af-subtle{ color: var(--af-muted-2) !important; }

html[data-theme="dark"] .af-auth-point{ color: rgba(237,243,255,0.88); }
html[data-theme="dark"] .af-chip{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.10);
  color: rgba(237,243,255,.90);
}
html[data-theme="dark"] .af-pill-neutral{
  background: rgba(255,255,255,0.06);
  color: rgba(237,243,255,.86);
  border-color: rgba(255,255,255,0.10);
}

html[data-theme="dark"] .af-thead th{
  background: #0d152a;
  color: rgba(237,243,255,.78);
  border-bottom-color: rgba(255,255,255,.08);
}
html[data-theme="dark"] .table{
  --bs-table-bg: transparent;
  --bs-table-color: var(--af-text);
  --bs-table-border-color: rgba(255,255,255,.08);
  color: var(--af-text);
}
html[data-theme="dark"] .table td{ border-top-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .table > :not(caption) > * > *{
  background-color: transparent;
  color: inherit;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .af-input{
  background: #0c1429;
  color: var(--af-text);
  border-color: rgba(255,255,255,.12);
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color: rgba(237,243,255,.45);
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .af-input:focus{
  background: #0f1831;
  color: var(--af-text);
  border-color: rgba(111,125,255,.60);
  box-shadow: 0 0 0 0.25rem rgba(111,125,255,.15);
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-dark{
  color: var(--af-text);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
}
html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-dark:hover{
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.22);
}
html[data-theme="dark"] .btn-secondary{
  background: #243458;
  border-color: #2d3f69;
}
html[data-theme="dark"] .btn-light{
  background: rgba(255,255,255,.08);
  color: var(--af-text);
  border-color: rgba(255,255,255,.14);
}
html[data-theme="dark"] .btn-link{ color: #b6cbff; }

html[data-theme="dark"] .dropdown-menu{
  background: #10182e;
  border-color: rgba(255,255,255,.10);
  color: var(--af-text);
}
html[data-theme="dark"] .dropdown-item{ color: rgba(237,243,255,.92); }
html[data-theme="dark"] .dropdown-item:hover{
  background: rgba(255,255,255,.06);
  color: #fff;
}
html[data-theme="dark"] .dropdown-divider{ border-top-color: rgba(255,255,255,.08); }

/* Bootstrap generic cards/alerts */
html[data-theme="dark"] .card{
  background: linear-gradient(180deg, #111a30, #0f1730);
  color: var(--af-text);
  border-color: rgba(255,255,255,.10);
}
html[data-theme="dark"] .card-header{
  background: rgba(255,255,255,.03);
  border-bottom-color: rgba(255,255,255,.07);
}
html[data-theme="dark"] .alert-success{
  background: rgba(34,197,94,.12);
  color: #bbf7d0;
  border-color: rgba(34,197,94,.20);
}
html[data-theme="dark"] .alert-danger{
  background: rgba(239,68,68,.12);
  color: #fecaca;
  border-color: rgba(239,68,68,.20);
}
html[data-theme="dark"] .alert-warning{
  background: rgba(251,191,36,.12);
  color: #fde68a;
  border-color: rgba(251,191,36,.20);
}
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-body-secondary{ color: var(--af-muted-2) !important; }

/* Run Pod workspace readability + theme variables (works with inline view CSS) */
html[data-theme="dark"] .af-run-shell{
  --bg0:#050913 !important;
  --bg1:#0a1328 !important;
  --bg2:#132347 !important;
  --card:#101a32 !important;
  --card2:#0d162d !important;
  --line:rgba(255,255,255,.12) !important;
  --muted:#c5d2ea !important;
  --text:#f2f6ff !important;
  --accent:#7d64ff !important;
  --accent2:#25d0ae !important;
  --warn:#f6c84c !important;
  --danger:#ff7777 !important;
  --shadow:0 20px 48px rgba(0,0,0,.34) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .af-run-shell .cardx{
  background: linear-gradient(180deg, rgba(16,26,50,.98), rgba(11,19,38,.98)) !important;
  border-color: rgba(255,255,255,.12) !important;
}
html[data-theme="dark"] .af-run-shell .text-light-emphasis{ color: var(--muted) !important; }
html[data-theme="dark"] .af-run-shell .af-chat-feed{ background: rgba(255,255,255,.03); }
html[data-theme="dark"] .af-run-shell .af-chat-msg{ border-color: rgba(255,255,255,.09); }

/* LIGHT MODE explicit overrides */
html[data-theme="light"] .af-body{
  background: radial-gradient(1000px 600px at 20% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
              radial-gradient(800px 500px at 90% 0%, rgba(79, 70, 229, 0.16), transparent 45%),
              #f6f8ff;
  color: #0f172a;
}
html[data-theme="light"] .af-theme-btn{
  background: #fff;
  color: #0f172a;
  border-color: rgba(15,23,42,0.12);
}
html[data-theme="light"] .af-run-shell{
  --bg0:#f5f8ff !important;
  --bg1:#eef3ff !important;
  --bg2:#dfe8ff !important;
  --card:#ffffff !important;
  --card2:#f9fbff !important;
  --line:rgba(15,23,42,.09) !important;
  --muted:#52627f !important;
  --text:#0f172a !important;
  --accent:#6d5efc !important;
  --accent2:#14b8a6 !important;
  --warn:#b58100 !important;
  --danger:#d63d3d !important;
  --shadow:0 12px 26px rgba(15,23,42,.10) !important;
  border-color: rgba(15,23,42,.08) !important;
  box-shadow: 0 10px 28px rgba(15,23,42,.08) !important;
  background:
    radial-gradient(900px 340px at 10% -6%, rgba(124,92,255,.10), transparent 60%),
    radial-gradient(780px 300px at 92% -12%, rgba(32,201,151,.06), transparent 64%),
    linear-gradient(180deg, #f7f9ff, #f2f6ff) !important;
}
html[data-theme="light"] .af-run-shell .cardx{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.98)) !important;
  border-color: rgba(15,23,42,.08) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .af-run-shell .text-light-emphasis{ color: #5b6d8d !important; }
html[data-theme="light"] .af-run-shell a{ color: #305fdd !important; }

/* Agent Studio Wizard UX refresh (v45.1)
   Keeps the existing Agent Studio contract fields while making the surface guided,
   scannable, and usable for non-developer builders. */
.af-studio-wizard{
  --studio-ink: rgba(15,23,42,0.92);
  --studio-muted: rgba(15,23,42,0.62);
}

.af-studio-hero{
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 26px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 24px;
  color: #fff;
  background:
    radial-gradient(900px 460px at 12% 0%, rgba(96,165,250,0.35), transparent 58%),
    radial-gradient(700px 400px at 100% 0%, rgba(168,85,247,0.32), transparent 52%),
    linear-gradient(135deg, #0b1220 0%, #172554 55%, #312e81 100%);
  box-shadow: 0 24px 55px rgba(15,23,42,0.20);
}

.af-studio-hero:after{
  content:"";
  position:absolute;
  right:-80px;
  bottom:-110px;
  width:320px;
  height:320px;
  border-radius:999px;
  border: 54px solid rgba(255,255,255,0.06);
  pointer-events:none;
}

.af-studio-hero-copy,
.af-studio-hero-actions{
  position: relative;
  z-index: 1;
}

.af-eyebrow{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.88);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.af-studio-hero h1{
  margin: 14px 0 8px 0;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.af-studio-hero p{
  max-width: 820px;
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-size: 16px;
  line-height: 1.6;
}

.af-studio-hero-actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  min-width: 280px;
}

.af-soft-btn{
  color: #0f172a;
  font-weight: 800;
}

.af-hero-pills{
  display:flex;
  flex-wrap:wrap;
  gap: 9px;
  margin-top: 18px;
}

.af-hero-pills span{
  display:inline-flex;
  align-items:center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.84);
  font-size: 12px;
  font-weight: 800;
}

.af-wizard-shell{
  display:grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 18px;
  align-items:start;
}

.af-wizard-rail{
  position: sticky;
  top: 88px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.af-wizard-steps,
.af-studio-preview,
.af-form-card,
.af-helper-card,
.af-submit-bar,
.af-details{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.08);
}

.af-wizard-steps{
  padding: 10px;
}

.af-wizard-step{
  width: 100%;
  display:flex;
  align-items:center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: rgba(15,23,42,0.68);
  text-align:left;
  border-radius: 16px;
  padding: 11px 12px;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.af-wizard-step:hover{
  background: rgba(37,99,235,0.07);
  color: rgba(15,23,42,0.90);
}

.af-wizard-step.is-active{
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(79,70,229,0.10));
  color: rgba(15,23,42,0.95);
}

.af-wizard-step.is-complete .af-step-index{
  background: rgba(22,163,74,0.14);
  color: rgb(22,101,52);
  border-color: rgba(22,163,74,0.24);
}

.af-step-index{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  border: 1px solid rgba(15,23,42,0.12);
  background: #fff;
  color: rgba(37,99,235,0.95);
  font-weight: 900;
}

.af-wizard-step strong{
  display:block;
  font-size: 13px;
  line-height: 1.15;
}

.af-wizard-step small{
  display:block;
  color: rgba(15,23,42,0.48);
  font-size: 11px;
  margin-top: 2px;
}

.af-studio-preview{
  padding: 16px;
}

.af-preview-title{
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.af-studio-preview dl{
  display:grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0 0 13px 0;
}

.af-studio-preview dt{
  color: rgba(15,23,42,0.50);
  font-size: 12px;
  font-weight: 800;
}

.af-studio-preview dd{
  margin: 0;
  color: rgba(15,23,42,0.86);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap:anywhere;
}

.af-readiness-meter{
  height: 9px;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  overflow:hidden;
}

.af-readiness-bar{
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #4f46e5, #16a34a);
  transition: width 180ms ease;
}

.af-readiness-text,
.af-field-hint{
  color: rgba(15,23,42,0.55);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 9px;
}

.af-wizard-panel-wrap{
  min-width: 0;
}

.af-wizard-panel{
  display:none;
  animation: afWizardIn 180ms ease both;
}

.af-wizard-panel.is-active{
  display:block;
}

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

.af-section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.af-section-heading h2{
  font-weight: 900;
  letter-spacing: -0.025em;
  font-size: clamp(23px, 2vw, 30px);
  margin: 2px 0 4px 0;
}

.af-section-heading p{
  color: rgba(15,23,42,0.58);
  margin: 0;
  max-width: 760px;
  line-height: 1.55;
}

.af-section-kicker{
  color: rgba(37,99,235,0.92);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.45px;
}

.af-form-card,
.af-helper-card{
  padding: 18px;
}

.af-helper-title{
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 6px;
}

.af-helper-card p{
  color: rgba(15,23,42,0.58);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.af-large-textarea{
  min-height: 300px;
}

.af-template-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.af-template-card{
  border: 1px solid rgba(15,23,42,0.10);
  background: linear-gradient(180deg, #fff, #fbfcff);
  border-radius: 16px;
  padding: 11px 12px;
  text-align:left;
  transition: border 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.af-template-card:hover,
.af-template-card.is-selected{
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 10px 20px rgba(37,99,235,0.11);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(37,99,235,0.07), #fff);
}

.af-template-card strong{
  display:block;
  color: rgba(15,23,42,0.88);
  font-size: 13px;
}

.af-template-card small{
  display:block;
  color: rgba(15,23,42,0.52);
  margin-top: 2px;
}

.af-details{
  padding: 0;
  overflow:hidden;
}

.af-details > summary{
  list-style:none;
  cursor:pointer;
  padding: 15px 18px;
  font-weight: 900;
  color: rgba(15,23,42,0.84);
  border-bottom: 1px solid rgba(15,23,42,0.07);
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.af-details > summary::-webkit-details-marker{
  display:none;
}

.af-details > summary:after{
  content:"▾";
  float:right;
  color: rgba(15,23,42,0.42);
}

.af-details:not([open]) > summary{
  border-bottom: 0;
}

.af-details:not([open]) > summary:after{
  content:"▸";
}

.af-details > .row,
.af-details > div{
  padding: 0 18px 18px 18px;
}

.af-submit-bar{
  padding: 16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.af-wizard-nav{
  position: sticky;
  bottom: 12px;
  z-index: 15;
  margin-top: 18px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 36px rgba(15,23,42,0.12);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.af-wizard-progress{
  color: rgba(15,23,42,0.58);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1180px){
  .af-wizard-shell{
    grid-template-columns: 1fr;
  }

  .af-wizard-rail{
    position: static;
  }

  .af-wizard-steps{
    display:grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .af-wizard-step{
    flex-direction:column;
    align-items:flex-start;
    min-height: 96px;
  }

  .af-studio-preview dl{
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .af-studio-preview dt{
    grid-row: 1;
  }

  .af-studio-preview dd{
    grid-row: 2;
  }
}

@media (max-width: 760px){
  .af-studio-hero{
    flex-direction:column;
    padding: 20px;
  }

  .af-studio-hero-actions{
    min-width: 0;
    width: 100%;
    justify-content:flex-start;
  }

  .af-wizard-steps{
    grid-template-columns: 1fr;
  }

  .af-wizard-step{
    min-height: auto;
    flex-direction:row;
  }

  .af-studio-preview dl{
    grid-template-columns: 92px 1fr;
  }

  .af-studio-preview dt,
  .af-studio-preview dd{
    grid-row: auto;
  }

  .af-section-heading,
  .af-submit-bar,
  .af-wizard-nav{
    flex-direction:column;
    align-items:stretch;
  }
}

html[data-theme="dark"] .af-studio-wizard{
  --studio-ink: rgba(255,255,255,0.92);
  --studio-muted: rgba(255,255,255,0.62);
}

html[data-theme="dark"] .af-wizard-steps,
html[data-theme="dark"] .af-studio-preview,
html[data-theme="dark"] .af-form-card,
html[data-theme="dark"] .af-helper-card,
html[data-theme="dark"] .af-submit-bar,
html[data-theme="dark"] .af-details,
html[data-theme="dark"] .af-wizard-nav{
  background: rgba(17,26,48,0.92);
  border-color: rgba(255,255,255,0.10);
}

html[data-theme="dark"] .af-wizard-step{
  color: rgba(255,255,255,0.72);
}

html[data-theme="dark"] .af-wizard-step:hover,
html[data-theme="dark"] .af-wizard-step.is-active{
  background: rgba(96,165,250,0.12);
  color: rgba(255,255,255,0.94);
}

html[data-theme="dark"] .af-step-index,
html[data-theme="dark"] .af-template-card,
html[data-theme="dark"] .af-details > summary{
  background: rgba(15,23,42,0.75);
  color: rgba(255,255,255,0.88);
  border-color: rgba(255,255,255,0.12);
}

html[data-theme="dark"] .af-wizard-step small,
html[data-theme="dark"] .af-studio-preview dt,
html[data-theme="dark"] .af-field-hint,
html[data-theme="dark"] .af-readiness-text,
html[data-theme="dark"] .af-helper-card p,
html[data-theme="dark"] .af-section-heading p,
html[data-theme="dark"] .af-template-card small,
html[data-theme="dark"] .af-wizard-progress{
  color: rgba(255,255,255,0.58);
}

html[data-theme="dark"] .af-studio-preview dd,
html[data-theme="dark"] .af-template-card strong,
html[data-theme="dark"] .af-details > summary,
html[data-theme="dark"] .af-helper-title,
html[data-theme="dark"] .af-section-heading h2,
html[data-theme="dark"] .af-submit-bar strong{
  color: rgba(255,255,255,0.90);
}

.af-studio-wizard .validation-summary-valid{
  display:none;
}

/* Agent Studio prompt import */
.af-prompt-import-card{
  border: 1px solid rgba(37,99,235,0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
  box-shadow: 0 18px 42px rgba(15,23,42,0.08);
  padding: 18px;
}

.af-prompt-import-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.af-prompt-import-head h3{
  margin: 2px 0 5px 0;
  font-size: 20px;
  font-weight: 900;
  color: rgba(15,23,42,0.90);
}

.af-prompt-import-head p{
  margin: 0;
  color: rgba(15,23,42,0.60);
  max-width: 820px;
  line-height: 1.5;
}

.af-prompt-import-actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.af-import-btn{
  border-radius: 999px;
  font-weight: 850;
  padding-inline: 18px;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(22,163,74,0.18);
}

.af-prompt-enhanced-card{
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid rgba(22,163,74,0.18);
  background: rgba(255,255,255,0.76);
  padding: 16px;
}

.af-prompt-enhanced-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.af-prompt-enhanced-head h3{
  margin: 2px 0 4px 0;
  font-size: 17px;
  font-weight: 850;
  color: rgba(15,23,42,0.88);
}

.af-prompt-enhanced-head p,
.af-prompt-enhanced-summary{
  color: rgba(15,23,42,0.64);
  line-height: 1.55;
}

.af-prompt-enhanced-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  justify-content:flex-end;
}

.af-import-textarea{
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.af-import-options{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
  margin-top: 12px;
  color: rgba(15,23,42,0.58);
  font-size: 13px;
  font-weight: 700;
}

html[data-theme="dark"] .af-prompt-import-card{
  background:
    radial-gradient(circle at top left, rgba(96,165,250,0.16), transparent 34%),
    rgba(17,26,48,0.92);
  border-color: rgba(96,165,250,0.20);
}

html[data-theme="dark"] .af-prompt-import-head h3{
  color: rgba(255,255,255,0.92);
}

html[data-theme="dark"] .af-prompt-import-head p,
html[data-theme="dark"] .af-import-options,
html[data-theme="dark"] .af-prompt-enhanced-head p,
html[data-theme="dark"] .af-prompt-enhanced-summary{
  color: rgba(255,255,255,0.60);
}

html[data-theme="dark"] .af-prompt-enhanced-card{
  background: rgba(15,23,42,0.32);
  border-color: rgba(74,222,128,0.24);
}

html[data-theme="dark"] .af-prompt-enhanced-head h3{
  color: rgba(255,255,255,0.92);
}

@media (max-width: 760px){
  .af-prompt-import-head,
  .af-prompt-enhanced-head{
    flex-direction:column;
  }

  .af-prompt-import-actions{
    width: 100%;
  }

  .af-import-btn{
    width: 100%;
  }
}


/* Global animated waiting/progress card used by Work Order Create and Agent Studio generation flows */
.af-wait-overlay{
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(760px 420px at 28% 22%, rgba(99,102,241,0.20), transparent 62%),
    radial-gradient(760px 420px at 72% 72%, rgba(236,72,153,0.20), transparent 60%),
    rgba(5,8,18,0.68);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.af-wait-overlay.is-visible{
  opacity: 1;
  pointer-events: auto;
}

body.af-waiting{
  cursor: progress;
}

.af-wait-card{
  width: min(820px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,0.18);
  background:
    radial-gradient(circle at 6% 12%, rgba(168,85,247,0.20), transparent 25%),
    radial-gradient(circle at 72% 4%, rgba(59,130,246,0.12), transparent 30%),
    linear-gradient(180deg, rgba(15,23,42,0.96), rgba(8,13,28,0.96));
  color: rgba(255,255,255,0.94);
  box-shadow: 0 34px 90px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 24px 28px 24px;
  transform: translateY(10px) scale(0.985);
  transition: transform 200ms ease;
  overflow: hidden;
  position: relative;
}

.af-wait-overlay.is-visible .af-wait-card{
  transform: translateY(0) scale(1);
}

.af-wait-card::before{
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.07) 42%, rgba(255,255,255,0.16) 50%, rgba(255,255,255,0.07) 58%, transparent 100%);
  transform: translateX(-72%);
  animation: afWaitShimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}

.af-wait-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.af-wait-badge{
  display:inline-flex;
  align-items:center;
  gap: 9px;
  border: 1px solid rgba(129,140,248,0.40);
  background: rgba(99,102,241,0.18);
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 900;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.af-wait-pulse{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #f472b6 70%);
  box-shadow: 0 0 0 rgba(244,114,182,0.7);
  animation: afWaitPulse 1.4s infinite;
}

.af-wait-status{
  font-weight: 900;
  color: rgba(226,232,240,0.92);
  font-size: 14px;
}

.af-wait-card h2{
  position: relative;
  z-index: 1;
  margin: 18px 0 8px 0;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 950;
  letter-spacing: -0.03em;
}

.af-wait-card p{
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(226,232,240,0.86);
  font-size: 16px;
  line-height: 1.55;
}

.af-wait-progress{
  position: relative;
  z-index: 1;
  height: 11px;
  border-radius: 999px;
  background: rgba(148,163,184,0.18);
  overflow: hidden;
  margin: 18px 0 12px;
}

.af-wait-progress-fill{
  position:absolute;
  inset: 0 auto 0 0;
  width: 48%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c084fc, #ec4899, #f97316);
  animation: afWaitProgress 2.2s ease-in-out infinite;
}

.af-wait-message{
  position: relative;
  z-index: 1;
  min-height: 22px;
  color: rgba(226,232,240,0.74);
  font-size: 13px;
  font-weight: 750;
}

.af-wait-tip{
  position: relative;
  z-index: 1;
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148,163,184,0.14);
}

.af-wait-tip span{
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255,255,255,0.08);
  color: rgba(226,232,240,0.88);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight: 900;
}

.af-wait-tip strong{
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255,255,255,0.92);
}

.af-submit-loading{
  position: relative;
  opacity: 0.78;
}

.af-submit-loading::after{
  content: "";
  display:inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.55em;
  vertical-align: -0.1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: afSpin 700ms linear infinite;
}

@keyframes afWaitPulse{
  0% { box-shadow: 0 0 0 0 rgba(244,114,182,0.62); transform: scale(1); }
  70% { box-shadow: 0 0 0 10px rgba(244,114,182,0); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 0 rgba(244,114,182,0); transform: scale(1); }
}

@keyframes afWaitProgress{
  0% { transform: translateX(-18%); width: 32%; }
  45% { width: 62%; }
  100% { transform: translateX(190%); width: 36%; }
}

@keyframes afWaitShimmer{
  0%, 42% { transform: translateX(-75%); opacity: 0; }
  50% { opacity: 1; }
  70%, 100% { transform: translateX(75%); opacity: 0; }
}

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

@media (max-width: 640px){
  .af-wait-card{
    padding: 20px;
    border-radius: 20px;
  }

  .af-wait-card-top,
  .af-wait-tip{
    align-items:flex-start;
    flex-direction:column;
  }
}

@media (prefers-reduced-motion: reduce){
  .af-wait-card::before,
  .af-wait-pulse,
  .af-wait-progress-fill,
  .af-submit-loading::after{
    animation: none;
  }
}


/* Agent Studio v53 refinements */
.af-registry-filter-card{
  background: radial-gradient(900px 280px at 0% 0%, rgba(37,99,235,0.10), transparent 60%), #ffffff;
}

.af-pill-info{
  background: rgba(37,99,235,0.10);
  color: rgba(37,99,235,1);
  border: 1px solid rgba(37,99,235,0.18);
}

.af-pill-warning{
  background: rgba(245,158,11,0.12);
  color: #92400e;
  border: 1px solid rgba(245,158,11,0.24);
}

.af-registry-score .af-readiness-meter{
  height: 8px;
  background: rgba(15,23,42,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.af-registry-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.af-chip.is-on{
  background: rgba(37,99,235,0.10);
  border-color: rgba(37,99,235,0.20);
  color: rgba(37,99,235,1);
}

/* V60 Agent Studio control-plane additions */
.af-code-block {
    display: block;
    max-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    padding: 1rem;
    color: #dbeafe;
}

.af-template-card span{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:7px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
  color:#2563eb;
}

.af-template-card span::after{
  content:"→";
  font-size:12px;
}

html[data-theme="dark"] .af-template-card span{
  color:#93c5fd;
}


/* V63 Quick Starter clarification dialogue */
.af-quick-clarifier{
  display:none;
  margin-top:1rem;
  padding:1rem;
  border:1px solid rgba(37,99,235,.18);
  border-radius:20px;
  background:linear-gradient(180deg, rgba(239,246,255,.96), rgba(255,255,255,.98));
  box-shadow:0 18px 42px rgba(15,23,42,.10);
}

.af-quick-clarifier.is-visible{
  display:block;
  animation:afQuickClarifierIn .22s ease-out;
}

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

.af-quick-chat-head{
  display:flex;
  gap:.75rem;
  align-items:center;
  margin-bottom:.75rem;
}

.af-quick-chat-head strong{
  display:block;
  color:#0f172a;
}

.af-quick-chat-head small{
  display:block;
  color:#64748b;
  line-height:1.3;
}

.af-quick-avatar{
  width:38px;
  height:38px;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  background:linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow:0 10px 24px rgba(37,99,235,.25);
}

.af-quick-chat-bubble{
  border-radius:16px;
  padding:.85rem;
  background:#fff;
  border:1px solid rgba(148,163,184,.22);
  color:#334155;
  font-size:.92rem;
}

.af-quick-chat-bubble ol{
  padding-left:1.1rem;
}

.af-default-note{
  color:#475569;
}

.af-quick-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:.6rem;
  margin-top:.85rem;
}

html[data-theme="dark"] .af-quick-clarifier{
  background:linear-gradient(180deg, rgba(15,23,42,.96), rgba(2,6,23,.98));
  border-color:rgba(96,165,250,.28);
}

html[data-theme="dark"] .af-quick-chat-head strong{
  color:#e5e7eb;
}

html[data-theme="dark"] .af-quick-chat-head small,
html[data-theme="dark"] .af-default-note{
  color:#94a3b8;
}

html[data-theme="dark"] .af-quick-chat-bubble{
  background:rgba(15,23,42,.86);
  border-color:rgba(148,163,184,.2);
  color:#cbd5e1;
}

/* V66 unified Agent Studio: soft-deleted agents stay out of the active workspace but remain visible in the governance view. */
.af-pill-danger{
  background: rgba(220,38,38,0.10);
  color: rgba(185,28,28,1);
  border: 1px solid rgba(220,38,38,0.22);
}

.af-deleted-agent-card{
  opacity: 0.86;
  border-style: dashed;
}

/* V77 Agent Resume / CV Foundation */
.af-prewrap {
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    padding: .85rem 1rem;
    color: inherit;
    font-family: inherit;
    line-height: 1.55;
}
html[data-theme='light'] .af-prewrap {
    background: rgba(15,23,42,.035);
    border-color: rgba(15,23,42,.10);
}

/* V92 Agent Studio score drilldowns */
.af-score-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: flex-start;
}
.af-score-chip {
    position: relative;
}
.af-score-chip > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.af-score-chip > summary::-webkit-details-marker { display: none; }
.af-score-chip > summary::after {
    content: "▾";
    font-size: .7rem;
    opacity: .8;
    margin-left: .15rem;
}
.af-score-chip[open] > summary::after { content: "▴"; }
.af-score-drilldown-card {
    position: absolute;
    z-index: 30;
    top: calc(100% + .45rem);
    left: 0;
    width: min(380px, calc(100vw - 2rem));
    padding: .85rem .95rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(18, 29, 58, .98), rgba(10, 17, 39, .98));
    border: 1px solid rgba(124, 92, 255, .26);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
    color: #edf3ff;
}
.af-score-drilldown-card .title {
    font-weight: 800;
    margin-bottom: .25rem;
}
.af-score-drilldown-card .sub {
    color: rgba(225, 235, 255, .78);
    font-size: .83rem;
    line-height: 1.35;
}
.af-score-drilldown-card ul {
    margin: .55rem 0 0;
    padding-left: 1.1rem;
    font-size: .82rem;
    color: rgba(237, 243, 255, .92);
}
.af-score-drilldown-card li + li { margin-top: .18rem; }
.af-score-panel {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
    padding: 1rem;
}
.af-score-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .8rem;
}
.af-score-panel-block {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: .8rem;
    background: rgba(255,255,255,.035);
}
.af-score-panel-block h4 {
    font-size: .95rem;
    margin: 0 0 .4rem 0;
}
.af-score-panel-block .mini {
    color: rgba(225,235,255,.78);
    font-size: .8rem;
    line-height: 1.35;
}
.af-score-signal-list {
    margin: .55rem 0 0;
    padding-left: 1.05rem;
    font-size: .82rem;
}
.af-score-signal-list li + li { margin-top: .18rem; }
.af-score-signal-list .ok { color: #77e7c1; }
.af-score-signal-list .warn { color: #ffdc7f; }
@media (max-width: 700px) {
    .af-score-drilldown-card {
        position: static;
        margin-top: .45rem;
        width: 100%;
    }
}

/* V96/V97 publish channels and automation flow designer */
.af-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .75rem;
}
.af-channel-card {
    border: 1px solid rgba(120, 160, 255, .22);
    border-radius: 18px;
    padding: .85rem;
    background: linear-gradient(135deg, rgba(79,70,229,.18), rgba(14,165,233,.10));
    min-height: 118px;
    cursor: pointer;
    display: grid;
    gap: .35rem;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.af-channel-card:hover { transform: translateY(-2px); border-color: rgba(129, 140, 248, .55); box-shadow: 0 18px 55px rgba(37,99,235,.18); }
.af-channel-card input { width: 18px; height: 18px; accent-color: #7c3aed; }
.af-channel-card .title { font-weight: 800; color: #eef4ff; }
.af-channel-card .sub { font-size: .78rem; color: rgba(220,230,255,.72); line-height: 1.35; }
.af-flow-designer {
    border: 1px solid rgba(129, 140, 248, .18);
    background: radial-gradient(circle at top left, rgba(124,58,237,.18), transparent 34%), linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.68));
}
.af-flow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .8rem;
}
.af-flow-template {
    color: #eef4ff;
    text-align: left;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37,99,235,.20), rgba(124,58,237,.14));
    padding: .95rem;
    display: grid;
    gap: .35rem;
    min-height: 136px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.af-flow-template:hover, .af-flow-template.active { transform: translateY(-2px); border-color: rgba(96,165,250,.58); box-shadow: 0 18px 50px rgba(59,130,246,.20); }
.af-flow-template .num {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: rgba(255,255,255,.12);
}
.af-flow-template strong { font-size: 1rem; }
.af-flow-template small { color: rgba(226,232,240,.75); line-height: 1.4; }
.af-flow-runtime {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}
.af-flow-runtime span {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    padding: .52rem .75rem;
    background: rgba(255,255,255,.055);
    font-weight: 750;
    color: #eaf2ff;
}
.af-flow-runtime i { color: #93c5fd; }

/* V98 Agent Sources & Grounding */
.af-source-grounding-panel {
    background: radial-gradient(circle at top left, rgba(20,184,166,.16), transparent 34%), linear-gradient(180deg, rgba(15,23,42,.94), rgba(15,23,42,.74));
    border: 1px solid rgba(45, 212, 191, .18);
}
.af-source-policy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 1rem;
    align-items: stretch;
}
.af-source-policy-main,
.af-source-toggle-stack,
.af-source-add-form,
.af-source-card {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: rgba(15, 23, 42, .62);
    padding: 1rem;
}
.af-source-toggle-stack {
    display: grid;
    gap: .65rem;
}
.af-source-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    padding: .72rem .8rem;
    background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(20,184,166,.09));
}
.af-source-toggle strong { display:block; color:#eff6ff; font-size:.9rem; }
.af-source-toggle small { display:block; color:rgba(226,232,240,.68); line-height:1.25; margin-top:.15rem; }
.af-source-toggle input { width: 42px; height: 22px; accent-color: #14b8a6; }
.af-source-card {
    background: linear-gradient(145deg, rgba(30,41,59,.78), rgba(15,23,42,.72));
    box-shadow: 0 18px 55px rgba(2,6,23,.20);
}
.af-source-add-form h4 { color:#e0f2fe; font-weight:800; }
@media (max-width: 900px) {
    .af-source-policy-grid { grid-template-columns: 1fr; }
}


/* V100 Enterprise Readiness */
.af-metric-tile {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1rem;
    padding: 0.9rem;
    background: rgba(15, 23, 42, 0.28);
}

[data-theme="light"] .af-metric-tile {
    background: rgba(248, 250, 252, 0.9);
}

.af-code-panel {
    white-space: pre-wrap;
    overflow: auto;
    max-height: 360px;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.55);
    color: var(--af-text, #e5e7eb);
    font-size: 0.85rem;
}

[data-theme="light"] .af-code-panel {
    background: #f8fafc;
    color: #0f172a;
}

/* V101 Agent Experience Builder + Add Knowledge starter */
.af-agent-experience-panel {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.09), rgba(79, 70, 229, 0.08)), #fff;
    border: 1px solid rgba(14, 116, 144, 0.16);
}

.af-experience-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
    gap: 1rem;
    align-items: stretch;
}

.af-experience-copy,
.af-experience-actions {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, .72);
}

.af-experience-actions {
    display: grid;
    gap: .65rem;
    align-content: start;
}

.af-connector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: .75rem;
}

.af-connector-card {
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 1rem;
    padding: .85rem;
    background: #fff;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.af-connector-card i {
    font-size: 1.35rem;
    color: #2563eb;
}

.af-connector-card strong {
    color: #0f172a;
}

.af-connector-card span {
    color: #64748b;
    font-size: .82rem;
    line-height: 1.35;
}

.af-connector-card.planned {
    background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 8px, #f1f5f9 8px, #f1f5f9 16px);
    opacity: .88;
}

.af-connector-card.planned i {
    color: #64748b;
}

@media (max-width: 992px) {
    .af-experience-grid {
        grid-template-columns: 1fr;
    }
}


/* V113 Agent Details: profile-aware self chat with explicit contrast */
.af-agent-self-chat-panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96)) !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
}

.af-agent-self-chat-panel h3,
.af-agent-self-chat-panel strong,
.af-agent-self-chat-panel .h5 {
    color: #ffffff !important;
}

.af-agent-self-chat-muted,
.af-agent-self-chat-note {
    color: #cbd5e1 !important;
}

.af-agent-self-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr);
    gap: 1rem;
    align-items: stretch;
}

.af-agent-self-chat-main,
.af-agent-self-chat-prompts,
.af-agent-knowledge-preview {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1rem;
    background: rgba(2, 6, 23, 0.42);
    padding: 1rem;
}

.af-agent-self-chat-feed {
    min-height: 230px;
    max-height: 360px;
    overflow: auto;
    padding: .85rem;
    border-radius: .9rem;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.af-agent-chat-message {
    max-width: 92%;
    padding: .75rem .85rem;
    border-radius: .9rem;
    margin-bottom: .65rem;
    white-space: pre-wrap;
    line-height: 1.45;
    color: #f8fafc;
}

.af-agent-chat-message-bot {
    background: rgba(30, 41, 59, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.af-agent-chat-message-user {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(124, 58, 237, 0.98));
    border: 1px solid rgba(191, 219, 254, 0.18);
}

.af-agent-self-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
}

.af-agent-self-chat-form .af-input {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.34) !important;
    color: #f8fafc !important;
}

.af-agent-self-chat-form .af-input::placeholder {
    color: #94a3b8 !important;
}

.af-agent-prompt-chip {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(147, 197, 253, 0.28);
    background: rgba(30, 64, 175, 0.22);
    color: #eff6ff;
    border-radius: .85rem;
    padding: .72rem .8rem;
    font-weight: 700;
    margin-bottom: .55rem;
}

.af-agent-prompt-chip:hover,
.af-agent-prompt-chip:focus {
    background: rgba(37, 99, 235, 0.42);
    color: #ffffff;
    outline: none;
}

.af-agent-knowledge-preview {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    background: rgba(8, 47, 73, 0.38);
}

.af-agent-knowledge-preview,
.af-agent-knowledge-preview .small {
    color: #dbeafe !important;
}

.af-agent-knowledge-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

[data-theme="light"] .af-agent-self-chat-panel {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
}

[data-theme="light"] .af-agent-self-chat-panel h3,
[data-theme="light"] .af-agent-self-chat-panel strong,
[data-theme="light"] .af-agent-self-chat-panel .h5 {
    color: #0f172a !important;
}

[data-theme="light"] .af-agent-self-chat-muted,
[data-theme="light"] .af-agent-self-chat-note {
    color: #475569 !important;
}

[data-theme="light"] .af-agent-self-chat-main,
[data-theme="light"] .af-agent-self-chat-prompts,
[data-theme="light"] .af-agent-knowledge-preview {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .af-agent-self-chat-feed {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .af-agent-chat-message-bot {
    background: #eef2ff;
    border-color: rgba(79, 70, 229, 0.16);
    color: #111827;
}

[data-theme="light"] .af-agent-chat-message-user {
    color: #ffffff;
}

[data-theme="light"] .af-agent-self-chat-form .af-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
}

[data-theme="light"] .af-agent-prompt-chip {
    background: #eff6ff;
    color: #1e3a8a;
    border-color: rgba(37, 99, 235, 0.18);
}

[data-theme="light"] .af-agent-prompt-chip:hover,
[data-theme="light"] .af-agent-prompt-chip:focus {
    background: #dbeafe;
    color: #172554;
}

[data-theme="light"] .af-agent-knowledge-preview,
[data-theme="light"] .af-agent-knowledge-preview .small {
    color: #0f172a !important;
}

@media (max-width: 992px) {
    .af-agent-self-chat-layout,
    .af-agent-knowledge-preview {
        grid-template-columns: 1fr;
        display: block;
    }

    .af-agent-self-chat-prompts,
    .af-agent-knowledge-preview {
        margin-top: 1rem;
    }

    .af-agent-knowledge-actions {
        justify-content: flex-start;
        margin-top: .75rem;
    }
}


/* =====================================================
   Database multi-select dropdown styling
   ===================================================== */
.af-ms-menu{
  border-radius: 14px;
}
.af-ms-list{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.af-ms-scroll{
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}
html[data-theme="dark"] .af-ms-menu{
  background: #0f1730;
  border-color: rgba(255,255,255,0.12);
}
html[data-theme="dark"] .af-ms-menu .form-check-label{
  color: rgba(237,243,255,0.92);
}
html[data-theme="dark"] .af-ms-menu .form-control{
  background: #0c1429;
  color: rgba(237,243,255,0.92);
  border-color: rgba(255,255,255,0.14);
}
html[data-theme="dark"] .af-ms-menu .form-control::placeholder{
  color: rgba(237,243,255,0.50);
}
