/*
 * TitikBisnis Article UI Kit
 * Version: 2.1.2 — Table legibility hotfix
 * Scope: every rule is namespaced with .tb-* and/or .tb-article-ui
 */

.tb-article-ui {
  /* Brand colors */
  --tb-color-brand: var(--tb-blue, #0868ff);
  --tb-color-brand-strong: var(--tb-navy-2, #0d285b);
  --tb-color-brand-soft: #eef5ff;
  --tb-color-accent: var(--tb-cyan, #08b6d8);
  --tb-color-accent-soft: #e9faff;
  --tb-color-ink: var(--tb-navy, #071a45);
  --tb-color-text: var(--tb-ink, #152448);
  --tb-color-muted: var(--tb-muted, #66728b);
  --tb-color-border: var(--tb-line, #e6eaf1);
  --tb-color-surface: #ffffff;
  --tb-color-surface-soft: var(--tb-soft, #f5f8fc);
  --tb-color-success: #087a55;
  --tb-color-success-soft: #eaf8f2;
  --tb-color-warning: #a44900;
  --tb-color-warning-soft: #fff6e5;
  --tb-color-danger: #b42318;
  --tb-color-danger-soft: #fff0ee;
  --tb-color-info: #0875a8;
  --tb-color-info-soft: #eaf7fc;

  /* Typography */
  --tb-font-body: var(--tb-sans, "Montserrat", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  --tb-font-display: var(--tb-serif, "Montserrat", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  --tb-font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --tb-text-xs: 0.75rem;
  --tb-text-sm: 0.875rem;
  --tb-text-base: 1rem;
  --tb-text-lg: 1.125rem;
  --tb-text-xl: clamp(1.25rem, 2vw, 1.5rem);
  --tb-text-2xl: clamp(1.65rem, 3vw, 2.2rem);
  --tb-leading: 1.7;

  /* Spacing and shape */
  --tb-space-1: 0.25rem;
  --tb-space-2: 0.5rem;
  --tb-space-3: 0.75rem;
  --tb-space-4: 1rem;
  --tb-space-5: 1.5rem;
  --tb-space-6: 2rem;
  --tb-space-7: 3rem;
  --tb-space-8: 4rem;
  --tb-radius-sm: 0.5rem;
  --tb-radius-md: var(--tb-radius, 0.75rem);
  --tb-radius-lg: 1rem;
  --tb-radius-pill: 999px;
  --tb-shadow-sm: var(--tb-shadow, 0 10px 28px rgb(14 34 78 / 0.075));
  --tb-shadow-md: 0 16px 38px rgb(14 34 78 / 0.12);
  --tb-content-width: 47.5rem;
  --tb-component-gap: 1.125rem;
  --tb-card-padding: clamp(1rem, 2.2vw, 1.25rem);
  --tb-shadow-editorial: 0 4px 14px rgb(14 34 78 / 0.055);
  --tb-shadow-featured: 0 8px 24px rgb(14 34 78 / 0.095);

  color: var(--tb-color-text);
  font-family: var(--tb-font-body);
  font-size: var(--tb-text-base);
  line-height: var(--tb-leading);
  overflow-wrap: anywhere;
}

.tb-article-ui,
.tb-article-ui *,
.tb-article-ui *::before,
.tb-article-ui *::after {
  box-sizing: border-box;
}

.tb-article-ui :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure) {
  margin-block-start: 0;
}

.tb-article-ui :where(a) {
  color: var(--tb-color-brand-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.tb-article-ui :where(a:hover) {
  color: var(--tb-color-brand);
}

.tb-article-ui :where(a, summary):focus-visible {
  outline: 3px solid rgb(8 104 255 / 0.35);
  outline-offset: 4px;
  border-radius: var(--tb-radius-sm);
}

.tb-article-ui :where(svg, img) {
  display: block;
  max-width: 100%;
}

.tb-article-ui .tb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Demo shell (optional; not required when components are embedded in an article) */
.tb-demo-page {
  margin: 0;
  background: var(--tb-soft, #f5f8fc);
}

.tb-article-ui .tb-demo-wrap {
  width: min(calc(100% - 2rem), var(--tb-content-width));
  margin-inline: auto;
  padding-block: var(--tb-space-6) var(--tb-space-8);
}

.tb-article-ui .tb-demo-intro {
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 4vw, 2.5rem);
  text-align: center;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-top: 0.3rem solid var(--tb-color-brand);
  border-radius: var(--tb-radius-lg);
  box-shadow: var(--tb-shadow-sm);
}

.tb-article-ui .tb-demo-kicker,
.tb-article-ui .tb-section-kicker {
  margin-bottom: var(--tb-space-2);
  color: var(--tb-color-brand);
  font-size: var(--tb-text-xs);
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tb-article-ui .tb-demo-intro .tb-demo-kicker {
  color: var(--tb-color-brand);
}

.tb-article-ui .tb-demo-title {
  max-width: 16ch;
  margin-inline: auto;
  margin-bottom: var(--tb-space-4);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-display);
  font-size: clamp(2.3rem, 7vw, 4rem);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.tb-article-ui .tb-demo-lead {
  max-width: 62ch;
  margin-inline: auto;
  margin-bottom: 0;
  color: var(--tb-color-muted);
  font-size: 1.08rem;
}

.tb-article-ui .tb-demo-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--tb-space-2);
  margin-top: var(--tb-space-5);
}

.tb-article-ui .tb-demo-meta-item {
  display: inline-flex;
  gap: var(--tb-space-2);
  padding: 0.4rem 0.75rem;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-xs);
  background: var(--tb-color-surface-soft);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-pill);
}

.tb-article-ui .tb-demo-meta-item strong {
  color: var(--tb-color-ink);
}

.tb-article-ui .tb-demo-nav {
  display: flex;
  gap: var(--tb-space-2);
  margin-block: var(--tb-space-5) var(--tb-space-7);
  padding: var(--tb-space-3);
  overflow-x: auto;
  scrollbar-width: thin;
  background: rgb(255 255 255 / 0.86);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
  box-shadow: var(--tb-shadow-sm);
}

.tb-article-ui .tb-demo-nav a {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  color: var(--tb-color-text);
  font-size: var(--tb-text-sm);
  font-weight: 700;
  text-decoration: none;
  background: var(--tb-color-surface-soft);
  border: 1px solid transparent;
  border-radius: var(--tb-radius-pill);
}

.tb-article-ui .tb-demo-nav a:hover {
  color: var(--tb-color-brand-strong);
  background: var(--tb-color-brand-soft);
  border-color: #cbdcff;
}

.tb-article-ui .tb-section {
  padding-block: var(--tb-space-6);
  scroll-margin-top: var(--tb-space-5);
}

.tb-article-ui .tb-section + .tb-section {
  border-top: 1px solid var(--tb-color-border);
}

.tb-article-ui .tb-section-head {
  display: block;
  margin-bottom: var(--tb-space-5);
}

.tb-article-ui .tb-section-title {
  margin-bottom: 0;
  color: var(--tb-color-ink);
  font-family: var(--tb-font-display);
  font-size: var(--tb-text-2xl);
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.tb-article-ui .tb-section-note {
  max-width: 60ch;
  margin-top: var(--tb-space-2);
  margin-bottom: 0;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
}

.tb-article-ui .tb-component {
  margin-block: var(--tb-component-gap);
}

/* Density variants. Editorial is the compact default for article embeds. */
.tb-article-ui.tb-density-compact {
  --tb-component-gap: 0.9rem;
  --tb-card-padding: 0.9rem 1rem;
}

.tb-article-ui.tb-density-spacious {
  --tb-component-gap: 1.5rem;
  --tb-card-padding: clamp(1.25rem, 3vw, 1.75rem);
}

/* Checklist */
.tb-article-ui .tb-checklist {
  display: grid;
  gap: var(--tb-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tb-check;
}

.tb-article-ui .tb-checklist-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--tb-space-4);
  padding: var(--tb-card-padding);
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
  box-shadow: var(--tb-shadow-editorial);
  counter-increment: tb-check;
}

.tb-article-ui .tb-checklist-item::before {
  content: counter(tb-check, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  color: #fff;
  font-size: var(--tb-text-xs);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  background: var(--tb-color-brand);
  border-radius: 50%;
}

.tb-article-ui .tb-checklist-item h3 {
  margin-top: 0;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-body);
  font-size: var(--tb-text-lg);
  line-height: 1.35;
}

.tb-article-ui .tb-checklist-item p {
  margin-bottom: 0;
  color: var(--tb-color-muted);
}

/* Steps */
.tb-article-ui .tb-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tb-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tb-step;
  align-items: start;
}

.tb-article-ui .tb-step {
  position: relative;
  min-height: 0;
  padding: var(--tb-card-padding);
  overflow: hidden;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-top: 0.22rem solid var(--tb-color-brand);
  border-radius: var(--tb-radius-md);
  box-shadow: var(--tb-shadow-editorial);
  counter-increment: tb-step;
}

.tb-article-ui .tb-step:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.tb-article-ui .tb-step::after {
  content: counter(tb-step, decimal-leading-zero);
  position: absolute;
  right: -0.1em;
  bottom: -0.28em;
  color: rgb(8 104 255 / 0.055);
  font-family: var(--tb-font-display);
  font-size: 6.5rem;
  font-weight: 700;
  line-height: 1;
}

.tb-article-ui .tb-step-number {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: var(--tb-space-3);
  color: var(--tb-color-brand);
  font-size: var(--tb-text-xs);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tb-article-ui .tb-step h3 {
  position: relative;
  z-index: 1;
  margin-top: 0;
  margin-bottom: var(--tb-space-2);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-body);
  font-size: var(--tb-text-lg);
  line-height: 1.3;
}

.tb-article-ui .tb-step p {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
  line-height: 1.6;
}

/* Flow */
.tb-article-ui .tb-flow {
  display: flex;
  align-items: stretch;
  gap: 2.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-article-ui .tb-flow-item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: var(--tb-card-padding);
  text-align: center;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
  box-shadow: var(--tb-shadow-editorial);
}

.tb-article-ui .tb-flow-item:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  left: calc(100% + 0.62rem);
  transform: translateY(-50%);
  color: var(--tb-color-brand);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.tb-article-ui .tb-flow-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto var(--tb-space-3);
  color: var(--tb-color-brand-strong);
  font-weight: 900;
  background: var(--tb-color-brand-soft);
  border-radius: 50%;
}

.tb-article-ui .tb-flow-item strong,
.tb-article-ui .tb-flow-item span {
  display: block;
}

.tb-article-ui .tb-flow-item strong {
  color: var(--tb-color-ink);
}

.tb-article-ui .tb-flow-item span {
  margin-top: var(--tb-space-1);
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
}

/* Factors */
.tb-article-ui .tb-factors {
  position: relative;
  display: grid;
  grid-template-columns: minmax(14rem, 0.8fr) minmax(0, 1.8fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--tb-color-surface-soft);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
}

.tb-article-ui .tb-factor-hub {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: var(--tb-space-5);
  color: #fff;
  text-align: center;
  background: var(--tb-color-brand);
  border: 0.6rem solid #d9e5ff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #bdd0ff;
}

.tb-article-ui .tb-factor-hub strong {
  max-width: 10ch;
  font-family: var(--tb-font-display);
  font-size: var(--tb-text-xl);
  line-height: 1.2;
}

.tb-article-ui .tb-factor-list {
  position: relative;
  display: grid;
  gap: var(--tb-space-3);
}

.tb-article-ui .tb-factor-list::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: clamp(2rem, 6vw, 5rem);
  border-top: 2px dashed #9bb8f7;
}

.tb-article-ui .tb-factor-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--tb-space-4);
  align-items: center;
  padding: var(--tb-space-4);
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
}

.tb-article-ui .tb-factor-index {
  color: var(--tb-color-brand);
  font-family: var(--tb-font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.tb-article-ui .tb-factor-card strong,
.tb-article-ui .tb-factor-card span {
  display: block;
}

.tb-article-ui .tb-factor-card strong {
  color: var(--tb-color-ink);
}

.tb-article-ui .tb-factor-card span {
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
}

/* Comparison (also covers pros/cons use cases) */
.tb-article-ui .tb-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tb-space-4);
  align-items: start;
}

.tb-article-ui .tb-compare-card {
  overflow: hidden;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
}

.tb-article-ui .tb-compare-card[data-featured="true"] {
  border: 2px solid var(--tb-color-brand);
  box-shadow: var(--tb-shadow-featured);
}

.tb-article-ui .tb-compare-head {
  padding: var(--tb-card-padding);
  background: var(--tb-color-surface-soft);
  border-bottom: 1px solid var(--tb-color-border);
}

.tb-article-ui .tb-compare-card[data-featured="true"] .tb-compare-head {
  background: var(--tb-color-brand-soft);
}

.tb-article-ui .tb-compare-eyebrow {
  display: inline-block;
  margin-bottom: var(--tb-space-2);
  color: var(--tb-color-brand-strong);
  font-size: var(--tb-text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tb-article-ui .tb-compare-head h3 {
  margin-top: 0;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-display);
  font-size: var(--tb-text-xl);
  line-height: 1.2;
}

.tb-article-ui .tb-compare-head p {
  margin-bottom: 0;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
}

.tb-article-ui .tb-compare-list {
  display: grid;
  gap: var(--tb-space-3);
  margin: 0;
  padding: var(--tb-card-padding);
  list-style: none;
}

.tb-article-ui .tb-compare-list li {
  position: relative;
  padding-left: 1.8rem;
}

.tb-article-ui .tb-compare-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--tb-color-success);
  font-weight: 900;
}

.tb-article-ui .tb-compare-list li::before {
  content: "✓";
}

/* Statistics */
.tb-article-ui .tb-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tb-space-3);
  align-items: start;
}

