/*
 * Screen-only workbench visual overrides.
 * Generated documents and print exports intentionally do not load this file.
 */

/* Mobile usability local batch v1 */
@media (max-width: 520px) {
  body.backend-shell-active:not(.public-site) .opportunity-toolbar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .opportunity-toolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .opportunity-toolbar .field,
  body.backend-shell-active:not(.public-site) .opportunity-toolbar .opportunity-search-field {
    flex: 0 1 auto;
  }

  body.backend-shell-active:not(.public-site) .opportunity-view-switch {
    display: none;
    flex: none;
    width: 100%;
    height: auto;
  }
}

/* Order seller settlement consolidation v1 */
body.backend-shell-active:not(.public-site).order-mode .order-buyer-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "settlement"
    "buyer";
  gap: 8px;
  align-items: start;
}

body.backend-shell-active:not(.public-site).order-mode .order-seller-settlement-card {
  grid-area: settlement;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-main-card {
  grid-area: buyer;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: end;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-overview .field,
body.backend-shell-active:not(.public-site).order-mode .order-settlement-overview .inline-checkbox {
  margin: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary {
  display: grid;
  min-width: 0;
  min-height: 40px;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid #d7e5e9;
  border-radius: 8px;
  background: #f7fbfc;
  color: #355765;
  font-size: 12px;
  line-height: 1.35;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary strong,
body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary strong {
  color: #1d3f4c;
  font-size: 13px;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary[data-status="warning"],
body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary[data-status="missing"] {
  border-color: #eed3a7;
  background: #fffaf0;
  color: #864507;
}

body.backend-shell-active:not(.public-site).order-mode .order-show-bank-info-field {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 7px;
  padding: 0 2px;
  color: #355765;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-details {
  margin-top: 2px;
  border-top-color: var(--visual-batch-line);
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-details > summary {
  min-height: 32px;
  padding: 4px 2px;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-details[open] {
  padding-top: 2px;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-details[open] > summary {
  margin-bottom: 8px;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-adjustment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 12px;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-adjustment-grid .full {
  grid-column: 1 / -1;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-adjustment-grid .order-seal-match-hint:not(:empty) {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  body.backend-shell-active:not(.public-site).order-mode .order-settlement-overview {
    grid-template-columns: 1fr;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-settlement-adjustment-grid {
    grid-template-columns: 1fr;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-show-bank-info-field {
    min-height: 44px;
    padding: 6px 0;
    white-space: normal;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-settlement-adjustment-grid .full {
    grid-column: 1;
  }
}

/* Order document pricing and linked-number controls v1 */
.order-invoice-no-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.order-invoice-no-control input {
  width: 100%;
  min-width: 0;
}

.order-invoice-no-control button {
  min-height: 40px;
  padding-inline: 9px;
  white-space: nowrap;
}

.order-invoice-link-status {
  color: #8a4b08;
  font-size: 10px;
  line-height: 1.35;
}

.order-invoice-link-status:empty { display: none; }

#orderWorkbench .order-product-finance-grid {
  padding: 10px;
  border: 1px solid var(--visual-batch-line);
  border-radius: 10px;
  background: #f8fafb;
}

#orderWorkbench .order-product-profit-metric {
  display: grid;
  align-self: stretch;
  align-content: center;
  gap: 3px;
  min-width: 0;
  text-align: left;
  min-height: 46px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

#orderWorkbench .order-product-profit-metric strong,
#orderWorkbench .order-profit-summary strong {
  overflow-wrap: anywhere;
}

#orderWorkbench .order-product-profit-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

#orderWorkbench .order-product-profit-metric small {
  color: #9a4b05;
  font-size: 11px;
  line-height: 1.3;
}

#orderWorkbench .order-product-profit-metric.negative,
#orderWorkbench .order-profit-summary .negative {
  border-color: #e0a09a;
  background: #fff4f2;
  color: #a12f25;
}

.order-library-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .65fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #dce8ed;
  border-radius: 5px;
  background: #f8fbfc;
}

.order-library-option-row > label {
  padding: 0;
  border: 0;
  background: transparent;
}

.order-option-cost-editor {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.order-option-cost-editor input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
}

.order-machine-cost-field {
  max-width: 360px;
}

.order-manual-options {
  grid-column: 1 / -1;
}

.order-manual-options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-manual-option-list {
  display: grid;
  gap: 8px;
}

.order-manual-option-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, .55fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 9px;
  border: 1px solid #dce8ed;
  border-radius: 5px;
  background: #f8fbfc;
}

.order-profit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 8px;
  min-width: 0;
}

.order-profit-summary > span {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #dbe7ec;
  border-radius: 6px;
  background: #f5fafb;
}

.order-profit-summary small,
.order-profit-summary em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.order-profit-discrepancy {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #e7c788;
  border-radius: 5px;
  background: #fff9ec;
  color: #89520b;
  text-align: right;
}

.order-profit-discrepancy[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .order-product-summary,
  .order-profit-summary,
  .order-library-option-row,
  .order-manual-option-row {
    grid-template-columns: 1fr;
  }

  .order-machine-cost-field {
    max-width: none;
  }

  .order-manual-options-head {
    align-items: stretch;
    flex-direction: column;
  }

  .order-profit-discrepancy {
    text-align: left;
  }
}

body.backend-shell-active:not(.public-site) .company-admin-summary {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

body.backend-shell-active:not(.public-site) .company-admin-summary-list {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

body.backend-shell-active:not(.public-site) .company-admin-summary-list button {
  width: min(100%, 360px);
  max-width: 100%;
  min-width: 0;
}

body.backend-shell-active:not(.public-site) .company-admin-summary-list button span {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 760px) {
  body.backend-shell-active:not(.public-site) :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select,
    textarea,
    details > summary
  ) {
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) :is(
    .checkbox-line,
    label:has(> input[type="checkbox"]),
    label:has(> input[type="radio"])
  ) {
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) :is(
    #quoteHistorySearchCard .quote-history-view-tabs button,
    .analysis-subnav a,
    .customer-detail-tabs button,
    .product-admin-tabs button,
    .product-drawer-tabs button,
    .quote-history-detail-tab,
    .order-workbench-secondary-tools > summary,
    .payment-term-row-menu > summary,
    .payment-term-row-menu button,
    .shared-data-status button,
    .shared-sync-button
  ) {
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) :is(
    #workbenchPlanPrevious,
    #workbenchPlanNext,
    button[data-quote-contact-remove],
    button[data-quote-email-remove]
  ) {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .workbench-plan-navigator {
    grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  }

  body.backend-shell-active:not(.public-site) #salesDashboardCard .dashboard-actions :is(input, select, button) {
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) #quoteHistorySearchCard .quote-history-advanced-filters > summary {
    min-height: 44px;
  }

  body.order-admin-page .payment-term-reorder button {
    min-width: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item :is(
    .customer-option-order-btn,
    .customer-option-delete-btn
  ) {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-edit-btn {
    min-height: 44px;
  }

  body.public-site .quotation-mobile-action-bar :is(.secondary, .primary) {
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .shared-data-status:not(.danger) {
    position: static;
    right: auto;
    bottom: auto;
    width: auto;
    max-width: none;
    margin: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-radius: 12px;
    box-shadow: none;
  }

  body.backend-shell-active:not(.public-site) .shared-data-status.danger {
    position: fixed;
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100vw - 16px - env(safe-area-inset-right));
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(92, 37, 29, 0.18);
  }
}

@media (max-width: 520px) {
  body.backend-shell-active:not(.public-site) .customer-option-admin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item > span:first-child,
  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-category {
    grid-column: 1 / -1;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item > span:first-child {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-category {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 44px;
    padding-left: 0;
    border-left: 0;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-category select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .customer-option-order-controls {
    grid-column: 1;
    justify-self: end;
    gap: 6px;
    margin-left: 0;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-order-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-edit-btn {
    grid-column: 2;
    width: auto;
    min-width: 56px;
    height: 44px;
    min-height: 44px;
    padding-inline: 10px;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item .customer-option-delete-btn {
    grid-column: 3;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-color: #efb7ae;
    color: #9d382d;
    background: #fff3f1;
  }

  body.backend-shell-active:not(.public-site) .customer-option-admin-item.readonly > small {
    grid-column: 1 / -1;
  }
}

/* Workbench visual unification local batch v1 */
body.backend-shell-active:not(.public-site) {
  --visual-batch-line: #d7e3e8;
  --visual-batch-line-strong: #bfd1d9;
  --visual-batch-surface: #ffffff;
  --visual-batch-surface-soft: #f6f9fa;
  --visual-batch-ink: #172a36;
  --visual-batch-muted: #627581;
  --visual-batch-brand: #0b6178;
  --visual-batch-brand-soft: #edf7f8;
  --visual-batch-radius: 10px;
  --visual-batch-shadow: 0 1px 2px rgba(23, 42, 54, 0.045);
  --visual-batch-gap: 14px;
}

body.backend-shell-active:not(.public-site) :is(
  .admin-card,
  .workbench-panel,
  .customer-management-panel,
  .customer-list-panel,
  .customer-detail-panel,
  .order-panel,
  .quote-wizard,
  .quote-history-workbench,
  .product-workspace-card,
  .technical-documents-center
) {
  border-color: var(--visual-batch-line);
  border-radius: var(--visual-batch-radius);
  box-shadow: var(--visual-batch-shadow);
}

body.backend-shell-active:not(.public-site).order-mode .order-panel.order-only {
  border-left-color: var(--visual-batch-brand);
}

body.backend-shell-active:not(.public-site):is(.customer-management-mode,.order-mode) #quoteEditorPanel,
body.backend-shell-active:not(.public-site).sales-mode[data-backend-active-module="quoteWorkbench"] #quoteEditorPanel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) :is(
  .admin-card > .section-heading:first-child,
  .workbench-panel > .workbench-panel-head:first-child,
  .customer-management-panel > .section-heading:first-child,
  .order-panel > .order-workbench-head:first-child,
  .quote-history-head,
  .analysis-section-heading
) {
  margin-bottom: var(--visual-batch-gap);
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--visual-batch-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) :is(
  .section-heading h1,
  .section-heading h2,
  .workbench-panel-head h2,
  .workbench-panel-head h3,
  .quote-history-head h2,
  .order-workbench-head h2,
  .admin-section-title h2
) {
  color: var(--visual-batch-ink);
  letter-spacing: -0.018em;
  line-height: 1.25;
}

body.backend-shell-active:not(.public-site) :is(
  .section-heading p,
  .workbench-panel-head p,
  .order-workbench-head p,
  .admin-section-title span,
  .form-help,
  .muted
) {
  color: var(--visual-batch-muted);
}

body.backend-shell-active:not(.public-site) :is(
  .header-actions,
  .quick-actions,
  .admin-section-actions,
  .table-actions,
  .quote-history-filter-actions,
  .order-actions
) {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body.backend-shell-active:not(.public-site) :is(
  .header-actions,
  .quick-actions,
  .admin-section-actions,
  .table-actions,
  .quote-history-filter-actions,
  .order-actions
) > * {
  min-width: 0;
}

body.backend-shell-active:not(.public-site) :is(input, select, textarea, button, .admin-link, .link-button) {
  border-radius: 8px;
}

body.backend-shell-active:not(.public-site) :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 3px solid rgba(11, 97, 120, 0.24);
  outline-offset: 2px;
}

body.backend-shell-active:not(.public-site) :is(
  .admin-table,
  .quote-history-table,
  .analysis-table,
  .dashboard-sales-table,
  .order-stats-table,
  .customer-browser-table
) :is(th, td),
body.backend-shell-active:not(.public-site) :is(
  .quote-history-kpis strong,
  .dashboard-kpi-grid strong,
  .order-stats-kpi strong,
  .workbench-kpi-card strong,
  .quote-snapshot-filter
) {
  font-variant-numeric: tabular-nums;
}

body.backend-shell-active:not(.public-site) :is(
  .admin-table,
  .quote-history-table,
  .analysis-table,
  .dashboard-sales-table,
  .order-stats-table,
  .customer-browser-table
) th {
  border-color: var(--visual-batch-line);
  background: #f1f6f7;
  box-shadow: none;
  color: #405762;
}

body.backend-shell-active:not(.public-site) :is(
  .customer-table-customer-open,
  .company-admin-summary-list button span,
  .opportunity-card-title-row strong
) {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.backend-shell-active:not(.public-site) .shared-data-status:not(.danger) {
  position: static;
  right: auto;
  bottom: auto;
  width: auto;
  max-width: min(100%, 720px);
  margin: 12px auto;
  border-color: var(--visual-batch-line);
  border-radius: var(--visual-batch-radius);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .backend-menu-section[data-backend-group="insight"] {
  --wds-menu-color: var(--visual-batch-brand);
  --wds-menu-bg: var(--visual-batch-brand-soft);
}

body.backend-shell-active:not(.public-site) .backend-menu-link.active {
  box-shadow: inset 3px 0 0 var(--visual-batch-brand);
}

body.backend-shell-active:not(.public-site) .backend-workbench-home.workbench-home-minimal {
  gap: var(--visual-batch-gap);
}

body.backend-shell-active:not(.public-site) .backend-workbench-home :is(
  .workbench-panel,
  .workbench-focus-strip,
  .workbench-action-row,
  .workbench-kpi-card
) {
  border-color: var(--visual-batch-line);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .workbench-dashboard-hero h2 {
  color: var(--visual-batch-ink);
}

body.backend-shell-active:not(.public-site) .workbench-panel-head > :last-child {
  margin-left: auto;
}

body.backend-shell-active:not(.public-site) :is(.quote-workbench-overview,.quote-wizard,.quote-wizard-progress,.quote-wizard-summary,.quote-wizard-actions) {
  border-color: var(--visual-batch-line);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .quote-overview-header {
  border-color: var(--visual-batch-line);
  background: var(--visual-batch-surface);
}

body.backend-shell-active:not(.public-site) .quote-wizard-progress {
  background: var(--visual-batch-surface-soft);
}

body.backend-shell-active:not(.public-site) .quote-wizard-step.active {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand-soft);
  color: var(--visual-batch-brand);
}

body.backend-shell-active:not(.public-site).order-mode :is(.order-workflow-steps,.order-workflow-section,.order-flow-card) {
  border-color: var(--visual-batch-line);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps {
  background: var(--visual-batch-surface-soft);
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section > .section-heading {
  border-bottom-color: var(--visual-batch-line);
}

body.backend-shell-active:not(.public-site).customer-management-mode #customerManagement {
  border-left-color: var(--visual-batch-brand);
  background: var(--visual-batch-surface);
}

body.backend-shell-active:not(.public-site) .customer-management-panel > .section-heading:first-child {
  border-bottom: 1px solid var(--visual-batch-line);
  background: transparent;
}

body.backend-shell-active:not(.public-site) .customer-management-panel :is(
  .customer-list-panel,
  .customer-detail-panel,
  .customer-table-view-switcher,
  .customer-browser-table-scroll,
  .customer-browser-table-row
) {
  border-color: var(--visual-batch-line);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .customer-management-panel .customer-table-view-button.active {
  background: var(--visual-batch-brand);
  color: #ffffff;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .customer-management-panel .customer-table-customer-open {
  color: var(--visual-batch-ink);
}

body.backend-shell-active:not(.public-site) .opportunity-heading,
body.backend-shell-active:not(.public-site) .opportunity-summary-card,
body.backend-shell-active:not(.public-site) .opportunity-toolbar,
body.backend-shell-active:not(.public-site) .opportunity-board-column,
body.backend-shell-active:not(.public-site) .opportunity-card {
  border-color: var(--visual-batch-line);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) .opportunity-toolbar,
body.backend-shell-active:not(.public-site) .opportunity-board-column {
  background: var(--visual-batch-surface-soft);
}

body.backend-shell-active:not(.public-site) #opportunityBoard {
  min-height: 220px;
  align-items: start;
}

body.backend-shell-active:not(.public-site) #opportunityBoard .opportunity-board-column {
  min-height: 190px;
}

body.backend-shell-active:not(.public-site) #opportunityBoard .opportunity-column-cards {
  min-height: 118px;
}

body.backend-shell-active:not(.public-site) #salesDashboardCard,
body.backend-shell-active:not(.public-site) #quoteHistorySearchCard,
body.order-admin-page.backend-shell-active:not(.public-site) #orderStatsCard {
  border: 1px solid var(--visual-batch-line);
  border-left: 3px solid var(--visual-batch-brand);
  background: var(--visual-batch-surface);
  box-shadow: var(--visual-batch-shadow);
}

body.backend-shell-active:not(.public-site) #salesDashboardCard > .sales-dashboard-head.section-heading:first-child {
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--visual-batch-line);
  border-radius: 0;
  background: var(--visual-batch-surface);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) :is(#salesDashboardCard,#quoteHistorySearchCard) :is(
  .dashboard-actions,
  .quote-history-filter-panel,
  .analysis-subnav,
  .dashboard-panel,
  .quote-history-stats-snapshot
) {
  border-color: var(--visual-batch-line);
  background: var(--visual-batch-surface-soft);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) :is(#salesDashboardCard,#quoteHistorySearchCard,#orderStatsCard) .analysis-subnav :is(a,button) {
  border-color: transparent;
  color: #526873;
  background: transparent;
}

body.backend-shell-active:not(.public-site) :is(#salesDashboardCard,#quoteHistorySearchCard,#orderStatsCard) .analysis-subnav :is(a,button):is(:hover,:focus-visible,.active,[aria-current="page"]) {
  border-color: var(--visual-batch-line-strong);
  color: var(--visual-batch-brand);
  background: var(--visual-batch-surface);
}

body.backend-shell-active:not(.public-site) #salesDashboardCard .sales-primary-kpis .dashboard-metric-card,
body.backend-shell-active:not(.public-site) #salesDashboardCard .sales-dashboard-alert-strip .dashboard-metric-card,
body.backend-shell-active:not(.public-site) #quoteHistorySearchCard .quote-history-kpis > div,
body.order-admin-page.backend-shell-active:not(.public-site) #orderStatsCard .order-stats-kpi {
  border-color: var(--visual-batch-line);
  background: var(--visual-batch-surface);
  background-image: none;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) :is(
  #salesDashboardCard .sales-primary-kpis .dashboard-metric-card strong,
  #quoteHistorySearchCard .quote-history-kpis strong,
  #orderStatsCard .order-stats-kpi strong
) {
  color: var(--visual-batch-brand);
}

body.backend-shell-active:not(.public-site) .quote-history-stats-grid li,
body.backend-shell-active:not(.public-site) .analysis-grid > div li {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

body.backend-shell-active:not(.public-site) .quote-history-stats-grid li::before,
body.backend-shell-active:not(.public-site) .analysis-grid > div li::before {
  content: none;
}

body.backend-shell-active:not(.public-site) .quote-snapshot-filter {
  grid-column: 1;
  min-width: 0;
  border-color: var(--visual-batch-line);
  border-radius: 8px;
  color: var(--visual-batch-brand);
  background: var(--visual-batch-surface);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

body.backend-shell-active:not(.public-site) #companyDataCard {
  grid-column: 1 / -1;
  width: min(100%, 980px);
  justify-self: center;
}

body.backend-shell-active:not(.public-site) #companyDataCard .admin-section-summary,
body.backend-shell-active:not(.public-site) #accountPermissionCard .admin-collapse > summary {
  border-color: var(--visual-batch-line);
  background: var(--visual-batch-surface-soft);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) #companyDataCard :is(.company-admin-summary,.company-admin-item),
body.backend-shell-active:not(.public-site) #accountPermissionCard :is(.account-form-panel,.account-permission-table-wrap) {
  border-color: var(--visual-batch-line);
  background: var(--visual-batch-surface);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) #companyDataCard .company-admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.backend-shell-active:not(.public-site) #companyDataCard .company-admin-summary-list button {
  width: min(100%, 440px);
  border-color: var(--visual-batch-line);
  background: var(--visual-batch-surface);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site) #accountPermissionCard .account-permission-summary :is(span,strong) {
  border-color: var(--visual-batch-line);
  border-radius: 999px;
  background: var(--visual-batch-surface-soft);
  color: #415a66;
}

body.backend-shell-active:not(.public-site) #accountPermissionCard .account-permission-summary strong {
  border-color: #bdd8df;
  background: var(--visual-batch-brand-soft);
  color: var(--visual-batch-brand);
}

@media (max-width: 760px) {
  body.backend-shell-active:not(.public-site) :is(button, a.admin-link, a.link-button, details > summary) {
    min-width: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site).sales-mode .quote-wizard-step-two .product-quick-search-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  body.backend-shell-active:not(.public-site).sales-mode .quote-wizard-step-two #productQuickClearBtn {
    width: 44px;
    min-width: 44px;
  }

  body.backend-shell-active.order-admin-page:not(.public-site) .order-template-save-actions-with-menu > button {
    min-width: 44px;
  }

  body.backend-shell-active:not(.public-site) :is(
    .section-heading.inline,
    .workbench-panel-head,
    .order-workbench-head,
    .admin-section-summary,
    .analysis-section-heading
  ) {
    align-items: stretch;
    flex-direction: column;
  }

  body.backend-shell-active:not(.public-site) :is(
    .header-actions,
    .quick-actions,
    .admin-section-actions,
    .table-actions,
    .quote-history-filter-actions,
    .order-actions
  ) {
    width: 100%;
    flex-wrap: wrap;
  }

body.backend-shell-active:not(.public-site) :is(.customer-management-mode,.order-mode) #quoteEditorPanel,
body.backend-shell-active:not(.public-site).sales-mode[data-backend-active-module="quoteWorkbench"] #quoteEditorPanel {
    width: 100%;
  }

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-list-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  box-shadow: none;
}

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-browser-table-row {
    grid-template-columns: 34px minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-more-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    bottom: auto;
    left: auto;
    grid-template-columns: minmax(0, 1fr);
    width: min(280px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
  }

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-more-filter-menu .field {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-mobile-more {
    grid-column: 2 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-mobile-more :is(summary,dl,div,dd) {
    min-width: 0;
    max-width: 100%;
  }

  body.backend-shell-active:not(.public-site) .customer-management-panel .customer-mobile-more dd {
    overflow-wrap: break-word;
    word-break: normal;
  }

  body.backend-shell-active:not(.public-site) .workbench-action-tools > :is(button, a) {
    min-width: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .workbench-recent-quote-actions button {
    min-width: 44px;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site) .opportunity-list-title {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
  }

  body.backend-shell-active:not(.public-site) #companyDataCard {
    width: 100%;
  }

  body.backend-shell-active:not(.public-site) #companyDataCard .company-admin-form,
  body.backend-shell-active:not(.public-site) #companyDataCard .brand-media-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.backend-shell-active:not(.public-site) #companyDataCard .company-admin-summary-list button {
    width: 100%;
  }

  body.backend-shell-active:not(.public-site) :is(#salesDashboardCard,#quoteHistorySearchCard,#orderStatsCard) .analysis-subnav {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  body.backend-shell-active:not(.public-site) .quote-history-stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Order screen hierarchy polish v1 */
body.backend-shell-active:not(.public-site):is(.order-mode,.order-admin-page[data-backend-active-module="orderFileTypeCard"]) {
  --visual-batch-brand: #0c6b71;
  --visual-batch-brand-soft: #f1f7f7;
  --visual-batch-ink: #172a35;
  --visual-batch-muted: #66737f;
  --visual-batch-line: #dce2e6;
  --visual-batch-line-strong: #c9d2d8;
  background: #ffffff;
}

body.backend-shell-active:not(.public-site):is(.order-mode,.order-admin-page[data-backend-active-module="orderFileTypeCard"]) :is(.backend-sidebar,.backend-topbar) {
  border-color: #dce2e6;
  background: #f8fafb;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site):is(.order-mode,.order-admin-page[data-backend-active-module="orderFileTypeCard"]) .backend-sidebar-brand {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site):is(.order-mode,.order-admin-page[data-backend-active-module="orderFileTypeCard"]) :is(.backend-sidebar-brand-copy,.backend-sidebar-brand-copy strong,.backend-sidebar-brand > strong) {
  color: #172a35;
}

body.backend-shell-active:not(.public-site):is(.order-mode,.order-admin-page[data-backend-active-module="orderFileTypeCard"]) :is(.backend-sidebar-brand-copy small,.backend-sidebar-brand > span) {
  color: #66737f;
}

body.backend-shell-active:not(.public-site):is(.order-mode,.order-admin-page[data-backend-active-module="orderFileTypeCard"]) .backend-sidebar .backend-menu-link.active {
  border-color: transparent;
  border-radius: 4px;
  background: #edf2f4;
  color: #0c6b71;
  box-shadow: inset 3px 0 0 #0c6b71;
}

#orderWorkbench,
body.order-admin-page :is(#orderFileTypeCard, #orderAdminWorkbenchCard, #orderTemplatePreviewDialog) {
  --visual-batch-brand: #0066cc;
  --visual-batch-brand-soft: #edf5ff;
  --visual-batch-ink: #1d1d1f;
  --visual-batch-muted: #6e6e73;
  --visual-batch-line: #d2d2d7;
  --visual-batch-line-strong: #b8b8be;
  --order-ui-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  outline: none;
}

#orderWorkbench :is(.order-workbench-head, .order-workflow-section > .section-heading, .order-buyer-info-head, .order-subsection-head, .order-step-actions, .order-review-rail),
body.order-admin-page :is(.order-file-template-head-grid, .order-template-control-grid, .order-editor-toolbar, .order-template-advanced-tools) {
  font-family: var(--order-ui-font);
  color: var(--visual-batch-ink);
}

#orderWorkbench :is(button, input, select, textarea, summary):not(.quote-sheet *),
body.order-admin-page :is(#orderFileTypeCard, #orderAdminWorkbenchCard) :is(button, input, select, textarea, summary):not(.quote-sheet *):not(.order-template-visual-editor *) {
  font-family: var(--order-ui-font);
  accent-color: var(--visual-batch-brand);
  font-weight: 500;
  line-height: 1.45;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

#orderWorkbench :is(button, input, select, textarea, summary):focus-visible,
body.order-admin-page :is(#orderFileTypeCard, #orderAdminWorkbenchCard) :is(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--visual-batch-brand);
  outline-offset: 3px;
}

body.backend-shell-active:not(.public-site).order-mode .order-panel.order-only {
  container: order-generation / inline-size;
  width: 100%;
  min-width: 0;
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: #f5f5f7;
  box-shadow: none;
  color: #1d1d1f;
  font-size: 14px;
}

body.backend-shell-active:not(.public-site).order-mode .order-workbench-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--visual-batch-line);
}

body.backend-shell-active:not(.public-site).order-mode .order-workbench-head .order-workflow-steps {
  grid-column: 1 / -1;
  grid-row: 2;
}

body.backend-shell-active:not(.public-site).order-mode #orderLanguageToolSlot {
  grid-column: 2;
  grid-row: 1;
}

body.backend-shell-active:not(.public-site).order-mode .order-workbench-head .order-title {
  margin: 0;
  padding: 0;
  border: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-workbench-head h2 {
  margin: 0;
  font-size: 28px;
}

body.backend-shell-active:not(.public-site).order-mode :is(
  .order-workflow-steps button,
  .order-step-actions button,
  .order-workflow-section > .section-heading button
) {
  min-height: 40px;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps button {
  min-width: 0;
  padding: 6px;
  border-color: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #6e6e73;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps button.active {
  border-color: transparent;
  border-bottom-color: var(--visual-batch-brand);
  background: transparent;
  color: var(--visual-batch-brand);
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-step-label {
  font-size: 13px;
  font-weight: 600;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-step-label b {
  border: 1px solid #aebbc4;
  background: #ffffff;
  color: #6e6e73;
  font-size: 11px;
  font-weight: 500;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps button.active .order-workflow-step-label b {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand);
  color: #ffffff;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps button small {
  font-size: 11px;
  font-weight: 500;
  opacity: 1;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps button.done:not(.active) {
  border-color: transparent;
  background: transparent;
  color: #287149;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps button:is(.has-warning,.is-blocked):not(.active) {
  background: transparent;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-sections {
  gap: 12px;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section > .section-heading {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--visual-batch-line);
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-section-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-card {
  gap: 10px;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-card + .order-buyer-card {
  padding-top: 16px;
  border-top: 1px solid var(--visual-batch-line);
}

body.backend-shell-active:not(.public-site).order-mode :is(.order-subsection-head,.order-buyer-info-head) {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
}

body.backend-shell-active:not(.public-site).order-mode #orderWorkbench :is(.field > span,.field > label) {
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
}

body.backend-shell-active:not(.public-site).order-mode #orderWorkbench :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
  min-height: 40px;
  border-radius: 10px;
  font-size: 14px;
}

body.backend-shell-active:not(.public-site).order-mode #orderWorkbench button {
  border-radius: 10px;
  font-size: 13px;
}

body.backend-shell-active:not(.public-site).order-mode #orderWorkflowSteps button {
  border-radius: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-overview {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) auto;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary:not([data-status="warning"]):not([data-status="missing"]) {
  padding: 4px 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: #6e6e73;
}

body.backend-shell-active:not(.public-site).order-mode .order-settlement-summary strong {
  font-weight: 500;
}

body.backend-shell-active:not(.public-site).order-mode .order-show-bank-info-field {
  color: #6e6e73;
  font-weight: 500;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section .order-fields-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section .order-fields-grid > :is(
  .full,
  .order-buyer-address-field,
  .order-payment-term-field,
  .order-notes-field
) {
  grid-column: 1 / -1;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section .order-buyer-primary-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 10px 16px;
}

body.backend-shell-active:not(.public-site).order-mode .order-workflow-section .order-buyer-primary-grid > .field {
  grid-column: auto;
  min-width: 0;
  margin: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-info-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-info-head > strong {
  flex: 0 0 auto;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot {
  flex: 1 1 auto;
  min-width: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot .quote-contact-editor-toolbar {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: 0;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot .quote-contact-editor-title > span {
  display: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot .quote-contact-benefit-notice span {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--visual-batch-muted);
  font-size: 12px;
  font-weight: 500;
}

body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot .quote-save-customer-btn {
  width: auto;
  min-height: 40px;
  margin: 0 0 0 auto;
  padding: 6px 12px;
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-editor-field {
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 4px;
  border: 1px solid var(--visual-batch-line);
  border-radius: 10px;
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(#quoteAddContactMethodBtn, #quoteAddEmailBtn) {
  min-width: 64px;
  min-height: 40px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  color: var(--visual-batch-brand);
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(#quoteAddContactMethodBtn, #quoteAddEmailBtn):hover {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand-soft);
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(.quote-contact-method-row, .quote-contact-email-row) {
  padding: 0;
  border: 0;
  background: transparent;
  align-items: start;
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(.quote-contact-method-row, .quote-contact-email-row) > button {
  align-self: start;
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
  border-color: var(--visual-batch-line);
  background: #ffffff;
  color: #6e6e73;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(.quote-contact-method-row, .quote-contact-email-row) > button:hover {
  border-color: #d9b4b0;
  background: #fff7f6;
  color: #9f2f25;
}

body.backend-shell-active:not(.public-site).order-mode :is(
  .order-buyer-card,
  .order-product-workbench,
  .order-packing-editor,
  .order-batch-export-panel,
  .order-preview-more-tools
) {
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-product-workbench {
  padding: 0;
  border: 0;
  border-color: var(--visual-batch-line);
  border-radius: 0;
  background: #ffffff;
}

body.backend-shell-active:not(.public-site).order-mode :is(.order-product-toolbar,.order-product-summary,.order-packing-editor,.order-preview-more-tools) {
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-product-toolbar {
  gap: 10px;
  padding: 0 0 12px;
}

body.backend-shell-active:not(.public-site).order-mode .order-product-summary {
  padding-top: 12px;
  border-top: 1px solid var(--visual-batch-line);
}

body.backend-shell-active:not(.public-site).order-mode .order-step-actions {
  grid-column: 1 / -1;
  position: sticky;
  bottom: 0;
  z-index: 24;
  margin-top: 0;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  border: 1px solid var(--visual-batch-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

body.backend-shell-active:not(.public-site).order-mode .order-step-actions button:last-child:not([hidden]) {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand);
  color: #ffffff;
}

body.order-admin-page.backend-shell-active:not(.public-site)[data-backend-active-module="orderFileTypeCard"] #adminPanel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f5f5f7;
  box-shadow: none;
}

body.order-admin-page #orderFileTypeCard,
body.order-admin-page #orderAdminWorkbenchCard {
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

body.order-admin-page .order-file-template-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
}

body.order-admin-page #orderFileTypeCard .order-file-template-head-grid > .section-heading:first-child {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

body.order-admin-page #orderFileTypeCard .order-file-template-head-grid > .section-heading h2 {
  margin: 0;
  font-size: 28px;
}

body.backend-shell-active.order-admin-page:not(.public-site) #docTabs {
  grid-column: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: 0;
  padding: 8px 0 0;
  border: 0;
  border-bottom: 1px solid var(--visual-batch-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-x: auto;
}

body.backend-shell-active.order-admin-page:not(.public-site) #docTabs button {
  width: auto;
  min-width: max-content;
  min-height: 42px;
  padding: 8px 12px;
  border-color: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  background-image: none;
  color: #6e6e73;
  box-shadow: none;
}

body.backend-shell-active.order-admin-page:not(.public-site) #docTabs button.active {
  border-color: transparent;
  border-bottom-color: var(--visual-batch-brand);
  background: transparent;
  background-image: none;
  color: var(--visual-batch-brand);
  box-shadow: none;
}

body.order-admin-page #paymentTermsAdmin {
  width: 100%;
  margin: 0;
  border-color: var(--visual-batch-line);
  border-radius: 10px;
  background: #f8fafb;
  box-shadow: none;
}

body.order-admin-page #paymentTermsAdmin > summary {
  min-height: 40px;
  padding: 7px 10px;
}

body.order-admin-page .order-template-control-grid {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

body.order-admin-page #orderAdminWorkbenchCard {
  container: order-template / inline-size;
  min-width: 0;
}

body.order-admin-page .order-template-control-grid > .order-admin-workbench-utility {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  padding: 0;
  border: 0;
}

body.order-admin-page .order-edit-scope-chip {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6e6e73;
  font-weight: 500;
}

body.order-admin-page .order-edit-scope-label {
  grid-column: 1;
  grid-row: 1;
  color: #6e6e73;
  font-size: 13px;
}

body.order-admin-page .order-protected-fields {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-bottom: 0;
  border: 0;
  overflow: visible;
}

body.order-admin-page .order-protected-fields > summary {
  min-height: 40px;
  padding: 6px 10px;
}

body.order-admin-page .edit-mode-tabs {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--visual-batch-line);
  border-radius: 10px;
  background: #ffffff;
}

body.order-admin-page #orderAdminWorkbenchCard .edit-mode-tabs button {
  min-height: 40px;
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
  background-image: none;
  color: #6e6e73;
  box-shadow: none;
}

body.order-admin-page #orderAdminWorkbenchCard .edit-mode-tabs button.active {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand);
  background-image: none;
  color: #ffffff;
  box-shadow: none;
}

#orderAdminWorkbenchCard .order-admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "editor" "preview";
  gap: 24px;
  min-width: 0;
}

#orderAdminWorkbenchCard .order-admin-preview-panel {
  grid-area: preview;
  display: block;
  min-width: 0;
  max-width: 100%;
  max-height: 900px;
  padding: 24px;
  border: 1px solid var(--visual-batch-line);
  border-radius: 16px;
  background: #f5f5f7;
  overflow: auto;
  overscroll-behavior: contain;
}

#orderAdminWorkbenchCard .order-admin-edit-panel {
  grid-area: editor;
  min-width: 0;
  max-width: 100%;
  position: static;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

body.order-admin-page .order-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
  border: 0;
}

/* Keep the placeholder scroller and More within the editor. */
body.order-admin-page .order-editor-toolbar,
body.order-admin-page .order-editor-toolbar > * {
  min-width: 0;
  max-width: 100%;
}

body.order-admin-page #templatePlaceholderBar {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.order-admin-page .template-visual-edit-tabs {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 0;
}

body.order-admin-page #orderAdminWorkbenchCard .template-visual-edit-tabs button {
  min-height: 40px;
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
  background-image: none;
  color: #6e6e73;
  box-shadow: none;
}

body.order-admin-page #orderAdminWorkbenchCard .template-visual-edit-tabs button.active {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand);
  background-image: none;
  color: #ffffff;
  box-shadow: none;
}

body.order-admin-page .template-placeholder-bar {
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

body.order-admin-page .template-placeholder-primary {
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

body.order-admin-page .template-placeholder-primary button,
body.order-admin-page .template-placeholder-more > summary {
  min-height: 40px;
  padding: 5px 9px;
}

body.order-admin-page .order-template-preview-button {
  min-height: 40px;
  border-color: var(--visual-batch-line-strong);
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: none;
}

body.order-admin-page .order-logistics-suggestion:not(.hidden) {
  grid-column: 1 / -1;
}

body.order-admin-page .order-admin-edit-pane {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.order-admin-page .order-template-visual-editor,
body.order-admin-page .order-admin-workspace.template-edit-expanded .order-template-visual-editor {
  min-height: max(300px, calc(100vh - 355px));
  max-height: none;
  padding: 16px;
  border-color: var(--visual-batch-line-strong);
  border-radius: 10px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

body.order-admin-page .order-admin-editor,
body.order-admin-page .order-admin-workspace.template-edit-expanded .order-admin-editor {
  min-height: max(300px, calc(100vh - 355px));
}

body.order-admin-page .order-template-visual-editor :is(table,.order-template-table-scroll) {
  max-width: 100%;
}

body.order-admin-page .order-template-save-actions,
body.backend-shell-active.order-admin-page:not(.public-site) .order-template-save-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.order-admin-page .order-template-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

body.order-admin-page .order-template-heading-actions .order-template-save-actions.hidden {
  display: none;
}

body.order-admin-page .order-template-heading-actions .order-template-save-state {
  order: 2;
  margin: 0;
  background: transparent;
  font-weight: 500;
}

body.order-admin-page .order-template-save-more {
  order: 3;
}

body.order-admin-page .order-template-heading-actions .order-template-save-more > div {
  top: calc(100% + 6px);
  bottom: auto;
}

body.order-admin-page .order-template-heading-actions :is(#saveCurrentDocBtn,#saveTemplateBtn,#saveAllTemplatesBtn):not(:disabled) {
  border-color: var(--visual-batch-brand);
  background: var(--visual-batch-brand);
  color: #ffffff;
  box-shadow: none;
}

body.order-admin-page :is(.order-template-heading-actions,.order-template-control-grid,.order-editor-toolbar) :is(button,summary) {
  border-radius: 10px;
  font-size: 13px;
}

body.order-admin-page .order-editor-toolbar > .order-workbench-secondary-tools {
  grid-column: 2;
  grid-row: 1;
}

body.order-admin-page .order-editor-toolbar > .order-protected-fields[open] {
  grid-column: 1 / -1;
  grid-row: 3;
  border: 1px solid var(--visual-batch-line);
  border-radius: 10px;
}

body.order-admin-page .order-template-advanced-tools {
  margin-top: 2px;
}

body.order-admin-page .order-template-advanced-tools > summary {
  min-height: 40px;
  padding: 7px 2px;
  color: #6e6e73;
}

@media (max-width: 760px) {
  body.backend-shell-active:not(.public-site).order-mode .order-panel.order-only {
    padding: 16px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workflow-section {
    padding: 0;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workflow-steps {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workbench-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.backend-shell-active:not(.public-site).order-mode #orderLanguageToolSlot {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workbench-head .order-workflow-steps {
    grid-row: 2;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-settlement-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  body.backend-shell-active:not(.public-site).order-mode #orderWorkbench :is(button,input:not([type="checkbox"]):not([type="radio"]),select,textarea,summary,.inline-checkbox) {
    min-height: 44px;
    font-size: 16px;
  }

  body.order-admin-page #orderAdminWorkbenchCard :is(input,select,textarea):not(.quote-sheet *):not(.order-template-visual-editor *) {
    font-size: 16px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workbench-head h2,
  body.order-admin-page #orderFileTypeCard .order-file-template-head-grid > .section-heading h2 {
    font-size: 24px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-buyer-info-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-buyer-info-head > strong {
    grid-column: 1;
    grid-row: 1;
  }

  body.backend-shell-active:not(.public-site).order-mode :is(.order-buyer-actions-slot, .order-buyer-actions-slot .quote-contact-editor-toolbar) {
    display: contents;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot .quote-contact-editor-title {
    grid-column: 1;
    grid-row: 2;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-buyer-actions-slot .quote-save-customer-btn {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(.quote-contact-method-row, .quote-contact-email-row) {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-method-row > select {
    grid-column: 1 / -1;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-method-row > input {
    grid-column: 1;
    grid-row: 2;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-method-row > button {
    grid-column: 2;
    grid-row: 2;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot .quote-contact-email-row > button {
    grid-column: 2;
    grid-row: 1;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-settlement-details > summary,
  body.backend-shell-active:not(.public-site).order-mode .order-contact-editor-slot :is(#quoteAddContactMethodBtn, #quoteAddEmailBtn, .quote-contact-method-row > button, .quote-contact-email-row > button) {
    min-height: 44px;
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workflow-section .order-fields-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.backend-shell-active:not(.public-site).order-mode .order-workflow-section .order-fields-grid > * {
    grid-column: 1;
  }

  body.backend-shell-active:not(.public-site).order-mode :is(
    .order-workflow-steps button,
    .order-step-actions button,
    .order-workflow-section > .section-heading button
  ) {
    min-height: 44px;
  }

  body.backend-shell-active.order-admin-page:not(.public-site) #orderFileTypeCard .order-file-template-head-grid,
  body.backend-shell-active.order-admin-page:not(.public-site) #orderAdminWorkbenchCard .order-template-control-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.order-admin-page #orderFileTypeCard,
  body.order-admin-page #orderAdminWorkbenchCard {
    padding: 16px;
  }

  body.backend-shell-active.order-admin-page:not(.public-site) #paymentTermsAdmin {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  body.backend-shell-active.order-admin-page:not(.public-site) #orderFileTypeCard .order-file-template-head-grid > *,
  body.backend-shell-active.order-admin-page:not(.public-site) #orderAdminWorkbenchCard .order-template-control-grid > *,
  body.backend-shell-active.order-admin-page:not(.public-site) #orderAdminWorkbenchCard .order-template-control-grid > .order-admin-workbench-utility :is(.order-edit-scope-chip,.order-workbench-secondary-tools) {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
  }

  body.order-admin-page .order-template-heading-actions {
    margin-left: 0;
  }

  body.order-admin-page .order-template-control-grid {
    gap: 6px;
  }

  body.order-admin-page #docTabs,
  body.order-admin-page .edit-mode-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  body.order-admin-page #docTabs button,
  body.order-admin-page #orderAdminWorkbenchCard .edit-mode-tabs button {
    min-width: max-content;
    min-height: 44px;
  }

  body.order-admin-page .order-editor-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  body.order-admin-page .template-visual-edit-tabs {
    grid-column: 1 / -1;
  }

  body.order-admin-page .template-placeholder-bar {
    grid-column: 1 / -1;
  }

  body.order-admin-page .order-editor-toolbar > .order-protected-fields,
  body.order-admin-page .order-editor-toolbar > .order-protected-fields[open] {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  body.order-admin-page .order-editor-toolbar > .order-workbench-secondary-tools {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  body.order-admin-page .order-template-preview-button {
    min-width: 72px;
    min-height: 44px;
  }

  body.order-admin-page .order-template-visual-editor,
  body.order-admin-page .order-admin-workspace.template-edit-expanded .order-template-visual-editor,
  body.order-admin-page .order-admin-editor,
  body.order-admin-page .order-admin-workspace.template-edit-expanded .order-admin-editor {
    min-height: 360px;
  }

  body.order-admin-page .order-template-visual-editor {
    overflow-x: auto;
  }

  body.order-admin-page .order-template-visual-editor table {
    min-width: 640px;
  }

  body.order-admin-page .order-template-save-actions,
  body.backend-shell-active.order-admin-page:not(.public-site) .order-template-save-actions {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  body.backend-shell-active.order-admin-page:not(.public-site) :is(
    #paymentTermsAdmin > summary,
    .order-protected-fields > summary,
    .order-workbench-secondary-tools > summary,
    .order-template-advanced-tools > summary,
    .template-placeholder-more > summary,
    .template-visual-edit-tabs button,
    .template-placeholder-primary button,
    .template-placeholder-more button,
    .order-template-preview-button,
    .order-template-heading-actions button,
    .order-template-heading-actions summary
  ) {
    min-height: 44px;
  }

  body.backend-shell-active.order-admin-page:not(.public-site) :is(
    #paymentTermsAdmin :is(button,summary),
    .order-workbench-secondary-tools button,
    .order-core-field-locks button,
    .order-template-advanced-tools button
  ) {
    min-height: 44px;
  }
}

body.order-mode #orderWorkbenchLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

body.order-mode #orderMainFlow {
  min-width: 0;
}

#orderWorkbench .order-flow-card {
  min-width: 0;
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
}

body.order-mode #orderReviewRail {
  position: static;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--visual-batch-line);
  border-radius: 16px;
  background: #ffffff;
}

#orderWorkbench .order-review-card {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#orderWorkbench .order-review-card-head {
  min-height: 44px;
  padding: 16px;
}

#orderWorkbench .order-workflow-section > .section-heading h3 {
  font-size: 18px;
}

#orderWorkbench :is(.order-subsection-head, .order-buyer-info-head) > strong {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

body.order-mode #orderWorkbench :is(.primary, .order-primary-import-action, .quote-save-customer-btn):not(:disabled) {
  border-color: var(--visual-batch-brand);
  border-radius: 999px;
  background: var(--visual-batch-brand);
  background-image: none;
  color: #ffffff;
}

body.order-mode #orderWorkbench :is(.secondary, .ghost, .admin-link):not(:disabled),
body.order-admin-page :is(#orderFileTypeCard, #orderAdminWorkbenchCard) .secondary:not(:disabled) {
  border-color: var(--visual-batch-line);
  background: #ffffff;
  background-image: none;
  color: var(--visual-batch-brand);
  box-shadow: none;
}

body.order-mode #orderWorkbench input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@container order-template (min-width: 1180px) {
  #orderAdminWorkbenchCard .order-admin-workspace {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas: "preview editor";
    align-items: start;
  }
}

@media (max-width: 760px) {
  #orderWorkbench .order-flow-card,
  #orderAdminWorkbenchCard .order-admin-preview-panel {
    padding: 16px;
  }
  #orderWorkbench .order-step-actions {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  #orderWorkbench :is(button, input, select, textarea, summary),
  body.order-admin-page :is(#orderFileTypeCard, #orderAdminWorkbenchCard) :is(button, input, select, textarea, summary) {
    transition: none;
    scroll-behavior: auto;
  }
}

#orderWorkbench :is(input,select,textarea):not(.quote-sheet *),
body.order-admin-page #orderAdminWorkbenchCard :is(input,select,textarea):not(.quote-sheet *):not(.order-template-visual-editor *) {
  font-weight: 400;
  scroll-margin-block: 96px calc(var(--order-step-actions-height,88px) + 24px);
}
html:has(body.order-mode) {
  scroll-padding-block-end: calc(var(--order-step-actions-height,88px) + 24px);
}
