/* Exact Dx site pages. Uses only the shared design tokens from /static/clockworks.css (colour, spacing, type, radius,
   elevation) so contrast and dark mode stay correct. Status is always icon + words; one accent for "needs a look". */

/* ------------------------------------------------------------------ page frame */
.xd-page { max-width: 1240px; margin: 0 auto; }
.xd-narrow { max-width: 60rem; }
.xd-page h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; }
.xd-page h2 { font-size: var(--fs-lg); }
.xd-page h3 { font-size: var(--fs-base); }
.xd-eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin: 0 0 var(--sp-2); }
.xd-h1-sub { font-weight: 400; color: var(--text-2); font-size: var(--fs-lg); letter-spacing: 0; }
.xd-lede { font-size: var(--fs-lg); color: var(--text-2); margin-bottom: var(--sp-5); max-width: 62ch; line-height: var(--lh-base); }
.xd-meta, .xd-threshold, .xd-row-sub, .xd-date { font-size: var(--fs-sm); color: var(--text-2); }
.xd-back { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.xd-back a { color: var(--text-2); text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }
.xd-back a:hover { color: var(--text); text-decoration: underline; }
.xd-pagehead { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end; justify-content: space-between; margin-bottom: var(--sp-5); }
.xd-pagehead .xd-lede { margin-bottom: 0; }
.xd-start { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.xd-startlink { font-weight: 600; }
.xd-arrow-r::after { content: "→"; margin-left: .2rem; }

/* ------------------------------------------------------------------ first page: summary tiles + note list */
.xd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-5); padding: 0; list-style: none; }
.xd-stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-1);
  display: flex; gap: var(--sp-3); align-items: center; }
.xd-stat-ico { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1rem; font-weight: 700; flex: none;
  background: var(--surface-3); color: var(--text-2); }
.xd-stat--needs_look .xd-stat-ico { background: var(--look-bg); color: var(--look); }
.xd-stat--agrees .xd-stat-ico { background: var(--ok-bg); color: var(--ok-fg); }
.xd-stat strong { display: block; font-size: var(--fs-xl); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.xd-stat span { font-size: var(--fs-sm); color: var(--text-2); }
@media (max-width: 640px) { .xd-stats { grid-template-columns: 1fr; } }

.xd-listcard { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.xd-listhead { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-base);
  padding: var(--sp-3) var(--sp-4); margin: 0; border-bottom: 1px solid var(--border-soft); }
.xd-show { font-weight: 400; font-size: var(--fs-md); display: inline-flex; gap: 2px; align-items: center; background: var(--surface-3); border-radius: var(--r-md); padding: 3px; }
.xd-show > span { padding: 0 var(--sp-2); color: var(--text-2); }
.xd-show a, .xd-show strong { padding: .25rem .7rem; border-radius: 5px; text-decoration: none; color: var(--text-2); font-weight: 500; }
.xd-show a:hover { color: var(--text); }
.xd-show strong { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
.xd-cols, .xd-row a { display: grid; grid-template-columns: minmax(10rem, 1.3fr) minmax(8rem, 1fr) minmax(9rem, 1fr) minmax(10rem, auto) 1rem; gap: var(--sp-1) var(--sp-4);
  align-items: center; padding: 0 var(--sp-4); }
.xd-cols { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft); min-height: 34px; }
.xd-rows { list-style: none; margin: 0; padding: 0; }
.xd-row { border-bottom: 1px solid var(--border-soft); position: relative; }
.xd-row:last-child { border-bottom: 0; }
.xd-row a { min-height: 60px; color: inherit; text-decoration: none; }
.xd-row a:hover { background: var(--surface-2); }
.xd-row a:focus-visible { outline-offset: -3px; }
.xd-row a::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--text-3); border-top: 2px solid var(--text-3); transform: rotate(45deg); justify-self: end; }
.xd-row-who { display: flex; align-items: center; gap: var(--sp-3); font-weight: 600; }
.xd-pidchip { font-family: var(--mono); font-size: var(--fs-sm); font-weight: 600; background: var(--surface-3); border-radius: var(--r-sm); padding: .15rem .45rem; color: var(--text); }
.xd-row-origin, .xd-row-visit { color: var(--text-2); font-size: var(--fs-md); }
.xd-row--needs_look::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--look-line); }
.xd-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-2); }
@media (max-width: 760px) {
  .xd-cols { display: none; }
  .xd-row a { grid-template-columns: 1fr auto; padding: var(--sp-3) var(--sp-4); }
  .xd-row a::after { display: none; }
  .xd-row-origin, .xd-row-visit { grid-column: 1; }
  .xd-row a .xd-status { grid-row: 1; grid-column: 2; }
}

