/* ============================================================
   INTELLEHEALTH DYNAMIC TEMPLATES STYLESHEET
   Additive layer for the reusable template families 15 to 18.
   Loads after the approved intellehealth.css and the approved
   intellehealth-expansion.css, and never redefines approved
   selectors. Everything here tolerates long names, missing
   fields, and record counts from zero to dozens. Motion is
   transform and opacity only.

   Sections
   01 Test Truth Card component
   02 Truth Card action states
   03 Grade pending and unavailable treatments
   04 Price anatomy
   05 Coverage groups and identity helpers
   06 Provider catalog filter helpers
   07 Reduced motion and print
   ============================================================ */

/* ------------------------------------------------------------
   01 TEST TRUTH CARD COMPONENT
   One canonical responsive card. Export ratios are produced by
   implementation tooling from this same component and are not
   shown to visitors.
   ------------------------------------------------------------ */
.intelle-truthcard {
  border: 1px solid var(--intelle-border);
  border-radius: var(--intelle-radius-md);
  background:
    radial-gradient(130% 90% at 88% -14%, rgba(141, 124, 255, 0.15), transparent 55%),
    var(--intelle-ink-soft);
  color: var(--intelle-canvas);
  padding: 22px;
  display: grid;
  gap: 14px;
  max-width: 560px;
}
.intelle-truthcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.intelle-truthcard__id {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.intelle-truthcard__name {
  margin: 0;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.22;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.intelle-truthcard__provider {
  margin: 3px 0 0;
  color: var(--intelle-muted-dark);
  font-weight: 700;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.intelle-truthcard__grade {
  display: grid;
  justify-items: center;
  gap: 5px;
  flex: none;
}
.intelle-truthcard__score {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--intelle-muted-dark);
  white-space: nowrap;
}
.intelle-truthcard__verdict {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  font-weight: 600;
}
.intelle-truthcard__fit {
  border: 1px solid var(--intelle-border);
  border-left: 4px solid var(--intelle-blue);
  border-radius: var(--intelle-radius-sm);
  background: rgba(23, 27, 37, 0.6);
  padding: 10px 14px;
  display: grid;
  gap: 2px;
}
.intelle-truthcard__fit b {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--intelle-muted-dark);
}
.intelle-truthcard__fit strong { font-size: 1.15rem; font-weight: 800; line-height: 1.1; }
.intelle-truthcard__fit span { font-size: 0.76rem; font-weight: 600; color: var(--intelle-muted-dark); line-height: 1.45; }
.intelle-truthcard__rows { margin: 0; display: grid; gap: 0; }
.intelle-truthcard__rows > div {
  display: grid;
  grid-template-columns: minmax(96px, 30%) 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--intelle-border);
  font-size: 0.9rem;
  line-height: 1.5;
}
.intelle-truthcard__rows dt {
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--intelle-muted-dark);
  padding-top: 2px;
}
.intelle-truthcard__rows dd { margin: 0; overflow-wrap: anywhere; }
.intelle-truthcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--intelle-border);
  padding-top: 12px;
}
.intelle-truthcard__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--intelle-font-wordmark);
  font-weight: 700;
  font-size: 0.95rem;
}
.intelle-truthcard__brand svg { width: 24px; height: 24px; display: block; }
.intelle-truthcard__meta {
  color: var(--intelle-muted-dark);
  font-weight: 700;
  font-size: 0.8rem;
}
.intelle-truthcard__meta a { color: var(--intelle-canvas); font-weight: 800; }
.intelle-truthcard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.intelle-truthcard__actions .intelle-btn { flex: 1 1 auto; }
@media (min-width: 700px) { .intelle-truthcard__actions .intelle-btn { flex: 0 1 auto; } }

/* ------------------------------------------------------------
   02 TRUTH CARD ACTION STATES
   Idle, working, success, and error. State is carried by text,
   shape, and a leading glyph, never color alone.
   ------------------------------------------------------------ */
.intelle-truthcard__action[aria-busy="true"] {
  opacity: 0.75;
  pointer-events: none;
}
.intelle-truthcard__action.is-success {
  border-color: rgba(81, 227, 206, 0.85);
  background: rgba(81, 227, 206, 0.14);
}
.intelle-truthcard__action.is-error {
  border-color: rgba(255, 130, 159, 0.85);
  background: rgba(255, 130, 159, 0.12);
}
.intelle-truthcard__status {
  margin: 0;
  min-height: 1.3em;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--intelle-muted-dark);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.intelle-truthcard__status.is-working::before {
  content: "\\2026";
  font-weight: 800;
}
.intelle-truthcard__status.is-success { color: var(--intelle-canvas); }
.intelle-truthcard__status.is-success::before {
  content: "✓";
  font-weight: 800;
  color: var(--intelle-mint);
}
.intelle-truthcard__status.is-error { color: var(--intelle-canvas); }
.intelle-truthcard__status.is-error::before {
  content: "!";
  font-weight: 800;
  color: var(--intelle-coral);
}

