/*
 * TSI Tools. Scoped to .tsit, built on the TSI design system: dark blue
 * #001E41, bright blue #4396F6, bright-blue tints, square corners, no
 * gradients. Green and orange appear only as status (a leader, a loss).
 * Every color and size is a custom property, so the theme or Elementor's
 * Advanced tab can restyle a tool without editing the plugin. The tokens
 * sit at zero specificity, so a page rule as plain as
 * .tsit { --tsit-radius: 8px; --tsit-h-weight: 500; } overrides them.
 */
:where(.tsit) {
  --tsit-dark: #001E41;
  --tsit-blue: #4396F6;
  --tsit-tint: #ECF4FE;
  --tsit-tint-2: #DAE9FD;
  --tsit-ink: #001E41;
  --tsit-body: #1F3D6B;
  --tsit-muted: #5E7493;
  --tsit-label: #3A557F;  /* small text on the tint: 6.9:1 */
  --tsit-line: #5E7493;   /* field borders: 4.8:1 on white */
  --tsit-rule: #D7DCE5;
  --tsit-panel-ink: #FFFFFF;
  --tsit-panel-muted: #B6BFD0;
  --tsit-panel-track: #0A2A52;
  --tsit-good: #66CC00;
  --tsit-warn: #FF8300;
  --tsit-error: #B42318;
  --tsit-radius: 2px;
  --tsit-h-weight: 300;
  --tsit-gap: 24px;
  --tsit-ease: cubic-bezier(0.2, 0, 0, 1);
}
.tsit {
  color: var(--tsit-body);
  caret-color: var(--tsit-blue);
  accent-color: var(--tsit-dark);
  font-family: var(--tsit-font, inherit);
  font-size: 16px;
  line-height: 1.5;
  max-width: 1180px;
  margin: 0 auto;
}
.tsit *,
.tsit *::before,
.tsit *::after { box-sizing: border-box; }
.tsit [hidden] { display: none !important; }
:where(.tsit) p { margin: 0; }
.tsit ::selection { background: var(--tsit-tint-2); color: var(--tsit-ink); }
.tsit__panel ::selection { background: var(--tsit-blue); color: var(--tsit-dark); }

.tsit.tsit .tsit__h {
  font-family: inherit;
  text-transform: none;
  color: var(--tsit-ink);
  font-weight: var(--tsit-h-weight) !important;
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 8px;
}
.tsit__intro { max-width: 68ch; margin: 0 0 32px; color: var(--tsit-body); text-wrap: pretty; }

