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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background: #f5f5f7;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.subtitle {
  color: #6b6b7b;
  font-size: 1.1rem;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a2e;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid #e0e0e5;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #4f46e5;
}

.toggle-group {
  display: flex;
  gap: 24px;
  margin: 20px 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #3a3a4a;
}

.toggle-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #4f46e5;
}

.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn.primary {
  background: #4f46e5;
  color: white;
}

.btn.primary:hover:not(:disabled) {
  background: #4338ca;
}

.btn.secondary {
  background: #e0e0e5;
  color: #3a3a4a;
}

.btn.secondary:hover:not(:disabled) {
  background: #d0d0d5;
}

.hidden {
  display: none !important;
}

/* Progress Section */
.session-info {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #6b6b7b;
}

.session-info span {
  background: #f0f0f5;
  padding: 4px 12px;
  border-radius: 20px;
}

.progress-bar {
  height: 8px;
  background: #e0e0e5;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.9rem;
  color: #6b6b7b;
  text-align: center;
}

.steps-container {
  margin-top: 20px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.step-item.pending {
  background: #f5f5f7;
  color: #9a9aa5;
}

.step-item.active {
  background: #eef2ff;
  color: #4f46e5;
}

.step-item.complete {
  background: #ecfdf5;
  color: #059669;
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.step-item.pending .step-icon {
  background: #e0e0e5;
  color: #9a9aa5;
}

.step-item.active .step-icon {
  background: #4f46e5;
  color: white;
  animation: pulse 1.5s infinite;
}

.step-item.complete .step-icon {
  background: #059669;
  color: white;
}

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

.step-name {
  flex: 1;
  font-size: 0.95rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
  font-size: 1.25rem;
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}

.badge.blocking {
  background: #fee2e2;
  color: #991b1b;
}

.question-text {
  font-size: 1.05rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.option-btn {
  padding: 14px 16px;
  border: 2px solid #e0e0e5;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s;
}

.option-btn:hover {
  border-color: #4f46e5;
  background: #eef2ff;
}

.option-btn.selected {
  border-color: #4f46e5;
  background: #eef2ff;
}

.question-custom {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e5;
}

.question-custom label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.question-custom textarea {
  min-height: 80px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Plan Viewer */
.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.plan-content {
  background: #fafafa;
  border-radius: 12px;
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.plan-content h1 { font-size: 1.8rem; margin: 1.5rem 0 1rem; color: #1a1a2e; }
.plan-content h2 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; color: #3a3a4a; }
.plan-content h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; color: #4a4a5a; }
.plan-content ul { margin: 0.5rem 0 0.5rem 1.5rem; }
.plan-content li { margin: 0.25rem 0; }
.plan-content strong { color: #1a1a2e; }

/* Error Section */
.card.error {
  border-left: 4px solid #ef4444;
}

.card.error h2 {
  color: #ef4444;
}

#error-text {
  background: #fef2f2;
  padding: 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  overflow-x: auto;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 0 10px; }
  header h1 { font-size: 2rem; }
  .toggle-group { flex-direction: column; gap: 12px; }
  .modal { padding: 10px; }
}