/* PIXXULA — app-specific bits on top of ../shared/pixx.css (amber accent from [data-app=pixxula]) */
.pxs-ws { --left-w: 300px; --right-w: 320px; }
#view { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#view.panning { cursor: grabbing; }
.stage-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.stage-empty .dropzone .row { justify-content: center; }
.zoompill { left: 12px; bottom: 12px; }
.zoompill .zl { min-width: 54px; text-align: center; font: 600 12px var(--mono); }
.infopill { right: 12px; bottom: 12px; padding: 6px 12px; gap: 12px; font: 500 11.5px var(--mono); color: var(--muted); pointer-events: none; }
.infopill b { color: var(--text); font-weight: 600; } .infopill .warnc { color: var(--warn); }
.dragover::after { content: 'Drop frames, GIFs or a sheet'; position: absolute; inset: 10px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--acc); border-radius: 18px; background: rgba(var(--acc-rgb), .08); font-size: 16px; font-weight: 700; z-index: 5; }
/* frame list */
.frames { display: flex; flex-direction: column; gap: 3px; }
.frow { display: grid; grid-template-columns: 16px 36px minmax(0, 1fr) 58px 22px; align-items: center; gap: 6px; padding: 4px 6px 4px 2px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; position: relative; }
.frow:hover { background: rgba(255,255,255,.035); }
.frow.on { background: linear-gradient(90deg, rgba(var(--acc-rgb), .2), rgba(var(--acc-rgb), .05)); border-color: rgba(var(--acc-rgb), .45); }
.frow.dragging { opacity: .4; } .frow.dropbefore { box-shadow: inset 0 3px 0 var(--acc); } .frow.dropafter { box-shadow: inset 0 -3px 0 var(--acc); }
.frow .grip { color: var(--dim); cursor: grab; font-size: 11px; letter-spacing: -2px; text-align: center; }
.frow canvas { width: 36px; height: 36px; image-rendering: pixelated; border-radius: 6px; background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 8px 8px; object-fit: contain; }
.frow .nm { display: flex; flex-direction: column; min-width: 0; }
.frow .nm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .nm span { font: 10.5px var(--mono); color: var(--muted); }
.frow .num { width: 58px; height: 24px; font-size: 11px; }
.frow .x { color: var(--dim); font-size: 13px; text-align: center; border-radius: 6px; }
.frow .x:hover { color: #fff; background: rgba(255,93,115,.5); }
.frow .dup { font: 700 9px var(--mono); color: var(--acc2); background: rgba(var(--acc2-rgb), .14); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.tagrow { display: grid; grid-template-columns: 14px minmax(0, 1fr) 44px 44px 84px 26px 22px; align-items: center; gap: 4px; margin: 3px 0; }
.tagrow .dot { width: 12px; height: 12px; border-radius: 4px; border: 0; padding: 0; cursor: pointer; }
.tagrow .text.sm, .tagrow .num, .tagrow .sel { height: 26px; width: 100%; min-width: 0; font-size: 11.5px; }
.tagrow .x { color: var(--dim); text-align: center; border-radius: 6px; } .tagrow .x:hover { color: #fff; background: rgba(255,93,115,.5); }
/* preview player */
.player { display: flex; align-items: center; justify-content: center; min-height: 140px; border-radius: 12px; background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 12px 12px; border: 1px solid var(--line); margin-bottom: 8px; position: relative; }
.player canvas { image-rendering: pixelated; max-width: 100%; }
.pivgrid { display: grid; grid-template-columns: repeat(3, 22px); gap: 3px; }
.pivgrid button { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid var(--line2); }
.pivgrid button.on { background: var(--acc); border-color: var(--acc); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 .num { width: 100%; }
/* slice dialog */
.slice-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.slice-stage { max-height: 60vh; overflow: auto; border-radius: 12px; background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: center; padding: 8px; }
.slice-stage canvas { image-rendering: pixelated; }
.export-row { display: flex; flex-direction: column; gap: 4px; }
.export-row label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; }
.export-row label:has(input:checked) { border-color: var(--acc); background: rgba(var(--acc-rgb), .1); }
.export-prev { display: flex; align-items: center; justify-content: center; max-height: 36vh; overflow: auto; border-radius: 12px; background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); padding: 8px; }
.export-prev canvas { image-rendering: pixelated; max-width: 100%; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.footbar .warnc { color: var(--warn); } .footbar .badc { color: var(--bad); }
/* ---------- v1.1: pack modes, background, view controls ---------- */
.modeseg { margin-left: 8px; }
.modeseg .short { display: none; }
.bgctl { display: inline-flex; align-items: center; gap: 6px; }
.bgctl input[type=color] { width: 30px; height: 26px; }
.bgctl input[type=color]:disabled { opacity: .35; }
.zoompill .zl { min-width: 70px; height: 26px; background: transparent; border: 0; color: var(--text); font: 600 12px var(--mono); text-align: center; text-align-last: center; cursor: pointer; padding: 0 2px; }
.zoompill .zl option { background: var(--panel2); }
.zoompill .zsep { width: 1px; height: 18px; background: var(--line2); margin: 0 3px; }
.procpill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(20,21,31,.88); border: 1px solid rgba(var(--acc-rgb), .45); color: var(--text); font-size: 12px; font-weight: 600; z-index: 3; pointer-events: none; }
.procpill .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(var(--acc-rgb), .3); border-top-color: var(--acc); animation: pxu-spin .7s linear infinite; }
@keyframes pxu-spin { to { transform: rotate(360deg); } }
.goodc { color: var(--good); } .warnc { color: var(--warn); }
.btn .cnt { font: 700 10px var(--mono); background: rgba(0,0,0,.25); border-radius: 999px; padding: 1px 6px; margin-left: 2px; }
.estline b { color: var(--text); }
/* ---------- v1.1: the PNG reducer ---------- */
.reducer { display: none; }
body.mode-reduce .sheet-only, body.mode-reduce .topbar .projname { display: none !important; }
body.mode-reduce .pxs-ws { grid-template-columns: minmax(0, 1fr) !important; }
body.mode-reduce #left, body.mode-reduce #stage, body.mode-reduce #right { display: none !important; }
/* v1.3 (2026-10-19): slim file list on the LEFT, the selected file's zoomable before/after preview fills the rest */
body.mode-reduce .reducer { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; position: relative; }
body.mode-reduce .reducer.red-empty { grid-template-columns: minmax(0, 1fr); }
.reducer.red-empty .reddetail { display: none; }
.redlist { overflow-y: auto; min-height: 0; padding: 10px; border-right: 1px solid var(--line); background: rgba(14,15,23,.65); }
.reducer.red-empty .redlist { border-right: 0; background: none; padding: 14px; }
.redcards { display: flex; flex-direction: column; gap: 6px; }
.redhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 4px 4px; font-size: 12px; color: var(--muted); }
.redhead b { color: var(--text); font-weight: 700; }
.reddrop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 48px 24px; margin: 30px auto; max-width: 560px; border: 2px dashed rgba(var(--acc-rgb), .45); border-radius: 22px; background: rgba(var(--acc-rgb), .05); color: var(--muted); }
.reddrop .ico { color: var(--acc); } .reddrop h2 { margin: 0; color: var(--text); font-size: 18px; } .reddrop p { margin: 0; max-width: 440px; line-height: 1.5; }
.rcard { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025); text-align: left; width: 100%; cursor: pointer; box-sizing: border-box; }
.rcard:hover { border-color: rgba(var(--acc-rgb), .5); }
.rcard:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.rcard.on { border-color: var(--acc); background: rgba(var(--acc-rgb), .08); box-shadow: 0 0 0 1px rgba(var(--acc-rgb), .3); }
.rcard.busy { opacity: .7; }
.rcard .rdel { opacity: .5; align-self: start; } .rcard:hover .rdel, .rcard.on .rdel, .rcard .rdel:focus-visible { opacity: 1; }
.rth canvas { width: 48px; height: 48px; border-radius: 8px; image-rendering: pixelated; background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 8px 8px; display: block; }
.rmeta { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 12px; }
.rmeta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmeta .mono { color: var(--muted); font-size: 11px; }
.rstat { font-size: 11px; line-height: 1.35; } .rstat b { font-weight: 700; }
.reddetail { min-height: 0; min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.cmpbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.redzoom { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.redzoom .seg button { padding: 0 8px; }
.redminus { font-size: 16px; line-height: 1; }
.redzoomval { min-width: 64px; font-size: 11px; color: var(--muted); text-align: right; }
.cmpbox { flex: 1 1 auto; min-height: 220px; border-radius: 12px; border: 1px solid var(--line); background: #10111a; overflow: hidden; }
.cmpbox canvas { display: block; touch-action: none; cursor: grab; image-rendering: pixelated; outline: none; }
.cmpbox canvas.panning { cursor: grabbing !important; }
.cmpbox:focus-within { border-color: rgba(var(--acc-rgb), .6); }
.redctl { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-start; flex: none; max-height: 40%; overflow-y: auto; }
.redstats { display: flex; flex-direction: column; gap: 2px; font-size: 12px; flex: 1 1 220px; min-width: 0; }
.redstats b { font-weight: 700; }
.redset { display: flex; flex-direction: column; gap: 4px; flex: 2 1 320px; min-width: 0; }
.redact { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; align-self: center; }
.reducer.dragover::after { content: 'Drop PNGs to reduce'; position: absolute; inset: 10px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--acc); border-radius: 18px; background: rgba(var(--acc-rgb), .08); font-size: 16px; font-weight: 700; z-index: 5; pointer-events: none; }
@media (max-width: 1100px) { body.mode-reduce .reducer { grid-template-columns: 230px minmax(0, 1fr); } .modeseg button { padding: 0 7px; } }
@media (max-width: 760px) {
  .floatpill.infopill { display: none; }
  .modeseg .long { display: none; } .modeseg .short { display: inline; }
  #undoBtn, #redoBtn { display: none !important; }
  #exportBtn > span:not(.ico) { display: none; } #exportBtn { padding: 0 9px; }
  .slice-wrap, .cols2 { grid-template-columns: minmax(0, 1fr); }
  .modeseg { margin-left: 2px; } .modeseg button { padding: 0 6px; font-size: 11px; }
  .topbar .projname { display: none; }
  .procpill { top: 8px; }
  /* phones: the file list is a horizontal strip on top, the preview gets most of the height */
  body.mode-reduce .reducer { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  body.mode-reduce .reducer.red-empty { grid-template-rows: minmax(0, 1fr); }
  .redlist { border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; padding: 8px; }
  .reducer.red-empty .redlist { overflow-y: auto; }
  .redcards { flex-direction: row; }
  .redhead { flex-direction: column; justify-content: center; padding: 0 4px; }
  .rcard { width: 230px; flex: none; }
  .reddetail { overflow-y: auto; padding: 8px; }
  .cmpbox { flex: none; height: 52vh; min-height: 240px; }
  .redctl { max-height: none; overflow: visible; }
  .redzoomval { display: none; }
}
/* Simplified workspace (PIXX.workspace, <html>.pxs-simple): touch-sized checkbox rows, frame-row inputs and delete buttons */
html.pxs-simple .pxs-app label.field:has(> input[type=checkbox]) { min-height: var(--touch); }
html.pxs-simple .frow { grid-template-columns: 16px 36px minmax(0, 1fr) 64px 40px; }
html.pxs-simple .frow .num { width: 64px; height: auto; }
html.pxs-simple .frow .x { min-width: 40px; min-height: 40px; }
