/*
  Golden Ratio Typography (GRT) — https://grtcalculator.com/math/
  φ = (1 + √5) / 2 ≈ 1.6180339887
  1/φ = φ − 1 ≈ 0.6180339887

  1) Typographic scale from primary font f:
       f/φ², f/φ, f, f·φ, f·φ², f·φ³
  2) Line heights h = f · q  (golden when q = φ; body uses measure-aware q)
  3) Spacing units from primary line height h₀
  4) Layout splits at 1 : φ  (≈ 38.2% / 61.8%)
*/

:root {
  --phi: 1.6180339887;
  --phi-inv: 0.6180339887;

  /* Primary font size f (GRT base) */
  --f: 16px;
  /* 6-step golden scale */
  --f-2: calc(var(--f) / var(--phi) / var(--phi));
  --f-1: calc(var(--f) / var(--phi));
  --f0: var(--f);
  --f1: calc(var(--f) * var(--phi));
  --f2: calc(var(--f) * var(--phi) * var(--phi));
  --f3: calc(var(--f) * var(--phi) * var(--phi) * var(--phi));

  /* Practical web-clamped scale */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-md: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --text-lg: clamp(1.375rem, 1.2rem + 0.7vw, 1.618rem);
  --text-xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.618rem);
  --text-2xl: clamp(2.25rem, 1.7rem + 2.2vw, 3.236rem);

  /* Line heights: h = f · q */
  --lh-tight: 1.2;
  --lh-snug: calc(1 + var(--phi-inv) * 0.5);
  --lh-body: calc(1 + var(--phi-inv));
  --lh-loose: calc(var(--phi));

  /* Primary line-height length for spacing */
  --h0: calc(var(--f) * var(--lh-body));

  /* Spacing units = fractions / multiples of h₀ */
  --s-1: calc(var(--h0) * 0.25);
  --s-2: calc(var(--h0) * 0.5);
  --s-3: calc(var(--h0) * var(--phi-inv));
  --s-4: var(--h0);
  --s-5: calc(var(--h0) * var(--phi));
  --s-6: calc(var(--h0) * var(--phi) * var(--phi));

  --measure: 65ch;
  --wrap: 68rem;

  /* Layout golden split */
  --grid-minor: 1fr;
  --grid-major: var(--phi)fr;

  --radius-sm: 0.375rem;
  --radius: 0.75rem;
  --radius-lg: calc(1rem * var(--phi));
  --radius-pill: 999px;

  --bg: #ffffff;
  --bg2: #f6f7fb;
  --bg3: #eef0f6;
  --border: rgba(15, 17, 23, 0.09);
  --accent: #1a4fdb;
  --accent2: #1240c2;
  --text: #0f1117;
  --muted: #5a5f72;
  --card: #ffffff;
  --ok: #0f7a45;
  --warn: #b7791f;
  --err: #c0392b;
  --shadow: 0 1px 2px rgba(15, 17, 23, 0.04),
            0 18px 48px -28px rgba(15, 17, 23, 0.22);

  --font: Inter, system-ui, -apple-system, sans-serif;
  --display: "Bebas Neue", Inter, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg2);
  min-height: 100dvh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  height: calc(var(--h0) * var(--phi));
  gap: var(--s-3);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 3.25rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 17, 23, 0.08);
}
.brand-qr:empty {
  background:
    linear-gradient(90deg, #e8eaf0 25%, #f4f5f8 50%, #e8eaf0 75%);
  background-size: 200% 100%;
}
.brand-qr canvas,
.brand-qr svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.brand-qr.is-demo {
  opacity: 0.88;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.1;
}
.brand .mark {
  font-family: var(--display);
  letter-spacing: 0.04em;
  font-size: var(--text-lg);
  color: var(--accent);
  line-height: 1;
}
.brand .sub {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
}
.nav { display: flex; gap: var(--s-1); align-items: center; flex-wrap: wrap; }
.nav a, .nav button.linkish {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--radius-sm);
  border: 0; background: none;
  cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button.linkish:hover {
  background: var(--bg3); color: var(--text); text-decoration: none;
}
.nav a .lock, .btn .lock, .mode-tabs button .lock {
  display: inline-block;
  margin-left: 0.25em;
  font-size: 0.85em;
  opacity: 0.85;
  vertical-align: middle;
}
.nav a.locked, .mode-tabs button.locked { color: var(--muted); }

.hero { padding: var(--s-5) 0 var(--s-3); }

/* Hero: golden split — copy major, QR minor top-right */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  align-items: center;
}
@media (min-width: 800px) {
  .hero-grid {
    grid-template-columns: var(--grid-major) var(--grid-minor);
    gap: var(--s-5);
  }
}
.hero-copy .eyebrow { margin-bottom: 0; }
.hero-copy h1 { max-width: 14ch; }
.hero-qr-panel {
  justify-self: stretch;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--phi));
  box-shadow: var(--shadow);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}
