/* ISNĀD v4 — Nur design system. Day: mineral. Night: ink-well.
   One accent: lapis. Verdigris is RESERVED for NLI-verified grounds.
   Law: structure rides hairlines (--line-strong ≥3:1), never surface
   luminance; surfaces are lighter than the canvas in BOTH themes.
   Spec: MASTERPLAN/nur20/OPUS-CONSULT-6-THEME-SPEC.md (row 396). */

/* ---- type: IBM Plex Sans + IBM Plex Sans Arabic (OFL; sources manifest) ---- */
/* IBM Plex Sans 300 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibmplexsans-latin-ext-var.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Sans 300 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibmplexsans-latin-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans 400 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibmplexsans-latin-ext-var.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Sans 400 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibmplexsans-latin-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans 500 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibmplexsans-latin-ext-var.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Sans 500 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibmplexsans-latin-var.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans Arabic 300 arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-arabic-300.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* IBM Plex Sans Arabic 300 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-latin-ext-300.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Sans Arabic 300 latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-latin-300.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans Arabic 400 arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-arabic-400.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* IBM Plex Sans Arabic 400 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-latin-ext-400.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Sans Arabic 400 latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans Arabic 500 arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-arabic-500.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* IBM Plex Sans Arabic 500 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-latin-ext-500.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Sans Arabic 500 latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibmplexsansarabic-latin-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  /* surfaces — canvas darker than surface-1 (deliberate inversion) */
  --canvas:#e7e9e3; --surface-1:#f4f5f1; --surface-2:#dcdfd7;
  --line:#c6cbc3;             /* decorative dividers only */
  --line-strong:#78837c;      /* 3.22:1 vs canvas — every card, input, button border */
  /* ink ramp */
  --ink:#1b2028;              /* 13.4:1 */
  --ink-2:#46505c; --ink-3:var(--ink-2);   /* 6.70:1 */
  --muted:#5b6775;            /* 4.71:1 */
  /* accent: ONE primary + ONE semantic secondary */
  --lapis:#2d4a8a;            /* 6.98:1 — actions, links, active nav */
  --verdigris:#2f6d5a;        /* 4.97:1 — RESERVED: NLI-verified grounds only */
  --lapis-soft:color-mix(in srgb, var(--lapis) 9%, var(--surface-1));
  --verdigris-soft:color-mix(in srgb, var(--verdigris) 10%, var(--surface-1));
  /* status */
  --ok:var(--verdigris); --ok-soft:var(--verdigris-soft);
  --bad:#8e2f3a;  --bad-soft:color-mix(in srgb,#8e2f3a 10%,var(--surface-1));
  --warn:#7a5a12; --warn-soft:color-mix(in srgb,#7a5a12 12%,var(--surface-1));
  --info:var(--lapis); --info-soft:var(--lapis-soft);
  /* focus + elevation */
  --focus-ring:0 0 0 2px var(--canvas), 0 0 0 4px var(--lapis);
  --e1:0 1px 2px rgba(27,32,40,.07);
  --e2:0 6px 20px rgba(27,32,40,.11);
  /* type scale (letterspacing: -0.015em display/h1 only, never positive) */
  --t-display:300 34px/1.15 var(--body-font);
  --t-h1:500 26px/1.25 var(--body-font);
  --t-h2:500 19px/1.35 var(--body-font);
  --t-body:400 17px/1.62 var(--body-font);
  --t-sm:450 14.5px/1.5 var(--body-font);
  --t-meta:500 12.5px/1.45 var(--body-font);
  --t-mono:400 12px/1.45 var(--mono-font);
  --t-quran:400 32px/2.05 var(--quran-font);
  --t-quran-lg:400 44px/1.95 var(--quran-font);
  --ls-display:-0.015em;
  /* space / radius / motion */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px; --s7:48px; --s8:64px;
  --r-sm:8px; --r-md:14px; --r-lg:18px; --r-pill:999px;
  --dur-1:120ms; --dur-2:180ms; --dur-3:260ms;
  --ease:cubic-bezier(.2,.6,.2,1); --ease-out:cubic-bezier(.3,0,.8,.15);
  --gutter:20px; --measure:38rem;
  /* misc */
  --divider:var(--line); --active-bg:var(--lapis-soft);
  --band-top:0.18; --band-bottom:0.72;  /* comfort band (reader follow-scroll) */
  --chain-color:var(--line-strong);
  --quran-font:'Scheherazade New','Amiri','Noto Naskh Arabic',serif;
  --body-font:'IBM Plex Sans','IBM Plex Sans Arabic',system-ui,-apple-system,'Segoe UI',sans-serif;
  --mono-font:ui-monospace,'Cascadia Mono','SF Mono',Menlo,monospace;
  /* legacy aliases — var() so night blocks need no re-declaration */
  --paper:var(--canvas); --paper-2:var(--surface-2); --paper2:var(--surface-2);
  --card:var(--surface-1); --border:var(--line-strong); --ink3:var(--ink-2);
  --cobalt:var(--lapis); --cobalt-soft:var(--lapis-soft); --bronze:var(--verdigris);
  --mono:var(--mono-font);
}

