/* Agent Forge — Builder Styles */

/* ── Minimal Top Bar ── */
.af-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
  background: rgba(15,23,42,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.af-topbar-brand { display: flex; align-items: center; gap: 0.75rem; }
.af-topbar-logo {
  font-size: 0.95rem; font-weight: 600; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 0.4rem;
}
.af-topbar-logo i { color: rgba(90,200,250,0.8); }
.af-topbar-logo:hover { color: rgba(90,200,250,0.9); }
.af-topbar-byline { font-size: 0.75rem; color: rgba(255,255,255,0.3); text-decoration: none; }
.af-topbar-byline:hover { color: rgba(255,255,255,0.5); }
.af-topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.af-topbar-link {
  font-size: 0.82rem; color: rgba(255,255,255,0.5); text-decoration: none;
  display: flex; align-items: center; gap: 0.3rem;
}
.af-topbar-link:hover { color: rgba(90,200,250,0.8); }
.af-topbar-icon {
  background: none; border: none; color: rgba(255,255,255,0.4);
  cursor: pointer; font-size: 0.95rem; padding: 4px;
}
.af-topbar-icon:hover { color: rgba(90,200,250,0.8); }
.af-topbar-login {
  font-size: 0.82rem; color: rgba(90,200,250,0.7); text-decoration: none;
  display: flex; align-items: center; gap: 0.3rem;
}
.af-topbar-login:hover { color: rgba(90,200,250,1); }
.af-topbar-user {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.6);
}
.af-user-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.af-topbar-logout {
  color: rgba(255,255,255,0.35); text-decoration: none; font-size: 0.75rem; margin-left: 0.3rem;
}
.af-topbar-logout:hover { color: rgba(255,255,255,0.6); }

