/* External model validation web app. Fixed light theme, scoped to .designata.
   Sizes are rem-based tokens (root 16px) so text zoom scales everything. */

.designata {
  --paper: #f5f2eb;
  --surface: #fffefa;
  --ink: #252c32;
  --muted: #59646c;
  --navy: #233e54;
  --navy-hover: #1c3245;
  --line: #deded5;
  --soft: #eeefe9;
  --green: #2f5e4b;
  --green-bg: #e9f2ec;
  --wait: #6f521c;
  --wait-bg: #f6efe0;
  --error: #9b3a2f;
  --error-bg: #fbefec;
  --rust: #9b4b37;
  --focus: #bd775d;
  --title: #20364a;

  /* One typeface for the whole site; levels differ by size and weight only. */
  --font-heading: var(--font-ui);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-body: 1rem;        /* 16px */
  --text-nav: 0.9375rem;    /* 15px */
  --text-label: 0.9375rem;  /* 15px, 600 */
  --text-subsection: 1.125rem; /* 18px, 600 */
  --text-group: 1.3125rem;  /* 21px, serif */
  --text-step: 1.625rem;    /* 26px, serif */
  --text-help: 0.875rem;    /* 14px, the smallest text size */
  --text-meta: 0.875rem;    /* 14px */
  --text-badge: 0.875rem;   /* 14px */
  --text-card-title: 1.125rem; /* 18px */
  --text-section: 1.5rem;   /* 24px */
  --text-page-h1: 2.25rem;  /* 36px */
  --text-hero-h1: 3rem;     /* 48px */
  --text-hero-sub: 1.5rem;  /* 24px */
  --text-metric: 2.375rem;  /* 38px */
  --text-review: 1.125rem;  /* 18px */

  --radius-control: 6px;
  --radius-card: 12px;
  --pad-card: 28px;
  --gutter: 40px;
  --control-height: 48px;

  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
  font: var(--text-body)/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.designata *, .designata *::before, .designata *::after { box-sizing: border-box; }
.designata [hidden] { display: none !important; }
.designata :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Zero-specificity reset so component spacing rules always win. */
:where(.designata) :where(h1, h2, h3, p, dl, dd) { margin: 0; }
.designata a { color: var(--navy); }
.designata code, .designata .d-code { font-family: var(--font-code); font-size: var(--text-meta); overflow-wrap: anywhere; }
.designata button, .designata input, .designata select, .designata textarea { font: inherit; color: inherit; }

.d-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.d-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); border: 0; }

/* ---- Layout ---- */
.d-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.d-page { padding-top: 40px; padding-bottom: 64px; }
.d-section { padding-top: 8px; padding-bottom: 64px; }
.d-page > h1, .d-page-head h1 { font: 400 var(--text-page-h1)/1.15 var(--font-heading); letter-spacing: -0.01em; }
.d-page > h1 { margin-bottom: 24px; }
.d-page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.d-section-title { font: 400 var(--text-section)/1.3 var(--font-heading); margin: 48px 0 16px; }
.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--pad-card); min-width: 0; }
.d-card-title { font: 600 var(--text-card-title)/1.4 var(--font-ui); }
.d-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.d-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Header ---- */
.d-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.d-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 64px; }
.d-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.d-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-control);
  color: var(--muted); font-size: var(--text-nav); text-decoration: none; }
.d-nav a:hover { color: var(--navy); }
.d-nav a[aria-current="page"] { color: var(--navy); background: var(--soft); font-weight: 600; }
.d-account { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: var(--text-help); color: var(--muted); }
.d-account-email { overflow-wrap: anywhere; }

/* ---- Text ---- */
.d-help { font-size: var(--text-help); line-height: 1.5; color: var(--muted); max-width: 72ch; text-wrap: pretty; }
.d-meta { display: block; font-size: var(--text-meta); line-height: 1.45; color: var(--muted); }
.d-note { margin-top: 20px; font-size: var(--text-help); color: var(--muted); }
.d-label { font-size: var(--text-help); color: var(--muted); }
.d-optional { font-weight: 400; color: var(--muted); }
.d-field-label { display: block; margin: 20px 0 8px; font-size: var(--text-label); font-weight: 600; line-height: 1.4; }

/* ---- Buttons ---- */
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.d-primary, .d-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--control-height); padding: 12px 20px; border-radius: var(--radius-control); font-size: var(--text-body);
  line-height: 1.3; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.d-primary { border: 1px solid var(--navy); background: var(--navy); font-weight: 600; }
.designata .d-primary { color: var(--surface); }
.d-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.d-secondary { border: 1px solid #c9cabf; background: var(--surface); color: var(--navy); }
.d-secondary:hover { border-color: var(--navy); }
.d-primary:disabled, .d-secondary:disabled { opacity: .5; cursor: not-allowed; }
.d-primary:disabled:hover { background: var(--navy); }
.d-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1px solid #c9cabf; border-radius: var(--radius-control); background: var(--surface); color: var(--navy);
  font-size: var(--text-body); font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer; white-space: nowrap; }
.d-outline:hover { border-color: var(--navy); }
.d-outline[aria-expanded="true"] { background: var(--soft); border-color: var(--navy); }
.d-validate { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px;
  border: 1px solid #8fb0cd; border-radius: var(--radius-control); background: #e8f0f8; color: var(--navy); font-size: var(--text-body);
  font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.d-validate:hover { border-color: var(--navy); background: #dde9f4; }
.d-quiet { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--radius-control);
  background: none; color: var(--muted); font-size: var(--text-help); cursor: pointer; }
.d-quiet:hover { color: var(--error); background: var(--error-bg); }
.d-danger { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-height); padding: 12px 20px;
  border: 1px solid var(--error); border-radius: var(--radius-control); background: var(--error); color: #fff; font-size: var(--text-body);
  font-weight: 600; cursor: pointer; }
.d-danger:disabled, .d-outline:disabled { opacity: .55; cursor: not-allowed; }
.designata button.d-danger { color: #fff; }
.d-textbutton { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; border: 0; background: none;
  color: var(--navy); font-size: var(--text-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.d-block { width: 100%; margin-top: 24px; }

/* ---- Badges ---- */
.d-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--soft); color: var(--ink); font-size: var(--text-badge); line-height: 1.3;
  font-weight: 600; white-space: nowrap; }
.d-badge .d-icon { width: 14px; height: 14px; }
.d-badge.is-ok { background: var(--green-bg); border-color: #c9ddcf; color: var(--green); }
.d-badge.is-wait { background: var(--wait-bg); border-color: #e6d6b4; color: var(--wait); }
.d-badge.is-bad { background: var(--error-bg); border-color: #efd3cc; color: var(--error); }
.d-badge.is-demo { background: #eef1f6; border-color: #d5dce8; color: var(--navy); }
.d-badge.is-format { min-height: 24px; padding: 1px 8px; border-radius: 4px; background: var(--surface); color: var(--muted);
  font-family: var(--font-code); font-size: var(--text-help); font-weight: 600; }

/* ---- Forms ---- */
.designata input[type="text"], .designata input[type="email"], .designata input[type="password"], .designata select, .designata textarea {
  display: block; width: 100%; min-height: var(--control-height); padding: 11px 14px; border: 1px solid #cfd0c6;
  border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font-size: var(--text-body); line-height: 1.4; }
.designata textarea { min-height: 200px; resize: vertical; font-family: var(--font-code); font-size: var(--text-help); }
.d-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.d-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.d-choice { display: flex; gap: 12px; align-items: flex-start; min-height: 64px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; }
.d-choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #f7f8f4; }
.d-choice.is-disabled { cursor: not-allowed; opacity: .75; }
.d-choice input, .d-check input, .d-model-card input, .d-config-pick input { width: 20px; height: 20px; margin: 2px 0 0; flex: none;
  accent-color: var(--navy); }
.d-choice strong { display: block; font-size: var(--text-body); font-weight: 600; }
.d-choice small { display: block; font-size: var(--text-help); color: var(--muted); line-height: 1.45; }
.d-check { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: var(--text-body); cursor: pointer; }
.d-label-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.d-show-password { min-height: 36px; padding: 4px 0; margin-bottom: 4px; font-size: var(--text-help); }
.d-group { padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--line); }
/* Form hierarchy: step title (serif, largest) > section title (serif, numbered) >
   subsection title (sans 600, 18px) > field label (sans 600, 15px) > help (14px, muted). */
.d-step-title { font: 400 var(--text-step)/1.25 var(--font-heading); margin-bottom: 16px; padding: 0; }
.d-group-title { display: flex; align-items: center; gap: 12px; font: 400 var(--text-group)/1.3 var(--font-heading); }
.d-group-title .d-optional { font: 400 var(--text-help)/1.3 var(--font-ui); }
.d-group-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: var(--surface); font: 600 var(--text-help)/1 var(--font-ui); }
.d-group-intro { margin-top: 6px; font-size: var(--text-help); line-height: 1.5; color: var(--muted); max-width: 72ch; }
/* A legend ignores its top margin inside a fieldset; floating it makes it lay out like a label. */
.d-fieldset > legend { float: left; width: 100%; padding: 0; }
.d-fieldset > legend + * { clear: both; }
.d-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 132px;
  padding: 20px; border: 1px dashed #bfc0b5; border-radius: 10px; background: var(--paper); text-align: center; cursor: pointer; }
.d-upload:hover, .d-upload.is-dragover { border-color: var(--navy); }
.d-upload:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.d-upload-icon { width: 24px; height: 24px; color: var(--navy); }
.d-upload-title { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.d-upload.has-file .d-upload-title { font-family: var(--font-code); font-weight: 400; color: var(--ink); }
.d-upload-hint { font-size: var(--text-help); color: var(--muted); }
.d-details { margin-top: 14px; }
.d-details > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); cursor: pointer;
  font-size: var(--text-body); text-decoration: underline; text-underline-offset: 3px; }
/* Expand/collapse controls look like buttons: border, light fill, chevron. */
.d-details > summary.d-disclosure, .d-disclosure { gap: 10px; padding: 9px 14px; border: 1px solid #c9cabf; border-radius: var(--radius-control);
  background: var(--soft); color: var(--navy); font-weight: 600; text-decoration: none; list-style: none; }
.d-disclosure::-webkit-details-marker { display: none; }
.d-disclosure::before { content: ""; flex: none; width: 8px; height: 8px; margin: 0 2px 3px 2px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.d-details[open] > .d-disclosure::before { transform: rotate(-135deg); margin-bottom: -3px; }
.d-disclosure:hover { border-color: var(--navy); }
.d-details[open] > .d-disclosure { margin-bottom: 4px; }
.d-help-list { margin: 4px 0 0; padding-left: 20px; font-size: var(--text-help); color: var(--muted); max-width: 72ch; }
.d-help-list li + li { margin-top: 4px; }
.d-feature-list { margin: 8px 0 0; padding-left: 24px; font-size: var(--text-help); color: var(--muted); columns: 2; column-gap: 32px; }

/* ---- Feedback ---- */
.d-feedback, .d-callout, .d-notice { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  font-size: var(--text-body); background: var(--surface); }
.d-feedback p + p { margin-top: 4px; color: var(--muted); font-size: var(--text-help); }
.d-feedback .d-secondary { margin-top: 12px; }
.d-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.d-ok { border-color: #c9ddcf; background: var(--green-bg); }
.d-ok .d-title { color: var(--green); }
.d-bad { border-color: #efd3cc; background: var(--error-bg); }
.d-bad .d-title { color: var(--error); }
.d-bad p + p { color: var(--ink); }
.d-callout, .d-notice { background: var(--wait-bg); border-color: #e6d6b4; }
.d-notice { max-width: 60ch; }
.d-empty { padding: var(--pad-card); border: 1px dashed #c9cabf; border-radius: var(--radius-card); background: var(--surface); }
.d-empty p { margin-top: 6px; color: var(--muted); }
.d-reason { display: block; margin-top: 6px; font-size: var(--text-help); color: var(--ink); line-height: 1.5; }
.d-reasons { margin: 8px 0 0; padding-left: 20px; font-size: var(--text-help); }
.d-continue-reason { margin-top: 12px; color: var(--ink); }

/* ---- Key/value rows ---- */
.d-kv { display: grid; gap: 0; margin-top: 12px; }
.d-kv > div { display: grid; grid-template-columns: minmax(130px, 34%) minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.d-kv > div:last-child { border-bottom: 1px solid var(--line); }
.d-kv dt { font-size: var(--text-help); color: var(--muted); }
.d-kv dd { font-size: var(--text-body); line-height: 1.5; min-width: 0; }
.d-kv-stacked > div { grid-template-columns: 1fr; gap: 2px; }
.d-name { overflow-wrap: normal; word-break: normal; hyphens: none; }
.d-page-head .d-head-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.d-page-head .d-head-action .d-help { text-align: right; max-width: 32ch; }
#flow-note { margin: 0 0 20px; }
#flow-note .d-actions { margin-top: 10px; }
#validate-title:focus { outline: none; }

/* ---- Sign in ---- */
.d-signin { display: flex; justify-content: center; padding-top: 72px; padding-bottom: 72px; }
.d-signin-card { width: 100%; max-width: 440px; padding: 32px; }
.d-signin-card h1 { font: 400 var(--text-page-h1)/1.15 var(--font-heading); margin-bottom: 8px; }
.d-signin-card h1 { color: var(--title); }
.d-signin-lead { color: var(--ink); }
.d-signin-card #signin-error { margin-top: 16px; }
.d-signin-links { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; }
/* Request access is a plain navigation link: underlined and clearly visible. */
.d-access-link, .d-back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); font-size: var(--text-body);
  text-decoration: underline; text-underline-offset: 3px; }
.d-back-link { color: var(--muted); }
.d-nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-control);
  color: var(--navy); font-size: var(--text-nav); font-weight: 600; text-decoration: none; }
.d-nav-link:hover { background: var(--soft); }
.d-nav-link[aria-current="page"] { background: var(--soft); }
.d-access-link { padding: 0 4px; border: 0; background: none; font-family: inherit; line-height: 1.3; cursor: pointer; }
.d-signin-links .d-access-link { padding: 0; }
/* Header actions: same font size and line height, centered in 44px targets. */
.d-guest-actions { align-items: center; gap: 8px; }
.d-guest-actions .d-nav-link, .d-guest-actions .d-access-link { font-size: var(--text-nav); line-height: 1.3; }
.d-menu-toggle { display: none; }
/* Contact window. */
.d-access-dialog { width: min(480px, calc(100vw - 32px)); }
.d-access-body { padding: 24px; }
.d-access-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -10px -10px 0 0; }
.d-icon-button { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius-control); background: none; color: var(--muted); cursor: pointer; }
.d-icon-button:hover { background: var(--soft); color: var(--ink); }
.d-icon-button .d-icon { width: 20px; height: 20px; }
#access-text { margin-top: 8px; font-size: var(--text-body); color: var(--muted); }
.d-access-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.d-access-dialog .d-field-label { margin-top: 16px; }
.d-access-dialog .d-help { margin: -4px 0 8px; }
.d-access-dialog textarea { min-height: 112px; }
.designata .d-access-dialog [aria-invalid="true"] { border-color: var(--error); }
#access-submit { margin-top: 24px; }
.d-access-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.d-access-done { margin-top: 12px; }
.d-access-done:focus { outline: none; }
.d-access-done-title { font-weight: 600; color: var(--green); }
.d-access-done p + p { margin-top: 6px; }
.d-access-done .d-secondary { margin-top: 20px; }
/* Results preview for signed-out visitors. */
.d-guest-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px;
  padding: 10px 10px 10px 18px; border: 1px solid #c4d6e8; border-radius: var(--radius-card); background: #eef4fa; }
.d-guest-banner p { font-weight: 600; color: var(--title); }
/* Signed-in-only and signed-out-only header items. */
body.is-guest [data-auth="user"], body.is-user [data-auth="guest"], body:not(.is-guest):not(.is-user) [data-auth] { display: none !important; }

/* ---- Overview ---- */

.d-hero-section { padding-top: 56px; padding-bottom: 48px; }
.d-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); gap: 40px; align-items: start; margin-top: 32px; }
.d-hero-title { font: 600 var(--text-hero-h1)/1.1 var(--font-heading); letter-spacing: -0.015em; color: var(--navy); overflow-wrap: anywhere; }
.d-hero-sub { margin-top: 18px; font: 400 var(--text-hero-sub)/1.35 var(--font-heading); color: var(--title); }
.d-hero-sub strong { font-weight: 600; }
.d-hero-copy { align-self: start; }
.d-formats-label { font-size: var(--text-help); font-weight: 600; color: var(--muted); }
.d-formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 10px 0 0; padding: 0; list-style: none; }
.d-formats li { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); }
.d-formats li > span { min-width: 0; overflow-wrap: anywhere; }
.d-formats strong { display: block; font-size: var(--text-card-title); color: var(--title); }
.d-formats li span span { display: block; margin-top: 2px; font-size: var(--text-help); line-height: 1.45; color: var(--muted); }
.d-format-icon { width: 28px; height: 28px; margin-top: 2px; color: var(--title); stroke-width: 1.5; }
.d-cta { min-height: 56px; padding: 14px 28px; font-size: 1.0625rem; }
.d-sample { padding: 24px; container-type: inline-size; }
.d-tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.d-sample-title { font: 400 1.375rem/1.3 var(--font-heading); color: var(--title); }
.d-sample-kind { margin-top: 4px; font-size: 1.0625rem; color: var(--ink); }
.d-sample .d-help { margin-top: 10px; }
.d-sample .d-block { margin-top: 20px; }
.d-sample-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(6px, 3cqi, 12px); margin-top: 18px; }
.d-sample-metrics > div { min-width: 0; padding: 14px clamp(2px, 2cqi, 16px); border: 1px solid var(--line); border-radius: 10px; background: #faf9f5; }
.d-sample-metrics dt { font-size: var(--text-help); color: var(--muted); overflow-wrap: anywhere; }
.d-sample-metrics dd { font: 400 clamp(.875rem, 9cqi, 1.875rem)/1.25 var(--font-heading); color: var(--title); font-variant-numeric: tabular-nums; }
.d-sample-metrics dd.is-structure { font: 400 var(--text-help)/1.6 var(--font-ui); color: var(--muted); }
.d-section > .d-section-title { margin-top: 0; }
.d-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 16px; }
.d-config-tile { display: flex; flex-direction: column; padding: 22px 22px 20px; }
.d-facts { display: grid; gap: 6px; margin: 14px 0 0; }
.d-facts > div { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); gap: 12px; }
.d-facts dt { color: var(--muted); }
.d-facts dd { margin: 0; color: var(--ink); }
.d-tile-reason { margin-top: 12px; font-size: var(--text-help); color: var(--wait); }
.d-config-tile > .d-details { margin-top: auto; padding-top: 16px; }
.d-config-tile > .d-details > summary.d-disclosure { display: flex; width: 100%; justify-content: center; background: var(--surface); }
.d-config-tile > .d-details[open] > summary.d-disclosure { margin-bottom: 8px; }
.d-evaluation-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* One card per task. Body text for names, sentences and values; meta size for the data line and labels. */
.d-task-tile { padding: 24px 28px; }
.d-task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.d-task-head .d-evaluation-toggle { flex: none; }
.d-task-meta { margin-top: 4px; font-size: var(--text-meta); color: var(--muted); }
.d-task-versions { margin: 16px 0 0; padding: 0; list-style: none; }
.d-task-versions > li { padding: 14px 0; border-top: 1px solid var(--line); }
.d-task-version-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.d-task-version-name { font-weight: 600; color: var(--ink); }
.d-task-version-summary { margin-top: 2px; color: var(--muted); max-width: 72ch; }
/* Opened Details sit apart from the version list: tinted, with an accent rule on the left. */
.d-task-details { margin-top: 4px; padding: 20px 24px; background: var(--soft); border-left: 4px solid var(--navy); border-radius: 0 8px 8px 0; }
.d-task-details-eyebrow { font-size: var(--text-meta); font-weight: 600; letter-spacing: 0.02em; color: var(--navy); }
.d-task-key { margin-top: 14px; }
.d-task-key > h4 { font-size: var(--text-body); font-weight: 600; color: var(--ink); }
.d-task-key .d-readable-copy { margin-top: 4px; }
.d-task-key .d-readable-copy p { margin: 0; color: var(--ink); }
.d-task-key .d-readable-copy li { margin: 2px 0 0; color: var(--ink); }
.d-task-key .d-readable-copy ul { margin: 6px 0 0; padding-left: 20px; }
.d-task-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid #d9dad1; }
.d-task-facts dt { font-size: var(--text-meta); color: var(--muted); }
.d-task-facts dd { margin: 2px 0 0; font-size: var(--text-meta); color: var(--ink); }
.d-task-details > .d-help { margin-top: 16px; }
@media (max-width: 799px) {
  .d-task-tile { padding: 20px; }
  .d-task-details { padding: 16px; }
  .d-task-facts { grid-template-columns: minmax(0, 1fr); }
}
.d-config-group-title { margin-top: 16px; font: 600 var(--text-card-title)/1.35 var(--font-heading); color: var(--title); }
.d-config-list > .d-config-group-title:first-child { margin-top: 0; }
.d-evaluation-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) auto;
  gap: 16px 28px; align-items: center; padding: 24px; }
