:root {
  --bg: #fbf3e6;
  --ink: #2a1433;
  --muted: #6f5a6e;
  --card: #fffdf9;
  --line: #ecdcc8;
  --rosa: #e4007c;
  --naranja: #ff7a00;
  --morado: #2a1433;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Rubik", system-ui, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: #b0005f; }
a:hover { color: var(--rosa); }
button, .btn {
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, border-color .15s, transform .1s;
}
button:hover, .btn:hover { border-color: #d6bfa3; background: #fff8ee; color: inherit; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button.primary, .btn.primary { background: var(--rosa); border-color: var(--rosa); color: #fff; font-weight: 500; }
button.primary:hover, .btn.primary:hover { background: #c8006d; color: #fff; }
button.accent { background: var(--naranja); border-color: var(--naranja); color: #fff; font-weight: 500; }
button.accent:hover { background: #e86e00; }
.btn { padding: 10px 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { background: var(--morado); color: #fff; overflow: hidden; }
.bar { display: flex; align-items: center; gap: 18px; max-width: 1520px; margin: 0 auto; padding: 12px 16px 0; }
.logo { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-family: "Yeseva One", Georgia, serif; font-size: 20px; white-space: nowrap; }
.logo:hover { color: #fff; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #f6d3e6; text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.lang { color: #fff; font-size: 14px; border: 1px solid rgba(255,255,255,.35); padding: 4px 10px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.lang:hover { background: rgba(255,255,255,.12); color: #fff; }
.strip { display: block; width: 100%; height: auto; margin-top: 6px; }

/* Breadcrumbs */
.crumbs { max-width: 1100px; margin: 14px auto 0; padding: 0 16px; font-size: 14px; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #b9a48c; }
.crumbs a { color: var(--muted); }

/* Typography */
h1, h2 { font-family: "Yeseva One", Georgia, serif; font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(32px, 4.6vw, 50px); margin: 0 0 12px; }
.lead { font-size: 18px; color: #4b3550; }
.intro { text-align: center; max-width: 820px; margin: 0 auto; padding: 26px 16px 4px; }
.prose { max-width: 780px; margin: 0 auto; padding: 24px 16px 40px; }
.prose.wide { max-width: 1100px; }
.prose-inner { max-width: 780px; }
.prose h2 { font-size: 28px; margin: 38px 0 12px; }
.prose li { margin: 4px 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 52px; position: relative; margin: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 13px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--naranja); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ideas div { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--rosa); border-radius: 12px; padding: 12px 14px; }
.ideas div:nth-child(2) { border-top-color: var(--naranja); }
.ideas div:nth-child(3) { border-top-color: #13a854; }
.ideas div:nth-child(4) { border-top-color: #00a3c4; }
.ideas h3 { margin: 0 0 4px; font-size: 17px; }
.ideas p { margin: 0; color: var(--muted); font-size: 15px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 500; }
details p { margin: 8px 0 0; color: var(--muted); }
table.colors { border-collapse: collapse; width: 100%; }
table.colors td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.colors td:first-child { font-weight: 500; white-space: nowrap; width: 140px; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 8px; }

/* Template cards */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 16px 0; }
.tcard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 12px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(60, 30, 10, .1); color: var(--ink); }
.tcard img { display: block; width: 100%; height: auto; }
.tname { font-weight: 500; margin-top: 6px; }
.tmeta { font-size: 13px; color: var(--muted); }

/* Template page */
.tpl { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.tpl-hero { margin: 0; background: #f6ead8; border-radius: var(--radius); padding: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tpl h2 { font-size: 28px; margin: 36px 0 12px; }
.tpl-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.tpl-two figure { margin: 0; }
.tpl-two figure img { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* Maker layout */
.app {
  display: grid;
  grid-template-columns: 270px minmax(0, .85fr) minmax(0, 1.35fr);
  gap: 16px;
  padding: 18px 16px;
  max-width: 1520px;
  margin: 0 auto;
  align-items: start;
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: 21px; display: flex; align-items: center; gap: 9px; }
.num {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--rosa); color: #fff;
  font: 700 14px "Rubik", sans-serif;
}
.row { display: flex; gap: 6px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row button { padding: 6px 10px; font-size: 14px; }
.tools .group { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.tools .group:first-child { padding-top: 0; }
.tools .group:last-child { border-bottom: 0; padding-bottom: 0; }
.tools h3, .exports h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 500; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.presets button { font-size: 13.5px; padding: 6px 8px; }
.more { display: inline-block; margin-top: 8px; font-size: 14px; }
.seg { display: flex; background: #f4e8d8; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 4px; font-size: 13px; border-radius: 8px; white-space: nowrap; }
.seg button:hover { background: rgba(255,255,255,.6); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 14px; cursor: pointer; }
.check input { accent-color: #13a854; width: 16px; height: 16px; }
.shapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 8px; }
.shapes button { padding: 5px; aspect-ratio: 1; display: grid; place-items: center; }
.shapes svg { width: 100%; height: 100%; fill: var(--ink); }
.shapes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.shapes button[aria-pressed="true"] svg { fill: #fff; }
.slider { display: grid; grid-template-columns: 58px 1fr 36px; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.slider input { width: 100%; accent-color: var(--rosa); }
.slider output { text-align: right; font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.editor-wrap { border-radius: 10px; overflow: hidden; background: #1f4a35; }
#editor { display: block; width: 100%; height: clamp(360px, 64vh, 640px); touch-action: none; cursor: crosshair; user-select: none; }
#editor .ol { fill: transparent; stroke: rgba(255,255,255,.7); stroke-width: 1; stroke-dasharray: 3 2; pointer-events: none; }
#editor .ol.keep { stroke: #8ef0b0; }
#editor[data-tool="erase"] { cursor: pointer; }
#editor[data-tool="erase"] .ol { pointer-events: all; }
#editor[data-tool="erase"] .ol:hover { fill: rgba(255, 80, 80, .45); stroke: #ff6b6b; stroke-dasharray: none; }
#edDraft { pointer-events: none; }
#editor .ghost { fill: rgba(255,255,255,.28); stroke: #fff; stroke-width: 1.5; }
#editor .ghost.keep, #editor .draft.keep { fill: rgba(142,240,176,.35); stroke: #8ef0b0; }
#editor .draft { fill: rgba(255,255,255,.18); stroke: #fff; stroke-width: 1.5; }
#editor polyline.draft { fill: none; }
#editor .start { fill: none; stroke: #ffd23f; stroke-width: 1.5; }
#editor .fold { stroke: #ffd23f; stroke-width: 1.4; stroke-dasharray: 6 4; }
#editor .fold-label { fill: #ffd23f; font: 500 7px "Rubik", sans-serif; letter-spacing: 2px; text-anchor: middle; }
#editor .band-label { fill: rgba(0,0,0,.45); font: 500 7px "Rubik", sans-serif; letter-spacing: 1.5px; text-anchor: middle; text-transform: uppercase; }
.hint { margin: 10px 2px 0; color: var(--muted); font-size: 13.5px; min-height: 2.6em; }
#view { border-radius: 10px; overflow: hidden; background: #f6ead8; }
#view svg { display: block; width: 100%; height: auto; }
.tabs { min-width: 230px; }
.exports { margin-top: 14px; }
.exports h3 { display: flex; align-items: center; gap: 8px; }
.exports .num { width: 20px; height: 20px; font-size: 11px; }

/* Pet card */
.petcard { margin: 18px 0 8px; }
.petcard h2 { margin-top: 0 !important; }
.petcard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.petform label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.petform input[type=text], .petform input[type=file] { display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.petform fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.petform legend { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.petform .radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; color: var(--ink); }
.note { font-size: 13px; color: var(--muted); }
.pcview svg { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(40, 10, 40, .18); }

/* Footer */
.site-footer { background: #241029; color: #e9d6e6; margin-top: 30px; padding: 34px 16px 20px; }
.site-footer .cols { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.site-footer h2 { font: 500 13px "Rubik", sans-serif; text-transform: uppercase; letter-spacing: 1.2px; color: #fff; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 5px 0; font-size: 14px; }
.site-footer a { color: #e9d6e6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.flogo { font-family: "Yeseva One", Georgia, serif; font-size: 20px; color: #fff; margin: 0 0 6px; }
.site-footer p { font-size: 14px; }
.copy { max-width: 1100px; margin: 22px auto 0; font-size: 13px; color: #a88fa6; }

@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .lay-0 .tools { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 22px; }
  .tools .group, .tools .group:first-child, .tools .group:last-child { padding: 10px 0; border-bottom: 1px dashed var(--line); }
}
@media (max-width: 860px) {
  .tpl-grid, .tpl-two, .petcard-grid { grid-template-columns: minmax(0, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .bar { flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 12px 10px; }
  #editor { height: 62vh; }
  .tabs { min-width: 0; width: 100%; }
  .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#printArea { display: none; }
@media print {
  @page { size: letter; margin: 0; }
  body { background: #fff; }
  body > * { display: none !important; }
  #printArea { display: block !important; }
  #printArea img { display: block; width: 8.5in; height: 11in; object-fit: contain; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
main:has(> .prose:not(.wide)) > .crumbs { max-width: 780px; }

/* ---------- Maker: three steps, one at a time ---------- */
.app.lay-c { display: block; max-width: 1280px; }
.stepper { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 16px; }
.stepper button { display: flex; align-items: center; gap: 8px; padding: 8px 18px 8px 10px; border-radius: 999px; }
.stepper button[aria-current="step"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lay-c .step { display: none; }
.lay-c[data-step="1"] .s1, .lay-c[data-step="3"] .s3 { display: block; }
.lay-c[data-step="2"] .s2 { display: grid; grid-template-columns: 260px minmax(0, 1fr) 250px; gap: 16px; align-items: stretch; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; font-size: 14px; }
.thumb img { width: 100%; height: auto; display: block; }
.thumb.accent { justify-content: center; }
.thumb .q { font: 700 64px/1 "Yeseva One", Georgia, serif; }
.lay-c .opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.lay-c .opts .group, .lay-c .opts .group:first-child { border-bottom: 0; padding: 12px 0 0; }
.lay-c .next { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.lay-c .next .primary { margin-left: auto; padding: 10px 22px; }
.lay-c #editor { height: clamp(440px, 68vh, 680px); }
.lay-c .mini { display: flex; flex-direction: column; }
.lay-c .mini .next { margin-top: auto; }
#mini svg { display: block; width: 100%; height: auto; }
.show #view { display: grid; place-items: center; background: #f6ead8; border-radius: 10px; overflow: hidden; }
.s3-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.kit h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 500; }
.kit-steps { list-style: none; counter-reset: k; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.kit-steps li { counter-increment: k; display: grid; grid-template-columns: 24px 1fr; gap: 4px 8px; font-size: 14px; }
.kit-steps li::before { content: counter(k); grid-row: span 2; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--rosa); color: #fff; font: 700 12px "Rubik", sans-serif; }
.kit-steps button { justify-self: start; padding: 7px 12px; font-size: 14px; }
.kit .paper { margin-bottom: 16px; }
.kit .paper .seg { max-width: 200px; }
.kit .row button { padding: 6px 10px; font-size: 14px; }

@media (max-width: 1100px) {
  .lay-c[data-step="2"] .s2 { grid-template-columns: 240px minmax(0, 1fr); }
  .lay-c .mini { grid-column: 1 / -1; }
  .s3-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .lay-c .opts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .lay-c[data-step="2"] .s2 { grid-template-columns: minmax(0, 1fr); }
  .stepper button { padding: 6px 12px 6px 8px; font-size: 14px; }
}

/* Idea showcase (pet bone) */
.showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.showcase figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.showcase img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.showcase figcaption { padding: 10px 12px 12px; margin: 0; }
.showcase figcaption b { display: block; color: var(--ink); }
@media (max-width: 860px) { .showcase { grid-template-columns: minmax(0, 1fr); } }
