:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #152022;
  --muted: #697477;
  --subtle: #8a9496;
  --line: #d9dfdc;
  --line-strong: #c4cdca;
  --paper: #ffffff;
  --ground: #f2f5f3;
  --panel: #f8faf9;
  --accent: #167d72;
  --accent-soft: #dff1ec;
  --coral: #c14f66;
  --violet: #6d4dc2;
  --amber: #a35d1b;
  --blue: #2f68b0;
  --header-height: 72px;
  --control-height: 66px;
  --sidebar-width: 226px;
  --inspector-width: 322px;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--ground);
  color: var(--ink);
}

body {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 125, 114, 0.22);
  outline-offset: 2px;
}

a {
  color: inherit;
}

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

.app-shell {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) var(--control-height) 1fr;
  overflow: hidden;
}

.app-header {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(420px, 1fr) var(--inspector-width);
  align-items: center;
  min-width: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  text-decoration: none;
  border-right: 1px solid var(--line);
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  content: "";
  position: absolute;
  display: block;
  background: var(--accent);
}

.brand-mark::before {
  width: 2px;
  height: 27px;
  left: 16px;
  top: 4px;
}

.brand-mark::after {
  width: 22px;
  height: 2px;
  left: 6px;
  top: 17px;
}

.brand-mark i {
  width: 7px;
  height: 7px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
}

.brand-mark i:nth-child(1) {
  left: 13px;
  top: 0;
}

.brand-mark i:nth-child(2) {
  left: 2px;
  top: 14px;
}

.brand-mark i:nth-child(3) {
  right: 2px;
  top: 14px;
}

.brand-mark i:nth-child(4) {
  left: 5px;
  bottom: 0;
}

.brand-mark i:nth-child(5) {
  right: 5px;
  bottom: 0;
}

.brand-copy {
  min-width: 0;
  display: grid;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.view-switcher {
  justify-self: center;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  min-height: 38px;
  padding: 3px;
  background: #edf1ef;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.view-switcher button {
  min-height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.view-switcher button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(21, 32, 34, 0.12);
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #0b655d;
  font-size: 11px;
}

.dataset-meta {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 0 22px;
  border-left: 1px solid var(--line);
}

.dataset-meta strong {
  font-size: 13px;
}

.dataset-meta span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.control-bar {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
  align-items: center;
  padding: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.dataset-control {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.dataset-control select {
  width: 100%;
  height: 30px;
  padding-left: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.search-control {
  position: relative;
  grid-column: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}

.search-control::before {
  content: "";
  width: 15px;
  height: 15px;
  margin-right: 11px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-control::after {
  content: "";
  position: absolute;
  left: 37px;
  top: 36px;
  width: 7px;
  height: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

.search-control input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-control input::placeholder {
  color: var(--subtle);
}

.search-control input:focus {
  outline: 0;
}

.search-control kbd {
  position: absolute;
  right: 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  box-shadow: 0 1px 0 var(--line);
}

.control-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 14px;
}

.control-group label,
.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.control-group label > span {
  display: none;
}

.control-group label {
  min-width: 0;
  flex: 1;
}

.control-group label select {
  width: 100%;
}

select {
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}

.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button,
.term-info,
.dialog-close {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-weight: 750;
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 13px;
}

.icon-button:hover,
.term-info:hover,
.dialog-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
  overflow: hidden;
}

.filter-panel,
.inspector {
  min-height: 0;
  overflow-y: auto;
  background: var(--paper);
}

.filter-panel {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
}

.filter-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 13px;
}

.filter-heading h2 {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.2;
}

.secondary-heading {
  margin-top: 25px;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: #0b655d;
  font-size: 11px;
  font-weight: 750;
}

.filter-list {
  display: grid;
  gap: 5px;
}

.filter-option {
  min-height: 36px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filter-option:hover {
  background: var(--panel);
  color: var(--ink);
}

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

.filter-option .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 2px;
}

.filter-label {
  min-width: 0;
  display: flex;
  align-items: center;
}

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

.term-info {
  width: 24px;
  height: 24px;
  padding: 0;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.filter-list.compact .filter-option {
  min-height: 32px;
}

.filter-note {
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 9px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.filter-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.freshness-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.workspace {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--ground);
}

.view-panel {
  display: none;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 20px;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

.workspace-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 50px;
  margin-bottom: 14px;
}

.workspace-heading h1 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.legend-line {
  width: 18px;
  border-top: 2px solid currentColor;
}

.legend-line.ecosystem {
  border-top-style: dashed;
}

.map-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, #e8ecea 32px);
}

.lineage-map {
  position: relative;
  min-width: 1220px;
  min-height: 840px;
}

.map-lane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 190px;
  border-left: 1px solid #e8ecea;
}

.map-lane:last-child {
  border-right: 1px solid #e8ecea;
}

.lane-label {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 249, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.year-line {
  position: absolute;
  left: 54px;
  right: 0;
  height: 1px;
  background: #dce2df;
}

.year-label {
  position: absolute;
  left: 9px;
  width: 37px;
  color: var(--subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  transform: translateY(-6px);
}

.map-edges {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.map-edge {
  fill: none;
  stroke-width: 2;
  opacity: 0.7;
}

.map-edge.ecosystem {
  stroke-dasharray: 6 5;
}

.map-edge.dimmed {
  opacity: 0.08;
}

.map-node-shell {
  position: absolute;
  z-index: 2;
  width: 164px;
  min-height: 66px;
}

.map-node {
  position: relative;
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 7px 1fr;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 15px rgba(21, 32, 34, 0.07);
}

.map-node-shell:hover .map-node,
.map-node.selected {
  border-color: var(--node-color);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--node-color) 18%, transparent),
    0 7px 18px rgba(21, 32, 34, 0.1);
}

.map-node.filtered-out {
  display: none;
}

.map-product-link {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.map-product-link:hover {
  border-color: var(--node-color);
  color: var(--node-color);
}

.node-accent {
  height: 100%;
  min-height: 64px;
  border-radius: 4px 0 0 4px;
  background: var(--node-color);
}

.node-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 34px 9px 10px;
}

.node-copy strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-copy small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.node-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--status-color);
}

.node-status-dot.active {
  --status-color: #2d8a62;
}

.node-status-dot.preview {
  --status-color: #2f68b0;
}

.node-status-dot.migration {
  --status-color: #a35d1b;
}

.node-status-dot.sunsetting {
  --status-color: #c14f66;
}

.node-status-dot.experimental {
  --status-color: #6d4dc2;
}

.node-status-dot.legacy,
.node-status-dot.retired {
  --status-color: #8a9496;
}

.node-status-dot.restricted {
  --status-color: #c14f66;
}

.inspector {
  border-left: 1px solid var(--line);
}

.inspector-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.inspector-empty .empty-symbol {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--accent);
  font-size: 22px;
}

