:root,
[data-theme="light"],
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080f;
  --bg-elev: #12131c;
  --header: rgba(7, 8, 15, 0.72);
  --ink: #f5f7fb;
  --muted: #a7adbd;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #c084fc;
  --accent-strong: #e879f9;
  --accent-soft: rgba(168, 85, 247, 0.18);
  --on-accent: #fff;
  --grad: linear-gradient(90deg, #e879f9 0%, #a78bfa 46%, #22d3ee 100%);
  --good: #3dd68c;
  --warn: #f5c451;
  --danger: #ff8d86;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --check-a: #1a1d28;
  --check-b: #2c3040;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(560px 320px at 78% 18%, rgba(147, 51, 234, 0.22), transparent 68%),
    radial-gradient(420px 260px at 92% 46%, rgba(236, 72, 153, 0.14), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
::selection { background: var(--accent-soft); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--bg-elev);
  padding: 8px 12px;
  z-index: 80;
}
.skip:focus { top: 8px; }

.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.logo svg { width: 36px; height: 36px; color: var(--accent); }
.logo strong { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 650;
}
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; }
[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon { display: none; }
#themeToggle { display: none; }

main { padding: 22px 0 48px; }
.view { display: none; }
.view.is-active { display: block; }
.site-footer { color: var(--muted); font-size: 13px; padding-bottom: 28px; }

.hero { padding: 18px 0 8px; }
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 8px 0;
}
.lede { margin: 0; max-width: 66ch; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.feature, .panel, .stat, .art, .config, .preview-panel {
  background: rgba(16, 18, 28, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.feature { padding: 16px; }
.feature h2 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 12px 14px; }
.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat-value {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-cost { margin: 8px 0 0; font-weight: 800; color: var(--accent); }
.cost-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cost-field input {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--ink);
}
.util-bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.util-bar span { display: block; height: 100%; width: 0; background: var(--grad); }

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: var(--bg-elev);
  text-align: center;
  padding: 28px 16px;
  cursor: pointer;
}
.dropzone:hover, .dropzone:focus, .dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.dropzone strong { display: block; font-size: 18px; }
.dropzone p { margin: 6px 0 0; color: var(--muted); }
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
.drop-status { min-height: 1.2em; margin: 0; color: var(--muted); font-size: 13px; }

.arts.is-sampling .thumb,
.arts.is-sampling .thumb img { cursor: crosshair; }

.ps-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10121a;
  overflow: hidden;
}
.ps-kicker {
  margin: 0;
  padding: 8px 10px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ps-panel > .ps-kicker:not(:first-child) {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 8px;
}
.ps-props {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 8px 10px 10px;
}
.ps-props .qty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.ps-props .qty > span { color: var(--muted); font-size: 12px; }
.ps-panel .field input,
.ps-panel .qty-row input,
.ps-panel .lock-btn,
.ps-panel .step { min-height: 34px; height: 34px; border-radius: 7px; }
.ps-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}
.ps-tool {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #d7d9e6;
}
.ps-tool:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.ps-tool.is-on {
  background: var(--accent-soft);
  border-color: rgba(192, 132, 252, 0.7);
  color: #fff;
}
.ps-tool:disabled { opacity: 0.35; cursor: not-allowed; }
.ps-tool-gap { flex: 1; }
.ps-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
}
.ps-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.ps-slide { flex: 1 1 140px; min-width: 0; }
.ps-slide input[type="range"] { flex: 1; width: auto; min-width: 72px; accent-color: var(--accent); }
.ps-options input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.ps-num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}
.ps-num-input {
  width: 52px;
  height: 30px;
  padding: 0 4px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0b0d14;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ps-apply {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
}
.ps-hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.ps-text,
.ps-font {
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0b0d14;
  color: var(--ink);
  font-size: 13px;
}
.ps-text {
  flex: 1 1 140px;
  min-width: 0;
  padding: 0 8px;
}
.ps-font {
  max-width: 100%;
  padding: 0 6px;
}
.ps-options .text-color {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.ps-options.is-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}
.ps-options.is-text .ps-text,
.ps-options.is-text .ps-apply,
.ps-options.is-text .ps-hint { grid-column: 1 / -1; }
.ps-options.is-text .ps-apply { justify-self: start; }
.ps-options.is-text .ps-font { width: 100%; max-width: none; }
.art .thumb.is-texting,
.art .thumb.is-texting img { cursor: text; }
.text-anchor {
  position: absolute;
  z-index: 3;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px #000;
  pointer-events: none;
}
.arts.is-list .ps-panel,
.arts.is-list .art-actions { grid-column: 1 / -1; }

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.view-toggle { display: flex; gap: 6px; margin-left: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }

.arts.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.arts.is-list { display: flex; flex-direction: column; gap: 10px; }
.art { padding: 12px; }
.arts.is-grid .art { display: flex; flex-direction: column; gap: 10px; }
.arts.is-list .art {
  display: grid;
  grid-template-columns: auto 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.thumb.is-erasing,
.thumb.is-erasing img { cursor: none; touch-action: none; }
.eraser-layer { position: absolute; z-index: 2; pointer-events: none; }
.eraser-cursor {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}
.art .thumb img { cursor: crosshair; }
.art .thumb.is-erasing,
.art .thumb.is-erasing img { cursor: none; touch-action: none; }
.arts.is-grid .thumb { aspect-ratio: 4 / 3; }
.arts.is-list .thumb { width: 84px; height: 84px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.checker {
  background-color: var(--check-a);
  background-image:
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--check-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--check-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--check-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.art-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.art-meta { display: block; color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 750;
}
.badge.alta { background: rgba(61, 214, 140, 0.16); color: #8af0c0; }
.badge.media { background: rgba(245, 196, 81, 0.16); color: #f5c451; }
.badge.baixa { background: rgba(255, 141, 134, 0.16); color: #ffb0aa; }
.art-warn { margin: 6px 0 0; color: var(--danger); font-size: 12px; }
.art-warn.is-soft { color: var(--warn); }
.dims { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.qty-row { display: flex; align-items: center; gap: 6px; }
.qty-row input { width: 72px; text-align: center; }
.art-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.art-real { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.art-real strong { color: var(--ink); }
/* Quantidade da arte na folha (o encaixe monta todas as cópias ao gerar) */
.ps-qty { display: flex; flex-direction: column; gap: 4px; padding: 0 10px 10px; }
.ps-qty-label { font-size: 13px; color: var(--muted); }
.ps-qty .qty-row { display: grid; grid-template-columns: 34px 1fr 34px; gap: 6px; }
.ps-qty .qty-row input { width: 100%; text-align: center; font-weight: 700; }
.ps-qty .step { display: inline-grid; place-items: center; padding: 0; font-size: 18px; line-height: 1; }
.arts.is-list .art-actions { justify-content: flex-end; }
.empty {
  grid-column: 1 / -1;
  width: 100%;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.empty p {
  margin: 0 auto;
  max-width: 40em;
  text-align: center;
}
.empty p + p { margin-top: 6px; }
.empty strong { color: var(--ink); }

.config { position: sticky; top: 88px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.config h2 { margin: 0; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field input, .qty-row input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 10px;
}
.readonly-row, .check-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.useful { margin: 0; color: var(--muted); font-size: 13px; }
.help, .hint, .legend, .sheet-meta, .pack-line { color: var(--muted); font-size: 13px; }
.form-error { color: var(--danger); font-size: 13px; margin: 0; }
.check-row { justify-content: flex-start; font-weight: 650; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.28);
}
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn-block { width: 100%; min-height: 54px; white-space: normal; text-align: center; line-height: 1.25; padding: 12px; }
.btn-small { min-height: 36px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lock-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: grid;
  place-items: center;
}
.lock-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.step {
  width: 36px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 18px;
}

.result-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 12px; }
.result-bar .btn-primary {
  margin-left: auto;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  padding-top: 8px;
  padding-bottom: 8px;
}
.preview-panel { padding: 14px; }
.sheet-pop[hidden] { display: none; }
.sheet-pop.is-open {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  padding: 0;
  background: #101218;
}
.sheet-pop.is-inline { display: block; }
.sheet-pop-card {
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #161822;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.sheet-pop.is-inline .sheet-pop-card {
  width: auto;
  max-height: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.sheet-pop-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sheet-pop-head h3 { margin: 0; font-size: 18px; }
.sheet-pop-head .tabs { flex: 1; }
.sheet-pop .stage { height: min(68vh, 720px); min-height: 380px; }
.sheet-pop.is-open .sheet-pop-card {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 14px 10px;
}
.sheet-pop.is-open .sheet-pop-head,
.sheet-pop.is-open .sheet-meta,
.sheet-pop.is-open .legend { flex-shrink: 0; }
.sheet-pop.is-open .stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
.sheet-pop.is-inline .stage { height: calc(100vh - 300px); min-height: 480px; }
body.sheet-pop-open { overflow: hidden; }
.sheet-overview {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  overflow-x: auto;
  padding: 16px;
  height: calc(100vh - 300px);
  min-height: 480px;
  background: #0c0d11;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.sheet-overview[hidden] { display: none; }
.sheet-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
}
.sheet-card canvas {
  display: block;
  max-width: none;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.sheet-card strong { font-size: 14px; font-weight: 700; }
.sheet-card em { font-style: normal; color: var(--muted); font-size: 12px; }
.sheet-card:hover canvas,
.sheet-card:focus-visible canvas { outline: 2px solid #c084fc; outline-offset: 3px; }
.preview-toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.tabs, .zoom-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.backdrop-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 8px;
}
.backdrop-controls { display: flex; gap: 6px; align-items: center; }
.backdrop-label { color: var(--muted); font-size: 12px; }
.backdrop-note { margin: 0; color: var(--muted); font-size: 12px; }
.backdrop-controls .btn.is-on { color: var(--accent); border-color: var(--accent); }
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}
.swatch.checker { background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0; }
.swatch-black { background: #000; }
.swatch-white { background: #fff; border-color: rgba(0, 0, 0, 0.28); }
.swatch-green { background: #16a34a; }
.swatch-red { background: #dc2626; }
.tabs button[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; }
#zoomLabel { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.stage {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 36px minmax(0, 1fr);
  height: calc(100vh - 300px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}
.corner {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ruler-x, .ruler-y { position: relative; overflow: hidden; background: var(--bg-elev); }
.ruler-x { border-bottom: 1px solid var(--line); }
.ruler-y { border-right: 1px solid var(--line); }
.ruler-x canvas, .ruler-y canvas { position: absolute; left: 0; top: 0; }
.sheet-scroll { overflow: auto; background: #0c0d11; }
.sheet-stage { position: relative; }
#handles { position: absolute; inset: 0; z-index: 3; }
.handle { position: absolute; box-sizing: border-box; cursor: grab; touch-action: none; z-index: 2; }
.handle.is-selected { outline: 2px solid var(--accent); z-index: 4; }
.handle.is-invalid { outline: 2px solid var(--danger); }
.handle-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 5; }
.handle-tools button, .handle-resize {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 800; cursor: pointer;
  pointer-events: auto;
}
.handle-resize { position: absolute; right: -6px; bottom: -6px; cursor: nwse-resize; }
.handle-rotate {
  position: absolute;
  left: 50%;
  top: -36px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: grab;
  z-index: 6;
}
.handle-rotate::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: var(--accent);
}

.panel { padding: 18px; }
.panel h1 { margin-top: 0; letter-spacing: -0.03em; }

.modal, .busy {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
}
.modal-card, .busy-card {
  width: min(460px, 100%);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.busy-card { width: auto; display: flex; align-items: center; gap: 14px; }
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
}
.toast {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--good); }
.toast.warn { border-left-color: var(--warn); }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
[aria-busy="true"] { pointer-events: none; }

@media (max-width: 980px) {
  .editor-layout, .features { grid-template-columns: 1fr; }
  .config { position: static; }
  .arts.is-list .art { display: flex; flex-direction: column; align-items: stretch; }
  .arts.is-list .thumb { width: 100%; height: 140px; }
}
@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .header-inner { flex-wrap: wrap; padding: 8px 0; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .result-bar .btn-primary { margin-left: 0; width: 100%; }
  .view-toggle { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.logo-home,
.logo-text-home,
.nav-home { display: none; }
.logo-home svg { display: block; }

html.is-home body {
  background:
    radial-gradient(560px 320px at 78% 22%, rgba(147, 51, 234, 0.28), transparent 68%),
    radial-gradient(420px 260px at 90% 48%, rgba(236, 72, 153, 0.18), transparent 70%),
    #07080f;
  color: #f5f7fb;
}
html.is-home .header {
  background: rgba(7, 8, 15, 0.72);
  border-bottom-color: transparent;
}
html.is-home .logo-app,
html.is-home .logo-text-app,
html.is-home .nav-app,
html.is-home #themeToggle { display: none; }
html.is-home .logo { color: #fff; font-weight: 650; }
html.is-home .logo-home { display: inline-flex; }
html.is-home .logo-text-home { display: inline; }
html.is-home .nav-home { display: flex; }
html.is-home .nav-home a {
  color: #c5c9d6;
  background: transparent;
  font-weight: 500;
  font-size: 15px;
}
html.is-home .nav-home a:hover { color: #fff; background: transparent; }
html.is-home .site-footer .footer-note,
html.is-generator .site-footer .footer-note { display: none; }
html.is-home main { padding-top: 8px; }

.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e879f9 0%, #a78bfa 46%, #22d3ee 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.35);
}
.btn-gradient:hover { filter: brightness(1.08); color: #fff; }
.btn-gradient:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
  padding: 42px 0 8px;
  scroll-margin-top: 88px;
}
.landing-copy h1 {
  margin: 0;
  max-width: 12em;
  color: #fff;
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
}
.landing-lede {
  margin: 18px 0 0;
  max-width: 46ch;
  color: #a7adbd;
  font-size: 16px;
  line-height: 1.55;
  scroll-margin-top: 96px;
}
.landing-lede strong { color: #fff; font-weight: 700; }
.landing-save {
  display: block; width: fit-content; max-width: min(100%, 46ch); margin: 16px 0 0; padding: 8px 12px; border-radius: 10px;
  background: rgba(61, 214, 140, .1); border: 1px solid rgba(61, 214, 140, .35); color: #c9f5de; font-size: 14.5px; line-height: 1.45;
}
.landing-save strong { color: #3dd68c; }
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 26px;
}
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #b7bccb;
  font-size: 13.5px;
}
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 18px; height: 18px; flex: none; }

a.mock-wrap {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 18px;
}
a.mock-wrap:hover .mock-window { transform: translateY(-2px); }
a.mock-wrap:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
.mock-window { transition: transform 0.18s ease; }
.mock-wrap::before {
  content: "";
  position: absolute;
  inset: 6% -8% -10% -6%;
  background:
    radial-gradient(circle at 72% 42%, rgba(168, 85, 247, 0.55), transparent 58%),
    radial-gradient(circle at 38% 72%, rgba(236, 72, 153, 0.38), transparent 52%);
  filter: blur(16px);
  z-index: 0;
  pointer-events: none;
}
.mock-window {
  position: relative;
  z-index: 1;
  width: min(468px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #12131c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.mock-dots { display: flex; gap: 6px; padding: 12px 14px 0; }
.mock-dots span { width: 10px; height: 10px; border-radius: 50%; }
.mock-dots span:nth-child(1) { background: #ff5f57; }
.mock-dots span:nth-child(2) { background: #febc2e; }
.mock-dots span:nth-child(3) { background: #28c840; }
.mock-stage {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 14px;
  padding: 14px 16px 18px;
  align-items: stretch;
}
.mock-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  padding: 18px 12px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: #c5cad6;
  background: rgba(255, 255, 255, 0.02);
}
.mock-drop svg { width: 42px; height: 42px; color: #9aa3b5; }
.mock-drop p { margin: 12px 0 0; font-size: 14px; line-height: 1.35; }
.mock-drop small { margin-top: 8px; color: #8b93a7; font-size: 12px; letter-spacing: 0.04em; }
.mock-sheet-box { position: relative; padding: 22px 0 0 28px; }
.dim {
  position: absolute;
  color: #9aa3b8;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.dim-x {
  top: 0;
  left: 28px;
  right: 0;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dim-x::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  border-top: 1px solid rgba(154, 163, 184, 0.75);
}
.dim-y {
  left: 0;
  top: 22px;
  bottom: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dim-y::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  border-left: 1px solid rgba(154, 163, 184, 0.75);
}
.dim-x > span,
.dim-y > span {
  position: relative;
  z-index: 1;
  background: #12131c;
  padding: 0 5px;
  line-height: 1;
}
.dim-y > span {
  transform: rotate(-90deg);
  white-space: nowrap;
}
.mock-sheet {
  height: 100%;
  border-radius: 12px;
  padding: 2px;
  background:
    linear-gradient(#f5f6fa, #f5f6fa) padding-box,
    linear-gradient(160deg, #22d3ee, #a855f7 42%, #f472b6) border-box;
  border: 2px solid transparent;
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.25),
    0 0 28px rgba(168, 85, 247, 0.55),
    0 0 46px rgba(244, 114, 182, 0.28);
}
.mock-sheet-inner {
  position: relative;
  width: 176px;
  height: 340px;
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
}
.mock-sheet-inner img {
  position: absolute;
  display: block;
  object-fit: fill;
}
.mock-sheet-inner .p05 { left: 2px; top: 2px; width: 65.8px; height: 71.6px; }
.mock-sheet-inner .p07 { left: 68.8px; top: 2px; width: 62.6px; height: 61.6px; }
.mock-sheet-inner .p14 { left: 68.8px; top: 64.6px; width: 61px; height: 62.6px; }
.mock-sheet-inner .p15 { left: 2px; top: 74.6px; width: 62.6px; height: 60.6px; }
.mock-sheet-inner .p02 { left: 65.6px; top: 128.2px; width: 52.6px; height: 71.6px; }
.mock-sheet-inner .p08 { left: 2px; top: 136.1px; width: 62.6px; height: 59.7px; }
.mock-sheet-inner .p06 { left: 119.3px; top: 128.2px; width: 51.6px; height: 71.6px; }
.mock-sheet-inner .p09 { left: 2px; top: 196.8px; width: 62.6px; height: 50.3px; }
.mock-sheet-inner .p11 { left: 2px; top: 248.1px; width: 45.6px; height: 62.6px; }
.mock-sheet-inner .p10 { left: 130.8px; top: 64.6px; width: 39.2px; height: 62.6px; }
.mock-sheet-inner .p03 { left: 65.6px; top: 200.8px; width: 71.6px; height: 33.3px; }
.mock-sheet-inner .p04 { left: 65.6px; top: 235.1px; width: 71.6px; height: 30.7px; }
.mock-sheet-inner .p01 { left: 138.2px; top: 200.8px; width: 24.3px; height: 71.6px; }
.mock-sheet-inner .p12 { left: 48.6px; top: 266.8px; width: 62.6px; height: 26.5px; }
.mock-sheet-inner .p13 { left: 2px; top: 311.7px; width: 62.6px; height: 25.4px; }
.mock-sheet-inner .p16 { left: 65.6px; top: 294.4px; width: 62.6px; height: 22.5px; }
@media (max-width: 800px) { html.is-home .nav-home { gap: 0; flex-wrap: wrap; overflow: visible; } html.is-home .nav-home a { font-size: 14px; padding: 6px 8px; white-space: nowrap; } }
.landing-benefits { margin-top: 64px; scroll-margin-top: 88px; }
.landing-benefits h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.landing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-card {
  background: rgba(16, 18, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px 20px 24px;
}
.landing-card h3 { margin: 14px 0 8px; color: #fff; font-size: 16px; }
.landing-card p { margin: 0; color: #9aa3b5; font-size: 14px; line-height: 1.5; }
.landing-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.landing-icon svg { width: 18px; height: 18px; }
.landing-icon.puzzle { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.landing-icon.image { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; }
.landing-icon.lock { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }

@media (max-width: 980px) {
  .landing-hero, .landing-grid, .mock-stage { grid-template-columns: 1fr; }
  .landing-copy h1 { max-width: none; }
  .mock-window, .mock-sheet-box { margin-left: auto; margin-right: auto; }
  .mock-drop { min-height: 180px; }
}

/* Pagamento (Mercado Pago: Pix e cartão) */
.pay-modal { align-items: start; overflow-y: auto; }
.pay-card { width: min(560px, 100%); margin: 24px auto; position: relative; }
.pay-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 36px; }
.pay-head > div:first-child { flex: 1; min-width: 0; }
.pay-head h3 { margin: 0; }
.pay-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.pay-total { text-align: right; white-space: nowrap; }
.pay-total span { display: block; color: var(--muted); font-size: 12px; }
.pay-total strong { font-size: 22px; color: var(--accent); }
.pay-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1;
}
.pay-close:hover { color: var(--ink); border-color: var(--accent); }
.pay-methods { margin: 10px 0 14px; color: var(--muted); font-size: 13px; }
/* Aviso: o pagamento é feito pelo Mercado Pago */
.mp-aviso {
  display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 14px; padding: 10px 12px;
  border: 1px solid rgba(0, 158, 227, .45); background: rgba(0, 158, 227, .09); border-radius: 10px;
  color: var(--ink); font-size: 13px; line-height: 1.45;
}
.mp-aviso svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: #4fc3f7; }
.mp-aviso b { color: #4fc3f7; }
.mp-aviso small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pay-msg {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 141, 134, 0.12); border: 1px solid rgba(255, 141, 134, 0.4); color: var(--danger);
  font-size: 14px;
}
.pay-msg.info { background: var(--accent-soft); border-color: var(--line); color: var(--ink); }
.pay-loading, .pay-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 12px 0; }
.pay-loading .spinner, .pay-wait .spinner { width: 18px; height: 18px; border-width: 2px; flex: none; }
.pay-pix { display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.pay-pix-title { margin: 0; font-weight: 700; }
.pix-qr { width: 220px; height: 220px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 8px; }
.pay-pix .field { text-align: left; }
.pay-pix textarea {
  width: 100%; resize: none; font: 12px/1.4 ui-monospace, Consolas, monospace;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  word-break: break-all;
}
.pay-pix .pay-wait { justify-content: center; }
.pay-note { margin: 0; color: var(--muted); font-size: 12px; }
.pay-pix #pixOther { align-self: center; }
.pay-done { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 0 6px; }
.pay-done svg { width: 56px; height: 56px; color: var(--good); }
.pay-done p { margin: 0; }
@media (max-width: 520px) {
  .pay-card { margin: 8px auto; padding: 18px 14px; }
  .pay-head { flex-wrap: wrap; }
  .pay-total { text-align: left; }
}
.pay-terms {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--accent-soft);
  font-size: 13px; line-height: 1.4; cursor: pointer;
}
.pay-terms input { flex: none; margin-top: 1px; }
/* Order bump: oferta opcional no pagamento avulso */
.pay-bump {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed rgba(61, 214, 140, .6); background: rgba(61, 214, 140, .08);
  font-size: 13px; line-height: 1.4; cursor: pointer;
}
.pay-bump[hidden] { display: none; }
.pay-bump input { flex: none; margin-top: 2px; accent-color: #3dd68c; }
.pay-bump b { color: #3dd68c; display: block; font-size: 14px; }
.pay-bump small { color: var(--muted); }
#payBrickWrap { transition: opacity 0.2s; }
#payBrickWrap.is-locked { opacity: 0.4; pointer-events: none; user-select: none; }
.ps-about { flex-basis: 100%; width: 100%; margin: 0 0 4px; color: var(--ink); opacity: 0.85; }
.ps-about strong { color: var(--accent); }
.pay-email { margin: 0 0 12px; }
.pay-email input {
  min-height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 15px;
}
.pay-email input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pay-email input.is-invalid { border-color: var(--danger); }
.pay-email small { color: var(--muted); font-size: 12px; }
.pay-choose { display: flex; flex-direction: column; gap: 10px; }
.pay-choose-title { margin: 0 0 2px; font-weight: 700; }
.pay-option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
.pay-option:hover, .pay-option:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.pay-option svg { width: 28px; height: 28px; flex: none; color: var(--accent); }
.pay-option span { display: flex; flex-direction: column; }
.pay-option small { color: var(--muted); font-size: 12px; }
#payCardArea #payBackBtn { margin-bottom: 8px; }
.footer-note { margin: 0 0 12px; }
.footer-support {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.footer-label { font-weight: 700; color: var(--ink); }
.footer-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-weight: 600;
}
.footer-link:hover, .footer-link:focus-visible { color: var(--accent); }
.footer-link svg { width: 18px; height: 18px; flex: none; }
/* Amostra da página inicial: imagem única da folha montada */
.mock-sheet-inner img.mock-full {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}
/* Folha de amostra com fundo escuro em xadrez (as artes brancas aparecem) */
.mock-sheet {
  background:
    linear-gradient(#1a1d28, #1a1d28) padding-box,
    linear-gradient(160deg, #22d3ee, #a855f7 42%, #f472b6) border-box;
}
.mock-sheet-inner {
  background-color: #1a1d28;
  background-image:
    linear-gradient(45deg, #262a38 25%, transparent 25%, transparent 75%, #262a38 75%),
    linear-gradient(45deg, #262a38 25%, transparent 25%, transparent 75%, #262a38 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}
.art-trim { display: block; margin: -2px 0 6px; color: var(--good); font-size: 12px; line-height: 1.35; }

/* Botão da tabela de tamanhos no Gerador */
.btn-sizes {
  position: relative;
  min-height: 50px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box,
    linear-gradient(90deg, #e879f9, #a78bfa 46%, #22d3ee) border-box;
  color: #fbbf24;
  font-weight: 800;
  box-shadow: 0 0 0 0 rgba(232, 121, 249, 0.45), 0 6px 18px rgba(168, 85, 247, 0.18);
  animation: sizesPulse 2.6s ease-out infinite;
}
.btn-sizes:hover {
  border-color: transparent;
  color: #fcd34d;
  background:
    linear-gradient(rgba(168, 85, 247, 0.22), rgba(168, 85, 247, 0.22)) padding-box,
    linear-gradient(90deg, #e879f9, #a78bfa 46%, #22d3ee) border-box;
}
.btn-sizes svg { color: #fb923c; }
@keyframes sizesPulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 121, 249, 0.45), 0 6px 18px rgba(168, 85, 247, 0.18); }
  70% { box-shadow: 0 0 0 8px rgba(232, 121, 249, 0), 0 6px 18px rgba(168, 85, 247, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(232, 121, 249, 0), 0 6px 18px rgba(168, 85, 247, 0.18); }
}
@media (prefers-reduced-motion: reduce) { .btn-sizes { animation: none; } }

/* Botão do editor de imagem no Gerador */
.btn-editor {
  min-height: 46px;
  border-color: rgba(34, 211, 238, 0.45);
  color: #fff;
  font-weight: 750;
}
.btn-editor:hover { border-color: #22d3ee; background: rgba(34, 211, 238, 0.1); color: #fff; }
.btn-editor svg { color: #67e8f9; }

/* Tamanho travado no card da arte (Gerador) */
.ps-props.is-locked input[readonly] {
  background: transparent;
  border-style: dashed;
  color: var(--ink);
  cursor: default;
  pointer-events: none;
  -moz-appearance: textfield;
}
.ps-props.is-locked input[readonly]::-webkit-outer-spin-button,
.ps-props.is-locked input[readonly]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ps-lock {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
}
.ps-lock svg { width: 16px; height: 16px; }
