/* Mirrorborn Online - legal pages. One small shared stylesheet: no external fonts, no external scripts.
   Light and dark follow the phone (prefers-color-scheme). English and Arabic live on the same page;
   site.js shows one of them (data-lang on <html>), and without JavaScript both are shown, one after the other. */

:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #1b2233;
  --muted: #5a6479;
  --line: #d9deea;
  --accent: #1f6f8b;
  --accent-ink: #ffffff;
  --note-bg: #eaf4f8;
  --note-line: #9cc7d6;
  --warn-bg: #fff5e0;
  --warn-line: #e3b95b;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --panel: #171e2e;
    --ink: #e8ecf6;
    --muted: #a3adc4;
    --line: #2a3450;
    --accent: #6cc4de;
    --accent-ink: #0f1420;
    --note-bg: #14303b;
    --note-line: #2f6a7f;
    --warn-bg: #3a2f14;
    --warn-line: #8a6c1f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; letter-spacing: .02em; color: var(--ink); text-decoration: none; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 15px; }
.tabs a { color: var(--accent); text-decoration: none; }
.tabs a:hover, .tabs a:focus { text-decoration: underline; }

.langs { display: flex; gap: 6px; }
.langs button {
  font: inherit;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.langs button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

main { max-width: 780px; margin: 0 auto; padding: 8px 16px 48px; }

.lang { padding-top: 12px; }
.lang + .lang { margin-top: 28px; border-top: 2px dashed var(--line); }

/* JavaScript on: one language. JavaScript off (no data-lang): both. */
html[data-lang="en"] .lang-ar { display: none; }
html[data-lang="ar"] .lang-en { display: none; }

.lang-ar {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Arabic Typesetting", system-ui, sans-serif;
  line-height: 1.9;
}

h1 { font-size: 1.75rem; line-height: 1.25; margin: 12px 0 4px; }
h2 { font-size: 1.25rem; margin: 2rem 0 .4rem; padding-top: .4rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .2rem; }
p, ul, ol { margin: .5rem 0; }
li { margin: .25rem 0; }
ul, ol { padding-inline-start: 1.4rem; }

.meta { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }

.box {
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-inline-start-width: 5px;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 14px 0;
}
.box.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.box p:first-child, .box ul:first-child { margin-top: .2rem; }
.box p:last-child, .box ul:last-child { margin-bottom: .2rem; }

.table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .94rem; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: start; }
th { background: var(--note-bg); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

a { color: var(--accent); }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 18px 0; }
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
}
.card strong { display: block; color: var(--accent); margin-bottom: 4px; }
.card span { color: var(--muted); font-size: .92rem; }
.card:hover, .card:focus { border-color: var(--accent); }

.foot { max-width: 780px; margin: 0 auto; padding: 0 16px 36px; color: var(--muted); font-size: .88rem; }
.foot a { color: var(--muted); }

code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: .92em; }

/* Phones: a table whose cells got labels from site.js turns into stacked cards (no sideways scrolling). */
@media (max-width: 640px) {
  .table-wrap:has(table.stack) { border: 0; background: transparent; overflow: visible; }
  table.stack { min-width: 0; display: block; }
  table.stack thead { display: none; }
  table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack tr { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 4px 0; }
  table.stack td { border-bottom: 0; padding: 6px 12px; }
  table.stack td + td { border-top: 1px dashed var(--line); }
  table.stack td::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .top { padding: 10px 12px; }
  main { padding-inline: 12px; }
}

@media print {
  .top, .foot { display: none; }
  body { background: #fff; color: #000; }
  .lang-en, .lang-ar { display: block !important; }
}
