/*
 * Sanxi admin foundation — the single semantic layer above legacy page CSS.
 * Keep customer-facing previews and the approved product editor workflow intact.
 */
:root {
  color-scheme: light;
  --sx-canvas: #f3f5f7;
  --sx-surface: #fefeff;
  --sx-surface-subtle: #f7f8fb;
  --sx-surface-hover: #f5f8ff;
  --sx-ink: #17212b;
  --sx-muted: #68727d;
  --sx-border: rgba(23, 33, 43, 0.10);
  --sx-border-strong: rgba(23, 33, 43, 0.16);
  --sx-primary: #315eea;
  --sx-primary-hover: #244cc9;
  --sx-primary-soft: #edf4ff;
  --sx-focus: rgba(49, 94, 234, 0.25);
  --sx-success: #16845b;
  --sx-success-soft: #eaf8f1;
  --sx-warning: #a86118;
  --sx-warning-soft: #fff4e5;
  --sx-danger: #b42318;
  --sx-danger-soft: #fef0ef;
  --sx-space-1: 4px;
  --sx-space-2: 8px;
  --sx-space-3: 12px;
  --sx-space-4: 16px;
  --sx-space-5: 20px;
  --sx-space-6: 24px;
  --sx-radius-control: 10px;
  --sx-radius-panel: 14px;
  --sx-radius-dialog: 18px;
  --sx-radius-nav: 8px;
  --sx-radius-status: 7px;
  --sx-radius-marker: 3px;
  --sx-radius-panel-compact: 12px;
  --sx-radius-product-control: 9px;
  --sx-control-height: 38px;
  --sx-touch-control-height: 44px;
  --sx-shell-sidebar-width: 216px;
  --sx-shell-topbar-height: 64px;
  --sx-shell-view-padding: 20px 24px 56px;
  --sx-shell-view-padding-narrow: 20px 20px 56px;
  --sx-shell-view-padding-phone: 16px 12px 56px;
  --sx-designer-view-padding: 0 20px 20px;
  --sx-shell-sidebar-background: color-mix(in srgb, var(--sx-surface) 78%, var(--sx-canvas));
  --sx-shell-nav-text: color-mix(in srgb, var(--sx-ink) 76%, var(--sx-muted));
  --sx-shell-nav-hover-text: var(--sx-ink);
  --sx-shell-nav-hover-background: var(--sx-surface-hover);
  --sx-shell-nav-active-text: var(--sx-primary);
  --sx-shell-nav-active-background: var(--sx-primary-soft);
  --sx-shadow-1: 0 1px 2px rgba(20, 32, 55, 0.045), 0 8px 24px rgba(20, 32, 55, 0.035);
  --sx-shadow-dialog: 0 24px 64px rgba(18, 29, 48, 0.20);
  --sx-shadow-primary: 0 1px 2px rgba(35, 77, 192, 0.20);
  --sx-product-editor-surface: #fff;
  --sx-product-editor-ink: #1d1d1f;
  --sx-product-editor-border: #d2d2d7;
  --sx-product-editor-focus: #0071e3;
  --sx-product-editor-focus-ring: rgba(0, 113, 227, 0.16);

  /* Compatibility aliases: existing views read these while the system converges. */
  --color-background: var(--sx-canvas);
  --color-surface: var(--sx-surface);
  --color-surface-subtle: var(--sx-surface-subtle);
  --color-surface-raised: var(--sx-surface);
  --color-text: var(--sx-ink);
  --color-text-muted: var(--sx-muted);
  --color-border: var(--sx-border);
  --color-border-soft: rgba(23, 33, 43, 0.065);
  --color-hover: var(--sx-surface-hover);
  --color-row-hover: #f8faff;
  --color-input: var(--sx-surface);
  --color-overlay: rgba(16, 25, 39, 0.44);
  --color-shadow: rgba(20, 32, 55, 0.12);
  --color-background-dark: #121820;
  --color-accent: var(--sx-primary);
  --color-accent-strong: var(--sx-primary-hover);
  --color-accent-soft: var(--sx-primary-soft);
  --color-secondary: var(--sx-primary);
  --color-secondary-soft: var(--sx-primary-soft);
  --color-danger: var(--sx-danger);
  --color-warning: var(--sx-warning);
  --color-success: var(--sx-success);
  --space-1: var(--sx-space-1);
  --space-2: var(--sx-space-2);
  --space-3: var(--sx-space-3);
  --space-4: var(--sx-space-4);
  --space-5: var(--sx-space-5);
  --space-6: var(--sx-space-6);
  --radius-sm: var(--sx-radius-control);
  --radius-md: var(--sx-radius-panel);
  --control-height: var(--sx-control-height);
  --sidebar-width: var(--sx-shell-sidebar-width);
  --ink: var(--sx-ink);
  --muted: var(--sx-muted);
  --line: var(--sx-border);
  --paper: var(--sx-canvas);
  --white: var(--sx-surface);
  --teal: var(--sx-primary);
  --teal-soft: var(--sx-primary-soft);
  --orange: var(--sx-warning);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --sx-canvas: #111722;
  --sx-surface: #19212d;
  --sx-surface-subtle: #202a38;
  --sx-surface-hover: #253143;
  --sx-ink: #eff4fb;
  --sx-muted: #a9b6c6;
  --sx-border: rgba(221, 232, 247, 0.13);
  --sx-border-strong: rgba(221, 232, 247, 0.22);
  --sx-primary: #82a8ff;
  --sx-primary-hover: #a8c3ff;
  --sx-primary-soft: #233b68;
  --sx-focus: rgba(130, 168, 255, 0.32);
  --sx-success: #64d29b;
  --sx-success-soft: #153c2c;
  --sx-warning: #f1b56f;
  --sx-warning-soft: #45331e;
  --sx-danger: #ff9c94;
  --sx-danger-soft: #4a2527;
  --sx-shadow-primary: 0 1px 2px rgba(0, 0, 0, 0.26);
  --sx-product-editor-surface: #1c1c1e;
  --sx-product-editor-ink: #f5f5f7;
  --sx-product-editor-border: #48484a;
  --sx-shell-sidebar-background: #171b21;
  --sx-shell-nav-text: #bcc5cf;
  --sx-shell-nav-hover-text: var(--sx-ink);
  --sx-shell-nav-hover-background: #232a32;
  --sx-shell-nav-active-text: #8bb3ff;
  --sx-shell-nav-active-background: #263650;
  --color-background: var(--sx-canvas);
  --color-surface: var(--sx-surface);
  --color-surface-subtle: var(--sx-surface-subtle);
  --color-surface-raised: var(--sx-surface);
  --color-text: var(--sx-ink);
  --color-text-muted: var(--sx-muted);
  --color-border: var(--sx-border);
  --color-border-soft: rgba(221, 232, 247, 0.08);
  --color-hover: var(--sx-surface-hover);
  --color-row-hover: var(--sx-surface-subtle);
  --color-input: var(--sx-surface);
  --color-overlay: rgba(0, 0, 0, 0.70);
  --color-shadow: rgba(0, 0, 0, 0.38);
  --color-accent: var(--sx-primary);
  --color-accent-strong: var(--sx-primary-hover);
  --color-accent-soft: var(--sx-primary-soft);
  --color-secondary: var(--sx-primary);
  --color-secondary-soft: var(--sx-primary-soft);
  --color-danger: var(--sx-danger);
  --color-warning: var(--sx-warning);
  --color-success: var(--sx-success);
  --teal: var(--sx-primary);
  --teal-soft: var(--sx-primary-soft);
  --color-background-dark: var(--sx-canvas);
}

body { color: var(--sx-ink); background: var(--sx-canvas); }
button, input, select, textarea { font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }

:where(button, input, select, textarea, a, summary):focus-visible {
  outline: 3px solid var(--sx-focus);
  outline-offset: 2px;
}

/* Shared shell: calm, dense and operational, rather than a promotional card layout. */
.shell { background: var(--sx-canvas); }
.shell:not(.designer-mode) #view { max-width: 1680px; padding-bottom: 56px; }
.sidebar {
  border-right: 1px solid var(--sx-border);
  background: color-mix(in srgb, var(--sx-surface) 78%, var(--sx-canvas));
}
.brand { border-bottom-color: var(--sx-border); }
.brand strong { color: var(--sx-ink); }
.brand span, .sidebar-footer { color: var(--sx-muted); }
.nav-item {
  position: relative;
  border-radius: var(--sx-radius-nav);
  color: color-mix(in srgb, var(--sx-ink) 76%, var(--sx-muted));
  transition: color 150ms ease, background 150ms ease;
}
.nav-item:hover { color: var(--sx-ink); background: var(--sx-surface-hover); }
.nav-item.active { color: var(--sx-primary); background: var(--sx-primary-soft); }
.nav-item.active::before {
  position: absolute;
  left: -8px;
  width: 3px;
  height: 18px;
  border-radius: 0 var(--sx-radius-marker) var(--sx-radius-marker) 0;
  background: var(--sx-primary);
  content: "";
}
.nav-item-marker { background: color-mix(in srgb, var(--sx-muted) 55%, transparent); }
.nav-item.active .nav-item-marker { background: var(--sx-primary); }
.topbar {
  border-bottom: 1px solid var(--sx-border);
  background: color-mix(in srgb, var(--sx-surface) 92%, transparent);
}
.topbar h1 { color: var(--sx-ink); letter-spacing: -0.02em; }
.breadcrumb, .breadcrumb-separator { color: var(--sx-muted); }
#section-tabs { border-bottom-color: var(--sx-border); background: var(--sx-surface); }
.section-tabs button { color: var(--sx-muted); }
.section-tabs button:hover { color: var(--sx-ink); }
.section-tabs button.active { border-bottom-color: var(--sx-primary); color: var(--sx-primary); }

