/* ===== Custom Property for Animated Conic Gradient ===== */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ===== CSS Custom Properties ===== */
:root {
  --bg-primary: #0a0a14;
  --bg-secondary: rgba(18, 18, 35, 0.75);
  --bg-tertiary: rgba(22, 22, 42, 0.8);
  --bg-panel: rgba(24, 24, 48, 0.7);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a82;
  --accent-start: #7c3aed;
  --accent-mid: #6366f1;
  --accent-end: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  --accent-gradient-wide: linear-gradient(135deg, var(--accent-start), var(--accent-mid), var(--accent-end), var(--accent-cyan));
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(124, 58, 237, 0.25);
  --glass-bg: rgba(18, 18, 35, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15), 0 0 60px rgba(59, 130, 246, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* Ensure hidden attribute always wins over CSS display */
[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* ===== Animated Background Orbs ===== */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-start), transparent 70%);
  top: -10%;
  left: -10%;
  animation: orb-float-1 18s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-end), transparent 70%);
  top: 40%;
  right: -8%;
  animation: orb-float-2 22s ease-in-out infinite;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  bottom: -5%;
  left: 30%;
  animation: orb-float-3 20s ease-in-out infinite;
}

.orb-4 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  top: 20%;
  left: 50%;
  animation: orb-float-4 25s ease-in-out infinite;
}

@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, 60px) scale(1.1); }
  50% { transform: translate(40px, 120px) scale(0.95); }
  75% { transform: translate(-30px, 80px) scale(1.05); }
}

@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-60px, 40px) scale(1.08); }
  50% { transform: translate(-100px, -30px) scale(0.92); }
  75% { transform: translate(-40px, -60px) scale(1.04); }
}

@keyframes orb-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(70px, -50px) scale(1.1); }
  66% { transform: translate(-50px, -80px) scale(0.9); }
}

@keyframes orb-float-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-60px, 50px) scale(1.15); }
  40% { transform: translate(40px, 90px) scale(0.85); }
  60% { transform: translate(80px, 20px) scale(1.05); }
  80% { transform: translate(20px, -40px) scale(0.95); }
}

/* ===== Header / Hero ===== */
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-start), var(--accent-end), transparent);
  opacity: 0.4;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: linear-gradient(
    135deg,
    #e8e8f0 0%,
    var(--accent-start) 25%,
    var(--accent-cyan) 50%,
    var(--accent-end) 75%,
    #e8e8f0 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hero-shimmer 6s ease-in-out infinite;
}

@keyframes hero-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-icon {
  display: inline-block;
  animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(5deg); }
}

.subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  margin-top: 0.6rem;
  font-weight: 400;
  opacity: 0;
  animation: subtitle-fade-in 1s ease 0.4s forwards;
}

@keyframes subtitle-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Hero Particles ===== */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-start);
  opacity: 0;
  animation: particle-drift 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 15%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.particle:nth-child(2) { left: 75%; top: 30%; animation-delay: 1.2s; animation-duration: 9s; background: var(--accent-end); }
.particle:nth-child(3) { left: 40%; top: 60%; animation-delay: 2.4s; animation-duration: 6s; }
.particle:nth-child(4) { left: 85%; top: 70%; animation-delay: 0.8s; animation-duration: 8s; background: var(--accent-cyan); }
.particle:nth-child(5) { left: 25%; top: 80%; animation-delay: 3s; animation-duration: 10s; background: var(--accent-end); }
.particle:nth-child(6) { left: 60%; top: 15%; animation-delay: 1.8s; animation-duration: 7.5s; background: var(--accent-cyan); }

@keyframes particle-drift {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  15% { opacity: 0.7; }
  50% { opacity: 0.4; transform: translate(20px, -30px) scale(1.2); }
  85% { opacity: 0.6; }
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
}