.d-evaluation-intro, .d-evaluation-facts { min-width: 0; }
.d-evaluation-task { margin-top: 6px; }
.d-evaluation-intro > .d-badge { margin-top: 10px; }
.d-evaluation-reason { margin-top: 8px; color: var(--muted); font-size: var(--text-help); }
.d-evaluation-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; }
.d-evaluation-facts > div { min-width: 0; }
.d-evaluation-facts dt { color: var(--muted); font-size: var(--text-help); }
.d-evaluation-facts dd { color: var(--ink); overflow-wrap: anywhere; }
.d-evaluation-time { grid-column: 1 / -1; }
.d-evaluation-toggle { display: inline-flex; align-items: center; cursor: pointer; grid-column: 3; grid-row: 1; justify-self: end; min-height: 44px; }
.d-evaluation-toggle[aria-expanded="true"]::before { transform: rotate(-135deg); }
.d-evaluation-expanded { grid-column: 1 / -1; min-width: 0; padding-top: 24px; border-top: 1px solid var(--line); }
.d-evaluation-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; align-items: start; }
.d-evaluation-expanded .d-review-group { min-width: 0; padding: 0; border: 0; }
.d-evaluation-expanded .d-kv > div { grid-template-columns: 9rem minmax(0,1fr); }
.d-evaluation-expanded > .d-review-group { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.d-definition-note { margin-top: 20px; color: var(--ink); }
@media (max-width: 799px) {
  .d-evaluation-row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; }
  .d-evaluation-toggle { display: inline-flex; align-items: center; cursor: pointer; grid-column: 1; grid-row: auto; justify-self: start; }
  .d-evaluation-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
  .d-evaluation-detail-grid { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .d-evaluation-expanded .d-kv > div { grid-template-columns: 7.5rem minmax(0,1fr); gap: 12px; }
}
.d-pending { margin-top: 12px; }
.d-pending ul { margin: 4px 0 0; padding-left: 20px; font-size: var(--text-help); }

/* ---- Validate ---- */
.d-steps { display: flex; margin: 0 0 24px; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.d-steps li { flex: 1; min-width: 0; }
.d-steps button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 0; margin-bottom: -1px;
  border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-size: var(--text-body); text-align: left; cursor: pointer; }
.d-steps button:disabled { cursor: not-allowed; }
.d-steps button[aria-current="step"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }
.d-step-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); font-size: var(--text-help); }
.d-steps button[aria-current="step"] .d-step-num { border-color: var(--navy); }
.d-steps button.is-done .d-step-num { border-color: var(--green); color: var(--green); }
.d-work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.d-summary-panel { position: sticky; top: 24px; padding: 24px; }
.d-summary-toggle { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left;
  font: 400 1.375rem/1.3 var(--font-heading); color: var(--ink); cursor: default; }
.d-summary { margin-top: 8px; }
#source-previous { margin-top: 24px; }
.d-model-list { display: grid; gap: 14px; }
.d-config-list { display: grid; gap: 12px; }
.d-model-card { display: flex; gap: 14px; align-items: flex-start; min-height: 64px; padding: 20px 22px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; }
.d-model-card:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #f7f8f4; }
.d-model-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.d-model-name { display: block; font-size: var(--text-card-title); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.d-model-meta { font-size: var(--text-body); color: var(--ink); }
.d-model-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.d-model-family { font-size: var(--text-body); font-weight: 600; color: var(--ink); }
.d-model-inputs { font-size: var(--text-body); color: var(--ink); }
.d-models-table .d-model-inputs { font-size: var(--text-card-title); font-weight: 600; font-variant-numeric: tabular-nums; }
.d-models-table td .d-badge.is-format { margin-top: 6px; }
.d-config-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.d-config-card:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.d-config-card.is-blocked { background: #fbfaf6; }
.d-config-pick { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.d-config-card.is-blocked .d-config-pick { cursor: default; }
.d-config-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.d-other { margin-top: 24px; }
.d-other .d-config-list { margin-top: 8px; }
#cohort-mode-wrap { margin-top: 20px; }
#config-compatible-section .d-group-title { margin: 20px 0 12px; }
.d-review { margin-top: 8px; }
.d-review-groups { display: grid; gap: 28px; margin-top: 24px; }
.d-review-title { font: 600 var(--text-card-title)/1.4 var(--font-ui); }
.d-review-group .d-kv dt { font-size: var(--text-body); color: var(--muted); }
.d-review-group .d-kv dd { font-size: var(--text-review); line-height: 1.45; color: var(--ink); }
.d-job { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.d-job-message { margin-top: 8px; }
.d-progress { height: 4px; margin-top: 12px; border-radius: 2px; background: var(--line); overflow: hidden; }
.d-progress > div { width: 0; height: 100%; background: var(--navy); transition: width .4s; }

/* ---- Tables (My models, Results) ---- */
.d-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); }
.d-table th { padding: 12px 16px; text-align: left; font-size: var(--text-help); font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line); }
.d-table td { padding: 16px; vertical-align: middle; border-bottom: 1px solid var(--line); font-size: var(--text-body); }
.d-table tr:last-child td { border-bottom: 0; }
.d-table td .d-badge { margin-top: 6px; }
.d-date { display: flex; flex-direction: column; white-space: nowrap; }
.d-row-actions { min-width: 0; }
.d-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 1000px) {
  .d-models-table th:last-child { width: 20rem; }
}
.d-row-reason { margin-top: 8px; max-width: 34ch; font-size: var(--text-help); line-height: 1.45; color: var(--wait); }
.d-table tr.is-open td { border-bottom-color: transparent; background: #fbfaf6; }
.d-detail-row > td { padding: 4px 24px 24px; background: #fbfaf6; }
.d-model-detail { max-width: 900px; }
.d-linked { margin-bottom: 20px; }
.d-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface); color: var(--ink); }
.d-dialog::backdrop { background: rgba(37, 44, 50, .45); }
.d-dialog-body { padding: 28px; }
.d-dialog-body p { margin-top: 10px; }
#models-status { margin: 0 0 20px; }
.d-pager { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.d-detail { margin-top: 24px; }

/* ---- Reports ---- */
.d-report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.d-report-head h1 { font: 400 var(--text-page-h1)/1.15 var(--font-heading); }
.d-report-sub { margin-top: 8px; color: var(--muted); max-width: 72ch; }
.d-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.d-metric-name { display: block; font-size: var(--text-body); font-weight: 600; color: var(--ink); }
.d-metric-note { display: block; font-size: var(--text-body); line-height: 1.45; color: var(--muted); }
.d-report .d-kv dt { font-size: var(--text-meta); color: var(--muted); }
.d-report .d-kv dd { font-size: var(--text-body); color: var(--ink); }
.d-confusion { width: 100%; table-layout: fixed; margin-top: 20px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.d-confusion caption { margin-bottom: 8px; text-align: left; font-weight: 600; }
.d-confusion th, .d-confusion td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.d-confusion thead th { font-weight: 600; color: var(--muted); }
.d-confusion tbody td { font-size: var(--text-card-title); font-weight: 600; color: var(--navy); }
.d-metric { padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); min-width: 0; }
.d-value { display: block; margin: 6px 0 4px; font: 400 var(--text-metric)/1.2 var(--font-heading); color: var(--navy);
  font-variant-numeric: tabular-nums; }
.d-value.is-missing { font: 600 var(--text-body)/1.4 var(--font-ui); color: var(--muted); }
.d-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.d-report-model { margin-top: 28px; }
/* Declared training target beside the evaluation definition */
.d-report-target { margin-top: 28px; min-width: 0; }
.d-target-status { margin-top: 8px; }
.d-target-table { width: 100%; margin-top: 12px; border-collapse: collapse; table-layout: fixed; font-size: var(--text-body); }
.d-target-table thead th:first-child { width: 11rem; }
.d-target-table th, .d-target-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.d-target-table thead th { font-size: var(--text-help); font-weight: 600; color: var(--muted); }
.d-target-table tbody th { width: 11rem; font-weight: 600; }
.d-target-table tr:last-child > * { border-bottom: 0; }
@media (max-width: 640px) {
  .d-target-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .d-target-table, .d-target-table tbody, .d-target-table tr, .d-target-table th, .d-target-table td { display: block; width: 100%; }
  .d-target-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .d-target-table tbody th, .d-target-table td { padding: 4px 0; border: 0; }
  .d-target-table td::before { content: attr(data-label); display: block; font-size: var(--text-meta); color: var(--muted); }
}
/* Calibration and thresholds (report) */
.d-report-performance { margin-top: 28px; min-width: 0; }
/* Sub-headings inside report cards: clear space above, so a heading never sits on the table before it. */
.d-subtitle { margin: 28px 0 4px; }
.d-report-tripod { margin-top: 28px; min-width: 0; }
.d-report-tripod > .d-details { margin-top: 16px; }
.d-report-tripod > .d-details + .d-help { margin-top: 12px; }
.d-performance-summary { display: grid; gap: 0; margin: 12px 0 4px; }
/* Same rhythm as the report's other label/value rows: label meta-muted, value body, explanation meta-muted. */
.d-performance-summary > div { display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.d-performance-summary > div:last-child { border-bottom: 1px solid var(--line); }
.d-performance-summary dt { font-size: var(--text-meta); color: var(--muted); }
.d-performance-summary dd { margin: 0; display: grid; gap: 2px; }
.d-performance-summary dd > strong { font-weight: 600; color: var(--ink); }
.d-performance-matched { margin-top: 12px; padding: 10px 12px; font-weight: 600; background: var(--soft); }
.d-performance-note { margin-top: 12px; }
.d-table-scroll { max-width: 100%; overflow-x: auto; margin-top: 8px; }
.d-performance-table { width: 100%; border-collapse: collapse; font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.d-performance-table th, .d-performance-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.d-performance-table thead th { font-size: var(--text-help); font-weight: 600; color: var(--muted); }
.d-performance-subgroups .d-subgroup-head th { padding-top: 18px; font-size: var(--text-help); font-weight: 600; color: var(--navy); letter-spacing: .02em; }
.d-performance-subgroups tbody:first-of-type .d-subgroup-head th { padding-top: 10px; }
.d-tripod-table td.d-tripod-where { white-space: normal; min-width: 18rem; }
@media (max-width: 640px) {
  .d-performance-summary > div { grid-template-columns: 1fr; gap: 2px; }
  .d-performance-table { font-size: var(--text-help); }
  .d-performance-table th, .d-performance-table td { padding: 6px 8px; }
}
/* Variable sheet (upload) and "Variables the model received" (report) */
.d-report-variables { margin-top: 28px; min-width: 0; }
.d-variable-quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.d-variable-group { margin-top: 16px; }
/* Group names inside the sheet are list captions, not headings: small, muted. */
.d-variable-group > legend.d-field-label, .d-overline { margin: 0 0 4px; font-size: var(--text-help); font-weight: 600; color: var(--muted);
  letter-spacing: .02em; }
.d-variable-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.d-variable-lab { min-width: 12rem; font-weight: 500; }
.d-variable-check { margin: 0; }
.d-variable-more { flex-basis: 100%; margin: 0; }
.d-variable-more-summary { width: fit-content; font-size: var(--text-help); color: var(--navy); text-decoration: underline; cursor: pointer; }
.d-variable-more[open] .d-variable-more-summary { margin-bottom: 4px; }
.d-mapping-details { margin-top: 16px; }
.d-variable-mapping-table td[hidden] { display: none; }
.d-variable-mapping-table .d-variable-id { font-size: var(--text-help); }
/* The mapping is a table where the form column is wide enough; one stacked block per input below that. */
@media (max-width: 1099px) {
  .d-variable-mapping-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .d-variable-mapping-table, .d-variable-mapping-table tbody, .d-variable-mapping-table tr, .d-variable-mapping-table td { display: block; width: 100%; }
  .d-variable-mapping-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .d-variable-table.d-variable-mapping-table td { padding: 4px 0; border: 0; }
  .d-variable-mapping-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-meta); font-weight: 600; color: var(--muted); }
}
.d-variable-footer { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.d-variable-footer .d-help-list { margin-bottom: 10px; }
.d-variable-ok { margin-top: 12px; padding: 10px 12px; color: var(--green); background: var(--green-bg); }
.d-variable-bad { margin-top: 12px; padding: 10px 12px; color: var(--error); background: var(--error-bg); }
.d-variable-warnings { margin: 8px 0; padding: 10px 12px 10px 28px; color: var(--wait); background: var(--wait-bg); }
.d-variable-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: var(--text-body); }
.d-variable-table th, .d-variable-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.d-variable-table thead th { font-size: var(--text-help); font-weight: 600; color: var(--muted); }
.d-variable-table input, .d-variable-table select { width: 100%; min-width: 7rem; }
.d-report-variables .d-variable-table td:nth-child(4), .d-report-variables .d-variable-table td:nth-child(5),
.d-report-variables .d-variable-table thead th:nth-child(4), .d-report-variables .d-variable-table thead th:nth-child(5) { white-space: nowrap; overflow-wrap: normal; }
.d-variable-id { display: block; font: var(--text-help)/1.4 var(--font-code); color: var(--muted); }
.d-variable-definition { margin-top: 12px; }
.d-variable-detail { margin-top: 12px; }
.d-variable-definition-title { margin: 16px 0 4px; font-size: var(--text-body); font-weight: 600; }
.d-record-check.is-loading { color: var(--muted); }
@media (max-width: 640px) {
  .d-variable-lab { flex-basis: 100%; min-width: 0; }
  .d-variable-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .d-variable-table, .d-variable-table tbody, .d-variable-table tr, .d-variable-table th, .d-variable-table td { display: block; width: 100%; }
  .d-variable-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .d-variable-table th, .d-variable-table td { padding: 4px 0; border: 0; }
  .d-variable-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-meta); color: var(--muted); }
}
.d-report-model .d-kv dd { overflow-wrap: anywhere; }
.d-model-scope { margin-top: 20px; }
.d-counts { display: flex; flex-wrap: wrap; gap: 16px 28px; margin: 14px 0 6px; }
.d-counts strong { display: block; font: 600 1.5rem/1.2 var(--font-ui); color: var(--navy); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .designata *, .designata *::before, .designata *::after { transition: none !important; }
}

/* Single column below ~1000px. */
@media (max-width: 999px) {
  .designata { --gutter: 24px; }
  .d-hero-section { padding-top: 40px; padding-bottom: 40px; }
  .d-hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .d-config-grid { grid-template-columns: 1fr; }
  .d-work-grid { grid-template-columns: 1fr; }
  .d-summary-panel { position: static; order: -1; padding: 16px 20px; }
  .d-summary-toggle { display: flex; justify-content: space-between; align-items: center; min-height: 44px; cursor: pointer; font-size: 1.25rem; }
  .d-summary-toggle::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
    transform: rotate(45deg); margin-right: 6px; }
  .d-summary-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); }
  .d-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-report-grid { grid-template-columns: 1fr; }
  }

/* Phone. */
@media (max-width: 640px) {
  .designata { --gutter: 20px; --pad-card: 20px; --text-hero-h1: 2.125rem; --text-page-h1: 1.875rem; --text-hero-sub: 1.25rem;
    --text-section: 1.375rem; --text-metric: 1.875rem; }
  .d-page { padding-top: 28px; }
  .d-choices { grid-template-columns: 1fr; }
  .d-formats { grid-template-columns: 1fr; }
  .d-page-head .d-head-action { align-items: flex-start; }
  .d-page-head .d-head-action .d-help { text-align: left; }
  .d-feature-list { columns: 1; }
  .d-kv > div { grid-template-columns: 1fr; gap: 2px; }
  /* Phone header: Menu on the left, account actions on the right, the four
     pages in a small panel that opens below. */
  .d-header-inner { flex-wrap: wrap; gap: 4px 8px; padding-top: 6px; padding-bottom: 6px; }
  .d-menu-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid #c9cabf;
    border-radius: var(--radius-control); background: var(--surface); color: var(--navy); font: 600 var(--text-nav)/1.3 var(--font-ui); cursor: pointer; }
  .d-menu-toggle::after { content: ""; width: 7px; height: 7px; margin-bottom: 3px; border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor; transform: rotate(45deg); }
  .d-menu-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; }
  .d-nav { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 4px 0 8px;
    border-top: 1px solid var(--line); }
  .d-header.is-menu-open .d-nav { display: flex; }
  .d-nav a { padding: 10px 12px; }
  .d-account { flex: 1 1 0; justify-content: flex-end; min-width: 0; }
  .d-guest-actions .d-nav-link { padding: 8px 10px; }
  .d-steps { gap: 12px; }
  .d-steps button { flex-direction: column; align-items: flex-start; gap: 6px; font-size: var(--text-help); }
  .d-account #sign-out { flex: none; white-space: nowrap; }
  .d-account > :first-child { min-width: 0; overflow-wrap: anywhere; }
  .d-sample-metrics > div:nth-child(n+5) { display: none; }
  .d-actions > .d-primary, .d-actions > .d-secondary { flex: 1 1 auto; }
  .d-table, .d-table thead, .d-table tbody, .d-table tr, .d-table td { display: block; width: 100%; }
  .d-table { border: 0; background: transparent; }
  .d-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .d-table tr { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
  .d-table td { padding: 6px 0; border: 0; }
  .d-table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: var(--text-meta); color: var(--muted); }
  .d-date { flex-direction: row; gap: 8px; }
  .d-row-actions { white-space: normal; }
  .d-detail-row { margin-top: -16px; border-top: 0 !important; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
  .d-detail-row > td { padding: 0; background: transparent; }
  .d-table tr.is-open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-style: dashed; }
  .d-table tr.is-open td { background: transparent; }
  .d-row-reason { max-width: none; }
  .d-model-card { padding: 16px; }
  .d-dialog-body { padding: 20px; }
}

