/* EasyWatermark
   Layout: estudio de edición — barra superior, inspector a la izquierda, mesa de luz a la derecha.
   Oscuro por defecto (grafito con matiz verde); versión clara para quien la prefiera. */
:root {
  --bg: #0f1316;
  --panel: #151b1f;
  --raised: #1d252a;
  --line: #273138;
  --line-strong: #35424a;
  --ink: #e7eef0;
  --muted: #8d9ca3;
  --faint: #5f6e75;
  --accent: #7fd6c2;
  --accent-ink: #062019;
  --accent-soft: #17332e;
  --stage: #0a0e10;
  --check-a: #11171a;
  --check-b: #0c1113;
  --ok: #8fd99a;
  --ok-soft: #173321;
  --bad: #f0907e;
  --bad-soft: #3a1d18;
  --shadow: 0 18px 50px rgb(0 0 0 / .45);
  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef2f2; --panel: #ffffff; --raised: #f3f6f6; --line: #dce3e4; --line-strong: #c7d1d3;
    --ink: #121a1d; --muted: #5b6a70; --faint: #8a979c;
    --accent: #0f7565; --accent-ink: #ffffff; --accent-soft: #dbefea;
    --stage: #e2e8e9; --check-a: #d9e0e1; --check-b: #e6ecec;
    --ok: #2b7a3c; --ok-soft: #e0f1e3; --bad: #b2412e; --bad-soft: #f8e3df;
    --shadow: 0 18px 50px rgb(20 40 40 / .18);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef2f2; --panel: #ffffff; --raised: #f3f6f6; --line: #dce3e4; --line-strong: #c7d1d3;
  --ink: #121a1d; --muted: #5b6a70; --faint: #8a979c;
  --accent: #0f7565; --accent-ink: #ffffff; --accent-soft: #dbefea;
  --stage: #e2e8e9; --check-a: #d9e0e1; --check-b: #e6ecec;
  --ok: #2b7a3c; --ok-soft: #e0f1e3; --bad: #b2412e; --bad-soft: #f8e3df;
  --shadow: 0 18px 50px rgb(20 40 40 / .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; flex: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; position: relative; overflow: hidden;
  background: var(--accent);
}
.brand-mark::before {
  content: ""; position: absolute; inset: -40%;
  background: repeating-linear-gradient(-30deg, transparent 0 5px, var(--accent-ink) 5px 7px);
  opacity: .45;
}
.brand-mark::after {
  content: "EW"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 12px/1 var(--font-display); color: var(--accent-ink); letter-spacing: .02em;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-inline: auto; }
.tabs button {
  display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-weight: 500;
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tabs button:hover { color: var(--ink); }
.local-pill { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); }
.local-pill svg { width: 14px; height: 14px; }

.workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 0; }
.workspace[data-tab="verify"] { grid-template-columns: minmax(0, 1fr); }
.workspace[data-tab="verify"] .inspector { display: none; }

/* ---------- Inspector ---------- */
.inspector { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; padding-left: env(safe-area-inset-left, 0px); }
.workspace[data-tab="images"] [data-scope="video"],
.workspace[data-tab="video"] [data-scope="images"] { display: none; }
.panel { border-bottom: 1px solid var(--line); }
.panel summary {
  list-style: none; cursor: pointer; padding: 14px 18px 10px;
  font: 600 11.5px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.panel summary::-webkit-details-marker { display: none; }
.panel summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.panel:not([open]) summary { padding-bottom: 14px; }
.panel:not([open]) summary::after { transform: rotate(-45deg); }
.panel-body { padding: 4px 18px 18px; display: grid; gap: 14px; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-weight: 500; font-size: 13px; }
.field .hint { font-size: 11.5px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
output { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type="text"], select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0;
}
input[type="text"]:hover, select:hover { border-color: var(--line-strong); }
input[type="text"]::placeholder { color: var(--faint); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--line-strong) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 3px solid var(--accent); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--accent); }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 6px 8px; border-radius: 6px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); background: transparent;
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.mine { padding-right: 4px; }
.chip .del { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); }
.chip .del:hover { background: var(--bad-soft); color: var(--bad); }
.chip .del svg { width: 12px; height: 12px; }
.save-style { display: flex; gap: 6px; }