/* ===== Form Glow Wrapper (Animated Gradient Border) ===== */
.form-glow-wrapper {
  position: relative;
  border-radius: calc(var(--radius-lg) + 3px);
  padding: 3px;
  background: conic-gradient(
    from var(--angle),
    var(--accent-start),
    var(--accent-end),
    var(--accent-cyan),
    var(--accent-start)
  );
  animation: rotate-border 6s linear infinite;
  box-shadow: var(--shadow-glow);
}

@keyframes rotate-border {
  to { --angle: 360deg; }
}

/* ===== Form Glassmorphism ===== */
.input-form {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Staggered fade-in for form elements */
.stagger-1, .stagger-2, .stagger-3, .stagger-4 {
  opacity: 0;
  animation: stagger-in 0.6s var(--ease-spring) forwards;
}
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

@keyframes stagger-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Labels ===== */
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

/* ===== Inputs & Textarea & Select ===== */
.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  outline: none;
  width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  transition: color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), inset 0 0 20px rgba(124, 58, 237, 0.05);
  background: rgba(10, 10, 20, 0.8);
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
  color: rgba(160, 160, 184, 0.5);
}

.form-group input:focus + label,
.form-group textarea:focus + label {
  color: var(--accent-start);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

/* ===== Generate Button ===== */
.btn-generate {
  position: relative;
  background: var(--accent-gradient);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.3s;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  animation: btn-gradient-move 3s ease infinite;
  letter-spacing: 0.01em;
}

.btn-generate[class*="stagger"] {
  animation: stagger-in 0.6s var(--ease-spring) forwards, btn-gradient-move 3s ease infinite;
  animation-delay: 0.4s, 0s;
}

@keyframes btn-gradient-move {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-generate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.4), 0 0 40px rgba(124, 58, 237, 0.15);
}

.btn-generate:hover:not(:disabled)::before {
  opacity: 1;
}

.btn-generate:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-generate:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Ripple effect */
.btn-generate .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* Sparkle animation */
.sparkle {
  display: inline-block;
  animation: sparkle-pulse 2s ease-in-out infinite;
}

@keyframes sparkle-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  50% { transform: scale(1.25) rotate(15deg); filter: brightness(1.3); }
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.loading-text {
  font-weight: 600;
}

/* Animated gradient ring spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, var(--accent-start) 50%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
  animation: spin 0.8s linear infinite;
}

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

/* ===== Shimmer Progress Bar ===== */
.shimmer-bar {
  height: 3px;
  border-radius: 3px;
  background: rgba(124, 58, 237, 0.15);
  overflow: hidden;
  position: relative;
}

.shimmer-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent-start) 30%,
    var(--accent-cyan) 60%,
    transparent 100%
  );
  animation: shimmer-move 1.5s ease-in-out infinite;
  will-change: transform;
}

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

/* ===== Elapsed Time ===== */
.elapsed-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  justify-content: center;
}

.elapsed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-start);
  animation: elapsed-pulse 1.5s ease-in-out infinite;
}

@keyframes elapsed-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ===== Error Message (inline, mostly hidden in favor of toasts) ===== */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  animation: error-shake 0.4s var(--ease-spring);
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 400px;
  width: calc(100% - 2.5rem);
}

.toast {
  pointer-events: auto;
  background: rgba(20, 20, 40, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  color: #fca5a5;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  animation: toast-in 0.4s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #ef4444, #f97316);
  border-radius: 3px 0 0 3px;
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.toast-text {
  flex: 1;
  line-height: 1.45;
}

.toast-dismiss {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.15s;
}

.toast-dismiss:hover {
  color: var(--text-primary);
}

.toast.toast-exit {
  animation: toast-out 0.3s ease forwards;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef4444, #f97316);
  animation: toast-progress 5s linear forwards;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ===== Output Section ===== */
.output-section {
  margin-top: 2rem;
  animation: output-appear 0.5s var(--ease-spring);
}

@keyframes output-appear {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Panel Tabs (Mobile Only) ===== */
.panel-tabs {
  display: none;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.panel-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.panel-tab.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-start);
  color: var(--text-primary);
}

.panel-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
}

/* ===== Panels Grid ===== */
.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.25rem;
}

/* ===== Panels ===== */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  animation: panel-slide-up 0.5s var(--ease-spring) backwards;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.2s; }

