:root {
  --bg: #f4f7ff;
  --surface: #ffffff;
  --surface-subtle: #f7faff;
  --ink: #172033;
  --muted: #53647b;
  --line: #d7e0ec;
  --line-strong: #bdcada;
  --brand: #ef3f34;
  --brand-dark: #c92b24;
  --brand-bright: #ff5b50;
  --brand-soft: #fff0ee;
  --source: #1473e6;
  --source-soft: #eaf3ff;
  --ready: #087f4b;
  --ready-soft: #e9f9f1;
  --review: #a86100;
  --review-soft: #fff4d6;
  --blocked: #d92f38;
  --blocked-soft: #fff0f1;
  --focus: #0068e8;
  --shadow: 0 18px 44px rgba(30, 42, 60, 0.1);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Manrope", "Inter", sans-serif;
}

body:not(.workspace-mode) .workflow-ledger article {
  border-top-color: var(--brand-bright) !important;
}

body:not(.workspace-mode) .workflow-ledger .ledger-number {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
}

.use-summary-card {
  max-width: 980px;
  border: 1px solid #c8d5e5;
  border-top: 3px solid var(--brand-bright);
  border-radius: 7px;
  background: #fff;
  padding: 24px 26px;
}

.use-summary-card h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
}

.use-summary-card ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.use-summary-card li {
  padding-left: 4px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.version-mark,
.preview-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.version-mark {
  border-left: 1px solid var(--line);
  padding-left: 9px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: #4e5561;
  font-size: 12px;
  font-weight: 700;
}

.main-nav a:hover {
  color: var(--brand-dark);
}

.header-tool-link {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
  padding: 8px 12px;
}

.header-tool-link:hover {
  background: var(--surface-subtle);
}

.landing-view {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 42px 24px 72px;
}

.landing-view::before {
  position: fixed;
  inset: 58px 0 auto;
  z-index: -1;
  height: 420px;
  border-bottom: 1px solid #e7e9ed;
  background:
    linear-gradient(rgba(58, 63, 73, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 63, 73, 0.035) 1px, transparent 1px),
    #f7f8f9;
  background-size: 44px 44px;
  content: "";
}

.landing-copy {
  max-width: 780px;
  margin: 0 auto 28px;
  text-align: center;
}

.eyebrow,
.pane-kicker {
  display: block;
  margin: 0 0 9px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 44px;
  line-height: 1.08;
}

.landing-lead {
  max-width: 680px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.landing-proof {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 18px;
  color: #4e5662;
  font-size: 12px;
  font-weight: 700;
}

.landing-proof span::before {
  margin-right: 7px;
  color: var(--ready);
  content: "OK";
  font-size: 9px;
  font-weight: 800;
}

.upload-panel {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 168px;
  border: 1px dashed #b9bec7;
  border-radius: 7px;
  background: var(--surface-subtle);
  padding: 24px 28px;
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.drop-zone input {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 68px;
  border: 1px solid #dcdfe4;
  border-radius: 5px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(33, 37, 44, 0.08);
}

.drop-zone h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
}

.drop-zone p {
  max-width: 560px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.upload-actions {
  display: grid;
  gap: 8px;
  min-width: 188px;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 750;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 0 14px;
  font-size: 12px;
}

.button-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button-primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: #343a43;
}

.button-secondary:hover {
  background: #f3f4f6;
}

.drop-zone small {
  grid-column: 2 / -1;
  color: #777e89;
  font-size: 11px;
}

#file-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-width: 0;
}

.file-status-name {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status-size {
  color: var(--muted);
}

.upload-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.upload-trust span {
  padding: 14px 18px;
}

.upload-trust span + span {
  border-left: 1px solid var(--line);
}

.upload-trust strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
}

.manual-fallback {
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.manual-fallback summary {
  cursor: pointer;
  padding: 13px 0;
  color: #454b55;
  font-size: 12px;
  font-weight: 750;
}

.manual-fallback label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.manual-fallback textarea {
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px;
}

.manual-fallback .button {
  margin: 10px 0 14px;
}

.processing-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  gap: 18px;
  padding: 16px 18px 0;
}

.extraction-live-status {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

.progress-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy strong {
  font-size: 12px;
}

.progress-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a4aab4;
}

.extraction-live-status[data-state="active"] .live-pulse {
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(240, 82, 69, 0.12);
}

.extraction-live-status[data-state="complete"] .live-pulse {
  background: var(--ready);
}

.progress-clock {
  color: #4d535d !important;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.extraction-meter {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 4px;
  background: #e6e8eb;
}

.extraction-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width 300ms ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: start;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-step {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #8a9099;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.pipeline-step span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
}

.pipeline-step.is-active,
.pipeline-step.is-done {
  color: var(--ink);
}

.pipeline-step.is-active span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.pipeline-step.is-done span {
  border-color: var(--ready);
  background: var(--ready-soft);
  color: var(--ready);
}

.status-line {
  grid-column: 1 / -1;
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.status-line[data-status="error"] {
  color: var(--blocked);
}

.landing-explanation {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
  gap: 48px;
  margin-top: 54px;
}

.content-section {
  scroll-margin-top: 76px;
}

.landing-explanation h2 {
  max-width: 340px;
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.15;
}

.explanation-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}

.explanation-steps article {
  padding: 18px;
}

.explanation-steps article + article {
  border-left: 1px solid var(--line);
}

.explanation-steps article > span {
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 800;
}

.explanation-steps strong {
  display: block;
  margin-top: 22px;
  font-size: 14px;
}

.explanation-steps p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.section-heading {
  max-width: 710px;
  margin-bottom: 28px;
}

.section-heading h2,
.quality-copy h2,
.faq-heading h2,
.resource-section h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 31px;
  line-height: 1.16;
}

.section-heading > p:last-child,
.quality-copy > p,
.faq-heading > p,
.resource-section > div > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.compact-heading {
  margin-bottom: 24px;
}

.capability-section,
.quality-section,
.formats-section,
.use-section,
.faq-section,
.resource-section {
  margin-top: 78px;
  border-top: 1px solid var(--line-strong);
  padding-top: 54px;
}

.capability-ledger {
  border-top: 1px solid var(--line-strong);
}

.capability-ledger article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 19px 4px;
}

.ledger-number {
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 800;
}

.capability-ledger h3,
.use-grid h3 {
  margin: 0;
  font-size: 14px;
}

.capability-ledger p,
.use-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.capability-ledger article > strong {
  color: #4e5662;
  font-size: 10px;
  text-align: right;
  text-transform: uppercase;
}

.quality-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.5fr);
  gap: 56px;
  align-items: start;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
}

.text-link:hover {
  text-decoration: underline;
}

.quality-table {
  border-top: 1px solid var(--line-strong);
}

.quality-row {
  display: grid;
  grid-template-columns: 0.75fr 1fr 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 15px 8px;
}

.quality-row span,
.quality-row strong {
  font-size: 11px;
  line-height: 1.45;
}

.quality-row span {
  color: var(--muted);
}

.quality-row-header {
  color: #555c67;
  font-weight: 800;
  text-transform: uppercase;
}

.quality-row-header span {
  color: inherit;
  font-size: 9px;
}

.format-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.format-matrix > div {
  min-height: 96px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 17px;
}

.format-matrix strong,
.format-matrix span {
  display: block;
}

.format-matrix strong {
  font-size: 13px;
}

.format-matrix span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}

.use-grid article {
  padding: 20px;
}

.use-grid article + article {
  border-left: 1px solid var(--line);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
  border: 1px solid var(--line-strong);
  background: #f8f9fa;
}

.trust-strip div {
  padding: 16px 18px;
}

.trust-strip div + div {
  border-left: 1px solid var(--line);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip strong {
  font-size: 11px;
}

.trust-strip span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.faq-section {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.45fr);
  gap: 60px;
  align-items: start;
}

.faq-heading {
  position: sticky;
  top: 86px;
}

.faq-list {
  border-top: 1px solid var(--line-strong);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: 18px 42px 18px 2px;
  font-size: 13px;
  font-weight: 750;
}

.faq-list summary::after {
  position: absolute;
  top: 15px;
  right: 6px;
  color: var(--muted);
  content: "+";
  font-size: 18px;
  font-weight: 400;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list p {
  margin: -2px 42px 20px 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.resource-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.6fr);
  gap: 56px;
}

.resource-links {
  border-top: 1px solid var(--line-strong);
}

.resource-links a {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 4px;
}

.resource-links a:hover strong {
  color: var(--brand-dark);
}

.resource-links strong {
  font-size: 12px;
}

.resource-links span {
  color: var(--muted);
  font-size: 11px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 40px;
  align-items: end;
  margin-top: 76px;
  border-top: 1px solid var(--line-strong);
  padding: 34px 0 0;
}

.footer-brand {
  width: max-content;
}

.site-footer p {
  max-width: 440px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
  color: #555c67;
  font-size: 11px;
  font-weight: 700;
}

.site-footer nav a:hover {
  color: var(--brand-dark);
}

body.workspace-mode {
  overflow: hidden;
  background: #eceef1;
}

body.workspace-mode .site-header,
body.workspace-mode .landing-view {
  display: none;
}

.results-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 620px;
  background: #eceef1;
}

.workspace-header {
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(430px, 1.5fr) auto;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line-strong);
  background: #fff;
  padding: 9px 14px;
}

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

.workspace-document div {
  min-width: 0;
}

.workspace-document span,
.workspace-document strong {
  display: block;
}

.workspace-document span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-document strong {
  max-width: 330px;
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exit-workspace-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #3d434d;
  font-size: 10px;
  font-weight: 750;
  padding: 0 10px;
}

.exit-workspace-button:hover {
  background: #f1f3f5;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-color: var(--line-strong);
  background: #fff;
  color: #3d434d;
  font-size: 15px;
}

.icon-button:hover {
  background: #f1f3f5;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(56px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.score-card {
  min-width: 0;
  background: #fafbfc;
  padding: 6px 8px;
  text-align: center;
}

.score-card strong,
.score-card span {
  display: block;
}

.score-card strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.score-card span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.workspace-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  padding-left: 12px;
}

.mobile-workspace-tabs {
  display: none;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 36%) minmax(300px, 30%) minmax(340px, 34%);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px 10px 0;
}

.workspace-pane {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.workspace-pane + .workspace-pane {
  border-left: 0;
}

.pdf-source-panel,
.reference-list-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
}

.pane-header h2,
.reference-detail > h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
}

.pane-header .pane-kicker {
  margin-bottom: 3px;
}

.pdf-page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdf-page-controls .icon-button {
  width: 30px;
  height: 30px;
}

#pdf-page-label {
  min-width: 58px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.pdf-source-status {
  min-height: 31px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  padding: 8px 12px;
}

.pdf-viewer {
  display: grid;
  place-items: start center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #d9dde2;
  padding: 18px;
}

.pdf-placeholder,
.pdf-canvas-wrap {
  position: relative;
  width: min(100%, 660px);
}

.sample-paper,
#pdf-canvas {
  display: block;
  width: 100%;
  border: 1px solid #c7cbd1;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 31, 37, 0.14);
}

.sample-paper {
  aspect-ratio: 0.76;
  padding: 10% 9%;
}

.sample-paper > span {
  display: block;
  margin-bottom: 8%;
  color: #4f5661;
  font-size: 11px;
  font-weight: 800;
}

.sample-paper i {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 10px;
  background: #e1e3e7;
}

.sample-paper i:nth-of-type(2),
.sample-paper i:nth-of-type(5) {
  width: 84%;
}

.sample-paper p {
  margin: 18% -2% 0;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  color: #4c515a;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
}

.sample-reference-page {
  min-height: 760px;
}

.sample-reference-page > span {
  margin-bottom: 28px;
}

.sample-reference-page p {
  margin: 0 0 15px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: transparent;
  color: #3f454e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1.55;
  padding: 8px 10px;
}

.sample-reference-page p.is-highlighted {
  border-color: rgba(240, 82, 69, 0.3);
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

.pdf-highlight-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pdf-highlight {
  position: absolute;
  border: 1px solid rgba(203, 57, 48, 0.55);
  border-radius: 2px;
  background: rgba(240, 82, 69, 0.21);
  mix-blend-mode: multiply;
}

.reference-list-header {
  align-items: flex-end;
}

.review-menu,
.export-menu {
  position: relative;
}

.review-menu summary,
.export-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  list-style: none;
  padding: 0 9px;
}

.review-menu summary::-webkit-details-marker,
.export-menu summary::-webkit-details-marker,
.utility-drawer > summary::-webkit-details-marker {
  display: none;
}

.review-menu-list,
.export-menu-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 210px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(30, 34, 40, 0.14);
}

.review-menu-list button,
.export-menu-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: #3a4049;
  font-size: 11px;
  padding: 10px;
  text-align: left;
}

.review-menu-list button:hover,
.review-menu-list button.is-active,
.export-menu-list button:hover {
  background: #f2f4f6;
}

.review-menu:not([open]) > .review-menu-list,
.export-menu:not([open]) > .export-menu-list {
  display: none !important;
}

.reference-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.reference-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  transition: background 120ms ease;
}

.reference-row:hover {
  background: #fafbfc;
}

.reference-row.is-selected {
  box-shadow: inset 3px 0 var(--brand);
  background: var(--brand-soft);
}

.reference-row input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.reference-row > div {
  min-width: 0;
}

.reference-row strong {
  display: block;
  color: #2c3139;
  font-size: 11px;
  line-height: 1.42;
}

