/* Aveltrim | Vending Machines / Estoque Pro V1. Native selectors, no DOM replacement. */
[data-view="vm-stock"],dialog.vm-studio-dialog,dialog.av-stock-blocked,body:has([data-view="vm-stock"].active) dialog:is(.av-transfer-dialog,.av-form-dialog,.av-stock-calendar){--sp-green:#176b47;--sp-deep:#14372c;--sp-ink:#173329;--sp-muted:#526e60;--sp-line:#d5e3da;--sp-soft:#f3f7f4;--sp-amber:#805711;--sp-red:#983d36}
[data-view="vm-stock"] #vmBody,[data-view="vm-stock"] #vmAlerts{max-width:1440px;margin-inline:auto;min-width:0}
html body [data-view="vm-stock"] #vmBody>.card{box-sizing:border-box;background:#fff;border:1px solid var(--sp-line);border-radius:12px;padding:22px;color:var(--sp-ink);box-shadow:0 2px 8px #14372c06}
html body [data-view="vm-stock"] .vm-machine-toolbar{align-items:end;gap:16px;margin-bottom:20px}
[data-view="vm-stock"] .vm-machine-toolbar::before{content:'GESTÃO DE ESTOQUE';display:block;flex-basis:100%;font-size:11px;font-weight:750;letter-spacing:.1em;color:var(--sp-green);margin-bottom:-8px}
[data-view="vm-stock"] .vm-field{display:grid;gap:7px;font-size:13px;font-weight:650;color:var(--sp-ink)}
[data-view="vm-stock"] .vm-machine-toolbar .vm-actions{display:flex;gap:8px;flex-wrap:wrap}
html body [data-view="vm-stock"] :is(.vm-field,.vm2-filters) :is(input,select),html body [data-view="vm-stock"] .vm-stock :is(input,select){box-sizing:border-box;min-height:42px;border:1px solid #bdcfc3!important;border-radius:8px!important;background:#fff;color:var(--sp-ink);font-size:14px;line-height:1.4;margin:0;padding:9px 12px;box-shadow:none}
html body [data-view="vm-stock"] button:is(.action,.primary),html body dialog:is(.vm-studio-dialog,.av-stock-blocked) button:is(.action,.primary),html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog button:is(.action,.primary){min-height:40px;padding:9px 13px;border-radius:8px!important;font-size:13px;font-weight:650;line-height:1.3;box-shadow:none!important;white-space:normal}
html body [data-view="vm-stock"] button.primary,html body dialog:is(.vm-studio-dialog,.av-stock-blocked) button.primary,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog button.primary,html body:has([data-view="vm-stock"].active) dialog.av-form-dialog .av-form-actions button[type="submit"]:not(.av-danger){background:#176b47!important;border:1px solid #176b47!important;color:#fff!important}
html body [data-view="vm-stock"] button.action:not(.danger):not(.vm-remove-product),html body dialog:is(.vm-studio-dialog,.av-stock-blocked) button.action,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog button.action{background:#fff;border-color:var(--sp-line,#d5e3da);color:var(--sp-ink,#173329)}
html body [data-view="vm-stock"] button.action[aria-pressed=true]{background:#e6f2eb!important;color:#176b47!important;border-color:#a8cfb6!important}
html body [data-view="vm-stock"] .vm-studio .vm-stock-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 20px}
html body [data-view="vm-stock"] .vm-studio .vm-stock-summary>.vm-summary-card{padding:16px 18px;border:1px solid var(--sp-line);border-radius:11px;background:#fff;display:flex;flex-direction:column;gap:13px;min-width:0}
[data-view="vm-stock"] .vm-summary-card h4{margin:0;display:flex;align-items:center;gap:9px;font-size:14px;font-weight:700;color:var(--sp-green);line-height:1.4}
[data-view="vm-stock"] .vm-summary-card h4 .vm-icon{box-sizing:border-box;width:31px;height:31px;padding:7px;border-radius:8px;background:#e5f1e9;color:var(--sp-green)}
[data-view="vm-stock"] .vm-summary-card dl{margin:0;display:grid;gap:8px}
[data-view="vm-stock"] .vm-summary-card dl>div{align-items:baseline;gap:12px;min-width:0}
[data-view="vm-stock"] .vm-summary-card dt{font-size:13px;line-height:1.45;color:var(--sp-muted)}
[data-view="vm-stock"] .vm-summary-card dd{font-size:14px;color:var(--sp-ink);font-variant-numeric:tabular-nums;line-height:1.35}
[data-view="vm-stock"] .vm-summary-card dl>div:first-child dd{font-size:21px;font-weight:750}
html body [data-view="vm-stock"] .vm-stock-summary>.vm-summary-card:first-child{background:var(--sp-deep);border-color:var(--sp-deep)}
[data-view="vm-stock"] .vm-stock-summary>.vm-summary-card:first-child :is(h4,dt,dd){color:#fff}
[data-view="vm-stock"] .vm-stock-summary>.vm-summary-card:first-child h4 .vm-icon{background:#ffffff19;color:#fff}
[data-view="vm-stock"] .vm-studio-note{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;background:var(--sp-soft);border:1px solid var(--sp-line);border-radius:9px;font-size:13px;line-height:1.5;margin:0 0 16px;color:var(--sp-muted)}
[data-view="vm-stock"] .vm-studio-note button{margin:0 0 0 auto}
[data-view="vm-stock"] .vm-stock-nav{gap:8px;padding:0 0 14px;margin:0 0 18px;border-color:var(--sp-line)}
[data-view="vm-stock"] .vm2-toolbar{margin:0 0 14px;gap:12px}
[data-view="vm-stock"] .vm2-toolbar h3,[data-view="vm-stock"] .vm-stock-history h3{margin:0 0 6px;font-size:18px;font-weight:750;line-height:1.4;color:var(--sp-ink)}
[data-view="vm-stock"] .vm2-toolbar small{font-size:13px;color:var(--sp-muted);line-height:1.4}
[data-view="vm-stock"] .vm2-filters{gap:10px;align-items:center}
[data-view="vm-stock"] .vm-stock-legend{margin:14px 0 0;gap:8px 16px;font-size:12px;line-height:1.5}
html body [data-view="vm-stock"] .vm-studio .vm-studio-workspace{gap:18px;margin:16px 0 0;grid-template-columns:minmax(0,1fr) minmax(250px,300px)}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map{background:#17372e;border:1px solid #264e40;border-radius:12px;gap:14px;padding:16px}
[data-view="vm-stock"] .vm2-machine-header{padding:12px 14px;background:#285044;color:#fff;border-radius:8px;line-height:1.4}
[data-view="vm-stock"] .vm2-machine-header small{color:#d5e9de}
[data-view="vm-stock"] .vm2-pickup{background:#0e281f;color:#d5e9de;border:1px solid #547a6b;padding:10px;margin:4px auto;box-sizing:border-box}
[data-view="vm-stock"] .vm2-map .vm-empty{min-height:190px;display:grid;align-content:center;justify-items:center;text-align:center;gap:10px;padding:20px;border:1px dashed #739587;border-radius:10px;background:#ffffff08;color:#f2fbf6}
[data-view="vm-stock"] .vm2-map .vm-empty :is(strong,p,svg){color:#e3f2e9!important;margin:0;line-height:1.5}
[data-view="vm-stock"] .vm2-map .vm-empty svg{width:34px;height:34px;background:#ffffff10;padding:5px;border-radius:7px;box-sizing:content-box}
[data-view="vm-stock"] .vm2-list .vm2-map .vm-empty{background:var(--sp-soft);border-color:var(--sp-line)}
[data-view="vm-stock"] .vm2-list .vm2-map .vm-empty :is(strong,p,svg){color:var(--sp-muted)!important}
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed=true]{background:#e8f4ec!important;border-color:#66ab80!important;box-shadow:0 0 0 2px #a8d2b6!important}
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed=true] .vm2-slot-head b{color:#176b47!important}
[data-view="vm-stock"] .vm2-slot[data-state=low] .vm2-slot-head span{color:var(--sp-amber)}
[data-view="vm-stock"] .vm2-slot[data-state=empty] .vm2-slot-head span{color:var(--sp-red)}
[data-view="vm-stock"] .vm2-empty-position{background:#25483c;color:#e1eee6;border-color:#759889}
[data-view="vm-stock"] .vm2-empty-position small{color:inherit}
[data-view="vm-stock"] .vm2-list .vm2-empty-position{background:#fff;color:var(--sp-muted);border-color:var(--sp-line)}
html body [data-view="vm-stock"] .vm-studio-detail{padding:18px;border:1px solid var(--sp-line);border-radius:11px;box-shadow:none}
[data-view="vm-stock"] .vm-studio-detail>small{display:block;margin:0 0 10px;color:var(--sp-green)}
[data-view="vm-stock"] .vm-studio-detail h3{font-size:17px;line-height:1.4;margin:0 0 8px}
[data-view="vm-stock"] .vm-studio-detail p{line-height:1.6;margin:0 0 12px}
[data-view="vm-stock"] .vm-studio-selected-slot{color:var(--sp-green);background:#e6f2eb;border-color:#bbd8c5}
[data-view="vm-stock"] .vm-studio-buttons{gap:8px}
[data-view="vm-stock"] .vm-remove-product{color:var(--sp-red)!important;border-color:#e5c6c1!important}
[data-view="vm-stock"] .vm-stock-history .table{border:1px solid var(--sp-line);border-radius:9px;overflow:auto;margin-top:14px}
[data-view="vm-stock"] .vm-stock-history th,[data-view="vm-stock"] .vm-stock th{background:var(--sp-soft);color:var(--sp-muted);font-size:12px;padding:12px}
[data-view="vm-stock"] .vm-stock-history td,[data-view="vm-stock"] .vm-stock td{padding:12px;line-height:1.45}
[data-view="vm-stock"] #vmBody>.card>.vm-empty{padding:25px;min-height:180px;display:grid;justify-items:center;align-content:center;gap:10px;background:var(--sp-soft);border:1px dashed var(--sp-line);border-radius:10px}
[data-view="vm-stock"] #vmBody>.card>.vm-empty p{margin:0;color:var(--sp-muted)}
/* Native layout drawer: keep one scrolling surface, stable footer. */
html body dialog.vm-studio-dialog{width:min(690px,100vw)!important;max-width:100vw!important;height:100dvh;max-height:100dvh;box-sizing:border-box;border-left:1px solid var(--sp-line);border-radius:14px 0 0 14px;background:#fff;color:var(--sp-ink);overflow:auto;overscroll-behavior:contain}
html body dialog.vm-studio-dialog>header{padding:20px 24px;gap:12px;border-color:var(--sp-line);background:white;position:sticky;top:0;z-index:3}
.vm-studio-dialog header small{color:var(--sp-green);font-size:11px;letter-spacing:.1em}.vm-studio-dialog h2{font-size:22px;line-height:1.3;margin:6px 0}.vm-studio-dialog header p{line-height:1.5;font-size:13px;color:var(--sp-muted)}
html body dialog.vm-studio-dialog .vm-studio-content{padding:20px 24px 0;gap:16px;align-content:start;min-width:0}
.vm-studio-dialog .vm-layout-templates h3{font-size:16px;margin:0 0 7px;color:var(--sp-ink)}
.vm-studio-dialog .vm-layout-templates p,.vm-studio-dialog .vm-layout-templates small{font-size:13px;line-height:1.5;color:var(--sp-muted)}
.vm-studio-dialog .vm-layout-choices{gap:12px;margin:14px 0}
html body dialog.vm-studio-dialog .vm-layout-choices button{padding:13px;border-radius:10px;background:var(--sp-soft);border:1px solid var(--sp-line);text-align:left;display:grid;gap:6px;min-width:0}
.vm-studio-dialog .vm-layout-choices button[aria-pressed=true]{border-color:var(--sp-green)!important;background:#e5f2e9!important;box-shadow:0 0 0 1px var(--sp-green)}
.vm-studio-dialog .vm-layout-choices button b{line-height:1.4;overflow-wrap:anywhere}.vm-studio-dialog .vm-layout-choices button span{color:var(--sp-muted);font-size:12px;line-height:1.4}
.vm-studio-dialog .vm-layout-mini{margin-top:4px;background:var(--sp-deep)}
.vm-studio-dialog .vm-studio-note{margin:0;padding:12px 14px;background:var(--sp-soft);border:1px solid var(--sp-line);border-radius:8px;color:var(--sp-muted);line-height:1.5}
.vm-studio-dialog .vm-studio-shelf{border:1px solid var(--sp-line);border-radius:10px;padding:14px;min-width:0}
.vm-studio-dialog .vm-studio-shelf>div:first-child{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.vm-studio-dialog .vm-studio-shelf>div:first-child b{margin-right:auto}
.vm-studio-dialog .vm-studio-edit-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,120px),1fr));gap:8px;margin:12px 0 0}
.vm-studio-dialog .vm-studio-edit-grid>div{gap:4px;align-items:center}.vm-studio-dialog .vm-studio-edit-grid input{min-width:0;min-height:38px;padding:8px;border:1px solid #bdcfc3;border-radius:7px}.vm-studio-dialog .vm-studio-edit-grid button{padding:8px;flex:none;min-width:32px;min-height:38px}
.vm-studio-dialog [data-add-shelf]{border:1px dashed #a9c7b5;color:var(--sp-green);min-height:42px;border-radius:8px}
.vm-studio-dialog .vm-studio-error:empty{display:none}.vm-studio-dialog .vm-studio-error{margin:0;color:var(--sp-red);line-height:1.5}
html body dialog.vm-studio-dialog footer{position:sticky;bottom:0;z-index:2;background:#fff;padding:13px 0;margin:0;gap:8px;flex-wrap:wrap;border-top:1px solid var(--sp-line)}
/* Blocked flow and transfer/batch dialogs. */
html body dialog.av-stock-blocked{width:min(720px,calc(100vw - 24px))!important;border:1px solid var(--sp-line);border-radius:14px;max-height:calc(100dvh - 24px);color:var(--sp-ink)}
html body dialog.av-stock-blocked>header,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog>header{padding:20px 24px;gap:12px;border-color:var(--sp-line)}
html body dialog.av-stock-blocked header small,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog header small{color:var(--sp-green);font-size:11px;letter-spacing:.09em}
html body dialog.av-stock-blocked header h2,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog header h2{font-size:22px;line-height:1.3;margin:5px 0}
html body dialog.av-stock-blocked .av-wh-body,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog .av-wh-body{padding:20px 24px;gap:16px;min-height:0}
.av-stock-blocked .av-stock-step{padding:14px;gap:12px;border-color:var(--sp-line);border-radius:10px;background:#fffaf1}.av-stock-blocked .av-stock-step.is-ok{background:#f0f7f2}.av-stock-blocked .av-stock-step-number{background:#f4e9d1;color:var(--sp-amber)}.av-stock-blocked .is-ok .av-stock-step-number{background:#dceddf;color:var(--sp-green)}
.av-stock-blocked .av-stock-step strong{font-size:14px;line-height:1.4}.av-stock-blocked .av-stock-step p{margin:5px 0 0;line-height:1.5}.av-stock-blocked .av-stock-help{margin:0;line-height:1.55;color:var(--sp-muted)}
html body dialog.av-stock-blocked footer,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog footer{padding:13px 24px;border-color:var(--sp-line);gap:8px;flex-wrap:wrap}
html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog{width:min(900px,calc(100vw - 24px));border:1px solid var(--sp-line);border-radius:14px}
body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog :is(.av-transfer-route>div,.av-transfer-metrics>div,.av-wh-batch-row,.av-transfer-confirm){border-color:var(--sp-line);border-radius:9px;background:var(--sp-soft)}
body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog :is(label,.av-wh-batch-row){gap:8px;min-width:0;line-height:1.4}
body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog :is(input:not([type=checkbox]),select){min-height:42px;border-color:#bdcfc3;border-radius:8px;min-width:0;box-sizing:border-box}
/* Shared forms used by stock only; keep original field layout and conditional visibility. */
html body:has([data-view="vm-stock"].active) dialog.av-form-dialog{--mp-green:#176b47;--mp-line:#d5e3da;--mp-ink:#173329;--mp-muted:#526e60;--mp-soft:#f3f7f4}
html body:has([data-view="vm-stock"].active) dialog.av-form-dialog.av-catalog-dialog{border:1px solid var(--sp-line);border-radius:14px}
html body:has([data-view="vm-stock"].active) dialog.av-form-dialog .av-form-fields{gap:14px 16px!important;align-items:start}
html body:has([data-view="vm-stock"].active) dialog.av-form-dialog .av-form-actions{gap:8px}
html body:has([data-view="vm-stock"].active) dialog.av-form-dialog .av-form-fields :is(input:not([type=hidden],[type=checkbox],[type=radio],[type=file]),select,textarea){min-height:42px;border:1px solid #bdcfc3!important;border-radius:8px!important;box-sizing:border-box;min-width:0}
html body [data-view="vm-stock"] :focus-visible,html body dialog:is(.vm-studio-dialog,.av-stock-blocked) :focus-visible,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog :focus-visible{outline:2px solid #70ae89!important;outline-offset:2px}
html body [data-view="vm-stock"] button:disabled,html body dialog:is(.vm-studio-dialog,.av-stock-blocked) button:disabled,html body:has([data-view="vm-stock"].active) dialog.av-transfer-dialog button:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:1250px){html body [data-view="vm-stock"] .vm-studio .vm-studio-workspace{grid-template-columns:minmax(0,1fr)}html body [data-view="vm-stock"] .vm-studio-detail{position:static}}
@container(max-width:850px){html body [data-view="vm-stock"] .vm-studio .vm-studio-workspace{grid-template-columns:minmax(0,1fr)}html body [data-view="vm-stock"] .vm-studio-detail{position:static}}
@media(max-width:720px){html body [data-view="vm-stock"] #vmBody>.card{padding:14px}html body [data-view="vm-stock"] .vm-studio .vm-stock-summary{grid-template-columns:minmax(0,1fr)}[data-view="vm-stock"] .vm-machine-toolbar .vm-actions{width:100%}[data-view="vm-stock"] .vm-machine-toolbar .vm-actions button{flex:1 1 140px}[data-view="vm-stock"] .vm2-filters>*{flex:1 1 100%;width:100%}[data-view="vm-stock"] .vm-studio-note button{margin-left:0}html body dialog.vm-studio-dialog .vm-studio-content,html body dialog.vm-studio-dialog>header,html body dialog.av-stock-blocked .av-wh-body,html body dialog.av-stock-blocked>header,html body dialog.av-stock-blocked footer{padding-left:16px;padding-right:16px}}
@media(max-width:400px){.vm-studio-dialog .vm-layout-choices{grid-template-columns:1fr}.av-stock-blocked footer button{flex:1 1 100%}}
/* Finish: align the KPI content and neutralize generic button/input theme overrides. */
html body [data-view="vm-stock"] .vm-studio .vm-stock-summary>.vm-summary-card{align-items:stretch!important;justify-content:flex-start!important;text-align:left!important}
html body [data-view="vm-stock"] .vm-summary-card h4{justify-content:flex-start!important}
html body [data-view="vm-stock"] .vm-summary-card dl{width:100%;align-self:stretch}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) button.vm2-empty-position{background:#25483c!important;color:#e5f1e9!important;border:1px dashed #759889!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) button.vm2-empty-position :is(b,small,svg){color:#e5f1e9!important}
html body [data-view="vm-stock"] .vm-studio.vm2-list button.vm2-empty-position{background:#fff!important;color:#526e60!important;border:1px dashed #bdcfc3!important}
html body [data-view="vm-stock"] .vm-studio .vm-studio-selected-slot{color:#176b47!important;background:#e6f2eb!important;border-color:#bbd8c5!important}
html body dialog.vm-studio-dialog>header{height:auto!important;min-height:0!important;max-height:none!important;box-sizing:border-box!important;align-items:flex-start!important;padding:20px 24px 16px!important}
html body dialog.vm-studio-dialog>header>div{min-width:0;flex:1;display:grid;gap:5px}
html body dialog.vm-studio-dialog>header h2,html body dialog.vm-studio-dialog>header p{margin:0!important;line-height:1.4!important}
html body dialog.vm-studio-dialog>header [data-close]{min-width:36px;min-height:36px;border:1px solid #d5e3da!important;border-radius:8px!important}
html body dialog.vm-studio-dialog .vm-studio-edit-grid input{border:1px solid #bdcfc3!important;background:#fff!important;border-radius:7px!important;margin:0!important;min-height:38px!important}
html body dialog.vm-studio-dialog .vm-studio-edit-grid input[readonly]{background:#eaf5ed!important;color:#176b47!important}
@media(max-width:720px){html body dialog.vm-studio-dialog>header{padding:16px!important}}

/* V4: physical shelf map. Exact native selectors; no fixed card width or DOM edits. */
html body [data-view="vm-stock"] .vm-stock-inventory{container:av-stock-map / inline-size;min-width:0}
html body [data-view="vm-stock"] .vm-studio .vm-studio-workspace{width:100%;max-width:none;min-width:0;grid-template-columns:minmax(0,1fr) minmax(220px,248px);gap:16px;align-items:start;margin:16px 0 0}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map{
  --map-count:1;--slot-gap:6px;--slot-min:54px;
  display:grid;grid-template-columns:minmax(calc(var(--map-count) * (var(--slot-min) + var(--slot-gap)) - var(--slot-gap)),1fr);
  align-content:start;gap:13px;width:100%;min-width:0;max-width:100%;box-sizing:border-box;
  background:#172528;border:1px solid #263638;border-radius:12px;padding:14px;overflow-x:auto;overscroll-behavior-inline:contain;
  scrollbar-color:#617779 #172528;scrollbar-width:thin;box-shadow:none;margin:0;
}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(2)){--map-count:2}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(3)){--map-count:3}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(4)){--map-count:4}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(5)){--map-count:5}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(6)){--map-count:6}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(7)){--map-count:7}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(8)){--map-count:8}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(9)){--map-count:9}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(10)){--map-count:10}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(11)){--map-count:11}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map:has(.vm2-grid > :nth-child(12)){--map-count:12}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-machine-header{background:#294043;color:#fff;border:1px solid #395254;border-radius:8px;padding:10px 12px;gap:10px;min-width:0;box-sizing:border-box}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-machine-header b{font-size:14px;overflow-wrap:anywhere}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-machine-header small{color:#c4ddd1;font-size:12px}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-shelf{min-width:0;overflow:visible;border:0;border-bottom:2px solid #45595b;padding:0 0 9px;margin:0;background:transparent;border-radius:0;box-shadow:none}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-shelf h4{color:#dce8e2;margin:0 0 7px;font-size:12px;line-height:1.4;font-weight:650;letter-spacing:.025em}
/* One row per actual shelf, with equally sized fluid columns, including filtered positions. */
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-grid{display:grid!important;grid-template-columns:none!important;grid-template-rows: minmax(0,auto)!important;grid-auto-flow:column!important;grid-auto-columns:minmax(0,1fr)!important;gap:var(--slot-gap)!important;min-width:0;width:100%;align-items:stretch;justify-content:stretch}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-grid > :is(.vm2-slot,.vm2-empty-position){box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;min-height:100px!important;height:100%;padding:7px 4px!important;border-radius:7px!important;gap:4px!important;overflow:hidden;box-shadow:none;white-space:normal;line-height:1.25}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-grid > :is(.vm2-slot,.vm2-empty-position)[hidden]{display:grid!important;visibility:hidden!important;pointer-events:none!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) button.vm2-empty-position{background:#26383a!important;color:#dce8e2!important;border:1px dashed #708986!important;justify-items:center;align-content:center;text-align:center}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) button.vm2-empty-position:hover{background:#34524b!important;border-color:#b3d1c3!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) button.vm2-empty-position :is(b,small,svg){color:#dce8e2!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-empty-position b{font-size:13px;line-height:1.2;overflow-wrap:anywhere;max-width:100%}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-empty-position small{font-size:10px;line-height:1.25;max-width:100%;overflow-wrap:anywhere}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-empty-position svg{width:16px;height:16px;margin:2px auto}
/* Configured slots: readable status, contained product photo and quantity; full name in existing details. */
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot{grid-template-rows:auto 44px minmax(28px,auto) 4px auto!important;align-content:start;text-align:left;background:#fff;color:#172528;border:1px solid #d5e3da;border-top:3px solid #319847;min-height:126px!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot.low{border-top-color:#d79b20}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot.empty{border-top-color:#c85349}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot-head{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot-head b{font-size:13px;overflow-wrap:anywhere;max-width:100%}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot-head span{font-size:10px;line-height:1.2;overflow-wrap:anywhere;max-width:100%;color:#426353}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot.low .vm2-slot-head span{color:#805711}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot.empty .vm2-slot-head span{color:#983d36}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) :is(.vm2-photo,.vm2-photo img){width:100%;min-width:0;height:44px;object-fit:contain;border-radius:5px}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-placeholder svg{width:24px;height:24px}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot strong{font-size:11px;line-height:1.25;min-width:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot small{font-size:10px;overflow-wrap:anywhere;line-height:1.25}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot .vm-bar{height:4px;min-width:0;margin:0}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed=true]{background:#e8f4ec!important;border-color:#66ab80!important;box-shadow:inset 0 0 0 1px #66ab80!important;transform:none!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed=true]::after{display:none!important;content:none!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-pickup{background:#0b1517;border:1px solid #526563;color:#c4ddd1;border-radius:7px;min-width:0;max-width:100%;width:68%;padding:9px 6px;margin:1px auto 0;font-size:10px;line-height:1.4}
html body [data-view="vm-stock"] .vm-studio-detail{box-sizing:border-box;min-width:0;padding:16px;position:sticky;top:12px;align-self:start;overflow-wrap:anywhere}
html body [data-view="vm-stock"] .vm-studio-detail h3{font-size:16px;line-height:1.4}
html body [data-view="vm-stock"] .vm-studio-detail p{font-size:13px;line-height:1.55;margin:0 0 8px}
html body [data-view="vm-stock"] .vm-studio-detail > p:last-child{margin-bottom:0}
html body [data-view="vm-stock"] .vm-studio .vm2-filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
html body [data-view="vm-stock"] .vm-studio .vm2-filters input{flex:1 1 220px;min-width:0}
html body [data-view="vm-stock"] .vm-studio .vm2-filters select{flex:0 1 auto;min-width:0;max-width:100%}
/* Prefer stacking the details rather than sacrificing the physical map. */
@container av-stock-map (max-width:960px){html body [data-view="vm-stock"] .vm-studio .vm-studio-workspace{grid-template-columns:minmax(0,1fr);max-width:none}html body [data-view="vm-stock"] .vm-studio-detail{position:static}}
@container av-stock-map (max-width:440px){html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-map{padding:10px;--slot-min:62px}html body [data-view="vm-stock"] .vm-studio .vm2-filters select{flex:1 1 100%}}
@media(max-width:720px){html body [data-view="vm-stock"] .vm-studio .vm-stock-summary{grid-template-columns:1fr;gap:10px}html body [data-view="vm-stock"] .vm-studio .vm-studio-workspace{grid-template-columns:minmax(0,1fr)}html body [data-view="vm-stock"] .vm-studio-detail{position:static}}
/* Compact empty shelves and consistent selection, without losing stock status. */
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-grid > .vm2-empty-position{min-height:82px!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed=true].low{border-top-color:#d79b20!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed=true].empty{border-top-color:#c85349!important}
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed=true].ok{border-top-color:#319847!important}
html body [data-view="vm-stock"] .vm-studio-detail .vm-studio-product-photo{height:108px;margin:12px 0;background:#f3f7f4}
html body [data-view="vm-stock"] .vm-studio-detail .vm-studio-product-photo img{max-height:98px;max-width:100%;object-fit:contain}

/* V5: selection uses blue; the top stripe always represents stock status. */
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed="true"],
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed="true"]{
  background:#eff5ff!important;
  border-left-color:#4b78dd!important;
  border-right-color:#4b78dd!important;
  border-bottom-color:#4b78dd!important;
  box-shadow:none!important;
  transform:none!important;
}
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed="true"].ok,
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed="true"].ok{border-top-color:#319847!important}
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed="true"].low,
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed="true"].low{border-top-color:#d79b20!important}
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed="true"].empty,
html body [data-view="vm-stock"] .vm-studio:not(.vm2-list) .vm2-slot[aria-pressed="true"].empty{border-top-color:#c85349!important}
html body [data-view="vm-stock"] .vm-studio .vm2-slot[aria-pressed="true"] .vm2-slot-head b{color:#244fa8!important}
html body [data-view="vm-stock"] .vm-studio .vm-studio-selected-slot{color:#244fa8!important;background:#edf3ff!important;border-color:#c4d5f8!important}
html body [data-view="vm-stock"] .vm-studio .vm2-slot:focus-visible{outline-color:#7197f1!important}
