/* Shared wrapper for the three standalone tool demos. */
body.tool-detail-page {
  --tp-accent: #afcce2;
  --tp-cta: #b7d4e9;
  --tp-cta-ink: #0a1b29;
  --tp-gutter: clamp(16px, 4.3vw, 72px);
  background: var(--dark-page);
  color: var(--dark-text);
}
html[data-theme="light"] body.tool-detail-page {
  --tp-accent: var(--lp-accent);
  --tp-cta: #214d68;
  --tp-cta-ink: #fff;
}
.tool-detail-page .tp-wrap {
  width: min(1380px, calc(100% - 2 * var(--tp-gutter)));
  margin-inline: auto;
  min-width: 0;
}
.tp-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--dark-page);
  border-bottom: 1px solid var(--dark-line);
}
.tp-topbar-inner {
  min-height: 63px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 16px;
}
.tp-back, .tp-top-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  color: var(--tp-accent);
}
.tp-top-link { color: var(--dark-text-soft); }
.tp-back:hover, .tp-top-link:hover, .tp-story a:hover {
  text-decoration: underline;
  text-underline-offset: .25em;
}
.tp-hero {
  padding: clamp(36px, 4.5vw, 64px) 0 clamp(26px, 3.4vw, 48px);
}
.tp-hero--with-film {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 24px clamp(24px, 4.5vw, 72px);
}
.tp-copy h1 {
  color: var(--dark-text);
  font-size: clamp(34px, 5vw, 70px);
  font-weight: 690;
  letter-spacing: -.062em;
  line-height: 1.13;
  margin: 0;
  text-wrap: balance;
}
.tp-lead {
  max-width: 51em;
  margin: 15px 0 0;
  color: var(--dark-text-soft);
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.75;
}
.tp-primary {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 46px;
  margin-top: 23px;
  padding: 10px 15px;
  border-radius: 4px;
  background: var(--tp-cta);
  color: var(--tp-cta-ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.tp-primary:hover { filter: brightness(.92); }
.tp-copy .work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin-top: 13px;
}
.tp-copy .work-tags > span {
  border: 0;
  background: none;
  padding: 0;
  color: var(--dark-muted);
  font-size: 14px;
}
.tp-story {
  border-block: 1px solid var(--dark-line);
}
.tp-story .work-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tp-story .work-story-grid > article {
  min-width: 0;
  padding: clamp(17px, 2.2vw, 30px);
}
.tp-story .work-story-grid > article:nth-child(2n) {
  border-left: 1px solid var(--dark-line);
}
.tp-story .work-story-grid > article:nth-child(n+3) {
  border-top: 1px solid var(--dark-line);
}
.tp-story .work-story-grid > article > span {
  display: block;
  color: var(--tp-accent);
  font-size: 18px;
  font-weight: 710;
  line-height: 1.3;
}
.tp-story .work-story-grid > article > p,
.tp-story .work-story-list {
  margin: 10px 0 0;
  color: var(--dark-text-soft);
  font-size: 16px;
  line-height: 1.7;
}
.tp-story .work-story-list { padding-inline-start: 1.25em; }
.tp-story .work-story-list li + li { margin-top: 7px; }
.tp-story .work-story-list b { color: var(--dark-text); font-weight: 720; }
.tp-story a {
  margin-inline-start: 6px;
  color: var(--tp-accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.tp-story .work-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 14px;
  margin-top: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--dark-line);
}
.tp-story .work-result-item { display: grid; gap: 3px; min-width: 0; }
.tp-story .work-result-item > strong {
  color: var(--dark-text);
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1.17;
  letter-spacing: -.045em;
}
.tp-story .work-result-item > strong > span {
  margin-inline-start: 2px;
  font-size: .55em;
  letter-spacing: 0;
}
.tp-story .work-result-name { color: var(--dark-muted); font-size: 12px; line-height: 1.5; }
.tp-film {
  min-width: 0;
  margin: 0;
}
.tp-film video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--dark-line-strong);
  border-radius: 8px;
  background: var(--dark-band);
}
.tp-film figcaption {
  margin-top: 9px;
  color: var(--dark-muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: end;
}
.tp-demo h2 {
  margin: 0;
  color: var(--dark-text);
  font-size: clamp(19px, 1.75vw, 25px);
  font-weight: 690;
  letter-spacing: -.025em;
  line-height: 1.35;
}
.tp-context p {
  margin: 9px 0 0;
  color: var(--dark-text-soft);
  font-size: 16px;
  line-height: 1.75;
}
#case-api-dashboard-link { scroll-margin-top: 80px; }
.tp-demo {
  padding: clamp(24px, 3.5vw, 42px) 0 0;
  scroll-margin-top: 69px;
}
.tp-demo-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-bottom: 13px;
}
.tp-demo-head > p {
  margin: 0;
  color: var(--dark-muted);
  font-size: 14px;
}
.tp-demo-frame {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--dark-line-strong);
  border-radius: 8px;
  background: var(--dark-band);
}
.tool-detail-page .tp-demo iframe {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}
.tp-demo .dashboard-embed { height: 1000px; }
.tp-demo .agent-embed { height: 790px; }
.tp-demo .automation-embed { height: 900px; }
.tp-context {
  margin: clamp(28px, 4.4vw, 55px) 0;
  padding-top: 24px;
  border-top: 1px solid var(--dark-line);
}
.tp-context .work-module-definitions {
  margin-top: 20px;
  border-block: 1px solid var(--dark-line);
}
.tp-context details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding-block: 10px;
  list-style: none;
  cursor: pointer;
  color: var(--tp-accent);
  font-size: 16px;
  font-weight: 680;
}
.tp-context details > summary::-webkit-details-marker { display: none; }
.tp-context details > summary::after { content: "+"; font-size: 20px; line-height: 1; }
.tp-context details[open] > summary::after { content: "−"; }
.tp-context details > summary:hover { text-decoration: underline; text-underline-offset: 4px; }
.tp-context details > summary:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 3px; }
.tp-context :is(.work-module-summary-title > small, .work-module-summary-topics, .work-module-summary-toggle) { display: none; }
.tp-context .work-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding-bottom: 8px;
}
.tp-context .work-module-grid > article {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  min-width: 0;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--dark-line);
}
.tp-context .work-module-grid > article > span { color: var(--dark-muted); font-size: 13px; }
.tp-context .work-module-grid p { margin: 5px 0 0; font-size: 14px; }
.tp-footer { margin-top: 24px; padding: 0 0 28px; border-top: 1px solid var(--dark-line); }

