/* Legal pages (privacy.html, terms.html, delete-account.html), generated by tools/legalgen
   from legal/*.md (FEATURES-000008). Colours follow the app's design system
   (sipelo/docs/design-system.md §3): brand blue + slate, light and dark. */

:root {
  --brand: #2563EB;
  --brand-deep: #1D4ED8;
  --ink: #0F172A;
  --ink-soft: #475569;
  --rule: #E2E8F0;
  --paper: #F8FAFC;
  --sheet: #FFFFFF;
  --tint: #F1F5F9;
  --link: #1D4ED8;
  --band: #2563EB; /* the landing page's blue, the same in light and dark */
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E2E8F0;
    --ink-soft: #94A3B8;
    --rule: #334155;
    --paper: #0F172A;
    --sheet: #0F172A;
    --tint: #1E293B;
    --link: #93C5FD;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  /* Footer at the bottom of the window on short pages, like the landing page. */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

/* ── One language at a time. legal.js sets html[data-lang] before the first paint; without
   JS nothing is hidden and every language shows, one after the other. The per-language
   "show" rules are generated into each page, so this file needs no language list. ── */
html[data-lang] [data-l] { display: none; }
html:not([data-lang]) .lang-toggle { display: none; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Band: the landing page's flat blue, only as tall as the logo and the language toggle ── */
.band {
  position: relative;
  overflow: hidden;
  background: var(--band);
  color: #FFFFFF;
  padding: 0.875rem 1rem;
}
.band-inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}
.brand svg { width: 1.75rem; height: 1.75rem; }

.lang-toggle {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
}
.lang-toggle button {
  min-width: 2.75rem;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}
.lang-toggle button[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}
.lang-toggle button:hover:not([aria-pressed='true']) { color: #FFFFFF; }

/* ── Document: contents on the left, one reading column ── */
.doc-head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}
.doc-head h1 {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(1.625rem, 3.2vw, 2.125rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}
.doc-head .meta {
  margin: 0.875rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.doc-head .meta strong { color: var(--ink); font-weight: 500; }

.doc {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

.toc {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.toc-title {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc li + li { margin-top: 0.375rem; }
.toc a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
}
.toc a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 0.2em; }


@media (min-width: 64rem) {
  .doc {
    display: grid;
    grid-template-columns: 15rem minmax(0, var(--measure));
    column-gap: 4rem;
    padding-top: 3.5rem;
  }
  .doc-head { grid-column: 1 / -1; margin-bottom: 1rem; }
  .toc {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    margin: 0;
    padding: 0;
    border: 0;
  }
}

/* ── Prose ── */
.prose { max-width: var(--measure); min-width: 0; }
.prose > :first-child { margin-top: 0; }

.prose h2 {
  margin: 3rem 0 0.875rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  scroll-margin-top: 1.5rem;
}
.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  scroll-margin-top: 1.5rem;
}
.prose p { margin: 0 0 1rem; }
.prose ul,
.prose ol { margin: 0 0 1.25rem; padding-left: 1.375rem; }
.prose li { margin: 0 0 0.5rem; padding-left: 0.25rem; }
.prose li::marker { color: var(--brand); }
.prose ol > li::marker { font-weight: 600; }
.prose strong { font-weight: 600; }
.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
.prose code {
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: var(--tint);
  font-size: 0.9em;
}

/* Tables scroll inside their own box on narrow screens; the page never scrolls sideways. */
.table-wrap {
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
.prose table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--tint);
  font-weight: 600;
}
.prose tr:last-child > td { border-bottom: 0; }
.prose td:first-child { font-weight: 500; }
.table-wrap.kv table { min-width: 0; }

/* ── Footer: the landing page's footer (index.html), on the same blue ── */
/* The layout sits on .foot__inner: the language rule sets .foot's own display. */
.foot {
  padding: 1.25rem clamp(1.5rem, 6vw, 4rem);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--band);
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.foot__copy,
.foot__links {
  font-size: clamp(0.6rem, 1.4vw, 0.68rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.foot__links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.foot__links a:hover { color: rgba(255, 255, 255, 0.85); }
.foot__links a[aria-current='page'] { color: #FFFFFF; }
.foot :focus-visible { outline-color: #FFFFFF; }

@media (max-width: 480px) {
  .foot__inner { flex-direction: column; align-items: flex-start; }
}

@media print {
  .band { background: none; color: #000; padding: 0 0 1rem; }
  .lang-toggle, .toc, .foot, .skip { display: none; }
  .brand { color: #000; }
  .doc { display: block; padding: 0; }
  .prose a { color: #000; }
}