.tb-article-ui .tb-stat-card {
  min-width: 0;
  padding: var(--tb-card-padding);
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
  box-shadow: var(--tb-shadow-editorial);
}

.tb-article-ui .tb-stat-value {
  display: block;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-display);
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tb-article-ui .tb-stat-label {
  display: block;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
  line-height: 1.45;
}

.tb-article-ui .tb-stat-trend {
  display: inline-flex;
  margin-top: var(--tb-space-3);
  padding: 0.2rem 0.55rem;
  color: var(--tb-color-success);
  font-size: var(--tb-text-xs);
  font-weight: 800;
  background: var(--tb-color-success-soft);
  border-radius: var(--tb-radius-pill);
}

/* Donut and pie charts */
.tb-article-ui .tb-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tb-space-4);
  align-items: start;
}

.tb-article-ui .tb-chart-card {
  display: grid;
  gap: var(--tb-space-5);
  align-content: start;
  min-width: 0;
  padding: var(--tb-card-padding);
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
  box-shadow: var(--tb-shadow-editorial);
}

.tb-article-ui .tb-chart-head h3 {
  margin-top: 0;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-body);
  font-size: var(--tb-text-lg);
  line-height: 1.35;
}

.tb-article-ui .tb-chart-head p {
  margin-bottom: 0;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
  line-height: 1.55;
}