@media (prefers-color-scheme: dark) { :root[data-theme="auto"], :root:not([data-theme]) {
  --canvas:#0e1318; --surface-1:#171d24; --surface-2:#1f262e;
  --line:#2b343d; --line-strong:#5c6871;   /* 3.27:1 vs canvas */
  --ink:#dfe4e8; --ink-2:#a7b2bd; --muted:#8995a1;
  --lapis:#7fa6dc;      /* 7.46:1 */
  --verdigris:#6fbfa3;  /* 8.58:1 */
  --bad:#e08b92;        /* 7.36:1 */
  --warn:#d9ad5e;       /* 9.14:1 */
  --e1:inset 0 1px 0 rgba(223,228,232,.055),0 1px 2px rgba(0,0,0,.55);
  --e2:inset 0 1px 0 rgba(223,228,232,.07),0 8px 28px rgba(0,0,0,.6);
} }
:root[data-theme="night"] {
  --canvas:#0e1318; --surface-1:#171d24; --surface-2:#1f262e;
  --line:#2b343d; --line-strong:#5c6871;   /* 3.27:1 vs canvas */
  --ink:#dfe4e8; --ink-2:#a7b2bd; --muted:#8995a1;
  --lapis:#7fa6dc;      /* 7.46:1 */
  --verdigris:#6fbfa3;  /* 8.58:1 */
  --bad:#e08b92;        /* 7.36:1 */
  --warn:#d9ad5e;       /* 9.14:1 */
  --e1:inset 0 1px 0 rgba(223,228,232,.055),0 1px 2px rgba(0,0,0,.55);
  --e2:inset 0 1px 0 rgba(223,228,232,.07),0 8px 28px rgba(0,0,0,.6);
}

/* ---- structure override layer (mold #2) ---------------------
   Loaded before page styles; property-level cascade lets page
   backgrounds stand while borders/elevation are guaranteed.
   body-prefix wins the specificity fight per-longhand.        */
body .card { border:1px solid var(--line-strong); box-shadow:var(--e1); }
@media (prefers-color-scheme: dark) {
  body .card { box-shadow: inset 0 1px 0 rgba(255,246,230,.055), 0 1px 2px rgba(0,0,0,.5); }
}

/* ---- app shell: tabbar + appbar + lockup (mold #3) -------- */
body.n-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

.n-appbar { position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 54px; padding: 0 18px;
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }

.n-lockup { display: flex; align-items: baseline; gap: var(--s2); }
.n-lockup .lat { font: var(--t-h1); font-size: 22px; letter-spacing: var(--ls-display); color: var(--ink); }
.n-lockup .ar { font-family: var(--quran-font); font-size: 21px; font-weight: 400;
  color: var(--ink-2); line-height: 1; }

.n-tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface-1); border-top: 1px solid var(--line-strong); }
.n-tabbar a { flex: 1; min-height: 44px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; text-decoration: none;
  color: var(--ink-3); font: var(--t-meta); font-size: 11px; position: relative; }
.n-tabbar a svg { width: 22px; height: 22px; }
.n-tabbar a.on, .n-tabbar a[aria-current="page"] { color: var(--lapis); }
.n-tabbar a.on::before, .n-tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px; background: var(--lapis); border-radius: 0 0 2px 2px; }

