/* The marketing site's design kit, built on the product's own tokens (dashboard/css/tokens.css).
   It deliberately does not load the dashboard's app.css: those are dashboard components, and the two
   should look like one product without depending on each other.

   Everything here is prefixed .pub-, so nothing can reach into the dashboard or the widget.
   Nothing is hidden until script runs: the reveal animations are armed only under html[data-motion],
   which public.js sets and a reduced-motion setting withholds, so the page is complete at rest. */

/* ---------- Ground ------------------------------------------------------------------------------ */

/* The public header's height, so anything that has to sit clear of it reads the same number. The
   dashboard's --topbar-h is a different bar on a different shell; this one is ours. */
.pub {
  --pub-header-h: 68px;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.pub *,
.pub *::before,
.pub *::after { box-sizing: border-box; }

.pub-wrap {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.pub-skip {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--weight-semibold);
}

.pub-skip:focus { left: 16px; top: 16px; }

.pi {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Type --------------------------------------------------------------------------------- */

.pub h1, .pub h2, .pub h3 { margin: 0; letter-spacing: -0.03em; text-wrap: balance; line-height: 1.12; }
.pub h1 { font-size: clamp(34px, 5.4vw, 60px); font-weight: var(--weight-bold); }
.pub h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: var(--weight-bold); }
.pub h3 { font-size: clamp(18px, 1.6vw, 21px); font-weight: var(--weight-semibold); letter-spacing: -0.015em; }
.pub p { margin: 0; }

.pub-eyebrow {
  max-width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--color-primary-soft-2);
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
  font-size: 12.5px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
}

.pub-eyebrow .pi { width: 15px; height: 15px; }

.pub-lede {
  max-width: 54ch;
  color: var(--color-text-2);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.62;
}

.pub-section { padding-block: clamp(56px, 8vw, 104px); }
.pub-section-head { display: flex; flex-direction: column; gap: 14px; max-width: 46rem; }

/* ---------- Buttons ------------------------------------------------------------------------------ */

.pub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: var(--weight-semibold);
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease, background-color 140ms ease, border-color 140ms ease,
              box-shadow 160ms ease, color 140ms ease;
}

.pub-btn .pi { width: 16px; height: 16px; stroke-width: 2; transition: transform 160ms ease; }
.pub-btn:hover .pi { transform: translateX(2px); }

.pub-btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 1px 2px rgba(41, 37, 36, 0.08);
}

.pub-btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(11, 122, 104, 0.9);
}

.pub-btn-quiet { background: transparent; color: var(--color-text-2); }
.pub-btn-quiet:hover { background: var(--color-surface-2); color: var(--color-text); }

.pub-btn-outline {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.pub-btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary-text); transform: translateY(-1px); }
.pub-btn-lg { padding: 13px 24px; font-size: 15.5px; border-radius: var(--radius-md); }

.pub-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-2);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.pub-icon-btn:hover { background: var(--color-surface-2); color: var(--color-text); }

/* The sun and the moon swap with the theme. */
.pub-icon-sun, .pub-icon-moon { position: absolute; }
[data-theme="light"] .pub-icon-moon,
[data-theme="dark"] .pub-icon-sun { display: none; }

.pub :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header -------------------------------------------------------------------------------- */

.pub-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--color-bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  transition: border-color 160ms ease, box-shadow 200ms ease, background-color 160ms ease;
}

/* Only once the page has moved under it, so the top of a page is clean. */
.pub-header[data-stuck] {
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 2px rgba(41, 37, 36, 0.04);
}

.pub-header-inner { display: flex; align-items: center; gap: 18px; height: var(--pub-header-h); }

.pub-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }

.pub-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 6px 16px -8px rgba(11, 122, 104, 0.9);
}

.pub-brand-mark .pi { width: 19px; height: 19px; }

.pub-brand-name { font-size: 16px; font-weight: var(--weight-bold); letter-spacing: -0.02em; }

.pub-nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }

.pub-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-2);
  font-size: 14.5px;
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: color 140ms ease, background-color 140ms ease;
}

.pub-nav a:hover { color: var(--color-text); background: var(--color-surface-2); }