.swatches { display: flex; gap: 8px; align-items: center; }
.swatches button, .sw-custom {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); padding: 0;
  background: var(--sw, transparent); position: relative;
}
.swatches [data-color="#ffffff"] { --sw: #ffffff; }
.swatches [data-color="#111111"] { --sw: #111111; }
.swatches [data-color="#d9b46a"] { --sw: #d9b46a; }
.swatches [data-color="#e2564b"] { --sw: #e2564b; }
.swatches button[aria-pressed="true"], .sw-custom.active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); border-color: transparent; }
.sw-custom { background: conic-gradient(#e2564b, #d9b46a, #7fd6c2, #5b7cf0, #c46bd6, #e2564b); cursor: pointer; overflow: hidden; }
.sw-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.corner-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 120px; aspect-ratio: 3 / 2; max-width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.corner-pick button { border: 1px dashed var(--line-strong); background: transparent; border-radius: 4px; }
.corner-pick button[aria-pressed="true"] { background: var(--accent); border: 0; }

.switch { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; cursor: pointer; }
.switch input { position: absolute; top: 0; left: 0; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; margin-top: 1px; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch b { font-weight: 600; font-size: 13px; display: block; }
.switch small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 2px; }
.sub { display: grid; gap: 12px; margin-left: 46px; padding: 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.key-row { display: flex; gap: 6px; align-items: center; }
.key-row code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; padding: 7px 10px; background: var(--raised); border-radius: 6px; color: var(--accent); user-select: all; overflow-wrap: anywhere; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 16px; height: 16px; }

.drop { position: relative; display: grid; place-items: center; gap: 2px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 18px 12px; cursor: pointer; color: var(--muted); font-size: 12.5px; transition: border-color .15s, background .15s; }
.drop strong { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input, .add-tile input, .empty input, .file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 9px 16px; border-radius: 9px; font-weight: 600; white-space: nowrap; position: relative;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn svg { width: 17px; height: 17px; }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }

/* ---------- Mesa de luz ---------- */
.view { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 0; min-width: 0; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px 18px; border-bottom: 1px solid var(--line);
}
.file-meta { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.badge { font: 600 10.5px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 7px; border-radius: 99px; margin-left: 8px; vertical-align: 2px; }
.tools { display: flex; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 500; }
.tool:hover { color: var(--ink); border-color: var(--line-strong); }
.tool[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tool svg { width: 16px; height: 16px; }
.tool:disabled { opacity: .4; cursor: not-allowed; }

.stage {
  position: relative; display: grid; place-items: center; padding: 28px; min-height: 320px; overflow: hidden;
  background-color: var(--stage);
  background-image: radial-gradient(var(--check-a) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.canvas-wrap { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
.canvas-wrap canvas { display: block; max-width: 100%; max-height: calc(100vh - 290px); min-height: 0; width: auto; height: auto; box-shadow: var(--shadow); border-radius: 3px; }
.split { position: absolute; inset: 0; cursor: ew-resize; touch-action: none; }
.split::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
.split-knob { position: absolute; top: 50%; left: var(--x, 50%); width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .35); }
.split-knob::before, .split-knob::after { content: ""; position: absolute; top: 12px; border: 5px solid transparent; }
.split-knob::before { left: 4px; border-right-color: #222; }
.split-knob::after { right: 4px; border-left-color: #222; }
.split-tag { position: absolute; top: 10px; font: 600 11px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; background: rgb(0 0 0 / .55); color: #fff; padding: 5px 8px; border-radius: 5px; }
.split-tag.left { left: 10px; }
.split-tag.right { right: 10px; }
.drop-hint { position: absolute; inset: 14px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--stage) 80%, transparent); color: var(--accent); font: 600 18px var(--font-display); opacity: 0; pointer-events: none; transition: opacity .15s; }
.stage.over .drop-hint { opacity: 1; }

.empty { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 420px; padding: 40px 28px; border: 1.5px dashed var(--line-strong); border-radius: 16px; cursor: pointer; color: var(--muted); position: relative; background: var(--panel); }
.empty svg { width: 40px; height: 40px; color: var(--accent); }
.empty strong { color: var(--ink); font: 600 17px/1.3 var(--font-display); }
.empty:hover, .stage.over .empty { border-color: var(--accent); }

.filmstrip { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel); min-width: 0; }
.strip { display: flex; gap: 8px; overflow-x: auto; min-width: 0; padding: 3px; }
.thumb { position: relative; flex: none; width: 88px; height: 62px; border-radius: 7px; overflow: hidden; border: 0; padding: 0; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .75; transition: opacity .15s; }
.thumb:hover img, .thumb[aria-current="true"] img { opacity: 1; }
.thumb[aria-current="true"] { box-shadow: 0 0 0 2px var(--accent); }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgb(0 0 0 / .65); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.thumb:hover .x, .thumb:focus-within .x, .thumb[aria-current="true"] .x { opacity: 1; }
.thumb .x svg { width: 11px; height: 11px; }
.add-tile { flex: none; width: 88px; height: 62px; border-radius: 7px; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 12px; cursor: pointer; position: relative; }
.add-tile:hover { border-color: var(--accent); color: var(--accent); }

.actionbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) 18px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.count { color: var(--muted); font-size: 13px; }
.file-btn { cursor: pointer; }
.view .empty strong { font-size: 17px; }

.scrub { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--panel); }
.scrub input { flex: 1; }

/* ---------- Verificar ---------- */
.verify { display: block; overflow-y: auto; padding-block: 36px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.verify-inner { max-width: 920px; margin: 0 auto; display: grid; gap: 26px; }
.verify-head h1 { font: 700 clamp(24px, 3.4vw, 34px)/1.15 var(--font-display); letter-spacing: -.015em; margin: 0 0 10px; text-wrap: balance; }
.verify-head p { color: var(--muted); max-width: 64ch; margin: 0; }
.verify-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.drop.tall { min-height: 320px; padding: 14px; background: var(--panel); }
.drop.tall img { max-height: 380px; max-width: 100%; width: auto; height: auto; border-radius: 6px; }
#verifyPrompt { display: grid; gap: 4px; }
.verify-side { display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.verify-side .btn { width: 100%; }
.result { border-radius: 9px; padding: 14px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 6px; }
.result b { font: 600 16px/1.3 var(--font-display); }
.result p { margin: 0; color: var(--muted); font-size: 13px; }
.result[data-state="found"] { background: var(--ok-soft); border-color: var(--ok); }
.result[data-state="found"] b { color: var(--ok); }
.result[data-state="missing"] { background: var(--bad-soft); border-color: var(--bad); }
.result[data-state="missing"] b { color: var(--bad); }
.meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 4px; }
.meter span { display: block; height: 100%; width: 0; background: var(--muted); transition: width .5s ease; }
.result[data-state="found"] .meter span { background: var(--ok); }
.result[data-state="missing"] .meter span { background: var(--bad); }

/* ---------- Modal y aviso ---------- */
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgb(5 8 10 / .6); backdrop-filter: blur(4px); z-index: 50; padding: 16px; }
.modal-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; padding: 22px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.modal-card b { font: 600 18px var(--font-display); }
.modal-card p { margin: 0; }
.modal-card .btn { justify-self: end; }
.bar { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 8px; transition: width .2s; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 9px; font-weight: 500;
  max-width: calc(100% - 32px); box-shadow: var(--shadow);
}

/* ---------- Escritorio: la app ocupa la ventana ---------- */
@media (min-width: 901px) {
  html, body { height: 100%; overflow: hidden; }
  .shell { height: 100%; min-height: 0; }
  .workspace { overflow: hidden; }
  .view { overflow: hidden; }
  .stage { container-type: size; }
  .canvas-wrap canvas { max-height: calc(100cqh - 56px); }
}

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .inspector { order: 2; border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .view { order: 1; }
  .local-pill span, .local-pill { font-size: 11px; }
  .tabs { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .tabs button { flex: 1; justify-content: center; padding: 7px 8px; }
  .stage { padding: 14px; min-height: 240px; }
  .canvas-wrap canvas { max-height: 60vh; }
  .verify-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar, .filmstrip, .actionbar, .scrub { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .tool span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Panel guiado por pasos ---------- */
.insp-head { display: grid; gap: 2px; padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.insp-head b { font: 600 15px/1.3 var(--font-display); }
.insp-head span { color: var(--muted); font-size: 12.5px; }
.step { border-bottom: 1px solid var(--line); }
.step > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px 18px; user-select: none;
}
.step > summary::-webkit-details-marker { display: none; }
.step > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
.step[open] > summary::after { transform: rotate(45deg) translateY(-2px); }
.step > summary:hover .step-t b { color: var(--accent); }
.step-n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12.5px/1 var(--font-display); color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.step[open] .step-n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step-t { display: grid; min-width: 0; }
.step-t b { font: 600 14.5px/1.3 var(--font-display); transition: color .15s; }
.step-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step[open] .step-t small { display: none; }
.step-body { display: grid; gap: 16px; padding: 0 18px 20px 56px; }

.group { display: grid; gap: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.group-label { font: 600 11px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Tarjetas de estilo con miniatura */
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset {
  position: relative; display: grid; gap: 0; padding: 0; border-radius: 9px; overflow: hidden; text-align: left;
  border: 1px solid var(--line-strong); background: var(--raised); transition: border-color .15s, box-shadow .15s;
}
.preset canvas { display: block; width: 100%; height: auto; aspect-ratio: 168 / 108; }
.preset-name { padding: 6px 9px 7px; font-size: 12px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.preset:hover { border-color: var(--accent); }
.preset[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.preset[aria-pressed="true"] .preset-name { color: var(--accent); }
.preset[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23062019' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.preset .del { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .6); color: #fff; opacity: 0; transition: opacity .15s; }
.preset:hover .del, .preset:focus-visible .del { opacity: 1; }
.preset .del svg { width: 12px; height: 12px; }
.link-btn.small { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; text-decoration: none; }
.link-btn.small svg { width: 14px; height: 14px; }
.link-btn.small:hover { text-decoration: underline; }
.save-style { display: flex; gap: 6px; align-items: center; }

/* Disposición con iconos */
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mode-grid button {
  display: grid; justify-items: center; gap: 2px; padding: 10px 4px 9px; border-radius: 9px; text-align: center;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
}
.mode-grid button b { font-size: 12.5px; font-weight: 600; }
.mode-grid button small { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.mode-grid button:hover { border-color: var(--accent); }
.mode-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mode-ico { width: 40px; height: 28px; border-radius: 4px; border: 1.5px solid var(--muted); position: relative; margin-bottom: 4px; overflow: hidden; }
.mode-ico.tile { background: repeating-linear-gradient(-30deg, transparent 0 4px, var(--muted) 4px 5.5px); }
.mode-ico.corner::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 13px; height: 4px; border-radius: 1px; background: var(--muted); }
.mode-ico.center::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 6px; border-radius: 1px; background: var(--muted); transform: translate(-50%, -50%) rotate(-18deg); }
.mode-grid button[aria-pressed="true"] .mode-ico { border-color: var(--accent); }
.mode-grid button[aria-pressed="true"] .mode-ico.tile { background: repeating-linear-gradient(-30deg, transparent 0 4px, var(--accent) 4px 5.5px); }
.mode-grid button[aria-pressed="true"] .mode-ico::after { background: var(--accent); }

.switch.compact small { font-size: 11.5px; }
.sub { margin-left: 0; }
@media (max-width: 900px) { .step-body { padding-left: 18px; } }
