/* Business UI 168. Primitive → semantic → component tokens; no external assets. */
html:root[data-shx-theme="premium"] {
  --shx-blue-50:#edf3fc; --shx-blue-600:#245bb6; --shx-blue-700:#1b4893;
  --shx-slate-50:#f4f7fb; --shx-slate-200:#d7e1ec; --shx-slate-500:#52657c;
  --shx-slate-700:#24364b; --shx-slate-900:#18324f;
  --shx-color-brand:var(--shx-blue-600); --shx-color-brand-hover:var(--shx-blue-700);
  --shx-color-text:var(--shx-slate-700); --shx-color-heading:var(--shx-slate-900);
  --shx-color-muted:var(--shx-slate-500); --shx-color-border:var(--shx-slate-200);
  --shx-color-workspace:var(--shx-slate-50); --shx-color-surface:#fff;
  --shx-color-success:#19734b; --shx-color-warning:#8a5a0a; --shx-color-danger:#b83443;
  --shx-color-focus:#245bb6; --shx-color-selected:var(--shx-blue-50);
  --shx-radius-control:8px; --shx-radius-panel:12px; --shx-radius-dialog:16px;
  --shx-space-1:4px; --shx-space-2:8px; --shx-space-3:12px; --shx-space-4:16px; --shx-space-6:24px;
  --shx-control-min:40px; --shx-control-pad:9px 12px;
  --shx-shadow-dialog:0 20px 64px #18324f29; --shx-motion:140ms;
  --b2-success:var(--shx-color-success); --b2-success-bg:#eef8f2;
  --b2-warning:var(--shx-color-warning); --b2-warning-bg:#fff8e9;
  --b2-danger:var(--shx-color-danger); --b2-danger-bg:#fff2f4;
  --b2-info:var(--shx-color-brand); --b2-info-bg:var(--shx-blue-50);
  --b2-unknown:var(--shx-color-muted); --b2-unknown-bg:#f0f3f7;
}
/* Business scopes intentionally leave the sign-in experience and table sizing alone. */
html:root[data-shx-theme="premium"] body #app-view {
  --blue:var(--shx-color-brand); --text:var(--shx-color-text); --muted:var(--shx-color-muted);
  --line:var(--shx-color-border); --border:var(--shx-color-border);
  color:var(--shx-color-text); background:var(--shx-color-workspace);
}
html:root[data-shx-theme="premium"] body #app-view #page-content { min-width:0; padding:24px 28px; }
html:root[data-shx-theme="premium"] body #app-view #page-content .page-heading { gap:16px; margin-bottom:20px; align-items:flex-start; }
html:root[data-shx-theme="premium"] body #app-view #page-content .page-heading h1 { color:var(--shx-color-heading); font-size:24px; line-height:1.35; margin:0 0 8px; letter-spacing:-.35px; }
html:root[data-shx-theme="premium"] body #app-view #page-content .page-heading p { color:var(--shx-color-muted); line-height:1.65; max-width:76ch; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(h2,h3,h4) { color:var(--shx-color-heading); line-height:1.45; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.muted,.terminal-footnote,.up-setup-note,.subtext) { color:var(--shx-color-muted); line-height:1.65; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.data-panel,.metric,.module-note,.up-menu) { background:var(--shx-color-surface); border:1px solid var(--shx-color-border); border-radius:var(--shx-radius-panel); box-shadow:none; }
html:root[data-shx-theme="premium"] body #app-view #page-content .metric { padding:18px 20px; }
html:root[data-shx-theme="premium"] body #app-view #page-content .metric strong { color:var(--shx-color-heading); font-variant-numeric:tabular-nums; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.terminal-page-toolbar,.panel-toolbar,.up-toolbar,.filters) { gap:10px; flex-wrap:wrap; }
/* Reset stacked-form margins inside horizontal/grid forms, then align by control baseline. */
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.terminal-page-toolbar,.terminal-filters,.filters,.up-toolbar,.field-grid,.terminal-form-grid) label {
  margin:0; min-width:0; color:var(--shx-color-muted); font-size:12px; line-height:1.5;
}
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.terminal-filters,.filters,.up-toolbar) { align-items:flex-end; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.terminal-filters,.filters,.up-toolbar) label:not(.up-check):not(.terminal-check):not(:has(>input[type="checkbox"])) { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
html:root[data-shx-theme="premium"] body #app-view #page-content .terminal-filters>div { align-items:flex-end; gap:10px; }
html:root[data-shx-theme="premium"] body :is(#app-view #page-content,#form-dialog,#record-drawer,#wb-record-drawer) :is(.record-controls-footer,.terminal-grid-footer) { align-items:flex-end; }
html:root[data-shx-theme="premium"] body #form-dialog .material-summary-paging { align-items:flex-end; }
html:root[data-shx-theme="premium"] body #form-dialog .cost-page { align-items:flex-end; }
@media(min-width:851px) { html:root[data-shx-theme="premium"] body #app-view #page-content .up-pagination { align-items:flex-end; } }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),select,textarea) {
  font:inherit; font-size:13px; line-height:1.5; color:var(--shx-color-text); background:#fff;
  border:1px solid var(--shx-color-border); border-radius:var(--shx-radius-control);
  min-height:var(--shx-control-min); padding:var(--shx-control-pad); max-width:100%; box-sizing:border-box;
  box-shadow:none; transition:border-color var(--shx-motion),box-shadow var(--shx-motion);
}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) label>:is(input,select,textarea,.password-field) { margin-top:0; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) textarea { min-height:100px; resize:vertical; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(input[type="checkbox"],input[type="radio"]) { width:18px; height:18px; min-height:0; flex:none; margin:0; padding:0; accent-color:var(--shx-color-brand); }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.terminal-check,.up-check) { display:flex; flex-direction:row; align-items:center; gap:8px; min-height:var(--shx-control-min); margin:0; color:var(--shx-color-text); }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .button {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:var(--shx-control-min);
  padding:var(--shx-control-pad); border:1px solid var(--shx-color-border); border-radius:var(--shx-radius-control);
  background:#fff; color:var(--shx-color-text); font-size:13px; font-weight:600; line-height:1.5;
  box-shadow:none; transform:none; transition:color var(--shx-motion),background-color var(--shx-motion),border-color var(--shx-motion);
}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .button:hover:not(:disabled) { background:var(--shx-blue-50); border-color:#a9bfdf; color:var(--shx-color-brand-hover); transform:none; box-shadow:none; }
html:root[data-shx-theme="premium"] body :is(#form-dialog,#record-drawer,#wb-record-drawer) .icon-button { display:inline-flex; align-items:center; justify-content:center; width:var(--shx-control-min); height:var(--shx-control-min); min-width:var(--shx-control-min); min-height:var(--shx-control-min); padding:0; flex:none; border:1px solid var(--shx-color-border); border-radius:var(--shx-radius-control); background:#f4f7fb; color:var(--shx-color-muted); }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .button.primary { background:var(--shx-color-brand)!important; border-color:var(--shx-color-brand)!important; color:#fff; }
/* Legacy premium hover is !important; this precise state override keeps the approved brand. */
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .button.primary:hover:not(:disabled) { background:var(--shx-color-brand-hover)!important; border-color:var(--shx-color-brand-hover)!important; color:#fff; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) .button.danger { background:#fff3f4; color:var(--shx-color-danger); border-color:#edbec5; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) :is(button,input,select,textarea):disabled { cursor:not-allowed; opacity:1; background:#f0f3f7; border-color:#dce3eb; color:#748397; box-shadow:none; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .button:disabled { cursor:not-allowed; opacity:1; background:#f0f3f7!important; border-color:#dce3eb!important; color:#748397!important; box-shadow:none; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) :is(button,[role="button"],input,select,textarea,summary,a):focus-visible { outline:3px solid var(--shx-color-focus); outline-offset:3px; box-shadow:none; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) button[aria-busy="true"] { cursor:progress; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.badge,.up-tag,.up-state-badge) { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; line-height:1.5; padding:3px 8px; border-radius:6px; border:1px solid var(--shx-color-border); color:var(--shx-color-muted); background:#f5f7fa; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.badge.green,.up-state-ready,.up-tag.good) { color:var(--shx-color-success); border-color:#b7d9c9; background:#eef8f2; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.badge.red,.up-state-review,.up-tag.bad) { color:var(--shx-color-danger); border-color:#edbec5; background:#fff2f4; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.up-warning,.notice.warning) { color:var(--shx-color-warning); border-color:#e6d4aa; background:#fff8e9; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog) .notice { border-radius:var(--shx-radius-control); line-height:1.65; padding:12px 14px; }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog) .notice:not(.error):not(.warning) { color:var(--shx-color-text); background:#f4f7fb; border-color:var(--shx-color-border); }
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog) .notice.error { color:var(--shx-color-danger); background:#fff3f4; border-color:#edbec5; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is(th,td,.summary-strip,.terminal-summary,.metric strong) { font-variant-numeric:tabular-nums; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is([data-cell-key],[data-column]) { text-align:left; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is([data-cell-key],[data-column]):is([data-cell-key="quantity"],[data-column="quantity"],[data-cell-key="amount"],[data-column="amount"],[data-cell-key="total_price"],[data-column="total_price"],[data-cell-key="unit_price"],[data-column="unit_price"],[data-cell-key="unit_cost"],[data-column="unit_cost"],[data-cell-key="total_cost"],[data-column="total_cost"],[data-cell-key="gross_profit"],[data-column="gross_profit"],[data-cell-key="paid_amount"],[data-column="paid_amount"],[data-cell-key="prepaid_applied"],[data-column="prepaid_applied"],[data-cell-key="outstanding"],[data-column="outstanding"]) { text-align:right; }
html:root[data-shx-theme="premium"] body #app-view #page-content :is([data-cell-key="status"],[data-column="status"],[data-cell-key="payment_status"],[data-column="payment_status"],[data-grid-action-head]) { text-align:center; }
/* Precise supplier policy and mode forms: labels above, controls and action at the same bottom. */
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root { --up-border:var(--shx-color-border); --up-blue:var(--shx-color-brand); }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root .up-settings162 { gap:16px; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root .up-settings162>section { padding:18px 20px; margin:0; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form) { display:grid; grid-template-columns:minmax(180px,1fr) minmax(240px,1.5fr) max-content; align-items:end; gap:12px; max-width:960px; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form)>label { margin:0; min-width:0; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form)>label>:is(input:not([type="checkbox"]),select) { width:100%; margin:0; min-height:40px; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form)>.button { min-height:40px; margin:0; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root .up-mode-controls { align-items:end; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root .up-mode-card { border-radius:var(--shx-radius-control); border-color:var(--shx-color-border); background:#fafcff; padding:14px; }
html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root .up-mode-card[data-selected="true"] { border-color:var(--shx-color-brand); background:var(--shx-color-selected); }
/* Dialog content owns scrolling; controls/actions stay reachable without clipping long forms. */
html:root[data-shx-theme="premium"] body #form-dialog { border:1px solid var(--shx-color-border); border-radius:var(--shx-radius-dialog); box-shadow:var(--shx-shadow-dialog); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); }
html:root[data-shx-theme="premium"] body #form-dialog::backdrop { background:#18324f66; backdrop-filter:none; }
html:root[data-shx-theme="premium"] body #form-dialog .dialog-heading { border-bottom:1px solid var(--shx-color-border); padding:18px 22px; }
html:root[data-shx-theme="premium"] body #form-dialog .dialog-heading h2 { color:var(--shx-color-heading); font-size:18px; line-height:1.45; }
html:root[data-shx-theme="premium"] body #form-dialog :is(.dialog-form,.dialog-detail) { padding:20px 22px; color:var(--shx-color-text); }
html:root[data-shx-theme="premium"] body #form-dialog :is(.terminal-native-fields,.field-grid,.terminal-form-grid) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:16px; }
html:root[data-shx-theme="premium"] body #form-dialog :is(.terminal-native-fields,.field-grid,.terminal-form-grid)>label { display:flex; flex-direction:column; gap:6px; margin:0; min-width:0; color:var(--shx-color-muted); font-size:12px; }
html:root[data-shx-theme="premium"] body #form-dialog :is(.terminal-native-fields,.field-grid,.terminal-form-grid)>:has(>textarea) { grid-column:1/-1; }
html:root[data-shx-theme="premium"] body #form-dialog :is(.terminal-native-fields,.field-grid,.terminal-form-grid)>.terminal-check { flex-direction:row; align-self:end; }
html:root[data-shx-theme="premium"] body #form-dialog .dialog-actions { gap:10px; border-top:1px solid var(--shx-color-border); margin-top:20px; padding-top:16px; }
html:root[data-shx-theme="premium"] body #form-dialog .material-summary-dialog dd { font-variant-numeric:tabular-nums; }
html:root[data-shx-theme="premium"] body #form-dialog :is(.badge,.b2-status,.up-state-badge,.up-order-tag) { border-radius:6px; font-size:12px; line-height:1.5; }
.shx-ui-icon { width:18px; height:18px; flex:none; display:inline-block; vertical-align:middle; }
html:root[data-shx-theme="premium"] body #app-view .nav-item { gap:10px; min-height:40px; border-radius:var(--shx-radius-control); color:var(--shx-color-text); }
html:root[data-shx-theme="premium"] body #app-view .nav-item.active { background:var(--shx-color-selected); color:var(--shx-color-brand); }
html:root[data-shx-theme="premium"] body #app-view .nav-item.child { min-height:36px; }
html:root[data-shx-theme="premium"] body #app-view .nav-item .chevron { margin-left:auto; display:flex; transition:transform var(--shx-motion); }
html:root[data-shx-theme="premium"] body #app-view .nav-item[aria-expanded="true"] .chevron { transform:rotate(180deg); }
html:root[data-shx-theme="premium"] body #terminal-shell-top { border-bottom:1px solid var(--shx-color-border); box-shadow:none; }
html:root[data-shx-theme="premium"] body #app-view .app-menu168-toggle { display:none; }
@media(max-width:960px) {
  html:root[data-shx-theme="premium"] body #app-view #page-content { padding:20px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form) { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form)>.button { justify-self:start; }
  html:root[data-shx-theme="premium"] body:not(.terminal-mode):not(.support-mode) #app-view .app-menu168-toggle:not([hidden]) { display:inline-flex; }
  html:root[data-shx-theme="premium"] body:not(.terminal-mode):not(.support-mode) #app-view .sidebar { position:fixed; width:230px; max-width:calc(100vw - 48px); z-index:50; transform:translateX(-100%); transition:transform var(--shx-motion); box-shadow:none; background:#fff; }
  html:root[data-shx-theme="premium"] body:not(.terminal-mode):not(.support-mode).app-menu168-open #app-view .sidebar { transform:translateX(0); box-shadow:12px 0 32px #18324f1f; }
  html:root[data-shx-theme="premium"] body:not(.terminal-mode):not(.support-mode) #app-view .app-main { margin-left:0; width:100%; }
  html:root[data-shx-theme="premium"] body:not(.terminal-mode):not(.support-mode) #app-view .topbar { position:relative; display:flex; align-items:center; flex-wrap:wrap; gap:10px; height:auto; min-height:60px; padding:10px 16px; }
  html:root[data-shx-theme="premium"] body:not(.terminal-mode):not(.support-mode) #app-view .topbar>div { min-width:0; flex-wrap:wrap; }
}
@media(max-width:600px) {
  html:root[data-shx-theme="premium"] { --shx-control-min:44px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content { padding:16px 12px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content .page-heading { flex-direction:column; margin-bottom:16px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content .page-heading>div:first-child { flex:0 1 auto; width:100%; }
  html:root[data-shx-theme="premium"] body #app-view #page-content .page-heading h1 { font-size:22px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content :is(.heading-actions,.terminal-page-toolbar,.up-toolbar) { gap:8px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form) { grid-template-columns:minmax(0,1fr); }
  html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form)>.button { width:100%; justify-self:stretch; min-height:44px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root :is(.up-policy-query,.up-policy-editor-form)>label>:is(input:not([type="checkbox"]),select) { min-height:44px; }
  html:root[data-shx-theme="premium"] body #app-view #page-content #upstream-root .up-settings162>section { padding:16px 14px; }
  html:root[data-shx-theme="premium"] body #form-dialog { max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
  html:root[data-shx-theme="premium"] body #form-dialog :is(.dialog-form,.dialog-detail,.dialog-heading) { padding:16px; }
  html:root[data-shx-theme="premium"] body #form-dialog :is(.terminal-native-fields,.field-grid,.terminal-form-grid) { grid-template-columns:minmax(0,1fr); }
}
@media(prefers-reduced-motion:reduce) {
  html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top),
  html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) *,
  html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) *::before,
  html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) *::after { transition-duration:0s!important; animation:none!important; scroll-behavior:auto!important; }
}
/* Exact record detail: compact facts, visible financial uncertainty, raw source
   expansion. Scoped to the two existing authenticated detail containers. */
html:root[data-shx-theme="premium"] body #form-dialog:has(#order-detail121){width:min(1040px,94vw);max-width:94vw}
@media(max-width:700px){html:root[data-shx-theme="premium"] body #form-dialog:has(#order-detail121){width:calc(100vw - 32px);max-width:calc(100vw - 32px)}}
html:root[data-shx-theme="premium"] body #form-dialog #order-detail121 {padding:18px 22px;min-width:0}
html:root[data-shx-theme="premium"] body #order-detail121 .order-detail121-intro {margin:0 0 16px;font-size:13px}
html:root[data-shx-theme="premium"] body #order-detail121 .order-detail121-summary {gap:14px 20px;margin-bottom:18px}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-section {margin:0 0 18px;min-width:0}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-section h3 {margin:0 0 10px;font-size:16px;color:var(--shx-color-text)}
html:root[data-shx-theme="premium"] body #order-detail121 .order-detail121-history {gap:8px 16px;padding:12px 14px;border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-control)}
html:root[data-shx-theme="premium"] body #order-detail121 .order-detail121-more {margin-bottom:18px}
html:root[data-shx-theme="premium"] body #order-detail121 .order-detail121-more>.order-detail121-history {border:0;border-top:1px solid var(--shx-color-border);border-radius:0}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-timeline {list-style:none;margin:0;padding:0;display:grid;gap:8px}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-timeline li {display:flex;flex-wrap:wrap;gap:6px 16px;padding-left:12px;border-left:2px solid var(--shx-color-border)}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-timeline time {font-variant-numeric:tabular-nums;color:var(--shx-color-muted)}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-deliveries {display:grid;gap:10px;margin-top:12px}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-deliveries article {padding:12px 14px;border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-control);min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-deliveries h4 {margin:0;font-size:14px;font-variant-numeric:tabular-nums}
html:root[data-shx-theme="premium"] body #order-detail121 .order-record-deliveries article>p {margin:5px 0 10px;color:var(--shx-color-muted);font-size:12px}
html:root[data-shx-theme="premium"] body #form-dialog .grid-record-detail .grid-record-field-long{grid-column:1/-1}
html:root[data-shx-theme="premium"] body #form-dialog .grid-record-detail .grid-record-raw summary{cursor:pointer;white-space:normal;overflow-wrap:anywhere;min-height:40px;color:var(--shx-color-brand)}
html:root[data-shx-theme="premium"] body #form-dialog .grid-record-detail .grid-record-raw pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:280px;overflow:auto;margin:8px 0 0;padding:10px;border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-control);background:var(--shx-color-workspace);font:inherit}
@media(max-width:700px){html:root[data-shx-theme="premium"] body #form-dialog .grid-record-detail .grid-record-raw summary{min-height:44px}}
html:root[data-shx-theme="premium"] body :is(#order-detail121,#wb-record-drawer) .order-record-raw {min-width:0;max-width:100%;margin:0}
html:root[data-shx-theme="premium"] body :is(#order-detail121,#wb-record-drawer) .order-record-raw summary {cursor:pointer;min-height:40px;line-height:1.6;overflow-wrap:anywhere;white-space:normal;color:var(--shx-color-brand)}
html:root[data-shx-theme="premium"] body :is(#order-detail121,#wb-record-drawer) .order-record-raw pre {margin:8px 0 0;padding:10px 12px;max-height:280px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-variant-numeric:tabular-nums;background:var(--shx-color-workspace);border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-control)}
@media(max-width:700px){html:root[data-shx-theme="premium"] body #form-dialog #order-detail121{padding:14px}html:root[data-shx-theme="premium"] body :is(#order-detail121,#wb-record-drawer) .order-record-raw summary{min-height:44px}html:root[data-shx-theme="premium"] body #order-detail121 .terminal-grid-footer{align-items:flex-end;gap:8px}}

/* Shared calendar173: same date contract, clear range and 44px controls. */
html:root[data-shx-theme="premium"] body dialog.terminal-calendar{width:440px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:var(--shx-radius-dialog,16px);overflow:auto}
html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-heading{padding:18px 20px;gap:12px}
html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-heading h2{display:flex;align-items:center;gap:9px;font-size:18px;margin:0}
html:root[data-shx-theme="premium"] body .terminal-calendar svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
html:root[data-shx-theme="premium"] body .terminal-calendar .icon-button{width:44px;height:44px;display:grid;place-items:center;border-radius:var(--shx-radius-control,8px);background:var(--shx-color-selected,#edf3fc);color:var(--shx-color-muted,#52657c)}
html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-form{padding:18px 20px}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-mode{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 16px}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-mode label{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;min-height:44px;margin:0;padding:8px;border:1px solid var(--shx-color-border,#d7e1ec);border-radius:var(--shx-radius-control,8px);font-size:14px;cursor:pointer;color:var(--shx-color-text,#24364b)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-mode label:has(:checked){background:var(--shx-color-selected,#edf3fc);border-color:var(--shx-color-brand,#245bb6);color:var(--shx-color-brand,#245bb6)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-mode input{width:18px;height:18px;min-height:0;flex:none;margin:0;padding:0;accent-color:var(--shx-color-brand,#245bb6)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-fields{display:grid;grid-template-columns:62px minmax(0,1fr) 82px;align-items:center;gap:8px;margin:0 0 18px}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-fields>span{font-size:13px;color:var(--shx-color-muted,#52657c);white-space:nowrap}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-fields input{width:100%;min-width:0;height:44px;margin:0;padding:8px 10px;font-variant-numeric:tabular-nums;border-radius:var(--shx-radius-control,8px)}
html:root[data-shx-theme="premium"] body .terminal-calendar .button{min-height:44px;min-width:44px;gap:4px;padding:8px 10px;font-size:14px;border-radius:var(--shx-radius-control,8px);box-shadow:none;transition:background var(--shx-motion,140ms),border-color var(--shx-motion,140ms),color var(--shx-motion,140ms)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-fields [aria-pressed="true"]{border-color:var(--shx-color-brand,#245bb6);color:var(--shx-color-brand,#245bb6);background:var(--shx-color-selected,#edf3fc)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-nav{gap:8px;margin-bottom:8px}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-nav strong{font-size:16px;font-variant-numeric:tabular-nums;color:var(--shx-color-heading,#18324f)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-days{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px 0;margin:0;text-align:center}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-weekday{display:grid;place-items:center;min-height:32px;font-size:13px;color:var(--shx-color-muted,#52657c)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day{position:relative;width:100%;height:44px;min-width:0;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;font-variant-numeric:tabular-nums;color:var(--shx-color-text,#24364b)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day.is-range{background:var(--shx-color-selected,#edf3fc);border-radius:0;color:var(--shx-color-brand,#245bb6)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day:is(.is-start,.is-end){background:var(--shx-color-brand,#245bb6);color:#fff;border-color:var(--shx-color-brand,#245bb6);font-weight:700}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day.is-start:not(.is-end){border-radius:8px 0 0 8px}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day.is-end:not(.is-start){border-radius:0 8px 8px 0}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day.is-today::after{content:"";position:absolute;inset:5px;border:1px solid currentColor;border-radius:5px;pointer-events:none;opacity:.7}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day:hover:not(:disabled){background:#dce9fb;color:var(--shx-color-brand-hover,#1b4893)}
html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-day[aria-pressed="true"]:hover{background:var(--shx-color-brand-hover,#1b4893);color:#fff}
html:root[data-shx-theme="premium"] body .terminal-calendar :is(button,input):focus-visible{outline:2px solid var(--shx-color-focus,#245bb6);outline-offset:2px;z-index:1}
html:root[data-shx-theme="premium"] body .terminal-calendar [data-calendar-hint]{font-size:13px;line-height:1.55;min-height:40px;margin:12px 0 0;color:var(--shx-color-muted,#52657c)}
html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:16px}
html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-actions .primary{background:var(--shx-color-brand,#245bb6);border-color:var(--shx-color-brand,#245bb6);color:#fff}
@media(max-width:480px){html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-heading{padding:12px 16px}html:root[data-shx-theme="premium"] body .terminal-calendar .dialog-form{padding:14px 16px}html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-fields{grid-template-columns:58px minmax(0,1fr) 74px;gap:6px}html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-fields .button{padding:8px 6px}html:root[data-shx-theme="premium"] body .terminal-calendar .calendar-nav .button{padding:8px 6px}}
@media(prefers-reduced-motion:reduce){html:root[data-shx-theme="premium"] body .terminal-calendar *{transition:none!important;animation:none!important}}

/* Services use the existing workspace tokens and contained record stream. */
html:root[data-shx-theme="premium"] body .terminal-service173 .service-item173{padding:16px 0;border-top:1px solid var(--shx-color-border);margin-top:12px}
html:root[data-shx-theme="premium"] body .terminal-service173 .service-item173 h3{font-size:16px;color:var(--shx-color-heading);margin:0 0 12px}
html:root[data-shx-theme="premium"] body .terminal-service173>h2{font-size:18px;margin:20px 0 12px;color:var(--shx-color-heading)}
html:root[data-shx-theme="premium"] body .terminal-service173 .service-metadata173{margin-top:20px;border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-panel);padding:12px}
html:root[data-shx-theme="premium"] body .terminal-service173 .service-metadata173>summary{min-height:44px;display:flex;align-items:center;color:var(--shx-color-brand);font-weight:600;cursor:pointer}
html:root[data-shx-theme="premium"] body .terminal-service173 .dialog-actions{flex-wrap:wrap}

/* Shared workspace components 173. The sign-in surface keeps its own design. */
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top){--shx-action-bg:#fff;--shx-action-hover:#edf3fc;--shx-row-hover:#f6f9fd;--shx-divider:#e5ebf3;--shx-footer-shadow:0 -8px 18px -16px #18324f66}
/* Legacy raw-table actions and chat controls use the same control contract. */
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.row-actions button,.support-bot-button,.support-reply-button){display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:var(--shx-control-min);padding:8px 12px;border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-control);background:var(--shx-action-bg);color:var(--shx-color-text);font:inherit;font-size:13px;font-weight:600;line-height:1.5;box-shadow:none;transform:none;transition:background-color var(--shx-motion),border-color var(--shx-motion),color var(--shx-motion)}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.row-actions button,.support-bot-button,.support-reply-button):hover:not(:disabled){background:var(--shx-action-hover);border-color:#a9bfdf;color:var(--shx-color-brand-hover);box-shadow:none;transform:none}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:var(--shx-control-min);min-height:var(--shx-control-min);border-radius:var(--shx-radius-control);color:var(--shx-color-muted);box-shadow:none}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) .row-actions{align-items:center;gap:8px;flex-wrap:wrap}
/* Preserve column widths and fixed-row sizing; only baseline and surface change. */
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.table-scroll,.terminal-table-scroll,.wb-related-table) :is(th,td){vertical-align:middle;border-bottom-color:var(--shx-divider)}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.table-scroll,.terminal-table-scroll,.wb-related-table) thead th{background:#f4f7fb;color:var(--shx-color-muted);font-weight:600;line-height:1.5}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.table-scroll,.terminal-table-scroll,.wb-related-table) tbody tr:hover{background:var(--shx-row-hover);box-shadow:none}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.table-scroll,.terminal-table-scroll,.wb-related-table) tbody tr[aria-selected="true"]{background:var(--shx-color-selected);box-shadow:inset 3px 0 var(--shx-color-brand)}
/* Keep secondary query strips in normal flow; only the final dialog action is sticky. */
html:root[data-shx-theme="premium"] body #form-dialog #dialog-content .dialog-actions{position:static;bottom:auto;align-items:flex-end;flex-wrap:wrap;box-shadow:none}
html:root[data-shx-theme="premium"] body #form-dialog #dialog-content>.dialog-actions:last-child,html:root[data-shx-theme="premium"] body #form-dialog #dialog-content>:is(form,.dialog-form,.dialog-detail):last-child>.dialog-actions:last-child{position:sticky;bottom:0;z-index:3;padding-block:12px;background:var(--shx-color-surface);border-top:1px solid var(--shx-color-border);box-shadow:var(--shx-footer-shadow)}
html:root[data-shx-theme="premium"] body #form-dialog .dialog-actions>.button{flex-shrink:0}
/* Detail records are registered field cards, not an invented event timeline. */
html:root[data-shx-theme="premium"] body :is(#form-dialog,#record-drawer,#wb-record-drawer) .grid-record-detail .grid-record-field{min-width:0;padding:12px 14px;border:1px solid var(--shx-divider);border-radius:var(--shx-radius-control);background:var(--shx-color-surface)}
html:root[data-shx-theme="premium"] body :is(#form-dialog,#record-drawer,#wb-record-drawer) .grid-record-detail .grid-record-field dt{margin-bottom:6px;color:var(--shx-color-muted);font-size:12px;line-height:1.5}
html:root[data-shx-theme="premium"] body :is(#form-dialog,#record-drawer,#wb-record-drawer) .grid-record-detail .grid-record-field dd{margin:0;color:var(--shx-color-text);line-height:1.65;overflow-wrap:anywhere}
html:root[data-shx-theme="premium"] body #app-view .sidebar #navigation .nav-item{border-radius:var(--shx-radius-control);transition:background-color var(--shx-motion),color var(--shx-motion)}
html:root[data-shx-theme="premium"] body #app-view .sidebar #navigation .nav-item:not(.active):hover{background:var(--shx-action-hover);color:var(--shx-color-brand-hover);box-shadow:none}
html:root[data-shx-theme="premium"] body #app-view .sidebar #navigation .nav-item.active{background:var(--shx-color-selected);color:var(--shx-color-brand)}
html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) .shx-ui-icon{color:inherit;stroke:currentColor}
@media(max-width:700px){
 html:root[data-shx-theme="premium"] body #app-view .sidebar #navigation .nav-item{min-height:44px}
 html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer) :is(.row-actions button,.support-bot-button,.support-reply-button){min-height:44px}
 html:root[data-shx-theme="premium"] body #form-dialog #dialog-content .dialog-actions{gap:8px;row-gap:10px}
 html:root[data-shx-theme="premium"] body :is(#form-dialog,#record-drawer,#wb-record-drawer) .grid-record-detail .grid-record-field{padding:12px}
}
@media(prefers-reduced-motion:reduce){html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top),html:root[data-shx-theme="premium"] body :is(#app-view,#form-dialog,#record-drawer,#wb-record-drawer,#terminal-shell-top) *{animation-duration:.01ms!important;animation-iteration-count:1!important;transition:none!important;scroll-behavior:auto!important}}

/* Dashboard keeps the same workspace surfaces and line icons as the shared shell. */
html:root[data-shx-theme="premium"] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board){font-family:"Segoe UI","Microsoft YaHei UI","PingFang SC",sans-serif;color:var(--shx-color-text)}
html:root[data-shx-theme="premium"] body #app-view #page-content :is(.dashboard-original-card,.dashboard-metric,.dashboard-health-card){background:var(--shx-color-surface);border:1px solid var(--shx-color-border);border-radius:var(--shx-radius-panel);box-shadow:none}
html:root[data-shx-theme="premium"] body #app-view #page-content .dashboard-action-grid{background:var(--shx-color-workspace);border:1px solid var(--shx-divider);border-radius:var(--shx-radius-control)}
html:root[data-shx-theme="premium"] body #app-view #page-content .dashboard-metric>div>b{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:7px;box-sizing:border-box;border-radius:var(--shx-radius-control);background:var(--shx-color-selected);color:var(--shx-color-brand)}
html:root[data-shx-theme="premium"] body #app-view #page-content .dashboard-metric .shx-ui-icon{width:18px;height:18px;margin:0}
html:root[data-shx-theme="premium"] body #app-view #page-content .dashboard-sparkline path{stroke:var(--shx-color-brand)}
html:root[data-shx-theme="premium"] body #app-view #page-content .dashboard-sparkline polygon{fill:var(--shx-color-selected)}
/* The original text is still complete; the collapsed preview occupies two lines. */
html:root[data-shx-theme="premium"] body :is(#form-dialog,#record-drawer,#wb-record-drawer) .grid-record-detail .grid-record-raw>summary{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;white-space:normal;line-height:1.6}
