.settings-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ── Header ── */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.settings-header-left { display: flex; align-items: center; gap: 1rem; }
.settings-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-back {
  font-size: 0.9rem; font-weight: 600; color: var(--accent);
  text-decoration: none; padding: 0.4rem 0.75rem;
  border: 2px solid var(--border); border-radius: 10px;
  background: var(--bg-card); transition: border-color 0.15s;
}
.btn-back:hover { border-color: var(--accent); }

.settings-title {
  margin: 0; font-size: 1.4rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}

/* ── Layout ── */
.settings-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 720px) { .settings-body { grid-template-columns: 1fr; } }

/* ── Preview ── */
.preview-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 1rem;
}

.preview-title {
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 0.75rem;
}
.preview-size { font-weight: 500; color: var(--accent); margin-left: 0.5rem; }

.preview-stage {
  display: flex; justify-content: center; align-items: center;
  background: #e8edf3; border-radius: 12px;
  padding: 1.25rem; margin-bottom: 0.5rem;
}

/* canvas + handles overlay */
.canvas-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

#label-canvas {
  border: 1px solid #999;
  border-radius: 2px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  display: block;
  cursor: default;
}

/* Drag handles */
.drag-handle {
  position: absolute;
  font-size: 9px;
  font-weight: 800;
  font-family: "Segoe UI", sans-serif;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  cursor: grab;
  user-select: none;
  opacity: 0.82;
  border: 1.5px solid rgba(0,0,0,0.18);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: opacity 0.12s, transform 0.1s;
  z-index: 10;
}
.drag-handle:hover  { opacity: 1; transform: scale(1.1); }
.drag-handle:active { cursor: grabbing; }

.drag-handle[data-el="qr"]   { background: #fde68a; color: #78350f; }
.drag-handle[data-el="sku"]  { background: #a5f3fc; color: #0c4a6e; }
.drag-handle[data-el="desc"] { background: #bbf7d0; color: #14532d; }
.drag-handle[data-el="msrp"] { background: #fca5a5; color: #7f1d1d; }

.drag-hint {
  text-align: center; font-size: 0.75rem;
  color: var(--muted); margin: 0 0 0.85rem;
}

/* Preview inputs */
.preview-inputs { display: flex; flex-direction: column; gap: 0.6rem; }
.pi-group { display: flex; flex-direction: column; gap: 0.25rem; }
.pi-group label {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.pi-group input {
  padding: 0.45rem 0.75rem;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit;
  color: var(--text); background: var(--bg-input); outline: none;
  transition: border-color 0.15s;
}
.pi-group input:focus { border-color: var(--accent); }

/* ── Controls ── */
.controls-section { display: flex; flex-direction: column; gap: 1rem; }

.ctrl-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-card);
}

.ctrl-group-title {
  font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}

.ctrl-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 0.75rem;
  padding: 0.45rem 0; border-bottom: 1px solid #f0f3f7;
}
.ctrl-row:last-child { border-bottom: none; }

.ctrl-row label {
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-soft); flex: 1; min-width: 0;
}
.ctrl-val {
  font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 2.5em; text-align: right;
}

.ctrl-row input[type="range"] {
  width: 120px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}
.ctrl-row input[type="color"] {
  width: 44px; height: 34px; padding: 2px;
  border: 2px solid var(--border); border-radius: 8px;
  cursor: pointer; background: none; flex-shrink: 0;
}
.ctrl-row select {
  padding: 0.35rem 0.6rem;
  border: 2px solid var(--border); border-radius: 8px;
  font-size: 0.88rem; font-family: inherit;
  color: var(--text); background: var(--bg-input);
  outline: none; cursor: pointer;
  flex-shrink: 0; max-width: 180px;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 0.65rem 1.4rem; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600;
  z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.2s ease;
}
