:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  line-height: 1.45;
  --page: #f6f8fb;
  --surface: #fff;
  --ink: #202733;
  --muted: #606a78;
  --line: #dce2ea;
  --accent: #174c8b;
  --boundary: #fff0bf;
  --name: #eee1fb;
  --identity: #ffe0e9;
  --origin: #e1effa;
  --presence: #d9ecff;
  --status: #ffded9;
  --uncertain: #e7e9ee;
  --coverage: #e7e9ee;
  --agreement: #dff1e5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #161b23;
    --surface: #212832;
    --ink: #edf0f5;
    --muted: #b4bdca;
    --line: #424c5b;
    --accent: #a6cfff;
    --boundary: #5d4d20;
    --name: #4c365f;
    --identity: #623448;
    --origin: #26455d;
    --presence: #294a6d;
    --status: #673a35;
    --uncertain: #424955;
    --coverage: #424955;
    --agreement: #2c4c3b;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}
header,
main {
  max-width: 1900px;
  margin: auto;
  padding: 0.8rem 1.1rem;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
}
h1 {
  font-size: 1.3rem;
  margin: 0;
}
h2 {
  font-size: 1.08rem;
  margin: 0;
}
p {
  margin: 0.3rem 0;
}
header p,
footer,
.muted,
.local {
  color: var(--muted);
  font-size: 0.85rem;
}
.local {
  white-space: nowrap;
}
button,
select,
input {
  font: inherit;
  max-width: 100%;
}
button,
summary {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
.controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}
.search-item {
  display: flex;
  gap: 0.65rem;
  flex: 0 0 calc(66.666% - 0.65rem);
  max-width: 100%;
  align-items: center;
}
.search-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}
.search-group input {
  width: 100%;
  min-width: 0;
}
.search-group output {
  white-space: nowrap;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.filter-options {
  display: contents;
}
.filter-options select {
  flex: 0 1 auto;
  min-width: 0;
}
#settings {
  display: none;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.active-filters[hidden] {
  display: none;
}
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.filter-tag button {
  border-radius: 50%;
}
.workspace {
  display: grid;
  grid-template-columns: 265px minmax(0, 1fr);
  gap: 1rem;
  margin-top: 0.8rem;
  align-items: start;
}
aside,
article,
.comparison-workspace {
  min-width: 0;
}
aside {
  position: sticky;
  top: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  overflow: hidden;
}
.list-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.list-heading output {
  font-size: 0.85rem;
  color: var(--muted);
}
.list-settings {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.list-settings label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.list-settings summary {
  padding: 0.3rem 0;
}
.list-settings fieldset {
  padding: 0.4rem;
  border: 1px solid var(--line);
  max-height: 16rem;
  overflow: auto;
}
.list-settings fieldset label {
  padding: 0.15rem 0;
}
.type-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.type-actions button {
  font-size: 0.8rem;
}
.cases {
  height: calc(100dvh - 21rem);
  min-height: 18rem;
  overflow: auto;
  padding: 0.3rem;
}
.case {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.6rem;
  background: var(--surface);
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.case[aria-current="true"] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.case-document {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
.case .preview {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
}
.tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.25rem 0;
}
.badge {
  font-size: 0.71rem;
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  overflow-wrap: anywhere;
}
.badge[data-kind] {
  background: var(--kind, var(--uncertain));
  color: var(--ink);
}
[data-kind="boundary"] {
  --kind: var(--boundary);
}
[data-kind="name"] {
  --kind: var(--name);
}
[data-kind="identity"] {
  --kind: var(--identity);
}
[data-kind="origin"] {
  --kind: var(--origin);
}
[data-kind="presence"] {
  --kind: var(--presence);
}
[data-kind="status"] {
  --kind: var(--status);
}
[data-kind="uncertain"] {
  --kind: var(--uncertain);
}
[data-kind="coverage"] {
  --kind: var(--coverage);
}
[data-kind="agreement"] {
  --kind: var(--agreement);
}
.view-options,
.actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.view-options {
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}
.view-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.actions {
  font-size: 0.8rem;
}
.focus-preview {
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  max-width: 60ch;
}
.case-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
}
.explanation-details {
  max-width: 100%;
}
.explanation-details[open] {
  flex-basis: 100%;
}
.explanation-details p {
  margin: 0.4rem 0;
}
.table-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.table-scroll {
  overflow: auto;
  max-height: calc(100dvh - 20rem);
  min-height: 15rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
}
.annotation-table {
  width: 100%;
  min-width: 1020px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.annotation-table caption {
  text-align: left;
}
.annotation-table th,
.annotation-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.annotation-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  box-shadow: 0 1px var(--line);
  font-weight: 600;
}
.annotation-table th:first-child {
  width: 11%;
}
.annotation-table th:nth-child(2) {
  width: 15%;
}
.annotation-table th:nth-child(3) {
  width: 36%;
}
.annotation-table th:nth-child(4) {
  width: 17%;
}
.annotation-table th:nth-child(5) {
  width: 11%;
}
.annotation-table th:nth-child(6) {
  width: 10%;
}
.annotation-table .annotator-name {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.annotation-table thead th:first-child {
  z-index: 4;
  left: 0;
}
.annotator-name strong {
  display: block;
  font-weight: 600;
}
.annotator-name small {
  display: block;
}
.role-badge {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.annotation-row[data-role="A"] .annotator-name,
.annotation-row[data-role="B"] .annotator-name {
  border-left: 3px solid var(--accent);
}
.annotation-row[data-role="baseline"] {
  color: var(--muted);
}
.annotation-table td[data-kind] {
  background: var(--kind, var(--surface));
}
.diff-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.cell-values {
  margin: 0;
  padding-left: 1.1rem;
}
.cell-values li + li {
  margin-top: 0.5rem;
}
.cell-values:has(li:only-child) {
  list-style: none;
  padding-left: 0;
}
.origin-label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.missing {
  font-size: 0.8rem;
  color: var(--muted);
}
.passage {
  margin: 0;
  white-space: normal;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.selection {
  background: var(--agreement);
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  padding: 0.05rem 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.selection.rejected {
  background: var(--status);
  text-decoration-style: dashed;
}
.selection.automatic {
  background: var(--boundary);
  text-decoration-style: dotted;
}
.selection[data-kind],
.context-gap[data-kind] {
  background: var(--kind);
}
.context-gap {
  outline: 1px dotted var(--muted);
  outline-offset: 1px;
  color: var(--muted);
}
.span-cell .cell-values {
  white-space: pre-wrap;
}
.evidence-button {
  font-size: 0.75rem;
}
.entity-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: 85dvh;
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1.2rem;
}
.entity-dialog::backdrop {
  background: #0007;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.entity-dialog p {
  margin: 0.7rem 0;
  overflow-wrap: anywhere;
}
.selected-quote {
  white-space: pre-wrap;
}
.table-legend {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 110ch;
}
.empty {
  padding: 1rem;
  color: var(--muted);
}
footer {
  padding: 0.8rem 0;
  font-size: 0.75rem;
}
#error {
  background: var(--status);
  padding: 0.8rem;
  overflow-wrap: anywhere;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.case:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
mark:focus-visible,
.context-gap:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
@media (min-width: 1650px) {
  .workspace {
    grid-template-columns: 285px minmax(0, 1fr);
  }
  .annotation-table {
    font-size: 0.9rem;
  }
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  aside {
    position: static;
  }
  .cases {
    height: 14rem;
    min-height: 0;
  }
  .table-scroll {
    max-height: 70dvh;
  }
  .annotation-table {
    min-width: 1000px;
  }
}
@media (max-width: 639px) {
  header,
  main {
    padding: 0.65rem;
  }
  header {
    align-items: flex-start;
  }
  h1 {
    font-size: 1.1rem;
  }
  .local {
    font-size: 0.7rem;
  }
  .search-item {
    flex-basis: 100%;
  }
  #settings {
    display: block;
  }
  .filter-options {
    display: none;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .filter-options.open {
    display: flex;
  }
  .controls {
    padding: 0.6rem;
  }
  .detail-heading {
    align-items: flex-start;
  }
  .view-options {
    gap: 0.4rem;
  }
  .table-caption .muted {
    font-size: 0.75rem;
  }
}
