:root {
  --paper: #f7f8fa;
  --surface: #ffffff;
  --ink: #121417;
  --muted: #667085;
  --faint: #596477;
  --line: #dce4f2;
  --line-strong: #b9c5d7;
  --focus: #245dff;
  --focus-soft: #eaf0ff;
  --success: #147d5a;
  --danger: #b42318;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --shadow-popover: 0 12px 32px rgb(18 20 23 / 12%);
  --ease-out: cubic-bezier(0.2, 0.75, 0.25, 1);
  --duration-fast: 120ms;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--line-strong) var(--paper);
}

::selection {
  background: var(--focus);
  color: var(--surface);
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

.auth-screen {
  display: grid;
  min-height: 100dvh;
  padding: 24px;
  place-items: center;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgb(36 93 255 / 3%) calc(100% - 1px)) 0 0 / 80px 100%,
    var(--paper);
}

.auth-panel {
  display: grid;
  width: min(100%, 520px);
  gap: 34px;
  padding: 42px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 18px 60px rgb(18 20 23 / 8%);
}

.auth-wordmark {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.auth-panel h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.auth-copy {
  max-width: 42ch;
  margin: 16px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.auth-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-control input,
.auth-control button {
  min-height: 48px;
  border: 1px solid var(--line-strong);
}

.auth-control input {
  min-width: 0;
  padding: 0 14px;
  border-right: 0;
  outline: 0;
  background: var(--surface);
}

.auth-control button {
  padding: 0 18px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 650;
}

.auth-control button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.auth-status {
  min-height: 21px;
  margin: -20px 0 0;
  color: var(--muted);
  font-size: 13px;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

button,
summary,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
summary,
select {
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

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

.app-shell {
  display: grid;
  grid-template-rows: 48px auto minmax(0, 1fr);
  height: 100dvh;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgb(36 93 255 / 3%) calc(100% - 1px)) 0 0 / 80px 100%,
    var(--paper);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.masthead-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.sign-out {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.review-quarantine {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--focus);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.review-quarantine:hover,
.review-quarantine[aria-pressed="true"] {
  background: var(--focus-soft);
}

.sign-out:hover {
  color: var(--ink);
}

.identity {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 18px;
}

.wordmark {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.descriptor,
.corpus {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus {
  font-variant-numeric: tabular-nums;
}

.search-instrument {
  min-width: 0;
  margin: 18px 24px 0;
  border: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 1px 0 rgb(18 20 23 / 3%);
}

.search-command {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 76px;
  padding: 0 20px;
}

.search-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 1.7;
}

#globalSearch {
  min-width: 0;
  width: 100%;
  height: 74px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: clamp(22px, 2.35vw, 34px);
  font-weight: 430;
  letter-spacing: -0.025em;
  caret-color: var(--focus);
}

#globalSearch::placeholder {
  color: var(--muted);
  opacity: 1;
}

#globalSearch::-webkit-search-cancel-button {
  display: none;
  appearance: none;
}

.keycap,
kbd {
  min-width: 24px;
  height: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 0 var(--line);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.filter-rail {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 46px;
  min-width: 0;
  border-top: 1px solid var(--line);
}

.filter-lead {
  display: grid;
  width: 56px;
  flex: 0 0 56px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.filter-lead svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.45;
}

.entity-switch {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
}

.entity-switch label {
  position: relative;
  display: grid;
  min-width: 72px;
  place-items: center;
  padding: 0 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.label-short {
  display: none;
}

.entity-switch label + label {
  border-left: 1px solid var(--line);
}

.entity-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.entity-switch label:has(input:checked) {
  background: var(--focus-soft);
  color: var(--focus);
}

.entity-switch label:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.filter-menu {
  position: relative;
  min-width: 156px;
  border-right: 1px solid var(--line);
}

.filter-menu summary,
.select-filter {
  display: grid;
  grid-template-columns: minmax(0, auto) auto 12px;
  align-items: center;
  height: 45px;
  gap: 8px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}

.quarantine-reason-filter {
  min-width: 270px;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary strong {
  overflow: hidden;
  max-width: 96px;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-menu summary svg,
.select-filter svg {
  width: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  transition: transform var(--duration-fast) var(--ease-out);
}

.filter-menu[open] summary {
  background: var(--focus-soft);
  color: var(--focus);
}

.filter-menu summary,
.select-filter,
.reset-filters {
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.filter-menu[open] summary svg {
  transform: rotate(180deg);
}

.filter-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: -1px;
  width: 260px;
  max-height: min(410px, calc(100dvh - 210px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 40px;
  gap: 9px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}

.filter-option:last-child {
  border-bottom: 0;
}

.filter-option:hover {
  background: var(--paper);
}

.filter-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--focus);
}

.filter-option span {
  font-size: 12px;
  font-weight: 580;
}

.filter-option small {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.select-filter {
  position: relative;
  grid-template-columns: auto minmax(72px, 1fr) 12px;
  min-width: 174px;
  border-right: 1px solid var(--line);
}

.select-filter select {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 14px 0 0;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.select-filter svg {
  pointer-events: none;
}

.reset-filters {
  align-self: stretch;
  margin-left: auto;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--focus);
  font-size: 12px;
  font-weight: 650;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(500px, 44%) minmax(0, 1fr);
  min-height: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 72%);
}

.results-pane,
.detail-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.results-pane {
  display: grid;
  grid-template-rows: auto 25px minmax(0, 1fr) auto;
  border-right: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 58%);
}

.pane-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 8px 18px 8px 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.pane-header h1 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--focus);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
}

.results-pane.is-searching .pane-header::after {
  animation: search-progress 720ms var(--ease-out) infinite;
  opacity: 1;
}

.result-count {
  flex: 0 0 auto;
  margin: 0;
  margin-left: 16px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.column-labels {
  display: grid;
  grid-template-columns: minmax(110px, 0.88fr) minmax(90px, 1fr) 134px;
  align-items: center;
  gap: 12px;
  padding: 0 18px 0 24px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.result-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(110px, 0.88fr) minmax(90px, 1fr) 134px;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 5px 18px 5px 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
  content-visibility: auto;
  contain-intrinsic-size: auto 54px;
}

.result-row:hover {
  background: #fbfcff;
}

.result-row[aria-selected="true"] {
  z-index: 1;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--focus), inset 0 0 0 1px var(--focus);
}

.result-primary,
.result-relevance {
  min-width: 0;
}

.result-name,
.result-subtitle,
.result-context {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-name-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.result-name-line .result-name {
  min-width: 0;
}

.same-name-count {
  flex: 0 0 auto;
  color: var(--focus);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.result-name {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.result-subtitle,
.result-context {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.result-subtitle {
  margin-top: 2px;
  color: #3e4651;
  font-weight: 560;
}

.result-relevance {
  display: grid;
  gap: 2px;
}

.result-context {
  color: #343940;
}

.filter-evidence {
  color: var(--focus);
  font-weight: 680;
}

.reachability-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
}

.available-channel {
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  color: var(--focus);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.no-channels {
  color: var(--faint);
  font-size: 9px;
  white-space: nowrap;
}

.result-skeleton {
  display: grid;
  grid-template-columns: 1.4fr 0.75fr 58px;
  min-height: 58px;
  align-items: center;
  gap: 16px;
  padding: 0 18px 0 24px;
  border-bottom: 1px solid var(--line);
}

.skeleton-line {
  height: 7px;
  background: linear-gradient(90deg, #edf0f5 25%, #f8f9fb 48%, #edf0f5 72%) 0 0 / 220% 100%;
  animation: shimmer 1.25s linear infinite;
}

.result-empty,
.result-error {
  display: grid;
  min-height: 240px;
  align-content: center;
  justify-items: start;
  padding: 30px 24px;
}

.result-empty h3,
.result-error h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.result-empty p,
.result-error p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.retry-search {
  min-height: 44px;
  margin-top: 18px;
  padding: 0 16px;
  border: 1px solid var(--focus);
  background: var(--surface);
  color: var(--focus);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.load-more {
  min-height: 42px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--focus);
  font-size: 12px;
  font-weight: 680;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.load-more:disabled {
  color: var(--muted);
  cursor: progress;
}

.detail-pane {
  position: relative;
  background: rgb(255 255 255 / 78%);
}

.detail-empty {
  display: grid;
  max-width: 520px;
  min-height: 100%;
  align-content: center;
  padding: clamp(32px, 6vw, 84px);
}

.register-mark {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  width: max-content;
  gap: 5px;
  margin-bottom: 28px;
}

.register-mark span {
  height: 4px;
  background: var(--line-strong);
}

.register-mark span:first-child {
  background: var(--focus);
}

.detail-empty h2 {
  margin: 0 0 10px;
  font-size: clamp(25px, 3vw, 39px);
  font-weight: 560;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.detail-empty > p:not(.eyebrow) {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.shortcut-list {
  display: grid;
  max-width: 360px;
  margin: 30px 0 0;
  border-top: 1px solid var(--line);
}

.shortcut-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
}

.shortcut-list dt,
.shortcut-list dd {
  margin: 0;
}

.shortcut-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-loading {
  padding: 32px;
  color: var(--muted);
}

.detail-content {
  min-height: 100%;
}

.record-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 150px;
  align-items: start;
  gap: 20px;
  padding: 30px 34px 24px;
  border-bottom: 1px solid var(--line-strong);
}

.record-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.entity-glyph {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--focus);
  font-size: 19px;
  font-weight: 760;
}

.entity-glyph::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  content: "";
}

.record-heading h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 35px);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.record-subtitle {
  margin: 7px 0 0;
  color: #343940;
  font-size: 14px;
  font-weight: 560;
  text-wrap: pretty;
}

.copy-id {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.technical-section {
  padding-top: 20px;
}

.technical-section .section-heading {
  margin-bottom: 10px;
}

.technical-section .section-heading h3,
.technical-label {
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.technical-id-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.technical-id {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.technical-id code {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button {
  display: none;
}

.detail-index {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 42px;
  overflow-x: auto;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
}

.detail-index a {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 670;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.detail-index a:first-child {
  padding-left: 0;
}

.detail-index a::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  background: transparent;
  content: "";
}

.detail-index a:hover,
.detail-index a:first-child {
  color: var(--ink);
}

.detail-index a:first-child::after {
  left: 0;
  background: var(--focus);
}

.detail-sections {
  padding: 0 34px 54px;
}

.detail-section {
  scroll-margin-top: 54px;
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.section-heading span {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.summary-copy {
  max-width: 820px;
  margin: 0;
  color: #343940;
  font-size: 14px;
  line-height: 1.65;
  text-wrap: pretty;
  white-space: pre-wrap;
}

.section-intro {
  max-width: 68ch;
  margin: -5px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.quarantine-explanation {
  max-width: 74ch;
}

.quarantine-original {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.quarantine-original p {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.same-name-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.same-name-record {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.same-name-record[aria-current="true"] {
  box-shadow: inset 3px 0 0 var(--focus);
}

.same-name-label {
  padding-left: 10px;
  color: var(--focus);
  font-size: 10px;
  font-weight: 730;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.same-name-context {
  overflow: hidden;
  color: #343940;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.field {
  min-width: 0;
  min-height: 76px;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field dt,
.field dd {
  margin: 0;
}

.field dt {
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.field dd {
  color: var(--ink);
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.taxonomy-groups {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.taxonomy-group {
  min-width: 0;
}

.taxonomy-group .eyebrow {
  margin-bottom: 7px;
}

.investor-sector-focus {
  margin-top: 18px;
}

.token {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: #3e4651;
  font-size: 11px;
  line-height: 1.2;
}

.contact-list,
.relationship-list,
.notes-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.contact-row,
.relationship-row,
.note-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.contact-row {
  grid-template-columns: minmax(90px, 0.3fr) minmax(0, 1fr) auto;
}

.contact-type,
.relationship-type,
.note-type {
  color: var(--faint);
  font-size: 10px;
  font-weight: 730;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-value,
.relationship-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.contact-value,
.relationship-name {
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.copy-value {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.copy-value svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.relationship-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.5fr);
}

.relationship-main {
  min-width: 0;
}

.relationship-main small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-type {
  text-align: right;
}

.relationship-name {
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 650;
  text-align: left;
}

.note-row {
  align-items: start;
  padding: 13px 0;
}

.note-row h4 {
  margin: 2px 0 5px;
  font-size: 13px;
}

.note-row p {
  margin: 0;
  color: #343940;
  text-wrap: pretty;
  white-space: pre-wrap;
}

.empty-value {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  box-shadow: var(--shadow-popover);
}

@keyframes shimmer {
  to { background-position-x: -220%; }
}

@keyframes search-progress {
  0% { transform: translateX(-80%) scaleX(0.2); }
  52% { transform: translateX(18%) scaleX(0.54); }
  100% { transform: translateX(100%) scaleX(0.12); }
}

@media (max-width: 1120px) {
  .descriptor {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(420px, 46%) minmax(0, 1fr);
  }

  .column-labels,
  .result-row {
    grid-template-columns: minmax(0, 1fr) 136px;
    gap: 8px;
    padding-right: 14px;
    padding-left: 18px;
  }

  .result-row {
    grid-template-areas:
      "identity reachability"
      "relevance reachability";
    min-height: 64px;
    contain-intrinsic-size: auto 64px;
  }

  .context-column-label {
    display: none;
  }

  .result-primary {
    grid-area: identity;
  }

  .result-relevance {
    grid-area: relevance;
  }

  .reachability-statuses {
    grid-area: reachability;
  }

  .result-skeleton {
    grid-template-columns: minmax(0, 1fr) 136px;
  }
}

@media (max-width: 1040px) {

  .filter-rail {
    overflow-x: auto;
  }

  .reset-filters {
    margin-left: 0;
  }
}

@media (max-width: 860px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    grid-template-rows: 46px auto minmax(0, 1fr);
    min-height: 0;
  }

  .masthead {
    padding: 0 14px;
  }

  .wordmark {
    font-size: 13px;
  }

  .corpus {
    max-width: 58%;
    font-size: 10px;
  }

  .review-quarantine {
    min-height: 44px;
    padding: 0 9px;
    font-size: 10px;
  }

  .sign-out {
    min-height: 44px;
  }

  .search-instrument {
    margin: 10px 10px 0;
  }

  .search-command {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 56px;
    padding: 0 11px;
  }

  .search-icon {
    width: 20px;
    height: 20px;
  }

  #globalSearch {
    height: 54px;
    padding: 0 8px;
    font-size: 18px;
  }

  .keycap {
    display: none;
  }

  .clear-search {
    width: 44px;
    height: 44px;
  }

  .filter-rail {
    min-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .filter-rail::-webkit-scrollbar {
    display: none;
  }

  .filter-rail::after {
    position: sticky;
    right: 0;
    width: 16px;
    flex: 0 0 16px;
    background: linear-gradient(90deg, transparent, var(--surface));
    content: "";
    pointer-events: none;
  }

  .filter-lead {
    display: none;
  }

  .entity-switch {
    flex: 0 0 auto;
  }

  .entity-switch label {
    min-width: 54px;
    padding: 0 10px;
  }

  .entity-switch .label-long {
    display: none;
  }

  .entity-switch .label-short {
    display: inline;
  }

  .filter-menu {
    position: static;
    min-width: 130px;
  }

  .filter-menu summary,
  .select-filter {
    height: 44px;
    padding: 0 11px;
  }

  .filter-popover {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 60dvh;
  }

  .select-filter {
    min-width: 144px;
  }

  .quarantine-reason-filter {
    min-width: 226px;
  }

  .workspace {
    position: relative;
    display: block;
    margin-top: 10px;
  }

  .results-pane,
  .detail-pane {
    position: absolute;
    inset: 0;
  }

  .results-pane {
    grid-template-rows: auto 27px minmax(0, 1fr) auto;
    border-right: 0;
    opacity: 1;
    transition: opacity var(--duration-fast) var(--ease-out);
  }

  .pane-header {
    min-height: 54px;
    padding: 9px 12px;
  }

  .pane-header h1 {
    font-size: 15px;
  }

  .column-labels,
  .result-row {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 8px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .result-row {
    grid-template-areas:
      "identity reachability"
      "relevance reachability";
    height: 64px;
    min-height: 64px;
    overflow: hidden;
  }

  .context-column-label {
    display: none;
  }

  .result-primary {
    grid-area: identity;
  }

  .result-relevance {
    grid-area: relevance;
  }

  .reachability-statuses {
    grid-area: reachability;
  }

  .detail-pane {
    z-index: 8;
    background: var(--surface);
    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);
    transition:
      opacity var(--duration-fast) var(--ease-out),
      transform var(--duration-fast) var(--ease-out),
      visibility 0s linear var(--duration-fast);
    visibility: hidden;
  }

  .app-shell.show-detail .detail-pane {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
    visibility: visible;
  }

  .app-shell.show-detail .results-pane {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .record-header {
    grid-template-columns: minmax(0, 1fr);
    min-height: 132px;
    padding: 49px 16px 20px;
  }

  .record-heading {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
  }

  .entity-glyph {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }

  .record-heading h2 {
    font-size: 24px;
  }

  .back-button {
    position: absolute;
    top: 10px;
    left: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 9px;
    border: 0;
    background: transparent;
    color: var(--focus);
    font-size: 12px;
    font-weight: 650;
  }

  .back-button svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
  }

  .detail-index,
  .detail-sections {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .contact-row {
    grid-template-columns: 88px minmax(0, 1fr) 44px;
  }

  .copy-value {
    width: 44px;
    height: 44px;
  }

  .same-name-record {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 52px;
  }

  .detail-empty {
    display: none;
  }
}

@media (max-width: 420px) {
  .corpus {
    display: none;
  }

  .review-quarantine {
    min-height: 44px;
  }

  .column-labels,
  .result-row {
    grid-template-columns: minmax(0, 1fr) 122px;
  }

  #globalSearch {
    font-size: 18px;
    letter-spacing: -0.018em;
  }

  .reachability-statuses {
    gap: 2px;
  }

  .available-channel {
    padding-right: 4px;
    padding-left: 4px;
  }
}

@media (max-width: 360px) {
  .auth-screen {
    padding: 12px;
  }

  .auth-panel {
    gap: 28px;
    padding: 30px 26px;
  }

  .auth-panel h1 {
    font-size: 28px;
  }

  .auth-control {
    grid-template-columns: 1fr;
  }

  .auth-control input {
    border-right: 1px solid var(--line-strong);
    border-bottom: 0;
  }

  .column-labels,
  .result-row {
    grid-template-columns: minmax(0, 1fr) 122px;
  }
}

@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;
  }
}
