/*
 * reviewapp.io — the one stylesheet of the public site (BACKLOG 51, step 3).
 *
 * Colours are the app's semantic tokens (constants/Colors.ts,
 * docs/design-system.md) on the identity of design/identity/README.md:
 * Acid lime #A3E600, Ink #141414 and White. Pages use these variables only;
 * no page defines its own colour. Text on lime is always Ink (12.17:1), never
 * white (1.51:1). Every text pair below is >= 4.5:1 in both themes, which
 * scripts/website-a11y.mjs checks on the rendered pages.
 */

@font-face {
  font-family: "Readex Pro";
  src: url("/site-assets/fonts/ReadexPro-400Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Readex Pro";
  src: url("/site-assets/fonts/ReadexPro-500Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Readex Pro";
  src: url("/site-assets/fonts/ReadexPro-700Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Identity (Brand in constants/Colors.ts). */
  --lime: #A3E600;
  --ink: #141414;
  --white: #FFFFFF;

  /* Semantic tokens, light. */
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --surface: #F2F3EF;
  --text: #141414;
  --muted: #5F6259;
  --border: rgba(20, 20, 20, 0.12);
  --border-strong: #8A8D84;
  --tint: #141414;
  --on-tint: #FFFFFF;
  --primary: #A3E600;
  --on-primary: #141414;
  --primary-light: #EEF8D6;
  --accent-text: #4A6B00;
  --focus: #141414;
  /* The hero is a quiet neutral; lime stays an accent (owner, 2026-12-02: «اللون فاقع، خفف تواجده»). */
  --hero-bg: #F2F3EF;
  --hero-text: #141414;
  --hero-card-border: rgba(20, 20, 20, 0.16);
  --demo-bg: #FFFFFF;
  --warning-bg: #FEF3DC;
  --warning-text: #8A5A05;

  /* Bubbles (BubbleColors in constants/Colors.ts). */
  --pos-bg: #E3F4EC;
  --pos-text: #0B6340;
  --pos-border: #10B981;
  --neg-bg: #FDE8EC;
  --neg-text: #A11A33;
  --neg-border: #F43F5E;
  --neu-bg: #EEF2F6;
  --neu-text: #475569;
  --neu-border: #64748B;

  /* Type scale (FontSize in constants/Typography.ts), in px: no other size is used. */
  --fs-caption: 12px;
  --fs-label: 13px;
  --fs-body: 14px;
  --fs-heading: 16px;
  --fs-title: 18px;
  --fs-display: 22px;
  --fs-hero: 28px;
  --fs-jumbo: 40px;

  /* Radius scale (Radius in constants/Spacing.ts). */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-xxl: 24px;
  --radius-pill: 999px;

  /* Spacing (Space in constants/Spacing.ts), plus the section rhythm on the 8-pt grid. */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-section: 48px;
  --space-section-lg: 88px;

  /* Touch target (TouchTarget.minimum) and the prose measure. */
  --target: 44px;
  --measure: 70ch;

  --shell: 1120px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --card: #1C1C1C;
    --surface: #262626;
    --text: #F5F5F2;
    --muted: #A6A99F;
    --border: rgba(245, 245, 242, 0.14);
    --border-strong: #7C7F76;
    --tint: #A3E600;
    --on-tint: #141414;
    --primary-light: #2A3310;
    --accent-text: #A3E600;
    --focus: #A3E600;
    --hero-bg: #1C1C1C;
    --hero-text: #F5F5F2;
    --hero-card-border: rgba(245, 245, 242, 0.14);
    --demo-bg: #262626;
    --warning-bg: #3A2F17;
    --warning-text: #FBBF24;

    --pos-bg: #123A2B;
    --pos-text: #86E7B8;
    --pos-border: #34D399;
    --neg-bg: #4A1E27;
    --neg-text: #FFB3BC;
    --neg-border: #FB7185;
    --neu-bg: #253042;
    --neu-text: #C7D2E0;
    --neu-border: #94A3B8;
  }
}

/* ---------- Base ---------- */
/* Every size below is a token above: font sizes on the app's 8-step scale,
   radii on its Radius scale, spacing on the 4/8-pt grid (no vw-based clamps,
   which land between grid steps). __tests__/website-test.ts checks this. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Readex Pro", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: var(--fs-heading);
  line-height: 1.75;
  overflow-wrap: anywhere;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 var(--space-sm); line-height: 1.3; letter-spacing: -0.01em; }
[lang="en"] h1, [lang="en"] h2 { letter-spacing: -0.02em; }
p, ul, ol, dl, pre, blockquote, figure { margin-block: 0 var(--space-lg); }
/* Prose stops at about 70 characters a line, whatever the column. */
p, li, dd, dt, blockquote, figcaption, summary, pre, h2, h3, h4 { max-width: var(--measure); }
a { color: inherit; text-underline-offset: 4px; }
p a, li a, dd a { color: var(--accent-text); font-weight: 500; }
p a:hover, li a:hover, dd a:hover { text-decoration-thickness: 2px; }
/* The outline follows each control's own radius; it never reshapes the control. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(var(--shell), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  inset-block-start: var(--space-md);
  inset-inline-start: var(--space-md);
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: var(--space-sm) var(--space-lg);
  color: var(--on-primary);
  background: var(--primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); outline-color: var(--ink); }

/* ---------- Wordmark ---------- */
.wordmark { display: block; height: auto; color: var(--text); }
.wordmark .wm-slash { fill: var(--lime); }
.on-lime .wordmark, .on-lime .wordmark .wm-slash { color: var(--ink); fill: currentColor; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: var(--bg);
  border-block-end: 1px solid var(--border);
}
.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav lang";
  align-items: center;
  gap: var(--space-sm) var(--space-xl);
  min-height: 72px;
}
.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  /* Clear space around the logo = the width of the «/» (identity rule). */
  padding-block: var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.brand .wordmark { width: 112px; }
.nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: flex-start; }
.nav a, .lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target);
  min-width: var(--target);
  padding-inline: var(--space-md);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover, .lang-switch:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface); font-weight: 700; }