@keyframes panel-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Panel gradient underline accent */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
}

.panel-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end), var(--accent-cyan));
  opacity: 0.6;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Thinking panel header is a button */
.thinking-panel .panel-header {
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  transition: background 0.2s;
}

.thinking-panel .panel-header:hover {
  background: rgba(124, 58, 237, 0.08);
}

.toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.25s var(--ease-spring);
}

.thinking-panel.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.thinking-panel.collapsed .panel-body {
  display: none;
}

.panel-body {
  padding: 1rem;
  overflow-y: auto;
  max-height: 500px;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Thinking panel pulse while streaming */
.thinking-panel.streaming .panel-header::after {
  animation: thinking-pulse-bar 1.5s ease-in-out infinite;
}

@keyframes thinking-pulse-bar {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.thinking-panel.streaming .panel-header .panel-title::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-start);
  margin-left: 0.5rem;
  animation: thinking-dot 1s ease-in-out infinite;
}

@keyframes thinking-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* ===== Status Panel ===== */
.status-panel {
  max-width: 400px;
  margin: 1.5rem auto 0;
  animation: status-appear 0.4s var(--ease-spring);
}

@keyframes status-appear {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-steps {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.3s, opacity 0.3s;
  opacity: 0.35;
  position: relative;
}

.status-step.active {
  opacity: 1;
  background: rgba(124, 58, 237, 0.08);
}

.status-step.completed {
  opacity: 0.7;
}

.status-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.status-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.status-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity 0.3s;
  min-height: 1rem;
}

.status-step.active .status-detail {
  color: var(--accent-start);
  opacity: 0.8;
  animation: detail-fade 0.3s ease;
}

@keyframes detail-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 0.8; transform: translateY(0); }
}

.status-step.active .status-label {
  color: var(--text-primary);
}

.status-check {
  font-size: 0.8rem;
  color: #28c840;
  opacity: 0;
  transition: opacity 0.3s;
  flex-shrink: 0;
}

.status-step.completed .status-check {
  opacity: 1;
}

.status-step.active .status-icon {
  animation: status-icon-pulse 1.2s ease-in-out infinite;
}

@keyframes status-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ===== Copy Button ===== */
.btn-copy {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-copy:hover:not(:disabled) {
  background: var(--accent-start);
  color: #fff;
  border-color: var(--accent-start);
  transform: scale(1.05);
}

.btn-copy:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.btn-copy.copied {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  animation: copy-bounce 0.4s var(--ease-spring);
}

@keyframes copy-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== Tool Modal Close Button (shared) ===== */
.tool-modal-close {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.tool-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ===== Generation Modal ===== */
.gen-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-bg-in 0.3s ease;
}

.gen-modal-overlay.closing {
  animation: modal-bg-out 0.3s ease forwards;
}

.gen-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: min(95vw, 800px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.4s var(--ease-spring);
  transition: height 0.4s var(--ease-spring);
}

.gen-modal-overlay.closing .gen-modal {
  animation: modal-out 0.25s ease forwards;
}

.gen-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.gen-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.gen-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.gen-modal-iframe {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: status-appear 0.4s var(--ease-spring);
}

.gen-modal-iframe iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

.gen-modal-actions {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
  animation: status-appear 0.4s var(--ease-spring);
}

.gen-modal-done {
  text-align: center;
  padding: 1rem 0;
}

.gen-modal-done-text {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-line {
  height: 1px;
  margin: 0 auto 1.25rem;
  max-width: 200px;
  background: linear-gradient(90deg, transparent, var(--accent-start), var(--accent-end), transparent);
  opacity: 0.4;
}

.heart-icon {
  display: inline-block;
  animation: heart-beat 2s ease-in-out infinite;
}

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

/* ===== Scrollbar Styling ===== */
.panel-body::-webkit-scrollbar {
  width: 6px;
}

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

.panel-body::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.25);
  border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.4);
}

