:root {
  --ink: #0c251f;
  --muted: #60736e;
  --line: #cfe0d9;
  --soft: #eef7f2;
  --panel: #ffffff;
  --green: #0f5a4d;
  --green-2: #2eb67d;
  --amber: #a15f00;
  --red: #a1262d;
  --blue: #334d8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(#fbfdfc 0, #fbfdfc 300px, #eef7f2 300px, #eef7f2 100%);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid #b7d4ca;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(12, 37, 31, 0.08);
}

.brand {
  display: grid;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

.brand-mark {
  font-family: Georgia, serif;
  font-size: 28px;
  letter-spacing: 6px;
}

.nav {
  display: flex;
  gap: 28px;
  font-weight: 700;
  font-size: 14px;
}

.nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-color: var(--green);
}

.logout-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.logout-form button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--green);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 48px 28px 72px;
}

.hero,
.paper-header,
.panel,
.library {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(12, 37, 31, 0.06);
}

.hero,
.paper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 150px;
  padding: 30px 36px;
  border-radius: 8px;
}

.review-header {
  align-items: flex-start;
  min-height: 0;
  gap: 24px;
  padding: 24px 28px;
}

.review-title-block {
  min-width: 0;
}

.review-title-block h1 {
  max-width: 980px;
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.12;
}

.review-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero.slim {
  min-height: 120px;
}

.dashboard-hero {
  border-left: 6px solid var(--green);
  background:
    linear-gradient(90deg, rgba(238, 247, 242, 0.95), rgba(255, 255, 255, 0.92)),
    #fff;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.auth-shell {
  display: grid;
  gap: 28px;
}

.auth-copy {
  max-width: 760px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 8px;
}

.hero-actions,
.row-actions,
.decision-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions {
  justify-content: flex-end;
}

.row-actions {
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
  width: 100%;
}

.row-actions .button.compact,
.row-action-menu > summary {
  min-width: 74px;
  white-space: nowrap;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.button.secondary {
  background: #fff;
  color: var(--green);
}

.button.danger {
  border-color: var(--red);
  background: #fff;
  color: var(--red);
}

.button.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.button:disabled,
.button.loading {
  opacity: 0.72;
  cursor: progress;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 37, 31, 0.36);
  backdrop-filter: blur(3px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-box {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(12, 37, 31, 0.22);
  text-align: center;
}

.loading-cancel {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.loading-box p {
  margin-bottom: 0;
  color: var(--muted);
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid #dce9e4;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 28px;
  margin: 34px 0;
}

.workflow-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.workflow-card {
  position: relative;
  min-width: 0;
  min-height: 174px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(12, 37, 31, 0.06);
}

.workflow-card::after {
  content: "";
  position: absolute;
  right: -13px;
  top: 50%;
  width: 24px;
  height: 1px;
  background: #9dc7ba;
}

.workflow-card:last-child::after {
  display: none;
}

.workflow-card .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border: 1px solid #9dc7ba;
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
}

.workflow-card strong {
  display: block;
  margin: 18px 0 8px;
  font-size: clamp(36px, 4vw, 50px);
  line-height: 0.9;
}

.workflow-card h2 {
  margin-bottom: 6px;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.workflow-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.project-card {
  display: grid;
  gap: 18px;
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(12, 37, 31, 0.06);
}

.project-card:hover {
  border-color: var(--green);
  box-shadow: 0 14px 28px rgba(12, 37, 31, 0.12);
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.project-metrics span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dce9e4;
  border-radius: 8px;
  background: #f7fbf9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.project-metrics strong {
  color: var(--ink);
  font-size: 24px;
}

.project-card-footer,
.member-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-card-footer {
  justify-content: space-between;
  color: var(--green);
  font-weight: 900;
}

.archive-list {
  display: grid;
  gap: 10px;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #d8e7e1;
  border-radius: 8px;
  background: #fff;
}

.archive-row strong,
.archive-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-row small {
  margin-top: 4px;
  color: var(--muted);
}

.danger-zone {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-left: 5px solid var(--red);
}

.danger-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.paper-card {
  position: relative;
  min-width: 0;
  min-height: 130px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 7px 7px 0 rgba(15, 90, 77, 0.08), 12px 12px 0 rgba(15, 90, 77, 0.04);
}

.paper-card strong {
  display: inline-block;
  margin-right: 12px;
  font-size: clamp(38px, 4vw, 58px);
  line-height: 1;
}

.paper-card span {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.paper-card small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
}

.paper-card.blue {
  color: var(--blue);
}

.paper-card.amber {
  color: var(--amber);
}

.paper-card.green {
  color: var(--green);
}

.paper-card.red {
  color: var(--red);
}

.panel {
  margin: 24px 0;
  padding: 26px 34px;
  border-radius: 8px;
}

.warning-panel {
  border-left: 5px solid var(--amber);
  background: #fff8e8;
  color: #6f4300;
}

.success-panel {
  border-left: 5px solid var(--green-2);
  background: #edfbf4;
  color: var(--green);
}

.compact-select {
  min-height: 34px;
  max-width: 180px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.row-action-menu {
  position: relative;
  border: 0;
  padding: 0;
}

.row-action-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.row-action-menu > summary::-webkit-details-marker {
  display: none;
}

.row-action-menu[open] > div {
  position: absolute;
  right: 0;
  top: 40px;
  z-index: 8;
  display: grid;
  gap: 10px;
  width: min(260px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(12, 37, 31, 0.16);
}

.row-action-menu form,
.action-with-select {
  display: grid;
  gap: 8px;
}

.row-action-menu .button,
.row-action-menu .compact-select {
  width: 100%;
  max-width: none;
}

.bulk-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.bulk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.progress-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.35fr) 1fr;
  gap: 28px;
  align-items: center;
}

.progress-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9e4;
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-2));
}

