/* ============================================================
   Blue Door Software: free tools and demos (/tools/, /demos/,
   /ask-your-data/demo/, /what-happens-after-a-free-call/).
   Loaded only by those pages, after styles.css. Every class is
   prefixed (.tl-, .pd-, .ayx-, .doc-) so nothing else on the site
   changes. Paper for people, dark instrument panels for the machine.
   ============================================================ */

.tl-shell { padding-block: clamp(3.5rem, 7vw, 6rem) clamp(4rem, 8vw, 7rem); }
.tl-wrap { width: min(1080px, 100%); margin-inline: auto; padding-inline: var(--pad); }
.tl-narrow { max-width: 760px; }
.tl-hero { container-type: inline-size; max-width: 820px; }
.tl-hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-size: clamp(2.6rem, 10cqw, 5.2rem);
  line-height: 1.02;
}
.tl-hero .lede { margin-top: 1.3rem; }
.tl-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}
.tl-badges li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf8f0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tl-badges li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-ink);
}

.tl-section { margin-top: clamp(2.8rem, 6vw, 4.5rem); }
.tl-section > h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.tl-section > p, .tl-prose p, .tl-prose li { color: #33404a; line-height: 1.75; }
.tl-section > p { margin-top: 1rem; max-width: 68ch; }
.tl-prose ul { margin: 0.9rem 0 0; padding-left: 1.1rem; }
.tl-prose li + li { margin-top: 0.35rem; }
.tl-prose a, .tl-section > p a, .tl-note a, .tl-result a, .doc-sheet a {
  color: var(--cyan-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* ── Hub cards ───────────────────────────────────────────── */
.tl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(0.85rem, 1.6vw, 1.2rem);
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}
.tl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem 1.45rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbf8f0;
  overflow: hidden;
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 260ms ease, border-color 260ms ease;
}
.tl-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--cyan-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.tl-card:hover, .tl-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(10, 111, 131, 0.38);
  box-shadow: 0 22px 44px -24px rgba(11, 13, 16, 0.32), 0 3px 10px rgba(11, 13, 16, 0.04);
}
.tl-card:hover::before, .tl-card:focus-within::before { transform: scaleX(1); }
.tl-card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--cyan-ink);
}
.tl-card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tl-card .label { margin-top: 1.1rem; }
.tl-card h3 { margin-top: 0.4rem; font-size: 1.12rem; }
.tl-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tl-card h3 a:focus-visible { outline: none; }
.tl-card:focus-within { outline: 2px solid var(--cyan-ink); outline-offset: 3px; }
.tl-card p { margin-top: 0.55rem; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }
.tl-card .tl-go {
  margin-top: auto;
  padding-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-ink);
}

/* ── Forms on paper (the site default inputs are dark) ─────── */
.tl-form { display: grid; gap: 1rem; margin-top: 1.8rem; }
.tl-q {
  margin: 0;
  padding: 1.3rem 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbf8f0;
  min-width: 0;
}
.tl-q legend, .tl-q > .tl-q-title {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.tl-q legend { float: left; width: 100%; }
.tl-q legend + * { clear: both; }
.tl-n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: -0.15rem;
  border: 1px solid rgba(10, 111, 131, 0.38);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--cyan-ink);
}
.tl-hint { margin-top: 0.4rem; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.tl-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}
.tl-choice { position: relative; display: block; cursor: pointer; }
.tl-choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tl-choice span {
  display: block;
  height: 100%;
  padding: 0.7rem 0.85rem 0.7rem 2.35rem;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.94rem;
  line-height: 1.45;
  color: #26303a;
  position: relative;
  transition: border-color 160ms ease, background 160ms ease;
}
.tl-choice span::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 0.92rem;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: #fff;
}
.tl-choice input[type="checkbox"] + span::before { border-radius: 4px; }
.tl-choice:hover span { border-color: var(--cyan-ink); }
.tl-choice input:checked + span {
  border-color: var(--cyan-ink);
  background: rgba(10, 111, 131, 0.07);
}
.tl-choice input:checked + span::before {
  border-color: var(--cyan-ink);
  background: var(--cyan-ink);
  box-shadow: inset 0 0 0 3px #fff;
}
.tl-choice input:focus-visible + span { outline: 2px solid var(--cyan-ink); outline-offset: 2px; }
.tl-choice small { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.82rem; }

