:root {
  /* Lab palette — slate base, electric cyan accent */
  --canvas: #0f1419;
  --canvas-2: #0c1015;
  --surface: rgba(255, 255, 255, 0.015);
  --surface-2: rgba(255, 255, 255, 0.03);
  --surface-3: rgba(255, 255, 255, 0.06);

  --border: rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.10);
  --border-3: rgba(255, 255, 255, 0.18);

  --text: #d8dee4;
  --text-strong: #f5f7fa;
  --text-mute: #94a3b8;
  --text-faint: #5b6473;

  --accent: #22d3ee;
  --accent-soft: #67e8f9;
  --accent-deep: #052029;
  --accent-bg: rgba(34, 211, 238, 0.10);
  --accent-bg-2: rgba(34, 211, 238, 0.20);

  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  background: transparent;
  border: 0.5px solid var(--border-2);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 14px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
button:hover { background: var(--surface-3); border-color: var(--border-3); }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary {
  background: var(--accent);
  color: var(--accent-deep);
  border-color: transparent;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
button.primary:hover { background: var(--accent-soft); }
button.ghost { border-color: transparent; }
button.danger { color: var(--err); border-color: rgba(251, 113, 133, 0.30); }
button.danger:hover { background: rgba(251, 113, 133, 0.10); }
button.icon { padding: 6px 8px; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}
input.mono, textarea.mono { font-family: var(--font-mono); font-size: 12px; }

::placeholder { color: var(--text-faint); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
  border: none;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none;
}

label.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 0.5px solid var(--border-2);
  border-radius: 4px;
  color: var(--text-mute);
}