.tb-article-ui .tb-chart-graphic {
  position: relative;
  display: grid;
  place-items: center;
  width: min(11.5rem, 72%);
  aspect-ratio: 1;
  margin-inline: auto;
  background: conic-gradient(
    var(--tb-chart-color-a, var(--tb-color-brand)) 0 var(--tb-chart-stop-a, 55%),
    var(--tb-chart-color-b, var(--tb-color-accent)) var(--tb-chart-stop-a, 55%) var(--tb-chart-stop-b, 85%),
    var(--tb-chart-color-c, #f2ad3a) var(--tb-chart-stop-b, 85%) 100%
  );
  border-radius: 50%;
}

.tb-article-ui .tb-chart-graphic::before {
  content: "";
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  background: var(--tb-color-surface);
  border-radius: 50%;
}

.tb-article-ui .tb-chart-graphic[data-style="pie"]::before {
  display: none;
}

.tb-article-ui .tb-chart-center {
  position: relative;
  z-index: 1;
  color: var(--tb-color-ink);
  text-align: center;
  line-height: 1.15;
}

.tb-article-ui .tb-chart-center strong,
.tb-article-ui .tb-chart-center span {
  display: block;
}

.tb-article-ui .tb-chart-center strong {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tb-article-ui .tb-chart-center span {
  margin-top: var(--tb-space-1);
  color: var(--tb-color-muted);
  font-size: var(--tb-text-xs);
}

.tb-article-ui .tb-chart-graphic[data-style="pie"] .tb-chart-center {
  display: none;
}

.tb-article-ui .tb-chart-legend {
  display: grid;
  gap: var(--tb-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-article-ui .tb-chart-legend li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--tb-space-2);
  align-items: center;
  color: var(--tb-color-text);
  font-size: var(--tb-text-sm);
}

.tb-article-ui .tb-chart-swatch {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--tb-swatch, var(--tb-color-brand));
  border-radius: 0.2rem;
}

.tb-article-ui .tb-chart-legend strong {
  color: var(--tb-color-ink);
  font-variant-numeric: tabular-nums;
}

/* Callouts: highlight, warning, tip */
.tb-article-ui .tb-callout {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--tb-space-3);
  padding: var(--tb-card-padding);
  background: transparent;
  border: 1px solid transparent;
  border-left: 0.3rem solid var(--tb-color-brand);
  border-radius: 0 var(--tb-radius-sm) var(--tb-radius-sm) 0;
}

