/* =====================================================================
   Tagline Batch Generator — Redesigned UI
   Font: Syne (headings) + DM Sans (body)
   Aesthetic: Refined dark studio — deep navy, crisp accents, glass panels
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700;800&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --bg:              #060d18;
  --bg-panel:        #0c1526;
  --bg-card:         #101e30;
  --bg-elevated:     #152438;
  --bg-input:        #0c1826;

  --border:          rgba(255,255,255,.07);
  --border-mid:      rgba(255,255,255,.11);
  --border-focus:    rgba(99,102,241,.7);
  --border-hover:    rgba(255,255,255,.18);

  --accent:          #6366f1;
  --accent-soft:     rgba(99,102,241,.15);
  --accent-glow:     rgba(99,102,241,.3);
  --accent-hover:    #818cf8;

  --green:           #34d399;
  --green-soft:      rgba(52,211,153,.12);
  --amber:           #fbbf24;
  --amber-soft:      rgba(251,191,36,.12);
  --red:             #f87171;
  --red-soft:        rgba(248,113,113,.12);

  --text:            #e8eeff;
  --text-sub:        #a0aec5;
  --text-muted:      #5c6e8a;
  --text-code:       #a5b4fc;

  --radius-xl:       16px;
  --radius-lg:       12px;
  --radius-md:       8px;
  --radius-sm:       6px;
  --radius-xs:       4px;

  --shadow-sm:       0 1px 4px rgba(0,0,0,.4);
  --shadow:          0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:       0 8px 32px rgba(0,0,0,.6);
  --shadow-accent:   0 4px 20px rgba(99,102,241,.25);

  --sidebar-w:       340px;
  --header-h:        64px;
  --transition:      .16s ease;

  --font-body:       'DM Sans', -apple-system, sans-serif;
  --font-heading:    'Syne', sans-serif;
  --font-mono:       'DM Mono', monospace;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ── App Shell ─────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: rgba(6,13,24,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-sep {
  flex: 1;
}

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

/* ── Main Content ──────────────────────────────────────────────────── */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 32px;
  gap: 6px;
}

/* ── Panel groups ──────────────────────────────────────────────────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.panel-header:hover { background: rgba(255,255,255,.025); }

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.panel-icon.indigo  { background: rgba(99,102,241,.18); }
.panel-icon.teal    { background: rgba(52,211,153,.15); }
.panel-icon.amber   { background: rgba(251,191,36,.14); }
.panel-icon.violet  { background: rgba(167,139,250,.15); }
.panel-icon.rose    { background: rgba(251,113,133,.14); }
.panel-icon.sky     { background: rgba(56,189,248,.14); }

.panel-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-sub);
}

.panel-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.panel.collapsed .panel-chevron { transform: rotate(-90deg); }
.panel.collapsed .panel-body    { display: none; }

.panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Drop zones ────────────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone.dragover {
  border-color: var(--accent-hover);
  background: rgba(99,102,241,.2);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: rgba(52,211,153,.4);
  background: rgba(52,211,153,.04);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.dz-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.dz-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dz-info { flex: 1; min-width: 0; }

.dz-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.dz-filename {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ── Language badges ───────────────────────────────────────────────── */
.lang-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.lang-pill.en { background: rgba(99,102,241,.2); color: #a5b4fc; border: 1px solid rgba(99,102,241,.25); }
.lang-pill.hi { background: rgba(251,191,36,.15); color: #fcd34d; border: 1px solid rgba(251,191,36,.25); }
.lang-pill.ur { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.2); }

/* ── Form fields ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }

.field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: 0.2px;
}

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

.field-row .field { flex: 1; }

select,
input[type="number"],
input[type="text"],
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%235c6e8a' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

select option { background: var(--bg-panel); }

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
}

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

input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; border-radius: 3px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 3px; }

/* ── Range sliders ─────────────────────────────────────────────────── */
.range-wrap { display: flex; flex-direction: column; gap: 6px; }

.range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-badge {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
  transition: box-shadow var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(99,102,241,.3);
}

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

.color-row input[type="color"] { flex-shrink: 0; }
.color-row span {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-sub);
}