/* ------------------------------------------------------------ layout */
.tsit__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: var(--tsit-gap);
  align-items: start;
}
.tsit--full[data-tsit-tool="net-back"] .tsit__layout,
.tsit--worksheet[data-tsit-tool="net-back"] .tsit__layout,
.tsit[data-tsit-tool="denial-bands"] .tsit__layout { grid-template-columns: minmax(0, 1fr); }
.tsit__main { min-width: 0; }
@media (min-width: 961px) {
  .tsit__panel { position: sticky; top: 24px; }
  /* Wide tools (4 agencies, 4 bands) put the panel under the form, side by side inside. */
  .tsit--full[data-tsit-tool="net-back"] .tsit__panel,
  .tsit--worksheet[data-tsit-tool="net-back"] .tsit__panel,
  .tsit[data-tsit-tool="denial-bands"] .tsit__panel {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: 40px;
    align-items: start;
  }
  .tsit--full[data-tsit-tool="net-back"] .tsit__panel > :not(.tsit__chart):not(.tsit__offer):not(.tsit__keep),
  .tsit--worksheet[data-tsit-tool="net-back"] .tsit__panel > :not(.tsit__chart):not(.tsit__offer):not(.tsit__keep),
  .tsit[data-tsit-tool="denial-bands"] .tsit__panel > :not(.tsit__chart):not(.tsit__offer):not(.tsit__keep) { grid-column: 1; }
  .tsit--full[data-tsit-tool="net-back"] .tsit__chart,
  .tsit--worksheet[data-tsit-tool="net-back"] .tsit__chart,
  .tsit[data-tsit-tool="denial-bands"] .tsit__chart { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }
  .tsit--full[data-tsit-tool="net-back"] .tsit__offer,
  .tsit--full[data-tsit-tool="net-back"] .tsit__keep,
  .tsit--worksheet[data-tsit-tool="net-back"] .tsit__offer,
  .tsit[data-tsit-tool="denial-bands"] .tsit__offer,
  .tsit[data-tsit-tool="denial-bands"] .tsit__keep { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .tsit__layout { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ errors */
.tsit__errors {
  border: 2px solid var(--tsit-error);
  border-radius: var(--tsit-radius);
  background: #FFFFFF;
  padding: 16px 20px;
  margin: 0 0 var(--tsit-gap);
}
.tsit__errors:focus-visible { outline: 3px solid var(--tsit-blue); outline-offset: 2px; }
.tsit__errors-h { font-weight: 600; color: var(--tsit-error); margin-bottom: 4px; }
.tsit__errors ul { margin: 0; padding-left: 1.25em; }
.tsit__errors a { color: var(--tsit-error); }

/* -------------------------------------------------------------- steps */
.tsit__form { counter-reset: tsit-step; }
.tsit__step { counter-increment: tsit-step; }
.tsit__step > legend,
.tsit__step-h {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tsit-ink);
  font-weight: 600;
  font-size: 18px;
  padding: 0;
  margin: 0 0 14px;
}
/* A lone step needs no number. */
.tsit__form:not(:has(.tsit__step ~ .tsit__step)) .tsit__step > legend::before,
.tsit__form:not(:has(.tsit__step ~ .tsit__step)) .tsit__step-h::before { display: none; }
.tsit__step > legend::before,
.tsit__step-h::before {
  content: counter(tsit-step);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--tsit-radius);
  background: var(--tsit-dark);
  color: #FFFFFF;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.tsit__set {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
  min-width: 0;
}
fieldset.tsit__set > legend { float: left; width: 100%; }
fieldset.tsit__set > legend + * { clear: both; }
.tsit__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 20px;
}
/* Four fields read as a 2 x 2 block, not a row of three and an orphan. */
.tsit__grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(max(220px, 40%), 1fr)); }

/* Agencies and bands: compact cards side by side. */
.tsit__step--groups { margin: 0 0 28px; }
.tsit__groups {
  display: grid;
  grid-template-columns: repeat(var(--tsit-cols, 2), minmax(0, 1fr));
  gap: 16px;
}
.tsit__groups--4 { --tsit-cols: 4; }
.tsit__groups--2 { --tsit-cols: 2; }
@media (max-width: 1100px) { .tsit__groups--4 { --tsit-cols: 2; } }
@media (max-width: 640px) { .tsit__groups { --tsit-cols: 1; } }
.tsit__group {
  background: var(--tsit-tint);
  border: 1px solid var(--tsit-tint-2);
  border-radius: var(--tsit-radius);
  padding: 14px 16px 2px;
  margin: 0;
}
.tsit__group > legend {
  float: left;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tsit-label);
  padding: 0;
  margin: 0 0 10px;
}
.tsit__group > legend + * { clear: both; }

/* -------------------------------------------------------------- fields */
.tsit__field { margin: 0 0 16px; display: flex; flex-direction: column; }
/* Side-by-side fields keep their boxes on one line even when hints differ in length. */
.tsit__field > .tsit__box { margin-top: auto; }
.tsit__field > .tsit__err { order: 3; }
.tsit__field label { display: block; color: var(--tsit-ink); font-weight: 600; font-size: 15px; line-height: 1.35; }
.tsit__hint { margin: 2px 0 8px; font-size: 13px; line-height: 1.45; color: var(--tsit-muted); text-wrap: pretty; }
/* One field guide above repeated cards, instead of the same hint in every card. */
.tsit__guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 24px;
  margin: 0 0 18px;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--tsit-rule);
  font-size: 13px;
  line-height: 1.45;
}
.tsit__guide dt { color: var(--tsit-ink); font-weight: 600; }
.tsit__guide dd { margin: 2px 0 0; color: var(--tsit-muted); text-wrap: pretty; }
/* Card hints: hidden while the guide sits above the cards. Quick checks have
   no guide, so the first card shows them and the others keep the same space
   so the boxes still line up. On phones the cards stack far below the guide,
   so the guide goes and the first card shows the hints instead. */
