:root {
  color-scheme: dark;
  --legal-bg: #07111f;
  --legal-panel: #0d1b2c;
  --legal-panel-alt: #102339;
  --legal-text: #edf5ff;
  --legal-muted: #b6c7da;
  --legal-line: #29405b;
  --legal-accent: #73d7c8;
  --legal-accent-ink: #06201d;
  --legal-blue: #38bdf8;
  --legal-indigo: #818cf8;
  --legal-teal: #0f766e;
  --legal-amber: #f59e0b;
}

* { box-sizing: border-box; }

.legal-page {
  margin: 0;
  min-height: 100vh;
  background: var(--legal-bg);
  color: var(--legal-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.68;
}

.legal-page a { color: var(--legal-accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-page a:hover { color: #a3ece1; }
.legal-page a:focus-visible,
.legal-page button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.legal-skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 50;
  padding: .75rem 1.25rem;
  background: #fff;
  color: #07111f !important;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
}
.legal-skip:focus { top: 1rem; }

.legal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem max(1.25rem, calc((100% - var(--cube-page-max, 1240px)) / 2));
  border-bottom: 1px solid var(--legal-line);
  background: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.legal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.legal-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}

.legal-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--legal-accent);
}

.legal-close-icon {
  display: none;
}

.legal-nav-toggle[aria-expanded="true"] .legal-menu-icon {
  display: none;
}

.legal-nav-toggle[aria-expanded="true"] .legal-close-icon {
  display: block;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 750;
  font-size: 1.05rem;
  color: #fff !important;
  text-decoration: none !important;
  white-space: nowrap;
  flex: 0 0 auto;
}

.legal-brand img { width: 26px; height: 26px; }

.legal-nav-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: .5rem;
  align-items: center;
}

.legal-nav-tabs a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 40px;
  padding: .38rem .85rem;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--legal-muted) !important;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: all .15s ease;
}

.legal-nav-tabs a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--legal-line);
}

.legal-nav-tabs a.active {
  color: #fff !important;
  background: rgba(115, 215, 200, 0.12);
  border-color: rgba(115, 215, 200, 0.35);
}

.legal-nav-tabs a.legal-nav-home {
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd !important;
  font-weight: 650;
  border-radius: 999px;
  padding: .38rem .95rem;
}

.legal-nav-tabs a.legal-nav-home:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.6);
  color: #fff !important;
}

.legal-shell {
  width: var(--cube-page-width, min(1240px, calc(100% - 40px)));
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}