.mono { font-family: var(--font-mono); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }
.dot.accent { background: var(--accent); }

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

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}
.titlebar-left { display: flex; align-items: center; gap: 12px; }
.lights { display: flex; gap: 6px; }
.lights span { width: 8px; height: 8px; border-radius: 50%; }
.lights span:nth-child(1) { background: #fb7185; }
.lights span:nth-child(2) { background: #fbbf24; }
.lights span:nth-child(3) { background: #34d399; }
.brand {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.brand b { color: var(--text-strong); font-weight: 500; }
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.titlebar-right .nav-link {
  color: var(--text-mute);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.titlebar-right .nav-link:hover { background: var(--surface-3); color: var(--text-strong); }
.titlebar-right .nav-link.active { color: var(--accent); }

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  border-top: 0.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.view {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Studio layout */
.studio {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  width: 100%;
}
@media (max-width: 1100px) { .studio { grid-template-columns: 1fr; } }

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pane-left, .pane-right { background: var(--surface); border-right: 0.5px solid var(--border); }
.pane-right { border-right: none; border-left: 0.5px solid var(--border); }
.pane-center {
  position: relative;
  background: linear-gradient(180deg, var(--canvas), var(--canvas-2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pane-section {
  padding: 14px;
  border-bottom: 0.5px solid var(--border);
}
.pane-section:last-child { border-bottom: none; }
.pane-section h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 0 10px;
  font-weight: 500;
}

.project-list { display: flex; flex-direction: column; gap: 2px; }
.project-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 0.5px solid transparent;
  border-left: 2px solid transparent;
}
.project-item:hover { background: var(--surface-3); }
.project-item.active {
  background: var(--accent-bg);
  border-color: rgba(34, 211, 238, 0.30);
  border-left-color: var(--accent);
  border-radius: 0 6px 6px 0;
}
.project-item .name { font-size: 12px; color: var(--text-strong); font-weight: 500; }
.project-item .code { font-family: var(--font-mono); font-size: 10px; color: var(--text-mute); margin-top: 2px; }
.project-item.active .code { color: var(--accent-soft); }

.option-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.option-grid > .opt {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.option-grid > .opt:hover { background: var(--surface-3); }
.option-grid > .opt.selected {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
}

.ecc-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ecc-row .ecc-cell {
  height: 28px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-mute);
  cursor: pointer;
}
.ecc-row .ecc-cell:hover { background: var(--surface-3); }
.ecc-row .ecc-cell.selected {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.row-spread {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px;
}
.row-spread .val { color: var(--text); text-transform: none; letter-spacing: 0; }
.row-spread .ok { color: var(--ok); text-transform: none; letter-spacing: 0; }

.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.color-cell {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  cursor: pointer;
}
.color-swatch {
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 0.5px solid var(--border-3);
  flex-shrink: 0;
}
.color-cell .hex { font-family: var(--font-mono); font-size: 10px; color: var(--text-mute); }

.logo-slot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 0.5px dashed rgba(34, 211, 238, 0.25);
  border-radius: 6px;
  cursor: pointer;
}
.logo-slot.empty { color: var(--text-mute); justify-content: center; font-size: 12px; }
.logo-slot .thumb {
  width: 28px; height: 28px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; font-family: var(--font-mono);
  background-size: cover; background-position: center;
}
.logo-slot .name { font-size: 11px; font-family: var(--font-mono); color: var(--text); flex: 1; }
.logo-slot .remove { color: var(--text-faint); cursor: pointer; padding: 2px; }
.logo-slot .remove:hover { color: var(--err); }

/* Center stage */
.canvas-readout {
  position: absolute;
  top: 14px; left: 18px; right: 18px;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
}

.qr-frame {
  position: relative;
  padding: 0;
}
.qr-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 0.5px dashed rgba(34, 211, 238, 0.40);
  border-radius: 14px;
  pointer-events: none;
}
.crop-mark {
  position: absolute;
  width: 12px; height: 12px;
}
.crop-mark.tl { top: -18px; left: -18px; border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.crop-mark.tr { top: -18px; right: -18px; border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.crop-mark.bl { bottom: -18px; left: -18px; border-bottom: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.crop-mark.br { bottom: -18px; right: -18px; border-bottom: 1px solid var(--accent); border-right: 1px solid var(--accent); }

.qr-card {
  background: #ffffff;
  padding: 22px;
  border-radius: 12px;
}
.qr-card svg { display: block; width: 230px; height: 230px; }

.canvas-actions {
  margin-top: 24px;
  display: flex; gap: 8px;
}
.canvas-actions button {
  height: 30px; padding: 0 12px;
  font-size: 11px; font-family: var(--font-mono);
}

/* Top input stack (kind picker + payload form + alias row) */
.url-row-stack {
  display: flex;
  flex-direction: column;
  border-bottom: 0.5px solid var(--border);
}

.kind-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 18px 0;
}
.kind-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  background: transparent;
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  color: var(--text-mute);
  cursor: pointer;
  transition: all 0.12s ease;
}
.kind-tab:hover { background: var(--surface-3); color: var(--text); }
.kind-tab.active {
  background: var(--accent-bg);
  border-color: rgba(34, 211, 238, 0.40);
  color: var(--accent);
}

.payload-form {
  padding: 14px 18px 0;
}
.payload-form .input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 6px;
  padding: 0 12px;
}
.payload-form .input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}
.payload-form .input-shell input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  box-shadow: none !important;
  outline: none;
}

.payload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.payload-grid .payload-row { display: flex; flex-direction: column; }
.payload-grid .payload-row.full { grid-column: 1 / -1; }
.payload-grid label.field-label { margin-bottom: 4px; }
.payload-grid input,
.payload-grid select,
.payload-grid textarea { width: 100%; }
.payload-grid textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  resize: vertical;
  min-height: 56px;
}
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.checkbox-row input { width: auto; }

@media (max-width: 700px) { .payload-grid { grid-template-columns: 1fr; } }

.alias-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 14px 18px;
}
.alias-input-shell {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 6px;
  padding: 0 12px;
  gap: 8px;
}
.alias-input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}
.alias-prefix { color: var(--text-faint); font-size: 12px; }
.alias-input-shell input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
}
.alias-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}
.alias-state.ok { color: var(--ok); }
.alias-state.err { color: var(--err); }
.alias-state.checking .dot.accent { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.alias-row .short-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--accent-bg);
  border: 0.5px solid rgba(34, 211, 238, 0.30);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  cursor: copy;
}
.alias-row .short-pill .copy-icn { opacity: 0.7; }
.alias-row .short-pill:hover .copy-icn { opacity: 1; }

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--canvas);
  border: 0.5px solid var(--border-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-mono);
  pointer-events: auto;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.40); }
.toast.err { border-color: rgba(251, 113, 133, 0.40); color: var(--err); }
.toast.fade-out { opacity: 0; transition: opacity 0.4s ease; }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal {
  background: var(--canvas);
  border: 0.5px solid var(--border-2);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
}
.modal h2 { margin: 0 0 18px; font-size: 16px; font-weight: 500; }
.modal .row { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* Tables (links view) */
.table-wrap {
  width: 100%;
  padding: 18px;
}
.table-wrap h2 {
  margin: 0 0 14px;
  font-size: 16px; font-weight: 500;
  color: var(--text-strong);
}
.toolbar {
  display: flex; gap: 8px; margin-bottom: 14px;
  align-items: center;
}
.toolbar input { flex: 1; max-width: 320px; }
.t {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.t thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--border);
  font-weight: 500;
}
.t tbody td {
  padding: 10px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}