.tb-article-ui .tb-callout[data-tone="warning"] {
  background: var(--tb-color-warning-soft);
  border-color: #f5d18e;
  border-left-color: #d77700;
  border-radius: var(--tb-radius-md);
}

.tb-article-ui .tb-callout[data-tone="tip"] {
  background: transparent;
  border-color: transparent;
  border-left-color: var(--tb-color-success);
}

.tb-article-ui .tb-callout.tb-featured {
  background: var(--tb-color-brand-soft);
  border-color: #c9d9ff;
  border-left-color: var(--tb-color-brand);
  border-radius: var(--tb-radius-md);
}

.tb-article-ui .tb-callout-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--tb-color-brand-strong);
  font-size: var(--tb-text-lg);
  font-weight: 900;
  background: var(--tb-color-surface-soft);
  border-radius: 50%;
}

.tb-article-ui .tb-callout.tb-quiet {
  padding-block: 0.85rem;
  background: transparent;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 var(--tb-radius-sm) var(--tb-radius-sm) 0;
}

.tb-article-ui .tb-callout.tb-quiet .tb-callout-icon {
  width: 2rem;
  height: 2rem;
  background: var(--tb-color-surface-soft);
}

.tb-article-ui .tb-callout[data-tone="warning"] .tb-callout-icon {
  color: var(--tb-color-warning);
  background: rgb(255 255 255 / 0.8);
}