/* Light-surface variant when the card sits on paper sections */
.intelle-truthcard--frame {
  box-shadow: var(--intelle-shadow-card-dark);
}

/* ------------------------------------------------------------
   03 GRADE PENDING AND UNAVAILABLE TREATMENTS
   Never a gray fake letter. Text plus dashed shape.
   ------------------------------------------------------------ */
.intelle-dyn-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  padding: 10px 14px;
  border: 2px dashed var(--intelle-border-light);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--intelle-muted-light);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.intelle-dyn-pending--card {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}
.intelle-on-dark .intelle-dyn-pending,
.intelle-x-section--dark .intelle-dyn-pending,
.intelle-truthcard .intelle-dyn-pending {
  border-color: var(--intelle-border);
  color: var(--intelle-muted-dark);
}
.intelle-grade-module .intelle-dyn-banner--info {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--intelle-border);
  border-left-color: var(--intelle-blue);
  color: var(--intelle-canvas);
}
.intelle-grade-module .intelle-dyn-banner--info p {
  color: inherit;
}
.intelle-grade-module .intelle-test-card__provider a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.intelle-grade-module .intelle-test-card__provider a:hover {
  color: var(--intelle-blue);
}
[data-intelle-results] [data-intelle-test][hidden] {
  display: none !important;
}
.intelle-dyn-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--intelle-border-light);
  border-left: 4px solid var(--intelle-warm);
  border-radius: var(--intelle-radius-sm);
  background: var(--intelle-panel-light);
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.intelle-dyn-banner--info { border-left-color: var(--intelle-blue); }
.intelle-dyn-banner--stop { border-left-color: var(--intelle-coral); }
.intelle-dyn-banner p { margin: 0; font-weight: 600; }
.intelle-dyn-banner strong { font-weight: 800; }

/* ------------------------------------------------------------
   04 PRICE ANATOMY
   ------------------------------------------------------------ */
.intelle-dyn-price { margin: 0; display: grid; gap: 0; }
.intelle-dyn-price > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--intelle-border-light);
  font-size: 0.94rem;
  line-height: 1.5;
}
.intelle-dyn-price > div:first-child { border-top: 0; padding-top: 0; }
.intelle-dyn-price dt { font-weight: 600; }
.intelle-dyn-price dt small { display: block; color: var(--intelle-muted-light); font-weight: 600; font-size: 0.82rem; }
.intelle-dyn-price dd { margin: 0; font-weight: 800; white-space: nowrap; }
.intelle-dyn-price .intelle-dyn-price__total {
  border-top: 2px solid var(--intelle-ink);
  font-size: 1rem;
}
.intelle-dyn-price .intelle-dyn-price__total dt { font-weight: 800; }

/* ------------------------------------------------------------
   05 COVERAGE GROUPS AND IDENTITY HELPERS
   ------------------------------------------------------------ */
/* Long evidence-state labels in article bylines wrap instead of
   forcing the pill wider than small viewports. */
.intelle-article-byline .intelle-x-status {
  white-space: normal;
  line-height: 1.4;
  text-align: left;
}
.intelle-dyn-idline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--intelle-muted-light);
  font-size: 0.88rem;
  font-weight: 700;
}
.intelle-dyn-idline li { display: inline-flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.intelle-dyn-idline li::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--intelle-border-light);
}
.intelle-dyn-cats { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------
   06 PROVIDER CATALOG FILTER HELPERS
   ------------------------------------------------------------ */
.intelle-dyn-count {
  margin: 0;
  color: var(--intelle-muted-light);
  font-weight: 700;
  font-size: 0.88rem;
}

/* ------------------------------------------------------------
   07 REDUCED MOTION AND PRINT
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .intelle-truthcard__action,
  .intelle-truthcard__status { transition: none; }
}
@media print {
  .intelle-truthcard__actions,
  .intelle-truthcard__status { display: none !important; }
  .intelle-truthcard { break-inside: avoid; }
}
/* WordPress integration fixes for dark detail shells. */
.intelle-main > .intelle-section--dark .intelle-breadcrumbs [aria-current="page"] {
  color: var(--intelle-paper);
}

.intelle-main > .intelle-x-hero .intelle-breadcrumbs [aria-current="page"] {
  color: var(--intelle-paper);
}

.intelle-detail-top .intelle-breadcrumbs [aria-current="page"] {
  color: var(--intelle-paper);
}

.intelle-x-panel {
  color: var(--intelle-ink);
}

.intelle-fit-cta .intelle-subtitle {
  color: var(--intelle-ink);
}

@media (max-width: 640px) {
  .intelle-grade-module .intelle-rail__grade-tag {
    display: none;
  }
}