/* ------------------------------------------------------------------ status labels and provenance */
.xd-status { display: inline-flex; gap: .4rem; align-items: center; font-weight: 600; white-space: nowrap; font-size: var(--fs-sm); line-height: 1.3;
  border: 1px solid var(--border-soft); border-radius: var(--r-pill); padding: .15rem .65rem; background: var(--surface); color: var(--text); justify-self: start; }
.xd-status--needs_look { color: var(--look); background: var(--look-bg); border-color: var(--look-line); }
.xd-status--agrees { color: var(--ok-fg); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok-fg) 35%, transparent); }
.xd-status--consistent { color: var(--ok-fg); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok-fg) 35%, transparent); }
.xd-status--could_not_check, .xd-status--read_yourself { border-style: dashed; border-color: var(--border); background: var(--surface-2); }
.xd-status--not_assessable { border-style: dashed; border-color: var(--border); }
.xd-origin { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sm); font-weight: 600; border: 1px solid var(--border-soft); border-radius: var(--r-pill);
  padding: .1rem .6rem; color: var(--text-2); background: var(--surface); letter-spacing: 0; }
.xd-origin--ai { border-color: var(--border); color: var(--text); background: var(--surface-3); }
.xd-tag { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; border: 1px solid var(--border); border-radius: var(--r-sm); padding: .05rem .4rem; }
.xd-chip { margin: .15rem .2rem 0 0; font-size: var(--fs-xs); }
.xd-badge-ai { background: var(--risk-bg); color: var(--risk-fg); }

/* ------------------------------------------------------------------ patient screen */
.xd-phead { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.xd-phead h1 { margin: 0; }
.xd-phead-tools { display: flex; gap: var(--sp-4); align-items: center; font-size: var(--fs-md); }
.xd-printbtn { display: inline-flex; gap: .4rem; align-items: center; color: var(--text-2); text-decoration: none; }
.xd-printbtn:hover { color: var(--text); text-decoration: underline; }
.xd-headline { font-size: var(--fs-lg); line-height: var(--lh-base); background: var(--surface); border: 1px solid var(--border-soft); border-left: 4px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); box-shadow: var(--shadow-1); }
.xd-headline--needs_look { border-left-color: var(--look-line); }
.xd-headline--agrees, .xd-headline--consistent { border-left-color: var(--ok-fg); }
.xd-headline .xd-status { margin-right: var(--sp-2); vertical-align: 2px; }
.xd-headline q, .xd-finding q, .xd-quote q { font-style: italic; }
.xd-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 960px) { .xd-two { grid-template-columns: 1fr; } }
.xd-pane { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.xd-pane > h2, .xd-panehead { display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; margin: 0; padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border-soft); font-size: var(--fs-base); }
.xd-panebody { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.xd-respane { position: sticky; top: 76px; }
.xd-note { font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-read); white-space: pre-wrap; word-break: break-word; margin: 0 0 var(--sp-4);
  padding: 0; background: none; border: 0; max-width: 72ch; }