/* ===== Selection ===== */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .site-header {
    padding: 2.5rem 1rem 1.75rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .container {
    padding: 1.25rem 0.75rem;
  }

  .input-form {
    padding: 1.5rem;
  }

  /* Mobile tabs */
  .panel-tabs {
    display: flex;
  }

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

  /* Hide inactive panel on mobile */
  .panel[data-panel-id="thinking"].mobile-hidden,
  .panel[data-panel-id="code"].mobile-hidden {
    display: none;
  }

  /* Hide desktop panel headers on mobile (tabs replace them) */
  .panel .panel-header {
    /* Keep visible for thinking toggle functionality */
  }

  .panel-body {
    max-height: 350px;
  }

  .terminal-body {
    max-height: 250px;
  }

  .form-glow-wrapper {
    padding: 2px;
  }
}

@media (max-width: 400px) {
  .site-header {
    padding: 2rem 0.75rem 1.25rem;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .btn-generate {
    font-size: 0.95rem;
    padding: 0.8rem 1.2rem;
  }

  .input-form {
    padding: 1.25rem;
  }

  .toast-container {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }
}

/* ===== Example Cards ===== */
.examples-section {
  margin-top: 1.5rem;
}

.examples-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  text-align: center;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}

.example-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-sans);
  color: var(--text-primary);
}

.example-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--accent-start);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.2);
}

.example-card:active {
  transform: translateY(0) scale(0.97);
}

.example-icon {
  font-size: 1.5rem;
}

.example-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

.surprise-card {
  border: 1px dashed var(--accent-start);
  background: rgba(124, 58, 237, 0.06);
}

.surprise-card:hover {
  background: rgba(124, 58, 237, 0.12);
  border-style: solid;
}

@media (max-width: 500px) {
  .examples-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .example-card {
    padding: 0.65rem 0.3rem;
  }
  .example-icon {
    font-size: 1.2rem;
  }
  .example-name {
    font-size: 0.7rem;
  }
}

/* ===== Intro Loading Screen ===== */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.intro-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-content {
  text-align: center;
  animation: intro-appear 0.8s ease forwards;
}

@keyframes intro-appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-logo {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: intro-pulse 2s ease-in-out infinite;
}

@keyframes intro-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.3); }
}

.intro-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.intro-tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.3rem;
}

.intro-loader {
  width: 200px;
  height: 3px;
  background: var(--border-color);
  border-radius: 3px;
  margin: 1.5rem auto 0.75rem;
  overflow: hidden;
}

.intro-loader-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 3px;
  animation: intro-load 2.5s ease-in-out forwards;
}

@keyframes intro-load {
  0% { width: 0%; }
  20% { width: 30%; }
  50% { width: 60%; }
  80% { width: 85%; }
  100% { width: 100%; }
}

.intro-status {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Beta Modal ===== */
.beta-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-bg-in 0.3s ease;
}

@keyframes modal-bg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.beta-modal-overlay.closing {
  animation: modal-bg-out 0.3s ease forwards;
}

@keyframes modal-bg-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.beta-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.4s var(--ease-spring);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.beta-modal-overlay.closing .beta-modal {
  animation: modal-out 0.25s ease forwards;
}

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

.beta-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.beta-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.75rem;
}

.beta-modal-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.beta-modal-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.beta-modal-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.7rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.beta-modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.beta-modal-btn:active {
  transform: translateY(0);
}

/* ===== Bug Report ===== */
.bug-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9990;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bug-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.bug-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-bg-in 0.3s ease;
}

.bug-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: min(95vw, 400px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.4s var(--ease-spring);
}

.bug-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.bug-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.bug-modal-body {
  padding: 1rem;
}

.bug-modal-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.bug-status {
  margin-top: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
}

