/* The Legal index and the five legal pages (CR-105 U3), as the app draws them:
   apps/customer-app/lib/features/legal/legal_screen.dart (LegalIndexScreen, LegalScreen, _LegalNav, _Document) and
   legal_markdown.dart (LegalMarkdown, _Table). A computer shows the LEGAL list beside the page; a phone shows the page
   alone under its back pill (900px, the app's Breakpoints.wide). Every section is shown in full, as in the app. */

/* The frame: the app's PageBody(maxWidth: 1160, padding: 40 44 40 70); a phone's padding is 18 16 18 40. Text the app
   gives no height of its own takes the theme's 1.6 (bodyMedium, lib/design/theme.dart). */
.legal-body { max-width: 1160px; margin: 0 auto; padding: 44px 40px 70px; line-height: 1.6; }
.legal-layout { display: flex; align-items: flex-start; gap: 52px; }
.legal-main { flex: 1 1 auto; min-width: 0; }
.legal-main__inner { max-width: 704px; overflow-wrap: break-word; }

/* The LEGAL list (_LegalNav): the five pages, the open one on white with a gold hairline. */
.legal-nav { flex: none; width: 238px; }
.legal-nav__title {
  margin: 0 0 14px; font-size: calc(9.5 * var(--u)); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold-deep);
}
.legal-nav ul { list-style: none; margin: 0; padding: 0; }
.legal-nav li { margin-bottom: 2px; }
.legal-nav a {
  display: block; padding: 10px 12px; border: 1px solid transparent; border-radius: 4px;
  font-size: calc(12 * var(--u)); font-weight: 600; color: #7A7A7A; text-decoration: none;
}
.legal-nav a:hover { color: var(--ink); }
.legal-nav a[aria-current="page"] { background: var(--white); border-color: var(--hairline-strong); color: var(--ink); }

/* Titles (TitleText: balanced lines). */
.legal-title {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: calc(34 * var(--u)); line-height: 1.1;
  color: var(--ink); text-wrap: balance;
}

/* The index's list (LegalIndexScreen): each page's name over a hairline, with a gold ›. */
.legal-index { list-style: none; margin: 24px 0 0; padding: 0; }
.legal-index a {
  display: flex; align-items: center; gap: 12px; padding: 16px 2px; border-bottom: 1px solid #F2ECDC;
  font-size: calc(14 * var(--u)); font-weight: 600; color: var(--ink); text-decoration: none;
}
.legal-index a:hover { color: var(--gold-deep); }
.legal-index__name { flex: 1 1 auto; min-width: 0; }
.legal-index__chevron { flex: none; font-size: calc(16 * var(--u)); color: var(--gold-icon); }

/* A page (_Document): its line, the date between gold rules, the sections, ALSO SEE. */
.legal-summary {
  margin: 11px 0 0; font-family: var(--font-voice); font-style: italic; font-size: calc(19 * var(--u)); line-height: 1.5;
  color: var(--grey-body);
}
.legal-updated {
  margin: 20px 0 0; padding: 12px 0; border-top: 1px solid var(--hairline-strong); border-bottom: 1px solid var(--hairline-strong);
  font-size: calc(12 * var(--u)); color: var(--grey);
}
.legal-updated__label { font-weight: 600; color: var(--ink); }
.legal-intro { margin-top: 24px; }
.legal-section { margin-top: 34px; }
.legal-section--first { margin-top: 24px; }
.legal-section__title {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: calc(21 * var(--u)); line-height: 1.2;
  color: var(--ink);
}
.legal-section__title + .legal-md { margin-top: 10px; }
.legal-also {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline-strong);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
}
.legal-also__title {
  margin: 0; font-size: calc(9.5 * var(--u)); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-deep);
}
.legal-also a {
  font-size: calc(12.5 * var(--u)); color: var(--grey); text-decoration: none; border-bottom: 1px solid var(--hairline-strong);
}
.legal-also a:hover { color: var(--ink); }