.xd-note mark { background: var(--mark-bg); color: var(--mark-fg); padding: .05rem .15rem; border-radius: 3px; box-shadow: inset 0 -2px 0 currentColor; }
.xd-notetext { width: 100%; min-height: 22rem; font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-read); }
.xd-actions, .xd-row-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.xd-actions form, .xd-row-actions form { margin: 0; }
.xd-actions { padding-top: var(--sp-4); border-top: 1px solid var(--border-soft); }
.xd-finding { border-top: 1px solid var(--border-soft); padding: var(--sp-4) 0; }
.xd-finding:first-of-type { border-top: 0; padding-top: var(--sp-2); }
.xd-finding h3 { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); font-size: var(--fs-base); }
.xd-finding--needs_look h3 { color: var(--look); }
.xd-evidence { list-style: none; padding: 0; margin: var(--sp-2) 0; border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.xd-evidence li { padding: .45rem var(--sp-3); font-variant-numeric: tabular-nums; font-size: var(--fs-md); border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.xd-evidence li:last-child { border-bottom: 0; }
.xd-date { display: inline-block; min-width: 6.5rem; font-variant-numeric: tabular-nums; }
.xd-threshold { margin: 0; }
.xd-details { margin-top: var(--sp-4); border-top: 1px solid var(--border-soft); padding-top: var(--sp-3); }
.xd-details > summary { cursor: pointer; font-weight: 600; color: var(--link); padding: var(--sp-1) 0; list-style: none; display: inline-flex; gap: .5rem; align-items: center; }
.xd-details > summary::-webkit-details-marker { display: none; }
.xd-details > summary::before { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
  transition: transform .15s var(--ease); }
.xd-details[open] > summary::before { transform: rotate(45deg); }
.xd-detailbody { display: grid; gap: var(--sp-4); margin-top: var(--sp-3); }
.xd-detailbody .cw-card { margin: 0; }
.xd-banner { display: flex; gap: var(--sp-2); align-items: baseline; border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
  background: var(--info-bg); color: var(--info-fg); margin: 0 0 var(--sp-4); }
.xd-banner--warn { background: var(--look-bg); color: var(--look); border-color: var(--look-line); border-left: 4px solid var(--look-line); }
mark.xd-unread { background: transparent; outline: 2px dashed currentColor; outline-offset: 1px; font-weight: 600; }
mark.xd-mentioned { background: transparent; text-decoration: underline dotted; box-shadow: none; }

/* decisions, calculator, toggles (inside "Show the details") */
.xd-decide { display: grid; gap: var(--sp-2); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-4); background: var(--surface-2); }
.xd-decide h3 { margin: 0; }
.xd-decide input[type=text] { width: 100%; }
.xd-calc { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: end; }
.xd-calc input { width: 8rem; }
.xd-kcard h3 { margin-top: 0; }
.xd-twoway th { width: 55%; font-weight: 600; font-size: var(--fs-md); }
.xd-twoway td { font-size: var(--fs-md); }
.xd-crit { list-style: none; padding: 0; }
.xd-crit li { margin: .4rem 0; padding-left: 1.4rem; text-indent: -1.4rem; }
.xd-mark { display: inline-block; width: 1.4rem; text-indent: 0; font-weight: 700; }
.xd-toggle { border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-2) var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.xd-toggle legend { font-weight: 600; padding: 0 var(--sp-1); }
.xd-toggle-opt { border: 1px solid var(--border-soft); border-radius: var(--r-pill); padding: .25rem .7rem; text-decoration: none; font-size: var(--fs-sm); color: var(--text); }
.xd-toggle-opt:hover { border-color: var(--border); }
.xd-toggle-opt[aria-checked="true"], .xd-toggle-opt[aria-current="true"] { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; color: var(--text); }
.xd-toggle-opt[aria-checked="true"]::before, .xd-toggle-opt[aria-current="true"]::before { content: "● "; color: var(--primary); }
.xd-stagebox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-3) 0; }
.xd-stagebox > div { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-3); }
@media (max-width: 520px) { .xd-stagebox { grid-template-columns: 1fr; } }
.xd-big { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.1; }
.xd-selected th, .xd-selected td { font-weight: 700; background: var(--primary-soft); }
.xd-hash { word-break: break-all; font-size: var(--fs-xs); }
.xd-tight { margin: 0; padding-left: 1.1rem; }
.xd-kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-md); }
.xd-kv dt { font-weight: 600; color: var(--text-2); }
.xd-kv dd { margin: 0; }
@media (max-width: 640px) { .xd-kv { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ results, rules, other pages */
.xd-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-6); }
.xd-figure { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); margin: 0; box-shadow: var(--shadow-1);
  color: var(--text-2); }