.paper-order {
  display: inline-block;
  min-width: 19px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.reference-row p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.reference-row-meta > span {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #626975;
  font-size: 8px;
  font-weight: 700;
  padding: 3px 5px;
}

.status-pill[data-status="ready"] {
  border-color: #b9dfc9;
  background: var(--ready-soft);
  color: var(--ready);
}

.status-pill[data-status="review"] {
  border-color: #efd78f;
  background: var(--review-soft);
  color: var(--review);
}

.status-pill[data-status="unresolved"] {
  border-color: #efbebe;
  background: var(--blocked-soft);
  color: var(--blocked);
}

.reference-row-actions {
  display: none;
}

.reference-detail {
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 15px;
}

.reference-detail > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.reference-detail label {
  display: grid;
  gap: 5px;
  color: #535a65;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.reference-detail textarea,
.reference-detail input,
.citation-style-card input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.4;
  padding: 8px;
  text-transform: none;
}

.reference-detail textarea {
  min-height: 92px;
  resize: vertical;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-grid label:first-child,
.detail-grid label:nth-child(2),
.detail-grid label:last-child {
  grid-column: 1 / -1;
}

.detail-actions,
.panel-actions,
.review-command-bar,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-actions {
  margin-top: 12px;
}

.detail-actions button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: #343a43;
  font-size: 9px;
  font-weight: 750;
  padding: 0 9px;
}

.detail-actions button:first-child {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.reference-intelligence,
.match-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.reference-intelligence > strong {
  font-size: 11px;
}

.reference-intelligence details {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.reference-intelligence summary {
  cursor: pointer;
  color: #444b55;
  font-size: 10px;
  font-weight: 750;
}

.reference-intelligence ul,
.match-list ul {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  padding-left: 17px;
}

.status-explanation {
  border-left: 3px solid var(--line-strong);
  background: #f7f8f9;
  font-size: 10px;
  line-height: 1.45;
  padding: 9px;
}

.status-explanation[data-status="ready"] {
  border-color: var(--ready);
  background: var(--ready-soft);
}

.status-explanation[data-status="review"] {
  border-color: var(--review);
  background: var(--review-soft);
}

.status-explanation[data-status="unresolved"] {
  border-color: var(--blocked);
  background: var(--blocked-soft);
}

.status-explanation-header {
  display: grid;
  gap: 4px;
}

.status-explanation-header span {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-explanation-header p {
  margin: 0;
}

.status-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 9px 0;
  padding: 0;
  list-style: none;
}

.status-check-grid li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(102, 109, 121, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 8px;
  padding: 5px;
}

.status-check-grid strong {
  color: var(--ink);
}

.status-reason-block {
  border-top: 1px solid rgba(102, 109, 121, 0.18);
  margin-top: 8px;
  padding-top: 7px;
}

.status-reason-block > strong {
  font-size: 9px;
}

.status-reason-block ul {
  margin: 5px 0 0;
  padding-left: 16px;
}

.status-reason-block li {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.workspace-utilities {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 48px;
  margin: 0 10px 10px;
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: #fff;
}

.utility-drawer {
  position: static;
  min-width: 0;
}

.utility-drawer + .utility-drawer {
  border-left: 1px solid var(--line-strong);
}

.utility-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 47px;
  cursor: pointer;
  list-style: none;
  padding: 7px 12px;
}

.utility-drawer > summary span {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.utility-drawer > summary strong,
.utility-drawer > summary small {
  display: block;
}

.utility-drawer > summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-drawer > summary small {
  max-width: 560px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-content {
  position: absolute;
  right: -1px;
  bottom: 47px;
  left: -1px;
  max-height: min(68vh, 680px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 -18px 38px rgba(29, 33, 40, 0.14);
  padding: 18px;
}

.quality-gauge {
  color: var(--ready) !important;
  font-weight: 800;
}

.review-command-bar {
  margin: 14px 0;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.report-grid article {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 12px;
}

.report-grid article:nth-child(4) {
  border-right: 0;
}

.report-grid .official-report {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  border-right: 0;
}

.report-grid h3 {
  margin: 0 0 8px;
  font-size: 11px;
}

.report-grid ul,
.report-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  padding-left: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f8f9;
  color: #535b66;
  font-size: 9px;
  padding: 4px 6px;
}

.source-row {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  padding: 5px 0;
}

.source-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.citation-style-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 8px 18px;
  margin-bottom: 14px;
}

.citation-style-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

#pdf-style-preview {
  grid-column: 2;
  grid-row: 1 / span 4;
  margin: 0;
  border-left: 1px solid var(--line);
  color: #4e5560;
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 14px;
}

.pdf-style-result-row {
  position: relative;
}

.pdf-style-result-row.is-open {
  display: grid;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
}

.pdf-style-result-row button {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 10px;
  padding: 7px;
  text-align: left;
}

.export-actions {
  margin-bottom: 14px;
}

.export-menu summary {
  min-width: 150px;
}

.export-menu-list {
  right: auto;
  left: 0;
}

.export-preview {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.export-preview > summary {
  cursor: pointer;
  color: #454c56;
  font-size: 11px;
  font-weight: 750;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.output-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.output-grid textarea {
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 9px;
  padding: 8px;
}

.copy-confirmation {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  border-radius: 6px;
  background: #22262d;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  opacity: 0;
  padding: 9px 12px;
  transform: translateY(6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.copy-confirmation.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .workspace-header {
    grid-template-columns: minmax(180px, 1fr) minmax(330px, 1.4fr) auto;
  }

  .scorecard-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .workspace-grid {
    grid-template-columns: minmax(300px, 34%) minmax(280px, 32%) minmax(320px, 34%);
  }

  .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-grid article:nth-child(2n) {
    border-right: 0;
  }

  .report-grid .official-report {
    grid-column: 1 / -1;
  }
}

/* Workspace action intelligence v24 */
body.workspace-mode .workspace-document > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.workspace-mode .workspace-document strong {
  max-width: min(520px, 31vw) !important;
  margin-top: 0;
  font-size: 11px;
  line-height: 1.15;
}

body.workspace-mode .workspace-status-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(560px, 35vw);
  overflow: hidden;
  line-height: 1;
}

body.workspace-mode .workspace-status-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 16px;
  border: 1px solid #cbd8e8;
  border-radius: 999px;
  background: #f8fbff;
  color: #64748b;
  font-size: 8px;
  font-weight: 850;
  padding: 2px 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

body.workspace-mode .workspace-status-metrics b {
  color: #172033;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

body.workspace-mode .workspace-status-metrics [data-tone="ready"] {
  border-color: #a8dbc0;
  background: #edfbf4;
  color: #08764a;
}

body.workspace-mode .workspace-status-metrics [data-tone="resolve"] {
  border-color: #efb9bf;
  background: #fff0f2;
  color: #b4232d;
}

body.workspace-mode .workspace-status-metrics [data-tone="metadata"] {
  border-color: #afd0f4;
  background: #eef6ff;
  color: #245f9f;
}

body.workspace-mode .workspace-actions .workspace-action-button {
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 2px;
  min-width: 104px;
  padding: 4px 12px !important;
  line-height: 1;
}

body.workspace-mode .workspace-actions .workspace-action-button > span {
  font-size: 12px;
  line-height: 1;
}

body.workspace-mode .workspace-actions .workspace-action-button > small {
  display: block;
  color: #64748b;
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

body.workspace-mode .workspace-actions .workspace-action-button[aria-busy="true"] > small {
  color: #1d4ed8;
}

@media (max-width: 1180px) {
  body.workspace-mode .workspace-status-metrics span:nth-child(3) {
    display: none;
  }

  body.workspace-mode .workspace-actions .workspace-action-button {
    min-width: 92px;
    padding-inline: 9px !important;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-status-metrics {
    max-width: 100%;
  }
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: auto 1fr;
    padding: 0 14px;
  }

  .main-nav {
    justify-content: flex-end;
  }

  .main-nav a:nth-child(-n + 3),
  .header-tool-link,
  .version-mark {
    display: none;
  }

  .landing-view {
    padding: 24px 14px 54px;
  }

  .landing-copy {
    margin-bottom: 18px;
  }

  .landing-copy h1 {
    font-size: 36px;
  }

  .landing-lead {
    font-size: 14px;
  }

  .landing-proof {
    display: none;
  }

  .upload-panel {
    padding: 10px;
  }

  .drop-zone {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
    gap: 12px;
    padding: 17px;
  }

  .drop-zone h2 {
    font-size: 20px;
  }

  .drop-icon {
    width: 47px;
    height: 56px;
  }

  .upload-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .drop-zone small {
    grid-column: 1 / -1;
  }

  .upload-trust {
    display: none;
  }

  .processing-panel {
    grid-template-columns: 1fr;
    padding: 13px 8px 0;
  }

  .extraction-live-status {
    border-right: 0;
    padding-right: 0;
  }

  .pipeline {
    display: none;
  }

  .landing-explanation {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 38px;
  }

  .explanation-steps {
    grid-template-columns: 1fr;
  }

  .explanation-steps article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .capability-section,
  .quality-section,
  .formats-section,
  .use-section,
  .faq-section,
  .resource-section {
    margin-top: 58px;
    padding-top: 40px;
  }

  .quality-section,
  .faq-section,
  .resource-section {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .faq-heading {
    position: static;
  }

  .capability-ledger article {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .capability-ledger article > strong {
    grid-column: 2;
    text-align: left;
  }

  .format-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .use-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .use-grid article + article,
  .trust-strip div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .workspace-header .scorecard-grid {
    display: none;
  }

  .workspace-actions .button-secondary {
    display: none;
  }

  .mobile-workspace-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 42px;
    border-bottom: 1px solid var(--line-strong);
    background: #fff;
  }

  .mobile-workspace-tabs button {
    border: 0;
    border-bottom: 2px solid transparent;
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
  }

  .mobile-workspace-tabs button.is-active {
    border-bottom-color: var(--brand);
    color: var(--ink);
  }

  .workspace-grid {
    display: block;
    padding: 0;
  }

  .workspace-pane {
    display: none;
    width: 100%;
    height: 100%;
    border: 0;
  }

  .workspace-grid[data-mobile-panel="references"] [data-pane="references"],
  .workspace-grid[data-mobile-panel="source"] [data-pane="source"] {
    display: flex;
  }

  .workspace-grid[data-mobile-panel="details"] [data-pane="details"] {
    display: block;
  }

  .workspace-utilities {
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  .utility-drawer > summary {
    padding: 7px 9px;
  }

  .utility-drawer > summary small {
    display: none;
  }

  .utility-content {
    bottom: 47px;
    max-height: 72vh;
    padding: 12px;
  }

  .detail-grid,
  .citation-style-card,
  .output-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-grid article,
  .report-grid article:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-grid .official-report {
    grid-column: auto;
  }

  #pdf-style-preview {
    grid-column: auto;
    grid-row: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 14px;
  }

  .main-nav a {
    font-size: 10px;
  }

  .landing-copy h1 {
    font-size: 32px;
  }

  .drop-zone {
    padding: 14px;
  }

  .upload-actions {
    grid-template-columns: 1fr;
  }

  .workspace-document strong {
    max-width: 120px;
  }

  .exit-workspace-button {
    width: 34px;
    overflow: hidden;
    padding: 0 9px;
  }

  .exit-workspace-button span:last-child {
    display: none;
  }

  .workspace-actions {
    padding-left: 6px;
  }

  .workspace-actions .button {
    padding: 0 10px;
  }

  .section-heading h2,
  .quality-copy h2,
  .faq-heading h2,
  .resource-section h2 {
    font-size: 26px;
  }

  .quality-row {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .quality-row > :last-child {
    display: none;
  }

  .format-matrix {
    grid-template-columns: 1fr;
  }

  .resource-links a {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Visual refresh: restrained research product, with color tied to meaning. */

:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.34);
  outline-offset: 2px;
}

.site-header {
  min-height: 64px;
  border-bottom-color: #dfe5ed;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(26, 38, 56, 0.04);
  backdrop-filter: blur(14px);
}

.brand-mark {
  background: linear-gradient(145deg, var(--brand-bright), var(--brand));
  box-shadow: 0 7px 16px rgba(239, 63, 52, 0.22);
}

.version-mark {
  border: 1px solid #dbe2eb;
  border-radius: 4px;
  background: #f7f9fc;
  padding: 4px 6px;
}

.header-tool-link {
  border-color: #bdc8d5;
  box-shadow: 0 3px 9px rgba(31, 45, 63, 0.05);
}

.landing-view {
  position: relative;
  padding-top: 48px;
}

.landing-view::before {
  inset: 64px 0 auto;
  height: 560px;
  border-bottom-color: #e2e7ef;
  background:
    linear-gradient(rgba(36, 107, 159, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 107, 159, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #fff8f6 0%, #f8fbfe 52%, #f2f8fb 100%);
  background-size: 48px 48px, 48px 48px, auto;
}

.landing-copy {
  max-width: 830px;
  margin-bottom: 30px;
}

.landing-copy::before {
  display: block;
  width: 54px;
  height: 4px;
  margin: 0 auto 17px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-bright), #e29b35, var(--source));
  content: "";
}

.landing-copy h1 {
  color: #172033;
  text-wrap: balance;
}

.landing-lead {
  color: #566477;
}

.landing-proof {
  gap: 10px;
  margin-top: 20px;
}

.landing-proof span {
  border: 1px solid #dbe3ec;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  color: #425065;
  padding: 7px 10px;
  box-shadow: 0 4px 12px rgba(31, 45, 63, 0.04);
}

.landing-proof span::before {
  color: var(--ready);
  content: "✓";
}

.upload-panel {
  position: relative;
  overflow: hidden;
  border-color: #c9d3df;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 58px rgba(32, 46, 66, 0.13);
  padding: 0 18px 18px;
}

.upload-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-bright) 0 42%, #e9a13a 42% 67%, var(--source) 67%);
  content: "";
}

.upload-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid #e4e9f0;
  color: #5a6676;
  font-size: 10px;
  text-transform: uppercase;
}

.upload-panel-head span {
  color: var(--brand-dark);
  font-weight: 800;
}

.upload-panel-head strong {
  color: #39475a;
  font-size: 10px;
}

.drop-zone {
  grid-template-columns: 78px minmax(0, 1fr) auto;
  min-height: 192px;
  margin-top: 18px;
  border: 2px dashed #b9c5d3;
  background:
    linear-gradient(120deg, rgba(255, 241, 239, 0.84), rgba(255, 255, 255, 0.42) 45%),
    #f8fbfd;
  padding: 30px 34px;
}

.drop-zone:hover {
  border-color: #8fa1b5;
  background:
    linear-gradient(120deg, rgba(255, 238, 235, 0.9), rgba(255, 255, 255, 0.52) 48%),
    #f7fafc;
}

.drop-zone.is-dragging {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 3px rgba(239, 63, 52, 0.08);
}

.drop-icon {
  position: relative;
  width: 66px;
  height: 78px;
  border: 2px solid var(--brand-bright);
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 14px 28px rgba(49, 61, 78, 0.12);
}

.drop-icon::before {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 17px;
  height: 17px;
  border-bottom: 2px solid var(--brand-bright);
  border-left: 2px solid var(--brand-bright);
  background: #ffe3df;
  content: "";
}

.drop-zone h2 {
  color: #172033;
  font-size: 26px;
}

.drop-zone p {
  color: #5c697a;
}

.upload-actions {
  min-width: 210px;
}

.button {
  min-height: 42px;
  box-shadow: 0 2px 5px rgba(31, 43, 59, 0.04);
}

.button-primary {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-bright), var(--brand));
  box-shadow: 0 9px 20px rgba(239, 63, 52, 0.22);
}

.button-primary:hover {
  border-color: var(--brand-dark);
  background: linear-gradient(180deg, #df4d42, var(--brand-dark));
}

.button-secondary {
  border-color: #bfcad7;
  color: #29364a;
}

.upload-trust {
  grid-template-columns: repeat(4, 1fr);
  border-bottom-color: #e2e8ef;
}

.upload-trust span {
  position: relative;
  padding-left: 38px;
}

.upload-trust span::before {
  position: absolute;
  top: 17px;
  left: 17px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid #a9c9b8;
  border-radius: 50%;
  background: var(--ready-soft);
  color: var(--ready);
  content: "✓";
  font-size: 8px;
  font-weight: 800;
}

.upload-trust span:nth-child(2)::before {
  border-color: #a9c8dd;
  background: var(--source-soft);
  color: var(--source);
}

.upload-trust span:nth-child(3)::before {
  border-color: #ead298;
  background: var(--review-soft);
  color: var(--review);
}

.upload-trust span:nth-child(4)::before {
  border-color: #d8bcc3;
  background: var(--brand-soft);
  color: var(--brand);
}

.manual-fallback {
  background: #fbfcfe;
}

.processing-panel {
  margin-top: 2px;
  border-radius: 7px;
  background: #f6f8fb;
  padding: 15px 16px;
}

.extraction-live-status {
  border-right-color: #d9e1ea;
}

.pipeline {
  position: relative;
}

.pipeline::before {
  position: absolute;
  top: 11px;
  right: 8%;
  left: 8%;
  height: 1px;
  background: #cfd8e3;
  content: "";
}

.pipeline-step {
  position: relative;
  z-index: 1;
}

.pipeline-step span {
  border-color: #bcc8d5;
  box-shadow: 0 0 0 4px #f6f8fb;
}

.content-section {
  position: relative;
}

.landing-explanation {
  gap: 42px;
  margin-top: 64px;
  border: 1px solid #d5dde7;
  border-radius: 8px;
  background: linear-gradient(110deg, #fff6f4, #ffffff 43%, #f2f8fc);
  box-shadow: 0 14px 32px rgba(31, 45, 63, 0.07);
  padding: 26px;
}

.explanation-steps {
  position: relative;
  border-top: 0;
}

.explanation-steps::before {
  position: absolute;
  top: 29px;
  right: 16%;
  left: 16%;
  height: 1px;
  background: #cad5e1;
  content: "";
}

.explanation-steps article {
  position: relative;
  z-index: 1;
  padding: 8px 18px 12px;
}

.explanation-steps article + article {
  border-left: 0;
}

.explanation-steps article > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e6b1ab;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.9);
}

.explanation-steps article:nth-child(2) > span {
  border-color: #aac9de;
  color: var(--source);
}

.explanation-steps article:nth-child(3) > span {
  border-color: #a8ceb9;
  color: var(--ready);
}

.explanation-steps strong {
  margin-top: 15px;
}

.capability-section,
.quality-section,
.formats-section,
.use-section,
.faq-section,
.resource-section {
  border-top-color: #cfd8e3;
}

.capability-section::before,
.formats-section::before,
.use-section::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 78px;
  height: 3px;
  background: var(--brand-bright);
  content: "";
}

.formats-section::before {
  background: var(--source);
}

.use-section::before {
  background: var(--ready);
}

.capability-ledger {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  border-top: 0;
}

.capability-ledger article {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  min-height: 150px;
  border: 1px solid #dbe2eb;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 45, 63, 0.05);
  padding: 20px;
}

.capability-ledger article:nth-child(1) {
  border-top: 3px solid var(--brand-bright);
}

.capability-ledger article:nth-child(2) {
  border-top: 3px solid #db9a31;
}

.capability-ledger article:nth-child(3) {
  border-top: 3px solid var(--source);
}

.capability-ledger article:nth-child(4) {
  border-top: 3px solid var(--ready);
}

.ledger-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
}

.capability-ledger article:nth-child(2) .ledger-number {
  background: var(--review-soft);
  color: var(--review);
}

.capability-ledger article:nth-child(3) .ledger-number {
  background: var(--source-soft);
  color: var(--source);
}

.capability-ledger article:nth-child(4) .ledger-number {
  background: var(--ready-soft);
  color: var(--ready);
}

.capability-ledger article > strong {
  grid-column: 2;
  margin-top: auto;
  text-align: left;
}

.quality-section {
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  background: linear-gradient(110deg, #f1f8fc, #ffffff 42%);
  padding: 34px;
}

.quality-copy {
  border-left: 4px solid var(--source);
  padding-left: 20px;
}

.quality-table {
  overflow: hidden;
  border: 1px solid #cfd9e4;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 45, 63, 0.07);
}

.quality-row {
  border-bottom-color: #e2e7ee;
  padding: 16px 14px;
}

.quality-row:not(.quality-row-header):nth-child(2) {
  box-shadow: inset 3px 0 var(--brand-bright);
}

.quality-row:not(.quality-row-header):nth-child(3) {
  box-shadow: inset 3px 0 var(--source);
}

.quality-row:not(.quality-row-header):nth-child(4) {
  box-shadow: inset 3px 0 #d59a34;
}

.quality-row:not(.quality-row-header):nth-child(5) {
  box-shadow: inset 3px 0 var(--ready);
}

.quality-row-header {
  background: #f3f6fa;
}

.format-matrix {
  gap: 10px;
  border: 0;
}

.format-matrix > div {
  position: relative;
  min-height: 106px;
  border: 1px solid #d9e1ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(31, 45, 63, 0.045);
  padding: 20px 17px 17px;
}

.format-matrix > div::before {
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 13px;
  border-radius: 3px;
  background: var(--brand-bright);
  content: "";
}

.format-matrix > div:nth-child(4n + 2)::before {
  background: #d8942d;
}

.format-matrix > div:nth-child(4n + 3)::before {
  background: var(--source);
}

.format-matrix > div:nth-child(4n + 4)::before {
  background: var(--ready);
}

.use-grid {
  gap: 12px;
  border-top: 0;
}

.use-grid article {
  min-height: 148px;
  border: 1px solid #d9e1ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(31, 45, 63, 0.045);
  padding: 22px;
}

.use-grid article + article {
  border-left: 1px solid #d9e1ea;
}

.use-grid article::before {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  border-radius: 7px;
  background: var(--source-soft);
  color: var(--source);
  content: "01";
  font-size: 9px;
  font-weight: 800;
}

.use-grid article:nth-child(2)::before {
  background: var(--brand-soft);
  color: var(--brand);
  content: "02";
}

.use-grid article:nth-child(3)::before {
  background: var(--ready-soft);
  color: var(--ready);
  content: "03";
}

.trust-strip {
  overflow: hidden;
  border-color: #d0d9e4;
  border-radius: 7px;
  background: linear-gradient(90deg, #f7fafc, #fffaf8);
}

.faq-list {
  overflow: hidden;
  border: 1px solid #d5dee8;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(31, 45, 63, 0.05);
}

.faq-list details {
  border-bottom-color: #e1e7ee;
  padding-inline: 16px;
}

.faq-list details[open] {
  background: #fbfcfe;
}

.faq-list summary::after {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #cdd7e2;
  border-radius: 50%;
  color: var(--source);
  font-size: 15px;
}

.resource-links {
  overflow: hidden;
  border: 1px solid #d5dee8;
  border-radius: 7px;
  background: #fff;
}

.resource-links a {
  position: relative;
  border-bottom-color: #e1e7ee;
  padding: 17px 38px 17px 18px;
}

.resource-links a::after {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--source);
  content: "→";
  font-size: 16px;
  transform: translateY(-50%);
}

.site-footer {
  border-top-color: #cfd8e3;
}

body.workspace-mode {
  background: #eaf1fb;
}

.results-panel {
  background: linear-gradient(180deg, #f7faff 0%, #eaf1fb 100%);
}

.results-panel::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 60;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-bright) 0 36%, #f2a51a 36% 58%, var(--source) 58% 80%, var(--ready) 80%);
  content: "";
}

.workspace-header {
  min-height: 68px;
  border-bottom-color: #c7d5e6;
  box-shadow: 0 5px 16px rgba(30, 43, 60, 0.06);
  padding-top: 11px;
}

.exit-workspace-button,
.icon-button {
  border-color: #b8c8dc;
  box-shadow: 0 2px 6px rgba(31, 45, 63, 0.05);
}

.scorecard-grid {
  gap: 6px;
  border: 0;
  background: transparent;
}

.score-card {
  border: 1px solid #ccd8e7;
  border-radius: 6px;
  background: #f7faff;
  padding: 7px 8px;
}

.score-card:nth-child(2) {
  border-color: #a9ddc1;
  background: var(--ready-soft);
}

.score-card:nth-child(3) {
  border-color: #aed0f5;
  background: var(--source-soft);
}

.score-card:nth-child(4) {
  border-color: #a9ddc1;
  background: var(--ready-soft);
}

.score-card:nth-child(5) {
  border-color: #f0ce76;
  background: var(--review-soft);
}

.score-card:nth-child(6) {
  border-color: #efb8bd;
  background: var(--blocked-soft);
}

.workspace-grid {
  grid-template-columns: minmax(360px, 36%) minmax(300px, 30%) minmax(340px, 34%);
  gap: 9px;
  padding: 11px 11px 0;
}

.workspace-pane {
  overflow: hidden;
  border-color: #c4d3e5;
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(31, 45, 63, 0.07);
}

.workspace-pane + .workspace-pane {
  border-left: 1px solid #c4d3e5;
}

.pane-header {
  min-height: 66px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.pdf-source-panel .pane-header {
  box-shadow: inset 0 3px var(--source);
}

.reference-list-pane .pane-header {
  box-shadow: inset 0 3px var(--brand-bright);
}

.reference-detail {
  box-shadow: inset 0 3px #f2a51a, 0 8px 22px rgba(31, 45, 63, 0.07);
}

.pane-kicker {
  color: var(--source);
}

.reference-list-pane .pane-kicker {
  color: var(--brand-dark);
}

.pdf-source-status {
  border-bottom-color: #d4e2f1;
  background: var(--source-soft);
  color: #315f8f;
}

.pdf-viewer {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #2b456d;
  background-size: 26px 26px;
}

.sample-paper,
#pdf-canvas {
  border-color: #abb5c1;
  box-shadow: 0 14px 34px rgba(11, 18, 28, 0.28);
}

.reference-row {
  border-bottom-color: #dbe4ef;
  padding: 13px 12px;
}

.reference-row:hover {
  background: #f5f9ff;
}

.reference-row.is-selected {
  border-top: 1px solid rgba(239, 63, 52, 0.35);
  border-bottom-color: rgba(239, 63, 52, 0.35);
  box-shadow: inset 4px 0 var(--brand-bright);
  background: linear-gradient(90deg, #ffedeb, #fff8f7 72%);
}

.reference-row-meta > span {
  border-color: #cfdbea;
  background: #f7faff;
}

.reference-detail textarea,
.reference-detail input,
.citation-style-card input {
  border-color: #b9c9dc;
  background: #f9fbff;
}

.reference-detail textarea:focus,
.reference-detail input:focus,
.citation-style-card input:focus {
  border-color: var(--source);
  background: #fff;
}

.status-explanation {
  border: 1px solid #d0dbe9;
  border-left: 4px solid var(--line-strong);
  border-radius: 6px;
}

.detail-actions button:first-child {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-bright), var(--brand));
}

.workspace-utilities {
  gap: 8px;
  margin: 8px 11px 11px;
  border: 0;
  background: transparent;
}

.utility-drawer {
  border: 1px solid #c4d3e5;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(31, 45, 63, 0.05);
}

.utility-drawer + .utility-drawer {
  border-left: 1px solid #c4d3e5;
}

.utility-drawer:first-child {
  box-shadow: inset 0 3px var(--source), 0 5px 15px rgba(31, 45, 63, 0.05);
}

.utility-drawer:last-child {
  box-shadow: inset 0 3px var(--ready), 0 5px 15px rgba(31, 45, 63, 0.05);
}

.utility-content {
  border-color: #c2d0e1;
  border-radius: 7px 7px 0 0;
}

.report-grid {
  overflow: hidden;
  border-color: #cedae9;
  border-radius: 6px;
}

.report-grid article:nth-child(1) {
  background: var(--source-soft);
}

.report-grid article:nth-child(2) {
  background: var(--review-soft);
}

.report-grid article:nth-child(3) {
  background: #f4f8ff;
}

.report-grid article:nth-child(4) {
  background: var(--ready-soft);
}

@media (max-width: 820px) {
  .site-header {
    min-height: 58px;
  }

  .landing-view {
    padding-top: 28px;
  }

  .landing-view::before {
    inset: 58px 0 auto;
    height: 540px;
  }

  .landing-copy::before {
    margin-bottom: 13px;
  }

  .landing-proof {
    display: flex;
    gap: 6px;
  }

  .landing-proof span {
    font-size: 9px;
    padding: 5px 7px;
  }

  .upload-panel {
    padding: 0 10px 10px;
  }

  .upload-panel-head {
    min-height: 42px;
    padding-inline: 4px;
  }

  .drop-zone {
    grid-template-columns: 56px minmax(0, 1fr);
    margin-top: 10px;
    padding: 18px;
  }

  .drop-icon {
    width: 50px;
    height: 60px;
  }

  .upload-trust {
    grid-template-columns: repeat(2, 1fr);
  }

  .upload-trust span {
    padding: 12px 10px 12px 32px;
  }

  .upload-trust span:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .upload-trust span:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .upload-trust span::before {
    top: 15px;
    left: 10px;
  }

  .processing-panel {
    margin-top: 0;
  }

  .landing-explanation {
    padding: 22px;
  }

  .explanation-steps::before {
    display: none;
  }

  .capability-ledger {
    grid-template-columns: 1fr;
  }

  .capability-ledger article {
    min-height: 0;
  }

  .quality-section {
    padding: 24px;
  }

  .workspace-grid {
    gap: 0;
    padding: 0;
  }

  .workspace-pane,
  .workspace-pane + .workspace-pane {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .workspace-utilities {
    gap: 0;
    margin: 0;
  }

  .utility-drawer {
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .landing-proof {
    display: none;
  }

  .upload-panel-head strong {
    display: none;
  }

  .drop-zone {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 15px;
  }

  .drop-icon {
    width: 43px;
    height: 52px;
    font-size: 10px;
  }

  .drop-zone h2 {
    font-size: 20px;
  }

  .upload-trust {
    display: grid;
  }

  .upload-trust strong {
    font-size: 10px;
  }

  .upload-trust span {
    font-size: 9px;
  }

  .landing-explanation,
  .quality-section {
    padding: 18px;
  }

  .format-matrix {
    gap: 8px;
  }
}

/* Flat pre-upload refinement. The review workspace is intentionally unchanged. */

body:not(.workspace-mode) {
  background: #edf3fb;
}

body:not(.workspace-mode) .site-header {
  border-bottom-color: #d2ddeb;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

body:not(.workspace-mode) .brand-mark {
  background: var(--brand);
  box-shadow: none;
}

body:not(.workspace-mode) .version-mark,
body:not(.workspace-mode) .header-tool-link {
  box-shadow: none;
}

body:not(.workspace-mode) .landing-view::before {
  display: none;
}

body:not(.workspace-mode) .landing-copy::before {
  background: var(--brand);
}

body:not(.workspace-mode) .landing-proof span {
  border-color: #c7d5e6;
  background: #f7faff;
  box-shadow: none;
}

body:not(.workspace-mode) .upload-panel {
  border-color: #b9c9dc;
  background: #ffffff;
  box-shadow: none;
}

body:not(.workspace-mode) .upload-panel::before {
  background: var(--brand);
}

body:not(.workspace-mode) .upload-panel-head {
  border-bottom-color: #d6e1ee;
}

body:not(.workspace-mode) .drop-zone,
body:not(.workspace-mode) .drop-zone:hover {
  border-color: #a9bbd1;
  background: #f7faff;
}

body:not(.workspace-mode) .drop-zone:hover {
  border-color: #6f91bc;
  background: #f1f6ff;
}

body:not(.workspace-mode) .drop-zone.is-dragging {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: none;
}

body:not(.workspace-mode) .drop-icon {
  border-color: var(--brand);
  box-shadow: none;
}

body:not(.workspace-mode) .drop-icon::before {
  border-color: var(--brand);
  background: #ffd9d5;
}

body:not(.workspace-mode) .button {
  box-shadow: none;
}

body:not(.workspace-mode) .button-primary,
body:not(.workspace-mode) .button-primary:hover {
  background: var(--brand);
  box-shadow: none;
}

body:not(.workspace-mode) .button-primary:hover {
  background: var(--brand-dark);
}

body:not(.workspace-mode) .button-secondary:hover {
  background: #edf4ff;
}

body:not(.workspace-mode) .upload-trust {
  background: #ffffff;
}

body:not(.workspace-mode) .manual-fallback,
body:not(.workspace-mode) .processing-panel {
  background: #f2f6fc;
}

body:not(.workspace-mode) .landing-explanation {
  border-color: #c5d3e3;
  background: #ffffff;
  box-shadow: none;
}

body:not(.workspace-mode) .explanation-steps article > span {
  border-color: #ffc0ba;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 0 0 7px #ffffff;
}

body:not(.workspace-mode) .explanation-steps article:nth-child(2) > span {
  border-color: #9fc7f5;
  background: var(--source-soft);
  color: var(--source);
}

body:not(.workspace-mode) .explanation-steps article:nth-child(3) > span {
  border-color: #9cd9b9;
  background: var(--ready-soft);
  color: var(--ready);
}

body:not(.workspace-mode) .capability-ledger article,
body:not(.workspace-mode) .format-matrix > div,
body:not(.workspace-mode) .use-grid article {
  border-color: #c8d5e5;
  background: #ffffff;
  box-shadow: none;
}

body:not(.workspace-mode) .capability-ledger article:nth-child(1) {
  border-top-color: var(--brand-bright);
}

body:not(.workspace-mode) .capability-ledger article:nth-child(2) {
  border-top-color: #f2a51a;
}

body:not(.workspace-mode) .capability-ledger article:nth-child(3) {
  border-top-color: var(--source);
}

body:not(.workspace-mode) .capability-ledger article:nth-child(4) {
  border-top-color: var(--ready);
}

body:not(.workspace-mode) .ledger-number {
  background: var(--brand-soft);
  color: var(--brand);
}

body:not(.workspace-mode) .capability-ledger article:nth-child(2) .ledger-number {
  background: var(--review-soft);
  color: var(--review);
}

body:not(.workspace-mode) .capability-ledger article:nth-child(3) .ledger-number {
  background: var(--source-soft);
  color: var(--source);
}

body:not(.workspace-mode) .capability-ledger article:nth-child(4) .ledger-number {
  background: var(--ready-soft);
  color: var(--ready);
}

body:not(.workspace-mode) .quality-section {
  border-color: #b9cee7;
  background: #f5f9ff;
}

body:not(.workspace-mode) .quality-table {
  border-color: #c1d1e3;
  box-shadow: none;
}

body:not(.workspace-mode) .quality-row-header {
  background: #eaf3ff;
}

body:not(.workspace-mode) .format-matrix > div::before {
  background: var(--brand-bright);
}

body:not(.workspace-mode) .format-matrix > div:nth-child(4n + 2)::before {
  background: #f2a51a;
}

body:not(.workspace-mode) .format-matrix > div:nth-child(4n + 3)::before {
  background: var(--source);
}

body:not(.workspace-mode) .format-matrix > div:nth-child(4n + 4)::before {
  background: var(--ready);
}

body:not(.workspace-mode) .use-grid article::before {
  background: var(--source-soft);
  color: var(--source);
}

body:not(.workspace-mode) .use-grid article:nth-child(2)::before {
  background: var(--brand-soft);
  color: var(--brand);
}

body:not(.workspace-mode) .use-grid article:nth-child(3)::before {
  background: var(--ready-soft);
  color: var(--ready);
}

body:not(.workspace-mode) .trust-strip {
  border-color: #c4d2e3;
  background: #f5f8ff;
}

body:not(.workspace-mode) .faq-list,
body:not(.workspace-mode) .resource-links {
  border-color: #c4d2e3;
  background: #ffffff;
  box-shadow: none;
}

body:not(.workspace-mode) .faq-list details[open] {
  background: #f3f7ff;
}

body:not(.workspace-mode) .site-footer {
  border-top-color: #c2d0e1;
}

body:not(.workspace-mode) .upload-panel {
  padding-top: 18px;
}

body:not(.workspace-mode) .upload-trust {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body:not(.workspace-mode) .after-extraction-accent {
  color: var(--brand-dark);
}

body:not(.workspace-mode) .capability-ledger article {
  grid-template-columns: auto minmax(0, 1fr);
}

body:not(.workspace-mode) .quality-row:not(.quality-row-header) {
  box-shadow: none;
}

@media (max-width: 760px) {
  body:not(.workspace-mode) .upload-trust {
    grid-template-columns: 1fr;
  }
}

/* Goal-oriented content revision. */

.upload-guidance {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.upload-guidance span,
.upload-guidance a {
  display: inline-flex;
  gap: 5px;
}

.upload-guidance strong {
  color: var(--ink);
}

.upload-guidance a {
  color: var(--source);
  font-weight: 600;
}

.upload-guidance a:hover {
  text-decoration: underline;
}

.workflow-ledger {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-ledger article {
  min-height: 164px;
}

.workflow-ledger article:nth-child(5) {
  border-top: 3px solid #8b5cf6;
}

.workflow-ledger article:nth-child(5) .ledger-number {
  background: #f2edff;
  color: #6941c6;
}

.workflow-ledger article:nth-child(6) {
  border-top: 3px solid var(--brand);
}

.workflow-ledger article:nth-child(6) .ledger-number {
  background: var(--brand-soft);
  color: var(--brand);
}

.destination-matrix {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.destination-matrix > div {
  min-height: 144px;
}

.destination-matrix > div:nth-child(1)::before {
  background: var(--source);
}

.destination-matrix > div:nth-child(2)::before {
  background: var(--brand);
}

.destination-matrix > div:nth-child(3)::before {
  background: var(--ready);
}

.faq-list p a {
  color: var(--source);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.final-action-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--line-strong);
  padding: 32px 0;
}

.final-action-section h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
}

.final-action-section p:last-child {
  max-width: 650px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.final-action-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.final-action-buttons .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 164px;
}

@media (max-width: 980px) {
  .workflow-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .upload-guidance {
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 5px;
  }

  .workflow-ledger,
  .destination-matrix {
    grid-template-columns: 1fr;
  }

  .workflow-ledger article,
  .destination-matrix > div {
    min-height: 0;
  }

  .final-action-section {
    align-items: stretch;
    flex-direction: column;
  }

  .final-action-buttons {
    flex-direction: column;
  }

  .final-action-buttons .button {
    width: 100%;
  }
}

/* Workflow clarity and footer revision. */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

body:not(.workspace-mode) .processing-panel {
  padding-bottom: 16px;
}

.post-upload-flow {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(0, 2fr);
  gap: 44px;
  align-items: start;
  margin-top: 26px;
  padding: 22px 4px 24px;
}

.post-upload-flow-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.25;
}

.post-upload-flow ol {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-upload-flow ol::before {
  position: absolute;
  top: 17px;
  right: 15%;
  left: 15%;
  height: 1px;
  background: #becde0;
  content: "";
}

.post-upload-flow li {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 0 18px;
}

.post-upload-flow li + li {
  border-left: 1px solid #d5dfeb;
}

.flow-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #ffaba3;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.post-upload-flow li:nth-child(2) .flow-number {
  border-color: #93bff0;
  color: var(--source);
}

.post-upload-flow li:nth-child(3) .flow-number {
  border-color: #8fd2ae;
  color: var(--ready);
}

.post-upload-flow h3 {
  margin: 1px 0 5px;
  font-size: 13px;
}

.post-upload-flow li p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.workflow-ledger {
  align-items: start;
}

.workflow-ledger article {
  align-self: start;
  min-height: 0;
  padding: 16px 17px;
}

body:not(.workspace-mode) .workflow-ledger article:nth-child(5) {
  border-top-color: #8b5cf6;
}

body:not(.workspace-mode) .workflow-ledger article:nth-child(6) {
  border-top-color: var(--brand);
}

.final-action-section {
  margin-top: 30px;
}

.site-footer {
  display: block;
  width: 100vw;
  margin: 76px 0 -72px calc(50% - 50vw);
  border-top: 4px solid var(--brand);
  background: #171c26;
  color: #fff;
  padding: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.55fr);
  gap: 64px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 54px 24px 60px;
}

.footer-brand-block,
.footer-nav {
  min-width: 0;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}

.site-footer .footer-logo strong {
  color: #fff;
  font-family: var(--display);
  font-size: 24px;
}

.site-footer .footer-brand-block p {
  max-width: 300px;
  margin: 18px 0 0;
  color: #bec7d5;
  font-size: 13px;
  line-height: 1.6;
}

.footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 24px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #fff;
  color: #171c26;
  font-size: 12px;
  font-weight: 800;
  padding: 0 17px;
}

.footer-button:hover {
  background: #eef3f8;
}

.site-footer .footer-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  color: inherit;
}

.footer-nav > div {
  display: grid;
  align-content: start;
  gap: 11px;
}

.footer-heading {
  margin-bottom: 2px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-footer .footer-nav a {
  color: #c7cfdb;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.site-footer .footer-nav a:hover {
  color: #fff;
}

@media (max-width: 980px) {
  .post-upload-flow {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 760px) {
  .post-upload-flow {
    margin-top: 20px;
    padding: 20px 2px 10px;
  }

  .post-upload-flow ol {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .post-upload-flow ol::before {
    top: 17px;
    bottom: 17px;
    left: 17px;
    width: 1px;
    height: auto;
  }

  .post-upload-flow li {
    padding: 0 0 20px;
  }

  .post-upload-flow li + li {
    border-left: 0;
  }

  .post-upload-flow li:last-child {
    padding-bottom: 0;
  }

  .footer-inner {
    padding: 42px 24px 48px;
  }

  .site-footer .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 22px;
  }
}

@media (max-width: 460px) {
  .site-footer .footer-nav {
    grid-template-columns: 1fr;
  }
}

/* Workspace usability pass: compact controls, side panels, and source zoom. */

body.workspace-mode .results-panel {
  --workspace-header-height: 62px;
}

body.workspace-mode .workspace-header {
  grid-template-columns: minmax(230px, 0.82fr) minmax(380px, 1.35fr) auto;
  gap: 12px;
  min-height: var(--workspace-header-height);
  padding: 8px 12px;
}

body.workspace-mode .workspace-document strong {
  max-width: 420px;
  font-size: 12px;
}

body.workspace-mode .scorecard-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

body.workspace-mode .score-card {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 5px;
  min-height: 28px;
  min-width: 0;
  border: 1px solid #cbd8e8;
  border-radius: 999px;
  background: #f8fbff;
  color: #263247;
  cursor: default;
  font: inherit;
  padding: 4px 9px;
  text-align: left;
}

body.workspace-mode button.score-card {
  cursor: pointer;
}

body.workspace-mode button.score-card:hover,
body.workspace-mode .score-card.is-active {
  border-color: var(--source);
  background: #eef6ff;
}

body.workspace-mode .score-card strong {
  color: #172033;
  font-size: 13px;
  line-height: 1;
}

body.workspace-mode .score-card span {
  margin: 0;
  color: #637187;
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

body.workspace-mode .score-card[data-tone="ready"] {
  border-color: #a8dbc0;
  background: #edfbf4;
}

body.workspace-mode .score-card[data-tone="review"] {
  border-color: #f0cd74;
  background: #fff7df;
}

body.workspace-mode .score-card[data-tone="unresolved"] {
  border-color: #efb9bf;
  background: #fff0f2;
}

body.workspace-mode .score-card[data-tone="identifier"] {
  border-color: #afd0f4;
  background: #eef6ff;
}

body.workspace-mode .workspace-actions {
  gap: 6px;
  padding-left: 0;
}

body.workspace-mode .workspace-actions .button {
  min-height: 34px;
  white-space: nowrap;
}

body.workspace-mode .workspace-actions #workspace-enrich-button,
body.workspace-mode .workspace-actions #workspace-match-button {
  border-color: #b9c9dc;
  background: #f7faff;
}

body.workspace-mode .workspace-actions #workspace-quality-button {
  border-color: #b8dec8;
  background: #f0fbf5;
  color: #08764a;
}

body.workspace-mode .workspace-grid {
  grid-template-columns: minmax(340px, 35%) minmax(320px, 31%) minmax(360px, 34%);
  padding-bottom: 11px;
}

body.workspace-mode.pdf-focus-mode .workspace-grid {
  grid-template-columns: minmax(520px, 51%) minmax(290px, 25%) minmax(300px, 24%);
}

body.workspace-mode .workspace-pane {
  min-height: 0;
}

body.workspace-mode .reference-detail {
  display: block;
  height: 100%;
  max-height: calc(100vh - var(--workspace-header-height) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px;
}

body.workspace-mode .reference-detail > .pane-kicker,
body.workspace-mode .reference-detail > .eyebrow,
body.workspace-mode .reference-detail > h2,
body.workspace-mode .reference-detail > h3 {
  position: sticky;
  z-index: 2;
  background: linear-gradient(180deg, #fff 74%, rgba(255, 255, 255, 0));
}

body.workspace-mode .reference-detail > .pane-kicker,
body.workspace-mode .reference-detail > .eyebrow {
  top: -16px;
  margin: -16px -16px 0;
  padding: 14px 16px 4px;
}

body.workspace-mode .reference-detail > h2,
body.workspace-mode .reference-detail > h3 {
  top: 14px;
  margin: 0 -16px 12px;
  padding: 0 16px 12px;
  border-bottom: 1px solid #e0e8f1;
}

body.workspace-mode .detail-actions {
  position: sticky;
  bottom: -16px;
  z-index: 3;
  margin: 14px -16px 12px;
  border-top: 1px solid #d9e3ee;
  border-bottom: 1px solid #d9e3ee;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 16px;
  backdrop-filter: blur(8px);
}

body.workspace-mode .detail-actions button,
body.workspace-mode .review-command-bar .button {
  min-height: 32px;
  border: 1px solid #b9c9dc;
  border-radius: 6px;
  background: #fff;
  color: #263247;
  font-size: 10px;
  font-weight: 750;
  padding: 0 10px;
}

body.workspace-mode .detail-actions button:first-child {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.pdf-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border-bottom: 1px solid #d7e2ee;
  background: #f8fbff;
  padding: 6px 12px;
}

.tool-button {
  min-height: 26px;
  border: 1px solid #b8c8dc;
  border-radius: 5px;
  background: #fff;
  color: #273247;
  font-size: 10px;
  font-weight: 750;
  padding: 0 9px;
}

.tool-button:hover {
  background: #edf5ff;
}

#pdf-zoom-label {
  min-width: 42px;
  color: #526176;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: center;
}

#pdf-focus-button {
  margin-left: auto;
}

body.workspace-mode.pdf-focus-mode #pdf-focus-button {
  border-color: var(--source);
  background: var(--source-soft);
  color: var(--source);
}

body.workspace-mode .pdf-viewer {
  scroll-behavior: smooth;
}

body.workspace-mode .workspace-utilities {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 80;
  display: block;
  width: 0;
  height: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

body.workspace-mode .utility-drawer {
  position: static;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.workspace-mode .utility-drawer > summary {
  display: none;
}

body.workspace-mode .utility-content {
  position: fixed;
  top: calc(var(--workspace-header-height) + 10px);
  right: 12px;
  bottom: 12px;
  left: auto;
  width: min(720px, calc(100vw - 24px));
  max-height: none;
  overflow: auto;
  border: 1px solid #bfcfe2;
  border-radius: 8px;
  background: #fff;
  box-shadow: -18px 0 42px rgba(25, 36, 54, 0.18);
  padding: 16px;
}

body.workspace-mode .utility-drawer[open]::before {
  position: fixed;
  inset: var(--workspace-header-height) 0 0;
  z-index: -1;
  background: rgba(17, 24, 39, 0.12);
  content: "";
}

.utility-panel-head {
  position: sticky;
  top: -16px;
  z-index: 4;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin: -16px -16px 16px;
  border-bottom: 1px solid #d9e3ee;
  background: rgba(255, 255, 255, 0.98);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.utility-panel-head strong,
.utility-panel-head span {
  display: block;
}

.utility-panel-head strong {
  color: var(--ink);
  font-size: 14px;
}

.utility-panel-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.utility-close-button {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

body.workspace-mode .review-command-bar {
  position: sticky;
  top: 58px;
  z-index: 3;
  margin: 0 0 14px;
  border: 1px solid #d4dfeb;
  border-radius: 7px;
  background: #f8fbff;
  padding: 9px;
}

body.workspace-mode .report-grid {
  border-color: #d1ddea;
  border-radius: 7px;
  overflow: hidden;
}

body.workspace-mode .citation-style-card {
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1fr);
  border: 1px solid #d5e0ec;
  border-radius: 7px;
  background: #f8fbff;
  padding: 12px;
}

body.workspace-mode .export-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

body.workspace-mode .export-menu summary {
  min-width: 150px;
  border-color: #b9c9dc;
  background: #fff;
}

@media (max-width: 1180px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) auto;
  }

  body.workspace-mode .workspace-actions #workspace-enrich-button,
  body.workspace-mode .workspace-actions #workspace-match-button {
    display: none;
  }

  body.workspace-mode .score-card span {
    display: none;
  }
}

@media (max-width: 980px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.workspace-mode .scorecard-grid {
    display: none;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-actions #workspace-quality-button {
    display: inline-flex !important;
  }

  body.workspace-mode .workspace-actions #copy-summary-button {
    display: none;
  }

  body.workspace-mode .reference-detail {
    max-height: calc(100vh - 150px);
  }

  body.workspace-mode .utility-content {
    top: 96px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    padding: 13px;
  }

  body.workspace-mode .citation-style-card,
  body.workspace-mode .report-grid {
    grid-template-columns: 1fr;
  }

  .pdf-tools {
    flex-wrap: wrap;
  }

#pdf-focus-button {
    margin-left: 0;
  }
}

/* Right review pane: compact, non-overlapping workspace layout */
body.workspace-mode .reference-detail {
  display: block;
  height: 100%;
  max-height: calc(100vh - var(--workspace-header-height) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0;
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
}

body.workspace-mode .reference-detail > .pane-kicker,
body.workspace-mode .reference-detail > .eyebrow,
body.workspace-mode .reference-detail > h2,
body.workspace-mode .reference-detail > h3 {
  position: static !important;
  z-index: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.detail-empty-state {
  padding: 18px;
}

.detail-review-header {
  border-bottom: 1px solid #dbe5ef;
  background: #fff;
  padding: 16px 18px 12px;
}

.detail-kicker {
  margin: 0 0 5px;
  color: #56677f;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-review-header h3,
.detail-empty-state h3 {
  margin: 0;
  color: #111827;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.1;
}

.detail-review-subtitle,
.detail-empty-state p:last-child {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: #607087;
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.workspace-mode .status-explanation {
  margin: 12px 18px 0;
  border: 1px solid #d7e2ee;
  border-left: 4px solid #7c8da3;
  border-radius: 7px;
  background: #f8fbff;
  padding: 12px;
  color: #273247;
  font-size: 11px;
  line-height: 1.45;
}

body.workspace-mode .status-explanation[data-status="ready"] {
  border-color: #b7e0c7;
  border-left-color: #07824f;
  background: #f0fbf5;
}

body.workspace-mode .status-explanation[data-status="review"] {
  border-color: #f0ce81;
  border-left-color: #c47400;
  background: #fff7dc;
}

body.workspace-mode .status-explanation[data-status="unresolved"] {
  border-color: #f3b8b8;
  border-left-color: #ef3b32;
  background: #fff2f2;
}

body.workspace-mode .status-explanation-header {
  display: grid;
  gap: 5px;
}

body.workspace-mode .status-explanation-header span {
  color: #263247;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.workspace-mode .status-explanation-header p {
  margin: 0;
  color: #263247;
  font-size: 12px;
}

body.workspace-mode .status-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
  padding: 0;
}

body.workspace-mode .status-check-grid li {
  display: grid;
  grid-template-columns: minmax(60px, .85fr) minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(134, 153, 177, .32);
  border-radius: 5px;
  background: rgba(255, 255, 255, .72);
  padding: 6px 8px;
  font-size: 10px;
}

body.workspace-mode .status-check-grid span {
  color: #5f7088;
}

body.workspace-mode .status-check-grid strong {
  color: #1e293b;
  font-weight: 800;
  text-align: right;
}

body.workspace-mode .status-reason-block {
  border-top: 1px solid rgba(109, 124, 145, .22);
  margin-top: 9px;
  padding-top: 9px;
}

body.workspace-mode .status-reason-block strong {
  display: block;
  margin-bottom: 5px;
  color: #1e293b;
  font-size: 11px;
}

body.workspace-mode .status-reason-block ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 17px;
}

body.workspace-mode .status-reason-block li {
  color: #586980;
  font-size: 11px;
}

body.workspace-mode .detail-actions {
  position: static !important;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 18px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
}

body.workspace-mode .detail-actions button {
  min-height: 34px;
  border: 1px solid #b8c8dc;
  border-radius: 6px;
  background: #fff;
  color: #263247;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  padding: 0 10px;
}

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

.detail-section {
  margin: 14px 18px 0;
}

.detail-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e1e8f0;
  margin-bottom: 8px;
  padding-top: 12px;
}

.detail-section-heading span {
  color: #4f5f76;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-section-heading small {
  color: #718096;
  font-size: 10px;
  text-align: right;
}

body.workspace-mode .reference-detail label {
  display: grid;
  gap: 6px;
  color: #5b6779;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

body.workspace-mode .reference-detail textarea,
body.workspace-mode .reference-detail input {
  min-height: 34px;
  border: 1px solid #b8c8dc;
  border-radius: 6px;
  background: #fbfdff;
  color: #172033;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  text-transform: none;
}

body.workspace-mode .reference-detail textarea:focus,
body.workspace-mode .reference-detail input:focus {
  border-color: #2684ff;
  box-shadow: 0 0 0 2px rgba(38, 132, 255, .13);
  outline: none;
}

body.workspace-mode .raw-section textarea {
  min-height: 86px;
  max-height: 150px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.45;
}

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

body.workspace-mode .reference-intelligence {
  border: 1px solid #d9e3ee;
  border-radius: 7px;
  background: #fbfdff;
  margin: 16px 18px 0;
  padding: 12px;
}

body.workspace-mode .reference-intelligence > strong {
  display: block;
  margin: 0 0 7px;
  color: #182235;
  font-size: 12px;
  font-weight: 850;
}

body.workspace-mode .reference-intelligence details {
  border-top: 1px solid #e1e8f0;
  padding: 7px 0;
}

body.workspace-mode .reference-intelligence details:first-of-type {
  border-top: 0;
}

body.workspace-mode .reference-intelligence summary {
  cursor: pointer;
  color: #3f4b5e;
  font-size: 11px;
  font-weight: 800;
}

body.workspace-mode .reference-intelligence ul {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
  padding-left: 17px;
  color: #5c6d84;
  font-size: 11px;
}

body.workspace-mode .match-list {
  display: grid;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0 0 18px;
}

body.workspace-mode .candidate-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid #d7e2ee;
  border-radius: 7px;
  background: #fbfdff;
  padding: 10px;
}

body.workspace-mode .candidate-card-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body.workspace-mode .candidate-card strong {
  color: #182235;
  font-size: 12px;
  line-height: 1.35;
}

body.workspace-mode .candidate-card span,
body.workspace-mode .candidate-card small {
  overflow-wrap: anywhere;
  color: #5d6b80;
  font-size: 10px;
  line-height: 1.4;
}

body.workspace-mode .candidate-card button {
  min-height: 30px;
  border: 1px solid #b9c9dc;
  border-radius: 5px;
  background: #fff;
  color: #243148;
  font-size: 10px;
  font-weight: 850;
  padding: 0 9px;
  white-space: nowrap;
}

body.workspace-mode .candidate-card button:hover {
  border-color: #2684ff;
  color: #0c63ce;
}

body.workspace-mode .candidate-empty {
  display: grid;
  gap: 4px;
  color: #5d6b80;
  font-size: 11px;
}

/* Right review pane v12: collapsed diagnostics and stable pane stripe */
body.workspace-mode .reference-detail.workspace-pane {
  border-top: 4px solid #f2a51a;
  box-shadow: 0 8px 22px rgba(31, 45, 63, 0.07);
}

body.workspace-mode .status-explanation,
body.workspace-mode .reference-intelligence {
  overflow: hidden;
}

body.workspace-mode .status-explanation-header,
body.workspace-mode .reference-intelligence-summary {
  cursor: pointer;
  list-style: none;
}

body.workspace-mode .status-explanation-header::-webkit-details-marker,
body.workspace-mode .reference-intelligence-summary::-webkit-details-marker {
  display: none;
}

body.workspace-mode .status-explanation-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

body.workspace-mode .status-explanation-header span,
body.workspace-mode .status-explanation-header p {
  grid-column: 1;
}

body.workspace-mode .status-summary-cue {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  border: 1px solid rgba(109, 124, 145, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #40506a;
  font-size: 10px;
  font-weight: 850;
  padding: 5px 8px;
  white-space: nowrap;
}

body.workspace-mode .status-explanation[open] .status-summary-cue {
  color: #233047;
}

body.workspace-mode .status-explanation[open] .status-summary-cue::before {
  content: "Hide ";
}

body.workspace-mode .status-explanation-body {
  margin-top: 10px;
}

body.workspace-mode .status-explanation:not([open]) .status-explanation-body,
body.workspace-mode .reference-intelligence:not([open]) .reference-intelligence-body,
body.workspace-mode .reference-intelligence details:not([open]) > ul {
  display: none;
}

body.workspace-mode .status-check-grid li {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
}

body.workspace-mode .status-check-grid span,
body.workspace-mode .status-check-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.workspace-mode .status-check-grid strong {
  line-height: 1.25;
}

body.workspace-mode .reference-intelligence {
  padding: 0;
}

body.workspace-mode .reference-intelligence-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
}

body.workspace-mode .reference-intelligence-summary strong {
  color: #182235;
  font-size: 12px;
  font-weight: 850;
}

body.workspace-mode .reference-intelligence-summary span {
  color: #65758b;
  font-size: 10px;
  line-height: 1.35;
}

body.workspace-mode .reference-intelligence-body {
  border-top: 1px solid #e1e8f0;
  padding: 0 12px 8px;
}

body.workspace-mode .reference-intelligence > strong {
  display: none;
}

body.workspace-mode .reference-intelligence details:first-of-type {
  border-top: 0;
}

body.workspace-mode .reference-intelligence details[open] summary {
  color: #182235;
}

@media (max-width: 760px) {
  body.workspace-mode .reference-detail {
    max-height: calc(100vh - 150px);
  }

  body.workspace-mode .detail-actions,
  body.workspace-mode .detail-grid,
  body.workspace-mode .status-check-grid,
  body.workspace-mode .candidate-card {
    grid-template-columns: 1fr;
  }

  .detail-section-heading {
    display: grid;
  }

  .detail-section-heading small {
    text-align: left;
  }
}

/* Workspace summary modal: keep the header compact and give the title more room. */
body.workspace-mode .workspace-header {
  grid-template-columns: minmax(360px, 1fr) auto auto;
}

body.workspace-mode .workspace-document {
  min-width: 0;
}

body.workspace-mode .workspace-document strong {
  max-width: min(720px, 42vw);
}

body.workspace-mode .workspace-summary-button {
  display: grid;
  gap: 2px;
  min-height: 34px;
  min-width: 172px;
  border: 1px solid #b9c9dc;
  border-radius: 7px;
  background: #f8fbff;
  color: #263247;
  cursor: pointer;
  font: inherit;
  padding: 6px 11px;
  text-align: left;
}

body.workspace-mode .workspace-summary-button:hover,
body.workspace-mode .workspace-summary-button[aria-expanded="true"] {
  border-color: #2684ff;
  background: #eef6ff;
}

body.workspace-mode .workspace-summary-button span {
  color: #5e6d82;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

body.workspace-mode .workspace-summary-button strong {
  overflow: hidden;
  color: #172033;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.workspace-mode .workspace-summary-popover[hidden] {
  display: none;
}

body.workspace-mode .workspace-summary-popover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding: calc(var(--workspace-header-height) + 14px) 16px 16px;
}

body.workspace-mode .workspace-summary-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .24);
  cursor: default;
}

body.workspace-mode .workspace-summary-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 32px));
  border: 1px solid #c6d5e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(21, 31, 47, .22);
  padding: 14px;
}