#onnx-metadata { display: block; width: 100%; min-width: 0; max-width: 100%; }
#onnx-metadata-help, #onnx-metadata-status { overflow-wrap: anywhere; }

/* Optional private records share the existing form/grid at narrow widths. */
.d-training-records input[type="file"] { display:block; max-width:100%; width:100%; }
.d-training-records { min-width:0; }
.d-training-records .d-help, .d-record-check p { overflow-wrap: anywhere; }

/* Submitted-record comparison has its own hierarchy, independent of callouts. */
.d-record-check { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface); min-width: 0; }
.d-report > .d-record-check { margin-bottom: 28px; }
.d-record-check.is-no-overlap-found { background: #eef5fa; border-color: #bdd1df;
  border-inline-start: 4px solid #47728b; }
.d-record-check.is-overlap-detected { background: var(--wait-bg); border-color: #dcc89e;
  border-inline-start: 4px solid var(--wait); }
.d-record-check.is-check-failed { background: var(--error-bg); border-color: #dfb4ac;
  border-inline-start: 4px solid var(--error); }
.d-record-check.is-check-failed .d-card-title { color: var(--error); }
.d-record-basis { margin-top: 8px; color: var(--muted); }
.d-record-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 24px; margin-top: 24px; }
.d-record-summary > div { min-width: 0; }
.d-record-summary dt { font-size: var(--text-help); color: var(--muted); line-height: 1.5; }
.d-record-number { margin-top: 8px; font: 600 1.75rem/1.25 var(--font-ui); color: var(--navy);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.d-record-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 24px;
  padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-help); }
.d-record-meta > div { display: flex; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.d-record-meta dt { font-weight: 600; }
.d-record-meta dd { min-width: 0; overflow-wrap: anywhere; }
.d-record-warning { margin-top: 20px; font-weight: 600; }
.d-record-scope, .d-record-example { margin-top: 24px; max-width: 66ch; text-align: left; }
.d-record-scope p, .d-record-example p { margin-top: 10px; font-size: var(--text-body); font-weight: 400;
  white-space: normal; word-break: normal; overflow-wrap: normal; line-height: 1.55; }
.d-copy-title { margin: 0; font-size: var(--text-body); font-weight: 600; line-height: 1.4; }
.d-readable-copy { display: grid; gap: 10px; }
.d-readable-copy p { margin: 0; }
.d-readable-copy ul { margin: 0; padding-left: 20px; }
.d-readable-copy li + li { margin-top: 8px; }
.d-report-setup > .d-readable-copy { margin-top: 20px; }
.d-field-mapping { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.d-field-mapping .d-kv { margin-top: 8px; }
.d-field-mapping .d-kv > div { border: 0; padding: 4px 0; }
.d-definition-note + .d-definition-note { margin-top: 20px; }
.d-record-recheck { margin-top: 12px; }
@media (max-width: 640px) {
  .d-record-check { padding: 16px; }
  .d-record-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .d-record-number { font-size: 1.5rem; }
}

.d-record-filter { display:flex; align-items:center; gap:12px; margin:20px 0; color:var(--muted); }
.d-record-filters { display:flex; flex-wrap:wrap; column-gap:28px; }
.d-record-filter select { width:auto; min-width:140px; }
#delete-dialog { width:min(520px,calc(100vw - 32px)); }
#delete-form { display:flex; flex-direction:column; gap:22px; font-size:16px; }
#delete-title { font-size:22px; line-height:1.3; }
#delete-form p, #delete-form .d-actions, #delete-form .d-feedback { margin:0; }
.d-delete-object { padding:16px; background:var(--soft); border:1px solid var(--line); border-radius:var(--radius-control); min-width:0; }
.d-delete-name { display:block; line-height:1.5; overflow-wrap:anywhere; }
#delete-form .d-delete-secondary { font-size:14px; line-height:1.6; color:var(--muted); overflow-wrap:anywhere; }
#delete-form .d-delete-object p { margin-top:8px; }
.d-delete-impact { display:flex; flex-direction:column; gap:20px; }
#delete-form .d-check { margin:0; padding-top:20px; border-top:1px solid var(--line); }
#delete-form .d-actions { justify-content:flex-end; flex-wrap:wrap; }
#delete-form .d-actions button { min-height:44px; }

.d-example-scenarios { display:flex; flex-wrap:wrap; gap:12px; margin:24px 0 16px; }
.d-example-scenarios button[aria-pressed="true"] { border-color:var(--navy); background:var(--soft); color:var(--navy); font-weight:600; }

/* Saved reports and public examples share the same section hierarchy. */
.d-report-population, .d-report-setup { min-width: 0; }
.d-report-classification .d-confusion { max-width: 760px; margin-top: 16px; }
/* Report layers: summary, performance, checks, then one collapsed "Full details".
   Only the page title is in the heading face; everything else is the UI face. */
.d-report-summary { margin-bottom: 28px; }
.d-report-verdict { font: 600 var(--text-card-title)/1.5 var(--font-ui); color: var(--ink); text-wrap: balance; }
.d-summary-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0 0; }
.d-summary-figures > .d-metric { padding: 16px 18px; }
.d-summary-figures .d-metric-name { font-size: var(--text-meta); font-weight: 400; color: var(--muted); }
.d-summary-figures .d-value { margin: 4px 0 2px; font: 600 1.75rem/1.2 var(--font-ui); color: var(--navy); }
.d-summary-figures .d-metric-note { font-size: var(--text-meta); }
.d-report-checks { margin-top: 28px; }
.d-check-row { border-top: 1px solid var(--line); }
.d-check-row:first-of-type { margin-top: 12px; }
.d-check-summary { display: flex; align-items: baseline; gap: 16px; min-height: 48px; padding: 12px 0; cursor: pointer; list-style: none; }
.d-check-summary::-webkit-details-marker { display: none; }
.d-check-summary::after { content: "▸"; flex: none; margin-left: auto; color: var(--muted); }
.d-check-row[open] > .d-check-summary::after { content: "▾"; }
.d-check-mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font: 700 0.8125rem/1 var(--font-ui); align-self: center; background: var(--soft); color: var(--muted); }
.d-check-row.is-ok .d-check-mark { background: var(--green-bg); color: var(--green); }
.d-check-row.is-attention .d-check-mark { background: var(--wait-bg); color: var(--wait); }
.d-check-row.is-attention .d-check-status { color: var(--wait); font-weight: 600; }
.d-check-label { flex: none; min-width: 9rem; font-weight: 600; color: var(--ink); }
.d-check-status { color: var(--muted); }
.d-check-body { padding: 0 0 24px; }
/* Sections reused inside a check or Full details lose their own card frame and repeated title. */
.d-check-body .d-card, .d-report-full .d-card { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
/* A reused card that is a direct part of Full details keeps the section spacing and divider. */
.d-report-full > section.d-card { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); border-radius: 0; }
.d-check-body > .d-card > .d-card-title:first-child { display: none; }
.d-report-full { margin-top: 28px; }
.d-report-full > summary { display: inline-flex; align-items: center; cursor: pointer; min-height: 44px; font-size: 1.125rem; }
.d-report-full[open] > .d-disclosure::before { transform: rotate(-135deg); margin-bottom: -3px; }
.d-report-full > .d-report-grid { margin-top: 24px; }
.d-report-full > section, .d-report-full > .d-report-full-note { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.d-report-full > .d-report-full-note { max-width: none; }
.d-report-full .d-kv dd.d-code { font-size: var(--text-meta); word-break: break-all; }
/* Full-width label/value lists use the Performance card's label column, not a third of the page. */
.d-report-full > section > .d-kv > div { grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); }
/* The next section's divider closes each list; no second line. */
.d-report-full .d-kv > div:last-child { border-bottom: 0; }
.d-performance-more { margin-top: 20px; }
.d-calibration { float: right; width: min(300px, 40%); margin: 0 0 16px 32px; }
.d-calibration-chart { display: block; width: 100%; height: auto; overflow: visible; }
.d-chart-grid { stroke: var(--line); stroke-width: 1; }
.d-chart-ideal { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.d-chart-point { fill: var(--navy); }
.d-chart-tick { font: 11px var(--font-ui); fill: var(--muted); }
.d-calibration figcaption { margin-top: 6px; }
.d-report-performance::after { content: ""; display: block; clear: both; }
@media (max-width: 799px) {
  .d-calibration { float: none; width: 100%; max-width: 320px; margin: 8px 0 16px; }
  .d-summary-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-check-summary { flex-wrap: wrap; gap: 4px 12px; }
  .d-check-label { min-width: 0; }
}
.d-input-list { padding-left: 28px; margin: 16px 0 0; }
.d-input-list > li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.d-input-name { display: block; font-size: var(--text-body); }
.d-input-list .d-kv { margin-top: 8px; }
.d-input-list .d-kv > div { padding: 6px 0; }
.d-example-switch-note { margin: 12px 0 24px; }

.d-input-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 36px; }
.d-input-list > li { min-width: 0; }
@media (max-width: 799px) {
  .d-input-list { grid-template-columns: minmax(0,1fr); }
  .d-input-list .d-kv > div { grid-template-columns: 7rem minmax(0,1fr); gap: 12px; }
}

.d-report-population .d-counts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }

.d-readable-copy .d-copy-secondary { font-size: var(--text-help); color: var(--muted); }

/* Short overlap explanations use the same available width as their summaries. */
.d-record-check > .d-record-scope, .d-record-check > .d-record-example { max-width: none; }

.d-record-check > .d-record-scope p, .d-record-check > .d-record-example p { text-wrap: pretty; }

/* Optional patient attachment is separate from declared training provenance. */
.d-training-list { margin: 24px 0; padding: 24px; background: #f7f8f8; border: 1px solid var(--line, #dfe3e5); border-radius: 10px; }
.d-training-list .d-card-title { display:flex; flex-wrap:wrap; gap:6px; align-items:baseline; }
.d-training-list .d-meta { display:inline; font-weight:400; }
.d-training-list-status { margin:16px 0; font-weight:600; }
.d-training-list > .d-help { margin:16px 0; }
.d-training-list + .d-details { margin-top:24px; }
.d-export-bar { display:flex; flex-wrap:wrap; gap:12px 20px; align-items:center; margin:16px 0 24px; }
.d-export-bar .d-help { margin:0; }
.d-report-tools { display:flex; flex-direction:column; align-items:flex-end; gap:12px; }
@media (max-width: 640px) {
 .d-training-list { padding:16px; }
 .d-export-bar { align-items:flex-start; flex-direction:column; }
 .d-report-tools { align-items:flex-start; }
 .d-report-head { flex-wrap:wrap; }
}

/* Download feedback lives inside the button: the icon slot is always filled
   (arrow, spinner, then a green check), so width and position never change. */
.d-download-button { gap:8px; }
.d-download-button[aria-busy="true"] { cursor:progress; }
.d-download-icon { display:inline-flex; flex:none; align-items:center; justify-content:center; width:16px; height:16px; }
.d-download-icon .d-icon { width:16px; height:16px; }
.d-download-button[data-download-state="done"] .d-download-icon { color:#1a7f45; }
.d-download-button[data-download-state="done"] .d-icon { stroke-width:2.6; }
.d-spinner { width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%;
  opacity:.8; animation:d-spin .8s linear infinite; }
@keyframes d-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .d-spinner { animation:none; } }
/* Shown only after a failure, next to the control; nothing is reserved before. */
.d-download-error { display:flex; align-items:center; gap:8px; width:100%; margin:8px 0 0; padding:4px 4px 4px 12px;
  border:1px solid #efd3cc; border-radius:var(--radius-control); background:var(--error-bg); color:var(--error); font-size:var(--text-help); }
.d-download-error p { flex:1; min-width:0; }
.d-export-bar + .d-download-error { margin:-12px 0 24px; }
.d-download-dismiss { flex:none; border:0; background:transparent; cursor:pointer; color:inherit;
  width:44px; min-height:44px; padding:0; font-size:1.5rem; border-radius:var(--radius-control); }
.d-download-dismiss:hover { background:rgba(32,58,76,.06); }

/* Variable requests */
.d-variable-request textarea, .d-variable-request input[type="text"], .d-variable-request select { width: 100%; max-width: 60ch; }
.d-variable-request .d-fieldset { margin-top: 12px; }
.d-variable-requests { margin-top: 32px; }
.d-request-list { list-style: none; margin: 8px 0 0; padding: 0; }
.d-request { padding: 12px 0; border-bottom: 1px solid var(--line); }
.d-request-head { margin: 0; }
.d-request-status, .d-request-note { color: var(--muted); }
.d-request-note { margin: 4px 0; font-size: var(--text-help); }

/* Training-row fingerprints */
.d-fingerprints { margin-top: 20px; }
.d-record-fingerprint { margin: 12px 0 0; font-size: var(--text-help); color: var(--muted); max-width: 72ch; }
.d-record-fingerprint.is-identical-rows-found { color: inherit; font-weight: 600; }

/* ---- Model form: tags, sections, dialog, model contents ---- */
.d-from { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--green-bg); color: var(--green);
  font-size: var(--text-help); font-weight: 400; vertical-align: 1px; }
.d-from-note { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--green-bg); color: var(--green);
  font-size: var(--text-help); line-height: 1.5; }
.d-linkbutton { padding: 0; border: 0; background: none; color: var(--navy); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.d-field-help { margin: -4px 0 8px; }
.d-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.d-choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-subsection { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line); }
.d-subsection-title, .d-fieldset > legend.d-subsection-title { margin: 20px 0 4px; font: 600 var(--text-subsection)/1.4 var(--font-ui); color: var(--ink); }
.d-subsection-title .d-optional { font-size: var(--text-help); }
.d-terms { display: grid; gap: 6px; margin: 12px 0 4px; padding: 12px 14px; border-radius: var(--radius-control); background: var(--paper);
  font-size: var(--text-help); line-height: 1.5; }
.d-terms > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; }
.d-terms dt { font-weight: 600; color: var(--ink); }
.d-terms dd { margin: 0; color: var(--muted); }
/* Optional sections: one level of disclosure, styled as a section header rather than a button. */
.d-section-details { margin-top: 12px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.d-section-details[open] { padding-bottom: 20px; }
.d-details > summary.d-section-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; width: 100%; min-height: 56px; padding: 14px 0 14px 22px;
  position: relative; color: var(--ink); text-decoration: none; list-style: none; }
