:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#111318;background:#f3f5f8;font-synthesis:none;--blue:#007aff;--red:#ff3b48;--muted:#7d8ca0;--surface:#f0f3f7;--line:#edf0f4}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation}button{border:0;background:transparent;color:inherit}input,select{min-width:0;border:0;border-radius:11px;background:var(--surface);padding:13px;color:inherit;outline:none}input:focus,select:focus{box-shadow:0 0 0 2px #007aff55}button:focus-visible{outline:3px solid #77b6ff;outline-offset:3px}button:disabled{opacity:.4;cursor:default}svg{width:22px;height:22px;display:block;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}h1,h2,p{margin:0}h1{font-size:28px;letter-spacing:-.8px}h2{font-size:21px;letter-spacing:-.4px}.app-icon{display:grid;place-items:center;background:var(--blue);border-radius:12px;width:40px;height:40px;color:white}.app-icon svg{width:26px;height:26px}.warehouse{max-width:820px;min-height:calc(100dvh - 64px);margin:32px auto;background:white;border-radius:20px;box-shadow:0 5px 36px #25314c07;overflow:hidden}header{padding:28px 30px 19px;position:sticky;top:0;background:#ffffffef;backdrop-filter:blur(15px);z-index:2}.heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.brand,.header-actions{display:flex;align-items:center;gap:12px}.header-actions{gap:14px}.icon-button{display:grid;place-items:center;width:38px;height:38px;color:#677b96;border-radius:10px}.icon-button:hover{background:var(--surface)}.add-button{width:44px;height:44px;border-radius:12px;background:var(--blue);color:white;display:grid;place-items:center;box-shadow:0 4px 9px #007aff1a}.add-button svg{width:26px;height:26px}.search-wrap{position:relative;display:flex;align-items:center;gap:9px;border-radius:12px;background:var(--surface);padding:0 13px;color:#62758e}.search-wrap input{background:transparent;border-radius:0;flex:1;padding:14px 0;font-size:15px}.search-wrap input:focus{box-shadow:none}.category-tabs{display:flex;gap:6px;margin-top:10px;overflow-x:auto;scrollbar-width:none}.category-tabs::-webkit-scrollbar{display:none}.category-tab{flex:1 0 auto;padding:9px 12px;border-radius:10px;background:var(--surface);color:var(--muted);font-size:13px;text-align:center;white-space:nowrap}.category-tab.selected{background:var(--blue);color:white}.search-wrap input::placeholder{color:#7a8a9e}.search-wrap kbd{font:12px -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:2px;white-space:nowrap;color:#8b99aa}.list-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 31px 10px;color:#8a97a8;font-size:11px;font-weight:600;letter-spacing:1px}.caption-title{display:flex;align-items:center;gap:6px}.list-caption #modelCount{letter-spacing:0;font-size:12px;font-weight:400;font-variant-numeric:tabular-nums}.list-caption #count{letter-spacing:0;font-size:12px;font-weight:400;font-variant-numeric:tabular-nums}.product-list{padding:0 18px 24px}.product-row{display:flex;align-items:center;width:100%;text-align:left;padding:12px;border-radius:13px;gap:20px;position:relative}.product-row:after{content:"";position:absolute;bottom:0;left:120px;right:12px;height:1px;background:var(--line)}.product-row:hover{background:#f8faff}.product-row:last-child:after{display:none}.product-photo{width:82px;height:74px;object-fit:contain;background:#f1f3f6;border-radius:11px;flex-shrink:0}.product-info{min-width:0;flex:1}.product-name{font-size:16px;font-weight:600;line-height:1.3;letter-spacing:-.3px;overflow-wrap:anywhere}.pills{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.pill{display:flex;align-items:center;gap:9px;padding:6px 9px;background:var(--surface);border-radius:7px;font-size:12px;line-height:1;color:#50627b;font-variant-numeric:tabular-nums}.pill b{color:var(--blue);font-size:12px;font-weight:600}.pill.zero b{color:#a2adbc;font-weight:400}.chevron{color:#8b9ab0;margin-left:12px}.chevron svg{width:19px;height:19px}.empty{text-align:center;padding:80px 24px;color:#8b99ab}.empty>span{display:grid;place-items:center;margin:0 auto 20px;width:70px;height:70px;border-radius:20px;background:var(--surface)}.empty svg{width:32px;height:32px}.empty h2{color:#253347;margin-bottom:9px}.empty p{line-height:1.5;font-size:14px;max-width:310px;margin:0 auto 24px}.primary{display:inline-flex;align-items:center;justify-content:center;gap:9px;background:var(--blue);color:white;border-radius:11px;padding:14px 20px;font-weight:600;font-size:15px;min-height:46px}.danger{background:var(--red)}.wide{width:100%}.text-button{color:var(--blue);font-size:15px;padding:9px 2px;min-height:40px}.soft-button{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--surface);color:#425a78;border-radius:11px;padding:12px;font-size:14px}.red{color:var(--red)}dialog{border:0;padding:0;box-shadow:0 12px 70px #18243c20;outline:none;color:#111318}dialog::backdrop{background:#1c2b3b45;backdrop-filter:blur(2px)}.sheet{position:fixed;margin:0 0 0 auto;inset:0;width:440px;max-width:100%;height:100dvh;max-height:100dvh;border-radius:20px 0 0 20px;background:white;overflow:hidden}.sheet[open]{display:flex;flex-direction:column}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 20px;min-height:68px;flex-shrink:0;border-bottom:1px solid var(--line);font-size:15px}.sheet-head>span{color:var(--muted);font-size:14px}.sheet-body{overflow-y:auto;overscroll-behavior:contain;padding:22px;flex:1}.hero-photo{width:100%;height:260px;object-fit:contain;display:block;background:#f2f4f7;border-radius:14px;margin-bottom:20px}.detail-name{font-size:24px;line-height:1.25;letter-spacing:-.7px;overflow-wrap:anywhere;margin-bottom:26px}.field-label{display:block;font-weight:600;font-size:14px;margin:24px 0 11px}.stock-row{display:flex;align-items:center;justify-content:space-between;padding:12px 2px;border-bottom:1px solid var(--line);font-size:16px}.stock-row strong{font-weight:500}.stock-amount{font-weight:600;color:var(--blue);background:#eff6ff;border-radius:9px;padding:9px 15px;min-width:58px;text-align:center;font-variant-numeric:tabular-nums}.stock-amount.zero{background:var(--surface);color:#9aa6b6}.stock-amount small{font-size:11px;font-weight:400}.detail-actions{display:flex;gap:10px;padding-top:26px;position:sticky;bottom:0;background:white}.detail-actions>button{flex:1;padding:13px 8px}.detail-actions svg{width:19px}.product-menu{position:absolute;right:18px;top:61px;z-index:3;background:white;border-radius:13px;box-shadow:0 6px 40px #20304930;border:1px solid var(--line);width:220px;overflow:hidden}.product-menu button{display:flex;align-items:center;gap:12px;padding:15px;width:100%;text-align:left;font-size:15px}.product-menu button+button{border-top:1px solid var(--line)}.product-menu button:hover{background:var(--surface)}#editForm{display:flex;flex-direction:column;height:100%;min-height:0}#productName{width:100%;font-size:15px}.photo-upload{position:relative;width:100%;height:210px;background:var(--surface);border-radius:13px;display:flex;align-items:center;justify-content:center;color:#60738d;overflow:hidden}.photo-upload img{width:100%;height:100%;object-fit:contain}.photo-upload>span{display:flex;align-items:center;flex-direction:column;gap:12px;font-size:14px}.photo-upload svg{width:32px;height:32px}.photo-upload:has(img:not([hidden]))>span{position:absolute;bottom:10px;right:10px;background:#fffffff0;border-radius:9px;padding:8px}.photo-upload:has(img:not([hidden]))>span svg{height:20px;width:20px}.photo-upload:has(img:not([hidden]))>span span{display:none}.segment{background:var(--surface);border-radius:10px;padding:3px;display:flex;margin-top:22px}.segment button{flex:1;padding:9px;border-radius:8px;font-size:13px;color:#77869b}.segment button.selected{background:white;box-shadow:0 1px 5px #25314c15;color:#17283f;font-weight:600}.edit-size-row{display:flex;align-items:center;gap:9px;margin:9px 0}.size-input{width:65px;background:transparent;font-weight:600;text-align:center;padding:10px 3px;border:1px solid var(--line)}.stepper{display:flex;align-items:center;gap:6px;flex:1;justify-content:flex-end}.stepper button{width:38px;height:38px;background:var(--surface);border-radius:9px;display:grid;place-items:center;color:#526b8d;flex-shrink:0}.stepper button:last-child{background:#eaf3ff;color:var(--blue)}.stepper input{width:68px;text-align:center;background:#fafbfd;border:1px solid var(--line);padding:10px 2px;font-weight:500}.remove-size{width:24px;height:38px;color:#a0aabc;padding:0;display:grid;place-items:center}.remove-size svg{width:16px}.stepper input::-webkit-inner-spin-button,.operation-stepper input::-webkit-inner-spin-button{appearance:none}.field-hint{color:#8693a5;font-size:12px;line-height:1.5;margin-bottom:16px}#addSize{margin-top:18px}.error{color:#e33945;font-size:13px;line-height:1.5;margin:12px 0}.error:empty{display:none}.operation-dialog{border-radius:18px;width:370px;max-width:calc(100% - 32px)}.operation-dialog .sheet-head{padding:10px 16px 10px 22px}.operation-dialog .sheet-head strong{font-size:20px}.operation-body{padding:18px 22px 22px}.operation-product{display:flex;align-items:center;gap:15px;margin-bottom:16px;font-size:15px;font-weight:600}.operation-product img{width:74px;height:68px;border-radius:10px;background:var(--surface);object-fit:contain}.operation-product span{overflow-wrap:anywhere}#operationSize{width:100%;font-size:15px}.quantity-label{display:flex;align-items:center;justify-content:space-between;margin-top:18px;margin-bottom:10px}.quantity-label .field-label{margin:0}.quantity-label>span{color:#8694a6;font-size:12px}.operation-stepper{display:flex;gap:8px;margin-bottom:18px}.operation-stepper button{flex:1;display:grid;place-items:center;background:var(--surface);color:var(--blue);border-radius:11px}.operation-stepper input{width:96px;min-height:54px;text-align:center;font-size:22px;font-weight:600}.confirm-dialog{width:340px;max-width:calc(100% - 40px);border-radius:18px;text-align:center;padding:25px 22px 12px}.confirm-dialog h2{font-size:19px;margin-bottom:9px}.confirm-dialog p{font-size:14px;line-height:1.5;color:#74849a;margin-bottom:22px}.confirm-dialog button{display:block;width:100%;padding:14px;color:var(--blue);border-top:1px solid var(--line);font-size:15px}.confirm-dialog button.red{color:var(--red)}.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);padding:14px 22px;border-radius:12px;background:#24394e;color:white;font-size:14px;box-shadow:0 5px 25px #162a4d25;z-index:20;max-width:calc(100% - 32px);text-align:center}.auth-screen{min-height:100dvh;display:grid;place-items:center;padding:24px}.auth-card{width:340px;background:white;padding:32px;border-radius:20px;text-align:center;box-shadow:0 4px 35px #21355009}.auth-card .app-icon{margin:0 auto 16px;width:52px;height:52px;border-radius:15px}.auth-card h1{font-size:27px}.auth-card>p:not(.error){font-size:14px;line-height:1.5;color:#8190a3;margin:12px 0 24px}.auth-card input{width:100%;margin-bottom:16px}.list-error{padding:25px;text-align:center;color:#a05e68;font-size:14px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@media(min-width:1100px){body:has(.detail-sheet[open]) .warehouse{transform:translateX(-130px);max-width:760px}}@media(max-width:650px){:root{background:white}.warehouse{margin:0;min-height:100dvh;border-radius:0;box-shadow:none}header{padding:20px 16px 15px}.heading{margin-bottom:17px}.brand{gap:10px}.brand .app-icon{display:none}h1{font-size:27px}.add-button{width:36px;height:36px;border-radius:10px}.add-button svg{width:24px}.header-actions{gap:9px}.logout{width:32px;height:34px}.logout svg{width:20px}.search-wrap input{padding:11px 0;font-size:14px}.search-wrap kbd{display:none}.category-tabs{margin-top:8px}.category-tab{padding:8px 10px;font-size:12px}.list-caption{padding:0 17px 7px;font-size:10px}.list-caption #count{font-size:11px}.product-list{padding:0 6px 20px}.product-row{padding:10px;gap:13px;border-radius:10px}.product-photo{width:68px;height:66px;border-radius:10px}.product-name{font-size:14px;letter-spacing:-.3px}.pills{margin-top:8px;gap:5px}.pill{font-size:11px;padding:6px 7px;gap:7px}.pill b{font-size:11px}.chevron{display:none}.product-row:after{left:91px;right:10px}.sheet{width:100%;height:calc(100dvh - max(20px,env(safe-area-inset-top)));max-height:calc(100dvh - 20px);top:auto;bottom:0;border-radius:18px 18px 0 0}.sheet-head{min-height:62px;padding:10px 16px}.sheet-body{padding:18px 18px max(24px,env(safe-area-inset-bottom))}.hero-photo{height:230px}.detail-name{font-size:23px;margin-bottom:24px}.detail-actions{padding-bottom:max(6px,env(safe-area-inset-bottom))}.photo-upload{height:190px}.operation-dialog{margin:auto auto max(20px,env(safe-area-inset-bottom));width:calc(100% - 24px);max-width:400px}.toast{bottom:max(25px,env(safe-area-inset-bottom))}.empty{padding-top:70px}.size-input{width:58px}.stepper input{width:62px}}@media(prefers-reduced-motion:no-preference){dialog[open]{animation:appear .15s ease-out}@keyframes appear{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}}