body.workspace-mode .workspace-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e0e8f1;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

body.workspace-mode .workspace-summary-head span {
  color: #5e6d82;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

body.workspace-mode .workspace-summary-head h2 {
  margin: 2px 0 0;
  color: #111827;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.15;
}

body.workspace-mode .workspace-summary-dialog .scorecard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.workspace-mode .workspace-summary-dialog .score-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 48px;
  border-radius: 7px;
  padding: 9px 10px;
}

body.workspace-mode .workspace-summary-dialog .score-card strong {
  font-size: 20px;
}

body.workspace-mode .workspace-summary-dialog .score-card span {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.workspace-mode .workspace-summary-note {
  margin: 10px 0 0;
  color: #65758b;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(280px, 1fr) auto auto;
  }

  body.workspace-mode .workspace-summary-dialog .score-card span {
    display: block;
  }
}

@media (max-width: 980px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.workspace-mode .workspace-summary-button {
    min-width: 138px;
  }

  body.workspace-mode .workspace-summary-dialog .scorecard-grid {
    display: grid;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.workspace-mode .workspace-document strong {
    max-width: 100%;
  }

  body.workspace-mode .workspace-summary-button {
    width: 100%;
  }

  body.workspace-mode .workspace-summary-popover {
    align-items: end;
    place-items: end stretch;
    padding: 10px;
  }

  body.workspace-mode .workspace-summary-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    border-radius: 10px;
    padding: 13px;
  }

  body.workspace-mode .workspace-summary-dialog .scorecard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Workspace v0.1 refinement pass: summary button, review pane, quality panel, export panel */
body.workspace-mode .workspace-header {
  grid-template-columns: minmax(420px, 1fr) auto auto;
  gap: 10px;
}

body.workspace-mode .workspace-summary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  min-width: 0;
  border: 1px solid #b9c9dc;
  border-radius: 7px;
  background: #fff;
  color: #263247;
  padding: 0 14px;
  text-align: center;
  white-space: nowrap;
}