.lang-switch {
  grid-area: lang;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 700;
}

/* ---------- Buttons and store badges ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 120ms ease, background-color 120ms ease;
}
.button--primary { background: var(--primary); color: var(--on-primary); }
.button--primary:focus-visible { outline-color: var(--focus); }
.button--tint { background: var(--tint); color: var(--on-tint); }
.button--outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
/* On a lime surface (an «action» section): Ink with white text in both themes. */
.button--ink { background: var(--ink); color: var(--white); }
.button:hover { filter: brightness(0.92); }
.button--outline:hover { filter: none; background: var(--surface); }
.button[aria-disabled="true"] { cursor: default; filter: none; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: var(--space-md); margin-block-start: var(--space-xl); }

/* The store items are "coming soon" placeholders, not links: outlined, so the
   one filled button on a page stays its primary action. */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-md);
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 56px;
  min-width: 176px;
  max-width: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  border: 2px solid currentColor;
  background: transparent;
  color: var(--text);
  text-decoration: none;
}
.store-badge svg { flex: none; width: 24px; height: 24px; fill: currentColor; }
.store-badge small { display: block; font-size: var(--fs-caption); line-height: 16px; font-weight: 500; }
.store-badge strong { display: block; font-size: var(--fs-heading); line-height: 24px; }
.store-badge[aria-disabled="true"] { cursor: default; }
.placeholder-note { margin: var(--space-md) 0 0; font-size: var(--fs-body); color: inherit; }
.hero .store-badge { color: var(--hero-text); }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-text); }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: var(--space-section);
  padding-block: var(--space-section-lg);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--accent-text);
}
.hero .eyebrow { color: var(--hero-text); }
.eyebrow::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: var(--radius-pill); background: currentColor; }
.hero .eyebrow::before { background: var(--lime); box-shadow: 0 0 0 1px var(--ink); }
.hero h1 { margin: var(--space-md) 0 var(--space-lg); font-size: var(--fs-jumbo); line-height: 1.2; font-weight: 700; }
.hero .lead { margin: 0; max-width: 34em; font-size: var(--fs-title); }

/* Example place card in the hero. */
.demo {
  margin: 0;
  padding: var(--space-xl);
  border-radius: var(--radius-xxl);
  background: var(--demo-bg);
  color: var(--text);
  border: 1px solid var(--hero-card-border);
  box-shadow: 0 16px 48px rgba(20, 20, 20, 0.16);
}
.demo__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.demo__name { margin: 0; font-size: var(--fs-title); font-weight: 700; }
.demo__tag { font-size: var(--fs-caption); color: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: var(--space-xs) var(--space-md); line-height: 16px; white-space: nowrap; }
.demo__label { margin: var(--space-lg) 0 var(--space-sm); font-size: var(--fs-label); font-weight: 700; color: var(--muted); }
.demo figcaption { margin-block-start: var(--space-lg); font-size: var(--fs-label); color: var(--muted); }

