/* legal.css: the privacy, terms and accessibility pages (templates/generic.html).
   Loaded after company.css, which keeps the shared legal body rules. Tokens
   only; no hex codes. Marked floor (18 Nov): the "On this page" list is not
   numbered (the headings it lists aren't), and its labels are sentence case
   in the house label style, never caps or monospace. */

.band.legal { padding-top: var(--space-7); }
@media (min-width: 768px) { .band.legal { padding-top: var(--space-8); } }
.legal__layout { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-6); }
.legal__layout > * { min-width: 0; }

/* ---- "In short": the house callout, with the prose list style ----------- */
.legal__summary { max-width: var(--container-reading); margin-bottom: var(--space-4); }
.legal__summary-label { margin-bottom: var(--space-3); }
.legal__summary ul { margin-bottom: 0; }
.legal__summary li:last-child { margin-bottom: 0; }
@media (max-width: 575.98px) {
  .legal__summary { padding: var(--space-5) var(--space-5) var(--space-5) 28px; }
  .legal__summary::before { top: var(--space-5); bottom: var(--space-5); }
}

/* ---- "On this page" --------------------------------------------------------- */
.legal__toc-list { list-style: none; margin: 0; padding: 0; }
.legal__toc-list a {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-height: var(--target-min);
  padding: 11px 0;
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--color-text);
  text-decoration: none;
}
.legal__toc-list a:hover { color: var(--color-link-hover); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* The section in view (legal.js): ink, 600, and a 4 px teal bar on the
   list's left edge, the callout's mark. */
.legal__toc-list a[aria-current="location"] { color: var(--color-text-heading); font-weight: 600; }
@media (min-width: 992px) {
  .legal__toc--side .legal__toc-list a { position: relative; }
  .legal__toc--side .legal__toc-list a[aria-current="location"]::before { content: ""; position: absolute; left: calc(-1 * var(--space-5)); top: 10px; bottom: 10px; width: 4px; background: var(--color-marker); }
}

/* Two copies of the list: the side column from 992 px, the closed row below
   that. The one not in use is display: none, so it is out of the tab order
   and the accessibility tree. */
.legal__toc--side { display: none; }
.legal__toc-label { margin-bottom: var(--space-2); }
@media (min-width: 992px) {
  .legal__toc--side { display: block; }
  .legal__toc--compact { display: none; }
  .legal__layout--toc {
    grid-template-columns: minmax(0, var(--container-reading)) minmax(200px, 264px);
    column-gap: clamp(48px, 6vw, 112px);
    justify-content: space-between;
  }
  .legal__layout--toc > :not(.legal__toc) { grid-column: 1; }
  .legal__toc--side {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: calc(var(--nav-h) + var(--space-6));
    max-height: calc(100vh - var(--nav-h) - var(--space-7));
    overflow-y: auto;
    padding-left: var(--space-5);
    border-left: 1px solid var(--color-border);
  }
  .legal__toc--side .legal__toc-list li + li a { border-top: 1px solid var(--color-border); }
}

/* Narrow screens: one closed row above the text. */
.legal__toc--compact details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.legal__toc--compact summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--target-min);
  padding: 10px var(--space-4);
  cursor: pointer;
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--color-label);
}
.legal__toc--compact summary::-webkit-details-marker { display: none; }
.legal__toc--compact summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin: -4px 4px 0 0;
  border-right: 2px solid var(--color-marker);
  border-bottom: 2px solid var(--color-marker);
  transform: rotate(45deg);
}
.legal__toc--compact details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.legal__toc--compact details[open] summary { border-bottom: 1px solid var(--color-border); }
.legal__toc--compact .legal__toc-list { padding: var(--space-1) var(--space-4) var(--space-2); }
.legal__toc--compact .legal__toc-list li + li a { border-top: 1px solid var(--color-border); }

/* ---- Body ------------------------------------------------------------------- */
.legal__body table { margin-top: var(--space-5); }
.legal__body th:last-child, .legal__body td:last-child { padding-right: 0; }
.legal__body td:first-child { color: var(--color-text-heading); }
.legal__body th:nth-child(3), .legal__body td:nth-child(3) { white-space: nowrap; }
.legal__body h2 + p { margin-top: 0; }
@media (min-width: 992px) {
  .legal__layout--toc .legal__body { max-width: none; }
  .legal__layout--toc .legal__body > :not(table) { max-width: var(--measure-body); }
}
.legal__body a[href^="tel:"], .legal__body a[href^="mailto:"] { white-space: nowrap; }
/* html already has scroll-padding-top (the header height + 16 px); this adds
   one small gap so a heading doesn't sit flush under the sticky header. */
.page-legal .legal__body h2[id] { scroll-margin-top: var(--space-4); }
