.workbench-body {
  background: #edf3f5;
  color: #102638;
}

.workbench-body [hidden] {
  display: none !important;
}

.workbench-body .topbar {
  --content: 1480px;
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.46fr);
  gap: 54px;
  align-items: end;
  background:
    radial-gradient(circle at 86% 20%, rgba(22, 207, 194, 0.17), transparent 27%),
    radial-gradient(circle at 10% 95%, rgba(47, 126, 216, 0.13), transparent 24%),
    linear-gradient(145deg, #04131f, #082d49 68%, #0a4056);
  padding: 54px max(28px, calc((100vw - 1480px) / 2)) 52px;
  color: #fff;
}

.back-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-bottom: 19px;
  color: #bcd0db;
  font-size: 14px;
  font-weight: 750;
}

.back-link:hover,
.back-link:focus-visible {
  color: #8ef0c8;
}

.workbench-hero h1 {
  margin: 13px 0 14px;
  font-size: clamp(38px, 4.5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.workbench-hero .hero-lead {
  max-width: 900px;
  color: #d7e5eb;
  font-size: clamp(17px, 1.4vw, 20px);
}

.local-mode-card {
  border: 1px solid rgba(142, 240, 200, 0.25);
  border-radius: 18px;
  background: rgba(5, 22, 36, 0.55);
  padding: 22px 24px;
  box-shadow: 0 18px 45px rgba(1, 11, 18, 0.18);
  backdrop-filter: blur(14px);
}

.local-mode-card > span {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(22, 207, 194, 0.13);
  padding: 5px 9px;
  color: #8ef0c8;
  font-size: 12px;
  font-weight: 800;
}

.local-mode-card strong {
  display: block;
  margin: 13px 0 6px;
  color: #fff;
  font-size: 20px;
}

.local-mode-card p {
  margin: 0;
  color: #c9d8df;
  font-size: 13px;
  line-height: 1.75;
}

.external-intake-context {
  display: flex;
  max-width: 1480px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 26px auto 0;
  border: 1px solid #a8d5d0;
  border-radius: 14px;
  background: linear-gradient(135deg, #effaf8, #fbfdfd);
  padding: 17px 20px;
  box-shadow: 0 12px 30px rgba(7, 68, 74, 0.06);
}

.external-intake-context > div {
  min-width: 0;
}

.external-intake-context span,
.external-intake-context strong,
.external-intake-context p {
  display: block;
}

.external-intake-context span {
  color: #0d8e91;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.external-intake-context strong {
  overflow: hidden;
  margin-top: 4px;
  color: #183f54;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-intake-context p {
  margin: 5px 0 0;
  color: #607986;
  font-size: 13px;
  line-height: 1.6;
}

.external-intake-context a {
  flex: 0 0 auto;
  border: 1px solid #acd0cd;
  border-radius: 9px;
  background: #fff;
  padding: 9px 12px;
  color: #087f78;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.intake-shell,
.workspace-shell {
  max-width: 1480px;
  margin: 26px auto 0;
  border: 1px solid #d4e0e5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(7, 26, 43, 0.06);
  padding: 26px 28px;
}

.workspace-shell {
  margin-bottom: 72px;
}

.mode-heading,
.workspace-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mode-heading > div > span,
.workspace-heading > div > span,
.panel-heading > div > span,
.dialog-heading > div > span {
  color: #0d8e91;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.mode-heading h2,
.workspace-heading h2 {
  margin: 2px 0 0;
  font-size: 26px;
}

.draft-library-button {
  min-height: 44px;
  border: 1px solid #bfd0d8;
  border-radius: 10px;
  background: #fff;
  padding: 8px 13px;
  color: #304c5e;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.draft-library-button b {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  background: #e7f5f4;
  color: #087f78;
}

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

.mode-switch button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 1px 13px;
  min-height: 94px;
  border: 1px solid #d1dde3;
  border-radius: 14px;
  background: #f8fafb;
  padding: 16px;
  color: #203849;
  text-align: left;
  cursor: pointer;
}

.mode-switch button > span {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #e8eff3;
  color: #4a6575;
  font-size: 13px;
  font-weight: 900;
}

.mode-switch button strong {
  align-self: end;
  font-size: 17px;
}

.mode-switch button small {
  color: #657a88;
  font-size: 13px;
}

.mode-switch button:hover,
.mode-switch button:focus-visible,
.mode-switch button.active {
  border-color: #0d8e91;
  background: #f1fbfa;
  outline: none;
}

.mode-switch button.active > span {
  background: #0d8e91;
  color: #fff;
}

.mode-guidance {
  margin: 14px 0 0;
  border-left: 3px solid #0d8e91;
  background: #f3f9f9;
  padding: 10px 13px;
  color: #526a78;
  font-size: 13px;
}

.existing-picker {
  display: grid;
  grid-template-columns: 0.5fr 1fr 1.5fr;
  gap: 12px;
  margin-top: 16px;
  border-radius: 14px;
  background: #f5f8f9;
  padding: 15px;
}

.existing-picker label > span,
.field-grid label > span,
.calculated-field > span {
  display: block;
  margin: 0 0 6px 2px;
  color: #526978;
  font-size: 13px;
  font-weight: 750;
}

.existing-picker input,
.existing-picker select,
.field-grid input,
.field-grid select,
.field-grid textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d6dd;
  border-radius: 9px;
  background: #fff;
  padding: 9px 11px;
  color: #183144;
  font: inherit;
  font-size: 15px;
}

.field-grid textarea {
  min-height: 0;
  line-height: 1.68;
  resize: vertical;
}

.existing-picker input:focus,
.existing-picker select:focus,
.field-grid input:focus,
.field-grid select:focus,
.field-grid textarea:focus {
  border-color: #0d8e91;
  box-shadow: 0 0 0 3px rgba(13, 142, 145, 0.11);
  outline: none;
}

.existing-record-preview {
  margin-top: 12px;
  border: 1px solid #d3e0e5;
  border-radius: 12px;
  padding: 14px 16px;
}

.existing-record-preview > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.existing-record-preview span {
  border-radius: 999px;
  background: #edf3f6;
  padding: 4px 8px;
  color: #536b7a;
  font-size: 12px;
}

.existing-record-preview h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.5;
}

.existing-record-preview p {
  margin: 0;
  color: #637886;
  font-size: 13px;
}

.existing-action {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  border: 0;
  padding: 0;
}

.existing-action legend {
  width: 100%;
  color: #405767;
  font-size: 13px;
  font-weight: 800;
}

.existing-action label {
  display: flex;
  min-height: 58px;
  flex: 1 1 300px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #d5e0e5;
  border-radius: 11px;
  padding: 11px 13px;
  cursor: pointer;
}

.existing-action input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: #0d8e91;
}

.existing-action span,
.existing-action strong,
.existing-action small {
  display: block;
}

.existing-action strong {
  font-size: 14px;
}

.existing-action small {
  color: #6a7e8b;
  font-size: 12px;
}

.workspace-heading {
  padding-bottom: 20px;
}

.process-steps {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-steps li {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #f0f4f6;
  padding: 6px 11px 6px 7px;
  color: #6b7e8b;
  font-size: 12px;
  font-weight: 750;
}

.process-steps b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #dbe5e9;
  color: #506875;
}

.process-steps li.active {
  background: #e7f7f5;
  color: #087f78;
}

.process-steps li.active b {
  background: #0d8e91;
  color: #fff;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.86fr) minmax(560px, 1.14fr);
  gap: 18px;
  align-items: start;
}

.pdf-panel,
.review-panel {
  overflow: hidden;
  border: 1px solid #d5e0e5;
  border-radius: 15px;
  background: #f7fafb;
}

.panel-heading {
  min-height: 72px;
  border-bottom: 1px solid #dbe5e9;
  background: #fff;
  padding: 14px 17px;
}

.panel-heading h3 {
  margin: 1px 0 0;
  font-size: 19px;
}

.panel-heading button {
  min-height: 42px;
  border: 1px solid #bfd0d8;
  border-radius: 9px;
  background: #fff;
  padding: 7px 11px;
  color: #365466;
  font-weight: 750;
  cursor: pointer;
}

.upload-zone {
  display: grid;
  min-height: 520px;
  place-items: center;
  align-content: center;
  margin: 17px;
  border: 2px dashed #b9cbd3;
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    repeating-linear-gradient(
      45deg,
      #edf4f5 0,
      #edf4f5 12px,
      #e8f0f2 12px,
      #e8f0f2 24px
    );
  padding: 32px;
  text-align: center;
  cursor: pointer;
}

.upload-zone.dragging,
.upload-zone:hover,
.upload-zone:focus-within {
  border-color: #0d8e91;
  background: #f1fbfa;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.upload-icon {
  display: grid;
  width: 72px;
  height: 82px;
  place-items: center;
  border-radius: 10px 10px 16px 16px;
  background: #d9292f;
  box-shadow: 0 12px 25px rgba(217, 41, 47, 0.18);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.upload-zone strong {
  margin-top: 20px;
  font-size: 20px;
}

.upload-zone p {
  max-width: 460px;
  margin: 7px 0 14px;
  color: #647a88;
  font-size: 14px;
}

.upload-zone small {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: 9px;
  background: #0b3653;
  padding: 8px 15px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.file-workspace {
  padding: 14px;
}

.file-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #d6e1e6;
  border-radius: 11px;
  background: #fff;
  padding: 10px 12px;
}

.file-summary > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.pdf-badge {
  display: grid;
  width: 40px;
  height: 46px;
  flex: none;
  place-items: center;
  border-radius: 7px 7px 10px 10px;
  background: #d9292f;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.file-summary p,
.file-summary strong,
.file-summary small {
  display: block;
  min-width: 0;
  margin: 0;
}

.file-summary strong {
  overflow: hidden;
  max-width: 380px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary small {
  color: #6b7f8c;
  font-size: 12px;
}

.file-summary a {
  flex: none;
  color: #087f78;
  font-size: 12px;
  font-weight: 800;
}

.parse-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 11px 0;
  border: 1px solid #cfe0e5;
  border-radius: 11px;
  background: #f3f9fa;
  padding: 10px 12px;
}

.parse-status.error {
  border-color: #e8c5c6;
  background: #fff4f4;
}

.parse-status.complete {
  border-color: #bfe0cf;
  background: #f1faf5;
}

.status-spinner {
  width: 24px;
  height: 24px;
  flex: none;
  border: 3px solid #d4e5e8;
  border-top-color: #0d8e91;
  border-radius: 50%;
  animation: workbench-spin 0.8s linear infinite;
}

.parse-status.idle .status-spinner,
.parse-status.complete .status-spinner,
.parse-status.error .status-spinner {
  animation: none;
}

.parse-status.idle .status-spinner {
  border-color: #d4e0e5;
}

.parse-status.complete .status-spinner {
  position: relative;
  border-color: #2ca56d;
}

.parse-status.complete .status-spinner::after {
  position: absolute;
  width: 7px;
  height: 12px;
  border-right: 2px solid #2ca56d;
  border-bottom: 2px solid #2ca56d;
  content: "";
  inset: 2px 5px;
  transform: rotate(45deg);
}

.parse-status strong,
.parse-status p {
  display: block;
  margin: 0;
}

.parse-status strong {
  font-size: 13px;
}

.parse-status p {
  color: #627886;
  font-size: 12px;
}

.pdf-preview-wrap {
  overflow: hidden;
  border: 1px solid #cbd9df;
  border-radius: 11px;
  background: #4a5156;
}

.pdf-preview-wrap iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: #fff;
}

.preview-fallback {
  background: #fff;
  padding: 9px 12px;
  color: #6c7f8b;
  font-size: 12px;
}

.review-heading {
  position: sticky;
  z-index: 4;
  top: 72px;
}

.review-status {
  flex: none;
  border-radius: 999px;
  background: #edf2f5;
  padding: 5px 9px;
  color: #637987;
  font-size: 12px;
  font-weight: 800;
}

.review-status.ready {
  background: #e5f6ec;
  color: #1c7d50;
}

.empty-review {
  display: grid;
  min-height: 590px;
  place-items: center;
  align-content: center;
  padding: 30px;
  text-align: center;
}

.empty-review > span {
  color: #c7d4da;
  font-size: 70px;
  font-weight: 900;
  line-height: 1;
}

.empty-review h4 {
  margin: 11px 0 5px;
  font-size: 20px;
}

.empty-review p {
  max-width: 490px;
  margin: 0;
  color: #637987;
  font-size: 14px;
}

#review-form {
  background: #fff;
}

.review-alert {
  margin: 14px 15px 0;
  border: 1px solid #e1c783;
  border-left: 4px solid #d5a62b;
  border-radius: 10px;
  background: #fffaf0;
  padding: 11px 13px;
  color: #5d4a20;
  font-size: 13px;
}

.review-alert.error {
  border-color: #e4babb;
  border-left-color: #d9292f;
  background: #fff3f3;
  color: #80262a;
}

.review-alert strong {
  display: block;
  color: inherit;
}

.review-alert ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.review-tabs {
  position: sticky;
  z-index: 3;
  top: 143px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #d9e3e7;
  background: #fff;
  padding: 12px 14px 0;
}

.review-tabs button {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #607583;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.review-tabs button:hover,
.review-tabs button:focus-visible,
.review-tabs button.active {
  border-bottom-color: #0d8e91;
  color: #087f78;
  outline: none;
}

.review-tab-panel {
  padding: 17px 16px 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field-grid .wide-field {
  grid-column: 1 / -1;
}

.field-grid label > span b,
.domain-fieldset legend b {
  color: #d9292f;
}

.field-grid [aria-invalid="true"] {
  border-color: #d9292f;
  background: #fff8f8;
}

.field-grid input[readonly] {
  background: #f1f5f6;
  color: #536a78;
}

.domain-fieldset {
  margin: 0 0 14px;
  border: 1px solid #d5e0e5;
  border-radius: 11px;
  padding: 12px 13px 13px;
}

.domain-fieldset legend {
  padding: 0 5px;
  color: #425b6b;
  font-size: 13px;
  font-weight: 800;
}

#domain-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#domain-checkboxes label {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  border: 1px solid #d3dfe4;
  border-radius: 999px;
  padding: 7px 11px;
  color: #4e6574;
  font-size: 13px;
  cursor: pointer;
}

#domain-checkboxes label:has(input:checked) {
  border-color: #0d8e91;
  background: #eaf8f6;
  color: #087f78;
}

#domain-checkboxes input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #0d8e91;
}