.split,
.section-heading,
.library-head,
.paper-row {
  display: grid;
  align-items: center;
}

.split {
  grid-template-columns: 1fr auto;
  gap: 18px;
}

.upload-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #bad4cb;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: #203832;
  font-size: 13px;
  font-weight: 800;
}

.library {
  overflow: visible;
  border-radius: 8px;
}

.library-head,
.paper-row {
  grid-template-columns: minmax(320px, 1fr) 128px minmax(190px, 230px) minmax(230px, 280px);
  gap: 16px;
}

.library-head {
  padding: 18px 26px;
  background: #edf4f0;
  color: #58706a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.paper-row {
  min-width: 0;
  min-height: 120px;
  padding: 22px 22px;
  border-top: 1px solid #d8e6e1;
  background: #fff;
  border-left: 4px solid #dfe8e4;
}

.paper-row > * {
  min-width: 0;
}

.paper-row.complete {
  border-left-color: var(--green-2);
}

.paper-row.extracted,
.paper-row.awaiting-review {
  border-left-color: #e28712;
}

.paper-row.needs-attention {
  border-left-color: var(--red);
}

.study-id,
.status,
.confidence {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eaf3ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.status {
  border: 1px solid #75c7a5;
  background: #ecfbf3;
}

.paper-main p,
.error {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.paper-main h3 {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.error,
.error-panel {
  color: var(--red);
}

.review-circles span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px dashed var(--line);
  border-radius: 50%;
  color: transparent;
}

.review-circles span.done {
  border-style: solid;
  border-color: var(--green-2);
  background: var(--green-2);
  color: #fff;
}

.review-circles span.working {
  border-style: solid;
  border-color: #e4a23a;
  background: #fff3d6;
  color: #8a5700;
}

.paper-readiness {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin-top: 8px;
}

.readiness-meter {
  width: min(220px, 100%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9e4;
}

.readiness-meter span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-2));
}

.priority-panel {
  border-left: 4px solid var(--green-2);
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 220px) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #d8e7e1;
  border-radius: 8px;
  background: #fff;
}

.priority-row strong,
.priority-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-row small {
  margin-top: 4px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 18px;
}

