.stock-branches { margin:20px 0; }
.stock-branches details { border-bottom:1px solid #e1e5ed; margin-bottom:12px; padding-bottom:10px; }
.stock-branches summary { display:flex; align-items:center; gap:8px; cursor:pointer; list-style:none; color:#27187e; font-weight:600; padding:8px 0; }
.stock-branches summary::-webkit-details-marker { display:none; }
.stock-branches summary svg { width:20px;height:20px;flex-shrink:0; }
.stock-branches summary svg:last-child { margin-left:auto;transition:transform .18s; }
.stock-branches details[open]>summary svg:last-child { transform:rotate(180deg); }
.branch-toolbar { display:flex; align-items:center; gap:10px; margin:12px 0; flex-wrap:wrap; }
.branch-toolbar label { display:flex;align-items:center;gap:8px; flex:1;min-width:0;margin:0; }
.branch-toolbar svg,.branch-pallet-info svg,.branch-card-name svg,.branch-dialog svg:not(.leaflet-zoom-animated),.branch-public-pallet h2 svg,#publicStockShare h1 svg { width:20px;height:20px;flex-shrink:0; }
.branch-toolbar input,.branch-toolbar select,.branch-dialog input,.branch-dialog select,.branch-dialog textarea { width:100%;min-width:0;box-sizing:border-box; padding:11px 12px; border:1px solid #dce1eb; border-radius:10px;background:white;color:#172033;font:inherit;min-height:44px; }
.branch-toolbar button,.branch-dialog button,.branch-dialog a { display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px; }
.branch-stock-filter select { max-width:400px; }
.branch-row { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #edf0f5; }
.branch-row>div:first-child { min-width:0;overflow-wrap:anywhere; }
.branch-row small { display:block;color:#626b7a;font-size:.83rem;margin-top:3px;line-height:1.4; }
.branch-actions { display:flex;gap:6px;flex-shrink:0; }
.branch-actions .stock-icon { width:40px;min-height:40px;padding:9px;border-radius:10px; }
.branch-dialog { width:min(520px,calc(100% - 24px));box-sizing:border-box;--dialog-padding-x:20px;--dialog-padding-y:20px;padding:20px; }
.branch-dialog form { display:grid;gap:12px;margin:0; }
#palletBranchCreateSlot { margin-top:16px;padding-top:16px;border-top:1px solid #e1e5ed; }
.branch-create-chevron { display:inline-flex;transition:transform .18s; }
#newPalletBranch[aria-expanded=true] .branch-create-chevron { transform:rotate(180deg); }
.branch-dialog label { display:grid;gap:6px;font-size:.9rem;margin:0; }
.branch-dialog label small { color:#626b7a; }
.branch-dialog .library-heading h2 { display:flex;align-items:center;gap:8px; }
#branchDialog,#palletBranchDialog,#stockShareDialog { --dialog-padding-x:20px;--dialog-padding-y:20px; }
.branch-form-row { display:grid;grid-template-columns:1fr 1fr;gap:12px; }
.branch-share-choices { max-height:42vh;overflow:auto; }
.branch-share-choices label { display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #edf0f5;overflow-wrap:anywhere; }
.branch-share-choices input { width:20px;height:20px;min-height:20px;flex-shrink:0;accent-color:#27187e; }
.branch-pallet-info { display:flex;align-items:center;flex-wrap:wrap;gap:6px;color:#626b7a;font-size:.85rem;margin:8px 0 12px; }
.branch-pallet-info small { flex-basis:100%; }
.stock-pallet-card .branch-card-name { display:flex;gap:5px;align-items:center;color:#27187e; }
.branch-card-name svg { width:15px;height:15px; }
.branch-public-pallet { border-bottom:1px solid #dce1eb;padding:16px 0; }
.branch-public-pallet h2,#publicStockShare h1 { display:flex;gap:8px;align-items:center; }
.branch-public-pallet svg { width:20px;height:20px;vertical-align:middle;margin-right:6px; }
.branch-public-pallet .stock-product { padding:10px 0; }
.branch-public-pallet .stock-product p { margin:4px 0; }
.stock-card[hidden],.branch-pallet-info[hidden] { display:none!important; }
@media(max-width:600px) { .branch-row { flex-wrap:wrap; } .branch-actions { margin-left:auto; } .branch-stock-filter label { flex-basis:100%; } .branch-stock-filter select { max-width:none; } .branch-form-row { grid-template-columns:1fr; } }
@media(max-width:768px) and (pointer:coarse) { body[data-hand="left"] .branch-row { flex-direction:row-reverse; } body[data-hand="left"] .branch-actions { margin-left:0;margin-right:auto; } body[data-hand="left"] .branch-row>div:first-child { text-align:right; } body[data-hand="left"] .branch-toolbar { flex-direction:row-reverse; } }
@media(prefers-reduced-motion:reduce) { .stock-branches summary svg { transition:none; } }

.branch-search-results{max-height:260px;overflow:auto;display:grid;gap:4px}.branch-dialog .branch-search-option{justify-content:flex-start;text-align:left;width:100%;padding:10px;border:1px solid transparent;border-radius:10px;background:transparent;color:#172033}.branch-search-option span{min-width:0;overflow-wrap:anywhere}.branch-search-option strong,.branch-search-option small{display:block}.branch-search-option small{font-size:.8rem;color:#626b7a;margin-top:3px}.branch-search-option[aria-pressed=true]{background:#efedf8;border-color:#d8d1ef;color:#27187e}.branch-search-option:hover{background:#f4f3fa}.branch-dialog [hidden]{display:none!important}

.branch-selected-preview{display:flex;align-items:center;gap:12px;justify-content:space-between}.branch-selected-preview>div{min-width:0;overflow-wrap:anywhere}.branch-selected-preview strong{display:flex;align-items:center;gap:7px}.branch-selected-preview small{display:block;margin-top:4px;color:#626b7a;line-height:1.4}.branch-selected-preview p{margin:8px 0 0;color:#626b7a;font-size:.85rem}.branch-selected-preview button{flex-shrink:0;width:44px;padding:10px}

.branch-picker-tabs{display:grid;grid-template-columns:1fr 1fr;margin-bottom:16px}.branch-picker-tabs button{display:flex;gap:7px;align-items:center;justify-content:center}.branch-location-notice{padding:14px;border-radius:10px;background:#efedf8;color:#514675;font-size:.9rem;line-height:1.5;margin:0}

#palletBranchEmpty{text-align:center;margin:8px 0 0;font-size:.85rem;line-height:1.45}#palletBranchForm #newPalletBranch{justify-self:center;width:auto;min-height:40px;padding:8px 12px;font-size:.85rem;border-radius:9px}#newPalletBranch>svg{width:17px;height:17px}#newPalletBranch .branch-create-chevron svg{width:15px;height:15px}

#palletBranchForm #newPalletBranch{justify-self:end;background:transparent;color:#625783;border:1px solid #ded9e9;font-weight:500;box-shadow:none;padding:7px 10px}#palletBranchForm #newPalletBranch:hover{background:#f0edf7;border-color:#c9c0dd}

.branch-map{height:300px;width:100%;border:1px solid #ded9e9;border-radius:12px;box-sizing:border-box;z-index:0}.branch-map-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}.branch-map-toolbar button{font-size:.8rem;padding:8px 10px}.branch-map-toolbar span{flex:1;min-width:140px;font-size:.8rem}.branch-point-details summary{display:flex;align-items:center;gap:8px;cursor:pointer;color:#625783;font-size:.85rem;min-height:44px}.branch-point-details summary .branch-create-chevron{margin-left:auto}.branch-point-details[open] summary .branch-create-chevron{transform:rotate(180deg)}.branch-map .leaflet-popup-content{overflow-wrap:anywhere}.branch-map .leaflet-popup-content button{font-size:.8rem;min-height:40px}.branch-map .leaflet-control-attribution{font-size:10px}.branch-map .leaflet-control a{min-height:0;display:block}.branch-map .leaflet-control-zoom a{line-height:30px}@media(max-width:400px){.branch-map{height:260px}}
#palletBranchDialog .branch-map .leaflet-control-attribution a{display:inline;min-height:0;padding:0;margin:0}
#palletBranchDialog .branch-map .leaflet-control-attribution svg{width:12px;height:8px}

#branchLocationMap{height:380px;max-height:48dvh}.branch-map-choice{padding:12px 0;border-top:1px solid #e7e3ee}.branch-map-choice p{margin:0 0 8px;text-align:center;font-size:.85rem;color:#626b7a}.branch-map-choice button{min-height:44px;font-size:.85rem;max-width:100%;white-space:normal}#branchMapNearby{display:grid;gap:6px;margin-bottom:8px}#addBranchAtPoint{display:flex;margin:0 auto;padding:8px 12px;background:#efedf8;color:#27187e}.branch-map .leaflet-tile{image-rendering:auto}@media(max-width:400px){#branchLocationMap{height:330px}}

.branch-address-source{font-size:.75rem;color:#626b7a}.branch-dialog .branch-address-source a{display:inline;min-height:0;color:inherit;text-decoration:underline}

#branchFormFields{border:0;padding:0;margin:0;min-width:0;display:grid;gap:12px}.branch-fields-legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.branch-form-notice{display:flex;align-items:center;gap:9px;padding:11px 12px;margin:0;border-radius:10px;background:#edf8f1;border:1px solid #bde8cb;color:#17633c;font-size:.85rem;line-height:1.4}.branch-form-notice svg{width:20px;height:20px;flex-shrink:0}.branch-form-notice[data-state=loading]{background:#efedf8;border-color:#dcd5ef;color:#514278}.branch-form-notice[data-state=loading] svg{animation:branch-loading-spin 1s linear infinite}.branch-form-notice[data-state=error]{background:#fff4e5;border-color:#ead39d;color:#79531a}#branchFormFields:disabled{opacity:.6}@keyframes branch-loading-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.branch-form-notice[data-state=loading] svg{animation:none}}

/* Compact map actions retain comfortable touch targets. */
#palletBranchDialog:has(#branchLocationTab[aria-selected=true]){width:min(760px,calc(100% - 24px))}.branch-map-frame{position:relative;isolation:isolate}.branch-map-frame #branchLocationMap{height:min(460px,52dvh);max-height:none;border-color:#e5e2ec;border-radius:14px}.branch-map-frame .branch-map-locate{position:absolute;right:12px;top:12px;z-index:500;width:44px;height:44px;min-height:44px;padding:10px;border:1px solid rgba(255,255,255,.9);border-radius:12px;background:rgba(255,255,255,.9);backdrop-filter:blur(12px);color:#342279;box-shadow:0 3px 14px #251a4820}.branch-map-toolbar{margin:8px 0 0}.branch-map-toolbar span{font-size:.8rem;line-height:1.4}.branch-map .leaflet-control-zoom{border:1px solid #ffffffd9;border-radius:12px;overflow:hidden;box-shadow:0 3px 14px #251a4820}.branch-map .leaflet-control-zoom a{width:40px;height:40px;line-height:40px;background:#fffffff2;color:#342279;font-size:22px}.branch-map .leaflet-popup-content-wrapper{border-radius:12px;box-shadow:0 4px 20px #251a4829}.branch-map .leaflet-popup-content{margin:12px 14px;line-height:1.4}.branch-map .leaflet-popup-content strong{font-size:.92rem;color:#27187e}.branch-map .leaflet-popup-content p{margin:5px 0 10px;font-size:.8rem;color:#626b7a}.branch-map .leaflet-popup-content button{padding:8px 12px;border-radius:9px;font-size:.8rem;gap:6px;min-height:44px}.branch-map .leaflet-popup-content button svg{width:17px;height:17px}.branch-store-marker{background:transparent;border:0}.branch-store-pin{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border:2px solid white;border-radius:12px;background:#342279;color:white;box-shadow:0 3px 10px #251a4838}.branch-dialog .branch-store-pin svg{width:21px;height:21px}.branch-nearby-option{justify-content:flex-start!important;text-align:left;background:transparent!important;border:0;border-bottom:1px solid #ece8f2;border-radius:0;padding:9px 2px!important;gap:9px}.branch-nearby-option span{min-width:0}.branch-nearby-option strong,.branch-nearby-option small{display:block}.branch-nearby-option small{font-size:.76rem;color:#626b7a;margin-top:3px}#addBranchAtPoint{width:auto;min-height:44px;padding:8px 12px;border-radius:9px;font-size:.82rem;background:#f0edf8;color:#342279}.branch-map-choice{padding:10px 0 0}@media(max-width:768px) and (pointer:coarse){.branch-map .leaflet-control-zoom a{width:44px;height:44px;line-height:44px}body[data-hand=left] .branch-map-frame .branch-map-locate{right:auto;left:12px;top:auto;bottom:32px}}
#palletBranchDialog .branch-map .leaflet-control-zoom a{width:40px;height:40px;line-height:40px;background:#fffffff2;color:#342279;font-size:22px}
@media(max-width:768px) and (pointer:coarse){#palletBranchDialog .branch-map .leaflet-control-zoom a{width:44px;height:44px;line-height:44px}}

.branch-shortcuts{display:flex;gap:6px;margin:8px 0}.branch-dialog .branch-shortcuts button{flex:1;min-height:44px;padding:8px 6px;font-size:.8rem;background:transparent;color:#625783;border:1px solid #e5e0ee;border-radius:9px}.branch-shortcuts button[aria-pressed=true]{background:#efedf8;color:#27187e;border-color:#d8d1ef}.branch-shortcuts svg{width:17px;height:17px}.branch-choice-row{display:flex;align-items:center;gap:4px;min-width:0}.branch-choice-row .branch-search-option{flex:1;min-width:0;width:auto}.branch-dialog .branch-favorite{width:44px;height:44px;flex:0 0 44px;padding:10px;border:0;background:transparent;color:#8a829b;border-radius:9px}.branch-favorite[aria-pressed=true]{color:#98700a;background:#fff8e2}.branch-favorite[aria-pressed=true] svg{fill:#f7d778}.branch-favorite svg{width:21px;height:21px}@media(max-width:768px) and (pointer:coarse){body[data-hand=left] .branch-choice-row{flex-direction:row-reverse}}

.branch-admin-toolbar{display:flex;align-items:center;gap:10px;margin:14px 0}.branch-admin-search{display:flex;align-items:center;gap:8px;flex:1;min-width:0;padding:0 12px;border:1px solid #ddd9e9;border-radius:10px;background:white}.branch-admin-search>svg{width:19px;height:19px;flex-shrink:0;color:#625783}.branch-admin-search input{width:100%;min-width:0;border:0;background:transparent;padding:12px 0;font:inherit;outline-offset:3px}.branch-admin-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #e6e2ed}.branch-admin-info{flex:1;min-width:0;overflow-wrap:anywhere}.branch-admin-info strong{display:flex;align-items:center;gap:7px;font-size:.95rem;color:#27187e}.branch-admin-info small{display:block;color:#626b7a;font-size:.8rem;margin-top:4px;line-height:1.4}.branch-admin-info svg{width:18px;height:18px;flex-shrink:0}.branch-admin-meta svg{width:13px;height:13px;vertical-align:middle;margin-right:4px}.branch-admin-actions{display:flex;gap:6px;flex-shrink:0}.branch-admin-actions button{width:44px;height:44px;padding:10px}.branch-admin-actions svg{width:20px;height:20px}#manageBranchPages svg{width:18px;height:18px;transform:rotate(-90deg)}#manageBranchPrevious svg{transform:rotate(90deg)}.branch-admin-matches{padding:10px;background:#fff8e2;border:1px solid #efdfa8;border-radius:9px}.branch-admin-matches small{display:block;margin-bottom:6px;color:#795d16}.branch-admin-matches button{display:flex;width:100%;justify-content:flex-start;text-align:left;background:transparent;font-size:.8rem;padding:8px;white-space:normal}.branch-admin-matches svg{width:17px;height:17px;flex-shrink:0}.reports-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}.reports-tabs button{min-width:0}#manageBranchDialog h2 svg{width:20px;height:20px}#manageBranchForm>button{margin-top:12px}@media(max-width:768px) and (pointer:coarse){body[data-hand=left] .branch-admin-row{flex-direction:row-reverse}body[data-hand=left] .branch-admin-info{text-align:right}body[data-hand=left] .branch-admin-info strong{justify-content:flex-end}body[data-hand=left] .branch-admin-toolbar{flex-direction:row-reverse}}@media(max-width:400px){.reports-tabs button{font-size:.75rem;padding:8px 3px;gap:4px}.reports-tabs svg{width:17px;height:17px}.branch-admin-row{gap:8px}.branch-admin-actions{gap:4px}}
@media(max-width:380px){.reports-tabs:has([data-moderation-view=branches]) button{flex-direction:column;gap:3px;font-size:.72rem;padding:7px 2px;white-space:normal;line-height:1.2}.reports-tabs:has([data-moderation-view=branches]) button svg,.reports-tabs:has([data-moderation-view=branches]) button i{width:16px;height:16px;font-size:16px}}
.stock-primary-actions{flex-wrap:nowrap;gap:6px}.stock-primary-actions .stock-icon{width:44px;height:44px;min-height:44px;flex:0 0 44px;padding:10px}.stock-primary-actions #scanPallet{min-height:44px;min-width:0;padding:10px 12px;font-size:.85rem;gap:6px}.share-mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px}.share-search-label{display:flex!important;align-items:center;gap:8px;border:1px solid #ddd9e9;border-radius:10px;padding:0 10px;margin:12px 0!important}.share-search-label input{border:0;background:transparent;padding:10px 0}.share-selection-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px}.share-selection-tools>span{flex:1;font-size:.8rem;color:#625783}.branch-dialog .share-selection-tools button{font-size:.76rem;min-height:40px;padding:7px 9px;background:#efedf8;color:#27187e}.branch-dialog .branch-share-choices{max-height:35dvh;overflow:auto;display:block;padding:0;margin:0 0 12px}.branch-dialog .share-choice{display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 4px;margin:0;border-bottom:1px solid #e6e2ed;cursor:pointer;background:transparent;box-sizing:border-box}.branch-dialog .share-choice:has(input:checked){background:#f1eef9}.branch-dialog .share-choice input{width:20px;height:20px;min-height:20px;flex:0 0 20px;accent-color:#27187e;padding:0}.share-choice span{min-width:0;overflow-wrap:anywhere}.share-choice strong,.share-choice small{display:block}.share-choice strong{font-size:.87rem;color:#27187e}.share-choice small{font-size:.76rem;color:#626b7a;margin-top:3px;line-height:1.4}#stockShareList .branch-row small{margin-top:4px}#stockShareList .branch-actions{flex-wrap:wrap;justify-content:flex-end;max-width:144px}#stockShareList .branch-actions button{width:44px;height:44px}#stockShareList .stock-delete{background:#c6263d;color:white}#stockShareForm #createStockShare{width:100%}#stockShareChoices input:focus-visible{outline:2px solid #7963d5;outline-offset:3px}@media(max-width:380px){.stock-primary-actions #scanPallet{font-size:.78rem;padding:10px 8px;flex:1}.stock-primary-actions #scanPallet svg{width:18px;height:18px}}@media(max-width:768px) and (pointer:coarse){body[data-hand=left] .share-choice{flex-direction:row-reverse;text-align:right}body[data-hand=left] #stockShareList .branch-row{flex-direction:row-reverse;text-align:right}body[data-hand=left] #stockShareList .branch-actions{justify-content:flex-start}}
.branch-dialog .share-mode-tabs [aria-pressed=true]{background:#27187e;color:white}#stockShareHint{font-size:.83rem;line-height:1.4;margin:10px 0 12px}
#stockShareBranchReview{margin:8px 0 14px;padding:0;border:0}#stockShareBranchReview>summary{display:flex;align-items:center;gap:7px;min-height:44px;padding:8px 10px;background:#efedf8;color:#27187e;border-radius:9px;font-size:.83rem;cursor:pointer;list-style:none}#stockShareBranchReview>summary::-webkit-details-marker{display:none}#stockShareBranchReview>summary .library-chevron{margin-left:auto;transition:transform .18s}#stockShareBranchReview[open]>summary .library-chevron{transform:rotate(180deg)}#stockShareBranchReview>p{font-size:.78rem;line-height:1.4;margin:8px 0}#stockShareBranchReview .branch-share-choices{max-height:28dvh}