.calculated-field {
  min-height: 86px;
  border: 1px solid #d5e0e5;
  border-radius: 10px;
  background: #f4f8f9;
  padding: 10px 12px;
}

.calculated-field strong,
.calculated-field small {
  display: block;
}

.calculated-field strong {
  color: #0b3653;
  font-size: 24px;
}

.calculated-field small {
  color: #6b7e8b;
  font-size: 11px;
}

.science-boundary,
.local-limit-note {
  margin-top: 14px;
  border: 1px solid #d8c98c;
  border-radius: 11px;
  background: #fffaf0;
  padding: 12px 14px;
}

.science-boundary strong,
.local-limit-note strong {
  color: #5a481e;
}

.science-boundary p,
.local-limit-note p {
  margin: 3px 0 0;
  color: #6a5b37;
  font-size: 13px;
}

.source-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 13px;
}

.source-summary div {
  border: 1px solid #d8e3e7;
  border-radius: 10px;
  background: #f6f9fa;
  padding: 11px 12px;
}

.source-summary span,
.source-summary strong {
  display: block;
}

.source-summary span {
  color: #6b7f8c;
  font-size: 11px;
}

.source-summary strong {
  margin-top: 2px;
  color: #17384b;
  font-size: 16px;
}

.provenance-list {
  display: grid;
  gap: 9px;
}