/* Cards sit on the tint, where the muted gray is 4.3:1; the label color is 6.9:1. */
.tsit__group .tsit__hint { color: var(--tsit-label); }
.tsit__hint--card { display: none; }
.tsit--quick .tsit__hint--card { display: block; }
.tsit--quick .tsit__group:not([data-group="0"]) .tsit__hint--card { visibility: hidden; }
@media (max-width: 640px) {
  .tsit__guide { display: none; }
  .tsit__group[data-group="0"] .tsit__hint--card { display: block; }
  .tsit__group:not([data-group="0"]) .tsit__hint--card { display: none; }
}
.tsit__group .tsit__field label { margin-bottom: 6px; }
.tsit__box { position: relative; display: flex; align-items: stretch; }
.tsit__box input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 46px;
  font: inherit;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--tsit-ink);
  background: #FFFFFF;
  border: 1px solid var(--tsit-line);
  border-radius: var(--tsit-radius);
  padding: 10px 12px;
  transition-property: border-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: var(--tsit-ease);
}
.tsit__box--pre input { padding-left: 28px; }
.tsit__box--suf input { padding-right: 72px; }
.tsit__affix {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  color: var(--tsit-muted);
  font-size: 15px;
  pointer-events: none;
}
.tsit__affix--pre { left: 12px; }
.tsit__affix--suf { right: 12px; }
.tsit__box input:focus { outline: none; border-color: var(--tsit-blue); box-shadow: 0 0 0 3px rgba(67, 150, 246, 0.35); }
.tsit__box input[aria-invalid="true"] { border: 2px solid var(--tsit-error); }
@media (hover: hover) { .tsit__box input:hover:not(:focus) { border-color: var(--tsit-dark); } }
.tsit__err { margin-top: 6px; font-size: 14px; color: var(--tsit-error); font-weight: 600; }
.tsit__err::before { content: "Error: "; }
.tsit__partial { margin: -6px 0 14px; font-size: 13px; color: var(--tsit-label); font-style: normal; }

/* ------------------------------------------------------------- buttons */
.tsit__buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 var(--tsit-gap); }
.tsit.tsit .tsit__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  color: var(--tsit-dark);
  background: #FFFFFF;
  border: 1px solid var(--tsit-dark);
  border-radius: var(--tsit-radius);
  -webkit-tap-highlight-color: transparent;
  transition-property: background-color, color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.tsit.tsit .tsit__btn--primary { color: #FFFFFF; background: var(--tsit-dark); }
@media (max-width: 480px) {
  .tsit__buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .tsit.tsit .tsit__buttons > .tsit__btn--primary { grid-column: 1 / -1; }
  .tsit.tsit .tsit__buttons > .tsit__btn { padding-inline: 12px; }
}
@media (max-width: 400px) {
  .tsit__buttons { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: hover) {
  .tsit.tsit .tsit__btn:hover { background: var(--tsit-tint); color: var(--tsit-dark); text-decoration: none; }
  .tsit.tsit .tsit__btn--primary:hover { background: var(--tsit-panel-track); color: #FFFFFF; }
}
.tsit.tsit .tsit__btn:focus-visible { outline: 3px solid var(--tsit-blue); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .tsit.tsit .tsit__btn:not(:disabled):active { scale: 0.96; }
}
.tsit.tsit .tsit__btn[disabled] { opacity: .6; cursor: progress; }
.tsit__excel { margin: -8px 0 var(--tsit-gap); font-size: 14px; }
.tsit__excel a { color: var(--tsit-dark); text-underline-offset: 3px; }

/* --------------------------------------------------------- results panel */
.tsit__panel {
  background: var(--tsit-dark);
  color: var(--tsit-panel-ink);
  border-radius: var(--tsit-radius);
  padding: 28px;
}
.tsit__panel-eyebrow,
.tsit__hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tsit-panel-muted);
}
.tsit__panel-eyebrow { margin-bottom: 14px; }
.tsit__panel-eyebrow:has(+ .tsit__empty[hidden]) { display: none; }
.tsit__empty { color: var(--tsit-panel-muted); font-size: 15px; padding: 8px 0 20px; text-wrap: pretty; }
.tsit__hero-eyebrow { color: var(--tsit-blue); margin-bottom: 6px; }
.tsit__hero-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tsit__hero-num {
  font-weight: 300;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tsit__hero-unit { color: var(--tsit-panel-muted); font-size: 15px; }
.tsit__hero-sub { margin-top: 8px; color: var(--tsit-panel-ink); font-size: 15px; text-wrap: pretty; }
.tsit__pill {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tsit-dark);
  background: var(--tsit-tint-2);
}
.tsit__pill--good { background: var(--tsit-good); }
.tsit__pill--warn { background: var(--tsit-warn); }

.tsit__chart { margin-top: 24px; }
.tsit__chart:empty { display: none; }
.tsit__bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tsit__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  font-size: 14px;
}
.tsit__bar-label { color: var(--tsit-panel-ink); overflow-wrap: anywhere; }
.tsit__bar-value { color: var(--tsit-panel-ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tsit__bar-note { color: var(--tsit-panel-muted); font-weight: 400; margin-left: 6px; }
.tsit__tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tsit-good);
  color: var(--tsit-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.tsit__track {
  grid-column: 1 / -1;
  position: relative;
  height: 10px;
  background: var(--tsit-panel-track);
  border-radius: var(--tsit-radius);
  overflow: hidden;
}
.tsit__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  min-width: 2px;
  background: var(--tsit-blue);
  border-radius: var(--tsit-radius);
}
.tsit__bar.is-lead .tsit__fill { background: var(--tsit-good); }
/* Diverging: zero sits in the middle. */
.tsit__track--div::after {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: var(--tsit-panel-muted);
}
.tsit__track--div .tsit__fill { left: 50%; }
.tsit__bar.is-neg .tsit__fill { left: auto; right: 50%; background: var(--tsit-warn); }
.tsit__bar.is-neg .tsit__bar-value { color: #FFB066; }
.tsit__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--tsit-panel-muted);
}

