/* ==========================================================================
   Total FM sector page (/sectors/total-fm)
   Page-specific classes use the `tf-` prefix. Colours: --v2-* tokens or the
   page tokens below (defined for both themes). Section styling mirrors the
   Field Services page so the two sector pages stay consistent.
   ========================================================================== */
:root,
[data-theme="light"] {
  --tf-player-bg: #EBEFE2;
  --tf-player-overlay: none;
  --tf-player-shadow: 0 30px 70px rgba(33, 30, 40, 0.14);
  --tf-card-bg: #FFFFFF;
  --tf-card-border: #DDD9CF;
  --tf-tint: #E9F0C8;
  --tf-track: #D3CEC2;
  --tf-bar-muted: #A39DB0;
  --tf-ctl-bg: rgba(255, 255, 255, 0.85);
  --tf-sent-bg: #FFFFFF;
  --tf-on: #211E28;      /* "done" chip / check circle / bars */
  --tf-on-fg: #DDEE93;
  --tf-hero-rule: rgba(33, 30, 40, 0.16);
  --tf-hero-rail: rgba(33, 30, 40, 0.2);
  --tf-warn-bg: #F3D9C8;
  --tf-warn-fg: #7A3412;
}
[data-theme="dark"] {
  --tf-player-bg: linear-gradient(to bottom, #2C3350 0%, #4A4A66 40%, #6C5A6E 70%, #9A6E68 100%);
  --tf-player-overlay: linear-gradient(to right, rgba(14, 10, 22, 0.5), rgba(14, 10, 22, 0.12));
  --tf-player-shadow: 0 40px 90px rgba(0, 0, 0, 0.4);
  --tf-card-bg: rgba(20, 16, 30, 0.66);
  --tf-card-border: rgba(246, 210, 176, 0.24);
  --tf-tint: rgba(221, 238, 147, 0.12);
  --tf-track: rgba(246, 210, 176, 0.22);
  --tf-bar-muted: rgba(246, 210, 176, 0.5);
  --tf-ctl-bg: rgba(255, 255, 255, 0.14);
  --tf-sent-bg: rgba(20, 16, 30, 0.92);
  --tf-on: #DDEE93;
  --tf-on-fg: #211E28;
  --tf-hero-rule: rgba(246, 210, 176, 0.16);
  --tf-hero-rail: rgba(246, 210, 176, 0.22);
  --tf-warn-bg: rgba(236, 150, 100, 0.22);
  --tf-warn-fg: #F6D2B0;
}

/* --------------------------------------------------------------------------
   01 Hero pipeline
   -------------------------------------------------------------------------- */
.tf-hero { padding-bottom: clamp(3.25rem, 2rem + 4.4vw, 6.25rem); }
.tf-hero__inner { display: grid; gap: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); }
.tf-hero__title {
  position: relative;
  margin: 0;
  padding-left: 30px;
  display: grid;
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: var(--v2-fs-h1);
  line-height: 1.08;
  letter-spacing: var(--v2-ls-h);
}
.tf-hero__rail {
  position: absolute; left: 8px; top: 6%; bottom: 6%;
  width: 1px; background: var(--tf-hero-rail);
}
.tf-hero__dot {
  position: absolute; left: 3px; top: 87.5%;
  width: 11px; height: 11px; margin-top: -5px;
  border-radius: var(--v2-r-pill);
  background: var(--v2-accent);
  box-shadow: 0 0 0 6px var(--v2-accent-halo);
}
.tf-hero__line {
  display: flex; align-items: baseline;
  gap: clamp(0.875rem, 0.7rem + 0.8vw, 1.375rem);
  padding: 12px 0;
  border-bottom: 1px solid var(--tf-hero-rule);
}
.tf-hero__num {
  flex: none; width: 28px;
  font-family: var(--v2-font-text);
  font-size: clamp(0.8125rem, 0.77rem + 0.2vw, 0.9375rem);
  font-weight: 400; letter-spacing: 0.1em;
  color: var(--v2-accent-ink);
}
.tf-hero__text { min-width: 0; }
.tf-hero__paid {
  display: inline-block;
  padding: 0 clamp(10px, 0.4rem + 0.8vw, 18px);
  margin-left: calc(-1 * clamp(10px, 0.4rem + 0.8vw, 18px));
  border-radius: 14px;
  background: var(--v2-accent);
  color: #211E28;
}

