/* Shared styles for /legal/* — built on /ds/v1 tokens (same topbar/footer as /analyst). */
html, body { overflow-x: hidden; }
body { background: var(--bg); color: var(--text); }
.wrap { max-width: var(--w-page); margin-inline: auto; padding-inline: var(--s-6); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.skip { position: absolute; inset-inline-start: var(--s-3); top: -60px; z-index: 100; padding: 8px 12px;
  background: var(--brand); color: #fff; border-radius: var(--r-sm); }
.skip:focus { top: var(--s-3); }

/* topbar — navy in both themes */
.topbar { position: sticky; top: 0; z-index: var(--z-nav); background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); }
.topbar-in { max-width: var(--w-page); margin-inline: auto; padding-inline: var(--s-6);
  height: 56px; display: flex; align-items: center; gap: var(--s-5); }
.brand-link { display: flex; align-items: center; gap: 10px; color: #fff;
  font-family: var(--font-display); font-weight: var(--fw-bold); letter-spacing: -.01em; }
.brand-link:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--p-blue-600);
  display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 16px; height: 16px; }
.brand-sub { color: var(--nav-text-soft); font-weight: var(--fw-medium); font-family: var(--font-ui); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s-2); }
.icon-btn { height: var(--ctl-h-sm); min-width: var(--ctl-h-sm); padding-inline: 8px;
  display: inline-flex; align-items: center; justify-content: center; background: transparent;
  color: var(--nav-text); border: 1px solid var(--nav-line); border-radius: var(--ctl-r); cursor: pointer;
  transition: background var(--ease-fast), color var(--ease-fast); }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.icon-btn svg { width: 15px; height: 15px; }
@media (max-width: 560px) { .topbar-in { padding-inline: var(--s-4); gap: var(--s-2); } }

/* document */
.doc { max-width: var(--w-narrow); margin-inline: auto; padding: var(--s-14) var(--s-6) var(--s-20); }
@media (max-width: 560px) { .doc { padding: var(--s-8) var(--s-4) var(--s-14); } }
.eyebrow { margin: 0 0 var(--s-2); font-size: var(--t-sm); font-weight: var(--fw-semi); color: var(--brand); }
.doc h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); font-weight: var(--fw-black); }
.doc h2 { font-size: var(--t-2xl); font-weight: var(--fw-bold); margin-bottom: var(--s-3); }
.doc h3 { font-size: var(--t-lg); font-weight: var(--fw-semi); margin: var(--s-5) 0 var(--s-2); }
.doc p, .doc li { font-size: var(--t-md); line-height: var(--lh-body); color: var(--text-soft); }
.doc p { margin: 0 0 var(--s-3); }
.doc ul { margin: 0 0 var(--s-3); padding-inline-start: var(--s-6); }
.doc strong { color: var(--text); }
.doc a { color: var(--brand); }
.updated { margin-top: var(--s-2) !important; font-size: var(--t-sm) !important; color: var(--text-mut) !important; }
.lead { margin-top: var(--s-6) !important; font-size: var(--t-lg) !important; }
.note { font-size: var(--t-sm) !important; color: var(--text-mut) !important; }
.doc section { padding-top: var(--s-10); margin-top: var(--s-10); border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.toc { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--bg-card);
  font-size: var(--t-sm); color: var(--text-soft); }
.toc a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.callout { padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-inline-start: 3px solid var(--warn);
  border-radius: var(--r-lg); background: var(--warn-soft); margin: var(--s-4) 0; }
.callout p { margin: 0; color: var(--text); }
.en { font-family: 'Inter', var(--font-ui); }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); }
.tbl-wrap:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-base); }
.tbl th, .tbl td { padding: var(--s-3) var(--s-4); text-align: start; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.tbl thead th { background: var(--bg-soft); font-size: var(--t-sm); font-weight: var(--fw-semi); color: var(--text-soft); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td { color: var(--text-soft); line-height: var(--lh-ui); }
.tbl td strong { color: var(--text); }
.tbl .num { font-weight: var(--fw-bold); color: var(--text); white-space: nowrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-full); border: 1px solid var(--line);
  font-size: var(--t-xs); font-weight: var(--fw-medium); color: var(--text-soft); white-space: nowrap; }
.pill.on { border-color: var(--brand-line, var(--brand)); color: var(--brand); background: var(--brand-soft); }
.sev { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; }
.sev.s1 { background: var(--bad); } .sev.s2 { background: var(--warn); } .sev.s3 { background: var(--brand); } .sev.s4 { background: var(--text-mut); }

/* phones: tables collapse into stacked cards, each cell labelled from data-h */
@media (max-width: 720px) {
  .tbl-wrap { border: 0; background: transparent; overflow: visible; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { margin-bottom: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); padding: var(--s-2) 0; }
  .tbl td { border: 0; padding: 6px var(--s-4); }
  .tbl td::before { content: attr(data-h); display: block; font-size: var(--t-xs); font-weight: var(--fw-semi); color: var(--text-mut); margin-bottom: 2px; }
  .tbl td:first-child::before { display: none; }
  .tbl td:first-child { font-size: var(--t-md); }
}

footer { border-top: 1px solid var(--line); padding-block: var(--s-8); padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom)); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
  font-size: var(--t-sm); color: var(--text-mut); }
.foot a { color: var(--text-mut); } .foot a:hover { color: var(--text); }
.foot a[aria-current="page"] { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