.pub-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- Mobile drawer -------------------------------------------------------------------------- */

.pub-drawer { position: fixed; inset: 0; z-index: 60; }
.pub-drawer[hidden] { display: none; }

.pub-drawer-scrim {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  animation: pub-fade 180ms ease;
}

.pub-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(20rem, 86vw);
  padding: 16px;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  animation: pub-slide-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pub-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.pub-drawer-panel > a {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 16px;
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.pub-drawer-panel > a:hover { background: var(--color-surface-2); }

.pub-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.pub-drawer-foot .pub-btn { width: 100%; }

@keyframes pub-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pub-slide-in { from { transform: translateX(100%); } to { transform: none; } }

/* Said to a screen reader, not drawn. A table cell whose only content is a tick needs a word in it, and
   so does a column heading the sighted eye reads from the plan card above it. */
.pub-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  white-space: nowrap;
  clip-path: inset(50%);
}

/* ---------- Surfaces ------------------------------------------------------------------------------- */

.pub-card {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 180ms ease;
}

.pub-card-lift:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.pub-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border: 1px solid var(--color-primary-soft-2);
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
}

.pub-card-icon .pi { width: 21px; height: 21px; }

.pub-grid { display: grid; gap: 18px; }
.pub-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.pub-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.pub-grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

/* Any image the site shows: never lets the page scroll sideways, never collapses while it loads. */
.pub-img { display: block; width: 100%; height: auto; max-width: 100%; border-radius: var(--radius-lg); }

/* ---------- Footer --------------------------------------------------------------------------------- */

.pub-footer {
  margin-top: clamp(48px, 7vw, 88px);
  padding-block: clamp(40px, 5vw, 64px) 28px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.pub-footer-grid {
  display: grid;
  gap: 36px 24px;
  grid-template-columns: minmax(min(100%, 19rem), 1.4fr) repeat(auto-fit, minmax(9rem, 1fr));
}

.pub-footer-brand p {
  margin: 16px 0 18px;
  max-width: 36ch;
  color: var(--color-text-3);
  font-size: 14px;
  line-height: 1.6;
}

.pub-footer-contact { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.pub-footer-contact li { display: flex; align-items: center; gap: 9px; color: var(--color-text-3); }
.pub-footer-contact .pi { width: 16px; height: 16px; color: var(--color-primary); }

.pub-footer-contact a {
  color: var(--color-text-2);
  font-size: 14px;
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.pub-footer-contact a:hover { color: var(--color-primary-text); text-decoration: underline; }

.pub-footer-col { display: flex; flex-direction: column; gap: 11px; }

.pub-footer-col h2 {
  margin: 0 0 3px;
  font-size: 11.5px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.pub-footer-col a { color: var(--color-text-2); font-size: 14.5px; text-decoration: none; }
.pub-footer-col a:hover { color: var(--color-primary-text); }

.pub-footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-3);
  font-size: 13px;
}

.pub-footer-base p { margin: 0; }

/* ---------- 404 / 500 ------------------------------------------------------------------------------ */

.pub-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-block: clamp(56px, 11vw, 128px);
  text-align: center;
}

.pub-stop-code {
  font-family: var(--font-mono);
  font-size: clamp(56px, 11vw, 104px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-primary);
  opacity: 0.22;
}

.pub-stop h1 { font-size: clamp(25px, 3.4vw, 34px); }
.pub-stop .pub-lede { margin-inline: auto; text-align: center; }
.pub-stop-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Revealing ------------------------------------------------------------------------------- */
/* Armed only when script is running and motion is wanted; otherwise every section is simply there. */

html[data-motion] .pub-reveal { opacity: 0; transform: translateY(14px); }

html[data-motion] .pub-reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 620ms cubic-bezier(0.22, 1, 0.36, 1), transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* One row of children, each a beat behind the last. */
html[data-motion] .pub-reveal-stagger > * { opacity: 0; transform: translateY(14px); }

html[data-motion] .pub-reveal-stagger.is-in > * {
  opacity: 1;
  transform: none;
  transition: opacity 560ms cubic-bezier(0.22, 1, 0.36, 1), transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-motion] .pub-reveal-stagger.is-in > *:nth-child(2) { transition-delay: 80ms; }
html[data-motion] .pub-reveal-stagger.is-in > *:nth-child(3) { transition-delay: 160ms; }
html[data-motion] .pub-reveal-stagger.is-in > *:nth-child(4) { transition-delay: 240ms; }
html[data-motion] .pub-reveal-stagger.is-in > *:nth-child(5) { transition-delay: 320ms; }
html[data-motion] .pub-reveal-stagger.is-in > *:nth-child(6) { transition-delay: 400ms; }

/* ---------- Narrow ---------------------------------------------------------------------------------- */

.pub-only-sm { display: none; }

@media (max-width: 940px) {
  .pub-nav { display: none; }
  .pub-only-sm { display: inline-flex; }
  .pub-hide-sm { display: none; }
}

@media (max-width: 560px) {
  .pub-header-inner { height: 60px; gap: 10px; }
}

/* ---------- Motion off ------------------------------------------------------------------------------- */
/* html[data-motion] is never set when the setting is on, so the reveals are inert already; this covers
   the hovers, the drawer and anything a page adds. */

@media (prefers-reduced-motion: reduce) {
  .pub *,
  .pub *::before,
  .pub *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .pub-btn:hover,
  .pub-card-lift:hover { transform: none; }
  .pub-btn:hover .pi { transform: none; }
}


/* ---------- Home page ------------------------------------------------------------------------------- */
/* Sections the home page is built from. They use the kit above and add nothing to it that only one block
   needs; anything a second page would want has stayed in the kit. */

.pub-hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 76px) clamp(32px, 4vw, 56px);
  overflow: hidden;
}