.bug-status.success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bug-status.error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===== Site Navigation ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.nav-brand:hover {
  opacity: 0.8;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-sep {
  color: var(--text-muted);
  margin: 0 0.25rem;
  font-size: 0.85rem;
}

.nav-register {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.nav-auth-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-username {
  color: var(--accent-start);
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.nav-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

@media (max-width: 600px) {
  .site-nav {
    padding: 0.6rem 1rem;
  }
  .nav-links {
    gap: 0.75rem;
  }
  .nav-links a {
    font-size: 0.8rem;
  }
}

/* ===== Auth Pages ===== */
.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1rem;
  min-height: calc(100vh - 60px);
}

.auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.4s var(--ease-spring);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-form .btn-generate {
  margin-top: 0.5rem;
  width: 100%;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-footer a {
  color: var(--accent-start);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: var(--accent-end);
}

/* ===== Marketplace ===== */
.marketplace-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.marketplace-header {
  text-align: center;
  margin-bottom: 2rem;
}

.marketplace-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  background: var(--accent-gradient-wide);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.marketplace-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.marketplace-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

.marketplace-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.marketplace-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.empty-text {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.btn-inline {
  display: inline-flex;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-start);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.2);
}

.tool-card-body {
  padding: 1.25rem;
  flex: 1;
}

.tool-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.tool-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-tag {
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-start);
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tool-card-uses {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* ===== Environment Page ===== */
.env-layout {
  display: flex;
  height: calc(100vh - 52px);
  position: relative;
  z-index: 1;
}

.env-preview {
  flex: 7;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border-color);
}

.env-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.env-tool-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-preview-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-env-action {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn-env-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-env-submit {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

.btn-env-submit:hover {
  opacity: 0.9;
  color: #fff;
}

.env-iframe-wrapper {
  flex: 1;
  background: #fff;
  overflow: hidden;
}

.env-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Chat Panel */
.env-chat {
  flex: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-secondary);
}

.env-chat-header {
  padding: 0.6rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.env-chat-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.env-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.env-chat-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 2rem;
  line-height: 1.6;
}

.env-msg {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.env-msg-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.env-msg-user .env-msg-label {
  color: var(--accent-start);
}

.env-msg-assistant .env-msg-label {
  color: var(--accent-cyan);
}

.env-msg-system .env-msg-label {
  color: var(--text-muted);
}

.env-msg-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-tertiary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.env-msg-user .env-msg-content {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.2);
}

.env-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.env-chat-textarea {
  flex: 1;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 120px;
  transition: border-color 0.2s;
}

.env-chat-textarea::placeholder {
  color: var(--text-muted);
}

.env-chat-textarea:focus {
  border-color: var(--accent-start);
}

.btn-env-send {
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-env-send:hover:not(:disabled) {
  transform: scale(1.05);
}

.btn-env-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-env-send-icon {
  font-size: 1rem;
}

/* Environment Chat scrollbar */
.env-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.env-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.env-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.2);
  border-radius: 3px;
}

.env-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.35);
}

/* ===== Generic Modal (Submit to Marketplace) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-bg-in 0.3s ease;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: min(95vw, 480px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.4s var(--ease-spring);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body .auth-form {
  gap: 1rem;
}

.modal-body .auth-form .btn-generate {
  margin-top: 0.5rem;
}

/* ===== Environment Responsive ===== */
@media (max-width: 768px) {
  .env-layout {
    flex-direction: column;
    height: calc(100vh - 52px);
  }

  .env-preview {
    flex: 1;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    min-height: 40vh;
  }

  .env-chat {
    flex: 1;
    min-height: 35vh;
  }

  .marketplace-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ===== Queue Panel ===== */
.queue-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  animation: status-appear 0.4s var(--ease-spring);
}

.queue-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.queue-icon {
  font-size: 1.2rem;
  animation: status-icon-pulse 1.2s ease-in-out infinite;
}

.queue-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.queue-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.queue-position {
  font-size: 0.85rem;
  color: var(--accent-start);
  font-weight: 600;
}

