.nd-map {
  margin: var(--sp-6) 0 var(--sp-8);
  padding: var(--sp-6);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  background: var(--bg-alt);
}
.nd-map .tv-label {
  margin: 0 0 var(--sp-4);
}
.nd-filters {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.nd-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}
.nd-filter-row > span {
  font-size: var(--text-xs);
  color: var(--faint);
  min-width: 7.5em;
}
.nd-pill {
  appearance: none;
  font: inherit;
  font-size: var(--text-sm);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 160ms,
    color 160ms,
    background 160ms;
}
.nd-pill:hover {
  color: var(--ink);
  border-color: var(--primary-line);
}
.nd-pill[aria-pressed=true] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.nd-pill:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
.nd-count {
  font-size: var(--text-xs);
  color: var(--faint);
  margin: 0 0 var(--sp-3);
}
.prose .nd-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--sp-3);
}
.prose .nd-card {
  margin: 0;
  padding: var(--sp-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface-card);
  display: grid;
  gap: var(--sp-2);
  align-content: start;
}
.nd-card[hidden] {
  display: none;
}
.nd-card h3 {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.3;
}
.prose .nd-card p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}
.prose .nd-card .nd-path {
  font-size: var(--text-xs);
  color: var(--faint);
}
.nd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nd-tag {
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-alt);
  color: var(--muted);
  white-space: nowrap;
}
.nd-tag--you {
  background: var(--success-fill);
  color: var(--success-text);
}
.nd-tag--frame {
  background: var(--bg-alt);
  color: var(--primary-text);
}
.nd-tag--self {
  background: var(--warning-fill);
  color: var(--warning-text);
}
.nd-card .inline-link {
  font-size: var(--text-xs);
}
.prose .nd-roles {
  list-style: none;
  margin: var(--sp-5) 0 var(--sp-6);
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}
.prose .nd-roles li {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(9em, 13em) 1fr minmax(8em, 11em);
  gap: var(--sp-4);
  align-items: baseline;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface-card);
}
.nd-roles b {
  font-weight: 600;
}
.nd-roles span {
  font-size: var(--text-sm);
  color: var(--muted);
}
.nd-roles em {
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--faint);
  text-align: right;
}
.prose .nd-roles li.nd-roles-agent {
  border-style: dashed;
  border-color: var(--primary-line);
}
@media (max-width: 640px) {
  .prose .nd-roles li {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }
  .nd-roles em {
    text-align: left;
  }
}
.prose .nd-flow {
  list-style: none;
  margin: var(--sp-5) 0 var(--sp-6);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2);
  counter-reset: nd;
}
.prose .nd-flow li {
  margin: 0;
  position: relative;
  padding: var(--sp-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface-card);
  font-size: var(--text-sm);
  line-height: 1.4;
  counter-increment: nd;
}
.nd-flow li::before {
  content: counter(nd);
  display: block;
  font: 600 var(--text-xs) var(--font-mono);
  color: var(--primary-text);
  margin-bottom: 4px;
}
.nd-flow li b {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.nd-flow li small {
  color: var(--muted);
  font-size: var(--text-xs);
}
.nd-flow li.nd-flow-new {
  border-color: var(--primary-line);
}
@media (max-width: 760px) {
  .prose .nd-flow {
    grid-template-columns: 1fr;
  }
}
.nd-check {
  margin: var(--sp-6) 0 var(--sp-8);
  padding: var(--sp-6);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  background: var(--bg-alt);
  display: grid;
  gap: var(--sp-4);
}
.nd-check .tv-label {
  margin: 0;
}
.nd-facts {
  font-size: var(--text-sm);
  color: var(--muted);
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--line);
  background: var(--surface-card);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.prose .nd-facts p {
  margin: 0;
}
.nd-ad {
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-card);
  box-shadow: var(--sh-1, none);
}
.nd-ad-kind {
  font-size: var(--text-xs);
  color: var(--faint);
  margin-bottom: var(--sp-2);
}
.nd-ad-title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--sp-2);
}
.nd-ad-text {
  font-size: var(--text-sm);
  line-height: 1.6;
}
.nd-frag {
  appearance: none;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 2px;
  margin: 0 -2px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: underline dotted var(--faint);
  text-underline-offset: 3px;
  text-align: left;
}
.nd-frag:hover {
  background: var(--bg-alt);
}
.nd-frag:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 1px;
}
.nd-frag.is-error {
  background: var(--warning-fill);
  color: var(--warning-text);
  text-decoration: line-through;
}
.nd-frag.is-ok {
  background: var(--success-fill);
  color: var(--success-text);
  text-decoration: none;
}
.nd-check-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
}
.prose .nd-check-status p {
  margin: 0;
  font-size: var(--text-sm);
}
.nd-check-note {
  min-height: 3em;
  font-size: var(--text-sm);
  color: var(--muted);
}
.prose .nd-check-note p {
  margin: 0;
}
.nd-check-reveal {
  appearance: none;
  font: inherit;
  font-size: var(--text-sm);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--muted);
  cursor: pointer;
}
.nd-check-reveal:hover {
  color: var(--ink);
}
.nd-check-reveal:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}
@media (prefers-reduced-motion: reduce) {
  .nd-pill {
    transition: none;
  }
}
