/* ============================================
   AGENT BUILDER — ADHD-FRIENDLY VISUAL SYSTEM
   ============================================ */

/* ── STEP TRANSITIONS ── */
.step-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(60px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.step-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  position: relative;
}
.step-panel.exit-left {
  opacity: 0;
  transform: translateX(-60px);
}

/* ── PROGRESS BAR (shimmer) ── */
.builder-progress {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}
.builder-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #22d3ee, #ec4899);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.builder-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── STEP DOTS ── */
.builder-dot {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900; font-size: 0.7rem;
  border: 2px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.3);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.builder-dot.active {
  border-color: #22d3ee;
  color: #22d3ee;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
  transform: scale(1.15);
}
.builder-dot.done {
  border-color: #22c55e;
  color: #fff;
  background: rgba(34, 197, 94, 0.25);
}
.builder-dot.done::after {
  content: '\2713';
  font-size: 0.75rem;
}
.builder-dot-connector {
  flex: 1; height: 2px;
  background: rgba(255,255,255,0.08);
  transition: background 0.4s;
  min-width: 16px;
}
.builder-dot-connector.done {
  background: linear-gradient(90deg, #22c55e, #22d3ee);
}

/* ── STEP LABEL ── */
.builder-step-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  transition: color 0.3s;
}

