/* =====================================================================
   Photo Studio - professional editor chrome.
   The editor has its own interface brightness (View › Interface): dark by default,
   light, or matching the system theme. Tokens are set on the window element.
   ===================================================================== */
.win[data-app="photostudio"] {
  color-scheme: dark;
  --text: #e9ebf0;
  --text-2: rgba(233, 235, 240, .68);
  --text-3: rgba(233, 235, 240, .42);
  --surface: #1e2026;
  --surface-2: #25282f;
  --surface-3: #2e323a;
  --sidebar: #1b1d22;
  --hover: rgba(255, 255, 255, .07);
  --press: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --tile: rgba(255, 255, 255, .075);
  --tile-hover: rgba(255, 255, 255, .13);
  --glass: rgba(26, 28, 34, .82);
  --glass-strong: rgba(26, 28, 34, .92);
  --glass-solid: #1c1e24;
  --glass-border: rgba(255, 255, 255, .09);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .05);
  --bar: #18191e;
  --ps-chrome: #1b1d22;
  --ps-panel: #202228;
  --ps-well: #131418;
  --ps-field: #2a2d34;
  --ps-card: rgba(32, 34, 40, .97);
  --ps-sheet: #24262c;
  --ps-track: #3a3e47;
  --ps-edge: rgba(0, 0, 0, .45);
  --ps-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .55);
  --ps-sel: rgba(var(--accent-rgb), .22);
  --ps-hl: #fff;
  background: var(--ps-chrome);
  color: var(--text);
}
/* light interface (View › Interface › Light, or Match system while the system is light) */
.win[data-app="photostudio"][data-ps-ui="light"],
:root[data-theme="light"] .win[data-app="photostudio"][data-ps-ui="auto"] {
  color-scheme: light;
  --text: #1c1f26;
  --text-2: rgba(28, 31, 38, .7);
  --text-3: rgba(28, 31, 38, .45);
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e7e9ee;
  --sidebar: #eef0f4;
  --hover: rgba(0, 0, 0, .055);
  --press: rgba(0, 0, 0, .09);
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .13);
  --tile: rgba(0, 0, 0, .05);
  --tile-hover: rgba(0, 0, 0, .09);
  --glass: rgba(246, 247, 250, .9);
  --glass-strong: rgba(250, 251, 252, .96);
  --glass-solid: #f7f8fa;
  --glass-border: rgba(0, 0, 0, .1);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .7);
  --bar: #e9ebf0;
  --ps-chrome: #e6e8ed;
  --ps-panel: #f2f3f6;
  --ps-well: #d4d7de;
  --ps-field: #ffffff;
  --ps-card: rgba(250, 251, 253, .98);
  --ps-sheet: #fbfbfd;
  --ps-track: #c9cdd6;
  --ps-edge: rgba(0, 0, 0, .14);
  --ps-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 18px 50px rgba(20, 24, 34, .22);
  --ps-sel: rgba(var(--accent-rgb), .18);
  --ps-hl: #1c1f26;
}
.win[data-app="photostudio"] .win-bar { background: var(--bar); border-bottom-color: var(--ps-edge); }

.app-photostudio { background: var(--ps-chrome); color: var(--text); font-size: 12.5px; }
.app-photostudio .ps-hidden { display: none; }
.ps-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ps-flex { flex: 1; }
.ps-muted { color: var(--text-2); margin: 0; font-size: 12.5px; line-height: 1.45; }
.ps-err { color: #ff6b6b; }

/* ------------------------------------------------------------------ title bar */
.ps-bar { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: 4px; }
.ps-bar[hidden] { display: none; }
.ps-docname {
  height: 26px; max-width: 260px; padding: 0 9px; border: 0; border-radius: 7px; background: none; color: var(--text);
  font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-docname:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-2); }
