:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --bg-hover: #1a1a1a;
  --bg-active: #222222;

  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;

  --border: #333333;
  --border-light: #444444;
  --border-focus: #666666;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.9);

  --transition: 150ms ease;
  --transition-slow: 300ms ease;

  --header-height: 64px;
  --footer-height: 48px;
  --sidebar-width: 240px;
  --builder-width: 320px;
}

.theme-light {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #eeeeee;
  --bg-hover: #e0e0e0;
  --bg-active: #d5d5d5;

  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #999999;

  --border: #cccccc;
  --border-light: #bbbbbb;
  --border-focus: #999999;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.7;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 45px;
  width: auto;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.version-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.nav-btn:hover {
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-btn.active {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-primary);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* Small icon button variant */
.icon-btn-sm {
  width: 28px;
  height: 28px;
}

.icon-btn-sm svg {
  width: 14px;
  height: 14px;
}

.main {
  flex: 1;
  overflow: hidden;
}

.view {
  display: none;
  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow: hidden;
}

.view.active {
  display: block;
  animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.techniques-layout {
  display: flex;
  height: 100%;
}

.techniques-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 0 48px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  animation: heroFadeIn 0.8s ease-out;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-models {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
  position: relative;
}

.hero-models::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-model-viewer {
  width: 190px;
  height: 190px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.hero-model-viewer:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hero-model-viewer.loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-model-viewer.hidden {
  display: none;
}

.hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-text {
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Hero responsive */
@media (max-width: 1024px) {
  .hero-model-viewer:nth-child(5) {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 24px 0 32px;
  }

  .hero-models {
    gap: 20px;
  }

  .hero-model-viewer {
    width: 120px;
    height: 120px;
  }

  .hero-model-viewer:nth-child(4),
  .hero-model-viewer:nth-child(5) {
    display: none;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hero-models {
    gap: 12px;
  }

  .hero-model-viewer {
    width: 100px;
    height: 100px;
  }

  .hero-title {
    font-size: 18px;
  }
}

.subject-input-container {
  margin-bottom: 20px;
}

.subject-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.subject-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.subject-input {
  width: 100%;
  padding: 12px 16px;
  padding-right: 44px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
}

.subject-input:focus {
  border-color: var(--text-primary);
}

.subject-input::placeholder {
  color: var(--text-muted);
}

.subject-input-container.has-value .subject-input {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.subject-input-container.has-value .subject-label::after {
  content: ' ✓';
  color: #22c55e;
  font-weight: 600;
}

.subject-clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.subject-clear:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.subject-clear svg {
  width: 16px;
  height: 16px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  gap: 8px;
}

.filter-select {
  padding: 10px 32px 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all var(--transition);
}

.theme-light .filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.filter-select:hover {
  border-color: var(--border-light);
}

.filter-select:focus {
  border-color: var(--text-primary);
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.results-count {
  color: var(--text-secondary);
  font-size: 14px;
  margin-left: auto;
}

.techniques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.technique-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.technique-card:hover {
  border-color: var(--border-light);
}

.technique-card.selected {
  border-color: var(--text-primary);
}

.technique-add-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--transition);
}

.technique-add-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.technique-card.selected .technique-add-btn {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-primary);
}

.technique-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-right: 36px;
}

.technique-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.technique-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
}

.badge-category {
  color: var(--text-secondary);
  border-color: var(--border);
}

.badge-basic,
.badge-intermediate,
.badge-advanced {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.technique-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.technique-prompt {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.technique-prompt::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(transparent, var(--bg-tertiary));
}

.technique-prompt.has-subject {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.05);
}

.technique-prompt.has-subject::after {
  background: linear-gradient(transparent, rgba(34, 197, 94, 0.05));
}

.technique-tips {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

.technique-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.technique-category {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.technique-difficulty {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty-basic {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.difficulty-intermediate {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.difficulty-advanced {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.technique-actions {
  display: flex;
  gap: 8px;
}

/* Technique card action buttons - make them clearly visible */
.technique-actions .btn-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
}

.technique-actions .btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.technique-actions .btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Add technique button (plus/minus) */
.technique-actions .add-technique {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}

.technique-card.selected .technique-actions .add-technique {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.prompt-builder {
  width: var(--builder-width);
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow), margin var(--transition-slow);
}

.prompt-builder.collapsed {
  width: 48px;
}

.prompt-builder.collapsed .prompt-builder-content {
  display: none;
}

.prompt-builder.collapsed .prompt-builder-header h3 {
  display: none;
}

.prompt-builder.collapsed #toggle-builder svg {
  transform: rotate(180deg);
}

.prompt-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.prompt-builder-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.prompt-builder-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.builder-section {
  margin-bottom: 20px;
}

.builder-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.selected-techniques {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.selected-technique-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.selected-technique-item button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selected-technique-item button:hover {
  color: var(--text-primary);
}

.combined-prompt {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  min-height: 100px;
}

.builder-actions {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.builder-actions .btn {
  flex: 1;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-sm svg {
  width: 12px;
  height: 12px;
}

.btn-primary {
  color: var(--bg-primary);
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-secondary {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
}

.btn-danger {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--text-primary);
}

.btn-danger:hover {
  color: var(--bg-primary);
  background: var(--text-primary);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.workspace-layout {
  display: flex;
  height: 100%;
}

.collections-sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
}

.collections-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.collections-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.collections-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.collection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.collection-item:hover {
  background: var(--bg-hover);
}

.collection-item.active {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}

.collection-name {
  font-size: 14px;
  color: var(--text-primary);
}

.collection-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
}

.workspace-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.workspace-header h2 {
  font-size: 24px;
  font-weight: 600;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.section-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.section-actions {
  display: flex;
  gap: 8px;
}

.dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--text-primary);
  border-style: solid;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
}

/* Video Frames Section */
.video-frames-section {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.video-frames-section .section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.video-frames-section .section-icon {
  width: 24px;
  height: 24px;
  color: #8b5cf6;
}

.dropzone-video {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.05);
  padding: 60px 20px;
}

.dropzone-video:hover,
.dropzone-video.drag-over {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.dropzone-video .dropzone-icon {
  width: 48px;
  height: 48px;
  color: #8b5cf6;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.dropzone-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.video-preview-container {
  margin-top: 16px;
}

.video-preview-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.video-preview {
  width: 100%;
  max-height: 300px;
  display: block;
}

.video-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.frame-count-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.frame-count-selector label {
  font-size: 14px;
  color: var(--text-secondary);
}

.frame-count-options {
  display: flex;
  gap: 4px;
}

.frame-count-btn {
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.frame-count-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.frame-count-btn.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: white;
}

.video-actions {
  display: flex;
  gap: 8px;
}

.video-actions .btn-primary {
  background: #8b5cf6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-actions .btn-primary:hover {
  background: #7c3aed;
}

.video-actions .btn-primary svg {
  width: 16px;
  height: 16px;
}

.extraction-progress {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.extraction-progress-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.extraction-progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: #8b5cf6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.extraction-progress.active .extraction-progress-bar::after {
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { width: 20%; margin-left: 0; }
  50% { width: 40%; margin-left: 60%; }
}

.extraction-progress-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.concept-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all var(--transition);
  background: var(--bg-tertiary);
}

.concept-item:hover {
  border-color: var(--border-light);
}

.concept-item.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.concept-item.compare-selected {
  border-color: var(--text-primary);
}

.concept-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.concept-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.8));
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
}

.concept-item:hover .concept-overlay {
  opacity: 1;
}

.concept-name {
  font-size: 12px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.concept-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.concept-item:hover .concept-checkbox,
.concept-item.selected .concept-checkbox,
.concept-item.compare-selected .concept-checkbox {
  opacity: 1;
}

.concept-item.selected .concept-checkbox,
.concept-item.compare-selected .concept-checkbox {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.concept-checkbox svg {
  width: 14px;
  height: 14px;
  color: var(--bg-primary);
}

.concept-star {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition);
  padding: 0;
}

.concept-item:hover .concept-star {
  opacity: 1;
}

.concept-star.active {
  color: var(--text-primary);
  opacity: 1;
}

.concept-star svg {
  width: 16px;
  height: 16px;
}

.concept-source {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 10px;
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.angle-checklist {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.angle-checklist h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.angle-progress {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.angle-progress-bar {
  height: 100%;
  background: var(--text-primary);
  transition: width var(--transition);
}

.angle-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.angle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.angle-item:hover {
  background: var(--bg-hover);
}

.angle-item input {
  accent-color: var(--text-primary);
}

.angle-suggest {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.selected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  min-height: 100px;
}

.selected-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--text-primary);
}

.selected-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.selected-item:hover .remove-btn {
  opacity: 1;
}

.models-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.model-item:hover {
  border-color: var(--border-light);
}

.model-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-preview {
  width: 48px;
  height: 48px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.model-preview canvas {
  width: 100%;
  height: 100%;
}

.model-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.model-icon svg {
  width: 24px;
  height: 24px;
}

.model-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-name {
  font-size: 14px;
  font-weight: 500;
}

.model-size {
  font-size: 12px;
  color: var(--text-muted);
}

.model-actions {
  display: flex;
  gap: 8px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--footer-height);
  padding: 0 24px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-left, .footer-center, .footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.powered-by {
  color: var(--text-muted);
}

.footer-link {
  color: var(--text-secondary);
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text-primary);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.theme-light .modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.modal-small {
  max-width: 360px;
}

.modal-large {
  max-width: 640px;
}

.modal-fullscreen {
  max-width: 95vw;
  max-height: 95vh;
  width: 95vw;
  height: 95vh;
}

.modal-preview {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  gap: 24px;
}

.modal-preview img {
  max-width: 60%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.modal-model {
  max-width: 800px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text-primary);
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.modal-content ol,
.modal-content ul {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.modal-content li {
  margin: 8px 0;
  line-height: 1.5;
}

.modal-content a {
  color: var(--text-primary);
}

.modal-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.modal-footer p {
  margin: 4px 0;
}

.powered-by-small {
  color: var(--text-muted);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.onboarding-step {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.step-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 50%;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-muted);
}

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--text-primary);
}

.onboarding-tip {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

/* Help Modal Extension Instructions */
.help-section {
  margin-bottom: 24px;
}

.help-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.help-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.help-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.help-section ol,
.help-section ul {
  margin: 12px 0;
  padding-left: 24px;
}

.help-section li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.help-section code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.extension-install-steps,
.extension-usage {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 8px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.shortcuts-table td:first-child {
  width: 120px;
}

.settings-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.setting-row.buttons {
  justify-content: flex-start;
}

.setting-row label {
  font-size: 14px;
  color: var(--text-primary);
}

.setting-input {
  flex: 1;
  max-width: 300px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}

.setting-input:focus {
  border-color: var(--text-primary);
}

.setting-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.setting-preview {
  font-size: 12px;
  color: var(--text-secondary);
}

.setting-preview span {
  font-family: monospace;
  color: var(--text-primary);
}

.toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 16px;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.extension-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-indicator.connected {
  background: #22c55e;
}

.status-indicator.disconnected {
  background: #ef4444;
}

.shortcuts-list {
  list-style: none;
  padding: 0;
}

.shortcuts-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.shortcuts-table td:first-child {
  width: 120px;
}

.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--border-light);
}

.history-prompt {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-time {
  font-size: 11px;
  color: var(--text-muted);
}

.history-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.history-delete:hover {
  color: var(--text-primary);
}

.compare-hint {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.compare-grid {
  display: grid;
  gap: 16px;
  height: calc(100% - 100px);
}

.compare-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.compare-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.compare-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.compare-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.compare-image-container {
  flex: 1;
  overflow: hidden;
  cursor: grab;
}

.compare-image-container:active {
  cursor: grabbing;
}

.compare-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
}

.compare-actions {
  padding: 8px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 250px;
}

.preview-name-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}

.preview-name-input:focus {
  border-color: var(--text-primary);
}

.preview-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-input {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}

.tag-input:focus {
  border-color: var(--text-primary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.tag button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.tag button:hover {
  color: var(--text-primary);
}

.preview-notes {
  flex: 1;
  min-height: 100px;
  padding: 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  resize: none;
}

.preview-notes:focus {
  border-color: var(--text-primary);
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.model-viewer {
  width: 100%;
  height: 400px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.model-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.context-menu {
  position: fixed;
  display: none;
  min-width: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  padding: 4px;
}

.context-menu.active {
  display: block;
}

.context-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.context-item:hover {
  background: var(--bg-hover);
}

.context-item.danger {
  color: #ef4444;
}

.context-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.tour-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: 300px;
}

.tour-content {
  background: var(--bg-secondary);
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.tour-content p {
  margin-bottom: 12px;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tour-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--text-primary);
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--text-primary);
  animation: slideIn var(--transition-slow);
  border-left: 2px solid var(--text-primary);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.fade-out {
  animation: slideOut var(--transition-slow) forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== BYOK (Bring Your Own Key) Styles ===== */

/* API Key Settings */
.api-key-row {
  margin-bottom: 20px;
}

.api-key-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.api-key-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-key-input {
  flex: 1;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.toggle-visibility {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.toggle-visibility:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toggle-visibility svg {
  width: 18px;
  height: 18px;
}

.api-key-status {
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.api-key-status.valid {
  color: #22c55e;
}

.api-key-status.invalid {
  color: #ef4444;
}

.api-key-status.testing {
  color: var(--text-secondary);
}

/* Generate Modal */
.modal-generate {
  max-width: 600px;
}

.generate-form {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.generate-textarea {
  width: 100%;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
}

.generate-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.generate-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.generate-status .spinner {
  width: 20px;
  height: 20px;
  margin-bottom: 0;
}

.generate-results h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.generate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.generate-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.generate-item:hover {
  border-color: var(--text-primary);
}

.generate-item.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.generate-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generate-item .select-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.generate-item.selected .select-indicator {
  opacity: 1;
}

.generate-item .select-indicator svg {
  width: 12px;
  height: 12px;
  color: var(--bg-primary);
}

.generate-actions {
  display: flex;
  gap: 8px;
}

.generate-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Convert Modal */
.modal-convert {
  max-width: 500px;
}

.convert-preview {
  width: 100%;
  max-height: 250px;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.convert-preview img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.convert-options {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.convert-options .form-group {
  flex: 1;
}

.convert-status {
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.convert-progress {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.convert-progress-bar {
  height: 100%;
  background: var(--text-primary);
  width: 0%;
  transition: width 0.3s ease;
}

.convert-result {
  padding: 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 24px;
}

.convert-result p {
  color: #22c55e;
  margin-bottom: 12px;
}

.convert-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.convert-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 16px;
}

/* BYOK Indicator */
.byok-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.byok-indicator svg {
  width: 10px;
  height: 10px;
}

/* BYOK actions in builder */
.byok-actions {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

.byok-actions .btn {
  width: 100%;
}

/* API enabled header badge */
.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
}

.api-badge.xai {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.api-badge.meshy {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

@media (max-width: 1024px) {
  .prompt-builder {
    display: none;
  }

  .collections-sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }

  .header-left {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .tagline {
    display: none;
  }

  .techniques-layout {
    flex-direction: column;
  }

  .techniques-main {
    padding: 16px;
  }

  .workspace-layout {
    flex-direction: column;
  }

  .collections-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 150px;
  }

  .collections-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }

  .collection-item {
    flex: 0 0 auto;
  }

  .workspace-main {
    padding: 16px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .search-container {
    max-width: none;
  }

  .filter-group {
    flex-direction: column;
  }

  .results-count {
    margin-left: 0;
    text-align: center;
  }

  .techniques-grid {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .workspace-actions .btn {
    flex: 1;
    min-width: 120px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-actions {
    width: 100%;
  }

  .section-actions .btn {
    flex: 1;
  }

  .footer {
    flex-direction: column;
    height: auto;
    padding: 16px;
    gap: 12px;
    text-align: center;
  }

  .modal-content {
    padding: 24px 16px;
    margin: 16px;
    max-height: calc(100vh - 32px);
  }

  .modal-preview {
    flex-direction: column;
  }

  .modal-preview img {
    max-width: 100%;
    max-height: 50vh;
  }

  .onboarding-steps {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .concepts-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .technique-actions {
    flex-direction: column;
  }

  .technique-actions .btn {
    width: 100%;
  }

  .compare-grid.grid-2,
  .compare-grid.grid-3,
  .compare-grid.grid-4 {
    grid-template-columns: 1fr;
  }
}
