.document-shell {
  --document-select-font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

.document-shell {
  background: var(--lf-card, #fff);
  letter-spacing: 0;
}

.document-shell.editor-shell {
  background: var(--lf-bg, #f6f8fb);
}

.document-shell .main-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 28px 32px;
}

.document-shell select,
.document-shell .el-select__wrapper,
.document-shell .el-select__selected-item,
.document-shell .el-select__input {
  font-family: var(--document-select-font);
}

.document-shell select {
  font-size: 13px;
  font-weight: 500;
}

.document-shell .el-select__wrapper {
  color: var(--lf-text, #1e2a3b);
  font-size: 15px;
  font-weight: 500;
}

.document-shell .el-select__selected-item {
  font-size: 15px;
  font-weight: 500;
}

.document-select-popper {
  --document-select-font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-family: var(--document-select-font);
}

.document-select-popper .el-select-dropdown__item {
  display: flex;
  min-height: 36px;
  height: auto;
  align-items: center;
  padding: 8px 14px;
  color: var(--lf-text-2, #47546a);
  font-family: var(--document-select-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.document-select-popper .el-select-dropdown__item:hover,
.document-select-popper .el-select-dropdown__item.hover {
  background: var(--lf-primary-lighter, #f5f8ff);
  color: var(--lf-primary, #2b5ce6);
}

.document-select-popper .el-select-dropdown__item.is-selected {
  color: var(--lf-primary, #2b5ce6);
  font-weight: 600;
}

.document-shell .app-sidebar {
  background: var(--lf-surface-2, #f8fafc);
  border-right: 1px solid var(--lf-border, #e3e9f0);
}

.document-shell .side-brand {
  padding: 12px 10px 24px;
  font-size: 19px;
}

.document-shell .side-group-title {
  letter-spacing: 0;
}

.document-shell .side-nav-item {
  min-height: 40px;
  border-radius: 6px;
  transition: color .18s ease, background-color .18s ease;
}

.document-shell .side-nav-item.active {
  background: var(--lf-primary-light, #eef3ff);
  color: var(--lf-primary, #2b5ce6);
  font-weight: 600;
}

.document-shell .side-nav-icon {
  display: inline-flex;
  align-items: center;
}

.document-shell .quota-card {
  padding: 12px 6px;
  background: transparent;
}

.document-shell .card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.document-page-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.document-shell:not(.editor-shell) .document-page-head {
  margin-bottom: 16px;
}

.document-shell:not(.editor-shell) .document-page-head h1 {
  margin-top: 0;
}

.document-page-head > div {
  min-width: 0;
}

.document-breadcrumb {
  color: var(--lf-text-3, #8a94a6);
  font-size: 12px;
  line-height: 1.5;
}

.document-page-head h1 {
  overflow: hidden;
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-page-head .el-button {
  min-height: 36px;
  border-radius: 6px;
}

.document-shell:not(.editor-shell) .document-page-head [data-testid="document-continue"] {
  display: none;
}

.document-shell .document-upload {
  display: flex;
  flex-direction: column;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
}

.document-upload > .document-upload-title {
  display: none !important;
}

.document-upload .document-language-row {
  order: -3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.document-language-row .el-select {
  width: 180px;
  max-width: 245px;
  flex: 1 1 150px;
}

.document-language-row .el-select__wrapper {
  min-height: 40px;
  border-radius: 6px;
}

.document-language-row > span {
  color: var(--lf-text-2, #47546a);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.document-language-row .el-button {
  margin-left: auto;
  color: var(--lf-primary, #2b5ce6);
  white-space: nowrap;
}

.document-language-row .lang-swap {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 50%;
  background: var(--lf-card, #fff);
  color: var(--lf-primary, #2b5ce6);
}

.terminology-project-row {
  display: grid;
  grid-template-columns: auto minmax(190px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  margin: -4px 0 14px;
  color: var(--lf-text-2, #47546a);
  font-size: 13px;
}

.terminology-project-row .el-select {
  width: 100%;
}

.terminology-project-row .el-select__wrapper {
  min-height: 38px;
  border-radius: 6px;
}

.terminology-project-row small {
  color: var(--lf-text-3, #64748b);
  line-height: 1.45;
}

.document-upload .document-advanced {
  order: -2;
}

.document-upload .upload-area {
  display: flex;
  min-height: 172px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--lf-primary-200, #bfd2fe);
  border-radius: 6px;
  background: var(--lf-card, #fff);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}

.document-upload .upload-area:hover,
.document-upload .upload-area.dragover {
  border-color: var(--lf-primary, #2b5ce6);
  background: var(--lf-primary-lighter, #f5f8ff);
}

.document-upload .upload-icon {
  position: relative;
  width: 42px;
  height: 42px;
  margin: 0 0 2px;
  color: var(--lf-primary, #2b5ce6);
}

.document-upload .upload-file-icon,
.document-upload .upload-arrow-icon {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lf-primary, #2b5ce6);
}

.document-upload .upload-file-icon {
  inset: 0;
  font-size: 40px;
}

.document-upload .upload-file-icon svg {
  width: 40px;
  height: 40px;
}

.document-upload .upload-arrow-icon {
  top: 12px;
  left: 12px;
  width: 18px;
  height: 18px;
  background: var(--lf-card, #fff);
  font-size: 17px;
}

.document-upload .upload-arrow-icon svg {
  width: 17px;
  height: 17px;
}

.document-upload .upload-text {
  color: var(--lf-text, #1e2a3b);
  font-size: 15px;
  font-weight: 500;
}

.document-upload .upload-hint {
  color: var(--lf-text-3, #8a94a6);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.document-choose-file {
  min-height: 30px;
  margin-top: 2px;
  padding: 5px 14px;
  border: 1px solid var(--lf-primary, #2b5ce6);
  border-radius: 4px;
  background: var(--lf-card, #fff);
  color: var(--lf-primary, #2b5ce6);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .18s ease, color .18s ease;
}

.document-choose-file:hover {
  background: var(--lf-primary-light, #eef3ff);
}

.document-upload .file-selected {
  min-height: 100px;
  margin: 0;
  border-radius: 6px;
}

.document-upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.terminology-preview-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--lf-border, #dfe5ee);
  border-radius: 6px;
  background: var(--lf-surface-subtle, #f8fafc);
  color: var(--lf-text, #1f2937);
  font-size: 13px;
}

.terminology-preview-panel p {
  margin: 6px 0 0;
  color: var(--lf-text-2, #47546a);
  line-height: 1.5;
}

.terminology-preview-panel ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.terminology-preview-panel li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  overflow-wrap: anywhere;
}

.terminology-preview-panel li small {
  color: var(--lf-text-3, #64748b);
}

.document-upload-action-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.document-upload-action-links .el-button {
  min-height: 32px;
  padding-inline: 4px;
  color: var(--lf-text-2, #47546a);
}

.document-upload-action-links .format-capabilities-trigger {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--lf-primary, #2b5ce6);
}

.document-upload-action-links .format-capabilities-trigger:hover {
  background: var(--lf-primary-lighter, #f5f8ff);
}

.document-upload-actions > .el-button--primary {
  min-height: 38px;
  padding-inline: 18px;
  border-radius: 4px;
}

.document-upload .progress-wrap {
  margin-top: 14px;
}

.document-shell .translation-history-panel {
  margin: 0;
  padding: 0;
}

.document-shell .translation-history-panel .card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.document-shell .card-title::before {
  display: none;
}

.translation-history-panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
}

.translation-history-panel h2 small {
  margin-left: 6px;
  color: var(--lf-text-3, #8a94a6);
  font-size: 14px;
  font-weight: 400;
}

.document-task-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.document-task-tools .el-input {
  width: 248px;
}

.document-task-tools .el-input__wrapper {
  min-height: 36px;
  border-radius: 4px;
}

.document-task-tools > .el-button {
  width: 36px;
  height: 36px;
  border-radius: 4px;
}

.document-task-tools > .el-button:first-child {
  width: auto;
  padding-inline: 11px;
}

.document-status-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
}

.document-status-tabs button {
  padding: 0 2px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--lf-text-2, #47546a);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.document-status-tabs button:hover,
.document-status-tabs button.active {
  color: var(--lf-primary, #2b5ce6);
}

.document-status-tabs button.active {
  border-bottom-color: var(--lf-primary, #2b5ce6);
  font-weight: 600;
}

.document-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 6px;
  background: var(--lf-card, #fff);
}

.document-task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.document-task-table th {
  height: 40px;
  background: var(--lf-surface-2, #f8fafc);
  color: var(--lf-text-2, #47546a);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.document-task-table th,
.document-task-table td {
  overflow-wrap: anywhere;
  padding: 7px 12px;
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
}

.document-task-table td {
  height: 46px;
  color: var(--lf-text, #1e2a3b);
  line-height: 1.4;
}

.document-task-table th:first-child {
  width: 28%;
}

.document-task-table th:last-child {
  width: 190px;
}

.hidden-task-table th:last-child {
  width: 240px;
}

.document-task-table tbody tr:hover {
  background: var(--lf-primary-lighter, #f5f8ff);
}

.document-task-table tbody tr:last-child td {
  border-bottom: 0;
}

.document-file-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.document-file-name .el-icon {
  display: inline-flex;
  width: 24px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--lf-primary-light, #eef3ff);
  color: var(--lf-primary, #2b5ce6);
  font-size: 17px;
}

.document-file-name .el-icon.pdf {
  background: var(--lf-danger-light, #fbebeb);
  color: var(--lf-danger, #dc2626);
}

.document-file-name strong {
  font-weight: 500;
}

.document-task-table .el-button {
  height: auto;
  padding: 5px 0;
  text-align: left;
  white-space: normal;
}

.document-task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
}

.hidden-task-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hidden-task-heading p {
  margin: 4px 0 0;
  color: var(--lf-text-3, #8a94a6);
  font-size: 13px;
}

.document-task-table .el-progress {
  margin-top: 4px;
}

.document-task-table .el-progress__text {
  min-width: 30px;
  font-size: 11px !important;
}

.document-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.document-state::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.document-state.complete {
  color: var(--lf-success, #16a34a);
}

.document-state.processing {
  color: var(--lf-primary, #2b5ce6);
}

.document-state.failed {
  color: var(--lf-danger, #dc2626);
}

.document-state.unknown {
  color: var(--lf-text-3, #8a94a6);
}

.document-pagination,
.document-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.document-pagination {
  justify-content: space-between;
  padding-top: 12px;
  color: var(--lf-text-3, #8a94a6);
  font-size: 12px;
}

.document-empty {
  padding: 24px !important;
  color: var(--lf-text-3, #8a94a6);
  text-align: center;
}

.document-shell .review-sidebar-handle,
.document-shell .aux-drawer-handle {
  display: none !important;
}

.document-shell .help-fab {
  top: 15px;
  right: 200px;
  bottom: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--lf-border, #e3e9f0);
  background: transparent;
  box-shadow: none;
  color: var(--lf-text-2, #47546a);
  font-size: 16px;
}

.document-shell .back-to-top {
  display: none;
}

body:has(.editor-shell) .app-footer {
  display: none;
}

body:has(.document-shell) .review-sidebar-root .review-sidebar-handle,
body:has(.document-shell) .aux-drawer-root .aux-drawer-handle {
  display: none !important;
}

.editor-shell .main-container {
  display: flex;
  height: calc(100dvh - var(--lf-sticky-header-height) - var(--lf-sticky-nav-height));
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding: 12px 24px 0;
}

.editor-shell .document-page-head {
  flex-shrink: 0;
  margin-bottom: 10px;
}

.editor-shell .document-page-head h1 {
  font-size: 18px;
}

.editor-shell .document-editor {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 10px 12px 0;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 8px;
  background: var(--lf-card, #fff);
  box-shadow: none;
}

.document-editor > * {
  flex-shrink: 0;
}

.editor-shell .document-editor > .card-title {
  display: none;
}

.editor-shell .document-editor-top {
  order: -4;
  gap: 4px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
}

.editor-shell .document-editor-top > div {
  gap: 4px !important;
}

.editor-shell .document-editor-top button {
  width: auto;
  margin: 0;
  padding: 4px 8px !important;
  font-size: 12px;
}

.editor-shell [data-testid="provider-route-summary"] {
  margin: 0 !important;
  padding: 3px 0 !important;
  border: 0 !important;
  background: transparent !important;
  font-size: 11px !important;
}

.editor-shell .result-actions-sticky {
  position: relative;
  top: auto;
  z-index: 5;
  order: -3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 0;
  background: var(--lf-card, #fff);
  box-shadow: none;
  backdrop-filter: none;
}

.editor-shell .toolbar-status-group {
  flex: 1 1 100%;
  justify-content: flex-start;
  gap: 8px;
}

.editor-shell .toolbar-status-group > .el-button:last-child {
  margin-left: auto;
}

.editor-shell .toolbar-action-groups {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  border: 0;
}

.editor-shell .toolbar-action-group {
  flex-wrap: nowrap;
  gap: 6px;
}

.editor-shell .toolbar-action-group .el-button {
  margin: 0;
}

.editor-shell .toolbar-summary-group,
.editor-shell .qa-summary-compact {
  font-size: 12px;
}

.editor-shell .toolbar-summary-group {
  justify-content: flex-start;
}

.editor-shell .seg-progress {
  padding: 0;
  background: transparent;
  font-size: 12px;
}

.editor-shell .quality-grade-badge,
.editor-shell .toolbar-action-group-rerun {
  display: none;
}

.editor-shell [data-testid="toolbar-action-group-rerun"],
.editor-shell [data-testid="next-segment-button"],
.editor-shell [data-testid="copy-all-targets-button"],
.editor-shell [data-testid="download-docx-targetonly-button"],
.editor-shell [data-testid="download-pdf-button"],
.editor-shell [data-testid="pdf-engine-select"],
.editor-shell [data-testid="toolbar-action-group-delivery"] > .el-dropdown:last-child,
.editor-shell [data-testid="toolbar-action-group-delivery"] > .muted {
  display: none;
}

.editor-shell .document-more-open [data-testid="toolbar-action-group-rerun"],
.editor-shell .document-more-open [data-testid="next-segment-button"],
.editor-shell .document-more-open [data-testid="copy-all-targets-button"],
.editor-shell .document-more-open [data-testid="download-docx-targetonly-button"],
.editor-shell .document-more-open [data-testid="download-pdf-button"],
.editor-shell .document-more-open [data-testid="pdf-engine-select"],
.editor-shell .document-more-open [data-testid="toolbar-action-group-delivery"] > .el-dropdown:last-child,
.editor-shell .document-more-open [data-testid="toolbar-action-group-delivery"] > .muted {
  display: inline-flex;
}

.editor-shell .document-more-open .toolbar-action-group {
  flex-wrap: wrap;
}

.editor-shell .document-more-open {
  max-height: 36vh;
  overflow-y: auto;
}

.editor-shell .document-table-workspace {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.editor-shell .seg-filter-bar {
  flex-shrink: 0;
  gap: 6px;
  margin: 0;
  padding: 8px 0;
}

.editor-shell .seg-filter-bar .filter-pill {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.editor-shell .result-layout {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  margin: 0;
}

.editor-shell .table-area {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.document-column-head {
  display: grid;
  min-height: 36px;
  flex-shrink: 0;
  grid-template-columns: 40px 56px minmax(0, 36fr) minmax(0, 40fr) 140px;
  align-items: center;
  border-block: 1px solid var(--lf-border, #e3e9f0);
  background: var(--lf-surface-2, #f8fafc);
  color: var(--lf-text-2, #47546a);
  font-size: 12px;
}

.document-column-head span {
  padding-left: 12px;
}

.editor-shell .vscroll-container {
  max-height: none;
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 0;
  border-radius: 0;
  overscroll-behavior: contain;
}

.editor-shell .translation-segments-table {
  width: 100%;
  margin: 0;
  table-layout: fixed;
}

.editor-shell .translation-segments-table td {
  padding: 10px 12px;
  vertical-align: top;
}

.editor-shell .target-edit {
  min-height: 48px !important;
  padding: 7px 8px;
  border-radius: 4px;
  font-size: 14px;
}

.editor-shell .source-text {
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
}

.editor-shell .status-badge {
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
}

.editor-shell .focus-review {
  order: 2;
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.review-sidebar-panel,
.editor-shell .aux-drawer-panel {
  top: var(--lf-sticky-header-height);
  width: min(380px, 92vw);
  max-height: calc(100dvh - var(--lf-sticky-header-height));
}

@media (max-width: 1200px) {
  .document-language-row .el-select {
    max-width: 180px;
  }

  .document-task-table {
    min-width: 780px;
  }

  .editor-shell .toolbar-action-groups {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .editor-shell .toolbar-action-group {
    flex-shrink: 0;
  }

  .editor-shell .toolbar-summary-group {
    flex-basis: 100%;
  }
}

@media (min-width: 761px) {
  .document-upload .document-language-row {
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) 36px auto minmax(130px, 1fr) auto minmax(150px, 1fr) auto;
    gap: 10px;
  }

  .document-language-row .el-select {
    width: 100%;
    max-width: none;
    flex: initial;
  }

  .document-language-row .el-button {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .document-shell .main-container {
    padding: 16px 12px 24px;
  }

  .document-shell:not(.editor-shell) .document-page-head {
    margin-bottom: 18px;
  }

  .document-shell:not(.editor-shell) .document-page-head h1 {
    margin-top: 6px;
  }

  .document-page-head {
    margin-bottom: 18px;
  }

  .document-page-head h1 {
    font-size: 20px;
  }

  .document-language-row {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px 12px;
  }

  .terminology-project-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: -6px;
  }

  .document-language-row .el-select {
    width: 100%;
    max-width: none;
  }

  .document-language-row .lang-swap {
    display: none;
  }

  .document-language-row > .el-button {
    grid-column: 2;
    justify-self: end;
  }

  .document-task-tools,
  .document-task-tools .el-input {
    width: 100%;
  }

  .document-task-tools {
    flex-wrap: wrap;
  }

  .document-task-tools > .el-button:first-child {
    flex: 1 0 auto;
    justify-content: center;
  }

  .document-shell .translation-history-panel .card-title {
    flex-wrap: wrap;
  }

  .document-status-tabs {
    gap: 16px;
    overflow-x: auto;
  }

  .document-upload .upload-area {
    min-height: 164px;
    padding: 14px;
  }

  .document-upload-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .document-upload-action-links {
    flex-wrap: wrap;
    gap: 2px 8px;
  }

  .document-upload-actions > .el-button--primary {
    flex-shrink: 0;
    padding-inline: 12px;
  }

  .editor-shell .main-container {
    padding: 8px;
  }

  .editor-shell .document-editor-top {
    max-height: 78px;
    overflow: auto;
  }

  .editor-shell .document-page-head h1 {
    max-width: 190px;
    font-size: 16px;
  }

  .editor-shell .help-fab {
    display: none;
  }

  .editor-shell .seg-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .editor-shell .seg-filter-bar > * {
    flex-shrink: 0;
  }

  .document-column-head {
    display: none;
  }

  .editor-shell .translation-segments-table {
    min-width: 0;
  }

  .editor-shell .document-more-open {
    max-height: 30vh;
  }
}

/* Translation editor refinements */
.editor-shell {
  --document-select-font: Inter, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-family: var(--document-select-font);
  color: var(--lf-text, #1e2a3b);
}

.editor-shell :is(button, input, textarea, select, .el-button) {
  font-family: inherit;
  letter-spacing: 0;
}

.editor-shell .result-actions-sticky {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
  grid-template-areas: "status status" "actions summary";
  align-items: center;
  gap: 6px 14px;
  padding: 6px 0 10px;
}

.editor-shell .toolbar-status-group {
  grid-area: status;
  min-height: 34px;
  flex: initial;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
}

.editor-shell .toolbar-status-group > .el-button:last-child {
  margin-left: auto;
}

.editor-shell .view-mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 6px;
  background: var(--lf-surface-2, #f8fafc);
}

.editor-shell .view-mode-btn {
  min-height: 28px;
  padding: 4px 9px;
  border: 0;
  border-radius: 4px;
  color: var(--lf-text-2, #47546a);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.editor-shell .view-mode-btn.active {
  color: var(--lf-primary, #2b5ce6);
  background: var(--lf-card, #fff);
  box-shadow: 0 1px 2px rgb(30 42 59 / 10%);
}

.editor-shell .toolbar-action-groups {
  grid-area: actions;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 0;
  border: 0;
}

.editor-shell .toolbar-action-group {
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 0;
  border: 0;
  border-right: 1px solid var(--lf-border, #e3e9f0);
}

.editor-shell .toolbar-action-group + .toolbar-action-group {
  padding-left: 0;
  border-left: 0;
}

.editor-shell .toolbar-action-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.editor-shell .toolbar-action-group .el-button {
  min-height: 30px;
  border-radius: 5px;
  font-size: 12px;
}

.editor-shell [data-testid="qa-run-all-button"] {
  --el-button-text-color: var(--lf-text-2, #47546a);
  --el-button-border-color: var(--lf-border, #e3e9f0);
  --el-button-bg-color: var(--lf-card, #fff);
  --el-button-hover-text-color: var(--lf-primary, #2b5ce6);
  --el-button-hover-border-color: var(--lf-primary, #2b5ce6);
  --el-button-hover-bg-color: var(--lf-primary-lighter, #f5f8ff);
}

.editor-shell .toolbar-summary-group {
  grid-area: summary;
  max-width: 560px;
  justify-content: flex-end;
  gap: 6px;
}

.editor-shell .seg-progress,
.editor-shell .qa-summary-badge,
.editor-shell .quality-grade-badge {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.35;
}

.editor-shell .seg-progress {
  color: var(--lf-text-2, #47546a);
  background: var(--lf-surface-2, #f8fafc);
}

.editor-shell .image-refine-panel {
  flex-shrink: 0;
  margin: 6px 0 10px;
  overflow: hidden;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 6px;
  background: var(--lf-surface-2, #f8fafc);
}

.editor-shell .image-refine-summary {
  display: grid;
  min-height: 40px;
  grid-template-columns: max-content minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: var(--lf-text-2, #47546a);
  cursor: pointer;
  list-style: none;
}

.editor-shell .image-refine-summary::-webkit-details-marker {
  display: none;
}

.editor-shell .image-refine-summary:focus-visible {
  outline: 2px solid var(--lf-primary, #2b5ce6);
  outline-offset: -2px;
}

.editor-shell .image-refine-title {
  color: var(--lf-text, #1e2a3b);
  font-size: 13px;
  font-weight: 600;
}

.editor-shell .image-refine-hint {
  overflow: hidden;
  color: var(--lf-text-3, #7d899b);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-shell .image-refine-chevron {
  width: 7px;
  height: 7px;
  justify-self: center;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}

.editor-shell .image-refine-panel[open] .image-refine-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.editor-shell .image-refine-content {
  padding: 0 12px 12px;
}

.editor-shell .image-refine-content textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 5px;
  color: var(--lf-text, #1e2a3b);
  background: var(--lf-card, #fff);
  font-size: 13px;
  line-height: 1.55;
}

.editor-shell .image-refine-content .btn-row {
  margin-top: 8px;
}

.editor-shell .seg-filter-bar {
  min-height: 40px;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 6px;
  background: var(--lf-surface-2, #f8fafc);
}

.editor-shell .seg-filter-bar .filter-label {
  margin-right: 2px;
  color: var(--lf-text-3, #7d899b);
  font-size: 12px;
}

.editor-shell .seg-filter-bar .filter-pill {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--lf-text-2, #47546a);
  background: transparent;
  font-size: 12px;
}

.editor-shell .seg-filter-bar .filter-pill:hover {
  border-color: var(--lf-border, #e3e9f0);
  background: var(--lf-card, #fff);
}

.editor-shell .seg-filter-bar .filter-pill.active {
  border-color: var(--lf-primary, #2b5ce6);
  color: var(--lf-primary, #2b5ce6);
  background: var(--lf-card, #fff);
  box-shadow: 0 1px 2px rgb(30 42 59 / 8%);
}

.editor-shell .seg-filter-bar [data-testid="show-minimap"] {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--lf-text-2, #47546a);
  font-size: 12px;
}

.editor-shell .result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 206px;
  min-height: 0;
  flex: 1;
  gap: 12px;
  overflow: hidden;
}

.editor-shell .result-layout.with-minimap-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.editor-shell .table-area {
  min-width: 0;
}

.editor-shell .document-column-head {
  grid-template-columns: 40px 52px minmax(0, 36fr) minmax(0, 40fr) 132px;
  min-height: 38px;
  border-top: 0;
  border-radius: 5px 5px 0 0;
  font-size: 12px;
  font-weight: 600;
}

.editor-shell .translation-segments-table col:nth-child(1) { width: 40px !important; }
.editor-shell .translation-segments-table col:nth-child(2) { width: 52px !important; }
.editor-shell .translation-segments-table col:nth-child(3) { width: 36% !important; }
.editor-shell .translation-segments-table col:nth-child(4) { width: 40% !important; }
.editor-shell .translation-segments-table col:nth-child(5) { width: 132px !important; }

.editor-shell .translation-segments-table tbody tr {
  border-bottom: 1px solid var(--lf-border, #e3e9f0);
}

.editor-shell .translation-segments-table td {
  padding: 11px 10px;
}

.editor-shell .source-text {
  color: var(--lf-text, #1e2a3b);
  font-size: 14px;
  line-height: 1.7;
}

.editor-shell .target-edit {
  min-height: 58px !important;
  padding: 8px 10px;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 5px;
  color: var(--lf-text, #1e2a3b);
  background: var(--lf-card, #fff);
  font-size: 14px;
  line-height: 1.65;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.editor-shell .target-edit:focus {
  border-color: var(--lf-primary, #2b5ce6);
  outline: 0;
  box-shadow: 0 0 0 2px rgb(43 92 230 / 12%);
}

.editor-shell .status-badge {
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.editor-shell .minimap-area {
  position: static;
  display: flex;
  width: 206px;
  min-height: 0;
  max-height: none;
  align-self: stretch;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--lf-border, #e3e9f0);
  border-radius: 6px;
  background: var(--lf-surface-2, #f8fafc);
}

.editor-shell .minimap-header {
  flex-shrink: 0;
  margin-bottom: 8px;
  color: var(--lf-text, #1e2a3b);
  font-size: 13px;
}

.editor-shell .minimap-header .toggle-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
}

.editor-shell .minimap-list {
  min-height: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  padding: 2px;
  scrollbar-gutter: stable;
}

.editor-shell .minimap-cell {
  min-height: 26px;
  border-radius: 4px;
  font-size: 11px;
}

.editor-shell .minimap-cell.status-approved { background: #328564; }
.editor-shell .minimap-cell.status-done { background: #75a77d; }
.editor-shell .minimap-cell.status-edited { background: var(--lf-primary, #2b5ce6); }
.editor-shell .minimap-cell.status-qa-error { background: #cf5c61; }
.editor-shell .minimap-cell.status-qa-warn { background: #c99743; }

.editor-shell .minimap-legend {
  flex-shrink: 0;
  gap: 6px 8px;
  color: var(--lf-text-2, #47546a);
  font-size: 11px;
}

@media (max-width: 1600px) {
  .editor-shell .result-actions-sticky {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "status" "actions" "summary";
    gap: 6px;
  }

  .editor-shell .toolbar-summary-group {
    max-width: none;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .editor-shell .result-layout,
  .editor-shell .result-layout.with-minimap-hidden {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .editor-shell .minimap-area {
    width: auto;
    max-height: 132px;
    order: 1;
  }

  .editor-shell .minimap-list {
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  }
}

@media (max-width: 760px) {
  .editor-shell .image-refine-summary {
    grid-template-columns: minmax(0, 1fr) 12px;
    gap: 4px 8px;
  }

  .editor-shell .image-refine-hint {
    grid-column: 1;
    grid-row: 2;
    white-space: normal;
  }

  .editor-shell .image-refine-chevron {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .editor-shell .result-actions-sticky {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "status" "actions" "summary";
  }

  .editor-shell .toolbar-action-groups {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .editor-shell .toolbar-action-group {
    flex-shrink: 0;
  }

  .editor-shell .result-layout,
  .editor-shell .result-layout.with-minimap-hidden {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .editor-shell .minimap-area {
    max-height: 112px;
  }

  .editor-shell .minimap-list {
    grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  }
}

@media (max-width: 760px) {
  body:has(.document-shell) .review-sidebar-root .review-sidebar-handle,
  body:has(.document-shell) .aux-drawer-root .aux-drawer-handle {
    display: flex !important;
  }
}

/* Keep the editor usable beside the review queue on wide screens. */
.review-sidebar-panel .review-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
}

.review-sidebar-panel .review-queue-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
}

.review-sidebar-panel .review-queue-reason {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.45;
}

.review-sidebar-panel .review-queue-row-actions {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.review-sidebar-panel .review-queue-row-actions .el-button {
  max-width: 100%;
  height: auto;
  min-width: 0;
  min-height: 28px;
  white-space: normal;
}

.review-sidebar-panel .review-queue-list--terms .review-queue-row {
  grid-template-columns: max-content minmax(0, 1fr);
}

@media (min-width: 1440px) {
  .editor-shell.review-sidebar-open .main-container {
    box-sizing: border-box;
    width: calc(100% - 416px);
    max-width: none;
    margin-right: auto;
    margin-left: 0;
  }

  .review-sidebar-panel {
    top: var(--lf-sticky-header-height);
    bottom: 0;
    width: 400px;
    max-width: 400px;
    max-height: none;
  }

  .editor-shell.review-sidebar-open .back-to-top-btn {
    right: 424px !important;
  }
}

@media (max-width: 1439px) {
  .editor-shell.review-sidebar-open .main-container {
    width: 100%;
  }

  .review-sidebar-panel {
    position: fixed;
  }
}

@media (max-width: 480px) {
  .review-sidebar-panel .review-queue-row-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 116px), 1fr));
  }

  .review-sidebar-panel .review-queue-row-actions .el-button {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 760px) {
  .document-status-tabs {
    flex-wrap: wrap;
    gap: 4px 14px;
    overflow: visible;
  }
}