.ps-docname-in { height: 26px; width: 200px; padding: 0 8px; border: 0; border-radius: 7px; background: var(--ps-field); color: var(--text); font-size: 12.5px; font-weight: 600; outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.ps-docstate { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.ps-docstate::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.ps-docstate.ok::before { background: #34c77b; }
.ps-docstate.warn::before { background: #f5a524; }
.ps-docstate.err { color: #ff6b6b; }
.ps-docstate.err::before { background: #ff6b6b; }

/* ------------------------------------------------------------------ editor frame */
.ps-editor { display: none; flex: 1; min-height: 0; flex-direction: column; }
.ps-has-doc .ps-editor { display: flex; }
.ps-has-doc .ps-start { display: none; }
.ps-main { position: relative; flex: 1; min-height: 0; display: flex; }

/* options bar */
.ps-optbar {
  height: 40px; flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: var(--ps-panel); border-bottom: 1px solid var(--ps-edge); box-shadow: inset 0 -1px 0 var(--line);
}
.ps-opt-scroll { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ps-opt-scroll::-webkit-scrollbar { display: none; }
.ps-opt-tool { display: flex; align-items: center; gap: 7px; padding: 0 12px 0 4px; margin-right: 2px; height: 24px; border-right: 1px solid var(--line-2); font-weight: 700; white-space: nowrap; color: var(--text); }
.ps-opt-tool .ic { color: var(--accent); }
.ps-opt-body { display: flex; align-items: center; gap: 12px; flex: 1 0 auto; padding-right: 8px; }
.ps-opt { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--text-2); }
.ps-opt-l { font-size: 12px; }
.ps-opt-u { font-size: 11.5px; color: var(--text-3); margin-left: -3px; }
.ps-opt-hint { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.ps-opt-sep { width: 1px; height: 20px; background: var(--line-2); flex: 0 0 auto; }
.ps-menu-btn, .ps-drawer-btn { width: 30px; height: 30px; flex: 0 0 auto; color: var(--text-2); }
.ps-drawer-btn, .ps-menu-btn { display: none; }
.ps-xfnums { display: flex; align-items: center; gap: 10px; }
.ps-maskbadge { flex: 0 0 auto; }
.app-photostudio .btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 7px; gap: 6px; white-space: nowrap; }
.app-photostudio .btn { box-shadow: inset 0 0 0 1px var(--line-2); }
.app-photostudio .btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.ps-ib { width: 28px; height: 28px; border-radius: 7px; color: var(--text-2); flex: 0 0 auto; }
.ps-ib:hover { color: var(--text); }
.ps-ib.on { background: var(--ps-sel); color: var(--text); }
.ps-seg { background: var(--ps-well); padding: 2px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); flex: 0 0 auto; }
.ps-seg button { height: 24px; padding: 0 9px; font-size: 12px; border-radius: 6px; color: var(--text-2); }
.ps-seg button.on { background: var(--surface-3) !important; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--line-2); }
.ps-seg button .ic { display: block; }
.ps-num {
  width: 52px; height: 24px; padding: 0 6px; border: 0; border-radius: 6px; outline: none; text-align: right;
  background: var(--ps-well); color: var(--text); font: 600 12px/1 var(--font); box-shadow: inset 0 0 0 1px var(--line-2);
  -moz-appearance: textfield;
}
.ps-num::-webkit-inner-spin-button, .ps-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ps-num:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.ps-num-sm { width: 46px; }
.ps-range { height: 4px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--ps-track) var(--p, 50%)); }
.ps-range::-webkit-slider-thumb { width: 13px; height: 13px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .5); }
.ps-range::-moz-range-thumb { width: 13px; height: 13px; }
.ps-range-sm { width: 90px; }
.ps-select { height: 26px; padding: 0 26px 0 9px; font-size: 12px; border-radius: 7px; background-color: var(--ps-well); background-position: calc(100% - 13px) 11px, calc(100% - 8px) 11px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.ps-fontsel { max-width: 150px; }
.ps-check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; cursor: default; }
.ps-check input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.ps-optsw, .ps-colorsw { width: 20px; height: 20px; border-radius: 5px; border: 0; padding: 0; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 0 0 1px rgba(0, 0, 0, .5); }
.ps-colorsw { width: 34px; height: 22px; }
.ps-presetbtn { height: 30px; display: inline-flex; align-items: center; gap: 2px; padding: 0 4px; border: 0; border-radius: 7px; background: var(--ps-well); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); flex: 0 0 auto; }
.ps-presetbtn .ps-bprev { width: 72px; height: 16px; }
.ps-gradbar { width: 100%; height: 22px; border: 0; border-radius: 6px; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); cursor: pointer; }
.ps-gradbar-sm { width: 110px; flex: 0 0 auto; }

