/* Layout: black hero band with brand + tool tabs, white tool card overlapping it, quiet white sections below. Palette from design.com (electric blue on black/white). */
:root {
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --surface-2: #EFEFEF;
  --fg: #0A0A0A;
  --muted: #606060;
  --line: #D1D1D1;
  --accent: #3F59F6;
  --accent-hover: #3247C5;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8ECFE;
  --accent-light: #B2BDFB;
  --link: #3247C5;
  --hero-bg: #000000;
  --hero-fg: #FFFFFF;
  --hero-muted: #D1D1D1;
  --hero-line: #3D3D3D;
  --warm: #3247C5;
  --ok: #1B7443;
  --warn: #A55412;
  --bad: #B3261E;
  --ad-bg: #F2F4FE;
  --ad-line: #B2BDFB;
  --ad-fg: #3247C5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .10);

  --f-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* type scale (8 steps) and spacing rhythm */
  --fs-xs: .75rem;    /* 12 labels, eyebrows */
  --fs-sm: .8125rem;  /* 13 hints, captions */
  --fs-md: .875rem;   /* 14 chips, field labels */
  --fs-base: 1rem;    /* 16 body, inputs, buttons */
  --fs-lg: 1.125rem;  /* 18 group titles */
  --fs-xl: 1.25rem;   /* 20 h3 */
  --fs-2xl: clamp(1.625rem, 3vw, 2.125rem); /* h2 */
  --fs-3xl: clamp(1.875rem, 4.2vw, 2.75rem); /* h1 */
  --sp-section: clamp(48px, 7vw, 80px);
  --line-strong: #949494;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --line-strong: #7A7A7A;
    --bg: #000000; --surface: #171717; --surface-2: #232323; --fg: #FFFFFF; --muted: #A3A3A3;
    --line: #3D3D3D; --accent: #3F59F6; --accent-hover: #5A70F8; --accent-ink: #FFFFFF; --accent-soft: #1A2152; --accent-light: #B2BDFB; --link: #B2BDFB;
    --hero-bg: #000000; --hero-fg: #FFFFFF; --hero-muted: #A3A3A3; --hero-line: #3D3D3D;
    --warm: #B2BDFB; --ok: #5CC98A; --warn: #E7A25C; --bad: #F2867D;
    --ad-bg: #111526; --ad-line: #3247C5; --ad-fg: #B2BDFB;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --line-strong: #7A7A7A;
  --bg: #000000; --surface: #171717; --surface-2: #232323; --fg: #FFFFFF; --muted: #A3A3A3;
  --line: #3D3D3D; --accent: #3F59F6; --accent-hover: #5A70F8; --accent-ink: #FFFFFF; --accent-soft: #1A2152; --accent-light: #B2BDFB; --link: #B2BDFB;
  --hero-bg: #000000; --hero-fg: #FFFFFF; --hero-muted: #A3A3A3; --hero-line: #3D3D3D;
  --warm: #B2BDFB; --ok: #5CC98A; --warn: #E7A25C; --bad: #F2867D;
  --ad-bg: #111526; --ad-line: #3247C5; --ad-fg: #B2BDFB;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--f-body); font-size: 16px; line-height: 1.55;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; text-wrap: balance; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- hero band (header + intro + tabs) ---------- */
.hero { background: var(--hero-bg); color: var(--hero-fg); padding-bottom: 56px; }
.site-header { border-bottom: 1px solid var(--hero-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--hero-fg); font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand b { color: var(--accent-light); font-weight: 600; }
.top-nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: .92rem; }
.top-nav a { color: var(--hero-muted); text-decoration: none; padding: 10px 2px; display: inline-block; }
.top-nav a:hover { color: var(--hero-fg); }

/* ---------- intro ---------- */
.intro { padding-block: 32px 22px; display: grid; gap: 12px; }
.intro h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; max-width: 30ch; }
.intro p { color: var(--hero-muted); max-width: 64ch; font-size: 1.0625rem; line-height: 1.55; }