.tb-article-ui .tb-callout[data-tone="tip"] .tb-callout-icon {
  color: var(--tb-color-success);
}

.tb-article-ui .tb-callout h3 {
  margin-top: 0;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-body);
  font-size: var(--tb-text-lg);
  line-height: 1.35;
}

.tb-article-ui .tb-callout p {
  margin-bottom: 0;
}

/* Definition */
.tb-article-ui .tb-definition {
  display: grid;
  grid-template-columns: minmax(10rem, 0.45fr) minmax(0, 1fr);
  overflow: hidden;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
  box-shadow: var(--tb-shadow-editorial);
}

.tb-article-ui .tb-definition-term {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--tb-card-padding);
  color: #fff;
  background: var(--tb-color-ink);
}

.tb-article-ui .tb-definition-term small {
  color: #8fb3ff;
  font-size: var(--tb-text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tb-article-ui .tb-definition-term strong {
  margin-top: var(--tb-space-2);
  font-family: var(--tb-font-display);
  font-size: var(--tb-text-xl);
  line-height: 1.2;
}

.tb-article-ui .tb-definition-body {
  padding: var(--tb-card-padding);
}

.tb-article-ui .tb-definition-body p:last-child {
  margin-bottom: 0;
}

/* Timeline */
.tb-article-ui .tb-timeline {
  position: relative;
  display: grid;
  gap: var(--tb-space-4);
  margin: 0;
  padding: 0 0 0 2.25rem;
  list-style: none;
  counter-reset: tb-timeline;
}

.tb-article-ui .tb-timeline::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  bottom: 1.5rem;
  left: 0.78rem;
  width: 2px;
  background: #bdd0ff;
}

.tb-article-ui .tb-timeline-item {
  position: relative;
  padding: var(--tb-card-padding);
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
  counter-increment: tb-timeline;
}

.tb-article-ui .tb-timeline-item::before {
  content: counter(tb-timeline);
  position: absolute;
  top: 1.25rem;
  right: calc(100% + 0.72rem);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: #fff;
  font-size: var(--tb-text-xs);
  font-weight: 900;
  line-height: 1;
  background: var(--tb-color-brand);
  border: 0.25rem solid #eaf0ff;
  border-radius: 50%;
}

.tb-article-ui .tb-timeline-time {
  display: block;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-brand-strong);
  font-size: var(--tb-text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tb-article-ui .tb-timeline-item h3 {
  margin-top: 0;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-body);
  font-size: var(--tb-text-lg);
  line-height: 1.35;
}

.tb-article-ui .tb-timeline-item p {
  margin-bottom: 0;
  color: var(--tb-color-muted);
}

/* Funnel */
.tb-article-ui .tb-funnel {
  display: grid;
  gap: var(--tb-space-2);
  align-items: center;
  margin: 0;
  padding: var(--tb-space-5);
  list-style: none;
  background: var(--tb-color-surface-soft);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
}

.tb-article-ui .tb-funnel-stage {
  width: var(--tb-funnel-width, 100%);
  margin-inline: auto;
  padding: var(--tb-space-4) clamp(1rem, 4vw, 2rem);
  color: #fff;
  text-align: center;
  background: var(--tb-funnel-color, var(--tb-color-brand));
  clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
}

.tb-article-ui .tb-funnel-stage strong,
.tb-article-ui .tb-funnel-stage span {
  display: block;
}

.tb-article-ui .tb-funnel-stage strong {
  font-size: var(--tb-text-lg);
}

.tb-article-ui .tb-funnel-stage span {
  color: rgb(255 255 255 / 0.78);
  font-size: var(--tb-text-sm);
}

/* Responsive table */
.tb-article-ui .tb-table-wrap {
  overflow-x: auto;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
  box-shadow: var(--tb-shadow-editorial);
}

/*
 * Some article markup still includes the theme's legacy scroll wrapper.
 * The UI Kit owns scrolling and framing, so neutralize that nested shell to
 * avoid a second border and the theme's large vertical margin.
 */
.tb-article-ui .tb-table-wrap > .tb-table-scroll {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: inherit;
  box-shadow: none;
}

.tb-article-ui .tb-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: var(--tb-text-sm);
}