body.workspace-mode .workspace-summary-button span {
  color: #263247;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
}

body.workspace-mode #workspace-export-button {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: none !important;
}

body.workspace-mode #workspace-export-button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  box-shadow: none !important;
}

body.workspace-mode .utility-panel-head {
  top: 0;
  margin: -16px -16px 18px;
  background: #fff;
  box-shadow: 0 1px 0 #e0e8f1;
  backdrop-filter: none;
}

body.workspace-mode #quality-drawer .utility-content {
  width: min(1120px, calc(100vw - 28px));
}

body.workspace-mode #export-drawer .utility-content {
  width: min(980px, calc(100vw - 28px));
}

body.workspace-mode #quality-drawer .review-command-bar {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #f8fbff;
  padding: 14px;
}

body.workspace-mode #quality-drawer .report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
}

body.workspace-mode #quality-drawer .report-grid > article {
  min-height: 0;
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #fbfdff;
  padding: 14px;
}

body.workspace-mode #quality-drawer .report-grid > article.official-report {
  grid-column: 1 / -1;
}

body.workspace-mode .official-deep-dive {
  border-top: 1px solid #e1e8f0;
  margin-top: 14px;
  padding-top: 12px;
}

body.workspace-mode .official-deep-dive summary {
  cursor: pointer;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

body.workspace-mode .official-deep-dive-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

body.workspace-mode #export-drawer .citation-style-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid #d9e5f4;
  border-radius: 14px;
  background: #f8fbff;
  margin: 0;
  padding: 14px;
}