.d-section-summary::-webkit-details-marker { display: none; }
.d-section-summary::before { content: ""; position: absolute; left: 2px; top: 22px; width: 8px; height: 8px; border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy); transform: rotate(-45deg); transition: transform .15s; }
.d-section-details[open] > .d-section-summary::before { transform: rotate(45deg); }
.d-section-details[open] > .d-section-summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.d-section-summary-title { font: 600 var(--text-subsection)/1.4 var(--font-ui); }
.d-section-summary-hint { font-size: var(--text-help); color: var(--muted); }
.d-dialog { width: min(640px, calc(100% - 32px)); max-height: 86vh; padding: 24px 28px; border: 0; border-radius: var(--radius-card);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(20, 30, 40, .25); overflow: auto; }
.d-dialog::backdrop { background: rgba(37, 44, 50, .45); }
.d-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.d-dialog-title { font: 400 var(--text-group)/1.3 var(--font-heading); }
.d-dialog-close { width: 40px; height: 40px; border: 0; border-radius: var(--radius-control); background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.d-dialog-close:hover { background: var(--soft); color: var(--ink); }

.d-model-view { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.d-model-view-title { font: 400 1.125rem/1.3 var(--font-heading); }
.d-model-view-kind { margin-top: 8px; font-weight: 600; }
.d-model-view-caption { margin-top: 16px; font-size: var(--text-help); color: var(--muted); }
.d-model-view-scroll { max-height: 320px; margin-top: 6px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-control); }
.d-model-view-table { width: 100%; border-collapse: collapse; font-size: var(--text-help); }
.d-model-view-table th, .d-model-view-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.d-model-view-table th { position: sticky; top: 0; background: var(--soft); font-weight: 600; color: var(--muted); }
.d-model-view-table tr:last-child td { border-bottom: 0; }
.d-model-view-table .is-num { text-align: right; font-family: var(--font-code); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-model-view .d-kv > div { grid-template-columns: minmax(100px, 45%) minmax(0, 1fr); padding: 6px 0; }

.d-model-view > .d-help, #model-view-body > .d-help { margin-top: 8px; }
@media (max-width: 999px) {
  .d-summary-panel { max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .d-field-row, .d-choices-3 { grid-template-columns: 1fr; }
  .d-terms > div { grid-template-columns: 1fr; gap: 0; }
}
.d-variable-quick-row .d-variable-quick { min-height: 36px; padding: 6px 12px; font-size: var(--text-help); }
.d-variable-footer .d-help-list strong { color: var(--ink); font-weight: 600; }
/* Form textareas hold prose; the monospace 200px default is for model JSON. */
.d-section-details textarea, .d-dialog textarea { min-height: 0; font-family: var(--font-ui); font-size: var(--text-body); }
.d-field-row input, .d-field-row select { width: 100%; min-height: var(--control-height); }
.d-variable-mapping-table th:nth-child(1), .d-variable-mapping-table td:nth-child(1) { width: 26%; }
.d-variable-mapping-table th:nth-child(3), .d-variable-mapping-table td:nth-child(3) { width: 7rem; }
.d-variable-mapping-table th:nth-child(4), .d-variable-mapping-table td:nth-child(4) { width: 11rem; }
.d-variable-match-cell .d-variable-note { margin-top: 8px; }
.d-variable-mapping-table td > .d-help { display: block; margin-top: 4px; }
.d-dialog-wide { width: min(960px, calc(100% - 32px)); }
.d-model-contents { max-height: 60vh; margin-top: 12px; padding: 14px 16px; overflow: auto; border-radius: var(--radius-control); background: var(--paper);
  font: var(--text-help)/1.6 var(--font-code); white-space: pre; tab-size: 4; }
.d-model-view-open { width: 100%; margin-top: 14px; min-height: 40px; padding: 8px 14px; }
/* Labs as a matrix: one row per lab, one column per input it can give. */
.d-lab-help { margin: 0 0 8px; }
.d-lab-row { display: grid; grid-template-columns: minmax(10rem, 1fr) repeat(3, 5.5rem) 6rem; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--line); }
.d-lab-head { padding: 4px 0; font-size: var(--text-help); font-weight: 600; color: var(--muted); }
.d-lab-head > span:not(:first-child), .d-lab-cell { text-align: center; }
.d-lab-cell { display: flex; justify-content: center; color: var(--muted); }
.d-lab-cell .d-variable-check { margin: 0; }
.d-variable-row { align-items: center; }
.d-definition-open { justify-self: end; font-size: var(--text-help); }
.d-variable-row .d-definition-open { margin-left: auto; }
/* Definition drawer: a side panel over the page, fixed header, scrolling body. */
.d-drawer { position: fixed; inset: 0 0 0 auto; width: min(480px, 100%); height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0;
  background: var(--surface); color: var(--ink); box-shadow: -12px 0 40px rgba(20, 30, 40, .2); }
.d-drawer::backdrop { background: rgba(37, 44, 50, .25); }
.d-drawer[open] { display: flex; flex-direction: column; }
.d-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.d-drawer-body { flex: 1; overflow: auto; padding: 4px 24px 24px; }
.d-definition-heading { margin: 20px 0 6px; font: 600 var(--text-body)/1.4 var(--font-ui); }
.d-definition-lead { font-size: var(--text-body); line-height: 1.55; }
.d-drawer .d-kv { margin-top: 0; }
.d-drawer .d-kv > div { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.d-drawer .d-kv dd { font-size: var(--text-help); }
.d-definition-list.is-technical dd { color: var(--muted); }
@media (max-width: 640px) {
  .d-lab-row { grid-template-columns: minmax(0, 1fr) repeat(3, 3.5rem) 4.5rem; gap: 4px; }
  .d-lab-head { font-size: 0.75rem; }
}
.d-model-view-table th, .d-model-view-table td { padding: 6px 8px; overflow-wrap: normal; word-break: normal; }
.d-model-view-table td:first-child { overflow-wrap: anywhere; }
.d-model-view-table .is-num { font-size: 0.8125rem; }
/* Model summary: tiles for the key numbers, a short list for the detail. */
.d-model-view { margin-top: 20px; padding-top: 18px; }
.d-model-view-title { font: 600 var(--text-help)/1.4 var(--font-ui); color: var(--muted); letter-spacing: .02em; }
.d-mv-kind { margin-top: 4px; font-size: var(--text-help); color: var(--muted); }
.d-mv-kind strong { font-size: var(--text-subsection); color: var(--ink); }
.d-mv-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.d-mv-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--paper); min-width: 0; }
.d-mv-value { font: 600 1.25rem/1.2 var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.d-mv-label { font-size: var(--text-help); color: var(--muted); }
.d-mv-section { margin-top: 18px; }
.d-mv-list-head { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  font-size: var(--text-help); font-weight: 600; color: var(--muted); }
.d-mv-list { margin: 0; padding: 0; list-style: none; font-size: var(--text-help); }
.d-mv-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: baseline; padding: 7px 0; }
.d-mv-list li.has-bar { grid-template-columns: minmax(0, 1fr) auto; }
.d-mv-name { overflow-wrap: anywhere; }
.d-mv-num { font-family: var(--font-code); font-size: 0.8125rem; font-variant-numeric: tabular-nums; text-align: right; }
.d-mv-num.is-neg { color: var(--rust); }
.d-mv-num.is-muted { min-width: 3.5rem; color: var(--muted); }
.d-mv-bar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: #b7c3cc; }
.d-mv-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.d-mv-chip { padding: 3px 10px; border-radius: 999px; background: var(--soft); font: 600 var(--text-help)/1.4 var(--font-ui); }
.d-mv-arrow { color: var(--muted); }
.d-mv-more { display: block; margin-top: 16px; font-size: var(--text-help); font-weight: 600; text-decoration: none; }
.d-mv-more:hover { text-decoration: underline; }
.d-mv-note { margin-top: 10px; }
/* Definition drawer: tags in the header, sections with space instead of rules between rows. */
.d-def-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.d-def-tag { padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: var(--text-help); }
.d-def-lead { margin-top: 16px; font-size: var(--text-body); line-height: 1.55; }
.d-def-section { margin-top: 24px; }
.d-def-heading { margin-bottom: 8px; font: 600 var(--text-help)/1.4 var(--font-ui); color: var(--muted); letter-spacing: .02em; }
.d-def-parts { display: grid; gap: 10px; margin: 0; }
.d-def-parts > div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 12px; }
.d-def-parts dt { font-weight: 600; }
.d-def-parts dd { margin: 0; }
.d-def-rules { margin: 0; padding-left: 18px; font-size: var(--text-help); line-height: 1.55; }
.d-def-rules li + li { margin-top: 6px; }
.d-def-source { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.d-def-source > summary { cursor: pointer; font-size: var(--text-help); font-weight: 600; color: var(--navy); }
.d-def-source[open] > summary { margin-bottom: 10px; }
.d-def-source .d-def-rules { color: var(--muted); }
.d-def-code { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--paper); font: 0.8125rem/1.55 var(--font-code); color: var(--muted); }
/* Export guide link and drawer content. */
.d-label-row .d-label-link { margin: 20px 0 8px; font-size: var(--text-help); }
.d-guide-steps { margin: 0; padding-left: 20px; font-size: var(--text-help); line-height: 1.55; }
.d-guide-steps li + li { margin-top: 8px; }
.d-guide-code { white-space: pre; overflow-x: auto; color: var(--ink); }
/* Report: inputs the model received, as the upload form shows them. */
.d-received-said { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--paper); font-size: var(--text-help); }
.d-received-list { margin-top: 16px; }
.d-received-row { grid-template-columns: minmax(10rem, 1fr) minmax(0, 12rem) 5rem 6rem; }
.d-received { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.d-received-row .d-received { align-items: flex-start; }
.d-received code { font-size: 0.8125rem; }
.d-received small { font-size: 0.75rem; text-align: center; }
.d-not-received { color: var(--line); }
.d-lab-row .d-lab-cell .d-received code { color: var(--ink); }
.d-received-foot { margin-top: 12px; }
/* TRIPOD statuses read at a glance. */
.d-tripod-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.d-tripod-status { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: var(--text-help); white-space: nowrap; }
.d-tripod-status.is-ok { background: var(--green-bg); color: var(--green); }
.d-tripod-status.is-partly { background: var(--wait-bg); color: var(--wait); }
/* Index of the sections inside Full details. */
.d-report-toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 8px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--text-help); }
@media (max-width: 640px) {
  .d-received-row { grid-template-columns: minmax(0, 1fr) auto; }
  .d-received-row > .d-help { display: none; }
}
.d-received-tick { color: var(--green); font-weight: 600; }
.d-report-variables .d-lab-row:not(.d-received-row) { grid-template-columns: minmax(10rem, 1fr) repeat(3, 6.5rem) 6rem; }
/* The sticky summary scrolls on its own when it is taller than the window (desktop only). */
@media (min-width: 1000px) {
  .d-summary-panel { max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9cabf transparent; }
}
/* Report: checks strip, then one topic per tab. */
.d-check-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 20px; }
.d-check-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.d-check-card:hover { border-color: var(--navy); }
.d-check-card.is-attention { border-color: #e3c9a3; background: var(--wait-bg); }
.d-check-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.d-check-card-text > span { font-size: var(--text-help); color: var(--muted); }
.d-report-tabs { margin-top: 20px; padding-top: 8px; }
.d-tabs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; border-bottom: 1px solid var(--line); }
.d-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.d-tab { padding: 12px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-size: var(--text-nav); cursor: pointer; }
.d-tab:hover { color: var(--navy); }
.d-tab[aria-selected="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }
.d-metric-guide { font-size: var(--text-help); }
.d-tab-panel { padding-top: 20px; }
.d-tab-panel:focus-visible { outline-offset: 6px; }
.d-tab-panel > * + * { margin-top: 20px; }
.d-metric-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; }
.d-metric-list > div { padding: 12px 14px; border-radius: var(--radius-control); background: var(--paper); min-width: 0; }
.d-metric-list dt { font-size: var(--text-help); color: var(--muted); }
.d-metric-list dd { margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; }
.d-metric-list dd strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.d-classification-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
.d-classification-grid .d-metric-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-calibration-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.d-calibration-grid .d-metric-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-report-checks .d-check-row { padding: 16px 0; border-top: 1px solid var(--line); }
.d-report-checks .d-check-row:first-child { border-top: 0; padding-top: 0; }
.d-report-checks .d-check-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.d-report-checks .d-check-label { font: 600 var(--text-subsection)/1.4 var(--font-ui); }
.d-report-checks .d-check-status { color: var(--muted); font-size: var(--text-help); }
.d-report-checks .d-card { border: 0; padding: 0; background: none; }
.d-guide-parts > div { grid-template-columns: 9rem minmax(0, 1fr); }
.d-guide-parts dd { font-size: var(--text-help); color: var(--muted); }
@media (max-width: 799px) {
  .d-classification-grid, .d-calibration-grid { grid-template-columns: 1fr; }
  .d-tab { padding: 10px 8px; }
}
.d-calibration-grid .d-calibration { float: none; width: 100%; margin: 0; }
.d-report-checks .d-check-summary { min-height: 0; padding: 0; cursor: default; }
.d-report-checks .d-check-summary::after { content: none; }
.d-report-checks .d-check-row:first-of-type { margin-top: 0; }
.d-check-strip .d-check-card.is-ok .d-check-mark { background: var(--green-bg); color: var(--green); }
.d-check-strip .d-check-card.is-attention .d-check-mark { background: var(--wait-bg); color: var(--wait); }
.d-panel-tools { display: flex; justify-content: flex-end; }
.d-tab-panel > .d-panel-tools + * { margin-top: 8px; }
/* No underlined click-to-open text anywhere: secondary actions are small outlined buttons. */
.d-textbutton, .d-linkbutton, .d-access-link, .d-back-link, .d-details > summary:not(.d-disclosure):not(.d-section-summary),
.d-variable-more-summary, .d-def-source > summary {
  display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 36px; padding: 6px 12px; border: 1px solid #c9cabf;
  border-radius: var(--radius-control); background: var(--surface); color: var(--navy); font-size: var(--text-help); font-weight: 600;
  line-height: 1.3; text-decoration: none; cursor: pointer; list-style: none; }