/* Controls and content surfaces. */
.primary-button, .secondary-button, .utility-button, .icon-button, .profile-trigger {
  min-height: var(--sx-control-height);
  border-radius: var(--sx-radius-control);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.primary-button {
  border-color: var(--sx-primary);
  background: var(--sx-primary);
  box-shadow: var(--sx-shadow-primary);
}
.primary-button:hover { border-color: var(--sx-primary-hover); background: var(--sx-primary-hover); }
.secondary-button, .utility-button, .icon-button, .profile-trigger {
  border-color: var(--sx-border);
  color: var(--sx-ink);
  background: var(--sx-surface);
  box-shadow: none;
}
.secondary-button:hover, .utility-button:hover, .icon-button:hover, .profile-trigger:hover {
  border-color: var(--sx-border-strong);
  background: var(--sx-surface-hover);
}
/* Only ordinary work surfaces inherit the foundation control skin.
 * Designer canvases and the approved product editor own their local UI surfaces. */
.shell:not(.designer-mode) #view .search,
.shell:not(.designer-mode) #view .select,
.shell:not(.designer-mode) #view input,
.shell:not(.designer-mode) #view select,
.shell:not(.designer-mode) #view textarea,
.shell:not(.designer-mode) #view .owner-select,
.topbar .search {
  border-color: var(--sx-border) !important;
  border-radius: var(--sx-radius-control) !important;
  color: var(--sx-ink) !important;
  background: var(--sx-surface) !important;
}
.shell:not(.designer-mode) #view .search:focus,
.shell:not(.designer-mode) #view .select:focus,
.shell:not(.designer-mode) #view input:focus,
.shell:not(.designer-mode) #view select:focus,
.shell:not(.designer-mode) #view textarea:focus,
.shell:not(.designer-mode) #view .owner-select:focus,
.topbar .search:focus {
  border-color: var(--sx-primary) !important;
  box-shadow: 0 0 0 3px var(--sx-focus) !important;
  outline: 0;
}

.contact-readiness-notice {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:14px 0;
}

.contact-readiness-notice .link-button,
.contact-readiness-warning .link-button {
  flex:0 0 auto;
}

.contact-readiness-warning {
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  color:#9a6547;
}

@media (max-width: 720px) {
  .contact-readiness-notice,
  .contact-readiness-warning {
    align-items:flex-start;
    flex-direction:column;
  }
}

.shell:not(.designer-mode) .panel,
.shell:not(.designer-mode) .workbench-section,
.shell:not(.designer-mode) .detail-panel,
.shell:not(.designer-mode) .help-card,
.shell:not(.designer-mode) .approval-overview-card,
.shell:not(.designer-mode) .customer-tag-settings,
.shell:not(.designer-mode) .product-filters,
.shell:not(.designer-mode) .media-card,
.shell:not(.designer-mode) .settings-fieldset,
.shell:not(.designer-mode) .compact-panel {
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.shell:not(.designer-mode) .toolbar,
.shell:not(.designer-mode) .media-filters {
  min-height: 54px;
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.table-wrap {
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.table th, .table td { border-color: var(--color-border-soft); }
.table thead th, .table thead th:last-child { color: var(--sx-muted); background: var(--sx-surface-subtle); }
.table th:last-child, .table td:last-child { box-shadow: -1px 0 0 var(--sx-border); }
.table tbody tr:hover td { background: var(--color-row-hover); }
.pagination { border-color: var(--sx-border); background: var(--sx-surface); }
.tag, .status, .status-pill { border-radius: 7px; }
.tag { color: var(--sx-primary); background: var(--sx-primary-soft); }
.status.live, .status-published { color: var(--sx-success); background: var(--sx-success-soft); }
.status-draft { color: var(--sx-warning); background: var(--sx-warning-soft); }
.status-hidden { color: var(--sx-muted); background: var(--sx-surface-subtle); }
.link-button, .table button.link-button, .customer-detail-actions .link-button { color: var(--sx-primary); }
.danger-text { color: var(--sx-danger); }

/* Workbench and customer approval: small, readable strata, not large coloured banners. */
.dashboard-hero {
  min-height: 156px;
  border: 1px solid color-mix(in srgb, var(--sx-primary) 16%, var(--sx-border));
  border-radius: var(--sx-radius-panel);
  color: var(--sx-ink);
  background: linear-gradient(120deg, var(--sx-primary-soft), color-mix(in srgb, var(--sx-surface) 84%, var(--sx-primary-soft)));
  box-shadow: var(--sx-shadow-1);
}
.dashboard-hero > div > span, .dashboard-section-head span, .eyebrow { color: var(--sx-primary); }
.dashboard-hero p, .dashboard-approval small { color: var(--sx-muted); }
.dashboard-approval {
  border-color: color-mix(in srgb, var(--sx-primary) 22%, var(--sx-border));
  border-radius: var(--sx-radius-control);
  color: var(--sx-ink);
  background: color-mix(in srgb, var(--sx-surface) 78%, transparent);
}
.dashboard-task, .workbench-card { border-color: var(--sx-border); }
.dashboard-task:hover, .workbench-card:hover, .approval-overview-card:hover {
  border-color: color-mix(in srgb, var(--sx-primary) 38%, var(--sx-border));
  background: var(--sx-surface-hover);
}
.dashboard-task:hover, .workbench-card-count, .approval-overview-card small { color: var(--sx-primary); }
.workbench-card { border-radius: var(--sx-radius-control); }
.approval-overview-card { border-radius: var(--sx-radius-panel); }
.approval-tab.active { border-bottom-color: var(--sx-primary); color: var(--sx-primary); }
.approval-tab b { color: var(--sx-primary); background: var(--sx-primary-soft); }

/* Product data, content, media and system settings retain their information density,
   but use the same calm surface, line and action hierarchy. */
.product-filters, .reference-product-filters, .reference-category-editor,
.reference-content-panel, .reference-category-form-actions {
  border-color: var(--sx-border);
  background: var(--sx-surface);
}
.reference-product-toolbar, .reference-content-head, .reference-content-tabs,
.reference-category-form-actions { border-color: var(--sx-border); }
.reference-product-table-wrap, .reference-category-table-wrap, .reference-content-table-wrap {
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.reference-product-table th, .reference-category-table th, .reference-content-table th {
  color: var(--sx-muted);
  background: var(--sx-surface-subtle);
}
.reference-product-table td, .reference-category-table td, .reference-content-table td {
  border-color: var(--color-border-soft);
}
.reference-product-table .product-title-button strong, .reference-category-form-row > label,
.reference-content-head h2, .reference-content-editor h2 { color: var(--sx-ink); }
.reference-product-table .product-title-button .code, .reference-content-tabs button.is-active { color: var(--sx-primary); }
.reference-content-tabs button.is-active::after { background-color: var(--sx-primary); }
.reference-category-image, .reference-content-thumb, .media-card-preview {
  border-color: var(--sx-border);
  background: var(--sx-surface-subtle);
}
.reference-category-form-row input[type="text"], .reference-category-form-row input[type="number"],
.reference-category-form-row input:not([type]), .reference-category-form-row select,
.reference-category-form-row textarea, .role-check, .choice-chip {
  border-color: var(--sx-border) !important;
  border-radius: var(--sx-radius-control) !important;
  color: var(--sx-ink) !important;
  background: var(--sx-surface) !important;
}
.reference-category-form-row input:focus, .reference-category-form-row select:focus,
.reference-category-form-row textarea:focus, .choice-chip:has(input:checked) {
  border-color: var(--sx-primary) !important;
  box-shadow: 0 0 0 3px var(--sx-focus) !important;
}
.reference-category-form-row p, .reference-content-head span, .reference-content-table td small,
.media-card-copy > span { color: var(--sx-muted); }
.reference-category-form-actions { position: sticky; bottom: 0; z-index: 2; }
.reference-content-page { background: var(--sx-canvas); color: var(--sx-ink); }
.reference-content-panel { border-radius: var(--sx-radius-panel); box-shadow: var(--sx-shadow-1); }
.reference-content-tabs button { color: var(--sx-muted); }
.reference-content-tabs button.is-active { background: transparent; }
.media-card { border-color: var(--sx-border); border-radius: var(--sx-radius-panel); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
.staff-directory-avatar { border-radius: var(--sx-radius-control); background: var(--sx-primary-soft); border-color: color-mix(in srgb, var(--sx-primary) 18%, var(--sx-border)); box-shadow: none; }
.role-check { min-height: var(--sx-control-height); }
.metric { border-color: var(--sx-border); border-radius: var(--sx-radius-panel); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
.metric strong { color: var(--sx-ink); }

/* Product management 2A: keep operational data dense on desktop and directly usable on touch screens. */
.product-list-workbench,
.reference-category-page,
.parameter-template-workbench,
.website-operations { min-width: 0; }
.product-list-workbench,
.reference-category-page {
  container-name: product-management;
  container-type: inline-size;
}
.product-list-workbench { display: grid; gap: var(--sx-space-4); }
.product-data-boundary {
  gap: 0;
  margin: 0;
  padding: 0;
  border-color: color-mix(in srgb, var(--sx-primary) 18%, var(--sx-border));
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.product-data-boundary > div { min-width: 0; padding: 14px 16px; }
.product-data-boundary > div + div { border-left: 1px solid var(--sx-border); }
.product-data-boundary strong { color: var(--sx-ink); }
.product-data-boundary span { color: var(--sx-muted); }
.reference-product-toolbar {
  min-height: 54px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.reference-action-button {
  min-height: var(--sx-control-height);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-control);
  padding: 0 13px;
  color: var(--sx-ink);
  background: var(--sx-surface);
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
}
.reference-action-button:hover { border-color: var(--sx-border-strong); background: var(--sx-surface-hover); }
.reference-action-button.is-primary { border-color: var(--sx-primary); color: var(--sx-surface); background: var(--sx-primary); }
.reference-action-button.is-primary:hover { border-color: var(--sx-primary-hover); background: var(--sx-primary-hover); }
.reference-action-button.is-success { color: var(--sx-success); background: var(--sx-success-soft); }
.reference-action-button.is-warning,
.reference-action-button.is-draft { color: var(--sx-warning); background: var(--sx-warning-soft); }
.reference-action-button.is-danger { color: var(--sx-danger); background: var(--sx-danger-soft); }
.reference-toolbar-icons .icon-button {
  width: var(--sx-control-height);
  height: var(--sx-control-height);
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-control);
  color: var(--sx-ink);
  background: var(--sx-surface);
  font-size: 18px;
}
.reference-product-filters {
  margin: 0;
  padding: 16px;
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.reference-product-filters .product-filter-grid { max-height: none; }
.reference-product-table th { height: 44px; font-size: 12px; }
.reference-product-table td { height: 64px; }
.reference-product-table .product-title-button { display: grid; gap: 3px; text-align: left; }
.reference-product-table .product-title-button strong { color: var(--sx-ink); }
.reference-product-table .product-title-button .code { color: var(--sx-primary); font-size: 12px; }
.product-source-badge,
.product-channel-status { border-radius: var(--sx-radius-status); }

.reference-category-page { display: grid; gap: var(--sx-space-4); }
.reference-category-page .reference-tag-intro {
  margin: 0;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-panel);
  padding: 13px 16px;
  color: var(--sx-muted);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.reference-category-page .reference-pagination,
.product-list-workbench .pagination { margin-top: 0; border-radius: var(--sx-radius-panel); box-shadow: var(--sx-shadow-1); }
.reference-category-table td { height: 68px; }
.reference-category-image { border-color: var(--sx-border); border-radius: var(--sx-radius-control); }

@container product-management (max-width: 1260px) {
  .product-list-workbench .reference-product-table-wrap,
  .reference-category-page .reference-product-table-wrap {
    max-width: 100%;
    overflow: visible;
  }
  .product-list-workbench .reference-product-table,
  .reference-category-page .reference-category-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }
  .product-list-workbench .reference-product-table thead,
  .reference-category-page .reference-category-table thead { display: none; }
  .product-list-workbench .reference-product-table tbody,
  .reference-category-page .reference-category-table tbody { display: grid; gap: 12px; }
  .product-list-workbench .reference-product-table tr,
  .reference-category-page .reference-category-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-panel-compact);
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-1);
  }
  .product-list-workbench .reference-product-table td,
  .reference-category-page .reference-category-table td {
    display: grid !important;
    height: auto;
    min-width: 0;
    position: static !important;
    right: auto !important;
    z-index: auto;
    grid-column: auto !important;
    grid-row: auto !important;
    grid-template-columns: minmax(92px, .55fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    border: 0;
    padding: 9px 12px !important;
    white-space: normal;
    box-shadow: none !important;
  }
  .product-list-workbench .reference-product-table td[data-field]::before,
  .reference-category-page .reference-category-table td[data-field]::before {
    content: attr(data-label);
    color: var(--sx-muted);
    font-size: 12px;
    font-weight: 600;
  }
  .product-list-workbench .reference-product-table [data-field="title"],
  .reference-category-page .reference-category-table [data-field="name"] {
    grid-column: span 2 !important;
    grid-template-columns: 1fr;
    padding: 14px 12px 9px;
  }
  .product-list-workbench .reference-product-table [data-field="title"]::before,
  .reference-category-page .reference-category-table [data-field="name"]::before { content: none; }
  .product-list-workbench .reference-product-table [data-field="select"],
  .reference-category-page .reference-category-table [data-field="select"] {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-self: stretch;
    padding: 9px 12px;
  }
  .product-list-workbench .reference-product-table [data-field="actions"],
  .reference-category-page .reference-category-table [data-field="actions"] {
    grid-column: 1 / -1 !important;
    grid-template-columns: 92px minmax(0, 1fr);
    border-top: 1px solid var(--sx-border);
    padding: 10px 12px 12px;
  }
  .product-list-workbench .reference-product-table td.empty-state,
  .reference-category-page .reference-category-table td.empty-state {
    grid-column: 1 / -1 !important;
    min-height: 148px;
    place-items: center;
    padding: 24px;
  }
}

@container product-management (max-width: 820px) {
  .product-list-workbench .reference-product-table tr,
  .reference-category-page .reference-category-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-list-workbench .product-row-select,
  .reference-category-page .category-row-select {
    display: grid;
    width: var(--sx-touch-control-height);
    height: var(--sx-touch-control-height);
    place-items: center;
  }
  .product-list-workbench .product-row-select input,
  .reference-category-page .category-row-select input { width: 18px; height: 18px; }
  .product-list-workbench .product-title-button,
  .product-list-workbench .reference-text-button,
  .reference-category-page .reference-text-button,
  .product-list-workbench .reference-toggle,
  .reference-category-page .reference-toggle { min-height: var(--sx-touch-control-height); }
}

@container product-management (max-width: 560px) {
  .product-list-workbench .reference-product-table tr,
  .reference-category-page .reference-category-table tr { grid-template-columns: minmax(0, 1fr) !important; }
  .product-list-workbench .reference-product-table [data-field="title"],
  .reference-category-page .reference-category-table [data-field="name"] { grid-column: 1 !important; }
}
.reference-tag-manager {
  display: grid;
  max-width: 1120px;
  gap: var(--sx-space-4);
  margin: 0;
  padding: 0 0 48px;
}
.reference-tag-manager .reference-tag-intro,
.reference-footer-intro {
  margin: 0;
  border: 1px solid var(--sx-border);
  border-left: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-panel);
  color: var(--sx-muted);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.reference-tag-manager-heading { margin: 0; padding: 0; }
.reference-tag-manager-heading h2 { color: var(--sx-ink); }
.reference-tag-manager-heading > button { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.reference-tag-group-box,
.reference-footer-settings {
  margin: 0;
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.reference-tag-group-box > header { border-color: var(--sx-border); }
.reference-tag-group-actions button { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.reference-footer-settings > .section-head { border-color: var(--sx-border); }
.reference-footer-row { border-color: var(--sx-border); }

.parameter-template-workbench { max-width: 1040px; padding: 0; overflow: hidden; }
.parameter-template-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--sx-border);
}
.parameter-template-heading h2 { margin: 0; color: var(--sx-ink); }
.parameter-template-heading p { max-width: 700px; margin: 7px 0 0; }
.parameter-template-heading > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: var(--sx-radius-status);
  color: var(--sx-primary);
  background: var(--sx-primary-soft);
  font-size: 12px;
  font-weight: 650;
}
.parameter-template-entry { padding: 16px 22px 20px; border-bottom: 1px solid var(--sx-border); background: var(--sx-surface-subtle); }
.parameter-template-entry > p { margin: 0 0 12px; font-size: 12px; }
.template-form {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) minmax(260px, 1.65fr) auto;
  gap: 12px;
  align-items: end;
}
.template-form label { display: grid; min-width: 0; gap: 6px; }
.template-form label > span { color: var(--sx-muted); font-size: 12px; font-weight: 650; }
.template-form input { min-width: 0; width: 100%; }
.template-form .primary-button { min-width: 104px; }
.setting-option-list { gap: 0; margin: 0; padding: 0 22px 18px; }
.setting-option-list > div { min-height: 62px; border-color: var(--sx-border); }
.setting-option-list small { color: var(--sx-muted); }

.website-operations { gap: var(--sx-space-4); }
.website-section-heading,
.website-data-table,
.website-empty-state,
.website-editor-heading,
.website-editor-band,
.website-editor-actions,
.website-category-manager {
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.website-section-heading { padding: 20px 22px; }
.website-section-heading > strong {
  color: var(--sx-primary);
  font-variant-numeric: tabular-nums;
}
.website-data-row { min-height: 58px; padding: 13px 20px; border-color: var(--sx-border); }
.website-data-head { background: var(--sx-surface-subtle); }
.website-status-badge { border-radius: var(--sx-radius-status); }
.website-editor-heading { padding: 18px 22px; }
.website-editor-band { gap: 22px; padding: 20px 22px; }
.website-editor-band > header h3 { font-size: 16px; }
.website-shared-field,
.website-shared-media-summary > div { border-color: var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); }
.website-category-manager { margin-top: 0; padding: 0; border-color: var(--sx-border); background: var(--sx-surface); }
.website-category-manager-heading { border-color: var(--sx-border); }
.website-category-manager-heading span { color: var(--sx-primary); }
.website-category-manager-heading h3 { color: var(--sx-ink); }
.website-category-manager-heading p,
.website-category-manager footer [data-website-category-status],
.website-category-delete-hint { color: var(--sx-muted); }
.website-category-row { border-color: var(--sx-border); }
.website-category-name-field,
.website-category-sort-field,
.website-category-usage { color: var(--sx-muted); }
.website-category-name-field input,
.website-category-sort-field input { border-color: var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); color: var(--sx-ink); }
.website-category-name-field input:focus-visible,
.website-category-sort-field input:focus-visible,
.website-category-visibility-field input:focus-visible,
.website-category-manager button:focus-visible { outline-color: var(--sx-focus-ring); }
.website-category-usage strong,
.website-category-empty strong,
.website-category-visibility-field { color: var(--sx-ink); }
.website-category-row-error { color: var(--sx-danger); }
.website-category-empty { color: var(--sx-muted); }
.website-category-manager footer { border-color: var(--sx-border); }
.website-category-choices { border-color: var(--sx-border); border-radius: var(--sx-radius-control); }
.website-editor-actions { padding: 12px 16px; }

/* Operational settings 2B: retain familiar high-density controls while giving each
   independent data boundary a calm, scannable work surface. */
.media-library-workbench,
.settings-company-workbench,
.staff-workbench { min-width: 0; }
.media-library-workbench {
  overflow: hidden;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-panel);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.media-library-workbench .reference-media-head { padding: 20px 22px 16px; border-color: var(--sx-border); }
.media-library-workbench .reference-media-head h2 { color: var(--sx-ink); }
.media-library-workbench .reference-media-head p,
.media-library-workbench .media-capacity-line { color: var(--sx-muted); }
.media-library-workbench .media-load-error { display: grid; justify-items: start; gap: 12px; margin: 14px; padding: 20px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); color: var(--sx-ink); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
.media-library-workbench .media-load-error p { margin: 0; }
.media-library-workbench .media-load-error [data-media-retry] { min-height: var(--sx-touch-control-height); }
.media-library-workbench .media-upload-actions,
.media-library-workbench .reference-media-filters,
.media-library-workbench .reference-pagination,
.media-library-workbench td[data-label="操作"] { display: flex; align-items: center; gap: 8px; }
.media-library-workbench .media-upload-actions,
.media-library-workbench .reference-media-filters { flex-wrap: wrap; }
.media-library-workbench .media-upload-button,
.media-library-workbench .reference-action-edit,
.media-library-workbench .reference-action-delete { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.media-library-workbench .reference-action-edit,
.media-library-workbench .reference-action-delete { padding: 0 10px; }
.media-library-workbench .reference-product-table-wrap { margin: 0 14px; overflow: auto; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); }
.media-library-workbench .reference-media-table { min-width: 920px; }
.media-library-workbench .reference-media-table th { color: var(--sx-muted); background: var(--sx-surface-subtle); }
.media-library-workbench .reference-media-table td { border-color: var(--sx-border); }
.media-library-workbench .reference-pagination { justify-content: space-between; margin: 0; padding: 14px 22px; border-top: 1px solid var(--sx-border); }

.settings-company-workbench { gap: var(--sx-space-4); max-width: 1120px; }
.settings-company-workbench > .panel,
.settings-company-workbench #contacts-panel { margin: 0; border-color: var(--sx-border); box-shadow: var(--sx-shadow-1); }
.settings-company-workbench .settings-form { padding: 20px 22px 22px; }
.settings-company-workbench .section-head { gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--sx-border); }
.settings-company-workbench .section-head h2,
.role-permission-workbench h2,
.staff-workbench h2 { color: var(--sx-ink); }
.settings-company-workbench .settings-fieldset { margin: 0; border-color: var(--sx-border); background: var(--sx-surface-subtle); }
.settings-company-workbench .contact-editor-row { margin: 0; border-color: var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); }
.settings-company-workbench #contact-list { display: grid; gap: 12px; margin: 18px 0; }
.settings-company-workbench .media-picker-summary { flex-wrap: wrap; }
.settings-company-workbench .primary-button,
.settings-company-workbench .secondary-button,
.settings-company-workbench .link-button { min-height: var(--sx-control-height); }

.staff-workbench { padding: 20px 22px 22px; }
.staff-workbench > .section-head { gap: 18px; margin-bottom: 16px; }
.staff-page-intro { max-width: 720px; margin: 6px 0 0; line-height: 1.65; }
.staff-directory-actions { justify-content: flex-end; flex-wrap: wrap; }
.role-permission-actions { justify-content: flex-end; flex-wrap: wrap; }
.role-permission-actions .secondary-button { display: inline-flex; align-items: center; text-decoration: none; }
.staff-workbench > .toolbar { margin: 0; padding: 10px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); box-shadow: none; }
.staff-workbench #staff-list { display: grid; gap: 12px; margin-top: 16px; }
.staff-workbench .compact-panel { margin-top: 0; }
.staff-workbench .staff-card-actions { flex-wrap: wrap; justify-content: flex-end; }
.staff-workbench .staff-card-actions .secondary-button,
.staff-workbench [data-save-roles],
.staff-workbench [data-save-permissions],
.staff-workbench [data-activate-pending],
.staff-workbench [data-import-wecom] { min-height: var(--sx-control-height); }
.staff-workbench .pagination { margin: 16px 0 0; }