/* Looping pipeline: lines appear one by one, the dot walks down the rail,
   "Paid." lights up, then everything fades and restarts (10s). The
   static (no-animation) state is the final, fully lit pipeline. */
@media (prefers-reduced-motion: no-preference) {
  .tf-hero__line { animation: 10s linear infinite both; }
  .tf-hero__line--1 { animation-name: tf-hero-l1; }
  .tf-hero__line--2 { animation-name: tf-hero-l2; }
  .tf-hero__line--3 { animation-name: tf-hero-l3; }
  .tf-hero__line--4 { animation-name: tf-hero-l4; }
  .tf-hero__paid { animation: tf-hero-paid 10s linear infinite both; }
  .tf-hero__dot { animation: tf-hero-dot 10s linear infinite both, tf-hero-pulse 1.9s ease-in-out infinite alternate; }
}
@keyframes tf-hero-l1 { 0%, 4% { opacity: 0; transform: translateY(14px); } 9%, 93% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; transform: none; } }
@keyframes tf-hero-l2 { 0%, 10.5% { opacity: 0; transform: translateY(14px); } 15.5%, 93% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; transform: none; } }
@keyframes tf-hero-l3 { 0%, 17% { opacity: 0; transform: translateY(14px); } 22%, 93% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; transform: none; } }
@keyframes tf-hero-l4 { 0%, 23.5% { opacity: 0; transform: translateY(14px); } 28.5%, 93% { opacity: 1; transform: none; } 99%, 100% { opacity: 0; transform: none; } }
@keyframes tf-hero-paid {
  0%, 36% { background-color: transparent; color: inherit; }
  40%, 100% { background-color: var(--v2-accent); color: #211E28; }
}
@keyframes tf-hero-dot {
  0%, 3.9% { opacity: 0; top: 12.5%; }
  4% { opacity: 1; top: 12.5%; }
  10.5% { top: 12.5%; }
  15.5% { top: 37.5%; }
  17% { top: 37.5%; }
  22% { top: 62.5%; }
  23.5% { top: 62.5%; }
  28.5% { top: 87.5%; }
  93% { opacity: 1; top: 87.5%; }
  99%, 100% { opacity: 0; top: 87.5%; }
}
@keyframes tf-hero-pulse {
  from { box-shadow: 0 0 0 6px var(--v2-accent-halo); }
  to { box-shadow: 0 0 0 10px var(--v2-accent-halo); }
}

/* --------------------------------------------------------------------------
   Shared section head spacing (design: 20px head gap, 56px to content)
   -------------------------------------------------------------------------- */
.tf-head { gap: clamp(0.875rem, 0.75rem + 0.5vw, 1.25rem); margin-bottom: clamp(2rem, 1.3rem + 2.9vw, 3.5rem); }
.tf-problem__sub { color: var(--v2-text-lead); }
.tf-problem .v2-col p { margin: 0; }
.tf-problem .v2-col h3 { margin: 0; }
/* Three problem columns (badge, title, text) with a top rule; stacked below 900px. */
.tf-problem__grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .tf-problem__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tf-problem__col { gap: clamp(1rem, 0.8rem + 0.8vw, 1.5rem); }
/* Columns side by side share their row tracks (badge, title, text), so a
   two-line title pushes every column's text down to the same line. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 900px) { .tf-problem__col { grid-row: span 3; grid-template-rows: subgrid; } }
}

/* --------------------------------------------------------------------------
   03 See it work: walkthrough player (9 steps, client email to sales invoice)
   -------------------------------------------------------------------------- */
.tf-see__head { gap: 16px; margin-bottom: clamp(1.625rem, 1.3rem + 1.3vw, 2.5rem); }
.tf-see__title { letter-spacing: -0.025em; }
.tf-see__sub { margin: 0; font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); color: var(--v2-text-muted); }

.tf-demo { display: grid; gap: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem); }
.tf-demo__stage { position: relative; display: grid; gap: 16px; }
.tf-demo__panels { position: relative; display: grid; }
.tf-panel {
  grid-area: 1 / 1;
  display: grid; gap: 18px; align-content: start;
  opacity: 0; transform: translateY(12px); visibility: hidden;
  transition: opacity 600ms ease, transform 600ms ease, visibility 0s linear 600ms;
}
.tf-panel.is-active {
  opacity: 1; transform: none; visibility: visible;
  transition: opacity 600ms ease, transform 600ms ease, visibility 0s;
}
.tf-panel__copy { display: grid; gap: 10px; max-width: 430px; }
.tf-panel__count { font-family: var(--v2-font-mono); font-size: 0.75rem; color: var(--v2-text-muted); }
.tf-panel__title {
  margin: 0;
  font-family: var(--v2-font-display); font-weight: 500;
  font-size: clamp(2.5rem, 2.05rem + 1.85vw, 4rem);
  letter-spacing: -0.03em; line-height: 1;
}
.tf-panel__text { margin: 0; font-size: clamp(1rem, 0.93rem + 0.3vw, 1.1875rem); line-height: 1.45; color: var(--v2-text-muted); }

