@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  --bg: #f6f7f9;
  --paper: #fff;
  --ink: #202a38;
  --muted: #7a8493;
  --line: #e5e9ee;
  --green: #177763;
  --mint: #e7f3ed;
  --blue: #597ca0;
  --sidebar: 242px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px "DM Sans",
    system-ui,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  padding: 9px 13px;
  color: var(--ink);
  font-weight: 500;
}
button:hover {
  border-color: #9aafa8;
  background: #f6faf8;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
a {
  color: var(--green);
  text-decoration: none;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce2e7;
  border-radius: 6px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--green);
}
textarea {
  min-height: 100px;
  resize: vertical;
}
label {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 7px;
  color: #5c6777;
}
.sidebar {
  width: var(--sidebar);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 30px 20px 20px;
  background: white;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  color: #21372e;
  font:
    800 22px Manrope,
    system-ui;
  letter-spacing: -1px;
  margin: 0 0 48px 5px;
  white-space: nowrap;
}
.brand-mark {
  font: 800 17px Manrope;
  background: var(--green);
  color: white;
  border-radius: 10px 10px 10px 3px;
  width: 32px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-right: 8px;
  letter-spacing: -2px;
}
.brand-dot {
  color: #77b18e;
}
.eyebrow,
.sidebar-section > label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #8c96a1;
  font-weight: 700;
  margin-left: 12px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 17px;
}
.sidebar nav a {
  padding: 12px;
  color: #687181;
  font-weight: 500;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.sidebar nav a span {
  font-size: 20px;
  width: 22px;
  text-align: center;
}
.sidebar nav a.active {
  color: var(--green);
  background: var(--mint);
  font-weight: 700;
}
.sidebar-section {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 25px;
}
.sidebar-section > label {
  margin-left: 0;
  font-size: 9px;
  letter-spacing: 1px;
}
.sidebar select {
  margin-top: 5px;
  font-size: 12px;
}
.workspace-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.quiet {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 3px;
}
.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  color: #67766d;
  font-size: 11px;
}
.sidebar-note p {
  font:
    600 17px/1.6 Manrope,
    system-ui;
  color: #3b5147;
  margin: 12px 0 0;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5b9e79;
  margin-right: 6px;
}
.credentials {
  text-align: left;
  margin-top: 16px;
}
.shell {
  margin-left: var(--sidebar);
}
.topbar {
  height: 75px;
  border-bottom: 1px solid var(--line);
  background: white;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #84909b;
  font-size: 12px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.tag {
  font-size: 9px;
  letter-spacing: 1.4px;
}
.avatar {
  border: 1px solid var(--line);
  background: #f3f0e9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #8c7b59;
  font-size: 10px;
}
main {
  padding: 35px 38px;
  min-height: calc(100vh - 130px);
  max-width: 1800px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.overline {
  color: var(--green);
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  margin-bottom: 10px;
}
h1 {
  font:
    700 30px/1.2 Manrope,
    system-ui;
  letter-spacing: -1px;
  margin: 0 0 10px;
}
h2 {
  font:
    700 17px Manrope,
    system-ui;
  margin: 0;
}
h3 {
  font:
    700 14px Manrope,
    system-ui;
  margin: 0;
}
p {
  line-height: 1.65;
}
.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #11624f;
  color: white;
}
.danger {
  color: #b74d43;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.filter-panel {
  padding: 19px;
  margin-bottom: 24px;
}
.filter-grid {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) repeat(3, minmax(100px, 1fr)) auto;
  gap: 13px;
  align-items: end;
}
.filter-extra {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-weight: 400;
  font-size: 12px;
}
.filter-panel details {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.filter-panel summary {
  cursor: pointer;
}
.result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 23px 0 14px;
  font-size: 12px;
  color: var(--muted);
}
.result-bar b {
  color: var(--ink);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 18px;
}
.document-card {
  border-radius: 9px;
  border: 1px solid var(--line);
  background: white;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  padding: 0;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.document-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 18px #183c2812;
}
.doc-preview {
  height: 175px;
  background: #e9ece9;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}
.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.mini-page {
  height: 155px;
  width: 112px;
  padding: 15px 10px;
  background: #faf8f1;
  box-shadow: 0 2px 8px #0002;
  transform: rotate(-3deg);
  overflow: hidden;
}
.mini-page strong {
  font:
    700 14px Georgia,
    serif;
  display: block;
  text-align: center;
  border-bottom: 2px solid #8b8a80;
  padding-bottom: 6px;
  color: #68695f;
}
.mini-page i {
  display: block;
  margin-top: 7px;
  height: 3px;
  background: #b8baad;
}
.mini-page i:nth-child(3n) {
  width: 75%;
}
.preview-label {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #fffe;
  padding: 4px 7px;
  font-size: 9px;
  border-radius: 4px;
  letter-spacing: 0.7px;
  color: #66726d;
}
.card-body {
  padding: 16px;
}
.card-body h3 {
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}
.card-footer {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 11px;
  color: #5d756d;
}
.badge {
  display: inline-flex;
  align-items: center;
  background: var(--mint);
  color: var(--green);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.badge.unlinked {
  background: #fff2de;
  color: #a17c37;
}
.load-more {
  display: block;
  margin: 24px auto;
}
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
  background: white;
  border: 1px dashed #d4dcd7;
  border-radius: 8px;
}
.empty h2 {
  color: var(--ink);
  margin-bottom: 10px;
}
.error {
  color: #b74d43;
  padding: 14px;
  background: #fff1ef;
  border-radius: 6px;
  white-space: pre-wrap;
}
footer {
  padding: 20px 38px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 1px;
  color: #929aa3;
  display: flex;
  gap: 22px;
  align-items: center;
}
footer a {
  margin-left: auto;
}
footer span {
  letter-spacing: 0;
}
.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.search-row input {
  max-width: 500px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.person-card {
  padding: 22px;
  text-align: left;
  display: flex;
  gap: 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.person-initials {
  width: 44px;
  height: 44px;
  flex: none;
  background: #edf2ef;
  color: #49775e;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font: 700 16px Manrope;
}
.person-card h3 {
  margin: 1px 0 6px;
}
.person-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.person-card .aliases {
  font-size: 10px;
  margin-top: 10px;
  color: #8b96a0;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: start;
}
.page-image {
  position: relative;
  width: 100%;
  background: #eaece9;
}
.page-image > img {
  display: block;
  width: 100%;
  height: auto;
}
.box {
  position: absolute;
  min-width: 0;
  min-height: 0;
  border: 2px solid #5c9b81;
  background: #56a58015;
  padding: 0;
  border-radius: 2px;
}
.box.mention {
  border-color: #6c8eb8;
  background: #658fbb18;
}
.box.unlinked {
  border-color: #cd9a4c;
  background: #d7a14d1a;
}
.box:hover {
  background: #70af8766;
}
.box span {
  position: absolute;
  bottom: 100%;
  left: -2px;
  background: var(--green);
  color: white;
  font-size: 10px;
  padding: 3px 5px;
  white-space: nowrap;
  display: none;
}
.box:hover span,
.box:focus span {
  display: block;
}
.panel-head {
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.panel-body {
  padding: 20px;
}
.text-page {
  font:
    16px/2 Georgia,
    serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 700px;
  overflow: auto;
  background: #fdfcf8;
  padding: 30px;
}
.text-page mark {
  cursor: pointer;
  background: #e3efe7;
  border-bottom: 2px solid #7ea68a;
  padding: 2px 0;
}
.text-page mark.unlinked {
  background: #fff0d5;
  border-color: #d1ad64;
}
.occurrence {
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.occurrence:last-child {
  border: 0;
}
.occurrence-info {
  min-width: 0;
  flex: 1;
}
.occurrence-info strong {
  font-size: 12px;
  display: block;
  overflow-wrap: anywhere;
}
.occurrence-info small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  margin-top: 5px;
}
.occurrence button {
  font-size: 11px;
  padding: 6px 8px;
}
.face-thumb {
  width: 46px;
  height: 52px;
  border-radius: 5px;
  background: #e9edeb;
  flex: none;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #99a79d;
}
.tabs {
  display: flex;
  gap: 25px;
  border-bottom: 1px solid var(--line);
  margin: 23px 0;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
  color: var(--muted);
}
.tabs button.active {
  color: var(--green);
  border-bottom: 2px solid var(--green);
  font-weight: 700;
}
.metadata {
  font:
    11px/1.6 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #718075;
  max-height: 300px;
  overflow: auto;
}
.profile {
  padding: 25px;
  display: flex;
  gap: 22px;
}
.profile .person-initials {
  width: 75px;
  height: 75px;
  font-size: 26px;
}
.profile p {
  margin: 7px 0;
  color: var(--muted);
}
.profile-description {
  font-size: 13px;
  max-width: 900px;
  white-space: pre-wrap;
}
.stat {
  padding: 5px 10px;
  background: #f4f6f4;
  border-radius: 4px;
  font-size: 11px;
  display: inline-block;
  margin-right: 8px;
}
.group {
  border-left: 2px solid #dce8df;
  padding-left: 17px;
  margin: 20px 0;
}
.group > h3 {
  color: #526f61;
  margin: 15px 0;
}
.group .document-card {
  width: 260px;
  display: inline-block;
  margin: 5px 12px 10px 0;
  vertical-align: top;
}
.group .doc-preview {
  height: 110px;
}
.group .mini-page {
  height: 110px;
}
.resolve-intro {
  background: #eaf1ed;
  border: 1px solid #d8e5dc;
  padding: 22px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
}
.resolve-intro p {
  margin: 6px 0 0;
  color: #688172;
  font-size: 13px;
}
.resolve-controls {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 120px auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}
.selection-bar {
  background: #ecf5ef;
  border: 1px solid #cee1d3;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 7px;
  margin-bottom: 15px;
}
.selection-bar span {
  flex: 1;
}
.help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: min(620px, calc(100vw - 32px));
  max-height: 90vh;
  box-shadow: 0 30px 120px #172d3830;
  color: var(--ink);
}
dialog::backdrop {
  background: #152b3555;
  backdrop-filter: blur(2px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.dialog-head button {
  border: 0;
  font-size: 20px;
  padding: 0 5px;
}
.dialog-body {
  padding: 22px;
  overflow: auto;
  max-height: 72vh;
}
.form-field {
  margin-bottom: 16px;
}
.form-field .help {
  margin-top: 5px;
  font-size: 11px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}
.person-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  margin-bottom: 8px;
  padding: 12px;
}
.person-option small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.dialog-results {
  max-height: 320px;
  overflow: auto;
  margin-top: 15px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: calc(50% + 100px);
  transform: translateX(-50%);
  background: #213e31;
  color: white;
  border-radius: 7px;
  padding: 13px 20px;
  box-shadow: 0 4px 20px #0002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  font-size: 13px;
  max-width: 80vw;
}
#toast.visible {
  opacity: 1;
}
.loading {
  padding: 50px;
  color: var(--muted);
  text-align: center;
}
.back {
  display: inline-block;
  font-size: 12px;
  margin-bottom: 20px;
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
summary {
  cursor: pointer;
}
.warning {
  color: #9b7735;
  background: #fff6e6;
  padding: 12px;
  border-radius: 5px;
  font-size: 12px;
}
@media (min-width: 1500px) {
  .cards {
    grid-template-columns: repeat(4, minmax(200px, 1fr));
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 205px;
  }
  .sidebar {
    padding: 25px 14px;
  }
  .brand {
    font-size: 19px;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filter-extra {
    grid-template-columns: 1fr 1fr;
  }
  main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .resolve-controls {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
  }
  .brand {
    margin: 0 0 14px;
  }
  .eyebrow,
  .sidebar-note,
  .credentials,
  .sidebar-section {
    display: none;
  }
  .sidebar nav {
    display: flex;
    margin: 0;
    gap: 6px;
  }
  .sidebar nav a {
    font-size: 12px;
    padding: 8px;
  }
  .sidebar nav a span {
    display: none;
  }
  .shell {
    margin: 0;
  }
  .topbar {
    height: 50px;
    padding: 0 18px;
  }
  .topbar .tag {
    display: none;
  }
  main {
    padding: 24px 18px;
  }
  .page-heading {
    flex-direction: column;
  }
  h1 {
    font-size: 27px;
  }
  .filter-grid,
  .filter-extra,
  .resolve-controls {
    grid-template-columns: 1fr 1fr;
  }
  .filter-grid > div:first-child {
    grid-column: 1/-1;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .doc-preview {
    height: 140px;
  }
  .card-body {
    padding: 12px;
  }
  .card-footer {
    gap: 8px;
    font-size: 10px;
  }
  .profile {
    padding: 18px;
    gap: 12px;
  }
  .profile .person-initials {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  .topbar-right {
    gap: 10px;
  }
  footer {
    padding: 20px 18px;
  }
  footer span {
    display: none;
  }
  #toast {
    left: 50%;
  }
  .selection-bar {
    flex-wrap: wrap;
  }
  .inline-fields {
    grid-template-columns: 1fr;
  }
  .occurrence {
    padding: 12px;
  }
  .page-heading .actions {
    width: 100%;
  }
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  .sidebar {
    position: relative;
  }
  .sidebar-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .sidebar-section > label {
    display: none;
  }
  .sidebar-section select {
    margin: 0;
  }
  .workspace-actions {
    margin: 0;
    gap: 12px;
  }
  .credentials {
    display: block;
    position: absolute;
    top: 17px;
    right: 18px;
    margin: 0;
  }
}
.person-identifiers {
  display: flex;
  gap: 8px 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.authority-link {
  font-size: 12px;
  overflow-wrap: anywhere;
}