.role-permission-workbench .staff-card-actions { align-items: flex-start; }
.role-permission-workbench .role-assignment-identity h3 { margin-bottom: 5px; }
.role-permission-workbench .role-assignment-identity p { margin: 0; }
.role-permission-workbench [data-staff-card-content] { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sx-border); }
.role-permission-workbench .role-assignment-editor h4,
.role-permission-workbench .permission-editor h4 { margin: 0 0 10px; }
.role-permission-workbench .permission-editor { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sx-border); }
.role-baseline-panel { margin-bottom: 16px; padding: 16px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface-subtle); }
.role-baseline-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--sx-control-height); cursor: pointer; list-style: none; }
.role-baseline-panel > summary::-webkit-details-marker { display: none; }
.role-baseline-panel > summary strong,
.role-baseline-panel > summary small { display: block; }
.role-baseline-panel > summary small { margin-top: 3px; color: var(--sx-muted); }
.role-baseline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.role-baseline-card { min-width: 0; padding: 14px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface); }
.role-baseline-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.role-baseline-card h3 { margin: 0; font-size: 15px; }
.role-baseline-card ul { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 12px 0 0; padding: 0; color: var(--sx-muted); font-size: 12px; line-height: 1.5; list-style: none; }
.role-baseline-card li::before { content: "·"; margin-right: 4px; color: var(--sx-primary); }
.role-baseline-note { margin: 12px 0 0; }