.suggestion-notice {
  border: 1px solid #c9ddd8;
  border-radius: 10px;
  background: #eef9f6;
  padding: 10px 12px;
  color: #295b58;
  font-size: 12px;
  line-height: 1.7;
}

.provenance-card {
  border: 1px solid #d7e2e7;
  border-radius: 10px;
  padding: 11px 12px;
}

.provenance-card.suggestion-card {
  border-color: #c9ddd8;
  background: #fbfffe;
}

.provenance-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provenance-card header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.provenance-card header strong {
  font-size: 14px;
}

.provenance-card header span {
  border-radius: 999px;
  background: #edf3f5;
  padding: 3px 8px;
  color: #526a78;
  font-size: 11px;
  font-weight: 750;
}

.provenance-card header button {
  min-height: 32px;
  border: 1px solid #9ec8c2;
  border-radius: 999px;
  background: #fff;
  padding: 4px 9px;
  color: #16706d;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.provenance-card header button:hover,
.provenance-card header button:focus-visible {
  border-color: #0d8e91;
  outline: 3px solid rgba(13, 142, 145, 0.16);
  outline-offset: 2px;
}

.provenance-card header button:disabled {
  border-color: #c7d8d5;
  background: #eef5f3;
  color: #6b817f;
  cursor: default;
}

.provenance-card p {
  margin: 7px 0 0;
  border-left: 3px solid #cbdadf;
  padding-left: 10px;
  color: #536a78;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.form-errors {
  margin: 0 16px 14px;
  border: 1px solid #e2b8b9;
  border-radius: 10px;
  background: #fff3f3;
  padding: 11px 13px;
  color: #86282d;
  font-size: 13px;
}

.review-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid #d9e3e7;
  background: rgba(255, 255, 255, 0.97);
  padding: 13px 16px;
  backdrop-filter: blur(12px);
}