.xd-figure strong { display: block; font-size: var(--fs-3xl); line-height: 1.1; color: var(--text); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-bottom: var(--sp-1); }
.xd-section { margin: var(--sp-6) 0; }
.xd-section > h2 { padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border-soft); margin-bottom: var(--sp-3); }
.xd-statlist { list-style: none; padding: 0; margin: 0 0 var(--sp-4); border: 1px solid var(--border-soft); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.xd-statlist li { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-soft); font-variant-numeric: tabular-nums; }
.xd-statlist li:last-child { border-bottom: 0; }
.xd-rulelist { list-style: none; padding: 0; margin: 0; counter-reset: rule; display: grid; gap: var(--sp-3); }
.xd-rulelist li { counter-increment: rule; position: relative; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5) var(--sp-4) calc(var(--sp-5) + 2.25rem); box-shadow: var(--shadow-1); }
.xd-rulelist li::before { content: counter(rule); position: absolute; left: var(--sp-4); top: var(--sp-4); width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: var(--fs-sm); display: grid; place-items: center; }
.xd-rulelist li > a { font-size: var(--fs-base); }
.xd-rulelist p { margin: var(--sp-1) 0 0; }
.xd-tests { list-style: none; padding: 0; } .xd-tests li { margin: .3rem 0; }
.xd-meter { height: .9rem; border: 1px solid var(--border); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); max-width: 30rem; }
.xd-meter span { display: block; height: 100%; background: var(--look-line); }
.xd-json, .xd-querytext { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: var(--fs-sm); background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }

/* extended (experimental) area: kept as before, on the shared tokens */
.xd-sym { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--sp-3); margin: var(--sp-3) 0 var(--sp-4); }
.xd-sym a { text-decoration: none; color: inherit; }
.xd-sym .cw-card { margin: 0; }
.xd-arrow { white-space: nowrap; }
.xd-code { font-family: var(--mono); font-size: .9em; }
.xd-trace td, .xd-trace th { font-size: var(--fs-sm); }
.xd-trace code { white-space: pre-wrap; word-break: break-word; }
.xd-true { font-weight: 700; }
.xd-query { width: 100%; min-height: 24rem; font-family: var(--mono); font-size: var(--fs-sm); }
.xd-lint li { margin: .2rem 0; }
.xd-filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: end; }
.xd-filters > div { min-width: 11rem; }
.xd-options label { display: block; margin: .3rem 0; font-weight: 400; }
.xd-advisory, .xd-experimental { border-left: 4px solid var(--risk-fg); }
.xd-ladder { padding-left: 1.4rem; }
.xd-ladder li { margin: .15rem 0; }
.xd-rung-doc, .xd-rung-comp { font-weight: 600; }
.xd-net .xd-sym { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.xd-sign { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--sp-4); align-items: start; }
@media (max-width: 1100px) { .xd-sign { grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr); } .xd-col--panel { grid-column: 1 / -1; } }
@media (max-width: 720px) { .xd-sign { grid-template-columns: 1fr; } }
.xd-plist { list-style: none; padding: 0; margin: var(--sp-2) 0; max-height: 48rem; overflow-y: auto; }
.xd-plist li a { display: block; padding: .45rem .5rem; border-radius: var(--r-md); text-decoration: none; color: inherit; border: 1px solid transparent; }
.xd-plist li a:hover, .xd-plist li a:focus-visible { border-color: var(--border-soft); }
.xd-plist li a[aria-current="true"] { border-color: currentColor; background: var(--surface); }
.xd-pid { font-weight: 700; font-family: var(--mono); }

@media (forced-colors: active) { .xd-status, .xd-origin, .xd-stat, .xd-row--needs_look::before { border: 1px solid CanvasText; } }

