/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #1e293b;
}
::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Tab active state */
.tab-btn {
  position: relative;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: #e2e8f0;
}
.tab-btn.active {
  color: #f1f5f9;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
  border-radius: 2px 2px 0 0;
}

/* Textarea monospace dark */
#snippet-input {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  resize: none;
  tab-size: 2;
}

/* Generated code block */
#generated-code {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Preview iframe */
#tp-preview,
#snippet-preview {
  border: none;
  width: 100%;
  height: 100%;
  background: #fff;
}

/* Input / select styles */
.field-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}
.field-input:focus {
  border-color: #3b82f6;
}
.field-input::placeholder {
  color: #475569;
}

/* Label */
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 1rem;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  cursor: pointer;
}
.radio-label input[type="radio"] {
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  accent-color: #3b82f6;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* Buttons */
.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover {
  background: #1d4ed8;
}
.btn-secondary {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background: #273549;
  color: #e2e8f0;
}
.btn-icon {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.btn-icon:hover {
  background: #273549;
  color: #e2e8f0;
}

/* Copy success flash */
@keyframes flash-green {
  0%, 100% { background: #1e293b; color: #94a3b8; }
  50% { background: #166534; color: #86efac; border-color: #166534; }
}
.copy-success {
  animation: flash-green 0.6s ease;
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid #1e293b;
  margin: 0.75rem 0;
}

/* Preview dark bg toggle */
.preview-dark {
  background: #0f172a !important;
}

/* Console panel */
.console-panel-hidden {
  display: none;
}
.console-panel-visible {
  display: block;
  height: 150px;
}
.console-output {
  background: #0d1117;
  height: calc(100% - 28px);
}
.console-line-log   { color: #d4d4d4; }
.console-line-info  { color: #60a5fa; }
.console-line-warn  { color: #fbbf24; }
.console-line-error { color: #f87171; }

/* Auto-run pulse indicator */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.autorun-pending::after {
  content: ' ●';
  color: #fbbf24;
  animation: pulse-dot 0.8s ease infinite;
}