.hero-qr-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: flex-start;
}
.hero-qr-mount {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 13.5rem;
  background: var(--bg2);
  border-radius: calc(var(--radius) * var(--phi-inv) + 6px);
  border: 1px dashed var(--border);
  padding: var(--s-2);
}
.hero-qr-mount canvas,
.hero-qr-mount svg {
  max-width: 100%;
  height: auto !important;
  display: block;
}
.hero-qr-mount.is-demo { opacity: 0.95; }
.hero-qr-hint {
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: center;
  line-height: var(--lh-body);
  margin: 0;
}

.hero .eyebrow {
  display: inline-flex; gap: var(--s-1); align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--border);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--radius-pill);
}
.hero h1 {
  margin-top: var(--s-3);
  font-size: var(--text-2xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  max-width: 16ch;
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--lh-body);
  max-width: var(--measure);
}
.badges {
  display: flex; flex-wrap: wrap;
  gap: var(--s-1);
  margin-top: var(--s-3);
}
.badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: calc(var(--s-1) * 0.85) var(--s-2);
}
.badge strong { color: var(--ok); }

.grt-note {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--s-2);
  line-height: var(--lh-body);
  max-width: var(--measure);
}
.grt-note code {
  font-size: 0.9em;
  background: var(--bg3);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--phi));
  box-shadow: var(--shadow);
  padding: var(--s-4);
  margin: var(--s-3) 0;
}
.card h2 {
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-1);
}
.card .hint {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  margin-bottom: var(--s-3);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 900px) {
  .grid-2 {
    /* golden: major (φ) controls + minor (1) stage ≈ 61.8% / 38.2% */
    grid-template-columns: var(--grid-major) var(--grid-minor);
    align-items: start;
  }
  .grid-2 .pane.stage {
    position: sticky;
    top: calc(4rem + var(--s-2));
  }
}

.pane { min-width: 0; }
.row {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.row > * { flex: 1; min-width: 7.5rem; }

.field-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-1);
}
.field, select.field, textarea.field {
  width: 100%;
  font: inherit;
  font-size: var(--text-base);
  line-height: var(--lh-snug);
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: calc(var(--radius) * var(--phi-inv) + 6px);
  padding: var(--s-2);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus, select.field:focus, textarea.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 79, 219, 0.12);
}
.control { margin-bottom: var(--s-3); }
.field-help {
  font-size: var(--text-xs);
  line-height: var(--lh-body);
  color: var(--muted);
  margin-top: var(--s-1);
}
.field-help code {
  font-size: 0.92em;
  background: var(--bg3);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}
.type-tab {
  border: 1.5px solid var(--border);
  background: #fff;
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--muted);
  line-height: var(--lh-snug);
}
.type-tab:hover { border-color: var(--text); color: var(--text); }
.type-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.mode-tabs, .style-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--phi));
  padding: var(--s-1);
  margin-bottom: var(--s-3);
}
.mode-tabs button, .style-tabs button {
  flex: 1 1 auto;
  min-width: 5.5rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--s-2) var(--s-1);
  border-radius: calc(var(--radius) * var(--phi-inv) + 4px);
  cursor: pointer;
  color: var(--muted);
  line-height: var(--lh-snug);
}
.mode-tabs button.active, .style-tabs button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
  border: 0;
  border-radius: calc(var(--radius) * var(--phi-inv) + 6px);
  padding: var(--s-2) var(--s-3);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(26, 79, 219, 0.25);
}
.btn-primary:hover { background: var(--accent2); }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text); }
.btn-dark { background: var(--text); color: #fff; }
.btn-sm {
  font-size: var(--text-xs);
  padding: var(--s-1) var(--s-2);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.notice {
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  padding: var(--s-2) var(--s-3);
  border-radius: calc(var(--radius) * var(--phi-inv) + 6px);
  margin-bottom: var(--s-3);
  border: 1px solid var(--border);
}
.notice.ok { background: #eefaf3; border-color: #b7e0c8; color: #0f5a34; }
.notice.info { background: #eef3ff; border-color: #c9d7f8; color: #1a3a8a; }
.notice.warn { background: #fff7e5; border-color: #f2d89a; color: #8a5a00; }
.notice.err { background: #fdeeee; border-color: #f0c2c2; color: #8a1f1f; }
.notice.hidden, .hidden { display: none !important; }

.stage-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-2);
}
.qr-mount {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--h0) * var(--phi) * var(--phi));
  padding: var(--s-3);
  background: var(--bg2);
  border-radius: calc(var(--radius) * var(--phi));
  border: 1px dashed var(--border);
}
.qr-mount canvas, .qr-mount svg { max-width: 100%; height: auto; }
.qr-mount.is-demo { opacity: 0.92; }
.qr-mount.is-demo::after {
  content: "Demo — add your content";
  display: block;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--s-2);
  font-weight: 600;
}
.qr-placeholder {
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--s-4);
  max-width: 14rem;
  line-height: var(--lh-body);
}