.t tbody tr:hover { background: var(--surface-2); }
.t .col-code { font-family: var(--font-mono); color: var(--accent); }
.t .col-url { color: var(--text-mute); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .col-clicks { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.t .col-actions { text-align: right; white-space: nowrap; }
.t .col-actions button { margin-left: 4px; padding: 4px 8px; font-size: 11px; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
}

/* Stats grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 800px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.metric {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.metric .label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.metric .value {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.spark { width: 100%; height: 80px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 80px; }
.bars .bar { flex: 1; background: var(--accent-bg-2); border-radius: 1px; min-height: 1px; }
.bars .bar:hover { background: var(--accent); }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
  font-size: 13px;
}
.empty .big { font-size: 28px; color: var(--text-strong); margin-bottom: 8px; font-weight: 500; }

/* Auth (modal style) */
.auth-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 12px;
  padding: 24px;
}
.auth-card h2 { margin: 0 0 18px; font-size: 16px; font-weight: 500; }
.auth-card .field { margin-bottom: 14px; }

/* Missing-link banner */
.missing-banner {
  background: rgba(251, 113, 133, 0.06);
  border-bottom: 0.5px solid rgba(251, 113, 133, 0.30);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--err);
  display: flex; align-items: center; gap: 10px;
}
.missing-banner .dismiss {
  margin-left: auto;
  cursor: pointer;
  color: var(--text-faint);
  padding: 2px 6px;
}

/* ========================================================================
   TRACK B — accordion designer pane, color picker popover, frame controls,
   export modal, scannability badge.
   ======================================================================== */

.designer-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.acc-section {
  border-bottom: 0.5px solid var(--border);
}
.acc-section:last-child { border-bottom: none; }
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.acc-head:hover { background: var(--surface-3); }
.acc-section.open .acc-head { color: var(--accent); }
.acc-title { font-weight: 500; }
.acc-chev {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-faint);
}
.acc-body { padding: 0 16px 16px; }
.acc-content > * { margin-bottom: 0; }

/* Color picker popover */
.cp-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.cp-swatch:hover { border-color: var(--border-3); }
.cp-chip {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 0.5px solid var(--border-3);
  flex-shrink: 0;
}
.cp-hex {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
}
.cp-caret {
  font-size: 10px;
  color: var(--text-faint);
}

.cp-popover {
  position: absolute;
  z-index: 60;
  width: 256px;
  background: var(--canvas);
  border: 0.5px solid var(--border-2);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.40);
}
.cp-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.cp-native {
  width: 38px;
  height: 32px;
  padding: 0;
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}
.cp-input {
  flex: 1;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
}
.cp-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 8px 0 6px;
}
.cp-presets {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.cp-preset {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 0.5px solid var(--border-3);
  cursor: pointer;
  padding: 0;
}
.cp-preset:hover { transform: scale(1.08); border-color: var(--accent); }

/* Foreground tabs (solid / gradient) */
.fg-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.fg-tab {
  flex: 1;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  color: var(--text-mute);
  cursor: pointer;
}
.fg-tab:hover { background: var(--surface-3); color: var(--text); }
.fg-tab.active {
  background: var(--accent-bg);
  border-color: rgba(34, 211, 238, 0.40);
  color: var(--accent);
}

.grad-ctrl select {
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 4px 8px;
}
.grad-stop {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.grad-stop-color { flex: 1; }

/* Color block for FG/BG/eye sections */
.color-block .row-spread {
  margin-bottom: 6px;
}
.eye-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.eye-color-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eye-color-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.reset-link {
  margin-top: 6px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.reset-link:hover { color: var(--accent); background: transparent; }

.micro-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Frame grid */
.frame-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.frame-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.frame-cell:hover { background: var(--surface-3); }
.frame-cell.selected {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.frame-cell svg { color: currentColor; }
.frame-detail {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}

/* Scannability box */
.scan-box {
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 8px;
  padding: 12px;
}
.scan-reasons {
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-mute);
}
.scan-reasons li {
  margin-bottom: 4px;
}

.hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* Export modal */
.export-modal { max-width: 480px; }
.export-row {
  margin-bottom: 16px;
}
.seg-control {
  display: flex;
  gap: 4px;
}
.seg-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.seg-btn:hover { background: var(--surface-3); color: var(--text); }
.seg-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.size-presets {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.size-chip {
  flex: 1;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-2);
  border-radius: 5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.size-chip:hover { background: var(--surface-3); }
.size-chip.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.export-preview {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