body.workspace-mode #export-drawer .pdf-style-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

body.workspace-mode #export-drawer .pdf-style-search-wrap {
  display: grid;
}

body.workspace-mode #export-drawer .pdf-style-search-wrap input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #c9d7e7;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  font-size: 16px;
  font-weight: 800;
  padding: 0 16px;
}

body.workspace-mode #export-drawer .pdf-style-result-row {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

body.workspace-mode #export-drawer .pdf-style-status-row {
  display: grid;
  grid-template-columns: minmax(240px, 0.48fr) minmax(0, 0.52fr);
  gap: 12px;
  min-width: 0;
}

body.workspace-mode #export-drawer .pdf-style-meta-row,
body.workspace-mode #export-drawer .pdf-style-preview {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  min-height: 100%;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

body.workspace-mode #export-drawer .pdf-style-meta-row p,
body.workspace-mode #export-drawer .pdf-style-preview p {
  margin: 0;
}

body.workspace-mode #export-drawer .pdf-style-meta-row strong {
  color: #172033;
  font-size: 16px;
  line-height: 1.35;
}

body.workspace-mode #export-drawer .pdf-style-preview {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

body.workspace-mode #export-drawer .pdf-style-preview span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: fit-content;
  border-radius: 999px;
  background: #eaf3ff;
  color: #0068e8;
  font-size: 11px;
  font-weight: 850;
  padding: 6px 8px;
  text-transform: uppercase;
}

