/* CertaRounds — Terms of Service (src/screens/terms.js). The page reuses Privacy's pv-* frame,
   cards and type (privacy.css); this file only adds what 24 numbered sections need.
   Semantic tokens only. */

/* The section number sits where Privacy has an icon */
.tm-num { font-size: var(--fs-15); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.tm-block .pv-block__title { scroll-margin-top: var(--sp-6); }
.tm-block .pv-block__lead strong { color: var(--text-strong); font-weight: var(--fw-semibold); }
.tm-block a, .tm-foot a, .tm .pv-summary li a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.tm-block a:focus-visible, .tm-foot a:focus-visible, .tm .pv-summary li a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* Numbered steps (section 20) */
.tm-steps { display: flex; flex-direction: column; gap: var(--sp-3); padding-left: 0; list-style: none; counter-reset: tmstep; }
.tm-steps li {
  position: relative;
  padding-left: var(--sp-6);
  font-size: var(--fs-15);
  line-height: 1.6;
  color: var(--text-2);
  counter-increment: tmstep;
}
.tm-steps li::before {
  content: counter(tmstep) ".";
  position: absolute;
  left: 2px;
  top: 0;
  font-weight: var(--fw-bold);
  color: var(--text-accent);
}
.tm-steps strong { color: var(--text-strong); font-weight: var(--fw-semibold); }

.tm-summary__note { font-size: var(--fs-13); line-height: 1.5; color: var(--text-2); }
.tm-foot { font-size: var(--fs-13); line-height: 1.55; color: var(--text-3); font-style: italic; padding: 0 var(--sp-1); }

/* Phones/tablets: a collapsed contents list under the lead */
.tm-toc {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.tm-toc__summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-4);
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-15);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  border-radius: var(--r-lg);
}
.tm-toc__summary::-webkit-details-marker { display: none; }
.tm-toc__summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tm-toc__count { margin-left: auto; font-size: var(--fs-13); font-weight: var(--fw-medium); color: var(--text-3); }
.tm-toc__summary .icon { color: var(--text-3); transition: transform .15s ease; }
.tm-toc[open] .tm-toc__summary .icon { transform: rotate(180deg); }
.tm-toc__list { display: flex; flex-direction: column; padding: 0 var(--sp-2) var(--sp-2); border-top: 1px solid var(--divider); }
.tm-toc__link {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 10px var(--sp-2);
  border-radius: 10px;
  font-size: var(--fs-15);
  line-height: 1.4;
  color: var(--link);
  text-decoration: none;
}
.tm-toc__link:hover { background: var(--surface-hover); }
.tm-toc__link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tm-index__n { flex-shrink: 0; min-width: 2.2ch; font-variant-numeric: tabular-nums; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .tm-toc__summary .icon { transition: none; } }

/* Desktop: 24 entries, so the sticky index scrolls inside the window instead of running past it */
@media (min-width: 1024px) {
  .tm .pv-side { max-height: calc(100vh - 2 * var(--sp-7)); }
  .tm-index { display: flex; flex-direction: column; min-height: 0; width: 100%; }
  .tm-index__scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px 4px 2px 2px; }
  .tm .pv-index__link { align-items: baseline; gap: 6px; min-height: 32px; padding-top: 6px; padding-bottom: 6px; font-size: var(--fs-13); line-height: 1.35; }
}