/* ---------- Bubbles ---------- */
.bubbles { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: 0; padding: 0; list-style: none; }
.bubble {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  border: 1.5px solid;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.6;
}
.bubble svg { flex: none; width: 16px; height: 16px; fill: currentColor; }
.bubble .count { font-weight: 700; }
.bubble--pos { background: var(--pos-bg); color: var(--pos-text); border-color: var(--pos-border); }
.bubble--neg { background: var(--neg-bg); color: var(--neg-text); border-color: var(--neg-border); }
.bubble--neu { background: var(--neu-bg); color: var(--neu-text); border-color: var(--neu-border); }

/* ---------- Sections ---------- */
.section-block { padding-block: var(--space-section-lg); }
.section-block--alt { background: var(--surface); }
.section-head { max-width: 44em; margin-block-end: var(--space-xxl); }
.section-head h2 { margin: var(--space-sm) 0 var(--space-md); font-size: var(--fs-hero); }
.section-head p { margin: 0; color: var(--muted); font-size: var(--fs-title); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  padding: var(--space-xl);
  border-radius: var(--radius-xxl);
  background: var(--card);
  border: 1px solid var(--border);
}
.section-block--alt .card { background: var(--card); }
.card h3 { margin: var(--space-lg) 0 var(--space-sm); font-size: var(--fs-title); }
.card h3:first-child { margin-block-start: 0; }
.card h2 { margin: 0 0 var(--space-sm); font-size: var(--fs-display); }
.card p { margin: 0; color: var(--muted); }
.card ul { margin: var(--space-sm) 0 0; padding-inline-start: var(--space-xl); color: var(--muted); }
.card li + li { margin-block-start: var(--space-xs); }
.card ul + p { margin-block-start: var(--space-md); }
.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--on-primary);
}
.icon-tile svg { width: 24px; height: 24px; fill: currentColor; }
.steps { counter-reset: step; display: grid; gap: var(--space-md); margin: 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-lg);
  align-items: start;
  max-width: none;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--tint);
  color: var(--on-tint);
  font-weight: 700;
}
.steps strong { display: block; }
.steps span { color: var(--muted); }

.disclosure {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-xxl);
  align-items: start;
}
.options { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-sm); }
.options li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
}
.options .note { color: var(--muted); font-size: var(--fs-body); text-align: end; }

.callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-section);
  border-radius: var(--radius-xxl);
  background: var(--tint);
  color: var(--on-tint);
}
.callout h2 { margin: 0 0 var(--space-sm); font-size: var(--fs-hero); }
.callout p { margin: 0; }
.callout :focus-visible { outline-color: var(--on-tint); }

.rule-quote {
  margin: 0;
  padding: var(--space-lg) var(--space-xl);
  border-inline-start: 6px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--text);
  font-weight: 500;
}
.rule-quote p { margin: 0; }
.rule-quote p + p { margin-block-start: var(--space-sm); }