@media(max-width:650px){.sheet{height:calc(var(--viewport-height,100dvh) - 20px);max-height:calc(var(--viewport-height,100dvh) - 20px);bottom:var(--viewport-bottom,0px)}.operation-dialog{max-height:calc(var(--viewport-height,100dvh) - 32px);margin-bottom:calc(var(--viewport-bottom,0px) + max(16px,env(safe-area-inset-bottom)));overflow:auto}}

#cancelEdit:focus-visible{outline:none}
html[data-input="pointer"] dialog button:focus-visible{outline:none}

/* Keep the phone layout compact and fully scannable at the simulator viewport. */
@media(max-width:650px){
  :root{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  h1{font-size:23px;letter-spacing:-.55px}
  h2{font-size:18px}
  header{padding:16px 14px 12px}
  .heading{margin-bottom:13px}
  .add-button{width:34px;height:34px}
  .search-wrap{gap:7px;padding:0 11px}
  .search-wrap input{padding:9px 0;font-size:16px}
  .list-caption{padding:0 15px 5px;font-size:9px}
  .product-list{padding:0 5px 16px}
  .product-row{padding:8px;gap:10px}
  .product-photo{width:58px;height:56px;border-radius:9px}
  .product-name{font-size:13px;line-height:1.25}
  .pills{margin-top:6px;gap:4px}
  .pill{padding:5px 6px;gap:5px;font-size:10px}
  .pill b{font-size:10px}
  .product-row:after{left:76px;right:8px}
  .sheet{top:calc(var(--viewport-top,0px) + 14px);bottom:auto;height:calc(var(--viewport-height,100dvh) - 14px);max-height:calc(var(--viewport-height,100dvh) - 14px);border-radius:15px 15px 0 0}
  .sheet-head{min-height:54px;padding:8px 12px;font-size:14px}
  .sheet-body{min-height:0;padding:14px 14px max(20px,env(safe-area-inset-bottom));scroll-padding:16px}
  .hero-photo{height:185px;margin-bottom:14px;border-radius:11px}
  .detail-name{font-size:20px;line-height:1.2;margin-bottom:17px}
  .field-label{font-size:13px;margin:18px 0 8px}
  .stock-row{padding:9px 2px;font-size:14px}
  .stock-amount{padding:7px 12px;min-width:52px;font-size:13px}
  .detail-actions{gap:8px;padding-top:16px}
  .detail-actions>button{padding:11px 7px;font-size:13px;min-height:42px}
  .detail-actions svg{width:17px}
  .photo-upload{height:160px}
  #productName{font-size:16px;padding:11px}
  .segment{margin-top:17px}
  .segment button{padding:8px;font-size:12px}
  .edit-size-row{gap:7px;margin:7px 0}
  .size-input{width:52px;padding:8px 2px;font-size:16px}
  .stepper{gap:5px}
  .stepper button{width:34px;height:36px}
  .stepper input{width:54px;padding:8px 2px;font-size:16px}
  #operationSize,.auth-card input{font-size:16px}
  .remove-size{width:20px;height:36px}
  #addSize{margin-top:13px}
  .operation-dialog .sheet-head{min-height:48px;padding:8px 12px 8px 16px}
  .operation-dialog .sheet-head strong{font-size:17px}
  .operation-body{padding:14px 16px 18px}
  .operation-product{gap:12px;margin-bottom:12px;font-size:13px}
  .operation-product img{width:62px;height:58px}
  .operation-stepper{gap:7px;margin-bottom:14px}
  .operation-stepper input{width:78px;min-height:46px;font-size:19px}
  .primary{min-height:42px;padding:11px 16px;font-size:14px}
  .text-button{font-size:14px;min-height:36px}
  .empty{padding:56px 20px}
  .empty>span{width:60px;height:60px;margin-bottom:16px}
  .empty p{font-size:13px;margin-bottom:18px}
}

/* App surface: stable scrolling, immediate touch feedback and short transitions. */
html.modal-open{overflow:hidden;overscroll-behavior:none}
html.modal-open body{position:fixed;top:var(--page-scroll-top,0px);left:0;right:0;width:100%}
html.modal-open #app{transform:translate3d(0,var(--viewport-top,0px),0)}
button{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
.product-row,.primary,.soft-button,.icon-button,.add-button,.text-button,.stepper button,.operation-stepper button{transition:background-color .15s ease,opacity .15s ease,transform .08s ease}
button:not(:disabled):active{transform:scale(.985)}
.product-row:active{background:#eef5ff;transform:scale(.99)}
.sheet-body{overflow-anchor:none;-webkit-overflow-scrolling:touch}
.sheet-head{background:#fff;position:relative;z-index:1}
button[aria-busy="true"]{cursor:progress;position:relative}
button[aria-busy="true"]:after{content:"";width:13px;height:13px;display:inline-block;margin-left:7px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{rotate:360deg}}
@media(max-width:650px){
  header{padding-top:calc(16px + env(safe-area-inset-top))}
  .warehouse{padding-bottom:env(safe-area-inset-bottom)}
  .sheet{top:calc(var(--viewport-top,0px) + max(14px,env(safe-area-inset-top)));height:calc(var(--viewport-height,100dvh) - max(14px,env(safe-area-inset-top)));max-height:calc(var(--viewport-height,100dvh) - max(14px,env(safe-area-inset-top)))}
  .operation-dialog{max-height:calc(var(--viewport-height,100dvh) - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom)))}
  .toast{bottom:calc(18px + env(safe-area-inset-bottom))}
  .auth-screen{padding-top:calc(24px + env(safe-area-inset-top));padding-bottom:calc(24px + env(safe-area-inset-bottom))}
}
dialog::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}
/* Native close is atomic: no translucent card over the list or intermediate flex layout. */
.sheet{flex-direction:column}
dialog{opacity:1;transition:none}
dialog::backdrop{background:#1c2b3b38;transition:none}
@media(prefers-reduced-motion:no-preference){
  dialog[open]{animation:app-open .08s ease-out;transform:none}
  .sheet[open]{animation:sheet-open .1s ease-out}
  .product-menu{animation:menu-in .1s ease-out;transform-origin:top right}
  .toast:not([hidden]){animation:toast-in .14s ease-out}
  @keyframes app-open{from{opacity:0}to{opacity:1}}
  @keyframes sheet-open{from{translate:0 4px}to{translate:0 0}}
  @keyframes menu-in{from{opacity:0;translate:0 -3px}to{opacity:1;translate:0 0}}
  @keyframes toast-in{from{opacity:0;translate:0 4px}to{opacity:1;translate:0 0}}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* Keep actions outside the scroll surface so stock rows cannot paint below them. */
.detail-sheet>.sheet-body{min-height:0}
.detail-sheet>.detail-actions{position:static;flex-shrink:0;margin:0;padding:12px 22px max(16px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line)}
@media(max-width:650px){.detail-sheet>.detail-actions{padding:12px 14px max(16px,env(safe-area-inset-bottom))}}

/* Monochrome controls, matching the soft black and white reference. */
:root{color:#171717;background:#ededed;--blue:#171717;--red:#353535;--muted:#858585;--surface:#f1f1f1;--line:#ededed;--control-dark:linear-gradient(155deg,#454545 0%,#191919 48%,#080808 100%);--control-shadow:inset 0 1px 1px #ffffff35,0 5px 12px #0000001c}
header{background:#ffffffef}
.app-icon,.add-button,.primary,.stepper button:last-child{background:var(--control-dark);color:#fff;box-shadow:var(--control-shadow)}
.add-button{border-radius:13px}
.primary{border-radius:15px;font-weight:500}
.primary.danger{background:linear-gradient(145deg,#fafafa,#ededed);color:#242424;box-shadow:inset 0 1px 0 #fff;border:1px solid #e9e9e9}
.icon-button,.logout,.chevron{color:#6e6e6e}
.icon-button:hover{background:#f1f1f1}
.search-wrap,.search-wrap input::placeholder,.search-wrap kbd{color:#888}
.search-wrap{background:#f2f2f2;border-radius:14px}
.list-caption,.list-caption #count{color:#929292}
.product-row:hover,.product-row:active{background:#f5f5f5}
.product-photo,.hero-photo,.photo-upload,.operation-product img{background:#f3f3f3}
.product-name{color:#171717}
.pill{background:#f1f1f1;color:#777;border-radius:9px}
.pill b{color:#202020}
.pill.zero b{color:#a2a2a2}
.empty,.empty p,.field-hint,.quantity-label>span,.auth-card>p:not(.error){color:#8a8a8a}
.empty h2{color:#262626}
.empty>span{background:#f1f1f1}
.soft-button{background:#f2f2f2;color:#606060;border-radius:14px;box-shadow:inset 0 1px 0 #fff}
.text-button{color:#505050}
.text-button.save{background:var(--control-dark);color:#fff;padding:9px 13px;border-radius:12px;box-shadow:var(--control-shadow);min-width:94px}
.text-button.save:disabled{background:#f0f0f0;color:#aaa;box-shadow:none;opacity:1}
input,select{background:#f2f2f2;border-radius:13px;caret-color:#202020}
input:focus,select:focus{box-shadow:0 0 0 2px #00000018}
button:focus-visible{outline-color:#777}
.photo-upload{color:#858585;border-radius:16px}
.segment{background:#f3f3f3;border-radius:16px;padding:4px;gap:4px;box-shadow:inset 0 1px 2px #00000004}
.segment button{color:#7a7a7a;border-radius:12px;font-weight:500}
.segment button.selected{background:var(--control-dark);color:#fff;box-shadow:var(--control-shadow)}
.size-input{background:#fff;border-color:#ededed}
.stepper button{background:#f1f1f1;color:#878787;border-radius:12px}
.stepper input{background:#f8f8f8;border-color:#eee}
.stepper button:disabled{box-shadow:none;opacity:.35}
.remove-size{color:#a5a5a5}
.stock-amount{background:#eee;color:#222;border-radius:12px}
.stock-amount.zero{background:#f6f6f6;color:#aaa}
.operation-stepper button{background:#f1f1f1;color:#555;border-radius:14px}
.operation-stepper button:last-child{background:var(--control-dark);color:#fff;box-shadow:var(--control-shadow)}
.operation-stepper input{background:#f4f4f4;border-radius:14px}
.product-menu{border-color:#eee;box-shadow:0 8px 28px #00000018}
.product-menu button:hover{background:#f5f5f5}
.red,.confirm-dialog button.red{color:#555}
.confirm-dialog button{color:#222}
.error,.list-error{color:#555}
.error:not(:empty){border-left:2px solid #777;padding-left:9px}
.toast{background:#202020;box-shadow:0 5px 20px #00000020}
.auth-card{box-shadow:0 8px 32px #00000006}
@media(max-width:650px){:root{background:#fff}.sheet-head{gap:6px}.sheet-head strong{font-size:14px}.text-button.save{font-size:12px;min-width:88px;padding:9px 10px}.sheet-head #cancelEdit{font-size:13px}}
dialog{color:#171717;box-shadow:0 12px 50px #00000018}
dialog::backdrop{background:#00000020}

/* Match the thumbnail to the product text block without changing row typography or width. */
.product-row>.product-photo{align-self:stretch;height:auto;object-fit:contain}

/* Theme controls use the same raised monochrome active state as other segments. */
:root{color-scheme:light}
.theme-switch{display:flex;align-items:center;gap:3px;padding:3px;background:#f1f1f1;border-radius:13px;flex-shrink:0}
.theme-switch button{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;color:#8a8a8a}
.theme-switch svg{width:18px;height:18px}
.theme-switch button[aria-pressed="true"]{background:var(--control-dark);color:#fff;box-shadow:var(--control-shadow)}
:root[data-theme="dark"]{color-scheme:dark;color:#ededed;background:#141414;--blue:#eee;--red:#d0d0d0;--muted:#8d8d8d;--surface:#242424;--line:#2c2c2c;--control-dark:linear-gradient(150deg,#fff 0%,#eaeaea 55%,#d6d6d6 100%);--control-shadow:inset 0 1px 0 #ffffff70,0 4px 12px #00000028}
[data-theme="dark"] body,[data-theme="dark"] .warehouse{background:#141414}
[data-theme="dark"] header{background:#141414f5}
[data-theme="dark"] .sheet,[data-theme="dark"] .operation-dialog,[data-theme="dark"] .confirm-dialog,[data-theme="dark"] .auth-card,[data-theme="dark"] .sheet-head,[data-theme="dark"] .detail-sheet>.detail-actions{background:#1b1b1b;color:#ededed}
[data-theme="dark"] dialog{color:#ededed;box-shadow:0 12px 50px #00000040}
[data-theme="dark"] dialog::backdrop{background:#00000070}
[data-theme="dark"] .product-name,[data-theme="dark"] .detail-name,[data-theme="dark"] .empty h2{color:#eee}
[data-theme="dark"] .search-wrap,[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] .soft-button{background:#252525;color:#ddd}
[data-theme="dark"] input{caret-color:#eee}
[data-theme="dark"] input:focus,[data-theme="dark"] select:focus{box-shadow:0 0 0 2px #ffffff25}
[data-theme="dark"] .search-wrap input{background:transparent}[data-theme="dark"] .category-tab.selected{background:var(--control-dark);color:#171717;box-shadow:var(--control-shadow)}
[data-theme="dark"] .search-wrap input::placeholder,[data-theme="dark"] input::placeholder{color:#737373}
[data-theme="dark"] .icon-button,[data-theme="dark"] .logout,[data-theme="dark"] .text-button,[data-theme="dark"] .chevron{color:#aaa}
[data-theme="dark"] .icon-button:hover,[data-theme="dark"] .product-row:hover,[data-theme="dark"] .product-row:active{background:#222}
[data-theme="dark"] .app-icon,[data-theme="dark"] .add-button,[data-theme="dark"] .primary,[data-theme="dark"] .text-button.save,[data-theme="dark"] .segment button.selected,[data-theme="dark"] .stepper button:last-child,[data-theme="dark"] .operation-stepper button:last-child,[data-theme="dark"] .theme-switch button[aria-pressed="true"]{background:var(--control-dark);color:#171717;box-shadow:var(--control-shadow)}
[data-theme="dark"] .primary.danger{background:linear-gradient(145deg,#303030,#252525);color:#eee;border-color:#3b3b3b;box-shadow:inset 0 1px 0 #ffffff08}
[data-theme="dark"] .text-button.save:disabled{background:#292929;color:#666;box-shadow:none}
[data-theme="dark"] .segment,[data-theme="dark"] .theme-switch{background:#101010;box-shadow:inset 0 1px 2px #00000030}
[data-theme="dark"] .segment button,[data-theme="dark"] .theme-switch button{color:#888}
[data-theme="dark"] .pill,[data-theme="dark"] .stock-amount{background:#292929;color:#999}
[data-theme="dark"] .pill b,[data-theme="dark"] .stock-amount:not(.zero){color:#eee}
[data-theme="dark"] .pill.zero b{color:#686868}
[data-theme="dark"] .stock-amount.zero{background:#232323;color:#686868}
[data-theme="dark"] .photo-upload,[data-theme="dark"] .hero-photo,[data-theme="dark"] .product-photo,[data-theme="dark"] .operation-product img,[data-theme="dark"] .empty>span{background:#252525}
[data-theme="dark"] .photo-upload{color:#888}
[data-theme="dark"] .photo-upload:has(img:not([hidden]))>span{background:#1b1b1bee;color:#ddd}
[data-theme="dark"] .size-input,[data-theme="dark"] .stepper input,[data-theme="dark"] .operation-stepper input{background:#242424;border-color:#333;color:#eee}
[data-theme="dark"] .stepper button,[data-theme="dark"] .operation-stepper button{background:#292929;color:#aaa}
[data-theme="dark"] .stepper button:last-child,[data-theme="dark"] .operation-stepper button:last-child{background:var(--control-dark);color:#171717}
[data-theme="dark"] .soft-button{color:#b5b5b5;box-shadow:inset 0 1px 0 #ffffff05}
[data-theme="dark"] .product-menu{background:#252525;border-color:#383838;box-shadow:0 8px 28px #00000040}
[data-theme="dark"] .product-menu button:hover{background:#303030}
[data-theme="dark"] .red,[data-theme="dark"] .confirm-dialog button,[data-theme="dark"] .confirm-dialog button.red{color:#ccc}
[data-theme="dark"] .error,[data-theme="dark"] .list-error{color:#bbb}
[data-theme="dark"] .toast{background:#e5e5e5;color:#191919}

/* Compact portrait photo in the product detail; preserve the existing height. */
.hero-photo{width:195px;max-width:100%;margin-left:auto;margin-right:auto;object-fit:contain}
@media(max-width:650px){.hero-photo{width:139px}}

/* Plain add icon, with the existing touch target. */
.add-button,[data-theme="dark"] .add-button{background:transparent;color:inherit;box-shadow:none;border:0}

/* Quiet outlined stock chips; inset borders preserve the existing geometry. */
.product-row .pill{background:#fafafa;box-shadow:inset 0 0 0 1px #e7e7e7;border-radius:7px}
.product-row .pill>span+b{position:relative}
.product-row .pill>span+b:before{content:"";position:absolute;left:-4px;top:1px;bottom:1px;width:1px;background:#e3e3e3}
.product-row .pill.zero{background:transparent;box-shadow:inset 0 0 0 1px #efefef}
[data-theme="dark"] .product-row .pill{background:#202020;box-shadow:inset 0 0 0 1px #393939}
[data-theme="dark"] .product-row .pill>span+b:before{background:#414141}
[data-theme="dark"] .product-row .pill.zero{background:transparent;box-shadow:inset 0 0 0 1px #2c2c2c}

/* Optional insole measurements aligned with each shoe size. */
.insole-input{width:62px;flex-shrink:0;text-align:center;padding:10px 3px;font-size:16px;background:var(--surface);border:1px solid var(--line)}
.insole-input::placeholder{color:var(--muted)}
.insole-value{font-size:12px;font-weight:400;color:var(--muted);margin-left:12px}
@media(max-width:650px){.insole-input{width:54px;padding:8px 2px}.edit-size-row .size-input{flex-shrink:0}}

/* Desktop workspace only; keep the phone layout unchanged. */
@media(min-width:900px){
  .warehouse,body:has(.detail-sheet[open]) .warehouse{width:calc(100% - 64px);max-width:1120px;min-height:calc(100dvh - 48px);margin:24px auto;transform:none}
  header{display:grid;grid-template-columns:auto minmax(240px,1fr) auto;align-items:center;column-gap:28px;row-gap:8px;padding:24px 28px;border-bottom:1px solid var(--line);backdrop-filter:none}
  .heading{display:contents}
  .add-button{grid-column:1;grid-row:1;display:flex;align-items:center;gap:8px;width:auto;height:44px;white-space:nowrap}
  .add-button:after{content:'Добавить товар';font-size:14px;font-weight:500}
  .add-button svg{width:22px;height:22px}
  .header-actions{grid-column:3;grid-row:1;gap:12px}
  .search-wrap{grid-column:2;grid-row:1}
  .category-tabs{grid-column:2;grid-row:2;margin-top:0}
  .search-wrap input{font-size:14px;padding:13px 0}
  .list-caption{padding:22px 28px 10px}
  .product-list{padding:0 16px 24px}
  .product-row{display:grid;grid-template-columns:64px minmax(160px,240px) minmax(0,1fr) 20px;gap:20px;min-height:104px;padding:12px;border-radius:12px}
  .product-row>.product-photo{width:64px;height:80px;align-self:center;object-fit:contain}
  .product-info{display:contents}
  .product-name{font-size:15px;line-height:1.35}
  .product-row .pills{margin:0;gap:6px;align-content:center}
  .product-row .pill{padding:7px 9px}
  .chevron{margin:0}
  .product-row:after{left:96px;right:12px}
  .sheet{inset:24px 24px 24px auto;margin:0;width:420px;height:calc(100dvh - 48px);max-height:calc(100dvh - 48px);border-radius:20px}
  .sheet-head{min-height:64px;padding:12px 20px}
  .sheet-body{padding:22px;min-height:0}
  .detail-sheet .hero-photo{width:150px;height:200px;margin-bottom:22px}
  .detail-name{font-size:22px;margin-bottom:22px}
  .stock-row{padding:10px 2px}
  .editor-sheet .photo-upload{height:180px}
}

/* Keep save errors visible above the editor's scrolling fields. */
.editor-error:not(:empty){flex-shrink:0;margin:10px 14px 0;padding:8px 10px;border-radius:8px;background:var(--surface);font-size:13px}
#editForm [aria-invalid="true"]{outline:2px solid #888;outline-offset:2px}

/* Photo lightbox: use the decoded card photo and preserve the underlying card. */
.photo-open{display:block;width:max-content;max-width:100%;padding:0;margin:0 auto;cursor:zoom-in;touch-action:manipulation}
.photo-open:active{transform:none!important}
.photo-viewer{position:fixed;inset:var(--viewport-top,0px) 0 auto;margin:0;width:100vw;max-width:none;height:var(--viewport-height,100dvh);max-height:none;border-radius:0;padding:calc(64px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:#101010;color:#fff;overflow:hidden;box-shadow:none}
.photo-viewer[open]{display:grid;place-items:center;grid-template-rows:minmax(0,1fr)}
.photo-viewer::backdrop{background:#101010}
.photo-viewer img{display:block;max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;min-height:0;border-radius:8px}
#closePhoto{position:absolute;top:calc(12px + env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#ffffff18;color:#fff;box-shadow:none}
[data-theme="dark"] .photo-viewer{background:#101010;color:#fff;box-shadow:none}

/* Optional product price, independent of size quantities. */
#productPrice{width:100%;font-size:16px}
.product-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.product-title .product-name{min-width:0}
.product-price{font-size:13px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
.detail-title{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:22px}
.detail-title .detail-name{margin-bottom:0;min-width:0}
.detail-price{font-size:19px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(min-width:900px){.product-title{display:block}.product-price{display:block;margin-top:6px;color:var(--muted)}}

/* Independent price control above the row's card-opening button. */
.product-open{position:absolute;inset:0;z-index:1;width:100%;height:100%;border-radius:inherit}
.product-open:focus-visible{outline-offset:-3px}
.product-price{position:relative;z-index:2;padding:6px 0;margin:-6px 0;text-align:left;text-decoration:underline dotted #bbb;text-underline-offset:4px;cursor:pointer;flex-shrink:0}
.product-price.unset{color:var(--muted);font-weight:400;font-size:12px;text-decoration:none}
.price-dialog{position:fixed;inset:var(--viewport-top,0px) 0 var(--viewport-bottom,0px);margin:auto;width:340px;max-width:calc(100% - 32px);height:fit-content;max-height:calc(var(--viewport-height,100dvh) - 32px);overflow:auto;border-radius:18px;padding:22px;background:#fff}
.price-dialog h2{font-size:20px;margin-bottom:6px}
.price-product-name{font-size:13px;color:var(--muted);margin-bottom:18px;overflow-wrap:anywhere}
.quick-price-field{display:flex;align-items:center;gap:10px;background:var(--surface);border-radius:13px;padding-right:14px}
.quick-price-field input{width:100%;font-size:22px;font-weight:500;background:transparent;min-width:0}
.quick-price-field>span{font-size:20px;color:var(--muted)}
.price-help{font-size:12px;color:var(--muted);margin-top:10px}
.price-actions{display:flex;gap:10px;margin-top:20px}
.price-actions button{flex:1;min-height:44px}
[data-theme="dark"] .price-dialog{background:#1b1b1b;color:#eee}
[data-theme="dark"] .quick-price-field input{background:transparent}

.share-catalog svg{width:19px;height:19px}
.catalog-visible-setting{display:flex;align-items:flex-start;gap:10px;margin-top:22px;color:inherit;cursor:pointer}
.catalog-visible-setting input{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;accent-color:var(--blue)}
.catalog-visible-setting span{display:flex;flex-direction:column;gap:4px}
.catalog-visible-setting strong{font-size:14px;font-weight:500}
.catalog-visible-setting small{color:var(--muted);font-size:12px;line-height:1.4}
.catalog-link-row{display:flex;align-items:center;gap:8px}
.catalog-link-row input{flex:1;min-width:0;padding:11px 9px;border:1px solid var(--line);border-radius:9px;background:#fafbfd;font-size:13px}
.catalog-link-row .soft-button{flex:0 0 auto;padding:10px;font-size:13px}
.catalog-link-row input:focus{outline:2px solid var(--blue);outline-offset:1px}
#catalogLinkStatus:empty{display:none}
[data-theme="dark"] .catalog-link-row input{background:#252525;color:#eee}