/* ---- component set (mold #4) ------------------------------ */
.n-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 500 13.5px/1 var(--body-font); cursor: pointer; text-decoration: none;
  user-select: none; -webkit-user-select: none;
  transition: filter .12s, transform .09s, background .12s, border-color .12s; }
.n-btn.primary { background: var(--cobalt); color: #fff; }
.n-btn.primary:hover { filter: brightness(1.08); }
.n-btn.secondary { background: var(--surface-1); color: var(--ink);
  border-color: var(--line-strong); box-shadow: var(--e1); }
.n-btn.secondary:hover { border-color: var(--cobalt); }
.n-btn.ghost { background: transparent; color: var(--ink-2); }
.n-btn.ghost:hover { background: var(--surface-2); }
.n-btn:active { transform: scale(.97); }
.n-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.n-btn[disabled] { opacity: .45; pointer-events: none; }

.n-chip { display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px; margin: 0 3px 3px 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font: 400 12px/1.6 var(--body-font); color: var(--ink-2);
  text-decoration: none; background: transparent; }
.n-chip:hover { border-color: var(--lapis); color: var(--lapis); }

.n-state { max-width: 320px; margin: 48px auto; text-align: center; }
.n-state .glyph { font-family: var(--quran-font); font-size: 28px; color: var(--ink-3); line-height: 1.2; }
.n-state h3 { font-size: 19px; font-weight: 600; margin: 8px 0 4px; color: var(--ink); }
.n-state p { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin: 0 0 14px; }
body .empty { text-align: center; color: var(--ink-3); font-size: 12.5px; line-height: 1.6;
  padding: 28px 12px; }


/* ---- ISNAD v4 signature: the chain of transmission (row 397) ----
   .n-chain - segmented rule in the leading margin, one link per provenance
   step. Long tight verdigris links = NLI-verified grounds; short gray links
   = context (no claim made); wide ochre gaps = chain broken, we declined. */
.n-chain { --seg: 10px; --gap: 4px; position: relative; padding-inline-start: var(--s4); }
.n-chain::before {
  content: ""; position: absolute; inset-block: 2px; inset-inline-start: 0; width: 2px;
  border-radius: 1px;
  background: repeating-linear-gradient(to bottom,
    var(--chain-color, var(--line-strong)) 0 var(--seg),
    transparent var(--seg) calc(var(--seg) + var(--gap)));
}
.n-chain[data-tier="grounds"] { --chain-color: var(--verdigris); --seg: 14px; --gap: 3px; }
.n-chain[data-tier="context"] { --chain-color: var(--line-strong); --seg: 6px; --gap: 6px; }
.n-chain[data-tier="broken"]  { --chain-color: var(--warn); --seg: 4px; --gap: 10px; }

/* .n-cite - the citation card: ref mono, arabic clamped, translation prose */
.n-cite { background: var(--surface-1); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--e1); padding: var(--s3) var(--s4); }
.n-cite .ref { font: var(--t-mono); color: var(--ink-2); }
.n-cite .ar { font-family: var(--quran-font); font-size: 26px; line-height: 1.9;
  color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.n-cite .tr { font: 400 14px/1.6 var(--body-font); color: var(--ink-2); }

/* .n-verdict - verdict pill: words, never a bare color or dot */
.n-verdict { display: inline-flex; align-items: center; padding: 3px 12px;
  border-radius: var(--r-pill); font: var(--t-meta); }
.n-verdict.ok { background: var(--verdigris-soft); color: var(--verdigris);
  border: 1px solid color-mix(in srgb, var(--verdigris) 40%, transparent); }
.n-verdict.warn { background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }

/* global focus rings (ISNAD v4) */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lapis); outline-offset: 2px; border-radius: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--lapis); outline-offset: 1px; }

/* row 254: Arabic-first RTL pass */
[dir="rtl"] body { letter-spacing: 0; }
[dir="rtl"] .n-tabbar { direction: rtl; }
[dir="rtl"] .track > .fill { left: auto; right: 0; }
[dir="rtl"] .n-appbar .n-lockup { flex-direction: row-reverse; }
[dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea { text-align: right; }
[dir="rtl"] [lang="en"], [dir="rtl"] .lat { direction: ltr; unicode-bidi: isolate; }

/* row 254: tables scroll within their box instead of widening the page (RTL 360px fix) */
.tbl, .wrap table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- motion safety (ISNĀD v4) --------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
