:root {
  color-scheme: light;
  --brand-black: #020b12;
  --brand-white: #fefefe;
  --brand-orange: #fca902;
  --brand-orange-ink: #9a6500;
  --brand-orange-soft: #fff4d6;
  --ink: #151d22;
  --muted: #626b70;
  --subtle: #858d91;
  --line: #dcdfdc;
  --line-strong: #c9cdca;
  --surface: #ffffff;
  --surface-muted: #f6f6f3;
  --canvas: #edefec;
  --blue: #172831;
  --blue-dark: var(--brand-black);
  --blue-soft: var(--brand-orange-soft);
  --green: #287457;
  --green-soft: #e9f5ef;
  --amber: var(--brand-orange-ink);
  --amber-soft: var(--brand-orange-soft);
  --red: #a33c3c;
  --red-soft: #fbecec;
  --shadow: 0 8px 28px rgba(2, 11, 18, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

button,
a,
input,
select,
textarea,
[tabindex] {
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid rgba(252, 169, 2, 0.56);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: white;
  background: var(--blue-dark);
  border-radius: 6px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: relative;
  min-height: 82px;
  background: var(--brand-black);
  border-bottom: 0;
  box-shadow: 0 8px 24px rgba(2, 11, 18, 0.14);
}

.app-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--brand-orange);
  pointer-events: none;
}

.header-inner {
  width: min(1500px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  color: var(--brand-white);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: clamp(150px, 11vw, 170px);
  height: auto;
  display: block;
  flex: 0 0 auto;
  background: var(--brand-black);
}

.brand-product {
  display: grid;
  gap: 5px;
  padding-left: 16px;
  color: rgba(254, 254, 254, 0.72);
  border-left: 1px solid rgba(254, 254, 254, 0.2);
  line-height: 1.1;
}

.brand-product strong {
  color: var(--brand-white);
  font-size: 14px;
  letter-spacing: 0.035em;
}

.brand-product small {
  color: rgba(254, 254, 254, 0.64);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.brand:focus-visible {
  border-radius: 4px;
  outline-color: var(--brand-orange);
}

.header-actions,
.api-health {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 14px;
  padding: 9px 12px;
  background: rgba(254, 254, 254, 0.055);
  border: 1px solid rgba(254, 254, 254, 0.12);
  border-radius: 8px;
}

.new-analysis-button {
  min-height: 32px;
  padding: 0 11px;
  color: var(--brand-orange);
  background: transparent;
  border: 1px solid rgba(252, 169, 2, 0.64);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.new-analysis-button:hover {
  color: var(--brand-black);
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}

.api-health {
  gap: 7px;
  color: rgba(254, 254, 254, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(67, 174, 127, 0.18);
}

.api-health.is-busy .health-dot {
  background: var(--brand-orange);
  box-shadow: 0 0 0 4px rgba(252, 169, 2, 0.2);
}

.api-health.is-error .health-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(221, 88, 88, 0.2);
}

.version-label {
  padding-left: 16px;
  border-left: 1px solid rgba(254, 254, 254, 0.18);
  color: rgba(254, 254, 254, 0.58);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.workflow-nav {
  display: grid;
  grid-template-columns: auto minmax(12px, 1fr) auto minmax(12px, 1fr) auto minmax(12px, 1fr) auto minmax(12px, 1fr) auto;
  align-items: center;
  padding: 13px 20px;
  margin-bottom: 34px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-align: left;
}

.workflow-step:disabled {
  opacity: 0.5;
}

.workflow-step:not(:disabled):hover {
  color: var(--blue);
}

.workflow-step > span:last-child {
  display: grid;
  line-height: 1.25;
}

.workflow-step strong {
  font-size: 13px;
}

.workflow-step small {
  color: var(--subtle);
  font-size: 10px;
}

.step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--subtle);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.workflow-step.is-current {
  color: var(--ink);
}

.workflow-step.is-current .step-number {
  color: var(--brand-black);
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}

.workflow-step.is-complete .step-number {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.workflow-step.is-complete .step-number::before {
  content: "✓";
}

.workflow-step.is-complete .step-number {
  font-size: 0;
}

.workflow-step.is-complete .step-number::before {
  font-size: 12px;
}

.step-connector {
  height: 1px;
  margin: 0 15px;
  background: var(--line-strong);
}

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

.heading-with-aside,
.compact-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.compact-heading {
  align-items: center;
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  color: var(--brand-orange-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.015em;
}

h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.trust-note {
  max-width: 310px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--blue-soft);
  border: 1px solid #efd99f;
  border-radius: var(--radius-sm);
}

.trust-note > span:last-child {
  display: grid;
}

.trust-note strong {
  color: var(--blue-dark);
  font-size: 12px;
}

.trust-note small {
  color: #6e6656;
  font-size: 11px;
}

.trust-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-black);
  background: var(--brand-orange);
  border-radius: 50%;
  font-weight: 800;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
  gap: 20px;
  align-items: start;
}

body[data-active-view="upload"] {
  background: #f4f5f3;
}

body[data-active-view="upload"] .shell {
  width: 100%;
  padding: 0 20px 56px;
}

body[data-active-view="upload"] .workflow-nav {
  display: none;
}

body[data-active-view="upload"] #global-alert {
  width: min(860px, 100%);
  margin: 20px auto 0;
}

.upload-home {
  min-height: calc(100vh - 84px);
  padding: clamp(66px, 9vh, 112px) 0 64px;
}

.upload-home-inner {
  width: min(860px, 100%);
  margin: 0 auto;
  text-align: center;
}

.upload-hero-copy {
  width: min(760px, 100%);
  margin: 0 auto 34px;
}

.upload-overline {
  margin: 0 0 14px;
  color: var(--brand-orange-ink);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.upload-hero-copy h1 {
  max-width: none;
  margin-bottom: 16px;
  color: var(--brand-black);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.upload-hero-copy > p:last-child {
  max-width: 690px;
  margin: 0 auto;
  color: #667079;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.65;
}

.upload-composer {
  padding: 12px;
  background: var(--surface);
  border: 1px solid #d8ddda;
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(2, 11, 18, 0.1);
  text-align: left;
}

.upload-home .drop-zone {
  min-height: 118px;
  justify-content: flex-start;
  gap: 18px;
  padding: 24px;
  background: #f7f8f7;
  background-image: none;
  border: 1px solid #e1e5e2;
  border-radius: 17px;
}

.upload-home .drop-zone:hover,
.upload-home .drop-zone.is-dragging {
  background: #f1f3f1;
  border-color: #9aa6a0;
}

.upload-add-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-black);
  background: white;
  border: 1px solid #d8ddda;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 350;
  line-height: 1;
}

.upload-drop-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.upload-home .drop-zone strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.upload-home .drop-zone p {
  color: #7a8389;
  font-size: 13px;
}

.upload-select-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 18px;
  color: var(--brand-black);
  border-radius: 11px;
}

