/* قاعدة المعرفة المعمارية — v2 production candidate. Framework-free, RTL-first. */
:root {
  --paper: #f6f3ed; --surface: #fffdf9; --raised: #ffffff; --ink: #1f1c18; --ink-2: #4a443c; --muted: #6c655b; --faint: #9a9287;
  --line: #e3ddd2; --line-2: #d4ccbe; --stone: #e9e1d2; --stone-2: #d8cbb3;
  --accent: #ae95bf; --accent-ink: #4f3a63; --accent-soft: #efe8f4; --accent-line: #cdbcd9;
  --timber: #8a6542; --timber-soft: #f3ebe1; --timber-line: #dcc8b0;
  --req: #7a2e3b; --req-soft: #f6e7e9; --req-line: #e2c0c6;
  --ok: #3f6b4f; --warn: #8a5a12; --warn-soft: #fbf1df;
  --sea: #eef0f0; --boundary: #fffdf9; --focus: #2f2140;
  --radius: 10px; --shadow: 0 1px 2px rgba(40, 30, 20, .05), 0 4px 16px rgba(40, 30, 20, .05);
  --font: "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic", "IBM Plex Sans Arabic", Tahoma, "DejaVu Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #171513; --surface: #1e1b18; --raised: #24211d; --ink: #ece7df; --ink-2: #cfc8bd; --muted: #a59d92; --faint: #7c756c;
  --line: #34302b; --line-2: #443f38; --stone: #2b2722; --stone-2: #3a342c;
  --accent: #b9a2c9; --accent-ink: #dccdea; --accent-soft: #2c2433; --accent-line: #4d3f5a;
  --timber: #cfa47a; --timber-soft: #2c241c; --timber-line: #4d3d2c;
  --req: #e7a1ad; --req-soft: #33222a; --req-line: #5a3540; --ok: #8fc3a1; --warn: #e2b46a; --warn-soft: #2f2719;
  --sea: #1b1a19; --boundary: #171513; --focus: #f0e6f7; color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #171513; --surface: #1e1b18; --raised: #24211d; --ink: #ece7df; --ink-2: #cfc8bd; --muted: #a59d92; --faint: #7c756c;
  --line: #34302b; --line-2: #443f38; --stone: #2b2722; --stone-2: #3a342c;
  --accent: #b9a2c9; --accent-ink: #dccdea; --accent-soft: #2c2433; --accent-line: #4d3f5a;
  --timber: #cfa47a; --timber-soft: #2c241c; --timber-line: #4d3d2c;
  --req: #e7a1ad; --req-soft: #33222a; --req-line: #5a3540; --ok: #8fc3a1; --warn: #e2b46a; --warn-soft: #2f2719;
  --sea: #1b1a19; --boundary: #171513; --focus: #f0e6f7; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.75; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.en { direction: ltr; text-align: left; unicode-bidi: isolate; font-family: "Segoe UI", system-ui, sans-serif; }

/* ---------- shell */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.top__in { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand__mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent) 0 50%, var(--stone-2) 50% 100%); flex: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs a { text-decoration: none; border-bottom: 1px solid var(--line-2); }
.crumbs a:hover { color: var(--ink); }
.crumbs__sep { color: var(--faint); }
.top__tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg a, .seg button { border: 0; background: none; padding: 4px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.iconbtn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 18px 24px 40px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- type */
.eyebrow { font-size: 13px; color: var(--muted); margin: 0 0 6px; letter-spacing: .01em; }
h1.title { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.3; margin: 0 0 8px; font-weight: 700; letter-spacing: -.01em; }
.lede { font-size: 17px; color: var(--ink-2); max-width: 64ch; margin: 0 0 18px; }
h2.h2 { font-size: 20px; margin: 40px 0 6px; font-weight: 700; }
.h2__sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; max-width: 70ch; }
h3.h3 { font-size: 16px; margin: 0 0 6px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- chips & badges */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.5; padding: 1px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.chip--built { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.chip--partial { border-color: var(--timber-line); background: var(--timber-soft); color: var(--timber); }
.chip--planned, .chip--listed { color: var(--muted); border-style: dashed; }
.kind { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 5px; white-space: nowrap; border: 1px solid; }
.kind::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: .9; }
.kind--description { color: var(--ink-2); border-color: var(--line-2); background: var(--stone); }
.kind--guideline { color: var(--timber); border-color: var(--timber-line); background: var(--timber-soft); }
.kind--encouraged { color: var(--timber); border-color: var(--timber-line); background: transparent; border-style: dashed; }
.kind--mandatory { color: var(--req); border-color: var(--req-line); background: var(--req-soft); }
.kind--illustration { color: var(--muted); border-color: var(--line-2); background: transparent; }
.kind--illustration::before { border-radius: 50%; background: transparent; border: 1.5px solid currentColor; width: 6px; height: 6px; }
.kind--interpretation, .kind--summary { color: var(--accent-ink); border-color: var(--accent-line); background: transparent; border-style: dotted; }
.style { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; border: 1.5px solid var(--req); color: var(--req); line-height: 1.5; direction: ltr; }
.bt { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 4px; background: var(--stone); color: var(--ink-2); }
.bt--villa { background: #e8eef3; color: #2c4a63; } .bt--lowrise { background: #e7efe9; color: #2f5a3f; }
:root[data-theme="dark"] .bt--villa { background: #1f2a33; color: #a9c3d8; } :root[data-theme="dark"] .bt--lowrise { background: #1f2c24; color: #a6cfb2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bt--villa { background: #1f2a33; color: #a9c3d8; } :root:not([data-theme="light"]) .bt--lowrise { background: #1f2c24; color: #a6cfb2; } }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--faint); white-space: nowrap; }
.src:hover { color: var(--ink); border-bottom-style: solid; }
.src__doc { font-weight: 650; direction: ltr; unicode-bidi: isolate; }

/* ---------- cards / panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.callout { border: 1px solid var(--warn); border-inline-start-width: 4px; background: var(--warn-soft); color: var(--ink); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.callout strong { color: var(--warn); }
.note { font-size: 12.5px; color: var(--muted); border-inline-start: 2px solid var(--line-2); padding-inline-start: 12px; line-height: 1.7; }

/* ---------- L1 national map */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.home__map { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.home__side { position: sticky; top: 76px; display: grid; gap: 14px; }
.cta { display: block; text-decoration: none; background: var(--raised); border: 1px solid var(--accent-line); border-inline-start: 5px solid var(--accent); border-radius: 12px; padding: 14px 16px; }
.cta:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cta__k { font-size: 12px; color: var(--accent-ink); font-weight: 650; }
.cta__t { display: block; font-size: 19px; font-weight: 700; margin: 2px 0; }
.cta__d { font-size: 13px; color: var(--muted); }
.cta__go { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 650; color: var(--accent-ink); }
.inactive-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: 13px; color: var(--muted); }
.inactive-list li { display: flex; gap: 7px; align-items: center; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; opacity: .55; }

.ksa-map { position: relative; }
.ksa-map__stage { position: relative; }
.ksa-map__svg { display: block; width: 100%; height: auto; max-height: 76vh; }
.ksa-shape { stroke: var(--boundary); stroke-width: .7px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ksa-shape--inactive { transition: fill-opacity .15s; cursor: not-allowed; }
.ksa-shape--inactive:hover { fill-opacity: .8; }
.ksa-shape--unnamed { pointer-events: none; }
.ksa-shape--active { cursor: pointer; stroke: var(--accent-ink); stroke-width: 1.2px; transition: fill .15s, stroke-width .15s; outline: none; }
.ksa-shape--active:hover, .is-hover-hejazi-coastal .ksa-shape--active { fill: #9b7fb0; stroke-width: 2px; }
.ksa-shape--active:focus-visible { stroke: var(--focus); stroke-width: 2.6px; }
.ksa-halo { fill: none; stroke: transparent; stroke-width: 10px; vector-effect: non-scaling-stroke; cursor: pointer; pointer-events: stroke; }
.ksa-leader { stroke: var(--accent-ink); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.ksa-leader-dot { fill: var(--accent-ink); }
.ksa-label { position: absolute; transform: translate(-100%, -50%); text-align: right; background: var(--raised); border: 1px solid var(--accent-line);
  border-inline-start: 4px solid var(--accent); border-radius: 8px; padding: 6px 12px; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
.ksa-label:hover, .ksa-label:focus-visible { border-color: var(--accent); }
.ksa-label__title { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.ksa-label__sub { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.ksa-label[hidden] { display: none; }
.is-compact .ksa-leader, .is-compact .ksa-leader-dot { display: none; }
.ksa-tip { position: absolute; transform: translate(-50%, -100%); pointer-events: none; background: var(--ink); color: var(--paper); padding: 5px 10px; border-radius: 6px;
  font-size: 13px; line-height: 1.45; white-space: nowrap; direction: rtl; text-align: right; z-index: 3; }
.ksa-tip strong { display: block; } .ksa-tip span { display: block; opacity: .8; font-size: 12px; }

/* ---------- L2 environment */
.env-hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; align-items: center; margin-bottom: 8px; }
.env-hero__map svg { width: 100%; height: auto; display: block; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.qa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 6px; }
.qa__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.qa__q { font-size: 12px; color: var(--muted); font-weight: 650; }
.qa__a { font-size: 14px; margin-top: 3px; }
.start { display: flex; flex-wrap: wrap; gap: 0; align-items: stretch; margin: 6px 0 0; counter-reset: s; }
.start__step { flex: 1 1 200px; position: relative; text-decoration: none; padding: 14px 16px 14px 28px; background: var(--surface); border: 1px solid var(--line);
  margin-inline-end: -1px; }
.start__step:first-child { border-radius: 0 var(--radius) var(--radius) 0; }
.start__step:last-child { border-radius: var(--radius) 0 0 var(--radius); }
.start__step:hover { background: var(--accent-soft); z-index: 1; border-color: var(--accent-line); }
.start__n { font-size: 12px; color: var(--accent-ink); font-weight: 700; }
.start__t { display: block; font-weight: 700; }
.start__d { display: block; font-size: 13px; color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.board__col h3 { font-size: 13px; color: var(--muted); font-weight: 650; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.board__col h3 b { color: var(--ink); font-size: 15px; }
.tile { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; position: relative; }
.tile:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.tile__t { font-weight: 700; display: block; margin-bottom: 2px; }
.tile__d { font-size: 13px; color: var(--muted); display: block; }
.tile__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tile--feature { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.tile__built { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent-ink); font-weight: 650; margin-top: 8px; }
.threads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.thread { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.thread__ends { display: flex; gap: 6px; align-items: center; font-weight: 650; font-size: 14px; grid-column: 1 / -1; flex-wrap: wrap; }
.thread__arrow { color: var(--faint); }
.thread__why { font-size: 13px; color: var(--ink-2); grid-column: 1 / -1; }

/* ---------- L3 topic pages */
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.sec__n { font-size: 12px; color: var(--muted); font-weight: 650; direction: ltr; text-align: right; }
.sec__t { font-weight: 700; }
.sec--built { border-color: var(--accent-line); }
.sec__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; font-weight: 650; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--raised); cursor: pointer; }
.btn:hover { border-color: var(--ink-2); }
.btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--sm { font-size: 13px; padding: 4px 10px; }

/* focused map */
.fmap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.fmap__stage { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.fmap svg { display: block; width: 100%; height: auto; }
.fm-link { stroke: var(--line-2); stroke-width: 1.4; fill: none; transition: stroke .2s, opacity .2s; }
.fm-link--leaf { stroke-dasharray: 3 3; }
.fm-node { cursor: pointer; }
.fm-node rect { fill: var(--raised); stroke: var(--line-2); stroke-width: 1.2; transition: fill .15s, stroke .15s, opacity .2s; }
.fm-node text { fill: var(--ink); font-family: var(--font); font-size: 15px; font-weight: 650; pointer-events: none; }
.fm-node .fm-count { fill: var(--muted); font-size: 12px; font-weight: 500; }
.fm-node:hover rect, .fm-node:focus-visible rect { stroke: var(--accent); }
.fm-node:focus { outline: none; }
.fm-node:focus-visible rect { stroke-width: 2.4; stroke: var(--focus); }
.fm-center rect { fill: var(--ink); stroke: var(--ink); }
.fm-center text { fill: var(--paper); font-size: 20px; font-weight: 700; }
.fm-node.is-on rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.fm-leaf rect { fill: var(--surface); stroke: var(--line-2); }
.fm-leaf text { font-size: 13px; font-weight: 500; }
.fm-leaf.is-on rect { fill: var(--accent-soft); stroke: var(--accent-ink); }
.is-focused .fm-branch:not(.is-on) rect, .is-focused .fm-branch:not(.is-on) text { opacity: .38; }
.is-focused .fm-link--branch:not(.is-on) { opacity: .3; }
.fm-link.is-on { stroke: var(--accent); stroke-width: 1.8; }
.fm-leafs { opacity: 0; transition: opacity .25s; }
.fm-leafs.is-on { opacity: 1; }
.fmap__panel { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.plist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.plist li { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--raised); }
.plist li.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plist__t { font-weight: 650; font-size: 14px; display: block; }
.plist__d { font-size: 13px; color: var(--ink-2); display: block; margin: 2px 0 4px; }
.plist__r { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- L4 element card */
.card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.term { font-size: 15px; color: var(--muted); }
.term b { color: var(--ink); font-weight: 650; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; margin-top: 22px; align-items: start; }
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram__legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.diagram__legend button { border: 1px solid var(--line-2); background: var(--raised); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; }
.diagram__legend button[aria-pressed="true"] { border-color: var(--accent-ink); background: var(--accent-soft); color: var(--accent-ink); }
.diagram__cap { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dg-part { transition: opacity .2s; }
.dg-on .dg-part { opacity: .25; }
.dg-on .dg-part.is-on { opacity: 1; }
.dg-lab { font-family: var(--font); font-size: 12px; fill: var(--ink-2); }
.facts { display: grid; gap: 10px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; }
.fact__k { font-size: 12px; color: var(--muted); font-weight: 650; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.fact__v { font-size: 15px; margin: 3px 0; }
.summary { background: var(--raised); border: 1px solid var(--accent-line); border-radius: 12px; padding: 14px 16px; }
.summary p { margin: 6px 0; font-size: 16.5px; line-height: 1.85; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: sticky; top: 53px; background: var(--paper); z-index: 5; }
.toc a { font-size: 13px; text-decoration: none; color: var(--muted); padding: 2px 10px; border-radius: 999px; }
.toc a:hover { background: var(--stone); color: var(--ink); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { font-size: 12.5px; color: var(--muted); font-weight: 650; background: var(--stone); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.en { font-size: 13px; color: var(--ink-2); }
.attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.attr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.attr blockquote { margin: 6px 0; font-size: 14.5px; color: var(--ink-2); }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.col__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.col__h b { font-size: 16px; }
.col__docs { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.stmt { border-top: 1px solid var(--line); padding: 10px 0; }
.stmt:first-of-type { border-top: 0; }
.stmt__k { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.stmt__q { margin: 0; font-size: 14.5px; line-height: 1.8; }
.stmt__q::before { content: "«"; color: var(--faint); } .stmt__q::after { content: "»"; color: var(--faint); }
.stmt__en { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.stmt__note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stmt details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.matrix td:first-child { font-weight: 650; width: 24%; }
.cell { display: grid; gap: 4px; }
.cell__v { font-size: 14px; }
.cell--none .cell__v { color: var(--faint); }
.rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rel__i { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.rel__t { font-weight: 650; }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fig { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; }
.fig__t { font-weight: 650; font-size: 14px; }
.diffs { display: grid; gap: 8px; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px; }
.diff__h { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-weight: 650; }
.diff__n { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.navback { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- L5 reference */
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 16px 0; font-size: 13px; }
.filters label { display: inline-flex; gap: 6px; align-items: center; }
.filters select { font: inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); }
.reftbl td { font-size: 13.5px; }
.reftbl .q { font-size: 14.5px; line-height: 1.8; min-width: 280px; }
.reftbl .id { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--muted); direction: ltr; white-space: nowrap; }
.count { font-size: 13px; color: var(--muted); }

@media (max-width: 1000px) {
  .home, .fmap { grid-template-columns: 1fr; }
  .home__side, .fmap__panel { position: static; max-height: none; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .cols3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 18px 16px 48px; } .top__in { padding: 8px 16px; flex-wrap: wrap; }
  .board, .qa, .threads { grid-template-columns: 1fr; }
  .env-hero { grid-template-columns: 1fr; } .env-hero__map { width: 150px; justify-self: start; }
  .ksa-label__sub { display: none; }
  .diff { grid-template-columns: 1fr; }
  .tbl { display: block; overflow-x: auto; }
  .toc { top: 0; position: static; }
  .start__step { flex-basis: 100%; border-radius: var(--radius) !important; margin: 0 0 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .top, .toc, .filters, .navback { display: none; } body { background: #fff; } }

.tblwrap { overflow-x: auto; border-radius: var(--radius); }
