/* WOLF Imagen Kit · estilos del panel de imagen y del editor de dibujo (identidad WOLF / Creator 3D 6.0).
   El panel usa la clase .wik en su contenedor; el editor es <dialog class="painter">.
   Cambia las variables para adaptar los colores a otra herramienta. */
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-var.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/plexmono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
.wik, dialog.painter {
  --ink: #183443; --ink-2: #21485a; --red: #c41e33; --red-dark: #9e1628; --red-tint: #fbe8ea;
  --paper: #f1f0ec; --paper-2: #e7e5de; --line: #d9d6cc; --line-soft: #e6e3db; --white: #fff;
  --muted: #5d6a70; --soft: #86918f;
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif; --mono: 'Plex Mono', ui-monospace, Menlo, monospace;
  font-family: var(--sans); color: var(--ink);
}
.wik *, dialog.painter * { box-sizing: border-box; }
.wik button, dialog.painter button, .wik label.btn { cursor: pointer; font-family: inherit; }
.wik [hidden], dialog.painter [hidden] { display: none !important; }
.wik .wik-crop { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: repeating-conic-gradient(#e8e6df 0 25%, #fff 0 50%) 0 0/16px 16px; touch-action: none; cursor: crosshair; display: block; margin-top: 8px; }
.wik .wik-note { margin: -6px 0 14px; }
/* Controles (panel y pie del editor) */
.wik .link, dialog.painter .link { border: 0; background: none; color: var(--red); font-weight: 600; font-size: 12.5px; padding: 6px 0; white-space: nowrap; }
.wik .link:hover, dialog.painter .link:hover { color: var(--red-dark); text-decoration: underline; }
.wik .field, dialog.painter .field { margin-bottom: 16px; }
.wik .field > .label, dialog.painter .field > .label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.wik .hint, dialog.painter .hint { margin: 6px 0 0; font-size: 11.5px; color: var(--soft); }
.wik .range, dialog.painter .range { display: grid; grid-template-columns: 1fr 76px; gap: 10px; align-items: center; }
.wik .range input[type=range], dialog.painter .range input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; margin: 0; }
.wik .range input[type=range]::-webkit-slider-runnable-track, dialog.painter .range input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--red) var(--p, 50%), var(--paper-2) var(--p, 50%)); }
.wik .range input[type=range]::-moz-range-track, dialog.painter .range input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--paper-2); }
.wik .range input[type=range]::-moz-range-progress, dialog.painter .range input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--red); }
.wik .range input[type=range]::-webkit-slider-thumb, dialog.painter .range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--red); box-shadow: 0 1px 3px #0003; }
.wik .range input[type=range]::-moz-range-thumb, dialog.painter .range input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--red); }
.wik .num, dialog.painter .num { position: relative; }
.wik .num input, dialog.painter .num input { width: 100%; min-height: 34px; padding: 4px 26px 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; font-family: var(--mono); font-size: 12.5px; text-align: right; -moz-appearance: textfield; }
.wik .num input::-webkit-inner-spin-button, dialog.painter .num input::-webkit-inner-spin-button { -webkit-appearance: none; }
.wik .num span, dialog.painter .num span { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--soft); pointer-events: none; font-family: var(--mono); }
.wik .num input:invalid, dialog.painter .num input:invalid { border-color: var(--red); color: var(--red); }
.wik .chips, dialog.painter .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wik .chips button, dialog.painter .chips button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.wik .chips button:hover, dialog.painter .chips button:hover { border-color: #9aa7ac; }
.wik .chips button[aria-pressed=true], dialog.painter .chips button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.wik .dropzone, dialog.painter .dropzone { display: grid; gap: 8px; padding: 16px; border: 1.5px dashed #b9b5aa; border-radius: 14px; background: #fbfaf7; text-align: center; }
.wik .dropzone.over, dialog.painter .dropzone.over { border-color: var(--red); background: var(--red-tint); }
.wik .dropzone p, dialog.painter .dropzone p { margin: 0; font-size: 12px; color: var(--muted); }
.wik .dropzone .file, dialog.painter .dropzone .file { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; font-size: 13px; }
.wik .btn, dialog.painter .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.wik .btn:hover, dialog.painter .btn:hover { border-color: #9aa7ac; }
.wik .btn.primary, dialog.painter .btn.primary, .wik .primary, dialog.painter .primary { background: var(--red); border-color: var(--red); color: #fff; }
.wik .btn.primary:hover, dialog.painter .btn.primary:hover, .wik .primary:hover:not(:disabled), dialog.painter .primary:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.wik .row, dialog.painter .row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wik .crop-bar, dialog.painter .crop-bar { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 14px; font-size: 12px; color: var(--muted); }
.wik .edit-drawing, dialog.painter .edit-drawing { width: 100%; margin: 4px 0 14px; }
.wik .zones, dialog.painter .zones { margin: 6px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; }
.wik .zones h4, dialog.painter .zones h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.wik .chips button.multi-chip, dialog.painter .chips button.multi-chip { border: 1.5px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #e8467c, #f7d154, #3cc3bd) border-box; }
.wik .chips button.multi-chip[aria-pressed=true], dialog.painter .chips button.multi-chip[aria-pressed=true] { background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(90deg, #e8467c, #f7d154, #3cc3bd) border-box; }
.wik .zones .row, dialog.painter .zones .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.wik .btn.multi-btn, dialog.painter .btn.multi-btn { border: 1.5px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #e8467c, #f7d154, #3cc3bd) border-box; font-weight: 700; }

/* Editor de dibujo */
.painter { width: min(1180px, 96vw); height: min(860px, 94dvh); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px; color: var(--ink); display: none; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px #0f222c88; }
.painter[open] { display: flex; }
.painter::backdrop { background: #10232dcc; backdrop-filter: blur(3px); }
.pt-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 20px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.pt-head h2 { margin: 0; font-size: 18px; font-weight: 800; font-stretch: 118%; }
.pt-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.pt-tools button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid #ffffff33; background: #ffffff12; color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pt-tools button[aria-pressed=true] { background: #fff; color: var(--ink); }
.pt-tools button:disabled { opacity: .4; cursor: default; }
.pt-tools button i { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 1.5px #00000066, 0 0 0 3px #ffffffaa; }
.pt-size { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; margin-left: 6px; }
.pt-size input { width: 130px; accent-color: var(--red); }
.pt-size output { font-family: var(--mono); font-size: 11.5px; min-width: 44px; }
.pt-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.pt-check input { width: 16px; height: 16px; accent-color: var(--red); }
.pt-sep { flex: 1; }
.pt-head .close { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #ffffff1c; color: #fff; font-size: 22px; cursor: pointer; }
.pt-stage { position: relative; flex: 1; overflow: auto; display: flex; padding: 12px; scrollbar-gutter: stable; background: repeating-conic-gradient(#e8e6df 0 25%, #f6f5f1 0 50%) 0 0/18px 18px; }
.pt-view { display: block; margin: auto; flex: none; image-rendering: auto; touch-action: none; cursor: none; box-shadow: 0 6px 24px #18344333; }
.pt-cursor { position: fixed; z-index: 10; pointer-events: none; border-radius: 50%; border: 2px solid #c41e33; box-shadow: 0 0 0 1px #fff, inset 0 0 0 1px #fff; transform: translate(-50%, -50%); }
.pt-cursor.soft::after { content: ''; position: absolute; left: 50%; top: 50%; width: var(--core); height: var(--core); transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px dashed #c41e33; }
.pt-badge { position: fixed; z-index: 11; left: 50%; bottom: 90px; transform: translateX(-50%); padding: 7px 12px; border-radius: 999px; background: #183443; color: #fff; font: 600 12.5px var(--sans); box-shadow: 0 6px 18px #0005; pointer-events: none; }
.pt-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fff; }
.pt-foot p { margin: 0; flex: 1; font-size: 12px; color: var(--muted); }
.pt-layers { display: inline-flex; padding: 3px; border-radius: 10px; background: #ffffff1a; }
.pt-layers button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: 700 12.5px var(--sans); cursor: pointer; }
.pt-layers [aria-selected=true] { background: #fff; color: var(--ink); }
.pt-colorbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; background: #f6f5f1; border-bottom: 1px solid var(--line); }
.pt-colorbar[hidden] { display: none; }
.pt-ctools { display: inline-flex; gap: 4px; }
.pt-ctools button, .pt-mini { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 600 12px var(--sans); cursor: pointer; }
.pt-ctools [aria-pressed=true] { border-color: var(--ink); background: var(--ink); color: #fff; }
.pt-swatches { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pt-swatch { position: relative; width: 34px; height: 34px; border-radius: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.pt-swatch[aria-pressed=true] { box-shadow: 0 0 0 2.5px var(--red); }
.pt-swatch .edit { position: absolute; right: -6px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 10px; line-height: 16px; text-align: center; color: var(--ink); }
.pt-mini-label { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--sans); }
.pt-mini-label select { min-height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; font: 12px var(--sans); }
.painter.color-layer .pt-shape-only { display: none; }

.wik button.wik-new-mask{font:600 11px inherit;display:block;border:1px solid #d88a9c;background:#be254912;color:inherit;padding:7px 10px;border-radius:20px;margin:-4px 0 18px;cursor:pointer}
.wik .wik-crop{background:repeating-conic-gradient(#b7b7b718 0 25%,#ffffff08 0 50%) 0 0/14px 14px}
.cw-vhelp{font-size:11px;line-height:1.5;margin:6px 0 10px;color:inherit;border:1px solid #82939c40;border-radius:9px;overflow:hidden}
.cw-vhelp summary{display:flex;align-items:center;gap:5px;cursor:pointer;list-style:none;padding:5px 8px;min-height:32px;background:#82939c0b}
.cw-vhelp summary::-webkit-details-marker{display:none}.cw-vhelp summary>svg{width:34px;height:23px;flex:none}
.cw-help-arrow{opacity:.65}.cw-help-label{margin-left:auto;font-size:10px;white-space:nowrap}.cw-help-label b{font-size:13px;margin-left:3px}
.cw-help-body{padding:8px 10px;border-top:1px solid #82939c40}.cw-help-figures{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cw-help-figures figure{margin:0;text-align:center}.cw-help-figures svg{width:76px;height:49px;max-width:100%}.cw-help-figures figcaption{font-size:10px}
.cw-help-body p{margin:9px 0 2px!important;color:inherit!important;font-size:11px!important;line-height:1.5!important}
.cw-vhelp summary:focus-visible{outline:2px solid #dfb77d;outline-offset:-2px}

.pt-bgbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:10px 18px;background:#eef3f3;border-bottom:1px solid #c8d6d8;color:#183443;font-size:12px;flex:none}
.pt-bgbar label{display:flex;align-items:center;gap:6px}.pt-bgbar input[type=range]{width:160px;accent-color:#c41e33}.pt-bgbar output{min-width:20px;font-variant-numeric:tabular-nums}.pt-bgbar button{border:1px solid #aabec3;background:#fff;color:#183443;border-radius:8px;padding:9px;cursor:pointer}.pt-bgbar span{font-size:11px;color:#4b636d}
#pt-bg-toggle small{background:#dfb77d;color:#182e38;padding:2px 5px;border-radius:5px;font-size:9px;margin-left:4px}
#pt-bg-toggle[aria-expanded=true]{background:#fff;color:#183443}
dialog.pt-classic .pt-head{flex-shrink:0}dialog.pt-classic .pt-stage{min-height:120px}dialog.pt-classic .pt-foot{flex-shrink:0}
@media(max-width:680px){.pt-bgbar{padding:8px;gap:8px;max-height:30dvh;overflow:auto}.pt-bgbar input[type=range]{width:130px}.pt-classic .pt-tools{gap:5px}.pt-classic .pt-head{padding:10px}.pt-classic .pt-foot{padding:9px;flex-wrap:wrap}.pt-classic .pt-foot p{flex-basis:100%}}

/* Readable middle-ground editor: original brush engine, compact tool column. */
.wik .wik-mode-cards{display:grid;gap:7px}.wik button.wik-mode-card{width:100%;display:grid;grid-template-columns:82px 1fr;gap:10px;align-items:center;text-align:left;background:var(--panel,#fff);color:var(--ink,#183443);border:1px solid var(--line,#c7d1d6);border-radius:12px;padding:8px;cursor:pointer}.wik-mode-card canvas{width:82px;height:52px;border:1px solid #a8afb133;border-radius:7px}.wik-mode-card strong{display:block;font-size:12px;line-height:1.35}.wik-mode-card small{display:block;font-size:10.5px;line-height:1.4;opacity:.8;margin-top:4px}.wik button.wik-mode-card[aria-pressed=true]{border:2px solid var(--accent,#bd2543);padding:7px;background:var(--accent-soft,#fff0df)}.wik-mode-card:focus-visible{outline:3px solid var(--accent,#c41e33);outline-offset:2px}.wik .wik-import-note{padding:10px;border-left:3px solid var(--accent,#c41e33);background:var(--panel2,#edf2f3)}
.painter.pt-balanced{background:#f4f6f6;color:#183443}.pt-balanced .pt-head{padding:14px 18px;flex-wrap:nowrap;background:#183443;gap:14px}.pt-balanced .pt-head p{margin:4px 0 0;color:#d9e4e7;font-size:11.5px}.pt-head-actions{display:flex;gap:6px;margin-left:auto;align-items:center}.pt-head-actions button{border:1px solid #ffffff33;background:#ffffff0d;color:#fff;padding:8px 11px;border-radius:9px;cursor:pointer}.pt-head-actions button:disabled{opacity:.35}
.pt-balanced-body{display:flex;min-height:0;flex:1;overflow:hidden}.pt-balanced-side{width:230px;flex:0 0 230px;padding:14px;background:#f4f6f6;border-right:1px solid #d5dfe1;overflow:auto;color:#183443;box-sizing:border-box}.pt-balanced-work{display:flex;flex:1;min-width:0;min-height:0;flex-direction:column}.pt-balanced .pt-stage{flex:1;min-height:100px}.pt-mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px}.pt-mode-tabs button{padding:10px 6px;border:1px solid #b7cbd0;border-radius:9px;background:#fff;color:#183443;font-size:11px;font-weight:650;cursor:pointer}.pt-mode-tabs button[aria-pressed=true],.pt-balanced #pt-bg-toggle[aria-pressed=true]{background:#183443;color:#fff;border-color:#183443}.pt-mode-hint{font-size:11px;line-height:1.5;margin:10px 0 14px}.pt-balanced .pt-tools{display:grid;gap:7px;margin:12px 0 18px;flex:none}.pt-balanced .pt-tools button{color:#183443;background:#fff;border:1px solid #b7cbd0;padding:10px;min-height:50px;text-align:left;position:relative}.pt-balanced .pt-tools button[aria-pressed=true]{background:#183443;color:#fff;border-color:#183443}.pt-balanced .pt-tools button i{width:8px;height:8px;box-shadow:none;position:absolute;right:9px;top:9px}.pt-balanced .pt-tools svg{width:24px;height:24px;flex:none}.pt-balanced .pt-tools b{display:block;font-size:12px}.pt-balanced .pt-tools small{display:block;font-size:10px;font-weight:400;margin-top:3px;opacity:.85}
.pt-balanced .pt-size{display:grid;grid-template-columns:1fr auto;gap:8px;color:#183443;margin:10px 0 0;font-size:11.5px}.pt-balanced .pt-size input{grid-column:1/-1;width:100%;accent-color:#bd2543;min-width:0}.pt-balanced .pt-size output{color:#435d67;font-size:11px;min-width:0}.pt-brush-example{display:flex;align-items:center;gap:8px;height:34px;color:#b7264a}.pt-brush-example small{font-size:10px;color:#526c75;margin-left:auto}.pt-dot{display:inline-block;border-radius:50%;background:#cb355c;flex:none}.pt-dot.little{width:7px;height:7px}.pt-dot.big{width:19px;height:19px}.pt-dot.soft{width:22px;height:22px;background:radial-gradient(circle,#cb355c 10%,#cb355c00 72%)}.pt-shortcut{display:grid;gap:5px;padding:10px;margin-top:14px;border-radius:9px;background:#e5edef;font-size:10.5px;line-height:1.4}.pt-shortcut small{font-size:10px;color:#526c75}.pt-balanced #pt-reset{font-size:10.5px;background:none;border:0;color:#ad2944;padding:14px 0;cursor:pointer;text-decoration:underline}
.pt-balanced .pt-bgbar{display:block;padding:10px;margin:10px 0;background:#e8f0f1;border:1px solid #c7d9dc;border-radius:10px;max-height:none;overflow:visible}.pt-balanced .pt-bgbar[hidden]{display:none}.pt-balanced .pt-bgbar button{width:100%;font-size:10.5px;padding:9px 4px}.pt-balanced #pt-bg-auto{background:#b92645;color:white;border:0;font-weight:650}.pt-balanced .pt-bgbar label:not(.pt-mask-check){display:grid;grid-template-columns:1fr auto;font-size:10.5px;margin:12px 0 5px}.pt-balanced .pt-bgbar input[type=range]{width:100%;grid-column:1/-1}.pt-balanced .pt-bgbar>span{font-size:10px;line-height:1.4;display:block;margin:7px 0}.pt-balanced .pt-mask-check{font-size:10.5px;margin:12px 0}.pt-viewbar{display:flex;justify-content:space-between;align-items:center;padding:9px 12px;background:#fff;border-bottom:1px solid #d5dfe1;gap:8px;flex-wrap:wrap}.pt-viewbar>div{display:flex;gap:5px}.pt-viewbar button{border:1px solid #bbcdd2;background:#fff;color:#183443;border-radius:8px;padding:8px 10px;cursor:pointer}.pt-balanced .pt-check{color:#183443;font-size:11.5px}.pt-balanced .pt-foot{background:#fff;border-top:1px solid #d5dfe1;padding:10px 16px}.pt-balanced .pt-foot p{font-size:11px;line-height:1.4;color:#526c75}
@media(max-width:650px){.painter.pt-balanced{width:98vw;height:96dvh}.pt-balanced .pt-head{padding:10px;gap:5px}.pt-balanced .pt-head h2{font-size:16px}.pt-balanced .pt-head p{display:none}.pt-head-actions button{font-size:10px;padding:7px}.pt-balanced-body{flex-direction:column}.pt-balanced-side{width:100%;flex:0 0 auto;max-height:37dvh;border-right:0;border-bottom:1px solid #d5dfe1;display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;padding:10px}.pt-mode-tabs,.pt-mode-hint,.pt-balanced .pt-bgbar,.pt-balanced .pt-tools,.pt-shortcut{grid-column:1/-1}.pt-balanced .pt-tools{grid-template-columns:1fr 1fr;margin:0}.pt-mode-hint{margin:0}.pt-balanced .pt-size{grid-row:auto;margin:0}.pt-brush-example{display:none}.pt-shortcut{margin:0;padding:6px}.pt-shortcut b{font-size:10px}.pt-balanced #pt-reset{padding:4px;grid-column:1/-1}.pt-balanced .pt-foot{padding:8px}.pt-balanced .pt-foot p{flex-basis:100%;margin:0;font-size:10px}.pt-balanced .pt-foot .btn{padding:9px 12px}.pt-balanced .pt-viewbar{padding:6px}.pt-balanced .pt-bgbar{margin:0}.pt-balanced .pt-bgbar>span{margin:4px 0}}