/* ------------------------------------------------------------------ print: the patient check as evidence */
.xd-print-only { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  .xd-print-only { display: block; }
  .xd-noprint, .xd-actions, .xd-back, .xd-phead-tools, .xd-decide, #calc, .xd-row-actions, .cw-notice { display: none !important; }
  .xd-print-head { border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 12px; font-size: 10pt; display: flex; justify-content: space-between; }
  .xd-page { max-width: none; }
  .xd-two { grid-template-columns: 1fr 1fr; gap: 12px; }
  .xd-pane, .xd-headline, .cw-card { box-shadow: none; border-color: #999; break-inside: avoid; }
  .xd-respane { position: static; }
  .xd-note { font-size: 10.5pt; }
  .xd-note mark { background: #fff3a8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; outline: 1px solid #000; }
  .xd-status { border: 1px solid #000 !important; background: #fff !important; color: #000 !important; }
  .xd-details > summary { color: #000; }
  .xd-details > summary::before { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; word-break: break-all; }
}

/* other measurements checked against published definitions (criteria library) on the per-note screen */
.xd-libblock { margin-top: var(--sp-4); border-top: 1px solid var(--border-soft); padding-top: var(--sp-4); display: grid; gap: var(--sp-3); }
.xd-subh { font-size: var(--fs-base); margin: 0; }
.xd-libblock .xd-meta { margin: 0; }

/* staff surfaces: coder worklist, coder view, definition library (shared cw-* components; xk-/xb- are layout hooks) */
.xk-staff { display: inline-flex; align-items: center; gap: .3rem; padding: 1px var(--sp-2); margin-right: var(--sp-2); border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); letter-spacing: .06em; }
.xk-page .xd-stats, .xb-page .xd-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.xk-stat--unsupported .xd-stat-ico { background: var(--look-bg); color: var(--look); }
.xk-stat--less_specific .xd-stat-ico, .xk-stat--not_stated .xd-stat-ico { background: var(--look-bg); color: var(--look); }
.xd-stat--could_not_check .xd-stat-ico { background: var(--surface-3); color: var(--text-2); }
.xk-pid { font-family: var(--mono); font-weight: 600; }
.xk-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.xk-chips .cw-chip { text-decoration: none; white-space: normal; }
.xk-meta { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 var(--sp-4); }
.xk-muted { color: var(--text-2); font-size: var(--fs-sm); }
.xk-tier { font-size: var(--fs-xs); color: var(--text-2); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
.xk-table tbody.xk-fam { border-top: 2px solid var(--border); }
.xk-table td p, .xk-table th p { margin: 0 0 var(--sp-1); }
.xk-table td:nth-child(2) { min-width: 18rem; }
.xk-defline { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center; }
.xk-cat { font-weight: 600; }
.xk-values { list-style: none; margin: var(--sp-1) 0; padding: 0; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.xk-values li { display: flex; flex-wrap: wrap; gap: 0 var(--sp-2); justify-content: space-between; padding: 2px var(--sp-2); background: var(--surface-2); border-radius: var(--r-sm); }
.xk-alt { font-size: var(--fs-sm); color: var(--text-2); }
.xk-quote q { font-style: italic; }
.xk-assess { margin-bottom: var(--sp-2) !important; }
.xk-assess .cw-chip { white-space: normal; height: auto; padding: 2px .6rem; }
.xk-detail { font-size: var(--fs-sm); color: var(--text-2); }
.xk-refrow > td { background: var(--surface-2); padding-top: var(--sp-1); padding-bottom: var(--sp-2); }
.xk-coderef { margin: 0; }
.xk-codes { columns: 2 22rem; font-size: var(--fs-sm); margin: 0 0 var(--sp-2); padding-left: 1.1rem; }
.xk-cite .cw-cite-card { margin-top: var(--sp-2); }
.xk-query { margin: 0 0 var(--sp-5); border-left: 4px solid var(--primary); }
.xk-query-head { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.xk-query-head h2 { margin: 0; }
.xk-hint { color: var(--text-2); font-size: var(--fs-sm); max-width: 80ch; }
.xk-querytext { white-space: pre-wrap; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-3); max-height: 28rem; overflow: auto; }
.xk-lint { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: grid; gap: var(--sp-1); }
.xk-warn { color: var(--look); background: var(--look-bg); border-left: 3px solid var(--look-line); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.xb-setting { margin: 0 0 var(--sp-4); }
.xb-setting h2 { margin-top: 0; font-size: var(--fs-base); }
.xb-flabel { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.xb-count { color: var(--text-2); font-size: var(--fs-sm); margin: 0 0 var(--sp-2); }
.xb-def { margin: 0; }
.xb-def > .cw-group > summary { flex-wrap: wrap; }
.xb-title { font-weight: 600; }
.xb-key { font-size: var(--fs-xs); color: var(--text-2); font-weight: 400; margin-left: var(--sp-1); }
.xb-state--small { font-size: var(--fs-xs); color: var(--text-2); font-weight: 400; }
.xb-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.xb-fields dt { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.xb-fields dd { margin: 0; }
.xb-review { border-top: 1px solid var(--border-soft); padding-top: var(--sp-2); }
.xb-h { font-size: var(--fs-sm) !important; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 0 0 var(--sp-2); }
.xb-reviewform { margin-top: var(--sp-3); }
.xb-formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--sp-3); }
@media (max-width: 900px) { .xk-page .xd-stats, .xb-page .xd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xk-query, .xb-def, .xk-fam { scroll-margin-top: 84px; }
.xk-cite > summary::after { content: none; display: none; }
