/*
 * 第一批复杂工作台迁移适配层。
 * 这里按共享组件职责组织规则；页面旧类名只作为迁移挂钩，业务行为保持不变。
 */

/* Shared project context */
body[data-theme="tech"] button.ui-context-card {
  border-color: var(--ui-line);
  background: var(--ui-surface-1);
  color: var(--ui-text);
  box-shadow: var(--ui-shadow-panel);
}

body[data-theme="tech"] button.ui-context-card:hover:not(:disabled) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-hover);
  color: var(--ui-text);
  box-shadow: var(--ui-shadow-panel);
  transform: none;
}

body[data-theme="tech"] .ui-context-card button.project-context-open,
body[data-theme="tech"] .ui-context-card button.project-context-requirements-value {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  box-shadow: none;
}

body[data-theme="tech"] .ui-context-card button.project-context-open:hover:not(:disabled),
body[data-theme="tech"] .ui-context-card button.project-context-requirements-value:hover:not(:disabled) {
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  transform: none;
}

body[data-theme="tech"] .ui-context-card button.project-context-requirements-edit {
  min-height: 30px;
  border-color: rgba(255, 179, 64, 0.34);
  background: rgba(255, 179, 64, 0.1);
  color: #f3c779;
  padding: 5px 10px;
  box-shadow: none;
}

body[data-theme="tech"] .ui-context-card button.project-context-requirements-edit:hover:not(:disabled) {
  border-color: rgba(255, 179, 64, 0.58);
  background: rgba(255, 179, 64, 0.16);
  color: #ffe0a3;
  box-shadow: none;
  transform: none;
}

body[data-theme="tech"] .ui-context-card .project-context-head em {
  background: var(--ui-success-soft);
  color: #8de8af;
}

body[data-theme="tech"] .ui-context-card.needs-review .project-context-head em {
  background: var(--ui-warning-soft);
  color: #f3c779;
}

body[data-theme="tech"] .ui-context-card .project-context-facts .favorable b {
  color: #8de8af;
}