.tf-demo__controls { display: flex; gap: 8px; justify-content: flex-end; order: -1; }
.tf-demo__ctl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--v2-chip-border); border-radius: var(--v2-r-pill);
  background: var(--tf-ctl-bg); color: var(--v2-text);
  font: inherit; font-size: 15px; cursor: pointer;
  transition: transform var(--v2-dur) var(--v2-ease), box-shadow var(--v2-dur) ease, background-color var(--v2-dur) ease;
}
.tf-demo__ctl svg { width: 13px; height: 13px; fill: currentColor; }
.tf-demo__ctl:hover { transform: scale(1.06); box-shadow: 0 0 0 8px var(--v2-accent-halo); }
.tf-demo__ctl:focus-visible { outline: 2px solid var(--v2-focus); outline-offset: 3px; }
.tf-demo__ctl--play { background: var(--v2-accent); border-color: transparent; color: #211E28; }
.tf-demo__icon-play { display: none; }
.tf-demo.is-paused .tf-demo__icon-pause { display: none; }
.tf-demo.is-paused .tf-demo__icon-play { display: block; }

/* Card inside the player */
.tf-card {
  box-sizing: border-box; width: 100%;
  background: var(--v2-card-bg);
  border: 1px solid var(--v2-chip-border);
  border-radius: 18px;
  padding: 14px 20px;
  display: flex; flex-direction: column;
}
.tf-card__head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 10px; min-height: 30px;
}
.tf-card__label { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--v2-text-muted); }
.tf-card__sublabel { display: block; padding: 14px 0 4px; }
.tf-muted { color: var(--v2-text-muted); }
.tf-strong { font-weight: 600; }
.tf-xs { font-size: 0.75rem; }
.tf-row { border-top: 1px solid var(--v2-border); }

.tf-chip {
  display: inline-block; white-space: nowrap; flex: none;
  font-size: 0.75rem; font-weight: 600; padding: 5px 12px; border-radius: var(--v2-r-pill);
  box-shadow: inset 0 0 0 1px var(--tf-card-border); color: var(--v2-text-muted);
  transition: background-color 400ms ease, color 400ms ease, box-shadow 400ms ease;
}
.tf-chip--on { background: var(--tf-on); color: var(--tf-on-fg); box-shadow: none; }
.tf-chip.is-pending, .tf-chip.is-off { background: transparent; color: var(--v2-text-muted); box-shadow: inset 0 0 0 1px var(--tf-card-border); }
.tf-chip.is-warn { background: var(--tf-warn-bg); color: var(--tf-warn-fg); box-shadow: none; }
.tf-card__head > .tf-chip { border-top: 0; }

.tf-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; font-size: 0.9375rem; }
.tf-kv > .tf-strong { text-align: right; }
.tf-msg { margin: 0; padding: 12px 0; font-size: 0.9375rem; line-height: 1.45; }
.tf-msg--first { border-top: 0; }
.tf-msg--first, .tf-msg--plain {
  margin: 6px 0; padding: 12px 16px; border-radius: 16px 16px 16px 4px; background: var(--tf-tint); border-top: 0;
}
.tf-msg--plain { background: transparent; box-shadow: inset 0 0 0 1px var(--tf-card-border); border-radius: 16px 16px 4px 16px; }
.tf-note { margin: 10px 0 4px; padding: 12px 16px; border-radius: 12px; background: var(--tf-tint); font-size: 0.9375rem; line-height: 1.4; border-top: 0; }

