:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #0d9488;
  --secondary-light: #ccfbf1;
  --accent: #7c3aed;
  --accent-light: #ede9fe;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --radius: 0.5rem;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

#app { min-height: 100vh; }

/* Typography */
h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  font-weight: 500; font-size: 0.875rem;
  border: none; cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  gap: 0.5rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--background); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--background); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-icon { padding: 0.5rem; }

/* Inputs */
.input, .textarea, .select {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; background: var(--surface);
  transition: border-color 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.textarea { resize: vertical; min-height: 80px; }
.label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.875rem; }

/* Cards */
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-header { margin-bottom: 1rem; }

/* Badge */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.5rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--background); color: var(--text-secondary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* Header */
.header {
  background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-content {
  max-width: 1200px; margin: 0 auto;
  padding: 1rem; display: flex;
  align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-img { height: 32px; width: auto; }
.logo-icon {
  width: 2rem; height: 2rem; background: var(--primary);
  border-radius: 0.5rem; display: flex;
  align-items: center; justify-content: center;
}
.logo-icon svg { width: 1.25rem; height: 1.25rem; fill: white; }
.logo-text { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Spacing */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }

/* Text */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.font-semibold { font-weight: 600; }

/* Hero section */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 50%, var(--accent-light) 100%);
  padding: 4rem 1rem;
}
.hero-title { font-size: 2.5rem; margin-bottom: 1rem; }
.hero-title .highlight { color: var(--primary); }
@media (min-width: 768px) { .hero-title { font-size: 3.5rem; } }

/* Feature cards */
.feature-card {
  padding: 1.5rem; border: 2px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon-primary { background: var(--primary-light); color: var(--primary); }
.feature-icon-secondary { background: var(--secondary-light); color: var(--secondary); }
.feature-icon-accent { background: var(--accent-light); color: var(--accent); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0;
  min-width: 150px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 0.25rem;
  display: none; z-index: 100; margin-top: 0.25rem;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu-right { right: 0; left: auto; }
.dropdown-header {
  padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border); margin-bottom: 0.25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: calc(var(--radius) - 2px);
  cursor: pointer; font-size: 0.875rem;
  width: 100%; border: none; background: none; text-align: left;
  color: var(--text); text-decoration: none;
}
.dropdown-item:hover { background: var(--background); }

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem; color: white;
  cursor: pointer; border: 2px solid transparent;
  transition: border-color 0.2s;
}
.avatar:hover { border-color: var(--primary); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  max-width: 400px; width: 100%; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; gap: 0.5rem; justify-content: flex-end;
}

/* Video uploader */
.video-uploader {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.video-uploader:hover, .video-uploader.dragover {
  border-color: var(--primary); background: var(--primary-light);
}
.video-preview {
  position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden;
}
.video-preview video { width: 100%; max-height: 280px; object-fit: contain; }
.video-remove {
  position: absolute; top: 0.5rem; right: 0.5rem;
}

/* Editor layout */
.editor-layout {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr 1fr; }
}
.editor-header {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.editor-header-spacer { flex: 1; }
.editor-header-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
@media (max-width: 640px) {
  .editor-header { flex-direction: column; align-items: stretch; }
  .editor-title-wrapper { width: 100%; }
  .editor-header-spacer { display: none; }
  .editor-header-actions { justify-content: flex-end; width: 100%; }
}
.editor-title {
  flex: 1; min-width: 200px;
  border: none; background: transparent;
  font-size: 1.25rem; font-weight: 600;
  padding: 0.25rem;
}
.editor-title:focus { outline: none; }

/* Flowchart */
.flowchart-panel { overflow-y: auto; max-height: calc(100vh - 200px); }
.node-card-wrapper { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.5rem; }
.node-number {
  min-width: 36px; height: 36px; background: var(--primary);
  color: white; font-weight: 700; font-size: 0.875rem;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 0.75rem;
}
.node-card {
  flex: 1; padding: 0.75rem; border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all 0.2s;
}
.node-card:hover { border-color: var(--primary); }
.node-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.node-card.choice { border-left: 4px solid var(--primary); }
.node-card.text { border-left: 4px solid var(--secondary); }
.node-card.end { border-left: 4px solid var(--success); }
.node-thumbnail {
  width: 60px; height: 80px; background: var(--background);
  border-radius: calc(var(--radius) - 2px); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.node-thumbnail video { width: 100%; height: 100%; object-fit: cover; }
.node-connection {
  margin-left: 1.5rem; padding-left: 1rem;
  border-left: 2px dashed var(--border);
}

/* Survey Fullscreen */
.survey-fullscreen {
  position: fixed; inset: 0; background: #000;
  display: flex; flex-direction: column;
}
.survey-video-wrapper {
  position: relative; flex: 1; overflow: hidden;
}
.survey-fullscreen video {
  width: 100%; height: 100%; object-fit: contain;
}
.survey-fullscreen .play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); cursor: pointer;
}
.play-button-lg {
  width: 5rem; height: 5rem; background: rgba(255,255,255,0.95);
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.play-button-lg:hover { transform: scale(1.1); }
.play-button-lg svg { margin-left: 4px; color: var(--primary); }
.survey-options-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.survey-question-title {
  color: #fff; text-align: center; font-size: 1.1rem; font-weight: 600;
  margin-bottom: 0.75rem; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  max-width: 500px; margin-left: auto; margin-right: auto;
}
.survey-options-list {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 500px; margin: 0 auto;
}
.survey-option-btn {
  width: 100%; padding: 0.75rem 1rem;
  border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius);
  background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
  cursor: pointer; display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.95rem; text-align: left; color: #fff;
  transition: all 0.2s;
}
.survey-option-btn:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
.survey-option-btn.selected {
  background: var(--primary); border-color: var(--primary);
}
.survey-option-letter {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: rgba(255,255,255,0.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0; font-size: 0.85rem;
}
.survey-option-btn.selected .survey-option-letter {
  background: rgba(255,255,255,0.3);
}
.survey-text-input {
  max-width: 500px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.survey-text-input .textarea {
  background: rgba(255,255,255,0.95); border: none;
}
.survey-finish-btn {
  max-width: 300px; margin: 0 auto; display: block;
}
.survey-mute-btn {
  position: absolute; top: 1rem; right: 1rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: rgba(0,0,0,0.5); border: none;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 10;
}
.survey-mute-btn:hover { background: rgba(0,0,0,0.7); }

/* Legacy response styles */
.response-container { max-width: 600px; margin: 0 auto; }
.response-video {
  background: #000; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; position: relative;
}
.response-video video { width: 100%; aspect-ratio: 9/16; max-height: 60vh; object-fit: contain; }
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); cursor: pointer;
}
.play-button {
  width: 4rem; height: 4rem; background: rgba(255,255,255,0.9);
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
}
.response-options { padding: 1.5rem; }
.option-btn {
  width: 100%; padding: 1rem 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  display: flex; align-items: center; gap: 1rem;
  font-size: 1rem; text-align: left;
  transition: all 0.2s;
}
.option-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.option-letter {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
}

/* Progress bar */
.progress { height: 0.5rem; background: var(--border); border-radius: 9999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: width 0.3s ease; }

/* Stats cards */
.stat-card { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; background: var(--background); }
.table tr:hover { background: var(--background); }

/* Complete page */
.complete-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 50%, var(--accent-light) 100%);
  padding: 1rem;
}
.complete-icon {
  width: 4rem; height: 4rem; background: var(--success-light);
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}