/* ── Agent Lifecycle Groups ── */
.af-lifecycle-group { margin-bottom: 1.25rem; }
.af-lifecycle-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.af-lifecycle-label i { font-size: 0.55rem; }
.af-lifecycle-label--pending { color: #fbbf24; }
.af-lifecycle-label--pending i { color: #fbbf24; }
.af-lifecycle-label--live { color: #4ade80; }
.af-lifecycle-label--live i { color: #4ade80; }
.af-lifecycle-count { font-weight: 400; opacity: 0.6; }

/* Pending item */
.af-pending-item {
  opacity: 0.7;
  cursor: default;
}
.af-pending-icon {
  color: #fbbf24;
  font-size: 0.7rem;
  margin-right: 0.2rem;
}

/* Live item */
.af-live-item { }
.af-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.af-live-delete {
  background: none;
  border: none;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 2px 4px;
}
.af-live-delete:hover { color: #f87171; }

/* Light theme lifecycle */
body[data-theme="light"] .af-lifecycle-label { color: #94a3b8; }
body[data-theme="light"] .af-lifecycle-label--pending { color: #d97706; }
body[data-theme="light"] .af-lifecycle-label--live { color: #16a34a; }
body[data-theme="light"] .af-pending-icon { color: #d97706; }
body[data-theme="light"] .af-live-dot { background: #16a34a; }
body[data-theme="light"] .af-live-delete { color: #cbd5e1; }
body[data-theme="light"] .af-live-delete:hover { color: #ef4444; }

/* ── Auth Gate ── */
.af-auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}
.af-auth-gate-card {
  text-align: center;
  padding: 3rem 2.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  max-width: 420px;
}
.af-auth-gate-card i.fa-lock {
  font-size: 2.5rem;
  color: rgba(90,200,250,0.4);
  margin-bottom: 1rem;
}
.af-auth-gate-card h2 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
  color: #fff;
}
.af-auth-gate-card p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 1.5rem;
}
.af-auth-gate-link {
  display: block;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
}
.af-auth-gate-link:hover { color: rgba(255,255,255,0.6); }

/* ── Page Header ── */
.af-page-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0.5rem;
}
.af-page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: #fff;
}
.af-page-header p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

/* ── Minimal Footer ── */
.af-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 2rem;
}
.af-footer a { color: rgba(255,255,255,0.45); text-decoration: none; }
.af-footer a:hover { color: rgba(255,255,255,0.7); }
.af-footer-sep { margin: 0 0.4rem; color: rgba(255,255,255,0.15); }

/* ── Breadcrumb ── */
.af-breadcrumb {
  font-size: 0.85rem;
  opacity: 0.7;
  color: inherit;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.af-breadcrumb:hover { opacity: 1; }

/* ── 3-Column Builder Layout ── */
.af-builder {
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  min-height: 80vh;
}

/* ── Component Tray (Left) ── */
.af-tray {
  position: sticky;
  top: 50px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.af-tray-section {
  margin-bottom: 1.5rem;
}

.af-tray-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.75rem;
}

.af-tray-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.af-tray-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: grab;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  transition: all 0.15s;
  user-select: none;
}
.af-tray-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(90,200,250,0.3);
  color: #fff;
}
.af-tray-card:active { cursor: grabbing; }
.af-tray-card.af-tray-card--used {
  opacity: 0.35;
  pointer-events: none;
}
.af-tray-card i {
  width: 18px;
  text-align: center;
  color: rgba(90,200,250,0.7);
}

/* Templates */
.af-tray-templates {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.af-template-btn {
  background: none;
  border: 1px dashed rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
  transition: all 0.15s;
}
.af-template-btn:hover {
  border-color: rgba(90,200,250,0.3);
  color: rgba(255,255,255,0.8);
  background: rgba(90,200,250,0.05);
}
.af-template-btn i { margin-right: 0.4rem; }

/* Drafts */
.af-drafts-list { display: flex; flex-direction: column; gap: 0.4rem; }
.af-drafts-empty { font-size: 0.8rem; color: rgba(255,255,255,0.3); }
.af-draft-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.15s;
}
.af-draft-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.af-draft-delete {
  background: none; border: none; color: rgba(255,255,255,0.3);
  cursor: pointer; font-size: 0.75rem; padding: 2px 4px;
}
.af-draft-delete:hover { color: #f87171; }

/* ── Pipeline Canvas (Center) ── */
.af-canvas {
  min-height: 500px;
}

.af-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.af-canvas-header h3 {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

.af-pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 400px;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  /* Subtle dot grid background */
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: rgba(0,0,0,0.15);
}
.af-pipeline.af-pipeline--dragover {
  border-color: rgba(90,200,250,0.4);
  background-color: rgba(90,200,250,0.02);
}

.af-pipeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: rgba(255,255,255,0.25);
  text-align: center;
  gap: 0.75rem;
}
.af-pipeline-empty i { font-size: 1.5rem; }
.af-pipeline-empty p { font-size: 0.9rem; line-height: 1.5; }

/* ── SVG Connector between cards ── */
.af-connector {
  display: flex;
  justify-content: center;
  height: 32px;
  position: relative;
  pointer-events: none;
}
.af-connector svg {
  width: 40px;
  height: 32px;
  overflow: visible;
}
.af-connector-line {
  stroke: rgba(90,200,250,0.3);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6 4;
  animation: af-dash-flow 1.5s linear infinite;
}
.af-connector-dot {
  fill: rgba(90,200,250,0.5);
}
.af-connector-arrow {
  fill: rgba(90,200,250,0.4);
  stroke: none;
}

@keyframes af-dash-flow {
  to { stroke-dashoffset: -10; }
}

/* ── Pipeline Cards ── */
.af-pipe-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  animation: af-card-enter 0.3s ease-out;
}

@keyframes af-card-enter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.af-pipe-card:hover {
  border-color: rgba(90,200,250,0.25);
  box-shadow: 0 0 20px rgba(90,200,250,0.06);
  transform: translateY(-1px);
}

.af-pipe-card.af-pipe-card--open {
  border-color: rgba(90,200,250,0.2);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 2px 16px rgba(90,200,250,0.08);
}

/* Node port dots on cards */
.af-pipe-card::before,
.af-pipe-card::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(90,200,250,0.3);
  border: 2px solid rgba(15,23,42,0.8);
  z-index: 2;
  transition: background 0.2s;
}
.af-pipe-card {
  position: relative;
}
.af-pipe-card::before {
  top: -5px;
}
.af-pipe-card::after {
  bottom: -5px;
}
.af-pipe-card:first-child::before {
  display: none;
}
.af-pipe-card:last-child::after {
  display: none;
}
.af-pipe-card:hover::before,
.af-pipe-card:hover::after {
  background: rgba(90,200,250,0.6);
}

.af-pipe-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
}
.af-pipe-card-header i.af-pipe-icon {
  color: rgba(90,200,250,0.7);
  width: 20px;
  text-align: center;
}
.af-pipe-card-header .af-pipe-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  flex: 1;
}
.af-pipe-card-header .af-pipe-summary {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.af-pipe-card-header .af-pipe-chevron {
  color: rgba(255,255,255,0.25);
  transition: transform 0.2s;
  font-size: 0.75rem;
}
.af-pipe-card.af-pipe-card--open .af-pipe-chevron {
  transform: rotate(180deg);
}
.af-pipe-card-header .af-pipe-drag {
  cursor: grab;
  color: rgba(255,255,255,0.2);
  padding: 0 4px;
}
.af-pipe-card-header .af-pipe-drag:hover { color: rgba(255,255,255,0.5); }

/* Card body animation handled in UI Polish section below */

/* ── Form Controls ── */
.af-field {
  margin-bottom: 0.85rem;
}
.af-field-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.af-field input[type="text"],
.af-field textarea,
.af-field select {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s;
}
.af-field input:focus,
.af-field textarea:focus,
.af-field select:focus {
  outline: none;
  border-color: rgba(90,200,250,0.5);
}
.af-field textarea { resize: vertical; min-height: 60px; }
.af-field textarea.af-mono { font-family: monospace; font-size: 0.8rem; min-height: 150px; }
.af-field select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}

/* Dark-themed select options (Firefox/Chrome) */
.af-field select option,
.af-output-row select option {
  background: #1a1f2e;
  color: rgba(255,255,255,0.85);
  padding: 0.4rem 0.6rem;
}
.af-field select option:checked,
.af-output-row select option:checked {
  background: rgba(90,200,250,0.2);
  color: #fff;
}
.af-field select option:hover,
.af-output-row select option:hover {
  background: rgba(90,200,250,0.15);
}

/* Powers select */
.af-powers-select {
  width: 64px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.35rem 1.4rem 0.35rem 0.5rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.3)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
}
.af-powers-select:focus {
  outline: none;
  border-color: rgba(90,200,250,0.5);
}
.af-powers-select option {
  background: #1a1f2e;
  color: rgba(255,255,255,0.85);
}

