/* Billion / second edition. One reversible layer; all functional DOM stays intact. */
:root{
 --billion-canvas:#f5f5f0;--billion-paper:#fff;--billion-ink:#192e26;--billion-muted:#59685e;
 --billion-line:#dce3d9;--billion-input:#819481;--billion-soft:#eef2e9;
 --billion-forest:#143d2c;--billion-accent:#d4edaa;--billion-on-accent:#183122;
 --billion-action:#1e5138;--billion-on-action:#fff;--billion-focus:#2b704a;--billion-link:#286141;
 --billion-shadow:0 2px 4px #18332103,0 12px 32px #18332106;
 --bd-radius:16px;--bd-small:9px;--bd-space:24px;
}
html[data-theme=dark]{
 --billion-canvas:#111b16;--billion-paper:#19271f;--billion-ink:#eff4e9;--billion-muted:#b6c4b0;
 --billion-line:#3a4b3c;--billion-input:#7f947c;--billion-soft:#263a2c;
 --billion-action:#d4edaa;--billion-on-action:#183122;--billion-focus:#d4edaa;--billion-link:#cbe7a6;
 --billion-shadow:0 2px 4px #0002,0 12px 32px #0001;
}
/* Workspace frame and navigation. Scroll containers and permission visibility survive. */
html #shell{background:var(--billion-canvas);grid-template-columns:248px minmax(0,1fr);font-size:14px;line-height:1.6}
html #shell .workspace{min-width:0;margin:12px 12px 12px 0;margin-inline-start:0;margin-inline-end:12px;border:1px solid var(--billion-line);border-radius:22px;background:var(--billion-canvas);min-height:calc(100dvh - 24px)}
html #shell .sidebar,html[dir] #shell .sidebar,html[data-theme=dark] #shell .sidebar{padding:24px 16px;background:var(--billion-canvas);color:var(--billion-ink)}
html #shell .sidebar .logo{height:44px;min-height:44px;padding:4px 12px;margin-bottom:22px}
html #shell .sidebar .logo img{height:30px;max-width:140px;filter:none}
html[data-theme=dark] #shell .sidebar .logo img{filter:brightness(0) invert(1)}
html #shell .sidebar .nav-search{min-height:40px;margin-bottom:22px;padding:10px 12px;background:var(--billion-paper);color:var(--billion-ink);border:1px solid var(--billion-line);border-radius:var(--bd-small);box-shadow:0 2px 4px #18332103}
html #shell .sidebar .nav-search::placeholder{color:var(--billion-muted)}
html #shell .nav button[data-view],html #shell .nav-group summary,html[lang=ar] #shell .nav-group summary{font-size:13px;color:var(--billion-muted);font-weight:500;min-height:40px;border-radius:var(--bd-small)}
html #shell .reference-nav-group>summary,html[lang=ar] #shell .reference-nav-group>summary{padding:10px 12px;min-height:42px;font-size:13px;color:var(--billion-muted)}
html #shell .reference-nav-group .nav-items>button[data-view]{min-height:36px;padding:7px 12px}
html #shell .nav button[data-view]:hover:not(.active),html[dir=rtl] #shell .nav button[data-view]:hover:not(.active),html #shell .reference-nav-group>summary:hover{background:var(--billion-soft);color:var(--billion-ink)}
html #shell .nav button.active,html #shell .nav button.active:hover,html #shell .reference-nav-group:not([data-group-key=marketingNav]):has(>.nav-items>.reference-primary-duplicate.active)>summary{color:var(--billion-on-accent);background:var(--billion-accent);box-shadow:none}
html #shell .reference-nav-group>summary::after,html #shell .reference-nav-group[data-group-key=onlineStoreChannel]::before,html[lang=ar] #shell .reference-nav-group[data-group-key=onlineStoreChannel]::before{color:var(--billion-muted)}
html #shell .reference-nav-group[data-group-key=storeSetup]{margin-top:24px;padding-top:16px;border-color:var(--billion-line)}
html #shell .topbar{height:68px;min-height:68px;padding:12px 28px;background:var(--billion-paper);color:var(--billion-ink);border-bottom:1px solid var(--billion-line);gap:16px}
html #shell .topbar .page-trail,html #shell .topbar .page-trail b,html #shell .topbar .page-trail span,html #shell #userName,html #shell #userRole{color:var(--billion-ink)}
html #shell .topbar :is(#brandSelect,.toolbar-select,.theme-toggle,#logoutButton){background:var(--billion-paper);color:var(--billion-ink);border-color:var(--billion-line);min-height:36px;border-radius:var(--bd-small)}
html #shell .content{padding:32px clamp(20px,3vw,48px) 64px;min-width:0}
html #shell .content h1{font-size:clamp(24px,2.3vw,32px);line-height:1.4;font-weight:700;letter-spacing:-.025em;overflow-wrap:anywhere}
html[lang=ar] #shell .content h1{letter-spacing:0}
html #shell :is(.reference-resource-heading,.workspace-home-heading,.reference-settings-heading){margin-bottom:24px;gap:16px}
html #shell :is(.reference-resource-heading,.workspace-home-heading,.reference-settings-heading) h1{margin:0}
html #shell .muted,html #editor .muted{color:var(--billion-muted)}
/* Common surfaces, detail cards, settings and reports. */
html :is(#shell,#editor){--bw-panel:var(--billion-paper);--bw-card:var(--billion-paper);--bw-text:var(--billion-ink);--bw-muted:var(--billion-muted);--bw-line:var(--billion-line);--bw-hover:var(--billion-soft);--bw-muted-bg:var(--billion-soft)}
html #shell :is(.card,.index-record-card,.reference-settings-card,.general-settings-card,.analytics-metric-card,.reference-resource-card){border:1px solid var(--billion-line);border-radius:var(--bd-radius);background:var(--billion-paper);box-shadow:var(--billion-shadow)}
html #shell :is(.card,.reference-settings-card,.general-settings-card){padding:24px}
html #shell :is(.card,.reference-settings-card,.general-settings-card) h2{font-size:16px;line-height:1.5}
html #shell .detail-grid{gap:24px;align-items:start}
html #shell :is(.index-toolbar,.reference-resource-toolbar,.surface-toolbar){gap:12px;padding:16px 20px;background:var(--billion-paper);border-color:var(--billion-line)}
html #shell :is(.analytics-top-metrics,.analytics-card-grid){gap:20px}
html #shell .analytics-metric-card{padding:24px}
html #shell .analytics-metric-card strong{font-size:28px;line-height:1.4;font-weight:700;letter-spacing:-.03em}
html #shell :is(.metric-strip,.home-reference-metrics,.order-reference-metrics,.product-reference-metrics){border-color:var(--billion-line);border-radius:var(--bd-radius);background:var(--billion-paper);box-shadow:var(--billion-shadow)}
html #shell :is(.order-metric-cells,.metric-strip) strong{font-size:24px;line-height:1.5}
html #shell :is(.empty-state,.order-empty-state){padding:56px 24px;min-height:360px}
html #shell :is(.empty-state,.order-empty-state) h2{font-size:22px;line-height:1.4}
html #shell :is(.empty-state,.order-empty-state) p{font-size:14px;line-height:1.9;color:var(--billion-muted)}
/* Tables remain semantic tables and keep their existing internal scroll regions. */
html #shell table{border-collapse:separate;border-spacing:0;font-size:13px;color:var(--billion-ink)}
html #shell table th{padding-top:14px;padding-bottom:14px;background:var(--billion-soft);color:var(--billion-muted);font-size:12px;font-weight:500;border-color:var(--billion-line)}
html #shell table td{padding-top:14px;padding-bottom:14px;border-color:var(--billion-line);vertical-align:middle}
html #shell table tbody tr:hover{background:color-mix(in srgb,var(--billion-soft) 65%,transparent)}
html #shell :is(.table-wrap,.index-table-wrap){border-color:var(--billion-line);border-radius:0 0 var(--bd-radius) var(--bd-radius)}
html #shell .badge{font-size:12px;line-height:1.5;border-radius:6px;padding:3px 8px;font-weight:500}
/* Controls retain their handlers, disabled states, names and accessible labels. */
html :is(#shell,#editor) :is(button,a).primary:not(.danger):not(:disabled):not([aria-disabled=true]){border-radius:var(--bd-small);min-height:38px;padding:9px 16px;font-weight:500;box-shadow:0 1px 2px #16382014}
html :is(#shell,#editor) .secondary:not(.danger){border-radius:var(--bd-small);border-color:var(--billion-line)}
html :is(#shell,#editor) :is(input.control,select.control,textarea.control){border-radius:var(--bd-small);border-color:var(--billion-input);background:var(--billion-paper);color:var(--billion-ink);min-height:40px;padding:9px 12px;font-size:14px;box-sizing:border-box;max-width:100%}
html :is(#shell,#editor) :is(input.control,select.control,textarea.control):focus{border-color:var(--billion-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--billion-focus) 14%,transparent)}
html :is(#shell,#editor) :is(input,textarea)::placeholder{color:var(--billion-muted);opacity:.8}
html #shell .tabs{gap:8px;padding-block:8px;border-color:var(--billion-line)}
html #shell .tabs .tab{padding:10px 16px;border-radius:var(--bd-small);font-size:13px}
html #shell .tabs .tab.active{background:var(--billion-soft);box-shadow:none;font-weight:700;color:var(--billion-ink)}
html :is(#shell,#editor) :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--billion-focus);outline-offset:3px}
/* Existing drawers and task-specific modal positioning are deliberately retained. */
html #editor{grid-template-columns:minmax(0,1fr);background:#0b201b80;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
html #editor .editor-panel{box-sizing:border-box;min-width:0;border:1px solid var(--billion-line);border-radius:20px;background:var(--billion-paper);color:var(--billion-ink);box-shadow:0 24px 80px #071d1933}
html #editor .editor-panel>header{border-bottom-color:var(--billion-line);padding-block:20px}
html #editor .editor-panel h2{font-size:20px;line-height:1.5;font-weight:700}
html #editor .editor-panel footer{border-top-color:var(--billion-line)}
html #editor :is(.report-configure-reference-panel,.shipping-rate-editor-panel,.shipping-zone-editor-panel){border-radius:0}
html #toast{border:1px solid var(--billion-line);border-radius:12px;box-shadow:0 8px 32px #112c2026}
/* Public site: warm editorial canvas, large type and a restrained product stage. */
body.billion-home{background:#f5f5ed;color:#183126}
.billion-home>header{max-width:none;padding:22px 6%;border-bottom:1px solid #d9e1d4;background:#f5f5ed;color:#183126;gap:24px}
.billion-home .brand img{filter:none;width:132px;height:38px}
.billion-home>header nav{gap:28px;color:#274c37}
.billion-home .signin{border-color:#879c80;border-radius:8px;min-height:44px;padding-inline:22px}
.billion-home .hero-workspace{max-width:1440px;padding:88px 6% 36px;min-height:auto;gap:64px;background:none}
.billion-home .hero-workspace:before,.billion-home .hero-workspace:after{background:none}
.billion-home .hero-copy .eyebrow{display:inline-flex;align-items:center;gap:8px;border:1px solid #cfdbc5;background:#ebf0df;color:#395d39;border-radius:99px;padding:8px 14px;margin:0 0 28px;font-size:11px}
.billion-home .hero h1{font-size:clamp(52px,5.2vw,80px);font-weight:500;line-height:1.22;letter-spacing:-.05em;color:#173b29}
html[dir=ltr] .billion-home .hero h1{line-height:1.12;font-weight:500}
.billion-home .intro{margin-top:24px;max-width:440px}
.billion-home .intro p{font-size:17px;line-height:1.9;color:#5b6d5b}
.billion-home .cta{min-width:200px;border-radius:10px;background:#1e5138;color:#fff;padding:15px 22px;font-weight:500;box-shadow:0 4px 12px #143b2014}
.billion-home .cta:hover{background:#143d2c}
.billion-home .product-window{transform:none;border:1px solid #466b49;border-radius:22px;background:#143d2c;color:#f1f6e9;box-shadow:0 24px 70px #1b3b291c;overflow:hidden}
.billion-home .product-window figcaption{background:#102e22;border-color:#ffffff20;color:#cadbbf;padding:16px 20px}
.billion-home .window-content{padding:24px}
.billion-home .window-toolbar{padding:20px 24px;border-color:#ffffff20}
.billion-home .window-categories .selected{background:#d4edaa;color:#183122;border-color:#d4edaa}
.billion-home .window-categories>span:not(.selected){color:#c4d6bb}
.billion-home .window-product{padding-block:20px;border-color:#ffffff20}
.billion-home .product-meta,.billion-home .window-summary{color:#c2d3ba}
.billion-home .window-summary{border-color:#ffffff20}
.billion-home .hero-bottom{grid-column:1/-1;margin-top:28px;padding-top:24px;border-color:#cedbc5;color:#53674c}
.billion-home .platform{max-width:none;padding:100px 6%;background:#e6eddc;color:#183126;gap:40px}
.billion-home .platform h2{font-size:clamp(36px,4.6vw,64px);line-height:1.35;font-weight:500;letter-spacing:-.035em}
.billion-home .platform .details{font-size:16px;line-height:2;color:#47613f}
.billion-home .workflow{max-width:1440px;padding:100px 6%;color:#183126}
.billion-home .workflow-heading h2,.billion-home .questions h2{font-size:clamp(32px,4vw,54px);line-height:1.35;font-weight:500}
.billion-home .workflow-card{border:1px solid #d6dfcf;border-radius:16px;background:#fff;padding:32px;color:#183126;box-shadow:0 4px 16px #1b3b2903}
.billion-home .workflow-card h3{font-size:21px;font-weight:700;line-height:1.5}
.billion-home .workflow-card p,.billion-home .workflow-heading>p:last-child{color:#52654a}
.billion-home .workflow-index{color:#537247;font-size:12px}
.billion-home .workflow-detail{border-color:#d6dfcf;color:#48663f}
.billion-home .questions{background:#eef2e6;border-color:#d6dfcf;color:#183126;border-radius:20px;max-width:calc(1440px - 12%);margin:0 auto 88px;padding:48px}
.billion-home .questions details{border-color:#cbd8bf}
.billion-home .questions p,.billion-home .questions a{color:#455f3e}
.billion-home>footer{max-width:none;padding:48px 6%;border-top:1px solid #d6dfcf;background:#e6eddc;color:#254b33}
.billion-home>footer p{color:#496342}
.billion-home.not-found{min-height:100dvh}
.billion-home.not-found main{max-width:1000px;padding-block:96px}
.billion-home.not-found h1{font-size:clamp(36px,5vw,72px);line-height:1.3;font-weight:500}
.billion-home.not-found main>p:not(.eyebrow){color:#52654a}
.billion-home.not-found .error-actions{gap:16px}
/* Entry is a deliberate two-panel composition; every auth state reuses the form. */
html #login.login{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,520px);grid-template-rows:auto 1fr;direction:ltr;align-items:start;gap:24px 7vw;padding:28px 5vw 40px;overflow:visible;background:var(--billion-canvas)}
html #login.login:before{content:'';position:absolute;inset:16px auto 16px 16px;width:calc(48% - 16px);height:auto;border-radius:24px;z-index:0;pointer-events:none;background:radial-gradient(ellipse at 70% 76%,#a0ca6133,transparent 46%),repeating-radial-gradient(ellipse at 10% 90%,transparent 0,transparent 78px,#d4edaa12 79px,transparent 80px),#143d2c}
html #login.login:after{content:'';position:absolute;left:8%;top:42%;width:30%;height:20%;background:url('/admin/assets/billion-wordmark.svg') center/contain no-repeat;filter:brightness(0) invert(1);opacity:.9;pointer-events:none}
html #login .framework-header{grid-column:1/-1;grid-row:1;width:100%;max-width:none;padding:0;z-index:1;box-sizing:border-box}
html #login .framework-header>a:first-child img{filter:brightness(0) invert(1);width:132px}
html #login .login-card,html[data-theme=dark] #login .login-card{grid-column:2;grid-row:2;width:100%;max-width:480px;margin:clamp(32px,9vh,100px) auto 24px;padding:36px;border:1px solid var(--billion-line);border-radius:20px;background:var(--billion-paper);box-shadow:var(--billion-shadow);z-index:1}
html[dir=rtl] #login .login-card{direction:rtl}
html[dir=ltr] #login .login-card{direction:ltr}
html #login h1{font-size:36px;line-height:1.4;font-weight:700;margin:0 0 12px}
html #login #loginIntro,html #login #registrationIntro,html #login #recoveryIntro,html #login #socialIntro{font-size:15px;line-height:1.9;margin-bottom:28px}
html #login .control{border-radius:10px;background:var(--billion-paper);border-color:var(--billion-input);min-height:52px;padding:13px 15px}
html #login .framework-email.compact{border-radius:12px;padding:5px 6px 5px 16px;background:var(--billion-paper);border-color:var(--billion-input)}
html #login .framework-email.compact #loginSubmit{border-radius:8px}
html #login .login-card .primary,html #login .login-card .primary:not(:disabled){border-radius:10px;box-shadow:0 2px 4px #16382012}
html #login .secondary,html #login #appleSignInButton,html #login #passkeySignIn{border-radius:10px;backdrop-filter:none;-webkit-backdrop-filter:none}
html #login .framework-header .login-tools .secondary{border-radius:8px;background:var(--billion-paper);box-shadow:none}
html #login .registration-policies{gap:8px 20px;border-top:1px solid var(--billion-line);padding-top:16px;margin-top:24px}
html #login #authNoScript{grid-column:2;grid-row:2;z-index:1}
/* Help, policies and account documents share the same reading rhythm. */
html.auth-document body{padding:32px 20px}
html.auth-document main,html.auth-document[data-theme] main{max-width:880px;width:min(100%,880px);padding:40px;border-radius:20px;background:var(--billion-paper);box-shadow:var(--billion-shadow);border:1px solid var(--billion-line);margin:24px auto}
html.auth-document h1{font-size:clamp(28px,4vw,40px);line-height:1.5;margin-top:32px}
html.auth-document h2{font-size:21px;line-height:1.6}
html.auth-document p{font-size:15px;line-height:2}
html.auth-document .auth-assistance{border-radius:14px;background:var(--billion-soft);padding:24px}
html.auth-document button,html.auth-document input{border-radius:9px}
html.auth-document details{padding-block:20px}
html.auth-document summary{line-height:1.7}
html.auth-document .auth-brand{justify-content:flex-start!important;padding-bottom:24px;border-bottom:1px solid var(--billion-line)}
@media(min-width:1600px){html #shell .content{max-width:1560px;margin-inline:auto}}
@media(max-width:1100px) and (min-width:901px){html #shell{grid-template-columns:220px minmax(0,1fr)}html #shell .topbar{padding-inline:20px}html #shell .content{padding-inline:24px}}
@media(max-width:960px){
 html #login.login{display:flex;direction:inherit;align-items:center;padding:24px 24px 40px;gap:0}
 html #login.login:before,html #login.login:after{display:none}
 html #login .framework-header{padding:0 0 20px}
 html #login .framework-header>a:first-child img{filter:none}
 html[data-theme=dark] #login .framework-header>a:first-child img{filter:brightness(0) invert(1)}
 html #login .login-card,html[data-theme=dark] #login .login-card{margin:40px auto 0;padding:32px;max-width:500px}
}
@media(max-width:900px){
 html #shell{grid-template-columns:minmax(0,1fr)}
 html #shell .workspace{margin:0;border:0;border-radius:0;min-height:100dvh}
 html #shell .topbar{height:60px;min-height:60px;padding:10px 16px}
 html #shell .content{padding:24px 20px 88px}
 html #shell.mobile-nav-open .sidebar{background:var(--billion-paper);width:min(360px,calc(100vw - 24px));padding:24px 16px;box-shadow:0 0 0 100vmax #091c1766;border-inline-end:1px solid var(--billion-line)}
 html #shell .sidebar .mobile-nav-close{background:var(--billion-soft);color:var(--billion-ink);width:36px;height:36px;min-height:36px}
 html #shell .sidebar .logo{padding-inline-end:48px}
 html #shell .nav button[data-view],html #shell .reference-nav-group>summary,html[lang=ar] #shell .reference-nav-group>summary{min-height:44px;font-size:14px}
 html #shell .detail-grid{gap:20px}
 .billion-home .hero-workspace{padding-top:56px;gap:36px}
 .billion-home .hero h1{font-size:clamp(48px,5.4vw,72px)}
 .billion-home .questions{max-width:88%;padding:32px}
}
@media(max-width:600px){
 :root{--bd-space:16px;--bd-radius:13px}
 html #shell .content{padding:20px 16px 88px}
 html #shell .content h1{font-size:25px;line-height:1.5}
 html #shell :is(.reference-resource-heading,.workspace-home-heading,.reference-settings-heading){gap:12px;margin-bottom:20px;flex-wrap:wrap}
 html #shell :is(.card,.reference-settings-card,.general-settings-card){padding:20px}
 html #shell :is(.index-toolbar,.reference-resource-toolbar,.surface-toolbar){padding:12px;gap:8px;flex-wrap:wrap}
 html #shell .analytics-metric-card{padding:18px}
 html #shell .analytics-metric-card strong{font-size:24px}
 html #shell table :is(th,td){padding-top:15px;padding-bottom:15px}
 html :is(#shell,#editor) :is(input.control,select.control,textarea.control){font-size:16px;min-height:44px}
 html :is(#shell,#editor) :is(button,a).primary:not(.danger):not(:disabled):not([aria-disabled=true]){min-height:42px;padding:10px 14px}
 html #editor .editor-panel{max-width:100%;border-radius:16px}
 html #editor :is(.report-configure-reference-panel,.shipping-rate-editor-panel,.shipping-zone-editor-panel){border-radius:0}
 .billion-home>header{padding:18px 6%;gap:16px}
 .billion-home>header nav{gap:16px}
 .billion-home .brand img{width:112px;height:32px}
 .billion-home .signin{padding-inline:14px;min-height:42px}
 .billion-home .hero-workspace{padding:48px 6% 28px;gap:32px}
 .billion-home .hero h1{font-size:clamp(46px,11vw,64px);line-height:1.3}
 .billion-home .hero-copy .eyebrow{margin-bottom:22px}
 .billion-home .intro p{font-size:16px}
 .billion-home .cta{width:100%;box-sizing:border-box;margin-top:24px;min-height:54px}
 .billion-home .window-content{padding:20px}
 .billion-home .hero-bottom{margin-top:8px;padding-top:20px;font-size:11px}
 .billion-home .platform,.billion-home .workflow{padding:64px 6%;gap:24px}
 .billion-home .workflow-card{padding:24px}
 .billion-home .questions{padding:28px 22px;margin-bottom:56px;border-radius:16px}
 .billion-home>footer{padding:36px 6%;gap:24px}
 .billion-home.not-found main{padding-block:56px}
 html #login.login{padding:20px 20px 32px}
 html #login .login-card,html[data-theme=dark] #login .login-card{margin-top:24px;padding:28px 22px;border-radius:16px}
 html #login h1{font-size:30px}
 html #login .framework-header img{width:112px}
 html.auth-document body{padding:12px}
 html.auth-document main,html.auth-document[data-theme] main{padding:24px 20px;margin:12px auto;border-radius:16px}
 html.auth-document .auth-assistance{padding:20px}
}
@media(prefers-reduced-motion:reduce){#shell *,#editor *,#login *,body.billion-home *{scroll-behavior:auto;transition:none!important;animation:none!important}}
@media(forced-colors:active){
 #shell .sidebar,#shell .workspace,#shell .topbar,#editor .editor-panel,#login .login-card,.billion-home .product-window{border:1px solid CanvasText;box-shadow:none}
 #shell .nav button.active,#shell .tabs .tab.active{outline:2px solid Highlight}
 #login.login:before,#login.login:after{display:none}
 :is(#login,#shell,#editor,.auth-document,.billion-home) :is(a,button,input,select,textarea,summary):focus-visible{outline:2px solid Highlight}
}