/* A single wash of brand colour behind the hero, so the page opens warm and settles into the ground. */
.pub-hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 80%;
  background: radial-gradient(60% 60% at 70% 55%, var(--color-primary-soft), transparent 70%);
  pointer-events: none;
}

.pub-hero-grid {
  position: relative;
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
}

.pub-hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.pub-hero-copy h1 { max-width: 15ch; }
.pub-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.pub-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.pub-hero-points li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-3);
  font-size: 13.5px;
  font-weight: var(--weight-medium);
}

.pub-hero-points .pi { width: 15px; height: 15px; stroke-width: 2.4; color: var(--color-primary); }

/* ---- The chat, playing itself through ---- */

.pub-demo {
  width: min(100%, 23rem);
  margin-inline: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.pub-demo-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.pub-demo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.18);
}

.pub-demo-head strong { display: block; font-size: 14px; font-weight: var(--weight-semibold); }
.pub-demo-head em { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-style: normal; opacity: 0.8; }
.pub-demo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lagoon-300); }

.pub-demo-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px;
  background: var(--color-surface-2);
  min-height: 17rem;
}

.pub-demo-row { display: flex; }
.pub-demo-row.pub-demo-us { justify-content: flex-start; }
.pub-demo-row.pub-demo-them { justify-content: flex-end; }

.pub-demo-row p {
  max-width: 82%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.pub-demo-them p {
  border-bottom-right-radius: 4px;
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.pub-demo-us p {
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
}

.pub-demo-ticket {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 88%;
  padding: 12px 14px;
  border: 1px solid var(--color-primary-soft-2);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: var(--color-surface);
}

.pub-demo-ticket-top {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary-text);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.03em;
}

.pub-demo-ticket-top .pi { width: 14px; height: 14px; }
.pub-demo-ticket strong { font-size: 13.5px; font-weight: var(--weight-semibold); }
.pub-demo-ticket span:last-child { color: var(--color-text-3); font-size: 12px; }

.pub-demo-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-disabled);
  font-size: 13px;
}

.pub-demo-foot i {
  width: 30px;
  height: 30px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  opacity: 0.9;
}

/* The exchange arrives in order. Armed only with motion on, so at rest the whole chat is simply there. */
html[data-motion] .pub-demo-row { opacity: 0; animation: pub-demo-in 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
html[data-motion] .pub-demo-1 { animation-delay: 300ms; }
html[data-motion] .pub-demo-2 { animation-delay: 900ms; }
html[data-motion] .pub-demo-3 { animation-delay: 1600ms; }
html[data-motion] .pub-demo-4 { animation-delay: 2300ms; }

@keyframes pub-demo-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---- The strip under the hero ---- */

.pub-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: clamp(28px, 4vw, 46px) 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.pub-strip li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-3);
  font-size: 13.5px;
  font-weight: var(--weight-medium);
}