.tb-article-ui .tb-table caption {
  padding: var(--tb-space-3) var(--tb-space-4);
  color: var(--tb-color-muted);
  text-align: left;
  caption-side: bottom;
}

.tb-article-ui .tb-table :where(th, td) {
  padding: var(--tb-space-3) var(--tb-space-4);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--tb-color-border);
}

.tb-article-ui .tb-table thead th {
  color: var(--tb-color-ink);
  font-size: var(--tb-text-xs);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--tb-color-surface-soft);
}

.tb-article-ui .tb-table tbody tr:last-child td {
  border-bottom: 0;
}

.tb-article-ui .tb-table tbody tr:hover {
  background: #fbfcfe;
}

.tb-article-ui .tb-table-badge {
  display: inline-flex;
  padding: 0.18rem 0.55rem;
  color: var(--tb-color-brand-strong);
  font-size: var(--tb-text-xs);
  font-weight: 800;
  background: var(--tb-color-brand-soft);
  border-radius: var(--tb-radius-pill);
}

/* Formula */
.tb-article-ui .tb-formula {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--tb-space-4);
  align-items: center;
  padding: var(--tb-card-padding);
  color: var(--tb-color-text);
  background: var(--tb-color-brand-soft);
  border: 1px solid #d8e7ff;
  border-left: 0.25rem solid var(--tb-color-brand);
  border-radius: 0 var(--tb-radius-md) var(--tb-radius-md) 0;
}

.tb-article-ui .tb-formula-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  color: var(--tb-color-brand-strong);
  font-family: var(--tb-font-display);
  font-size: var(--tb-text-xl);
  font-weight: 700;
  background: var(--tb-color-surface);
  border: 1px solid #d8e7ff;
  border-radius: 50%;
}