/* ── CHOICE CARD (personality, power source) ── */
.choice-card {
  cursor: pointer;
  border: 3px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.choice-card:hover {
  transform: scale(1.04);
  border-color: rgba(255,255,255,0.2);
}
.choice-card.selected {
  transform: scale(1.06);
  border-color: var(--card-color, #22d3ee);
  box-shadow:
    0 0 30px color-mix(in srgb, var(--card-color, #22d3ee) 40%, transparent),
    0 0 60px color-mix(in srgb, var(--card-color, #22d3ee) 20%, transparent),
    inset 0 0 30px color-mix(in srgb, var(--card-color, #22d3ee) 8%, transparent);
}
.choice-card.selected::after {
  content: '\2713';
  position: absolute;
  top: 8px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card-color, #22d3ee);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px;
}
.choice-card.dimmed {
  opacity: 0.35;
  transform: scale(0.95);
  filter: grayscale(0.4);
}

/* ── AVATAR GRID ── */
.avatar-cell {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  border-radius: 16px;
  border: 3px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.avatar-cell:hover {
  border-color: rgba(34, 211, 238, 0.4);
  transform: scale(1.1);
}
.avatar-cell.selected {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
  transform: scale(1.12);
}
.avatar-cell.dimmed {
  opacity: 0.3;
  transform: scale(0.9);
}

@keyframes avatar-bounce {
  0%, 100% { transform: scale(1.12); }
  30%  { transform: scale(1.35); }
  50%  { transform: scale(0.95); }
  70%  { transform: scale(1.18); }
}
.avatar-bounce { animation: avatar-bounce 0.6s ease; }

/* ── COUNTRY PILL ── */
.country-pill {
  padding: 6px 12px;
  border-radius: 9999px;
  border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.country-pill:hover {
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.1);
}
.country-pill.selected {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}

/* ── NAME INPUT (giant) ── */
.name-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 3px solid rgba(255,255,255,0.15);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0;
  outline: none;
  transition: border-color 0.3s;
  caret-color: #22d3ee;
}
.name-input::placeholder {
  color: rgba(255,255,255,0.15);
  text-transform: uppercase;
}
.name-input:focus {
  border-color: #22d3ee;
}
@media (max-width: 640px) {
  .name-input { font-size: 1.6rem; }
}

/* ── POWER METER (skill slider) ── */
.power-meter {
  height: 32px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.power-meter:active { cursor: grabbing; }
.power-meter-fill {
  height: 100%;
  border-radius: 14px;
  transition: width 0.15s ease;
  position: relative;
  min-width: 0;
}
.power-meter-fill::after {
  content: '';
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  pointer-events: none;
}
.power-meter[data-skill="aggression"] .power-meter-fill  { background: linear-gradient(90deg, #ef4444, #f97316); }
.power-meter[data-skill="creativity"] .power-meter-fill  { background: linear-gradient(90deg, #a855f7, #ec4899); }
.power-meter[data-skill="logic"] .power-meter-fill       { background: linear-gradient(90deg, #22d3ee, #3b82f6); }
.power-meter[data-skill="speed"] .power-meter-fill       { background: linear-gradient(90deg, #eab308, #f59e0b); }
.power-meter[data-skill="defense"] .power-meter-fill     { background: linear-gradient(90deg, #22c55e, #10b981); }

/* ── ENERGY BATTERY ── */
.energy-battery {
  width: 88px; height: 38px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  position: relative;
  padding: 3px;
  display: inline-flex;
}
.energy-battery::after {
  content: '';
  position: absolute;
  right: -9px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 15px;
  background: rgba(255,255,255,0.3);
  border-radius: 0 3px 3px 0;
}
.energy-battery-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.3s, background 0.3s;
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.energy-battery-fill.low { background: linear-gradient(90deg, #ef4444, #f97316); }
.energy-battery-fill.mid { background: linear-gradient(90deg, #eab308, #f59e0b); }

@keyframes fully-charged {
  0%   { text-shadow: 0 0 10px #22c55e; }
  50%  { text-shadow: 0 0 30px #22c55e, 0 0 60px #4ade80; }
  100% { text-shadow: 0 0 10px #22c55e; }
}
.fully-charged { animation: fully-charged 1s ease-in-out infinite; color: #4ade80 !important; }

/* ── LEAGUE TOGGLE CARD ── */
.league-toggle {
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(255,255,255,0.02);
  text-align: center;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.league-toggle:hover {
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.03);
}
.league-toggle.toggled {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.25);
  transform: scale(1.04);
}
.league-toggle.toggled::after {
  content: '\2713';
  position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #22d3ee;
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 11px;
}

/* ── AGENT CARD PREVIEW (holographic trading card) ── */
.agent-card-preview {
  width: 280px;
  min-height: 380px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  background: linear-gradient(165deg, rgba(15,15,25,0.95) 0%, rgba(20,10,30,0.95) 100%);
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.agent-card-preview::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(34,211,238,0.08), transparent, rgba(236,72,153,0.08), transparent);
  animation: card-holo 6s linear infinite;
  pointer-events: none;
}
@keyframes card-holo {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.agent-card-preview > * { position: relative; z-index: 1; }

/* ── Card inner elements ── */
.preview-avatar-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(236,72,153,0.2));
  border: 2px solid rgba(255,255,255,0.2);
  margin: 0 auto 0.75rem;
  transition: all 0.3s;
}
.preview-stat-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.preview-stat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── CONFETTI ── */
@keyframes confetti-fall {
  0%   { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  width: 10px; height: 10px;
  z-index: 9999;
  animation: confetti-fall 3s ease-in forwards;
  pointer-events: none;
}

/* ── DEPLOY ROCKET ── */
@keyframes rocket-launch {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  50%  { transform: translateY(-200px) scale(1.5); opacity: 0.8; }
  100% { transform: translateY(-400px) scale(0.5); opacity: 0; }
}
.rocket-launch { animation: rocket-launch 1.5s ease-in forwards; }

/* ── PARTICLE BURST ── */
@keyframes particle-out {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { opacity: 0; }
}
.particle-burst {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-out 0.6s ease-out forwards;
}

/* ── FILE DROP ── */
@keyframes file-drop {
  0%   { transform: translateY(-40px) scale(0.8); opacity: 0; }
  60%  { transform: translateY(5px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.file-drop { animation: file-drop 0.6s ease-out; }

/* ── BUILDER NAV BUTTONS ── */
.btn-builder {
  padding: 0.85rem 2rem;
  border-radius: 14px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: none;
}
.btn-builder-back {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #d1d5db;
}
.btn-builder-back:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}
.btn-builder-next {
  background: linear-gradient(135deg, #22d3ee 0%, #ec4899 100%);
  color: #000;
}
.btn-builder-next:hover {
  transform: scale(1.03);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.5);
}
.btn-builder-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-builder-deploy {
  background: linear-gradient(135deg, #22d3ee 0%, #ec4899 100%);
  color: #000;
  font-size: 1.1rem;
  padding: 1.15rem 2.5rem;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.4), 0 0 60px rgba(236, 72, 153, 0.2);
}
.btn-builder-deploy:hover {
  transform: scale(1.04);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.6), 0 0 80px rgba(236, 72, 153, 0.3);
}
.btn-builder-deploy:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── DOWNLOAD BUTTON ── */
.btn-download {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.btn-download:hover {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
  transform: scale(1.04);
}

/* ── RADAR CANVAS ── */
.radar-container {
  width: 240px; height: 240px;
  margin: 0 auto;
}
.radar-container canvas {
  width: 100%; height: 100%;
}

/* ── REVIEW PILL ── */
.review-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
}

/* ── MOBILE PREVIEW DRAWER ── */
.mobile-preview-toggle {
  width: 100%;
  padding: 10px;
  text-align: center;
  background: linear-gradient(0deg, rgba(10,10,15,0.98) 0%, rgba(10,10,15,0.85) 100%);
  border-top: 1px solid rgba(34, 211, 238, 0.3);
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #22d3ee;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mobile-preview-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: rgba(10,10,15,0.98);
  padding: 0 1rem;
}
.mobile-preview-body.open {
  max-height: 500px;
  padding: 1rem;
}

/* ── POST-DEPLOY SUCCESS ── */
.deploy-success {
  display: none;
}
.deploy-success.visible {
  display: block;
  animation: file-drop 0.6s ease-out;
}

/* ── VIRAL SHARE SECTION ── */
.share-section {
  background: linear-gradient(135deg, rgba(34,211,238,0.06), rgba(236,72,153,0.06));
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.share-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(34,211,238,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.share-section > * { position: relative; z-index: 1; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.share-btn:hover { transform: scale(1.06); }
.share-btn:active { transform: scale(0.97); }

.share-btn-x {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.9rem 2rem;
  font-size: 0.85rem;
  box-shadow: 0 0 20px rgba(255,255,255,0.06);
}
.share-btn-x:hover {
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 30px rgba(255,255,255,0.1);
}

.share-btn-linkedin {
  background: #0077b5;
  color: #fff;
}
.share-btn-linkedin:hover {
  background: #0088cc;
  box-shadow: 0 0 20px rgba(0,119,181,0.4);
}

.share-btn-copy {
  background: rgba(255,255,255,0.06);
  color: #22d3ee;
  border: 1px solid rgba(34,211,238,0.3);
}
.share-btn-copy:hover {
  background: rgba(34,211,238,0.1);
  border-color: rgba(34,211,238,0.5);
  box-shadow: 0 0 20px rgba(34,211,238,0.2);
}
.share-btn-copied {
  background: rgba(34,197,94,0.15) !important;
  color: #22c55e !important;
  border-color: rgba(34,197,94,0.4) !important;
}

.share-tweet-preview {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  max-width: 400px;
  margin: 0 auto;
}
.share-tweet-preview .text-left {
  white-space: pre-line;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .share-section { padding: 1.25rem 1rem; }
  .share-btn { width: 100%; justify-content: center; }
  .share-btn-x { font-size: 0.8rem; padding: 0.85rem 1.5rem; }
}

/* ── MODEL CARD ── */
.model-card {
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(255,255,255,0.02);
  -webkit-tap-highlight-color: transparent;
}
.model-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.02);
}
.model-card.selected {
  border-color: var(--card-color, #22d3ee);
  background: color-mix(in srgb, var(--card-color, #22d3ee) 8%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--card-color, #22d3ee) 25%, transparent);
}
.model-card.selected::after {
  content: '\2713';
  position: absolute;
  top: 8px; right: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--card-color, #22d3ee);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 11px;
}

/* ── API KEY INPUT ── */
.api-key-input {
  width: 100%;
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.api-key-input:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}
.api-key-input::placeholder { color: rgba(255,255,255,0.2); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .choice-card { padding: 1rem; }
  .agent-card-preview { width: 100%; min-height: 300px; }
  .power-meter { height: 40px; }
  .power-meter-fill::after { width: 22px; height: 22px; }
  .avatar-cell { width: 60px; height: 60px; font-size: 1.6rem; }
  .radar-container { width: 200px; height: 200px; }
}
@media (max-width: 480px) {
  .name-input { font-size: 1.3rem; }
  .choice-card { padding: 0.85rem; border-radius: 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   AGENT INSTRUCTIONS SECTION
   ═══════════════════════════════════════════════════════════════ */

/* ── Instructions container ── */
.instructions-section {
  border: 1px solid rgba(249, 115, 22, 0.2);
  background: linear-gradient(165deg, rgba(249, 115, 22, 0.03) 0%, rgba(236, 72, 153, 0.02) 100%);
}

/* ── Textarea ── */
.instructions-textarea {
  width: 100%;
  min-height: 140px;
  max-height: 300px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.instructions-textarea:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.instructions-textarea::placeholder {
  color: rgba(255, 255, 255, 0.18);
  font-style: italic;
  line-height: 1.6;
}

/* ── Glow animation on auto-generate ── */
@keyframes instructions-glow-pulse {
  0%   { box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }
  50%  { box-shadow: 0 0 20px rgba(249, 115, 22, 0.35), 0 0 40px rgba(236, 72, 153, 0.15); }
  100% { box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }
}
.instructions-glow {
  animation: instructions-glow-pulse 0.8s ease;
  border-color: #f97316 !important;
}

/* ── Character counter states ── */
.instructions-counter-warn {
  color: #f59e0b !important;
}
.instructions-counter-over {
  color: #ef4444 !important;
  font-weight: 700;
}

/* ── Template chips ── */
.tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-family: 'Inter', sans-serif;
}
.tpl-chip:hover {
  border-color: rgba(249, 115, 22, 0.4);
  color: #f97316;
  background: rgba(249, 115, 22, 0.06);
  transform: scale(1.05);
}
.tpl-chip-active {
  border-color: #f97316 !important;
  color: #f97316 !important;
  background: rgba(249, 115, 22, 0.12) !important;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.2);
}

/* ── Auto-generate button ── */
.btn-autogen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(236, 72, 153, 0.08));
  color: #f97316;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn-autogen:hover {
  transform: scale(1.05);
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(236, 72, 153, 0.12));
}
.btn-autogen:active {
  transform: scale(0.97);
}
.btn-autogen-done {
  border-color: rgba(34, 197, 94, 0.5) !important;
  color: #22c55e !important;
  background: rgba(34, 197, 94, 0.08) !important;
}

/* ── Responsive adjustments ── */
@media (max-width: 640px) {
  .instructions-textarea {
    min-height: 120px;
    font-size: 0.8rem;
  }
  .tpl-chip {
    font-size: 0.65rem;
    padding: 4px 10px;
  }
  .btn-autogen {
    font-size: 0.65rem;
    padding: 0.5rem 1rem;
  }
}