.link-preview {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: calc(var(--radius) * var(--phi-inv) + 8px);
  padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
}
.link-preview .lp-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-1);
}
.link-preview .lp-url {
  font-size: var(--text-sm);
  font-weight: 600;
  word-break: break-all;
  line-height: var(--lh-snug);
}
.link-preview .lp-url a { color: var(--accent); }
.link-preview .lp-meta {
  margin-top: var(--s-1);
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--lh-body);
}
.link-preview .lp-meta strong { color: var(--text); }
.link-preview.is-empty .lp-url { color: var(--muted); font-weight: 500; }
.link-preview.is-ready {
  border-color: #b7e0c8;
  background: #f3fbf6;
}

.color-row, .picker-row {
  display: flex;
  gap: var(--s-2);
  align-items: center;
}
.hex-field {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Menlo, monospace;
  font-size: var(--text-sm);
}
.pcr-button {
  width: 2.625rem !important;
  height: 2.625rem !important;
  border-radius: 0.625rem !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.color-from-site {
  border: 1px solid #c9d7f8;
  background: #eef3ff;
  border-radius: calc(var(--radius) * var(--phi-inv) + 8px);
  padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
}
.color-from-site.hidden { display: none !important; }
.color-from-site .cfs-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-1);
}
.cfs-swatches {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s-1); margin-bottom: var(--s-1);
}
.cfs-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.cfs-hex {
  font-family: ui-monospace, Menlo, monospace;
  font-size: var(--text-xs);
  font-weight: 600;
}
.cfs-on { color: var(--muted); font-size: var(--text-xs); }
.cfs-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--s-1);
  line-height: var(--lh-body);
}
.cfs-candidates {
  display: flex; flex-wrap: wrap;
  gap: var(--s-1); margin-bottom: var(--s-2);
}
.cand-swatch {
  width: 1.625rem; height: 1.625rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer; padding: 0;
}
.cand-swatch:hover {
  transform: scale(1.08);
  outline: 2px solid var(--accent);
}

.logo-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s-2);
}
.file-btn {
  display: inline-flex; align-items: center;
  font-size: var(--text-sm); font-weight: 600;
  padding: var(--s-2) var(--s-3);
  border-radius: calc(var(--radius) * var(--phi-inv) + 6px);
  border: 1.5px solid var(--border);
  background: #fff; cursor: pointer;
}
.file-btn input { display: none; }
.logo-preview {
  width: calc(var(--h0) * var(--phi));
  height: calc(var(--h0) * var(--phi));
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: none;
  background: #fff;
}
.logo-preview.show { display: block; }
.logo-clear {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--err);
  background: none; border: 0; cursor: pointer;
  font-family: inherit;
}
.logo-clear.hidden { display: none; }
.muted { color: var(--muted); }

.control-section {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--phi-inv) + 8px);
  padding: var(--s-3);
  margin-bottom: var(--s-3);
  background: var(--bg2);
}
.section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--s-2);
  display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap;
  line-height: var(--lh-snug);
}
.section-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2em 0.65em;
  border-radius: var(--radius-pill);
  background: #fff7e5;
  color: #8a5a00;
  border: 1px solid #f2d89a;
}
.section-pill-public {
  background: #e6f4ee;
  color: #0f5a34;
  border-color: #b7e0c8;
}

.control.is-locked-field .field {
  background: #f1f3f7;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.85;
}
.control.is-locked-field .field-label::after {
  content: " · locked";
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.check-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  gap: var(--s-1);
  align-items: center;
  line-height: var(--lh-snug);
}

.site-footer {
  margin-top: var(--s-5);
  padding: var(--s-4) 0 var(--s-5);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: space-between;
  align-items: center;
}

.tracked-only { display: block; }

@media (max-width: 640px) {
  .wrap { padding: 0 var(--s-3); }
  .hero { padding: var(--s-4) 0 var(--s-2); }
  .card { padding: var(--s-3); }
}