.inspector-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.inspector-empty p {
  max-width: 220px;
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.inspector-header {
  padding: 24px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.inspector-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.provider-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.close-inspector {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.close-inspector:hover {
  background: var(--panel);
  color: var(--ink);
}

.inspector-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tool-glyph {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--node-color) 14%, white);
  color: var(--node-color);
  font-size: 17px;
  font-weight: 800;
}

.inspector-title-row h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.inspector-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.inspector-product-link,
.compare-product-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.inspector-product-link:hover,
.compare-product-link:hover {
  text-decoration: underline;
}

.badge-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.2;
}

.badge {
  background: color-mix(in srgb, var(--badge-color) 12%, white);
  color: var(--badge-color);
  font-weight: 750;
}

.badge.status {
  --badge-color: #697477;
  background: #edf1ef;
}

.badge.status.sunsetting {
  --badge-color: var(--coral);
  background: #f8e7eb;
}

.badge.status.migration {
  --badge-color: var(--amber);
  background: #f6ebde;
}

.badge.status.restricted {
  --badge-color: var(--coral);
  background: #f8e7eb;
}

.badge.status.legacy,
.badge.status.retired {
  --badge-color: var(--muted);
  background: #edf1ef;
}

.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
}

.inspector-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.inspector-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
}

.inspector-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.status-note {
  margin-top: 12px !important;
  padding: 10px 11px;
  border-left: 3px solid var(--coral);
  background: #fbf0f2;
  color: #7f3040 !important;
}

.fact-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

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

.fact-list dd {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.relation-list,
.source-list {
  display: grid;
  gap: 7px;
}

.relation-row,
.source-link {
  min-height: 34px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 10px;
  text-decoration: none;
}

.relation-row:hover,
.source-link:hover {
  border-color: var(--accent);
}

.relation-mark {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--relation-color);
}

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

.compare-action {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.compare-action:hover {
  background: var(--accent);
}

.compare-action.selected {
  background: var(--accent-soft);
  color: #0b655d;
}

.directory-table {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.directory-header,
.directory-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) 140px 120px minmax(190px, 1.4fr) 88px 42px;
  gap: 14px;
  align-items: center;
  min-width: 860px;
}

.directory-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.directory-row {
  min-height: 76px;
  padding: 10px 16px;
  border-bottom: 1px solid #e8ecea;
  background: var(--paper);
}

.directory-row:last-child {
  border-bottom: 0;
}

.directory-row:hover {
  background: #fafcfb;
}

.directory-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-mark {
  width: 5px;
  height: 36px;
  flex: 0 0 5px;
  border-radius: 3px;
  background: var(--node-color);
}

.directory-name button {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.directory-product-link {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.directory-product-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.directory-name small,
.directory-cell {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.directory-cell.status-cell {
  color: var(--ink);
  font-weight: 650;
}

.inline-term {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--line-strong);
  background: transparent;
  color: inherit;
  font-size: inherit;
  text-align: left;
}

.inline-term:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.compare-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 18px;
}

.compare-toggle.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.compare-grid {
  min-height: 0;
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-content: start;
  gap: 12px;
}

.compare-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--node-color);
  border-radius: var(--radius);
  background: var(--paper);
}