.queue-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.queue-progress {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.queue-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.queue-cancel {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  transition: all 0.15s;
}

.queue-cancel:hover {
  border-color: #f87171;
  color: #f87171;
}

/* ===== Fork Styles ===== */
.tool-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  font-size: 0.75rem;
}

.tool-card-author {
  color: var(--text-muted);
}

.tool-card-fork-badge {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent-start);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

.tool-card-forks {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.tool-card-fork-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  transition: all 0.15s;
}

.tool-card-fork-btn:hover {
  border-color: var(--accent-start);
  color: var(--accent-start);
}

.tool-card-fork-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fork-banner {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  background: rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-sm);
  margin-left: auto;
  white-space: nowrap;
}

.fork-banner a {
  color: var(--accent-start);
  text-decoration: none;
  font-weight: 600;
}

.fork-banner a:hover {
  text-decoration: underline;
}

/* ===== Dashboard ===== */
.dashboard-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.dashboard-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  background: var(--accent-gradient-wide);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.dashboard-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Tab Bar */
.dashboard-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dashboard-tabs::-webkit-scrollbar {
  display: none;
}

.dashboard-tab {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}

.dashboard-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s var(--ease-smooth);
}

.dashboard-tab:hover {
  color: var(--text-secondary);
}

.dashboard-tab.active {
  color: var(--text-primary);
  font-weight: 600;
}

.dashboard-tab.active::after {
  transform: scaleX(1);
}

/* Panel */
.dashboard-panel {
  min-height: 200px;
}

.dashboard-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dashboard-empty {
  text-align: center;
  padding: 3rem 1rem;
}

/* History Table */
.dashboard-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dashboard-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.dashboard-table th {
  text-align: left;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.dashboard-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.dashboard-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.06);
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

.history-name {
  font-weight: 600;
}

.history-date {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.history-result-link {
  color: var(--accent-start);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}

.history-result-link:hover {
  text-decoration: underline;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-completed {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-processing {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-failed {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-cancelled {
  background: rgba(156, 163, 175, 0.12);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.2);
}

.status-queued {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
  .dashboard-container {
    padding: 1.5rem 1rem;
  }

  .dashboard-tabs {
    gap: 0;
  }

  .dashboard-tab {
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* ============================================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   Targets: iPhone 15 / Safari iOS / low-GPU devices
   Reduces GPU compositing layers, eliminates backdrop-filter,
   and disables decorative infinite animations.
   ============================================================ */
@media (max-width: 768px) {

  /* ── 1. Kill background orbs (filter:blur(80px) + infinite anim) ── */
  .bg-orbs {
    display: none;
  }

  /* ── 2. Kill hero particles (6× infinite animations) ── */
  .hero-particles {
    display: none;
  }

  /* ── 3. Replace backdrop-filter with solid opaque backgrounds ── */
  .site-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 10, 20, 0.97);
  }

  .input-form {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 35, 0.97);
  }

  .panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(24, 24, 48, 0.97);
  }

  .toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(20, 20, 40, 0.97);
  }

  .example-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 35, 0.95);
  }

  .tool-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 35, 0.95);
  }

  .queue-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 35, 0.97);
  }

  .auth-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 35, 0.97);
  }

  .gen-modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .beta-modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .bug-modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .dashboard-table-wrapper {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 35, 0.95);
  }

  /* ── 4. Disable always-on decorative animations ── */

  /* Hero title shimmer (background-position infinite) */
  .hero-title {
    animation: none;
    background-size: 100% 100%;
    background-position: 0% 50%;
  }

  /* Hero icon float */
  .hero-icon {
    animation: none;
  }

  /* Form glow border rotation (@property + conic-gradient) */
  .form-glow-wrapper {
    animation: none;
    background: var(--accent-gradient);
  }

  /* Generate button gradient move */
  .btn-generate {
    animation: none;
  }

  .btn-generate[class*="stagger"] {
    animation: stagger-in 0.6s var(--ease-spring) forwards;
  }

  /* Sparkle pulse */
  .sparkle {
    animation: none;
  }

  /* Footer heart beat */
  .heart-icon {
    animation: none;
  }

  /* Intro screen pulse (only shows for 2.8s but still expensive) */
  .intro-logo {
    animation: none;
  }

  /* ── 5. Disable loading-state animations that aren't critical ── */

  /* Status icon pulse (decorative, not functional) */
  .status-step.active .status-icon {
    animation: none;
  }

  /* Queue icon pulse */
  .queue-icon {
    animation: none;
  }

  /* Thinking panel streaming indicators */
  .thinking-panel.streaming .panel-header::after {
    animation: none;
    opacity: 1;
  }

  .thinking-panel.streaming .panel-header .panel-title::after {
    animation: none;
  }

  /* Elapsed time dot pulse */
  .elapsed-dot {
    animation: none;
  }

  /* ── 6. Reduce hover transforms (GPU compositing on every card) ── */
  .example-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
  }

  .tool-card:hover {
    transform: none;
  }

  .btn-generate:hover:not(:disabled) {
    transform: none;
  }

  /* ── 7. Simplify the conic-gradient border ── */
  .form-glow-wrapper {
    padding: 2px;
  }

  /* ── 8. Reduce stagger animation distance ── */
  @keyframes stagger-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ===== User Profile Page ===== */