.key-status {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.key-status.ready {
  border: 1px solid #75c7a5;
  background: #ecfbf3;
  color: var(--green);
}

.key-status.missing {
  border: 1px solid #e8b1b5;
  background: #fff4f5;
  color: var(--red);
}

.byo-key-panel,
.team-panel,
.inline-secret-form {
  display: grid;
  gap: 16px;
}

.inline-secret-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.inline-secret-form .button {
  align-self: end;
}

.member-list span {
  display: inline-grid;
  gap: 2px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #cfe0d9;
  border-radius: 8px;
  background: #f7fbf9;
  font-weight: 900;
}

.member-list small {
  color: var(--muted);
  font-weight: 700;
}

.setup-steps {
  border: 1px solid #d7e8e1;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfdfc;
}

.setup-steps ol {
  margin: 14px 0;
  padding-left: 22px;
}

.setup-steps li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.config-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
}

.config-list dt {
  color: var(--muted);
  font-weight: 900;
}

.paper-header {
  margin-bottom: 22px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(460px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.pdf-pane,
.fields-pane {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(12, 37, 31, 0.06);
}

.pdf-pane {
  position: sticky;
  top: 86px;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.pdf-pane iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 640px;
  border: 0;
  background: #f3f5f6;
}

.fields-pane {
  padding-bottom: 18px;
}

.section-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 660px;
}

.section-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #eef7f2;
}

.section-tile {
  appearance: none;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border: 1px solid #c6dcd4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.section-tile span {
  font-weight: 900;
  line-height: 1.2;
}

.section-tile small {
  color: var(--muted);
  font-weight: 800;
}

.section-tile .readiness-meter {
  width: 100%;
  height: 6px;
}

.section-tile .readiness-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green-2);
}

.section-tile.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 90, 77, 0.16);
}

.section-tile.active small {
  color: rgba(255, 255, 255, 0.8);
}

.section-tile.active .readiness-meter {
  background: rgba(255, 255, 255, 0.25);
}

.section-tile.active .readiness-meter b {
  background: #fff;
}

.section-content {
  min-width: 0;
}

.field-section {
  display: none;
  margin: 18px;
  padding: 18px;
  border: 1px solid #dce9e4;
  border-radius: 8px;
  background: #fbfdfc;
}

.field-section.active {
  display: block;
}

.field-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dce9e4;
}

.field-section-head h2 {
  margin-bottom: 0;
}

.field-section-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e9f4ef;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
}

.field-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(12, 37, 31, 0.06);
}

.field-card.approved {
  border-color: #6ed0a1;
  background: #fbfffc;
}

.field-card.needs-revision {
  border-color: #e79aa0;
  background: #fffafa;
}

.effect-review-card {
  grid-column: 1 / -1;
}

.effect-review-card.expanded {
  position: fixed;
  inset: 82px 24px 24px;
  z-index: 50;
  overflow: auto;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(12, 37, 31, 0.28);
}

.effect-review-card.expanded .effect-table-wrap {
  max-height: calc(100vh - 310px);
}

.effect-review-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d7e8e1;
  border-radius: 8px;
  background: #f5fbf8;
  flex-wrap: wrap;
}

.effect-review-summary > div {
  display: grid;
  gap: 4px;
}

.effect-table-wrap {
  overflow-x: auto;
  border: 1px solid #d7e8e1;
  border-radius: 8px;
  background: #fff;
  max-height: 540px;
  overflow-y: auto;
}

.effect-review-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.effect-review-table th,
.effect-review-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e1ebe7;
  text-align: left;
  vertical-align: top;
}

.effect-review-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f2;
  color: #526a63;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.effect-review-table tr:last-child td {
  border-bottom: 0;
}

.effect-review-table td strong,
.effect-review-table td small {
  display: block;
}

.effect-review-table td small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #bad5cc;
  border-radius: 999px;
  background: #f5fbf8;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-pill.graph_digitised {
  border-color: #e3ba73;
  background: #fff8e8;
  color: #8a5700;
}

.source-pill.reported_text,
.source-pill.reported_table,
.source-pill.manual_reviewer_entry {
  border-color: #84cfaa;
  background: #edfbf4;
  color: #126345;
}

.source-pill.graph_significance_only,
.source-pill.unclear {
  border-color: #e8b4b8;
  background: #fff2f3;
  color: var(--red);
}

.judgement-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #bad5cc;
  border-radius: 999px;
  background: #f5fbf8;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.judgement-pill.high {
  border-color: #e8b4b8;
  background: #fff2f3;
  color: var(--red);
}