.table-wrap { overflow-x: auto; max-width: 960px; }
table.plain th[scope="row"] { width: 30%; }
table.plain { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
table.plain th, table.plain td { padding: var(--space-md) var(--space-lg); text-align: start; vertical-align: top; border-block-end: 1px solid var(--border); }
table.plain th { font-weight: 700; }
table.plain td { color: var(--muted); }
table.plain tr:last-child th, table.plain tr:last-child td { border-block-end: 0; }

/* ---------- FAQ ---------- */
/* The whole question row is the control; the sign sits in a 44 px slot and
   turns from «+» into «−» when the answer is open. */
.faq { display: grid; gap: var(--space-md); max-width: calc(var(--measure) + 2 * var(--space-xxl)); }
.faq-page { padding-block-end: 72px; }
.faq details {
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 64px;
  max-width: none;
  padding-block: var(--space-sm);
  padding-inline: var(--space-lg) var(--space-sm);
  border-radius: var(--radius-lg);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary:hover { background: var(--surface); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: var(--target);
  height: var(--target);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1;
  transition: transform 160ms ease;
}
.faq summary:hover::after { background: var(--bg); }
.faq details[open] summary::after { content: "−"; transform: rotate(180deg); }
.faq .answer { padding: 0 var(--space-lg) var(--space-lg); color: var(--muted); }
.faq .answer p { margin: 0 0 var(--space-sm); }
.faq h2 { margin: var(--space-xxl) 0 var(--space-xs); font-size: var(--fs-display); }

/* ---------- Page heads, notices (q, 404) ---------- */
.page-head { padding-block: var(--space-section) var(--space-xl); }
.page-head h1 { margin: var(--space-sm) 0 var(--space-md); font-size: var(--fs-jumbo); }
.page-head .lead { margin: 0; max-width: 40em; color: var(--muted); font-size: var(--fs-title); }
.notice { padding-block: var(--space-section); }
.notice .shell { display: grid; justify-items: center; }
.notice__card {
  width: 100%;
  max-width: 640px;
  padding: var(--space-section);
  border-radius: var(--radius-xxl);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
}
.notice__card .app-icon { width: 72px; height: 72px; margin: 0 0 var(--space-lg); display: inline-block; }
.notice__card h1 { margin: 0 0 var(--space-sm); font-size: var(--fs-hero); }
.notice__card p { margin: 0 0 var(--space-sm); color: var(--muted); }
.notice__card .actions, .notice__card .store-badges { justify-content: center; }
.notice__card .store-badge { flex: 1 1 176px; }
.notice__code { font-weight: 700; color: var(--text); direction: ltr; unicode-bidi: isolate; }

/* ---------- Legal and information pages (content unchanged) ---------- */
.legal-main { padding: var(--space-section) 0 72px; }
.legal-hero {
  background: var(--surface);
  border-radius: var(--radius-xxl);
  padding: var(--space-section);
}
.legal-hero .eyebrow { font-size: var(--fs-label); }
.legal-hero h1 { margin: var(--space-sm) 0 var(--space-md); font-size: var(--fs-jumbo); }
.legal-hero p { margin: 0; color: var(--muted); }
.legal-hero p + p { margin-block-start: var(--space-sm); }
.updated { margin-top: var(--space-lg) !important; font-size: var(--fs-label); }
.legal-grid { display: grid; gap: var(--space-lg); margin-top: var(--space-lg); }
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xxl);
  padding: var(--space-xxl);
  min-width: 0;
}
.section h2 { margin: 0 0 var(--space-md); font-size: var(--fs-display); }
.section h2 + h2, .section p + h2, .section ul + h2, .section ol + h2, .section pre + h2, .section a + h2 { margin-block-start: var(--space-xl); }
.section h3 { margin: var(--space-xl) 0 var(--space-sm); font-size: var(--fs-heading); color: var(--accent-text); }
.section p { margin: var(--space-sm) 0; color: var(--muted); }
.section ul, .section ol { margin: var(--space-md) 0 0; padding-inline-start: var(--space-xl); color: var(--muted); }
.section li + li { margin-block-start: var(--space-xs); }
.section strong { color: var(--text); }
.section table { width: 100%; border-collapse: collapse; margin-block: var(--space-md); display: block; overflow-x: auto; }
.section th, .section td { padding: var(--space-sm) var(--space-md); border: 1px solid var(--border); text-align: start; vertical-align: top; color: var(--muted); }
.section th { color: var(--text); background: var(--surface); }
/* Licence texts: the site face, not a system monospace. */
.section pre { margin: var(--space-md) 0 var(--space-xl); white-space: pre-wrap; overflow-x: auto; padding: var(--space-lg); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: var(--fs-label); line-height: 1.6; }
.section .button { margin-top: var(--space-md); }
/* English blocks inside an Arabic section (package names, licence texts) form
   one column on the left, each capped at the measure, without auto margins. */
[dir="rtl"] .section:has(> [dir="ltr"]) { display: grid; align-content: start; }
[dir="rtl"] .section > [dir="ltr"] { justify-self: end; }
/* «action» sections: a pale lime tint with a lime edge, not a full lime block. */
.section.action { background: var(--primary-light); border-color: var(--primary-light); border-inline-start: 6px solid var(--primary); color: var(--text); }
.section.action h2, .section.action p, .section.action strong, .section.action a { color: var(--text); }
.section.action a { text-decoration: underline; }
.section.action .button { text-decoration: none; }
.section.action .button--ink { color: var(--white); }
.section.action :focus-visible { outline-color: var(--focus); }
.legal-main > .section-nav, .legal-hero + .legal-grid { min-width: 0; }

/* ---------- Licences (/licenses/): one collapsed group per licence ----------
   Each licence opens to its packages (name and version, one per line), its
   text once and the copyright lines; the page stays a short list until opened
   (design audit D1206). The rows read like the FAQ questions. */