/* Auth pages */
.auth-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 50%, var(--accent-light) 100%);
  padding: 1rem;
}
.auth-card { max-width: 400px; width: 100%; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
  width: 3rem; height: 3rem; background: var(--primary);
  border-radius: 0.75rem; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
}
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-error { background: var(--danger-light); color: var(--danger); padding: 0.75rem; border-radius: var(--radius); font-size: 0.875rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon {
  width: 4rem; height: 4rem; background: var(--background);
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header-content { padding: 0.75rem; }
  .hide-mobile { display: none; }
}

/* Loading */
.spinner {
  width: 1.5rem; height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
}

/* Divider with text */
.divider-text {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Record button */
.btn-record {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.75rem 1rem;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 1rem; cursor: pointer;
  font-weight: 500; font-size: 0.875rem;
  transition: all 0.2s;
}
.btn-record:hover { border-color: var(--danger); background: rgba(239, 68, 68, 0.05); }
.record-dot {
  width: 16px; height: 16px; background: var(--danger);
  border-radius: 50%; animation: pulse-record 1.5s ease-in-out infinite;
}
@keyframes pulse-record {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* Video Recording Container */
.video-recording-container {
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem; border: 2px solid var(--danger);
}
.recording-preview-wrapper {
  position: relative; border-radius: 8px; overflow: hidden;
  background: #000; aspect-ratio: 9/16; max-height: 360px; margin: 0 auto;
}
.recording-preview-wrapper video {
  width: 100%; height: 100%; object-fit: contain;
}
.preview-close-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: rgba(0,0,0,0.6); border: none;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 10;
}
.preview-close-btn:hover { background: rgba(0,0,0,0.8); }
.recording-indicator {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.6); padding: 6px 12px;
  border-radius: 20px; color: white; font-size: 0.75rem;
}
.record-dot-live {
  width: 10px; height: 10px; background: var(--danger);
  border-radius: 50%; animation: blink-record 1s ease-in-out infinite;
}
@keyframes blink-record {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.recording-progress-bar {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 2px; margin-top: 12px; overflow: hidden;
}
.recording-progress-fill {
  height: 100%; background: var(--danger);
  border-radius: 2px; transition: width 0.5s linear;
}

/* Toggle Switch */
.toggle-switch {
  display: flex; margin: 12px; align-items: center; gap: 0.5rem; cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
  width: 40px; height: 22px; background: var(--border);
  border-radius: 11px; position: relative; transition: background 0.2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(18px); }

/* Dashboard Styles */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4 { grid-template-columns: 1fr; } }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

.bar-chart {
  display: flex; align-items: flex-end; gap: 8px;
  height: 200px; padding-top: 20px;
}
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bar {
  width: 100%; min-height: 4px; background: var(--primary);
  border-radius: 4px 4px 0 0; position: relative;
  display: flex; justify-content: center; transition: height 0.3s;
}
.bar-value {
  position: absolute; top: -20px; font-size: 0.75rem;
  font-weight: 600; color: var(--text-primary);
}
.bar-label { font-size: 0.625rem; color: var(--text-muted); }

.survey-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius);
  background: var(--background); text-decoration: none;
  transition: background 0.2s;
}
.survey-list-item:hover { background: var(--bg-tertiary); }