.tf-done { display: flex; align-items: center; gap: 12px; padding: 13px 0 4px; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.tf-done + .tf-done { padding-top: 10px; }
.tf-check { display: block; flex: none; width: 18px; height: 18px; }
.tf-check circle { fill: var(--tf-on); }
.tf-check path { fill: none; stroke: var(--tf-on-fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tf-cross {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 18px; border-radius: var(--v2-r-pill);
  background: var(--tf-warn-bg); color: var(--tf-warn-fg); font-size: 14px; line-height: 1; font-weight: 700;
}

/* Schedule: ranking */
.tf-rank {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 12px; align-items: center;
  padding: 10px 12px; margin: 0 -12px; border: 1px solid transparent; border-radius: 12px;
  font-size: 0.9375rem;
}
.tf-rank + .tf-rank { border-top-color: var(--v2-border); }
.tf-rank__n {
  grid-row: span 2; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--v2-r-pill);
  box-shadow: inset 0 0 0 1px var(--tf-card-border); font-size: 0.75rem; font-weight: 700;
}
.tf-rank__meta { grid-column: 2; font-size: 0.8125rem; color: var(--v2-text-muted); }
.tf-r0.tf-rank { border-color: var(--tf-on); background: var(--tf-tint); }
.tf-r0.tf-rank .tf-rank__n { background: var(--tf-on); color: var(--tf-on-fg); box-shadow: none; }
.tf-rank + .tf-note { margin-top: 12px; }

/* Compliance / bill checks */
.tf-check-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; font-size: 0.9375rem; line-height: 1.35; }
.tf-checks { list-style: none; margin: 0; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tf-checks > li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8125rem; font-weight: 600; padding: 5px 11px; border-radius: var(--v2-r-pill);
  background: var(--tf-tint);
}
.tf-checks > li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tf-on); }
.tf-passed { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 0; font-size: 0.9375rem; }

/* Remedials */
.tf-remedial { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; font-size: 0.9375rem; line-height: 1.4; }