.licence-groups { display: grid; gap: var(--space-md); margin-block-start: var(--space-lg); }
.licence { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.licence summary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 64px;
  max-width: none;
  padding-block: var(--space-sm);
  padding-inline: var(--space-lg) var(--space-sm);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.licence summary:hover { background: var(--surface); }
.licence summary::-webkit-details-marker { display: none; }
.licence summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: var(--target);
  height: var(--target);
  margin-inline-start: auto;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1;
}
.licence summary:hover::after { background: var(--bg); }
.licence details[open] > summary::after, .licence[open] > summary::after { content: "−"; }
.licence__name { min-width: 0; overflow-wrap: normal; }
.licence__count { flex: none; color: var(--muted); font-weight: 500; font-size: var(--fs-label); white-space: nowrap; }
.licence__body { display: grid; gap: var(--space-sm); min-width: 0; padding: 0 var(--space-lg) var(--space-lg); }
.licence__more { border-block-start: 1px solid var(--border); }
.licence__more summary { min-height: var(--target); padding-inline: 0; color: var(--accent-text); }
.licence__more summary:hover { background: transparent; text-decoration: underline; }
.licence__more pre { margin-block-start: 0; }
[dir="rtl"] .licence__more pre[dir="ltr"] { margin-inline-start: auto; }
.section .package-list, .section .copyright-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: var(--fs-label);
  line-height: 1.6;
}
.section .package-list { columns: 3 18em; column-gap: var(--space-xl); }
.section .package-list li, .section .copyright-list li { margin: 0; break-inside: avoid; overflow-wrap: break-word; }
.section .package-list span { color: var(--muted); white-space: nowrap; }
.section .copyright-list { padding-block-end: var(--space-md); color: var(--muted); }

/* Translation and draft notices: warning tokens, text >= 5.38:1. */
.translation-note, .draft-banner {
  margin: var(--space-lg) 0 0 !important;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  border-inline-start: 6px solid var(--warning-text);
  background: var(--warning-bg);
  color: var(--warning-text) !important;
}
.translation-note a, .draft-banner a, .translation-note strong, .draft-banner strong { color: var(--warning-text); }

/* ---------- Footer ---------- */
.site-footer {
  margin-block-start: auto;
  padding-block: var(--space-section) var(--space-xxl);
  background: var(--surface);
  color: var(--muted);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
  gap: var(--space-xxl);
}
.footer-brand .wordmark { width: 112px; color: var(--text); }
.footer-brand p { margin: var(--space-md) 0 0; max-width: 22em; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xl); }
.footer-links h2 { margin: 0 0 var(--space-xs); font-size: var(--fs-body); color: var(--text); }
.footer-links ul { margin: 0; padding: 0; list-style: none; }
.footer-links a, .footer-meta a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  min-width: var(--target);
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover, .footer-meta a:hover { color: var(--text); text-decoration: underline; }
.footer-links a[aria-current="page"] { color: var(--text); font-weight: 700; }
.footer-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-xl);
  max-width: none;
  margin: 0;
  padding-block-start: var(--space-lg);
  border-block-start: 1px solid var(--border);
  font-size: var(--fs-body);
}
.footer-meta a { color: var(--text); font-weight: 500; padding-inline: var(--space-md); margin-inline: calc(-1 * var(--space-md)); border-radius: var(--radius-pill); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner, .disclosure { grid-template-columns: 1fr; gap: var(--space-xxl); }
  .cards { grid-template-columns: 1fr 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-header { position: static; }
  .site-header__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand lang" "nav nav";
    padding-block: var(--space-sm);
  }
  .nav { margin-inline: calc(-1 * var(--space-md)); }
  .hero__inner { padding-block: var(--space-section); }
  .hero h1 { font-size: var(--fs-hero); }
  .section-block { padding-block: var(--space-section); }
  .section-head h2, .callout h2 { font-size: var(--fs-display); }
  .page-head h1, .legal-hero h1 { font-size: var(--fs-hero); }
  .callout, .notice__card, .legal-hero { padding: var(--space-xl); }
  .section { padding: var(--space-xl); }
  .legal-main { padding-block-start: var(--space-xl); }
  .cards, .cards--2 { grid-template-columns: 1fr; }
  .callout { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .options li { flex-direction: column; gap: 0; }
  .options .note { text-align: start; }
  .store-badge { flex: 1 1 160px; }
}
@media (max-width: 400px) {
  .footer-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #FFFFFF; color: #141414; }
}