body.workspace-mode #export-drawer .pdf-style-preview p {
  color: #526176;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.workspace-mode #export-drawer .citation-style-note {
  border-top: 1px solid #dbe5ef;
  margin: 0;
  padding-top: 12px;
  color: #5b6779;
  font-size: 12px;
  line-height: 1.55;
}

body.workspace-mode #export-drawer .export-actions {
  justify-content: flex-start;
  gap: 10px;
  margin: 16px 0 14px;
}

body.workspace-mode #export-drawer .export-menu summary {
  min-height: 42px;
  border: 1px solid #b9c9dc;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  font-size: 13px;
  padding: 0 14px;
}

body.workspace-mode #export-drawer .export-preview {
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px;
}

body.workspace-mode #export-drawer .export-preview summary {
  cursor: pointer;
  color: #334155;
  font-weight: 800;
}

body.workspace-mode #export-drawer .output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

body.workspace-mode #export-drawer .output-grid label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

body.workspace-mode #export-drawer .output-grid textarea {
  min-height: 220px;
  border: 1px solid #cad7e6;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  padding: 12px;
}

body.workspace-mode .reference-detail.workspace-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - var(--workspace-header-height) - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 0;
  box-shadow: 0 8px 22px rgba(31, 45, 63, 0.07);
  padding: 0;
}

body.workspace-mode .reference-detail {
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.workspace-mode .detail-sticky-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 66px;
  border-top: 4px solid #f2a51a;
  border-bottom: 1px solid #dbe5ef;
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 11px 13px;
}

body.workspace-mode .reference-detail[data-status="ready"] .detail-sticky-header {
  border-top-color: #0b8a52;
}

body.workspace-mode .reference-detail[data-status="review"] .detail-sticky-header {
  border-top-color: #d28a08;
}

body.workspace-mode .reference-detail[data-status="unresolved"] .detail-sticky-header {
  border-top-color: #d92f38;
}

body.workspace-mode .detail-sticky-copy {
  display: grid;
  gap: 3px;
}

body.workspace-mode .detail-kicker {
  margin: 0;
  color: #d28a08;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.workspace-mode .reference-detail[data-status="ready"] .detail-kicker {
  color: #0b8a52;
}

body.workspace-mode .reference-detail[data-status="review"] .detail-kicker {
  color: #d28a08;
}

body.workspace-mode .reference-detail[data-status="unresolved"] .detail-kicker {
  color: #d92f38;
}

body.workspace-mode .detail-sticky-header h2 {
  margin: 0;
  color: #111827;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.15;
}

body.workspace-mode .detail-page-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  padding-bottom: 18px;
}

body.workspace-mode section.reference-intelligence .reference-intelligence-body {
  display: grid;
  border-top: 1px solid #e1e8f0;
  padding: 0 12px 8px;
}

body.workspace-mode section.reference-intelligence .reference-intelligence-head {
  display: grid;
  gap: 4px;
  padding: 12px;
}

body.workspace-mode section.reference-intelligence .reference-intelligence-head strong {
  color: #182235;
  font-size: 12px;
  font-weight: 850;
}

body.workspace-mode section.reference-intelligence .reference-intelligence-head span {
  color: #65758b;
  font-size: 10px;
  line-height: 1.4;
}

body.workspace-mode section.reference-intelligence details {
  border-top: 1px solid #e1e8f0;
  padding: 8px 0;
}

body.workspace-mode section.reference-intelligence details:first-child {
  border-top: 0;
}

body.workspace-mode section.reference-intelligence summary {
  cursor: pointer;
  color: #3f4b5e;
  font-size: 11px;
  font-weight: 800;
}

body.workspace-mode section.reference-intelligence ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 17px;
  color: #5c6d84;
  font-size: 11px;
}

@media (max-width: 1180px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(300px, 1fr) auto auto;
  }
}

@media (max-width: 980px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.workspace-mode #quality-drawer .report-grid,
  body.workspace-mode #export-drawer .output-grid {
    grid-template-columns: 1fr;
  }

  body.workspace-mode #export-drawer .pdf-style-status-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-summary-button {
    width: auto;
    justify-self: stretch;
  }

  body.workspace-mode #quality-drawer .utility-content,
  body.workspace-mode #export-drawer .utility-content {
    width: calc(100vw - 16px);
  }

  body.workspace-mode .detail-sticky-header {
    min-height: 62px;
    padding: 10px 12px;
  }

  body.workspace-mode .detail-sticky-header h2 {
    font-size: 16px;
  }

  body.workspace-mode #quality-drawer .review-command-bar,
  body.workspace-mode #quality-drawer .report-grid,
  body.workspace-mode #export-drawer .pdf-style-status-row,
  body.workspace-mode #export-drawer .output-grid {
    grid-template-columns: 1fr;
  }

  body.workspace-mode #export-drawer .pdf-style-preview {
    grid-template-columns: 1fr;
  }
}

/* Mobile workspace repair: keep the review tool inside one phone viewport. */
@media (max-width: 760px) {
  html,
  body,
  body.workspace-mode,
  body.workspace-mode main,
  body.workspace-mode .results-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.workspace-mode .results-panel {
    --mobile-workspace-header-height: 126px;
    --mobile-workspace-tabs-height: 44px;
    min-height: 100dvh;
  }

  body.workspace-mode .workspace-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "document summary"
      "actions actions";
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: var(--mobile-workspace-header-height);
    padding: 8px 10px;
  }

  body.workspace-mode .workspace-document {
    grid-area: document;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  body.workspace-mode .workspace-document .exit-workspace-button {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
  }

  body.workspace-mode .workspace-document .exit-workspace-button span:last-child {
    display: none;
  }

  body.workspace-mode .workspace-document > div {
    min-width: 0;
    max-width: 100%;
  }

  body.workspace-mode .workspace-document strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.workspace-mode .workspace-summary-button {
    grid-area: summary;
    width: 100%;
    min-width: 126px;
    min-height: 42px;
    padding: 0 12px;
    justify-self: end;
    white-space: nowrap;
  }

  body.workspace-mode .workspace-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 0;
  }

  body.workspace-mode .workspace-actions #workspace-enrich-button,
  body.workspace-mode .workspace-actions #workspace-match-button,
  body.workspace-mode .workspace-actions #copy-summary-button {
    display: none !important;
  }

  body.workspace-mode .workspace-actions #workspace-quality-button,
  body.workspace-mode .workspace-actions #workspace-export-button {
    display: inline-flex !important;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    justify-content: center;
    padding: 0 10px;
    font-size: 13px;
  }

  body.workspace-mode .mobile-workspace-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-height: var(--mobile-workspace-tabs-height);
    overflow: hidden;
  }

  body.workspace-mode .mobile-workspace-tabs button {
    min-width: 0;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  body.workspace-mode .workspace-grid {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: calc(100dvh - var(--mobile-workspace-header-height) - var(--mobile-workspace-tabs-height));
    padding: 0;
    overflow: hidden;
  }

  body.workspace-mode .workspace-pane {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    overflow-x: hidden;
  }

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

  body.workspace-mode .workspace-grid[data-mobile-panel="details"] [data-pane="details"] {
    display: flex;
  }

  body.workspace-mode .pane-header {
    min-width: 0;
    padding: 12px 14px;
  }

  body.workspace-mode .reference-list,
  body.workspace-mode .pdf-viewer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.workspace-mode .reference-row {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px 14px;
    overflow: hidden;
  }

  body.workspace-mode .reference-row > div,
  body.workspace-mode .reference-row strong,
  body.workspace-mode .reference-row p,
  body.workspace-mode .reference-row-meta {
    min-width: 0;
    max-width: 100%;
  }

  body.workspace-mode .reference-row strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  body.workspace-mode .reference-row p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.workspace-mode .reference-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow: hidden;
  }

  body.workspace-mode .reference-row-meta > span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.workspace-mode .reference-list-header {
    gap: 10px;
  }

  body.workspace-mode .reference-filter-menu summary {
    min-width: 118px;
    max-width: 150px;
    padding: 0 10px;
  }

  body.workspace-mode .reference-filter-menu summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.workspace-mode .reference-filter-menu {
    position: relative;
  }

  body.workspace-mode .reference-filter-menu .review-menu-list {
    left: auto;
    right: 0;
    width: min(220px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    min-width: 0;
    transform: none;
  }

  body.workspace-mode .reference-filter-menu:not([open]) .review-menu-list {
    display: none !important;
  }

  body.workspace-mode .review-menu-list button {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.workspace-mode .reference-detail.workspace-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.workspace-mode .detail-sticky-header {
    flex: 0 0 auto;
    min-height: 64px;
    padding: 10px 14px;
  }

  body.workspace-mode .detail-page-body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px 14px 18px;
  }

  body.workspace-mode .detail-actions,
  body.workspace-mode .detail-grid,
  body.workspace-mode .status-check-grid {
    grid-template-columns: 1fr;
  }

  body.workspace-mode .detail-actions {
    display: grid;
    gap: 8px;
  }

  body.workspace-mode .detail-actions button,
  body.workspace-mode .reference-detail textarea,
  body.workspace-mode .reference-detail input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body.workspace-mode .status-check-grid li,
  body.workspace-mode .status-check-grid li strong,
  body.workspace-mode .match-card,
  body.workspace-mode .match-card * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.workspace-mode .reference-intelligence,
  body.workspace-mode .candidate-section,
  body.workspace-mode .detail-section {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  body.workspace-mode .workspace-utilities {
    position: static;
    height: 0;
  }

  body.workspace-mode .utility-content,
  body.workspace-mode #quality-drawer .utility-content,
  body.workspace-mode #export-drawer .utility-content {
    position: fixed;
    inset: calc(var(--mobile-workspace-header-height) + 8px) 8px 8px 8px;
    width: auto !important;
    max-width: none;
    min-width: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 12px;
    padding: 12px;
  }

  body.workspace-mode .utility-panel-head {
    position: sticky;
    top: -12px;
    z-index: 6;
    margin: -12px -12px 12px;
    padding: 12px;
    background: #fff;
  }

  body.workspace-mode #quality-summary {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  body.workspace-mode #quality-drawer .review-command-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  body.workspace-mode #quality-drawer .review-command-bar .button,
  body.workspace-mode #quality-drawer .review-menu summary {
    width: 100%;
  }

  body.workspace-mode #quality-drawer .report-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.workspace-mode #quality-drawer .report-grid > article,
  body.workspace-mode #quality-drawer .report-grid > article.official-report,
  body.workspace-mode #official-reference-report,
  body.workspace-mode .official-deep-dive,
  body.workspace-mode .official-deep-dive-body {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
  }

  body.workspace-mode #quality-drawer .report-grid ul {
    padding-left: 18px;
  }

  body.workspace-mode #export-drawer .citation-style-card,
  body.workspace-mode #export-drawer .pdf-style-workbench,
  body.workspace-mode #export-drawer .pdf-style-status-row,
  body.workspace-mode #export-drawer .pdf-style-meta-row,
  body.workspace-mode #export-drawer .pdf-style-preview,
  body.workspace-mode #export-drawer .output-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.workspace-mode #export-drawer .pdf-style-search-wrap input {
    min-width: 0;
    font-size: 14px;
    padding: 0 12px;
  }

  body.workspace-mode #export-drawer .pdf-style-result-row {
    max-height: 210px;
    min-width: 0;
  }

  body.workspace-mode #export-drawer .pdf-style-result-row button,
  body.workspace-mode #export-drawer .pdf-style-meta-row strong,
  body.workspace-mode #export-drawer .pdf-style-preview p,
  body.workspace-mode #export-drawer .citation-style-note {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.workspace-mode #export-drawer .export-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.workspace-mode #export-drawer .export-menu,
  body.workspace-mode #export-drawer .export-menu summary,
  body.workspace-mode #export-drawer .output-grid textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "document"
      "summary"
      "actions";
    min-height: 170px;
  }

  body.workspace-mode .results-panel {
    --mobile-workspace-header-height: 170px;
  }

  body.workspace-mode .workspace-summary-button {
    justify-self: stretch;
    min-width: 0;
  }
}

/* Review workspace polish v20: stable card scrolling, flatter selection, calmer audit drawer. */
body.workspace-mode .reference-row.is-selected {
  border-left: 4px solid #ff5f59;
  box-shadow: none;
  background: #fff2f1;
}

body.workspace-mode .reference-detail.workspace-pane {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--workspace-header-height) - 24px);
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 45, 63, 0.07);
}