.pub-strip .pi { width: 16px; height: 16px; color: var(--color-primary); }

/* ---- Sections ---- */

.pub-section-tint { background: var(--color-surface); border-block: 1px solid var(--color-border); }

/* ---- The three steps ---- */

.pub-steps {
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 5vw, 60px);
  margin: clamp(36px, 5vw, 56px) 0 0;
  padding: 0;
  list-style: none;
}

.pub-step {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
}

.pub-step-flip .pub-step-text { order: 2; }
.pub-step-text { display: flex; flex-direction: column; gap: 12px; }

.pub-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 15px;
  font-weight: var(--weight-bold);
}

.pub-step-text p { max-width: 48ch; color: var(--color-text-2); line-height: 1.62; }

.pub-step-text code,
.pub-embed code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.pub-step-text code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--color-surface-3);
  color: var(--color-primary-text);
}

.pub-step-pic {
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
}

.pub-step-art { display: block; width: 100%; height: auto; }

/* ---- The one line ---- */

.pub-embed {
  margin-top: clamp(36px, 5vw, 56px);
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--stone-900);
  overflow: hidden;
}

.pub-embed-label {
  display: block;
  margin-bottom: 10px;
  color: var(--stone-400);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pub-embed pre { margin: 0; overflow-x: auto; }
.pub-embed code { color: var(--stone-100); font-size: 13px; line-height: 1.7; white-space: pre; }
.pub-embed code span { color: var(--lagoon-300); }

/* ---- FAQ ---- */

.pub-faq-grid {
  display: grid;
  gap: clamp(28px, 4vw, 52px);
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.pub-faq { display: flex; flex-direction: column; gap: 10px; }

.pub-faq details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.pub-faq details[open] { border-color: var(--color-primary-soft-2); background: var(--color-primary-soft); }

.pub-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  list-style: none;
}

.pub-faq summary::-webkit-details-marker { display: none; }
.pub-faq summary .pi { flex-shrink: 0; color: var(--color-text-3); transition: transform 200ms ease; }
.pub-faq details[open] summary .pi { transform: rotate(180deg); color: var(--color-primary); }

.pub-faq p {
  margin: 0;
  padding: 0 18px 17px;
  max-width: 62ch;
  color: var(--color-text-2);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ---- Closing band ---- */

.pub-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(36px, 6vw, 64px) clamp(20px, 4vw, 48px);
  border: 1px solid var(--color-primary-soft-2);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(80% 120% at 50% 0%, var(--color-primary-soft), transparent 70%),
    var(--color-surface);
  text-align: center;
}

.pub-cta h2 { max-width: 20ch; }
.pub-cta p { max-width: 54ch; color: var(--color-text-2); font-size: 16px; line-height: 1.62; }
.pub-cta .pub-hero-actions { justify-content: center; margin-top: 8px; }

/* ---- Narrow ---- */

@media (max-width: 940px) {
  .pub-hero-grid { grid-template-columns: 1fr; }
  .pub-hero-copy h1 { max-width: none; }
  .pub-step,
  .pub-faq-grid { grid-template-columns: 1fr; }
  .pub-step-flip .pub-step-text { order: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pub-faq details[open] summary .pi { transform: rotate(180deg); }
}

/* ---------- Pricing page ----------------------------------------------------------------------------- */
/* The plans, the switch between billing periods, and the table under them. Built on the kit above; the
   only new shapes are the plan card and the table, which no other page has. */

.pub-hero-short { padding-block: clamp(36px, 5vw, 64px) clamp(28px, 3.5vw, 44px); }

.pub-head-center {
  align-items: center;
  margin-inline: auto;
  max-width: 62ch;
  text-align: center;
}

.pub-head-center .pub-lede { margin-inline: auto; }

/* ---- Monthly / yearly ---- */
/* Two links, so the price is right before any script runs and either version can be shared. */

.pub-cycle {
  position: relative;
  display: flex;
  gap: 4px;
  width: max-content;
  margin: 28px auto 0;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.pub-cycle a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  color: var(--color-text-2);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-colors);
}

.pub-cycle a:hover { color: var(--color-text); background: var(--color-surface-2); }

.pub-cycle a.is-on {
  color: var(--color-on-primary);
  background: var(--color-primary);
}

.pub-cycle a.is-on:hover { background: var(--color-primary-hover); }

.pub-cycle em {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--color-success-text);
  font-size: 11.5px;
  font-style: normal;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.pub-cycle a.is-on em { background: rgb(255 255 255 / 0.18); color: var(--color-on-primary); }

/* ---- The plans ---- */

.pub-plans {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  align-items: stretch;
  margin-top: clamp(28px, 4vw, 44px);
}

.pub-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 180ms ease;
}