/* Dashboard: the three context blocks precede a full-width results row. */
body[data-tool-page="dashboard"] .tp-story .work-story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body[data-tool-page="dashboard"] .tp-story .work-story-grid > article {
  border: 0;
}
body[data-tool-page="dashboard"] .tp-story .work-story-grid > article:nth-child(2),
body[data-tool-page="dashboard"] .tp-story .work-story-grid > article:nth-child(3) {
  border-left: 1px solid var(--dark-line);
}
body[data-tool-page="dashboard"] .tp-story .work-story-grid > .work-story-results {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 20px clamp(26px, 3vw, 44px);
  border-top: 1px solid var(--dark-line);
}
body[data-tool-page="dashboard"] .tp-story .work-story-results > span {
  grid-column: 1 / -1;
}
body[data-tool-page="dashboard"] .tp-story .work-story-results .work-result-grid {
  margin: 0;
  padding: 4px 0 0;
  border: 0;
  gap: 14px;
}
body[data-tool-page="dashboard"] .tp-story .work-result-item { gap: 8px; }
body[data-tool-page="dashboard"] .tp-story .work-result-item > strong {
  font-size: clamp(27px, 2.5vw, 36px);
}
body[data-tool-page="dashboard"] .tp-story .work-result-name { font-size: 13px; }
body[data-tool-page="dashboard"] .tp-story .work-story-results > .work-story-list {
  margin-top: 0;
}
body[data-tool-page="dashboard"] .tp-story .work-story-results .work-story-list li + li {
  margin-top: 12px;
}

@media (max-width: 790px) {
  .tp-hero--with-film { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  body[data-tool-page="dashboard"] .tp-story .work-story-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-tool-page="dashboard"] .tp-story .work-story-grid > article:nth-child(n) {
    padding-inline: 0;
    border-left: 0;
  }
  body[data-tool-page="dashboard"] .tp-story .work-story-grid > article + article {
    border-top: 1px solid var(--dark-line);
  }
  body[data-tool-page="dashboard"] .tp-story .work-story-grid > .work-story-results {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  body[data-tool-page="dashboard"] .tp-story .work-story-results .work-result-grid {
    padding: 0 0 17px;
    border-bottom: 1px solid var(--dark-line);
  }
}

@media (max-width: 680px) {
  .tp-topbar-inner { min-height: 53px; }
  .tp-back, .tp-top-link { font-size: 13px; }
  .tp-hero { padding: 29px 0 25px; }
  .tp-copy h1 { font-size: clamp(31px, 7.6vw, 48px); }
  .tp-lead { margin-top: 10px; }
  .tp-primary { margin-top: 16px; }
  .tp-story .work-story-grid { grid-template-columns: minmax(0, 1fr); }
  .tp-story .work-story-grid > article { padding-inline: 0; }
  .tp-story .work-story-grid > article:nth-child(2n) { border-left: 0; }
  .tp-story .work-story-grid > article + article { border-top: 1px solid var(--dark-line); }
  .tp-story .work-story-grid > article > p, .tp-story .work-story-list { font-size: 15px; }
  .tp-story .work-result-grid { gap: 7px; }
  .tp-story .work-result-item > strong { font-size: clamp(20px, 6vw, 27px); }
  body[data-tool-page="dashboard"] .tp-story .work-story-results .work-result-grid { gap: 10px; }
  body[data-tool-page="dashboard"] .tp-story .work-result-item > strong { font-size: clamp(22px, 6vw, 27px); }
  .tp-demo { scroll-margin-top: 59px; }
  .tp-demo .dashboard-embed { height: 970px; }
  .tp-demo .agent-embed { height: 1040px; }
  .tp-demo .automation-embed { height: 1350px; }
  .tp-context .work-module-grid { grid-template-columns: minmax(0, 1fr); }
}