/* ---------- tool tabs ---------- */
.tool-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tool-tabs::-webkit-scrollbar { display: none; }
.tool-tab {
  flex: none; border: 1px solid var(--hero-line); background: transparent; border-radius: 999px;
  padding: 10px 18px; font-weight: 600; font-size: .95rem; cursor: pointer; display: flex; gap: 8px; align-items: center; color: var(--hero-muted);
}
.tool-tab:hover { color: var(--hero-fg); border-color: var(--hero-muted); }
.tool-tab svg { width: 18px; height: 18px; }
.tool-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

main > .wrap > .tool-card { margin-top: -30px; position: relative; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 16px;
}
@media (min-width: 900px) { .tool-card { padding: 32px; } }

/* two-column tool layout: controls | preview */
.tool-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .tool-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 26px; align-items: start; }
  .tool-grid .preview-col { position: sticky; top: 12px; }
}
.controls { display: grid; gap: 28px; min-width: 0; }
.controls > .group + .group { border-top: 1px solid var(--line); padding-top: 24px; }
.preview-col { display: grid; gap: 12px; min-width: 0; }

/* ---------- form atoms ---------- */
.group { display: grid; gap: 14px; }
.group-title { font-family: var(--f-display); font-weight: 700; font-size: var(--fs-lg); line-height: 1.25; display: flex; align-items: center; gap: 10px; }
.group-title .step { font-family: var(--f-mono); font-size: var(--fs-xs); color: var(--accent-ink); background: var(--accent); font-weight: 700; letter-spacing: .02em; min-width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .label { font-size: var(--fs-md); font-weight: 600; color: var(--fg); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], input[type="password"], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: var(--fs-base); min-height: 46px;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.big-input { font-size: 1.08rem !important; min-height: 52px !important; background: var(--surface) !important; border-width: 1.5px !important; }
.hint { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 14px;
  font-size: var(--fs-md); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 40px;
}
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 6px; }
.seg button {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 6px;
  cursor: pointer; display: grid; justify-items: center; gap: 4px; font-size: .84rem; font-weight: 600; color: var(--muted);
}
.seg button svg { width: 34px; height: 34px; }
.seg button[aria-pressed="true"] { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }

.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.color-pick { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; min-width: 0; }
.color-pick .top { display: flex; align-items: center; gap: 10px; }
.color-pick input[type="color"] { width: 42px; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: var(--surface); cursor: pointer; flex: none; }
.color-pick .name { font-size: .85rem; font-weight: 600; }
.color-pick .hex { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }

.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-grid button { width: 40px; height: 40px; font-size: 1.3rem; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; padding: 0; line-height: 1; }
.emoji-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.emoji-grid input { width: 64px; min-height: 40px; padding: 6px; text-align: center; font-size: 1.2rem; }

.range { display: grid; gap: 4px; }
.range .head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--muted); }
.range output { font-family: var(--f-mono); color: var(--fg); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); padding: 10px 18px; font-weight: 700; cursor: pointer;
  min-height: 46px; text-decoration: none; color: var(--fg); font-size: var(--fs-base);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-dark:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-link { background: none; border: none; color: var(--link); padding: 10px 2px; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 auto; }

details.more { border-top: 1px dashed var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--link); }