.survey-card-link {
  text-decoration: none; display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.survey-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.detail-list { display: flex; flex-direction: column; gap: 16px; }
.detail-item {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.detail-item:last-child { border-bottom: none; padding-bottom: 0; }

.response-list { display: flex; flex-direction: column; gap: 12px; }
.response-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border-radius: var(--radius); background: var(--background);
}

.badge-sm { font-size: 0.625rem; padding: 2px 6px; }

/* Success colors */
:root {
  --success-light: rgba(34, 197, 94, 0.1);
  --bg-tertiary: rgba(0, 0, 0, 0.03);
}
[data-theme="dark"] {
  --bg-tertiary: rgba(255, 255, 255, 0.03);
}

/* Modal Styles */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.2s ease;
}
.modal-content {
  width: 100%; max-width: 400px; margin: 1rem;
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.modal-header h3 { margin: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Editor Title Wrapper */
.editor-title-wrapper {
  position: relative; flex: 1; max-width: 400px;
}
.editor-title {
  width: 100%; padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: transparent; font-size: 1.25rem; font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.editor-title:hover { border-color: var(--primary); background: var(--bg-tertiary); }
.editor-title:focus { border-style: solid; border-color: var(--primary); background: var(--card); outline: none; }
.editor-title-hint {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.editor-status { min-width: 80px; text-align: center; }

/* Publish Success Page */
.publish-success-card { max-width: 480px; }
.publish-success-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  background: var(--success-light); color: var(--success);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.publish-stats {
  display: flex; justify-content: center; gap: 2rem;
  padding: 1.5rem; background: var(--background); border-radius: var(--radius);
}
.publish-stat { text-align: center; }
.publish-stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.publish-stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* Text colors */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Add Question Button */
.add-question-btn {
  width: 100%; height: 64px; margin-top: 1rem;
  background: var(--background); border: 2px dashed var(--border);
  border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s;
}
.add-question-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* Add Option Button */
.add-option-btn {
  width: 100%; padding: 0.75rem 1rem; margin-top: 0.5rem;
  background: transparent; border: 1px dashed var(--border);
  border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--text-muted); font-size: 0.875rem; transition: all 0.2s;
}
.add-option-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* Unified Delete Button */
.btn-delete {
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--danger); cursor: pointer; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.btn-delete:hover { background: rgba(239, 68, 68, 0.1); }
.btn-delete-sm { width: 28px; height: 28px; }

/* Pricing Cards */
.pricing-card {
  position: relative; text-align: center; padding: 2rem;
  border: 2px solid var(--border); transition: all 0.2s;
}
.pricing-card:hover { border-color: var(--primary); transform: translateY(-4px); }
.pricing-current { border-color: var(--primary); background: var(--primary-light); }
.pricing-popular { border-color: var(--accent); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white; padding: 0.25rem 0.75rem;
  border-radius: 1rem; font-size: 0.75rem; font-weight: 600;
}
.pricing-current-badge {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--primary); color: white; padding: 0.25rem 0.5rem;
  border-radius: 0.25rem; font-size: 0.625rem; font-weight: 600;
}
.pricing-name { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.pricing-price { font-size: 2.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.pricing-period { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-features {
  list-style: none; text-align: left; margin-bottom: 1.5rem;
}
.pricing-features li {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features svg { color: var(--success); flex-shrink: 0; }

/* Modal Container Styles (overlay defined above at line 678) */
.modal-container {
  background: var(--card-bg, #fff); border-radius: 16px;
  padding: 2rem; max-width: 400px; width: 90%;
  text-align: center; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}
.modal-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  background: var(--bg-secondary, #f1f5f9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-icon svg { width: 32px; height: 32px; }
.modal-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; }
.modal-actions .btn { min-width: 100px; }

/* Modal plan details */
.modal-plan-details {
  background: var(--bg-secondary); border-radius: 12px;
  padding: 1rem; margin: 1rem 0; text-align: left;
}
.modal-plan-row {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.modal-plan-row:last-child { border-bottom: none; }
.modal-plan-label { color: var(--text-muted); }
.modal-plan-value { font-weight: 600; }

/* Response Detail Styles */
.response-answer-card { padding: 1.25rem; }
.response-answer-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem;
}
.response-answer-number {
  font-weight: 600; color: var(--primary); font-size: 0.875rem;
}
.response-video-preview { border-radius: 8px; overflow: hidden; }
.response-answer-value {
  display: flex; gap: 0.5rem; padding: 0.75rem;
  background: var(--bg-secondary); border-radius: 8px;
  margin-bottom: 0.75rem;
}
.response-answer-label { color: var(--text-muted); font-size: 0.875rem; }
.response-answer-text { font-weight: 500; }
.response-answer-time { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem; }

/* AI Assistant Full Screen Overlay - Independent class to avoid conflicts */
.ai-fullscreen-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  margin: 0; padding: 0;
  background: var(--bg-primary, #f8fafc);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
}
.ai-fullscreen-overlay .ai-dialog {
  position: relative;
  z-index: 100000;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #0f172a);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 90%; width: auto;
}
.ai-fullscreen-overlay .ai-dialog.ai-prompt-dialog {
  max-width: 420px; width: 90%;
  padding: 2rem; text-align: center;
}
.ai-fullscreen-overlay .ai-dialog.ai-form-dialog {
  max-width: 640px; width: 95%;
  padding: 0;
}
.ai-fullscreen-overlay .ai-dialog .modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border, #e2e8f0);
}
.ai-fullscreen-overlay .ai-dialog .modal-header h3 { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.ai-fullscreen-overlay .ai-dialog .modal-body { padding: 1.5rem; max-height: 70vh; overflow-y: auto; }
.ai-fullscreen-overlay .ai-dialog .modal-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary, #4f46e5), #818cf8);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white;
}
.ai-form .form-group { margin-bottom: 1rem; }
.ai-form .label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.875rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.textarea {
  width: 100%; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.875rem; resize: vertical;
  background: var(--bg-primary); color: var(--text-primary);
}
.textarea:focus { outline: none; border-color: var(--primary); }
.style-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.style-option {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 0.875rem;
  transition: all 0.2s;
}
.style-option:hover { border-color: var(--primary); }
.style-option.selected { border-color: var(--primary); background: rgba(99, 102, 241, 0.1); }
.style-option input { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* AI Preview */
.ai-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.ai-preview-header h4 { margin: 0; font-size: 1rem; }
.ai-preview-actions { display: flex; gap: 0.5rem; }
.ai-preview-content {
  background: var(--bg-secondary); border-radius: var(--radius);
  padding: 1rem; max-height: 400px; overflow-y: auto;
  font-family: monospace; font-size: 0.8rem; line-height: 1.5;
}
.ai-preview-content pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.spinner-sm {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-secondary); }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .style-options { flex-direction: column; }
  .style-option { width: 100%; justify-content: center; }
}

