:root {
  --naranja: #FF8001;
  --rojo: #E74E46;
  --coral: #EF6A53;
  --amarillo: #FEB421;
  --gris: #7B7B7B;

  --bg: #F4F2EF;
  --panel: #FFFFFF;
  --line: #E6E2DC;
  --line-strong: #D3CDC4;
  --text: #1E1E1E;
  --muted: #6E6A64;
  --stage: #E9E6E1;
  --accent: var(--naranja);
  --accent-ink: #C25F00;
  --accent-soft: #FFF1E2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 24px rgba(0,0,0,.06);
  --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
  --font-display: 'Exo 2', 'IBM Plex Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Topbar ---------- */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  background: #1E1E1E;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-size: 18px; }
.brand strong { font-weight: 800; }
.brand span { font-weight: 400; }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; }
.topbar nav a {
  color: #CFCAC3; text-decoration: none; padding: 8px 14px; border-radius: 8px; white-space: nowrap; font-weight: 500;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.active { color: #fff; background: rgba(255,128,1,.22); box-shadow: inset 0 -2px 0 var(--naranja); }

/* ---------- Controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--gris); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.btn.primary:hover { background: #EC7400; }
.btn.dark { background: #1E1E1E; border-color: #1E1E1E; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.danger { color: var(--rojo); }
.btn.danger:hover { border-color: var(--rojo); background: #FDEDEC; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn svg { width: 16px; height: 16px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.input, .select, textarea.input {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}
textarea.input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.input:focus, .select:focus, textarea.input:focus { outline: 2px solid rgba(255,128,1,.35); border-color: var(--naranja); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.row > .btn, .row > .flex-none { flex: none; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--naranja); }
.range-row output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.seg button svg { width: 16px; height: 16px; }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
  transition: transform .1s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.swatch-custom { position: relative; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.swatch-custom input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px;
}
.chip.on { background: #1E1E1E; border-color: #1E1E1E; color: #fff; }

.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; line-height: 1.5; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0 0 12px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1E1E1E; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; border-left: 4px solid var(--naranja); }
.toast.error { border-left-color: var(--rojo); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ================= EDITOR ================= */
.page-editor { overflow: hidden; }
.editor {
  height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 64px 300px 1fr 290px;
  grid-template-rows: 56px 1fr;
  grid-template-areas: "rail side toolbar props" "rail side stage props";
}
.rail { grid-area: rail; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 8px 6px; gap: 2px; }
.rail button {
  border: 0; background: transparent; border-radius: 8px; padding: 8px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted);
}
.rail button svg { width: 22px; height: 22px; }
.rail button:hover { background: var(--bg); color: var(--text); }
.rail button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.side { grid-area: side; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 16px; }
.side h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.side .panel { display: none; }
.side .panel.on { display: block; }

.toolbar {
  grid-area: toolbar; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 0;
}
.toolbar .name-input { max-width: 220px; font-weight: 600; border-color: transparent; }
.toolbar .name-input:hover { border-color: var(--line-strong); }
.toolbar .spacer { flex: 1; }
.toolbar .select { width: auto; }
.toolbar .zoom { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; width: 42px; text-align: center; }