.tb-article-ui .tb-formula-label {
  display: block;
  margin-bottom: var(--tb-space-2);
  color: var(--tb-color-brand);
  font-size: var(--tb-text-xs);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tb-article-ui .tb-formula-expression {
  margin-bottom: var(--tb-space-2);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-mono);
  font-size: clamp(1.05rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
}

.tb-article-ui .tb-formula-note {
  margin-bottom: 0;
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
}

/* Formula group: related calculations read as one editorial module. */
.tb-article-ui .tb-formula-group {
  overflow: hidden;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-left: 0.25rem solid var(--tb-color-brand);
  border-radius: 0 var(--tb-radius-md) var(--tb-radius-md) 0;
  box-shadow: var(--tb-shadow-editorial);
}

.tb-article-ui .tb-formula-row {
  display: grid;
  grid-template-columns: minmax(8rem, 0.7fr) minmax(0, 1.3fr);
  gap: var(--tb-space-4);
  align-items: baseline;
  padding: var(--tb-space-3) var(--tb-space-4);
  border-bottom: 1px solid var(--tb-color-border);
}

.tb-article-ui .tb-formula-row:last-child {
  border-bottom: 0;
}

.tb-article-ui .tb-formula-row > :first-child {
  color: var(--tb-color-muted);
  font-size: var(--tb-text-sm);
  font-weight: 700;
}

.tb-article-ui .tb-formula-row code,
.tb-article-ui .tb-formula-row strong {
  color: var(--tb-color-ink);
  font-family: var(--tb-font-mono);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.tb-article-ui .tb-formula-result {
  background: var(--tb-color-brand-soft);
}

.tb-article-ui .tb-formula-result > :first-child,
.tb-article-ui .tb-formula-result code,
.tb-article-ui .tb-formula-result strong {
  color: var(--tb-color-brand-strong);
}

/* Split chart: shorter on desktop, stacked on narrow screens. */
.tb-article-ui .tb-charts--single {
  grid-template-columns: 1fr;
}

.tb-article-ui .tb-chart-card--split,
.tb-article-ui .tb-charts > .tb-chart-card:only-child {
  grid-column: 1 / -1;
  grid-template-columns: minmax(10rem, 0.75fr) minmax(0, 1.25fr);
  grid-template-areas:
    "head head"
    "graphic legend";
  align-items: center;
}

.tb-article-ui .tb-chart-card--split .tb-chart-head,
.tb-article-ui .tb-charts > .tb-chart-card:only-child .tb-chart-head {
  grid-area: head;
}

.tb-article-ui .tb-chart-card--split .tb-chart-graphic,
.tb-article-ui .tb-charts > .tb-chart-card:only-child .tb-chart-graphic {
  grid-area: graphic;
}

.tb-article-ui .tb-chart-card--split .tb-chart-legend,
.tb-article-ui .tb-charts > .tb-chart-card:only-child .tb-chart-legend {
  grid-area: legend;
}

/* Native FAQ accordion. */
.tb-article-ui .tb-faq {
  display: grid;
  gap: var(--tb-space-2);
}

.tb-article-ui .tb-faq-item {
  overflow: hidden;
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-md);
}

.tb-article-ui .tb-faq-question,
.tb-article-ui details.tb-compare-card > summary {
  display: flex;
  gap: var(--tb-space-3);
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--tb-space-4);
  color: var(--tb-color-ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.tb-article-ui .tb-faq-question::-webkit-details-marker,
.tb-article-ui details.tb-compare-card > summary::-webkit-details-marker {
  display: none;
}

.tb-article-ui .tb-faq-question::after,
.tb-article-ui details.tb-compare-card > summary::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--tb-color-brand-strong);
  background: var(--tb-color-brand-soft);
  border-radius: 50%;
}

.tb-article-ui .tb-faq-item[open] > .tb-faq-question::after,
.tb-article-ui details.tb-compare-card[open] > summary::after {
  content: "−";
}

.tb-article-ui .tb-faq-answer {
  padding: 0 var(--tb-space-4) var(--tb-space-4);
  color: var(--tb-color-muted);
}

.tb-article-ui .tb-faq-answer > :last-child {
  margin-bottom: 0;
}

/* Optional weight controls for long articles. */
.tb-article-ui .tb-quiet {
  box-shadow: none;
}

.tb-article-ui .tb-featured {
  box-shadow: var(--tb-shadow-featured);
}

/* Score and progress */
.tb-article-ui .tb-score-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 3rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--tb-color-surface);
  border: 1px solid var(--tb-color-border);
  border-radius: var(--tb-radius-lg);
  box-shadow: var(--tb-shadow-sm);
}

.tb-article-ui .tb-score-ring {
  display: grid;
  place-items: center;
  width: 8.5rem;
  aspect-ratio: 1;
  background: conic-gradient(var(--tb-color-brand) calc(var(--tb-score, 0) * 1%), #e7edf5 0);
  border-radius: 50%;
}

.tb-article-ui .tb-score-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 6.5rem;
  aspect-ratio: 1;
  background: var(--tb-color-surface);
  border-radius: 50%;
}

