/* The legal documents at /terms, /privacy, /dpa and /acceptable-use (ew2/legal.py), on top of home.css. */
.legal { padding: 48px max(24px, calc((100vw - 820px) / 2)) 24px; }
.legal-doc { background: var(--sheet); border: 1px solid var(--line); border-radius: 20px; padding: 48px 56px 56px; }
.legal-doc h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-bottom: 20px; }
.legal-doc h2 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin: 40px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.legal-doc h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.legal-doc p, .legal-doc ul, .legal-doc ol { margin: 0 0 12px; }
.legal-doc ul, .legal-doc ol { padding-left: 1.4em; }
.legal-doc li { margin-bottom: 6px; }
/* Numbered clauses and lettered items use a hanging indent: the number sits in the margin and the words wrap
   normally beneath each other. Not a grid: in a grid every link or bold term becomes its own column, which broke
   "Privacy Notice" into 3 or 4 letters a line on phones (Han's iPhone, 12 October 2026). */
.legal-doc { overflow-wrap: break-word; }
.legal-doc .clause { padding-left: 3.4em; text-indent: -3.4em; font-size: inherit; color: inherit; font-weight: inherit; margin-bottom: 12px; }  /* home.css has a .clause of its own for the demo */
.legal-doc .sub { padding-left: 5.8em; text-indent: -2.4em; }
.legal-doc .num { display: inline-block; text-indent: 0; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legal-doc .clause > .num { width: 3.4em; }
.legal-doc .sub > .num { width: 2.4em; }
.legal-doc .clause > .num, .legal-doc .sub > .num { margin-right: -0.26em; }  /* take back the space after the number, so wrapped lines align */
.legal-doc .clause > *, .legal-doc .sub > * { text-indent: 0; }
.legal-doc .counsel { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .01em; color: #6b4a00; background: #fbefcf; border: 1px solid #ecd59a; border-radius: 6px; padding: 0 6px; margin-left: 2px; }
.legal-doc code { font-size: .9em; background: var(--tint); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; }
.legal-doc a { overflow-wrap: break-word; }
.legal-doc .table-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--line); border-radius: 12px; }
.legal-doc table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.legal-doc th, .legal-doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal-doc th { background: var(--tint); font-weight: 600; }
.legal-doc tr:last-child td { border-bottom: 0; }
.legal-nav { gap: 20px; }
.legal-nav a[aria-current="page"], .legal-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
@media (max-width: 620px) {
  .legal { padding: 16px 16px 8px; }
  .legal-doc { padding: 24px 18px 28px; border-radius: 16px; }
  .legal-doc .clause { padding-left: 0; text-indent: 0; }
  .legal-doc .clause > .num { display: block; width: auto; margin-bottom: 2px; }
  .legal-doc .sub { padding-left: 2.2em; text-indent: -2.2em; }
  .legal-doc .sub > .num { width: 2.2em; }
  /* Columns size to whole words (a fixed layout split "communications" mid-word); the wrapper scrolls if ever needed. */
  .legal-doc table { font-size: .82rem; }
  .legal-doc th, .legal-doc td { padding: 8px 6px; overflow-wrap: normal; }
  .foot { padding-left: 16px; padding-right: 16px; }
}
/* On a phone a table's rows become cards of label over value (Microsoft's Cards view; the house rule for phones): no
   table scrolls sideways and hides words to the right (website audit, 21 October 2026). */
@media (max-width: 620px) {
  .legal-doc .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .legal-doc .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal-doc .table-wrap table, .legal-doc .table-wrap tbody, .legal-doc .table-wrap tr, .legal-doc .table-wrap td { display: block; width: auto; }
  .legal-doc .table-wrap tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .legal-doc .table-wrap td { border: 0; padding: 4px 0; font-size: .9rem; }
  .legal-doc .table-wrap td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); }
  .legal-doc .table-wrap td[data-label=""]::before { content: none; }
}
/* Touch screens: the brand and the legal links are 44 px targets (L5, second UI pass, 21 October 2026). */
@media (pointer: coarse) {
  .brand { display: inline-flex; align-items: center; min-height: 44px; }
  .foot-legal a, .legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
}