.legal-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--legal-accent);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-shell h1 {
  margin: .45rem 0 1rem;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.legal-lede {
  max-width: var(--cube-measure, 70ch);
  color: var(--legal-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.legal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
  padding: .9rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--legal-line);
  border-radius: 12px;
  font-size: .88rem;
  color: var(--legal-muted);
}

.legal-meta-bar strong { color: #fff; }

.legal-section {
  margin-top: 2.2rem;
  padding: 1.8rem;
  border: 1px solid var(--legal-line);
  border-radius: 18px;
  background: var(--legal-panel);
}

.legal-section h2 {
  margin: 0 0 .85rem;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  color: #fff;
}

.legal-section h3 {
  margin: 1.3rem 0 .5rem;
  font-size: 1.08rem;
  color: #edf5ff;
}

.legal-section p:last-child,
.legal-section ul:last-child { margin-bottom: 0; }
.legal-section li + li { margin-top: .45rem; }

/* Page frame: the legal pages are a two-column grid inside the shared 1240 px container, [content][details panel].
   - The frame has THREE children, in this order: .legal-head (kicker, title, lede), .legal-meta-bar (the details card) and
     .legal-body (every section card). Content on the left (head over body) takes all the room that is left; the panel is the
     right-hand column, 18rem (288 px), sticky for the WHOLE page: one grid item that spans the two content rows
     (grid-row: 1 / span 2) with align-self: start, so its cell is as tall as the content and it sticks from the first section to
     the last. The row count comes from the markup (head + body), never from counting sections.
     (OneCare "hero panel" pattern: sticky + top-24 + self-start on the element.)
   - Nothing runs under or over the panel: every section card is the width of the content column; card pairs, record cards and the
     spec table fit in it (no legal table scrolls sideways at any width: see "Legal tables" below), so all cards of a page are the
     same width.
   - Prose inside a card keeps a reading measure (--cube-measure, 80ch at most) and the body text is 17 px from 1100 px up;
     no CSS columns anywhere (a reader had to climb back up to read the second column and sentences broke across them).
   - Below 1100 px nothing is placed: one column, the details card between the heading and the body, as it always was. */
.legal-shell {
  --legal-measure: var(--cube-measure, 70ch);
  --legal-card-pad: 1.8rem;
  --legal-aside-w: 18rem;
  --legal-aside-gap: 2.5rem;
  --legal-sticky-top: 6rem;
}
/* With the site index on there is no sticky legal header to clear (it is hidden), so the panel sits closer to the top. */
html.csr-on .legal-shell { --legal-sticky-top: 2rem; }

/* Each card is a size container: the card pairs inside it collapse to one column when THE CARD is narrow (the site index changes
   how much room a card gets at the same window width, so a window breakpoint cannot decide that). */
.legal-body > section { padding: var(--legal-card-pad); container-type: inline-size; }
.legal-body > section > p,
.legal-body > section > ul,
.legal-body > section > h3,
.legal-body > section > .legal-callout { max-width: var(--legal-measure); }
.legal-body > section h3 { break-after: avoid; }
.legal-card,
.legal-callout,
.privacy-choice { break-inside: avoid; }

@media (min-width: 1100px) {
  .legal-page { font-size: 17px; }
  .legal-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--legal-aside-w);
    column-gap: var(--legal-aside-gap);
    align-items: start;
  }
  .legal-shell > .legal-head,
  .legal-shell > .legal-body { grid-column: 1; min-width: 0; }
  .legal-head > .legal-lede,
  .legal-head > .privacy-lede { margin-bottom: 0; }
  .legal-shell > .legal-meta-bar {
    grid-column: 2;
    grid-row: 1 / span 2; /* the two content rows (head, body): the panel's cell is as tall as the content */
    align-self: start;
    position: sticky;
    top: var(--legal-sticky-top);
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 1.1rem 1.35rem;
    border-radius: 16px;
    background: var(--legal-panel);
    color: var(--legal-text);
    font-size: .92rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .legal-meta-bar > div + div { padding-top: .75rem; border-top: 1px solid var(--legal-line); }
  .legal-meta-bar strong {
    display: block;
    margin-bottom: .1rem;
    color: var(--legal-accent);
    font-size: .74rem;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  /* A short window cannot hold a sticky panel (it would be cut off): it scrolls with the page instead. */
  @media (max-height: 540px) {
    .legal-shell > .legal-meta-bar { position: static; }
  }
}

.legal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* pairs and quads: 2 across (2 x 2), never 3 + 1 */
  gap: 1.25rem;
  margin: 1.25rem 0;
}
/* Two cards across need ~280 px each: in a card narrower than 36rem of content (window 1100-1340 px with the site index open,
   or phones) the pair stacks; the long e-mail addresses and statement descriptors then never overflow the card. */
@container (max-width: 36rem) {
  .legal-grid-2 { grid-template-columns: 1fr; }
}

.legal-card {
  padding: 1.35rem;
  border: 1px solid var(--legal-line);
  border-radius: 14px;
  background: var(--legal-panel-alt);
}

.legal-card-spaced {
  margin-top: 1rem;
}

.legal-card h3 { margin-top: 0; }

.legal-badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.legal-badge-pill {
  border: 1px solid rgba(115, 215, 200, 0.4);
  background: rgba(115, 215, 200, 0.1);
  color: var(--legal-accent);
}

.legal-badge-future {
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: var(--legal-amber);
}

.legal-callout {
  margin: 1.25rem 0;
  padding: 1.15rem 1.35rem;
  border-left: 4px solid var(--legal-accent);
  border-radius: 0 12px 12px 0;
  background: rgba(115, 215, 200, 0.06);
  color: var(--legal-text);
  font-size: .95rem;
}

.legal-callout-alert {
  border-left-color: var(--legal-amber);
  background: rgba(245, 158, 11, 0.08);
}

/* ── Legal tables ──────────────────────────────────────────────────────────────────────────────────────────────────────
   Rule (cube UI): a table cell is never more than 2 lines, and legal text is NEVER cut with an ellipsis (hiding a clause behind a
   tooltip weakens it). The rule is met by restructuring, not by trimming:
   - .legal-records: a table whose cells carry sentences (products and sub-processors) is a LIST OF RECORD CARDS at every width.
     Each <tr> is a card: the name is the title, the status is a badge, the sentence is a full paragraph, every other field is a
     label/value pair. The labels come from the header text itself (data-label on each cell). The markup stays a <table> with explicit
     ARIA roles (display is no longer table), and its header row is visually hidden but kept in the accessibility tree.
   - .legal-spec: a two-column label/value table (support) whose cells fit in 2 lines stays a table from 1100 px up; below 1100 px each row
     is a stacked card with the label over its value.
   Nothing here scrolls sideways at any width: there is no scroll region and no "scroll horizontally" notice any more. */
.legal-records {
  display: block;
  position: relative;
  width: 100%;
  margin: 1.25rem 0 0;
  border: 0;
  border-collapse: separate;
  font-size: .93rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
/* Header row: hidden for sighted users (each card labels its own fields) but kept for assistive technology. */
.legal-records thead {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.legal-records thead tr,
.legal-records thead th { display: block; padding: 0; border: 0; }
.legal-records tbody { display: grid; gap: .85rem; }
.legal-records tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: .8rem 1.5rem;
  padding: 1.1rem 1.25rem 1.2rem;
  border: 1px solid var(--legal-line);
  border-radius: 14px;
  background: var(--legal-panel-alt);
}
.legal-records td {
  display: block;
  min-width: 0;
  margin: 0;
  overflow-wrap: break-word;
}
.legal-records td:not(.legal-badge) {
  padding: 0;
  border: 0;
  color: var(--legal-text);
}
/* Field label: the column header text, over its value. The title and the status badge are self-describing and carry none. */
.legal-records td[data-label]:not(:first-child):not(.legal-badge)::before {
  content: attr(data-label);
  content: attr(data-label) / "";
  display: block;
  margin-bottom: .2rem;
  color: var(--legal-accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}
.legal-records td:first-child strong {
  display: block;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
/* Status badge (same pill / future tones as the product cards on /terms). */
.legal-records td.legal-badge {
  width: max-content;
  max-width: 100%;
  justify-self: start;
  align-self: center;
  line-height: 1.4;
}
/* The sentence is a paragraph with a reading measure, not a cell squeezed into a column. 60ch of this 15 px text (tabular figures widen "ch")
   gives a median of ~75 characters per full line (70ch gave 87), measured with caracteres_por_linea.mjs. */
.legal-records-products td:nth-child(3) { max-width: min(var(--legal-measure), 60ch); }

/* Products: [name | badge] over the full paragraph. The badge drops under the name when the card is narrow. */
@container (min-width: 28rem) {
  .legal-records-products tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
  .legal-records-products td.legal-badge { justify-self: end; }
  .legal-records-products td:nth-child(3) { grid-column: 1 / -1; }
}
/* Sub-processors: name on top, then role / data / jurisdiction as label-value pairs: 1 column in a narrow card, 2 (role on its own
   row) in a medium one, 3 side by side in a wide one. The card is the size container, so the site index (which narrows it) is covered. */
.legal-records-providers td:first-child { grid-column: 1 / -1; }
@container (min-width: 28rem) {
  .legal-records-providers tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-records-providers td:nth-child(2) { grid-column: 1 / -1; }
}
@container (min-width: 40rem) {
  .legal-records-providers tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .legal-records-providers td:nth-child(2) { grid-column: auto; }
}

/* Patents: family title on top, status badge, metadata cells, and full architectural scope */
.legal-records-patents td:first-child { grid-column: 1 / -1; }
@container (min-width: 28rem) {
  .legal-records-patents tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-records-patents td.legal-badge { grid-column: 1 / -1; }
  .legal-records-patents td[data-label="Architectural Scope"] { grid-column: 1 / -1; }
}
@container (min-width: 44rem) {
  .legal-records-patents tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .legal-records-patents td.legal-badge { grid-column: auto; justify-self: end; }
  .legal-records-patents td[data-label="Architectural Scope"] { grid-column: 1 / -1; }
}

/* Spec table (two columns, label | value): stays a table from 1100 px; stacked cards below. */
.legal-spec {
  width: 100%;
  margin: 1.25rem 0 0;
  border: 1px solid var(--legal-line);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  font-size: .93rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.legal-spec th,
.legal-spec td {
  padding: .75rem .8rem;
  border-bottom: 1px solid var(--legal-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
.legal-spec tr:last-child > th,
.legal-spec tr:last-child > td { border-bottom: 0; }
.legal-spec th[scope="row"] {
  width: 32%;
  border-right: 1px solid var(--legal-line);
  background: rgba(7, 17, 31, 0.45);
  color: var(--legal-accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  line-height: 1.5;
  text-transform: uppercase;
}
.legal-spec td { color: var(--legal-text); font-size: .9rem; }

.legal-footer {
  width: var(--cube-page-width, min(1240px, calc(100% - 40px)));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--legal-line);
  color: var(--legal-muted);
  font-size: .88rem;
  line-height: 1.6;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.legal-footer-links a {
  color: var(--legal-muted) !important;
  text-decoration: none !important;
  font-weight: 500;
}

.legal-footer-links a:hover {
  color: var(--legal-accent) !important;
  text-decoration: underline !important;
}

.legal-footer-disclaimer {
  max-width: 800px;
  margin: 1rem auto 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #8892b0;
  text-align: center;
}

.legal-footer-copy {
  margin-top: 0.5rem;
  text-align: center;
}

/* Header: the tab strip collapses into the menu button before it can wrap (it used to wrap at ~1300 px). */
@media (max-width: 1100px) {
  .legal-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem 1.1rem;
  }
  .legal-header-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .legal-nav-toggle {
    display: inline-flex;
  }
  .legal-nav-tabs {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.75rem 0.6rem;
    background: rgba(13, 27, 44, 0.98);
    border: 1px solid var(--legal-line);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
  }
  .legal-nav-tabs.is-open {
    display: flex;
    animation: legalNavFadeIn 0.2s ease-out forwards;
  }
  .legal-nav-tabs a {
    white-space: normal;
    min-height: 44px;
    padding: 0.65rem 0.95rem;
    font-size: 0.92rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .legal-nav-tabs a.legal-nav-home {
    border-radius: 8px !important;
    background: rgba(59, 130, 246, 0.14) !important;
    border: 1px solid rgba(96, 165, 250, 0.35) !important;
    color: #93c5fd !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    gap: 6px;
  }
}

/* Below 1100 px every legal table is a stack of cards, one per row, label over value (no sideways scroll, no table columns). */
@media (max-width: 1099.98px) {
  .legal-spec,
  .legal-spec tbody {
    display: block;
    border: 0;
    border-radius: 0;
    background: none;
    overflow: visible;
  }
  .legal-spec tbody { display: grid; gap: .7rem; }
  .legal-spec tr {
    display: block;
    padding: .9rem 1.1rem 1rem;
    border: 1px solid var(--legal-line);
    border-radius: 12px;
    background: var(--legal-panel-alt);
  }
  .legal-spec th,
  .legal-spec td,
  .legal-spec th[scope="row"] {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: none;
  }
  .legal-spec th[scope="row"] { margin-bottom: .25rem; }
}

@media (max-width: 768px) {
  .legal-shell { padding-top: 2rem; }
  .legal-section,
  .legal-body > section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 1.25rem 1rem !important;
  }
  .legal-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .legal-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 1.15rem 1.15rem !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }
}

@keyframes legalNavFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
