/**
 * Genesis Singularity - Modern Minimal UI
 * v18.8.11: Linear/Vercel inspired design
 */

/* ==================== CSS VARIABLES ==================== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #171717;
  --bg-hover: #1a1a1a;
  --bg-active: #262626;

  --border-subtle: #262626;
  --border-default: #333333;
  --border-hover: #404040;

  --text-primary: #fafafa;
  --text-secondary: #a1a1a1;
  --text-tertiary: #737373;
  --text-muted: #525252;

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-subtle: rgba(59, 130, 246, 0.1);

  --success: #22c55e;
  --success-subtle: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.1);
  --error: #ef4444;
  --error-subtle: rgba(239, 68, 68, 0.1);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ==================== BASE STYLES ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;

  /* Millimeter paper grid - small lines + large lines */
  background-image:
    /* Large grid lines (every 100px) */
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    /* Small grid lines (every 20px) */
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
}

/* ==================== LAYOUT ==================== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error-subtle);
  color: var(--error);
  border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
  background: var(--error);
  color: white;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

/* ==================== INPUTS ==================== */
.input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:hover {
  border-color: var(--border-default);
}

.input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.input-lg {
  padding: 16px 20px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

textarea.input {
  resize: vertical;
  min-height: 120px;
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-hover {
  transition: all var(--transition-normal);
}

.card-hover:hover {
  border-color: var(--border-default);
  background: var(--bg-tertiary);
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-success {
  background: var(--success-subtle);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-subtle);
  color: var(--warning);
}

.badge-error {
  background: var(--error-subtle);
  color: var(--error);
}

.badge-accent {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

/* ==================== DIVIDER ==================== */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 24px 0;
}

/* ==================== HEADER ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}

.logo:hover {
  opacity: 0.8;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-primary);
}

.logo-text {
  font-weight: 600;
  font-size: 15px;
}

.logo-version {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  margin-left: 4px;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link-external svg {
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.nav-link-external:hover svg {
  opacity: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
}

/* Hide nav on mobile */
@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
}

/* ==================== LANDING PAGE ==================== */
.landing {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.landing-content {
  width: 100%;
  max-width: 680px;
  text-align: center;
}

.landing-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.landing-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.6;
}

.landing-input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.landing-input {
  width: 100%;
  padding: 20px 20px 56px 20px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  outline: none;
  resize: none;
  min-height: 140px;
  transition: all var(--transition-fast);
}

.landing-input::placeholder {
  color: var(--text-muted);
}

.landing-input:hover {
  border-color: var(--border-default);
}

.landing-input:focus {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.landing-input-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.landing-improve {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.landing-improve:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}

.landing-improve:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.landing-improve.loading svg {
  animation: spin 1s linear infinite;
}

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

.landing-submit {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.landing-submit:hover {
  background: var(--text-secondary);
}

.landing-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prompt-improve {
  font-size: 12px !important;
  padding: 4px 10px !important;
  gap: 4px;
}

.prompt-improve.loading svg {
  animation: spin 1s linear infinite;
}

.landing-examples {
  margin-top: 24px;
}

.landing-examples-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.landing-examples-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.example-btn {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.example-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.landing-footer {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.landing-footer-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.landing-footer-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

/* ==================== GENERATOR VIEW ==================== */
.generator {
  padding: 48px 24px;
}

.generator-header {
  text-align: center;
  margin-bottom: 40px;
}

.generator-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.generator-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Settings Sections */
.settings-section {
  margin-bottom: 32px;
}

.settings-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.settings-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
  .settings-grid-2,
  .settings-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Option Cards */
.option-card {
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-card:hover {
  border-color: var(--border-default);
}

.option-card.selected {
  border-color: var(--text-primary);
  background: var(--bg-tertiary);
}

.option-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.option-card-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-card-title {
  font-size: 14px;
  font-weight: 500;
}

.option-card-desc {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Language Pills */
.lang-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.lang-pill:hover {
  border-color: var(--border-default);
}

.lang-pill.selected {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.lang-pill input {
  display: none;
}

.lang-pill-check {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.lang-pill.selected .lang-pill-check {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.lang-pill.selected .lang-pill-check svg {
  display: block;
}

.lang-pill-check svg {
  display: none;
  width: 10px;
  height: 10px;
  color: white;
}

/* Collapsible Sections */
.collapsible {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.collapsible-header:hover {
  background: var(--bg-tertiary);
}

.collapsible-title {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.collapsible-icon {
  transition: transform var(--transition-normal);
}

.collapsible.open .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.collapsible.open .collapsible-content {
  display: block;
}

/* ==================== ROLE CARDS (AI Model Config) ==================== */
.role-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.role-card:hover {
  border-color: var(--border-default);
}

.role-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.role-card-header:hover {
  background: var(--bg-tertiary);
}

.role-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.role-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.role-card-model {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-tertiary);
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.role-card-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.role-card.open .role-card-chevron {
  transform: rotate(180deg);
}

.role-card-body {
  display: none;
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.role-card.open .role-card-body {
  display: block;
}

.role-card-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.role-card-field {
  margin-bottom: 10px;
}

.role-card-field:last-child {
  margin-bottom: 0;
}

.role-card-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.role-card-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: 500;
}

.role-card-field .input {
  padding: 8px 12px;
  font-size: 13px;
}

.role-card-field select.input {
  padding-right: 32px;
}

/* Temperature slider */
.role-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.role-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.role-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.role-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-primary);
  cursor: pointer;
}

/* ==================== PROGRESS ==================== */
.progress-section {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.progress-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-info {
  flex: 1;
}

.progress-message {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.progress-bar-container {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* Log Panel */
.log-panel {
  margin-top: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.log-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.log-panel-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.log-panel-actions {
  display: flex;
  gap: 4px;
}

.log-panel-body {
  height: 240px;
  overflow-y: auto;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-entry {
  padding: 2px 0;
  color: var(--text-tertiary);
}

.log-entry[data-type="phase"] {
  color: var(--accent-primary);
  font-weight: 500;
  margin-top: 8px;
}

.log-entry[data-type="success"] {
  color: var(--success);
}

.log-entry[data-type="error"] {
  color: var(--error);
}

.log-entry[data-type="warning"] {
  color: var(--warning);
}

.log-timestamp {
  color: var(--text-muted);
  margin-right: 8px;
}

/* ==================== RESULT ==================== */
.result-section {
  text-align: center;
  padding: 48px 24px;
}

.result-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: var(--success-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-icon svg {
  width: 32px;
  height: 32px;
  color: var(--success);
}

.result-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ==================== ARTIFACTS ==================== */
.artifacts-section {
  margin-top: 48px;
}

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

.artifacts-title {
  font-size: 16px;
  font-weight: 600;
}

.artifacts-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.artifact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.artifact-item:hover {
  border-color: var(--border-default);
}

.artifact-info {
  flex: 1;
  min-width: 0;
}

.artifact-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.artifact-actions {
  display: flex;
  gap: 8px;
  margin-left: 16px;
}

.artifacts-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.artifacts-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-exit {
  animation: slideOut 0.2s ease forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--error);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info .toast-icon {
  color: var(--accent-primary);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.toast-close {
  flex-shrink: 0;
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--text-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  animation: progress linear forwards;
}

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

/* ==================== ANIMATIONS ==================== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.3s ease;
}

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

/* ==================== UTILITIES ==================== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* ==================== CELEBRATION MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.4s ease;
}

.modal-overlay.hidden {
  display: none;
}

#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.celebration-modal {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.celebration-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 3s ease-in-out infinite;
}

.celebration-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: var(--success-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.celebration-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--success);
}

.celebration-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  animation: textFadeIn 0.5s ease 0.3s both;
}

.celebration-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  animation: textFadeIn 0.5s ease 0.4s both;
}

.celebration-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  animation: textFadeIn 0.5s ease 0.5s both;
}

.celebration-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.celebration-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.celebration-stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.celebration-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

.celebration-download {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  gap: 10px;
  margin-bottom: 12px;
  animation: textFadeIn 0.5s ease 0.6s both;
  background: var(--success);
  border-color: var(--success);
}

.celebration-download:hover {
  background: #16a34a;
  border-color: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.celebration-close {
  width: 100%;
  animation: textFadeIn 0.5s ease 0.7s both;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes iconPop {
  from { opacity: 0; transform: scale(0.3); }
  50% { transform: scale(1.1); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* ==================== AUTH UI ==================== */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 12px 4px 4px; cursor: pointer; color: var(--text-primary);
  font-size: 13px; transition: border-color 0.15s;
}
.user-menu-btn:hover { border-color: var(--text-tertiary); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; }
.user-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; min-width: 220px; padding: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3); z-index: 100;
}
.user-dropdown-header {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px; font-size: 12px; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 4px;
}
.user-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--text-primary); font-size: 13px;
  transition: background 0.15s;
}
.user-dropdown-item:hover { background: var(--bg-tertiary); }
.user-dropdown-danger { color: var(--error); }
.user-dropdown-danger:hover { background: rgba(239,68,68,0.1); }

/* Auth Modal */
.auth-modal {
  max-width: 400px; width: 90vw; padding: 32px;
  position: relative;
}
.auth-modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-tertiary);
  font-size: 24px; cursor: pointer; padding: 4px;
  line-height: 1;
}
.auth-modal-close:hover { color: var(--text-primary); }
.auth-modal-header { text-align: center; margin-bottom: 24px; }
.auth-modal-header h2 { font-size: 20px; font-weight: 600; }
.auth-modal-body { display: flex; flex-direction: column; gap: 12px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.auth-btn-google {
  background: #fff; color: #333; border: 1px solid #ddd;
}
.auth-btn-google:hover { background: #f8f8f8; border-color: #ccc; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-tertiary); font-size: 12px; margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-email-form { display: flex; flex-direction: column; }

/* ==================== PRICING UI ==================== */
.pricing-modal {
  max-width: 900px; width: 95vw; padding: 32px;
  position: relative;
}
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 24px;
}
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; }
}
.pricing-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; position: relative;
  transition: border-color 0.2s;
}
.pricing-card:hover { border-color: var(--text-tertiary); }
.pricing-card-featured {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, rgba(59,130,246,0.05) 0%, var(--bg-secondary) 100%);
}
.pricing-card-featured:hover { border-color: var(--accent-primary); }
.pricing-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent-primary); color: #fff;
  padding: 2px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pricing-card-header { text-align: center; margin-bottom: 20px; }
.pricing-card-header h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 8px;
  color: var(--text-primary);
}
.pricing-price {
  font-size: 40px; font-weight: 700; color: var(--text-primary);
  line-height: 1;
}
.pricing-decimal { font-size: 20px; font-weight: 500; }
.pricing-desc {
  font-size: 13px; color: var(--text-secondary); margin-top: 4px;
}
.pricing-savings {
  font-size: 12px; color: var(--success); margin-top: 4px; font-weight: 500;
}
.pricing-features {
  list-style: none; padding: 0; margin: 0 0 20px;
  flex: 1;
}
.pricing-features li {
  padding: 6px 0; font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.pricing-features li::before {
  content: ''; display: inline-block;
  width: 16px; height: 16px; flex-shrink: 0;
  background: var(--success); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}