/* Content hub 3A: five content types keep one renderer and one calm operating surface. */
.content-hub-workbench { min-width: 0; padding-bottom: var(--sx-space-6); }
.content-hub-workbench .reference-content-head { min-height: 72px; padding: 16px 28px; }
.content-hub-workbench .reference-content-head h2 { margin-top: 2px; font-size: 18px; }
.content-hub-workbench .reference-content-tabs { gap: 6px; min-height: 56px; padding: 8px 28px; }
.content-hub-workbench .reference-content-tabs button { min-height: var(--sx-control-height); padding: 0 12px; border-radius: var(--sx-radius-control); }
.content-hub-workbench .reference-content-tabs button.is-active { background: var(--sx-primary-soft); }
.content-hub-workbench .reference-content-tabs button.is-active::after { display: none; }
.content-hub-workbench .reference-function-guide { width: min(1240px, calc(100% - 56px)); margin: 14px auto 0; padding: 0 2px; border: 0; background: transparent; }
.content-hub-workbench .reference-function-guide strong { margin-bottom: 2px; color: var(--sx-muted); font-size: 12px; font-weight: 650; }
.content-hub-workbench .reference-function-guide p { margin: 0; color: var(--sx-ink); font-size: 13px; }
.content-hub-workbench .reference-function-guide small { display: none; }
.content-hub-workbench .reference-content-panel { width: min(1240px, calc(100% - 56px)); margin: 14px auto; border-radius: var(--sx-radius-panel); }
.content-hub-workbench .reference-product-toolbar { gap: 16px; padding: 16px 20px; background: var(--sx-surface-subtle); }
.content-hub-workbench .reference-bulk-actions { flex-wrap: wrap; }
.content-hub-workbench .reference-list-search { flex: 1 1 340px; justify-content: flex-end; }
.content-hub-workbench .reference-list-search input { min-width: 220px; border-color: var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface); }
.content-hub-workbench .reference-action-button { border-radius: var(--sx-radius-control); }
.content-hub-workbench .reference-content-table { min-width: 1080px; }
.content-hub-workbench .reference-content-table th { height: 44px; font-size: 12px; font-weight: 650; }
.content-hub-workbench .reference-content-table td { height: 60px; }
.content-hub-workbench .reference-content-table td[data-label="操作"] { white-space: nowrap; }
.content-hub-workbench .reference-content-thumb { width: 58px; height: 40px; border-radius: var(--sx-radius-status); }
.content-hub-workbench .reference-toggle { min-height: 30px; border-radius: var(--sx-radius-status); }
.content-hub-workbench .reference-pagination { min-height: 58px; padding: 0 20px; }
.content-hub-workbench .reference-content-editor { padding: 22px; }
.content-hub-workbench .reference-form-grid { gap: 16px 20px; }
.content-hub-workbench .reference-form-actions { margin-top: 16px; padding-top: 16px; }
.content-hub-workbench .reference-display-settings { padding: 22px; }
.content-hub-workbench .reference-display-settings form { gap: 12px; margin-top: 16px; }

/* Official content 3B: a separate, calm source-attribution workbench. */
.official-content-workbench { min-width: 0; padding-bottom: var(--sx-space-6); }
.official-content-workbench .reference-content-head { min-height: 72px; padding: 16px 28px; }
.official-content-workbench .reference-content-head h2 { margin-top: 2px; font-size: 18px; }
.official-content-workbench .reference-back-button { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.official-content-workbench .reference-function-guide { width: min(1240px, calc(100% - 56px)); margin: 14px auto 0; padding: 0 2px; border: 0; background: transparent; }
.official-content-workbench .reference-function-guide strong { display: block; margin-bottom: 2px; color: var(--sx-muted); font-size: 12px; font-weight: 650; }
.official-content-workbench .reference-function-guide p { margin: 0; color: var(--sx-ink); font-size: 13px; }
.official-content-workbench .reference-function-guide small { display: none; }
.official-content-workbench .reference-content-panel { width: min(1240px, calc(100% - 56px)); margin: 14px auto; border-radius: var(--sx-radius-panel); }
.official-content-workbench .reference-product-toolbar { gap: 16px; padding: 16px 20px; background: var(--sx-surface-subtle); }
.official-content-workbench .reference-bulk-actions { flex-wrap: wrap; }
.official-content-workbench .reference-list-search { flex: 1 1 420px; justify-content: flex-end; }
.official-content-workbench .reference-list-search input,
.official-content-workbench .reference-list-search select { min-width: 130px; border-color: var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface); }
.official-content-workbench .reference-list-search input { min-width: 220px; }
.official-content-workbench .reference-action-button,
.official-content-workbench .secondary-button { border-radius: var(--sx-radius-control); }
.official-content-workbench > .notice { width: min(1240px, calc(100% - 56px)); margin: 0 auto; border-color: var(--sx-border); background: var(--sx-surface-subtle); color: var(--sx-muted); }
.official-content-workbench .table-wrap { margin: 0 20px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); }
.official-content-workbench .reference-content-table { min-width: 1080px; }
.official-content-workbench .reference-content-table th { height: 44px; color: var(--sx-muted); background: var(--sx-surface-subtle); font-size: 12px; font-weight: 650; }
.official-content-workbench .reference-content-table td { height: 60px; border-color: var(--sx-border); }
.official-content-workbench .reference-content-table td[data-label="操作"] { white-space: nowrap; }
.official-content-workbench .official-content-select { display: inline-grid; width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); place-items: center; vertical-align: middle; }
.official-content-workbench .official-content-select input { width: 18px; height: 18px; }
.official-content-workbench .reference-content-thumb { width: 58px; height: 40px; border-radius: var(--sx-radius-status); }
.official-content-workbench .reference-text-button { min-height: var(--sx-control-height); }
.official-content-workbench .reference-pagination { justify-content: space-between; min-height: 58px; padding: 0 20px; }
.official-content-workbench .reference-content-editor { padding: 22px; }
.official-content-workbench .reference-form-grid { gap: 16px 20px; }
.official-content-workbench .reference-form-actions { margin-top: 16px; padding-top: 16px; }

/* Forms 3C: keep the visible form workspace and hidden compatibility routes calm and distinct. */
.forms-workbench { min-width: 0; padding-bottom: var(--sx-space-6); }
.forms-definition-workbench,
.form-submissions-workbench,
.feedback-settings-workbench,
.interaction-settings-workbench { width: min(1240px, 100%); margin: 0 auto; }
.forms-definition-workbench { display: grid; gap: var(--sx-space-4); }
.forms-definition-workbench > .panel,
.forms-definition-workbench .forms-definition-editor,
.form-submissions-workbench .form-submissions-panel,
.feedback-settings-workbench .settings-grid > .panel,
.interaction-settings-workbench .settings-grid > .panel {
  margin: 0;
  border-color: var(--sx-border);
  border-radius: var(--sx-radius-panel);
  box-shadow: var(--sx-shadow-1);
}
.forms-workbench .section-head { gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--sx-border); }
.forms-workbench .section-head h2 { color: var(--sx-ink); }
.forms-workbench .section-head .muted { margin-bottom: 0; }
.forms-definition-workbench > .panel,
.forms-definition-workbench .forms-definition-editor,
.form-submissions-workbench .form-submissions-panel { padding: 20px 22px 22px; }
.forms-workbench .primary-button,
.forms-workbench .secondary-button,
.forms-workbench .link-button,
.forms-workbench select,
.forms-workbench input,
.forms-workbench textarea { border-radius: var(--sx-radius-control); }
.forms-workbench .toolbar { margin: 16px 0; padding: 10px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); box-shadow: none; }
.forms-workbench .table-wrap { margin: 0; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); }
.forms-workbench .table { min-width: 720px; }
.forms-workbench .table th { height: 44px; color: var(--sx-muted); background: var(--sx-surface-subtle); font-size: 12px; font-weight: 650; }
.forms-workbench .table td { min-height: 56px; border-color: var(--sx-border); }
.forms-definition-workbench td[data-label="操作"] { white-space: nowrap; }
.forms-workbench .pagination { justify-content: space-between; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--sx-border); }
.forms-workbench .pagination > div { display: flex; gap: 8px; }
.forms-definition-workbench .form-grid { gap: 16px 20px; }
.forms-definition-workbench .form-builder-row { display: grid; grid-template-columns: 24px minmax(120px, 1fr) minmax(120px, 1fr) minmax(112px, .8fr) minmax(132px, 1fr) auto auto; gap: 10px; align-items: center; margin-top: 10px; padding: 10px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); }
.forms-definition-workbench .form-builder-row .check-tag { min-height: var(--sx-control-height); margin: 0; }
.forms-definition-workbench [data-remove-field],
.forms-definition-workbench [data-add-field],
.forms-definition-workbench [data-close-form-editor],
.forms-definition-workbench [data-new-form],
.forms-definition-workbench [data-form-editor] .primary-button,
.form-submissions-workbench [data-export-submissions],
.form-submissions-workbench .pagination .secondary-button,
.feedback-settings-workbench .primary-button,
.interaction-settings-workbench .primary-button { min-height: var(--sx-control-height); }
.feedback-settings-workbench .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sx-space-4); }
.interaction-settings-workbench .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sx-space-4); }
.feedback-settings-workbench .settings-grid > .panel,
.interaction-settings-workbench .settings-grid > .panel { padding: 20px 22px 22px; }
.feedback-settings-workbench .setting-switch,
.interaction-settings-workbench .setting-switch { min-height: var(--sx-control-height); }

/* Settings 3D: isolated operational surfaces for pages, access rules, audit and share compatibility. */
.single-pages-workbench { min-width: 0; max-width: 1240px; margin: 0 auto; color: var(--sx-ink); background: transparent; }
.single-pages-workbench .reference-list-toolbar,
.single-pages-workbench .reference-page-description,
.single-pages-workbench .reference-product-table-wrap,
.single-pages-workbench .reference-pagination {
  border-color: var(--sx-border);
  background: var(--sx-surface);
  box-shadow: var(--sx-shadow-1);
}
.single-pages-workbench .reference-list-toolbar { gap: 16px; padding: 16px 20px; border-radius: var(--sx-radius-panel) var(--sx-radius-panel) 0 0; }
.single-pages-workbench .reference-list-toolbar .button-row,
.single-pages-workbench .reference-list-tools { flex-wrap: wrap; }
.single-pages-workbench .reference-list-toolbar button,
.single-pages-workbench .reference-list-tools input { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.single-pages-workbench .reference-page-description { margin: 0; padding: 12px 20px; border-top: 1px solid var(--sx-border); border-bottom: 1px solid var(--sx-border); color: var(--sx-muted); }
.single-pages-workbench .reference-product-table-wrap { margin: 0; overflow: auto; border-radius: 0; }
.single-pages-workbench .reference-single-table { min-width: 900px; }
.single-pages-workbench .reference-single-table th { height: 44px; color: var(--sx-muted); background: var(--sx-surface-subtle); }
.single-pages-workbench .reference-single-table td { height: 60px; border-color: var(--sx-border); }
.single-pages-workbench .single-page-select { display: inline-grid; width: var(--sx-control-height); height: var(--sx-control-height); place-items: center; }
.single-pages-workbench .single-page-select input { width: 18px; height: 18px; }
.single-pages-workbench .reference-action-edit,
.single-pages-workbench .reference-action-code,
.single-pages-workbench .reference-action-delete { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.single-pages-workbench .reference-pagination { justify-content: space-between; min-height: 58px; margin: 0; padding: 0 20px; border-radius: 0 0 var(--sx-radius-panel) var(--sx-radius-panel); }
.single-pages-editor-workbench { padding: 0 0 var(--sx-space-6); }
.single-pages-editor-workbench .reference-editor-head,
.single-pages-editor-workbench .reference-form-row,
.single-pages-editor-workbench .reference-editor-actions { border-color: var(--sx-border); }
.single-pages-editor-workbench .reference-editor-head { padding: 18px 22px; }
.single-pages-editor-workbench .reference-form-row { padding: 16px 22px; }
.single-pages-editor-workbench .page-block-row { border-color: var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); }
.single-pages-editor-workbench .reference-editor-actions { padding: 16px 22px; }
.single-pages-code-dialog { border-color: var(--sx-border); border-radius: var(--sx-radius-dialog); background: var(--sx-surface); color: var(--sx-ink); }

.visitor-access-rules-workbench { max-width: 920px; margin: 0 auto; }
.visitor-access-rules-workbench .settings-form { margin: 0; padding: 20px 22px 22px; border-color: var(--sx-border); box-shadow: var(--sx-shadow-1); }
.visitor-access-rules-workbench .section-head { gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--sx-border); }
.visitor-access-rules-workbench .section-head h2 { color: var(--sx-ink); }
.visitor-access-rules-workbench .primary-button,
.visitor-access-rules-workbench input { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.visitor-access-rules-workbench .notice { margin: 18px 0 0; border-color: var(--sx-border); background: var(--sx-surface-subtle); color: var(--sx-muted); }

.audit-workbench { max-width: 1240px; margin: 0 auto; padding: 20px 22px 22px; border-color: var(--sx-border); box-shadow: var(--sx-shadow-1); }
.audit-workbench .section-head { padding-bottom: 16px; border-bottom: 1px solid var(--sx-border); }
.audit-workbench .section-head h2 { color: var(--sx-ink); }
.audit-workbench .toolbar { margin: 16px 0; padding: 10px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); background: var(--sx-surface-subtle); box-shadow: none; }
.audit-workbench .toolbar input { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }
.audit-workbench .table-wrap { margin: 0; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); }
.audit-workbench .table { min-width: 820px; }
.audit-workbench .table th { height: 44px; color: var(--sx-muted); background: var(--sx-surface-subtle); font-size: 12px; font-weight: 650; }
.audit-workbench .table td { min-height: 56px; border-color: var(--sx-border); }
.audit-workbench .pagination { justify-content: space-between; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--sx-border); }
.audit-workbench .pagination > div { display: flex; gap: 8px; }
.audit-workbench .pagination .secondary-button { min-height: var(--sx-control-height); }

