#setup-branch .branch-settings-rows{display:block}
.main-shell:has(#page-setup.active){overflow:clip}
.main-shell:has(#page-setup.active) .top-module-nav{flex-wrap:wrap;height:auto;min-height:52px}
#setup-branch{grid-template-columns:minmax(0,1fr);min-width:0}
#setup-branch>.panel{min-width:0;max-width:100%}
#setup-branch .panel-title{flex-wrap:wrap}
#setup-branch .branch-action-row{flex-wrap:wrap;max-width:100%;min-width:0}
#setup-branch .branch-action-row .pill{max-width:100%;white-space:normal;overflow-wrap:anywhere}
#setup-branch .table-wrap{max-width:100%;overflow:auto}
.branch-settings-group{border:1px solid var(--line,#e0e5ef);border-radius:14px;margin:18px 0;overflow:hidden}
.branch-settings-group h3{margin:0;padding:15px 18px;background:var(--pale,#f6f7fc);font-size:15px}
#setup-branch .branch-setting-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,300px);gap:24px;align-items:center;padding:15px 18px;margin:0;border:0;border-bottom:1px solid var(--line,#e0e5ef);border-radius:0;min-height:78px;background:transparent}
#setup-branch .branch-setting-row:last-child{border-bottom:0}
.setting-copy{display:flex;flex-direction:column;gap:5px;min-width:0}
.setting-copy strong{font-size:13px}.setting-copy small{font-size:12px;font-weight:400;line-height:1.5;color:#65728a;max-width:650px}
#setup-branch .setting-copy [hidden]{display:none!important}
#setup-branch .setting-copy .pill{align-self:flex-start;width:auto;max-width:100%;font-size:11px}
#setup-branch .switch-line>.setting-copy{width:auto;height:auto;border-radius:0;background:none;position:static}
#setup-branch .switch-line>.setting-copy:after,#setup-branch .switch-line>.setting-control:after{content:none}
.setting-control{display:flex;flex-direction:column;gap:8px;align-items:stretch;min-width:0}
.setting-control .enterprise-logo-preview{min-height:60px;max-width:300px;padding:10px}
.setting-control .enterprise-logo-preview img{max-height:70px;object-fit:contain}
#setup-branch .setting-control .input{height:38px;min-height:38px;width:100%;align-self:center}
#setup-branch .setting-control textarea.input{height:78px;min-height:78px;resize:vertical}
#setup-branch .switch-line .setting-control{display:block;justify-self:end;width:42px;height:24px;background:none;border-radius:0;position:relative}
#setup-branch .switch-line .setting-control>span{display:block;position:relative;width:42px;height:24px;border-radius:20px;background:#d7ddeb}
#setup-branch .switch-line .setting-control>span:after{content:'';position:absolute;width:18px;height:18px;top:3px;left:3px;border-radius:50%;background:white;box-shadow:0 1px 4px #0002;transition:transform .15s}
#setup-branch .switch-line .setting-control input:checked+span{background:var(--violet,#5931ed)}
#setup-branch .switch-line .setting-control input:checked+span:after{transform:translateX(18px)}
#setup-branch .switch-line input{display:block;position:absolute;opacity:0;width:42px;height:24px;cursor:pointer;z-index:1;margin:0}
#setup-branch .switch-line:focus-within{outline:2px solid var(--violet,#5931ed);outline-offset:-2px}
.branch-currency-note{padding:14px 18px;border-radius:10px;background:#f1f5ff;font-size:13px;line-height:1.6}
@media(max-width:640px){#setup-branch .branch-setting-row{grid-template-columns:minmax(0,1fr);gap:12px;padding:14px}#setup-branch .switch-line.branch-setting-row{grid-template-columns:minmax(0,1fr) 42px}.setting-control{width:100%}}

/* Compact branch editor: one task-focused section at a time. */
.branch-profile-tabs{display:flex;gap:4px;flex-wrap:wrap;padding:5px;background:var(--pale,#f5f6fb);border:1px solid var(--line,#e0e5ef);border-radius:12px;margin:16px 0 20px}
.branch-profile-tabs button{flex:1 1 auto;min-height:40px;border:0;border-radius:8px;background:transparent;color:var(--muted,#63718a);font-size:12px;font-weight:650;padding:10px 12px;box-shadow:none}
.branch-profile-tabs button[aria-selected=true]{background:var(--surface,#fff);color:var(--violet,#5931ed);box-shadow:0 1px 5px #18234712}
.branch-profile-tabs button:focus-visible{outline:2px solid var(--violet,#5931ed);outline-offset:2px}
.branch-profile-panel[hidden]{display:none!important}
.branch-profile-heading{margin:0 0 18px}.branch-profile-heading h3{font-size:16px;margin:0 0 5px}.branch-profile-heading p{font-size:12px;color:var(--muted,#65728a);margin:0}
.branch-profile-fields{border:1px solid var(--line,#e0e5ef);border-radius:12px;overflow:hidden}
#setup-branch .branch-setting-row{min-height:64px;padding:12px 16px;gap:20px;grid-template-columns:minmax(0,1fr) minmax(160px,260px)}
#setup-branch .setting-control textarea.input{font-family:inherit;font-size:12px;height:96px;min-height:96px}
.branch-profile-general .branch-profile-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;border:0;overflow:visible}
#setup-branch .branch-standard-field{display:flex;flex-direction:column;align-items:stretch;padding:0;gap:7px;min-height:0;border:0}
#setup-branch .branch-standard-field .setting-copy strong{font-size:12px;color:var(--text,#172a46)}
#setup-branch .branch-standard-field .setting-control{width:100%}
#setup-branch .branch-wide-setting{grid-column:1/-1}
#setup-branch [data-setting=setupBranchLogoFile]{padding:14px 16px;border:1px dashed var(--line,#dce2ed);border-radius:10px;display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,2fr);align-items:center}
#setup-branch [data-setting=setupBranchLogoFile] .setting-control{display:flex;flex-direction:row;align-items:center;gap:16px;flex-wrap:wrap}
#setup-branch [data-setting=setupBranchLogoFile] input{flex:1;min-width:170px}
#setup-branch #branchLogoPreview{min-height:0;max-width:240px;padding:8px;display:flex;align-items:center;gap:10px;flex:0 1 240px}
#setup-branch #branchLogoPreview img{width:58px;max-height:58px;object-fit:contain}
#setup-branch #branchLogoPreview small{display:none}
.branch-save-bar{position:sticky;bottom:0;z-index:5;margin:20px -4px 12px;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid var(--line,#e0e5ef);border-radius:12px;background:var(--surface,#fff);box-shadow:0 -3px 18px #172a4609}
.branch-save-bar[hidden]{display:none!important}.branch-save-bar>span{font-size:12px;color:var(--muted,#65728a)}.branch-save-bar.is-dirty>span{color:var(--violet,#5931ed);font-weight:600}
#setup-branch>.panel+.panel{display:none}
#setup-branch>.setup-card-grid,#setup-branch>.panel>.rule-explainer{display:none}
.branch-directory-details{margin-top:14px;font-size:12px}.branch-directory-details summary{cursor:pointer;color:var(--violet,#5931ed);padding:8px 0;font-weight:600}
#page-setup .setup-content{min-width:0}
@media(min-width:901px){#page-setup .setup-shell{grid-template-columns:230px minmax(0,1fr)}#page-setup .setup-nav{grid-template-columns:minmax(0,1fr);position:sticky;top:8px;max-height:calc(100dvh - 190px);overflow:auto}#page-setup .setup-nav button{min-height:54px;padding:10px 8px}}
@media(max-width:900px){#page-setup .setup-shell{grid-template-columns:minmax(0,1fr)}#page-setup .setup-nav{display:flex;position:static;overflow:auto;max-width:100%;padding:7px;gap:4px}#page-setup .setup-nav button{flex:0 0 auto;min-height:40px;grid-template-columns:24px auto;gap:6px;padding:6px 10px}#page-setup .setup-nav button>span{width:24px;height:24px;grid-row:auto}#page-setup .setup-nav button small{display:none}}

/* Long-form content and media need room, not a narrow preference control. */
#setup-branch .branch-text-editor{display:block;padding:18px;min-height:0}
#setup-branch .branch-text-editor .setting-copy{margin-bottom:12px}
.branch-editor-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.branch-editor-tools small{font-size:11px;color:var(--muted,#65728a)}
.branch-editor-tools button{min-height:30px;padding:5px 10px;font-size:11px}
#setup-branch .branch-text-editor .setting-control textarea{width:100%;height:150px;min-height:150px;max-height:70vh;resize:vertical;line-height:1.65;font-size:13px;padding:12px 14px}
#setup-branch .branch-text-editor.is-expanded .setting-control textarea{height:320px;min-height:260px}
#setup-branch .branch-upload-card,#setup-branch [data-setting=setupBranchLogoFile].branch-upload-card{display:block;padding:18px;border:0;border-bottom:1px solid var(--line,#e0e5ef);border-radius:0}
#setup-branch .branch-upload-card .setting-copy{margin-bottom:14px}
#setup-branch .branch-upload-card .setting-copy small{display:block!important}
#setup-branch .branch-upload-card .setting-control,#setup-branch [data-setting=setupBranchLogoFile].branch-upload-card .setting-control{display:grid;grid-template-columns:150px minmax(0,1fr);gap:20px;align-items:center}
#setup-branch .branch-upload-card .enterprise-logo-preview,#setup-branch .branch-upload-card #branchLogoPreview{margin:0;width:150px;max-width:150px;min-height:110px;height:110px;padding:12px;border:1px solid var(--line,#e0e5ef);border-radius:10px;background:var(--pale,#f8f9fc);display:flex;flex-direction:column;justify-content:center;gap:6px}
#setup-branch .branch-upload-card .enterprise-logo-preview img,#setup-branch .branch-upload-card #branchLogoPreview img{width:auto;max-width:124px;height:auto;max-height:82px;object-fit:contain}
#setup-branch .branch-upload-card .enterprise-logo-preview:has(img)>b,#setup-branch .branch-upload-card .enterprise-logo-preview small{display:none}
#setup-branch .branch-upload-card .enterprise-logo-preview b{font-size:11px;text-align:center}
.branch-upload-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0}
.branch-upload-actions button{min-height:36px;padding:8px 16px}
.branch-upload-name{font-size:12px;font-weight:600;overflow-wrap:anywhere;color:var(--ink,#172a46)}
.branch-upload-actions small{font-size:11px;line-height:1.5;color:var(--muted,#65728a)}
#setup-branch .branch-upload-card .branch-file-input{position:absolute!important;width:1px!important;min-width:0!important;height:1px!important;opacity:0;overflow:hidden;pointer-events:none}
@media(max-width:640px){#setup-branch .branch-text-editor{padding:14px}#setup-branch .branch-upload-card .setting-control,#setup-branch [data-setting=setupBranchLogoFile].branch-upload-card .setting-control{grid-template-columns:100px minmax(0,1fr);gap:12px}#setup-branch .branch-upload-card .enterprise-logo-preview,#setup-branch .branch-upload-card #branchLogoPreview{width:100px;max-width:100px;height:100px;min-height:100px;padding:8px}#setup-branch .branch-upload-card .enterprise-logo-preview img,#setup-branch .branch-upload-card #branchLogoPreview img{max-width:82px;max-height:80px}.branch-upload-actions button{padding:7px 10px}}
.branch-currency-note{font-size:11px;padding:10px 12px;margin:16px 0 0;background:var(--pale,#f6f7fc);color:var(--muted,#65728a)}
@media(max-width:760px){.branch-profile-general .branch-profile-fields{grid-template-columns:minmax(0,1fr)}.branch-profile-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.branch-profile-tabs button{text-align:left}.branch-save-bar{padding:10px;gap:10px}.branch-save-bar button{flex-shrink:0}#setup-branch [data-setting=setupBranchLogoFile]{display:flex}#setup-branch .branch-setting-row{grid-template-columns:minmax(0,1fr);gap:10px}#setup-branch .switch-line.branch-setting-row{grid-template-columns:minmax(0,1fr) 42px}}