/* Break-even scale */
.tsit__scale { padding: 34px 0 0; }
.tsit__scale-track { position: relative; height: 12px; background: #1F3D6B; border-radius: var(--tsit-radius); margin-bottom: 38px; }
.tsit__scale-lose { position: absolute; top: 0; bottom: 0; left: 0; background: var(--tsit-warn); border-radius: var(--tsit-radius) 0 0 var(--tsit-radius); }
.tsit__scale-mark { position: absolute; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; background: #FFFFFF; }
.tsit__scale-mark > span,
.tsit__scale-dot > span {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tsit__scale-mark > span { bottom: calc(100% + 4px); color: #FFFFFF; }
.tsit__scale-dot {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--tsit-warn);
  border: 3px solid var(--tsit-dark);
  box-shadow: 0 0 0 2px #FFFFFF;
}
.tsit__scale-dot.is-good { background: var(--tsit-good); }
.tsit__scale-dot > span { top: calc(100% + 8px); color: var(--tsit-panel-muted); }
/* Keep labels near either end inside the scale. */
.tsit__scale .is-start > span { translate: 0 0; left: -8px; }
.tsit__scale .is-end > span { translate: -100% 0; left: calc(100% + 8px); }

.tsit__summary { margin-top: 20px; color: var(--tsit-panel-ink); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.tsit__summary:empty { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .tsit__fill { transition: width 320ms var(--tsit-ease), left 320ms var(--tsit-ease); }
  .tsit__scale-lose { transition: width 320ms var(--tsit-ease); }
  .tsit__scale-mark, .tsit__scale-dot { transition: left 320ms var(--tsit-ease); }
  .tsit__hero:not([hidden]) { animation: tsit-in 300ms ease-out both; }
}
@keyframes tsit-in { from { opacity: 0; translate: 0 8px; } }

/* --------------------------------------------------- offer (in the panel) */
.tsit__offer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #1F3D6B;
}
.tsit__offer-h { color: #FFFFFF; font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.tsit__offer p:not(.tsit__offer-h):not(.tsit__fine) { color: var(--tsit-panel-muted); font-size: 14px; }
.tsit.tsit .tsit__offer .tsit__btn--primary {
  width: 100%;
  margin-top: 14px;
  text-align: center;
  text-wrap: balance;
  background: var(--tsit-blue);
  border-color: var(--tsit-blue);
  color: var(--tsit-dark);
}
@media (hover: hover) { .tsit.tsit .tsit__offer .tsit__btn--primary:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--tsit-dark); } }
.tsit.tsit .tsit__offer .tsit__btn--primary:focus-visible { outline-color: #FFFFFF; }
.tsit__fine { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--tsit-panel-muted); }
.tsit.tsit .tsit__fine a { color: #FFFFFF; }

.tsit__keep { margin-top: 16px; }
.tsit__keep summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: #FFFFFF;
  min-height: 44px;
  padding: 10px 0;
  list-style-position: inside;
}
.tsit__keep summary:focus-visible { outline: 3px solid var(--tsit-blue); outline-offset: 2px; }
.tsit__keep-form { padding-top: 10px; }
.tsit__keep .tsit__grid { grid-template-columns: minmax(0, 1fr); }
/* Wide tools: the panel spans the page, so the three fields sit in a row. */
@media (min-width: 961px) {
  .tsit--full[data-tsit-tool="net-back"] .tsit__keep .tsit__grid,
  .tsit[data-tsit-tool="denial-bands"] .tsit__keep .tsit__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tsit--full[data-tsit-tool="net-back"] .tsit__keep,
  .tsit[data-tsit-tool="denial-bands"] .tsit__keep { max-width: 860px; }
  .tsit.tsit--full[data-tsit-tool="net-back"] .tsit__offer .tsit__btn--primary,
  .tsit.tsit--worksheet[data-tsit-tool="net-back"] .tsit__offer .tsit__btn--primary,
  .tsit.tsit[data-tsit-tool="denial-bands"] .tsit__offer .tsit__btn--primary { width: auto; min-width: 20rem; padding-inline: 28px; }
}
.tsit__keep label { color: #FFFFFF; font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }
.tsit__keep input[type="email"],
.tsit__keep input[type="text"] {
  width: 100%;
  min-height: 44px;
  font: inherit;
  color: var(--tsit-dark);
  background: #FFFFFF;
  border: 1px solid #FFFFFF;
  border-radius: var(--tsit-radius);
  padding: 8px 12px;
}
.tsit__keep input:focus { outline: 3px solid var(--tsit-blue); outline-offset: 1px; }
.tsit.tsit .tsit__keep .tsit__btn { background: #FFFFFF; border-color: #FFFFFF; }
.tsit__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tsit__keep-status { margin-top: 8px; font-size: 14px; color: #FFFFFF; }
.tsit__keep-status:empty { display: none; }

/* -------------------------------------------- mobile result bar ("peek") */
.tsit__peek { display: none; }
@media (max-width: 960px) {
  .tsit:not(.tsit--has-result) .tsit__peek { display: none !important; }
  .tsit__peek {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: baseline;
    gap: 8px;
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    margin: 0 -16px calc(-52px - env(safe-area-inset-bottom, 0px) - var(--tsit-gap));
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: var(--tsit-dark);
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
  }
  .tsit__peek:focus-visible { outline: 3px solid #FFFFFF; outline-offset: -5px; }
  .tsit__peek-label { color: var(--tsit-panel-muted); }
  .tsit__peek strong { font-size: 18px; font-variant-numeric: tabular-nums; }
  .tsit__peek > span[aria-hidden] { margin-left: auto; }
}

/* Wide tools put the panel under the form on desktop too, so the bar shows there as well. */
@media (min-width: 961px) {
  .tsit--full[data-tsit-tool="net-back"].tsit--has-result .tsit__peek,
  .tsit--worksheet[data-tsit-tool="net-back"].tsit--has-result .tsit__peek,
  .tsit[data-tsit-tool="denial-bands"].tsit--has-result .tsit__peek {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: baseline;
    gap: 8px;
    height: 52px;
    /* Takes no room in the flow, so the panel sits where it did and nothing shifts. */
    margin-bottom: calc(-52px - var(--tsit-gap));
    padding: 12px 28px;
    background: var(--tsit-dark);
    color: #FFFFFF;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid var(--tsit-body);
  }
  .tsit--has-result .tsit__peek:focus-visible { outline: 3px solid #FFFFFF; outline-offset: -5px; }
  .tsit--has-result .tsit__peek-label { color: var(--tsit-panel-muted); }
  .tsit--has-result .tsit__peek strong { font-size: 18px; font-variant-numeric: tabular-nums; }
  .tsit--has-result .tsit__peek > span[aria-hidden] { margin-left: auto; }
}

.tsit.tsit--panel-seen .tsit__peek,
.tsit.tsit--buttons-seen .tsit__peek { visibility: hidden; }
/* Keyboard focus scrolls fields clear of the bar instead of under it. */
html:has(.tsit--has-result .tsit__peek) { scroll-padding-bottom: 80px; }

/* ------------------------------------------------------- the full math */
/* The break-even worksheet shows its grid open on load; hold the space so
   the article below doesn't jump when the script builds it. */
@media (scripting: enabled) {
  .tsit--worksheet[data-tsit-tool="denial-break-even"] .tsit__table:empty { min-height: 583px; }
}
@media (scripting: enabled) and (max-width: 640px) {
  .tsit--worksheet[data-tsit-tool="denial-break-even"] .tsit__table:empty { min-height: 668px; }
}
.tsit__results { margin: 28px 0 16px; }
.tsit__math > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--tsit-dark);
  padding: 12px 0;
  border-top: 1px solid var(--tsit-rule);
}
.tsit__math > summary:focus-visible { outline: 3px solid var(--tsit-blue); outline-offset: 2px; }
.tsit__table-h { font-weight: 600; color: var(--tsit-ink); margin: 24px 0 6px; }
.tsit__scroll { overflow-x: auto; margin-bottom: 10px; }
.tsit__scroll:focus-visible { outline: 3px solid var(--tsit-blue); }
.tsit table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 15px; }
.tsit caption { text-align: left; font-weight: 600; color: var(--tsit-ink); padding: 0 0 8px; }
.tsit th,
.tsit td { border-bottom: 1px solid var(--tsit-rule); padding: 10px 12px; vertical-align: top; }
.tsit thead th { text-align: right; color: var(--tsit-ink); background: var(--tsit-tint); font-weight: 600; }
.tsit thead td { background: var(--tsit-tint); }
.tsit thead tr > :first-child { text-align: left; }
.tsit tbody th { text-align: left; font-weight: 600; color: var(--tsit-ink); }
.tsit td { text-align: right; white-space: nowrap; color: var(--tsit-ink); }
/* Narrow screens: row labels stay readable and pinned while the numbers scroll. */
@media (max-width: 640px) {
  .tsit table { font-size: 14px; }
  .tsit caption { position: sticky; left: 0; max-width: calc(100vw - 32px); }
  .tsit th, .tsit td { padding: 10px 8px; }
  .tsit tbody th { min-width: 7.5em; position: sticky; left: 0; z-index: 1; background: #FFFFFF; box-shadow: 1px 0 0 var(--tsit-rule); }
  .tsit thead tr > :first-child { position: sticky; left: 0; z-index: 1; }
  .tsit td { white-space: normal; min-width: 6.5em; }
  .tsit thead th { white-space: nowrap; }
}
.tsit__neg { color: var(--tsit-error) !important; }
.tsit__rownote {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.tsit__note { font-size: 13px; line-height: 1.55; color: var(--tsit-muted); max-width: 72ch; margin: 0 0 10px; }

/* ------------------------------------------------------------- print */
@media print {
  .tsit__buttons, .tsit__excel, .tsit__offer, .tsit__keep, .tsit__errors, .tsit__peek, .tsit__chart { display: none !important; }
  .tsit__panel { background: none; color: #000; border: 1px solid #000; }
  .tsit__layout { display: block; }
  .tsit__math > :not(summary) { display: block !important; }
  .tsit__math::details-content { content-visibility: visible; display: block; }
  .tsit__rownote { position: static; width: auto; height: auto; clip: auto; clip-path: none; white-space: normal; display: block; font-weight: 400; font-size: .8em; }
  .tsit__scroll { overflow: visible; }
}