/* Toggle switch */
.af-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}
.af-toggle-row label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.af-toggle {
  position: relative;
  width: 40px;
  height: 22px;
}
.af-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.af-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.af-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.af-toggle input:checked + .af-toggle-slider {
  background: rgba(90,200,250,0.6);
}
.af-toggle input:checked + .af-toggle-slider::before {
  transform: translateX(18px);
}

/* Range slider */
.af-range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.af-range-row input[type="range"] {
  flex: 1;
  accent-color: rgba(90,200,250,0.7);
}
.af-range-value {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  min-width: 40px;
  text-align: right;
  font-family: monospace;
}

/* Icon picker trigger */
.af-icon-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  transition: border-color 0.15s;
}
.af-icon-trigger:hover { border-color: rgba(90,200,250,0.4); }
.af-icon-trigger i { font-size: 1.1rem; }

/* Tier selector */
.af-tier-selector {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.af-tier-btn {
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  background: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}
.af-tier-btn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.af-tier-btn.af-tier-btn--active { border-color: currentColor; }
.af-tier-btn[data-tier="common"] { color: #9ca3af; }
.af-tier-btn[data-tier="uncommon"] { color: #4ade80; }
.af-tier-btn[data-tier="rare"] { color: #60a5fa; }
.af-tier-btn[data-tier="epic"] { color: #a855f7; }
.af-tier-btn[data-tier="legendary"] { color: #f59e0b; }

/* Output section rows */
.af-output-sections {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.af-output-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
.af-output-row .af-output-drag {
  cursor: grab;
  color: rgba(255,255,255,0.2);
  padding: 0 4px;
}
.af-output-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.82rem;
  padding: 0.3rem;
  outline: none;
}
.af-output-row select {
  width: 130px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.3)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  padding-right: 1.4rem;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.3rem;
}
.af-output-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
}
.af-output-remove:hover { color: #f87171; }

.af-add-output-btn {
  background: none;
  border: 1px dashed rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.4);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  width: 100%;
  transition: all 0.15s;
}
.af-add-output-btn:hover {
  border-color: rgba(90,200,250,0.3);
  color: rgba(255,255,255,0.7);
}

/* Output type preview strip */
.af-type-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  height: 16px;
}
.af-type-preview-bar { width: 40px; height: 6px; border-radius: 3px; background: rgba(90,200,250,0.4); }
.af-type-preview-num { font-size: 0.6rem; color: rgba(90,200,250,0.5); font-family: monospace; }
.af-type-preview-line { width: 100%; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.1); }
.af-type-preview-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(90,200,250,0.4); }
.af-type-preview-pill {
  padding: 1px 6px; border-radius: 8px; font-size: 0.55rem;
  background: rgba(90,200,250,0.15); color: rgba(90,200,250,0.6);
}
.af-type-preview-border {
  border-left: 2px solid rgba(90,200,250,0.3);
  padding-left: 6px;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}
.af-type-preview-box {
  padding: 2px 8px;
  border: 1px solid rgba(90,200,250,0.2);
  border-radius: 4px;
  font-size: 0.55rem;
  color: rgba(90,200,250,0.5);
}
.af-type-preview-img {
  width: 20px; height: 14px; border-radius: 2px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
}
.af-type-preview-swatch {
  width: 8px; height: 8px; border-radius: 2px;
}

/* Scaffold helper button */
.af-scaffold-btn {
  background: rgba(90,200,250,0.1);
  border: 1px solid rgba(90,200,250,0.25);
  color: rgba(90,200,250,0.8);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  width: 100%;
  margin-bottom: 0.75rem;
  transition: all 0.15s;
}
.af-scaffold-btn:hover {
  background: rgba(90,200,250,0.15);
  border-color: rgba(90,200,250,0.4);
}

/* ── Preview Column (Right) ── */
.af-preview-col {
  position: relative;
}
.af-preview-sticky {
  position: sticky;
  top: 50px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.af-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.5rem;
}
.af-preview-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1rem;
}

