:root{
  color-scheme:light;
  --bg:#f8fafc;
  --white:#fff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --accent:#4f46e5;
  --accent-dark:#4338ca;
  --accent-bg:#eef2ff;
  --accent-line:#c7d2fe;
  --rail:220px;
  --bar:60px;
  --shadow:0 1px 2px #0f172a08;
  font:14px/1.5 "Segoe UI","Microsoft YaHei UI",sans-serif;
  color:var(--text);
  background:var(--bg);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
a{color:var(--accent-dark);text-decoration:none}
a:hover{text-decoration:underline}
button,input,select,textarea{font:inherit}
button{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--accent);color:white;border:1px solid transparent;border-radius:6px;padding:7px 13px;min-height:34px;cursor:pointer;font-weight:500;transition:background .15s,border-color .15s}
button:hover{background:var(--accent-dark)}
button:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
button.quiet,button.sort,button.active-tab{background:var(--white);color:#334155;border-color:var(--line)}
button.quiet:hover{background:var(--accent-bg);border-color:var(--accent-line);color:var(--accent-dark)}
button.sort{padding:0;min-height:0;border:none;background:transparent;white-space:nowrap;font-weight:650;color:inherit}
button.active-tab{background:var(--accent-bg);border-color:var(--accent-line);color:var(--accent-dark);font-weight:600}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
input:not([type=checkbox]),select,textarea{color:var(--text);border:1px solid var(--line);border-radius:6px;background:var(--white);padding:7px 10px;max-width:100%;min-width:0;min-height:34px;transition:border-color .15s,box-shadow .15s}
input::placeholder,textarea::placeholder{color:#94a3b8}
input:not([type=checkbox]):focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg);outline:0}
input[readonly],input:disabled,select:disabled{background:var(--bg);color:var(--muted)}
input[type=checkbox]{accent-color:var(--accent);width:16px;height:16px;vertical-align:middle;cursor:pointer}
input[type=file]{padding:6px;max-width:100%;font-size:13px}
input[type=file]::file-selector-button{font:inherit;color:var(--accent-dark);background:var(--accent-bg);border:0;border-radius:5px;padding:5px 9px;margin-right:10px;cursor:pointer}
textarea{resize:vertical;line-height:1.65;min-height:86px}
svg{flex-shrink:0}
.skip-link{position:fixed;top:-70px;left:12px;z-index:30;background:white;padding:10px 18px;border:2px solid var(--accent);border-radius:8px}
.skip-link:focus{top:10px}
.topbar{height:var(--bar);position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:12px;padding:0 24px 0 0;background:var(--white);border-bottom:1px solid var(--line)}
.brand{height:100%;flex:0 0 var(--rail);display:flex;align-items:center;gap:10px;border-right:1px solid var(--line);padding:0 18px;color:var(--text)}
.brand strong{display:block;font-size:16px;line-height:1.35;font-weight:650;white-space:nowrap}
.brand-caption{display:block;font-size:11px;color:var(--muted);margin-top:1px}
.brand-mark{width:32px;height:32px;fill:none;stroke:var(--accent);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.header-breadcrumb{font-size:13px;color:#475569;white-space:nowrap;margin:0 auto 0 12px}
.header-breadcrumb::before{content:"管理 / ";color:var(--muted);margin-right:7px}
.header-tools{display:flex;align-items:center;gap:10px;min-width:0;margin-left:auto}
.topbar .account{margin-left:auto;color:#334155;font-weight:600;min-width:0;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar button{font-size:12px;min-height:32px;padding:6px 10px;white-space:nowrap}
.topbar #logout{border:0;background:transparent;color:var(--muted);padding-left:4px;padding-right:4px}
.topbar #logout:hover{color:var(--accent);background:var(--accent-bg)}
.topbar :is(#help-link,#last-batch-link){font-size:12px;white-space:nowrap}
.portal-back{font-size:12px;white-space:nowrap}
.topbar .badge{font-size:11px;background:var(--bg);color:var(--muted);white-space:nowrap}
main{min-width:0}
#login{width:min(430px,calc(100% - 36px));margin:clamp(36px,10vh,100px) auto 50px;background:white;padding:36px;border:1px solid var(--line);border-radius:18px;box-shadow:0 14px 50px #29203c07}
.login-symbol{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border:1px solid var(--accent-line);border-radius:12px;background:var(--accent-bg);margin-bottom:25px}
.login-symbol svg{width:32px;height:32px;fill:none;stroke:var(--accent);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#login form{display:grid;align-items:stretch;gap:19px;margin:27px 0 22px}
#login form label{font-size:13px}
#login form input{min-height:44px}
#login form button{min-height:44px;margin-top:5px}
#login h1{font-size:27px;margin:7px 0 8px;letter-spacing:.3px}
.login-intro{color:var(--muted);font-size:13px}
.login-footnote{font-size:11px;text-align:center;color:var(--muted);border-top:1px solid var(--line);padding-top:18px;margin:0}
body:has(#workspace[hidden]) .header-breadcrumb{display:none}
#workspace{display:grid;grid-template-columns:var(--rail) minmax(0,1fr);min-height:calc(100dvh - var(--bar))}
.workspace-main{min-width:0}
.app-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:8px 24px;background:var(--white);border-bottom:1px solid var(--line)}
body:not(.portal-home) .app-bar:has(#product-switch[hidden],#current-product:disabled){display:none}
#product-switch{display:flex;align-items:center;gap:10px;color:#475569;font-size:13px;min-width:0;max-width:100%;white-space:nowrap}
#current-product{width:220px;max-width:100%;min-height:32px;padding:5px 10px;font-size:13px}
.portal-brand,.portal-online,.portal-app-secondary,.portal-validation{display:none}
.portal-home .portal-back{display:none}
.portal-home .portal-brand{display:inline-flex;align-items:center;gap:5px;color:var(--accent);font-size:12px;font-weight:600;white-space:nowrap}
.portal-home .portal-brand:hover{color:var(--accent-dark);text-decoration:none}
.portal-home .portal-online,.portal-home #environment{display:inline-flex;align-items:center;gap:5px;min-height:23px;padding:2px 8px;border:1px solid;border-radius:99px;font-size:11px;font-weight:600;white-space:nowrap}
.portal-home .portal-online{background:#ecfdf5;border-color:#a7f3d0;color:#065f46}
.portal-home .portal-online::before{content:"";width:6px;height:6px;border-radius:50%;background:#22c55e}
.portal-home #environment{background:#6d28d9;border-color:#6d28d9;color:#fff}
.portal-home .topbar #help-link{display:inline-flex}
.portal-home .workspace-main{--shadow:0 1px 3px #0000000f;padding:20px 24px 40px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
.portal-home #content{padding:0}
.portal-home #page-load-status:not(.error),.portal-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.portal-home .app-bar{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);align-items:center;gap:9px 10px;min-height:89px;margin:0 0 16px;padding:10px 16px;border:1px solid var(--line);border-radius:12px;background:var(--white);box-shadow:var(--shadow)}
.portal-home .app-bar:not(:has(> :not([hidden]))){display:none}
.portal-home #product-switch{grid-column:1;grid-row:1;gap:10px;width:auto;font-size:13px}
.portal-home #current-product{flex:1;width:0;min-height:27px;padding:3px 8px;font-size:12px;text-overflow:ellipsis}
.portal-app-actions,.portal-home .portal-app-secondary{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.portal-home .portal-app-actions{grid-column:2;grid-row:1}
.portal-home .portal-app-secondary{grid-column:1;grid-row:2;justify-content:flex-end}
.portal-home .portal-validation{display:flex;align-items:center;justify-self:end;grid-column:2;grid-row:2;gap:6px;color:var(--muted);font-size:12px;text-align:right}
.portal-home .portal-validation strong{color:#166534;font-weight:600}
:is(.portal-app-actions,.portal-app-secondary,.home-quick) :is(a,button),.home-portal-shortcut{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:29px;padding:5px 10px;border:0;border-radius:6px;background:var(--accent);color:#fff;font-size:12px;font-weight:500;line-height:1.5}
:is(.portal-app-actions,.portal-app-secondary,.home-quick) :is(a,button):hover,.home-portal-shortcut:hover{filter:brightness(.9);text-decoration:none}
.portal-app-actions #portal-switch{padding-inline:15px}
:is(.portal-app-actions,.portal-app-secondary) .portal-button-green{background:#22c55e}
:is(.portal-app-actions,.portal-app-secondary) .portal-button-red{background:#ef4444}
:is(.portal-app-actions,.portal-app-secondary) .portal-button-blue{background:#1a56db}
:is(.portal-app-actions,.portal-app-secondary) .portal-button-orange{background:#f59e0b}
nav{position:sticky;top:var(--bar);height:calc(100dvh - var(--bar));overflow:auto;padding:12px 10px;background:var(--white);border-right:1px solid var(--line);scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
.nav-group{margin-bottom:12px}
.nav-group:not(:has(a:not([hidden]))){display:none}
nav p{font-size:11px;font-weight:600;color:var(--muted);margin:8px 10px 6px}
nav a{display:flex;align-items:center;gap:10px;min-height:41px;border-radius:6px;padding:8px 10px;margin:2px 0;color:#475569;font-size:13px;font-weight:500;transition:background .15s,color .15s}
nav a svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;color:var(--muted)}
nav a:hover{background:var(--bg);color:var(--text);text-decoration:none}
nav a[aria-current=page]{background:var(--accent-bg);color:var(--accent)}
nav a[aria-current=page] svg{color:var(--accent)}
.nav-new{margin-left:auto;color:var(--accent);font-size:10px;background:var(--accent-bg);border-radius:4px;padding:0 4px;line-height:16px}
.nav-footer{display:flex;align-items:center;gap:8px;margin:16px 8px 0;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:11px}
.status-dot{width:6px;height:6px;border-radius:50%;background:#64748b;flex-shrink:0}
#content{min-width:0;padding:20px 24px 40px;outline:none}
#content>section{margin:0}
h1,h2,h3,p{margin:0 0 12px}
h1{font-size:23px;line-height:1.35;font-weight:650;margin-bottom:7px}
h2{font-size:17px;font-weight:650}
h3{font-size:14px;font-weight:650}
.eyebrow{color:var(--muted)!important;font-size:11px;font-weight:650;letter-spacing:.6px;margin-bottom:6px}
.hint,section>p,.muted{color:var(--muted)}
section>p:not(.eyebrow){font-size:13px;margin-bottom:16px;line-height:1.6}
.page-load-status{font-size:11px;color:var(--muted);padding:0;text-align:right;margin:0 0 8px}
.page-load-status:empty{display:none}
.page-load-status.error{color:#8d423e;background:#fff0ec;padding:10px 13px;border-radius:8px;text-align:left}
.page-head,.actions,.toolbar,.pager{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.page-head{justify-content:space-between;margin-bottom:16px}
.page-head p{margin:0;font-size:13px}
.toolbar{padding:0 0 12px;gap:8px}
.pager{justify-content:flex-end;padding:12px 0;color:var(--muted);font-size:12px}
.pager:empty{display:none}
.pager button{min-height:30px;min-width:30px;font-size:12px;padding:5px 9px}
.pager-current{display:inline-flex;align-items:center;justify-content:center;min-height:30px;min-width:30px;padding:5px 9px;border:1px solid var(--accent-line);border-radius:6px;background:var(--accent-bg);color:var(--accent);font-weight:600}
.pager input[type=number]{width:64px;min-height:30px;padding:4px 7px}
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:12px;margin:16px 0}
.metric{background:var(--white);border:1px solid var(--line);border-radius:12px;padding:14px 16px;display:grid;gap:5px;box-shadow:var(--shadow);overflow:hidden}
.metric span{color:var(--muted);font-size:12px}
.metric strong{font-size:25px;line-height:1.2;font-weight:650;font-variant-numeric:tabular-nums}
.panel,details,.record{background:var(--white);border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin-bottom:12px;overflow-wrap:anywhere;box-shadow:var(--shadow)}
.record{display:flex;align-items:center;flex-wrap:wrap;gap:10px;white-space:pre-wrap}
details>summary{cursor:pointer;font-weight:600;font-size:13px;color:#334155;list-style-position:inside}
details>summary::marker{color:var(--muted);font-size:10px}
details[open]>summary{margin-bottom:14px}
details p:last-child{margin-bottom:0}
#home{display:grid;gap:16px}
#home-counts{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}
#home-counts:empty{display:none}
#home-counts .metric{min-height:91px;align-content:center;gap:4px;padding:12px 16px}
#home-counts .metric span{color:#94a3b8;font-size:12px}
#home-counts .metric strong{color:#4f46e5;font-size:25px;font-weight:700}
#home-counts .metric:nth-child(2) strong{color:#22c55e}
#home-counts .metric:nth-child(3) strong{color:#ef4444}
#home-counts .metric:nth-child(4) strong{color:#f59e0b}
#home>.panel,#home>details,#home #renewal-alerts{margin:0}
.portal-section-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-bottom:8px}
#home :is(.portal-section-head,.portal-product,.portal-controls,.home-quick,.portal-shortcuts) h2{margin:0;font-size:14px;font-weight:650}
#home-announcement{min-height:76px;margin:0;padding:14px 18px;border:1px solid #fde68a;border-radius:12px;background:#fffbeb;color:#92400e}
#home-announcement .portal-section-head{margin-bottom:4px}
#home-announcement-link{color:#b45309;font-size:12px;font-weight:600}
#home-announcement-text{margin:0;color:#92400e;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.portal-product{min-height:119px;padding:11px 18px}
.portal-product-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0}
.portal-product-row input{flex:1;min-width:104px}
.portal-product-row a{font-size:12px;white-space:nowrap}
.portal-product>p:last-child{margin-bottom:0}
.portal-controls,.portal-login-audit{padding:16px 18px}
.portal-controls>div{display:grid;grid-template-columns:minmax(85px,1fr) minmax(0,2fr) auto;align-items:center;gap:5px 10px;padding:9px 0;border-bottom:1px solid var(--line);font-size:12px}
.portal-controls>div:last-child{padding-bottom:0;border-bottom:0}
.portal-controls>div>span{color:var(--muted)}
.portal-controls>div>a,.portal-login-audit a{font-size:12px}
.home-quick{display:grid;gap:10px;padding:16px 18px}
.home-quick-group h3{margin:0 0 7px;color:var(--muted);font-size:12px}
.portal-shortcuts{display:grid;gap:10px;padding:16px 18px}
.portal-shortcuts-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.home-task-links{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.home-task-links:empty{display:none}
.home-shortcut-count{display:inline-flex;align-items:center;padding:0 5px;border-radius:10px;background:#ffffff2b;font-size:11px;font-variant-numeric:tabular-nums}
#home-ops.actions{gap:8px;font-size:12px}
#home-ops:empty{display:none}

#help{display:grid;gap:18px}
.help-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:18px 20px;border:1px solid var(--accent-line);border-radius:12px;background:var(--accent-bg)}
.help-intro h1{margin-bottom:5px}
.help-intro p:last-child,.help-section-heading p{margin:0;color:#475569;font-size:13px;line-height:1.6}
.help-intro .eyebrow{color:var(--accent-dark)!important}
.help-section{display:grid;gap:10px;min-width:0}
.help-section-heading h2{margin:0 0 3px}
.help-section-heading p{color:var(--muted)}
.help-steps,.help-status-grid{display:grid;gap:10px;margin:0;padding:0}
.help-steps{grid-template-columns:repeat(2,minmax(0,1fr));list-style:none}
.help-steps>li{display:grid;grid-template-columns:34px minmax(0,1fr);align-content:start;align-items:start;gap:6px 10px;min-width:0;padding:14px 16px;margin:0}
.help-step-number{display:grid;place-items:center;grid-row:1/3;height:32px;border-radius:8px;background:var(--accent-bg);color:var(--accent-dark);font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.help-steps>li>:is(h3,p,.actions,textarea){grid-column:2;margin:0}
.help-steps h3{padding-top:5px}
.help-steps p,.help-status-grid dd,.help-questions p{color:#475569;font-size:13px;line-height:1.65}
.help-steps .actions{gap:6px}
.help-steps .actions:not(:has(> :not([hidden]))){display:none}
.help-steps .actions button,.help-link-button{font-size:12px}
.help-link-button{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:6px 10px;border:1px solid var(--line);border-radius:6px;background:var(--white);color:var(--accent-dark);font-weight:600}
.help-link-button:hover{border-color:var(--accent-line);background:var(--accent-bg);text-decoration:none}
#codes-help-link{white-space:nowrap;text-decoration:underline;text-underline-offset:2px}
#customer-help{width:100%}
.help-status-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.help-status-grid>div{min-width:0;margin:0;padding:12px 14px}
.help-status-grid dt{margin:0 0 7px;font-weight:650}
.help-status-grid dd{margin:0}
.help-status-grid dd p{margin:6px 0 0}
#help-support-note{margin:0}
.help-questions{display:grid;gap:8px}
.help-questions details{margin:0;padding:12px 14px}
.help-questions details[open]>summary{margin-bottom:8px}
.help-questions p{margin-bottom:8px}
#custom-help{justify-self:start}

form{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:12px 0}
label{display:grid;gap:5px;font-weight:500;font-size:12px;color:#475569;min-width:0}
label>input,label>select,label>textarea{font-size:13px;font-weight:400}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.form-grid>button{justify-self:start;min-width:120px}
.full,.form-grid>.summary{grid-column:1/-1}
.summary{padding:12px 14px;background:var(--accent-bg);border:1px solid var(--accent-line);color:var(--accent-dark);border-radius:8px;margin:0;font-size:13px;line-height:1.6}
#batch-filter,#search,#import,#grant,#reply,#platform-draft,#audit-tools>form,.code-action-panel,#products>.toolbar,#orders-tools:not(:empty){padding:16px 20px;background:var(--white);border:1px solid var(--line);border-radius:12px;margin:12px 0 16px;box-shadow:var(--shadow)}
.code-action-panel{min-width:0}
.current-batch-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 16px;padding:12px 16px;border-color:var(--accent-line);border-inline-start:4px solid var(--accent);background:var(--accent-bg)}
.current-batch-summary{min-width:0}
.current-batch-tools h2{margin:0 0 4px;font-size:14px}
.current-batch-tools p{margin:0;color:#475569;font-size:12px}
.current-batch-tools .actions{gap:6px}
.current-batch-tools :is(a,button){font-size:12px}
.code-action-panel>#code-filter{margin:0;padding:0 0 12px}
.code-action-panel>.toolbar{padding-bottom:10px}
.code-action-panel>.toolbar:first-child:not(:has(> :not([hidden]))){display:none}
#code-filter label:first-child{flex:1;min-width:240px}
#code-filter label:first-child input{width:100%}
#batch-filter label:first-child{flex:1;min-width:210px}
#platform-draft{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}
#platform-draft label:has([name=url]),#platform-draft label:has([name=sha256]),#platform-draft label:has([name=notes]){grid-column:span 3}
#platform-draft button{justify-self:start}
#platform-draft-heading{margin-top:25px}
#reply{display:grid;grid-template-columns:1fr;box-shadow:none;padding:17px}
#reply button{justify-self:start}
#grant{align-items:end}
#grant-account{width:100%;font-size:14px}
#orders-tools>form{flex:1;justify-content:flex-end;margin:0}
#product-query{width:min(360px,100%)}
.table-wrap{overflow:auto;max-height:65vh;border:1px solid var(--line);border-radius:12px;background:var(--white);box-shadow:var(--shadow);scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
table{width:100%;border-spacing:0;text-align:left;font-size:13px;line-height:1.5}
th,td{padding:9px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
th{background:var(--bg);position:sticky;top:0;z-index:1;white-space:nowrap;color:#475569;font-size:12px;font-weight:600}
td{height:45px;color:#334155}
tr:last-child td{border-bottom:none}
tr:hover td{background:var(--bg)}
td:last-child,th:last-child{position:sticky;right:0;box-shadow:-1px 0 var(--line)}
td:last-child{background:white}
th:last-child{z-index:2}
td .actions{flex-wrap:nowrap;gap:6px}
td button{white-space:nowrap;padding:4px 8px;min-height:28px;font-size:12px;border-radius:6px}
td button.quiet{border-color:var(--line);background:var(--white);color:var(--accent-dark)}
td button.quiet:hover{background:var(--accent-bg);border-color:var(--accent-line)}
.clipped{max-width:170px;overflow:hidden;text-overflow:ellipsis}
#codes-table table{min-width:1050px}
.mono{font-family:Consolas,monospace;white-space:nowrap;font-size:12px;letter-spacing:.3px}
.tag,.badge{display:inline-block;border-radius:5px;padding:3px 8px;background:#f1f5f9;color:#475569;white-space:nowrap;font-size:11px;font-weight:500;line-height:1.6}
.tag.available{background:#dcfce7;color:#166534}
.tag.redeemed{background:var(--accent-bg);color:var(--accent-dark)}
.tag.disabled{background:#fef2f2;color:#991b1b}
.empty{padding:30px 16px;text-align:center;color:var(--muted);background:var(--white);margin:0;border:1px solid var(--line);border-top:0;border-radius:0 0 12px 12px;font-size:13px}
.code-action-panel>#code-tabs{border-bottom:1px solid var(--line);margin:0}
#code-tabs button{font-size:12px;min-height:30px;padding:5px 10px}
.code-order-context{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 10px;margin-top:9px;padding:8px 10px;border:1px solid var(--accent-line);border-radius:8px;background:var(--accent-bg);color:var(--accent-dark);font-size:12px;overflow-wrap:anywhere}
.code-order-context p{margin:0}
.code-action-panel>#code-selection{color:var(--muted);font-size:12px;min-height:27px;padding:9px 0 0}
.code-selection-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0;border-inline-start:1px solid var(--line);padding-inline-start:8px}
.code-selection-actions:empty{display:none}
.code-selection-actions button{min-height:28px;font-size:12px;padding:4px 8px}
#notice{position:fixed;right:24px;bottom:24px;max-width:min(520px,90vw);z-index:9;color:#166534;background:#f0fdf4;padding:13px 18px;border:1px solid #bbf7d0;border-radius:10px;box-shadow:0 8px 28px #0f172a16;margin:0;font-size:13px;overflow-wrap:anywhere}
#notice:empty{display:none}
#notice.error,.modal-error{color:#a2584b;background:#fff1ec;border-color:#f0d9d0}
#renewal-alerts{background:#fff6e8;color:#a1804b;padding:14px 17px;border:1px solid #f2e2c5;border-radius:9px;font-size:13px}
dialog{color:var(--text);background:var(--white);border:1px solid var(--line);border-radius:12px;padding:0;width:min(700px,calc(100% - 32px));max-height:calc(100dvh - 32px);box-shadow:0 18px 70px #0f172a30}
dialog::backdrop{background:#0f172a65}
#record-dialog{margin:0 0 0 auto;height:100dvh;max-height:100dvh;width:min(760px,100%);border-radius:12px 0 0 12px}
.dialog-head{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:16px 20px;background:var(--white);border-bottom:1px solid var(--line)}
.dialog-head h2{margin:0;font-size:17px;color:var(--text)}
.dialog-head .close{font-size:22px;line-height:1;width:32px;height:32px;min-height:32px;padding:0;border:0;background:var(--bg);color:var(--muted);font-weight:400;border-radius:6px}
.dialog-body{padding:20px}
.dialog-body>p{color:var(--muted);font-size:13px;line-height:1.75}
.dialog-body>.actions{margin:14px 0}
.dialog-body .table-wrap{max-height:45vh}
.generation-guide{padding:11px 13px;margin:0 0 13px;border:1px solid var(--accent-line);border-radius:8px;background:var(--accent-bg);color:var(--accent-dark);font-size:13px;line-height:1.6}
.generation-guide p{margin:0 0 6px}
.generation-guide p:last-child{margin-bottom:0}
.generation-extra{grid-column:1/-1;width:100%;margin:0;box-shadow:none}
.generation-extra .form-grid{gap:10px}
.generation-result{padding:12px 13px 12px 33px;margin:0 0 14px;border:1px solid var(--line);border-radius:8px;background:var(--bg);font-size:13px}
.generation-result li+li{margin-top:5px}
.modal-error{padding:11px 14px;border:1px solid #f0d9d0;border-radius:8px;font-size:13px}
.facts{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:11px 16px;font-size:13px;padding:14px 16px;background:var(--bg);border:1px solid var(--line);border-radius:10px;margin:14px 0}
.facts dt{color:var(--muted)}
.facts dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap;color:#334155}
.copy-fallback textarea{width:100%}
#settings-list>.panel{padding:22px 24px;margin-bottom:18px}
#settings-list>.panel>p{font-size:13px;color:var(--muted)}
#settings-list>.panel>button+div{margin-top:17px}
#settings-list form label:has([name=helpUrl]){flex:1;min-width:180px;max-width:440px}
#settings-list form label:has([name=defaultCount]){max-width:130px}
.home-content-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:18px;margin:20px 0}
.banner-card{min-width:0;background:#fff;border:1px solid var(--line);border-radius:13px;overflow:hidden;box-shadow:var(--shadow)}
.banner-image{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:#f1f5f9}
.banner-meta{padding:17px 18px 10px;min-width:0}
.banner-meta h2,.banner-meta h3{margin-bottom:6px;font-size:15px}
.banner-meta p{font-size:12px;color:var(--muted);margin-bottom:8px;overflow-wrap:anywhere}
.banner-controls{display:flex;align-items:center;gap:7px;flex-wrap:wrap;border-top:1px solid var(--line);padding:12px 18px;background:var(--bg)}
.banner-controls button{font-size:12px;min-height:32px;padding:5px 10px}
.banner-preview{position:relative;overflow:hidden;border-radius:12px;background:#f1f5f9;min-width:0;margin:15px 0}
.banner-preview img{display:block;width:100%;max-height:320px;object-fit:cover}
.banner-preview h3{padding:16px 18px 0;margin-bottom:7px}
.banner-preview p{padding:0 18px 18px;margin:0;font-size:12px}
.content-status{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:var(--white);border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin:16px 0;color:#334155;font-size:13px}
.content-status p{margin:0}.content-status .muted{font-size:12px}
.client-config-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:22px 0 28px;align-items:start}
.client-config-card{min-width:0;margin:0;padding:22px}
.client-config-card .page-head{align-items:flex-start;margin-bottom:13px;gap:12px}
.client-config-card .page-head h2{margin:9px 0 0;font-size:18px}
.client-config-card>p{font-size:12px;line-height:1.75;margin-bottom:15px}
.client-config-preview{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:17px 18px;overflow-wrap:anywhere;min-width:0}
.client-config-preview h3{font-size:14px;margin:0 0 9px}
.client-config-preview h3:not(:first-child){margin-top:21px;padding-top:16px;border-top:1px solid var(--line)}
.client-config-preview p{font-size:13px;line-height:1.8;margin:0 0 9px}
.client-config-preview p:last-child{margin-bottom:0}
.client-config-preview a{display:inline-block;font-size:12px;border-bottom:1px solid var(--accent-line);padding-bottom:2px}
.client-config-copy{white-space:pre-wrap;overflow-wrap:anywhere}
.client-config-card .client-config-copy{max-height:180px;overflow:auto}
.client-config-card .client-config-version{font-size:11px;text-align:right;margin:9px 0 15px}
.client-config-card .client-config-permission{margin:13px 0 0;font-size:11px}
.client-config-form>label{grid-column:1/-1}
.client-config-form .eyebrow{margin:0}
.client-config-form .client-config-preview{margin-top:-9px}
.client-config-conflict{background:#fff5e5;border:1px solid #ead4ad;border-radius:9px;padding:15px;color:#8b6533;font-size:13px}
.client-config-conflict p{margin-bottom:11px}
.announcement-section-heading{padding-top:4px}
.announcement-section-heading h2{margin:9px 0 8px;font-size:18px}
.announcement-section-heading p{font-size:13px;margin-bottom:8px}
.redemption-trend{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;align-content:space-between;gap:6px 10px;min-height:177px;padding:14px 16px;border-inline-start:4px solid var(--accent)}
.redemption-trend h2{margin:0;font-size:14px;font-weight:650}
.redemption-trend>.hint{grid-column:1/-1;margin:0;font-size:11px;color:#94a3b8}
.redemption-trend>.redemption-trend-mean{display:flex;align-items:baseline;gap:4px;margin:0;color:var(--muted);font-size:12px}
.redemption-trend-mean strong{color:var(--accent);font-size:14px}
.redemption-trend-days{grid-column:1/-1;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none}
.redemption-trend-days li{display:grid;gap:3px;text-align:center;color:#94a3b8;font-size:11px;font-variant-numeric:tabular-nums}
.redemption-trend-days li>span{color:var(--muted);font-weight:600}
.redemption-trend-days time{white-space:nowrap}
.redemption-trend-track{display:flex;justify-content:center;align-items:flex-end;height:56px}
.redemption-trend-track i{display:block;width:100%;min-height:4px;background:#e2e8f0;border-radius:4px 4px 0 0}
.redemption-trend-track i.has-redemptions{background:var(--accent)}

@media(max-width:1100px){
  .topbar{gap:10px;padding-right:16px}
  .header-breadcrumb{margin-left:3px}
  .client-config-grid{grid-template-columns:1fr}
  .client-config-card{padding:16px}
}
@media(max-width:970px){
  :root{--rail:178px}
  .topbar{gap:8px}
  .topbar .account{max-width:100px;font-size:12px}
  .topbar #help-link{display:none}
  .portal-home :is(.portal-brand,.portal-online){display:none}
  .header-breadcrumb{display:none}
  .brand{padding:0 12px;gap:8px}
  .brand-mark{width:28px;height:28px}
  .brand strong{font-size:14px}
  nav{padding-inline:8px}
  nav a{gap:8px;padding-inline:8px;font-size:12px}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app-bar{padding-inline:18px}
  #content{padding:18px 18px 36px}
  .portal-home .workspace-main{padding:18px 18px 36px}
  .table-wrap{max-height:65vh}
  #platform-draft{grid-template-columns:repeat(2,minmax(0,1fr))}
  #platform-draft label:has([name=url]),#platform-draft label:has([name=sha256]),#platform-draft label:has([name=notes]){grid-column:span 2}
  .toolbar>form{width:100%;justify-content:flex-start!important}
  #orders-tools>form{flex:auto}
  .dialog-body{padding:21px}
  .dialog-head{padding:18px 21px}
}
@media(max-width:760px){
  :root{--rail:64px;--bar:56px}
  .brand{padding:0;justify-content:center}
  .brand>div{display:none}
  .brand-mark{width:30px;height:30px}
  .topbar{padding-right:10px}
  .header-tools{flex-wrap:wrap;justify-content:flex-end;gap:4px 6px}
  .topbar button{min-height:24px;font-size:11px;padding:3px 7px}
  .topbar .badge{display:none}
  .portal-home #environment{display:none}
  .topbar .account{font-size:11px;max-width:80px}
  nav{padding:10px 8px}
  .nav-group{margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--line)}
  nav p,.nav-label,.nav-new,.nav-footer{display:none}
  nav a{justify-content:center;padding:7px}
  nav a svg{width:19px;height:19px}
  .app-bar{padding-inline:16px}
  #content{padding:16px 16px 32px}
  .portal-home .workspace-main{padding:16px 16px 32px}
  h1{font-size:21px}
  .page-head{align-items:flex-start;gap:12px}
  .page-head>div{flex:1 1 190px;min-width:0}
  .panel,details,.record,.code-action-panel,#batch-filter,#search,#import,#grant,#reply,#platform-draft,#audit-tools>form{padding:14px 16px}
  .metrics{gap:8px}
  #help{gap:14px}
  .help-intro{padding:14px 16px}
  .help-steps,.help-status-grid{grid-template-columns:minmax(0,1fr)}
  .form-grid{gap:14px}
  .content-status{padding:14px}
  .home-content-grid{grid-template-columns:1fr}
}
@media(max-width:850px){
  .portal-home .app-bar{display:flex;gap:8px;min-height:0;padding:10px 12px}
  .portal-home #product-switch{width:100%}
  .portal-home .portal-app-secondary{justify-content:flex-start}
  .portal-home .portal-validation{margin-left:auto}
  #home{gap:12px}
}
@media(max-width:520px){
  .topbar{gap:6px;padding-right:8px}
  .topbar button{padding-inline:6px}
  .topbar .account{max-width:64px}
  .app-bar{padding-inline:12px}
  #product-switch{width:100%;gap:8px}
  #current-product{flex:1;width:100%}
  #content{padding:14px 12px 28px}
  .portal-home .workspace-main{padding:14px 12px 28px}
  .metrics{margin:12px 0}
  .metric{padding:12px 10px}
  .metric span{font-size:11px}
  .metric strong{font-size:22px}
  #home-counts{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  #home-counts .metric{min-height:72px}
  .form-grid,#platform-draft{grid-template-columns:1fr}
  .full,.form-grid>.summary,#platform-draft label:has([name=url]),#platform-draft label:has([name=sha256]),#platform-draft label:has([name=notes]){grid-column:auto}
  #code-filter label,#batch-filter label{flex:1;min-width:min(100%,110px)}
  #code-filter label:first-child,#batch-filter label:first-child{flex-basis:100%;min-width:0}
  #search label{width:100%}
  .code-selection-actions{flex-basis:100%;border-inline-start:0;padding:5px 0 0}
  .redemption-trend{padding-inline:10px}
  .redemption-trend-days{gap:2px}
  .redemption-trend-days li{font-size:9px}
  .portal-controls>div{grid-template-columns:minmax(0,1fr) auto}
  .portal-controls>div>span{grid-column:1;grid-row:2}
  .portal-controls>div>a{grid-column:2;grid-row:1/3}
  .facts{grid-template-columns:1fr;gap:3px;padding:14px}
  .facts dd{margin-bottom:10px}
  .dialog-head{padding:16px 18px}
  .dialog-body{padding:18px}
  .dialog-head h2{font-size:17px}
  #notice{right:12px;bottom:12px;max-width:calc(100vw - 24px)}
  #login{padding:28px;margin-top:35px}
  .banner-controls{padding:11px 14px}
  .banner-meta{padding:15px 14px 8px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