/* Her text (LegalMarkdown): 14px body at 1.75, 10px between blocks. */
.legal-md { font-size: calc(14 * var(--u)); line-height: 1.75; color: #3D3D3D; }
.legal-md > *, .legal-md blockquote > * { margin: 0; }
.legal-md > * + *, .legal-md blockquote > * + * { margin-top: 10px; }
.legal-md strong { font-weight: 600; color: var(--ink); }
.legal-md em { font-style: italic; }
.legal-md h2, .legal-md h3, .legal-md h4, .legal-md h5, .legal-md h6 {
  padding-top: 8px; font-family: var(--font-display); font-weight: 700; font-size: calc(16 * var(--u)); line-height: 1.25;
  color: var(--ink);
}
.legal-md h2 { font-size: calc(19 * var(--u)); }

/* Lists: a gold bullet or number in a 22px column, each item over a hairline. */
.legal-md ul, .legal-md ol { list-style: none; padding: 0; counter-reset: legal-item; }
.legal-md li {
  position: relative; padding: 7px 0 7px 1.375rem; border-bottom: 1px solid #F2ECDC; font-size: calc(13.5 * var(--u));
}
.legal-md li::before {
  content: "•"; position: absolute; left: 0; top: 7px; font-size: calc(14 * var(--u)); font-weight: 600; color: var(--gold-deep);
}
.legal-md ol > li { counter-increment: legal-item; }
.legal-md ol > li::before { content: counter(legal-item) "."; }

/* A quote: the gold box, a little smaller; an all-bold first line is its label. */
.legal-md blockquote {
  padding: 14px 16px 14px 19px; background: #FCF8EA; border: 1px solid var(--hairline-strong); border-radius: 5px;
  box-shadow: inset 3px 0 0 var(--gold); font-size: calc(13.5 * var(--u)); line-height: 1.7;
}
.legal-md > blockquote { margin-top: 4px; }
.legal-md > * + blockquote { margin-top: 14px; }
.legal-md blockquote li, .legal-md blockquote li::before { font-size: calc(13.5 * var(--u)); }
.legal-quote__label {
  font-size: calc(9.5 * var(--u)); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; line-height: 1.6;
  color: var(--gold-deep);
}

/* A table: white, bordered, a cream header row of gold capitals; the first column 10 parts to the others' 12. */
.legal-md .table-scroll {
  position: relative; container-type: inline-size; background: var(--white); border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden;
}
.legal-md > .table-scroll { margin-top: 2px; }
.legal-md > * + .table-scroll { margin-top: 12px; }
.legal-md table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.legal-md th:first-child { width: calc(100% * 10 / 22); }
.legal-md table:has(th:nth-child(3)) th:first-child { width: calc(100% * 10 / 34); }
.legal-md table:has(th:nth-child(4)) th:first-child { width: calc(100% * 10 / 46); }
.legal-md table:has(th:nth-child(5)) th:first-child { width: calc(100% * 10 / 58); }
.legal-md th:only-child { width: auto; }
.legal-md thead { background: #FCFAF3; }
.legal-md th {
  padding: 9px 10px; text-align: left; vertical-align: middle; font-size: calc(8.5 * var(--u)); font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; line-height: 1.6; color: var(--gold-deep);
}
.legal-md td {
  padding: 10px; vertical-align: top; border-top: 1px solid #F5F0E2;
  font-size: calc(13 * var(--u)); line-height: 1.55; color: var(--grey-body);
}
.legal-md td:first-child { color: var(--ink); font-weight: 600; }
/* Narrower than 520px (the app's _Table): no header row on view, each row's cells stacked. */
@container (max-width: 517.98px) {
  .legal-md thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
  .legal-md table, .legal-md tbody, .legal-md tr, .legal-md td { display: block; width: auto; }
  .legal-md tr { padding: 8px 0; border-top: 1px solid #F5F0E2; }
  .legal-md td { padding: 3px 12px; border-top: 0; }
}

/* A phone (the app's phone sizes). */
@media (max-width: 899.98px) {
  .legal-body { padding: 16px 18px 40px; }
  .legal-back { margin-bottom: 16px; }
  .legal-layout { display: block; }
  .legal-nav, .legal-also { display: none; }
  .legal-title { font-size: calc(24 * var(--u)); line-height: 1.15; }
  .legal-title--index { font-size: calc(26 * var(--u)); }
  .legal-index { margin-top: 20px; }
  .legal-summary { margin-top: 8px; font-size: calc(15.5 * var(--u)); }
  .legal-updated { margin-top: 16px; padding: 11px 0; font-size: calc(11.5 * var(--u)); }
  .legal-section { margin-top: 26px; }
  .legal-intro, .legal-section--first { margin-top: 20px; }
  .legal-section__title { font-size: calc(19 * var(--u)); }
}