.stage { grid-area: stage; background: var(--stage); overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.stage .canvas-wrap { box-shadow: 0 10px 40px rgba(0,0,0,.18); background: #fff; line-height: 0; }
.stage .dims { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: rgba(255,255,255,.8); padding: 3px 10px; border-radius: 99px; }

.props { grid-area: props; background: #fff; border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; }
.props h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.props .tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.props .tools .btn { width: 100%; padding: 0; }

/* Paneles laterales */
.tpl-grid, .media-grid-sm, .logo-grid-sm, .shape-grid, .design-grid { display: grid; gap: 8px; }
.tpl-grid { grid-template-columns: 1fr 1fr; }
.tpl {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; padding: 0; text-align: left;
  transition: border-color .15s, transform .15s;
}
.tpl:hover { border-color: var(--naranja); transform: translateY(-1px); }
.tpl .prev { aspect-ratio: 1; display: block; width: 100%; }
.tpl span { display: block; padding: 6px 8px; font-size: 12px; font-weight: 600; }

.text-presets { display: flex; flex-direction: column; gap: 8px; }
.text-presets button {
  text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; cursor: pointer;
}
.text-presets button:hover { border-color: var(--naranja); }

.shape-grid { grid-template-columns: repeat(4, 1fr); }
.shape-grid button {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; padding: 8px;
}
.shape-grid button:hover { border-color: var(--naranja); background: var(--accent-soft); }
.shape-grid svg { width: 100%; height: 100%; }

.media-grid-sm { grid-template-columns: 1fr 1fr; }
.media-grid-sm .m {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid var(--line);
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px;
}
.media-grid-sm .m img { width: 100%; height: 100%; object-fit: contain; }
.media-grid-sm .m.dark { background: #333; }
.media-grid-sm .m:hover { border-color: var(--naranja); }
.media-grid-sm .m .bgbtn {
  position: absolute; right: 4px; bottom: 4px; font-size: 11px; padding: 3px 7px; border-radius: 6px; border: 0;
  background: rgba(0,0,0,.7); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.media-grid-sm .m:hover .bgbtn { opacity: 1; }

.logo-grid-sm { grid-template-columns: 1fr; }
.logo-card-sm { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.logo-card-sm img { height: 54px; width: 100%; object-fit: contain; margin-bottom: 8px; }
.logo-card-sm .name { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.logo-card-sm .chips .chip { font-size: 11px; padding: 3px 8px; }

.design-grid { grid-template-columns: 1fr 1fr; }
.design { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; background: #fff; }
.design:hover { border-color: var(--naranja); }
.design img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--stage); }
.design .meta { padding: 6px 8px; }
.design .meta b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design .meta small { color: var(--muted); font-size: 11px; }
.design .del { position: absolute; top: 4px; right: 4px; opacity: 0; }
.design:hover .del { opacity: 1; }

.grad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grad-grid button { height: 40px; border-radius: 8px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }

/* ================= MEDIOS ================= */
.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: 14px; background: #fff; padding: 26px; text-align: center; margin-bottom: 20px;
  transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--naranja); background: var(--accent-soft); }
.dropzone strong { font-family: var(--font-display); font-size: 17px; display: block; margin-bottom: 4px; }
.dropzone p { margin: 0 0 14px; color: var(--muted); }
.dropzone .row { justify-content: center; max-width: 420px; margin: 0 auto; }

.filters { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filters .input { max-width: 260px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.media-card .thumb {
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; padding: 10px;
  background: repeating-conic-gradient(#efefef 0 25%, #fff 0 50%) 0 0/18px 18px;
}
.media-card .thumb.dark { background: #2B2B2B; }
.media-card .thumb img { max-height: 100%; object-fit: contain; }
.media-card .info { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.media-card .info input { border: 1px solid transparent; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; font-weight: 600; background: transparent; width: calc(100% + 8px); }
.media-card .info input:hover, .media-card .info input:focus { border-color: var(--line-strong); outline: none; }
.media-card .info small { color: var(--muted); }
.media-card .actions { display: flex; gap: 6px; align-items: center; }
.media-card .actions .select { height: 30px; font-size: 12px; flex: 1; }

/* ================= LOGOS ================= */
.logo-app { display: grid; grid-template-columns: 300px 1fr 320px; gap: 16px; padding: 16px; max-width: 1600px; margin: 0 auto; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card + .card { margin-top: 16px; }

.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-grid button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; cursor: pointer; font-size: 11px; }
.preset-grid button:hover { border-color: var(--naranja); }
.preset-grid svg { width: 100%; aspect-ratio: 1; display: block; }

.layers { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.layer {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
}
.layer:hover { background: var(--bg); }
.layer.on { border-color: var(--naranja); background: var(--accent-soft); }
.layer svg { width: 26px; height: 26px; flex: none; }
.layer span { flex: 1; font-size: 13px; }

.icon-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.icon-box-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.icon-box {
  width: 340px; max-width: 100%; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); touch-action: none;
  background-color: #fff;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 10% 10%;
}
.icon-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.icon-box [data-i] { cursor: move; }
.icon-box .sel-outline { fill: none; stroke: var(--naranja); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; vector-effect: non-scaling-stroke; }
.layer-props { flex: 1; min-width: 240px; }

.preview-area { border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.preview-area .bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.preview-stage { padding: 40px 30px; display: flex; align-items: center; justify-content: center; min-height: 260px; transition: background .2s; }
.preview-stage svg { max-width: 100%; max-height: 320px; height: auto; }
.preview-stage.light { background: #fff; }
.preview-stage.dark { background: #2B2B2B; }
.preview-stage.orange { background: linear-gradient(135deg, #FF8001, #E74E46); }
.preview-stage.checker { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/20px 20px; }

.variants { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.variant { border-radius: 10px; padding: 14px; display: flex; align-items: center; justify-content: center; height: 90px; border: 1px solid var(--line); }
.variant svg { max-width: 100%; max-height: 100%; }

.logo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.logo-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.logo-item .lp { height: 110px; display: flex; align-items: center; justify-content: center; padding: 14px; cursor: pointer; }
.logo-item .lp img { max-height: 100%; object-fit: contain; }
.logo-item .lf { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--line); gap: 6px; }
.logo-item .lf b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .editor { grid-template-columns: 64px 260px 1fr 250px; }
  .logo-app { grid-template-columns: 280px 1fr; }
  .logo-app > .col-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .logo-app > .col-right .card + .card { margin-top: 0; }
}
@media (max-width: 900px) {
  .page-editor { overflow: auto; }
  .editor {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 70vh auto;
    grid-template-areas: "toolbar" "rail" "side" "stage" "props";
  }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail button { min-width: 64px; }
  .toolbar { flex-wrap: wrap; padding: 8px 12px; height: auto; }
  .side { max-height: 50vh; border-right: 0; }
  .logo-app { grid-template-columns: 1fr; }
  .logo-app > .col-right { display: block; }
  .logo-app > .col-right .card + .card { margin-top: 16px; }
  .topbar { gap: 12px; padding: 0 12px; }
  .brand span { display: none; }
}

/* Barra del editor compacta */
.toolbar { gap: 6px; }
.toolbar .name-input { max-width: 170px; min-width: 90px; }
.toolbar .select { max-width: 200px; min-width: 0; }
@media (max-width: 1640px) {
  .toolbar .btn .lbl { display: none; }
  .toolbar #newBtn, .toolbar #saveBtn { padding: 0 10px; }
}

/* ================= GENERADOR ================= */
.page-generar { overflow: hidden; }
.gen {
  height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 300px 1fr 360px;
}
.gen h2 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.gen-list { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.gen-list-head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.gen-list-head h2 { margin: 0; }
.gen-list-head .chip { font-size: 12px; padding: 4px 10px; }
.gen-tpls { overflow-y: auto; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.gen-tpl {
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0; cursor: pointer; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s;
}
.gen-tpl:hover { border-color: var(--naranja); }
.gen-tpl.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }
.gen-tpl .th { display: block; position: relative; width: 100%; padding-top: 125%; background: var(--stage); overflow: hidden; }
.gen-tpl .th img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.gen-tpl .tx { display: block; }
.gen-tpl .tx { padding: 7px 9px; }
.gen-tpl b { display: block; font-size: 12px; line-height: 1.25; }
.gen-tpl small { color: var(--muted); font-size: 11px; }

.gen-preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gen-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gen-bar .label { margin-bottom: 4px; }
.gen-bar .seg button { height: 32px; font-size: 13px; }
.gen-stage { flex: 1; background: var(--stage); display: flex; align-items: center; justify-content: center; position: relative; min-height: 0; overflow: hidden; }
.gen-stage canvas { box-shadow: 0 10px 40px rgba(0,0,0,.18); background: #fff; }
.gen-empty { position: absolute; color: var(--muted); }

.gen-form { background: #fff; border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; }
.gen-form .field > label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.gen-logo-prev { height: 54px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f0f0f0 0 25%, #fff 0 50%) 0 0/14px 14px; border-radius: 8px; border: 1px solid var(--line); padding: 6px; }
.gen-logo-prev img { max-height: 100%; object-fit: contain; }
.gen-logo-prev:empty { display: none; }
.gen-logo .chip { font-size: 12px; padding: 4px 10px; }

@media (max-width: 1200px) {
  .gen { grid-template-columns: 260px 1fr 320px; }
  .gen-tpls { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .page-generar { overflow: auto; }
  .gen { height: auto; grid-template-columns: 1fr; }
  .gen-list { max-height: 46vh; border-right: 0; }
  .gen-tpls { grid-template-columns: repeat(3, 1fr); }
  .gen-stage { height: 70vh; flex: none; }
  .gen-form { border-left: 0; }
}

/* ---------- Logos: listado completo ---------- */
.logo-group-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 10px; grid-column: 1 / -1; }
.logo-item .badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); background: var(--accent-soft); border-radius: 99px; padding: 2px 7px; }
.logo-item .lf input { border: 1px solid transparent; border-radius: 6px; padding: 2px 4px; font-weight: 600; font-size: 13px; min-width: 0; flex: 1; background: transparent; }
.logo-item .lf input:hover, .logo-item .lf input:focus { border-color: var(--line-strong); outline: none; }
.logo-item .vars { display: flex; gap: 4px; padding: 0 10px 10px; flex-wrap: wrap; }
.logo-item .vars a { font-size: 11px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.logo-item .vars a:hover { color: var(--text); border-color: var(--gris); }
.manual-cta { background: linear-gradient(135deg, #FF8001, #E74E46); color: #fff; border: 0; }
.manual-cta h3 { color: #fff; }
.manual-cta p { margin: 0 0 12px; opacity: .92; font-size: 13px; line-height: 1.45; }
.manual-cta .btn { background: #fff; color: #1E1E1E; border-color: #fff; }

/* Campos del generador en el editor */
.field-box { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.field-box.on { border-style: solid; border-color: var(--naranja); background: var(--accent-soft); }
.field-box .field { margin: 10px 0 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--naranja); width: 16px; height: 16px; }

/* ---------- Generador: modelos ---------- */
.gen-model-row { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 10px; }
.gen-model-row .label { margin-bottom: 6px; }
.gen-models { display: flex; gap: 8px; overflow-x: auto; }
.gen-models button {
  flex: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 86px;
}
.gen-models button:hover { border-color: var(--naranja); }
.gen-models button.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }
.gen-models img { width: 76px; height: 64px; object-fit: contain; background: var(--stage); border-radius: 4px; }
.gen-models span { font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; }

/* ---------- Campos del formulario ---------- */
.field > label .ff-count { float: right; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; }
.ff-count.near { color: #C25F00; }
.ff-count.full { color: var(--rojo); font-weight: 700; }
.ff-logo-prev { height: 54px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f0f0f0 0 25%, #fff 0 50%) 0 0/14px 14px; border-radius: 8px; border: 1px solid var(--line); padding: 6px; }
.ff-logo-prev img { max-height: 100%; object-fit: contain; }
.ff-logo .chip, .ff-pattern .chip { font-size: 12px; padding: 4px 10px; }
.ff-img-prev { height: 120px; border-radius: 8px; overflow: hidden; background: #DCD6CE; display: flex; align-items: center; justify-content: center; border: 1px dashed #ADA59B; }
.ff-img-prev img { width: 100%; height: 100%; object-fit: cover; }
.ff-img-prev span { font-family: var(--font-display); font-weight: 800; font-size: 12px; letter-spacing: .1em; color: #7E766D; }
.ff-lib { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.ff-lib button { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #eee; }
.ff-lib button:hover { border-color: var(--naranja); }
.ff-lib img { width: 100%; height: 100%; object-fit: cover; }
.ff-pat-current { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 6px; cursor: pointer; text-align: left; font-weight: 600; font-size: 13px; }
.ff-pat-current img, .ff-pat-current .none { width: 40px; height: 40px; border-radius: 6px; flex: none; border: 1px solid var(--line); }
.none { display: inline-block; background: linear-gradient(135deg, transparent 46%, var(--rojo) 46%, var(--rojo) 54%, transparent 54%), #fff; }
.ff-pat-panel { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.ff-pat-panel .chip { font-size: 11px; padding: 3px 8px; }
.ff-pat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; max-height: 260px; overflow-y: auto; }
.ff-pat-grid button { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; }
.ff-pat-grid button:hover { border-color: var(--naranja); }
.ff-pat-grid img, .ff-pat-grid .none { width: 100%; height: 100%; display: block; }
.range-row small { color: var(--muted); font-size: 12px; }

/* ================= CARRUSEL ================= */
.car { grid-template-columns: 320px 1fr 360px; }
.car-settings { border-left: 0; border-right: 1px solid var(--line); }
.car-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.car-themes button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.car-themes button span { width: 100%; height: 26px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.car-themes button.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }
.car-stage { overflow-x: auto; }
.car-strip { display: flex; gap: 6px; align-items: center; padding: 20px; margin: auto; }
.car-slide { position: relative; border: 0; padding: 0; background: none; cursor: pointer; line-height: 0; border-radius: 4px; transition: transform .15s; }
.car-slide canvas { box-shadow: 0 6px 24px rgba(0,0,0,.18); background: #fff; }
.car-slide.on { outline: 3px solid var(--naranja); outline-offset: 3px; }
.car-slide span { position: absolute; top: -10px; left: -10px; width: 24px; height: 24px; border-radius: 50%; background: #1E1E1E; color: #fff; font: 700 12px/24px var(--font-ui); text-align: center; }
.car-slide.on span { background: var(--naranja); }
@media (max-width: 1200px) { .car { grid-template-columns: 280px 1fr 300px; } }
@media (max-width: 900px) { .car { grid-template-columns: 1fr; } .car-stage { height: 60vh; flex: none; } }
.gen-tpls { grid-auto-rows: max-content; }
.gen-tpl { min-height: max-content; }
.pat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-height: 300px; overflow-y: auto; }
.pat-grid button { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; }
.pat-grid button:hover { border-color: var(--naranja); }
.pat-grid img { width: 100%; height: 100%; display: block; }
.pat-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; }
.pat-gallery button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.pat-gallery button:hover { border-color: var(--naranja); }
.pat-gallery img { width: 100%; aspect-ratio: 1; border-radius: 5px; }
.pat-gallery span { font-size: 10.5px; line-height: 1.2; color: var(--muted); text-align: left; }
.modal { border: 0; border-radius: 14px; padding: 22px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(20,20,20,.45); }
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.modal .check { margin-bottom: 12px; }
.car-designs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.car-designs button { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; min-width: 0; }
.car-designs button img { width: 100%; aspect-ratio: 4/5; object-fit: contain; background: var(--stage); border-radius: 4px; }
.car-designs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-designs button.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }

/* ================= ARMADO FÁCIL ================= */
.wiz { max-width: 1400px; margin: 0 auto; padding: 18px 20px 40px; }
.wiz-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 6px; overflow-x: auto; }
.wiz-steps li {
  flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.wiz-steps li span { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); font-size: 12px; flex: none; }
.wiz-steps li.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }
.wiz-steps li.on span { background: var(--naranja); color: #fff; }
.wiz-steps li.done span { background: #1E1E1E; color: #fff; }
.wiz-steps li.na { opacity: .45; cursor: default; }
.wiz-steps li small { font-weight: 400; color: var(--muted); }
.wiz-body { display: grid; grid-template-columns: 1fr 440px; gap: 20px; align-items: start; }
.wiz-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-height: 60vh; display: flex; flex-direction: column; }
.wiz-head h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.wiz-head .hint { margin-bottom: 16px; font-size: 13px; }
#stepContent { flex: 1; }
.wiz-nav { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.wiz-nav .btn { height: 42px; padding: 0 22px; font-size: 15px; }
.wiz-nav .btn[hidden] { display: none; }
.wiz-preview { position: sticky; top: 72px; }
.wiz-stage { height: calc(100vh - 170px); min-height: 420px; background: var(--stage); border-radius: 14px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.wiz-stage canvas { box-shadow: 0 10px 30px rgba(0,0,0,.18); background: #fff; }
.wiz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.wiz-cards.models { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 6px; }
.wiz-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s; }
.wiz-card:hover { border-color: var(--naranja); transform: translateY(-2px); }
.wiz-card.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }
.wiz-card .th { display: block; position: relative; padding-top: 125%; background: var(--stage); border-radius: 8px; overflow: hidden; }
.wiz-card .th img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.wiz-card b { font-size: 13px; line-height: 1.25; }
.wiz-card small { color: var(--muted); font-size: 11.5px; }
.wiz-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.wiz-logo { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.wiz-logo img { height: 50px; width: 100%; object-fit: contain; }
.wiz-logo small { font-size: 11.5px; color: var(--muted); text-align: left; line-height: 1.25; }
.wiz-logo:hover { border-color: var(--naranja); }
.wiz-logo.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); }
.wiz-logo[hidden] { display: none; }
.wiz-final p { font-size: 15px; margin: 0 0 16px; }
.wiz-final .btn { height: 46px; font-size: 15px; }
@media (max-width: 1100px) { .wiz-body { grid-template-columns: 1fr; } .wiz-preview { position: static; } .wiz-stage { height: 60vh; } }
.wiz-card { align-items: stretch; }
.wiz-card .th { width: 100%; }

/* Selector de ícono */
.ff-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.ff-icon-grid button { aspect-ratio: 1; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.ff-icon-grid button:hover { border-color: var(--naranja); }
.ff-icon-grid button.on { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja); background: var(--accent-soft); }
.ff-icon-grid img { width: 100%; height: 100%; display: block; }
