/* Bsync legal pages — shared stylesheet.
   Matches the app's own palette (indigo #6366f1) and typeface (Inter).
   Theme-aware: follows the reader's OS setting, like the app does. */

:root {
  --indigo:      #6366f1;
  --indigo-deep: #4f46e5;
  --ground:      #f7f7fb;
  --surface:     #ffffff;
  --ink:         #111827;
  --ink-soft:    #374151;
  --ink-mute:    #6b7280;
  --ink-faint:   #9ca3af;
  --rule:        #e5e7eb;
  --tint:        #eef2ff;
  --warn-tint:   #fff7ed;
  --warn-rule:   #f59e0b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --indigo:      #a5b4fc;
    --indigo-deep: #818cf8;
    --ground:      #0f1218;
    --surface:     #171b23;
    --ink:         #f1f5f9;
    --ink-soft:    #cbd5e1;
    --ink-mute:    #94a3b8;
    --ink-faint:   #64748b;
    --rule:        #2a3038;
    --tint:        #1e2035;
    --warn-tint:   #2b2113;
    --warn-rule:   #d97706;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--ground);
  padding: 0 16px 72px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 760px;
  margin: 32px auto 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 44px 52px;
}

/* ── Masthead ────────────────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

/* The real brand mark, not a letter in a box. Served at 320px wide and drawn
   at 48, so it stays sharp on 2x and 3x screens. Height is set from the
   source aspect ratio (320x206) rather than left to `auto`, so the header
   does not reflow when the image lands.

   The <picture> wrapper is what swaps the colour mark for the white one in
   dark mode, so it needs to behave as the flex child itself -- without this
   the wrapper collapses and the image loses its box. */
.brand picture {
  display: block;
  flex: none;
  line-height: 0;
}

.brand-mark {
  width: 48px;
  height: 31px;
  flex: none;
  display: block;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}

h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.6px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 30px;
}

/* ── Structure ───────────────────────────────────────────────────────── */

h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 24px;
  margin-bottom: 8px;
}

p { margin-bottom: 15px; }

ul, ol { margin: 12px 0 16px 22px; }
li { margin-bottom: 8px; }

strong { color: var(--ink); font-weight: 600; }

a { color: var(--indigo-deep); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--indigo); }
a:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 3px; }

hr { border: none; border-top: 1px solid var(--rule); margin: 36px 0; }

/* ── Callouts ────────────────────────────────────────────────────────── */

.callout {
  background: var(--tint);
  border-left: 4px solid var(--indigo);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
}
.callout p:last-child { margin-bottom: 0; }

.callout-warn {
  background: var(--warn-tint);
  border-left-color: var(--warn-rule);
}

.summary {
  background: var(--tint);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 8px;
}
.summary p:last-child { margin-bottom: 0; }
.summary ul { margin-bottom: 0; }

/* ── Data tables ─────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; margin: 18px 0 22px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 520px;
}

th {
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  background: var(--tint);
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}

tr:last-child td { border-bottom: none; }

/* ── Contact block ───────────────────────────────────────────────────── */

.contact-box {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 16px;
}
.contact-box p { margin-bottom: 6px; }
.contact-box p:last-child { margin-bottom: 0; }

/* ── Table of contents ───────────────────────────────────────────────── */

.toc {
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 24px 0 8px;
}
.toc h2 {
  margin: 0 0 12px;
  padding: 0;
  border: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.toc ol { margin: 0 0 0 20px; }
.toc li { margin-bottom: 5px; font-size: 14.5px; }

/* ── Nav / footer ────────────────────────────────────────────────────── */

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.page-nav a {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--ground);
}
.page-nav a:hover { border-color: var(--indigo); color: var(--indigo-deep); }

footer {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 0 4px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

/* ── Index page ──────────────────────────────────────────────────────── */

.doc-list { display: grid; gap: 12px; margin-top: 26px; }

.doc-card {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  text-decoration: none;
  background: var(--ground);
}
.doc-card:hover { border-color: var(--indigo); }
.doc-card .t {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.doc-card .d { display: block; font-size: 14px; color: var(--ink-mute); line-height: 1.55; }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 680px) {
  body { padding: 0 12px 56px; }
  .container { padding: 30px 22px; margin-top: 16px; border-radius: 12px; }
  h1 { font-size: 25px; }
  h2 { font-size: 17.5px; margin-top: 32px; }
  body { font-size: 15.5px; }
}

@media print {
  body { background: #fff; padding: 0; }
  .container { border: none; max-width: none; padding: 0; }
  .page-nav { display: none; }
  a { color: #000; }
}