/* ── Toggle switch ─────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toggle-row-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

/* ── Multi-size checklist ── */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}

.check-row:hover { border-color: var(--border-hover); }

.check-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.check-row-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.check-row-sub {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.size-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* custom checkbox toggle */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: 99px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: left var(--transition), background var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  left: calc(100% - 16px);
  background: #fff;
}

/* ── Offset control ────────────────────────────────────────────────── */
.offset-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.offset-row input[type="range"] { flex: 1; }

.offset-row input[type="number"] {
  width: 58px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 6px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent-hover); background: var(--accent-soft); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 24px rgba(99,102,241,.35); }

.btn-success {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff;
  box-shadow: 0 4px 16px rgba(52,211,153,.2);
}
.btn-success:hover { box-shadow: 0 6px 24px rgba(52,211,153,.3); filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: rgba(255,255,255,.04); color: var(--text); border-color: var(--border-hover); }

.btn-sm { padding: 6px 11px; font-size: 11.5px; border-radius: var(--radius-sm); }

.btn[disabled], button[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Action bar (bottom of sidebar) ───────────────────────────────── */
.sidebar-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-actions-row {
  display: flex;
  gap: 6px;
}

.sidebar-actions-row .btn { flex: 1; }

/* ── Progress ──────────────────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

progress {
  flex: 1;
  height: 5px;
  border: none;
  border-radius: 99px;
  background: var(--bg-elevated);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

progress::-webkit-progress-bar   { background: var(--bg-elevated); border-radius: 99px; }
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 99px;
  transition: width 0.2s ease;
}

#progressText {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 96px;
  text-align: right;
}

#settingsStatus {
  font-size: 11px;
  color: var(--green);
  font-weight: 500;
  min-height: 16px;
  font-family: var(--font-mono);
}

/* ── Main canvas area ──────────────────────────────────────────────── */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ── Preview section ───────────────────────────────────────────────── */
.preview-section {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.preview-section-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

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

.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}

.preview-card:hover { border-color: var(--border-hover); }

.preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.preview-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-size {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
}

.preview-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.preview-box {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-input);
  min-height: 200px;
  max-height: 340px;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
}

.preview-empty .empty-icon { font-size: 24px; opacity: 0.5; }
.preview-empty span { font-size: 11.5px; text-align: center; }

/* ── Output grid section ───────────────────────────────────────────── */
.output-section {
  padding: 24px;
  flex: 1;
}

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

.output-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.output-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--green);
  border-radius: 2px;
}

#gridCount {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.grid .item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
}

.grid .item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  transform: translateY(-1px);
}

.grid .item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.grid .item p {
  padding: 7px 9px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  border-top: 1px solid var(--border);
}

/* ── Tagline actions ───────────────────────────────────────────────── */
.tagline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tagline-actions input[type="file"] { display: none; }

/* ── Toast notifications ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  animation: toast-in 0.2s ease;
  max-width: 320px;
  backdrop-filter: blur(8px);
}

.toast.removing { animation: toast-out 0.2s ease forwards; }

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--green-soft); color: var(--green); }
.toast.error   .toast-icon { background: var(--red-soft);   color: var(--red);   }
.toast.warning .toast-icon { background: var(--amber-soft); color: var(--amber); }
.toast.info    .toast-icon { background: var(--accent-soft); color: var(--accent-hover); }

@keyframes toast-in  { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { transform: translateX(24px); opacity: 0; } }

/* ── Footer ────────────────────────────────────────────────────────── */
footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* hidden canvas */
#workCanvas { display: none; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .preview-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --sidebar-w: 100%; }
  .workspace { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .preview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .preview-section, .output-section { padding: 16px; }
  .sidebar { padding: 14px 12px 24px; }
}