.d-textbutton:hover, .d-linkbutton:hover, .d-access-link:hover, .d-back-link:hover, .d-details > summary:not(.d-disclosure):not(.d-section-summary):hover,
.d-def-source > summary:hover { border-color: var(--navy); background: var(--soft); text-decoration: none; }
.d-textbutton[hidden], .d-linkbutton[hidden] { display: none; }
.d-back-link { color: var(--muted); }
.d-def-source > summary::-webkit-details-marker { display: none; }
.d-button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.d-button-row .d-help { margin: 0; }
.d-label-row .d-label-link { margin: 14px 0 6px; }
.d-mv-more { margin-top: 16px; }
.d-mv-more:hover { text-decoration: none; }
.d-definition-open { min-height: 30px; padding: 3px 10px; font-weight: 500; }
.d-show-password { min-height: 30px; padding: 3px 10px; }
/* ---- Report, one visual language: one card per block, hairlines inside, no nested boxes. ---- */
.d-report-summary .d-summary-figures { gap: 0; margin-top: 20px; }
.d-report-summary .d-summary-figures > .d-metric { padding: 2px 24px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; }
.d-report-summary .d-summary-figures > .d-metric:first-child { padding-left: 0; border-left: 0; }
.d-report-summary .d-check-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 22px; padding-top: 6px; border-top: 1px solid var(--line); }
.d-report-summary .d-check-card { padding: 12px 16px 6px 0; border: 0; border-radius: 0; background: none; align-items: center; }
.d-report-summary .d-check-card:hover .d-check-card-text strong { color: var(--navy); }
.d-report-summary .d-check-card.is-attention { background: none; }
.d-report-summary .d-check-card.is-attention .d-check-card-text > span { color: var(--wait); font-weight: 600; }
.d-check-mark { flex: none; }
.d-example-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.d-example-scenarios .d-help { margin: 0; }
.d-segmented { display: inline-flex; border: 1px solid #c9cabf; border-radius: var(--radius-control); overflow: hidden; }
.d-segmented button { padding: 5px 12px; border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: var(--text-help); cursor: pointer; }
.d-segmented button + button { border-left: 1px solid #c9cabf; }
.d-segmented button[aria-pressed="true"] { background: var(--navy); color: var(--surface); font-weight: 600; }
/* Tabs: the guide sits at the right of the tab bar. */
.d-tabs-bar { flex-wrap: nowrap; }
.d-tabs-bar .d-metric-guide { flex: none; min-height: 32px; padding: 4px 10px; }
.d-tab { padding: 12px 12px; }
/* Figures as a ruled list, value on the right; no tiles. */
.d-metric-list { display: block; max-width: 560px; }
.d-metric-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; padding: 10px 0;
  border-radius: 0; background: none; border-bottom: 1px solid var(--line); }
.d-metric-list > div:first-child { border-top: 1px solid var(--line); }
.d-metric-list dt { font-size: var(--text-body); color: var(--ink); }
.d-metric-list dd { margin: 0; align-items: flex-end; text-align: right; }
.d-metric-list dd strong { font-size: var(--text-body); font-weight: 600; }
.d-metric-list dd .d-help { font-size: 0.8125rem; }
.d-classification-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.d-classification-grid .d-metric-list, .d-calibration-grid .d-metric-list { max-width: none; }
.d-report-discrimination > .d-metric-list { max-width: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
.d-report-discrimination > .d-metric-list > div { border-top: 1px solid var(--line); }
/* Confusion matrix: ruled rows like the lists around it. */
.d-classification-grid .d-confusion { margin-top: 0; table-layout: auto; }
.d-classification-grid .d-confusion th, .d-classification-grid .d-confusion td { border: 0; border-bottom: 1px solid var(--line); padding: 10px 8px; }
.d-classification-grid .d-confusion thead th { border-top: 1px solid var(--line); font-size: var(--text-help); }
.d-classification-grid .d-confusion tbody td { font-size: var(--text-body); color: var(--ink); text-align: right; }
.d-classification-grid .d-confusion thead th:not(:first-child) { text-align: right; }
.d-classification-grid .d-confusion tbody th { font-weight: 400; }
.d-performance-note { font-size: 0.8125rem; max-width: 90ch; }
@media (max-width: 799px) {
  .d-report-summary .d-summary-figures > .d-metric { padding: 10px 12px; border-left: 0; }
  .d-report-summary .d-check-strip, .d-report-discrimination > .d-metric-list { grid-template-columns: 1fr; }
  .d-tabs-bar { flex-wrap: wrap; }
}
/* Upload zones side by side; compact zones for small attachments. */
.d-upload-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.d-upload-pair .d-upload { min-height: 132px; }
.d-upload-small { min-height: 0 !important; padding: 14px; flex-direction: row; }
.d-upload-small .d-upload-title { font-size: var(--text-help); }
.d-upload-small.has-file .d-upload-title, .d-upload.has-file .d-upload-title { font-family: var(--font-code); font-weight: 400; color: var(--ink); }

/* Definition: a small round "i" beside each variable. */
.d-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid #c9cabf;
  border-radius: 50%; background: var(--surface); color: var(--navy); font: 600 0.8125rem/1 Georgia, serif; font-style: italic; cursor: pointer; }
.d-icon-button:hover { border-color: var(--navy); background: var(--soft); }
.d-lab-row .d-definition-open, .d-variable-row .d-definition-open { justify-self: center; margin-left: auto; min-height: 0; }
.d-lab-row { grid-template-columns: minmax(10rem, 1fr) repeat(3, 5.5rem) 3rem; }
.d-report-variables .d-lab-row:not(.d-received-row) { grid-template-columns: minmax(10rem, 1fr) repeat(3, 6.5rem) 3rem; }
.d-received-row { grid-template-columns: minmax(10rem, 1fr) minmax(0, 12rem) 5rem 3rem; }
/* Variable sheet result: one callout, the fix beside the message. */
.d-sheet-callout { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-control); font-size: var(--text-help); line-height: 1.5; }
.d-sheet-callout.is-ok { background: var(--green-bg); color: var(--green); }
.d-sheet-callout.is-bad { background: var(--error-bg); color: var(--error); }
.d-sheet-callout.is-attention { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--wait-bg); }
.d-sheet-callout.is-attention .d-sheet-callout-title { color: var(--wait); font-weight: 600; }
.d-sheet-callout.is-attention .d-help { margin-top: 4px; }
.d-sheet-callout.is-attention .d-secondary { flex: none; min-height: 40px; padding: 8px 14px; font-size: var(--text-help); }
/* Locked step: what to do first, instead of greyed-out controls. */
.d-locked-note { margin-top: 14px; padding: 12px 14px; border: 1px dashed #c9cabf; border-radius: var(--radius-control); color: var(--muted); font-size: var(--text-help); }
@media (max-width: 640px) {
  .d-upload-pair { grid-template-columns: 1fr; }
  .d-sheet-callout.is-attention { flex-direction: column; align-items: flex-start; }
  .d-lab-row { grid-template-columns: minmax(0, 1fr) repeat(3, 3.5rem) 2.5rem; }
}
.d-steps-bar { display: flex; align-items: flex-end; gap: 16px; }
.d-steps-bar .d-steps { flex: 1; min-width: 0; }
.d-steps-action { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.d-steps-action .d-help { margin: 0; max-width: 24ch; }
@media (max-width: 640px) { .d-steps-bar { flex-direction: column; align-items: stretch; } .d-steps-action { padding-bottom: 0; } }
.d-steps-bar { margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.d-steps-bar .d-steps { margin: 0; border-bottom: 0; }
/* What the uploaded files filled in, right under the uploads. */
.d-autofill { margin-top: 14px; padding: 14px 16px; border: 1px solid #c9ddcf; border-radius: 10px; background: var(--green-bg); }
.d-autofill-title { font-weight: 600; color: var(--green); }
.d-autofill-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; font-size: var(--text-help); }
.d-autofill-list li { display: grid; grid-template-columns: 1.25rem 9rem minmax(0, 1fr); gap: 8px; align-items: baseline; }
.d-autofill-list li.is-done { color: var(--ink); }
.d-autofill-list li.is-todo { color: var(--muted); }
.d-autofill-list li.is-done .d-autofill-mark { color: var(--green); font-weight: 700; }
.d-autofill-list li.is-todo .d-autofill-mark { color: var(--wait); }
.d-from { font-weight: 600; }
@media (max-width: 640px) { .d-autofill-list li { grid-template-columns: 1.25rem minmax(0, 1fr); } .d-autofill-list li > span:last-child { grid-column: 2; } }
/* ✅ filled, ❌ still open. */
.d-autofill { border-color: var(--line); background: var(--surface); }
.d-autofill-title { color: var(--ink); }
.d-autofill-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1; }
.d-autofill-list li.is-done .d-autofill-mark { background: var(--green); color: #fff; }
.d-autofill-list li.is-todo .d-autofill-mark { background: var(--error); color: #fff; }
.d-autofill-list li.is-todo strong { color: var(--error); }
.d-autofill-list li.is-todo { color: var(--muted); }
.d-autofill-list li { align-items: center; }
/* ✓ / ✕ beside each field. */
.d-field-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; margin-left: 8px;
  border-radius: 50%; color: #fff; font: 700 0.6875rem/1 var(--font-ui); vertical-align: 2px; }
.d-field-mark.is-done { background: var(--green); }
.d-field-mark.is-todo { background: var(--error); }
.d-field-mark[hidden] { display: none; }
.d-group-title .d-field-mark { margin-left: 4px; vertical-align: middle; }
.d-check .d-field-mark { margin: 3px 0 0 auto; }
.d-check:has(.d-field-mark.is-todo) { padding: 10px 12px; border: 1px solid #efc9c2; border-radius: var(--radius-control); background: var(--error-bg); }
.d-check:has(.d-field-mark.is-done) { padding: 10px 12px; border: 1px solid #c9ddcf; border-radius: var(--radius-control); background: var(--green-bg); }
/* Paired uploads line up: labels at the top, drop zones on the same baseline whatever the help text's length. */
.d-upload-pair > div { display: flex; flex-direction: column; }
.d-upload-pair > div > .d-upload { margin-top: auto; }
.d-upload-pair > div > .d-field-help { margin-bottom: 10px; }
/* Five field states, each with its own shape, colour and words. */
.d-field-mark.is-done { background: var(--green); color: #fff; }
.d-field-mark.is-todo { background: transparent; border: 2px solid #b7b9ae; }
.d-field-mark.is-missing { background: var(--error); color: #fff; }
.d-field-mark.is-recommended { background: #c98a12; color: #fff; }
.d-field-mark.is-optional { background: transparent; color: var(--muted); border: 1px dashed #b7b9ae; }
.d-autofill-list li { grid-template-columns: 1.25rem 9rem minmax(0, 1fr) auto; }
.d-autofill-list li.is-done strong, .d-autofill-list li.is-todo strong, .d-autofill-list li.is-optional strong, .d-autofill-list li.is-recommended strong { color: var(--ink); }
.d-autofill-list li.is-missing strong { color: var(--error); }
.d-autofill-list li:not(.is-done) { color: var(--muted); }
.d-state-tag { padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.d-state-tag.is-todo { background: var(--soft); color: var(--ink); }
.d-state-tag.is-missing { background: var(--error-bg); color: var(--error); }
.d-state-tag.is-recommended { background: var(--wait-bg); color: var(--wait); }
.d-state-tag.is-optional { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.d-check:has(.d-field-mark.is-todo) { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
@media (max-width: 640px) { .d-autofill-list li > .d-state-tag { grid-column: 2; justify-self: start; } }
.d-check:has(.d-field-mark.is-missing) { padding: 10px 12px; border: 1px solid #efc9c2; border-radius: var(--radius-control); background: var(--error-bg); }
/* Right column: wider, and two cards of equal rank instead of one card split by a line. */
.d-work-grid { grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 420px); }
.d-summary-panel { display: flex; flex-direction: column; gap: 16px; padding: 0; background: none; border: 0; }
.d-side-card { padding: 22px 24px; }
.d-summary-toggle, .d-model-view-title { font: 400 1.25rem/1.3 var(--font-heading); color: var(--ink); letter-spacing: 0; }
.d-model-view { margin-top: 0; padding-top: 22px; border-top: 1px solid var(--line); }
.d-model-view.d-side-card { border-top: 1px solid var(--line); }
@media (max-width: 999px) {
  .d-work-grid { grid-template-columns: 1fr; }
  .d-summary-panel { padding: 0; }
  .d-side-card { padding: 16px 20px; }
}
.d-mv-tiles { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.d-mv-value { font-size: 1.125rem; }
/* Both side-card headings at the same level (the summary heading is a button, which otherwise inherits the body font). */
.designata .d-summary-toggle, .designata .d-model-view-title { font: 400 1.25rem/1.3 var(--font-heading); color: var(--ink); }
.d-summary-state { margin-top: 10px; }
.d-model-view .d-mv-kind { margin-top: 10px; }
.d-model-view .d-mv-kind strong { font-size: var(--text-body); }
.d-autofill-list .d-field-mark { margin-left: 0; }
/* Coefficient list: three fixed columns shared by the heading and every row, so the numbers line up. */
.d-mv-list-head.is-three, .d-mv-list.is-three li { display: grid; grid-template-columns: minmax(0, 1fr) 6.25rem 6.25rem; gap: 0 10px; align-items: baseline; }
.d-mv-list-head.is-three > span:not(:first-child) { text-align: right; }
.d-mv-list.is-three .d-mv-num.is-muted { min-width: 0; }
/* Paired uploads: same height, tops and bottoms aligned. With help text, rows are shared (subgrid) so labels, help and zones line up. */
.d-upload-pair > div > .d-upload { flex: 1 1 auto; margin-top: 0; }
.d-upload-pair.has-help { grid-template-rows: auto auto auto; }
.d-upload-pair.has-help > div { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
.d-upload-pair.has-help > div > .d-field-help { margin: 0 0 10px; }
/* Focus ring for keyboard users only; a mouse pick should not look like an error. */
.d-upload:focus-within { outline: none; }
.d-upload:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Draft summary: compact rows, open fields dimmed. */
.d-summary-state { margin-top: 4px; font-size: var(--text-help); color: var(--wait); font-weight: 600; }
.d-summary-draft { display: grid; gap: 0; margin: 12px 0 0; font-size: var(--text-help); }
.d-summary-draft > div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.d-summary-draft dt { color: var(--muted); }
.d-summary-draft dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.d-summary-draft > div.is-open dd { color: #b0b2a8; }
.d-summary-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.d-upload[data-pointer="1"]:has(input:focus-visible) { outline: none; }
/* "Go to": jump to the field that still needs filling, which then flashes. */
.d-goto { padding: 2px 9px; border: 1px solid #c9cabf; border-radius: var(--radius-control); background: var(--surface); color: var(--navy);
  font: 600 0.75rem/1.4 var(--font-ui); cursor: pointer; white-space: nowrap; }
.d-goto:hover { border-color: var(--navy); background: var(--soft); }
.d-autofill-list li { grid-template-columns: 1.25rem 9rem minmax(0, 1fr) auto auto; }
.d-summary-draft > div.is-open dd { display: flex; align-items: center; gap: 8px; color: var(--muted); }
@keyframes d-attention { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 25%, 75% { box-shadow: 0 0 0 4px rgba(201, 138, 18, .45); } }
.d-attention { animation: d-attention 1.6s ease-in-out; border-radius: var(--radius-control); }
@media (prefers-reduced-motion: reduce) { .d-attention { animation: none; outline: 3px solid #c98a12; } }
/* The word beside a field mark. */
.d-field-word { margin-left: 6px; font-size: 0.75rem; font-weight: 600; vertical-align: 2px; }
.d-field-word.is-todo { color: var(--muted); }
.d-field-word.is-missing { color: var(--error); }
.d-field-word.is-recommended { color: var(--wait); }
.d-field-word[hidden] { display: none; }
.d-check .d-field-word { margin: 4px 0 0 6px; white-space: nowrap; }
.d-group-title .d-field-word { font-family: var(--font-ui); }
/* Field status sits in the label row, centred with the label text: one element, no baseline nudging. */
.d-field-label:has(> .d-field-mark:not([hidden])) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.d-field-label > .d-field-mark, .d-group-title > .d-field-mark, .d-check > .d-field-mark { margin: 0; vertical-align: baseline; }
.d-field-label > .d-field-mark.is-todo, .d-field-label > .d-field-mark.is-missing, .d-group-title > .d-field-mark.is-todo, .d-group-title > .d-field-mark.is-missing,
.d-check > .d-field-mark.is-todo, .d-check > .d-field-mark.is-missing {
  width: auto; height: auto; padding: 1px 8px; border: 0; border-radius: 999px; font: 600 0.75rem/1.5 var(--font-ui); }
.d-field-label > .d-field-mark.is-todo, .d-group-title > .d-field-mark.is-todo, .d-check > .d-field-mark.is-todo { background: var(--soft); color: var(--muted); }
.d-field-label > .d-field-mark.is-missing, .d-group-title > .d-field-mark.is-missing, .d-check > .d-field-mark.is-missing { background: var(--error-bg); color: var(--error); }
.d-check { align-items: center; }
.d-check > .d-field-mark { margin-left: auto; flex: none; }
.d-group-title > .d-field-mark { align-self: center; }
.d-check > input { align-self: flex-start; }
/* Side-panel task list: progress, the next thing to do, then one ruled row per item (whole row clickable). */
.d-task-count { margin-top: 6px; font-size: var(--text-help); font-weight: 600; color: var(--ink); }
.d-task-progress { margin-top: 6px; height: 6px; border-radius: 3px; }
.d-task-progress > div { background: var(--green); border-radius: 3px; }
.d-task-next { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--soft); font-size: var(--text-help); }
.d-task-next > span { font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: 0.75rem; }
.d-task-next > strong { flex: 1; min-width: 0; color: var(--ink); }
.d-task-next.is-ready { background: var(--green-bg); }
.d-task-next.is-ready > strong { color: var(--green); }
.d-task-go { min-height: 32px; padding: 4px 14px; font-size: var(--text-help); }
.d-task-list { margin: 12px 0 0; padding: 0; list-style: none; }
.d-task-list li + li { border-top: 1px solid var(--line); }
.d-task-row { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 4px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-control); }
.d-task-row:hover { background: var(--soft); }
.d-task-row .d-field-mark { margin: 0; }
.d-task-text { display: flex; flex-direction: column; min-width: 0; font-size: var(--text-help); line-height: 1.35; }
.d-task-text strong { color: var(--ink); }
.d-task-text span { color: var(--muted); overflow-wrap: anywhere; }
.d-task-list li.is-done .d-task-text span { color: var(--ink); }
.d-task-state { font-size: 0.75rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.d-task-state.is-done { color: var(--green); }
.d-task-state.is-missing { color: var(--error); }
.d-task-state.is-recommended { color: var(--wait); }
/* The note under the uploads. */
.d-autofill { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; font-size: var(--text-help); background: var(--green-bg); border-color: #c9ddcf; }
.d-autofill .d-field-mark { margin: 1px 0 0; flex: none; }
/* Each input: its column name, and what it means underneath. */
.d-mv-name { display: flex; flex-direction: column; min-width: 0; }
.d-mv-name code { font-size: 0.8125rem; color: var(--ink); overflow-wrap: anywhere; }
.d-mv-name small { font-size: 0.75rem; line-height: 1.35; color: var(--muted); }
.d-mv-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.d-mv-list li:last-child { border-bottom: 0; }
/* What the files filled: a quiet line, no box. */
.d-autofill { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; padding: 0; border: 0; background: none; color: var(--green); font-size: var(--text-help); }
.d-autofill-tick { font-weight: 700; }
/* Pinned progress strip at the top of the side column. */
.d-task-strip { position: sticky; top: 0; z-index: 2; padding: 12px 16px; box-shadow: 0 6px 16px rgba(20, 30, 40, .08); }
.d-task-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--text-help); }
.d-task-strip .d-task-progress { margin-top: 8px; }
.d-task-strip-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: var(--text-help); font-weight: 600; color: var(--ink); }
.d-task-strip-next.is-ready > span { color: var(--green); }
@media (max-width: 999px) { .d-task-strip { position: static; box-shadow: none; } }

/* ---- Report, figure-led (Seismometer / OHDSI PLP viewer: each topic opens with its figure,
   exact values in a table underneath). Example-only content sits in one band above the report. */
.d-eyebrow { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#example-report .d-report-head, #report .d-report-head { margin-bottom: 20px; }
.d-example-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
  margin: 0 0 20px; padding: 14px 18px; background: var(--soft); border-radius: 10px; }
.d-example-bar .d-example-intro { flex: 1 1 320px; max-width: 60ch; margin: 0; font-size: var(--text-help); line-height: 1.5; color: var(--ink); }
.d-example-bar .d-example-scenarios { flex: 0 1 auto; display: grid; grid-template-columns: auto auto; align-items: center; gap: 6px 12px; margin: 0; }
.d-example-scenarios-label { font-size: var(--text-help); font-weight: 600; color: var(--ink); }
.d-example-bar .d-example-switch-note { grid-column: 1 / -1; font-size: 0.8125rem; }
.d-report-summary .d-report-verdict { font: 400 1.375rem/1.4 var(--font-heading); color: var(--title); }
.d-report-summary .d-summary-figures .d-value { font-size: 2rem; }

.d-report-tabs .d-tab-panel { padding-top: 24px; }
.d-panel-heading { margin: 0 0 4px; font-size: var(--text-card-title); font-weight: 600; color: var(--ink); }
.d-discrimination-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.d-discrimination-grid .d-report-classification { margin: 0; }
.d-discrimination-grid .d-report-classification .d-confusion { max-width: none; margin-top: 16px; }

/* Ruled figure lists: label left, value right, the reading hint under the value. */
.d-report-tabs .d-metric-list { display: block; margin: 16px 0 0; }
.d-report-tabs .d-metric-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline;
  padding: 10px 0; border-radius: 0; background: none; border-bottom: 1px solid var(--line); }
.d-report-tabs .d-metric-list > div:first-child { border-top: 1px solid var(--line); }
.d-report-tabs .d-metric-list dt { font-size: 0.9375rem; color: var(--ink); }
.d-report-tabs .d-metric-list dd { margin: 0; align-items: flex-end; text-align: right; }
.d-report-tabs .d-metric-list dd strong { font-size: 1rem; }
.d-report-tabs .d-metric-list dd .d-help { font-size: 0.8125rem; }

/* A value on its scale. */
.d-scale { margin: 22px 0 0; }
.d-scale-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.d-scale-label { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.d-scale-value { font-size: 1.125rem; font-variant-numeric: tabular-nums; color: var(--navy); white-space: pre; }
.d-scale-track { --o: 0px; position: relative; height: calc(var(--o) + 24px); margin-top: 10px; }
.d-scale-track.has-bands { --o: 24px; }
.d-scale-track::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--o) + 12px); border-top: 1px solid #c9cabf; }
.d-scale-band { position: absolute; top: 0; height: 20px; background: #ecebe4; border-right: 2px solid var(--surface);
  font-size: 0.75rem; line-height: 20px; text-align: center; color: var(--muted); overflow: hidden; white-space: nowrap; }
.d-scale-band:first-child { border-radius: 4px 0 0 4px; }
.d-scale-band.is-current { background: #d8e0e7; color: var(--navy); font-weight: 600; }
.d-scale-ci { position: absolute; top: calc(var(--o) + 9px); height: 7px; border-radius: 4px; background: rgba(35, 62, 84, 0.3); }
.d-scale-dot { position: absolute; top: calc(var(--o) + 5px); width: 15px; height: 15px; margin-left: -7.5px; border-radius: 50%;
  background: var(--navy); box-shadow: 0 0 0 2px var(--surface); }
.d-scale-baseline { position: absolute; top: calc(var(--o) + 2px); height: 20px; border-left: 2px dashed var(--muted); }
.d-scale-ends { position: relative; height: 18px; margin-top: 2px; font-size: 0.75rem; color: var(--muted); }
.d-scale-ends > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.d-scale-ends > span:first-child { transform: none; }
.d-scale-ends > span:last-child { transform: translateX(-100%); }
.d-scale-note { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.d-scale-key { flex: none; width: 0; height: 14px; border-left: 2px dashed var(--muted); margin: 0 6px; }

/* Confusion matrix as a tinted 2×2: correct and wrong cells differ by word as well as tint. */
.d-report-tabs .d-confusion th, .d-report-tabs .d-confusion td { border: 0; border-bottom: 1px solid var(--surface); }
.d-report-tabs .d-confusion td { padding: 12px 14px; font-size: 1.375rem; text-align: center; border-left: 3px solid var(--surface); }
.d-report-tabs .d-confusion td::after { content: attr(data-note); display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.d-report-tabs .d-confusion td.is-right { background: #e5ecf1; }
.d-report-tabs .d-confusion td.is-wrong { background: #f6ebe5; color: var(--rust); }
.d-report-tabs .d-confusion thead th { text-align: center; font-size: 0.8125rem; }
.d-report-tabs .d-confusion tbody th { font-size: 0.875rem; font-weight: 500; }

/* Calibration: the plot first, its figures beside it. */
.d-report-tabs .d-calibration-grid { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 48px; }
.d-report-tabs .d-calibration-grid .d-metric-list { margin-top: 0; }

/* Subgroup forest plot. */
.d-forest { margin: 20px 0 8px; }
.d-forest-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 180px; gap: 20px; align-items: center; padding: 7px 0; border-bottom: 1px solid #ecebe4; }
.d-forest-axis { padding: 0 0 6px; border-bottom: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
.d-forest-axis > span:last-child { text-align: right; }
.d-forest-ticks { position: relative; height: 16px; }
.d-forest-ticks > span { position: absolute; transform: translateX(-50%); }
.d-forest-dim { padding: 16px 0 4px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.d-forest-group { font-size: 0.9375rem; color: var(--ink); }
.d-forest-group small { margin-left: 8px; font-size: 0.8125rem; color: var(--muted); }
.d-forest-track { position: relative; height: 22px; }
.d-forest-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #ecebe4; }
.d-forest-overall { position: absolute; top: -8px; bottom: -8px; border-left: 2px dashed var(--muted); }
.d-forest-chance { position: absolute; top: -8px; bottom: -8px; border-left: 1px dotted var(--muted); opacity: 0.8; }
.d-forest-ci { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--navy); }
.d-forest-dot { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 2px var(--surface); }
.d-forest-value { font-size: 0.875rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Cut-off line chart. */
.d-line-figure { margin: 16px 0 8px; }
.d-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8125rem; color: var(--ink); }
.d-legend i, .d-chart-readout i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.d-line-frame { margin-top: 8px; border-radius: 6px; }
.d-line-frame:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.d-line-chart { display: block; width: 100%; max-width: 820px; height: auto; overflow: visible; }
.d-chart-axis { stroke: #b9bab0; stroke-width: 1; }
.d-chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.d-chart-marker { stroke: var(--surface); stroke-width: 1.5; }
.d-chart-direct { font: 600 12px var(--font-ui); fill: var(--ink); }
.d-chart-cursor { stroke: var(--ink); stroke-opacity: 0.25; stroke-width: 1; }
.d-chart-hit { fill: transparent; cursor: crosshair; }
.d-chart-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 8px 0 0; padding: 10px 14px;
  background: var(--soft); border-radius: 8px; font-size: 0.875rem; font-variant-numeric: tabular-nums; }

.d-report-tabs .d-performance-note { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 90ch; font-size: 0.8125rem; }
@media (max-width: 900px) {
  .d-discrimination-grid, .d-report-tabs .d-calibration-grid { grid-template-columns: 1fr; gap: 28px; }
  .d-forest-row { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) 72px; gap: 10px; }
  .d-forest-value { font-size: 0.75rem; }
}
.d-example-bar .d-segmented { justify-self: start; }

/* ---- Checks tab: one row per check. Left: the question, the result, the status line.
   Right: a figure first, then the evidence. No tinted boxes inside the panel. */
.d-report-checks .d-check-row { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 40px; padding: 28px 0; margin: 0; border-top: 1px solid var(--line); }
.d-report-checks .d-check-row:first-child { padding-top: 4px; border-top: 0; }
.d-report-checks .d-check-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 6px 10px; min-height: 0; padding: 0; cursor: default; }
.d-report-checks .d-check-summary::after { content: none; }
.d-report-checks .d-check-mark { align-self: center; }
.d-report-checks .d-check-label { min-width: 0; font-size: var(--text-card-title); }
.d-report-checks .d-check-question, .d-report-checks .d-check-verdict, .d-report-checks .d-check-status { grid-column: 2; margin: 0; }
.d-check-question { font-size: var(--text-help); line-height: 1.45; color: var(--muted); }
.d-check-verdict { justify-self: start; margin-top: 6px !important; padding: 2px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--soft); color: var(--muted); }
.d-check-verdict.is-ok { background: var(--green-bg); color: var(--green); }
.d-check-verdict.is-attention { background: var(--wait-bg); color: var(--wait); }
.d-report-checks .d-check-status { font-size: var(--text-help); line-height: 1.45; color: var(--ink); }
.d-report-checks .d-check-row.is-attention .d-check-status { color: var(--wait); }
.d-report-checks .d-check-body { padding: 0; min-width: 0; }
.d-report-checks .d-check-body > * + * { margin-top: 20px; }
/* The overlap card loses its tinted frame here; the left column already gives the result. */
.d-report-checks .d-record-check { padding: 0; border: 0; border-radius: 0; background: none; }
.d-report-checks .d-record-check > .d-card-title, .d-report-checks .d-target-status { display: none; }
.d-report-checks .d-record-basis { margin: 0; font-size: var(--text-help); color: var(--muted); }
.d-report-checks .d-record-summary { margin-top: 16px; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.d-report-checks .d-record-summary > div { padding: 12px 16px 12px 0; }
.d-report-checks .d-record-summary > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.d-report-checks .d-record-number { font-size: 1.5rem; }
.d-report-checks .d-record-meta { margin-top: 14px; font-size: var(--text-help); }
.d-report-checks .d-record-scope h4 { font-size: 0.9375rem; }
.d-report-checks .d-record-scope p { font-size: var(--text-help); color: var(--muted); }
.d-overlap-figure { margin: 0; }
.d-overlap-bar { position: relative; height: 14px; border-radius: 7px; background: #dfe5ea; overflow: hidden; }
.d-overlap-part { position: absolute; left: 0; top: 0; bottom: 0; background: var(--rust); border-right: 2px solid var(--surface); }
.d-overlap-figure figcaption { margin-top: 8px; font-size: 0.9375rem; color: var(--ink); }
.d-check-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.d-check-figures > div { padding: 12px 16px 12px 0; }
.d-check-figures > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.d-check-figures dt { font-size: var(--text-help); color: var(--muted); }
.d-check-figures dd { margin: 2px 0 0; font: 600 1.5rem/1.2 var(--font-ui); color: var(--navy); font-variant-numeric: tabular-nums; }
.d-report-checks .d-report-variables > .d-help:first-of-type { margin-top: 0; }
.d-report-checks .d-target-table { width: 100%; }

/* ---- About tab: one column of sections, heading on the left and facts on the right. */
.d-report-full > .d-report-grid { display: block; margin: 0; }
.d-report-full .d-report-grid > section { display: grid; grid-template-columns: minmax(160px, 200px) minmax(0, 1fr); gap: 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.d-report-full > .d-report-grid:first-child > section:first-child { padding-top: 4px; border-top: 0; }
.d-report-full .d-report-grid > section > .d-card-title { margin: 0; font-size: var(--text-card-title); }
.d-about-body { min-width: 0; }
.d-about-body > .d-help:first-child { margin: 0 0 4px; }
.d-report-full .d-about-body .d-kv { margin-top: 12px; }
.d-report-full .d-about-body .d-kv > div { grid-template-columns: minmax(150px, 30%) minmax(0, 1fr); gap: 24px; }
.d-report-full .d-about-body .d-kv dt { font-size: var(--text-help); color: var(--muted); }
.d-report-full .d-report-population .d-counts { display: flex; gap: 0; margin: 16px 0 0; }
.d-report-full .d-report-population .d-counts > div { padding-right: 24px; }
.d-report-full .d-report-population .d-counts > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.d-split { margin: 0; }
.d-split-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.d-split-part.is-positive { background: var(--navy); border-right: 2px solid var(--surface); }
.d-split-part.is-negative { background: #c9d3dc; }
.d-split-labels { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 0.9375rem; color: var(--ink); }
.d-split-label i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; vertical-align: 0; }
.d-split-label.is-positive i { background: var(--navy); }
.d-split-label.is-negative i { background: #c9d3dc; }
.d-split-label strong { font-variant-numeric: tabular-nums; }
.d-split-share { color: var(--muted); }
.d-about-caveat { margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--wait); background: var(--wait-bg); border-radius: 0 8px 8px 0; }
.d-about-caveat-title { margin: 0 0 6px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--wait); }
.d-about-caveat .d-readable-copy p { margin: 6px 0 0; font-size: var(--text-help); line-height: 1.5; }
.d-about-caveat .d-readable-copy p:first-child { margin-top: 0; }
.d-report-full > .d-report-full-note { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.8125rem; }
@media (max-width: 900px) {
  .d-report-checks .d-check-row, .d-report-full .d-report-grid > section { grid-template-columns: 1fr; gap: 16px; }
  .d-check-figures { grid-template-columns: 1fr 1fr 1fr; }
}
.d-report-checks .d-record-meta { padding-top: 0; border-top: 0; }
.d-report-checks .d-target-table th:first-child, .d-report-checks .d-target-table td:first-child { padding-left: 0; }
.d-report-full .d-about-body > .d-kv:first-child { margin-top: -10px; }
.d-report-full .d-about-body > .d-kv:first-child > div:first-child { border-top: 0; }
.d-report-full .d-report-grid > section > .d-card-title { line-height: 1.5; }
.d-example-bar .d-example-scenarios { padding-top: 0; border-top: 0; }
.d-report-summary .d-report-verdict { max-width: 62ch; }

/* ---- TRIPOD+AI: coverage bar first, then the checklist table grouped by paper section. */
.d-tripod-lead { max-width: 72ch; margin: 4px 0 0; }
.d-tripod-figure { margin: 20px 0 0; }
.d-tripod-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.d-tripod-bar > span + span { border-left: 2px solid var(--surface); }
.d-tripod-bar .is-reported, .d-tripod-count.is-reported i, .d-tripod-status.is-reported i { background: var(--green); }
.d-tripod-bar .is-partly, .d-tripod-count.is-partly i, .d-tripod-status.is-partly i { background: #c49a45; }
.d-tripod-bar .is-missing, .d-tripod-count.is-missing i, .d-tripod-status.is-missing i { background: var(--rust); }
.d-tripod-bar .is-na, .d-tripod-count.is-na i, .d-tripod-status.is-na i { background: #c9cabf; }
.d-report-tripod .d-tripod-counts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0 0; font-size: 0.9375rem; color: var(--ink); }
.d-tripod-count i, .d-tripod-status i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; }
.d-tripod-count strong { font-variant-numeric: tabular-nums; }
.d-tripod-tools { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.d-report-tripod .d-table-scroll { margin-top: 12px; }
.d-report-tripod .d-tripod-table th, .d-report-tripod .d-tripod-table td { vertical-align: top; }
.d-report-tripod .d-tripod-table thead th:first-child, .d-report-tripod .d-tripod-item { width: 5.5rem; padding-left: 0; }
.d-report-tripod .d-tripod-item { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-report-tripod .d-tripod-topic { font-weight: 600; color: var(--ink); min-width: 11rem; }
.d-report-tripod .d-tripod-group th { padding: 20px 0 6px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: none; }
.d-report-tripod .d-tripod-status { padding: 0; background: none; color: var(--ink); font-size: var(--text-help); }
.d-report-tripod .d-tripod-where { color: var(--muted); font-size: var(--text-help); line-height: 1.5; }
.d-tripod-table.is-open-only tbody tr[data-status="Reported"], .d-tripod-table.is-open-only tbody tr[data-status="Not applicable"] { display: none; }
.d-tripod-source { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.8125rem; }
.d-report-tripod .d-tripod-table td:nth-child(3) { width: 9rem; white-space: nowrap; }

/* ---- Clickability: strong signifiers (NN/g eyetracking: flat, unframed controls are
   noticed less and clicked less). Check cards look like cards with "Details ›";
   the report sections look like folder tabs attached to their panel. */
.d-report-summary .d-check-strip { gap: 12px; padding-top: 18px; }
.d-report-summary .d-check-card { position: relative; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); text-align: left; cursor: pointer; transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; }
.d-report-summary .d-check-card:hover { border-color: var(--navy); background: #f7f8f6; box-shadow: 0 1px 3px rgba(35, 62, 84, 0.12); }
.d-report-summary .d-check-card.is-attention { border-color: #dcc89e; background: var(--wait-bg); }
.d-report-summary .d-check-card.is-attention:hover { border-color: var(--wait); }
.d-report-summary .d-check-card .d-check-mark { margin-top: 1px; }
.d-report-summary .d-check-card-text { flex: 1 1 auto; }
.d-check-card-go { flex: none; align-self: center; font-size: var(--text-help); font-weight: 600; color: var(--navy); white-space: nowrap; }
.d-check-card.is-attention .d-check-card-go { color: var(--wait); }
.d-check-card:hover .d-check-card-go { text-decoration: none; transform: translateX(2px); }

.d-report-tabs { padding-top: 0; overflow: hidden; }
.d-report-tabs > .d-tabs-bar { margin: 0 calc(-1 * var(--pad-card)); padding: 10px var(--pad-card) 0; align-items: flex-end;
  background: var(--soft); border-bottom: 1px solid var(--line); }
.d-report-tabs .d-tabs { gap: 2px; }
.d-report-tabs .d-tab { margin-bottom: -1px; padding: 11px 16px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  color: var(--ink); font-weight: 500; }
.d-report-tabs .d-tab:hover { background: rgba(255, 254, 250, 0.7); color: var(--navy); }
.d-report-tabs .d-tab[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: inset 0 3px 0 var(--navy);
  color: var(--navy); font-weight: 600; }
.d-report-tabs .d-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.d-report-tabs .d-tabs-bar .d-metric-guide { margin-bottom: 8px; background: var(--surface); }

/* ---- Sign-in: Show/Hide attached to the password field (GOV.UK password input);
   one line for requesting access, in the same type as the card. */
.d-password { display: flex; align-items: stretch; margin-top: 8px; }
.designata .d-password input { flex: 1 1 auto; min-width: 0; margin: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.d-password-toggle { flex: none; min-width: 76px; padding: 0 16px; border: 1px solid #cfd0c6; border-left: 0;
  border-radius: 0 var(--radius-control) var(--radius-control) 0; background: var(--soft); color: var(--navy);
  font: 600 var(--text-label)/1 var(--font-ui); cursor: pointer; }
.d-password-toggle:hover { background: #e4e5de; }
.d-signin-card #signin-submit { margin-top: 24px; }
/* Hierarchy: title, the two fields, one filled primary button; below a divider, the outlined
   secondary action and a short note. Everything in the card uses the body size. */
.d-signin-card { padding: 40px; }
.d-signin-card .d-signin-lead { margin: 4px 0 8px; color: var(--muted); }
.d-signin-card #signin-submit { margin-top: 28px; min-height: 52px; font-size: 1.0625rem; font-weight: 600; }
.d-signin-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 16px; color: var(--muted); font-size: var(--text-help); }
.d-signin-divider::before, .d-signin-divider::after { content: ""; flex: 1 1 auto; border-top: 1px solid var(--line); }
.d-signin-card .d-signin-request { width: 100%; font-weight: 600; }
.d-signin-note { margin: 10px 0 0; text-align: center; font-size: var(--text-help); color: var(--muted); }
/* One focus ring around the field and its Show button together: the button is flush with the
   field and would otherwise paint over the right side of the field's own ring. */
.designata .d-password input:focus-visible, .d-password-toggle:focus-visible { outline: none; }
.d-password { border-radius: var(--radius-control); }
.d-password:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.d-password:has(.d-password-toggle:focus-visible) .d-password-toggle { background: #e4e5de; }

/* ---- Header: service name, pages, account (GOV.UK service navigation). The current page is
   bold with a bar on the header's bottom edge, not a grey pill; both account actions are
   buttons of one size. */
.d-header-inner { flex-wrap: nowrap; gap: 28px; min-height: 64px; }
.d-brand { display: inline-flex; align-items: baseline; gap: 10px; flex: none; color: var(--title); text-decoration: none;
  font: 600 1.25rem/1 var(--font-heading); }
.d-brand-sub { font: 400 var(--text-help)/1 var(--font-ui); color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.d-brand:hover { color: var(--navy); }
.d-nav { flex: 1 1 auto; align-self: stretch; gap: 2px; flex-wrap: nowrap; }
.d-nav a { align-self: stretch; min-height: 64px; padding: 0 14px; border-radius: 0; background: none; color: var(--ink);
  font-size: var(--text-nav); font-weight: 500; text-decoration: none; box-shadow: inset 0 -3px 0 transparent; }
.d-nav a:hover { color: var(--navy); background: none; box-shadow: inset 0 -3px 0 #cfd6dc; }
.d-nav a[aria-current="page"] { color: var(--navy); background: none; font-weight: 700; box-shadow: inset 0 -3px 0 var(--navy); }
.d-account { flex: none; gap: 10px; }
.d-header-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px;
  border: 1px solid #c9cabf; border-radius: var(--radius-control); background: var(--surface); color: var(--navy);
  font: 600 var(--text-nav)/1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer; }
.d-header-button:hover { border-color: var(--navy); background: #f7f8f6; }
.d-header-button.is-quiet { border-color: transparent; background: none; }
.d-header-button.is-quiet:hover { border-color: transparent; background: var(--soft); }
.d-header-button[aria-current="page"] { background: var(--soft); }

/* ---- Overview: a start page. Title and lead, the start button, what you need; the example
   report beside it as a miniature of the real report's opening. */
.d-hero-section { padding-top: 64px; padding-bottom: 56px; }
.d-hero { grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); gap: 56px; margin-top: 0; }
.d-hero-title { font: 400 clamp(2.25rem, 4vw, 3rem)/1.1 var(--font-heading); letter-spacing: -0.01em; color: var(--title); }
.d-hero-sub { max-width: 34em; margin-top: 16px; font: 400 1.1875rem/1.55 var(--font-ui); color: var(--ink); }
.d-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.d-hero-actions .d-cta { min-height: 52px; padding: 0 26px; font-size: 1.0625rem; font-weight: 600; }
.d-hero-actions .d-cta-secondary { min-height: 52px; padding: 0 22px; font-size: 1.0625rem; font-weight: 600; }
.d-sample { padding: 28px; box-shadow: 0 1px 2px rgba(32, 54, 74, 0.04), 0 8px 24px rgba(32, 54, 74, 0.06); }
.d-sample .d-eyebrow { margin-bottom: 10px; }
.d-sample-title { font: 400 1.375rem/1.3 var(--font-heading); color: var(--title); }
.d-sample .d-sample-meta { margin-top: 6px; }
.d-sample-verdict { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--text-body); line-height: 1.5; color: var(--ink); }
.d-sample-metrics { gap: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.d-sample-metrics > div { padding: 14px 12px 14px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.d-sample-metrics > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.d-sample-metrics dd { margin-top: 2px; font: 600 clamp(1.25rem, 8cqi, 1.75rem)/1.2 var(--font-ui); color: var(--navy); font-variant-numeric: tabular-nums; }
.d-sample .d-block { margin-top: 20px; }
@media (max-width: 1099px) {
  .d-header-inner { gap: 16px; }
  .d-brand-sub, .d-account-email { display: none; }
}
@media (max-width: 900px) {
  .d-hero { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .d-header-inner { flex-wrap: wrap; gap: 4px 12px; }
  .d-nav { align-self: auto; }
  .d-nav a { min-height: 44px; padding: 10px 12px; box-shadow: inset 3px 0 0 transparent; }
  .d-nav a:hover { box-shadow: inset 3px 0 0 #cfd6dc; }
  .d-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--navy); }
  .d-account { flex: 1 1 auto; justify-content: flex-end; }
}

/* ---- Evaluations: one card per task side by side (a catalogue grid). Eyebrow, title, two
   facts, the versions; Details opens the drawer. Cards in a row share one height. */
.d-hero-band + .d-section { padding-top: 24px; }
.d-evaluation-list:has(.d-task-tile) { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: stretch; }
.d-task-tile { display: flex; flex-direction: column; padding: 24px; }
.d-task-tile .d-eyebrow { margin: 0 0 8px; }
.d-task-tile .d-card-title { font: 400 1.3125rem/1.3 var(--font-heading); color: var(--title); }
.d-task-glance { margin: 14px 0 0; display: grid; gap: 6px; }
.d-task-glance > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; font-size: var(--text-help); }
.d-task-glance dt { color: var(--muted); }
.d-task-glance dd { margin: 0; color: var(--ink); }
.d-task-versions-title { margin: 18px 0 0; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.d-task-tile .d-task-versions { margin: 8px 0 0; }
.d-task-tile .d-task-versions > li { padding: 10px 0; }
.d-task-tile .d-task-version-name { font-size: var(--text-help); }
.d-task-tile .d-task-version-summary { font-size: var(--text-help); line-height: 1.45; }
.d-task-tile .d-evaluation-toggle { margin-top: auto; width: 100%; }
.d-task-tile .d-task-versions { margin-bottom: 18px; }
#definition-body .d-task-details { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.d-hero-band + .d-section { padding-top: 48px; }
.d-section-lead { margin: -6px 0 20px; color: var(--muted); }
.d-task-glance > div { grid-template-columns: 6.5rem minmax(0, 1fr); }
.d-brand { font: 600 1.0625rem/1.2 var(--font-ui); letter-spacing: 0; }

/* ---- Less text, clearer order: one line per need, version names only on the cards. */
.d-hero-sub { max-width: 30em; font-size: 1.25rem; }
.d-sample-metrics { margin-top: 20px; }
.d-task-tile .d-task-versions { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.d-task-tile .d-task-versions > li { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; }
.d-task-tile .d-task-version-name { font-size: var(--text-help); font-weight: 500; color: var(--ink); }
.d-task-details-heading { margin-top: 20px; font-size: var(--text-body); font-weight: 600; color: var(--ink); }
.d-task-version-list { margin: 8px 0 0; }
.d-task-version-list > div { padding: 10px 0; border-top: 1px solid var(--line); }
.d-task-version-list dt { font-weight: 600; font-size: var(--text-help); color: var(--ink); }
.d-task-version-list dd { margin: 2px 0 0; font-size: var(--text-help); color: var(--muted); }
.d-header-inner .d-nav { margin-left: -14px; }

/* ---- Clear signifiers in the header. The pages sit in one contained track, like the report's
   tabs: each page is a padded target, the current one raised in white; Sign in is a filled
   button, Request access outlined. */
.d-header-inner .d-nav { margin-left: 0; align-self: center; flex: 0 1 auto; gap: 2px; padding: 4px; border-radius: 10px; background: var(--soft); }
.d-nav a { align-self: auto; min-height: 38px; padding: 0 16px; border-radius: 7px; color: var(--ink); font-weight: 500; box-shadow: none; }
.d-nav a:hover { background: rgba(255, 254, 250, 0.75); color: var(--navy); box-shadow: none; }
.d-nav a[aria-current="page"] { background: var(--surface); color: var(--navy); font-weight: 600;
  box-shadow: 0 1px 2px rgba(32, 54, 74, 0.12), 0 0 0 1px rgba(32, 54, 74, 0.06); }
.d-header-inner { justify-content: space-between; }
.d-header-button.is-primary { border-color: var(--navy); background: var(--navy); color: var(--surface); }
.d-header-button.is-primary:hover { border-color: var(--navy-hover); background: var(--navy-hover); color: var(--surface); }
.d-header-button.is-primary[aria-current="page"] { background: var(--navy-hover); }
@media (max-width: 640px) {
  .d-header-inner .d-nav { padding: 4px 0 8px; background: none; border-radius: 0; }
  .d-nav a { min-height: 44px; padding: 10px 12px; }
  .d-nav a[aria-current="page"] { background: var(--soft); box-shadow: inset 3px 0 0 var(--navy); }
}
/* Buttons in the header beat the global "button { font: inherit; color: inherit }" reset. */
.designata .d-header-button { color: var(--navy); font: 600 var(--text-nav)/1 var(--font-ui); }
.designata .d-header-button.is-primary { color: var(--surface); }

/* ---- Header pages as underline tabs with icons (GitHub Primer UnderlineNav): every page has
   an icon and a rounded hover target; the current page is bold with a bar on the header edge. */
.d-header-inner .d-nav { align-self: stretch; gap: 4px; padding: 0; background: none; border-radius: 0; margin-left: -10px; }
.d-nav a { position: relative; align-self: stretch; display: inline-flex; align-items: center; gap: 8px; min-height: 64px; padding: 0 10px;
  border-radius: 0; background: none; box-shadow: none; color: var(--ink); font-weight: 500; }
.d-nav a::before { content: ""; position: absolute; inset: 12px 0; border-radius: 8px; background: transparent; z-index: -1; transition: background .12s; }
.d-nav a:hover { background: none; box-shadow: none; color: var(--navy); }
.d-nav a:hover::before { background: var(--soft); }
.d-nav a .d-icon { width: 17px; height: 17px; color: var(--muted); }
.d-nav a:hover .d-icon, .d-nav a[aria-current="page"] .d-icon { color: var(--navy); }
.d-nav a[aria-current="page"] { background: none; color: var(--navy); font-weight: 600; box-shadow: inset 0 -3px 0 var(--navy); }
.d-nav { position: relative; z-index: 0; }
@media (max-width: 640px) {
  .d-header-inner .d-nav { margin-left: 0; align-self: auto; }
  .d-nav a { min-height: 44px; padding: 10px 12px; }
  .d-nav a::before { inset: 2px 0; }
  .d-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--navy); }
}

/* ---- Evaluations as one comparison table; the versions once below it. */
.d-evaluation-list:has(.d-task-table) { display: block; }
.d-task-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.d-task-table th, .d-task-table td { padding: 16px 20px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.d-task-table thead th { padding-top: 12px; padding-bottom: 12px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: #faf9f5; }
.d-task-table tbody tr:last-child > * { border-bottom: 0; }
.d-task-table tbody tr:hover { background: #fbfaf6; }
.d-task-table td { color: var(--ink); }
.d-task-table td.is-number { font-variant-numeric: tabular-nums; }
.d-task-name { font: 400 1.1875rem/1.35 var(--font-heading); color: var(--title); }
.d-task-table .d-task-action { width: 1%; white-space: nowrap; text-align: right; }
.d-task-table .d-evaluation-toggle { min-height: 40px; padding: 0 18px; margin: 0; width: auto; }
.d-task-table th .d-task-versions { margin: 8px 0 0; }
.d-task-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 14px; }
.d-task-legend-title { margin: 0; font-size: var(--text-help); font-weight: 600; color: var(--ink); }
.d-task-legend .d-task-versions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; }
.d-task-legend .d-task-versions li { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; font-size: var(--text-help); color: var(--ink); }
.d-task-legend .d-help { flex-basis: 100%; margin: 0; }
/* Rows were cards before: undo the card layout on the table row. */
.d-task-table tr.d-task-tile { display: table-row; padding: 0; }
@media (max-width: 760px) {
  .d-task-table thead { display: none; }
  .d-task-table tr.d-task-tile { display: block; }
  .d-task-table, .d-task-table tbody, .d-task-table tr, .d-task-table th, .d-task-table td { display: block; width: 100%; }
  .d-task-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .d-task-table th, .d-task-table td { padding: 4px 0; border: 0; }
  .d-task-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .d-task-table .d-task-action { text-align: left; padding-top: 10px; }
}

/* ---- Bullet graphs (Discrimination). Graded bands in one rounded track, the 95% interval as
   a bar, the estimate as a tall dark marker with a white edge, a dashed reference line. */
.d-scale { margin: 28px 0 0; }
.d-scale-head { align-items: baseline; }
.d-scale-value { font-size: 1.25rem; font-weight: 600; }
.d-bullet { position: relative; height: 26px; margin-top: 26px; border-radius: 6px; overflow: visible; }
.d-bullet-band { position: absolute; top: 0; bottom: 0; }
.d-bullet-band:first-child { border-radius: 6px 0 0 6px; }
.d-bullet-band:nth-last-child(1 of .d-bullet-band) { border-radius: 0 6px 6px 0; }
.d-bullet-ci { position: absolute; top: 9px; height: 8px; border-radius: 4px; background: rgba(35, 62, 84, 0.42); }
.d-bullet-mark { position: absolute; top: -7px; width: 6px; height: 40px; margin-left: -3px; border-radius: 3px; background: var(--navy);
  box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgba(32, 54, 74, 0.25); }
.d-bullet-base { position: absolute; top: -10px; bottom: -6px; border-left: 2px dashed #6f7a82; }
.d-bullet-base > span { position: absolute; bottom: 100%; left: 0; transform: translateX(-50%); margin-bottom: 2px; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.d-bullet-names { position: relative; height: 18px; margin-top: 6px; }
.d-bullet-names > span { position: absolute; text-align: center; font-size: 0.75rem; color: var(--muted); }
.d-bullet-names > span.is-current { color: var(--navy); font-weight: 700; }
.d-bullet-axis { position: relative; height: 18px; margin-top: 4px; border-top: 1px solid #cfd0c6; }
.d-bullet-axis > span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-bullet-axis > span::before { content: ""; position: absolute; top: -8px; left: 50%; height: 4px; border-left: 1px solid #cfd0c6; }
.d-bullet-axis > span:first-child { transform: none; }
.d-bullet-axis > span:first-child::before { left: 0; }
.d-bullet-axis > span:last-child { transform: translateX(-100%); }
.d-bullet-axis > span:last-child::before { left: auto; right: 0; }
.d-scale .d-scale-note { margin-top: 10px; }

/* ---- Confusion matrix cells: rounded, with breathing room. */
.d-report-tabs .d-confusion { border-collapse: separate; border-spacing: 6px; margin-left: -6px; width: calc(100% + 12px); }
.d-report-tabs .d-confusion td { border: 0; border-radius: 10px; padding: 16px 14px; }
.d-report-tabs .d-confusion td.is-right { background: #e3ebf1; color: var(--navy); }
.d-report-tabs .d-confusion td.is-wrong { background: #f5e6df; }


.d-report-tabs .d-confusion caption { padding-left: 6px; }

/* ---- Evaluation details in the drawer: one clear order. A small version tag; then each
   section as a quiet uppercase label over its text, separated by rules and space; the
   concept list and facts in a smaller, muted size; versions last. */
#definition-body .d-task-details { padding: 0; }
#definition-body .d-task-details-eyebrow { display: inline-block; margin: 0 0 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--soft); color: var(--navy); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; }
#definition-body .d-task-key { margin: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
#definition-body .d-task-key > h4, #definition-body .d-task-details-heading {
  margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#definition-body .d-task-key .d-readable-copy { margin: 0; }
#definition-body .d-task-key .d-readable-copy p { margin: 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); }
#definition-body .d-task-key .d-readable-copy p + p { margin-top: 6px; }
#definition-body .d-task-key .d-readable-copy ul { margin: 10px 0 0; padding-left: 18px; }
#definition-body .d-task-key .d-readable-copy li { margin: 4px 0 0; font-size: var(--text-help); line-height: 1.5; color: var(--muted); }
#definition-body .d-task-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 18px 0; border-top: 0; border-bottom: 1px solid var(--line); }
#definition-body .d-task-facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#definition-body .d-task-facts dd { margin-top: 4px; font-size: var(--text-help); line-height: 1.5; color: var(--ink); }
#definition-body .d-task-details-heading { margin-top: 22px; }
#definition-body .d-task-version-list { margin: 0; }
#definition-body .d-task-version-list > div { padding: 10px 0; border-top: 0; border-bottom: 1px solid var(--line); }
#definition-body .d-task-version-list > div:last-child { border-bottom: 0; }
#definition-body .d-task-version-list dt { font-size: 0.9375rem; }
#definition-body .d-task-details > .d-help { margin-top: 14px; font-size: 0.8125rem; }

/* ---- Evaluations table, organised: name with its timing underneath, who is counted, the
   inputs; the row is the target (hover + chevron); versions once in the footer. */
.d-task-table th[scope="row"] { width: 46%; }
.d-task-sub { display: block; margin-top: 4px; font-size: var(--text-help); color: var(--muted); }
.d-task-count { display: block; font-size: 1.125rem; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.d-task-table tbody tr { cursor: pointer; transition: background .12s; }
.d-task-table tbody tr:hover { background: #f6f7f4; }
.d-task-table tbody tr:hover .d-evaluation-toggle { color: var(--navy); }
.designata .d-task-table .d-evaluation-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; border: 0; background: none;
  color: var(--muted); font: 600 var(--text-nav)/1 var(--font-ui); cursor: pointer; }
.d-task-table .d-chevron { font-size: 1.375rem; line-height: 1; transition: transform .12s; }
.d-task-table tbody tr:hover .d-chevron { transform: translateX(3px); }
.d-task-table tfoot td { padding: 14px 20px; background: #faf9f5; border-top: 1px solid var(--line); border-bottom: 0; }
.d-task-table .d-task-legend { margin: 0; gap: 6px 16px; }
.d-task-table .d-task-legend-title { font-weight: 600; }
.d-task-table .d-task-legend .d-help { flex-basis: auto; }
@media (max-width: 760px) {
  .d-task-table th[scope="row"] { width: 100%; }
  .d-task-table tfoot td { display: block; }
}

/* ---- Example card: the calibration figure, then the four numbers in one row. */
.d-sample-figure { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.d-sample-figcaption { font-size: var(--text-help); color: var(--muted); }
.d-sample-chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.d-sample-line { fill: none; stroke: var(--navy); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.d-sample-point { fill: var(--navy); stroke: var(--surface); stroke-width: 2; }
.d-chart-note { font: italic 11px var(--font-ui); fill: var(--muted); }
.d-sample .d-sample-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--line); }
.d-sample .d-sample-metrics > div, .d-sample .d-sample-metrics > div:nth-child(even) { padding: 12px 8px 12px 0; border-left: 0; border-bottom: 1px solid var(--line); }
.d-sample .d-sample-metrics > div + div { padding-left: 10px; border-left: 1px solid var(--line); }
.d-sample .d-sample-metrics dt { font-size: 0.75rem; }
.d-sample .d-sample-metrics dd { font-size: clamp(1rem, 5.5cqi, 1.375rem); }
.d-sample-figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.d-sample-figcaption strong { color: var(--ink); font-weight: 600; }
.d-sample-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 0.75rem; }
.d-sample-legend i { display: inline-block; width: 16px; height: 0; border-top: 2.25px solid var(--navy); }
.d-sample-legend i.is-ideal { margin-left: 8px; border-top: 1.5px dashed var(--muted); }
.d-sample .d-sample-metrics > div:nth-child(n) { padding: 12px 8px 12px 10px; border-left: 1px solid var(--line); }
.d-sample .d-sample-metrics > div:first-child { padding-left: 0; border-left: 0; }
/* Colour in the example figure: the model blue, points hollow with a blue ring. */
.d-sample-line { stroke: #2a78d6; stroke-width: 2.5; }
.d-sample-point { fill: var(--surface); stroke: #2a78d6; stroke-width: 2.25; }
.d-sample-legend i { border-top-color: #2a78d6; }
.d-sample-legend i.is-ideal { border-top-color: var(--muted); }
/* The same blue for the model's marks in the report's calibration plot and forest plot. */
.d-chart-point { fill: var(--surface); stroke: #2a78d6; stroke-width: 2.25; }
.d-forest-dot { background: #2a78d6; }
.d-forest-ci { background: #2a78d6; }
.d-task-legend.d-section-lead { display: block; margin: -6px 0 18px; }
.d-task-legend.d-section-lead strong { font-weight: 600; color: var(--ink); }

/* ---- Evaluation details: three type levels only. Title (serif); a 13px uppercase label for
   every section and fact; 15px text for everything else (names in 600, notes muted). */
#definition-drawer .d-def-tag { font-size: 0.8125rem; padding: 3px 10px; }
#definition-body .d-task-details-eyebrow { font-size: 0.8125rem; }
#definition-body .d-task-key > h4, #definition-body .d-task-details-heading, #definition-body .d-task-facts dt {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#definition-body .d-task-key .d-readable-copy p, #definition-body .d-task-key .d-readable-copy li, #definition-body .d-task-facts dd,
#definition-body .d-task-version-list dt, #definition-body .d-task-version-list dd { font-size: 0.9375rem; line-height: 1.55; }
#definition-body .d-task-key .d-readable-copy p, #definition-body .d-task-facts dd, #definition-body .d-task-version-list dt { color: var(--ink); }
#definition-body .d-task-key .d-readable-copy li, #definition-body .d-task-version-list dd { color: var(--muted); }
#definition-body .d-task-facts dd { margin-top: 0; }
#definition-body .d-task-version-list dt { font-weight: 600; }
#definition-body .d-task-version-list dd { margin-top: 2px; }
#definition-body .d-task-details > .d-help { font-size: 0.8125rem; }
/* Plain-text values (no paragraph wrapper) take the same 15px body size. */
#definition-body .d-task-key, #definition-body .d-task-facts dd { font-size: 0.9375rem; line-height: 1.55; color: var(--ink); }
/* The report's calibration figure is the same figure as the overview card's. */
.d-report-tabs .d-calibration-grid { grid-template-columns: minmax(300px, 1fr) minmax(0, 1fr); align-items: start; }
.d-calibration-grid .d-sample-figure { margin: 0; padding-top: 0; border-top: 0; }
.d-calibration-note { margin-top: 8px; font-size: var(--text-help); }

/* ---- Figure lists beside a chart: the label with its reading hint underneath on the left,
   the value on the right, centred on the row; rows of equal rhythm, top-aligned with the chart. */
.d-report-tabs .d-metric-list > div { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "hint value";
  align-items: center; row-gap: 2px; padding: 12px 0; }
.d-report-tabs .d-metric-list dd { display: contents; }
.d-report-tabs .d-metric-list dt { grid-area: label; }
.d-report-tabs .d-metric-list dd strong { grid-area: value; align-self: center; font-size: 1.125rem; font-weight: 600; color: var(--navy); text-align: right; }
.d-report-tabs .d-metric-list dd .d-help { grid-area: hint; text-align: left; font-size: 0.8125rem; }
.d-calibration-grid .d-metric-list > div:first-child { border-top: 0; padding-top: 4px; }
.d-calibration-grid { align-items: start; }

/* ---- "How to read these numbers": stacked rows, one figure each, under group headings. */
.d-guide-group + .d-guide-group { margin-top: 28px; }
.d-guide-heading { margin: 0; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.d-guide-lead { margin: 6px 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink); }
.d-guide-list { margin: 10px 0 0; }
.d-guide-list > div { padding: 14px 0; border-top: 1px solid var(--line); }
.d-guide-list dt { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.d-guide-list dd { margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.d-guide-text { margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.d-guide-note { margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }

/* ---- Type hierarchy with one typeface. A light serif at the top read weaker than the bold
   sans below it; now each level is heavier or larger than the next:
   page title 700 > section and step titles 650 > card and panel titles 600 > body 400. */
.d-page > h1, .d-page-head h1, .d-signin-card h1, .d-report-head h1, .d-hero-title {
  font-weight: 700; letter-spacing: -0.022em; color: var(--title); }
.d-hero-title { font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.08; }
.d-section-title, .d-step-title, .d-group-title, .d-dialog-title { font-weight: 650; letter-spacing: -0.012em; color: var(--title); }
.d-sample-title, .d-task-name, .d-task-tile .d-card-title, .d-model-view-title, .d-summary-toggle,
.designata .d-summary-toggle, .designata .d-model-view-title, .d-config-group-title, .d-how-step { font-weight: 600; letter-spacing: -0.006em; }
.d-report-summary .d-report-verdict { font-weight: 500; font-size: 1.25rem; letter-spacing: -0.006em; }
.d-value, .d-sample-metrics dd { font-weight: 650; }
.d-task-name { font-size: 1.0625rem; }
.d-sample-title { font-size: 1.25rem; }

/* ---- Notes run the width of their column. A 72-character cap broke short notes in wide
   panels into a long line and a stray second line; they now wrap only at the column edge. */
.d-help, .d-group-intro, .d-help-list, .d-report-sub, .d-tripod-lead, .d-performance-note, .d-report-tabs .d-performance-note,
.d-record-fingerprint, .d-task-version-summary, .d-report-summary .d-report-verdict { max-width: none; }

/* ---- My models: two tabs under the heading. */
.d-page-tabs { display: flex; gap: 4px; margin: 4px 0 20px; border-bottom: 1px solid var(--line); }
.d-page-tabs .d-tab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; color: var(--ink); font-weight: 500; }
.d-page-tabs .d-tab[aria-selected="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }
.d-tab-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 0.8125rem; font-weight: 600; text-align: center; }
#requests-panel > .d-help { margin: 0 0 16px; }

/* ---- My models tabs in the same folder style as the report's: a tinted strip, the selected
   tab white with a dark top edge, joined to the white panel below it. */
.d-page-tabs { gap: 2px; margin: 8px 0 0; padding: 10px 16px 0; background: var(--soft); border: 1px solid var(--line);
  border-bottom: 1px solid var(--line); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.d-page-tabs .d-tab { margin-bottom: -1px; padding: 11px 18px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  color: var(--ink); font-weight: 500; }
.d-page-tabs .d-tab:hover { background: rgba(255, 254, 250, 0.7); color: var(--navy); }
.d-page-tabs .d-tab[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: inset 0 3px 0 var(--navy);
  color: var(--navy); font-weight: 600; }
.d-page-tabs .d-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.d-page-tabs .d-tab[aria-selected="true"] .d-tab-count { background: var(--soft); }
#models-panel, #requests-panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card); }
#models-panel .d-record-filter { margin-top: 0; }
#models-panel .d-empty, #requests-panel .d-empty { border-style: dashed; background: #faf9f5; }
#requests-panel { margin-top: 0; }

/* ---- One select style site-wide: the browser's small arrow is replaced by a chevron with
   room around it, in the text colour; hover and focus match the other fields. */
.designata select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23233e54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px; }
.designata select:hover { border-color: #b9bab0; }
.designata select:disabled { cursor: not-allowed; opacity: 0.6; }
.designata select[multiple] { background-image: none; padding-right: 14px; }

/* ---- Evaluation details as a summary list: label left, value right, one fact per row. */
#definition-body .d-task-details-eyebrow { margin-bottom: 8px; }
.d-task-summary { margin: 0; }
.d-task-summary > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.d-task-summary dt { font-size: 0.875rem; font-weight: 600; color: var(--muted); line-height: 1.55; }
.d-task-summary dd { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--ink); }
.d-task-summary dd .d-readable-copy p { margin: 0; font-size: inherit; color: inherit; }
.d-task-summary dd .d-readable-copy p + p { margin-top: 4px; }
#definition-body .d-task-details-heading { margin: 26px 0 4px; font-size: 0.875rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
#definition-body .d-task-version-list dt { display: flex; align-items: center; gap: 8px; }
#definition-body .d-task-version-list dt .d-badge { font-size: 0.75rem; }
.d-task-technical ul { margin: 6px 0 0; padding-left: 18px; }
.d-task-technical li { margin-top: 4px; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
@media (max-width: 520px) { .d-task-summary > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---- Reading guide in the same summary-list form. */
.d-guide-heading { font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.d-guide-lead { margin-top: 2px; font-size: 0.9375rem; color: var(--muted); }
.d-guide-list.d-task-summary { margin-top: 10px; border-top: 1px solid var(--line); }
.d-guide-list.d-task-summary > div { padding: 14px 0; border-top: 0; }
.d-guide-list.d-task-summary dt { color: var(--ink); }
.d-guide-list.d-task-summary dd { margin: 0; color: var(--muted); }
.d-guide-ideal { display: block; margin-top: 4px; font-size: 0.8125rem; font-weight: 500; color: var(--green); }

/* ---- Fewer grey notes in the report: in the overlap check the basis line is dropped (the
   figure says it) and the scope reads as one quiet line under its heading. */
.d-report-checks .d-record-basis { display: none; }
.d-report-checks .d-record-scope { margin-top: 16px; }
.d-report-checks .d-record-scope h4 { display: inline; margin-right: 6px; font-size: var(--text-help); }
.d-report-checks .d-record-scope p { display: inline; margin: 0; }
.d-report-checks .d-record-scope p + p::before { content: " "; }

/* ---- Training patients: two independent checks as two cards, each with a title, a status
   pill, one line on what it does, then its controls. */
.d-check-method { margin: 16px 0 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.d-check-method + .d-check-method { margin-top: 14px; }
.d-check-method-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.d-check-method-head-only { float: right; margin-top: -30px; }
.d-check-method-title { margin: 0; padding: 0; font-size: var(--text-subsection); font-weight: 600; color: var(--ink); }
.d-check-method-status { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.d-check-method-status.is-on { background: var(--green-bg); color: var(--green); }
.d-check-method > .d-help { margin-top: 4px; }
.d-check-method .d-field-label { margin-top: 16px; }
#training-records-source-help { margin-top: 6px; }
.d-method-steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink); font-size: var(--text-body); line-height: 1.55; }
.d-method-steps li + li { margin-top: 4px; }
.d-method-steps .d-textbutton { display: inline; padding: 0; min-height: 0; font-weight: 600; }
.d-upload.d-upload-compact { min-height: 0; padding: 16px; margin-top: 6px; }
.d-check-method .d-actions { margin-top: 16px; }

/* ---- Training patients, locked: a card that says why and offers the way forward. */
.d-locked-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 18px; margin-top: 16px;
  padding: 18px 20px; border: 1px solid #dcc89e; border-radius: 10px; background: var(--wait-bg); }
.d-locked-card[hidden] { display: none; }
.d-locked-icon { width: 22px; height: 22px; color: var(--wait); }
.d-locked-title { margin: 0; font-size: var(--text-body); font-weight: 600; color: var(--ink); }
.d-locked-body { margin: 2px 0 0; font-size: var(--text-help); line-height: 1.5; color: var(--muted); }
.d-locked-action { white-space: nowrap; }
@media (max-width: 640px) { .d-locked-card { grid-template-columns: auto minmax(0, 1fr); } .d-locked-action { grid-column: 1 / -1; } }
/* Once unlocked by a save, the section flashes once. */
@keyframes d-unlocked { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30%, 70% { box-shadow: 0 0 0 4px rgba(47, 94, 75, 0.35); } }
.d-unlocked { animation: d-unlocked 2.2s ease-in-out; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .d-unlocked { animation: none; } }

/* My tasks: researcher-defined tasks (list and definition form). */
.d-tasks-lead { max-width: 64ch; margin: 4px 0 20px; }
.d-task-form .d-group { margin-top: 28px; }
.d-task-form .d-group:first-child { margin-top: 20px; }
.d-task-form input[type="text"], .d-task-form input[type="number"], .d-task-form select { width: 100%; min-height: var(--control-height); }
.d-inline-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 16px; margin-top: 12px; }
.d-field { display: block; }
.d-field .d-field-label { display: block; }
.d-field-narrow { max-width: 320px; margin-top: 16px; }
.d-task-form .d-fieldset { margin-top: 16px; }
.d-task-counts { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }
.d-task-counts .d-subsection-title { margin-top: 0; }
.d-gate-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.d-gate-list li { display: flex; gap: 8px; align-items: center; }
.d-gate-list li.is-ok { color: var(--green); }
.d-gate-list li.is-bad { color: var(--red, #b42318); }
.d-bad-text { color: var(--red, #b42318); }
.d-task-items { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }
.d-task-item { padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }
.d-task-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.d-task-item-head .d-card-title { margin: 0; }
.d-task-item-label { margin: 4px 0 8px; color: var(--muted); font-size: 0.875rem; }
.d-check-method-status.is-bad { background: var(--red-bg, #fef3f2); color: var(--red, #b42318); }
@media (max-width: 640px) { .d-inline-fields { grid-template-columns: 1fr; } }

/* Researcher-defined tasks: the way in from Overview, the form and My tasks. */
.d-own-task { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 20px;
  padding: 18px 20px; border: 1px dashed #c9cabf; border-radius: 8px; background: var(--surface); }
.d-own-task > .d-icon { align-self: start; margin-top: 3px; color: var(--navy); }
.d-own-task-title { margin: 0; font: 600 var(--text-card-title)/1.4 var(--font-ui); color: var(--ink); }
.d-own-task p { margin: 4px 0 0; color: var(--muted); font-size: var(--text-help); line-height: 1.5; max-width: 70ch; }
@media (max-width: 640px) { .d-own-task { grid-template-columns: 24px minmax(0, 1fr); } .d-own-task > .d-secondary { grid-column: 1 / -1; justify-self: start; } }
.d-research-note { margin: 8px 0 12px; padding: 12px 16px; border-left: 3px solid var(--navy); background: var(--surface); }
.d-research-note p { margin: 0 0 4px; }
.d-task-steps { max-width: 72ch; margin: 0 0 24px; padding-left: 1.4em; display: grid; gap: 6px; }
.d-task-steps a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }


/* ---- Cohort builder (My tasks; cohort-builder.js). Wraps at phone width, never scrolls sideways. */
.d-cohort-build { margin-top: 16px; }
.d-builder-scope { margin-bottom: 4px; }
.d-builder { min-width: 0; }
.d-builder-part { margin-top: 24px; padding-top: 4px; min-width: 0; }
.d-builder-part > .d-subsection-title { margin-top: 0; }
.d-builder-part > .d-help { margin-bottom: 8px; }
.d-builder-card { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
.d-builder-card-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 12px; }
.d-builder-card-head > .d-builder-field { flex: 1 1 240px; min-width: 0; }
.d-builder-card-head .d-field-label { margin-top: 0; }
.d-builder-card-title { font-weight: 600; }
.d-builder-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 10px; min-width: 0; }
.d-builder-line > .d-builder-field { flex: 1 1 200px; min-width: 0; }
.d-builder-line > select { flex: 1 1 180px; min-width: 0; }
.d-builder-field .d-field-label { margin: 12px 0 6px; }
.d-builder-number { max-width: 220px; }
.d-builder-indent { margin-left: 32px; }
.d-builder .d-builder-check { margin-top: 10px; }
.d-builder .d-builder-add { margin-top: 12px; }
.d-builder .d-button-row .d-builder-add { margin-top: 0; }
.d-builder-remove { flex: none; }
.d-builder .d-builder-more { margin-top: 12px; }
.d-rule-item { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--line); background: var(--paper); border-radius: 0 6px 6px 0; min-width: 0; }
.d-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.d-range-label { font-size: var(--text-help); font-weight: 600; color: var(--ink); }
.d-range-and { font-size: var(--text-help); color: var(--muted); }
.d-task-form .d-builder .d-range select, .d-task-form .d-builder .d-range input[type="number"] { width: auto; min-width: 0; max-width: 100%; }
.d-task-form .d-builder .d-range input[type="number"] { width: 7.5em; padding: 11px 10px; }
.d-builder input[type="number"] { border: 1px solid #cfd0c6; border-radius: var(--radius-control); background: var(--surface); padding: 11px 14px; font-size: var(--text-body); }

/* Concept sets: chips for chosen concepts, a search box and its results listbox. */
.d-concept-chips { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.d-concept-chip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 8px 12px;
  border: 1px solid #c9cabf; border-radius: 999px; background: var(--soft); min-width: 0; }
.d-concept-chip.is-excluded { background: var(--error-bg); border-color: #efd3cc; }
.d-concept-chip.is-excluded .d-concept-name { text-decoration: line-through; }
.d-concept-chip-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.d-concept-chip-options { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.d-concept-chip-options .d-check { margin-top: 0; font-size: var(--text-help); align-items: center; }
.d-concept-chip-options .d-quiet { min-height: 36px; }
.d-concept-name { font-weight: 600; color: var(--ink); }
.d-concept-meta, .d-concept-source, .d-concept-maps { font-size: var(--text-help); color: var(--muted); overflow-wrap: anywhere; }
.d-concept-maps strong { color: var(--ink); }
.d-concept-added { font-size: var(--text-help); font-weight: 600; color: var(--green); }
.d-concept-empty { margin-top: 8px; }
.d-concept-search { margin-top: 8px; min-width: 0; }
.d-concept-search .d-field-label { margin-top: 12px; }
.d-concept-search-row { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.d-concept-search-row > .d-concept-query { flex: 3 1 240px; min-width: 0; }
.d-task-form .d-concept-search-row > select { flex: 1 1 200px; width: auto; min-width: 0; }
.d-concept-query { min-height: var(--control-height); padding: 11px 14px; border: 1px solid #cfd0c6; border-radius: var(--radius-control);
  background: var(--surface); font-size: var(--text-body); }
.d-concept-quick { margin-top: 8px; }
.d-concept-status { margin-top: 6px; min-height: 1.5em; }
.d-concept-results { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 360px; overflow-y: auto; border: 1px solid #c9cabf;
  border-radius: 8px; background: var(--surface); }
.d-concept-option { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px; cursor: pointer; min-width: 0; }
.d-concept-option + .d-concept-option { margin-top: 2px; }
.d-concept-option:hover, .d-concept-option.is-active { background: var(--soft); box-shadow: inset 3px 0 0 var(--navy); }
.d-concept-option[aria-disabled="true"] { cursor: default; opacity: .7; }

/* Validation and compiler refusals shown on the field. */
.d-builder .is-invalid { border-color: var(--error) !important; }
.d-builder input.is-invalid, .d-builder select.is-invalid { box-shadow: 0 0 0 1px var(--error); }
.d-builder .d-builder-card.is-invalid, .d-builder .d-rule-item.is-invalid, .d-builder .d-range.is-invalid, .d-builder .d-concept-chips.is-invalid,
.d-builder .d-concept-empty.is-invalid { padding: 8px 10px; border: 1px solid var(--error); border-radius: 8px; background: var(--error-bg); }
.d-field-error { flex-basis: 100%; margin: 6px 0; font-size: var(--text-help); font-weight: 600; color: var(--error); }
.d-builder-summary { margin-top: 24px; padding: 14px 16px; border-left: 3px solid var(--navy); background: var(--surface); border-radius: 0 8px 8px 0; }
.d-builder-summary .d-subsection-title { margin-top: 0; }
.d-builder-warnings { margin: 10px 0 0; padding-left: 20px; font-size: var(--text-help); color: var(--wait); }
.d-cohort-actions { margin-top: 16px; }
.d-cohort-edit { margin-top: 8px; }
.d-cohort-unsupported code { font-size: var(--text-help); }
.d-example-note { margin-top: 6px; }
@media (max-width: 640px) {
  .d-builder-card { padding: 12px; }
  .d-builder-indent { margin-left: 0; }
  .d-builder-number { max-width: none; }
  .d-concept-chip { border-radius: 12px; }
}

/* ---- How it works in the hero, each step with what it needs. One number per step; the
   needs are plain rows (item | note) under the step that uses them. */
.d-how-title { margin: 40px 0 0; font: 600 var(--text-body)/1.4 var(--font-ui); color: var(--ink); }
.d-how { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.d-how > li { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.d-how-num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; background: var(--navy);
  color: var(--surface); font: 600 0.8125rem/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.d-how-step { font: 600 var(--text-body)/1.6 var(--font-ui); color: var(--ink); }
.d-how p { margin-top: 2px; font-size: var(--text-help); line-height: 1.5; color: var(--muted); }
.d-how a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.d-how-needs { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.d-how-needs li { display: grid; grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr); column-gap: 14px; font-size: var(--text-help); line-height: 1.5; color: var(--muted); }
.d-how-needs strong { font-weight: 500; color: var(--ink); }
@media (max-width: 640px) {
  .d-how-needs li { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Overview: the example card runs the full height of the left column, its button on
   the bottom line; less space before Evaluations. */
@media (min-width: 901px) {
  .d-hero { align-items: stretch; }
  .d-hero > .d-sample { display: flex; flex-direction: column; }
  /* Spare height goes around the chart, so the figures and button stay together at the bottom. */
  .d-hero > .d-sample > .d-sample-figure { flex: 1 1 auto; display: flex; flex-direction: column; }
  .d-hero > .d-sample > .d-sample-figure > .d-sample-chart { margin-block: auto; padding-block: 8px; }
}
.d-sample .d-sample-verdict { margin-top: 12px; padding-top: 0; border-top: 0; font-size: var(--text-help); line-height: 1.55; color: var(--muted); }
.d-hero-section { padding-bottom: 40px; }
.d-hero-band + .d-section { padding-top: 32px; }

/* ---- Entrance effects (app.js "motion"): only when motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .d-reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d-reveal-delay, 0ms); }
  .d-reveal.is-revealed { opacity: 1; transform: none; }
  .d-words .d-word { display: inline-block; opacity: 0; transform: translateY(.45em); transition: opacity .55s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d-word, 0) * 90ms); }
  .d-words.is-revealed .d-word { opacity: 1; transform: none; }
  .d-sample-chart.is-drawing .d-sample-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: d-draw 1.2s cubic-bezier(.45, 0, .2, 1) .35s forwards; }
  .d-sample-chart.is-drawing .d-sample-fill { opacity: 0; animation: d-fade-in .7s ease 1.3s forwards; }
  .d-sample-chart.is-drawing .d-sample-point { opacity: 0; transform-box: fill-box; transform-origin: center; animation: d-pop .35s cubic-bezier(.2, .9, .3, 1.3) forwards; animation-delay: calc(.35s + var(--d-point, 0) * 1.2s); }
}
@keyframes d-draw { to { stroke-dashoffset: 0; } }
@keyframes d-fade-in { to { opacity: 1; } }
@keyframes d-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }

@media print { .d-reveal, .d-words .d-word { opacity: 1 !important; transform: none !important; } }

/* ---- Step 1's way to a researcher-defined task: a clear secondary action, not a text link. */
.d-how .d-how-cta { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; margin: 2px 0 2px 4px; padding: 0 12px; vertical-align: middle;
  border: 1px solid var(--navy); border-radius: 999px; background: var(--surface); color: var(--navy);
  font-size: var(--text-help); font-weight: 600; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.d-how .d-how-cta .d-icon { width: 16px; height: 16px; }
.d-how .d-how-cta:hover { background: var(--navy); color: var(--surface); }
.d-how .d-how-cta:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.d-task-readiness { margin: 8px 0 0; }
.d-task-version-list dt .d-badge + .d-badge { margin-left: 6px; }

/* ---- A tighter first screen, so the steps and the example fit without scrolling. */
@media (min-width: 901px) {
  .d-hero-section { padding-top: 28px; }
  .d-hero-actions { margin-top: 24px; }
  .d-how-title { margin-top: 28px; }
  .d-how > li { padding: 11px 0; }
  .d-hero > .d-sample { padding: 22px 24px; }
}

/* ---- Down arrow at the foot of the first screen (no "scroll" label). */
.d-scroll-cue { position: fixed; left: 50%; bottom: 4px; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 44px; height: 30px; margin-left: -22px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--navy);
  cursor: pointer; opacity: .8; transition: opacity .35s ease, visibility .35s; }
.d-scroll-cue .d-icon { width: 20px; height: 20px; stroke-width: 2.2; }
.d-scroll-cue .d-icon + .d-icon { margin-top: -13px; }
.d-scroll-cue:hover { opacity: 1; }
.d-scroll-cue:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.d-scroll-cue.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 900px) { .d-scroll-cue { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .d-scroll-cue .d-icon { animation: d-cue 1.6s ease-in-out infinite; }
  .d-scroll-cue .d-icon + .d-icon { animation-delay: .18s; }
}
@keyframes d-cue { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(5px); opacity: 1; } }


/* ---- Patient counts next to concepts in the cohort builder (aggregates from the server). */
.d-concept-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.d-concept-count { font-size: var(--text-help); font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
