/* Compact Setup workspace, using the application's existing theme. */
.page-host:has(#page-setup.active){overflow:hidden;padding:12px 16px 8px;min-height:0}
#page-setup.active{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
#page-setup>.page-head{margin:0;padding:12px 16px;min-height:0;display:flex;gap:20px;align-items:center;justify-content:space-between;box-shadow:none}
#page-setup>.page-head h1{font-size:21px;line-height:1.2;margin:0}
#page-setup .setup-shell{min-height:0;height:100%;display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px;align-items:stretch}
#page-setup .setup-nav{position:static;max-height:none;min-height:0;overflow:auto;display:block;padding:8px;margin:0;align-self:stretch;box-shadow:none}
#page-setup .setup-nav-group{margin:0 0 6px;border:0;background:transparent;padding:0}
#page-setup .setup-nav-group>summary{cursor:pointer;font-size:11px;font-weight:750;letter-spacing:.03em;color:var(--muted,#64748b);padding:9px 8px;text-transform:uppercase}
#page-setup .setup-nav-group>button{display:grid;grid-template-columns:21px minmax(0,1fr);width:100%;min-height:35px;padding:7px 9px;gap:8px;align-items:center;text-align:left;border-radius:8px;margin:2px 0;font-size:12px;line-height:1.3}
#page-setup .setup-nav-group>button>b{font-size:12px;font-weight:650;line-height:1.3}
#page-setup .setup-nav-group>button>span{width:20px;height:20px;grid-row:auto;background:transparent;padding:0}
#page-setup .setup-nav-group>button small{display:none}
#page-setup .setup-content{height:100%;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;padding:0 4px 0 0;scroll-padding-top:12px;scroll-padding-bottom:64px}
#page-setup .setup-content .panel{padding:14px;margin-bottom:12px;box-shadow:none;min-width:0}
#page-setup .setup-content .panel-title{gap:10px;margin-bottom:12px;align-items:center}
#page-setup .setup-content h2{font-size:17px;margin:0}
#page-setup .setup-content h3{font-size:14px;margin:0 0 5px}
#page-setup .setup-content p{font-size:12px;line-height:1.5;margin:6px 0 12px}
#page-setup .setup-content :is(.form-grid,.detail-grid){gap:12px 16px;align-items:start}
#page-setup .setup-content label{font-size:12px;gap:5px}
#page-setup .setup-content :is(input.input,select.input){min-height:35px;height:35px;padding:7px 10px;font-size:13px}
#page-setup .setup-content input[type=number]{max-width:144px}
#page-setup .setup-content textarea.input{min-height:64px;height:64px;padding:8px 10px;font-family:inherit;font-size:13px;resize:vertical}
#page-setup .setup-content .table-wrap{max-height:none!important;height:auto!important;overflow-y:visible!important;overflow-x:auto}
#page-setup .branch-profile-tabs{gap:4px;padding:4px;margin-bottom:12px;position:sticky;top:0;z-index:5;background:var(--pale,#f5f6fb)}
#page-setup .branch-profile-tabs button{min-height:32px;font-size:12px;padding:7px 10px}
#page-setup .branch-profile-heading{margin:0 0 12px}
#page-setup .branch-profile-heading p{margin:4px 0 0}
#page-setup .branch-profile-fields{gap:12px 16px}
#page-setup .branch-setting-row{padding:8px 0}
#page-setup .branch-setting-row .setting-control:has(>input[type=number]){justify-self:start}
#page-setup .branch-setting-row .setting-control>input[type=number]{width:120px}
#page-setup .branch-text-editor{padding:12px;min-height:0}
#page-setup .branch-text-editor .setting-copy{margin-bottom:4px}
#page-setup .branch-editor-tools{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 5px}
#page-setup .branch-text-editor .setting-control textarea{min-height:64px;height:64px;max-height:60vh;padding:8px 10px}
#page-setup .branch-text-editor.is-expanded .setting-control textarea{height:240px;min-height:180px}
#page-setup .setup-content .branch-save-bar{position:sticky!important;inset:auto 0 0!important;z-index:15!important;margin:0!important;padding:10px 12px;background:var(--surface,#fff);border:1px solid var(--line,#e0e5ef);box-shadow:0 -4px 16px #172b4d08;min-height:52px}
#page-setup .presentation-tabs{margin:10px 0}
#page-setup [data-invoice-sequence-row]{display:grid;grid-template-columns:minmax(160px,1.3fr) 100px 130px minmax(190px,1.4fr) auto;gap:12px;align-items:center;margin:0;padding:12px}
#page-setup [data-invoice-sequence-row]>.sequence-identity{display:grid;gap:4px;min-width:0}
#page-setup [data-invoice-sequence-row] strong{font-size:13px}
#page-setup [data-invoice-sequence-row] small{font-size:11px;color:var(--muted,#64748b);line-height:1.4}
#page-setup [data-invoice-sequence-row]>.form-grid{display:contents}
#page-setup [data-invoice-sequence-row] label.check{align-self:center;margin:0}
#page-setup #branchInvoiceSequenceRows{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
#page-setup .setup-find{position:relative;flex:0 1 620px;min-width:220px}
#page-setup #setupSearch{width:100%;height:38px;min-height:38px;padding:8px 12px;font-size:13px;background:var(--pale,#f6f7fc)}
#page-setup .setup-find-results{position:absolute;top:calc(100% + 6px);right:0;left:0;z-index:90;background:var(--surface,#fff);border:1px solid var(--line,#dce2ef);border-radius:12px;box-shadow:0 12px 35px #172b4d20;max-height:min(420px,65vh);overflow-y:auto;padding:6px}
#page-setup .setup-find-results>button{width:100%;display:grid;text-align:left;gap:3px;border:0;background:transparent;color:var(--ink,#10203c);padding:10px;border-radius:8px;cursor:pointer}
#page-setup .setup-find-results>button:is(:hover,.active){background:var(--violet-light,#f0eaff)}
#page-setup .setup-find-results>button strong{font-size:13px}
#page-setup .setup-find-results>button small{font-size:11px;color:var(--muted,#64748b)}
#page-setup .setup-find .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#page-setup .setup-search-target{outline:2px solid var(--violet,#5931ed)!important;outline-offset:3px;transition:outline-color .2s}
@media(max-width:1100px){#page-setup .setup-shell{grid-template-columns:190px minmax(0,1fr)}#page-setup [data-invoice-sequence-row]{grid-template-columns:minmax(130px,1fr) 90px 110px;gap:10px}#page-setup [data-invoice-sequence-row] label.check{grid-column:1/3}#page-setup [data-invoice-sequence-row]>button{justify-self:end}}
@media(max-width:760px){.page-host:has(#page-setup.active){padding:8px}#page-setup>.page-head{padding:10px;gap:8px;flex-wrap:wrap}#page-setup>.page-head h1{font-size:18px}#page-setup .setup-find{flex:1 1 100%;min-width:0}#page-setup .setup-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px}#page-setup .setup-nav{display:flex;flex-wrap:wrap;gap:4px;max-height:160px;padding:5px}#page-setup .setup-nav-group{flex:1 1 130px;margin:0}#page-setup .setup-nav-group>summary{padding:7px;font-size:10px}#page-setup .setup-nav-group>button{font-size:11px;min-height:30px;padding:5px 7px}#page-setup .setup-content .panel{padding:10px}#page-setup .branch-profile-tabs{display:flex;flex-wrap:wrap}#page-setup .branch-profile-tabs button{flex:1 1 110px}#page-setup [data-invoice-sequence-row]{grid-template-columns:minmax(0,1fr) 100px}#page-setup [data-invoice-sequence-row]>.sequence-identity{grid-column:1/-1}#page-setup [data-invoice-sequence-row] label.check{grid-column:1/-1}#page-setup [data-invoice-sequence-row]>button{grid-column:2}#page-setup .setup-content .branch-save-bar{gap:8px;padding:8px}}

#page-setup .setup-content textarea.setup-editor-expanded{height:240px!important;min-height:180px;max-height:60vh}
#page-setup .setup-content .setup-expand-editor{justify-self:end;align-self:end;min-height:26px!important;padding:4px 8px!important;font-size:11px!important}

#page-setup .setup-mobile-select{display:none}
@media(max-width:760px){#page-setup .setup-nav{display:block;overflow:visible;max-height:none;padding:6px}#page-setup .setup-nav-group{display:none}#page-setup .setup-mobile-select{display:block;width:100%;height:35px;font-size:13px;padding:6px 10px}}

#page-setup>.page-head{overflow:visible}
#page-setup .setup-main{display:grid;grid-template-rows:minmax(0,1fr) auto;height:100%;min-height:0;min-width:0;gap:8px}
#page-setup .setup-main>.setup-content{height:auto;min-height:0;padding-bottom:0}
#page-setup .setup-main>.branch-save-bar{position:static!important;margin:0!important;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:var(--surface,#fff);border:1px solid var(--line,#e0e5ef);border-radius:12px;min-height:52px;box-shadow:none;z-index:15}
#page-setup .setup-main>.branch-save-bar[hidden]{display:none!important}
#page-setup .setup-main>.branch-save-bar button{min-height:34px;padding:7px 12px;font-size:12px;flex-shrink:0}
@media(max-width:760px){#page-setup .setup-main>.branch-save-bar{padding:8px;gap:8px;font-size:11px}}

@media(min-width:1101px){#page-setup #setup-branch .branch-profile-appearance>.branch-profile-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}#page-setup #setup-branch .branch-profile-appearance>.branch-profile-fields>.branch-setting-row{grid-column:1/-1}#page-setup #setup-branch .branch-profile-appearance>.branch-profile-fields>.branch-text-editor{grid-column:auto}#page-setup #setup-branch .branch-profile-appearance>.branch-profile-fields>.branch-text-editor.is-expanded{grid-column:1/-1}}

/* Quiet typography and shared sequence columns. */
#page-setup .setup-content :is(input,select,textarea){font-weight:400!important}
#page-setup .setup-content :is(label,.setting-copy strong){font-weight:500!important}
#page-setup .setup-content :is(p,small,td){font-weight:400}
#page-setup .setup-content :is(h2,h3){font-weight:600}
#page-setup :is(button.primary,button.secondary){font-weight:500!important}
#page-setup .setup-nav-group>summary{font-weight:500}
#page-setup .setup-nav-group>button>b{font-weight:400}
#page-setup .setup-nav-group>button.active>b{font-weight:600}
#page-setup [data-invoice-sequence-row],#page-setup .sequence-register-head{grid-template-columns:minmax(180px,1.3fr) minmax(110px,.65fr) minmax(120px,.7fr) minmax(160px,.9fr) 112px;gap:12px}
#page-setup .sequence-register-head{display:grid;align-items:center;padding:8px 12px;background:var(--pale,#f6f7fc);border-bottom:1px solid var(--line,#e0e5ef);border-radius:8px 8px 0 0;color:var(--muted,#64748b);font-size:12px;font-weight:500}
#page-setup [data-invoice-sequence-row]{padding:10px 12px;border-radius:8px}
#page-setup [data-invoice-sequence-row] .sequence-identity strong{font-weight:500;font-size:13px}
#page-setup [data-invoice-sequence-row] label{position:relative;font-weight:400!important}
#page-setup [data-invoice-sequence-row] .sequence-field-label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
#page-setup [data-invoice-sequence-row] label.check{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;min-height:35px}
#page-setup [data-invoice-sequence-row] .sequence-info{font-size:13px;font-weight:400;color:var(--muted,#64748b)}
#page-setup [data-invoice-sequence-row] input{width:100%;font-weight:400!important}
#page-setup [data-invoice-sequence-row]>button{align-self:center;min-height:35px!important;white-space:nowrap!important}
@media(max-width:1100px){#page-setup .sequence-register-head{display:none}#page-setup [data-invoice-sequence-row]{grid-template-columns:minmax(130px,1fr) 110px 130px}#page-setup [data-invoice-sequence-row] .sequence-field-label{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:normal;font-size:12px}#page-setup [data-invoice-sequence-row] label.check{grid-column:1/3}}
@media(max-width:760px){#page-setup [data-invoice-sequence-row]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#page-setup [data-invoice-sequence-row] label.check{grid-column:1/-1}#page-setup [data-invoice-sequence-row]>button{grid-column:2;justify-self:end}}

#page-setup .setup-content [data-invoice-sequence-row],#page-setup .setup-content .sequence-register-head{box-sizing:border-box;width:100%;grid-column:1/-1;padding-left:12px;padding-right:12px;margin:0}
#page-setup .setup-content .sequence-register-head{border:1px solid transparent;border-bottom-color:var(--line,#e0e5ef)}
#page-setup .setup-content [data-invoice-sequence-row]{padding-top:10px;padding-bottom:10px}
#page-setup .setup-content [data-invoice-sequence-row]>button{width:100%;justify-self:stretch}
#page-setup .setup-content [data-invoice-sequence-row] small{font-size:12px;font-weight:400}

#page-setup>.page-head h1,#page-setup .setup-content th{font-weight:600}

#page-setup .sequence-register-head{position:sticky;top:0;z-index:6}