.share-settings-workbench { max-width: 920px; margin: 0 auto; padding: 20px 22px 22px; border-color: var(--sx-border); box-shadow: var(--sx-shadow-1); }
.share-settings-workbench .section-head { gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--sx-border); }
.share-settings-workbench .section-head h2 { color: var(--sx-ink); }
.share-settings-workbench .primary-button,
.share-settings-workbench input,
.share-settings-workbench select { min-height: var(--sx-control-height); border-radius: var(--sx-radius-control); }

/* Help center 3E: a quiet reading surface that preserves the complete operational guide. */
.help-page.help-center-workbench { max-width: 1240px; margin: 0 auto; padding: 20px 22px 24px; }
.help-page.help-center-workbench .help-context { margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--sx-border); color: var(--sx-muted); font-size: 13px; line-height: 1.6; }
.help-page.help-center-workbench .help-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(272px, 360px); gap: 24px; align-items: end; margin: 0; padding: 20px 0; }
.help-page.help-center-workbench .help-heading h2 { margin: 0; color: var(--sx-ink); font-size: 24px; line-height: 1.25; }
.help-page.help-center-workbench .help-heading p { max-width: 62ch; margin: 8px 0 0; line-height: 1.6; }
.help-page.help-center-workbench .help-search-control { display: grid; gap: 7px; color: var(--sx-muted); font-size: 12px; font-weight: 650; }
.help-page.help-center-workbench .help-search-control input { width: 100%; min-height: var(--sx-control-height); }
.help-page.help-center-workbench .help-results { min-width: 0; }
.help-page.help-center-workbench .help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.help-page.help-center-workbench .help-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel); padding: 18px; background: var(--sx-surface); box-shadow: none; }
.help-page.help-center-workbench .help-card-head { padding-bottom: 12px; border-bottom: 1px solid var(--sx-border); }
.help-page.help-center-workbench .help-card-meta { gap: 10px; color: var(--sx-muted); font-size: 12px; }
.help-page.help-center-workbench .help-card h3 { margin: 12px 0 0; color: var(--sx-ink); font-size: 17px; line-height: 1.4; }
.help-page.help-center-workbench .help-card-summary { margin: 14px 0 0; color: var(--sx-ink); line-height: 1.65; }
.help-page.help-center-workbench .help-steps { margin-top: 16px; }
.help-page.help-center-workbench .help-steps h4 { margin: 0 0 8px; color: var(--sx-ink); font-size: 13px; }
.help-page.help-center-workbench .help-steps ol { margin: 0; padding-left: 19px; color: var(--sx-muted); line-height: 1.6; }
.help-page.help-center-workbench .help-implementation { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--sx-border); }
.help-page.help-center-workbench .help-implementation summary { display: flex; align-items: center; min-height: var(--sx-control-height); color: var(--sx-primary); font-size: 13px; font-weight: 650; cursor: pointer; }
.help-page.help-center-workbench .help-implementation p { margin: 10px 0 0; color: var(--sx-muted); line-height: 1.65; }
.help-page.help-center-workbench .help-empty-state { width: 100%; min-height: 180px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel); background: var(--sx-surface); box-shadow: none; }

/* The approved product editor C plan deliberately keeps its own warm work surface.
 * reference-admin.css loads after its source styles and applies !important generic inputs,
 * so restore the already-approved local field treatment here without changing its structure. */
.dialog.product-page-mode .reference-product-editor input,
.dialog.product-page-mode .reference-product-editor select,
.dialog.product-page-mode .reference-product-editor textarea {
  border-color: var(--sx-product-editor-border) !important;
  border-radius: var(--sx-radius-product-control) !important;
  color: var(--sx-product-editor-ink) !important;
  background: var(--sx-product-editor-surface) !important;
}
.dialog.product-page-mode .reference-product-editor input:focus,
.dialog.product-page-mode .reference-product-editor select:focus,
.dialog.product-page-mode .reference-product-editor textarea:focus {
  outline: 3px solid var(--sx-product-editor-focus-ring);
  border-color: var(--sx-product-editor-focus) !important;
}

.dialog {
  border-radius: var(--sx-radius-dialog);
  box-shadow: var(--sx-shadow-dialog);
}
.dialog::backdrop { background: var(--color-overlay); backdrop-filter: blur(3px); }
.dialog header, .dialog footer { border-color: var(--sx-border); }

