/* ==========================================================================
   AI Voice Button Configurator - Styles
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f1f3f5;
  --bg-card: #ffffff;
  --bg-code: #1e1e2e;
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --accent: #6C3AED;
  --accent-hover: #5B21B6;
  --accent-soft: rgba(108, 58, 237, 0.08);
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --nav-height: 56px;
  --panel-width: 440px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #1a1a2e;
  --bg-code: #0d0d1a;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border-color: #2d2d44;
  --border-hover: #3d3d5c;
  --accent: #8B5CF6;
  --accent-hover: #7C3AED;
  --accent-soft: rgba(139, 92, 246, 0.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

/* ---------- Top Navigation ---------- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ---------- App Layout ---------- */
.app-layout {
  display: flex;
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ---------- Configuration Panel (Left) ---------- */
.config-panel {
  width: var(--panel-width);
  min-width: var(--panel-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  height: calc(100vh - var(--nav-height));
  position: sticky;
  top: var(--nav-height);
  transition: background var(--transition), border-color var(--transition);
}

.panel-header {
  padding: 20px 24px 12px;
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Accordion ---------- */
.accordion {
  border-bottom: 1px solid var(--border-color);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}

.accordion-trigger:hover {
  background: var(--accent-soft);
}

.accordion-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.accordion-icon {
  display: flex;
  transition: transform 0.25s ease;
}

.accordion:not(.open) .accordion-icon {
  transform: rotate(-90deg);
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.accordion-content {
  padding: 0 24px 20px;
  display: none;
}

.accordion.open > .accordion-content {
  display: block;
}

/* ---------- Form Controls ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Info icon tooltip */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  cursor: help;
  position: relative;
  border-radius: 50%;
  transition: color var(--transition);
}

.info-icon:hover,
.info-icon:focus {
  color: var(--accent);
}

.info-icon:hover::after,
.info-icon:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  width: 220px;
  line-height: 1.5;
  z-index: 10;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

/* Text Inputs */
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

textarea {
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Select */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Range slider */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Color input group */
.color-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-secondary);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.hex-input {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
}

/* Gradient Controls */
.gradient-toggle-row {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.gradient-mode-btn {
  flex: 1;
}

.gradient-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gradient-controls .color-input-group {
  flex-wrap: wrap;
}

.grad-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 0 2px;
}

.gradient-angle-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gradient-angle-row label {
  text-transform: none;
  font-size: 0.78rem;
}

.gradient-type-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gradient-type-row label {
  text-transform: none;
  font-size: 0.78rem;
}

.gradient-type-row .button-group {
  display: flex;
  gap: 4px;
}

/* Button Group */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.btn-option {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-option:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-option.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Icon Picker */
.icon-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-option {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.icon-option svg {
  width: 20px;
  height: 20px;
}

.icon-option:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.icon-option.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.icon-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Preset Grid */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset-card {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
}

.preset-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.preset-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.preset-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.preset-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.preset-swatch.gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  filter: blur(4px);
  opacity: 0.5;
  z-index: -1;
  transform: scale(1.3);
}

.preset-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

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

.btn-danger {
  background: var(--bg-secondary);
  color: var(--danger);
  border-color: var(--border-color);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: var(--danger);
}

[data-theme="dark"] .btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.btn-sm:hover {
  background: var(--bg-tertiary);
}

.btn-sm.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-row {
  display: flex;
  gap: 8px;
}

/* ---------- Preview Panel (Right) ---------- */
.preview-panel {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.preview-section {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-secondary);
  padding-bottom: 24px;
}

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

.section-header h2 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-toggle {
  display: flex;
  gap: 4px;
}

/* Preview Container */
.preview-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.preview-mock-page {
  position: relative;
  min-height: 380px;
  padding: 20px;
}

.mock-nav {
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  margin-bottom: 24px;
  width: 60%;
}

.mock-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-line {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.mock-line.w80 { width: 80%; }
.mock-line.w60 { width: 60%; }
.mock-line.w90 { width: 90%; }
.mock-line.w40 { width: 40%; }
.mock-line.w70 { width: 70%; }

/* Preview Button Wrapper - position varies */
#previewButtonWrapper {
  position: absolute;
}

/* Config Summary */
.config-summary {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: background var(--transition), border-color var(--transition);
}

.config-summary h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.summary-value {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Code Section ---------- */
.code-section {
  margin-top: 24px;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.code-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 16px;
}

[data-theme="dark"] .code-warning {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.code-warning.hidden {
  display: none;
}

.code-output {
  background: var(--bg-code);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.code-output pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
  max-height: 500px;
  overflow-y: auto;
}

.code-output code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre;
}

/* ---------- Preview Button Animations ---------- */

/* Pulse */
@keyframes vb-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Bounce */
@keyframes vb-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Glow */
@keyframes vb-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--glow-rgb, 108, 58, 237), 0.3); }
  50% { box-shadow: 0 0 24px rgba(var(--glow-rgb, 108, 58, 237), 0.6); }
}

/* Ripple */
@keyframes vb-ripple {
  0% { box-shadow: 0 0 0 0 rgba(var(--glow-rgb, 108, 58, 237), 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(var(--glow-rgb, 108, 58, 237), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--glow-rgb, 108, 58, 237), 0); }
}

/* Breathe */
@keyframes vb-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}