.tl-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 0.9rem 1rem;
  margin-top: 1rem;
}
.tl-field { display: grid; gap: 0.4rem; align-content: start; }
.tl-field > span {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tl-field small { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.tl-form input[type="text"], .tl-form input[type="number"], .tl-form select, .tl-form textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
}
.tl-form input:hover, .tl-form select:hover { border-color: var(--ink); }
.tl-form input:focus-visible, .tl-form select:focus-visible, .tl-form textarea:focus-visible {
  outline: 2px solid var(--cyan-ink);
  outline-offset: 1px;
  border-color: var(--cyan-ink);
}
.tl-form input.tl-example { background: #fff8e8; border-style: dashed; }

.tl-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-top: 0.4rem; }
.tl-btn-small { min-height: 42px; padding-inline: 1.1rem; font-size: 0.88rem; }
.tl-example-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #fff1d6;
  color: var(--amber-ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tl-example-flag[hidden] { display: none; }

/* ── Result panel: the machine's answer, on dark ──────────── */
.tl-result {
  --tl-signal: var(--cyan);
  margin-top: 1.6rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  border: 1px solid rgba(11, 13, 16, 0.5);
  border-radius: 14px;
  background:
    radial-gradient(130% 105% at 10% -10%, rgba(34, 211, 238, 0.07), transparent 60%),
    var(--panel);
  color: var(--d-ink);
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
}
.tl-result[hidden] { display: none; }
.tl-result.is-green { --tl-signal: var(--ok); }
.tl-result.is-amber { --tl-signal: var(--amber); }
.tl-result.is-red { --tl-signal: #fb7185; }
.tl-result:focus { outline: 2px solid var(--tl-signal); outline-offset: 3px; }
.tl-verdict { display: flex; gap: 1rem; align-items: flex-start; }
.tl-light {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: var(--tl-signal);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tl-signal) 22%, transparent), 0 0 22px var(--tl-signal);
}
.tl-result .label { color: var(--tl-signal); }
.tl-result h2, .tl-result h3.tl-headline {
  margin-top: 0.3rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.08;
  color: var(--d-ink);
}
.tl-result p, .tl-result li { color: #c9c7c0; font-size: 0.98rem; line-height: 1.7; }
.tl-result p { margin-top: 0.8rem; }
.tl-result ul { margin: 0.6rem 0 0; padding-left: 1.1rem; }
.tl-result h4, .tl-result h3.tl-sub {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--d-muted);
}
.tl-result a { color: var(--cyan); }
.tl-result .btn-ghost, .tl-cta .btn-ghost { border-color: var(--d-line); color: var(--d-ink); background: transparent; }
.tl-result .btn-ghost:hover { border-color: var(--d-ink); background: rgba(233, 231, 224, 0.06); }
.tl-result .btn-primary { background: var(--cyan); color: #04222a; font-weight: 600; }
.tl-result .tl-actions { margin-top: 1.5rem; }

/* Numbers in the calculator result */
.tl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 0.8rem; margin-top: 1.2rem; }
.tl-stat { padding: 1rem 1.05rem; border: 1px solid var(--d-line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.tl-stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 2.2rem; line-height: 1.05; color: var(--d-ink); font-variant-numeric: tabular-nums; }
.tl-stat span { display: block; margin-top: 0.35rem; font-size: 0.86rem; color: var(--d-muted); line-height: 1.45; }
.tl-stat.is-hot b { color: var(--cyan); }
.tl-formula {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--cyan);
  background: rgba(34, 211, 238, 0.05);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #c9c7c0;
  overflow-wrap: anywhere;
}

/* Readiness profile bars */
.tl-profile { display: grid; gap: 0.7rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.tl-profile li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.4rem 1rem; align-items: center; }
.tl-profile .tl-bar { height: 8px; border-radius: 99px; background: rgba(233, 231, 224, 0.1); overflow: hidden; }
.tl-profile .tl-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--c, var(--cyan)); transition: width 600ms cubic-bezier(0.2, 0.7, 0.3, 1); }
.tl-profile small { grid-column: 2; font-size: 0.84rem; color: var(--d-muted); line-height: 1.45; }
.tl-profile b { font-size: 0.9rem; font-weight: 500; color: var(--d-ink); }