/* Test panel */
.af-test-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1rem;
}
.af-test-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  margin-bottom: 0.5rem;
}
.af-test-input:focus { outline: none; border-color: rgba(90,200,250,0.5); }
.af-test-result {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Actions */
.af-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Buttons ── */
.af-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: 'Inter', sans-serif;
}
.af-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.af-btn-primary {
  background: rgba(90,200,250,0.2);
  color: rgba(90,200,250,0.9);
  border: 1px solid rgba(90,200,250,0.3);
}
.af-btn-primary:hover:not(:disabled) {
  background: rgba(90,200,250,0.3);
}
.af-btn-secondary {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
}
.af-btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
}
.af-btn-ghost {
  background: none;
  color: rgba(255,255,255,0.4);
  border: none;
}
.af-btn-ghost:hover { color: rgba(255,255,255,0.7); }

/* ── Spinner ── */
.af-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(90,200,250,0.2);
  border-top-color: rgba(90,200,250,0.8);
  border-radius: 50%;
  animation: af-spin 0.8s linear infinite;
}
@keyframes af-spin { to { transform: rotate(360deg); } }

.af-test-loading, .af-scaffold-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

/* ── Modals ── */
.af-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 6rem 1rem 2rem;
  overflow-y: auto;
}
.af-modal {
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.af-modal-lg { max-width: 700px; }
.af-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.af-modal-header h3 {
  font-size: 1rem;
  color: #fff;
}
.af-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.3rem;
  cursor: pointer;
}
.af-modal-close:hover { color: #fff; }
.af-modal-body { padding: 1.25rem; }
.af-modal-body p { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 1rem; }
.af-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.af-scaffold-textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  resize: vertical;
}
.af-scaffold-textarea:focus { outline: none; border-color: rgba(90,200,250,0.5); }

/* Icon picker */
.af-icon-search {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.af-icon-search:focus { outline: none; border-color: rgba(90,200,250,0.5); }
.af-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
  max-height: 350px;
  overflow-y: auto;
}
.af-icon-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem;
  transition: all 0.1s;
  border: 1px solid transparent;
}
.af-icon-option:hover {
  background: rgba(90,200,250,0.1);
  color: #fff;
  border-color: rgba(90,200,250,0.3);
}
.af-icon-option.af-icon-option--selected {
  background: rgba(90,200,250,0.2);
  color: rgba(90,200,250,1);
  border-color: rgba(90,200,250,0.5);
}