/* Float */
@keyframes vb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Active: Pulse Ring */
@keyframes vb-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Active: Glow */
@keyframes vb-active-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 28px rgba(239, 68, 68, 0.7); }
}

/* Active: Wave */
@keyframes vb-wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

/* Spinner for preview */
@keyframes vb-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Glow pulse hover */
@keyframes vb-glow-pulse-hover {
  0%, 100% { box-shadow: 0 0 8px rgba(var(--glow-rgb, 108, 58, 237), 0.4); }
  50% { box-shadow: 0 0 20px rgba(var(--glow-rgb, 108, 58, 237), 0.7); }
}

/* Wobble */
@keyframes vb-wobble {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(-5deg); }
  30% { transform: rotate(4deg); }
  45% { transform: rotate(-3deg); }
  60% { transform: rotate(2deg); }
  75% { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

/* ---------- Orb Preview Styles ---------- */
.preview-orb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.preview-orb-btn {
  position: relative;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  outline: none;
}

.preview-orb-btn .orb-icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-orb-btn .orb-icon svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.preview-orb-btn .orb-shine {
  position: absolute;
  top: 10%;
  left: 15%;
  width: 35%;
  height: 35%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: 3;
}

.preview-orb-btn .orb-spinner {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255,255,255,0.6);
  animation: vb-spin 1s linear infinite;
  z-index: 4;
  display: none;
}

.preview-orb-btn.loading .orb-spinner {
  display: block;
}

.preview-orb-shadow {
  width: 60%;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  filter: blur(3px);
  margin-top: 2px;
  animation: vb-shadow-move 3s ease-in-out infinite;
}

@keyframes vb-shadow-move {
  0%, 100% { transform: scaleX(1); opacity: 0.15; }
  50% { transform: scaleX(0.85); opacity: 0.1; }
}

.preview-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid rgba(255,255,255,0.8);
  z-index: 5;
}

.preview-status-dot.active {
  background: #ef4444;
  animation: vb-pulse 1.5s ease-in-out infinite;
}

.preview-connection-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-connection-indicator.visible {
  opacity: 1;
}

.preview-connection-indicator .conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.preview-status-msg {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
}

.preview-status-msg.visible {
  opacity: 1;
}

/* ---------- Active badge ---------- */
.preview-active-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: vb-pulse 1.5s ease-in-out infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  :root {
    --panel-width: 380px;
  }
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .config-panel {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .preview-section {
    position: static;
  }

  .preview-panel {
    padding: 16px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .code-actions {
    flex-direction: column;
  }

  .code-actions .btn {
    justify-content: center;
  }

  .nav-badge {
    display: none;
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Scrollbar ---------- */
.config-panel::-webkit-scrollbar,
.code-output pre::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.config-panel::-webkit-scrollbar-track,
.code-output pre::-webkit-scrollbar-track {
  background: transparent;
}

.config-panel::-webkit-scrollbar-thumb,
.code-output pre::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.config-panel::-webkit-scrollbar-thumb:hover,
.code-output pre::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---------- Copy feedback ---------- */
.btn-copy-success {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
}

/* ---------- Focus visible polyfill ---------- */
:focus:not(:focus-visible) {
  outline: none;
}