/* Totals */
.tf-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0 6px; border-top-color: var(--tf-card-border); }
.tf-sum__num { font-family: var(--v2-font-display); font-weight: 500; letter-spacing: -0.02em; font-size: clamp(1.375rem, 1.3rem + 0.35vw, 1.625rem); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Steps / progress */
.tf-demo__steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.tf-demo__steps::-webkit-scrollbar { display: none; }
.tf-demo__steps > li { flex: none; scroll-snap-align: start; }
.tf-step {
  display: block; width: 100%; padding: 10px 16px; margin: 0;
  border: 0; border-radius: var(--v2-r-pill);
  box-shadow: inset 0 0 0 1px var(--v2-chip-border);
  background: transparent; color: var(--v2-text-muted);
  font: inherit; font-size: 0.875rem; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer;
  transition: background-color 400ms ease, color 400ms ease, opacity 400ms ease;
}
.tf-step:hover { color: var(--v2-text); }
.tf-step:focus-visible { outline: 2px solid var(--v2-focus); outline-offset: 3px; }
.tf-step.is-active { background: var(--v2-accent); color: #211E28; box-shadow: none; }
.tf-step__track { display: none; }
.tf-step__num { display: none; font-family: var(--v2-font-mono); font-size: 0.75rem; }

/* Row reveal (only while JS drives the walkthrough and motion is allowed) */
.tf-demo.is-animated .tf-row {
  opacity: 0; transform: translateY(8px);
  transition: opacity 450ms ease, transform 450ms ease;
}
.tf-demo.is-animated .is-active .tf-row { opacity: 1; transform: none; }
.tf-demo.is-animated .is-active .tf-r0 { transition-delay: 400ms; }
.tf-demo.is-animated .is-active .tf-r1 { transition-delay: 850ms; }
.tf-demo.is-animated .is-active .tf-r2 { transition-delay: 1300ms; }
.tf-demo.is-animated .is-active .tf-r3 { transition-delay: 1750ms; }
.tf-demo.is-animated .is-active .tf-r4 { transition-delay: 2200ms; }
.tf-demo.is-animated .is-active .tf-r5 { transition-delay: 2650ms; }
.tf-demo.is-animated .is-active .tf-r6 { transition-delay: 3100ms; }
.tf-demo.is-animated .is-active .tf-r7 { transition-delay: 3550ms; }
/* Header chips that are rows themselves pop in rather than slide */
.tf-demo.is-animated .tf-card__head > .tf-row { transform: scale(0.9); }
.tf-demo.is-animated .is-active .tf-card__head > .tf-row { transform: none; }
/* Best match highlight fades in after the ranking appears */
.tf-demo.is-animated .tf-r0.tf-rank { border-color: transparent; background: transparent; transition: opacity 450ms ease, transform 450ms ease, border-color 400ms ease, background-color 400ms ease; }
.tf-demo.is-animated .is-active .tf-r0.tf-rank { border-color: var(--tf-on); background: var(--tf-tint); transition-delay: 400ms, 400ms, 1900ms, 1900ms; }
/* Step progress fill (desktop track) */
.tf-demo.is-animated .tf-step.is-active .tf-step__fill { animation: tf-fill var(--tf-step-dur, 5.5s) linear both; }
.tf-demo.is-paused .tf-step.is-active .tf-step__fill { animation-play-state: paused; }
@keyframes tf-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (min-width: 600px) {
  .tf-rank { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; }
  .tf-rank__n { grid-row: auto; }
  .tf-rank__meta { grid-column: auto; text-align: right; }
}

@media (min-width: 900px) {
  .tf-demo__stage {
    display: block;
    min-height: 500px;
    border-radius: 26px; overflow: hidden;
    background: var(--tf-player-bg);
    box-shadow: var(--tf-player-shadow);
  }
  .tf-demo__stage::before { content: ""; position: absolute; inset: 0; background: var(--tf-player-overlay); pointer-events: none; }
  .tf-demo__panels { min-height: 500px; padding: 40px clamp(56px, 5vw, 140px) 76px 56px; box-sizing: border-box; }
  .tf-panel { justify-items: start; align-content: center; }
  .tf-panel .tf-card { max-width: 540px; }
  .tf-panel__copy { gap: 14px; }
  .tf-panel__count { font-size: 0.875rem; }
  .tf-demo__controls { position: absolute; left: 56px; bottom: 22px; z-index: 2; justify-content: flex-start; }
  .tf-demo__ctl { width: 34px; height: 34px; border-color: transparent; }
  .tf-demo__ctl--play { background: var(--tf-ctl-bg); color: var(--v2-text); }
  .tf-card { background: var(--tf-card-bg); border-color: var(--tf-card-border); padding: 20px 28px; }
  .tf-card__label { font-size: 0.75rem; }
  .tf-kv, .tf-msg, .tf-check-row, .tf-remedial, .tf-done, .tf-rank { font-size: 1rem; }

  .tf-demo__steps { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 14px; overflow: visible; }
  .tf-step {
    display: grid; gap: 12px; padding: 0 0 4px; border-radius: 0; box-shadow: none;
    background: transparent; color: var(--v2-text); opacity: 0.5; font-size: 0.9375rem; white-space: normal;
  }
  .tf-step:hover { opacity: 0.8; }
  .tf-step.is-active { background: transparent; color: var(--v2-text); opacity: 1; }
  .tf-step__track { display: block; height: 2px; background: var(--tf-track); overflow: hidden; }
  .tf-step__fill { display: block; height: 100%; background: var(--tf-on); transform-origin: left; transform: scaleX(0); }
  .tf-step.is-done .tf-step__fill, .tf-step.is-active .tf-step__fill { transform: scaleX(1); }
  .tf-step__label { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
  .tf-step__num { display: inline; }
}
@media (min-width: 1200px) {
  .tf-panel {
    grid-template-columns: minmax(0, 430px) minmax(0, 540px);
    justify-content: space-between; align-items: center; gap: 40px;
  }
}
@media (max-width: 1199.98px) {
  /* Narrow screens: the stage takes the height of the current step only. */
  .tf-panel:not(.is-active) { position: absolute; top: 0; left: 0; width: 100%; }
}
@media (min-width: 900px) and (max-width: 1199.98px) {
  .tf-panel:not(.is-active) { top: 40px; left: 56px; right: clamp(56px, 5vw, 140px); width: auto; }
}
@media (max-width: 899.98px) { .tf-demo__steps { order: -1; } }


/* --------------------------------------------------------------------------
   05 Results
   -------------------------------------------------------------------------- */
.tf-results__inner { display: grid; gap: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }
.tf-results__sub { margin: 0; max-width: 820px; }
.tf-results__group { display: grid; gap: 22px; }
.tf-results__lab { margin: 0; font-weight: 400; }
.tf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.tf-stats .v2-body { margin: 0; }
.tf-statnum { color: var(--v2-accent-ink); font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .tf-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
}

/* --------------------------------------------------------------------------
   04 What TYTEN does
   -------------------------------------------------------------------------- */
.tf-does__head .v2-h2 { letter-spacing: -0.025em; }
.tf-does__sub { margin: 0; }
.tf-does__grid { list-style: none; margin: 0; padding: 0; }
.tf-does__card .v2-card__title { margin-bottom: 0; }
/* While the auto-highlight runs, the other cards only lift on real hover. */
.tf-does__grid.is-cycling:hover .tf-does__card.is-active:not(:hover) {
  border-color: var(--v2-border); background: var(--v2-card-bg); transform: none;
}

/* --------------------------------------------------------------------------
   06 Integrations
   -------------------------------------------------------------------------- */
:root, [data-theme="light"] {
  --tf-int-line: rgba(33, 30, 40, 0.16);
  --tf-int-fill: rgba(33, 30, 40, 0.02);
  --tf-sys-border: rgba(33, 30, 40, 0.22);
  --tf-sys-bg: rgba(33, 30, 40, 0.03);
  --tf-st-new: #8A8094;
  --tf-st-future: #7E7488;
}
[data-theme="dark"] {
  --tf-int-line: rgba(246, 210, 176, 0.18);
  --tf-int-fill: rgba(255, 255, 255, 0.03);
  --tf-sys-border: rgba(246, 210, 176, 0.24);
  --tf-sys-bg: rgba(255, 255, 255, 0.04);
  --tf-st-new: #B7ABB9;
  --tf-st-future: #9D93A6;
}
.tf-int__top { display: grid; gap: 24px; margin-bottom: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }
.tf-int__head .v2-h2 { letter-spacing: -0.025em; line-height: 1.05; }
.tf-int__sub { margin: 0; max-width: 560px; }

.tf-int__table { border: 1px solid var(--tf-int-line); border-radius: clamp(20px, 1rem + 1vw, 30px); overflow: hidden; background: var(--tf-int-fill); }
.tf-int__row { display: grid; gap: 16px; padding: 22px 20px; }
.tf-int__row + .tf-int__row { border-top: 1px solid var(--tf-int-line); }
.tf-int__cat { margin: 0; font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--v2-text-muted); font-weight: 600; }
.tf-int__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tf-sys {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--tf-sys-border); background: var(--tf-sys-bg);
  transition: border-color 400ms ease, background-color 400ms ease;
}
.tf-sys--future { opacity: 0.5; }
/* Vendor tags: the whole tag is the link target (stretched ::after), so the tag keeps its padding/look. */
.tf-sys--link { position: relative; }
.tf-sys__link { color: inherit; text-decoration: none; }
.tf-sys__link::after { content: ""; position: absolute; inset: -1px; border-radius: 12px; }
.tf-sys__link:focus-visible { outline: none; }
.tf-sys__link:focus-visible::after { outline: 2px solid var(--v2-focus); outline-offset: 2px; }
.tf-sys--link:hover,
.tf-sys--link:has(.tf-sys__link:focus-visible) { border-color: var(--v2-accent); background: var(--v2-accent-tint); }
.tf-sys--link:hover .tf-sys__link { color: var(--v2-accent-ink); }
.tf-sys--more { border-color: var(--v2-accent-tint-border); background: var(--v2-accent-tint); color: var(--v2-accent-ink); }
.tf-sys__st { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.tf-sys__st--live { color: var(--v2-accent-ink); }
.tf-sys__st--new { color: var(--tf-st-new); }
.tf-sys__st--future { color: var(--tf-st-future); }

.tf-int__beyond { display: grid; gap: 28px; margin-top: clamp(3rem, 2.3rem + 2.9vw, 4.5rem); align-items: start; }
.tf-int__beyond-head { display: grid; gap: 18px; }
.tf-int__beyond-title { margin: 0; font-family: var(--v2-font-display); font-weight: 500; font-size: clamp(1.75rem, 1.5rem + 1.05vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; }
.tf-int__papers { list-style: none; margin: 0; padding: 0; display: grid; }
.tf-int__papers > li {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--tf-int-line);
  font-size: clamp(1.125rem, 1.03rem + 0.4vw, 1.375rem); line-height: 1.35;
}
.tf-int__papers strong { font-weight: 600; }
.tf-int__pnum { font-family: var(--v2-font-mono); font-size: 0.875rem; color: var(--v2-text-muted); }
.tf-int__trust { margin: 36px 0 0; font-size: 1rem; line-height: 1.6; color: var(--v2-text-muted); max-width: 900px; }
.tf-int__trust a { color: inherit; text-decoration: underline; text-decoration-color: var(--v2-accent-ink); text-underline-offset: 3px; }
.tf-int__trust a:hover { color: var(--v2-accent-ink); }
.tf-int__cards { display: grid; gap: 18px; margin-top: clamp(2.5rem, 1.9rem + 2.4vw, 4rem); }
.tf-int__card {
  border: 1px solid var(--tf-int-line); border-radius: 24px; background: var(--tf-int-fill);
  padding: clamp(24px, 1.2rem + 1vw, 34px) clamp(22px, 1rem + 1.5vw, 38px);
  display: grid; gap: 14px; align-content: start;
}
.tf-int__card-title { margin: 0; font-family: var(--v2-font-display); font-weight: 600; font-size: clamp(1.375rem, 1.24rem + 0.57vw, 1.75rem); letter-spacing: -0.02em; }
.tf-int__card p { margin: 0; font-size: var(--v2-fs-body); line-height: 1.55; color: var(--v2-text-muted); max-width: 460px; }
.tf-int__legal { margin: 36px 0 0; font-size: 0.8125rem; line-height: 1.6; color: var(--v2-text-muted); max-width: 1000px; }

@media (min-width: 900px) {
  .tf-int__row { grid-template-columns: minmax(180px, 290px) minmax(0, 1fr); gap: 32px; align-items: center; padding: 30px 44px; }
  .tf-int__cat { font-size: 0.8125rem; }
  .tf-int__chips { gap: 12px; }
  .tf-sys { font-size: 1.125rem; padding: 12px 18px; }
  .tf-int__beyond { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(40px, 5vw, 80px); }
  .tf-int__papers > li { grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 18px 0; }
  .tf-int__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

/* --------------------------------------------------------------------------
   07 You stay in control
   -------------------------------------------------------------------------- */
.tf-ctrl__grid { display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: start; }
.tf-ctrl__intro { display: grid; gap: 28px; align-content: space-between; height: 100%; }
.tf-ctrl__note { margin: 0; max-width: 420px; }
.tf-ctrl__list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--v2-line); }
.tf-ctrl__list .v2-ctrl { padding: 22px 0; }
.tf-ctrl__icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: var(--v2-r-pill); background: var(--v2-accent);
}
.tf-ctrl__icon svg { width: 22px; height: 22px; fill: none; stroke: #211E28; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tf-ctrl__txt { display: grid; gap: 8px; }
.tf-ctrl__title { margin: 0; font-size: clamp(1.25rem, 1.2rem + 0.2vw, 1.375rem); }
.tf-ctrl__txt p { margin: 0; }
@media (min-width: 900px) {
  .tf-ctrl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-ctrl__list .v2-ctrl { padding: 26px 0; }
}

/* --------------------------------------------------------------------------
   08 Your first 60 days: timeline lights up step by step (10s loop)
   -------------------------------------------------------------------------- */
.tf-days__inner { display: grid; gap: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }
.tf-days__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.tf-days__step { display: grid; gap: 14px; align-content: start; }
.tf-days__title { margin: 0; font-size: clamp(1.25rem, 1.2rem + 0.2vw, 1.375rem); }
.tf-days__step p { margin: 0; }
/* Steps side by side share row tracks so body text starts on one line. */
@supports (grid-template-rows: subgrid) {
  .tf-days__step { grid-row: span 4; grid-template-rows: subgrid; }
}
.tf-days__track { position: relative; display: block; height: 22px; }
.tf-days__track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--v2-line-soft); }
.tf-days__fill { position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--v2-accent); transform-origin: left; }
.tf-days__step--4 .tf-days__fill { transform: scaleX(0); }
.tf-days__dot {
  position: absolute; left: 0; top: 4px; width: 14px; height: 14px; box-sizing: border-box;
  border-radius: var(--v2-r-pill); border: 2px solid var(--v2-accent); background: var(--v2-accent);
}
.tf-days__banner { margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .tf-days__step--1 .tf-days__fill { animation: tf-days-f1 10s linear infinite both; }
  .tf-days__step--2 .tf-days__fill { animation: tf-days-f2 10s linear infinite both; }
  .tf-days__step--3 .tf-days__fill { animation: tf-days-f3 10s linear infinite both; }
  .tf-days__step--2 .tf-days__dot { animation: tf-days-d2 10s linear infinite both; }
  .tf-days__step--3 .tf-days__dot { animation: tf-days-d3 10s linear infinite both; }
  .tf-days__step--4 .tf-days__dot { animation: tf-days-d4 10s linear infinite both; }
}
@keyframes tf-days-f1 { 0%, 23% { transform: scaleX(0); } 30%, 99.9% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes tf-days-f2 { 0%, 46% { transform: scaleX(0); } 53%, 99.9% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes tf-days-f3 { 0%, 69% { transform: scaleX(0); } 76%, 99.9% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes tf-days-d2 { 0%, 23% { background-color: var(--v2-bg); border-color: var(--v2-chip-border); } 28%, 100% { background-color: var(--v2-accent); border-color: var(--v2-accent); } }
@keyframes tf-days-d3 { 0%, 46% { background-color: var(--v2-bg); border-color: var(--v2-chip-border); } 51%, 100% { background-color: var(--v2-accent); border-color: var(--v2-accent); } }
@keyframes tf-days-d4 { 0%, 69% { background-color: var(--v2-bg); border-color: var(--v2-chip-border); } 74%, 100% { background-color: var(--v2-accent); border-color: var(--v2-accent); } }

/* --------------------------------------------------------------------------
   09 How we start
   -------------------------------------------------------------------------- */
.tf-start__list > li { display: grid; gap: 8px; padding: 22px 0; border-top: 1px solid var(--v2-line); }
.tf-start__list p { margin: 0; }
@media (min-width: 900px) { .tf-start__list > li { padding: 26px 0; } }

/* --------------------------------------------------------------------------
   10 Closing (soft glow) above the shared footer
   -------------------------------------------------------------------------- */
:root, [data-theme="light"] {
  --tf-rule: rgba(33, 30, 40, 0.3);
  --tf-glow-a: rgba(141, 178, 31, 0.13); --tf-glow-b: rgba(236, 150, 100, 0.22); --tf-glow-c: rgba(100, 125, 210, 0.2);
}
[data-theme="dark"] {
  --tf-rule: rgba(246, 210, 176, 0.3);
  --tf-glow-a: rgba(221, 238, 147, 0.13); --tf-glow-b: rgba(214, 156, 118, 0.2); --tf-glow-c: rgba(110, 120, 190, 0.22);
}
.tf-closing { position: relative; isolation: isolate; overflow: hidden; padding-top: clamp(3.5rem, 2.5rem + 4.4vw, 6.25rem); }
.tf-closing__inner { position: relative; padding-bottom: clamp(3rem, 2.3rem + 2.9vw, 4.5rem); }
.tf-closing__accent { color: var(--v2-accent-ink); }
.tf-closing__rule { height: 1px; background: linear-gradient(to right, transparent, var(--tf-rule), transparent); }
/* Night only: three soft glows drift slowly behind the closing line. */
.tf-closing__glows { display: none; position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
[data-theme="dark"] .tf-closing__glows { display: block; }
.tf-glow { position: absolute; display: block; }
.tf-glow--a { left: -10%; top: -35%; width: 70%; height: 130%; background: radial-gradient(closest-side, var(--tf-glow-a), transparent); }
.tf-glow--b { right: -15%; top: 0; width: 60%; height: 110%; background: radial-gradient(closest-side, var(--tf-glow-b), transparent); }
.tf-glow--c { left: 25%; bottom: -60%; width: 60%; height: 110%; background: radial-gradient(closest-side, var(--tf-glow-c), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .tf-glow--a { animation: tf-drift-a 31s ease-in-out infinite alternate; }
  .tf-glow--b { animation: tf-drift-b 36s ease-in-out infinite alternate; }
  .tf-glow--c { animation: tf-drift-c 42s ease-in-out infinite alternate; }
}
@keyframes tf-drift-a { from { transform: translate(-70px, 40px); } to { transform: translate(70px, -40px); } }
@keyframes tf-drift-b { from { transform: translate(55px, -50px); } to { transform: translate(-60px, 45px); } }
@keyframes tf-drift-c { from { transform: translate(-80px, -25px); } to { transform: translate(75px, 30px); } }

@media (prefers-reduced-motion: reduce) {
  .tf-hero__line, .tf-hero__paid, .tf-hero__dot, .tf-glow, .tf-days__fill, .tf-days__dot { animation: none !important; }
}

/* Phone fixes after visual check (design pd-03): white demo card, ink active step pill */
@media (max-width: 899.98px) {
  .tf-card { background: var(--tf-card-bg); border-color: var(--v2-border); }
  .tf-step.is-active { background: var(--tf-on); color: var(--tf-on-fg); }
}