body.workspace-mode .reference-detail .detail-sticky-header {
  position: relative;
  top: auto;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 72px;
  border-top: 4px solid #f2a51a;
  border-bottom: 1px solid #dbe5ef;
  background: #fff;
  padding: 13px 16px 12px;
}

body.workspace-mode .reference-detail[data-status="ready"] .detail-sticky-header {
  border-top-color: #0b8a52;
}

body.workspace-mode .reference-detail[data-status="review"] .detail-sticky-header {
  border-top-color: #d28a08;
}

body.workspace-mode .reference-detail[data-status="unresolved"] .detail-sticky-header {
  border-top-color: #d92f38;
}

body.workspace-mode .reference-detail .detail-kicker {
  margin: 0;
  color: #d28a08;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

body.workspace-mode .reference-detail[data-status="ready"] .detail-kicker {
  color: #0b8a52;
}

body.workspace-mode .reference-detail[data-status="review"] .detail-kicker {
  color: #d28a08;
}

body.workspace-mode .reference-detail[data-status="unresolved"] .detail-kicker {
  color: #d92f38;
}

body.workspace-mode .reference-detail .detail-sticky-header h2 {
  margin: 6px 0 0;
  color: #111827;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.12;
}

body.workspace-mode .reference-detail .detail-page-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  padding: 16px 18px 20px;
}

body.workspace-mode .reference-detail .detail-actions,
body.workspace-mode .reference-detail .detail-section,
body.workspace-mode .reference-detail .status-explanation,
body.workspace-mode .reference-detail .reference-intelligence,
body.workspace-mode .reference-detail .candidate-section {
  margin-right: 0;
  margin-left: 0;
}

body.workspace-mode .reference-detail .status-explanation {
  margin-top: 16px;
}

body.workspace-mode .reference-intelligence {
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  background: #fbfdff;
  padding: 0;
}

body.workspace-mode section.reference-intelligence .reference-intelligence-head {
  padding: 12px 14px;
}

body.workspace-mode section.reference-intelligence .reference-intelligence-body {
  display: grid;
  border-top: 1px solid #e1e8f0;
  padding: 0 14px 8px;
}

body.workspace-mode section.reference-intelligence details {
  border-top: 1px solid #e1e8f0;
  padding: 9px 0;
}

body.workspace-mode section.reference-intelligence details:first-child {
  border-top: 0;
}

body.workspace-mode section.reference-intelligence summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}

body.workspace-mode section.reference-intelligence summary::-webkit-details-marker {
  display: none;
}

body.workspace-mode section.reference-intelligence summary::before {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #63738a;
  content: "";
  transition: transform 120ms ease;
}

body.workspace-mode section.reference-intelligence details[open] summary::before {
  transform: rotate(90deg);
}

body.workspace-mode .intelligence-empty {
  margin: 7px 0 0 18px;
  color: #6b7a90;
  font-size: 11px;
  line-height: 1.45;
}

body.workspace-mode #quality-drawer .utility-content {
  width: min(980px, calc(100vw - 40px));
  overflow-x: hidden;
  background: #f8fbff;
  padding: 0;
}

body.workspace-mode #quality-drawer .utility-panel-head {
  top: 0;
  margin: 0;
  border-bottom: 1px solid #d9e3ee;
  background: #fff;
  padding: 14px 18px;
}

body.workspace-mode #quality-summary {
  margin: 0;
  border-bottom: 1px solid #d9e3ee;
  background: #fff;
  color: #2a3446;
  font-size: 14px;
  line-height: 1.45;
  padding: 14px 18px;
}

body.workspace-mode #quality-drawer .review-command-bar {
  position: sticky;
  top: 62px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #d9e3ee;
  border-radius: 0;
  background: rgba(248, 251, 255, 0.96);
  padding: 10px 18px;
  backdrop-filter: blur(8px);
}

body.workspace-mode #quality-drawer .review-command-bar .button,
body.workspace-mode #quality-drawer .review-menu summary {
  min-height: 36px;
  border-radius: 7px;
  box-shadow: none;
  font-size: 12px;
}

body.workspace-mode #quality-drawer .report-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.2fr) minmax(250px, 1fr) minmax(230px, 1fr);
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 14px 18px 18px;
}

body.workspace-mode #quality-drawer .report-grid article {
  min-width: 0;
  min-height: 0;
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

body.workspace-mode #quality-drawer .report-grid article:nth-child(1) {
  background: #f3f8ff;
}

body.workspace-mode #quality-drawer .report-grid article:nth-child(2) {
  background: #fff8e6;
}

body.workspace-mode #quality-drawer .report-grid article:nth-child(3) {
  background: #f7fbff;
}

body.workspace-mode #quality-drawer .report-grid article:nth-child(4) {
  background: #effaf5;
}

body.workspace-mode #quality-drawer .report-grid .official-report {
  grid-column: 1 / -1;
  background: #fff;
}

body.workspace-mode #quality-drawer .report-grid h3 {
  margin: 0 0 10px;
  color: #172033;
  font-size: 13px;
  line-height: 1.2;
}

body.workspace-mode #quality-drawer .report-grid ul,
body.workspace-mode #quality-drawer .report-grid p {
  margin: 0;
  color: #526176;
  font-size: 12px;
  line-height: 1.48;
}

body.workspace-mode #quality-drawer .report-grid ul {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

body.workspace-mode #quality-drawer .tag-list {
  gap: 7px;
}

body.workspace-mode #quality-drawer .tag-list span,
body.workspace-mode #quality-drawer .official-id-tags span,
body.workspace-mode #quality-drawer .official-public-links a {
  border-color: #cbd8e8;
  background: #fff;
  color: #415169;
  font-size: 11px;
}

body.workspace-mode #quality-drawer .source-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 8px 0;
  font-size: 11px;
}

body.workspace-mode #quality-drawer .source-row small {
  color: #68788e;
  line-height: 1.35;
}

body.workspace-mode #quality-drawer .official-status {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

body.workspace-mode #quality-drawer .official-status strong {
  color: #172033;
  font-size: 16px;
}

body.workspace-mode #quality-drawer .official-status span {
  color: #4b5b72;
  font-size: 13px;
  line-height: 1.45;
}

body.workspace-mode #quality-drawer .document-identity-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

body.workspace-mode #quality-drawer .document-identity-card > div {
  min-width: 0;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

body.workspace-mode #quality-drawer .document-identity-card small,
body.workspace-mode #quality-drawer .official-report small {
  color: #65758b;
  font-size: 10px;
  font-weight: 800;
}

body.workspace-mode #quality-drawer .document-identity-card strong {
  display: block;
  margin-top: 3px;
  color: #172033;
  font-size: 13px;
}

body.workspace-mode #quality-drawer .document-identity-card span,
body.workspace-mode #quality-drawer .official-source-list span,
body.workspace-mode #quality-drawer .official-ledger span {
  color: #526176;
  font-size: 12px;
  line-height: 1.4;
}

body.workspace-mode #quality-drawer .official-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

body.workspace-mode #quality-drawer .official-deep-dive {
  margin-top: 14px;
  border-top: 1px solid #d9e3ee;
  padding-top: 12px;
}

body.workspace-mode #quality-drawer .official-deep-dive summary {
  cursor: pointer;
  color: #263247;
  font-size: 13px;
  font-weight: 850;
}

body.workspace-mode #quality-drawer .official-deep-dive-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

body.workspace-mode #quality-drawer .official-source-list,
body.workspace-mode #quality-drawer .official-ledger ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 1180px) {
  body.workspace-mode #quality-drawer .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.workspace-mode .reference-detail.workspace-pane {
    height: 100%;
    border-radius: 0;
  }

  body.workspace-mode .reference-detail .detail-sticky-header {
    min-height: 64px;
    padding: 10px 14px;
  }

  body.workspace-mode .reference-detail .detail-page-body {
    padding: 12px 14px 18px;
  }

  body.workspace-mode #quality-drawer .utility-content {
    width: auto;
    padding: 0;
  }

  body.workspace-mode #quality-drawer .review-command-bar {
    top: 58px;
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  body.workspace-mode #quality-drawer .report-grid,
  body.workspace-mode #quality-drawer .document-identity-card {
    grid-template-columns: 1fr;
  }

  body.workspace-mode #quality-drawer .report-grid {
    gap: 10px;
    padding: 12px;
  }
}

/* Review pane scroll and detail polish v21 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.workspace-mode .reference-detail.workspace-pane {
  overflow: hidden !important;
  scrollbar-gutter: auto !important;
}

body.workspace-mode .reference-detail .detail-page-body {
  align-self: stretch;
  width: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable !important;
  padding-right: 18px;
}

body.workspace-mode .reference-detail .field-control {
  display: grid;
  min-width: 0;
}

body.workspace-mode .raw-section .field-control-raw {
  gap: 0;
}

body.workspace-mode .raw-section textarea {
  min-height: 96px;
  max-height: none !important;
  overflow: hidden !important;
  resize: none;
}

body.workspace-mode .reference-intelligence:not([open]) .reference-intelligence-body,
body.workspace-mode section.reference-intelligence .reference-intelligence-body {
  display: grid !important;
}

body.workspace-mode .reference-intelligence details:not([open]) > ul,
body.workspace-mode .reference-intelligence details:not([open]) > .intelligence-empty {
  display: none !important;
}

body.workspace-mode section.reference-intelligence details {
  display: block;
}

body.workspace-mode section.reference-intelligence summary {
  min-width: 0;
  color: #3d4a5f;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

body.workspace-mode section.reference-intelligence ul {
  margin: 8px 0 0 18px;
}

@media (max-width: 760px) {
  body.workspace-mode .reference-detail .detail-page-body {
    padding-right: 14px;
    scrollbar-gutter: stable !important;
  }

  body.workspace-mode .raw-section textarea {
    min-height: 88px;
  }
}

/* Review pane header parity v22 */
body.workspace-mode .reference-detail .detail-sticky-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 66px !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #fff, #f8fbff) !important;
  box-shadow: inset 0 3px #f2a51a !important;
  padding: 11px 13px !important;
}

body.workspace-mode .reference-detail[data-status="ready"] .detail-sticky-header {
  box-shadow: inset 0 3px #0b8a52 !important;
}

body.workspace-mode .reference-detail[data-status="review"] .detail-sticky-header {
  box-shadow: inset 0 3px #d28a08 !important;
}

body.workspace-mode .reference-detail[data-status="unresolved"] .detail-sticky-header {
  box-shadow: inset 0 3px #d92f38 !important;
}

body.workspace-mode .reference-detail .detail-kicker {
  margin: 0 0 3px !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  text-transform: uppercase !important;
}

body.workspace-mode .reference-detail .detail-sticky-header h2 {
  margin: 0 !important;
  font-family: var(--display) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: normal !important;
}

@media (max-width: 760px) {
  body.workspace-mode .reference-detail .detail-sticky-header {
    min-height: 66px !important;
    padding: 12px 14px !important;
  }
}

/* Pane collapse controls v23 */
body.workspace-mode .workspace-header {
  --workspace-action-button-height: 40px;
}

body.workspace-mode .workspace-summary-button,
body.workspace-mode .workspace-actions .button {
  min-height: var(--workspace-action-button-height) !important;
  height: var(--workspace-action-button-height) !important;
  align-items: center !important;
}

body.workspace-mode .workspace-summary-button {
  display: inline-flex !important;
  justify-content: center !important;
  padding: 0 16px !important;
}

body.workspace-mode .workspace-grid {
  position: relative;
  transition: grid-template-columns 180ms ease;
}

body.workspace-mode .workspace-pane {
  transition:
    opacity 150ms ease,
    transform 180ms ease,
    border-color 150ms ease,
    background-color 150ms ease;
}

body.workspace-mode .pane-collapse-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 7px;
  color: #334155;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
}

body.workspace-mode .pane-collapse-button:hover {
  border-color: #8fb3dc;
  background: #eef6ff;
  color: #0f5fbf;
}

body.workspace-mode .pdf-page-controls {
  flex-wrap: nowrap;
}

body.workspace-mode .detail-sticky-header .pane-collapse-button {
  margin-left: auto;
}

body.workspace-mode .pane-restore-rail {
  position: absolute;
  top: 10px;
  bottom: 11px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 32px;
  border: 1px solid #bfd0e4;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

body.workspace-mode .pane-restore-rail:hover {
  border-color: #2684ff;
  background: #f0f7ff;
  color: #0f5fbf;
}

body.workspace-mode .pane-restore-left {
  left: 10px;
  box-shadow: inset 3px 0 #1473e6;
}

body.workspace-mode .pane-restore-right {
  right: 10px;
  box-shadow: inset -3px 0 #d28a08;
}

body.workspace-mode .pane-restore-rail[hidden] {
  display: none !important;
}

@media (min-width: 901px) {
  body.workspace-mode .workspace-grid.is-source-collapsed {
    grid-template-columns: 34px minmax(320px, 31%) minmax(560px, 1fr);
  }

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

  body.workspace-mode .workspace-grid.is-source-collapsed [data-pane="source"],
  body.workspace-mode .workspace-grid.is-detail-collapsed [data-pane="details"] {
    overflow: hidden !important;
    border-color: transparent !important;
    background: transparent !important;
    opacity: 0;
    pointer-events: none;
  }

  body.workspace-mode .workspace-grid.is-source-collapsed [data-pane="source"] > *,
  body.workspace-mode .workspace-grid.is-detail-collapsed [data-pane="details"] > * {
    visibility: hidden;
  }

  body.workspace-mode .workspace-grid.is-source-collapsed [data-pane="references"],
  body.workspace-mode .workspace-grid.is-detail-collapsed [data-pane="references"] {
    border-left: 1px solid var(--line-strong);
  }

  body.workspace-mode .workspace-grid.is-source-collapsed .pane-restore-left,
  body.workspace-mode .workspace-grid.is-detail-collapsed .pane-restore-right {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 900px) {
  body.workspace-mode .pane-collapse-button,
  body.workspace-mode .pane-restore-rail {
    display: none !important;
  }

  body.workspace-mode .workspace-grid.is-source-collapsed,
  body.workspace-mode .workspace-grid.is-detail-collapsed {
    grid-template-columns: 1fr;
  }

  body.workspace-mode .workspace-grid.is-source-collapsed [data-pane="source"],
  body.workspace-mode .workspace-grid.is-detail-collapsed [data-pane="details"] {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}

/* Export drawer visual system v24 */
body.workspace-mode #export-drawer .utility-content {
  isolation: isolate !important;
  width: min(1040px, calc(100vw - 28px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid #bfd0e4 !important;
  border-radius: 10px !important;
  background: #f8fbff !important;
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.18) !important;
  padding: 0 14px 14px !important;
  scrollbar-gutter: stable !important;
}

body.workspace-mode #export-drawer .utility-panel-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  align-items: center !important;
  min-height: 62px !important;
  margin: 0 -14px 12px !important;
  border-bottom: 1px solid #d8e3ef !important;
  background: #fff !important;
  box-shadow: 0 1px 0 #d8e3ef, 0 12px 24px rgba(15, 23, 42, 0.06) !important;
  padding: 14px 18px !important;
  backdrop-filter: none !important;
}

body.workspace-mode #export-drawer .utility-panel-head::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #f43b36 0%, #f2a51a 34%, #1473e6 68%, #0b8a52 100%);
  content: "";
}

body.workspace-mode #export-drawer .utility-panel-head strong {
  color: #172033 !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
}