.qr-boot {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 600;
  padding: var(--s-4);
}
.qr-mount {
  /* ensure stage is obviously a QR area on first paint */
  min-height: 18rem;
}


/* ========== Belonging layout (like QR Codes Made Easy) ========== */
.hero {
  padding: var(--s-5) 0 var(--s-4);
  text-align: center;
}
.hero-inner {
  max-width: 42rem;
  margin: 0 auto;
}
.hero h1 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
}
.hero h1 em {
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}
.hero-lead {
  margin: var(--s-3) auto 0;
  max-width: 36ch;
  font-size: var(--text-md);
  line-height: var(--lh-body);
  color: var(--muted);
}
.hero-pills {
  justify-content: center;
  margin-top: var(--s-3);
}
.badge-accent {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.badge-accent strong { color: #fff !important; }

/* Single tool card: controls | sticky QR */
.tool-card {
  padding: 0;
  overflow: hidden;
  margin-top: var(--s-3);
}
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .tool-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.85fr);
  }
}
.pane-controls {
  padding: var(--s-4);
}
.step-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-3);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0;
}

/* Stage sits in soft well — belongs to the card */
.pane.stage {
  background: linear-gradient(180deg, #f3f5fa 0%, #e9edf5 100%);
  padding: var(--s-4);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
@media (max-width: 899px) {
  .pane.stage {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
@media (min-width: 900px) {
  .pane.stage {
    position: sticky;
    top: 0;
    align-self: stretch;
  }
}
.stage-frame {
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(15, 17, 23, 0.06);
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 17, 23, 0.04), 0 18px 40px -24px rgba(15, 17, 23, 0.28);
  padding: var(--s-3);
}
.qr-mount {
  min-height: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: var(--s-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-mount.is-demo::after { display: none; }
.stage-scan-hint {
  margin: 0 0 var(--s-2);
  text-align: center;
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  color: var(--text);
  font-weight: 600;
}
.stage-frame .link-preview {
  margin-bottom: var(--s-2);
  background: var(--bg2);
}
.stage-frame .link-preview.is-empty { display: none; }
.stage-frame .link-preview.is-ready { display: block; }
.stage-actions {
  margin-top: var(--s-2);
  justify-content: center;
}

/* Type tabs more like his segmented control */
.type-tabs {
  background: var(--bg3);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
  border: 0;
}
.type-tab {
  border: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.55rem 0.85rem;
}
.type-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  border: 0;
}

/* Hide abandoned hero-qr rules if present (no effect without markup) */
.hero-grid, .hero-qr-panel { display: contents; }

.export-panel {
  margin-top: var(--s-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.export-panel .field-label { margin-bottom: 0; }
.btn-block { width: 100%; }
.btn-flex { flex: 1; }
.export-row { display: flex; gap: var(--s-2); }
.export-check { justify-content: center; color: var(--muted); font-weight: 500; }
.export-note {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ok);
  font-weight: 600;
  margin: 0;
}
.export-note[hidden] { display: none !important; }
.embed-box { margin-top: 0; }
.embed-code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  line-height: 1.35;
  min-height: 4.5rem;
  resize: vertical;
}
.stage-frame .btn-dark.btn-block {
  padding: 0.9rem 1rem;
  font-size: var(--text-base);
  border-radius: 999px;
}
.stage-frame .btn-ghost.btn-block,
.stage-frame .export-row .btn-ghost {
  border-radius: 999px;
  padding: 0.75rem 1rem;
}

.print-cta {
  display: block;
  width: 100%;
  margin-top: var(--s-1);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  cursor: pointer;
  line-height: var(--lh-body);
}
.print-cta:hover { text-decoration: underline; }
.print-tips {
  margin-top: var(--s-2);
  padding: var(--s-3);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * var(--phi-inv) + 8px);
  text-align: left;
}
.print-tips h3 {
  font-size: var(--text-sm);
  margin-bottom: var(--s-2);
}
.print-tips ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--lh-body);
}
.print-tips li { margin-bottom: var(--s-1); }
.print-tips strong { color: var(--text); }

.presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
@media (min-width: 520px) {
  .presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 0.9rem;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.preset:hover {
  border-color: rgba(15, 17, 23, 0.22);
}
.preset.active {
  border-color: var(--text);
  background: #f7f8fc;
  box-shadow: 0 0 0 1px var(--text);
}
.preset svg {
  width: 2.15rem;
  height: 2.15rem;
  color: var(--text);
  display: block;
}
.preset span { line-height: 1.2; }
.style-step { margin-top: var(--s-1); }