@media (max-width: 1180px) {
  :root { --sidebar-width: 196px; }
  #view { padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 820px) {
  :root { --sx-control-height: var(--sx-touch-control-height); }
  .sidebar-toggle {
    width: var(--sx-touch-control-height);
    height: var(--sx-touch-control-height);
    min-width: var(--sx-touch-control-height);
  }
  .nav-item,
  .nav-group-toggle { min-height: var(--sx-touch-control-height); }
  .help-page.help-center-workbench { margin: 0; padding: 16px 0 24px; }
  .help-page.help-center-workbench .help-head { grid-template-columns: 1fr; gap: 16px; padding: 18px 0; }
  .help-page.help-center-workbench .help-heading h2 { font-size: 22px; }
  .help-page.help-center-workbench .help-search-control input { min-height: var(--sx-touch-control-height); }
  .help-page.help-center-workbench .help-grid { grid-template-columns: 1fr; gap: 12px; }
  .help-page.help-center-workbench .help-card { padding: 16px; }
  .help-page.help-center-workbench .help-implementation summary { min-height: var(--sx-touch-control-height); }
  .help-page.help-center-workbench .help-empty-state { width: 100%; min-height: 180px; }
  .dashboard-hero { min-height: 0; }
  .dashboard-grid, .approval-overview, .customer-detail-grid { gap: 14px; }
  .reference-content-page { margin: -18px; }
  .reference-content-panel { width: calc(100% - 32px); }
  .product-data-boundary { grid-template-columns: 1fr; }
  .product-data-boundary > div + div { border-top: 1px solid var(--sx-border); border-left: 0; }
  .reference-product-toolbar { align-items: stretch; flex-direction: column; }
  .reference-bulk-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reference-bulk-actions .is-primary { grid-column: 1 / -1; }
  .reference-action-button { min-width: 0; min-height: var(--sx-touch-control-height); }
  .reference-toolbar-icons { justify-content: flex-end; }
  .reference-toolbar-icons .icon-button { width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); }
  .reference-product-filters { padding: 14px; }
  .product-list-workbench .reference-product-table-wrap,
  .reference-category-page .reference-product-table-wrap { overflow: visible; }
  .reference-product-table:not(.reference-category-table) { display: block; min-width: 0; }
  .reference-product-table:not(.reference-category-table) thead { display: none; }
  .reference-product-table:not(.reference-category-table) tbody { display: grid; gap: 12px; }
  .reference-product-table:not(.reference-category-table) tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 12px;
    overflow: hidden;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-panel-compact);
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-1);
  }
  .reference-product-table:not(.reference-category-table) td { display: none; height: auto; min-width: 0; border: 0; padding: 0; white-space: normal; }
  .reference-product-table:not(.reference-category-table) td:nth-child(1),
  .reference-product-table:not(.reference-category-table) td:nth-child(2),
  .reference-product-table:not(.reference-category-table) td:nth-child(3),
  .reference-product-table:not(.reference-category-table) td:nth-child(4),
  .reference-product-table:not(.reference-category-table) td:nth-child(5),
  .reference-product-table:not(.reference-category-table) td:nth-child(7),
  .reference-product-table:not(.reference-category-table) td:nth-child(8),
  .reference-product-table:not(.reference-category-table) td:nth-child(9),
  .reference-product-table:not(.reference-category-table) td:nth-child(10),
  .reference-product-table:not(.reference-category-table) td:nth-child(11) { display: grid; }
  .reference-product-table:not(.reference-category-table) td:nth-child(1) { grid-column: 2; grid-row: 1; place-self: center end; padding: 14px 14px 0 0; }
  .reference-product-table:not(.reference-category-table) td:nth-child(2) { grid-column: 1 / -1; grid-row: 9; padding: 10px 14px 14px; border-top: 1px solid var(--sx-border); }
  .reference-product-table:not(.reference-category-table) td:nth-child(3) { grid-column: 1; grid-row: 1; padding: 14px 0 7px 14px; }
  .product-list-workbench .product-row-select,
  .reference-category-page .category-row-select {
    display: grid;
    width: var(--sx-touch-control-height);
    height: var(--sx-touch-control-height);
    place-items: center;
  }
  .product-list-workbench .product-row-select input,
  .reference-category-page .category-row-select input { width: 18px; height: 18px; }
  .product-list-workbench .product-title-button { min-height: var(--sx-touch-control-height); align-content: center; }
  .reference-product-table:not(.reference-category-table) td:nth-child(4),
  .reference-product-table:not(.reference-category-table) td:nth-child(5),
  .reference-product-table:not(.reference-category-table) td:nth-child(10) {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 14px;
    align-items: center;
  }
  .reference-product-table:not(.reference-category-table) td:nth-child(4)::before,
  .reference-product-table:not(.reference-category-table) td:nth-child(5)::before,
  .reference-product-table:not(.reference-category-table) td:nth-child(10)::before {
    content: attr(data-label);
    color: var(--sx-muted);
    font-size: 12px;
    font-weight: 600;
  }
  .reference-product-table:not(.reference-category-table) td:nth-child(4) { grid-row: 2; }
  .reference-product-table:not(.reference-category-table) td:nth-child(5) { grid-row: 3; }
  .reference-product-table:not(.reference-category-table) td:nth-child(10) { grid-row: 4; }
  .reference-product-table:not(.reference-category-table) td:nth-child(7),
  .reference-product-table:not(.reference-category-table) td:nth-child(8),
  .reference-product-table:not(.reference-category-table) td:nth-child(9),
  .reference-product-table:not(.reference-category-table) td:nth-child(11) {
    grid-column: 1 / -1;
    grid-template-columns: minmax(112px, .7fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 5px 14px;
  }
  .reference-product-table:not(.reference-category-table) td:nth-child(7) { grid-row: 5; }
  .reference-product-table:not(.reference-category-table) td:nth-child(8) { grid-row: 6; }
  .reference-product-table:not(.reference-category-table) td:nth-child(9) { grid-row: 7; }
  .reference-product-table:not(.reference-category-table) td:nth-child(11) { grid-row: 8; padding-bottom: 12px; }
  .reference-product-table:not(.reference-category-table) td:nth-child(7)::before,
  .reference-product-table:not(.reference-category-table) td:nth-child(8)::before,
  .reference-product-table:not(.reference-category-table) td:nth-child(9)::before,
  .reference-product-table:not(.reference-category-table) td:nth-child(11)::before {
    content: attr(data-label);
    color: var(--sx-muted);
    font-size: 12px;
    font-weight: 600;
  }
  .reference-product-table:not(.reference-category-table) td:nth-child(7) .reference-toggle,
  .reference-product-table:not(.reference-category-table) td:nth-child(8) .reference-toggle,
  .reference-product-table:not(.reference-category-table) td:nth-child(9) .reference-toggle { min-height: var(--sx-touch-control-height); }
  .reference-product-table:not(.reference-category-table) td.empty-state {
    display: grid;
    grid-column: 1 / -1;
    min-height: 148px;
    place-items: center;
    padding: 24px;
  }
  .reference-product-table:not(.reference-category-table) .reference-row-actions { min-height: var(--sx-touch-control-height); }
  .reference-product-table:not(.reference-category-table) .reference-text-button { min-height: var(--sx-touch-control-height); }
  .reference-category-table { display: block; min-width: 0; }
  .reference-category-table thead { display: none; }
  .reference-category-table tbody { display: grid; gap: 12px; }
  .reference-category-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .reference-category-table td { display: none; height: auto; min-width: 0; border: 0; padding: 0; white-space: normal; }
  .reference-category-table td:nth-child(1),
  .reference-category-table td:nth-child(2),
  .reference-category-table td:nth-child(3),
  .reference-category-table td:nth-child(4),
  .reference-category-table td:nth-child(5),
  .reference-category-table td:nth-child(6),
  .reference-category-table td:nth-child(7),
  .reference-category-table td:nth-child(8),
  .reference-category-table td:nth-child(10) { display: grid; }
  .reference-category-table td:nth-child(1) { grid-column: 2; grid-row: 1; place-self: center end; padding: 14px 14px 0 0; }
  .reference-category-table td:nth-child(2) { grid-column: 1; grid-row: 1; padding: 14px 0 8px 14px; }
  .reference-category-table td:nth-child(3),
  .reference-category-table td:nth-child(4),
  .reference-category-table td:nth-child(5),
  .reference-category-table td:nth-child(6),
  .reference-category-table td:nth-child(7),
  .reference-category-table td:nth-child(8) { grid-column: 1 / -1; grid-template-columns: minmax(112px, .7fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 14px; }
  .reference-category-table td:nth-child(3)::before,
  .reference-category-table td:nth-child(4)::before,
  .reference-category-table td:nth-child(5)::before,
  .reference-category-table td:nth-child(6)::before,
  .reference-category-table td:nth-child(7)::before,
  .reference-category-table td:nth-child(8)::before { content: attr(data-label); color: var(--sx-muted); font-size: 12px; font-weight: 600; }
  .reference-category-table td:nth-child(3) { grid-row: 2; }
  .reference-category-table td:nth-child(4) { grid-row: 3; }
  .reference-category-table td:nth-child(5) { grid-row: 4; }
  .reference-category-table td:nth-child(6) { grid-row: 5; }
  .reference-category-table td:nth-child(7) { grid-row: 6; }
  .reference-category-table td:nth-child(8) { grid-row: 7; padding-bottom: 12px; }
  .reference-category-table td:nth-child(10) { grid-column: 1 / -1; grid-row: 8; padding: 10px 14px 14px; border-top: 1px solid var(--sx-border); }
  .reference-category-table td:nth-child(4) .reference-toggle,
  .reference-category-table td:nth-child(5) .reference-toggle { min-height: var(--sx-touch-control-height); }
  .reference-category-table td.empty-state {
    display: grid;
    grid-column: 1 / -1;
    min-height: 148px;
    place-items: center;
    padding: 24px;
  }
  .reference-category-table .reference-row-actions { min-height: var(--sx-touch-control-height); }
  .reference-category-table .reference-text-button { min-height: var(--sx-touch-control-height); }
  .reference-tag-manager-heading { align-items: stretch; flex-direction: column; }
  .reference-tag-manager-heading > button,
  .reference-tag-group-actions button { min-height: var(--sx-touch-control-height); }
  .reference-tag-group-box > header { align-items: stretch; flex-direction: column; }
  .parameter-template-heading { align-items: flex-start; flex-direction: column; }
  .template-form { grid-template-columns: 1fr; }
  .template-form .primary-button { min-height: var(--sx-touch-control-height); width: 100%; }
  .website-section-heading { align-items: flex-start; flex-direction: column; }
  .website-editor-actions .primary-button,
  .website-editor-actions .secondary-button { min-height: var(--sx-touch-control-height); }
  .media-library-workbench { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .media-library-workbench .reference-media-head,
  .media-library-workbench .media-capacity-line,
  .media-library-workbench .reference-media-filters,
  .media-library-workbench .reference-pagination {
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-panel-compact);
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-1);
  }
  .media-library-workbench .reference-media-head { padding: 18px 16px; }
  .media-library-workbench .media-capacity-line { margin-top: 12px; padding: 12px 14px; }
  .media-library-workbench .reference-media-filters { margin-top: 12px; padding: 12px; }
  .media-library-workbench #media-kind { min-height: var(--sx-touch-control-height); }
  .media-library-workbench .reference-product-table-wrap { margin: 12px 0 0; overflow: visible; border: 0; background: transparent; }
  .media-library-workbench .reference-media-table { display: block; min-width: 0; }
  .media-library-workbench .reference-media-table thead { display: none; }
  .media-library-workbench .reference-media-table tbody { display: grid; gap: 12px; }
  .media-library-workbench .reference-media-table tr { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 12px; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .media-library-workbench .reference-media-table td { display: grid; min-width: 0; border: 0; padding: 0; white-space: normal; }
  .media-library-workbench .reference-media-table td[data-label="预览"] { grid-column: 1; grid-row: 1 / span 2; padding: 14px 0 14px 14px; }
  .media-library-workbench .reference-media-table td[data-label="文件名称"] { grid-column: 2; padding: 14px 14px 4px 0; }
  .media-library-workbench .reference-media-table td[data-label="类型"],
  .media-library-workbench .reference-media-table td[data-label="大小"],
  .media-library-workbench .reference-media-table td[data-label="目录 / 标签"],
  .media-library-workbench .reference-media-table td[data-label="上传时间"] { grid-column: 1 / -1; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 14px; }
  .media-library-workbench .reference-media-table td[data-label="类型"]::before,
  .media-library-workbench .reference-media-table td[data-label="大小"]::before,
  .media-library-workbench .reference-media-table td[data-label="目录 / 标签"]::before,
  .media-library-workbench .reference-media-table td[data-label="上传时间"]::before { content: attr(data-label); color: var(--sx-muted); font-size: 12px; font-weight: 650; }
  .media-library-workbench .reference-media-table td[data-label="操作"] { grid-column: 1 / -1; flex-wrap: wrap; padding: 12px 14px 14px; border-top: 1px solid var(--sx-border); }
  .media-library-workbench .reference-media-table td.empty-state { display: grid; grid-column: 1 / -1; min-height: 148px; place-items: center; padding: 24px; }
  .media-library-workbench .reference-media-thumb { width: 78px; height: 64px; }
  .media-library-workbench .reference-pagination { justify-content: space-between; margin-top: 12px; padding: 12px 14px; }
  .media-library-workbench .reference-pagination > div { display: flex; gap: 8px; }
  .media-library-workbench .reference-pagination .secondary-button { min-height: var(--sx-touch-control-height); }
  .settings-company-workbench .settings-form,
  .staff-workbench { padding: 16px; }
  .settings-company-workbench .section-head,
  .staff-workbench > .section-head { align-items: stretch; flex-direction: column; }
  .settings-company-workbench .section-head .primary-button,
  .settings-company-workbench #contacts-form > .primary-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .settings-company-workbench .contact-editor-row { padding: 14px; }
  .staff-directory-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .role-permission-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .role-permission-actions .secondary-button { justify-content: center; min-height: var(--sx-touch-control-height); }
  .staff-directory-actions .primary-button { grid-column: 1 / -1; }
  .staff-directory-actions .primary-button,
  .staff-directory-actions .secondary-button,
  .staff-workbench .staff-card-actions .secondary-button,
  .staff-workbench [data-save-roles],
  .staff-workbench [data-save-permissions],
  .staff-workbench [data-activate-pending],
  .staff-workbench [data-import-wecom] { min-height: var(--sx-touch-control-height); }
  .staff-workbench .staff-card-head { align-items: stretch; flex-direction: column; }
  .staff-workbench .staff-card-actions { justify-content: flex-start; }
  .staff-workbench .pagination { align-items: stretch; flex-direction: column; }
  .staff-workbench .pagination > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .staff-workbench .pagination .secondary-button { min-height: var(--sx-touch-control-height); }
  .role-permission-workbench .staff-card-actions { align-items: stretch; }
  .role-baseline-panel { padding: 14px; }
  .role-baseline-panel > summary { align-items: flex-start; min-height: var(--sx-touch-control-height); }
  .role-baseline-panel > summary .link-button { display: none; }
  .role-baseline-grid { grid-template-columns: 1fr; }
  .content-hub-workbench { margin: -12px; padding-bottom: 18px; }
  .content-hub-section-tabs button { min-width: var(--sx-touch-control-height); min-height: var(--sx-touch-control-height); }
  .content-hub-workbench .reference-content-head { min-height: 68px; padding: 12px 16px; }
  .content-hub-workbench .reference-content-head h2 { font-size: 18px; }
  .content-hub-workbench .reference-content-tabs { gap: 4px; min-height: 60px; padding: 8px 16px; overflow-x: auto; }
  .content-hub-workbench .reference-content-tabs button { flex: 0 0 auto; min-width: var(--sx-touch-control-height); min-height: var(--sx-touch-control-height); }
  .content-hub-workbench .reference-function-guide { width: calc(100% - 32px); margin: 12px auto 0; }
  .content-hub-workbench .reference-content-panel { width: calc(100% - 32px); margin: 12px auto; }
  .content-hub-workbench .reference-product-toolbar { padding: 14px; }
  .content-hub-workbench .reference-list-search { width: 100%; }
  .content-hub-workbench .reference-list-search input { min-width: 0; min-height: var(--sx-touch-control-height); }
  .content-hub-workbench .table-wrap { overflow: visible; border: 0; background: transparent; }
  .content-hub-workbench .reference-content-table { display: block; min-width: 0; }
  .content-hub-workbench .reference-content-table thead { display: none; }
  .content-hub-workbench .reference-content-table tbody { display: grid; gap: 12px; }
  .content-hub-workbench .reference-content-table tr { display: grid; grid-template-columns: minmax(0, 1fr) var(--sx-touch-control-height); gap: 0 10px; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .content-hub-workbench .reference-content-table td { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(92px, .7fr) minmax(0, 1fr); gap: 8px; align-items: center; height: auto; min-width: 0; border: 0; padding: 6px 14px; white-space: normal; }
  .content-hub-workbench .reference-content-table td::before { content: attr(data-label); color: var(--sx-muted); font-size: 12px; font-weight: 650; }
  .content-hub-workbench .reference-content-table td:nth-child(1) { grid-column: 2; grid-row: 1; width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); place-items: center; padding: 8px 8px 0 0; }
  .content-hub-workbench .reference-content-table td:nth-child(1)::before,
  .content-hub-workbench .reference-content-table td:nth-child(2)::before { display: none; }
  .content-hub-workbench .content-row-select { display: grid; width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); place-items: center; }
  .content-hub-workbench .content-row-select input { width: 18px; height: 18px; }
  .content-hub-workbench .reference-content-table td:nth-child(2) { grid-column: 1; grid-row: 1; padding: 15px 0 8px 14px; color: var(--sx-ink); font-size: 18px; }
  .content-hub-workbench .reference-content-table td[data-label="操作"] { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--sx-border); }
  .content-hub-workbench .reference-content-table td.empty-state { display: grid; grid-column: 1 / -1; grid-row: auto; width: auto; height: auto; min-height: 148px; place-items: center; padding: 24px; }
  .content-hub-workbench .reference-content-table td.empty-state::before { display: none; }
  .content-hub-workbench .reference-content-table .reference-toggle,
  .content-hub-workbench .reference-content-table .reference-text-button { min-height: var(--sx-touch-control-height); }
  .content-hub-workbench .reference-pagination { flex-wrap: wrap; justify-content: space-between; min-height: 64px; padding: 10px 14px; }
  .content-hub-workbench .reference-pagination button { min-height: var(--sx-touch-control-height); padding: 0 12px; }
  .content-hub-workbench .reference-content-editor,
  .content-hub-workbench .reference-display-settings { padding: 16px; }
  .content-hub-workbench .reference-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .content-hub-workbench .reference-form-actions .reference-action-button,
  .content-hub-workbench .reference-form-actions .secondary-button,
  .content-hub-workbench .reference-display-settings .reference-action-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .official-content-workbench { margin: -18px; padding-bottom: 18px; }
  .official-content-workbench .reference-content-head { min-height: 68px; padding: 12px 16px; }
  .official-content-workbench .reference-content-head h2 { font-size: 18px; }
  .official-content-workbench .reference-back-button { min-height: var(--sx-touch-control-height); }
  .official-content-workbench .reference-function-guide,
  .official-content-workbench .reference-content-panel,
  .official-content-workbench > .notice { width: calc(100% - 32px); margin-right: auto; margin-left: auto; }
  .official-content-workbench .reference-function-guide { margin-top: 12px; }
  .official-content-workbench .reference-content-panel { margin-top: 12px; margin-bottom: 12px; }
  .official-content-workbench .reference-product-toolbar { padding: 14px; }
  .official-content-workbench .reference-list-search { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .official-content-workbench .reference-list-search input { grid-column: 1 / -1; }
  .official-content-workbench .reference-list-search input,
  .official-content-workbench .reference-list-search select,
  .official-content-workbench .reference-list-search .secondary-button { width: 100%; min-width: 0; min-height: var(--sx-touch-control-height); }
  .official-content-workbench .table-wrap { margin: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .official-content-workbench .reference-content-table { display: block; min-width: 0; }
  .official-content-workbench .reference-content-table thead { display: none; }
  .official-content-workbench .reference-content-table tbody { display: grid; gap: 12px; }
  .official-content-workbench .reference-content-table tr { display: grid; grid-template-columns: minmax(0, 1fr) var(--sx-touch-control-height); gap: 0 10px; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .official-content-workbench .reference-content-table td { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(92px, .7fr) minmax(0, 1fr); gap: 8px; align-items: center; height: auto; min-width: 0; border: 0; padding: 6px 14px; white-space: normal; }
  .official-content-workbench .reference-content-table td::before { color: var(--sx-muted); font-size: 12px; font-weight: 650; content: attr(data-label); }
  .official-content-workbench .reference-content-table td:nth-child(1) { grid-column: 2; grid-row: 1; width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); place-items: center; padding: 8px 8px 0 0; }
  .official-content-workbench .reference-content-table td:nth-child(1)::before,
  .official-content-workbench .reference-content-table td:nth-child(2)::before { display: none; }
  .official-content-workbench .reference-content-table td:nth-child(2) { grid-column: 1; grid-row: 1; padding: 15px 0 8px 14px; color: var(--sx-ink); font-size: 18px; }
  .official-content-workbench .reference-content-table td[data-label="操作"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--sx-border); }
  .official-content-workbench .reference-content-table td.empty-state { display: grid; grid-column: 1 / -1; grid-row: auto; width: auto; height: auto; min-height: 148px; place-items: center; padding: 24px; }
  .official-content-workbench .reference-content-table td.empty-state::before { display: none; }
  .official-content-workbench .official-content-select { display: grid; width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); place-items: center; }
  .official-content-workbench .reference-text-button { min-height: var(--sx-touch-control-height); }
  .official-content-workbench .reference-pagination { flex-wrap: wrap; min-height: 64px; padding: 10px 14px; }
  .official-content-workbench .reference-pagination button { min-height: var(--sx-touch-control-height); padding: 0 12px; }
  .official-content-workbench .reference-content-editor { padding: 16px; }
  .official-content-workbench .reference-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .official-content-workbench .reference-form-actions .reference-action-button,
  .official-content-workbench .reference-form-actions .secondary-button,
  .official-content-workbench [data-choose-official-cover] { width: 100%; min-height: var(--sx-touch-control-height); }
  .forms-workbench { padding-bottom: 18px; }
  .forms-definition-workbench,
  .form-submissions-workbench,
  .feedback-settings-workbench,
  .interaction-settings-workbench { width: 100%; }
  .forms-definition-workbench > .panel,
  .forms-definition-workbench .forms-definition-editor,
  .form-submissions-workbench .form-submissions-panel,
  .feedback-settings-workbench .settings-grid > .panel,
  .interaction-settings-workbench .settings-grid > .panel { padding: 16px; }
  .forms-workbench .section-head { align-items: stretch; flex-direction: column; }
  .forms-definition-workbench .section-head > .primary-button,
  .forms-definition-workbench [data-add-field],
  .forms-definition-workbench [data-close-form-editor],
  .form-submissions-workbench [data-export-submissions],
  .feedback-settings-workbench .primary-button,
  .interaction-settings-workbench .primary-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .forms-workbench .toolbar { margin: 14px 0; }
  .forms-workbench .toolbar select { width: 100%; min-height: var(--sx-touch-control-height); }
  .forms-workbench .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .forms-workbench .table { display: block; min-width: 0; }
  .forms-workbench .table thead { display: none; }
  .forms-workbench .table tbody { display: grid; gap: 12px; }
  .forms-workbench .table tr { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .forms-workbench .table td { display: grid; grid-template-columns: minmax(92px, .7fr) minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; min-height: 0; border: 0; padding: 7px 14px; white-space: normal; }
  .forms-workbench .table th:last-child,
  .forms-workbench .table td:last-child { position: static; right: auto; box-shadow: none; }
  .forms-workbench .table td::before { content: attr(data-label); color: var(--sx-muted); font-size: 12px; font-weight: 650; }
  .forms-definition-workbench .table td[data-label="表单"] { padding-top: 15px; color: var(--sx-ink); font-size: 18px; }
  .forms-definition-workbench .table td[data-label="表单"]::before { display: none; }
  .forms-definition-workbench .table td[data-label="操作"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--sx-border); }
  .forms-definition-workbench .table td[data-label="操作"]::before { display: none; }
  .forms-definition-workbench .table td[data-label="操作"] .link-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .form-submissions-workbench .table td[data-label="提交内容"] { align-items: start; }
  .forms-workbench .table td.empty-state { display: grid; grid-column: 1 / -1; width: auto; height: auto; min-height: 148px; place-items: center; padding: 24px; }
  .forms-workbench .table td.empty-state::before { display: none; }
  .forms-workbench .pagination { align-items: stretch; flex-direction: column; }
  .forms-workbench .pagination > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forms-workbench .pagination .secondary-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .forms-definition-workbench .form-grid { grid-template-columns: 1fr; }
  .forms-definition-workbench .form-grid input,
  .forms-definition-workbench .form-grid select,
  .forms-definition-workbench .form-grid textarea,
  .feedback-settings-workbench input:not([type="checkbox"]),
  .interaction-settings-workbench input:not([type="checkbox"]) { min-height: var(--sx-touch-control-height); }
  .forms-definition-workbench .form-builder-row { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .forms-definition-workbench .form-builder-row .drag-handle { grid-column: 1; grid-row: 1; align-self: center; }
  .forms-definition-workbench .form-builder-row input,
  .forms-definition-workbench .form-builder-row select { grid-column: 2; width: 100%; min-height: var(--sx-touch-control-height); }
  .forms-definition-workbench .form-builder-row .check-tag,
  .forms-definition-workbench .form-builder-row [data-remove-field] { grid-column: 2; width: 100%; min-height: var(--sx-touch-control-height); }
  .forms-definition-workbench [data-form-editor] .primary-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .feedback-settings-workbench .settings-grid { grid-template-columns: 1fr; }
  .interaction-settings-workbench .settings-grid { grid-template-columns: 1fr; }
  .feedback-settings-workbench .setting-switch,
  .interaction-settings-workbench .setting-switch { min-height: var(--sx-touch-control-height); }
  .single-pages-workbench { width: 100%; min-height: 0; }
  .single-pages-workbench .reference-list-toolbar { align-items: stretch; flex-direction: column; padding: 14px; border-radius: var(--sx-radius-panel-compact) var(--sx-radius-panel-compact) 0 0; }
  .single-pages-workbench .reference-list-toolbar .button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .single-pages-workbench .reference-list-toolbar .button-row .primary-button { grid-column: 1 / -1; }
  .single-pages-workbench .reference-list-toolbar button,
  .single-pages-workbench .reference-list-tools button,
  .single-pages-workbench .reference-list-tools input { min-height: var(--sx-touch-control-height); }
  .single-pages-workbench .reference-list-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .single-pages-workbench .reference-list-tools .search { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .single-pages-workbench .reference-page-description { padding: 12px 14px; }
  .single-pages-workbench .reference-product-table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .single-pages-workbench .reference-single-table { display: block; min-width: 0; }
  .single-pages-workbench .reference-single-table thead { display: none; }
  .single-pages-workbench .reference-single-table tbody { display: grid; gap: 12px; }
  .single-pages-workbench .reference-single-table tr { display: grid; grid-template-columns: minmax(0, 1fr) var(--sx-touch-control-height); gap: 0 10px; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .single-pages-workbench .reference-single-table td { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(92px, .7fr) minmax(0, 1fr); gap: 8px; align-items: center; height: auto; min-width: 0; border: 0; padding: 7px 14px; white-space: normal; }
  .single-pages-workbench .reference-single-table td::before { content: attr(data-label); color: var(--sx-muted); font-size: 12px; font-weight: 650; }
  .single-pages-workbench .reference-single-table td[data-label="选择"] { grid-column: 2; grid-row: 1; width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); place-items: center; padding: 8px 8px 0 0; }
  .single-pages-workbench .reference-single-table td[data-label="选择"]::before,
  .single-pages-workbench .reference-single-table td[data-label="标题"]::before { display: none; }
  .single-pages-workbench .single-page-select { width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); }
  .single-pages-workbench .reference-single-table td[data-label="标题"] { grid-column: 1; grid-row: 1; padding: 15px 0 8px 14px; color: var(--sx-ink); font-size: 18px; }
  .single-pages-workbench .reference-single-table td[data-label="操作"] { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--sx-border); }
  .single-pages-workbench .reference-single-table td[data-label="操作"]::before { display: none; }
  .single-pages-workbench .reference-single-table td[data-label="操作"] button { width: 100%; min-height: var(--sx-touch-control-height); }
  .single-pages-workbench .reference-single-table td.empty-state { display: grid; grid-column: 1 / -1; width: auto; height: auto; min-height: 148px; place-items: center; padding: 24px; }
  .single-pages-workbench .reference-single-table td.empty-state::before { display: none; }
  .single-pages-workbench .reference-pagination { align-items: stretch; flex-direction: column; min-height: 0; padding: 14px; border: 1px solid var(--sx-border); border-top: 0; border-radius: 0 0 var(--sx-radius-panel-compact) var(--sx-radius-panel-compact); }
  .single-pages-editor-workbench .reference-editor-head { align-items: stretch; flex-direction: column; padding: 16px; }
  .single-pages-editor-workbench .reference-editor-head .secondary-button,
  .single-pages-editor-workbench .reference-editor-actions button,
  .single-pages-editor-workbench .page-block-add button,
  .single-pages-editor-workbench [data-remove-page-block] { min-height: var(--sx-touch-control-height); }
  .single-pages-editor-workbench .reference-form-row { padding: 14px 16px; }
  .single-pages-editor-workbench .reference-form-row input,
  .single-pages-editor-workbench .reference-form-row textarea,
  .single-pages-editor-workbench .reference-form-row select { min-height: var(--sx-touch-control-height); }
  .single-pages-editor-workbench .page-block-add { align-items: stretch; flex-direction: column; }
  .single-pages-editor-workbench .page-block-add select { width: 100%; min-height: var(--sx-touch-control-height); }
  .single-pages-code-dialog .single-page-code-cancel,
  .single-pages-code-dialog .single-page-code-download { min-height: var(--sx-touch-control-height); }
  .single-pages-code-dialog .single-page-code-close { width: var(--sx-touch-control-height); min-width: var(--sx-touch-control-height); height: var(--sx-touch-control-height); min-height: var(--sx-touch-control-height); }
  .visitor-access-rules-workbench .settings-form,
  .audit-workbench,
  .share-settings-workbench { padding: 16px; }
  .visitor-access-rules-workbench .section-head,
  .share-settings-workbench .section-head { align-items: stretch; flex-direction: column; }
  .visitor-access-rules-workbench .primary-button,
  .visitor-access-rules-workbench input,
  .share-settings-workbench .primary-button,
  .share-settings-workbench input,
  .share-settings-workbench select { width: 100%; min-height: var(--sx-touch-control-height); }
  .audit-workbench .toolbar input { width: 100%; min-height: var(--sx-touch-control-height); }
  .audit-workbench .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .audit-workbench .table { display: block; min-width: 0; }
  .audit-workbench .table thead { display: none; }
  .audit-workbench .table tbody { display: grid; gap: 12px; }
  .audit-workbench .table tr { display: grid; overflow: hidden; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-panel-compact); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
  .audit-workbench .table td { display: grid; grid-template-columns: minmax(84px, .65fr) minmax(0, 1fr); gap: 8px; align-items: center; height: auto; min-width: 0; border: 0; padding: 7px 14px; white-space: normal; }
  .audit-workbench .table td::before { content: attr(data-label); color: var(--sx-muted); font-size: 12px; font-weight: 650; }
  .audit-workbench .table td.empty-state { display: grid; width: auto; height: auto; min-height: 148px; place-items: center; padding: 24px; }
  .audit-workbench .table td.empty-state::before { display: none; }
  .audit-workbench .pagination { align-items: stretch; flex-direction: column; }
  .audit-workbench .pagination > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-workbench .pagination .secondary-button { width: 100%; min-height: var(--sx-touch-control-height); }
  .catalog-designer #add-catalog-module { min-height: var(--sx-touch-control-height); }
}