/* ── Canvas Status ── */
.af-canvas-status {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

/* ── Sortable ghost/drag styles ── */
.sortable-ghost {
  opacity: 0.3;
}
.sortable-chosen {
  box-shadow: 0 4px 20px rgba(90,200,250,0.15);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .af-builder {
    grid-template-columns: 180px 1fr 280px;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .af-builder {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .af-tray {
    position: static;
    max-height: none;
  }
  .af-tray-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .af-tray-card {
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }
  .af-preview-sticky {
    position: static;
  }
}

/* ── Notification Popups ── */
.af-notifications {
  position: fixed;
  top: 50px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.af-notification {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}
.af-notification--visible {
  opacity: 1;
  transform: translateX(0);
}
.af-notification--success { border-left: 3px solid #4ade80; }
.af-notification--warning { border-left: 3px solid #fbbf24; }
.af-notification--error { border-left: 3px solid #f87171; }
.af-notification--info { border-left: 3px solid rgba(90,200,250,0.7); }

.af-notification-content {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  flex: 1;
}
.af-notification-content strong {
  font-size: 0.85rem;
  color: #fff;
}
.af-notification-content p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  margin: 0.2rem 0 0;
}
.af-notification-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.af-notification-close:hover { color: #fff; }

/* ── Confirm Modal ── */
.af-modal-confirm {
  max-width: 440px;
}
.af-confirm-overlay {
  align-items: center;
  padding: 1rem;
}

/* ── Review Loading ── */
.af-review-loading-msg {
  text-align: center;
  padding: 2rem 0;
}
.af-review-loading-msg p {
  margin: 0.3rem 0;
}

/* ── Review Modal ── */
.af-modal-review {
  max-width: 620px;
}

.af-review-score-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.af-review-score-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.af-review-score-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  min-width: 80px;
}

.af-review-score-bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.af-review-score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
}

.af-review-score-num {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
  font-family: monospace;
}

.af-review-feedback-text {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin: 1rem 0;
}

.af-review-similar {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  padding: 0.5rem 0;
}
.af-review-similar i {
  margin-right: 0.3rem;
  color: rgba(90,200,250,0.5);
}

.af-review-suggestions {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.af-review-suggestions h4 {
  font-size: 0.82rem;
  color: rgba(251,191,36,0.8);
  margin-bottom: 0.5rem;
}
.af-review-suggestions h4 i { margin-right: 0.4rem; }
.af-review-suggestions ul {
  margin: 0;
  padding-left: 1.2rem;
}
.af-review-suggestions li {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin-bottom: 0.3rem;
}

.af-review-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* ── Locked Card State ── */
.af-pipe-card--locked {
  opacity: 0.6;
  pointer-events: none;
}
.af-pipe-card--locked .af-pipe-card-header {
  pointer-events: auto;
  cursor: default;
}
.af-pipe-card--locked .af-pipe-drag {
  display: none;
}

.af-btn-locked {
  background: rgba(251,191,36,0.1) !important;
  color: rgba(251,191,36,0.7) !important;
  border: 1px solid rgba(251,191,36,0.2) !important;
  cursor: not-allowed !important;
}

/* ── Suggestions Banner ── */
.af-suggestions-banner {
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.af-suggestions-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(251,191,36,0.8);
  margin-bottom: 0.5rem;
}
.af-suggestions-header i { margin-right: 0.4rem; }
.af-suggestions-banner ul {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
}
.af-suggestions-banner li {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}
.af-suggestions-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── Formatted Test Results ── */
.af-test-section {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.af-test-section:last-of-type { border-bottom: none; }

.af-test-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(90,200,250,0.6);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.af-test-score {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.af-test-score-num {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: monospace;
}
.af-test-score-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.af-test-score-bar div {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.af-test-verdict {
  font-style: italic;
  color: rgba(255,255,255,0.7);
  border-left: 3px solid rgba(90,200,250,0.3);
  padding-left: 0.75rem;
  font-size: 0.88rem;
}

.af-test-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.55;
}

.af-test-list {
  margin: 0;
  padding-left: 1rem;
}
.af-test-list li {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
.af-test-list li::marker {
  color: rgba(90,200,250,0.5);
}

.af-test-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.af-test-tag {
  padding: 0.2rem 0.6rem;
  background: rgba(90,200,250,0.1);
  color: rgba(90,200,250,0.7);
  border-radius: 12px;
  font-size: 0.75rem;
}

.af-test-highlight {
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(90,200,250,0.15);
  border-radius: 6px;
  background: rgba(90,200,250,0.04);
  font-size: 0.85rem;
  color: rgba(90,200,250,0.8);
  line-height: 1.5;
}

.af-test-empty {
  color: rgba(255,255,255,0.3);
  text-align: center;
  padding: 1rem;
}

.af-test-json-toggle {
  margin-top: 0.75rem;
  font-size: 0.78rem;
}
.af-test-json-toggle summary {
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  user-select: none;
}
.af-test-json-toggle summary:hover { color: rgba(255,255,255,0.6); }
.af-test-json-toggle pre {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ══════════════════════════════════════════════
   UI/UX POLISH — Accessibility, Interactions, Visual Hierarchy
   ══════════════════════════════════════════════ */

/* 1. Focus states for all interactive elements */
.af-tray-card:focus-visible,
.af-template-btn:focus-visible,
.af-btn:focus-visible,
.af-pipe-card-header:focus-visible,
.af-topbar-link:focus-visible,
.af-topbar-icon:focus-visible,
.af-topbar-login:focus-visible,
.af-icon-trigger:focus-visible,
.af-tier-btn:focus-visible,
.af-output-remove:focus-visible,
.af-add-output-btn:focus-visible,
.af-toggle input:focus-visible + .af-toggle-slider {
  outline: 2px solid rgba(90,200,250,0.6);
  outline-offset: 2px;
}

/* 2. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .af-connector-line { animation: none; }
  .af-pipe-card { animation: none; }
  .af-notification { transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* 3. Cursor improvements */
.af-tray-card { cursor: grab; }
.af-tray-card:active { cursor: grabbing; }

/* 4. Drag handle visibility */
.af-pipe-card-header .af-pipe-drag { color: rgba(255,255,255,0.35); }
.af-pipe-card-header .af-pipe-drag:hover { color: rgba(255,255,255,0.6); }

/* 5. Active/open card left accent border */
.af-pipe-card.af-pipe-card--open {
  border-left: 3px solid rgba(90,200,250,0.5);
}

/* 6. Card expand/collapse animation */
.af-pipe-card-body {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
  padding: 0 1rem;
}
.af-pipe-card.af-pipe-card--open .af-pipe-card-body {
  max-height: 2000px;
  opacity: 1;
  padding: 0 1rem 1rem;
}

/* 7. Tray section spacing */
.af-tray-section { margin-bottom: 2rem; }

/* 8. Used tray card — softer, with checkmark */
.af-tray-card.af-tray-card--used {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}
.af-tray-card.af-tray-card--used::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: #4ade80;
}

/* 9. Test result score color coding */
.af-test-score-num[data-score-level="high"] { color: #4ade80; }
.af-test-score-num[data-score-level="mid"] { color: #fbbf24; }
.af-test-score-num[data-score-level="low"] { color: #f87171; }

/* 10. Test result panel scroll */
.af-test-result {
  max-height: 400px;
  overflow-y: auto;
}

/* 11. Contrast fixes — bump low-contrast labels */
.af-tray-title { color: rgba(255,255,255,0.5); }
.af-canvas-status { color: rgba(255,255,255,0.4); }
.af-preview-label { color: rgba(255,255,255,0.45); }

/* ══════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ══════════════════════════════════════════════ */

/* Auth gate */
body[data-theme="light"] .af-auth-gate-card { background: #fff; border-color: #e2e8f0; }
body[data-theme="light"] .af-auth-gate-card i.fa-lock { color: #3b82f6; }
body[data-theme="light"] .af-auth-gate-card h2 { color: #1e293b; }
body[data-theme="light"] .af-auth-gate-card p { color: #64748b; }
body[data-theme="light"] .af-auth-gate-link { color: #94a3b8; }

/* Page header + footer */
body[data-theme="light"] .af-page-header h1 { color: #1e293b; }
body[data-theme="light"] .af-page-header p { color: #64748b; }
body[data-theme="light"] .af-footer { color: #94a3b8; border-top-color: rgba(0,0,0,0.06); }
body[data-theme="light"] .af-footer a { color: #64748b; }
body[data-theme="light"] .af-footer a:hover { color: #334155; }
body[data-theme="light"] .af-footer-sep { color: #e2e8f0; }

/* Topbar */
body[data-theme="light"] .af-topbar { background: rgba(255,255,255,0.95); border-bottom-color: rgba(0,0,0,0.08); }
body[data-theme="light"] .af-topbar-logo { color: #1e293b; }
body[data-theme="light"] .af-topbar-logo i { color: #3b82f6; }
body[data-theme="light"] .af-topbar-byline { color: #94a3b8; }
body[data-theme="light"] .af-topbar-link { color: #64748b; }
body[data-theme="light"] .af-topbar-link:hover { color: #3b82f6; }
body[data-theme="light"] .af-topbar-icon { color: #94a3b8; }
body[data-theme="light"] .af-topbar-icon:hover { color: #3b82f6; }
body[data-theme="light"] .af-topbar-login { color: #3b82f6; }
body[data-theme="light"] .af-topbar-user { color: #475569; }
body[data-theme="light"] .af-topbar-logout { color: #94a3b8; }

/* Tray */
body[data-theme="light"] .af-tray-card {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: #334155;
}
body[data-theme="light"] .af-tray-card:hover {
  background: rgba(0,0,0,0.07);
  border-color: rgba(59,130,246,0.3);
  color: #1e293b;
}
body[data-theme="light"] .af-tray-card i { color: #3b82f6; }
body[data-theme="light"] .af-tray-title { color: rgba(0,0,0,0.4); }
body[data-theme="light"] .af-template-btn {
  border-color: rgba(0,0,0,0.1);
  color: #64748b;
}
body[data-theme="light"] .af-template-btn:hover {
  border-color: rgba(59,130,246,0.3);
  color: #334155;
  background: rgba(59,130,246,0.05);
}
body[data-theme="light"] .af-drafts-empty { color: rgba(0,0,0,0.3); }
body[data-theme="light"] .af-draft-item { background: rgba(0,0,0,0.03); color: #475569; }
body[data-theme="light"] .af-draft-item:hover { background: rgba(0,0,0,0.06); color: #1e293b; }

/* Pipeline canvas */
body[data-theme="light"] .af-pipeline {
  border-color: rgba(0,0,0,0.08);
  background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-color: rgba(0,0,0,0.02);
}
body[data-theme="light"] .af-pipeline.af-pipeline--dragover {
  border-color: rgba(59,130,246,0.4);
  background-color: rgba(59,130,246,0.03);
}
body[data-theme="light"] .af-pipeline-empty { color: rgba(0,0,0,0.25); }
body[data-theme="light"] .af-canvas-header h3 { color: rgba(0,0,0,0.45); }
body[data-theme="light"] .af-canvas-status { color: rgba(0,0,0,0.3); }

/* Pipeline cards */
body[data-theme="light"] .af-pipe-card {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body[data-theme="light"] .af-pipe-card:hover {
  border-color: rgba(59,130,246,0.3);
  box-shadow: 0 2px 8px rgba(59,130,246,0.08);
}
body[data-theme="light"] .af-pipe-card.af-pipe-card--open {
  border-color: rgba(59,130,246,0.25);
  background: #fff;
  box-shadow: 0 2px 12px rgba(59,130,246,0.1);
}
body[data-theme="light"] .af-pipe-card-header .af-pipe-title { color: #1e293b; }
body[data-theme="light"] .af-pipe-card-header .af-pipe-summary { color: #94a3b8; }
body[data-theme="light"] .af-pipe-card-header .af-pipe-chevron { color: #cbd5e1; }
body[data-theme="light"] .af-pipe-card-header .af-pipe-drag { color: #cbd5e1; }
body[data-theme="light"] .af-pipe-card-header i.af-pipe-icon { color: #3b82f6; }

/* Node ports + connectors */
body[data-theme="light"] .af-pipe-card::before,
body[data-theme="light"] .af-pipe-card::after { background: rgba(59,130,246,0.3); border-color: #fff; }
body[data-theme="light"] .af-pipe-card:hover::before,
body[data-theme="light"] .af-pipe-card:hover::after { background: rgba(59,130,246,0.6); }
body[data-theme="light"] .af-connector-line { stroke: rgba(59,130,246,0.25); }
body[data-theme="light"] .af-connector-dot { fill: rgba(59,130,246,0.4); }
body[data-theme="light"] .af-connector-arrow { fill: rgba(59,130,246,0.35); }

/* Form controls */
body[data-theme="light"] .af-field-label { color: #64748b; }
body[data-theme="light"] .af-field input[type="text"],
body[data-theme="light"] .af-field textarea,
body[data-theme="light"] .af-field select {
  background: #f8fafc; border-color: #e2e8f0; color: #1e293b;
}
body[data-theme="light"] .af-field input:focus,
body[data-theme="light"] .af-field textarea:focus,
body[data-theme="light"] .af-field select:focus { border-color: #3b82f6; }
body[data-theme="light"] .af-field select option,
body[data-theme="light"] .af-output-row select option,
body[data-theme="light"] .af-powers-select option { background: #fff; color: #1e293b; }
body[data-theme="light"] .af-powers-select { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
body[data-theme="light"] .af-toggle-slider { background: #e2e8f0; }
body[data-theme="light"] .af-toggle input:checked + .af-toggle-slider { background: #3b82f6; }
body[data-theme="light"] .af-toggle-row label { color: #334155; }

/* Output rows */
body[data-theme="light"] .af-output-row { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .af-output-row input { color: #1e293b; }
body[data-theme="light"] .af-output-row select { background: #fff; border-color: #e2e8f0; color: #334155; }
body[data-theme="light"] .af-output-remove { color: #cbd5e1; }
body[data-theme="light"] .af-output-remove:hover { color: #ef4444; }
body[data-theme="light"] .af-add-output-btn { border-color: rgba(0,0,0,0.1); color: #94a3b8; }
body[data-theme="light"] .af-add-output-btn:hover { border-color: rgba(59,130,246,0.3); color: #3b82f6; }

/* Scaffold + icon triggers */
body[data-theme="light"] .af-scaffold-btn { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.25); color: #3b82f6; }
body[data-theme="light"] .af-icon-trigger { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
body[data-theme="light"] .af-tier-btn { border-color: #e2e8f0; }

/* Preview + test */
body[data-theme="light"] .af-preview-card { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .af-preview-label { color: rgba(0,0,0,0.35); }
body[data-theme="light"] .af-test-panel { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .af-test-input { background: #fff; border-color: #e2e8f0; color: #1e293b; }
body[data-theme="light"] .af-test-result { background: #f1f5f9; color: #334155; }

/* Buttons */
body[data-theme="light"] .af-btn-primary { background: rgba(59,130,246,0.1); color: #3b82f6; border-color: rgba(59,130,246,0.3); }
body[data-theme="light"] .af-btn-primary:hover:not(:disabled) { background: rgba(59,130,246,0.15); }
body[data-theme="light"] .af-btn-secondary { background: rgba(0,0,0,0.04); color: #475569; border-color: #e2e8f0; }
body[data-theme="light"] .af-btn-ghost { color: #94a3b8; }
body[data-theme="light"] .af-btn-ghost:hover { color: #475569; }

/* Modals */
body[data-theme="light"] .af-modal { background: #fff; border-color: #e2e8f0; box-shadow: 0 8px 40px rgba(0,0,0,0.15); }
body[data-theme="light"] .af-modal-header { border-bottom-color: #f1f5f9; }
body[data-theme="light"] .af-modal-header h3 { color: #1e293b; }
body[data-theme="light"] .af-modal-close { color: #94a3b8; }
body[data-theme="light"] .af-modal-body p { color: #64748b; }
body[data-theme="light"] .af-modal-footer { border-top-color: #f1f5f9; }
body[data-theme="light"] .af-scaffold-textarea { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }

/* Notifications */
body[data-theme="light"] .af-notification { background: #fff; border-color: #e2e8f0; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
body[data-theme="light"] .af-notification-content strong { color: #1e293b; }
body[data-theme="light"] .af-notification-content p { color: #64748b; }

/* Review modal */
body[data-theme="light"] .af-review-score-label { color: #64748b; }
body[data-theme="light"] .af-review-score-bar-bg { background: #f1f5f9; }
body[data-theme="light"] .af-review-feedback-text { color: #334155; }
body[data-theme="light"] .af-review-similar { color: #94a3b8; }
body[data-theme="light"] .af-review-suggestions { background: #fffbeb; border-color: #fef3c7; }
body[data-theme="light"] .af-review-suggestions li { color: #92400e; }
body[data-theme="light"] .af-suggestions-banner { background: #fffbeb; border-color: #fde68a; }
body[data-theme="light"] .af-suggestions-banner li { color: #92400e; }

/* Test sections */
body[data-theme="light"] .af-test-section { border-bottom-color: #f1f5f9; }
body[data-theme="light"] .af-test-section-label { color: #3b82f6; }
body[data-theme="light"] .af-test-verdict { color: #334155; border-left-color: #3b82f6; }
body[data-theme="light"] .af-test-text { color: #475569; }
body[data-theme="light"] .af-test-list li { color: #475569; }
body[data-theme="light"] .af-test-list li::marker { color: #3b82f6; }
body[data-theme="light"] .af-test-tag { background: rgba(59,130,246,0.1); color: #3b82f6; }
body[data-theme="light"] .af-test-highlight { border-color: rgba(59,130,246,0.2); background: rgba(59,130,246,0.04); color: #1d4ed8; }
body[data-theme="light"] .af-test-score-bar { background: #f1f5f9; }
body[data-theme="light"] .af-test-json-toggle summary { color: #94a3b8; }
body[data-theme="light"] .af-test-json-toggle pre { background: #f1f5f9; color: #475569; }

/* Icon picker */
body[data-theme="light"] .af-icon-search { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
body[data-theme="light"] .af-icon-option { color: #94a3b8; }
body[data-theme="light"] .af-icon-option:hover { background: rgba(59,130,246,0.08); color: #3b82f6; border-color: rgba(59,130,246,0.3); }