.upload-home .file-list {
  gap: 7px;
  margin-top: 8px;
}

.upload-home .file-list-empty {
  display: none;
}

.upload-home .file-item {
  padding: 10px 12px;
  background: white;
  border-color: #e3e6e4;
  border-radius: 11px;
}

.upload-composer-footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 8px 0 14px;
}

.upload-composer-footer .counter {
  color: #737d83;
  font-weight: 650;
}

.upload-start-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.upload-start-area .action-help {
  max-width: 250px;
  margin: 0;
  text-align: right;
}

.upload-start-area .primary-button {
  min-height: 46px;
  padding-inline: 22px;
  border-radius: 12px;
  white-space: nowrap;
}

.upload-footnote {
  margin: 18px 0 0;
  color: #7b8489;
  font-size: 12px;
}

.upload-card,
.settings-card,
.progress-card,
.analysis-grid > .card {
  padding: 24px;
}

.card-heading,
.progress-header,
.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-heading {
  margin-bottom: 20px;
}

.counter,
.result-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drop-zone {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 30px;
  color: var(--muted);
  background-color: #fafbfc;
  background-image: radial-gradient(#d8dfe5 0.8px, transparent 0.8px);
  background-size: 15px 15px;
  border: 1px dashed #aebbc5;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

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

.drop-zone.is-dragging {
  transform: scale(1.005);
}

.drop-zone strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
}

.drop-zone p {
  margin-bottom: 0;
  font-size: 13px;
}

.pdf-glyph {
  width: 56px;
  height: 66px;
  display: grid;
  place-items: end center;
  flex: 0 0 auto;
  padding-bottom: 12px;
  color: var(--red);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 5px 13px 5px 5px;
  box-shadow: 0 5px 12px rgba(32, 40, 50, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.secondary-button,
.primary-button,
.accept-button,
.reject-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 7px;
  font-weight: 750;
  text-decoration: none;
}

.secondary-button {
  color: var(--blue);
  background: white;
  border: 1px solid var(--line-strong);
  font-size: 12px;
}

.real-button:hover {
  border-color: var(--brand-orange);
}

.primary-button {
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
}

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

.primary-button:disabled {
  color: #f7f8fa;
  background: #9ca8b1;
  border-color: #9ca8b1;
  opacity: 0.7;
}

.full-width {
  width: 100%;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.file-list-empty {
  padding: 13px;
  color: var(--subtle);
  background: var(--surface-muted);
  border-radius: 7px;
  font-size: 12px;
  text-align: center;
}

.file-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 7px;
}

.file-item:hover {
  border-color: var(--line-strong);
}

.file-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
}

.file-meta {
  min-width: 0;
  display: grid;
}

.file-meta strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta small,
.file-size {
  color: var(--subtle);
  font-size: 10px;
}

.remove-file {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 20px;
}

.remove-file:hover {
  color: var(--red);
  background: var(--red-soft);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.field-label span {
  color: var(--subtle);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

select.form-control {
  min-height: 42px;
}

textarea.form-control {
  resize: vertical;
}

.field-help,
.action-help {
  margin: 7px 0 0;
  color: var(--subtle);
  font-size: 11px;
}

.action-help {
  text-align: center;
}

.settings-divider {
  height: 1px;
  margin: 23px 0;
  background: var(--line);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.switch-row > span:first-child {
  display: grid;
}

.switch-row strong {
  font-size: 13px;
}

.switch-row small {
  max-width: 280px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  width: 43px;
  height: 24px;
  display: block;
  padding: 3px;
  background: #a5afb8;
  border-radius: 99px;
  transition: background 150ms ease;
}

.switch-track span {
  width: 18px;
  height: 18px;
  display: block;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 150ms ease;
}

.switch input:checked + .switch-track {
  background: var(--blue);
}

.switch input:checked + .switch-track span {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(252, 169, 2, 0.5);
  outline-offset: 3px;
}

.switch input:disabled + .switch-track {
  cursor: not-allowed;
  opacity: 0.55;
}

.privacy-note {
  display: flex;
  gap: 9px;
  margin: 23px 0;
  padding: 12px;
  color: #556776;
  background: var(--surface-muted);
  border-radius: 7px;
  font-size: 11px;
}

.privacy-note span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-orange-ink);
  border: 1px solid #d5b266;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.privacy-note p {
  margin-bottom: 0;
}

.alert {
  margin-bottom: 22px;
  padding: 13px 16px;
  color: #78312f;
  background: var(--red-soft);
  border: 1px solid #efcaca;
  border-radius: var(--radius-sm);
}

.run-identity {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.run-identity small {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.run-identity code {
  max-width: 320px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-header {
  align-items: end;
}

.progress-value {
  color: var(--brand-orange-ink);
  font-size: 28px;
  line-height: 1;
}

.progress-track {
  height: 8px;
  margin: 20px 0 26px;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 99px;
}

.progress-track > span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--brand-orange);
  border-radius: inherit;
  transition: width 350ms ease;
}

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pipeline-stages li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--subtle);
}

.pipeline-stages li > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.pipeline-stages li > div {
  min-width: 0;
  display: grid;
}

.pipeline-stages strong,
.pipeline-stages small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-stages strong {
  font-size: 10px;
}

.pipeline-stages small {
  font-size: 9px;
}

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

.pipeline-stages li.is-active > span {
  color: var(--brand-black);
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.pipeline-stages li.is-done > span {
  color: white;
  background: var(--green);
  border-color: var(--green);
  font-size: 0;
}

.pipeline-stages li.is-done > span::before {
  content: "✓";
  font-size: 10px;
}

.pipeline-stages li.is-error > span {
  color: white;
  background: var(--red);
  border-color: var(--red);
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-grid div {
  min-width: 0;
  padding: 16px;
  background: white;
}

.metric-grid dt {
  color: var(--muted);
  font-size: 10px;
}

.metric-grid dd {
  margin: 3px 0 0;
  font-size: 22px;
  font-weight: 750;
}

.analysis-files {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.analysis-files li {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  background: var(--surface-muted);
  border-radius: 7px;
}

.analysis-files .file-state {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.analysis-files .file-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.analysis-files small {
  color: var(--subtle);
  font-size: 10px;
}

.view-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.export-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.results-heading-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.document-select-field {
  display: grid;
  gap: 4px;
}

.document-select-field > span {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.document-select-field select {
  width: min(300px, 31vw);
  min-height: 44px;
  padding: 0 32px 0 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 650;
}

.export-group > span {
  padding: 0 7px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.export-group button {
  min-height: 32px;
  padding: 0 11px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 0;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.export-group button:hover {
  color: white;
  background: var(--blue);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 1px;
  margin: 0 0 20px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-strip > div {
  min-width: 0;
  padding: 15px;
  background: white;
}

.summary-strip dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-strip dd {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 750;
}

.results-card {
  overflow: hidden;
}

.toolbar,
.review-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 0 12px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 7px;
}

.search-field:focus-within {
  background: white;
  border-color: var(--brand-orange);
}

.search-field > span {
  color: var(--subtle);
  font-size: 21px;
}

.search-field input {
  width: 100%;
  min-height: 39px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.filter-field select {
  min-height: 37px;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 11px;
}

.result-count {
  min-width: 90px;
  text-align: right;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.2fr) minmax(390px, 0.8fr);
  min-height: 610px;
}

.table-region {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
}

.table-scroll {
  max-height: 760px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 13px;
  color: var(--muted);
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf0f2;
  font-size: 12px;
  vertical-align: middle;
}

tr.is-selected td {
  background: var(--blue-soft);
}

.tag-button {
  max-width: 100%;
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  border: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: left;
  word-break: normal;
}

.tag-primary,
.tag-continuity {
  display: block;
}

.tag-continuity {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
}

.tag-button:hover {
  text-decoration: underline;
}

.type-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #3d4a56;
}

.type-copy {
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.type-copy strong {
  color: var(--ink);
  font-size: 11px;
}

.type-copy small {
  color: var(--subtle);
  font-size: 9px;
}

.type-symbol {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 900;
}

.confidence-cell {
  min-width: 116px;
}

.confidence-value {
  font-weight: 750;
}

.mini-meter {
  width: 54px;
  height: 3px;
  display: inline-block;
  margin-left: 7px;
  overflow: hidden;
  background: var(--line);
  border-radius: 99px;
  vertical-align: middle;
}

.mini-meter span {
  height: 100%;
  display: block;
  background: var(--brand-orange);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-confirmed,
.status-reviewer_accepted,
.reviewer-accepted {
  color: var(--green);
  background: var(--green-soft);
  border-color: #c9e5d7;
}

.status-probable {
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: #ead5a4;
}

.status-review,
.reviewer-pending {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #efdbaf;
}

.status-corrected {
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: #ead5a4;
}

.status-rejected,
.status-false_positive,
.reviewer-rejected {
  color: var(--red);
  background: var(--red-soft);
  border-color: #efcaca;
}

.row-open-button {
  width: 29px;
  height: 29px;
  padding: 0;
  color: var(--blue);
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.row-open-button:hover {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.entity-detail {
  min-width: 0;
  background: #fbfcfd;
}

.detail-placeholder {
  min-height: 610px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px;
  color: var(--subtle);
  text-align: center;
}

.detail-placeholder-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 50%;
  font-size: 24px;
}

.detail-placeholder strong {
  color: var(--ink);
}

.detail-placeholder p {
  max-width: 300px;
  margin: 5px 0 0;
  font-size: 12px;
}

#detail-content {
  padding: 20px;
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-header > div {
  min-width: 0;
}

.detail-header h2 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 15px 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.detail-fact {
  min-width: 0;
  padding: 9px;
  background: white;
}

.detail-fact.is-wide {
  grid-column: 1 / -1;
}

.detail-fact.is-wide strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

.detail-fact small {
  color: var(--subtle);
  font-size: 9px;
  text-transform: uppercase;
}

.detail-fact strong {
  margin-top: 2px;
  font-size: 11px;
}

.tag-context {
  margin: 18px 0 0;
}

.occurrence-picker {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(190px, 1fr);
  align-items: center;
  gap: 5px 10px;
  margin-top: 14px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--brand-orange-soft);
  border: 1px solid rgba(154, 101, 0, 0.28);
  border-radius: 7px;
}

.occurrence-picker > span {
  color: var(--brand-orange-ink);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.occurrence-picker > select {
  min-width: 0;
  margin: 0;
}

.occurrence-picker > small {
  grid-column: 1 / -1;
  color: #66552c;
  font-size: 9px;
}

.tag-metadata-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.tag-metadata-item {
  min-width: 0;
  padding: 10px 11px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.tag-metadata-item dt {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tag-metadata-item dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.isa-interpretation-scope {
  margin: -2px 0 9px;
  color: var(--muted);
  font-size: 10px;
}

.isa-letter-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.isa-letter-card {
  min-width: 0;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.isa-letter-card.is-ambiguous {
  background: var(--amber-soft);
  border-color: rgba(154, 101, 0, 0.42);
}

.isa-letter-card.is-unmapped {
  border-style: dashed;
}

.isa-letter-card-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.isa-letter-token {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--brand-black);
  background: var(--brand-orange);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 950;
}

.isa-letter-position {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.isa-letter-state {
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.isa-letter-state.is-warning {
  color: var(--amber);
}

.isa-letter-candidates {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.isa-letter-candidate {
  display: grid;
  gap: 1px;
}

.isa-letter-role {
  color: var(--subtle);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.isa-letter-meaning {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.isa-letter-project-flag {
  width: fit-content;
  margin-top: 3px;
  padding: 2px 5px;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
}

.isa-letter-unmapped,
.isa-interpretation-placeholder,
.isa-interpretation-notice {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.isa-interpretation-notice {
  margin-top: 8px;
  padding: 7px 8px;
  background: var(--surface-muted);
  border-left: 3px solid var(--line-strong);
  border-radius: 4px;
}

.isa-interpretation-notice.is-warning {
  color: #6f4a00;
  background: var(--amber-soft);
  border-left-color: var(--brand-orange);
}

.isa-interpretation-notice.is-error,
.coverage-isa-interpretation.is-error .isa-interpretation-placeholder {
  color: var(--red);
  background: var(--red-soft);
  border-left-color: var(--red);
}

.relation-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.relation-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(100px, 0.45fr) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 9px 11px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
}

.relation-item span {
  overflow-wrap: anywhere;
}

.relation-item small {
  color: var(--muted);
}

.viewer-section,
.evidence-section,
.decision-section,
.crop-viewer {
  margin: 18px 0 0;
}

.subsection-heading {
  margin-bottom: 9px;
}

.subsection-heading > span {
  color: var(--subtle);
  font-size: 10px;
}

.page-viewer {
  margin: 0;
}

.viewer-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin: -3px 0 7px;
}

.viewer-controls button,
.focus-controls button,
.review-navigation button {
  min-width: 30px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--blue-dark);
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.viewer-controls output,
.focus-controls output {
  min-width: 44px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.page-canvas {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: auto;
  max-height: 520px;
  background-color: #dfe4e7;
  background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.28) 25%, transparent 25%);
  background-size: 16px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.page-sheet {
  position: relative;
  width: 100%;
  min-width: 75%;
  transition: width 150ms ease;
}

.page-sheet img {
  width: 100%;
  height: auto;
  display: block;
}

.bbox-overlay {
  position: absolute;
  display: none;
  border: 2px solid #e33f3f;
  background: rgba(227, 63, 63, 0.12);
  box-shadow: 0 0 0 1px white, 0 0 0 4px rgba(227, 63, 63, 0.18);
  pointer-events: none;
}

.viewer-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(245, 247, 248, 0.92);
  font-size: 11px;
}

.page-viewer figcaption {
  margin-top: 6px;
  color: var(--subtle);
  font-size: 9px;
}

.crop-viewer {
  padding: 0;
}

.crop-viewer img {
  width: 100%;
  max-height: 230px;
  display: block;
  object-fit: contain;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.evidence-list {
  display: grid;
  gap: 7px;
}

.evidence-card {
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}

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

.source-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-dark);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--brand-orange);
  border-radius: 50%;
}

.evidence-confidence {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.evidence-text {
  margin: 7px 0 0;
  color: #34414d;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.evidence-raw,
.evidence-trace {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  line-height: 1.45;
}

.evidence-raw {
  padding: 6px 7px;
  color: #4e3f1f;
  background: var(--brand-orange-soft);
  border-left: 3px solid var(--brand-orange);
}

.evidence-trace {
  color: var(--subtle);
}

.geometry-evidence-summary {
  margin-top: 8px;
  padding: 9px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.geometry-evidence-summary.is-confirmed {
  background: var(--green-soft);
  border-color: #bddbce;
}

.geometry-match-status {
  width: fit-content;
  margin: 0 0 8px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.geometry-match-status.is-confirmed {
  color: #1f5f47;
  background: white;
  border: 1px solid #91c6b1;
}

.geometry-match-status.is-inconclusive {
  color: #6f4a00;
  background: var(--amber-soft);
  border: 1px solid rgba(154, 101, 0, 0.28);
}

.geometry-match-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.geometry-match-fact {
  min-width: 0;
  padding: 7px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(201, 205, 202, 0.72);
  border-radius: 5px;
}

.geometry-match-fact dt {
  color: var(--subtle);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.geometry-match-fact dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.geometry-match-reason {
  margin: 8px 0 0;
  color: #34414d;
  font-size: 9px;
  line-height: 1.45;
}

.context-status {
  margin: 14px 0 0;
  padding: 9px 11px;
  color: #4e3f1f;
  background: var(--amber-soft);
  border: 1px solid rgba(154, 101, 0, 0.28);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.context-status.is-loading {
  border-left: 4px solid var(--brand-orange);
}

.context-status.is-incomplete {
  color: #7b2929;
  background: var(--red-soft);
  border-color: #e5bcbc;
}

.context-status.is-ready {
  color: #1f5f47;
  background: var(--green-soft);
  border-color: #bddbce;
}

.evidence-meta {
  margin: 5px 0 0;
  color: var(--subtle);
  font-size: 9px;
}

.decision-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.correction-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 10px;
}

.correction-grid .field-label {
  margin: 0;
}

.correction-grid .form-control {
  margin-top: 5px;
}

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

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

.reference-wide-field {
  grid-column: span 2;
}

.decision-section .detail-taxonomy-grid {
  grid-template-columns: 1fr;
}

.decision-section .reference-correction-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.decision-actions {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 8px;
  margin-top: 10px;
}

.draft-status,
.review-impact-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.45;
}

.draft-status {
  color: #1f5f47;
  background: var(--green-soft);
  border: 1px solid #bddbce;
  font-weight: 750;
}

.review-impact-note {
  color: #713434;
  background: var(--red-soft);
  border: 1px solid #ebcaca;
}

.reject-button {
  color: var(--red);
  background: white;
  border: 1px solid #e1b6b6;
}

.reject-button:hover {
  background: var(--red-soft);
}

.accept-button {
  color: white;
  background: var(--green);
  border: 1px solid var(--green);
}

.accept-button:hover {
  background: #1f5f47;
}

.decision-actions button:disabled {
  opacity: 0.6;
}

.empty-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  color: var(--subtle);
  text-align: center;
}

.empty-state > span {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 34px;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  margin: 3px 0 0;
  font-size: 12px;
}

.review-tally {
  min-width: 120px;
  padding: 12px 20px;
  background: var(--amber-soft);
  border: 1px solid #efdbaf;
  border-radius: var(--radius-sm);
  text-align: center;
}

.review-tally strong,
.review-tally span {
  display: block;
}

.review-tally strong {
  color: var(--amber);
  font-size: 25px;
  line-height: 1;
}

.review-tally span {
  margin-top: 4px;
  color: #775a27;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.review-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.review-toolbar .search-field {
  min-width: 0;
  width: 100%;
}

.review-toolbar .filter-field {
  width: 100%;
}

.review-toolbar .filter-field select {
  min-width: 0;
  flex: 1;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.56fr) minmax(650px, 1.44fr);
  align-items: start;
  gap: 14px;
}

.review-queue-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.review-list {
  display: grid;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 7px;
}

.review-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 6px;
  font: inherit;
  text-align: left;
}

.review-item:hover {
  background: #f7f9fa;
}

.review-item.is-selected {
  background: #fff7e7;
  border-left-color: var(--brand-orange);
  box-shadow: inset 0 0 0 1px #f0d8a4;
}

.review-identity {
  min-width: 0;
}

.review-identity strong {
  display: block;
  overflow: hidden;
  color: var(--blue-dark);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-identity small {
  color: var(--muted);
  font-size: 10px;
}

.review-reasons {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.review-reasons p {
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-reasons p::before {
  content: "•";
  margin-right: 6px;
  color: var(--amber);
}

.review-score {
  display: none;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.review-score strong {
  font-size: 17px;
}

.review-score span {
  display: grid;
  color: var(--muted);
  font-size: 9px;
}

.review-empty {
  min-height: 220px;
}

.review-studio {
  min-width: 0;
  padding: 18px;
  position: sticky;
  top: 12px;
}

.review-studio-placeholder {
  min-height: 560px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.review-studio-placeholder > span {
  color: var(--brand-orange);
  font-size: 40px;
}

.review-studio-placeholder p {
  margin: 4px 0 0;
  font-size: 11px;
}

.review-studio-header,
.review-studio-header > div,
.review-navigation,
.review-figure figcaption,
.focus-controls {
  display: flex;
  align-items: center;
}

.review-studio-header {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.review-studio-header > div:first-child {
  min-width: 0;
  display: block;
}

.review-studio-header h2 {
  overflow-wrap: anywhere;
}

.review-machine-decision,
#review-machine-decision {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.review-navigation {
  flex: none;
  gap: 5px;
}

.review-navigation > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.review-visual-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(360px, 1.32fr);
  gap: 12px;
  margin-top: 14px;
}

.review-figure {
  min-width: 0;
  margin: 0;
}

.review-figure figcaption {
  min-height: 31px;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.review-figure figcaption strong {
  font-size: 11px;
}

.review-figure figcaption > span:not(.focus-controls) {
  color: var(--subtle);
  font-size: 9px;
}

.focus-controls {
  gap: 4px;
}

.review-overview {
  position: relative;
  min-height: 300px;
  max-height: 420px;
  display: grid;
  place-items: start center;
  overflow: auto;
  background: #dfe4e7;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.review-overview-sheet {
  position: relative;
  width: 100%;
}

.review-overview-sheet img {
  width: 100%;
  height: auto;
  display: block;
}

#review-focus-canvas {
  width: 100%;
  min-height: 300px;
  display: block;
  background: #dfe4e7;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.focus-figure {
  position: relative;
}

.focus-message {
  position: absolute;
  inset: 46px 12px 12px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  background: rgba(245, 247, 248, 0.9);
  border-radius: 6px;
  font-size: 10px;
  text-align: center;
}

.review-sources,
.review-correction {
  margin-top: 17px;
}

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

.source-card {
  min-width: 0;
  padding: 11px;
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 7px;
}

.source-card.source-ocr {
  border-top-color: var(--brand-orange);
}

.source-card.source-vision {
  border-top-color: #7b5ca8;
}

.source-card.source-geometry {
  border-top-color: #286486;
}

.source-card.source-automatic {
  border-top-color: var(--green);
}

.source-card.source-manual {
  border-top-color: var(--brand-orange);
  background: #fffaf0;
}

.source-card.is-missing {
  background: var(--surface-muted);
  border-top-color: var(--line-strong);
}

.source-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.source-card header strong {
  font-size: 10px;
  text-transform: uppercase;
}

.source-card header span,
.source-description,
.source-meta,
.source-empty {
  color: var(--subtle);
  font-size: 9px;
}

.source-description {
  margin: 4px 0 8px;
}

.source-reading {
  margin: 5px 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.source-meta,
.source-empty {
  margin: 4px 0 0;
}

.automatic-reason {
  margin: 4px 0 0;
  color: #3d4a56;
  font-size: 10px;
}

.automatic-reason::before {
  content: "•";
  margin-right: 5px;
  color: var(--brand-orange);
}

.review-correction {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.machine-values {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.review-decision-actions {
  display: grid;
  grid-template-columns: 0.85fr 1fr 1.35fr;
  gap: 7px;
  margin-top: 10px;
}

.review-decision-actions button {
  min-height: 38px;
}

.review-decision-actions button:disabled {
  opacity: 0.55;
}

.review-history {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}

.review-history > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.review-history > div span,
.review-history small {
  color: var(--muted);
}

.review-history ol {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.review-history li {
  display: grid;
  gap: 2px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.review-history li p {
  margin: 2px 0 0;
  color: #3d4a56;
}

.review-history li.is-empty {
  color: var(--muted);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  color: white;
  background: #263442;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  background: #843a3a;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .workflow-step small,
  .pipeline-stages small {
    display: none;
  }

  .summary-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .results-layout {
    grid-template-columns: minmax(480px, 1fr) minmax(340px, 0.75fr);
  }

  .review-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .review-score {
    display: none;
  }
}

@media (max-width: 900px) {
  .shell,
  .header-inner {
    width: min(100% - 24px, 1500px);
  }

  .workflow-nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 10px;
  }

  .step-connector,
  .workflow-step small {
    display: none;
  }

  .workflow-step {
    justify-content: center;
  }

  .heading-with-aside,
  .compact-heading {
    align-items: start;
    flex-direction: column;
  }

  .trust-note {
    max-width: 100%;
  }

  .results-heading-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .document-select-field select {
    width: 100%;
  }

  .upload-layout,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-stages {
    grid-template-columns: repeat(4, 1fr);
    row-gap: 14px;
  }

  .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-field {
    min-width: 100%;
  }

  .results-layout {
    display: block;
  }

  .table-region {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .entity-detail {
    min-height: 0;
  }

  .detail-placeholder {
    min-height: 260px;
  }

  .review-item {
    grid-template-columns: 1fr auto;
  }

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

  .review-list {
    max-height: 380px;
  }

  .review-studio {
    position: static;
  }

  .review-reasons {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .review-visual-grid {
    grid-template-columns: minmax(220px, 0.75fr) minmax(330px, 1.25fr);
  }
}

@media (max-width: 620px) {
  .header-actions .version-label,
  .brand-product,
  .workflow-step > span:last-child,
  .file-size {
    display: none;
  }

  .app-header,
  .header-inner {
    min-height: 68px;
  }

  .header-inner {
    gap: 14px;
  }

  .brand-logo {
    width: 120px;
  }

  .header-actions {
    gap: 8px;
    padding: 6px 8px;
  }

  .new-analysis-button {
    min-height: 30px;
    padding-inline: 9px;
    font-size: 10px;
  }

  .api-health {
    font-size: 11px;
  }

  .shell {
    padding-top: 16px;
  }

  .workflow-nav {
    margin-bottom: 24px;
  }

  h1 {
    font-size: 29px;
  }

  .upload-card,
  .settings-card,
  .progress-card,
  .analysis-grid > .card {
    padding: 16px;
  }

  .drop-zone {
    min-height: 220px;
    flex-direction: column;
    gap: 13px;
    text-align: center;
  }

  .file-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

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

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

  .export-group {
    width: 100%;
  }

  .export-group button {
    flex: 1;
  }

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

  .filter-field {
    flex: 1;
  }

  .filter-field select {
    min-width: 0;
    flex: 1;
  }

  .result-count {
    width: 100%;
    text-align: left;
  }

  .table-scroll {
    max-height: 540px;
  }

  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }

  #detail-content {
    padding: 16px;
  }

  .tag-metadata-list {
    grid-template-columns: 1fr;
  }

  .relation-item {
    grid-template-columns: 1fr auto;
  }

  .relation-item > span {
    grid-column: 1 / -1;
  }

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

  .review-item {
    grid-template-columns: 1fr;
  }

  .review-visual-grid,
  .source-comparison,
  .correction-grid,
  .review-decision-actions {
    grid-template-columns: 1fr;
  }

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

  .occurrence-picker > small,
  .reference-wide-field {
    grid-column: auto;
  }

  .decision-section .reference-correction-grid {
    grid-template-columns: 1fr;
  }

  .review-overview {
    max-height: 360px;
  }

  .review-reasons {
    grid-column: auto;
    grid-row: auto;
  }

  .review-item-actions {
    justify-content: stretch;
  }

  .review-item-actions button {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .header-inner {
    width: calc(100% - 16px);
    gap: 8px;
  }

  .brand-logo {
    width: 105px;
  }

  #api-health-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .api-health {
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Coverage and manual marking workspace */

.coverage-shortcut-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--brand-black);
  background: var(--brand-orange-soft);
  border: 1px solid #e9c66b;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.coverage-shortcut-button:hover {
  background: #ffe7a2;
  border-color: var(--brand-orange);
}

.coverage-heading {
  align-items: end;
}

.coverage-heading-actions,
.coverage-export-group,
.coverage-page-tools,
.coverage-primary-actions,
.coverage-zoom-controls,
.coverage-filter-bar,
.coverage-legend,
.coverage-geometry-options,
.coverage-form-actions,
.coverage-selection-actions {
  display: flex;
  align-items: center;
}

.coverage-heading-actions {
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.review-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.review-back-coverage {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

.coverage-export-group {
  min-height: 43px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.coverage-export-group > span {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.coverage-export-group button {
  align-self: stretch;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
}

.coverage-export-group button:last-child {
  border-right: 0;
}

.coverage-export-group button:hover:not(:disabled) {
  color: var(--brand-black);
  background: var(--brand-orange-soft);
}

.coverage-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.coverage-summary > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
}

.coverage-summary > div:last-child {
  border-right: 0;
}

.coverage-summary strong {
  color: var(--brand-black);
  font-size: 19px;
}

.coverage-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-card {
  overflow: hidden;
  padding: 0;
}

.coverage-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.coverage-primary-actions {
  justify-content: flex-end;
  gap: 9px;
}

.coverage-review-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-inline: 13px;
  text-align: left;
}

.coverage-review-button > span:last-child {
  display: grid;
  gap: 1px;
}

.coverage-review-button strong,
.coverage-review-button small {
  display: block;
}

.coverage-review-button small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.coverage-workflow-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 8px 14px;
  color: var(--muted);
  background: #f7f9fa;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  text-align: center;
}

.coverage-workflow-note strong {
  color: var(--blue-dark);
}

.coverage-page-tools {
  min-width: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.coverage-page-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coverage-page-field select,
.coverage-filter-bar select {
  min-height: 36px;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.coverage-zoom-controls {
  min-height: 36px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.coverage-zoom-controls button,
.coverage-zoom-controls output {
  min-width: 36px;
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 9px;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.coverage-zoom-controls button:hover:not(:disabled) {
  background: var(--surface-muted);
}

.coverage-zoom-controls output {
  min-width: 58px;
  color: var(--muted);
}

.coverage-zoom-controls > :last-child {
  border-right: 0;
}

.coverage-tool-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.coverage-tool-button.is-active {
  color: var(--brand-black);
  background: var(--brand-orange-soft);
  border-color: #e7c46c;
}

.coverage-add-button {
  min-height: 40px;
  gap: 7px;
  white-space: nowrap;
}

.coverage-filter-bar {
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.coverage-filter-bar .filter-field {
  min-width: 155px;
}

.coverage-filter-bar .filter-field > span {
  color: var(--muted);
}

.coverage-visible-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.coverage-legend {
  min-height: 48px;
  gap: 16px;
  padding: 9px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.coverage-legend > span:not(.coverage-legend-title) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.coverage-legend-title {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.coverage-legend-swatch {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.legend-accepted { color: #1e7653; background: #1e7653; }
.legend-corrected { color: #b56b00; background: #b56b00; }
.legend-pending { color: #687178; background: #687178; }
.legend-voided { color: #b33a3a; background: #b33a3a; border-style: dashed; }
.legend-manual { color: #7450a5; background: #7450a5; }
.legend-reference { color: #286486; background: #286486; }
.legend-symbol { color: #315ea8; background: #315ea8; }
.legend-node { color: #375f63; background: #375f63; }
.legend-signal { color: #7a4d92; background: #7a4d92; }
.legend-subsystem { color: #4b6b30; background: #4b6b30; font-size: 8px; }

.coverage-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  min-height: 640px;
}

.coverage-canvas-region {
  min-width: 0;
  padding: 14px;
  background: #e7eae7;
}

.coverage-canvas-heading {
  min-height: 43px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.coverage-canvas-heading h2 {
  font-size: 14px;
}

.coverage-canvas-heading p {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 11px;
}

.coverage-coordinate-readout {
  min-width: 118px;
  padding: 5px 8px;
  color: #4e5c63;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(120, 130, 124, 0.32);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  text-align: center;
}

.coverage-viewport {
  position: relative;
  height: min(70vh, 850px);
  min-height: 560px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #cfd4d0;
  border: 1px solid #bcc3be;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(2, 11, 18, 0.12);
  cursor: grab;
  touch-action: none;
}

.coverage-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}

.coverage-sheet {
  position: relative;
  width: 100%;
  min-width: 100%;
  margin: 0 auto;
  background: white;
  box-shadow: 0 3px 16px rgba(2, 11, 18, 0.12);
  transform-origin: 0 0;
}

.coverage-sheet.is-drawing,
.coverage-sheet.is-drawing .coverage-overlay {
  cursor: crosshair;
}

.coverage-sheet > img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  transition: filter 160ms ease;
}

.coverage-sheet > img.is-high-contrast {
  filter: contrast(1.55) brightness(0.94) saturate(0.78);
}

.coverage-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.coverage-mark {
  cursor: pointer;
  outline: none;
}

.coverage-mark-shape,
.coverage-mark-point,
.coverage-mark-cross,
.coverage-mark-label-ring {
  vector-effect: non-scaling-stroke;
}

.coverage-mark-shape,
.coverage-mark-point {
  fill: rgba(104, 113, 120, 0.09);
  stroke: #687178;
  stroke-width: 2.2;
}

.coverage-mark-shape.is-open {
  fill: none !important;
}

.coverage-mark-label-ring {
  fill: #687178;
  stroke: #fff;
  stroke-width: 1.5;
}

.coverage-mark-label {
  fill: #fff;
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.coverage-reference-direction {
  fill: #173d52;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 900;
  dominant-baseline: central;
  pointer-events: none;
}

.coverage-mark-cross {
  stroke: #fff;
  stroke-width: 1.6;
}

.coverage-mark.status-accepted .coverage-mark-shape,
.coverage-mark.status-accepted .coverage-mark-point { fill: rgba(30, 118, 83, 0.09); stroke: #1e7653; }
.coverage-mark.status-accepted .coverage-mark-label-ring { fill: #1e7653; }
.coverage-mark.status-corrected .coverage-mark-shape,
.coverage-mark.status-corrected .coverage-mark-point { fill: rgba(181, 107, 0, 0.1); stroke: #b56b00; }
.coverage-mark.status-corrected .coverage-mark-label-ring { fill: #b56b00; }
.coverage-mark.status-voided .coverage-mark-shape,
.coverage-mark.status-voided .coverage-mark-point { fill: rgba(179, 58, 58, 0.07); stroke: #b33a3a; stroke-dasharray: 7 5; }
.coverage-mark.status-voided .coverage-mark-label-ring { fill: #b33a3a; }
.coverage-mark.origin-human_manual .coverage-mark-shape,
.coverage-mark.origin-human_manual .coverage-mark-point { fill: rgba(116, 80, 165, 0.1); stroke: #7450a5; }
.coverage-mark.origin-human_manual .coverage-mark-label-ring { fill: #7450a5; }
.coverage-mark.origin-human_manual.status-voided .coverage-mark-shape,
.coverage-mark.origin-human_manual.status-voided .coverage-mark-point {
  fill: rgba(179, 58, 58, 0.07);
  stroke: #b33a3a;
}
.coverage-mark.family-reference:not(.origin-human_manual) .coverage-mark-label-ring { fill: #286486; }
.coverage-mark.family-symbol:not(.origin-human_manual) .coverage-mark-label-ring { fill: #315ea8; }
.coverage-mark.family-connection_node:not(.origin-human_manual) .coverage-mark-label-ring { fill: #375f63; }
.coverage-mark.family-signal_connection:not(.origin-human_manual) .coverage-mark-label-ring { fill: #7a4d92; }
.coverage-mark.family-subsystem:not(.origin-human_manual) .coverage-mark-label-ring { fill: #4b6b30; }

.coverage-mark.status-voided .coverage-mark-shape {
  opacity: 0.78;
}

.coverage-mark:hover .coverage-mark-shape,
.coverage-mark:hover .coverage-mark-point,
.coverage-mark:focus .coverage-mark-shape,
.coverage-mark:focus .coverage-mark-point,
.coverage-mark.is-selected .coverage-mark-shape,
.coverage-mark.is-selected .coverage-mark-point {
  stroke-width: 4;
  filter: drop-shadow(0 0 3px rgba(2, 11, 18, 0.42));
}

.coverage-mark.is-selected .coverage-mark-label-ring {
  stroke: var(--brand-orange);
  stroke-width: 3;
}

.coverage-draft-shape {
  fill: rgba(252, 169, 2, 0.13);
  stroke: var(--brand-orange-ink);
  stroke-width: 2.5;
  stroke-dasharray: 8 5;
  vector-effect: non-scaling-stroke;
}

.coverage-draft-shape.is-open {
  fill: none;
}

.coverage-draft-vertex {
  fill: #fff;
  stroke: var(--brand-orange-ink);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.coverage-loading {
  z-index: 5;
  background: rgba(246, 246, 243, 0.9);
}

.coverage-status {
  min-height: 29px;
  margin: 9px 2px 0;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
}

.coverage-status.is-error {
  color: var(--red);
  background: var(--red-soft);
  border-radius: 5px;
}

.coverage-status.is-busy {
  color: var(--brand-orange-ink);
}

.coverage-status.is-success {
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
}

.coverage-inspector {
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
}

.coverage-inspector-placeholder {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.coverage-inspector-placeholder > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--brand-orange-ink);
  background: var(--brand-orange-soft);
  border-radius: 50%;
  font-size: 22px;
}

.coverage-inspector-placeholder p {
  max-width: 260px;
  margin: 0;
  font-size: 12px;
}

.coverage-save-success {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 26px 12px;
  text-align: center;
}

.coverage-save-success-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-size: 25px;
  box-shadow: 0 0 0 7px var(--green-soft);
}

.coverage-save-success h2 {
  max-width: 300px;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.coverage-save-success > p:not(.card-kicker) {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.coverage-save-success > small {
  max-width: 310px;
  color: var(--subtle);
  font-size: 9px;
}

.coverage-save-success-actions {
  width: min(100%, 340px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.coverage-save-success-actions button {
  min-height: 42px;
}

.coverage-selection-heading,
.coverage-form-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.coverage-selection-heading h2,
.coverage-form-heading h2 {
  overflow-wrap: anywhere;
  font-size: 21px;
}

.coverage-selection-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.coverage-selection-badge.status-accepted { color: var(--green); background: var(--green-soft); border-color: #b8ddcd; }
.coverage-selection-badge.status-corrected { color: var(--brand-orange-ink); background: var(--brand-orange-soft); border-color: #ead39a; }
.coverage-selection-badge.status-voided { color: var(--red); background: var(--red-soft); border-color: #efbcbc; }

.coverage-selection-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0 0 16px;
}

.coverage-selection-facts > div {
  min-width: 0;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.coverage-selection-facts dt {
  color: var(--subtle);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coverage-selection-facts dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.coverage-selection-actions {
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.coverage-selection-purpose {
  margin: 0 0 12px;
  padding: 9px 10px;
  color: #365668;
  background: #eef5f8;
  border: 1px solid #cadce5;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.45;
}

.coverage-selection-review-button {
  flex-basis: 100% !important;
}

.coverage-review-note-field {
  display: block;
  margin: 0 0 12px;
  font-size: 10px;
}

.coverage-review-note-field .form-control {
  min-height: 66px;
  margin-top: 4px;
  resize: vertical;
  font-size: 12px;
}

.coverage-review-availability {
  margin: 0 0 12px;
  padding: 9px 10px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #efbcbc;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.coverage-selection-actions button {
  min-height: 36px;
  flex: 1 1 140px;
  padding: 0 10px;
  font-size: 11px;
}

.coverage-form-heading {
  position: sticky;
  top: -18px;
  z-index: 2;
  padding-top: 4px;
  background: var(--surface);
}

.coverage-close-form {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 20px;
}

.coverage-geometry-fieldset,
.coverage-occurrence-fieldset {
  min-width: 0;
  padding: 0;
  margin: 0 0 16px;
  border: 0;
}

.coverage-geometry-fieldset legend,
.coverage-occurrence-fieldset legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.coverage-geometry-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.coverage-geometry-options button {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0 6px;
  padding: 9px;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  text-align: left;
}

.coverage-geometry-options button > span {
  grid-row: 1 / 3;
  font-size: 19px;
}

.coverage-geometry-options button strong {
  font-size: 11px;
}

.coverage-geometry-options button small {
  color: var(--muted);
  font-size: 9px;
}

.coverage-geometry-options button.is-active {
  background: var(--brand-orange-soft);
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 2px rgba(252, 169, 2, 0.16);
}

.coverage-gesture-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.coverage-gesture-actions button {
  min-height: 35px;
  flex: 1;
  padding-inline: 8px;
  font-size: 10px;
}

.coverage-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-bottom: 14px;
}

.coverage-form-grid .field-label:first-child,
.coverage-form-grid #coverage-subtype-field {
  grid-column: 1 / -1;
}

.coverage-isa-interpretation {
  grid-column: 1 / -1;
  min-height: 42px;
  padding: 9px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.coverage-isa-interpretation.is-loading {
  border-style: dashed;
}

.coverage-isa-interpretation .isa-letter-breakdown {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coverage-occurrence-fieldset > label:not(.coverage-existing-field) {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  padding: 8px 9px;
  margin-bottom: 7px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.coverage-occurrence-fieldset input[type="radio"] {
  margin: 3px 0 0;
  accent-color: var(--brand-orange-ink);
}

.coverage-occurrence-fieldset label > span {
  display: grid;
}

.coverage-occurrence-fieldset strong {
  font-size: 11px;
}

.coverage-occurrence-fieldset small {
  color: var(--muted);
  font-size: 9px;
}

.coverage-existing-field {
  margin-top: 9px;
}

.coverage-extra-metadata {
  padding: 10px;
  margin-bottom: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.coverage-extra-metadata summary {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.coverage-extra-metadata[open] summary {
  margin-bottom: 12px;
}

.coverage-reference-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 11px;
}

.coverage-form .field-label {
  min-width: 0;
  font-size: 10px;
}

.coverage-form .form-control {
  min-height: 40px;
  margin-top: 4px;
  font-size: 12px;
}

.coverage-symbol-picker {
  position: relative;
  margin-top: 4px;
}

.coverage-symbol-control {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: stretch;
  gap: 7px;
}

.coverage-symbol-preview {
  min-width: 0;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--brand-black);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
}

.coverage-symbol-preview.is-empty {
  color: var(--subtle);
  background: var(--surface-muted);
  border-style: dashed;
}

.coverage-symbol-preview.is-invalid {
  color: var(--red);
  background: var(--red-soft);
  border-color: #dfaaaa;
}

.coverage-symbol-fallback {
  font-size: 10px;
  font-weight: 950;
}

.coverage-symbol-selected-svg {
  width: 45px;
  height: 41px;
  display: block;
  color: var(--brand-black);
}

.coverage-symbol-input-group {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 39px;
}

.coverage-form .coverage-symbol-input-group .form-control {
  min-width: 0;
  margin-top: 0;
  border-radius: 7px 0 0 7px;
}

.coverage-symbol-toggle {
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  font-size: 17px;
  font-weight: 900;
}

.coverage-symbol-picker.is-open .coverage-symbol-toggle {
  color: var(--brand-black);
  background: var(--brand-orange-soft);
  border-color: var(--brand-orange);
}

.coverage-symbol-options {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 330px;
  display: grid;
  gap: 5px;
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(2, 11, 18, 0.2);
}

.coverage-symbol-option {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
}

.coverage-symbol-option:hover,
.coverage-symbol-option.is-active {
  background: var(--brand-orange-soft);
  border-color: var(--brand-orange);
}

.coverage-symbol-option[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--brand-orange);
}

.coverage-symbol-option-preview {
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--brand-black);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.coverage-symbol-option-svg {
  width: 65px;
  height: 54px;
  display: block;
  color: var(--brand-black);
}

.coverage-symbol-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.coverage-symbol-option-copy strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
}

.coverage-symbol-option-copy span {
  color: var(--muted);
  font-size: 9px;
}

.coverage-symbol-option-copy code {
  color: var(--brand-orange-ink);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.coverage-symbol-empty {
  margin: 0;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.coverage-symbol-help {
  display: block;
  min-height: 26px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
}

.coverage-symbol-help.is-error {
  color: var(--red);
}

.coverage-form textarea.form-control {
  min-height: 70px;
  resize: vertical;
}

.coverage-form-actions {
  align-items: stretch;
  gap: 9px;
  padding-top: 14px;
}

.coverage-form-actions button {
  flex: 1;
  min-height: 41px;
}

@media (max-width: 1280px) {
  .workflow-step {
    gap: 7px;
  }

  .workflow-step small {
    display: none;
  }

  .step-connector {
    margin-inline: 8px;
  }

  .coverage-workspace {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 1040px) {
  .workflow-nav {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    padding-inline: 10px;
  }

  .workflow-nav .step-connector {
    display: none;
  }

  .workflow-step {
    justify-content: center;
  }

  .coverage-heading,
  .coverage-heading-actions {
    align-items: stretch;
  }

  .coverage-heading {
    flex-direction: column;
  }

  .coverage-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .coverage-viewport {
    height: min(65vh, 720px);
    min-height: 480px;
  }

  .coverage-inspector {
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .coverage-inspector-placeholder {
    min-height: 210px;
  }
}

@media (max-width: 760px) {
  .workflow-nav {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding-inline: 10px;
  }

  .workflow-nav .step-connector {
    display: none;
  }

  .workflow-step {
    justify-content: center;
  }

  .workflow-step > span:last-child {
    display: none;
  }

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

  .coverage-summary > div {
    border-bottom: 1px solid var(--line);
  }

  .coverage-summary > div:nth-child(2n) {
    border-right: 0;
  }

  .coverage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .coverage-page-tools,
  .coverage-primary-actions,
  .coverage-add-button,
  .coverage-review-button {
    width: 100%;
  }

  .coverage-primary-actions .coverage-add-button,
  .coverage-primary-actions .coverage-review-button {
    justify-content: center;
  }

  .coverage-filter-bar {
    align-items: stretch;
  }

  .coverage-filter-bar .filter-field {
    flex: 1 1 calc(50% - 12px);
  }

  .coverage-visible-count {
    width: 100%;
    margin-left: 0;
  }

  .coverage-canvas-region {
    padding: 9px;
  }

  .coverage-viewport {
    min-height: 420px;
  }

  .coverage-form-grid,
  .coverage-reference-fields {
    grid-template-columns: 1fr;
  }

  .coverage-form-grid .field-label:first-child,
  .coverage-form-grid #coverage-subtype-field {
    grid-column: auto;
  }

  .coverage-isa-interpretation {
    grid-column: auto;
  }

  .coverage-isa-interpretation .isa-letter-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .review-heading-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .review-back-coverage {
    width: 100%;
  }

  .coverage-heading-actions,
  .coverage-export-group,
  .coverage-heading-actions .document-select-field {
    width: 100%;
  }

  .coverage-export-group button {
    flex: 1;
  }

  .coverage-export-group > span {
    display: none;
  }

  .coverage-page-tools {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .coverage-zoom-controls {
    grid-column: 1 / -1;
    order: 3;
  }

  .coverage-zoom-controls > * {
    flex: 1;
  }

  .coverage-filter-bar .filter-field {
    flex-basis: 100%;
  }

  .coverage-geometry-options,
  .coverage-form-actions,
  .coverage-selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .coverage-geometry-options {
    grid-template-columns: 1fr;
  }

  .coverage-selection-facts {
    grid-template-columns: 1fr;
  }

  .coverage-workflow-note {
    align-items: flex-start;
    flex-direction: column;
    text-align: left;
  }

  .coverage-workflow-note > span {
    display: none;
  }

  .coverage-save-success-actions {
    grid-template-columns: 1fr;
  }

  .isa-letter-breakdown,
  .coverage-isa-interpretation .isa-letter-breakdown {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body[data-active-view="upload"] .shell {
    padding-inline: 14px;
  }

  .upload-home {
    padding-top: 46px;
  }

  .upload-hero-copy {
    margin-bottom: 26px;
  }

  .upload-hero-copy h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .upload-hero-copy > p:last-child {
    font-size: 15px;
  }

  .upload-composer {
    padding: 9px;
    border-radius: 19px;
  }

  .upload-home .drop-zone {
    min-height: 210px;
    padding: 24px 18px;
    border-radius: 14px;
    text-align: center;
  }

  .upload-select-button {
    width: 100%;
    max-width: 220px;
  }

  .upload-composer-footer,
  .upload-start-area {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-composer-footer {
    padding: 14px 5px 2px;
  }

  .upload-start-area .action-help {
    max-width: none;
    text-align: left;
  }

  .upload-start-area .primary-button {
    width: 100%;
  }
}