@media (max-width: 560px) {
  :root { --sx-radius-panel: var(--sx-radius-panel-compact); }
  #view { padding: 16px 12px 32px; }
  .toolbar, .media-filters { border-radius: var(--sx-radius-panel-compact); }
  .dashboard-hero { padding: 22px 20px; }
  .dashboard-approval { min-width: 0; }
  .shell:not(.designer-mode) .panel, .shell:not(.designer-mode) .workbench-section,
  .shell:not(.designer-mode) .detail-panel, .shell:not(.designer-mode) .help-card { border-radius: var(--sx-radius-panel-compact); }
}

/* Final computed authority: shared shell and route-independent dimensions.
 * Earlier files retain component history; this block owns the final shell contract. */
.shell:not(.designer-mode) {
  grid-template-columns: var(--sx-shell-sidebar-width) minmax(0, 1fr);
}
.shell {
  color: var(--sx-ink);
  background: var(--sx-canvas);
}
.sidebar {
  background: var(--sx-shell-sidebar-background);
}
.nav-item {
  color: var(--sx-shell-nav-text);
}
.nav-item:hover {
  color: var(--sx-shell-nav-hover-text);
  background: var(--sx-shell-nav-hover-background);
}
.nav-item.active {
  color: var(--sx-shell-nav-active-text);
  background: var(--sx-shell-nav-active-background);
}
:root[data-theme="dark"] .shell { color: var(--sx-ink); background: var(--sx-canvas); }
:root[data-theme="dark"] .sidebar { background: var(--sx-shell-sidebar-background); }
:root[data-theme="dark"] .nav-item { color: var(--sx-shell-nav-text); }
:root[data-theme="dark"] .nav-item:hover {
  color: var(--sx-shell-nav-hover-text);
  background: var(--sx-shell-nav-hover-background);
}
:root[data-theme="dark"] .nav-item.active {
  color: var(--sx-shell-nav-active-text);
  background: var(--sx-shell-nav-active-background);
}
.topbar {
  min-height: var(--sx-shell-topbar-height);
  padding: 10px 24px;
}
.shell:not(.designer-mode) #view {
  max-width: 1680px;
  padding: var(--sx-shell-view-padding);
}
.shell.designer-mode { grid-template-columns: 1fr; }
.shell.designer-mode .sidebar { display: none; }
.shell.designer-mode #view {
  max-width: none;
  padding: var(--sx-designer-view-padding);
}
@media (max-width: 1180px) {
  :root { --sx-shell-sidebar-width: 196px; }
  .shell:not(.designer-mode) #view { padding: var(--sx-shell-view-padding-narrow); }
}
@media (max-width: 560px) {
  .shell:not(.designer-mode) #view { padding: var(--sx-shell-view-padding-phone); }
}