body.workspace-mode #export-drawer .utility-panel-head span {
  color: #53647a !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body.workspace-mode #export-drawer .utility-close-button {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 8px !important;
  background: #fff !important;
}

body.workspace-mode #export-drawer .citation-style-card {
  gap: 10px !important;
  border: 1px solid #d7e2ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  padding: 12px !important;
}

body.workspace-mode #export-drawer .pdf-style-workbench {
  gap: 9px !important;
}

body.workspace-mode #export-drawer .pdf-style-search-wrap input {
  min-height: 38px !important;
  border-color: #bfd0e4 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #172033 !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  padding: 0 12px !important;
}

body.workspace-mode #export-drawer .pdf-style-search-wrap input:focus {
  border-color: #2684ff !important;
  box-shadow: 0 0 0 3px rgba(38, 132, 255, 0.12) !important;
  outline: none !important;
}

body.workspace-mode #export-drawer .pdf-style-result-row {
  max-height: 190px !important;
  border-color: #d7e2ee !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.workspace-mode #export-drawer .pdf-style-result-row.is-open {
  margin-top: 2px !important;
}

body.workspace-mode #export-drawer .pdf-style-result-row button {
  min-height: 34px !important;
  color: #172033 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  padding: 8px 12px !important;
}

body.workspace-mode #export-drawer .pdf-style-status-row {
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr) !important;
  gap: 10px !important;
}

body.workspace-mode #export-drawer .pdf-style-meta-row,
body.workspace-mode #export-drawer .pdf-style-preview {
  min-height: 82px !important;
  border-color: #d7e2ee !important;
  border-radius: 8px !important;
  background: #fbfdff !important;
  gap: 6px !important;
  padding: 10px 12px !important;
}

body.workspace-mode #export-drawer .pdf-style-meta-row p {
  color: #53647a !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body.workspace-mode #export-drawer .pdf-style-meta-row strong {
  color: #172033 !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

body.workspace-mode #export-drawer .pdf-style-preview {
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start !important;
}

body.workspace-mode #export-drawer .pdf-style-preview span {
  border-radius: 999px !important;
  background: #eaf3ff !important;
  color: #0068e8 !important;
  font-size: 10px !important;
  line-height: 1 !important;
  padding: 5px 7px !important;
}

body.workspace-mode #export-drawer .pdf-style-preview p {
  display: -webkit-box !important;
  overflow: hidden !important;
  color: #526176 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 4 !important;
}

body.workspace-mode #export-drawer .citation-style-note {
  border-top: 1px solid #dbe5ef !important;
  color: #526176 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  padding-top: 10px !important;
}

body.workspace-mode #export-drawer .export-actions {
  position: relative !important;
  z-index: 25 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 12px 0 !important;
}

body.workspace-mode #export-drawer .export-menu {
  position: relative !important;
}

body.workspace-mode #export-drawer .export-menu summary {
  min-width: 160px !important;
  min-height: 36px !important;
  border-color: #b9c9dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #172033 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 0 12px !important;
}

body.workspace-mode #export-drawer .export-menu[open] summary {
  border-color: #2684ff !important;
  background: #eef6ff !important;
}

body.workspace-mode #export-drawer .export-menu-list {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  z-index: 45 !important;
  overflow: hidden !important;
  width: min(260px, 80vw) !important;
  border: 1px solid #bfd0e4 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14) !important;
}

body.workspace-mode #export-drawer .export-menu-list button {
  min-height: 34px !important;
  color: #172033 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  padding: 8px 12px !important;
}

body.workspace-mode #export-drawer .export-menu-list button:hover,
body.workspace-mode #export-drawer .export-menu-list button:focus {
  background: #f0f7ff !important;
  color: #0f5fbf !important;
}

body.workspace-mode #export-drawer .export-preview {
  position: relative !important;
  z-index: 1 !important;
  border-color: #d7e2ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  padding: 10px 12px 12px !important;
}

body.workspace-mode #export-drawer .export-preview summary {
  color: #253248 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}

body.workspace-mode #export-drawer .output-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
  gap: 10px !important;
  margin-top: 10px !important;
}

body.workspace-mode #export-drawer .output-grid label {
  gap: 6px !important;
  color: #475569 !important;
  font-size: 10px !important;
  letter-spacing: 0 !important;
}

body.workspace-mode #export-drawer .output-grid textarea {
  width: 100% !important;
  min-height: 160px !important;
  max-height: 240px !important;
  border-color: #cad7e6 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #172033 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  padding: 10px !important;
  resize: vertical !important;
}

@media (max-width: 760px) {
  body.workspace-mode #export-drawer .utility-content {
    width: auto !important;
    padding: 0 10px 12px !important;
  }

  body.workspace-mode #export-drawer .utility-panel-head {
    min-height: 58px !important;
    margin: 0 -10px 10px !important;
    padding: 12px !important;
  }

  body.workspace-mode #export-drawer .citation-style-card {
    padding: 10px !important;
  }

  body.workspace-mode #export-drawer .pdf-style-status-row,
  body.workspace-mode #export-drawer .pdf-style-preview,
  body.workspace-mode #export-drawer .output-grid {
    grid-template-columns: 1fr !important;
  }

  body.workspace-mode #export-drawer .pdf-style-meta-row,
  body.workspace-mode #export-drawer .pdf-style-preview {
    min-height: 0 !important;
  }

  body.workspace-mode #export-drawer .export-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  body.workspace-mode #export-drawer .export-menu,
  body.workspace-mode #export-drawer .export-menu summary {
    width: 100% !important;
  }

  body.workspace-mode #export-drawer .export-menu-list {
    position: static !important;
    width: 100% !important;
    margin-top: 6px !important;
    box-shadow: none !important;
  }
}

/* Export drawer scroll containment v25 */
html.utility-drawer-open,
html.utility-drawer-open body.workspace-mode,
html.utility-drawer-open body.workspace-mode main,
html.utility-drawer-open body.workspace-mode .results-panel {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.workspace-mode.utility-drawer-open .workspace-grid {
  pointer-events: none;
}

body.workspace-mode.utility-drawer-open .workspace-utilities,
body.workspace-mode.utility-drawer-open .utility-drawer[open],
body.workspace-mode.utility-drawer-open .utility-drawer[open] .utility-content {
  pointer-events: auto;
}

body.workspace-mode #export-drawer .utility-content {
  top: calc(var(--workspace-header-height) + 10px) !important;
  right: 12px !important;
  bottom: 12px !important;
  display: flex !important;
  width: min(1040px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - var(--workspace-header-height) - 22px) !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  padding: 0 !important;
  scrollbar-gutter: auto !important;
}

body.workspace-mode #export-drawer .utility-panel-head {
  position: relative !important;
  top: auto !important;
  z-index: 50 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 16px 18px 14px !important;
}

body.workspace-mode #export-drawer .utility-scroll-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 14px !important;
  scrollbar-gutter: stable !important;
}

body.workspace-mode #export-drawer .export-menu-list {
  max-height: min(310px, calc(100vh - var(--workspace-header-height) - 260px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

body.workspace-mode #export-drawer .pdf-style-result-row {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

body.workspace-mode #export-drawer .export-preview {
  margin-bottom: 4px !important;
}

@media (max-width: 760px) {
  body.workspace-mode #export-drawer .utility-content {
    inset: calc(var(--mobile-workspace-header-height, var(--workspace-header-height)) + 8px) 8px 8px !important;
    width: auto !important;
    max-height: calc(100vh - var(--mobile-workspace-header-height, var(--workspace-header-height)) - 16px) !important;
  }

  body.workspace-mode #export-drawer .utility-panel-head {
    padding: 13px 12px !important;
  }

  body.workspace-mode #export-drawer .utility-scroll-body {
    padding: 10px !important;
  }

  body.workspace-mode #export-drawer .export-menu-list {
    max-height: 260px !important;
  }
}

/* Quality drawer scroll containment v28 */
body.workspace-mode #quality-drawer .utility-content {
  top: calc(var(--workspace-header-height) + 10px) !important;
  right: 12px !important;
  bottom: 12px !important;
  display: flex !important;
  width: min(1120px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - var(--workspace-header-height) - 22px) !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  padding: 0 !important;
  scrollbar-gutter: auto !important;
}

body.workspace-mode #quality-drawer .utility-panel-head {
  position: relative !important;
  top: auto !important;
  z-index: 50 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 16px 18px 14px !important;
}

body.workspace-mode #quality-drawer .utility-scroll-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 16px 18px 18px !important;
  scrollbar-gutter: stable !important;
}

body.workspace-mode #quality-drawer #quality-summary {
  margin: 0 0 14px !important;
}

@media (max-width: 760px) {
  body.workspace-mode #quality-drawer .utility-content {
    inset: calc(var(--mobile-workspace-header-height, var(--workspace-header-height)) + 8px) 8px 8px !important;
    width: auto !important;
    max-height: calc(100vh - var(--mobile-workspace-header-height, var(--workspace-header-height)) - 16px) !important;
  }

  body.workspace-mode #quality-drawer .utility-panel-head {
    padding: 13px 12px !important;
  }

  body.workspace-mode #quality-drawer .utility-scroll-body {
    padding: 10px !important;
  }
}

/* Workspace action intelligence final override v29 */
body.workspace-mode .workspace-document > div {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

body.workspace-mode .workspace-document strong {
  max-width: min(520px, 31vw) !important;
  margin-top: 0 !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}

body.workspace-mode .workspace-status-metrics {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  max-width: min(560px, 35vw) !important;
  overflow: hidden !important;
  line-height: 1 !important;
}

body.workspace-mode .workspace-status-metrics span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  min-height: 16px !important;
  border: 1px solid #cbd8e8 !important;
  border-radius: 999px !important;
  background: #f8fbff !important;
  color: #64748b !important;
  font-size: 8px !important;
  font-weight: 850 !important;
  padding: 2px 6px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

body.workspace-mode .workspace-status-metrics b {
  color: #172033 !important;
  font-size: 9px !important;
  font-variant-numeric: tabular-nums !important;
}

body.workspace-mode .workspace-status-metrics [data-tone="ready"] {
  border-color: #a8dbc0 !important;
  background: #edfbf4 !important;
  color: #08764a !important;
}

body.workspace-mode .workspace-status-metrics [data-tone="resolve"] {
  border-color: #efb9bf !important;
  background: #fff0f2 !important;
  color: #b4232d !important;
}

body.workspace-mode .workspace-status-metrics [data-tone="metadata"] {
  border-color: #afd0f4 !important;
  background: #eef6ff !important;
  color: #245f9f !important;
}

body.workspace-mode .workspace-actions .workspace-action-button {
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 2px !important;
  min-width: 104px !important;
  padding: 4px 12px !important;
  line-height: 1 !important;
}

body.workspace-mode .workspace-actions .workspace-action-button > span {
  font-size: 12px !important;
  line-height: 1 !important;
}

body.workspace-mode .workspace-actions .workspace-action-button > small {
  display: block !important;
  color: #64748b !important;
  font-size: 8px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

body.workspace-mode .workspace-actions .workspace-action-button[aria-busy="true"] > small {
  color: #1d4ed8 !important;
}

@media (max-width: 1180px) {
  body.workspace-mode .workspace-status-metrics span:nth-child(3) {
    display: none !important;
  }

  body.workspace-mode .workspace-actions .workspace-action-button {
    min-width: 92px !important;
    padding-inline: 9px !important;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-status-metrics {
    max-width: 100% !important;
  }
}

/* Workspace inline progress v30 */
body.workspace-mode .workspace-header {
  grid-template-columns: minmax(460px, 1fr) auto auto !important;
}

body.workspace-mode .workspace-document {
  min-width: 0 !important;
}

body.workspace-mode .workspace-document > div {
  display: grid !important;
  gap: 3px !important;
  min-width: 0 !important;
}

body.workspace-mode .workspace-title-row {
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body.workspace-mode .workspace-document #workspace-file-name {
  flex: 0 1 auto !important;
  max-width: clamp(190px, 25vw, 440px) !important;
  min-width: 120px !important;
  overflow: hidden !important;
  color: #172033 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.workspace-mode .workspace-inline-progress {
  flex: 1 1 auto !important;
  min-width: 150px !important;
  max-width: min(380px, 26vw) !important;
  overflow: hidden !important;
  color: #5f6f87 !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.workspace-mode .workspace-inline-progress[hidden] {
  display: none !important;
}

body.workspace-mode .workspace-actions #workspace-enrich-button,
body.workspace-mode .workspace-actions #workspace-match-button {
  display: inline-flex !important;
  min-width: 106px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 14px !important;
}

@media (max-width: 1180px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: minmax(300px, 1fr) auto auto !important;
  }

  body.workspace-mode .workspace-document #workspace-file-name {
    max-width: clamp(140px, 22vw, 300px) !important;
  }

  body.workspace-mode .workspace-inline-progress {
    max-width: 260px !important;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-title-row {
    align-items: start !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  body.workspace-mode .workspace-document #workspace-file-name,
  body.workspace-mode .workspace-inline-progress {
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* Workspace top bar and quality drawer polish v33 */
body.workspace-mode .workspace-header {
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  column-gap: 14px !important;
}

body.workspace-mode .workspace-document {
  min-width: 0 !important;
}

body.workspace-mode .workspace-summary-button,
body.workspace-mode .workspace-actions .button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

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

body.workspace-mode .workspace-summary-button span {
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: 1 !important;
}

body.workspace-mode .workspace-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-left: auto !important;
  flex-wrap: nowrap !important;
}

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

body.workspace-mode .workspace-actions #workspace-enrich-button,
body.workspace-mode .workspace-actions #workspace-match-button,
body.workspace-mode .workspace-actions #workspace-quality-button {
  min-width: 78px !important;
}

body.workspace-mode .workspace-actions #workspace-export-button {
  min-width: 76px !important;
}

body.workspace-mode #quality-drawer .quality-scroll-body {
  padding-top: 14px !important;
}

body.workspace-mode #quality-drawer #quality-summary {
  margin: 0 0 18px !important;
}

body.workspace-mode #quality-drawer .report-grid {
  margin-top: 0 !important;
}

@media (max-width: 1280px) {
  body.workspace-mode .workspace-summary-button,
  body.workspace-mode .workspace-actions .button {
    min-height: 34px !important;
    height: 34px !important;
    padding-inline: 9px !important;
    font-size: 11px !important;
  }

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

  body.workspace-mode .workspace-actions #workspace-enrich-button,
  body.workspace-mode .workspace-actions #workspace-match-button,
  body.workspace-mode .workspace-actions #workspace-quality-button {
    min-width: 74px !important;
  }

  body.workspace-mode .workspace-actions #workspace-export-button {
    min-width: 72px !important;
  }
}

@media (max-width: 760px) {
  body.workspace-mode .workspace-header {
    grid-template-columns: 1fr !important;
    row-gap: 10px !important;
  }

  body.workspace-mode .workspace-summary-button,
  body.workspace-mode .workspace-actions .button {
    min-height: 34px !important;
    height: 34px !important;
    font-size: 11px !important;
  }

  body.workspace-mode .workspace-summary-button {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.workspace-mode .workspace-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
  }

  .use-summary-card ul {
    grid-template-columns: 1fr;
  }
}