/* tool rail */
.ps-rail {
  width: 48px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 10px;
  background: var(--ps-panel); border-right: 1px solid var(--ps-edge); overflow-y: auto; scrollbar-width: none;
}
.ps-rail::-webkit-scrollbar { display: none; }
.ps-tools { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ps-tool { position: relative; width: 36px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--text-2); display: grid; place-items: center; padding: 0; flex: 0 0 auto; transition: background .1s, color .1s; }
.ps-tool:hover { background: var(--hover); color: var(--text); }
.ps-tool.on { background: var(--ps-sel); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55); }
.ps-tool.multi::after { content: ''; position: absolute; right: 3px; bottom: 3px; border: 3px solid transparent; border-right-color: currentColor; border-bottom-color: currentColor; opacity: .55; }
.ps-rail-sep { width: 22px; height: 1px; background: var(--line-2); margin: 4px 0; flex: 0 0 auto; }
.ps-swatches { position: relative; width: 38px; height: 40px; flex: 0 0 auto; margin-top: auto; }
.ps-sw-btn { position: absolute; width: 22px; height: 22px; border: 0; padding: 0; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 0 1.5px rgba(255, 255, 255, .85); }
.ps-sw-fg { left: 2px; top: 2px; z-index: 1; }
.ps-sw-bg { left: 13px; top: 13px; }
.ps-sw-mini { position: absolute; border: 0; padding: 0; background: none; color: var(--text-2); }
.ps-sw-swap { right: -3px; top: -2px; width: 14px; height: 14px; display: grid; place-items: center; }
.ps-sw-swap:hover, .ps-sw-def:hover { color: var(--text); }
.ps-sw-def { left: 0; bottom: -3px; width: 12px; height: 12px; }
.ps-sw-def i { position: absolute; width: 7px; height: 7px; border-radius: 1.5px; box-shadow: 0 0 0 1px rgba(127, 127, 127, .6); }
.ps-sw-def i:first-child { left: 0; top: 0; background: #000; z-index: 1; }
.ps-sw-def i:last-child { left: 4px; top: 4px; background: #fff; }

/* work area + rulers */
.ps-work { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--ps-well); }
.ps-stage { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 18px 1fr; grid-template-rows: 18px 1fr; }
.ps-stage.ps-norulers { grid-template-columns: 0 1fr; grid-template-rows: 0 1fr; }
.ps-stage.ps-norulers .ps-ruler, .ps-stage.ps-norulers .ps-ruler-corner { display: none; }
.ps-ruler-corner { grid-column: 1; grid-row: 1; background: var(--ps-panel); border-right: 1px solid var(--ps-edge); border-bottom: 1px solid var(--ps-edge); }
.ps-ruler { display: block; touch-action: none; }
.ps-ruler-top { grid-column: 2; grid-row: 1; cursor: s-resize; }
.ps-ruler-left { grid-column: 1; grid-row: 2; cursor: e-resize; }
.ps-viewwrap { position: relative; grid-column: 2; grid-row: 2; min-height: 0; min-width: 0; overflow: hidden; }
.ps-view { position: absolute; inset: 0; overflow: auto; touch-action: none; outline: none; background: var(--ps-well); }
.ps-view::-webkit-scrollbar { width: 11px; height: 11px; }
.ps-view::-webkit-scrollbar-thumb { background: var(--ps-track); border: 3px solid var(--ps-well); border-radius: 8px; }
.ps-view::-webkit-scrollbar-corner { background: var(--ps-well); }
.ps-sizer { position: relative; }
.ps-canvas {
  position: absolute; display: block;
  --cs: 8px;
  background-color: #fff;
  background-image: linear-gradient(45deg, #cfd2d8 25%, transparent 25%, transparent 75%, #cfd2d8 75%), linear-gradient(45deg, #cfd2d8 25%, transparent 25%, transparent 75%, #cfd2d8 75%);
  background-size: calc(var(--cs) * 2) calc(var(--cs) * 2);
  background-position: 0 0, var(--cs) var(--cs);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 10px 40px rgba(0, 0, 0, .45);
}
.ps-canvas.ps-pixelated { image-rendering: pixelated; }
.ps-ov { position: absolute; left: 0; top: 0; pointer-events: none; }
.ps-view[data-cursor="cross"] { cursor: crosshair; }
.ps-view[data-cursor="none"] { cursor: none; }
.ps-view[data-cursor="move"] { cursor: move; }
.ps-view[data-cursor="text"] { cursor: text; }
.ps-view[data-cursor="grab"] { cursor: grab; }
.ps-view[data-cursor="zoom"] { cursor: zoom-in; }
.ps-space .ps-view, .ps-space .ps-view[data-cursor] { cursor: grab !important; }
.ps-panning .ps-view, .ps-panning .ps-view[data-cursor] { cursor: grabbing !important; }

.ps-textedit {
  position: absolute; left: 0; top: 0; z-index: 3; margin: 0; padding: 0; border: 0; outline: 1px dashed rgba(0, 160, 255, .95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); background: transparent; resize: none; overflow: hidden;
  min-width: 8px; caret-color: var(--accent); transform-origin: 0 0; font-kerning: normal;
}
.ps-textedit::placeholder { color: rgba(127, 127, 127, .6); }

/* status bar */
.ps-status {
  height: 28px; flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: var(--ps-panel); border-top: 1px solid var(--ps-edge); color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden;
}
.ps-status .ps-ib { width: 24px; height: 22px; border-radius: 6px; }
.ps-zoomval { min-width: 50px; height: 22px; border: 0; border-radius: 6px; background: var(--ps-well); color: var(--text); font: 600 11.5px/1 var(--font); box-shadow: inset 0 0 0 1px var(--line); }
.ps-zoomval:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.ps-status .ps-opt-sep { height: 14px; margin: 0 6px; }
.ps-st-pos { margin-left: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 70px; }
.ps-st-info { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ right panels */
.ps-panelgrip { width: 5px; flex: 0 0 auto; margin-right: -5px; z-index: 2; cursor: col-resize; position: relative; }
.ps-panelgrip:hover { background: rgba(var(--accent-rgb), .35); }
.ps-panels {
  width: 288px; flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overflow-x: hidden;
  background: var(--ps-panel); border-left: 1px solid var(--ps-edge); scrollbar-width: thin;
}
.ps-panel { display: flex; flex-direction: column; min-height: 0; flex: 0 0 auto; border-bottom: 1px solid var(--ps-edge); box-shadow: 0 1px 0 var(--line); }
.ps-panel.drop-above { box-shadow: inset 0 2px 0 var(--accent); }
.ps-panel-layers:not(.collapsed) { flex: 1 0 auto; min-height: 240px; }
.ps-panel.collapsed .ps-pbody { display: none; }
.ps-ph { height: 32px; flex: 0 0 auto; display: flex; align-items: center; gap: 2px; padding: 0 6px 0 4px; cursor: grab; }
.ps-ph-toggle { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ps-ph-toggle:hover { color: var(--text); background: var(--hover); }
.ps-ph .ps-ib { width: 26px; height: 26px; }
.ps-pextra { display: inline-flex; align-items: center; gap: 1px; }
.ps-pbody { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ps-pb-layers { flex: 1; padding: 0 0 0; gap: 6px; }
.ps-ptip { font-size: 11.5px; color: var(--text-3); }

/* navigator */
.ps-navwrap { display: grid; place-items: center; min-height: 80px; background: var(--ps-well); border-radius: 8px; padding: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.ps-navcv { display: block; cursor: pointer; touch-action: none; background: repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.ps-navrow { display: flex; align-items: center; gap: 4px; }
.ps-navrow .ps-range { flex: 1; }
.ps-navz { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* colour + swatches + brushes */
.ps-cchips { display: flex; align-items: center; gap: 6px; }
.ps-cchip { width: 30px; height: 30px; border: 0; border-radius: 7px; padding: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 0 1.5px rgba(255, 255, 255, .6); }
.ps-cchip.on { box-shadow: 0 0 0 2px var(--accent), inset 0 0 0 1.5px rgba(255, 255, 255, .6); }
.ps-hexin { width: 82px; text-align: left; font-family: var(--mono); text-transform: uppercase; }
.ps-crow { display: grid; grid-template-columns: 14px 1fr 30px; align-items: center; gap: 8px; }
.ps-clbl { font-size: 11px; font-weight: 700; color: var(--text-3); }
.ps-crange { height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.ps-cval { font-size: 11.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.ps-swgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(20px, 1fr)); gap: 4px; }
.ps-swchip { aspect-ratio: 1; border: 0; padding: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 0 0 1px rgba(0, 0, 0, .35); }
.ps-swchip:hover { transform: scale(1.12); }
.ps-swadd { display: grid; place-items: center; background: var(--ps-well); color: var(--text-2); }
.ps-blist { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.ps-bitem { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--text); text-align: left; font-size: 12px; }
.ps-bitem:hover { background: var(--hover); }
.ps-bitem.on { background: var(--ps-sel); }
.ps-bprev { width: 110px; height: 24px; flex: 0 0 auto; }

/* properties */
.ps-phead { display: flex; align-items: center; gap: 8px; }
.ps-phead .ic { color: var(--accent); }
.ps-phead b { font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-psec { display: flex; flex-direction: column; gap: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.ps-psec-t { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.ps-ptext { min-height: 60px; resize: vertical; font-size: 13px; background: var(--ps-well); }
.ps-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-pgrid .ps-in { height: 28px; width: 100%; }
.ps-pval { height: 28px; display: flex; align-items: center; color: var(--text-2); }
.ps-pmthumb { display: grid; place-items: center; padding: 3px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2); }
.ps-pmthumb.on { box-shadow: 0 0 0 2px var(--accent); }
.ps-pmbtns { display: flex; flex-direction: column; gap: 4px; }
.ps-row-inline { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.ps-row-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ps-textctl .ps-select { max-width: 120px; }

/* layers */
.ps-lprops { display: flex; flex-direction: column; gap: 7px; padding: 0 10px; }
.ps-blend { width: 100%; }
.ps-lop { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.ps-lop .ps-range { flex: 1; }
.ps-locks { display: flex; align-items: center; gap: 2px; padding: 0 10px; }
.ps-locks .ps-opt-l { color: var(--text-3); margin-right: 4px; }
.ps-locks .ps-ib { width: 26px; height: 24px; }
.ps-llist { flex: 1; min-height: 120px; max-height: 52vh; overflow-y: auto; padding: 4px; background: var(--ps-well); margin: 0 6px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.ps-lrow { position: relative; height: 42px; display: flex; align-items: center; gap: 5px; padding-right: 4px; border-radius: 7px; margin-bottom: 2px; color: var(--text); }
.ps-lrow:hover { background: var(--hover); }
.ps-lrow.on { background: var(--ps-sel); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.ps-lrow.hidden .ps-lthumb-wrap, .ps-lrow.hidden .ps-lname { opacity: .45; }
.ps-lrow.dragging { opacity: .4; }
.ps-lrow.drop-above::before, .ps-lrow.drop-below::after { content: ''; position: absolute; left: 4px; right: 4px; height: 2px; border-radius: 2px; background: var(--accent); }
.ps-lrow.drop-above::before { top: -2px; }
.ps-lrow.drop-below::after { bottom: -2px; }
.ps-lrow.drop-into { box-shadow: inset 0 0 0 2px var(--accent); }
.ps-lbtn { width: 22px; height: 24px; border: 0; padding: 0; border-radius: 6px; background: none; color: var(--text-2); display: grid; place-items: center; flex: 0 0 auto; }
.ps-lbtn:hover { background: var(--hover); color: var(--text); }
.ps-lcaret { width: 16px; }
.ps-lclip { color: var(--text-3); display: grid; place-items: center; flex: 0 0 auto; }
.ps-lthumb-wrap { position: relative; width: 40px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 4px; background-color: #fff;
  background-image: linear-gradient(45deg, #d4d6db 25%, transparent 25%, transparent 75%, #d4d6db 75%), linear-gradient(45deg, #d4d6db 25%, transparent 25%, transparent 75%, #d4d6db 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); overflow: hidden; cursor: pointer; }
.ps-lthumb-wrap.tgt { box-shadow: 0 0 0 2px var(--ps-hl), 0 0 0 3px rgba(0, 0, 0, .5); }
.ps-lthumb-icon { background: var(--surface-3); color: var(--text-2); }
.ps-lmask { width: 34px; background: #000; }
.ps-lmask.off::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1.5px), #ff4d4d calc(50% - 1.5px), #ff4d4d calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.ps-lthumb { display: block; max-width: 40px; max-height: 32px; }
.ps-licon { display: grid; place-items: center; }
.ps-ltype { position: absolute; right: 1px; bottom: 1px; min-width: 12px; height: 12px; padding: 0 2px; border-radius: 3px; background: rgba(0, 0, 0, .65); color: #fff; font: 700 9px/12px var(--font); font-style: normal; display: grid; place-items: center; }
.ps-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ps-lname-in { flex: 1; min-width: 0; height: 24px; padding: 0 6px; border: 0; border-radius: 5px; outline: none; background: var(--ps-field); color: var(--text); font-size: 12.5px; box-shadow: inset 0 0 0 1.5px var(--accent); }
.ps-lfx { height: 18px; padding: 0 5px; border: 0; border-radius: 4px; background: var(--tile); color: var(--text-2); font: italic 700 11px/18px var(--font); flex: 0 0 auto; }
.ps-lfx:hover { color: var(--text); background: var(--tile-hover); }
.ps-lfx.off { text-decoration: line-through; opacity: .6; }
.ps-llock { color: var(--text-3); display: grid; place-items: center; flex: 0 0 auto; }
.ps-lfoot { display: flex; align-items: center; gap: 1px; padding: 4px 6px 6px; }
.ps-lfoot .ps-ib { width: 28px; height: 26px; }

.ps-adjgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.ps-adjbtn {
  height: 46px; border: 0; border-radius: 7px; background: var(--ps-well); color: var(--text-2); padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; line-height: 1.1; box-shadow: inset 0 0 0 1px var(--line);
}
.ps-adjbtn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-adjbtn:hover { color: var(--text); background: var(--surface-2); }

.ps-hlist { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.ps-hrow { height: 28px; flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: left; font-size: 12.5px; }
.ps-hrow .ic { color: var(--text-3); flex: 0 0 auto; }
.ps-hrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-hrow:hover { background: var(--hover); }
.ps-hrow.on { background: var(--ps-sel); }
.ps-hrow.on .ic { color: var(--accent); }
.ps-hrow.future { color: var(--text-3); font-style: italic; }

/* floating card (adjustments, filters, layer style, colour range) */
.ps-adj {
  position: absolute; right: 14px; top: 34px; z-index: 5; width: 300px; max-height: calc(100% - 48px); display: flex; flex-direction: column; padding: 12px 14px 12px;
  border-radius: 12px; background: var(--ps-card); color: var(--text); box-shadow: var(--ps-shadow);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  animation: ps-pop .16s var(--ease, ease-out);
}
.ps-adj-wide { width: 470px; }
@keyframes ps-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.ps-adj-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: move; user-select: none; }
.ps-adj-head .ic { color: var(--accent); }
.ps-adj-head b { font-size: 13.5px; white-space: nowrap; }
.ps-adj-on { margin-left: auto; color: var(--text-3); font-size: 11.5px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-adj-body { overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.ps-adj-rows { display: flex; flex-direction: column; gap: 12px; }
.ps-adj-row { display: flex; flex-direction: column; gap: 7px; }
.ps-adj-row.ps-row-inline { flex-direction: row; align-items: center; justify-content: space-between; }
.ps-adj-lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); }
.ps-numwrap { display: inline-flex; align-items: center; gap: 4px; }
.ps-numwrap small { color: var(--text-3); }
.ps-adj-actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.ps-adj-peek { user-select: none; }
.ps-prog { height: 3px; opacity: 0; transition: opacity .2s; }
.ps-prog.on { opacity: 1; }
.ps-prog i { width: 0; }
.ps-curves { display: block; align-self: center; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); touch-action: none; cursor: crosshair; }
.ps-levels { display: block; align-self: center; }
.ps-lvtrack { position: relative; height: 14px; margin: 0 6px; border-radius: 3px; background: linear-gradient(90deg, #000, #fff); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .5); }
.ps-lvknob { position: absolute; top: 9px; width: 0; height: 0; margin-left: -7px; border: 7px solid transparent; border-bottom: 10px solid #888; border-top: 0; cursor: ew-resize; touch-action: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.ps-lv-b { border-bottom-color: #111; }
.ps-lv-g { border-bottom-color: #888; }
.ps-lv-w { border-bottom-color: #fafafa; }
.ps-lvout { margin-bottom: 8px; }
.ps-lvnums { display: flex; justify-content: space-between; }
.ps-crrow { display: flex; align-items: center; gap: 8px; }
.ps-crsw { width: 28px; height: 22px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.ps-crthumb { display: block; align-self: center; max-width: 100%; border-radius: 4px; box-shadow: 0 0 0 1px var(--line-2); }
.ps-fxwrap { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.ps-fxlist { display: flex; flex-direction: column; gap: 1px; }
.ps-fxitem { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px; border-radius: 6px; cursor: default; color: var(--text-2); }
.ps-fxitem input { accent-color: var(--accent); margin: 0; }
.ps-fxitem:hover { background: var(--hover); color: var(--text); }
.ps-fxitem.on { background: var(--ps-sel); color: var(--text); }
.ps-fxpane { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.ps-fxhead { font-weight: 700; font-size: 13px; }

/* progress overlay for filters */
.ps-progress { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0, 0, 0, .25); }
.ps-progress-card { width: 260px; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--ps-card); box-shadow: var(--ps-shadow); }
.ps-progress-card .progress i { width: 0; }
.ps-progress-card .btn { align-self: flex-end; }

/* ------------------------------------------------------------------ colour picker */
.ps-cp {
  position: absolute; z-index: 60; width: 240px; padding: 12px; border-radius: 12px; background: var(--ps-sheet); color: var(--text);
  box-shadow: var(--ps-shadow); animation: ps-pop .14s ease-out;
}
.ps-cp-title { font-weight: 700; font-size: 12.5px; margin-bottom: 9px; }
.ps-cp-sv { position: relative; height: 150px; border-radius: 8px; touch-action: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); cursor: crosshair; }
.ps-cp-svk { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .4); pointer-events: none; }
.ps-cp-hue { position: relative; height: 12px; margin: 10px 0 12px; border-radius: 6px; touch-action: none; background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.ps-cp-huek { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: transparent; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .4); pointer-events: none; }
.ps-cp-row { display: flex; align-items: center; gap: 8px; }
.ps-cp-rgbrow { margin-top: 8px; justify-content: space-between; }
.ps-cp-rgbl { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 11px; font-weight: 700; }
.ps-cp-rgb { width: 46px; }
.ps-cp-prev { display: flex; width: 44px; height: 24px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); flex: 0 0 auto; }
.ps-cp-prev i { flex: 1; }
.ps-cp-hash { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.ps-cp-hex { width: 80px; text-align: left; font-family: var(--mono); text-transform: uppercase; }
.ps-cp-sub { margin: 12px 0 6px; font-size: 11px; color: var(--text-3); font-weight: 600; }
.ps-cp-recent { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.ps-cp-chip { aspect-ratio: 1; border: 0; padding: 0; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 0 0 1px rgba(0, 0, 0, .4); }
.ps-cp-chip:hover { transform: scale(1.1); }

/* ------------------------------------------------------------------ sheets */
.ps-sheet-layer { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(6, 7, 10, .5); animation: ps-fade .15s ease-out; }
@keyframes ps-fade { from { opacity: 0; } }
.ps-sheet {
  width: min(420px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 14px; background: var(--ps-sheet); color: var(--text);
  box-shadow: var(--ps-shadow); animation: ps-pop .18s var(--ease, ease-out);
}
.ps-sheet-wide { width: min(720px, 100%); }
.ps-sheet-xl { width: min(960px, 100%); }
.ps-sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 6px 18px; }
.ps-sheet-head .ic { color: var(--accent); }
.ps-sheet-head h2 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.ps-sheet-body { padding: 8px 18px 6px; overflow-y: auto; min-height: 0; }
.ps-sheet-actions { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; flex-wrap: wrap; }
.ps-form { display: flex; flex-direction: column; gap: 12px; }
.ps-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ps-field-l { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.ps-in { height: 32px; width: 100%; background: var(--ps-well); }
.ps-in[type="number"] { width: 110px; }
.ps-custom-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.ps-custom-row .ps-ib { margin-bottom: 2px; }
.ps-unit { color: var(--text-3); padding-bottom: 8px; }
.ps-sub { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 4px 0 8px; }
.ps-openwrap .ps-picgrid { max-height: 360px; overflow-y: auto; }
.ps-anchor { display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; }
.ps-anchor button { width: 26px; height: 26px; border: 0; border-radius: 5px; background: var(--ps-well); box-shadow: inset 0 0 0 1px var(--line-2); }
.ps-anchor button.on { background: var(--accent); box-shadow: none; }
.ps-bgchoose { display: flex; align-items: center; gap: 8px; }
.ps-colorin { width: 30px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.ps-colorin::-webkit-color-swatch-wrapper { padding: 2px; }
.ps-colorin::-webkit-color-swatch { border: 0; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.ps-keys { display: flex; flex-direction: column; gap: 10px; }
.ps-keyrow { display: grid; grid-template-columns: 90px 1fr; gap: 12px; line-height: 1.5; color: var(--text-2); }
.ps-keyrow b { color: var(--text); }

/* gradient editor */
.ps-ge-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.ps-ge-preset { height: 30px; border: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.ps-ge-preset:hover { box-shadow: 0 0 0 2px var(--accent); }
.ps-ge-wrap { position: relative; padding: 0 8px; }
.ps-ge-bar { height: 34px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); cursor: copy; }
.ps-ge-stops { position: relative; height: 22px; }
.ps-ge-stop { position: absolute; top: 4px; width: 14px; height: 16px; margin-left: -7px; border: 0; padding: 0; border-radius: 3px 3px 4px 4px; box-shadow: 0 0 0 2px var(--surface-3), 0 0 0 3px rgba(0, 0, 0, .4); touch-action: none; cursor: ew-resize; }
.ps-ge-stop::before { content: ''; position: absolute; left: 3px; top: -6px; border: 4px solid transparent; border-bottom-color: var(--text-2); border-top: 0; }
.ps-ge-stop.on { box-shadow: 0 0 0 2px var(--accent), 0 0 0 3px rgba(0, 0, 0, .4); }
.ps-ge-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; }
.ps-ge-edit .ps-adj-lbl { margin-left: 4px; }

/* export */
.ps-exp { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; min-height: 0; }
.ps-exp-prev { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ps-exp-stage { height: 360px; overflow: auto; display: grid; place-items: center; border-radius: 10px; background: repeating-conic-gradient(#c7c9ce 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: inset 0 0 0 1px var(--line-2); }
.ps-exp-cv { display: block; }
.ps-exp-bar { display: flex; align-items: center; gap: 10px; }
.ps-exp-info { display: flex; align-items: baseline; gap: 10px; color: var(--text-2); }
.ps-exp-info b { color: var(--text); font-size: 14px; }
.ps-exp-spin { opacity: 0; width: 16px; height: 16px; }
.ps-exp-spin.on { opacity: 1; }
.ps-exp-side { min-width: 0; }

/* presets + picture grid (shared by start screen and sheets) */
.ps-newform { display: flex; flex-direction: column; gap: 16px; }
.ps-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ps-preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 11px 10px; border: 0; border-radius: 10px; text-align: left;
  background: var(--ps-well); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .12s, background .12s, transform .1s;
}
.ps-preset:hover { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .7); }
.ps-preset:active { transform: scale(.98); }
.ps-preset-art { width: 100%; height: 54px; display: grid; place-items: center; margin-bottom: 6px; }
.ps-preset-art i { display: block; border-radius: 3px; background: linear-gradient(140deg, rgba(var(--accent-rgb), .55), rgba(var(--accent-rgb), .15)); box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), .9); }
.ps-preset b { font-size: 12.5px; }
.ps-preset small { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ps-preset small.ps-preset-sub { color: var(--text-3); }
.ps-custom { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 10px; background: var(--ps-well); box-shadow: inset 0 0 0 1px var(--line); }
.ps-picgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ps-pic { display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; background: none; color: var(--text-2); text-align: left; min-width: 0; }
.ps-pic-art { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 1px rgba(0, 0, 0, .3); transition: transform .12s, box-shadow .12s; background-size: cover !important; }
.ps-pic:hover .ps-pic-art { box-shadow: 0 0 0 2px var(--accent); }
.ps-pic:hover { color: var(--text); }
.ps-pic-name { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-projlist { display: flex; flex-direction: column; gap: 4px; }
.ps-proj { display: flex; align-items: center; gap: 12px; padding: 6px; border: 0; border-radius: 9px; background: none; color: var(--text); text-align: left; min-width: 0; }
.ps-proj:hover { background: var(--hover); }
.ps-proj-art { width: 56px; height: 42px; flex: 0 0 auto; border-radius: 6px; background: var(--surface-3) center / cover no-repeat; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); display: grid; place-items: center; font: 700 11px/1 var(--font); color: #fff; }
.ps-proj-psd { background: linear-gradient(140deg, #0b3a6e, #1677d2); }
.ps-proj-meta { display: flex; flex-direction: column; min-width: 0; }
.ps-proj-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-proj-meta small { font-size: 11.5px; color: var(--text-3); }
.ps-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 10px; color: var(--text-3); text-align: center; }
.ps-empty b { color: var(--text); }

/* ------------------------------------------------------------------ start screen */
.ps-start {
  flex: 1; min-height: 0; overflow-y: auto; padding: 26px 28px 30px;
  background: radial-gradient(900px 400px at 15% -10%, rgba(34, 211, 238, .12), transparent 70%), radial-gradient(700px 400px at 100% 0%, rgba(30, 58, 138, .3), transparent 70%), var(--ps-chrome);
}
.ps-start-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.ps-start-head { display: flex; align-items: center; gap: 14px; }
.ps-start-head h1 { margin: 0; font: 700 24px/1.15 var(--font-display); letter-spacing: -.01em; }
.ps-start-head p { margin: 3px 0 0; color: var(--text-2); font-size: 13.5px; }
.ps-start-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.ps-start-card { padding: 18px; border-radius: 14px; background: var(--ps-card); box-shadow: var(--ps-shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ps-start-card h2 { margin: 0; font-size: 14px; font-weight: 700; }
.ps-start-card .ps-h2-gap { margin-top: 6px; }
.ps-start-row { display: flex; align-items: center; gap: 8px; }
.ps-start-actions { display: flex; justify-content: flex-end; }
.ps-start .ps-picgrid { max-height: 268px; overflow-y: auto; padding: 2px; }
.ps-drophint { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; color: var(--text-3); font-size: 12px; }

/* drag & drop + busy */
.ps-drop::after {
  content: 'Drop to open'; position: absolute; inset: 10px; z-index: 50; display: grid; place-items: center; border-radius: 14px;
  border: 2px dashed var(--accent); background: rgba(var(--accent-rgb), .12); color: var(--text); font-weight: 700; font-size: 16px; pointer-events: none;
}
.ps-has-doc.ps-drop::after { content: 'Drop to add as a layer'; }
.ps-busy::before {
  content: ''; position: absolute; left: 50%; top: 50%; z-index: 60; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 3px solid rgba(127, 127, 127, .25); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
.ps-busy[data-busy]:not([data-busy=""])::after {
  content: attr(data-busy); position: absolute; left: 50%; top: calc(50% + 26px); z-index: 60; transform: translateX(-50%); padding: 4px 10px; border-radius: 8px;
  background: var(--ps-card); color: var(--text); font-weight: 600; box-shadow: var(--ps-shadow); white-space: nowrap;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ps-scrim { display: none; }

/* ------------------------------------------------------------------ compact / phone layout */
.ps-compact .ps-main { flex-direction: column-reverse; }
.ps-compact .ps-rail {
  width: auto; height: 52px; flex-direction: row; padding: 0 8px; gap: 8px; overflow-x: auto; overflow-y: hidden;
  border-right: 0; border-top: 1px solid var(--ps-edge); padding-bottom: env(safe-area-inset-bottom, 0);
}
.ps-compact .ps-tools { flex-direction: row; gap: 2px; }
.ps-compact .ps-tool { width: 40px; height: 40px; }
.ps-compact .ps-rail-sep { width: 1px; height: 22px; margin: 0 3px; }
.ps-compact .ps-swatches { margin: 0 0 0 auto; height: 38px; flex: 0 0 38px; }
.ps-compact .ps-drawer-btn { display: grid; }
.ps-compact .ps-menu-btn { display: grid; }
.ps-compact .ps-opt-tool span { display: none; }
.ps-compact .ps-opt-tool { padding-right: 8px; }
.ps-compact .ps-range-sm { width: 70px; }
.ps-compact .ps-panelgrip { display: none; }
.ps-compact .ps-panels {
  position: absolute; z-index: 20; right: 0; top: 0; bottom: 52px; width: min(320px, 90%) !important;
  transform: translateX(105%); transition: transform .22s var(--ease, ease-out); box-shadow: -20px 0 40px rgba(0, 0, 0, .4);
}
.ps-compact.ps-drawer-open .ps-panels { transform: none; }
.ps-compact.ps-drawer-open .ps-scrim { display: block; position: absolute; inset: 0 0 52px 0; z-index: 19; background: rgba(0, 0, 0, .35); }
.ps-compact .ps-st-pos { display: none; }
.ps-compact .ps-adj { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 60%; }
.ps-compact .ps-fxwrap { grid-template-columns: 1fr; }
.ps-compact .ps-fxlist { flex-direction: row; flex-wrap: wrap; }
.ps-compact .ps-start { padding: 18px 14px 24px; }
.ps-compact .ps-start-cols { grid-template-columns: 1fr; }
.ps-compact .ps-presets { grid-template-columns: repeat(2, 1fr); }
.ps-compact .ps-picgrid { grid-template-columns: repeat(3, 1fr); }
.ps-compact .ps-sheet-layer { padding: 10px; align-items: end; }
.ps-compact .ps-sheet { max-height: calc(100% - 20px); }
.ps-compact .ps-exp { grid-template-columns: 1fr; }
.ps-compact .ps-exp-stage { height: 200px; }
.ps-compact .ps-docstate { display: none; }
.ps-compact .ps-docname { max-width: 150px; }
.ps-compact .ps-llist { max-height: 40vh; }

@media (prefers-reduced-motion: reduce) {
  .ps-adj, .ps-cp, .ps-sheet, .ps-sheet-layer { animation: none; }
  .ps-compact .ps-panels { transition: none; }
}
.ps-check.ps-adj-row { flex-direction: row; align-items: center; }
.ps-pgrid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ps-pgrid4 .ps-field-l { font-size: 10.5px; }
.ps-pgrid4 .ps-in { height: 26px; width: 100%; padding: 0 6px; font-size: 12px; }
.ps-pgrid4 .ps-pval { height: 26px; font-size: 12px; }
.ps-pbody { overflow-y: auto; }
.ps-pb-props { max-height: 42vh; }
.ps-pb-layers { overflow: visible; }
.ps-pb-color, .ps-pb-swatches, .ps-pb-brushes, .ps-pb-adjust { max-height: 34vh; }
.ps-pb-history { max-height: 26vh; }
.ps-start .ps-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
