/*
 * Text review workspace mapped directly from the production PDF reviewer.
 * Text-specific differences are limited to the source-evidence body.
 */
body.workspace-mode {
  --workspace-header-height: 62px !important;
  overflow: hidden !important;
  background: #edf3f9 !important;
}

body.workspace-mode #results-panel {
  display: grid !important;
  grid-template-rows: var(--workspace-header-height) minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #edf3f9 !important;
}

body.workspace-mode .workspace-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 12px !important;
  width: 100% !important;
  height: var(--workspace-header-height) !important;
  min-height: var(--workspace-header-height) !important;
  padding: 8px 12px !important;
  border-top: 3px solid transparent !important;
  border-image: linear-gradient(90deg, #f43b33 0 36%, #eda900 36% 58%, #1575e6 58% 80%, #0b9668 80%) 1 !important;
  border-bottom: 1px solid #cbd8e8 !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: none !important;
}

body.workspace-mode .workspace-header > #scorecard-grid {
  display: none !important;
}

body.workspace-mode .workspace-document {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  gap: 10px !important;
}

body.workspace-mode .exit-workspace-button {
  width: 140px !important;
  min-width: 140px !important;
  height: 34px !important;
  min-height: 34px !important;
  border: 1px solid #b9c9dc !important;
  border-radius: 6px !important;
  background: #fff !important;
  padding: 0 10px !important;
  color: #172033 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 11px !important;
  white-space: nowrap !important;
}

body.workspace-mode .workspace-document-copy {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  min-width: 0 !important;
  align-items: baseline !important;
  gap: 0 !important;
}

body.workspace-mode .workspace-document-copy > span {
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 12px !important;
  text-transform: uppercase !important;
}

body.workspace-mode .workspace-document #workspace-file-name {
  max-width: clamp(190px, 28vw, 500px) !important;
  overflow: hidden !important;
  color: #172033 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 14px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.workspace-mode #workspace-inline-status {
  grid-column: 1 !important;
  max-width: min(480px, 32vw) !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 13px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.workspace-mode .workspace-actions {
  display: flex !important;
  width: auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-left: auto !important;
  overflow: visible !important;
}

body.workspace-mode .workspace-summary-button,
body.workspace-mode .workspace-actions .button {
  display: inline-flex !important;
  width: auto !important;
  height: 34px !important;
  min-height: 34px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #b9c9dc !important;
  border-radius: 6px !important;
  background: #fff !important;
  padding: 0 12px !important;
  color: #172033 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 11px !important;
  white-space: nowrap !important;
}

body.workspace-mode .workspace-summary-button {
  min-width: 152px !important;
}

body.workspace-mode .workspace-summary-button strong {
  display: none !important;
}

body.workspace-mode #enrich-button { min-width: 89px !important; }
body.workspace-mode #workspace-match-button { min-width: 78px !important; }
body.workspace-mode #workspace-quality-button {
  min-width: 77px !important;
  border-color: #9fd6b9 !important;
  background: #effaf4 !important;
  color: #08784e !important;
}
body.workspace-mode #workspace-export-button {
  min-width: 76px !important;
  border-color: #f43b33 !important;
  background: #f43b33 !important;
  color: #fff !important;
}

body.workspace-mode .mobile-workspace-tabs {
  display: none !important;
}

body.workspace-mode .workspace-grid {
  grid-row: 2 !important;
  top: auto !important;
  bottom: auto !important;
  display: grid !important;
  grid-template-columns: minmax(320px, 34%) minmax(320px, 31%) minmax(390px, 1fr) !important;
  align-items: stretch !important;
  gap: 9px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 11px !important;
  overflow: hidden !important;
  background: #edf3f9 !important;
}

