:root { color-scheme: dark; --base:#15151f; --panel:#1e1e2c; --panel2:#262638; --accent:#8b5cf6; --muted:#9292a6; --border:#ffffff25; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; height:100dvh; display:flex; flex-direction:column; background:var(--base); color:#f8f8fa; font:13px 'Segoe UI',sans-serif; overflow:hidden; }
button,input,select { font:inherit; }
button { background:var(--panel2); color:inherit; border:1px solid var(--border); border-radius:7px; padding:7px 12px; font-weight:600; cursor:pointer; white-space:nowrap; }
button:hover { background:#3a3a52; border-color:#ffffff55; }
button:active { background:#4a4a66; }
button:disabled { opacity:.4; cursor:default; }
button:focus-visible,input:focus-visible,[tabindex]:focus-visible,a:focus-visible { outline:2px solid #a78bfa; outline-offset:2px; }
input { color:inherit; background:var(--base); border:1px solid var(--border); border-radius:6px; padding:7px; min-width:0; }
input[type=text],label + input:not([type=range]):not([type=checkbox]) { width:100%; }
input[type=range] { width:100%; padding:0; border:0; height:18px; accent-color:var(--accent); cursor:pointer; }
input[type=checkbox] { appearance:none; width:32px; height:18px; border:0; border-radius:20px; background:#444456; cursor:pointer; position:relative; padding:0; flex-shrink:0; }
input[type=checkbox]::after { content:''; position:absolute; width:12px; height:12px; top:3px; left:3px; background:#ddd; border-radius:50%; transition:transform .12s; }
input[type=checkbox]:checked { background:var(--accent); } input[type=checkbox]:checked::after { transform:translateX(14px); background:white; }
input[type=color] { width:36px; height:32px; padding:2px; cursor:pointer; }
label:not(.switch-row) { display:block; margin:9px 0 5px; }
h2 { font-size:14px; font-weight:600; margin:0 0 8px; }
p { line-height:1.5; margin:7px 0 0; }
hr { border:0; border-top:1px solid var(--border); margin:14px 0; }
code { font-family:Consolas,monospace; }
.toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:8px 12px; background:var(--panel); border-bottom:1px solid var(--border); }
.brand { display:flex; margin-right:12px; } .brand img { width:184px; height:46px; object-fit:contain; image-rendering:pixelated; }
.file-actions,.dimensions,.utility { display:flex; align-items:center; gap:6px; }
.history-actions { display:flex; align-items:center; gap:6px; margin-left:auto; padding-bottom:6px; flex-shrink:0; }
.history-actions .history-button { width:34px; height:32px; padding:0; font-size:22px; }
.brush-number { display:flex; gap:6px; align-items:center; }
.brush-arrows { display:flex; flex-direction:column; gap:2px; }
.brush-arrows button { width:24px; height:16px; padding:0; line-height:12px; font-size:13px; touch-action:manipulation; }
.dimensions { color:#b8b8c8; } .dimensions input { width:64px; height:32px; } .dimensions button { width:36px; height:32px; padding:0; font-size:23px; }
.utility { margin-left:auto; gap:10px; }.utility button { width:30px; height:30px; padding:0; }
.tabs-bar { display:flex; align-items:center; gap:8px; padding:8px 12px 0; border-bottom:1px solid var(--border); }
.tabs { display:flex; gap:2px; min-width:0; overflow-x:auto; scrollbar-width:thin; }
.tabs button { border:0; border-radius:8px 8px 0 0; color:#b8b8c8; background:transparent; padding:11px 22px; border-bottom:3px solid transparent; }
.tabs button[aria-selected=true] { color:#fff; background:var(--panel2); border-bottom-color:var(--accent); }
.tabs button > span:first-child { color:#a78bfa; margin-right:6px; }
.workspace { display:grid; grid-template-columns:280px minmax(0,1fr); gap:12px; padding:12px; flex:1; min-height:0; }
.workspace.preview,.workspace.work { grid-template-columns:minmax(0,1fr) 260px; }
.sidebar { overflow:auto; min-height:0; scrollbar-width:thin; padding:0 2px 2px 0; }
.panel { border:1px solid var(--border); border-radius:10px; background:var(--panel); padding:12px; margin-bottom:10px; }
.right .panel { min-height:100%; margin:0; padding:14px; }
.compact { padding:7px 12px; }.panel-heading { display:flex; align-items:center; justify-content:space-between; gap:5px; margin-bottom:4px; } .panel-heading h2 { margin:0; }
.tools { display:flex; gap:4px; }.tools button { display:flex; align-items:center; justify-content:center; padding:0; width:44px; height:38px; opacity:.6; }.tools button.selected { opacity:1; background:#382854; border-color:var(--accent); }
.tool-icon { width:24px; height:24px; display:block; background:currentColor; mask:var(--icon) center/contain no-repeat; }
.pencil { --icon:url('assets/lapiz.png'); }.eraser { --icon:url('assets/goma.png'); }.eyedropper { --icon:url('assets/cuentagotas.png'); }
.muted,.range-labels { color:var(--muted); font-size:11px; }.range-labels { display:flex; justify-content:space-between; }.text-button { background:none; border:0; font:13px Consolas,monospace; padding:2px 0; }
#brush-readout { color:#a78bfa; font-family:Consolas,monospace; }
#brush-size { appearance:none; height:6px; margin:8px 0; border-radius:3px; background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--brush-progress,0%),#2f2f44 var(--brush-progress,0%),#2f2f44 100%); }
#brush-size::-webkit-slider-thumb { appearance:none; width:16px; height:16px; background:var(--accent); border-radius:50%; }
#brush-size::-moz-range-thumb { width:16px; height:16px; background:var(--accent); border-radius:50%; border:0; }
#brush-size::-moz-range-track { background:transparent; }
#brush-size:disabled { opacity:.4; }
.current-color { display:flex; align-items:center; gap:10px; }.current-color p { margin-top:3px; }
.swatch { width:28px; height:28px; border:1px solid #ffffff44; border-radius:6px; display:inline-block; background-color:var(--color); }
.large { width:48px; height:48px; flex-shrink:0; }
.sv-picker { height:140px; position:relative; border-radius:6px; background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent),hsl(var(--hue,258) 100% 50%); cursor:crosshair; touch-action:none; }
#sv-dot { position:absolute; width:10px; height:10px; border:2px solid white; border-radius:50%; transform:translate(-50%,-50%); box-shadow:0 0 0 1px #222; pointer-events:none; }
.hue { margin-top:10px; appearance:none; background:linear-gradient(to right,red,#ff0,#0f0,cyan,blue,#f0f,red); border-radius:5px; }
.hue::-webkit-slider-thumb { appearance:none; width:8px; height:20px; border:2px solid white; background:transparent; border-radius:3px; }
.accent { background:var(--accent); border-color:var(--accent); color:white; }.accent:hover { background:#9e75fb; }.outlined { background:transparent; border-color:var(--accent); color:#c4adfc; }
.full { width:100%; margin-top:8px; }.small { padding:4px 8px; font-size:12px; }.swatches { display:flex; flex-wrap:wrap; gap:6px; }.swatches button { padding:0; width:28px; height:28px; background:var(--color); box-shadow:inset 0 0 0 1px #ffffff33; }
.palette-actions { display:flex; gap:8px; margin-top:10px; }
.canvas-stage { position:relative; min-width:0; min-height:0; border:1px solid var(--border); border-radius:10px; background:#181820; overflow:hidden; }
#canvas { display:block; width:100%; height:100%; touch-action:none; cursor:crosshair; outline-offset:-4px; }
.view-buttons { position:absolute; top:10px; right:12px; display:flex; gap:8px; align-items:center; color:var(--muted); font:11px Consolas,monospace; }
.layers-dock { position:absolute; right:12px; bottom:12px; width:180px; pointer-events:none; }.layers-dock > button { display:block; margin:0 0 6px auto; }.layers-dock button,.layers-dock input,.layers-dock .panel { pointer-events:auto; }
.layers-dock .panel { margin:0 0 6px; padding:10px; }.layers-dock .compact { margin:0; padding:6px 10px; }.layers-dock h2 { font-size:12px; }.layers-dock output { font-size:10px; color:var(--muted); }
#layer-list { max-height:150px; overflow:auto; scrollbar-width:thin; }.layer-row { display:flex; gap:3px; align-items:center; margin-top:4px; padding:3px; border-radius:5px; border:1px solid transparent; }.layer-row.active { background:#352949; border-color:#8b5cf666; }.layer-row.drop { border-top:2px solid #a78bfa; }.layer-name { overflow:hidden; text-overflow:ellipsis; flex:1; background:none; border:0; padding:4px 1px; text-align:left; font-weight:400; }.layer-row .small { padding:2px 5px; }.layer-row.invisible { opacity:.55; }
.switch-row { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:12px 0; }
.used-color { display:flex; align-items:center; gap:8px; margin-top:10px; }.used-color .swatch { width:22px; height:22px; flex-shrink:0; }.used-color .name { flex:1; overflow-wrap:anywhere; }.used-color code,.used-color small { font:11px Consolas,monospace; color:var(--muted); }
footer { background:var(--panel); border-top:1px solid var(--border); padding:5px 12px; display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:11px; }
.help { position:fixed; top:72px; right:12px; width:min(410px,calc(100vw - 24px)); max-height:70vh; overflow:auto; z-index:5; box-shadow:0 12px 50px #0008; }.help ul { padding-left:20px; }.help li { margin-bottom:8px; line-height:1.5; }
dialog { background:var(--panel); color:inherit; border:1px solid #ffffff40; border-radius:12px; padding:24px; max-width:calc(100vw - 24px); max-height:90dvh; box-shadow:0 20px 80px #000a; }
dialog::backdrop { background:#0009; }#prompt-dialog { width:420px; }#prompt-input { margin-top:14px; }.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
#export-dialog { width:940px; }.export-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:24px; }.export-preview { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:300px; background:repeating-conic-gradient(#30303e 0% 25%,#252533 0% 50%) 0/20px 20px; border-radius:8px; padding:12px; gap:12px; overflow:hidden; }.export-preview canvas { max-width:100%; max-height:65vh; object-fit:contain; image-rendering:pixelated; }.export-preview output { background:var(--base); padding:4px 8px; border-radius:5px; }
@media(max-width:1000px) { .brand { margin-right:0; }.brand img { width:145px; }.toolbar { gap:8px; }.toolbar button { padding:7px 9px; }.workspace { grid-template-columns:230px minmax(0,1fr); }.workspace.preview,.workspace.work { grid-template-columns:minmax(0,1fr) 220px; }.tools button { width:36px; } }
@media(max-width:650px) { .toolbar { padding:6px 8px; }.brand img { height:34px; width:128px; }.file-actions { order:3; width:100%; overflow:auto; }.dimensions { order:4; }.utility { margin-left:auto; }.tabs-bar { padding:4px 8px 0; }.tabs button { padding:10px 12px; }.workspace { padding:8px; gap:8px; grid-template-columns:155px minmax(0,1fr); }.workspace.preview,.workspace.work { grid-template-columns:minmax(0,1fr) 155px; }.panel { padding:9px; }.right .panel { padding:9px; }.tools { flex-wrap:wrap; }.tools button { width:36px; height:34px; }.current-color { gap:5px; flex-wrap:wrap; }.sv-picker { height:115px; }.layers-dock { right:6px; bottom:6px; width:145px; }.view-buttons { right:6px; }.palette-actions { flex-wrap:wrap; }.export-layout { grid-template-columns:1fr; }.export-preview { min-height:160px; }.export-preview canvas { max-height:30vh; }.help { top:135px; } }