.tb-article-ui .tb-score-value {
  z-index: 1;
  grid-area: 1 / 1;
  color: var(--tb-color-ink);
  font-family: var(--tb-font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.tb-article-ui .tb-score-copy h3 {
  margin-top: 0;
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-ink);
  font-family: var(--tb-font-display);
  font-size: var(--tb-text-xl);
  line-height: 1.2;
}

.tb-article-ui .tb-score-copy > p {
  margin-bottom: var(--tb-space-4);
  color: var(--tb-color-muted);
}

.tb-article-ui .tb-progress-list {
  display: grid;
  gap: var(--tb-space-3);
}

.tb-article-ui .tb-progress-label {
  display: flex;
  justify-content: space-between;
  gap: var(--tb-space-3);
  margin-bottom: var(--tb-space-1);
  color: var(--tb-color-text);
  font-size: var(--tb-text-sm);
  font-weight: 700;
}

.tb-article-ui .tb-progress-label span:last-child {
  color: var(--tb-color-muted);
}

.tb-article-ui .tb-progress {
  display: block;
  width: 100%;
  height: 0.65rem;
  overflow: hidden;
  appearance: none;
  background: #e7edf5;
  border: 0;
  border-radius: var(--tb-radius-pill);
}

.tb-article-ui .tb-progress::-webkit-progress-bar {
  background: #e7edf5;
  border-radius: var(--tb-radius-pill);
}

.tb-article-ui .tb-progress::-webkit-progress-value {
  background: var(--tb-color-brand);
  border-radius: var(--tb-radius-pill);
}

.tb-article-ui .tb-progress::-moz-progress-bar {
  background: var(--tb-color-brand);
  border-radius: var(--tb-radius-pill);
}

/* Responsive behavior */
@media (max-width: 48rem) {
  .tb-article-ui .tb-definition,
  .tb-article-ui .tb-factors {
    grid-template-columns: 1fr;
  }

  .tb-article-ui .tb-demo-meta {
    margin-top: var(--tb-space-3);
  }

  .tb-article-ui .tb-flow {
    flex-direction: column;
    gap: 2.3rem;
  }

  .tb-article-ui .tb-flow-item:not(:last-child)::after {
    top: calc(100% + 0.7rem);
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }

  .tb-article-ui .tb-factor-hub {
    justify-self: center;
    width: min(100%, 14rem);
  }

  .tb-article-ui .tb-factor-list::before {
    top: auto;
    right: auto;
    bottom: 100%;
    left: 50%;
    width: 0;
    height: clamp(2rem, 6vw, 5rem);
    border-top: 0;
    border-left: 2px dashed #9bb8f7;
  }

}

@media (max-width: 40rem) {
  .tb-article-ui .tb-demo-wrap {
    width: min(calc(100% - 1.25rem), var(--tb-content-width));
  }

  .tb-article-ui .tb-demo-intro {
    padding: var(--tb-space-5);
  }

  .tb-article-ui .tb-demo-title {
    font-size: clamp(2.1rem, 14vw, 3.6rem);
  }

  .tb-article-ui .tb-steps,
  .tb-article-ui .tb-comparison,
  .tb-article-ui .tb-stats,
  .tb-article-ui .tb-charts,
  .tb-article-ui .tb-score-card {
    grid-template-columns: 1fr;
  }

  .tb-article-ui .tb-step {
    min-height: 0;
  }

  .tb-article-ui .tb-step:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .tb-article-ui .tb-score-ring {
    justify-self: center;
  }

  .tb-article-ui .tb-table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .tb-article-ui .tb-table,
  .tb-article-ui .tb-table tbody,
  .tb-article-ui .tb-table tr,
  .tb-article-ui .tb-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .tb-article-ui .tb-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .tb-article-ui .tb-table tbody {
    display: grid;
    gap: var(--tb-space-3);
  }

  .tb-article-ui .tb-table tbody tr {
    overflow: hidden;
    background: var(--tb-color-surface);
    border: 1px solid var(--tb-color-border);
    border-radius: var(--tb-radius-md);
    box-shadow: var(--tb-shadow-sm);
  }

  .tb-article-ui .tb-table tbody td {
    display: grid;
    grid-template-columns: minmax(7rem, 0.65fr) minmax(0, 1fr);
    gap: var(--tb-space-3);
    padding: var(--tb-space-3) var(--tb-space-4);
  }

  .tb-article-ui .tb-table tbody td::before {
    content: attr(data-label);
    color: var(--tb-color-ink);
    font-size: var(--tb-text-xs);
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .tb-article-ui .tb-table caption {
    display: block;
    padding-inline: 0;
  }

  .tb-article-ui .tb-formula {
    grid-template-columns: 1fr;
  }

  .tb-article-ui .tb-formula-mark {
    width: 2.8rem;
    height: 2.8rem;
  }

  .tb-article-ui .tb-formula-row {
    grid-template-columns: 1fr;
    gap: var(--tb-space-1);
  }

  .tb-article-ui .tb-chart-card--split,
  .tb-article-ui .tb-charts > .tb-chart-card:only-child {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "graphic"
      "legend";
  }

}

@media print {
  .tb-demo-page {
    background: #fff;
  }

  .tb-article-ui .tb-demo-wrap {
    width: 100%;
    padding: 0;
  }

  .tb-article-ui .tb-demo-nav {
    display: none;
  }

  .tb-article-ui .tb-component,
  .tb-article-ui .tb-checklist-item,
  .tb-article-ui .tb-step,
  .tb-article-ui .tb-callout,
  .tb-article-ui .tb-chart-card {
    break-inside: avoid;
  }
}