.pub-plan:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

/* The one most people take sits a little forward, with the brand on it. */
.pub-plan.is-featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.pub-plan.is-featured::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(170deg, var(--color-primary-soft), transparent 55%);
  pointer-events: none;
}

.pub-plan > * { position: relative; }

.pub-plan-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin-bottom: -4px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 11.5px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.pub-plan-flag .pi { width: 13px; height: 13px; }

.pub-plan h2 {
  margin: 0;
  font-size: 19px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

.pub-plan-blurb {
  margin: -8px 0 0;
  min-height: 2.8em;
  color: var(--color-text-2);
  font-size: 14px;
  line-height: 1.45;
}

.pub-plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.pub-plan-figure {
  display: inline-flex;
  align-items: baseline;
  color: var(--color-text);
  font-size: clamp(30px, 3.4vw, 38px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pub-plan-figure i {
  margin-right: 2px;
  font-size: 0.62em;
  font-style: normal;
  font-weight: var(--weight-semibold);
  color: var(--color-text-3);
}

.pub-plan-figure-text { font-size: clamp(23px, 2.6vw, 28px); letter-spacing: var(--tracking-tight); }

.pub-plan-per { color: var(--color-text-3); font-size: 13.5px; font-weight: var(--weight-medium); }

/* Always rendered, so the four cards keep one baseline whichever period is showing. */
.pub-plan-billed {
  margin: -10px 0 0;
  min-height: 1.2em;
  color: var(--color-text-3);
  font-size: 12.5px;
}

.pub-plan-cta { justify-content: center; width: 100%; }

.pub-plan-limits {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 4px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.pub-plan-limits li {
  position: relative;
  padding-left: 14px;
  color: var(--color-text);
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
}

.pub-plan-limits li::before {
  content: "";
  position: absolute;
  top: 0.52em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.pub-plan-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub-plan-list li {
  display: flex;
  gap: 9px;
  color: var(--color-text-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.pub-plan-list .pi {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  stroke-width: 2.6;
  color: var(--color-primary);
}

.pub-plan-note {
  margin: auto 0 0;
  padding-top: 4px;
  color: var(--color-text-3);
  font-size: 12.5px;
  font-style: italic;
}

.pub-plans-foot {
  max-width: 68ch;
  margin: 24px auto 0;
  color: var(--color-text-3);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

/* ---- The table ---- */
/* A wide table scrolls inside its own box, so the page itself never moves sideways. */

.pub-table-scroll {
  margin-top: clamp(28px, 4vw, 40px);
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.pub-table {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-size: 13.5px;
}

.pub-table thead th {
  position: sticky;
  top: 0;
  padding: 15px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 14px;
  font-weight: var(--weight-bold);
  text-align: center;
  white-space: nowrap;
}

.pub-table thead th:first-child { width: 38%; text-align: left; }

.pub-table-group th {
  padding: 16px 16px 8px;
  color: var(--color-primary-text);
  font-size: 11.5px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-align: left;
  text-transform: uppercase;
}

.pub-table tbody th[scope="row"] {
  padding: 11px 16px;
  color: var(--color-text);
  font-weight: var(--weight-medium);
  text-align: left;
}

.pub-table td {
  padding: 11px 16px;
  color: var(--color-text-2);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.pub-table tbody tr:not(.pub-table-group) + tr:not(.pub-table-group) th,
.pub-table tbody tr:not(.pub-table-group) + tr:not(.pub-table-group) td {
  border-top: 1px solid var(--color-border);
}

.pub-table tbody tr:not(.pub-table-group):hover th,
.pub-table tbody tr:not(.pub-table-group):hover td { background: var(--color-surface-2); }

.pub-yes { width: 17px; height: 17px; stroke-width: 2.8; color: var(--color-primary); vertical-align: middle; }
.pub-no { color: var(--color-text-disabled); }

/* ---- Narrow ---- */

@media (max-width: 760px) {
  .pub-cycle { width: 100%; justify-content: center; }
  .pub-cycle a { padding-inline: 13px; }
  .pub-plan-blurb,
  .pub-plan-billed { min-height: 0; }
}

/* ---------- About page ------------------------------------------------------------------------------- */
/* A reading page, so most of what it needs is measure and rhythm rather than new components. The two it
   does add - the figures band and the contact cards - are shapes a later page will want as well. */

.pub-hero-art { position: relative; }

/* ---- A passage of prose, with its heading beside it ---- */

.pub-prose {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: start;
}

.pub-prose-head {
  position: sticky;
  top: calc(var(--pub-header-h) + 24px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.pub-prose-head h2 { margin: 0; }

.pub-prose-body { max-width: 68ch; }

.pub-prose-body p {
  margin: 0 0 18px;
  color: var(--color-text-2);
  font-size: 15.5px;
  line-height: 1.72;
}

.pub-prose-body p:last-child { margin-bottom: 0; }

.pub-quote {
  position: relative;
  margin: 28px 0 0;
  padding: 22px 24px 22px 56px;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--color-primary-soft);
}

.pub-quote .pi {
  position: absolute;
  top: 22px;
  left: 20px;
  width: 22px;
  height: 22px;
  color: var(--color-primary);
  opacity: 0.6;
}

.pub-quote p {
  margin: 0;
  color: var(--color-primary-text);
  font-size: 17px;
  font-weight: var(--weight-medium);
  line-height: 1.55;
  text-wrap: balance;
}

/* ---- Three figures, each with the detail behind it ---- */

.pub-facts-grid {
  display: grid;
  gap: clamp(28px, 4vw, 52px);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
}

.pub-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub-facts li {
  display: grid;
  gap: 2px 18px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color 180ms ease, box-shadow 200ms ease;
}

.pub-facts li:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }

.pub-facts strong {
  grid-row: 1 / span 2;
  color: var(--color-primary);
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pub-facts span {
  color: var(--color-text);
  font-size: 15px;
  font-weight: var(--weight-semibold);
}

.pub-facts em {
  color: var(--color-text-3);
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

/* ---- Hero points, read down instead of across ---- */

.pub-points-stacked {
  flex-direction: column;
  gap: 10px;
}

.pub-points-stacked li { font-size: 14.5px; }

/* ---- Three ways to reach a person ---- */

.pub-contact-band {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin-top: clamp(28px, 4vw, 40px);
}

.pub-contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 180ms ease;
}

.pub-contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.pub-contact-card strong {
  color: var(--color-text);
  font-size: 15.5px;
  font-weight: var(--weight-bold);
}

.pub-contact-card > span:not(.pub-card-icon) {
  color: var(--color-primary-text);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

.pub-contact-card em {
  margin-top: 2px;
  color: var(--color-text-3);
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.5;
}

/* ---- Narrow ---- */

@media (max-width: 940px) {
  .pub-prose,
  .pub-facts-grid { grid-template-columns: 1fr; }
  .pub-prose-head { position: static; }
  .pub-facts li { padding: 18px; }
}

/* ---------- Forms on the public site ----------------------------------------------------------------- */
/* The kit's own inputs. The dashboard has its own (dashboard-input) and the marketing site does not load
   that stylesheet, so these are deliberately a separate, smaller set built on the same tokens. */

.pub-section-flush { padding-top: 0; }

.pub-field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 18px; }

.pub-field > label {
  color: var(--color-text);
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
}

.pub-input {
  width: 100%;
  min-height: var(--control-h);
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.pub-input::placeholder { color: var(--color-text-disabled); }

.pub-input:hover { border-color: var(--color-text-3); }

.pub-input:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.pub-textarea { min-height: 0; resize: vertical; line-height: 1.6; }

/* The arrow is drawn here rather than left to the browser, which styles it differently on every platform. */
.pub-select {
  appearance: none;
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 1px), calc(100% - 14px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.pub-field.has-error .pub-input { border-color: var(--color-danger); }
.pub-field.has-error .pub-input:focus-visible { box-shadow: 0 0 0 3px var(--color-danger-soft); }

.pub-field-help { color: var(--color-text-3); font-size: 12.5px; }

.pub-field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--color-danger-text);
  font-size: 12.5px;
  font-weight: var(--weight-medium);
}

.pub-field-error .pi { flex: none; width: 14px; height: 14px; margin-top: 2px; stroke-width: 2.6; }

.pub-field-row {
  display: grid;
  gap: 0 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.pub-alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  background: var(--color-danger-soft);
}

.pub-alert p {
  margin: 0;
  color: var(--color-danger-text);
  font-size: 14px;
  font-weight: var(--weight-medium);
}

/* The honeypot. Taken out of the layout entirely rather than display:none, which some bots check for. */
.pub-trap-wrap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pub-trap { position: absolute; left: -9999px; }

/* ---------- Contact page ----------------------------------------------------------------------------- */

.pub-contact-grid {
  display: grid;
  gap: clamp(22px, 3.5vw, 40px);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: start;
}

.pub-form-panel {
  padding: clamp(24px, 3.5vw, 36px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.pub-form-title {
  margin: 0 0 22px;
  font-size: 21px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

.pub-form-send { width: 100%; justify-content: center; margin-top: 4px; }

.pub-form-fine {
  margin: 16px 0 0;
  color: var(--color-text-3);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

.pub-form-fine a { color: var(--color-primary-text); }

/* ---- The thank-you, in the panel the form was in ---- */

.pub-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-block: clamp(16px, 3vw, 36px);
  text-align: center;
}

.pub-sent-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--color-success-soft);
  color: var(--color-success-text);
}

.pub-sent-mark .pi { width: 30px; height: 30px; stroke-width: 2.2; }

.pub-sent h2 { margin: 0; font-size: clamp(21px, 2.6vw, 26px); }

.pub-sent p {
  max-width: 46ch;
  margin: 0;
  color: var(--color-text-2);
  font-size: 15px;
  line-height: 1.65;
}

.pub-sent .pub-hero-actions { justify-content: center; margin-top: 6px; }

/* ---- The column beside it ---- */

.pub-contact-side { display: flex; flex-direction: column; gap: 18px; }

.pub-contact-rows { display: flex; flex-direction: column; gap: 12px; }

.pub-contact-row {
  display: grid;
  gap: 1px 16px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 200ms ease, transform 180ms ease;
}

.pub-contact-row:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.pub-contact-row .pub-card-icon { grid-row: 1 / span 3; margin: 0; align-self: center; }

.pub-contact-row strong { color: var(--color-text); font-size: 14px; font-weight: var(--weight-bold); }

.pub-contact-row > span:not(.pub-card-icon) {
  color: var(--color-primary-text);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

.pub-contact-row em { color: var(--color-text-3); font-size: 12.5px; font-style: normal; }

.pub-aside-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.pub-aside-card h3 {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: var(--weight-bold);
}

.pub-aside-card p {
  margin: 0 0 14px;
  color: var(--color-text-2);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---- Narrow ---- */

@media (max-width: 940px) {
  .pub-contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Legal pages ------------------------------------------------------------------------------- */
/* Terms, privacy and cancellation. These are reading pages: a comfortable measure, a clear hierarchy of
   headings, and a contents list that stays with you. No reveal animations - somebody who has followed a
   link to a specific clause should find it there, not fading in. */

.pub-legal-head { align-items: flex-start; max-width: 54ch; }

.pub-legal-date {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-3);
  font-size: 13px;
}

.pub-legal-grid {
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  align-items: start;
}

/* ---- Contents ---- */

.pub-toc {
  position: sticky;
  top: calc(var(--pub-header-h) + 24px);
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.pub-toc h2 {
  margin: 0 0 12px;
  color: var(--color-text-3);
  font-size: 11.5px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.pub-toc ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.pub-toc li { counter-increment: toc; }

.pub-toc a {
  display: flex;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-2);
  font-size: 13.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: var(--transition-colors);
}

.pub-toc a::before {
  content: counter(toc) ".";
  flex: none;
  color: var(--color-text-disabled);
  font-variant-numeric: tabular-nums;
}

.pub-toc a:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
}

.pub-toc a:hover::before { color: var(--color-primary); }

.pub-toc-foot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.pub-toc-foot p { margin: 0 0 10px; color: var(--color-text-3); font-size: 13px; }
.pub-toc-foot .pub-btn { width: 100%; justify-content: center; }

/* ---- The text ---- */

.pub-legal { max-width: 72ch; }

/* An anchored clause lands clear of the sticky header rather than under it. */
.pub-legal > section { scroll-margin-top: calc(var(--pub-header-h) + 20px); }

.pub-legal > section + section { margin-top: 36px; }

.pub-legal h2 {
  margin: 0 0 14px;
  font-size: clamp(18px, 2.2vw, 21px);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

.pub-legal p,
.pub-legal li {
  color: var(--color-text-2);
  font-size: 15px;
  line-height: 1.75;
}

.pub-legal p { margin: 0 0 14px; }
.pub-legal p:last-child { margin-bottom: 0; }

.pub-legal ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}

.pub-legal ul li {
  position: relative;
  padding-left: 20px;
}

.pub-legal ul li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.pub-legal strong { color: var(--color-text); font-weight: var(--weight-semibold); }

.pub-legal a { color: var(--color-primary-text); text-underline-offset: 2px; }

.pub-legal code {
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface-2);
  color: var(--color-text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ---- The statements about the code ---- */

.pub-legal-facts {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pub-legal-facts dt {
  padding: 14px 18px 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-weight: var(--weight-bold);
}

.pub-legal-facts dd {
  margin: 0;
  padding: 4px 18px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-2);
  font-size: 14px;
  line-height: 1.7;
}

.pub-legal-facts dd:last-child { border-bottom: 0; }

/* ---- Who else touches it ---- */

.pub-legal-table-scroll {
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.pub-legal-table { min-width: 34rem; }
.pub-legal-table td { text-align: left; white-space: normal; line-height: 1.6; }
.pub-legal-table thead th { text-align: left; }
.pub-legal-table thead th:first-child { width: auto; }
.pub-legal-note { color: var(--color-text-3); font-size: 12.5px; }

/* ---- The end of the page ---- */

.pub-legal-contact {
  margin-top: 40px;
  padding: 22px 24px;
  border: 1px solid var(--color-primary-soft-2);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
}

.pub-legal-contact h2 { margin-bottom: 8px; }
.pub-legal-contact ul { margin: 12px 0 0; }
.pub-legal-contact ul li::before { background: var(--color-primary); }

.pub-legal-siblings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.pub-legal-siblings a {
  color: var(--color-text-2);
  font-size: 13.5px;
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.pub-legal-siblings a:hover { color: var(--color-primary-text); text-decoration: underline; }

/* ---- Narrow ---- */

@media (max-width: 940px) {
  .pub-legal-grid { grid-template-columns: 1fr; }
  .pub-toc { position: static; }
  .pub-toc ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
}

/* ---------- How it works ------------------------------------------------------------------------------ */
/* The page is built from the kit: the steps, cards and scenes other pages already use. The one shape it
   adds is the numbered handover list, where the number is part of the reading rather than a bullet. */

.pub-flow {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.pub-flow li {
  position: relative;
  padding-left: 42px;
  color: var(--color-text-2);
  font-size: 14.5px;
  line-height: 1.6;
  counter-increment: flow;
}

.pub-flow li::before {
  content: counter(flow);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-primary-soft-2);
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
  font-size: 13px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

.pub-flow strong { color: var(--color-text); font-weight: var(--weight-semibold); }
