/*
  Shared look of DegreEZ's legal and trust pages (privacy, terms, security,
  accessibility, delete-account, takedown; docs/legal_pages.md). Same palette as
  coverage.html and support.html, light and dark. Each page holds its text in
  three languages, one <article class="l10n" lang dir> each; legal.js sets
  html[data-lang] and the rules at the bottom hide the other two. Without
  JavaScript all three show, each in its own direction.
*/
:root {
  color-scheme: light dark;
  --bg: #f4f8f5; --card: #ffffff; --card-glass: rgba(255, 255, 255, 0.72);
  --border: #dfe8e2; --row: #eef4f0;
  --text: #1a2238; --muted: #4f5966;
  --primary: #1b7a4e; --secondary: #14532d; --link: #1a6655;
  --focus: #0b57d0; --warn-bg: #fff6e0; --warn-border: #e8c46a;
  --field: #6f8378; --error: #b3261e; --ok-bg: #e6f4ec; --ok-border: #8fcaa8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512; --card: #18211c; --card-glass: rgba(24, 33, 28, 0.78);
    --border: #2a3830; --row: #1c2721;
    --text: #e9f1ec; --muted: #a9b6ae;
    --primary: #3fb27f; --secondary: #1f7a52; --link: #7fdcb0;
    --focus: #8ab4f8; --warn-bg: #2a2412; --warn-border: #7a6224;
    --field: #7f978a; --error: #f2b8b5; --ok-bg: #16301f; --ok-border: #2f6b47;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans Hebrew", "Noto Sans Arabic", "Geeza Pro", sans-serif;
  font-size: 16px; line-height: 1.6; overflow-wrap: break-word;
}
:lang(ar) { line-height: 1.75; }
/* Arabic glyphs read small next to Latin at the same size. */
article:lang(ar) p, article:lang(ar) li, article:lang(ar) dd, footer.site:lang(ar) li { font-size: 17px; }

/* Skip link: first thing a keyboard reaches. */
.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 10;
  background: var(--card); color: var(--text); border: 2px solid var(--focus);
  border-radius: 10px; padding: 8px 14px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px;
}

/* Top bar: brand and language switcher, frosted like the app's glass kit. */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--card-glass); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.top-inner {
  max-width: 820px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.01em; }
.grad, .brand {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .grad, .brand { background: linear-gradient(135deg, #6fd3a5, var(--primary)); -webkit-background-clip: text; background-clip: text; }
}
.langs ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.langs a {
  display: inline-block; min-height: 44px; min-width: 44px; padding: 10px 12px;
  border-radius: 999px; text-decoration: none; color: var(--text); font-size: 15px; line-height: 24px; text-align: center;
}
.langs a:hover { background: var(--row); }
.langs a[aria-current="true"] {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

main { max-width: 820px; margin: 0 auto; padding: 28px 16px 24px; }
main:focus { outline: none; }
article + article { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
h1 { font-size: 32px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 1.3; margin: 40px 0 10px; scroll-margin-top: 80px; }
h3 { font-size: 18px; line-height: 1.35; margin: 24px 0 6px; scroll-margin-top: 80px; }
p, li { font-size: 16px; }
ul, ol { padding-inline-start: 22px; }
li { margin: 6px 0; }
.updated { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; margin: 18px 0;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.summary { border-inline-start: 5px solid var(--primary); }
.summary h2 { margin-top: 0; font-size: 20px; }
.who { background: var(--row); }
.who h2 { margin-top: 0; font-size: 19px; }
.note { background: var(--warn-bg); border-color: var(--warn-border); }
.toc h2 { margin-top: 0; font-size: 17px; }
.toc ol { columns: 2 240px; column-gap: 28px; margin: 0; }
.toc li { margin: 4px 0; break-inside: avoid; font-size: 15px; }
.placeholder {
  background: var(--warn-bg); border: 1px dashed var(--warn-border); border-radius: 6px; padding: 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; white-space: nowrap;
}
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step; position: relative; padding-inline-start: 44px; margin: 14px 0; min-height: 32px;
}
.steps > li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px; line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.two .card { margin: 9px 0; }
dl.facts { margin: 0; }
dl.facts dt { font-weight: 650; margin-top: 12px; }
dl.facts dd { margin: 2px 0 0; color: var(--text); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; overflow-wrap: anywhere; }
bdi { unicode-bidi: isolate; }

footer.site { max-width: 820px; margin: 0 auto; padding: 20px 16px 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
footer.site ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 10px; padding: 0; list-style: none; }
footer.site li { margin: 0; font-size: 15px; }
footer.site a { display: inline-block; padding: 8px 6px; min-height: 40px; }
footer.site p { margin: 6px 0; font-size: 14px; }

@media (max-width: 640px) {
  h1 { font-size: 27px; }
  h2 { font-size: 20px; margin-top: 32px; }
  main { padding-top: 20px; }
  .two { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .brand { font-size: 18px; }
  .langs a { padding: 10px 9px; font-size: 14px; }
}

/* The takedown form (takedown.html, legal/takedown.js). */
.takedown .field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.takedown label, .takedown legend { display: block; font-weight: 650; margin: 0 0 4px; padding: 0; }
.takedown .hint { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.takedown input[type="text"], .takedown select, .takedown textarea {
  display: block; width: 100%; min-height: 48px; margin: 0; padding: 11px 14px;
  font: inherit; color: var(--text); background: var(--card);
  border: 1.5px solid var(--field); border-radius: 12px;
}
.takedown textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.takedown select { appearance: auto; }
.takedown input:focus-visible, .takedown select:focus-visible, .takedown textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus);
}
.takedown [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.takedown label.check {
  display: flex; gap: 12px; align-items: flex-start; font-weight: 400;
  margin: 10px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--row);
}
.takedown label.check input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--primary); }
.takedown label.check input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }
.takedown .send { margin: 22px 0 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 650; line-height: 1.3; text-align: center; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); cursor: pointer;
}
.button:hover { filter: brightness(1.06); }
.button[disabled] { opacity: 0.6; cursor: default; filter: none; }
.button.ghost { color: var(--link); background: var(--card); border: 1.5px solid var(--primary); }
.linkish {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px;
}
.status { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--row); }
.status.ok { background: var(--ok-bg); border-color: var(--ok-border); }
.status.err { background: var(--warn-bg); border-color: var(--warn-border); }
.status bdi, .signed-in bdi { font-weight: 650; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .button { width: 100%; }
}
@media print {
  .takedown, .nojs { display: none; }
}

/* One language at a time once legal.js has chosen it. */
html[data-lang="en"] .l10n:not([lang="en"]),
html[data-lang="he"] .l10n:not([lang="he"]),
html[data-lang="ar"] .l10n:not([lang="ar"]) { display: none; }
html[data-lang] article + article { margin-top: 0; padding-top: 0; border-top: 0; }

@media print {
  .top, .skip, footer.site { display: none; }
  body { background: #fff; color: #000; }
  .card { border-color: #999; }
  a { color: #000; }
}

/* Technical names kept whole and left-to-right inside Hebrew and Arabic. */
.nb { white-space: nowrap; unicode-bidi: isolate; }