.judgement-pill.some-concerns-moderate,
.judgement-pill.moderate,
.judgement-pill.some-concerns {
  border-color: #e3ba73;
  background: #fff8e8;
  color: #8a5700;
}

.judgement-pill.low {
  border-color: #84cfaa;
  background: #edfbf4;
  color: #126345;
}

.bias-review-table {
  min-width: 900px;
}

.rob-symbol {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(12, 37, 31, 0.25);
  border-radius: 50%;
  font-size: 19px;
  font-weight: 1000;
  line-height: 1;
}

.symbol-plus {
  background: #5fed48;
  color: #092118;
}

.symbol-concern,
.symbol-- {
  background: #f5ef11;
  color: #2c2b00;
}

.symbol-unknown {
  background: #78c9ff;
  color: #092118;
}

.symbol-high {
  background: #d91515;
  color: #111;
}

.symbol-NA {
  background: #e8ecea;
  color: #60736d;
}

.review-action-menu[open] > div {
  display: grid;
  width: min(320px, calc(100vw - 48px));
  gap: 8px;
}

.manual-row-panel {
  border: 1px dashed #a9cfc2;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf9;
}

.manual-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.field-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.field-top label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-top .confidence {
  max-width: 100%;
  overflow-wrap: anywhere;
}

details {
  border-top: 1px solid #e1ebe7;
  padding-top: 10px;
}

summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}

blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--green);
  background: #eef7f2;
  color: #304741;
}

.inline-link {
  color: var(--green);
  font-weight: 900;
  text-decoration: underline;
}

.empty {
  padding: 44px;
  color: var(--muted);
}

.exports {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 220px) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #d8e7e1;
  border-radius: 8px;
  background: #fff;
}

.job-row.running {
  border-color: #7bc7a9;
  background: #f4fbf8;
  box-shadow: 0 0 0 1px rgba(46, 182, 125, 0.12);
}

.job-row.running strong::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--green-2);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.job-row.queued {
  border-style: dashed;
}

.job-row.cancelling {
  border-color: #e3b15c;
  background: #fffaf0;
}

.job-row.complete {
  border-color: #bde4d0;
  background: #f8fdf9;
}

.job-row.failed,
.job-row.cancelled,
.job-row.interrupted {
  border-color: #edc2c4;
  background: #fffafa;
}

.queue-done {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.queue-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.job-row div {
  min-width: 0;
}

.job-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9e4;
}

.mini-progress span {
  display: block;
  height: 100%;
  min-width: 4px;
  background: var(--green-2);
}

.job-row.running .mini-progress span {
  width: 100% !important;
  min-width: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--green-2),
    var(--green-2) 8px,
    #62d29d 8px,
    #62d29d 16px
  );
  animation: progress-slide 1.2s linear infinite;
}

.job-row.cancelling .mini-progress span,
.job-row.queued .mini-progress span {
  width: 100% !important;
  min-width: 100%;
  background: repeating-linear-gradient(
    45deg,
    #e3b15c,
    #e3b15c 8px,
    #f0ca82 8px,
    #f0ca82 16px
  );
  animation: progress-slide 1.2s linear infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

@keyframes progress-slide {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 32px 0;
  }
}

.compact-job-panel {
  margin-bottom: 18px;
}

.exports h2 {
  margin: 0 auto 0 0;
}

.export-note {
  flex-basis: 100%;
  margin: 6px 0 0;
}

code,
pre {
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1180px) {
  .topbar,
  .hero,
  .paper-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  .stats-grid,
  .workflow-overview,
	  .progress-panel,
	  .bulk-panel,
	  .danger-zone,
	  .review-layout,
  .section-workspace,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .workflow-card::after {
    display: none;
  }

  .bulk-actions {
    justify-content: flex-start;
  }

  .library-head {
    display: none;
  }

  .paper-row {
    grid-template-columns: 1fr;
  }

  .pdf-pane {
    position: static;
  }

  .section-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .inline-secret-form {
    grid-template-columns: 1fr;
  }

  .auth-grid,
  .job-row {
    grid-template-columns: 1fr;
  }
}
