.term-card { border: 1px solid var(--line, #dce3eb); border-radius: 12px; background: var(--surface, #fff); margin: 12px 0; overflow: hidden; }
.term-card summary { cursor: pointer; display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; padding: 18px 20px; }
.term-card summary::before { content: '+'; color: #65748b; }
.term-card[open] summary::before { content: '−'; }
.term-card.is-focused { border-color: #346ac3; box-shadow: 0 0 0 2px #346ac322; }
.term-code { font: 500 13px 'DM Mono', monospace; color: #27599e; overflow-wrap: anywhere; }
.term-card summary strong { font-size: 16px; color: #172b45; }
.term-status { margin-left: auto; font-size: 12px; text-transform: capitalize; color: #526580; background: #f0f4f8; border-radius: 16px; padding: 4px 10px; }
.term-body { padding: 0 22px 22px; line-height: 1.65; overflow-wrap: anywhere; }
.term-body p { margin: 8px 0 14px; }
.term-definition { font-size: 16px; white-space: pre-line; }
.term-wording { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-block: 1px solid #e5eaf0; margin: 20px 0 14px; padding: 14px 0 0; }
.term-wording h3 { font-size: 13px; margin: 0; color: #526580; }
.term-meta { font-size: 12px; color: #64748b; }
.term-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 13px; }
.term-card.is-proposed { border-style: dashed; }
.term-card.is-proposed .term-status { color: #8a5a00; background: #fff4dc; }
.term-note { font-size: 13px; color: #64748b; }
.term-body h3 { font-size: 13px; margin: 14px 0 4px; color: #526580; }
.term-evidence { margin: 4px 0 12px; padding-left: 18px; font-size: 13px; }
.term-evidence li { margin: 4px 0; }
.term-summary { margin: 4px 0 14px; }
.term-totals { margin: 0 0 8px; line-height: 1.6; }
.term-sources summary { cursor: pointer; font-weight: 600; color: #27599e; }
.term-sources table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.term-sources th, .term-sources td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid #e5eaf0; overflow-wrap: anywhere; }
.term-sources td:nth-child(2), .term-sources td:nth-child(3), .term-sources td:nth-child(4) { white-space: nowrap; overflow-wrap: normal; }
.term-sources .term-status { margin-left: 0; }
.term-sources tr[data-source-status="missing"] .term-status, .term-sources tr[data-source-status="unreadable"] .term-status { color: #9a2a2a; background: #fde8e8; }
.term-sources tr[data-source-status="restricted"] .term-status { color: #6b4f00; background: #fff4dc; }
@media (max-width: 640px) { .term-wording { grid-template-columns: 1fr; gap: 2px; } .term-card summary { gap: 8px; padding: 14px; } .term-body { padding-inline: 14px; } }

@media screen {
  html[data-theme="dark"] .term-card summary::before,
  html[data-theme="dark"] :is(.term-wording h3, .term-meta, .term-note, .term-body h3) { color: var(--muted-strong); }
  html[data-theme="dark"] .term-card summary strong { color: var(--ink); }
  html[data-theme="dark"] :is(.term-code, .term-sources summary) { color: var(--blue-dark); }
  html[data-theme="dark"] .term-card.is-focused { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-pale); }
  html[data-theme="dark"] :is(.term-wording, .term-sources th, .term-sources td) { border-color: var(--line-soft); }
  html[data-theme="dark"] .term-status { color: var(--ink-soft); background: var(--paper-soft); }
  html[data-theme="dark"] .term-card.is-proposed .term-status,
  html[data-theme="dark"] .term-sources tr[data-source-status="restricted"] .term-status { color: var(--amber); background: var(--amber-pale); }
  html[data-theme="dark"] .term-sources tr:is([data-source-status="missing"], [data-source-status="unreadable"]) .term-status { color: var(--red); background: var(--red-pale); }
}
