/* 10-shell.css */
/* 1. Header: case selector no longer outweighs the case title */
html body .hb-app .hb-case-selector .MuiInputBase-root {
  background: var(--hb-surface-container-low, #f3f1f6) !important;
  color: var(--hb-on-surface, #1d1b20) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hb-primary, #6750a4) 35%, transparent);
}
html body .hb-app .hb-case-selector .MuiSelect-select { color: var(--hb-on-surface, #1d1b20) !important; }
html body .hb-app .hb-case-selector .MuiInputLabel-root { color: var(--hb-on-surface-variant, #49454f) !important; }
html body .hb-app .hb-case-selector .MuiSelect-icon,
html body .hb-app .hb-case-selector svg { color: var(--hb-primary, #6750a4) !important; fill: currentColor; }
html body .hb-app .hb-case-selector .MuiOutlinedInput-notchedOutline { border-color: transparent !important; }

/* 2. Case strip: counts read as clickable filters, readable size */
html body .hb-app .hb-case-counts { gap: 6px 8px; font-size: 0.875rem; }
html body .hb-app .hb-case-counts > span { display: none; }          /* dangling "·" separators */
html body .hb-app .hb-case-count {
  min-height: 36px; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--hb-surface, #fff) 70%, transparent);
  box-shadow: inset 0 0 0 1px var(--hb-outline-variant, #cac4d0);
}
html body .hb-app .hb-case-count:hover:not(:disabled) {
  text-decoration: none; box-shadow: inset 0 0 0 1px var(--hb-primary, #6750a4);
}

/* 3. Canonical v2.0: hide the top decision-status banner line above the main content */
html body .hb-app .hb-canvas:has(> .hb-case-strip) { display: flex; flex-direction: column; }
html body .hb-app .hb-canvas:has(> .hb-case-strip) > .hb-case-strip { order: -2; }
html body .hb-app .hb-canvas > .hb-run-id.MuiTypography-root { display: none !important; }

/* 17. Case strip: one compact layout on every view */
html body .hb-app .hb-case-strip.MuiPaper-root {
  display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 4px 20px !important; padding: 10px 20px !important; border-radius: 20px !important; margin-bottom: 16px;
}
html body .hb-app .hb-case-strip .hb-case-title-row { grid-area: 1 / 1; gap: 6px 12px; margin: 0 !important; }
html body .hb-app .hb-case-strip h1.MuiTypography-root { font-size: 1.375rem !important; line-height: 1.3 !important; margin: 0 !important; }
html body .hb-app .hb-case-strip .hb-case-counts { grid-area: 1 / 2; justify-content: flex-end; margin: 0 !important; }
html body .hb-app .hb-case-strip .hb-case-context { grid-area: 1 / 3; margin: 0 !important; }
html body .hb-app .hb-case-strip .hb-case-context > summary { min-height: 40px; padding: 8px 10px; }
html body .hb-app .hb-case-strip .hb-case-context[open] { grid-area: auto / 1 / auto / -1; padding-top: 4px; }
html body .hb-app .hb-case-strip :is(.hb-case-caveat, .hb-case-source-mode) { grid-column: 1 / -1; margin: 0 !important; padding: 4px 0 2px; }
html body .hb-app .hb-case-strip .hb-mobile-jump { grid-column: 1 / -1; }
@media (max-width: 1199px) {
  html body .hb-app .hb-case-strip.MuiPaper-root { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px !important; }
  html body .hb-app .hb-case-strip .hb-case-title-row { grid-column: 1; }
  html body .hb-app .hb-case-strip .hb-case-context { grid-column: 2; grid-row: 1; }
  html body .hb-app .hb-case-strip .hb-case-counts { grid-area: 2 / 1 / auto / -1; justify-content: flex-start; }
}
@media (max-width: 600px) {
  html body .hb-app .hb-case-strip.MuiPaper-root { padding: 8px 12px !important; gap: 0 8px !important; }
  html body .hb-app .hb-case-strip h1.MuiTypography-root { font-size: 1.125rem !important; }
}
/* decision status sits tight under the strip */
html body .hb-app .hb-canvas:has(> .hb-run-id) > .hb-case-strip { margin-bottom: 10px; }

/* 19. Navigation order: patient layer first (Огляд · Перебіг · Дані), then candidate layer (Граф · План · Міркування) */
html body .hb-app .hb-rail ul.MuiList-root { display: flex; flex-direction: column; }
html body .hb-app .hb-rail ul.MuiList-root > span:nth-child(4) { order: 3; }
html body .hb-app .hb-rail ul.MuiList-root > span:nth-child(3) { order: 4; position: relative; margin-top: 14px; }
html body .hb-app .hb-rail ul.MuiList-root > span:nth-child(5) { order: 5; }
html body .hb-app .hb-rail ul.MuiList-root > span:nth-child(6) { order: 6; }
html body .hb-app .hb-rail ul.MuiList-root > span:nth-child(3)::before {
  content: ""; position: absolute; top: -8px; left: 22%; right: 22%; height: 1px; background: var(--hb-outline-variant, #cac4d0);
}
@media (max-width: 760px) {
  html body .hb-app .hb-mobile-nav > :nth-child(4) { order: 3; }
  html body .hb-app .hb-mobile-nav > :nth-child(3) { order: 4; }
  html body .hb-app .hb-mobile-nav > :nth-child(5) { order: 5; }
  html body .hb-app .hb-mobile-nav > :nth-child(6) { order: 6; }
}


/* 20-overview.css */
/* 4. Clinical picture: "Ще" becomes a real, tappable control */
html body .hb-app .hb-clamp__toggle {
  min-height: 36px; padding: 6px 2px; font-size: 0.875rem; font-weight: 650;
  color: var(--hb-primary, #6750a4); text-decoration: underline; text-underline-offset: 0.2em;
}

/* 5. Urgent block: use the full card width at any breakpoint */
html body .hb-app .hb-overview-urgent__list,
html body .hb-app .hb-overview-urgent__step { max-width: none; width: 100%; }
html body .hb-app .hb-overview-urgent__step:only-child { grid-column: 1 / -1; }

/* 6. Hypothesis notes: one quiet block instead of two loose lines */
html body .hb-app .hb-overview-differential .hb-hypothesis-coexistence,
html body .hb-app .hb-overview-differential .hb-hypothesis-order-note {
  margin: 0; font-size: 0.875rem; color: var(--hb-on-surface-variant, #49454f);
}
html body .hb-app .hb-overview-differential .hb-hypothesis-order-note { margin-bottom: 18px; }

/* 7. Hypothesis list: rank badges for ranked items, quieter unranked ones,
      divider aligned with text */
html body .hb-app .hb-overview-differential .hb-hypothesis-layout { counter-reset: hb-rank; }
html body .hb-app .hb-overview-differential .hb-v1-diff__row {
  grid-template-columns: 28px minmax(0, 1fr) 20px !important;
  font-size: 0.95rem; line-height: 1.35;
}
html body .hb-app .hb-overview-differential .hb-v1-diff__row::before {
  content: ""; display: grid !important; place-items: center;
  width: 26px; height: 26px; border-radius: 8px; position: static;
  font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
html body .hb-app .hb-overview-differential .hb-v1-diff__row[data-ranked="true"]::before {
  counter-increment: hb-rank; content: counter(hb-rank);
  background: var(--hb-primary-container, #eaddff); color: var(--hb-on-primary-container, #21005d);
}
html body .hb-app .hb-overview-differential .hb-v1-diff__row[data-ranked="true"][aria-pressed="true"]::before {
  background: var(--hb-primary, #6750a4); color: #fff;
}
html body .hb-app .hb-overview-differential .hb-v1-diff__row[data-ranked="false"]::before {
  content: "–"; color: var(--hb-on-surface-variant, #49454f);
  box-shadow: inset 0 0 0 1px var(--hb-outline-variant, #cac4d0);
}
html body .hb-app .hb-overview-differential .hb-v1-diff__row[data-ranked="false"] .hb-v1-diff__name {
  color: var(--hb-on-surface-variant, #49454f);
}
html body .hb-app .hb-overview-differential .hb-v1-diff__row[aria-pressed="true"] .hb-v1-diff__name {
  color: var(--hb-on-surface, #1d1b20); font-weight: 700;
}
html body .hb-app .hb-overview-differential .hb-hypothesis-option::after { left: 52px; right: 12px; }
/* label the unranked group once */
html body .hb-app .hb-overview-differential
  .hb-hypothesis-option:has(> [data-ranked="true"]) + .hb-hypothesis-option:has(> [data-ranked="false"])::before {
  content: "Check order not established";
  display: block; padding: 14px 12px 4px; font-size: 0.75rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--hb-on-surface-variant, #49454f);
}

/* 8. Detail card: height follows content (no empty white field) */
@media (min-width: 1100px) {
  html body .hb-app .hb-overview-differential .hb-v1-leading.hb-workup-item.MuiCard-root {
    height: auto !important; max-height: none !important; align-self: start; overflow: visible;
  }
  /* list and card are side by side — "jump" links are redundant here */
  html body .hb-app .hb-overview-differential .hb-hypothesis-jump,
  html body .hb-app .hb-overview-differential .hb-hypothesis-return { display: none !important; }
}

/* 9. Other clinical issues: chevron is enough; urgent issue is labelled */
html body .hb-app .hb-clinical-issue__action {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
html body .hb-app .hb-clinical-issue__name { font-size: 0.95rem; }
html body .hb-app .hb-clinical-issue[data-urgent="true"] { border-left: 4px solid #b3261e !important; }
html body .hb-app .hb-clinical-issue__alert { display: inline-flex; align-items: center; gap: 6px; color: #b3261e; }
html body .hb-app .hb-clinical-issue__alert::after {
  content: "Urgent"; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 2px 8px; border-radius: 999px; background: #fde7e5; color: #8c1d18; order: 2;
}
html body .hb-app .hb-clinical-issue__toggle { gap: 10px; }
html body .hb-app .hb-clinical-issue__toggle .hb-clinical-issue__name { flex: 1 1 auto; }
html body .hb-app .hb-clinical-issue__toggle .hb-clinical-issue__alert { order: 2; }
html body .hb-app .hb-clinical-issue__toggle > svg { order: 3; }

/* 10. Mobile */
@media (max-width: 760px) {
  html body .hb-app .hb-mobile-nav .MuiBottomNavigationAction-label,
  html body .hb-app .hb-mobile-nav .MuiBottomNavigationAction-label.Mui-selected {
    overflow-wrap: normal; word-break: normal; white-space: nowrap;
    font-size: 0.66rem; letter-spacing: -0.01em;
  }
  html body .hb-app .hb-mobile-nav .MuiBottomNavigationAction-root { padding-inline: 0; }
  html body .hb-app .hb-case-count { padding: 4px 10px; min-height: 34px; }
  html body .hb-app .hb-overview-differential .hb-hypothesis-option::after { left: 50px; }
}

/* 12. Hypothesis section: drop the two explanatory notes */
html body .hb-app .hb-overview-differential :is(.hb-hypothesis-coexistence, .hb-hypothesis-order-note) { display: none !important; }
html body .hb-app .hb-overview-differential .hb-readiness { margin-bottom: 16px !important; }

/* 13. Hypotheses: list no longer stretches to the detail card height; no group caption */
@media (min-width: 1100px) {
  html body .hb-app .hb-overview-differential .hb-hypothesis-layout {
    grid-template-rows: repeat(var(--hypothesis-count), min-content) 1fr !important; align-content: start !important;
  }
  html body .hb-app .hb-overview-differential .hb-v1-leading.hb-workup-item.MuiCard-root { grid-row: 1 / -1 !important; }
}
html body .hb-app .hb-overview-differential
  .hb-hypothesis-option:has(> [data-ranked="true"]) + .hb-hypothesis-option:has(> [data-ranked="false"])::before { content: none !important; display: none !important; }

/* 24. Premium editorial styling of the leading hypothesis detail card */
html body .hb-app .hb-v1-leading.MuiCard-root {
  background: #ffffff !important;
  border: 1px solid #e7e3f1 !important;
  box-shadow: 0 22px 48px -32px rgba(40, 28, 72, 0.28), 0 1px 3px rgba(31, 26, 43, 0.04) !important;
  border-radius: 24px !important;
  overflow: hidden;
}
html body .hb-app .hb-v1-leading .hb-v1-leading__headline.hb-clinical-brief {
  padding: 28px 30px 24px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbfe 100%) !important;
}
html body .hb-app .hb-v1-leading .hb-workup-title.MuiTypography-root {
  margin: 0 0 16px !important;
  padding-left: 0 !important;
  border-left: 0 !important;
  font-size: 1.44rem !important;
  font-weight: 760 !important;
  line-height: 1.24 !important;
  letter-spacing: -0.028em !important;
  color: #161124 !important;
}

/* Confirmation status row — refined semantic pill */
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact dl {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact dl > div {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact dt {
  margin: 0 !important;
  font-size: 0.7rem !important;
  font-weight: 720 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #7d748e !important;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact dd {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  font-size: 0.81rem !important;
  font-weight: 650 !important;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  background: #f3effb !important;
  color: #47287d !important;
  border: 1px solid #e2d9f5 !important;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact dd::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.78;
  flex: none;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact[data-confirmation="specific_support"] dd {
  background: #e9f7f0 !important; color: #145a40 !important; border-color: #c5e8d6 !important;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact[data-confirmation="conflicting"] dd {
  background: #fdf0f2 !important; color: #9f1239 !important; border-color: #f3cdd4 !important;
}
html body .hb-app .hb-v1-leading .hb-hypothesis-assessment--compact[data-confirmation="insufficient_data"] dd {
  background: #f4f3f7 !important; color: #564f64 !important; border-color: #e3e0ec !important;
}

/* Tactile action callout — "Для уточнення" + signature plum CTA */
html body .hb-app .hb-v1-leading .hb-brief-next {
  grid-column: 1 / -1 !important;
  margin-top: 18px !important;
  padding: 16px 20px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #f8f5fd 0%, #f3f9f6 100%) !important;
  border: 1px solid #e4ddf2 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 22px -18px rgba(64, 42, 108, 0.25) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px 24px !important;
  align-items: center !important;
}
html body .hb-app .hb-v1-leading .hb-brief-next__label {
  grid-column: 1 / -1;
  margin: 0 !important;
  font-size: 0.72rem !important;
  font-weight: 740 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #5c4294 !important;
}
html body .hb-app .hb-v1-leading .hb-brief-next ul {
  grid-column: 1;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: grid;
  gap: 7px;
}
html body .hb-app .hb-v1-leading .hb-brief-next li {
  position: relative;
  padding-left: 16px;
  font-size: 0.91rem !important;
  font-weight: 520 !important;
  line-height: 1.45 !important;
  color: #1f192d !important;
  margin: 0 !important;
}
html body .hb-app .hb-v1-leading .hb-brief-next li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6d4bb3;
  box-shadow: 0 0 0 3px rgba(109, 75, 179, 0.14);
}
html body .hb-app .hb-v1-leading .hb-brief-next [data-testid="brief-plan"] {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: center;
  justify-self: end;
  background: linear-gradient(180deg, #6246a6 0%, #4e338c 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 8px 18px !important;
  min-height: 38px !important;
  font-size: 0.83rem !important;
  font-weight: 650 !important;
  letter-spacing: -0.005em !important;
  text-transform: none !important;
  box-shadow: 0 8px 18px -8px rgba(78, 51, 140, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease !important;
}
html body .hb-app .hb-v1-leading .hb-brief-next [data-testid="brief-plan"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 22px -8px rgba(78, 51, 140, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}
html body .hb-app .hb-v1-leading .hb-brief-counter {
  display: inline-flex !important;
  align-items: center !important;
  align-self: center !important;
  justify-self: end;
  gap: 5px !important;
  padding: 4px 12px !important;
  min-height: 28px !important;
  border-radius: 999px !important;
  background: #fdf2f3 !important;
  border: 1px solid #f4d3d8 !important;
  color: #9f1239 !important;
  font-size: 0.78rem !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease !important;
}
html body .hb-app .hb-v1-leading .hb-brief-counter:hover {
  background: #fce4e7 !important;
  border-color: #eab8c0 !important;
  transform: translateY(-1px);
}
html body .hb-app .hb-v1-leading .hb-brief-counter svg {
  width: 15px;
  height: 15px;
}
@media (max-width: 760px) {
  html body .hb-app .hb-v1-leading .hb-v1-leading__headline.hb-clinical-brief { padding: 20px 16px 18px !important; }
  html body .hb-app .hb-v1-leading .hb-workup-title.MuiTypography-root { font-size: 1.22rem !important; }
  html body .hb-app .hb-v1-leading .hb-brief-counter { justify-self: start !important; margin-top: 6px !important; }
  html body .hb-app .hb-v1-leading .hb-brief-next { grid-template-columns: minmax(0, 1fr) !important; padding: 14px !important; }
  html body .hb-app .hb-v1-leading .hb-brief-next [data-testid="brief-plan"] { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
}


/* 30-evidence.css */
/* 11. Evidence block v2: quiet ledger — short labels, one accent per row */
html body .hb-app .hb-v1-leading .hb-workup-title.MuiTypography-root.MuiTypography-h1 {
  font-size: 1.375rem !important; line-height: 1.3 !important; letter-spacing: -0.01em;
}

/* disclosure title: shorter */
html body .hb-app #hypothesis-evidence > summary .hb-disclosure-summary__label { font-size: 0 !important; }
html body .hb-app #hypothesis-evidence > summary .hb-disclosure-summary__label::after {
  content: "Arguments"; font-size: 0.95rem; font-weight: 650;
}

html body .hb-app .hb-hypothesis-evidence-visible > :is(.hb-item-evidence, .hb-item-neutral) { padding-inline: 24px; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence { display: grid !important; gap: 0 !important; margin: 0 !important; padding-top: 0 !important; }

/* rows */
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute, .hb-item-neutral) {
  display: grid !important; grid-template-columns: 6.5rem minmax(0, 1fr) !important;
  column-gap: 16px !important; row-gap: 0 !important; align-items: baseline !important;
  padding: 14px 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--hb-outline-variant, #cac4d0) 55%, transparent) !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__support { box-shadow: none !important; padding-top: 4px !important; }

/* row labels: short, sentence case, colour = the only accent */
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute, .hb-item-neutral) > .hb-item-heading.MuiTypography-root {
  grid-column: 1; margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important;
  font-size: 0 !important; line-height: 1.4; display: block;
}
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute, .hb-item-neutral) > .hb-item-heading::after {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0; text-transform: none;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__support > .hb-item-heading::after { content: "For"; color: #2e6b4f; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute > .hb-item-heading::after { content: "Against"; color: #9b2a22; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral > .hb-item-heading::after { content: "Neutral"; color: var(--hb-on-surface-variant, #5f5a66); font-weight: 600; }
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-arg-list, .hb-arg__empty) { grid-column: 2; margin: 0 !important; }

/* empty "against": a dash, not a sentence */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute[data-empty="true"] > .hb-item-heading::after { color: var(--hb-on-surface-variant, #5f5a66); font-weight: 600; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__empty { font-size: 0 !important; padding: 0 !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__empty::after {
  content: "not recorded"; font-size: 0.875rem; color: var(--hb-on-surface-variant, #5f5a66);
}

/* argument */
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg-list { display: grid; gap: 12px; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg {
  display: grid !important; gap: 3px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; background: none !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__text { display: block !important; max-width: 70ch; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__text :is(p, strong) {
  display: block; margin: 0 !important; font-size: 0.9375rem !important; line-height: 1.5 !important;
  color: var(--hb-on-surface, #1d1b20); font-weight: 450 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__text strong { font-weight: 550 !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__text strong + p {
  font-size: 0.875rem !important; color: var(--hb-on-surface-variant, #5f5a66);
}

/* meta: tiny grey line; only the source carries colour */
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__meta {
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 0 12px !important; margin: 0 !important; padding: 0 !important;
  font-size: 0.78rem; color: var(--hb-on-surface-variant, #5f5a66);
}
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-arg__chips, .hb-arg__provenance) { display: contents !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__chip {
  background: none !important; border: 0 !important; padding: 0 !important; min-height: 0 !important;
  font-size: 0.78rem !important; font-weight: 500 !important; color: var(--hb-on-surface-variant, #5f5a66) !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__kind[data-kind="pattern_compatibility"] { font-size: 0 !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__kind[data-kind="pattern_compatibility"]::after { content: "non-specific"; font-size: 0.78rem; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral .hb-arg__kind[data-kind="context_only"] { display: none !important; }

html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-arg__source, .hb-arg__more) {
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 4px;
  padding: 2px 0 !important; min-height: 24px !important; min-width: 0 !important;
  display: inline-flex !important; align-items: center; gap: 3px;
  font-size: 0.78rem !important; font-weight: 500 !important; cursor: pointer;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__source { color: var(--hb-primary, #6750a4) !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__more { color: var(--hb-on-surface-variant, #5f5a66) !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__source svg { width: 12px !important; height: 12px !important; opacity: 0.8; }
/* generic "Джерело" label → icon only (accessible name stays) */
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__source[data-generic="true"] > span { display: none; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__source[data-generic="true"] svg { width: 14px !important; height: 14px !important; }
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-arg__source, .hb-arg__more):hover { text-decoration: underline; text-underline-offset: 0.2em; color: var(--hb-primary, #6750a4) !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__details {
  margin-top: 6px; padding: 8px 12px; border-radius: 10px; font-size: 0.85rem;
  background: var(--hb-surface-container-low, #f6f3f8);
}

/* context panel: soft tinted box, short titles, no bullets */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits {
  display: grid !important; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)) !important; gap: 14px 32px !important;
  margin: 8px 0 20px !important; padding: 16px 18px !important; border: 0 !important; border-radius: 14px;
  background: var(--hb-surface-container-low, #f6f4f7) !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits > div { padding: 0 !important; border: 0 !important; background: none !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits .hb-item-heading.MuiTypography-root {
  margin: 0 0 6px !important; padding: 0 !important; background: none !important; font-size: 0 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits .hb-item-heading::after {
  font-size: 0.8125rem; font-weight: 700; color: var(--hb-on-surface, #1d1b20);
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits > div:nth-child(1) .hb-item-heading::after { content: "What to check"; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits > div:nth-child(2) .hb-item-heading::after { content: "Limitations"; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits ul { margin: 0 !important; padding: 0 !important; list-style: none !important; display: grid; gap: 6px; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits li {
  position: relative; padding: 0 0 0 14px !important; margin: 0 !important; font-size: 0.875rem !important; line-height: 1.45 !important;
  color: var(--hb-on-surface-variant, #4a4550);
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 1.5px; background: currentColor; opacity: 0.6;
}

@media (max-width: 760px) {
  html body .hb-app .hb-hypothesis-evidence-visible > :is(.hb-item-evidence, .hb-item-neutral) { padding-inline: 16px; }
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits { margin: 8px 0 16px !important; padding: 14px !important; }
  html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute, .hb-item-neutral) {
    grid-template-columns: minmax(0, 1fr) !important; row-gap: 4px !important;
  }
  html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-arg-list, .hb-arg__empty) { grid-column: 1; }
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute { grid-template-columns: auto minmax(0, 1fr) !important; column-gap: 10px !important; }
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute .hb-arg__empty { grid-column: 2; }
}

/* 11b. "За" / "Проти" as two paired cards; neutral stays a ledger row below */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; padding: 4px 0 12px !important;
}
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) {
  display: flex !important; flex-direction: column; gap: 10px !important; align-items: stretch !important;
  padding: 14px 16px 16px !important; border-radius: 14px !important; min-width: 0;
  box-shadow: inset 0 3px 0 var(--hb-card-accent), inset 0 0 0 1px var(--hb-card-line) !important;
  background: var(--hb-card-bg) !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__support {
  --hb-card-accent: #3c8a64; --hb-card-line: #d3e6da; --hb-card-bg: #f6fbf8;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute {
  --hb-card-accent: #b3261e; --hb-card-line: #f0d6d3; --hb-card-bg: #fdf7f6;
}
/* empty side: dashed, neutral — absence is visible but not alarming */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence > [data-empty="true"] {
  --hb-card-accent: transparent; --hb-card-bg: transparent;
  box-shadow: none !important; outline: 1.5px dashed var(--hb-outline-variant, #cac4d0); outline-offset: -1.5px; justify-content: flex-start;
}
/* card header: label + count */
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) > .hb-item-heading.MuiTypography-root {
  display: flex !important; align-items: center; gap: 8px; padding: 0 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) > .hb-item-heading::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--hb-card-accent) no-repeat center / 12px 12px;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__support > .hb-item-heading::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 2.5v7M2.5 6h7' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute > .hb-item-heading::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6h7' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence > [data-empty="true"] > .hb-item-heading::before {
  background-color: var(--hb-outline-variant, #cac4d0);
}
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) > .hb-item-heading::after {
  font-size: 0.875rem !important; font-weight: 700 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__support > .hb-item-heading[data-count]::after { content: "For · " attr(data-count); }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence__refute > .hb-item-heading[data-count]::after { content: "Against · " attr(data-count); }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence > [data-empty="true"] > .hb-item-heading::after { content: "Against" !important; }
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) :is(.hb-arg-list, .hb-arg__empty) { grid-column: auto !important; }
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) .hb-arg-list { gap: 0 !important; }
html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) .hb-arg + .hb-arg {
  margin-top: 10px !important; padding-top: 10px !important;
  border-top: 1px solid var(--hb-card-line) !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence > [data-empty="true"] .hb-arg__empty::after {
  content: "Not recorded — the case has no refuting data";
}

/* neutral row now opens the ledger under the cards */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral {
  box-shadow: none !important; padding-top: 6px !important;
}

@media (max-width: 760px) {
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  html body .hb-app .hb-hypothesis-evidence-visible :is(.hb-item-evidence__support, .hb-item-evidence__refute) { padding: 12px 14px 14px !important; }
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-evidence > [data-empty="true"] { flex-direction: row; align-items: center !important; flex-wrap: wrap; gap: 6px 10px !important; }
}

/* 11c. "Нейтрально" = grey card, same width as the "За" column */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral {
  display: flex !important; flex-direction: column; gap: 10px !important; align-items: stretch !important;
  width: calc(50% - 6px); box-sizing: border-box !important; min-width: 0; margin: 0 0 4px !important; padding: 14px 16px 16px !important;
  border-radius: 14px !important; border: 0 !important;
  background: #f4f4f6 !important; box-shadow: inset 0 3px 0 #9a99a3, inset 0 0 0 1px #e2e1e6 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral > .hb-item-heading.MuiTypography-root {
  display: flex !important; align-items: center; gap: 8px; padding: 0 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral > .hb-item-heading::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none; background: #8e8d96 no-repeat center / 12px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='1.6' fill='white'/%3E%3C/svg%3E");
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral > .hb-item-heading::after {
  font-size: 0.875rem !important; font-weight: 700 !important; color: #5f5e66 !important;
}
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral > .hb-item-heading[data-count]::after { content: "Neutral · " attr(data-count); }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral .hb-arg-list { grid-column: auto !important; gap: 0 !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral .hb-arg + .hb-arg {
  margin-top: 10px !important; padding-top: 10px !important; border-top: 1px solid #e2e1e6 !important;
}
@media (max-width: 760px) {
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral { width: auto; padding: 12px 14px 14px !important; }
}

/* 14. Neutral card sits under the red "Проти" card */
@media (min-width: 761px) {
  html body .hb-app .hb-hypothesis-evidence-visible .hb-item-neutral { margin-left: calc(50% + 6px) !important; }
}


/* 23. Evidence layout: balanced rows without awkward whitespace when "Проти" is empty.
       - Refuting data present: «За» + «Проти» side-by-side (equal height), «Нейтрально» full width below.
       - Refuting data empty + neutral present: «За» + «Нейтрально» side-by-side (equal height), compact dashed «Проти» strip below.
       - Refuting data empty + no neutral: «За» full width, compact dashed «Проти» strip below.
       «Що перевірити / Обмеження» always spans full width at the bottom. */
@media (min-width: 761px) {
  html body .hb-app #hypothesis-evidence[open]::details-content {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto;
    gap: 12px; align-items: stretch; padding: 4px 0 20px;
  }
  html body .hb-app #hypothesis-evidence .hb-item-evidence { display: contents !important; }
  html body .hb-app #hypothesis-evidence .hb-item-evidence__support { grid-column: 1; grid-row: 1; }
  html body .hb-app #hypothesis-evidence .hb-item-evidence__refute { grid-column: 2; grid-row: 1; }
  html body .hb-app #hypothesis-evidence .hb-item-neutral { grid-column: 1 / -1; grid-row: 2; width: auto !important; margin: 0 !important; }
  html body .hb-app #hypothesis-evidence .hb-item-limits { grid-column: 1 / -1; grid-row: 3; margin: 0 !important; }

  /* Empty "Against" with Neutral present: pair For + Neutral cleanly side-by-side; move empty Against to a compact full-width strip */
  html body .hb-app #hypothesis-evidence[open]:has(.hb-item-evidence__refute[data-empty="true"]):has(.hb-item-neutral) .hb-item-neutral {
    grid-column: 2; grid-row: 1;
  }
  html body .hb-app #hypothesis-evidence[open]:has(.hb-item-evidence__refute[data-empty="true"]):not(:has(.hb-item-neutral)) .hb-item-evidence__support {
    grid-column: 1 / -1; grid-row: 1;
  }
  html body .hb-app #hypothesis-evidence[open] .hb-item-evidence__refute[data-empty="true"] {
    grid-column: 1 / -1; grid-row: 2;
    flex-direction: row !important; align-items: center !important; flex-wrap: wrap;
    gap: 6px 12px !important; padding: 10px 16px !important;
  }
}
/* limits: headings and lists start at the top of each column */
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits > div { display: block !important; align-self: start !important; }
html body .hb-app .hb-hypothesis-evidence-visible .hb-item-limits ul { align-content: start !important; }
/* meta line: «Деталі» stays on the same line as the source */
html body .hb-app .hb-hypothesis-evidence-visible .hb-arg__meta { row-gap: 2px !important; }

/* 40-history.css */
/* 15. Calendar: hide empty months */
html body .hb-app .hb-time-workspace button[data-month][data-count="0"] { display: none !important; }

/* 16. Journey (Хронологія) */
html.hbj-on body .hb-app .hb-time-workspace { display: none !important; }
html body .hb-app .hbj {
  background: var(--hb-surface, #fffbfe); border-radius: 24px; padding: 24px 28px 20px; margin-bottom: 20px;
  box-shadow: 0 12px 28px -20px rgba(64, 46, 91, .35), 0 0 0 1px rgba(65, 51, 83, .05);
  color: var(--hb-on-surface, #1d1b20);
}
html:not(.hbj-on) body .hb-app #hb-journey { display: none; }
.hbj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hbj-head h2 { margin: 0; font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; }
.hbj-head p { margin: 4px 0 0; font-size: 0.8125rem; color: var(--hb-on-surface-variant, #5f5a66); font-variant-numeric: tabular-nums; }
.hbj-switch { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--hb-surface-container, #f3edf7); }
.hbj-switch button, .hbj-back {
  font: inherit; font-size: 0.8125rem; font-weight: 600; border: 0; background: none; color: var(--hb-on-surface-variant, #5f5a66);
  padding: 7px 14px; border-radius: 9px; cursor: pointer; min-height: 34px;
}
.hbj-switch button[aria-pressed="true"] { background: #fff; color: var(--hb-on-surface, #1d1b20); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.hbj-back { background: var(--hb-surface-container, #f3edf7); margin: 0 0 12px; }
html.hbj-on .hbj-back { display: none; }
.hbj-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 8px; }
.hbj-chip {
  font: inherit; font-size: 0.8125rem; font-weight: 550; cursor: pointer; min-height: 32px;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  border: 0; background: none; box-shadow: inset 0 0 0 1px var(--hb-outline-variant, #cac4d0); color: var(--hb-on-surface, #1d1b20);
}
.hbj-chip b { font-weight: 650; color: var(--hb-on-surface-variant, #5f5a66); font-variant-numeric: tabular-nums; }
.hbj-chip.is-on { background: var(--hb-primary, #6750a4); color: #fff; box-shadow: none; }
.hbj-chip.is-on b { color: rgba(255,255,255,.85); }
.hbj-chip:focus-visible, .hbj-switch button:focus-visible, .hbj-open:focus-visible, .hbj-back:focus-visible { outline: 2px solid var(--hb-primary, #6750a4); outline-offset: 2px; }

.hbj-year { margin-top: 18px; }
.hbj-year > h3 {
  margin: 0 0 10px; font-size: 0.9375rem; font-weight: 700; color: var(--hb-primary, #6750a4);
  font-variant-numeric: tabular-nums;
  display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--hb-surface-container, #f3edf7);
}
.hbj-year ol { list-style: none; margin: 0; padding: 0; }
.hbj-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 20px; padding-bottom: 14px; }
.hbj-when { position: relative; padding: 14px 24px 0 0; text-align: right; }
.hbj-when time { display: block; font-size: 0.9375rem; font-weight: 650; color: var(--hb-on-surface, #1d1b20); font-variant-numeric: tabular-nums; }
.hbj-when small { display: block; font-size: 0.6875rem; color: var(--hb-on-surface-variant, #5f5a66); line-height: 1.3; margin-top: 2px; }
.hbj-when::after { content: ""; position: absolute; top: 24px; bottom: -22px; right: 4px; width: 1px; background: var(--hb-outline-variant, #cac4d0); }
.hbj-year li:last-child .hbj-when::after { display: none; }
.hbj-node { position: absolute; top: 18px; right: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--hb-primary, #6750a4); z-index: 1; }
.hbj-row.is-doc .hbj-node { background: var(--hb-surface, #fff); box-shadow: inset 0 0 0 1.5px var(--hb-primary, #6750a4); }
.hbj-row.is-doc .hbj-when time { color: var(--hb-on-surface-variant, #5f5a66); font-weight: 600; }

.hbj-stack { display: grid; gap: 8px; min-width: 0; }
.hbj-card {
  --tone: #6750a4; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start;
  background: var(--hb-surface-container-low, #f7f2fa); border-radius: 14px; padding: 14px 18px;
  box-shadow: inset 3px 0 0 var(--tone);
}
.hbj-lab { --tone: #3c8a64; } .hbj-img { --tone: #b4536f; } .hbj-path { --tone: #7a5aa8; } .hbj-cons { --tone: #b07d1a; } .hbj-other { --tone: #8e8d96; }
.hbj-card__main { min-width: 0; display: grid; gap: 3px; }
.hbj-tag { font-size: 0.72rem; font-weight: 700; color: var(--tone); letter-spacing: 0.01em; }
.hbj-card h4 { margin: 0; font-size: 0.9375rem; font-weight: 650; line-height: 1.4; }
.hbj-card p { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--hb-on-surface-variant, #4a4550); max-width: 90ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hbj-card small { font-size: 0.75rem; color: var(--hb-on-surface-variant, #5f5a66); font-variant-numeric: tabular-nums; }
.hbj-open {
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--hb-primary, #6750a4); background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 4px; min-height: 32px; border-radius: 8px; white-space: nowrap;
}
.hbj-open svg { width: 14px; height: 14px; }
.hbj-open:hover { background: color-mix(in srgb, var(--hb-primary, #6750a4) 8%, transparent); }
.hbj-note, .hbj-empty { margin: 14px 0 0; font-size: 0.75rem; color: var(--hb-on-surface-variant, #5f5a66); }

@media (max-width: 760px) {
  html body .hb-app .hbj { padding: 18px 16px 16px; border-radius: 20px; }
  .hbj-row { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; }
  .hbj-when { padding-right: 16px; }
  .hbj-when time { font-size: 0.875rem; }
  .hbj-card { grid-template-columns: 1fr; padding: 12px 14px; }
  .hbj-open { justify-self: start; padding-left: 0; }
}


/* 46-trends.css */
/* Canonical Trends & Longitudinal Dynamics view — calm Swiss-clean clinical layout (HematoBoard v2.0) */
html.hbtr-on body .hb-app .hb-time-workspace,
html.hbtr-on body .hb-app #hb-timesets,
html.hbtr-on body .hb-app #hb-journey { display: none !important; }
html:not(.hbtr-on) body .hb-app #hb-trends { display: none; }

.hbtr-root {
  background: #ffffff;
  border-radius: 26px;
  border: 1px solid #e6e3ee;
  box-shadow: 0 18px 40px -28px rgba(45, 36, 74, 0.22);
  padding: 22px 26px 26px;
  margin-bottom: 18px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  color: #1f1a2b;
  font-variant-numeric: tabular-nums;
}

.hbtr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 16px;
}
.hbtr-head h2 { margin: 0; font-size: 1.35rem; font-weight: 750; letter-spacing: -0.025em; color: #1f1a2b; line-height: 1.25; }
.hbtr-head p { margin: 4px 0 0; font-size: 0.84rem; color: #676074; }

/* Domain sub-navigation (only for multi-domain cases like CASE030) */
.hbtr-domain-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ede9f5;
}
.hbtr-dtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 630;
  color: #3d364d;
  background: #f3f2f7;
  border: 1px solid #e1deea;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}
.hbtr-dtab b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 680;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(31, 26, 43, 0.07);
  color: #554e66;
}
.hbtr-dtab:hover { background: #e9e6f3; border-color: #cfc8df; color: #201830; }
.hbtr-dtab.is-on {
  background: linear-gradient(180deg, #f3edfc 0%, #ebe2fa 100%);
  border-color: #c7b4ec;
  color: #47287d;
  box-shadow: 0 3px 10px -6px rgba(71, 40, 125, 0.38);
}
.hbtr-dtab.is-on b { background: rgba(71, 40, 125, 0.12); color: #47287d; }

/* Focus Highlights — open editorial 2-card overview (no nested outer box) */
.hbtr-focus {
  margin-bottom: 26px;
}
.hbtr-focus-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 14px;
}
.hbtr-focus-head h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 740;
  letter-spacing: -0.02em;
  color: #191326;
}
.hbtr-focus-head p {
  margin: 0;
  font-size: 0.76rem;
  color: #777086;
}
.hbtr-focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 16px;
  align-items: stretch;
}
.hbtr-focus-col {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbfe 100%);
  border: 1px solid #e6e0f0;
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow: 0 14px 32px -24px rgba(45, 32, 74, 0.24), 0 1px 2px rgba(45, 32, 74, 0.04);
}
.hbtr-fcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.hbtr-fcard-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 740;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b526d;
}
.hbtr-fcard-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6d4bb3;
  box-shadow: 0 0 0 3px rgba(109, 75, 179, 0.14);
}
.hbtr-focus-col.is-img .hbtr-fcard-eyebrow i {
  background: #b53453;
  box-shadow: 0 0 0 3px rgba(181, 52, 83, 0.14);
}
.hbtr-fcard-dates {
  font-size: 0.72rem;
  font-weight: 620;
  color: #625a73;
  background: #f4f2f9;
  border: 1px solid #e8e3f2;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.hbtr-fcard-kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 11px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f7f4fc 0%, #faf8fd 100%);
  border: 1px solid #e8e0f4;
}
.hbtr-fcard-kpi strong {
  font-size: 1.24rem;
  font-weight: 770;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: #4a2a82;
}
.hbtr-fcard-kpi span {
  font-size: 0.8rem;
  font-weight: 520;
  color: #514a61;
}
.hbtr-focus-col.is-img .hbtr-fcard-kpi {
  background: linear-gradient(135deg, #fdf4f6 0%, #fbf7fa 100%);
  border-color: #f1d9e0;
}
.hbtr-focus-col.is-img .hbtr-fcard-kpi strong {
  color: #93213e;
}

.hbtr-focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.hbtr-focus-list li {
  border-bottom: 1px solid #f1edf8;
}
.hbtr-focus-list li:last-child {
  border-bottom: 0;
}
.hbtr-fitem {
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
  padding: 9px 10px;
  margin: 0 -10px;
  width: calc(100% + 20px);
  border-radius: 12px;
  transition: background-color 0.14s ease;
}
.hbtr-fitem-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: transform 0.14s ease;
}
.hbtr-fitem-ico svg {
  width: 12px;
  height: 12px;
  display: block;
}
.hbtr-fitem-ico.is-up {
  background: #fdf0f3;
  border: 1px solid #f4cad3;
  color: #be123c;
}
.hbtr-fitem-ico.is-down {
  background: #edf4ff;
  border: 1px solid #c5dbfc;
  color: #1d4ed8;
}
.hbtr-fitem-ico.is-flat {
  background: #f4f3f8;
  border: 1px solid #e2dfec;
  color: #6b647a;
}
.hbtr-fitem:hover .hbtr-fitem-ico {
  transform: scale(1.06);
}
.hbtr-fitem:hover {
  background: #f7f4fc;
}
.hbtr-fitem:hover .hbtr-fitem-name {
  color: #4b2b85;
}
.hbtr-fitem:focus-visible {
  outline: 2px solid #6750a4;
  outline-offset: -1px;
}
.hbtr-fitem-left {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.hbtr-fitem-name {
  font-size: 0.86rem;
  font-weight: 670;
  color: #1c162a;
  line-height: 1.3;
  transition: color 0.14s ease;
}
.hbtr-fitem-traj {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-size: 0.8rem;
  line-height: 1.3;
}
.hbtr-fitem-from {
  color: #777087;
  font-weight: 540;
}
.hbtr-fitem-arr {
  color: #a9a1ba;
  font-size: 0.76rem;
}
.hbtr-fitem-to {
  color: #1e182d;
  font-weight: 710;
}
.hbtr-fitem-traj small {
  font-size: 0.72rem;
  color: #827b92;
  font-weight: 500;
}
.hbtr-fitem-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  flex-shrink: 0;
}
.hbtr-fitem-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.81rem;
  font-weight: 720;
  color: #211a30;
  white-space: nowrap;
}
.hbtr-fitem-delta i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
}
.hbtr-fitem-delta svg {
  width: 11px;
  height: 11px;
  display: block;
}
.hbtr-fitem-delta.is-up { color: #a31637; }
.hbtr-fitem-delta.is-down { color: #1d4ed8; }
.hbtr-fitem-delta.is-flat { color: #6c647a; }
.hbtr-badge.is-region {
  background: #f3f1f8;
  color: #635b75;
  border: 1px solid #e7e3f1;
}

.hbtr-fcard-foot {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #f0ecf7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
}
.hbtr-fcard-cta, .hbtr-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d4c4f0;
  background: linear-gradient(180deg, #f8f5fe 0%, #efe8fb 100%);
  padding: 5px 13px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.79rem;
  font-weight: 670;
  color: #46257c;
  box-shadow: 0 2px 6px -4px rgba(71, 40, 125, 0.3);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}
.hbtr-fcard-cta:hover, .hbtr-more-btn:hover {
  background: linear-gradient(180deg, #f2ebfd 0%, #e6daf9 100%);
  border-color: #bfa8e8;
  box-shadow: 0 4px 10px -5px rgba(71, 40, 125, 0.38);
  transform: translateY(-1px);
  text-decoration: none;
}
.hbtr-fcard-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #f2cfd6;
  background: #fdf2f4;
  color: #9f1239;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 660;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.hbtr-fcard-pill:hover {
  background: #fce4e8;
  border-color: #e9b6c0;
}
.hbtr-focus-warn {
  border: 1px solid #efd085;
  background: #fffbeb;
  color: #92400e;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 660;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.hbtr-focus-warn:hover { background: #fef3c7; border-color: #e4bc5a; }

/* Sections */
.hbtr-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #efecf5; }
.hbtr-pane > .hbtr-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hbtr-sec-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 10px 16px; margin-bottom: 14px;
}
.hbtr-sec-title-wrap {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.hbtr-sec-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.hbtr-sec-head h3 { margin: 0; font-size: 1.04rem; font-weight: 740; letter-spacing: -0.02em; color: #191326; }
.hbtr-sec-head p { margin: 2px 0 0; font-size: 0.79rem; color: #6c657a; }
.hbtr-sec-title-wrap p { margin: 0; }
.hbtr-sec-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* Legend & Hero cards */
.hbtr-legend { display: inline-flex; flex-wrap: wrap; gap: 12px; font-size: 0.74rem; color: #6c6578; }
.hbtr-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hbtr-legend i { display: inline-block; width: 12px; height: 6px; border-radius: 3px; }
.hbtr-legend i.is-first { background: #aca0c6; }
.hbtr-legend i.is-last { background: #523185; }
.hbtr-legend i.is-ref { background: #d4eee0; border: 1px solid #95cab2; }

.hbtr-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.hbtr-hero.is-flat { grid-template-columns: 1fr; }
.hbtr-hero.is-flat .hbtr-group-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px;
}
.hbtr-group {
  background: #faf9fd;
  border: 1px solid #ece7f4;
  border-radius: 16px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.hbtr-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hbtr-group-head h4 { margin: 0; font-size: 0.84rem; font-weight: 710; color: #2b213e; }
.hbtr-group-head span { font-size: 0.73rem; color: #756e82; }
.hbtr-group-cards { display: grid; gap: 9px; }
.hbtr-card {
  background: #ffffff;
  border: 1px solid #ebe6f3;
  border-radius: 13px;
  padding: 11px 13px;
  display: grid;
  gap: 7px;
}
.hbtr-card-top h5 { margin: 0; font-size: 0.85rem; font-weight: 680; color: #1f1a2b; }
.hbtr-card-meta { margin: 2px 0 0; font-size: 0.72rem; color: #746d80; }
.hbtr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.hbtr-jump {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 680; color: #261d3a;
  cursor: pointer; text-align: left;
}
.hbtr-jump:hover { color: #523185; text-decoration: underline; }

/* Zero-based comparison bars & Sparklines */
.hbtr-pair { display: grid; gap: 5px; width: 100%; }
.hbtr-pair.is-compact { gap: 3px; max-width: 120px; }
.hbtr-lane { display: grid; grid-template-columns: 36px 56px minmax(0, 1fr); gap: 7px; align-items: center; }
.hbtr-pair.is-compact .hbtr-lane { grid-template-columns: minmax(0, 1fr); }
.hbtr-lane[role="button"] { cursor: pointer; border-radius: 6px; padding: 1px 2px; margin: -1px -2px; }
.hbtr-lane[role="button"]:hover { background: #f4f1fa; }
.hbtr-lane time { font-size: 0.71rem; color: #736c80; }
.hbtr-lane-val { font-size: 0.79rem; font-weight: 700; color: #1f1a2b; text-align: right; }
.hbtr-lane.is-out .hbtr-lane-val { color: #9f1239; }
.hbtr-track {
  position: relative; display: block; height: 9px;
  background: #f2eff8; border-radius: 999px; overflow: hidden;
}
.hbtr-pair.is-compact .hbtr-track { height: 6px; }
.hbtr-ref-band {
  position: absolute; top: 0; bottom: 0;
  background: #d2eedf; border-left: 1px solid #8ec8a8; border-right: 1px solid #8ec8a8;
}
.hbtr-ref-band.is-limit { width: 2px !important; background: #8ec8a8; border: 0; }
.hbtr-fill { position: relative; z-index: 1; display: block; height: 100%; border-radius: 999px; background: #a89cc2; }
.hbtr-lane.is-last .hbtr-fill { background: #523185; }
.hbtr-lane.is-last.is-out .hbtr-fill { background: #be2b44; }
.hbtr-lane.is-img-bar .hbtr-fill { background: #b83c5c; }
.hbtr-fill.is-zero { width: 3px !important; opacity: 0.45; }
.hbtr-scale {
  display: flex; justify-content: space-between; font-size: 0.68rem; color: #837c90;
  padding-left: 99px;
}

.hbtr-spark svg { width: 100%; height: auto; display: block; }
.hbtr-spark.is-compact svg { max-width: 120px; }
.hbtr-dot.is-click { cursor: pointer; }
.hbtr-one-pt { font-size: 0.73rem; color: #8a8396; }

/* Directional delta markers & range badges */
.hbtr-delta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.79rem; font-weight: 660; color: #241d31; }
.hbtr-delta.is-quiet { color: #857e91; font-weight: 500; }
.hbtr-delta-val { display: inline-flex; align-items: center; gap: 5px; }
.hbtr-delta-val.is-up { color: #a31637; }
.hbtr-delta-val.is-down { color: #1d4ed8; }
.hbtr-delta-val.is-return { color: #145a40; }
.hbtr-delta-val.is-flat { color: #746d82; }
.hbtr-dir-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: none;
}
.hbtr-dir-ico svg { width: 10px; height: 10px; display: block; }
.hbtr-dir-ico.is-up { background: #fdecef; border: 1px solid #f4c4ce; color: #be123c; }
.hbtr-dir-ico.is-down { background: #ebf3ff; border: 1px solid #bfd7fc; color: #1d4ed8; }
.hbtr-dir-ico.is-return { background: #e6f7ef; border: 1px solid #b5e3cc; color: #145a40; }
.hbtr-dir-ico.is-flat { background: #f3f2f7; border: 1px solid #e1deec; color: #746d82; }
.hbtr-arrow { font-weight: 750; font-size: 0.76rem; }
.hbtr-arrow.is-up { color: #be123c; }
.hbtr-arrow.is-down { color: #1d4ed8; }
.hbtr-badge {
  display: inline-flex; align-items: center; font-size: 0.69rem; font-weight: 650;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.hbtr-badge.is-warn { background: #fdf0f2; color: #9f1239; }
.hbtr-badge.is-return { background: #e8f6ef; color: #145a40; }
.hbtr-badge.is-near { background: #f0ecf8; color: #523185; }
.hbtr-badge.is-conflict { background: #fef3c7; color: #92400e; }

/* Calm unified hairline table */
.hbtr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.hbtr-bar .hbj-filters { margin: 0; }
.hbtr-bar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hbtr-select, .hbtr-search {
  font: inherit; font-size: 0.8rem; padding: 5px 11px; border-radius: 999px;
  border: 1px solid #dad5e5; background: #faf9fc; color: #1f1a2b; min-height: 32px;
}
.hbtr-search { min-width: 175px; }
.hbtr-search:focus, .hbtr-select:focus { outline: 2px solid #6750a4; outline-offset: 1px; background: #fff; }
.hbtr-shown { margin: 2px 0 0; font-size: 0.76rem; color: #756e82; }

.hbtr-sheet {
  border: 1px solid #ebe7f3;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}
.hbtr-cols, .hbtr-row > summary {
  display: grid;
  grid-template-columns: minmax(190px, 1.9fr) minmax(84px, 0.72fr) minmax(84px, 0.72fr) minmax(150px, 1.2fr) minmax(108px, 0.9fr);
  gap: 8px 12px;
  align-items: center;
}
.hbtr-cols {
  padding: 9px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #70697d;
  background: #faf9fd;
  border-bottom: 1px solid #ebe7f3;
}
.hbtr-list { display: block; }
.hbtr-row {
  border-bottom: 1px solid #f1eef7;
  transition: background-color 0.12s ease;
}
.hbtr-row:last-child { border-bottom: 0; }
.hbtr-row:hover { background: #fcfbfe; }
.hbtr-row[open] { background: #faf9fd; }
.hbtr-row.is-conflict { background: #fffdf5; }
.hbtr-row.is-flash { box-shadow: inset 3px 0 0 #6750a4; background: #f6f2fc; }
.hbtr-row > summary { padding: 10px 16px; cursor: pointer; list-style: none; }
.hbtr-row > summary::-webkit-details-marker { display: none; }
.hbtr-r-name { display: grid; gap: 1px; min-width: 0; }
.hbtr-r-name strong { font-size: 0.84rem; font-weight: 650; color: #1f1a2b; line-height: 1.3; }
.hbtr-r-name small { font-size: 0.72rem; color: #787185; }
.hbtr-r-val { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.hbtr-r-val b { font-size: 0.85rem; font-weight: 680; color: #1f1a2b; display: inline-flex; align-items: baseline; gap: 3px; }
.hbtr-r-val.is-out b { color: #9f1239; }
.hbtr-r-val b i { font-style: normal; font-size: 0.72rem; opacity: 0.78; }
.hbtr-r-date { font-size: 0.69rem; color: #837c90; }
.hbtr-miss { color: #a8a2b4; }

.hbtr-row-detail {
  padding: 10px 16px 14px;
  border-top: 1px dashed #e9e4f2;
  background: #ffffff;
  display: grid;
  gap: 10px;
}
.hbtr-row-detail-plot { max-width: 380px; }
.hbtr-row-ref { margin: 0; font-size: 0.79rem; color: #544d61; }
.hbtr-pt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.hbtr-pt-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: 0.79rem; color: #362f42; padding: 5px 10px; border-radius: 9px; background: #faf9fd;
}
.hbtr-pt-list time { color: #676074; min-width: 92px; }
.hbtr-pt-st { font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; background: #e8f6ef; color: #145a40; font-weight: 640; }
.hbtr-pt-st.is-out { background: #fdf0f2; color: #9f1239; }
.hbtr-open-ev {
  border: 0; background: #f0ebf9; color: #4c2d82; font: inherit; font-size: 0.75rem; font-weight: 660;
  padding: 4px 10px; border-radius: 999px; cursor: pointer; margin-left: auto;
}
.hbtr-open-ev:hover { background: #e4dbf6; }
.hbtr-ev-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hbtr-ev-actions .hbtr-open-ev { margin-left: 0; }

/* Imaging completeness strip & conflicts */
.hbtr-strip { display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.hbtr-cell { width: 10px; height: 16px; border-radius: 3px; border: 0; padding: 0; cursor: pointer; }
.hbtr-cell.is-matched { background: #d5c9ec; }
.hbtr-cell.is-matched:hover { background: #6750a4; }
.hbtr-cell.is-conflict {
  background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 3px, #fef3c7 3px, #fef3c7 6px);
  box-shadow: inset 0 0 0 1px #b45309;
}
.hbtr-conflict-pill {
  display: inline-block; font-size: 0.7rem; font-weight: 650; color: #92400e;
  background: #fef3c7; padding: 2px 7px; border-radius: 999px;
}

.hbtr-conflicts {
  background: #fffdf5;
  border: 1px solid #f2d590;
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 12px;
}
.hbtr-conflicts h4 { margin: 0; font-size: 0.87rem; font-weight: 720; color: #92400e; }
.hbtr-conflicts > p { margin: 3px 0 10px; font-size: 0.78rem; color: #78350f; }
.hbtr-conflict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
.hbtr-conflict-card { background: #ffffff; border: 1px solid #f3dc9f; border-radius: 11px; padding: 11px 13px; }
.hbtr-conflict-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.hbtr-conflict-top h5 { margin: 0; font-size: 0.84rem; font-weight: 700; color: #1f1a2b; }
.hbtr-conflict-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; }
.hbtr-conflict-dl div { background: #faf9fd; border-radius: 8px; padding: 6px 8px; }
.hbtr-conflict-dl div.is-warn { background: #fef3c7; }
.hbtr-conflict-dl dt { font-size: 0.67rem; color: #6c6478; margin-bottom: 2px; }
.hbtr-conflict-dl dd { margin: 0; font-size: 0.8rem; font-weight: 710; color: #1f1a2b; }

.hbtr-img-notes, .hbtr-notes {
  margin-top: 14px;
  background: #faf9fd;
  border: 1px solid #ece7f4;
  border-radius: 14px;
  padding: 13px 15px;
}
.hbtr-img-notes h4, .hbtr-notes h4 { margin: 0 0 8px; font-size: 0.85rem; font-weight: 710; color: #2b213e; }
.hbtr-img-notes dl { margin: 0; display: grid; gap: 7px; }
.hbtr-img-notes dt { font-size: 0.78rem; font-weight: 690; color: #4b2d82; }
.hbtr-img-notes dd { margin: 1px 0 0; font-size: 0.8rem; color: #3a3347; line-height: 1.45; }
.hbtr-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 0.8rem; color: #3a3347; line-height: 1.45; }

/* Molecular / NGS */
.hbtr-ngs-context { margin: 0 0 11px; font-size: 0.8rem; color: #463e54; background: #faf9fd; border: 1px solid #ece8f4; padding: 8px 12px; border-radius: 11px; }
.hbtr-ngs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 9px;
  margin-bottom: 11px;
}
.hbtr-ngs-card {
  border-radius: 13px;
  padding: 11px 13px;
  border: 1px solid #ebe6f3;
  background: #ffffff;
  display: grid;
  gap: 3px;
}
.hbtr-ngs-card.is-high { background: #fef9fa; border-color: #eed0d8; }
.hbtr-ngs-card.is-vus { background: #fffef7; border-color: #f0e1ae; }
.hbtr-ngs-gene { font-size: 0.72rem; font-weight: 750; letter-spacing: 0.03em; color: #523185; text-transform: uppercase; }
.hbtr-ngs-card.is-high .hbtr-ngs-gene { color: #852840; }
.hbtr-ngs-card.is-vus .hbtr-ngs-gene { color: #92400e; }
.hbtr-ngs-card strong { font-size: 0.84rem; font-weight: 690; color: #1f1a2b; line-height: 1.35; }
.hbtr-ngs-card p { margin: 0; font-size: 0.74rem; color: #676074; line-height: 1.4; }

.hbtr-ngs-tech {
  background: #faf9fd; border: 1px solid #ece7f4; border-radius: 13px; padding: 9px 13px; font-size: 0.8rem;
}
.hbtr-ngs-tech summary { cursor: pointer; font-weight: 660; color: #362853; }
.hbtr-ngs-dl {
  margin: 9px 0 7px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 7px 14px;
}
.hbtr-ngs-dl dt { font-size: 0.7rem; color: #746d80; }
.hbtr-ngs-dl dd { margin: 1px 0 0; font-size: 0.78rem; font-weight: 610; color: #1f1a2b; }
.hbtr-ngs-caveat { margin: 8px 0 0; font-size: 0.77rem; color: #78350f; background: #fffdf5; padding: 7px 10px; border-radius: 9px; border: 1px solid #f2d590; }

.hbtr-empty { text-align: center; padding: 28px 16px; color: #676074; font-size: 0.87rem; }
.hbtr-back-btn {
  margin-top: 10px; border: 0; background: #6750a4; color: #fff; font: inherit; font-size: 0.81rem; font-weight: 650;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}

@media (max-width: 820px) {
  .hbtr-root { padding: 16px 14px 18px; border-radius: 20px; }
  .hbtr-focus-col { padding: 15px 15px 14px; border-radius: 17px; }
  .hbtr-cols { display: none; }
  .hbtr-row > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 10px 12px; }
  .hbtr-r-name { grid-column: 1 / -1; }
  .hbtr-r-plot { grid-column: 1 / -1; }
  .hbtr-conflict-dl { grid-template-columns: 1fr; }
  .hbtr-scale { padding-left: 0; }
}
@media (max-width: 520px) {
  .hbtr-fitem { grid-template-columns: 22px minmax(0, 1fr); gap: 5px 9px; padding: 9px 8px; margin: 0 -8px; width: calc(100% + 16px); align-items: start; }
  .hbtr-fitem-ico { width: 22px; height: 22px; margin-top: 1px; }
  .hbtr-fitem-right { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; }
}

/* 50-supports.css */
/* 18. Джерельні опори (reasoning view) */
html.hbs-on body .hb-app .hb-reasoning-log__main > :not(#hb-supports),
html.hbs-on body .hb-app nav.hb-reasoning-toc { display: none !important; }
html.hbs-on body .hb-app .hb-reasoning-log__main { grid-column: 1 / -1 !important; }
html:not(.hbs-on) body .hb-app #hb-supports { display: none; }
html body .hb-app .hbs { max-width: 1180px; margin-inline: auto; }
.hbs-article-switch { margin-top: 14px; }
.hbs-rule {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 0.8125rem; line-height: 1.5;
  background: var(--hb-surface-container-low, #f7f2fa); color: var(--hb-on-surface-variant, #4a4550);
}
.hbs-list { display: grid; gap: 14px; margin-top: 8px; }
.hbs-card {
  border-radius: 18px; background: var(--hb-surface, #fff);
  box-shadow: 0 0 0 1px var(--hb-outline-variant, #e2dde6), 0 10px 24px -20px rgba(64, 46, 91, .35);
  padding: 18px 20px 16px; scroll-margin-top: calc(var(--hb-appbar-height, 72px) + 16px);
}
.hbs-card__head h3 { margin: 0; font-size: 1.0625rem; font-weight: 650; line-height: 1.35; }
.hbs-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hbs-disc, .hbs-hyp, .hbs-state, .hbs-type {
  display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 650; line-height: 1.3;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.hbs-hyp { background: var(--hb-surface-container, #f3edf7); color: var(--hb-on-surface, #1d1b20); font-weight: 550; }
.hbs-disc--spec { background: #e5f3ea; color: #1f6b44; }
.hbs-disc--shared { background: #efeff2; color: #55535c; }
.hbs-disc--undet { background: #fbf0dc; color: #704600; }
.hbs-cols { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; margin-top: 14px; }
.hbs-cols h4 { margin: 0 0 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 0.8125rem; font-weight: 700; color: var(--hb-on-surface, #1d1b20); }
.hbs-patient { border-radius: 14px; padding: 12px 14px; background: #f6faf7; box-shadow: inset 3px 0 0 #3c8a64; }
.hbs-patient p { margin: 0; font-size: 0.875rem; line-height: 1.55; }
.hbs-missing { margin-top: 8px !important; color: var(--hb-on-surface-variant, #5f5a66); font-size: 0.8125rem !important; }
.hbs-missing b { font-weight: 650; color: #704600; }
.hbs-state--ok { background: #e5f3ea; color: #1f6b44; }
.hbs-state--gap { background: #fbf0dc; color: #704600; }
.hbs-state--warn { background: #fbe9e8; color: #8c1d18; }
.hbs-sources { border-radius: 14px; padding: 12px 14px; background: var(--hb-surface-container-low, #f7f2fa); box-shadow: inset 3px 0 0 var(--hb-primary, #6750a4); }
.hbs-count { font-weight: 550; color: var(--hb-on-surface-variant, #5f5a66); font-size: 0.75rem; }
.hbs-sources ol, .hbs-other ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbs-thesis + .hbs-thesis { padding-top: 10px; border-top: 1px solid rgba(103, 80, 164, .14); }
.hbs-thesis > p { margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--hb-on-surface, #1d1b20); }
.hbs-cite { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 0.75rem; color: var(--hb-on-surface-variant, #5f5a66); }
.hbs-type--guide { background: #ede4fb; color: #4f378b; }
.hbs-type--review { background: #e3eef8; color: #1d4f7a; }
.hbs-type--pub { background: #efeff2; color: #55535c; }
.hbs-type--other { background: #efeff2; color: #55535c; }
.hbs-title { font-style: italic; min-width: 0; }
.hbs-year { font-variant-numeric: tabular-nums; }
.hbs-link { display: inline-flex; align-items: center; gap: 3px; color: var(--hb-primary, #6750a4); font-weight: 600; text-decoration: none; }
.hbs-link:hover { text-decoration: underline; }
.hbs-link svg { width: 12px; height: 12px; }
.hbs-why { margin-top: 4px; }
.hbs-why > summary { cursor: pointer; font-size: 0.75rem; font-weight: 600; color: var(--hb-on-surface-variant, #5f5a66); list-style: none; padding: 2px 0; }
.hbs-why > summary::-webkit-details-marker { display: none; }
.hbs-why > summary::after { content: " ▾"; font-size: 0.7em; }
.hbs-why[open] > summary::after { content: " ▴"; }
.hbs-why p { margin: 4px 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--hb-on-surface-variant, #4a4550); }
.hbs-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hb-outline-variant, #e2dde6); }
.hbs-next > span { font-size: 0.8125rem; font-weight: 650; }
.hbs-step {
  font: inherit; font-size: 0.8125rem; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  border: 0; border-radius: 10px; padding: 6px 10px; min-height: 32px; text-align: left;
  background: var(--hb-surface-container, #f3edf7); color: var(--hb-primary, #6750a4);
}
.hbs-step svg { width: 13px; height: 13px; flex: none; }
.hbs-step:hover { background: var(--hb-surface-container-high, #ece6f0); }
.hbs-other { margin-top: 16px; border-radius: 14px; background: var(--hb-surface-container-low, #f7f2fa); padding: 12px 16px; }
.hbs-other > summary { cursor: pointer; font-size: 0.875rem; font-weight: 650; }
.hbs-other ol { margin-top: 12px; }
.hbs-flash { animation: hbs-flash 2s ease-out; }
@keyframes hbs-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--hb-primary, #6750a4); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .hbs-flash { animation: none; } }

/* "Джерельні опори" inside the overview hypothesis card — tactile elevated citation chips */
.hbs-onhyp {
  grid-column: 1 / -1 !important;
  width: 100%;
  box-sizing: border-box;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0edf7;
  display: grid;
  gap: 10px;
}
.hbs-onhyp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hbs-onhyp__label {
  font-size: 0.72rem;
  font-weight: 720;
  color: #7d748e;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hbs-onhyp__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hbs-onhyp__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 560;
  color: #241c35;
  background: #ffffff;
  border: 1px solid #e7e2f1;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(34, 24, 58, 0.04);
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}
.hbs-onhyp__chip:hover {
  transform: translateY(-1px);
  background: #fdfcff;
  border-color: #c9bce8;
  color: #45267a;
  box-shadow: 0 5px 14px -6px rgba(82, 49, 133, 0.24);
}
.hbs-onhyp__chip.is-more {
  background: #f5f3fa;
  color: #5f5670;
  font-weight: 660;
  box-shadow: none;
}
.hbs-onhyp__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}
.hbs-onhyp__yr {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: #786f88;
  background: #f4f1fa;
  padding: 1px 6px;
  border-radius: 999px;
  margin-right: -4px;
}
.hbs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: #8c8499;
}
.hbs-dot--guide { background: #6750a4; }
.hbs-dot--review { background: #2b6cb0; }
.hbs-dot--pub { background: #207d57; }
.hbs-onhyp__go {
  font: inherit; font-size: 0.79rem; font-weight: 650; color: #523185;
  background: #f5f2fb; border: 1px solid #e6dff5; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; min-height: 28px; border-radius: 999px; white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.hbs-onhyp__go svg { width: 12px; height: 12px; }
.hbs-onhyp__go:hover { background: #ece5f9; border-color: #cfc0ee; }
.hbs-step:focus-visible, .hbs-onhyp__go:focus-visible, .hbs-onhyp__chip:focus-visible, .hbs-link:focus-visible, .hbs-why > summary:focus-visible { outline: 2px solid var(--hb-primary, #6750a4); outline-offset: 2px; }

@media (max-width: 860px) {
  .hbs-cols { grid-template-columns: minmax(0, 1fr); }
  .hbs-card { padding: 14px 14px 12px; }
}

.hbs-onstep {
  margin: 4px 0 0; font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--hb-primary, #6750a4);
  background: none; border: 0; cursor: pointer; padding: 6px 0; min-height: 32px;
}
.hbs-onstep:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.hbs-onstep:disabled { color: var(--hb-on-surface-variant, #5f5a66); cursor: default; text-decoration: none; }


@media (max-width: 760px) {
  html body .hb-app .hbs .hbj-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 6px; scrollbar-width: none; }
  html body .hb-app .hbs .hbj-filters::-webkit-scrollbar { display: none; }
  html body .hb-app .hbs .hbj-chip { flex: none; white-space: nowrap; }
}

html body .hb-app .hb-reasoning-log__main, html body .hb-app #hb-supports, html body .hb-app .hbs-list, html body .hb-app .hbs-card { min-width: 0; max-width: 100%; }
html body .hb-app .hbs .hbj-filters { max-width: 100%; }

.hbs-short { font-weight: 700; color: var(--hb-on-surface, #1d1b20); font-style: normal; }
.hbs-cite .hbs-title { opacity: .85; }

/* 55-observations.css */
/* 22. «Розгляд даних» (reasoning view): grouped review of every patient record */
html body .hb-app #reasoning-observations[open] { display: flex; flex-direction: column; gap: 0; }
html body .hb-app #reasoning-observations > summary { order: -3; }
html body .hb-app #reasoning-observations > p { order: -2; margin: 4px 0 8px; padding: 0 4px; font-size: 0.8125rem; line-height: 1.5; color: var(--hb-on-surface-variant, #5f5a66); text-align: left; }
html body .hb-app #reasoning-observations > .hbo-bar { order: -1; display: grid; gap: 8px; padding: 0 4px 10px; }
.hbo-bar .hbj-filters { margin: 0; }
.hbo-search {
  font: inherit; font-size: 0.875rem; width: min(100%, 26rem); min-height: 38px; padding: 6px 12px;
  border-radius: 10px; border: 1px solid var(--hb-outline-variant, #cac4d0); background: var(--hb-surface, #fff); color: inherit;
}
.hbo-search:focus-visible { outline: 2px solid var(--hb-primary, #6750a4); outline-offset: 1px; }
.hbo-hint { margin: 0; font-size: 0.75rem; color: var(--hb-on-surface-variant, #5f5a66); }

/* one record = one compact row */
html body .hb-app #reasoning-observations > article {
  --tone: #8e8d96;
  display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: start;
  margin: 0 !important; padding: 10px 14px 10px 16px !important; text-align: left !important;
  border-top: 1px solid color-mix(in srgb, var(--hb-outline-variant, #cac4d0) 55%, transparent);
  box-shadow: inset 3px 0 0 var(--tone);
}
html body .hb-app #reasoning-observations > article[hidden] { display: none !important; }
html body .hb-app #reasoning-observations > article[data-cat="explain"] { --tone: #c98a00; }
html body .hb-app #reasoning-observations > article[data-cat="linked"] { --tone: var(--hb-primary, #6750a4); }
html body .hb-app #reasoning-observations > article[data-cat="separate"] { --tone: #3f6f9a; }
/* group heading on the first record of each group */
html body .hb-app #reasoning-observations > article[data-first="true"] { margin-top: 14px !important; border-top: 0; }
html body .hb-app #reasoning-observations > article[data-first="true"]::before {
  content: attr(data-group-label) " · " attr(data-count);
  grid-column: 1 / -1; margin: -2px 0 6px -16px; padding: 0 0 6px 16px;
  font-size: 0.8125rem; font-weight: 700; color: var(--tone);
  border-bottom: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
}
/* record title: the source fact, left-aligned, never centred */
html body .hb-app #reasoning-observations > article > button.MuiButton-root {
  grid-column: 1; justify-self: start; justify-content: flex-start; text-align: left !important;
  padding: 0 !important; min-height: 0 !important; margin: 0 !important;
  font-size: 0.875rem !important; font-weight: 550 !important; line-height: 1.45 !important; text-transform: none;
  color: var(--hb-on-surface, #1d1b20) !important; background: none !important; white-space: normal;
}
html body .hb-app #reasoning-observations > article > button.MuiButton-root:hover { color: var(--hb-primary, #6750a4) !important; text-decoration: underline; text-underline-offset: 0.2em; }
/* category label is carried by the group heading */
html body .hb-app #reasoning-observations > article > p:nth-of-type(1) { display: none; }
html body .hb-app #reasoning-observations > article > p:nth-of-type(2) {
  grid-column: 1; margin: 0 !important; font-size: 0.8125rem; line-height: 1.5; color: var(--hb-on-surface-variant, #4a4550); text-align: left;
}
/* MedLens: a quiet external link in the right column */
html body .hb-app #reasoning-observations > article > a.hbo-ext {
  grid-column: 2; grid-row: 1; align-self: start; white-space: nowrap;
  font-size: 0.75rem; font-weight: 600; color: var(--hb-primary, #6750a4); text-decoration: none; padding: 2px 0;
}
html body .hb-app #reasoning-observations > article > a.hbo-ext { font-size: 0 !important; }
html body .hb-app #reasoning-observations > article > a.hbo-ext::after { content: "MedLens ↗"; font-size: 0.75rem; }
html body .hb-app #reasoning-observations > article > a.hbo-ext:hover { text-decoration: underline; }
@media (max-width: 760px) {
  html body .hb-app #reasoning-observations > article { grid-template-columns: minmax(0, 1fr); }
  html body .hb-app #reasoning-observations > article > a.hbo-ext { grid-column: 1; grid-row: auto; }
  html body .hb-app #reasoning-observations .hbo-bar .hbj-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  html body .hb-app #reasoning-observations .hbo-bar .hbj-chip { flex: none; white-space: nowrap; }
}
/* open <details> wraps children in ::details-content; the flex order must live there */
html body .hb-app #reasoning-observations::details-content { display: flex; flex-direction: column; }
html body .hb-app #reasoning-observations > article[data-first="true"] > a.hbo-ext { grid-row: 2; }
.hbo-search { height: 38px; box-sizing: border-box; }

/* 60-graph.css */
/* 20. Graph: explanation panel stays in view while scrolling the graph */
@media (min-width: 1100px) {
  html body .hb-app .hb-evidence-graph__inspector {
    position: sticky !important; top: calc(var(--hb-appbar-height, 72px) + 52px) !important; align-self: start !important;
    max-height: calc(100vh - var(--hb-appbar-height, 72px) - 68px) !important; overflow: auto !important;
  }
}


/* 24. Graph reads hypothesis → evidence: hypotheses on the left, clinical data on the right.
       The board (nodes, ports, SVG links, column headers) is mirrored; text stays upright. */
html body .hb-app .hb-evidence-graph__desktop { transform: scaleX(-1); }
html body .hb-app .hb-evidence-graph__desktop :is(
  .hb-evidence-graph__fact-label, .hb-evidence-graph__fact-meta, .hb-evidence-graph__fact-relations,
  .hb-graph-premium__node-info, .hb-evidence-graph__hypothesis-label, .hb-graph-premium__column) { transform: scaleX(-1); }

/* 25. Vertically center hypothesis labels inside graph nodes (fixes upward offset when <small> rank subtitle is absent) */
html body .hb-app .hb-evidence-graph__hypotheses button {
  grid-template-rows: auto !important;
  align-content: center !important;
  align-items: center !important;
  padding-block: 14px !important;
}

/* 26. Center "Hypotheses" and "Clinical data" column headers directly over their card columns */
html body .hb-app .hb-evidence-graph__desktop .hb-graph-premium__column {
  width: var(--graph-node-width) !important;
  justify-content: center !important;
  text-align: center !important;
}

/* timesets_en.css */
/* TimeSets interactive timeline & slide-over record drawer (Premium 12 language) */
.hbts-root {
  background: #ffffff;
  border-radius: 26px;
  border: 1px solid #e6e3ee;
  box-shadow: 0 18px 40px -28px rgba(45, 36, 74, 0.22);
  padding: 22px 24px 20px;
  margin-bottom: 18px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.hbts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 14px;
}

.hbts-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: #1f1a2b;
  line-height: 1.25;
}

.hbts-head p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #5f5a66;
  font-variant-numeric: tabular-nums;
}

.hbts-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hbts-scale {
  display: inline-flex;
  background: #f2eef8;
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.hbts-scale button {
  border: 0;
  background: transparent;
  color: #544b66;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.hbts-scale button[aria-pressed="true"] {
  background: #ffffff;
  color: #2f2347;
  box-shadow: 0 2px 8px -3px rgba(61, 44, 86, 0.28);
}

.hbts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.hbts-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hbts-set-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--ts-stroke, #d9d5e4);
  background: var(--ts-tint, #f7f5fb);
  color: var(--ts-ink, #322b40);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hbts-set-pill i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ts-accent, #6750a4);
  display: inline-block;
}

.hbts-set-pill b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.hbts-set-pill[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--ts-accent, #6750a4);
}

.hbts-set-pill.is-dim {
  opacity: 0.45;
}

.hbts-glyph-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  color: #5f5a66;
}

.hbts-glyph-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hbts-scroll {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid #ece9f3;
  background: linear-gradient(180deg, #fcfbfd 0%, #f9f8fc 100%);
  padding: 6px 4px 4px;
  max-width: 100%;
  box-sizing: border-box;
}

.hbts-svg {
  display: block;
  width: 100%;
  min-width: 920px;
  height: auto;
  user-select: none;
  font-family: inherit;
}

.hbts-ev {
  cursor: pointer;
  outline: none;
  pointer-events: all;
}

.hbts-ev text,
.hbts-ev circle,
.hbts-ev polygon {
  pointer-events: none;
}

.hbts-ev .hbts-ev__bg {
  pointer-events: all;
  transition: fill-opacity 0.16s ease, stroke-opacity 0.16s ease, stroke-width 0.16s ease;
}

.hbts-ev:hover .hbts-ev__bg,
.hbts-ev:focus-visible .hbts-ev__bg {
  fill: #ffffff;
  fill-opacity: 0.98;
  stroke: var(--ts-accent, #6750a4);
  stroke-opacity: 0.78;
  stroke-width: 1.5;
  filter: url(#hbts-pill-shadow);
}

.hbts-ev.is-selected .hbts-ev__bg {
  fill: url(#hbts-pill-grad);
  fill-opacity: 1;
  stroke: #ffffff;
  stroke-opacity: 0.95;
  filter: url(#hbts-pill-shadow);
}

.hbts-ev.is-dim {
  opacity: 0.24;
}

.hbts-ribbon {
  transition: opacity 0.18s ease;
}

.hbts-ribbon.is-dim {
  opacity: 0.22;
}

.hbts-gutter-label {
  cursor: pointer;
}

.hbts-undated {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #dcd7e6;
}

.hbts-undated__title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5f5a66;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hbts-undated__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hbts-undated-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #dfdbe8;
  background: #faf9fc;
  color: #262033;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hbts-undated-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ts-accent, #6750a4);
  flex: none;
}

.hbts-undated-chip small {
  color: #6b6476;
  font-weight: 500;
  font-size: 0.74rem;
}

.hbts-undated-chip:hover,
.hbts-undated-chip.is-selected {
  background: linear-gradient(118deg, #ffffff 12%, #fdfbff 69%, #f2eafa 100%);
  border-color: #b7a4da;
  box-shadow: 0 8px 18px -10px rgba(93, 62, 137, 0.42);
}

.hbts-foot-hint {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: #6a6475;
}

/* Hide legacy MUI Calendar workspace when TimeSets is active */
html.hbj-on .hbts-root {
  display: none !important;
}
html.hbts-on .hb-time-workspace {
  display: none !important;
}

/* Slide-over detail drawer (native <dialog closedby="any">, Premium 12) */
@keyframes hbts-drawer-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

dialog.hbts-drawer {
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid #dcd9e6;
  border-radius: 26px 0 0 26px;
  width: min(590px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: #fcfbfd;
  color: #1d1b20;
  box-shadow: -18px 10px 55px -20px rgba(37, 36, 63, 0.38);
  overflow-y: auto;
  font-family: inherit;
}

dialog.hbts-drawer:modal {
  overscroll-behavior: contain;
}

dialog.hbts-drawer[open] {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.hbts-drawer[open] {
    animation: hbts-drawer-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

dialog.hbts-drawer::backdrop {
  background-color: rgba(31, 43, 47, 0.32);
  backdrop-filter: blur(3px);
  overscroll-behavior: contain;
}

.hbts-drawer__head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  background: rgba(252, 251, 253, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #ece8f2;
}

.hbts-drawer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.hbts-drawer__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--ts-tint, #f1ecf7);
  color: var(--ts-ink, #3d2c56);
  border: 1px solid var(--ts-stroke, #ddd5eb);
}

.hbts-drawer__date {
  font-size: 0.78rem;
  font-weight: 600;
  color: #5f5a66;
  font-variant-numeric: tabular-nums;
}

.hbts-drawer__pages {
  font-size: 0.75rem;
  color: #6b6476;
}

.hbts-drawer__title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.3;
  color: #1f1a2b;
  letter-spacing: -0.02em;
}

.hbts-drawer__close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid #e1dce9;
  background: #ffffff;
  color: #4a4357;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.hbts-drawer__close:hover {
  background: #f3effa;
  color: #1f1a2b;
}

.hbts-drawer__body {
  padding: 18px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hbts-drawer__section h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f576d;
}

.hbts-drawer__hyps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hbts-drawer__hyp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #dcd5ea;
  background: #f6f3fb;
  color: #3a2a57;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.hbts-drawer__hyp:hover {
  border-color: #7c63b5;
  background: #eee7f8;
}

.hbts-drawer__hyp em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

.hbts-drawer__hyp em[data-rel="supports"] { background: #e3f4ea; color: #1c6543; }
.hbts-drawer__hyp em[data-rel="contradicts"] { background: #fde9e7; color: #9c241b; }
.hbts-drawer__hyp em[data-rel="neutral"] { background: #ecebf0; color: #55525e; }

.hbts-drawer__obs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #ffffff;
  border: 1px solid #e7e3ef;
  border-radius: 14px;
  overflow: hidden;
}

.hbts-drawer__obs-table th {
  text-align: left;
  padding: 9px 11px;
  background: #f4f2f8;
  color: #534c61;
  font-size: 0.72rem;
  font-weight: 700;
  border-bottom: 1px solid #e6e2ee;
}

.hbts-drawer__obs-table td {
  padding: 8px 11px;
  border-bottom: 1px solid #f0edf5;
  vertical-align: top;
  color: #241f2e;
}

.hbts-drawer__obs-table tr:last-child td {
  border-bottom: 0;
}

.hbts-drawer__val {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.hbts-drawer__val[data-flag="high"],
.hbts-drawer__val[data-flag="low"] {
  color: #b3261e;
}

.hbts-drawer__flag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fde9e7;
  color: #9c241b;
}

.hbts-drawer__findings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hbts-drawer__findings li {
  background: #ffffff;
  border: 1px solid #e8e4f0;
  border-radius: 13px;
  padding: 11px 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #241f2e;
}

.hbts-drawer__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 24px;
  border-top: 1px solid #ece8f2;
  background: #faf9fc;
  margin-top: auto;
}

.hbts-drawer__nav button {
  border: 1px solid #ddd7e8;
  background: #ffffff;
  color: #352b47;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.hbts-drawer__nav button:hover:not(:disabled) {
  border-color: #7c63b5;
  background: #f4effb;
}

.hbts-drawer__nav button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 760px) {
  .hbts-root {
    padding: 16px 14px;
    border-radius: 20px;
  }
  dialog.hbts-drawer {
    border-radius: 20px 20px 0 0;
    height: 90dvh;
    margin: auto 0 0 0;
    border-left: 0;
    border-top: 1px solid #dcd9e6;
  }
}

/* en layout & typography polish */
/* Hide redundant top status & disclaimer lines beneath the case strip */
html body .hb-app .hb-canvas > .hb-run-id {
  display: none !important;
}
html body .hb-app .hb-case-strip .hb-case-source-mode {
  font-size: .78rem;
  line-height: 1.35;
  padding: 2px 0 0 !important;
  opacity: .9;
}
html.hbts-on .hb-time-workspace {
  display: none !important;
}
@media (min-width: 761px) {
  html body .hb-app .hb-graph-scope {
    flex-wrap: nowrap !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }
  html body .hb-app .hb-graph-scope > .MuiButton-root {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}
html body .hb-app .hbs-cite .hbs-short {
  line-height: 1.35;
  font-weight: 600;
}
.hb-case-opt-sub {
  margin-left: 8px;
  font-size: .75rem;
  color: var(--hb-on-surface-variant, #5f5a66);
  font-weight: 400;
}