.user-profile-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

.user-profile-header {
  margin-bottom: 2rem;
}

.user-profile-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.user-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-profile-details {
  flex: 1;
}

.user-profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.user-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.user-profile-stat {
  color: var(--text-secondary);
}

.user-profile-stat strong {
  color: var(--accent-start);
  font-weight: 600;
}

.user-profile-joined {
  color: var(--text-muted);
}

.user-profile-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}

.user-profile-tabs .dashboard-tab {
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
}

.user-profile-tabs .dashboard-tab.active {
  border-bottom-color: var(--accent-start);
}

/* ===== Author Link Styles ===== */
.tool-card-author-link {
  color: var(--accent-start);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.tool-card-author-link:hover {
  color: var(--accent-end);
  text-decoration: underline;
}

.tool-card-fork-origin-wrap {
  margin-top: 0.5rem;
}

.tool-card-fork-origin {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tool-card-fork-origin .tool-card-author-link {
  font-weight: 400;
}

/* ===== Nav Username Link ===== */
.nav-username {
  color: var(--accent-start);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-username:hover {
  color: var(--accent-end);
  text-decoration: underline;
}

/* ===== Read-Only Banner (Environment Page) ===== */
.readonly-banner {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 1rem;
  grid-column: 1 / -1;
}

.readonly-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
}

.readonly-banner-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.readonly-banner-text .tool-card-author-link {
  font-weight: 600;
}

.btn-fork-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-fork-edit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-fork-edit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Owner Info (Environment Page) ===== */
.env-owner-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.env-owner-info .tool-card-author-link {
  font-weight: 500;
}

/* ===== Dashboard: Link to Profile ===== */
.dashboard-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-start);
  text-decoration: none;
  transition: color 0.2s ease;
}

.dashboard-profile-link:hover {
  color: var(--accent-end);
  text-decoration: underline;
}

/* ===== Floating Generation Widget ===== */
.gen-widget {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 9990;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: widget-slide-in 0.4s var(--ease-spring);
  max-width: 320px;
}

@keyframes widget-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gen-widget.hiding {
  animation: widget-slide-out 0.3s ease forwards;
}

@keyframes widget-slide-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

.gen-widget-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.gen-widget-icon {
  font-size: 1.5rem;
  animation: status-icon-pulse 1.2s ease-in-out infinite;
}

.gen-widget-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gen-widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gen-widget-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gen-widget-action {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.gen-widget-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

.gen-widget-dismiss:hover {
  color: var(--text-primary);
}

@media (max-width: 500px) {
  .gen-widget {
    left: 1rem;
    right: 1rem;
    max-width: unset;
  }
}