/* Policy output */
.tl-output {
  width: 100%;
  min-height: 26rem;
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--d-ink);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Notes and disclaimers */
.tl-note {
  margin-top: 1.6rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan-ink);
  border-radius: 10px;
  background: #fbf8f0;
  color: #33404a;
  font-size: 0.93rem;
  line-height: 1.65;
}
.tl-note strong { color: var(--ink); }
.tl-note.is-warn { border-left-color: var(--amber-ink); }
.tl-status { min-height: 1.4em; font-size: 0.88rem; color: var(--d-muted); }
.tl-cta {
  display: grid;
  gap: 1rem;
  margin-top: clamp(2.8rem, 6vw, 4.5rem);
  padding: clamp(1.5rem, 3.5vw, 2.4rem);
  border-radius: 14px;
  background: var(--panel);
  color: var(--d-ink);
}
.tl-cta h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.tl-cta p { color: #c9c7c0; max-width: 60ch; }
.tl-cta .btn-primary { background: var(--cyan); color: #04222a; font-weight: 600; justify-self: start; }
.tl-cta .btn-ghost { border-color: var(--d-line); color: var(--d-ink); }

/* ── Process demo (/demos/before-and-after/) ─────────────── */
.pd {
  margin-top: 2rem;
  border: 1px solid rgba(11, 13, 16, 0.5);
  border-radius: 14px;
  background:
    radial-gradient(130% 105% at 10% -10%, rgba(34, 211, 238, 0.075), transparent 60%),
    linear-gradient(rgba(233, 231, 224, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 231, 224, 0.02) 1px, transparent 1px),
    var(--panel);
  background-size: auto, 34px 34px, 34px 34px, auto;
  color: var(--d-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 42px 90px -34px rgba(11, 13, 16, 0.62);
  overflow: hidden;
}
.pd-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--d-line-2);
}
.pd-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.pd-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pd-tab, .pd-mode button, .ayx-q, .ayx-btn {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--d-line);
  border-radius: 999px;
  background: transparent;
  color: var(--d-muted);
  font-family: var(--sans);
  font-size: 0.88rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.pd-tab:hover, .pd-mode button:hover, .ayx-q:hover, .ayx-btn:hover { color: var(--d-ink); border-color: rgba(233, 231, 224, 0.4); }
.pd-tab[aria-selected="true"] { color: #04222a; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }
.pd-tab:focus-visible, .pd-mode button:focus-visible, .ayx-q:focus-visible, .ayx-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pd-body { padding: clamp(1.1rem, 3vw, 2rem); }
.pd-intro { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; justify-content: space-between; }
.pd-intro h2, .pd-intro h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; color: var(--d-ink); }
.pd-intro p { margin-top: 0.4rem; color: var(--d-muted); font-size: 0.95rem; max-width: 52ch; }
.pd-mode { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--d-line); border-radius: 999px; }
.pd-mode button { border-color: transparent; min-height: 36px; }
.pd-mode button[aria-pressed="true"] { background: var(--d-ink); color: var(--panel); font-weight: 600; }
.pd-mode button[data-mode="before"][aria-pressed="true"] { background: var(--amber); color: #2a1300; }
.pd-flow {
  position: relative;
  display: grid;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0 0 0 1.6rem;
  list-style: none;
}
.pd-flow::before {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(180deg, var(--pd-c, var(--cyan)), rgba(233, 231, 224, 0.08));
}
.pd[data-mode="before"] .pd-flow { --pd-c: var(--amber); }
.pd-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  align-items: center;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--d-line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  opacity: 0;
  transform: translateX(-8px);
  animation: pdIn 420ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.pd-step::before {
  content: "";
  position: absolute;
  left: -1.42rem;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid var(--pd-c, var(--cyan));
  background: var(--panel);
}
.pd-step strong { font-weight: 500; font-size: 0.97rem; color: var(--d-ink); }
.pd-step em { grid-column: 1; font-style: normal; font-size: 0.86rem; color: var(--d-muted); line-height: 1.5; }
.pd-step .pd-who {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--d-line);
  color: var(--d-muted);
  white-space: nowrap;
}
.pd-step.is-pain .pd-who { color: var(--amber); border-color: rgba(251, 146, 60, 0.45); }
.pd-step.is-ai .pd-who { color: var(--cyan); border-color: rgba(34, 211, 238, 0.45); }
.pd-step.is-gate { border-color: rgba(251, 146, 60, 0.5); background: rgba(251, 146, 60, 0.07); }
.pd-step.is-gate::before { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 14px rgba(251, 146, 60, 0.7); }
.pd-step.is-gate .pd-who { color: var(--amber); border-color: rgba(251, 146, 60, 0.55); }
.pd-step.is-log { border-style: dashed; }
.pd-step.is-log strong { font-family: var(--mono); font-size: 0.82rem; color: var(--d-muted); }
@keyframes pdIn { to { opacity: 1; transform: none; } }
.pd-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem clamp(1rem, 2.5vw, 1.5rem);
  border-top: 1px solid var(--d-line-2);
  font-size: 0.84rem;
  color: var(--d-faint);
}
.pd-foot a { color: var(--cyan); }
.pd-summary { margin-top: 1.2rem; font-size: 0.92rem; color: #c9c7c0; }
.pd-summary b { color: var(--d-ink); font-weight: 500; }

/* ── Ask Your Data scripted demo ─────────────────────────── */
.ayx { margin-top: 2rem; }
.ayx-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 1rem; }
.ayx-panel {
  border: 1px solid rgba(11, 13, 16, 0.5);
  border-radius: 14px;
  background: var(--panel);
  color: var(--d-ink);
  overflow: hidden;
  min-width: 0;
}
.ayx-panel > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--d-line-2);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--d-muted);
}
.ayx-panel > header .ayx-fict { color: var(--amber); }
.ayx-pad { padding: 1.1rem; }
.ayx-qs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ayx-q { text-align: left; border-radius: 10px; }
.ayx-q[aria-pressed="true"] { border-color: var(--cyan); color: var(--d-ink); background: rgba(34, 211, 238, 0.08); }
.ayx-ask {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--d-ink);
  background: rgba(0, 0, 0, 0.3);
  min-height: 3.1rem;
}
.ayx-ask::before { content: "> "; color: var(--cyan); }
.ayx-stages { display: grid; gap: 0.4rem; margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: ayx; }
.ayx-stages li {
  counter-increment: ayx;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.15rem 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--d-line-2);
  border-radius: 10px;
  color: var(--d-faint);
  transition: border-color 220ms ease, color 220ms ease, background 220ms ease;
}
.ayx-stages li::before {
  content: counter(ayx, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding-top: 0.15rem;
}
.ayx-stages li b { font-weight: 500; font-size: 0.92rem; }
.ayx-stages li span { grid-column: 2; font-size: 0.82rem; line-height: 1.5; }
.ayx-stages li.is-on { border-color: rgba(34, 211, 238, 0.45); color: var(--d-ink); background: rgba(34, 211, 238, 0.05); }
.ayx-stages li.is-on span { color: #c9c7c0; }
.ayx-stages li.is-done { color: var(--d-muted); }
.ayx-stages li.is-stop { border-color: rgba(251, 113, 133, 0.5); color: #fecdd3; background: rgba(251, 113, 133, 0.06); }
.ayx-table-wrap { overflow-x: auto; }
.ayx-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ayx-table caption { text-align: left; padding: 0 0 0.6rem; color: var(--d-muted); font-size: 0.82rem; }
.ayx-table th, .ayx-table td { padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--d-line-2); text-align: left; white-space: nowrap; }
.ayx-table th { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--d-muted); font-weight: 600; }
.ayx-table td { color: #c9c7c0; font-variant-numeric: tabular-nums; }
.ayx-table tr.is-read td { background: rgba(34, 211, 238, 0.07); color: var(--d-ink); }
.ayx-mask { font-family: var(--mono); font-size: 0.74rem; padding: 0.05rem 0.35rem; border-radius: 4px; background: rgba(251, 146, 60, 0.16); color: var(--amber); }
.ayx-answer {
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}
.ayx-answer[hidden] { display: none; }
.ayx-answer p { color: #d9d7d0; font-size: 0.95rem; line-height: 1.65; }
.ayx-answer .ayx-src { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.74rem; color: var(--d-muted); }
.ayx-answer .ayx-state { display: inline-block; margin-bottom: 0.5rem; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.ayx-answer .ayx-state.is-ok { color: var(--ok); }
.ayx-answer .ayx-state.is-stop { color: #fb7185; }
.ayx-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.ayx-btn.is-primary { background: var(--ok); border-color: var(--ok); color: #03261a; font-weight: 600; }
.ayx-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ayx-log {
  margin: 0;
  padding: 0.9rem 1.1rem;
  min-height: 9rem;
  max-height: 16rem;
  overflow-y: auto;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--d-muted);
}
.ayx-log li { padding: 0.2rem 0; border-bottom: 1px dashed var(--d-line-2); overflow-wrap: anywhere; }
.ayx-log li time { color: var(--cyan); margin-right: 0.5rem; }
.ayx-log li.is-stop { color: #fda4af; }
.ayx-log li.is-ok { color: #a7f3d0; }
.ayx-log .ayx-empty { border: 0; color: var(--d-faint); }

/* ── Sample next-step summary (/what-happens-after-a-free-call/) ── */
.doc-sheet {
  position: relative;
  margin-top: 1.8rem;
  padding: clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fffdf7;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.doc-stamp {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin: calc(-1 * clamp(1.4rem, 4vw, 3rem)) calc(-1 * clamp(1.4rem, 4vw, 3rem)) 1.6rem;
  padding: 0.75rem clamp(1.4rem, 4vw, 3rem);
  background: repeating-linear-gradient(-45deg, #fff1d6 0 12px, #ffe9bf 12px 24px);
  border-bottom: 1px solid rgba(156, 83, 8, 0.25);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-ink);
}
.doc-sheet h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-top: 0.2rem; }
.doc-sheet h3 { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 1.05rem; }
.doc-sheet p, .doc-sheet li, .doc-sheet td, .doc-sheet th { color: #33404a; font-size: 0.97rem; line-height: 1.7; }
.doc-sheet p { margin-top: 0.7rem; }
.doc-sheet ul { margin: 0.6rem 0 0; padding-left: 1.1rem; }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0.6rem 1.2rem; margin-top: 1rem; }
.doc-meta div { padding-top: 0.5rem; border-top: 1px solid var(--line); }
.doc-meta dt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.doc-meta dd { margin: 0.2rem 0 0; font-size: 0.95rem; }
.doc-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 0.8rem; }
.doc-ba > div { padding: 1rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); }
.doc-ba .doc-before { background: #fff6e9; }
.doc-ba .doc-after { background: rgba(10, 111, 131, 0.06); border-color: rgba(10, 111, 131, 0.25); }
.doc-ba ol { list-style: decimal; padding-left: 1.2rem; margin-top: 0.5rem; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
.doc-table th, .doc-table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-table th { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 880px) {
  .ayx-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tl-profile li { grid-template-columns: 1fr; }
  .tl-profile small { grid-column: 1; }
  .doc-ba { grid-template-columns: 1fr; }
  .pd-step { grid-template-columns: 1fr; }
  .pd-step .pd-who { grid-row: auto; grid-column: 1; justify-self: start; margin-top: 0.3rem; }
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table tr { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
  .doc-table td { border: 0; padding: 0.15rem 0; }
  .doc-table td[data-h]::before { content: attr(data-h) ": "; font-weight: 600; color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-card::before, .tl-choice span, .tl-profile .tl-bar i, .ayx-stages li { transition: none; }
  .tl-card:hover, .tl-card:focus-within { transform: none; }
  .pd-step { animation: none; opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .tl-form, .tl-hero, .tl-cta, .tl-actions, .tl-section, .skip { display: none !important; }
  .tl-result { box-shadow: none; background: #fff; color: #000; border: 2px solid #000; }
  .tl-result p, .tl-result li, .tl-result h2, .tl-result h3.tl-headline { color: #000; }
  .tl-result.tl-print-keep { display: block !important; }
}

.tl-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.tl-steps-wrap { margin-top: 2rem; }

/* ── Front door r3 ─────────────────────────────────────────── */
.ayx-choose { color: var(--d-muted); margin: 0 0 0.7rem; }
.ayx-side { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.ayx-noscript { margin: 0 0 0.7rem; color: var(--ink); }
.ayx-swipe { display: none; }
@media (max-width: 560px) {
  .ayx-swipe { display: block; margin: 0 0 0.4rem; color: var(--d-muted); font-size: 0.82rem; }
  .ayx-table-wrap { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
.ayx-ask[hidden] { display: none; }

/* Unanswered questions and progress */
.tl-q.is-missing { border-color: var(--amber-ink); box-shadow: inset 3px 0 0 var(--amber-ink); }
.tl-missing { margin-left: auto; align-self: center; flex: none; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(156, 83, 8, 0.1); color: var(--amber-ink); font-family: var(--mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tl-progress { margin-top: 0.4rem; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; }

/* Touch: the whole choice is the hit area, at least 44px tall */
.tl-choice span { min-height: 44px; display: flex; align-items: center; }
.tl-choice span:has(small) { display: block; }

/* 44px controls in the demos */
.pd-tab, .pd-mode button, .ayx-q, .ayx-btn { min-height: 44px; }
.pd-mode button { min-height: 44px; }

/* Before/after toggle stays in reach on phones */
@media (max-width: 780px) { .pd-intro .pd-mode { position: sticky; top: 76px; z-index: 2; background: var(--panel); } }

/* Hub cards: no orphans (4 tools = 2 × 2, 3 demos = 3 across) */
@media (min-width: 700px) { .tl-cards--tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tl-cards--demos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* One width system and one H1 scale with the rest of the site */
.tl-wrap { width: min(1180px, 100%); }
.tl-hero h1 { font-size: clamp(3rem, 8.4vw, 6.7rem); font-size: clamp(3rem, 11cqw, 6.7rem); }

.tl-noscript { margin-top: 1rem; }
.ayx-h { margin: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