/* ---------- previews ---------- */
.stage { background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--line); padding: 38px 16px 16px; display: grid; place-items: center; min-width: 0; position: relative; }
.qr2d { width: min(100%, 260px); aspect-ratio: 1; display: grid; place-items: center; }
.qr2d canvas, .qr2d svg { width: 100% !important; height: auto !important; border-radius: 6px; }
.stage-label { position: absolute; top: 12px; left: 14px; font-family: var(--f-mono); font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.viewer { width: 100%; aspect-ratio: 4 / 3; max-height: 380px; position: relative; border-radius: 10px; overflow: hidden; touch-action: none; }
.viewer canvas { display: block; width: 100% !important; height: 100% !important; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: .9rem; }
.viewer-hint { position: absolute; bottom: 8px; right: 10px; font-size: var(--fs-xs); background: var(--surface); padding: 2px 8px; border-radius: 999px; color: var(--muted); pointer-events: none; }

.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.readout div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.readout dt { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.readout dd { margin: 0; font-family: var(--f-mono); font-size: .9rem; font-variant-numeric: tabular-nums; }
.warns { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.warns li { font-size: .85rem; padding: 7px 10px; border-radius: 8px; border-left: 3px solid; background: var(--surface-2); }
.warns li.ok { border-color: var(--ok); }
.warns li.warn { border-color: var(--warn); }
.warns li.bad { border-color: var(--bad); }
.warns li b { font-weight: 700; }

.card-stage canvas { width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,.15); border-radius: 4px; background: #fff; }
.card-stage { padding: 42px 20px 22px; }

.privacy { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--muted); margin-top: 12px; }
.privacy svg { width: 18px; height: 18px; flex: none; color: var(--ok); margin-top: 2px; }

.subtabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.subtabs button { border: 0; background: none; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; color: var(--muted); }
.subtabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.quotes { display: grid; gap: 8px; }
.quote {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px; background: var(--bg);
}
.quote.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.quote p { font-size: 1rem; }
.quote .qa { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- ad placeholders ---------- */
.ad-slot {
  border: 1.5px dashed var(--ad-line); background: var(--ad-bg); color: var(--ad-fg); border-radius: 10px;
  display: grid; place-items: center; text-align: center; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .12em;
  margin-inline: auto; width: 100%;
}
.ad-slot b { font-size: .95rem; letter-spacing: .2em; display: block; }
.ad-slot small { letter-spacing: .02em; opacity: .8; }
.ad-leaderboard { max-width: 970px; min-height: 90px; margin-block: 22px; }
.ad-rect { max-width: 336px; min-height: 280px; }
.ad-incontent { margin-block: 30px; }

dialog.ad-modal { border: 0; border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--fg); box-shadow: 0 30px 80px rgba(0,0,0,.35); width: min(92vw, 380px); }
dialog.ad-modal::backdrop { background: rgba(10, 15, 13, .55); }
.ad-modal .inner { padding: 18px; display: grid; gap: 12px; position: relative; }
.ad-modal .close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.ad-modal .ok-line { font-weight: 700; font-family: var(--f-display); font-size: 1.1rem; padding-right: 40px; }
.ad-modal .ad-slot { min-height: 250px; max-width: 300px; }

.ad-corner {
  position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: min(300px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; display: grid; gap: 6px;
}
.ad-corner .ad-slot { min-height: 100px; }
.ad-corner .x { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.ad-corner .lbl { font-size: .7rem; color: var(--muted); font-family: var(--f-mono); letter-spacing: .08em; }

.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 60; background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* ---------- content below the tool ---------- */
.section { padding-block: var(--sp-section); }
.section h2 { font-size: var(--fs-2xl); letter-spacing: -.02em; margin-bottom: 24px; }
.section .lead { color: var(--muted); max-width: 62ch; margin-top: -10px; margin-bottom: 28px; font-size: var(--fs-lg); }
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: s; }
.steps li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; display: grid; gap: 8px; align-content: start; }
.steps ol { padding: 0; margin: 0; }
.steps .n { font-family: var(--f-mono); font-size: var(--fs-xs); letter-spacing: .08em; color: var(--link); font-weight: 700; }
.steps h3 { font-size: var(--fs-xl); }
.steps p { color: var(--muted); font-size: .95rem; }

.ideas { display: grid; gap: 32px 24px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.idea { border-top: 3px solid var(--accent); padding-top: 12px; display: grid; gap: 6px; align-content: start; }
.idea h3 { font-size: var(--fs-xl); }
.idea p { color: var(--muted); font-size: .94rem; }
.idea .spec { font-family: var(--f-mono); font-size: var(--fs-xs); color: var(--warm); }

.prose { display: grid; gap: 14px; }
.prose > * { max-width: 68ch; }
.prose p { line-height: 1.65; }
.prose h3 { font-size: var(--fs-xl); margin-top: 14px; }
.prose p { color: var(--fg); }

.faq { display: grid; gap: 8px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0; }
.faq summary { padding: 16px 18px; min-height: 44px; }
.faq details p { padding: 0 18px 18px; margin-top: 0 !important; }
.faq summary { cursor: pointer; font-weight: 700; list-style-position: outside; }
.faq details p { margin-top: 10px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 20px; }
.site-footer .wrap { padding-block: 22px; display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: space-between; font-size: .88rem; color: var(--muted); }
.site-footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.site-footer nav a { padding-block: 10px; }
.site-footer a { color: var(--muted); }

.noscript-msg { padding: 16px; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .tool-tab, .seg button { transition: background-color .15s, border-color .15s, color .15s, filter .15s; }
  .toast { animation: toastIn .25s ease-out; }
  @keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }
}

/* ---------- phones: tool first, preview right under the input ---------- */
@media (max-width: 899px) {
  .intro { padding-block: 18px 14px; }
  .intro p .more-intro, .intro p .desk-only { display: none; }
  #panel-qr .tool-grid > .controls, #panel-qr .tool-grid > .preview-col,
  #panel-tarjetas .tool-grid > .controls, #panel-tarjetas .tool-grid > .preview-col { display: contents; }
  #panel-qr .controls > :nth-child(1) { order: 1; }
  #panel-qr .preview-col > :nth-child(1) { order: 2; }
  #panel-qr .preview-col > :nth-child(2) { order: 3; }
  #panel-qr .controls > :nth-child(2) { order: 4; }
  #panel-qr .controls > :nth-child(3) { order: 5; }
  #panel-qr .preview-col > :nth-child(n+3) { order: 6; }
  #panel-tarjetas .controls > :nth-child(1) { order: 1; }
  #panel-tarjetas .preview-col > :nth-child(1) { order: 2; }
  #panel-tarjetas .preview-col > :nth-child(2) { order: 3; }
  #panel-tarjetas .controls > :nth-child(n+2) { order: 4; }
  #panel-tarjetas .preview-col > :nth-child(n+3) { order: 5; }
  #qr-kind { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
  #qr-kind::-webkit-scrollbar { display: none; }
  #qr-kind .chip { flex: none; }
  .qr2d { width: min(100%, 220px); }
}
@media (max-width: 640px) {
  .top-nav { display: none; }
  .intro h1 { font-size: 1.55rem; }
}

/* ---------- logo upload ---------- */
.logo-drop { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 10px 12px; cursor: pointer; background: var(--bg); min-width: 0; }
.logo-drop:hover, .logo-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.logo-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-thumb {
  width: 64px; height: 64px; flex: none; border-radius: 8px; display: grid; place-items: center; color: var(--muted); overflow: hidden;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 0 / 12px 12px; border: 1px solid var(--line);
}
.logo-thumb svg { width: 24px; height: 24px; }
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-copy { display: grid; gap: 2px; min-width: 0; }
.logo-copy strong { font-size: .95rem; overflow-wrap: anywhere; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* subtabs + stage labels on narrow screens */
.stage-label { max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .subtabs { display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; width: 100%; }
  .subtabs button { border-radius: 10px; font-size: .88rem; padding: 8px 6px; }
}

/* ---------- template galleries ---------- */
.tpl-current { margin-left: auto; font-family: var(--f-body); font-size: .8rem; font-weight: 600; color: var(--link); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.tpl-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tpl-cats::-webkit-scrollbar { display: none; }
.tpl-cats .chip { flex: none; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-grid.portrait, .tpl-grid.square { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tpl { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 6px 6px 8px; cursor: pointer; display: grid; gap: 6px; text-align: left; min-width: 0; }
.tpl:hover { border-color: var(--accent-light); }
.tpl[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl canvas { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.12); display: block; }
.tpl span { font-size: .8rem; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl[aria-pressed="true"] span { color: var(--fg); }
@media (max-width: 520px) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-grid.portrait, .tpl-grid.square { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- touch: 44 px minimum targets ---------- */
@media (pointer: coarse) {
  .chip, .tool-tab, .subtabs button, .seg button, .emoji-grid button { min-height: 44px; }
  .swatch { width: 34px; height: 34px; }
  .emoji-grid button { width: 44px; }
}
/* short tab labels on phones so all three tools stay visible */
.tab-short { display: none; }
@media (max-width: 520px) {
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tool-tab { padding: 10px 14px; }
  .controls > .group + .group { padding-top: 20px; }
  .tool-card { padding: 18px 16px; }
}

.stage-3d { padding: 38px 0 0; overflow: hidden; }
.stage-3d .viewer { border-radius: 0 0 10px 10px; }
.subtabs button { min-height: 44px; }
details.more summary { padding-block: 11px; }
.color-pick input[type="color"] { width: 46px; height: 44px; }
.site-footer a { display: inline-block; padding-block: 10px; }
.group-title { flex-wrap: wrap; row-gap: 6px; }

/* ---------- your own template ---------- */
.tpl-upload { border-style: dashed; border-color: var(--line-strong); background: var(--bg); }
.tpl-upload:hover, .tpl-upload.over { border-color: var(--accent); background: var(--accent-soft); }
.tpl-upload .up-box { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; border-radius: 6px; color: var(--link); text-align: center; padding: 6px; }
.tpl-upload .up-box svg { width: 24px; height: 24px; }
.tpl-upload .up-box b { font-size: var(--fs-md); color: var(--fg); }
.tpl-upload .up-box small { font-size: var(--fs-xs); color: var(--muted); }
.custom-opts { display: grid; gap: 12px; border: 1px solid var(--accent-light); background: var(--accent-soft); border-radius: var(--r-md); padding: 14px 16px; }
.custom-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.custom-head strong { font-family: var(--f-display); font-size: var(--fs-lg); }

/* ---------- imagery: hero card stack, showcase scenes, product photos ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
.hero-art { display: block; position: relative; height: 190px; perspective: 1400px; margin: -6px 0 6px; overflow: hidden; }
.hero-art .stack { transform: rotateX(42deg) rotateZ(-20deg) scale(.72); }
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; }
  .hero-art { height: 300px; margin: 0; overflow: visible; }
  .hero-art .stack { transform: rotateX(42deg) rotateZ(-24deg) translate(-4%, 2%); }
}
.stack { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(42deg) rotateZ(-24deg) translate(-4%, 2%); }
.stack canvas { position: absolute; left: 50%; top: 50%; width: 250px; height: auto; border-radius: 5px; transform-origin: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 18px 30px rgba(0,0,0,.55); }
@media (prefers-reduced-motion: no-preference) {
  .stack canvas { animation: floaty 7s ease-in-out infinite; }
  .stack canvas:nth-child(2) { animation-delay: -1.2s; } .stack canvas:nth-child(3) { animation-delay: -2.4s; }
  .stack canvas:nth-child(4) { animation-delay: -3.6s; } .stack canvas:nth-child(5) { animation-delay: -4.8s; }
  @keyframes floaty { 50% { translate: 0 0 10px; } }
}
.scenes { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.scene { margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: grid; }
.scene-art { background: var(--scene); aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.scene-art canvas { position: absolute; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 14px 28px rgba(0,0,0,.18); height: auto; }
.scene-art .back { opacity: .96; }
.scene figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.scene figcaption span { display: grid; min-width: 0; }
.scene figcaption b { font-family: var(--f-display); font-size: var(--fs-lg); }
.scene figcaption small { color: var(--muted); font-size: var(--fs-sm); }
.scene .btn { flex: none; min-height: 44px; font-size: var(--fs-md); }
.idea-img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); display: block; margin-bottom: 6px; background: var(--surface-2); }
.idea-mock { background: var(--scene); position: relative; overflow: hidden; }
.idea-mock canvas { position: absolute; width: 74%; left: 13%; top: 22%; border-radius: 4px; box-shadow: 0 14px 28px rgba(0,0,0,.2); transform: rotate(-5deg); }
.idea { border-top: 0 !important; padding-top: 0 !important; }

@media (min-width: 900px) { .ideas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