.compare-card-header {
  min-height: 132px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.compare-card-header h2 {
  margin: 0;
  font-size: 16px;
}

.compare-card-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.remove-compare {
  float: right;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.compare-row {
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid #e8ecea;
}

.compare-row:last-child {
  border-bottom: 0;
}

.compare-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.compare-row strong,
.compare-row p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.compare-placeholder {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.compare-placeholder strong {
  color: var(--ink);
  font-size: 13px;
}

.compare-placeholder p {
  max-width: 200px;
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

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

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  margin: 5px 0 14px;
  font-size: 11px;
}

.glossary-badge {
  border: 0;
  cursor: help;
}

.glossary-badge:hover {
  box-shadow: inset 0 0 0 1px currentColor;
}

.glossary-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(21, 32, 34, 0.24);
}

.glossary-dialog::backdrop {
  background: rgba(21, 32, 34, 0.46);
}

.glossary-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.glossary-header h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  font-size: 20px;
}

.glossary-content {
  max-height: calc(min(760px, 100dvh - 32px) - 79px);
  overflow-y: auto;
  padding: 22px;
}

.glossary-intro {
  max-width: 620px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.glossary-list {
  border-top: 1px solid var(--line);
}

.glossary-list-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 8px minmax(140px, 0.7fr) minmax(0, 1.5fr) 28px;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.glossary-list-row:hover {
  background: var(--panel);
}

.glossary-list-row > i,
.glossary-term-title > i {
  width: 8px;
  height: 28px;
  border-radius: 3px;
  background: var(--term-color);
}

.glossary-list-row strong {
  font-size: 12px;
}

.glossary-list-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.glossary-list-row small {
  color: var(--subtle);
  font-size: 10px;
  text-align: center;
}

.glossary-back {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.glossary-detail {
  max-width: 620px;
}

.glossary-term-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.glossary-term-title h3 {
  margin: 0;
  font-size: 22px;
}

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

.glossary-detail h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.glossary-detail p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.glossary-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.glossary-examples span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
}

.mobile-backdrop {
  display: none;
}

.mobile-backdrop[hidden] {
  display: none;
}

@media (max-width: 1320px) {
  .legend {
    display: none;
  }
}

@media (max-width: 1240px) {
  :root {
    --sidebar-width: 210px;
    --inspector-width: 300px;
  }

  .dataset-meta {
    padding: 0 16px;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 64px;
    --control-height: 58px;
    --sidebar-width: 190px;
  }

  .app-header {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .dataset-meta {
    display: none;
  }

  .control-bar {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto;
  }

  .search-control {
    grid-column: 2;
  }

  .app-body {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .inspector {
    position: fixed;
    z-index: 20;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: min(390px, 92vw);
    transform: translateX(100%);
    transition: transform 180ms ease;
    box-shadow: -16px 0 40px rgba(21, 32, 34, 0.18);
  }

  .inspector.open {
    transform: translateX(0);
  }

  .mobile-backdrop {
    position: fixed;
    z-index: 19;
    inset: var(--header-height) 0 0;
    display: block;
    background: rgba(21, 32, 34, 0.3);
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: visible;
  }

  .app-header {
    min-height: 112px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 8px;
    padding: 9px 12px;
  }

  .brand {
    height: 38px;
    padding: 0;
    border: 0;
  }

  .brand-copy {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 8px;
  }

  .brand-copy small {
    font-size: 12px;
  }

  .view-switcher {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: repeat(3, 1fr);
  }

  .view-switcher button {
    padding: 0 6px;
    font-size: 11px;
  }

  .control-bar {
    grid-template-columns: 1fr;
    padding: 8px 12px;
    gap: 8px;
  }

  .dataset-control {
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
  }

  .search-control {
    grid-column: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
  }

  .search-control::after {
    left: 25px;
    top: 24px;
  }

  .search-control kbd {
    right: 10px;
  }

  .control-group {
    padding: 0;
    justify-content: space-between;
  }

  .control-group label {
    flex: 1;
  }

  .control-group select {
    width: 100%;
  }

  .control-group .secondary-button {
    padding: 0 9px;
  }

  .app-body {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .filter-panel {
    display: none;
  }

  .workspace {
    min-height: calc(100dvh - 196px);
  }

  .view-panel {
    padding: 12px;
  }

  .workspace-heading {
    align-items: flex-start;
    min-height: auto;
    margin-bottom: 10px;
  }

  .workspace-heading h1 {
    font-size: 17px;
  }

  .legend {
    display: none;
  }

  .map-scroll {
    min-height: 600px;
  }

  .lineage-map {
    min-height: 800px;
  }

  .directory-header {
    display: none;
  }

  .directory-table {
    border: 0;
    background: transparent;
  }

  .directory-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
    min-height: 92px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .directory-row > :not(.directory-name, .compare-toggle) {
    display: none;
  }

  .glossary-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .glossary-header {
    min-height: 72px;
    padding: 15px 16px;
  }

  .glossary-header h2 {
    font-size: 17px;
  }

  .glossary-content {
    max-height: calc(100dvh - 93px);
    padding: 16px;
  }

  .glossary-list-row {
    grid-template-columns: 8px minmax(0, 1fr) 24px;
    gap: 10px;
  }

  .glossary-list-row span {
    grid-column: 2 / -1;
  }

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

  .sort-control span {
    display: none;
  }
}

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