@font-face{font-family:Kit Sans;src:url(vendor/fonts/sans.ttf)}@font-face{font-family:Kit Serif;src:url(vendor/fonts/serif.ttf)}@font-face{font-family:Kit Mono;src:url(vendor/fonts/mono.ttf)}:root{--bg:#21221d;--bg2:#272822;--panel:#2b2c26;--line:#404138;--text:#f5f3e8;--muted:#a5a699;--green:#a6e22e;--pink:#f92672;--cyan:#66d9ef}*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden}.photo-app{background:var(--bg);color:var(--text);font:14px var(--ui-font);display:grid;grid-template-rows:auto auto minmax(0,1fr)}button,input,select,textarea{font:inherit;color:inherit}button,select,input,textarea{border:1px solid var(--line);border-radius:5px;background:var(--bg);padding:7px 9px;min-width:0}button{cursor:pointer;white-space:nowrap}button:hover{border-color:var(--green);color:var(--green)}button:disabled{opacity:.35;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}.primary{background:var(--green);color:var(--accent-text,#162013);font-weight:bold}input[type=range]{accent-color:var(--green);padding:0;min-width:40px}input[type=color]{padding:2px;width:33px;height:27px}input[type=checkbox]{accent-color:var(--green)}.photo-header{display:flex;align-items:center;gap:12px;padding:11px 16px;border-bottom:1px solid var(--line);background:var(--panel);flex-wrap:wrap}.photo-brand{font-size:22px;letter-spacing:-1.2px;text-decoration:none;color:var(--text);white-space:nowrap}.photo-brand span{font-family:monospace;color:var(--green);margin-right:8px}.photo-header>input{width:160px;background:transparent;border-color:transparent}.photo-label{font:9px 'Kit Mono',monospace;letter-spacing:1px;color:var(--cyan);margin-right:auto}.header-buttons{display:flex;gap:5px;flex-wrap:wrap}.header-buttons button{font-size:11px}.photo-options{display:flex;gap:16px;align-items:center;padding:9px 16px;overflow:auto;border-bottom:1px solid var(--line);flex-wrap:wrap}.photo-options>strong{width:70px;color:var(--cyan);font-size:13px}.photo-options label{display:flex;align-items:center;gap:6px;font-size:11px;white-space:nowrap}.photo-options input[type=range]{width:78px}.photo-options output{min-width:20px;font:10px monospace;color:var(--muted)}.photo-body{display:grid;grid-template-columns:66px minmax(0,1fr) 276px;min-height:0}.photo-body>nav{border-right:1px solid var(--line);padding:12px 7px;display:flex;flex-direction:column;gap:7px;overflow:auto;background:var(--panel)}#photoTools button{display:grid;gap:3px;padding:9px 2px;text-align:center;font:18px 'Kit Mono',monospace;flex:none}#photoTools button small{font:8px var(--ui-font);color:var(--muted)}#photoTools [aria-pressed=true]{border-color:var(--cyan);color:var(--cyan);background:color-mix(in srgb,var(--cyan) 12%,var(--bg))}.photo-center{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0}.canvas-toolbar{display:flex;gap:5px;align-items:center;flex-wrap:wrap;padding:8px 12px;border-bottom:1px solid var(--line);font-size:11px;background:var(--bg2)}.canvas-toolbar button{padding:5px 8px;font-size:11px}#photoZoom{width:60px;padding:5px}#canvasDimensions{margin-left:auto;color:var(--muted);font:10px monospace}#photoViewport{position:relative;overflow:hidden;background:color-mix(in srgb,var(--bg) 70%,#101114);touch-action:none;outline:none}#canvasHolder{position:absolute;left:0;top:0;transform-origin:0 0;box-shadow:0 8px 40px #0006;line-height:0}#photoCanvas{background-color:#ccc;background-image:linear-gradient(45deg,#aaa 25%,transparent 25%),linear-gradient(-45deg,#aaa 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#aaa 75%),linear-gradient(-45deg,transparent 75%,#aaa 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0}#photoOverlay{position:absolute;left:0;top:0;touch-action:none;user-select:none;-webkit-user-drag:none}.photo-status{display:flex;gap:16px;justify-content:space-between;padding:7px 12px;border-top:1px solid var(--line);font-size:10px;color:var(--muted);background:var(--panel);min-height:28px}#photoStatus{overflow-wrap:anywhere}.photo-inspector{border-left:1px solid var(--line);background:var(--panel);overflow-y:auto;overflow-x:hidden;font-size:11px}.photo-inspector section{padding:12px;border-bottom:1px solid var(--line)}h2{font-size:14px;font-weight:500;margin:0 0 12px}.panel-heading{display:flex;justify-content:space-between;align-items:center}.panel-heading h2{margin:0}.layer-actions{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}.layer-actions button{font-size:10px;padding:5px 7px}#photoLayers{max-height:240px;min-height:80px;overflow-y:auto;margin-top:12px;display:grid;gap:5px}.photo-layer{display:flex;align-items:center;gap:5px;padding:5px;border:1px solid var(--line);border-radius:5px;background:var(--bg2)}.photo-layer.active{border-color:var(--cyan)}.photo-layer>button{border:0;background:transparent;padding:3px;min-width:22px}.photo-layer>button.layer-select{flex:1;min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere;font-size:11px}.photo-layer canvas{width:32px;height:28px;object-fit:contain;background:#7773}.photo-layer.drag-over{border-top:3px solid var(--green)}.photo-inspector label,dialog label{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0}.photo-inspector label>input:not([type=checkbox]),.photo-inspector select{width:58%;font-size:11px}.photo-inspector label:has(textarea){display:block}.photo-inspector textarea{width:100%;margin-top:6px}.photo-inspector input[type=range]{width:60%}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.two-fields label{display:grid;gap:5px;margin:5px 0}.two-fields label>input{width:100%!important}details{border-top:1px solid var(--line);margin-top:12px;padding-top:10px}summary{cursor:pointer;color:var(--cyan);padding:3px 0}p{color:var(--muted);line-height:1.7}.photo-inspector p{font-size:10px}dialog{color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:28px;width:min(520px,calc(100vw - 24px));max-height:85dvh;overflow:auto;font-size:13px;line-height:1.7}dialog::backdrop{background:#000a;backdrop-filter:blur(5px)}dialog h2{font-size:24px;margin:12px 0 20px}dialog a{color:var(--cyan)}dialog li{margin:12px 0}dialog .close{position:absolute;top:8px;right:10px;border:0;background:transparent;font-size:24px}#photoHelpDialog{width:min(690px,calc(100vw - 24px))}[hidden]{display:none!important}@media(max-width:1100px){.photo-body{grid-template-columns:56px minmax(0,1fr) 220px}.photo-label{display:none}.photo-header{gap:8px}.photo-header>input{width:120px}.photo-options{gap:10px}}@media(max-width:700px){.photo-body{grid-template-columns:48px minmax(0,1fr) 180px}.photo-inspector section{padding:8px}.photo-header{padding:8px}.header-buttons button{font-size:10px;padding:5px}.photo-brand{font-size:18px}.photo-options label:nth-last-child(-n+3){display:none}.photo-status{font-size:9px}.canvas-toolbar button{font-size:10px;padding:4px}.photo-body>nav{padding:8px 3px}#photoTools button{font-size:16px}.layer-actions button{font-size:9px;padding:4px}#photoSaveState{display:none}}
.mobile-ui.photo-app{height:var(--app-height,100dvh);grid-template-rows:56px minmax(0,1fr);font-size:14px}.mobile-ui.photo-app .photo-header{height:56px;min-height:56px;flex-wrap:nowrap;padding:4px max(8px,env(safe-area-inset-left));gap:4px}.mobile-ui.photo-app .photo-brand{font-size:19px;flex:1;min-width:0;white-space:nowrap}.mobile-ui.photo-app .photo-brand>span{font-size:17px;margin-right:3px}.mobile-ui.photo-app .photo-label,.mobile-ui.photo-app .photo-header>#documentName{display:none}.mobile-ui.photo-app .header-buttons{flex:none;gap:3px;flex-wrap:nowrap}.mobile-ui.photo-app .header-buttons>button{display:none!important}.mobile-ui.photo-app .header-buttons>#undoPhoto,.mobile-ui.photo-app .header-buttons>#redoPhoto,.mobile-ui.photo-app .header-buttons>#exportPhoto,.mobile-ui.photo-app .header-buttons>#photoMobileMenuButton{display:inline-flex!important;align-items:center;justify-content:center;min-width:38px;min-height:44px;padding:5px;font-size:17px}.mobile-ui.photo-app .header-buttons>#exportPhoto{font-size:12px}.mobile-ui.photo-app .photo-body{grid-row:2;grid-column:1;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 64px calc(56px + env(safe-area-inset-bottom));min-height:0}.mobile-ui.photo-app .photo-center{grid-row:1;grid-column:1;min-height:0;min-width:0}.mobile-ui.photo-app .canvas-toolbar{height:48px;min-height:48px;flex-wrap:nowrap;overflow:auto;padding:2px 6px;gap:4px;white-space:nowrap}.mobile-ui.photo-app .canvas-toolbar button{min-width:38px;min-height:44px;font-size:13px;padding:4px 8px}.mobile-ui.photo-app #photoZoom{width:64px;min-height:40px;flex:none}.mobile-ui.photo-app #resizePhoto,.mobile-ui.photo-app #cropSelection,.mobile-ui.photo-app #clearSelection{display:none}.mobile-ui.photo-app #canvasDimensions{font-size:10px}.mobile-ui.photo-app .photo-status{min-height:28px;font-size:10px;max-height:42px;overflow:auto}.mobile-ui.photo-app .photo-body>#photoTools{grid-row:2;grid-column:1;display:flex;flex-direction:row;height:64px;gap:5px;padding:5px 6px;border-right:0;border-top:1px solid var(--line);overflow-x:auto;overflow-y:hidden;z-index:90;touch-action:pan-x;overscroll-behavior:contain}.mobile-ui.photo-app #photoTools button{min-width:54px;min-height:52px;padding:4px;font-size:20px}.mobile-ui.photo-app #photoTools small{font-size:10px}.mobile-ui.photo-app .photo-mobile-dock{grid-row:3;grid-column:1;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;padding:0 4px env(safe-area-inset-bottom);margin:0;background:var(--panel);border-top:1px solid var(--line);z-index:90}.mobile-ui.photo-app .photo-mobile-dock button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-size:19px;min-width:0;min-height:52px;border:0;background:transparent}.mobile-ui.photo-app .photo-mobile-dock span{font-size:10px}.mobile-ui.photo-app .photo-mobile-dock [aria-pressed=true]{color:var(--cyan);background:color-mix(in srgb,var(--cyan) 10%,var(--panel))}.mobile-ui.photo-app .photo-inspector{display:none;position:fixed;left:auto;right:0;top:56px;bottom:calc(120px + env(safe-area-inset-bottom));height:auto;width:min(94vw,390px);max-width:100%;z-index:80;box-shadow:-10px 0 35px #0007}.mobile-ui.photo-app[data-photo-panel=layers] .photo-inspector,.mobile-ui.photo-app[data-photo-panel=properties] .photo-inspector{display:block}.mobile-ui.photo-app[data-photo-panel=layers] #layerProperties,.mobile-ui.photo-app[data-photo-panel=layers] .selection-actions{display:none}.mobile-ui.photo-app .photo-inspector section{padding:14px}.mobile-ui.photo-app .photo-inspector h2{font-size:16px}.mobile-ui.photo-app .photo-inspector button{min-width:40px;min-height:44px;font-size:13px}.mobile-ui.photo-app .photo-inspector .panel-heading>button[data-photo-panel-close]{margin-left:auto;font-size:24px}.mobile-ui.photo-app .photo-inspector label{font-size:14px}.mobile-ui.photo-app .photo-inspector input:not([type=range]):not([type=checkbox]),.mobile-ui.photo-app .photo-inspector select{min-height:44px}.mobile-ui.photo-app .photo-inspector input[type=range]{height:32px}.mobile-ui.photo-app #photoLayers{max-height:none;overflow:auto}.mobile-ui.photo-app .photo-layer{min-height:60px;padding:6px}.mobile-ui.photo-app .photo-layer>button.layer-select{font-size:14px}.mobile-ui.photo-app .photo-layer canvas{width:40px;height:36px}.mobile-ui.photo-app .photo-options{display:none;position:fixed;left:0;right:0;bottom:calc(120px + env(safe-area-inset-bottom));max-height:65dvh;overflow:auto;z-index:80;background:var(--panel);padding:14px;box-shadow:0 -10px 35px #0007}.mobile-ui.photo-app[data-photo-panel=brush] .photo-options{display:flex;flex-wrap:wrap;gap:14px}.mobile-ui.photo-app .photo-options>strong{font-size:16px}.mobile-ui.photo-app .photo-options>button{margin-left:auto;min-width:44px;min-height:44px;font-size:24px}.mobile-ui.photo-app .photo-options label,.mobile-ui.photo-app .photo-options label:nth-last-child(-n+3){display:flex;font-size:14px;min-height:44px;flex:1 1 44%;white-space:normal;gap:8px}.mobile-ui.photo-app .photo-options input[type=range]{width:100%;min-width:50px;max-width:150px;height:32px}.mobile-ui.photo-app .photo-panel-shade:not([hidden]){display:block!important;position:fixed;inset:56px 0 calc(120px + env(safe-area-inset-bottom));z-index:70;background:#0008;border:0;border-radius:0}.mobile-ui.photo-app .photo-panel-shade[hidden]{display:none!important}.mobile-ui.photo-app #photoMobileMenu label{display:grid;gap:8px}.mobile-ui.photo-app #photoMobileMenu .mobile-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:16px}
@media(orientation:landscape) and (max-height:560px){.mobile-ui.photo-app{grid-template-rows:48px minmax(0,1fr)}.mobile-ui.photo-app .photo-header{height:48px;min-height:48px}.mobile-ui.photo-app .photo-body{grid-template-columns:62px minmax(0,1fr);grid-template-rows:minmax(0,1fr) calc(48px + env(safe-area-inset-bottom))}.mobile-ui.photo-app .photo-body>#photoTools{grid-row:1;grid-column:1;flex-direction:column;height:auto;overflow-y:auto;overflow-x:hidden;border-right:1px solid var(--line);touch-action:pan-y}.mobile-ui.photo-app .photo-center{grid-row:1;grid-column:2}.mobile-ui.photo-app #photoTools button{min-width:44px;min-height:50px}.mobile-ui.photo-app .photo-mobile-dock{grid-row:2;grid-column:1/-1}.mobile-ui.photo-app .photo-mobile-dock button{min-height:44px;flex-direction:row;gap:7px}.mobile-ui.photo-app .photo-inspector{top:48px;bottom:calc(48px + env(safe-area-inset-bottom))}.mobile-ui.photo-app .photo-options{bottom:calc(48px + env(safe-area-inset-bottom))}.mobile-ui.photo-app .photo-panel-shade{inset:48px 0 calc(48px + env(safe-area-inset-bottom))}.mobile-ui.photo-app .canvas-toolbar{height:44px;min-height:44px}.mobile-ui.photo-app .photo-status{min-height:24px}}
.mobile-ui.photo-app .photo-inspector{height:calc(var(--app-height,100dvh) - 176px - env(safe-area-inset-bottom));bottom:auto}.mobile-ui.photo-app .photo-panel-shade:not([hidden]){height:calc(var(--app-height,100dvh) - 176px - env(safe-area-inset-bottom));bottom:auto}.mobile-ui.photo-app .photo-options{bottom:auto;top:56px;max-height:calc(var(--app-height,100dvh) - 176px - env(safe-area-inset-bottom))}@media(orientation:landscape) and (max-height:560px){.mobile-ui.photo-app .photo-inspector{height:calc(var(--app-height,100dvh) - 96px - env(safe-area-inset-bottom))}.mobile-ui.photo-app .photo-panel-shade:not([hidden]){height:calc(var(--app-height,100dvh) - 96px - env(safe-area-inset-bottom))}.mobile-ui.photo-app .photo-options{top:48px;max-height:calc(var(--app-height,100dvh) - 96px - env(safe-area-inset-bottom))}}

.photo-slider-inputs{display:inline-flex;align-items:center;gap:6px;min-width:0}.photo-slider-inputs input[type=range]{flex:1;min-width:45px}.photo-slider-inputs input[type=number]{width:65px;min-width:65px;padding:6px}.brush-preview{margin:0;flex:0 0 240px;max-width:100%;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--bg2)}.brush-preview canvas{display:block;width:100%;height:90px;background-color:var(--bg);background-image:conic-gradient(#8883 25%,transparent 0 50%,#8883 0 75%,transparent 0);background-size:16px 16px;border-radius:4px}.brush-preview figcaption{font-size:10px;color:var(--muted);line-height:1.4;margin:5px 0}.brush-preview label{font-size:11px;display:flex;gap:5px}.brush-preview .photo-slider-inputs{flex:1}.view-rotation{display:flex;align-items:center;gap:4px;white-space:nowrap}#photoViewRotation{width:64px}#photoViewport{touch-action:none;overscroll-behavior:contain}
.mobile-ui.photo-app .photo-options label.photo-range-field{flex:1 1 100%;display:flex;flex-wrap:wrap;min-width:0;gap:6px}.mobile-ui.photo-app .photo-range-field .photo-slider-inputs{width:100%;display:flex}.mobile-ui.photo-app .photo-slider-inputs input[type=number]{width:76px;min-width:76px;min-height:44px;font-size:16px}.mobile-ui.photo-app .photo-options .photo-slider-inputs input[type=range]{max-width:none;min-height:44px}.mobile-ui.photo-app .brush-preview{flex:1 1 100%;order:2;width:100%;padding:10px}.mobile-ui.photo-app .brush-preview canvas{height:120px}.mobile-ui.photo-app .brush-preview figcaption{font-size:12px}.mobile-ui.photo-app .brush-preview label{display:flex;flex-wrap:wrap}.mobile-ui.photo-app .photo-inspector .photo-range-field{display:flex;flex-wrap:wrap;gap:6px}.mobile-ui.photo-app .photo-inspector .photo-range-field .photo-slider-inputs{flex:1 1 100%}.mobile-ui.photo-app .canvas-toolbar .view-rotation{font-size:12px}.mobile-ui.photo-app #photoViewRotation{min-height:40px;width:60px}.mobile-ui.photo-app .photo-options{scroll-padding:14px;overscroll-behavior:contain}.mobile-ui.photo-app .photo-options>button[data-photo-panel-close]{position:sticky;top:0;background:var(--panel);z-index:2}

.mobile-ui.photo-app .photo-options>strong{order:-3;flex:1}.mobile-ui.photo-app .photo-options>button[data-photo-panel-close]{order:-3}.mobile-ui.photo-app .brush-preview{order:-2;position:relative;z-index:1}.mobile-ui.photo-app .brush-preview canvas{height:90px}.mobile-ui.photo-app .photo-options{align-content:flex-start}.mobile-ui.photo-app .photo-options>label:has(input[type=checkbox]){flex:1 1 44%}

/* Desktop brush controls occupy a single row; small windows can scroll it horizontally. */
.photo-app:not(.mobile-ui) .photo-options{flex-wrap:nowrap;height:58px;min-height:58px;padding:5px 10px;gap:10px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.photo-app:not(.mobile-ui) .photo-options>*{flex-shrink:0}.photo-app:not(.mobile-ui) .photo-options>strong{width:auto;min-width:42px}.photo-app:not(.mobile-ui) .photo-options label{white-space:nowrap;gap:5px;font-size:11px}.photo-app:not(.mobile-ui) .photo-options input[type=range]{width:62px;min-width:40px}.photo-app:not(.mobile-ui) .photo-options .photo-slider-inputs input[type=number]{width:48px;min-width:48px;padding:4px;font-size:11px}
.photo-app:not(.mobile-ui) .brush-preview{display:grid;grid-template-columns:108px 148px;grid-template-rows:18px 22px;gap:0 6px;align-items:center;flex:0 0 270px;width:270px;max-width:none;height:46px;padding:2px 4px;border-radius:5px}
.photo-app:not(.mobile-ui) .brush-preview canvas{grid-column:1;grid-row:1/3;width:108px;height:40px}.photo-app:not(.mobile-ui) .brush-preview figcaption{grid-column:2;grid-row:1;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:9px;line-height:16px}.photo-app:not(.mobile-ui) .brush-preview label{grid-column:2;grid-row:2;min-width:0;font-size:9px;gap:3px}.photo-app:not(.mobile-ui) .brush-preview .photo-slider-inputs{gap:3px;min-width:0}.photo-app:not(.mobile-ui) .brush-preview input[type=range]{width:30px;min-width:20px}.photo-app:not(.mobile-ui) .brush-preview .photo-slider-inputs input[type=number]{width:34px;min-width:34px;padding:2px;font-size:10px;height:22px}
#canvasHolder{will-change:transform;backface-visibility:hidden}.mobile-ui.photo-app #resetPhotoView{display:inline-flex;align-items:center;justify-content:center;text-align:center;align-self:center;flex:0 0 auto;line-height:1;height:40px;min-height:40px;margin:0;padding:0 10px}

.photo-project-rail{background:var(--bg2);border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.photo-project-heading{display:flex;align-items:center;gap:5px;padding:6px}.photo-project-heading strong{font-size:12px;min-width:0;flex:1}.photo-project-heading button{padding:5px 7px}.photo-project-heading span{color:var(--muted);font-size:10px}.photo-project-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1;padding:6px}.photo-project-content input{width:100%;font-size:12px}.photo-project-toolbar{display:flex;gap:5px}.photo-project-toolbar button{flex:1;font-size:11px;padding:7px 3px}#photoProjectList{overflow:auto;min-height:0;flex:1;display:flex;flex-direction:column;gap:8px}.photo-project{border:1px solid var(--line);border-radius:6px;background:var(--panel);flex:none;overflow:hidden}.photo-project.active{border-color:var(--cyan)}.photo-project-open{width:100%;display:flex;align-items:center;gap:6px;text-align:left;border:0;border-radius:0;padding:6px}.photo-project-open img{width:48px;height:36px;object-fit:contain;background:var(--bg)}.photo-project-open span{min-width:0;flex:1}.photo-project-open b{font-size:11px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.photo-project-open small{font-size:9px;color:var(--muted);display:block;white-space:normal;line-height:1.5}.photo-project-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;padding:4px}.photo-project-actions button{font-size:10px;padding:5px 2px}.photo-project-content>.hint{font-size:10px;line-height:1.5;margin:0;color:var(--muted)}.photo-app:not(.mobile-ui).photo-projects-collapsed .photo-project-content,.photo-app:not(.mobile-ui).photo-projects-collapsed .photo-project-heading strong{display:none}.photo-project-rail .mobile-only{display:none!important}

.mobile-ui.photo-app .photo-project-rail{display:none;position:fixed;left:0;top:56px;width:min(94vw,360px);height:calc(var(--app-height,100dvh) - 176px - env(safe-area-inset-bottom));z-index:80;box-shadow:10px 0 30px #0007}.mobile-ui.photo-app[data-photo-panel=projects] .photo-project-rail{display:flex}.mobile-ui.photo-app .photo-project-rail .mobile-only{display:inline-flex!important}.mobile-ui.photo-app .photo-project-heading strong{font-size:16px}.mobile-ui.photo-app .photo-project-heading button,.mobile-ui.photo-app .photo-project-actions button,.mobile-ui.photo-app .photo-project-toolbar button{min-height:44px;min-width:40px;font-size:13px}.mobile-ui.photo-app .photo-project-open{min-height:64px}.mobile-ui.photo-app .photo-project-open b{font-size:14px}.mobile-ui.photo-app .photo-project-open small{font-size:11px}.mobile-ui.photo-app .photo-project-open img{width:64px;height:48px}.mobile-ui.photo-app .photo-mobile-dock{grid-template-columns:repeat(6,minmax(0,1fr))}.mobile-ui.photo-app .photo-project-content input{min-height:44px;font-size:16px}#photoRenameDialog label{display:grid;gap:8px;margin-bottom:16px}.mobile-ui .layer-actions{flex-wrap:wrap}.mobile-ui #addPhotoLayer{font-size:13px}
@media(orientation:landscape) and (max-height:560px){.mobile-ui.photo-app .photo-project-rail{top:48px;height:calc(var(--app-height,100dvh) - 96px - env(safe-area-inset-bottom))}.mobile-ui.photo-app .photo-mobile-dock button{gap:3px}.mobile-ui.photo-app .photo-mobile-dock span{font-size:10px}}

#photoBrushCursor{position:fixed;z-index:80;pointer-events:none;border:1px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #000b;box-sizing:border-box;will-change:transform,left,top}#photoBrushCursor[hidden]{display:none}#photoBrushCursor[data-tool=eraser]{border-style:dashed}

.photo-app:not(.mobile-ui) .photo-options #brushSize{width:160px;min-width:160px}.mobile-ui.photo-app .photo-options #brushSize{min-width:160px;width:100%;max-width:none}

/* Independent layers / properties panes and canvas editing controls. */
.photo-inspector{display:flex;flex-direction:column;overflow:hidden!important;padding:0!important;gap:0}.photo-inspector>.layer-section{flex:0 0 var(--photo-layers-height,32%);min-height:110px;overflow:auto;padding:12px}.photo-inspector>#layerProperties{flex:1;min-height:0;overflow:auto;padding:12px}.photo-inspector>.selection-actions{flex:0 0 auto;max-height:130px;overflow:auto;padding:8px 12px;border-top:1px solid var(--line)}.photo-pane-divider{height:7px;flex:none;cursor:ns-resize;background:var(--line);touch-action:none}.photo-pane-divider:hover{background:var(--cyan)}.text-toggle-row{display:flex;flex-wrap:wrap;gap:6px 12px}.photo-inspector label:has(>input[type=checkbox]){display:flex!important;flex-direction:row!important;align-items:center;justify-content:flex-start;gap:7px}.photo-inspector label>input[type=checkbox]{width:auto!important;margin:0;flex:none}.photo-bottom-zoom{display:flex;align-items:center;gap:6px;flex:none;font-size:11px}.photo-bottom-zoom input{width:100px;accent-color:var(--cyan)}.photo-bottom-zoom output{min-width:35px}.photo-status{align-items:center}.photo-status>#photoStatus{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.photo-inline-text{position:absolute;z-index:5;resize:none;padding:8px;border:2px solid #66d9ef;background:#1115;outline:0;line-height:1.25;overflow:hidden;min-width:80px;max-width:none}.photo-context-menu{position:fixed;z-index:10000;width:190px;padding:7px;border:1px solid var(--line);border-radius:9px;background:var(--panel);box-shadow:0 12px 40px #0008}.photo-context-menu[hidden]{display:none}.photo-context-menu button{display:block;width:100%;text-align:left;padding:9px;border:0;background:none;color:var(--text)}.photo-context-menu button:hover{background:var(--bg)}
@media(max-width:900px){.photo-pane-divider{display:none}.photo-inspector>.layer-section,.photo-inspector>#layerProperties{flex:1;max-height:none}.photo-bottom-zoom input{width:72px}.photo-bottom-zoom{font-size:10px}.photo-status>#photoSaveState{display:none}.text-toggle-row label{min-height:38px}.photo-inspector .layer-actions button{min-height:38px}.photo-inline-text{font-size:max(16px,1em)}}
.mobile-ui.photo-app .photo-inspector{display:none;overflow:hidden!important}.mobile-ui.photo-app[data-photo-panel=layers] .photo-inspector,.mobile-ui.photo-app[data-photo-panel=properties] .photo-inspector{display:flex}.mobile-ui.photo-app .photo-inspector>.layer-section{min-height:0;flex:1;overflow:auto}.mobile-ui.photo-app .photo-inspector>#layerProperties{flex:1;overflow:auto}.mobile-ui.photo-app .photo-mobile-dock{grid-template-columns:repeat(6,minmax(0,1fr))}.mobile-ui.photo-app .photo-bottom-zoom .photo-slider-inputs{display:flex}.mobile-ui.photo-app #photoZoomSliderNumber{display:none}.photo-status #photoZoomSliderNumber{display:none}

#photoLayerRotate{position:absolute;z-index:6;width:32px;height:32px;border:1px solid var(--cyan);border-radius:50%;background:var(--panel);color:var(--cyan);font-size:22px;line-height:1;padding:0;transform:translate(-50%,-50%);cursor:grab;touch-action:none;box-shadow:0 2px 8px #0005}#photoLayerRotate[hidden]{display:none}#photoLayerRotate:active{cursor:grabbing}@media(pointer:coarse){#photoLayerRotate{width:40px;height:40px}}

/* Keep every tool tile square, independently of its label or rail orientation. */
#photoTools{--photo-tool-size:48px;align-items:center}
#photoTools button,.mobile-ui.photo-app #photoTools button{width:var(--photo-tool-size);height:var(--photo-tool-size);min-width:var(--photo-tool-size);min-height:var(--photo-tool-size);max-width:var(--photo-tool-size);max-height:var(--photo-tool-size);aspect-ratio:1;flex:0 0 auto;grid-template-rows:20px auto;align-content:center;justify-items:center;gap:2px;padding:3px 1px;line-height:1;overflow:hidden}
#photoTools button small,.mobile-ui.photo-app #photoTools button small{max-width:100%;white-space:normal;line-height:1.05;font-size:8px}
.mobile-ui.photo-app #photoTools{--photo-tool-size:52px}
.mobile-ui.photo-app #photoTools button small{font-size:9px}
@media(orientation:landscape) and (max-height:560px){.mobile-ui.photo-app #photoTools{--photo-tool-size:48px}}

/* The rail scrolls vertically; padding and scrollbars never push tiles sideways. */
.photo-app .photo-body>#photoTools{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px 3px;scrollbar-width:thin;scrollbar-gutter:stable;overscroll-behavior:contain;touch-action:pan-y}
#photoTools button,.mobile-ui.photo-app #photoTools button{width:100%;max-width:var(--photo-tool-size);min-width:0;height:auto;min-height:0;max-height:none;aspect-ratio:1}
.mobile-ui.photo-app .photo-body>#photoTools{display:grid;grid-template-columns:repeat(auto-fit,minmax(52px,1fr));grid-auto-rows:52px;align-content:start;justify-items:center;gap:5px;padding:5px 6px}
@media(orientation:landscape) and (max-height:560px){.mobile-ui.photo-app .photo-body{grid-template-columns:64px minmax(0,1fr)}.mobile-ui.photo-app .photo-body>#photoTools{display:flex;flex-direction:column;padding:5px 3px}}
.photo-pixel-palette{position:absolute;left:12px;bottom:12px;display:flex;flex-wrap:wrap;gap:4px;max-width:280px;padding:7px;background:var(--panel);border:1px solid var(--border);border-radius:8px;z-index:8}.photo-pixel-palette[hidden]{display:none}.photo-pixel-palette button{width:26px;height:26px;min-width:0;min-height:0;padding:0;border:1px solid #888}.photo-sprite-dialog{width:min(640px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto}.sprite-order{max-height:200px;overflow:auto}.sprite-order .row{display:flex;gap:8px;align-items:center;margin:5px 0}.sprite-order span{flex:1}.sprite-preview{display:block;image-rendering:pixelated;width:128px;height:128px;object-fit:contain;margin:12px auto;background:repeating-conic-gradient(#444 0 25%,#333 0 50%) 0/12px 12px}

.photo-scale-handle{position:absolute;z-index:4;width:24px;height:24px;min-width:24px;padding:0;border:0;background:transparent;transform:translate(-50%,-50%);touch-action:none}.photo-scale-handle::after{content:"";position:absolute;inset:6px;border:1px solid #21221d;background:var(--cyan);box-shadow:0 0 0 1px #fff}.photo-scale-handle:focus-visible{outline:2px solid var(--cyan)}.canvas-toolbar .transform-snap{display:flex;align-items:center;gap:4px;white-space:nowrap}.mobile-ui.photo-app .brush-preview{order:0}.mobile-ui.photo-app .photo-options>label:has(#paintColor),.mobile-ui.photo-app .photo-options>label:has(#brushSize){order:0}

.canvas-toolbar label.transform-snap{display:inline-flex;align-items:center;gap:6px;margin:0 4px 0 0;flex:none}.canvas-toolbar .transform-snap input[type=checkbox]{margin:0;flex:none}.canvas-toolbar .grid-snap-size{display:inline-flex;align-items:center;gap:5px;margin-right:8px;flex:none}.grid-snap-size input{width:62px;padding:5px}.mobile-ui.photo-app .grid-snap-size input{min-height:40px}

.photo-layer{display:grid;grid-template-columns:24px 26px minmax(0,1fr) repeat(4,24px);gap:2px;padding:3px}
.photo-layer>button.photo-layer-icon{width:100%;min-width:0;min-height:28px;padding:3px;display:grid;place-items:center}
.photo-layer-icon svg{width:16px;height:16px;pointer-events:none}
.photo-layer>button.layer-select{font-size:13px;line-height:1.25;padding:3px}
.photo-layer canvas,.mobile-ui.photo-app .photo-layer canvas{width:100%;height:auto}
.photo-layer-menu{width:max-content;max-width:calc(100vw - 16px);overflow:auto;max-height:calc(100dvh - 16px);zoom:1}
.photo-inspector>.selection-actions{max-height:min(55%,calc(var(--photo-mask-height,92px) + 110px))}
.photo-inspector>.selection-actions:has(.photo-mask-panel:not([open])){max-height:122px}
.photo-mask-panel summary{cursor:pointer;font-weight:600}
.photo-mask-body{height:var(--photo-mask-height,auto);max-height:var(--photo-mask-height,92px);overflow:auto}
.photo-mask-resize{height:12px;cursor:ns-resize;touch-action:none;display:grid;place-items:center}
.photo-mask-resize::after{content:"";width:24px;height:3px;border-radius:2px;background:var(--muted)}
.photo-mask-panel:not([open]) .photo-mask-resize{display:none}
.mobile-ui.photo-app .photo-layer{grid-template-columns:36px 28px minmax(0,1fr) repeat(4,36px);gap:2px}
.mobile-ui.photo-app .photo-layer>button.photo-layer-icon{min-width:0;min-height:44px}
.mobile-ui.photo-app .photo-layer>button.layer-select{min-width:0}
.photo-inline-text,.mobile-ui.photo-app .photo-inline-text{border:0;outline:1px solid var(--cyan);background:transparent;color:transparent;caret-color:var(--text-caret,#fff);line-height:1.25;min-width:0}
.photo-inline-text::placeholder{color:var(--muted)}
.photo-inline-text::selection{background:#66d9ef55;color:transparent}

@media(max-width:1100px){.photo-app:not(.mobile-ui) .photo-layer{grid-template-columns:22px 20px minmax(0,1fr) repeat(4,22px)}}

/* The sidebar shares a width. The two horizontal splitters divide its height. */
.photo-app:not(.mobile-ui) .photo-body{
 grid-template-columns:190px 64px minmax(0,1fr) min(var(--photo-inspector-width,250px),55vw)
}
.photo-app:not(.mobile-ui).photo-projects-collapsed .photo-body{
 grid-template-columns:34px 64px minmax(0,1fr) min(var(--photo-inspector-width,250px),55vw)
}
@media(max-width:1100px){
 .photo-app:not(.mobile-ui) .photo-body{
  grid-template-columns:165px 64px minmax(0,1fr) min(var(--photo-inspector-width,210px),55vw)
 }
 .photo-app:not(.mobile-ui).photo-projects-collapsed .photo-body{
  grid-template-columns:34px 64px minmax(0,1fr) min(var(--photo-inspector-width,210px),55vw)
 }
}
.photo-app:not(.mobile-ui) .photo-inspector{position:relative}
.photo-inspector{min-width:0;min-height:0;padding-left:9px!important}
.photo-inspector > .layer-section{flex:0 0 var(--photo-layers-height,32%);min-height:0}
.photo-inspector > #layerProperties{flex:1 1 0;min-height:0}
.photo-inspector > .selection-actions{
 flex:0 0 var(--photo-selection-height,auto);
 min-height:0;
 max-height:var(--photo-selection-height,min(42%,calc(var(--photo-mask-height,92px) + 110px)));
}
.photo-inspector > .selection-actions:has(.photo-mask-panel:not([open])){
 max-height:var(--photo-selection-height,122px)
}
.photo-inspector:has(#layerProperties[hidden]) > .layer-section{flex:1 1 0}
.photo-inspector:has(#layerProperties[hidden]) > #photoLayersSplitter{display:none}
.photo-pane-divider{display:block;height:9px;border-block:3px solid var(--panel);background:var(--line)}
.photo-inspector-splitter{
 position:absolute;inset:0 auto 0 0;width:9px;z-index:1;
 border-inline:3px solid var(--panel);background:var(--line);
 touch-action:none;cursor:ew-resize;
}
.photo-inspector-splitter:hover,.photo-inspector-splitter:focus-visible,.photo-pane-divider:focus-visible{
 background:var(--cyan)
}
.mobile-ui.photo-app .photo-inspector{width:min(94vw,var(--photo-inspector-width,390px))}
.mobile-ui.photo-app[data-photo-panel=properties] .photo-inspector > .layer-section{
 flex:0 0 var(--photo-layers-height,32%)
}
.mobile-ui.photo-app[data-photo-panel=properties] .photo-inspector > #layerProperties{flex:1 1 0}
.mobile-ui.photo-app[data-photo-panel=properties] .photo-inspector:has(#layerProperties[hidden]) > .layer-section,
.mobile-ui.photo-app[data-photo-panel=layers] .photo-inspector > .layer-section{flex:1 1 0}
.mobile-ui.photo-app[data-photo-panel=layers] .photo-pane-divider{display:none}
.mobile-ui.photo-app[data-photo-panel=properties] .photo-inspector:not(:has(#layerProperties[hidden])) .layer-section [data-photo-panel-close]{
 display:none
}

.layer-select .layer-name,.layer-select .layer-type{display:block}
.layer-select .layer-type{margin-top:2px;font-size:10px;color:var(--muted);white-space:nowrap}

.photo-options [data-photo-options][hidden]{display:none!important}
.photo-app:not(.mobile-ui) .photo-options{height:auto;min-height:44px;flex-wrap:wrap;overflow:visible}
.photo-app:not(.mobile-ui) .photo-options #brushSize{width:clamp(75px,10vw,140px);min-width:75px}
.photo-app:not(.mobile-ui) .photo-options .brush-preview{max-width:min(100%,260px)}
.mobile-ui.photo-app .photo-header #downloadPhotoBackup{display:none!important}
.mobile-ui.photo-app .photo-mobile-dock button{padding-inline:2px;word-break:normal;overflow-wrap:normal}
@media(max-width:360px){
 .mobile-ui.photo-app .photo-mobile-dock span{font-size:9px;white-space:nowrap}
}