/* Personal workbench layouts: scoped to the dashboard, with no route or data grants. */
.workbench-layout-editor { display: grid; gap: 14px; margin-bottom: 18px; padding: 20px; border-color: var(--sx-border); background: var(--sx-surface); box-shadow: var(--sx-shadow-1); }
.workbench-layout-editor > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.workbench-layout-editor header span { color: var(--sx-muted); font-size: 12px; font-weight: 650; }
.workbench-layout-editor h2 { margin: 4px 0 0; color: var(--sx-ink); font-size: 18px; }
.workbench-layout-editor p { margin: 6px 0 0; color: var(--sx-muted); font-size: 13px; }
.workbench-layout-editor header > div:last-child, .workbench-layout-editor footer, .workbench-layout-devices, .workbench-role-tabs, .workbench-layout-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workbench-device-tab, .workbench-role-tabs button { min-height: var(--sx-control-height); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-navigation); padding: 0 12px; color: var(--sx-muted); background: var(--sx-surface-subtle); font-weight: 650; }
.workbench-device-tab.is-active, .workbench-role-tabs button.is-active { border-color: var(--sx-primary); color: var(--sx-primary); background: var(--sx-primary-soft); }
.workbench-layout-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.workbench-layout-card { display: flex; min-width: 0; min-height: 88px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); padding: 12px; background: var(--sx-surface); }
.workbench-layout-card strong, .workbench-layout-card span { display: block; }.workbench-layout-card span { margin-top: 4px; color: var(--sx-muted); font-size: 12px; }
.workbench-layout-card-actions { justify-content: flex-end; }.workbench-layout-card-actions .secondary-button { min-width: var(--sx-control-height); padding: 0 8px; }.workbench-layout-card select { min-height: var(--sx-control-height); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-control); color: var(--sx-ink); background: var(--sx-surface); }
.workbench-visible-control { display: inline-flex; min-height: var(--sx-control-height); align-items: center; gap: 5px; color: var(--sx-muted); font-size: 12px; }.workbench-size-fixed { padding: 0 6px; }
.workbench-layout-editor footer { justify-content: flex-end; padding-top: 4px; }.workbench-layout-status { margin-left: 4px; color: var(--sx-muted); font-size: 12px; }
.workbench-layout-preview { color: var(--sx-muted); font-size: 12px; }.workbench-layout-active [data-workbench-layout-preview-frame] { width: 100%; margin-inline: auto; transition: width .18s ease; }.workbench-layout-active[data-workbench-preview-device="tablet"] [data-workbench-layout-preview-frame] { width: 100%; max-width: 768px; }.workbench-layout-active[data-workbench-preview-device="mobile"] [data-workbench-layout-preview-frame] { width: 100%; max-width: 390px; }
.workbench-layout-active .parity-dashboard { display: flex; flex-wrap: wrap; gap: 18px; }.workbench-layout-active .parity-dashboard .dashboard-grid { display: contents; }.workbench-layout-active .parity-dashboard [data-workbench-module] { min-width: 0; }.workbench-layout-active .parity-dashboard [data-workbench-module][data-workbench-size="small"] { flex: 0 1 32%; }.workbench-layout-active .parity-dashboard [data-workbench-module][data-workbench-size="half"] { flex: 0 1 calc(50% - 9px); }.workbench-layout-active .parity-dashboard [data-workbench-module][data-workbench-size="full"] { flex: 1 1 100%; }
@media (max-width: 820px) {
  .workbench-layout-editor { padding: 16px; }.workbench-layout-editor > header { display: grid; }.workbench-layout-editor header > div:last-child { width: 100%; }.workbench-layout-editor header > div:last-child button { flex: 1; min-height: var(--sx-touch-control-height); }.workbench-device-tab, .workbench-role-tabs button, .workbench-layout-editor footer button { min-height: var(--sx-touch-control-height); }.workbench-layout-cards { grid-template-columns: 1fr; }.workbench-layout-card { align-items: flex-start; flex-direction: column; }.workbench-layout-card-actions { width: 100%; justify-content: flex-start; }.workbench-layout-card-actions select { flex: 1; min-height: var(--sx-touch-control-height); }.workbench-visible-control { min-height: var(--sx-touch-control-height); }.workbench-layout-editor footer { justify-content: stretch; }.workbench-layout-editor footer button { flex: 1 1 100%; }.workbench-layout-active .parity-dashboard [data-workbench-module] { flex-basis: 100% !important; }.workbench-layout-active[data-workbench-preview-device="tablet"] [data-workbench-layout-preview-frame], .workbench-layout-active[data-workbench-preview-device="mobile"] [data-workbench-layout-preview-frame] { width: 100%; max-width: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-item,
  .primary-button,
  .secondary-button,
  .utility-button,
  .icon-button,
  .profile-trigger {
    transition: none;
  }
}
