/* TJM: scoped components built on the existing Just a Click tokens. */
.tm-tjm { --tjm-link: var(--button-primary-background); --tjm-error: #b42318; max-width: 1200px; }
.dark .tm-tjm { --tjm-link: hsl(var(--primary)); --tjm-error: #ffb4a8; }
.tm-tjm [hidden] { display: none !important; }
.tm-tjm *, .tm-tjm *::before, .tm-tjm *::after { box-sizing: border-box; }
.tm-tjm :is(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 4px; }
.tm-tjm :is(section, article) { scroll-margin-top: 7rem; }
.tm-tjm a { color: var(--tjm-link); text-decoration: underline; text-underline-offset: 4px; }
.tm-tjm a:hover { text-decoration-thickness: 2px; }
.tm-tjm-breadcrumb { margin-top: -1.5rem; margin-bottom: 1.5rem; font-size: .875rem; color: hsl(var(--muted-foreground)); }
.tm-tjm-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; list-style: none; padding: 0; }
.tm-tjm-breadcrumb li + li::before { content: "/"; margin-right: .5rem; }
.tm-tjm-breadcrumb a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.tm-tjm-heading { margin-bottom: 2rem; max-width: 60rem; }
.tm-tjm-heading h1 { max-width: 32ch; }
.tm-tjm-eyebrow { font-size: .875rem; font-weight: 500; color: var(--tjm-link); margin-bottom: .75rem; }
.tm-tjm-intro { margin-top: 1.25rem; max-width: 65ch; font-size: 1.125rem; line-height: 1.75; color: hsl(var(--muted-foreground)); }
.tm-tjm-scope { margin-top: 1rem; font-size: .875rem; line-height: 1.7; font-weight: 500; }
.tm-tjm-meta { margin-top: .5rem; font-size: .8125rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.tm-tjm-calculator { border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); }
.tm-tjm-calculator-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid hsl(var(--border)); }
.tm-tjm-calculator h2 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; }
.tm-tjm-calculator-heading a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .875rem; }
.tm-tjm-workspace { display: grid; }
.tm-tjm-workspace > * { min-width: 0; padding: 1.5rem; }
.tm-tjm fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.tm-tjm-mode legend { font-size: .875rem; font-weight: 500; margin-bottom: .5rem; }
.tm-tjm-mode-options { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.tm-tjm-mode-options label { display: flex; gap: .5rem; align-items: center; min-height: 2.75rem; cursor: pointer; font-size: .875rem; }
.tm-tjm-mode-options input { width: 1rem; height: 1rem; accent-color: var(--button-primary-background); flex: none; }
.tm-tjm-mode-options input:checked + span { color: var(--tjm-link); font-weight: 600; }
.tm-tjm-field { margin-top: 1.25rem; }
.tm-tjm-field label { display: block; font-weight: 500; font-size: .875rem; line-height: 1.5; margin-bottom: .5rem; }
.tm-tjm-field input { display: block; width: 100%; min-width: 0; min-height: 3rem; padding: .625rem .75rem; border: 1px solid hsl(var(--input)); border-radius: .375rem; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-variant-numeric: tabular-nums; }
.tm-tjm-field input[aria-invalid="true"] { border-color: var(--tjm-error); }
.tm-tjm-hint { margin-top: .5rem; font-size: .8125rem; line-height: 1.65; color: hsl(var(--muted-foreground)); }
.tm-tjm-field-error { margin-top: .5rem; font-size: .875rem; line-height: 1.6; color: var(--tjm-error); }
.tm-tjm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.5rem 0 .75rem; }
.tm-tjm-actions button { min-height: 2.75rem; padding: .75rem 1rem; font-weight: 500; font-size: .875rem; line-height: 1.5; border-radius: .375rem; }
.tm-tjm-secondary { text-decoration: underline; text-underline-offset: 4px; color: var(--tjm-link); }
.tm-tjm-results { background: hsl(var(--muted) / .35); border-top: 1px solid hsl(var(--border)); border-radius: 0 0 var(--radius) var(--radius); }
.tm-tjm-answer { margin: 1.5rem 0 .75rem; }
.tm-tjm-answer dt { max-width: 35ch; font-size: .9375rem; line-height: 1.6; }
.tm-tjm-answer dd { margin-top: .5rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#tjm-primary-value { font-size: 2rem; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; }
#tjm-primary-unit { font-size: .875rem; color: hsl(var(--muted-foreground)); }
.tm-tjm-result-context { font-size: .875rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }
.tm-tjm-results h3 { margin-top: 2rem; font-weight: 500; font-size: .875rem; }
.tm-tjm-breakdown { margin: .5rem 0 1rem; font-size: .875rem; line-height: 1.6; }
.tm-tjm-breakdown > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; padding: .875rem 0; border-bottom: 1px solid hsl(var(--border)); }
.tm-tjm-breakdown dt { flex: 1 1 10rem; }
.tm-tjm-breakdown dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tm-tjm-breakdown .tm-tjm-total { font-weight: 600; border-bottom: 0; }
.tm-tjm-notice, .tm-tjm-errors { margin: 1rem 0; padding: 1rem; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: .375rem; font-size: .875rem; line-height: 1.65; }
.tm-tjm-calculator > noscript .tm-tjm-notice { margin: 1.5rem; }
.tm-tjm-errors { color: var(--tjm-error); border-color: var(--tjm-error); }
.tm-tjm-errors ul { list-style: disc; padding-left: 1.25rem; margin-top: .5rem; }
.tm-tjm-errors a { color: inherit; }
.tm-tjm-follow { display: grid; gap: 2rem; margin: 3rem 0; padding: 2rem 0; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.tm-tjm-follow > div { min-width: 0; }
.tm-tjm-follow h2 { font-size: 1.375rem; line-height: 1.4; font-weight: 600; }
.tm-tjm-follow p:not(.tm-tjm-eyebrow) { margin: 1rem 0; color: hsl(var(--muted-foreground)); font-size: 1rem; line-height: 1.75; }
.tm-tjm-follow .jc-newsletter-form { grid-template-columns: minmax(0, 1fr); max-width: none; }
.tm-tjm-follow .sib-form-block__button { width: 100%; }
.tm-tjm-follow-link { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: .5rem; font-size: .875rem; }
.tm-tjm-episodes ul { list-style: none; padding: 0; }
.tm-tjm-episodes li { border-bottom: 1px solid hsl(var(--border)); }
.tm-tjm-episodes a { display: block; padding: .875rem 0; font-size: .9375rem; line-height: 1.65; }
.tm-tjm-guide-layout { display: grid; gap: 2rem; min-width: 0; }
.tm-tjm-guide-nav { display: flex; flex-wrap: wrap; align-content: start; align-items: start; column-gap: 1.5rem; border-bottom: 1px solid hsl(var(--border)); padding-bottom: 1.5rem; }
.tm-tjm-guide-nav p { width: 100%; margin-bottom: .5rem; font-size: .875rem; font-weight: 600; }
.tm-tjm-guide-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .875rem; line-height: 1.6; }
.tm-tjm-guide { min-width: 0; max-width: 68ch; }
.tm-tjm-guide section + section { margin-top: 3rem; }
.tm-tjm-guide h2 { margin-bottom: 1.5rem; font-size: clamp(1.5rem, 1.2rem + .7vw, 1.875rem); line-height: 1.3; font-weight: 600; }
.tm-tjm-guide h3 { margin: 1.5rem 0 .75rem; font-size: 1.125rem; line-height: 1.5; font-weight: 600; }
.tm-tjm-guide p + p, .tm-tjm-guide :is(dl, ul) + p { margin-top: 1rem; }
.tm-tjm-guide ul { list-style: disc; padding-left: 1.25rem; margin-top: 1rem; }
.tm-tjm-guide li + li { margin-top: .5rem; }
.tm-tjm-formulas { margin-top: 1.5rem; border-top: 1px solid hsl(var(--border)); font-size: 1rem; line-height: 1.75; }
.tm-tjm-formulas > div { padding: 1rem 0; border-bottom: 1px solid hsl(var(--border)); }
.tm-tjm-formulas dt { font-weight: 600; }
.tm-tjm-formulas dd { margin-top: .25rem; color: hsl(var(--muted-foreground)); }
.tm-tjm-formula { padding: 1rem; background: hsl(var(--muted)); font-size: 1rem; line-height: 1.75; }
.tm-tjm-table-scroll { overflow-x: auto; max-width: 100%; margin: 1.5rem 0; }
.tm-tjm-table { width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.65; font-variant-numeric: tabular-nums; }
.tm-tjm-table caption { text-align: left; color: hsl(var(--muted-foreground)); padding-bottom: .75rem; }
.tm-tjm-table th, .tm-tjm-table td { padding: .875rem .5rem; text-align: right; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
.tm-tjm-table th { font-weight: 500; }
.tm-tjm-table th:first-child { text-align: left; white-space: nowrap; }
.tm-tjm-table small { display: block; font-size: .75rem; line-height: 1.6; margin-top: .5rem; }
.tm-tjm-faq details { border-top: 1px solid hsl(var(--border)); }
.tm-tjm-faq details:last-child { border-bottom: 1px solid hsl(var(--border)); }
.tm-tjm-faq summary { cursor: pointer; padding: 1rem 0; min-height: 2.75rem; font-size: 1rem; font-weight: 500; line-height: 1.65; }
.tm-tjm-faq summary::marker { color: var(--tjm-link); }
.tm-tjm-faq details p { margin: 0 0 1.5rem; }
.tm-tjm-sources { border-top: 1px solid hsl(var(--border)); padding-top: 2rem; }
.tm-tjm-sources :is(p, ul) { color: hsl(var(--muted-foreground)); font-size: .875rem; line-height: 1.75; }
.tm-tjm-sources a { overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .tm-tjm-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tm-tjm-workspace > * { padding: 2rem; }
  .tm-tjm-results { border-top: 0; border-left: 1px solid hsl(var(--border)); border-radius: 0 0 var(--radius) 0; }
  .tm-tjm-follow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; padding: 2.5rem 0; margin: 4rem 0; }
  .tm-tjm-guide-layout { grid-template-columns: 13rem minmax(0, 1fr); column-gap: 4rem; }
  .tm-tjm-guide-nav { flex-direction: column; border: 0; }
  .tm-tjm-guide-nav a { padding: .5rem 0; }
}
@media (max-width: 519px) {
  .tm-tjm-calculator-heading, .tm-tjm-workspace > * { padding: 1.25rem; }
  .tm-tjm-actions { align-items: stretch; }
  .tm-tjm-actions button { flex: 1 0 100%; }
  .tm-tjm-mode-options { flex-direction: column; gap: 0; }
  #tjm-primary-value { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-tjm * { scroll-behavior: auto; transition: none; }
}