.review-actions button {
  min-height: 44px;
  border-radius: 9px;
  padding: 8px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.review-actions .secondary-action {
  border: 1px solid #bdccd4;
  background: #fff;
  color: #405969;
}

.review-actions .primary-action {
  border: 0;
  background: #0d8e91;
  color: #fff;
}

.review-actions .primary-action:hover,
.review-actions .primary-action:focus-visible {
  background: #087f78;
  outline: 3px solid rgba(13, 142, 145, 0.2);
  outline-offset: 2px;
}

.review-actions .medical-submit-action {
  border: 0;
  background: linear-gradient(135deg, #173f63, #0b2944);
  color: #fff;
}

.review-actions .medical-submit-action:hover,
.review-actions .medical-submit-action:focus-visible {
  background: linear-gradient(135deg, #1a4b75, #0e3659);
  outline: 3px solid rgba(23, 63, 99, 0.2);
  outline-offset: 2px;
}

.review-actions .medical-submit-action:disabled {
  background: #a7b6bd;
  cursor: not-allowed;
  outline: none;
}

.local-mode-card.connected {
  border-color: rgba(142, 240, 200, 0.48);
  background: rgba(8, 61, 75, 0.64);
}

.local-mode-card.connected > span {
  color: #8ef0c8;
}

.drafts-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid #cbd9df;
  border-radius: 16px;
  background: #f5f8f9;
  padding: 0;
  box-shadow: 0 30px 90px rgba(4, 19, 31, 0.3);
}

.drafts-dialog::backdrop {
  background: rgba(3, 16, 27, 0.68);
  backdrop-filter: blur(5px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #d4e0e5;
  background: #fff;
  padding: 18px 20px;
}

.dialog-heading h2 {
  margin: 2px 0 3px;
  font-size: 24px;
}

.dialog-heading p {
  margin: 0;
  color: #637986;
  font-size: 12px;
}

.dialog-heading button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border: 1px solid #c7d4da;
  border-radius: 50%;
  background: #fff;
  color: #324d5e;
  font-size: 24px;
  cursor: pointer;
}

.drafts-list {
  display: grid;
  max-height: 510px;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 18px;
}

.draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  border: 1px solid #d3dfe4;
  border-radius: 12px;
  background: #fff;
  padding: 13px 14px;
}

.draft-card > div:first-child {
  min-width: 0;
}

.draft-card h3 {
  overflow: hidden;
  margin: 5px 0 3px;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-card p {
  margin: 0;
  color: #667b88;
  font-size: 12px;
}

.draft-card .draft-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.draft-card .draft-meta span {
  border-radius: 999px;
  background: #edf3f5;
  padding: 3px 7px;
  color: #526978;
  font-size: 10px;
}

.draft-card .draft-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.draft-card button {
  min-height: 40px;
  border: 1px solid #c6d4da;
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: #365465;
  font-weight: 750;
  cursor: pointer;
}

.draft-card button.delete {
  color: #a52a30;
}

.draft-empty {
  padding: 48px 20px;
  color: #667b88;
  text-align: center;
}

.draft-import {
  border-top: 1px solid #d4e0e5;
  background: #fff;
  padding: 13px 18px;
}

.draft-import label {
  display: block;
  margin-bottom: 6px;
  color: #405868;
  font-size: 12px;
  font-weight: 800;
}

.draft-import input {
  width: 100%;
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 2000;
  right: 20px;
  bottom: 20px;
  max-width: min(430px, calc(100vw - 40px));
  border: 1px solid #aed9c3;
  border-radius: 11px;
  background: #edf9f3;
  box-shadow: 0 15px 45px rgba(7, 26, 43, 0.16);
  padding: 11px 14px;
  color: #216b48;
  font-size: 13px;
  font-weight: 750;
}

.toast.error {
  border-color: #e1b6b7;
  background: #fff2f2;
  color: #912b31;
}

.workbench-body footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #071a2b;
  padding: 28px max(28px, calc((100vw - 1480px) / 2));
  color: #d5e0e8;
}

.workbench-body footer > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workbench-body footer p {
  margin: 0;
  color: #9fb2bd;
  font-size: 12px;
}

@keyframes workbench-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .workbench-hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .local-mode-card {
    max-width: 720px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .pdf-preview-wrap iframe {
    height: 620px;
  }

  .review-heading,
  .review-tabs,
  .review-actions {
    position: static;
  }
}

@media (max-width: 780px) {
  .workbench-body .global-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workbench-hero {
    padding: 40px 18px;
  }

  .workbench-hero h1 {
    font-size: 40px;
  }

  .intake-shell,
  .workspace-shell,
  .external-intake-context {
    margin-top: 16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 18px 14px;
  }

  .external-intake-context {
    align-items: stretch;
    flex-direction: column;
  }

  .external-intake-context strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .external-intake-context a {
    text-align: center;
  }

  .workspace-shell {
    margin-bottom: 40px;
  }

  .mode-heading,
  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .existing-picker {
    grid-template-columns: 1fr;
  }

  .process-steps {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .process-steps li {
    flex: none;
  }

  .workspace-grid {
    gap: 14px;
  }

  .upload-zone {
    min-height: 380px;
    margin: 12px;
    padding: 24px 18px;
  }

  .file-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-summary strong {
    max-width: min(70vw, 430px);
  }

  .pdf-preview-wrap iframe {
    height: 58dvh;
    min-height: 420px;
  }

  .review-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid .wide-field {
    grid-column: 1;
  }

  .field-grid input,
  .field-grid select,
  .field-grid textarea,
  .existing-picker input,
  .existing-picker select {
    font-size: 16px;
  }

  .source-summary {
    grid-template-columns: 1fr;
  }

  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .review-actions button {
    width: 100%;
  }

  .draft-card {
    grid-template-columns: 1fr;
  }

  .draft-card .draft-actions {
    justify-content: flex-start;
  }

  .workbench-body footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 18px;
  }
}

@media (max-width: 480px) {
  .mode-switch button {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 13px;
  }

  .local-mode-card {
    padding: 17px;
  }

  #domain-checkboxes {
    display: grid;
    grid-template-columns: 1fr;
  }

  #domain-checkboxes label {
    border-radius: 10px;
  }

  .drafts-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .dialog-heading {
    padding: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-spinner {
    animation: none;
  }

  .mode-switch button,
  .upload-zone {
    transition: none;
  }
}