body.workspace-mode .workspace-pane,
body.workspace-mode .workspace-pane:first-child,
body.workspace-mode .workspace-pane:last-child,
body.workspace-mode .workspace-pane + .workspace-pane {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  align-self: stretch !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border: 1px solid #bfd0e4 !important;
  border-radius: 6px !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.workspace-mode .source-text-pane { box-shadow: inset 0 4px #1473e6 !important; }
body.workspace-mode .reference-list-pane { box-shadow: inset 0 4px #f43b33 !important; }
body.workspace-mode .reference-detail { box-shadow: inset 0 4px #d58a00 !important; }

body.workspace-mode .pane-header,
body.workspace-mode .detail-sticky-header {
  position: relative !important;
  top: auto !important;
  z-index: 4 !important;
  display: flex !important;
  width: 100% !important;
  height: 66px !important;
  min-height: 66px !important;
  flex: 0 0 66px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 15px 14px 13px !important;
  overflow: visible !important;
  border-bottom: 1px solid #cbd8e8 !important;
  background: #fff !important;
}

body.workspace-mode .pane-kicker,
body.workspace-mode .detail-kicker {
  margin: 0 !important;
  color: #1473e6 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 13px !important;
  text-transform: uppercase !important;
}

body.workspace-mode .reference-list-pane .pane-kicker { color: #d7352e !important; }
body.workspace-mode .reference-detail .detail-kicker { color: #d58a00 !important; }

body.workspace-mode .pane-header h2,
body.workspace-mode .reference-detail h2,
body.workspace-mode .reference-detail h3 {
  margin: 4px 0 0 !important;
  color: #172033 !important;
  font-family: Manrope, Inter, sans-serif !important;
  font-size: 20px !important;
  font-weight: 850 !important;
  line-height: 24px !important;
}

body.workspace-mode .pane-header-actions,
body.workspace-mode .reference-list-actions {
  position: static !important;
  display: flex !important;
  width: auto !important;
  height: auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

body.workspace-mode .pane-header-actions .icon-button,
body.workspace-mode .detail-sticky-header .icon-button {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  border: 1px solid #b9c9dc !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #334155 !important;
}

body.workspace-mode .source-text-tools {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 5px 14px !important;
  border-bottom: 1px solid #cbd8e8 !important;
  background: #fff !important;
}

body.workspace-mode .source-text-tools span {
  overflow: hidden !important;
  color: #58708d !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.workspace-mode .source-text-tools .tool-button {
  height: 30px !important;
  min-height: 30px !important;
  border-radius: 5px !important;
  font-size: 11px !important;
}

body.workspace-mode .source-text-viewer {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 14px !important;
  background: #eef3f8 !important;
}

body.workspace-mode #workspace-source-text {
  min-height: 100% !important;
  padding: 18px !important;
  font-size: 12px !important;
  line-height: 1.65 !important;
}

body.workspace-mode .workspace-source-note {
  width: 100% !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 8px 14px !important;
  font-size: 10px !important;
  line-height: 14px !important;
}

body.workspace-mode .reference-list-actions .review-menu > summary {
  width: 118px !important;
  min-width: 118px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 6px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

body.workspace-mode .review-menu-section-label {
  display: block !important;
  margin: 5px 4px 2px !important;
  border-top: 1px solid #dbe5ef !important;
  padding: 9px 6px 4px !important;
  color: #7b8798 !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
}

body.workspace-mode .reference-list {
  display: block !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0 !important;
  background: #fff !important;
}

body.workspace-mode .reference-row {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  width: 100% !important;
  min-height: 104px !important;
  max-height: none !important;
  align-items: start !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid #d8e2ed !important;
  border-left: 4px solid #8ea0b5 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.workspace-mode .reference-row.is-selected {
  border-left-color: #1473e6 !important;
  background: #f1f7ff !important;
  box-shadow: inset 0 0 0 1px #71aceb !important;
}

body.workspace-mode .reference-row > input {
  width: 16px !important;
  height: 16px !important;
  margin: 2px 0 0 !important;
  accent-color: #f43b33 !important;
}

body.workspace-mode .reference-row > div {
  min-width: 0 !important;
  overflow: hidden !important;
}

body.workspace-mode .reference-row > div > strong {
  display: -webkit-box !important;
  overflow: hidden !important;
  color: #172033 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.35 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

body.workspace-mode .paper-order {
  margin-right: 5px !important;
  color: #64748b !important;
  font-weight: 900 !important;
}

body.workspace-mode .reference-row p {
  margin: 6px 0 0 !important;
  overflow: hidden !important;
  color: #66778d !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.workspace-mode .reference-row-meta {
  display: flex !important;
  max-height: 24px !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  margin-top: 8px !important;
  overflow: hidden !important;
}

body.workspace-mode .reference-row > button { display: none !important; }

body.workspace-mode .reference-detail {
  top: auto !important;
  bottom: auto !important;
  align-self: stretch !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.workspace-mode .detail-page-body {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 16px !important;
  background: #fff !important;
}

body.workspace-mode .detail-actions {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 0 0 16px !important;
  padding: 0 0 16px !important;
  border: 0 !important;
  border-bottom: 1px solid #dbe5ef !important;
  background: #fff !important;
}

body.workspace-mode .detail-actions button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 38px !important;
  border: 1px solid #b9c9dc !important;
  border-radius: 6px !important;
  background: #fff !important;
  padding: 6px 9px !important;
  color: #172033 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  text-align: center !important;
}

body.workspace-mode .detail-actions button:first-child {
  border-color: #f43b33 !important;
  background: #f43b33 !important;
  color: #fff !important;
}

body.workspace-mode .detail-section {
  margin: 0 0 16px !important;
  padding: 0 0 16px !important;
  border-bottom: 1px solid #dbe5ef !important;
}

body.workspace-mode .detail-section-heading {
  display: flex !important;
  min-height: 22px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 0 10px !important;
  color: #596b82 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .02em !important;
  text-transform: uppercase !important;
}

body.workspace-mode .detail-section-heading small {
  color: #8a98aa !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.workspace-mode .reference-detail label {
  gap: 5px !important;
  color: #526176 !important;
  font-size: 9px !important;
  font-weight: 850 !important;
}

body.workspace-mode .reference-detail input,
body.workspace-mode .reference-detail textarea {
  border: 1px solid #b9c9dc !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #172033 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

body.workspace-mode .field-control-raw textarea {
  min-height: 96px !important;
  max-height: 180px !important;
  resize: vertical !important;
}

body.workspace-mode .detail-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body.workspace-mode .detail-grid label:nth-child(1),
body.workspace-mode .detail-grid label:nth-child(2),
body.workspace-mode .detail-grid label:last-child {
  grid-column: 1 / -1 !important;
}

body.workspace-mode .detail-empty-state {
  padding: 22px !important;
}

body.workspace-mode .workspace-utilities {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1200 !important;
  pointer-events: none !important;
}

body.workspace-mode .workspace-utility-drawer[open]::before {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  display: block !important;
  background: rgba(15, 23, 42, .34) !important;
  content: "" !important;
  pointer-events: none !important;
}

body.workspace-mode .workspace-utility-drawer[open] .utility-content {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 2 !important;
  display: flex !important;
  width: min(1040px, calc(100vw - 72px)) !important;
  max-width: 1040px !important;
  height: min(680px, calc(100vh - 72px)) !important;
  max-height: calc(100vh - 72px) !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border: 1px solid #bfd0e4 !important;
  border-radius: 8px !important;
  background: #f8fbff !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28) !important;
  pointer-events: auto !important;
  transform: translate(-50%, -50%) !important;
}

body.workspace-mode .workspace-utility-drawer .utility-panel-head {
  flex: 0 0 auto !important;
}

body.workspace-mode .workspace-utility-drawer .utility-scroll-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body.workspace-mode .workspace-restore-button:not([hidden]) {
  position: fixed !important;
  top: calc(var(--workspace-header-height) + 11px) !important;
  bottom: 11px !important;
  z-index: 25 !important;
  display: grid !important;
  width: 58px !important;
  height: auto !important;
  place-items: center !important;
  border: 1px solid #bfd0e4 !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #526176 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .03em !important;
  text-transform: uppercase !important;
  writing-mode: vertical-rl !important;
}

body.workspace-mode .source-restore:not([hidden]) {
  left: 11px !important;
  box-shadow: inset 4px 0 #1473e6 !important;
}

body.workspace-mode .detail-restore:not([hidden]) {
  right: 11px !important;
  box-shadow: inset -4px 0 #d58a00 !important;
}

@media (min-width: 1101px) {
  body.workspace-mode .workspace-grid.is-source-collapsed {
    grid-template-columns: 58px minmax(360px, 31%) minmax(390px, 1fr) !important;
  }

  body.workspace-mode .workspace-grid.is-detail-collapsed {
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 31%) 58px !important;
  }
}

@media (max-width: 1100px) {
  body.workspace-mode #results-panel {
    display: flex !important;
    flex-direction: column !important;
  }

  body.workspace-mode .workspace-header {
    flex: 0 0 auto !important;
  }

  body.workspace-mode .mobile-workspace-tabs {
    z-index: 18 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    flex: 0 0 46px !important;
    width: 100% !important;
    min-height: 46px !important;
    border-bottom: 1px solid #cbd8e8 !important;
    background: #fff !important;
  }

  body.workspace-mode .workspace-grid {
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
  }

  body.workspace-mode .workspace-pane,
  body.workspace-mode .workspace-pane:first-child,
  body.workspace-mode .workspace-pane:last-child,
  body.workspace-mode .workspace-pane + .workspace-pane {
    display: none !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.workspace-mode .workspace-grid[data-mobile-panel="references"] > [data-pane="references"],
  body.workspace-mode .workspace-grid[data-mobile-panel="source"] > [data-pane="source"],
  body.workspace-mode .workspace-grid[data-mobile-panel="detail"] > [data-pane="detail"] {
    display: flex !important;
  }

  body.workspace-mode .pane-collapse-button,
  body.workspace-mode .workspace-restore-button {
    display: none !important;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 8px !important;
    height: auto !important;
    min-height: 126px !important;
    padding: 10px 12px 8px !important;
  }

  body.workspace-mode .workspace-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 6px !important;
  }

  body.workspace-mode .workspace-summary-button { display: none !important; }
  body.workspace-mode .workspace-actions .button { min-width: 0 !important; padding: 0 6px !important; }
  body.workspace-mode .detail-actions,
  body.workspace-mode .detail-grid { grid-template-columns: minmax(0, 1fr) !important; }
  body.workspace-mode .detail-grid label { grid-column: 1 !important; }
}