body[data-theme="tech"] .ui-context-card .project-context-requirements b {
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-context-card.project-context-dock {
  border-color: var(--project-context-border);
  border-left-color: var(--project-context-accent);
  background: var(--project-context-bg);
  color: #26363b;
  box-shadow: 0 8px 22px rgba(20, 39, 48, .13);
}

body[data-theme="tech"] .ui-context-card.project-context-dock:hover {
  border-color: var(--project-context-accent);
  background: var(--project-context-bg);
}

body[data-theme="tech"] .ui-context-card.project-context-dock :where(.project-context-facts > span, .project-context-requirements) {
  border-color: rgba(53, 77, 84, .11);
  background: var(--project-context-surface);
}

body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-facts .favorable,
body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-head em {
  border-color: transparent;
  background: var(--project-context-accent-soft);
  color: var(--project-context-accent);
}

body[data-theme="tech"] .ui-context-card.project-context-dock :where(b, strong) {
  color: #243439;
}

body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-head strong,
body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-facts .favorable b,
body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-gender-value {
  color: var(--project-context-accent);
}

body[data-theme="tech"] .ui-context-card.project-context-dock :where(small, .project-context-requirements small) {
  color: #647177;
}

body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-requirements {
  border-color: rgba(129, 100, 54, .16);
  background: rgba(255, 250, 239, .74);
}

body[data-theme="tech"] .ui-context-card.project-context-dock .project-context-requirements b {
  color: #4d4a43;
}

/* Route selection and name-pool evidence */
body[data-theme="tech"] .ui-workbench--routes .name-pool-current-version {
  border-color: var(--ui-line-strong);
  background: var(--ui-accent-soft);
  color: #a9dae4;
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-current-version span {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-overview > header p,
body[data-theme="tech"] .ui-workbench--routes .name-pool-overview > header small {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-overview > header > span.ready {
  background: var(--ui-success-soft);
  color: #8de8af;
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-overview > header > span.blocked {
  background: var(--ui-danger-soft);
  color: #f2a1aa;
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-metrics > .primary {
  border-color: var(--ui-line-strong);
  background: var(--ui-accent-soft);
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-metrics > .primary b {
  color: var(--ui-accent);
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-position-metrics span,
body[data-theme="tech"] .ui-workbench--routes .name-pool-stroke-pairs > span,
body[data-theme="tech"] .ui-workbench--routes .name-pool-version-list > :where(span, article),
body[data-theme="tech"] .ui-workbench--routes .name-pool-artifact-list article {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-position-metrics b,
body[data-theme="tech"] .ui-workbench--routes .name-pool-stroke-pairs b,
body[data-theme="tech"] .ui-workbench--routes .name-pool-version-list b,
body[data-theme="tech"] .ui-workbench--routes .name-pool-artifact-list strong {
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--routes :where(
  .name-pool-surname-basis,
  .name-pool-formula-basis,
  .name-pool-explanation-groups,
  .name-pool-history
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-1);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--routes :where(
  .name-pool-surname-basis > div > span,
  .name-pool-formula-symbols > span,
  .name-pool-formula-grid > span,
  .name-pool-group-card,
  .name-pool-grid-proof article,
  .name-pool-sancai-proof,
  .name-pool-group-count-proof
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--routes .name-pool-group-card[open] > summary,
body[data-theme="tech"] .ui-workbench--routes .name-pool-history-body {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
}

body[data-theme="tech"] .ui-workbench--routes .ui-route-card small {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--routes .ui-route-card.is-recommended small {
  color: var(--ui-accent);
}

body[data-theme="tech"] .ui-workbench--routes .ui-route-card > button {
  width: 100%;
}

/* First-filter workbench */
body[data-theme="tech"] .ui-workbench--filter .filter-current-record {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-selected);
  color: var(--ui-text-strong);
  box-shadow: none;
}

body[data-theme="tech"] .ui-workbench--filter .filter-current-record:hover:not(:disabled) {
  border-color: var(--ui-accent);
  background: var(--ui-surface-hover);
  color: var(--ui-text-strong);
  box-shadow: none;
  transform: none;
}

body[data-theme="tech"] .ui-workbench--filter .filter-workbench-topline {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
}

body[data-theme="tech"] .ui-workbench--filter .filter-workbench-topline span {
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--filter .filter-workbench-topline span.ready {
  background: var(--ui-success-soft);
  color: #8de8af;
}

body[data-theme="tech"] .ui-workbench--filter .filter-workbench-topline span.pending {
  background: var(--ui-warning-soft);
  color: #f2c77e;
}

body[data-theme="tech"] .ui-workbench--filter .filter-console-nav button.ui-nav-item {
  min-height: 54px;
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--filter .filter-console-nav button.ui-nav-item i {
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--filter .filter-console-nav button.ui-nav-item.active i {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

body[data-theme="tech"] .ui-workbench--filter .filter-console-summary,
body[data-theme="tech"] .ui-workbench--filter .filter-action-bar {
  border-color: var(--ui-line-subtle);
  background: var(--ui-surface-2);
}

body[data-theme="tech"] .ui-workbench--filter :where(
  .filter-manual-basis,
  .filter-basic-grid > section,
  .filter-gender-buttons label > span,
  .filter-elements-unrestricted,
  .component-filter-card,
  .one-screen-exclusions .exclusion-option,
  .zodiac-filter-section,
  .zodiac-tier-option,
  .filter-empty-result,
  .filter-result-metrics > div
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--filter :where(
  .filter-inline-hint,
  .filter-auto-note,
  .filter-summary-list li,
  .filter-summary-tip,
  .filter-result-notice,
  .zodiac-filter-detected,
  .zodiac-filter-preview
) {
  border-color: var(--ui-line-subtle);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--filter :where(
  .filter-stage-title h2,
  .filter-summary-head > span,
  .filter-basic-grid h3,
  .one-screen-exclusions .check strong,
  .filter-action-bar strong,
  .filter-result-metrics strong,
  .filter-empty-result strong
) {
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--filter :where(
  .filter-stage-title p,
  .filter-summary-list span,
  .filter-gender-buttons small,
  .component-filter-card small,
  .one-screen-exclusions .check small,
  .filter-result-metrics span
) {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--filter .filter-summary-list strong,
body[data-theme="tech"] .ui-workbench--filter .filter-manual-basis strong {
  color: #9ed9c1;
}

body[data-theme="tech"] .ui-workbench--filter .filter-gender-buttons input:checked + span,
body[data-theme="tech"] .ui-workbench--filter .component-filter-card.keep {
  border-color: rgba(53, 213, 121, 0.4);
  background: var(--ui-success-soft);
}

body[data-theme="tech"] .ui-workbench--filter .component-filter-card.exclude {
  border-color: rgba(255, 102, 117, 0.42);
  background: var(--ui-danger-soft);
}

body[data-theme="tech"] .ui-workbench--filter .component-filter-card.common:not(.keep):not(.exclude) {
  border-color: rgba(255, 179, 64, 0.24);
  background: var(--ui-warning-soft);
}

body[data-theme="tech"] .ui-workbench--filter .component-mode-switch button,
body[data-theme="tech"] .ui-workbench--filter .zodiac-choice-grid button,
body[data-theme="tech"] .ui-workbench--filter .zodiac-preview-rules button,
body[data-theme="tech"] .ui-workbench--filter .zodiac-preview-chars button {
  border-color: var(--ui-line);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
  box-shadow: none;
}

body[data-theme="tech"] .ui-workbench--filter :where(
  .component-mode-switch button.active,
  .zodiac-choice-grid button.active,
  .zodiac-preview-rules button.active
) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-selected);
  color: var(--ui-text-strong);
}

/* Legacy stroke-state rules use !important; these two compatibility rules are
   intentionally equally explicit until the old filter block is migrated. */
body[data-theme="tech"] .ui-workbench--filter .filter-stroke-setting.unset {
  border-color: rgba(255, 179, 64, 0.42) !important;
  background: var(--ui-warning-soft) !important;
  box-shadow: 0 0 0 3px rgba(255, 179, 64, 0.07) !important;
}

body[data-theme="tech"] .ui-workbench--filter .filter-stroke-setting.configured {
  border-color: rgba(53, 213, 121, 0.38) !important;
  background: var(--ui-success-soft) !important;
  box-shadow: 0 0 0 3px rgba(53, 213, 121, 0.06) !important;
}

body[data-theme="tech"] .ui-workbench--filter .filter-stroke-input {
  border-color: var(--ui-line);
  background: var(--ui-surface-1);
}

body[data-theme="tech"] .ui-workbench--filter .filter-stroke-input input {
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--filter .filter-action-bar > button:last-child {
  border-color: rgba(75, 216, 237, 0.55);
  background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-strong));
  color: var(--ui-text-on-accent);
}

body[data-theme="tech"] :where(.filter-picker-dialog, .filter-info-dialog) {
  border-color: var(--ui-line);
  background: var(--ui-surface-1);
  color: var(--ui-text);
}

body[data-theme="tech"] :where(.filter-picker-dialog, .filter-info-dialog) > :where(header, footer) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
}

/* Second-review workbench */
body[data-theme="tech"] .ui-workbench--review .review-workbench-header {
  border-color: var(--ui-line);
  background: var(--ui-surface-1);
}

body[data-theme="tech"] .ui-workbench--review .review-status-pills > span {
  border: 1px solid var(--ui-line-subtle);
  background: var(--ui-surface-2);
}

body[data-theme="tech"] .ui-workbench--review .review-status-pills > span.wide {
  border-color: rgba(53, 213, 121, 0.2);
  background: var(--ui-success-soft);
}

body[data-theme="tech"] .ui-workbench--review .review-status-pills strong {
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--review .review-header-menu > summary {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--review .review-header-menu[open] > summary {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-selected);
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--review .review-header-menu > div {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text-muted);
  box-shadow: var(--ui-shadow-panel);
}

body[data-theme="tech"] .ui-workbench--review .review-tool-tabs,
body[data-theme="tech"] .ui-workbench--review .review-library-bar,
body[data-theme="tech"] .ui-workbench--review .review-finish {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
}

body[data-theme="tech"] .ui-workbench--review .review-tool-tabs button,
body[data-theme="tech"] .ui-workbench--review .review-library-level-switch button,
body[data-theme="tech"] .ui-workbench--review .pinyin-initial-filter button {
  border-color: var(--ui-line);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
  box-shadow: none;
}

body[data-theme="tech"] .ui-workbench--review :where(
  .review-tool-tabs button.active,
  .review-library-level-switch button.active,
  .pinyin-initial-filter button.active
) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-selected);
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--review :where(
  .review-ai-assistant,
  .review-delete-tool,
  .review-history-panel,
  .review-memory-panel,
  .review-manual-preview,
  .review-library-difference-note,
  .review-library-same-note
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--review :where(
  .review-ai-statebar,
  .review-ai-group-head,
  .review-pinyin-result-head,
  .review-history-legend
) {
  border-color: var(--ui-line-subtle);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--review .review-ai-project-summary {
  border-color: rgba(255, 179, 64, 0.26);
  border-left-color: var(--ui-warning);
  background: var(--ui-warning-soft);
}

body[data-theme="tech"] .ui-workbench--review .review-ai-hard-rules > div {
  border-color: var(--ui-line-subtle);
  background: var(--ui-surface-3);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--review :where(
  .review-ai-project-summary,
  .review-ai-hard-rules > div,
  .review-ai-empty
) :where(strong, b) {
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--review :where(
  .review-ai-project-summary,
  .review-ai-hard-rules > div,
  .review-ai-empty
) :where(span, p) {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--review .review-preview-area {
  background: var(--ui-surface-1);
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-delete-1 {
  border-color: rgba(255, 179, 64, 0.28);
  background: rgba(151, 91, 39, 0.18);
  color: #e3bd8d;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-delete-2 {
  border-color: rgba(255, 124, 91, 0.38);
  background: rgba(151, 67, 45, 0.23);
  color: #efaa95;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-delete-3 {
  border-color: rgba(255, 102, 117, 0.52);
  background: rgba(151, 47, 59, 0.27);
  color: #ffb3bc;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-keep-1 {
  border-color: rgba(53, 213, 121, 0.25);
  background: rgba(38, 121, 79, 0.16);
  color: #a5dfb9;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-keep-2 {
  border-color: rgba(53, 213, 121, 0.37);
  background: rgba(38, 137, 83, 0.22);
  color: #a8e9c0;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-keep-3 {
  border-color: rgba(53, 213, 121, 0.52);
  background: rgba(33, 148, 84, 0.27);
  color: #b4f0ca;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.history-balanced {
  border-color: rgba(139, 124, 255, 0.34);
  background: var(--ui-intelligence-soft);
  color: #c5befc;
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.remembered {
  box-shadow: inset 0 -2px rgba(53, 213, 121, 0.58);
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.material-auto-keep {
  box-shadow: inset 0 -2px rgba(255, 179, 64, 0.68);
}

body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.memory-selected,
body[data-theme="tech"] .ui-workbench--review .review-page-groups .ui-tile--character.selected {
  border-color: var(--ui-accent);
  background: var(--ui-surface-selected);
  color: #e4fbfd;
  box-shadow: inset 0 0 0 1px rgba(75, 216, 237, 0.15), var(--ui-shadow-glow);
}

body[data-theme="tech"] .ui-workbench--review .review-pinyin-result-char {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
  box-shadow: none;
}

body[data-theme="tech"] .ui-workbench--review .review-pinyin-result-char.selected {
  border-color: var(--ui-accent);
  background: var(--ui-surface-selected);
}

/* Library maintenance workbench */
body[data-theme="tech"] .ui-workbench--maintenance .maintenance-tabs button,
body[data-theme="tech"] .ui-workbench--maintenance .maintenance-tool-tabs button {
  border-color: var(--ui-line);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
  box-shadow: none;
}

body[data-theme="tech"] .ui-workbench--maintenance :where(
  .maintenance-tabs button.active,
  .maintenance-tool-tabs button.active
) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-selected);
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-results-head,
body[data-theme="tech"] .ui-workbench--maintenance .maintenance-tool-tabs {
  border-color: var(--ui-line);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-char-tile {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-char-tile:hover {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-hover);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-char-tile.selected {
  border-color: var(--ui-accent);
  background: var(--ui-surface-selected);
  box-shadow: var(--ui-shadow-glow);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-char-tile.deleted {
  border-color: rgba(255, 102, 117, 0.35);
  background: var(--ui-danger-soft);
}

body[data-theme="tech"] .ui-workbench--maintenance button.maintenance-char-main.ui-tile {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ui-text-strong);
  box-shadow: none;
  transform: none;
}

body[data-theme="tech"] .ui-workbench--maintenance button.maintenance-char-main.ui-tile:hover:not(:disabled) {
  border: 0;
  background: transparent;
  color: #e8fbfd;
  box-shadow: none;
  transform: none;
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-char-main small {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--maintenance :where(
  .maintenance-selected-glyph,
  .maintenance-batch-details,
  .maintenance-selected-editor,
  .maintenance-side-form,
  .bulk-add-box
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-selected-glyph {
  color: var(--ui-accent);
}

body[data-theme="tech"] .ui-workbench--maintenance .maintenance-batch-details summary {
  color: var(--ui-text-muted);
}

/* Xiaohongshu reply workbench */
body[data-theme="tech"] .ui-workbench--xhs {
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-resource-status {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-resource-status span {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-composer label {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--xhs :where(
  .xhs-result-block,
  .xhs-run-progress,
  .xhs-correction,
  .xhs-evidence,
  .xhs-admin-corrections details
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-final-reply,
body[data-theme="tech"] .ui-workbench--xhs :where(textarea, input, select) {
  border-color: var(--ui-line);
  background: #07111e;
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-admin-correction-body p {
  border-left-color: var(--ui-accent);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-section-head {
  border-color: var(--ui-line);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-section-head span,
body[data-theme="tech"] .ui-workbench--xhs .xhs-history-list span {
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-history-list strong {
  color: var(--ui-text);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-history-list button.ui-list-item.active strong {
  color: var(--ui-text-strong);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-evidence-grid section,
body[data-theme="tech"] .ui-workbench--xhs .xhs-evidence-reasons p,
body[data-theme="tech"] .ui-workbench--xhs .xhs-evidence-meta {
  border-color: var(--ui-line-subtle);
  background: var(--ui-surface-3);
  color: var(--ui-text-muted);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-progress-track {
  background: var(--ui-surface-4);
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-progress-track i {
  background: linear-gradient(90deg, var(--ui-accent-strong), var(--ui-intelligence));
}

body[data-theme="tech"] .ui-workbench--xhs .xhs-run-error {
  border-color: rgba(255, 102, 117, 0.28);
  background: var(--ui-danger-soft);
  color: #f2a1aa;
}

body[data-theme="tech"] .ui-workbench--xhs .empty {
  color: var(--ui-text-muted);
}

@media (max-width: 900px) {
  body[data-theme="tech"] .ui-workbench--dashboard {
    display: block;
    height: auto;
    overflow: visible;
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-overview-band,
  body[data-theme="tech"] .ui-workbench--dashboard .admin-workbench-body {
    margin-top: var(--ui-space-3);
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-workbench-head,
  body[data-theme="tech"] .ui-workbench--dashboard .admin-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-head-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-live-status {
    grid-column: 1 / -1;
    justify-content: center;
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-overview-band,
  body[data-theme="tech"] .ui-workbench--dashboard .admin-workbench-body {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-overview-band {
    height: auto;
    min-height: 0;
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-completion-visual {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  body[data-theme="tech"] .ui-workbench--dashboard .admin-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-theme="tech"] .ui-workbench--filter .filter-workbench-head {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-theme="tech"] .ui-workbench--filter .filter-workbench-head > div:first-child {
    width: auto;
  }

  body[data-theme="tech"] .ui-workbench--filter .filter-record-switcher {
    width: 100%;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  body[data-theme="tech"] .ui-workbench--filter .filter-console,
  body[data-theme="tech"] .ui-workbench--review .review-layout,
  body[data-theme="tech"] .ui-workbench--maintenance .maintenance-workspace-grid,
  body[data-theme="tech"] .ui-workbench--xhs :where(.xhs-reply-layout, .xhs-reply-lower) {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-theme="tech"] .ui-workbench--filter .filter-console-nav {
    display: flex;
    overflow-x: auto;
  }

  body[data-theme="tech"] .ui-workbench--filter .filter-console-nav button.ui-nav-item {
    min-width: 132px;
  }
}

@media (max-width: 520px) {
  body[data-theme="tech"] .ui-workbench--dashboard .admin-head-actions,
  body[data-theme="tech"] .ui-workbench--dashboard .admin-quick-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
