
/* Layout concept: an app-like workspace — a hub of large icon tiles,
   each opening a focused page; data set in mono like a drawing title block. */
:root {
  color-scheme: light;
  /* Light, cool-white base with electric blue + amber accents */
  --bg:        #f3f6fb;   /* page */
  --bg-raised: #ffffff;   /* cards */
  --bg-sunk:   #eef3f9;   /* inputs, result panels */
  --line:      #dde5f0;
  --line-hi:   #c6d3e4;
  --fg:        #0f1e36;   /* deep navy text */
  --fg-muted:  #4d5d78;
  --fg-dim:    #5c6a80;
  --accent:    #0284c7;   /* electric blue */
  --accent-hi: #0369a1;   /* blue for text on light */
  --amber:     #b45309;   /* amber, darkened for text contrast */
  --amber-hi:  #f59e0b;
  --ok:        #047857;
  --bad:       #c81e1e;
  --warn:      #b45309;
  /* hero band */
  --band-1:    #0c4a6e;
  --band-2:    #0284c7;
  --band-3:    #06b6d4;
  /* calculator group colours */
  --g-elec:    #0284c7;   /* Electrical */
  --g-mech:    #007a3d;   /* Mechanical & HVAC — Saudi green */
  --g-civil:   #c09300;   /* Civil & Structural — Egyptian gold */
  --g-civil-text: #8a6a00; /* ACC-2: same gold, dark enough for text (5.1:1 on white) */
  --g-solar-text: #b45309; /* ACC-2: orange for text (5.0:1) */
  --g-plumb:   #ce1126;   /* Plumbing & Fire — Egyptian red */
  --g-pm:      #8a1538;   /* Project management (Qatar maroon) */
  --g-gen:     #7c3aed;   /* General */
  --g-solar:   #e8890c;   /* Renewables */
  --g-elv:     #0e7490;   /* ELV & low current */
  --g-geo:     #8b5a2b;   /* Geotechnical */
  --g-road:    #4b5563;   /* Roads & pavements (asphalt grey) */
  --g-water:   #1d4ed8;   /* Water & wastewater */
  --g-plant:   #b45309;   /* Plant & temporary works (amber) */
  --g-proc:    #be185d;   /* Process & industrial (magenta) */
  --g-ctrl:    #4338ca;   /* Controls & automation (indigo) */
  --g-surv:    #4d7c0f;   /* Surveying (olive) */
  --g-fac:     #0f766e;   /* Façade (teal) */
  --g-fire:    #c2410c;   /* Fire protection (fire orange) */
  --g-env:     #166534;   /* Environmental (forest green) */
  --g-ctry:    #7c2d12;   /* Country practice (maroon brown) */
  --g-fm:      #be185d;   /* Facility management (rose) */
  --grid-major: rgba(2,132,199,.07);
  --grid-minor: rgba(2,132,199,.035);
  --qatar:     #8a1538;   /* Qatar flag maroon */
  --saudi:     #006c35;   /* Saudi flag green */
  --egypt:     #ce1126;   /* Egypt flag red */
  --egypt-gold:#c09300;   /* Egypt eagle gold */
  --tri: linear-gradient(90deg, var(--qatar) 0 33.3%, var(--saudi) 33.3% 66.6%, var(--egypt) 66.6% 88.9%, #111 88.9%);

  --font-sans: "Inter", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Roboto, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Sans Arabic", ui-monospace, Consolas, monospace; /* FABLE M9: Arabic inside mono text uses the Arabic font */

  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2vw, 2.375rem);
  --step-4: clamp(2.25rem, 1.3rem + 3.6vw, 3.5rem);
  --radius: 8px;
  --wrap: 1120px;
}

/* ---------- DARK MODE ("night shift") — toggled by the moon button ---------- */
:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0a1120; --bg-raised: #111b2e; --bg-sunk: #0d1627; --line: #1f2c45; --line-hi: #304365;
  --fg: #e6edf7; --fg-muted: #a9b9cf; --fg-dim: #8b9bb4;
  --accent-hi: #38bdf8; --amber: #fbbf24; --ok: #34d399; --bad: #f87171; --warn: #fbbf24;
  --grid-major: rgba(56,189,248,.09); --grid-minor: rgba(56,189,248,.04);
  --g-civil-text: #c09300; --g-solar-text: #e8890c; /* bright colours already contrast on dark */
  --g-proc-text: #f472b6; /* process magenta, lighter for text on dark */
  --g-ctrl-text: #a5b4fc; /* controls indigo, lighter for text on dark */
  --g-surv-text: #a3e635; /* surveying olive, lighter for text on dark */
  --g-fac-text: #5eead4; /* façade teal, lighter for text on dark */
  --g-fire-text: #fdba74; /* fire orange, lighter for text on dark */
  --g-env-text: #86efac; /* forest green, lighter for text on dark */
  --g-ctry-text: #fdba74; /* maroon brown, lighter for text on dark */
  --g-fm-text: #f9a8d4;   /* Facility management, lighter for text on dark */
}
:root[data-mode="dark"] .rail-card, :root[data-mode="dark"] .site-header { background: color-mix(in srgb, var(--bg-raised) 90%, transparent); }
:root[data-mode="dark"] .home-hero::after { background: var(--bg-raised); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* PERF-3: no animation work while the tab is hidden or the hero is off-screen */
html.anim-paused *, html.anim-paused *::before, html.anim-paused *::after, .home-hero.offscreen * { animation-play-state: paused !important; }
body { margin: 0; color: var(--fg); font-family: var(--font-sans); font-size: 1rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.2rem; border-radius: 6px; font: 600 .9375rem/1 var(--font-sans); cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0369a1; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-hi); }
.btn-ghost:hover { color: var(--accent-hi); border-color: var(--accent-hi); }
.btn svg { width: 16px; height: 16px; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--bg-raised) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header { border-bottom: 0; }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--tri); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.brand { display: flex; align-items: center; gap: .72rem; color: var(--fg); font-weight: 700; background: none; border: 0; cursor: pointer; padding: 0; }
.logo { width: 44px; height: 44px; flex: none; display: block; filter: drop-shadow(0 6px 8px rgba(138,21,56,.28)); transition: transform .35s cubic-bezier(.3,1.5,.5,1); }
.logo svg { width: 100%; height: 100%; display: block; overflow: visible; }
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
.logo-bolt { transform-box: fill-box; transform-origin: center; animation: logo-zap 4s ease-in-out infinite; }
@keyframes logo-zap { 0%, 86%, 100% { opacity: 1; filter: none; } 88% { opacity: .2; } 90% { opacity: 1; filter: drop-shadow(0 0 3px #fde68a); } 92% { opacity: .4; } 94% { opacity: 1; filter: drop-shadow(0 0 4px #fde68a); } }
.brand-text { display: grid; line-height: 1.05; text-align: start; }
.brand-name { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; color: var(--fg); }
.brand-name em { font-style: normal; background: linear-gradient(90deg, var(--qatar), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font: 600 .6rem var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--fg-dim); margin-top: .25rem; }
.nav { display: flex; gap: .25rem; overflow-x: auto; min-width: 0; margin-inline-start: auto; scrollbar-width: none; }
@media (max-width: 640px) { .nav { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-inline-end: 1.5rem; }
  [dir="rtl"] .nav { -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); } } /* FABLE M6: fade shows the row scrolls */
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; }
.nav a { text-decoration: none; display: inline-block; background: none; border: 0; color: var(--fg-muted); padding: .5rem .75rem; border-radius: 6px; font-weight: 500; font-size: .9375rem; cursor: pointer; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--accent-hi); background: color-mix(in srgb, var(--accent) 10%, var(--bg-raised)); }
@media (max-width: 560px) { .brand-text { display: none; } .nav a { padding: .5rem .5rem; font-size: .875rem; } }

.about-pill { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .3rem; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg-muted); font-size: .8125rem; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s; }
.about-pill:hover, .about-pill[aria-current="page"] { border-color: var(--qatar); color: var(--qatar); }
.about-ava { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #a61b46, var(--qatar)); }
.about-ava svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 760px) { .about-txt { display: none; } .about-pill { padding: .3rem; } }
.site-header .wrap { gap: .75rem; }

/* Views */
.view { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

/* ---------- HOME ---------- */
/* Blue hero band with a faint drawing-sheet grid */
.home-hero { position: relative; overflow: hidden; isolation: isolate; margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 3.5vw, 2.25rem) clamp(1.25rem, 4vw, 2.75rem); border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, var(--band-1) 0%, var(--band-2) 60%, var(--band-3) 100%);
  box-shadow: 0 20px 40px -24px color-mix(in srgb, var(--band-1) 70%, transparent); }
.home-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: linear-gradient(100deg, transparent 20%, #000 75%); }
/* Qatar flag motif: maroon panel with the nine-point serrated edge, white edge behind it */
.home-hero::after, .qa-flag { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: clamp(64px, 20%, 220px); clip-path: polygon(34% 0%, 0% 5.556%, 34% 11.111%, 0% 16.667%, 34% 22.222%, 0% 27.778%, 34% 33.333%, 0% 38.889%, 34% 44.444%, 0% 50.0%, 34% 55.556%, 0% 61.111%, 34% 66.667%, 0% 72.222%, 34% 77.778%, 0% 83.333%, 34% 88.889%, 0% 94.444%, 34% 100%, 100% 100%, 100% 0%); z-index: -1; }
.home-hero::after { background: #fff; right: 6px; width: calc(clamp(64px, 20%, 220px) + 6px); opacity: .95; }
.qa-flag { background: var(--qatar); }
@media (max-width: 560px) { .home-hero::after { width: 54px; } .qa-flag { width: 48px; } .home-hero h1, .home-hero cite { padding-right: 40px; } }
.home-hero p.status { color: rgba(255,255,255,.85); font-size: .75rem; margin-top: 0; }
.quote { margin: 0; }
.home-hero h1 { font-size: clamp(1.3rem, 1rem + 1.6vw, 2.05rem); font-weight: 800; letter-spacing: -.025em; max-width: 34ch; line-height: 1.2; }
.home-hero cite { display: block; margin-top: .6rem; font: 500 .9rem var(--font-mono); font-style: normal; letter-spacing: .04em; color: rgba(255,255,255,.85); }
.home-hero > *:not(.qa-flag) { position: relative; }
.home-hero h1 em { font-style: normal; color: #fcd34d; }
.home-hero p { margin-top: 1rem; color: rgba(255,255,255,.88); font-size: var(--step-1); max-width: 34rem; }
.status { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

.hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 720px) { .hub { grid-template-columns: 1fr; } }
.hub-tile { text-align: start; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center;
  padding: 1.75rem; border-radius: var(--radius); border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg); transition: border-color .15s, transform .15s; }
.hub-tile:hover { border-color: var(--accent-hi); transform: translateY(-2px); }
.hub-tile .ico { width: 64px; height: 64px; }
.hub-tile h2 { font-size: var(--step-2); }
.hub-tile p { color: var(--fg-muted); font-size: .9375rem; margin-top: .25rem; }
.hub-tile .arrow { width: 22px; height: 22px; color: var(--fg-dim); }
.hub-tile:hover .arrow { color: var(--accent-hi); }

/* Icon chip — colour comes from --c (set per group) */
/* 3D icon: domed gradient tile, extruded base, glossy highlight, embossed glyph.
   Change the look here for every icon on the site. --c = icon colour. */
.ico { --c: var(--accent); --depth: 5px; display: grid; place-items: center; border-radius: 18px; color: #fff; position: relative;
  background: radial-gradient(circle at 30% 22%, color-mix(in srgb, var(--c) 45%, #fff) 0%, var(--c) 48%, color-mix(in srgb, var(--c) 68%, #000) 100%);
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.5),
    inset 0 -5px 8px rgba(0,0,0,.22),
    0 var(--depth) 0 color-mix(in srgb, var(--c) 55%, #000),
    0 calc(var(--depth) + 10px) 18px -6px color-mix(in srgb, var(--c) 55%, transparent);
  transform: translateY(calc(var(--depth) * -1)); transform-style: preserve-3d;
  transition: transform .25s cubic-bezier(.2,.8,.2,1.2), box-shadow .25s ease; }
.ico::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse 70% 45% at 35% 8%, rgba(255,255,255,.55), transparent 70%); }
.ico svg { position: relative; z-index: 1; width: 54%; height: 54%; fill: rgba(255,255,255,.2); stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.22)) drop-shadow(0 4px 5px rgba(0,0,0,.18)); }
.icon-card, .hub-tile { perspective: 600px; }
.icon-card:hover .ico, .hub-tile:hover .ico, .quick-row button:hover .ico {
  transform: translateY(calc(var(--depth) * -1.8)) rotateX(12deg) rotateY(-12deg);
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.5),
    inset 0 -5px 8px rgba(0,0,0,.22),
    0 calc(var(--depth) * 1.6) 0 color-mix(in srgb, var(--c) 55%, #000),
    0 calc(var(--depth) + 22px) 26px -8px color-mix(in srgb, var(--c) 60%, transparent); }
.icon-card:active .ico, .hub-tile:active .ico { transform: translateY(-1px); box-shadow: inset 0 2px 1px rgba(255,255,255,.5), inset 0 -5px 8px rgba(0,0,0,.22), 0 1px 0 color-mix(in srgb, var(--c) 55%, #000); }
.quick-row .ico { --depth: 2px; border-radius: 50%; }
.quick-row button { padding-top: .6rem; }
.calc-title .ico { --depth: 4px; }
.icon-card { padding-top: 1.7rem; }
.ico.amber { --c: var(--g-civil); }
.ico.qatar { --c: var(--qatar); }
.ico.violet { --c: var(--g-gen); }
.ico.solid { }
/* soft elevation for cards */
.hub-tile, .icon-card, .proj, .calc-shell, .cred, .form, .link-row { box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 10px 24px -16px rgba(15,30,54,.18); }

.quick { margin-top: 2.5rem; }
.quick-row { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; margin-top: .75rem; }
.quick-row button { flex: none; display: flex; align-items: center; gap: .6rem; padding: .72rem .9rem .72rem .72rem; border-radius: 999px; border: 1px solid var(--line-hi); background: transparent; color: var(--fg); cursor: pointer; font-size: .875rem; font-weight: 500; }
.quick-row button:hover { border-color: var(--accent-hi); }
.quick-row .ico { width: 30px; height: 30px; border-radius: 50%; }

/* ---------- CALC GRID ---------- */
.page-head { display: grid; gap: .6rem; margin-bottom: 2rem; max-width: 44rem; }
.page-head .label { color: var(--accent-hi); }
.page-head h1 { font-size: var(--step-3); }
.page-head p { color: var(--fg-muted); font-size: var(--step-1); }
.search { max-width: 360px; margin-bottom: 2rem; }
.search input { width: 100%; padding: .72rem .9rem; border-radius: 6px; border: 1px solid var(--line-hi); background: var(--bg-sunk); color: var(--fg); font-size: .9375rem; }
.search input:focus { outline: none; border-color: var(--accent-hi); }
.group { margin-bottom: 2.25rem; }
.group > .label { display: block; margin-bottom: 1rem; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
a.icon-card, a.hub-tile { text-decoration: none; }
.icon-card { display: grid; justify-items: center; text-align: center; gap: .75rem; padding: 1.4rem .9rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg); cursor: pointer; transition: border-color .15s, transform .15s; }
.icon-card:hover { border-color: var(--accent-hi); transform: translateY(-2px); }
.icon-card .ico { width: 58px; height: 58px; }
.icon-card b { font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.icon-card span { font-size: .78rem; color: var(--fg-dim); line-height: 1.35; }
.empty { color: var(--fg-muted); }

/* ---------- CALCULATOR ---------- */
.back { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; color: var(--fg-muted); cursor: pointer; padding: 0; margin-bottom: 1.5rem; font-size: .9375rem; }
.back:hover { color: var(--accent-hi); }
.back svg { width: 16px; height: 16px; }
.calc-title { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.calc-title .ico { width: 56px; height: 56px; flex: none; }
.calc-title h1 { font-size: var(--step-3); }
.calc-title p { color: var(--fg-muted); margin-top: .2rem; }
.calc-shell { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .calc-shell { grid-template-columns: 1fr; } }
.calc-shell > * { min-width: 0; }
.inputs { padding: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-content: start; border-right: 1px solid var(--line); }
@media (max-width: 820px) { .inputs { border-right: 0; border-bottom: 1px solid var(--line); } }
@media (max-width: 420px) { .inputs { grid-template-columns: 1fr; } }
.field { display: grid; gap: .375rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .8125rem; color: var(--fg-muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; padding: .72rem .75rem; border-radius: 5px; background: var(--bg-sunk); color: var(--fg); border: 1px solid var(--line-hi); font: .9375rem var(--font-mono); font-variant-numeric: tabular-nums; }
.field textarea { font-family: var(--font-sans); resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent-hi); }
.unit { position: relative; }
.unit input { padding-right: 3.6rem; }
.unit span { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font: .75rem var(--font-mono); color: var(--fg-dim); pointer-events: none; }
.results { padding: 1.5rem; display: grid; gap: 1.25rem; align-content: start; background: var(--bg-sunk); }
.readout { display: grid; gap: .25rem; }
.readout b { font: 600 var(--step-4)/1 var(--font-mono); color: var(--accent-hi); letter-spacing: -.03em; overflow-wrap: anywhere; }
.readout small { font: .875rem var(--font-mono); color: var(--fg-muted); }
.verdict { display: inline-flex; justify-self: start; padding: .35rem .75rem; border-radius: 999px; font-weight: 600; font-size: .8125rem; }
.verdict.ok  { color: var(--ok);  background: color-mix(in srgb, var(--ok) 12%, transparent); }
.verdict.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.rows { display: grid; border-top: 1px solid var(--line); }
.rows div { display: flex; justify-content: space-between; gap: 1rem; padding: .72rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.rows span { color: var(--fg-muted); }
.rows b { font: 500 .875rem var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.copy-res { justify-self: start; padding: .72rem .9rem; font-size: .85rem; }
.copy-res svg { width: 15px; height: 15px; }
.formula { padding: .9rem 1rem; border: 1px dashed var(--line-hi); border-radius: 6px; font: .8125rem/1.6 var(--font-mono); color: var(--fg-muted); }
.note { font-size: .8125rem; color: var(--fg-dim); }

/* ---------- PROFILE ---------- */
.prof-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.prof-hero > * { min-width: 0; }
@media (max-width: 900px) { .prof-hero { grid-template-columns: 1fr; } }
.prof-hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -.035em; }
.prof-hero h1 em { font-style: normal; color: var(--accent-hi); }
.prof-hero .sub { margin-top: 1.25rem; font-size: var(--step-1); color: var(--fg-muted); max-width: 36rem; }
.prof-hero .sub strong { color: var(--fg); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.sld { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-sunk); padding: 1.25rem; margin: 0; }
.sld-top { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.sld svg { width: 100%; height: auto; display: block; }
.sld .w { stroke: var(--fg-muted); stroke-width: 1.6; fill: none; }
.sld .bus { stroke: var(--accent-hi); stroke-width: 3; }
.sld .t { fill: var(--fg-dim); font: 500 10px var(--font-mono); }
.sld .tv { fill: var(--amber); font: 500 10px var(--font-mono); }
.sld .flow { stroke: var(--accent-hi); stroke-width: 1.6; fill: none; stroke-dasharray: 3 7; animation: flow 1.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3rem; border-top: 1px solid var(--line); }
.stat { padding: 1.25rem 1rem 0 0; }
.stat b { display: block; font: 600 var(--step-3)/1.1 var(--font-mono); letter-spacing: -.02em; }
.stat span { color: var(--fg-muted); font-size: .875rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); row-gap: 1rem; } }

.psec { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.sec-head { display: grid; gap: .6rem; margin-bottom: 2.25rem; max-width: 46rem; }
.sec-head .label { color: var(--accent-hi); }
.sec-head h2 { font-size: var(--step-3); }
.sec-head p { color: var(--fg-muted); font-size: var(--step-1); }

.matrix { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 900px) { .matrix { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .matrix { grid-template-columns: 1fr; } }
.cell { background: var(--bg-raised); padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: .72rem; align-content: start; }
.cell h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -.01em; }
.cell p { color: var(--fg-muted); font-size: .9375rem; }
.cell .code { color: var(--accent-hi); font: 500 .75rem var(--font-mono); letter-spacing: .08em; }
.tags { display: flex; flex-wrap: wrap; gap: .375rem; }
.tag { font: .75rem/1 var(--font-mono); padding: .35rem .5rem; border: 1px solid var(--line-hi); border-radius: 3px; color: var(--fg-muted); }

.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.75rem; }
.cred { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.seal { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--amber-hi); display: grid; place-items: center; font: 600 .6875rem var(--font-mono); color: var(--amber); background: color-mix(in srgb, var(--amber-hi) 8%, var(--bg-raised)); }
.seal.pending { border-style: dashed; border-color: var(--fg-dim); color: var(--fg-muted); }
.cred b { display: block; font-weight: 600; }
.cred span { font-size: .8125rem; color: var(--fg-muted); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.chip { font-weight: 500; font-size: .875rem; line-height: 1; padding: .6rem .9rem; border-radius: 999px; cursor: pointer; background: transparent; color: var(--fg-muted); border: 1px solid var(--line-hi); }
.chip:hover { color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 820px) { .projects { grid-template-columns: 1fr; } }
.proj { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); display: flex; flex-direction: column; min-width: 0; }
.proj-head { padding: 1.5rem 1.5rem 1.25rem; display: grid; gap: .6rem; }
.proj-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.proj-meta .label:first-child { color: var(--amber); }
.proj h3 { font-size: var(--step-2); font-weight: 700; }
.proj .scope { color: var(--fg-muted); font-size: .9375rem; }
.proj dl { margin: 0; padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); flex: 1; }
.proj dd { margin: 0; font-size: .9375rem; }
.proj ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; }
.proj li { margin-bottom: .25rem; }
.proj li::marker { color: var(--accent-hi); }
.proj-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--line); }

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; }
.contact-grid > * { min-width: 0; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.links { display: grid; gap: .75rem; }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); }
.link-row:hover { border-color: var(--accent-hi); text-decoration: none; }
.link-row .label { display: block; margin-bottom: .125rem; }
.link-row b { font-weight: 500; overflow-wrap: anywhere; }
.link-row svg { flex: none; width: 18px; height: 18px; color: var(--fg-dim); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.5rem; border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); align-content: start; }
@media (max-width: 480px) { .form { grid-template-columns: 1fr; } }
.form-msg { grid-column: 1 / -1; font-size: .875rem; color: var(--ok); }
.form-msg.err { color: var(--bad); }

/* ---------- TOPICS / ARTICLE ---------- */
.article { max-width: 46rem; }
.article .lead { font-size: var(--step-1); color: var(--fg-muted); margin-bottom: 2rem; }
.article h2 { font-size: var(--step-2); margin: 2rem 0 .75rem; }
.article ul { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .5rem; }
.article li::marker { color: var(--ct, var(--c, var(--accent))); }
.article li b { font-weight: 600; }
.ktable-wrap { overflow-x: auto; margin-top: .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.ktable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ktable th, .ktable td { text-align: start; padding: .72rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ktable th { font: 600 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); background: var(--bg-sunk); }
.ktable tr:last-child td { border-bottom: 0; }
.ktable td:first-child { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; color: var(--ct, var(--c, var(--accent-hi))); }
.tip { margin-top: 2rem; padding: 1rem 1.25rem; border-radius: var(--radius); background: color-mix(in srgb, var(--c, var(--accent)) 8%, #fff); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 25%, transparent); }
.src-box { margin-top: 2rem; padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px dashed color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.src-box h2 { margin-top: 0; }
.src-box li { overflow-wrap: anywhere; }
.src-dates, .src-note { font-size: .875rem; opacity: .8; }
.tip .label { display: block; color: var(--ct, var(--c, var(--accent))); margin-bottom: .25rem; }
.art-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.art-nav button { background: none; border: 0; color: var(--accent-hi); cursor: pointer; font-weight: 600; padding: 0; text-align: start; }
.art-nav button span { display: block; font: .75rem var(--font-mono); color: var(--fg-dim); letter-spacing: .08em; text-transform: uppercase; font-weight: 400; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.steps li { display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; align-items: start; }
.steps li i { font: 600 .8rem/2rem var(--font-mono); font-style: normal; text-align: center; width: 2rem; height: 2rem; border-radius: 50%; color: #fff; background: var(--c, var(--accent)); }
.steps li b { display: block; font-weight: 600; }
.steps li span { color: var(--fg-muted); font-size: .9375rem; }
.stage { display: inline-block; font: 600 .72rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: .35rem .5rem; border-radius: 4px; white-space: nowrap; }
.stage.s1 { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--bg-raised)); }
.stage.s2 { color: var(--accent-hi); background: color-mix(in srgb, var(--accent) 10%, var(--bg-raised)); }
.stage.s3 { color: var(--qatar); background: color-mix(in srgb, var(--qatar) 9%, var(--bg-raised)); }
.ktable.certs td:first-child { white-space: normal; }

/* ---------- CHAT ---------- */
.chat { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }
.chat > * { min-width: 0; }
@media (max-width: 820px) { .chat { grid-template-columns: 1fr; } }
.channels { display: grid; gap: .4rem; }
@media (max-width: 820px) { .channels { display: flex; overflow-x: auto; padding-bottom: .4rem; } }
.channel { display: flex; align-items: center; gap: .72rem; padding: .72rem .72rem; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--fg); cursor: pointer; text-align: left; font-weight: 500; font-size: .9375rem; flex: none; }
.channel .ico { width: 32px; height: 32px; border-radius: 10px; --depth: 2px; flex: none; }
.channel:hover { background: var(--bg-raised); }
.channel[aria-current="true"] { background: var(--bg-raised); border-color: var(--line-hi); box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 8px 18px -14px rgba(15,30,54,.25); }
.chat-panel { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 10px 24px -16px rgba(15,30,54,.18); overflow: hidden; }
.chat-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.chat-head h2 { font-size: var(--step-1); }
.chat-head p { color: var(--fg-muted); font-size: .875rem; }
.live { display: inline-flex; align-items: center; gap: .4rem; font: 500 .75rem var(--font-mono); color: var(--fg-dim); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim); }
.live.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.msgs { height: min(58vh, 560px); overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; background: var(--bg-sunk); }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: .75rem; }
.msg img { width: 36px; height: 36px; border-radius: 50%; background: var(--line); }
.msg-meta { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.msg-meta b { font-weight: 600; font-size: .9375rem; }
.msg-meta time { font: .75rem var(--font-mono); color: var(--fg-dim); }
.msg-meta button { margin-inline-start: auto; background: none; border: 0; color: var(--fg-dim); font-size: .75rem; cursor: pointer; padding: 0; }
.msg-meta button:hover { color: var(--bad); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; margin-top: .15rem; }
.msg.me .msg-text { background: color-mix(in srgb, var(--accent) 9%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); padding: .5rem .75rem; border-radius: 4px 12px 12px 12px; justify-self: start; }
.chat-empty { margin: auto; text-align: center; color: var(--fg-muted); max-width: 28rem; display: grid; gap: .5rem; justify-items: center; }
.chat-empty .ico { width: 56px; height: 56px; margin-bottom: .5rem; }
.chat-empty b { color: var(--fg); font-size: var(--step-1); }
.composer { display: grid; grid-template-columns: 1fr auto; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); align-items: end; }
.composer textarea { width: 100%; resize: none; min-height: 46px; max-height: 160px; padding: .72rem .85rem; border-radius: 8px; border: 1px solid var(--line-hi); background: var(--bg-sunk); color: var(--fg); font: .9375rem/1.5 var(--font-sans); }
.composer textarea:focus { outline: none; border-color: var(--accent-hi); }
.composer-note { grid-column: 1 / -1; font-size: .8125rem; color: var(--fg-dim); }
.composer-note.err { color: var(--bad); }
.hub-tile.wide { grid-column: 1 / -1; }

/* ---------- ELECTRIC EFFECTS ---------- */
.zap-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
.home-hero h1 em { text-shadow: 0 0 18px rgba(252,211,77,.55); }
.home-hero.struck h1 em { animation: buzz .35s steps(2) 1; }
@keyframes buzz { 0%,100% { text-shadow: 0 0 18px rgba(252,211,77,.55); } 50% { text-shadow: 0 0 4px #fff, 0 0 28px #fde68a, 0 0 46px #38bdf8; } }


/* ---------- SITE WORKER ---------- */
.worker { --dir: 1; position: fixed; left: 0; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); width: 56px; z-index: 65; pointer-events: none;
  transform: translateX(-120px); will-change: transform; }
.worker svg { width: 100%; height: auto; display: block; overflow: visible; }
@media (max-width: 700px) { .worker { display: none; } } /* UX-1: no walking figure over cards on phones */
.w-flip { transform: scaleX(var(--dir)); transition: transform .18s ease; }
.w-leg, .w-arm, .w-body, .w-upper, .w-head, .eye { transform-box: view-box; }
.eye { transform-box: fill-box; transform-origin: center; }
.w-leg { transform-origin: 30px 58px; }
.w-arm { transform-origin: 30px 39px; transition: transform .3s ease; }
.w-upper { transform-origin: 30px 58px; transition: transform .4s cubic-bezier(.3,.7,.3,1); }
.w-head { transform-origin: 30px 33px; transition: transform .3s ease; }
/* walking */
.worker.walking .w-leg { animation: w-swing .7s ease-in-out infinite; }
.worker.walking .w-leg.back { animation-delay: -.35s; }
.worker.walking .w-arm.back { animation: w-swing-arm .7s ease-in-out infinite; }
.worker.walking .w-arm.front { animation: w-swing-small .7s ease-in-out infinite -.35s; }
.worker.walking .w-body { animation: w-bob .35s ease-in-out infinite alternate; }
@keyframes w-swing { 0%, 100% { transform: rotate(22deg); } 50% { transform: rotate(-22deg); } }
@keyframes w-swing-arm { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(18deg); } }
@keyframes w-swing-small { 0%, 100% { transform: rotate(7deg); } 50% { transform: rotate(-7deg); } }
@keyframes w-bob { from { transform: translateY(0); } to { transform: translateY(-1.6px); } }
/* idle breathing */
.worker:not(.walking) .w-upper { animation: w-breathe 2.4s ease-in-out infinite; }
@keyframes w-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.6px); } }
/* faces */
.face-front, .m-oops { display: none; }
.worker.look .face-side { display: none; }
.worker.look .face-front { display: inline; }
.worker.oops .m-smile { display: none; }
.worker.oops .m-oops { display: inline; }
.worker.look .w-head { transform: rotate(calc(var(--dir) * -4deg)); }
.worker.blink .eye { transform: scaleY(.12); }
/* poses */
.worker.bend .w-upper { animation: none; transform: rotate(48deg); }
.worker.bend .w-arm.back { transform: rotate(-30deg); }
.worker.wave .w-arm.back { animation: w-wave .32s ease-in-out infinite alternate; }
@keyframes w-wave { from { transform: rotate(150deg); } to { transform: rotate(118deg); } }
.worker.scratch .w-arm.back { animation: w-scratch .25s ease-in-out infinite alternate; }
@keyframes w-scratch { from { transform: rotate(160deg); } to { transform: rotate(170deg); } }
.worker.no-wrench .w-wrench { display: none; }
/* speech bubble */
.w-bubble { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-30%) scale(.6); transform-origin: 20% 100%; opacity: 0;
  background: var(--bg-raised); color: var(--fg); border: 1.5px solid var(--fg); border-radius: 12px; padding: .35rem .72rem; font: 600 .78rem/1.3 var(--font-sans);
  white-space: nowrap; box-shadow: 0 6px 14px -8px rgba(15,30,54,.35); transition: opacity .2s ease, transform .25s cubic-bezier(.3,1.5,.5,1); }
.w-bubble::after { content: ""; position: absolute; left: 22%; top: 100%; border: 6px solid transparent; border-top-color: var(--fg); }
.w-bubble.show { opacity: 1; transform: translateX(-30%) scale(1); }
/* dropped wrench */
.dropped-tool { position: fixed; left: 0; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: 10px; z-index: 64; pointer-events: none; display: none; }
.dropped-tool svg { width: 100%; display: block; overflow: visible; }
@media (max-width: 560px) { .worker { width: 46px; } .dropped-tool { width: 8px; } }
@media (prefers-reduced-motion: reduce) { .worker, .dropped-tool { display: none !important; } }

/* ---------- SIDE RAILS ---------- */
.rail { display: none; }
@media (min-width: 1100px) {
  .rail { display: flex; flex-direction: column; justify-content: center; gap: 1rem; position: fixed; top: 84px; bottom: 16px; z-index: 1;
    width: min(230px, calc((100vw - var(--wrap)) / 2 - 28px)); }
  .rail-left { left: 14px; }
  .rail-right { right: 14px; }
  main, footer { position: relative; z-index: 2; }
  .rail { z-index: 6; }
}
.rail-traces { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.rail-traces.flip { transform: scaleX(-1); }
.tr-base { fill: none; stroke: color-mix(in srgb, var(--accent) 22%, var(--line)); stroke-width: 2; }
.tr-base rect { fill: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.tr-nodes circle { fill: var(--bg-raised); stroke: color-mix(in srgb, var(--accent) 40%, var(--line)); stroke-width: 2; }
.tr-pulse { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(14,165,233,.9)); }
.pulse { stroke-dasharray: 18 260; animation: pulse-run 5s linear infinite; }
.pulse.p1 { animation-duration: 6.5s; animation-delay: -2s; stroke: var(--amber-hi); filter: drop-shadow(0 0 4px rgba(245,158,11,.9)); }
.pulse.p2 { animation-duration: 4.2s; animation-delay: -1s; }
.pulse.p3 { display: none; }
@keyframes pulse-run { from { stroke-dashoffset: 278; } to { stroke-dashoffset: -900; } }

.rail-card { min-width: 0; background: color-mix(in srgb, var(--bg-raised) 88%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line-hi); border-radius: 14px; padding: 1rem;
  box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 14px 30px -18px rgba(15,30,54,.3); }
.rail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .25rem; }
.rail-head .label { color: var(--fg); font-weight: 600; }
.gauge { width: 100%; display: block; }
.g-track, .g-fill { fill: none; stroke-width: 9; stroke-linecap: round; }
.g-track { stroke: var(--bg-sunk); }
.g-fill { stroke: var(--accent); stroke-dasharray: 0 100; transition: stroke-dasharray .9s ease, stroke .4s; }
.g-needle { stroke: var(--fg); stroke-width: 2.4; stroke-linecap: round; transform-origin: 60px 62px; transition: transform .9s cubic-bezier(.3,1.4,.5,1); }
.g-hub { fill: var(--fg); }
.g-read { text-align: center; margin-top: -.35rem; }
.g-read b { font: 600 1.5rem/1 var(--font-mono); }
.g-read span { font-size: .75rem; color: var(--fg-muted); margin-inline-start: .2rem; }
.m-rows { margin: .75rem 0 0; display: grid; }
.m-rows div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 .5rem; padding: .32rem 0; border-top: 1px solid var(--line); font-size: .78rem; }
.m-rows dt { color: var(--fg-muted); display: flex; align-items: center; gap: .35rem; }
.m-rows dt i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.m-rows dd { margin: 0; font-family: var(--font-mono); color: var(--fg-muted); }
.m-rows b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.m-note { margin-top: .5rem; font: .72rem var(--font-mono); color: var(--fg-dim); letter-spacing: .06em; text-transform: uppercase; text-align: right; }
.clock { display: grid; gap: .15rem; text-align: center; }
.clock b { font-size: clamp(1.05rem, 1.7vw - .45rem, 1.7rem); font-weight: 600; letter-spacing: .02em; color: var(--fg); }
.clock span:last-child { font-size: .8rem; color: var(--fg-muted); }
.clock .label { color: var(--qatar); font-weight: 600; }
.fact-label { color: var(--g-gen); font-weight: 600; display: block; margin-bottom: .4rem; }
.fact-tag { display: inline-block; font: 600 .72rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--c, var(--accent)); padding: .3rem .45rem; border-radius: 4px; margin-bottom: .45rem; transition: opacity .35s; }
.fact-tag.fade { opacity: 0; }
.fact p { font-size: .9rem; line-height: 1.5; min-height: 5.4em; transition: opacity .35s ease; }
.fact p.fade { opacity: 0; }
.fact-dots { display: flex; gap: 4px; margin-top: .6rem; flex-wrap: wrap; }
.fact-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-hi); }
.fact-dots i.on { background: var(--g-gen); }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; stroke-dasharray: none; opacity: .5; } }

/* ---------- LIBRARY ---------- */
.shelves { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.shelf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .shelf-grid { grid-template-columns: 1fr; } }
.shelf-grid > * { min-width: 0; }
.shelf-sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); padding: 1.25rem 1.4rem; box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 10px 24px -16px rgba(15,30,54,.18); }
.shelf-sec h2 { font-size: var(--step-1); display: flex; align-items: center; gap: .72rem; margin-bottom: .9rem; }
.shelf-sec h2 svg { width: 20px; height: 20px; fill: none; stroke: var(--c, var(--accent)); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; }
.lib-list li { padding: .6rem 0; border-top: 1px solid var(--line); display: grid; gap: .1rem; }
.lib-list li:first-child { border-top: 0; padding-top: 0; }
.lib-list b { font-weight: 600; }
.lib-list .code { font: 600 .8rem var(--font-mono); color: var(--ct, var(--c, var(--accent-hi))); }
.lib-list span { color: var(--fg-muted); font-size: .875rem; }
.lib-link { display: flex; justify-content: space-between; align-items: center; gap: .75rem; color: var(--fg); }
.lib-link:hover { text-decoration: none; color: var(--ct, var(--c, var(--accent-hi))); }
.lib-link svg { flex: none; width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.shelf-note { margin-top: 1.25rem; }
.lib-hit { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; padding: .75rem 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; color: var(--fg); }
.lib-hit .stage { grid-row: span 2; align-self: start; color: #fff; background: var(--c); }
.lib-hit span { color: var(--fg-muted); font-size: .875rem; }

/* ---------- SUGGESTIONS ---------- */
.sugg-btn { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem .4rem .72rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--amber-hi) 45%, transparent); background: color-mix(in srgb, var(--amber-hi) 10%, var(--bg-raised)); color: var(--amber); font-size: .8125rem; font-weight: 600; cursor: pointer; }
.sugg-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sugg-btn:hover, .sugg-btn[aria-expanded="true"] { background: var(--egypt-gold); color: #fff; border-color: var(--amber-hi); }
@media (max-width: 760px) { .sugg-txt { display: none; } .sugg-btn { padding: .4rem; } }
.sugg-panel { position: fixed; z-index: 80; top: calc(env(safe-area-inset-top, 0px) + 70px); right: max(16px, env(safe-area-inset-right, 0px)); width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--bg-raised); border: 1px solid var(--line-hi); border-radius: 14px; padding: 1.25rem; box-shadow: 0 24px 50px -20px rgba(15,30,54,.45); display: grid; gap: 1rem; }
.sugg-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.sugg-head h2 { font-size: var(--step-1); }
.sugg-head p { color: var(--fg-muted); font-size: .875rem; margin-top: .2rem; }
.sugg-close { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--fg-dim); cursor: pointer; padding: 0 .25rem; }
.sugg-close:hover { color: var(--fg); }
.sugg-form { display: grid; gap: .9rem; }
.sugg-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.sugg-types label { cursor: pointer; }
.sugg-types input { position: absolute; opacity: 0; pointer-events: none; }
.sugg-types span { display: grid; gap: .1rem; text-align: center; padding: .72rem .3rem; border-radius: 8px; border: 1px solid var(--line-hi); font-size: .8rem; font-weight: 600; color: var(--fg-muted); }
.sugg-types small { font-weight: 500; font-size: .75rem; }
.sugg-types input:checked + span { border-color: var(--amber-hi); background: color-mix(in srgb, var(--amber-hi) 12%, var(--bg-raised)); color: var(--amber); }
.sugg-types input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.sugg-inbox { border-top: 1px solid var(--line); padding-top: 1rem; }
.sugg-inbox h3 { font-size: 1rem; margin-bottom: .5rem; }
.sugg-item { padding: .6rem 0; border-top: 1px solid var(--line); display: grid; gap: .2rem; }
.sugg-item:first-child { border-top: 0; }
.sugg-item .meta { display: flex; gap: .5rem; align-items: center; font: .72rem var(--font-mono); color: var(--fg-dim); }
.sugg-item p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }

/* ---------- FLAG-COLOUR ACCENTS (maroon · green · red · black · gold) ---------- */
.home-hero { border-bottom: 0; }
.home-hero > .tri-band { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--tri); z-index: 1; }

.qa { display: grid; gap: .5rem; }
.qa details { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); padding: .2rem 1rem; }
.qa summary { cursor: pointer; font-weight: 600; padding: .72rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font: 600 1.1rem var(--font-mono); color: var(--ct, var(--c, var(--accent))); }
.qa details[open] summary::after { content: "−"; }
.qa details p { color: var(--fg-muted); padding-bottom: .8rem; }

/* ---------- EXAMS ---------- */
.quiz { display: grid; gap: 1rem; margin-top: 1rem; }
.quiz-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: 1rem; font-size: .85rem; color: var(--fg-muted); }
.quiz-meta span:first-child { color: var(--ct, var(--c, var(--accent-hi))); font-weight: 600; }
.qotd { margin-top: 1.25rem; padding: 1.2rem 1.4rem; border-radius: var(--radius); border: 1px solid var(--line-hi); background: var(--bg-raised); box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 10px 28px -18px rgba(15,30,54,.25); }
.qotd-head { display: flex; align-items: center; gap: .72rem; flex-wrap: wrap; margin-bottom: .72rem; }
.qotd-head .ico { width: 38px; height: 38px; border-radius: 11px; --depth: 2px; flex: none; }
.qotd-head b { font-size: 1rem; }
.qotd-head .tag { font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 6px; color: #fff; background: var(--c, var(--accent)); }
.qotd-head time { margin-inline-start: auto; font: 500 .78rem var(--font-mono); color: var(--fg-dim); }
.qotd h3 { font-size: 1.02rem; line-height: 1.45; margin-bottom: .72rem; }
.qotd .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .qotd .opts { grid-template-columns: 1fr; } }
.qotd .opts button { text-align: start; padding: .6rem .8rem; border: 1px solid var(--line-hi); border-radius: 8px; background: var(--bg); color: var(--fg); font: inherit; font-size: .92rem; cursor: pointer; }
.qotd .opts button:hover:not(:disabled) { border-color: var(--c, var(--accent)); }
.qotd .opts button:disabled { cursor: default; }
.qotd .opts button.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--bg-raised)); }
.qotd .opts button.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--bg-raised)); }
.qotd-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .72rem; }
.qotd-foot p { flex: 1 1 20rem; font-size: .88rem; color: var(--fg-muted); }
.daily { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; margin-top: 1.25rem; align-items: stretch; }
.daily > section { margin-top: 0; }
.daily .qotd .opts { grid-template-columns: 1fr; }
@media (max-width: 980px) { .daily { grid-template-columns: 1fr; } .daily .qotd .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .daily .qotd .opts { grid-template-columns: 1fr; } }
.eotd { padding: 1.2rem 1.4rem; border-radius: var(--radius); border: 1px solid var(--line-hi); background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 60%), var(--bg-raised); box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 10px 28px -18px rgba(15,30,54,.25); display: flex; flex-direction: column; }
.eotd-ini { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 .9rem var(--font-sans); color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 3px 8px -2px color-mix(in srgb, var(--c) 60%, transparent); flex: none; }
.eotd-nav { margin-inline-start: auto; display: flex; gap: .3rem; }
.eotd-nav button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.eotd-nav button:hover { color: var(--fg); border-color: var(--c); }
[dir="rtl"] .eotd-nav { flex-direction: row-reverse; }
.eotd h3 { font-size: 1.25rem; line-height: 1.25; margin-bottom: .1rem; }
.eotd-en { font-size: .85rem; font-weight: 500; color: var(--fg-dim); }
.eotd-years { font: 500 .78rem var(--font-mono); color: var(--fg-dim); margin-bottom: .72rem; text-align: start; unicode-bidi: isolate; }
[dir="rtl"] .eotd-years { text-align: right; }
.eotd-done { font-size: .93rem; line-height: 1.6; color: var(--fg); margin-bottom: .8rem; }
.eotd .label, .eotd-lesson .label { display: block; margin-bottom: .2rem; color: var(--ct, var(--c)); }
.eotd-lesson { display: flex; gap: .72rem; align-items: flex-start; padding: .8rem .9rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, var(--bg-raised)); border-inline-start: 3px solid var(--c); font-size: .9rem; line-height: 1.55; }
.eotd-lesson svg { width: 22px; height: 22px; flex: none; color: var(--ct, var(--c)); margin-top: .1rem; }
.eotd-today { align-self: flex-start; margin-top: .72rem; background: none; border: 0; padding: 0; color: var(--accent-hi); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }

.qcard { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); padding: 1.1rem 1.25rem; }
.qcard h3 { font-size: 1rem; margin-bottom: .72rem; display: flex; gap: .6rem; }
.qcard h3 i { font: 600 .8rem/1.6rem var(--font-mono); font-style: normal; min-width: 1.6rem; height: 1.6rem; text-align: center; border-radius: 50%; color: #fff; background: var(--c, var(--accent)); flex: none; }
.opts { display: grid; gap: .45rem; }
.opts label { display: flex; gap: .6rem; align-items: center; padding: .72rem .75rem; border: 1px solid var(--line-hi); border-radius: 8px; cursor: pointer; font-size: .9375rem; }
.opts label:hover { border-color: var(--c, var(--accent)); }
.opts input { accent-color: var(--c, var(--accent)); }
.opts label.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--bg-raised)); }
.opts label.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--bg-raised)); }
.explain { margin-top: .6rem; font-size: .875rem; color: var(--fg-muted); }
.score { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-radius: var(--radius); background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 30%, transparent); }
.score b { font: 600 1.6rem var(--font-mono); }
/* ---------- TEMPLATES ---------- */
.tpl-doc { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); padding: clamp(1.25rem, 3vw, 2rem); max-width: 52rem; box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 14px 30px -18px rgba(15,30,54,.25); }
.tpl-doc header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: start; border-bottom: 2px solid var(--fg); padding-bottom: .9rem; margin-bottom: 1rem; }
.tpl-doc h2 { font-size: var(--step-2); }
.tpl-doc h3 { font: 600 .78rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ct, var(--c, var(--accent-hi))); margin: 1.2rem 0 .4rem; }
.tpl-fields { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
@media (max-width: 600px) { .tpl-fields { grid-template-columns: 1fr; } }
.tpl-fields div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .5rem .72rem; min-height: 2.6rem; font-size: .85rem; color: var(--fg-muted); }
.tpl-fields div.wide { grid-column: 1 / -1; min-height: 4.5rem; }
.tpl-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
/* ---------- GLOSSARY ---------- */
.ktable.glo td:first-child { color: var(--fg); font-family: var(--font-sans); }
.ktable.glo td:nth-child(2) { font-size: 1rem; text-align: right; font-weight: 500; }
.ktable.glo td:nth-child(3) span { display: inline-block; font: 600 .72rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ct, var(--c)); }

.glo-tabs { display: flex; flex-wrap: wrap; gap: .3rem; padding: .3rem; border-radius: 12px; background: var(--bg-sunk); border: 1px solid var(--line); width: fit-content; max-width: 100%; margin-bottom: 1rem; }
.glo-tabs button { border: 0; background: none; padding: .5rem .9rem; border-radius: 9px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--fg-muted); cursor: pointer; }
.glo-tabs button[aria-selected="true"] { background: var(--bg-raised); color: var(--fg); box-shadow: 0 1px 3px rgba(15,30,54,.12); }
.glo-tabs .n { font: 600 .72rem var(--font-mono); opacity: .6; margin-inline-start: .2rem; }
.glo-bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.glo-bar .search { flex: 1 1 320px; margin: 0; }
.glo-dl { display: inline-flex; align-items: center; gap: .45rem; }
.glo-dl svg { width: 15px; height: 15px; }
.ktable.glo tr.has-def { cursor: pointer; }
/* FABLE H2: on phones both languages fit side by side; the discipline column is dropped (the filters above still show it) */
@media (max-width: 640px) {
  .ktable.glo { table-layout: fixed; }
  .ktable.glo th:nth-child(3), .ktable.glo td:nth-child(3) { display: none; }
  .ktable.glo th, .ktable.glo td { padding: .6rem .6rem; }
  .ktable.glo td:first-child { white-space: normal; overflow-wrap: anywhere; }
}
.ktable.glo tr.has-def:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--bg-raised)); }
.glo-plus { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-inline-end: .45rem; border-radius: 4px; background: color-mix(in srgb, var(--accent) 14%, transparent); vertical-align: -.15rem; position: relative; }
.glo-plus::before, .glo-plus::after { content: ""; position: absolute; width: 8px; height: 1.6px; background: var(--accent-hi); border-radius: 1px; }
.glo-plus::after { transform: rotate(90deg); transition: transform .15s; }
tr.open .glo-plus::after { transform: rotate(0); }
tr.glo-def td { background: color-mix(in srgb, var(--accent) 5%, var(--bg-raised)); padding: .8rem 1rem 1rem; }
tr.glo-def p { margin: 0 0 .35rem; font-size: .9rem; color: var(--fg); font-family: var(--font-sans); font-weight: 400; white-space: normal; }
tr.glo-def p[lang="ar"] { text-align: right; color: var(--fg-muted); }
.glo-go { background: none; border: 0; padding: 0; margin-top: .3rem; font: inherit; font-size: .85rem; font-weight: 600; color: var(--accent-hi); cursor: pointer; }
.abbr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; margin-top: .25rem; }
.abbr { border: 1px solid var(--line-hi); border-top: 3px solid var(--c); border-radius: var(--radius); background: var(--bg-raised); padding: .9rem 1rem; }
.abbr header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.abbr header b { font: 700 1.2rem var(--font-mono); color: var(--ct, var(--c)); }
.abbr .g { font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); text-align: end; }
.abbr h3 { font-size: .95rem; line-height: 1.3; }
.abbr .a { font-size: .95rem; font-weight: 600; color: var(--fg-muted); margin: .25rem 0 .4rem; text-align: right; }
.abbr p { font-size: .85rem; line-height: 1.5; color: var(--fg-muted); }
.slang-note { font-size: .88rem; color: var(--fg-muted); padding: .72rem .9rem; border-radius: 10px; background: color-mix(in srgb, var(--amber, #f59e0b) 10%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--amber, #f59e0b) 30%, transparent); margin-bottom: .8rem; }
.ktable.slang td { vertical-align: middle; }
.ktable.slang td:first-child { font-family: var(--font-sans); color: var(--fg); white-space: normal; text-align: right; }
.ktable.slang td.sl { font-size: 1.05rem; font-weight: 700; color: var(--accent-hi); text-align: right; }
.ktable.slang td:last-child { color: var(--fg-muted); font-size: .85rem; }
.rg { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font: 600 .72rem var(--font-sans); color: #fff; white-space: nowrap; }
.rg-egypt { background: var(--egypt); } .rg-gulf { background: var(--qatar, #8a1538); } .rg-common { background: var(--saudi); }
.fc-modes { display: inline-flex; gap: .3rem; padding: .25rem; border-radius: 10px; background: var(--bg-sunk); border: 1px solid var(--line); margin: .25rem 0 1rem; }
.fc-modes button { border: 0; background: none; padding: .4rem .9rem; border-radius: 8px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--fg-muted); cursor: pointer; }
.fc-modes button[aria-pressed="true"] { background: var(--bg-raised); color: var(--fg); box-shadow: 0 1px 3px rgba(15,30,54,.12); }
.fc-wrap { max-width: 560px; margin: 0 auto; display: grid; gap: 1rem; justify-items: center; }
.fc-card { position: relative; width: 100%; height: 240px; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1000px; }
.fc-face { position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem; text-align: center; padding: 1.5rem; border-radius: 18px; border: 1px solid var(--line-hi); background: var(--bg-raised); box-shadow: 0 18px 40px -22px rgba(15,30,54,.45); backface-visibility: hidden; transition: transform .45s; }
.fc-face b { font-size: 1.6rem; line-height: 1.25; color: var(--fg); }
.fc-face small { font-size: .9rem; color: var(--fg-muted); line-height: 1.5; }
.fc-k { font: 600 .72rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-hi); }
.fc-face.back { transform: rotateY(180deg); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg-raised)), var(--bg-raised)); }
.fc-card.flipped .front { transform: rotateY(-180deg); } .fc-card.flipped .back { transform: rotateY(0); }
@media (prefers-reduced-motion: reduce) { .fc-face { transition: none; } }
.fc-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
.fc-nav span { font: 600 .85rem var(--font-mono); color: var(--fg-muted); }
.fc-shuffle { margin: 0; }
.fc-q { text-align: center; display: grid; gap: .4rem; padding: 1.2rem; width: 100%; border-radius: 16px; border: 1px solid var(--line-hi); background: var(--bg-raised); }
.fc-q b { font-size: 1.5rem; }
.fc-opts { width: 100%; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .fc-opts { grid-template-columns: 1fr; } .fc-card { height: 220px; } }
.fc-opts button { padding: .75rem .9rem; border: 1px solid var(--line-hi); border-radius: 10px; background: var(--bg-raised); color: var(--fg); font: inherit; font-size: 1rem; cursor: pointer; text-align: right; }
.fc-opts button:hover:not(:disabled) { border-color: var(--accent); }
.fc-opts button.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--bg-raised)); }
.fc-opts button.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--bg-raised)); }
/* ---------- JOBS ---------- */
.jobs { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.jobs > * { min-width: 0; }
@media (max-width: 900px) { .jobs { grid-template-columns: 1fr; } }
.jobs aside { display: grid; gap: 1rem; }
.job-form .form-title { grid-column: 1 / -1; font-size: var(--step-1); }
.job { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); padding: 1rem 1.25rem; display: grid; gap: .35rem; margin-bottom: .75rem; box-shadow: 0 1px 2px rgba(15,30,54,.05); }
.job h3 { font-size: 1.05rem; }
.job .meta { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .82rem; color: var(--fg-muted); }
.job .meta .stage { color: #fff; background: var(--c); }
.job p { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.job .apply { font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.job .del { justify-self: start; background: none; border: 0; color: var(--fg-dim); font-size: .78rem; cursor: pointer; padding: 0; }
.job .del:hover { color: var(--bad); }
.boards { display: grid; gap: .6rem; }
/* ---------- WEEKLY TIP ---------- */
.weekly { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--egypt-gold) 40%, transparent); background: color-mix(in srgb, var(--egypt-gold) 8%, var(--bg-raised)); }
.weekly .ico { width: 44px; height: 44px; flex: none; --c: var(--egypt-gold); --depth: 3px; }
.weekly .label { color: var(--g-civil-text); display: block; margin-bottom: .15rem; }
.weekly p { font-size: .95rem; }

/* ---------- HEADER EXTRAS ---------- */
.more { position: relative; flex: none; }
/* FABLE M6: on phones the More menu opens full width inside the screen (8 px margin each side), under its button */
@media (max-width: 640px) { .more-menu { position: fixed; top: auto; inset-inline: 8px; min-width: 0; margin-top: 6px; max-height: 70vh; overflow-y: auto; } }
.more-btn { display: inline-flex; align-items: center; gap: .25rem; background: none; border: 0; color: var(--fg-muted); padding: .5rem .6rem; border-radius: 6px; font-weight: 500; font-size: .9375rem; cursor: pointer; }
.more-btn:hover, .more-btn[aria-expanded="true"], .more-btn.current { color: var(--fg); background: var(--bg-sunk); }
.more-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.more-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 210px; background: var(--bg-raised); border: 1px solid var(--line-hi); border-radius: 10px; padding: .35rem; box-shadow: 0 18px 40px -18px rgba(15,30,54,.45); display: grid; z-index: 90; }
.more-menu a { display: block; text-decoration: none; text-align: start; background: none; border: 0; padding: .6rem .75rem; border-radius: 7px; color: var(--fg); font-size: .9rem; cursor: pointer; }
.more-menu a:hover, .more-menu a[aria-current="page"] { background: var(--bg-sunk); color: var(--accent-hi); }
.icon-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; font: 700 .85rem var(--font-sans); }
.icon-btn:hover { color: var(--accent-hi); border-color: var(--accent-hi); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.i-sun { display: none; }
:root[data-mode="dark"] .i-sun { display: block; } :root[data-mode="dark"] .i-moon { display: none; }
@media (max-width: 1240px) { .sugg-txt, .about-txt { display: none; } .sugg-btn { padding: .4rem; } .about-pill { padding: .3rem; } }
.ar-note { background: color-mix(in srgb, var(--egypt-gold) 14%, var(--bg-raised)); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--fg-muted); }
.ar-note .wrap { padding-block: .45rem; }
/* ---------- HOME: 3×3 hub, counters, favourites ---------- */
.hub { grid-template-columns: repeat(3, 1fr) !important; }
@media (max-width: 1000px) { .hub { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 640px) { .hub { grid-template-columns: 1fr !important; } }
.hub-tile { padding: 1.3rem 1.4rem; gap: 1rem; }
.hub-tile .ico { width: 54px; height: 54px; }
.hub-tile h2 { font-size: 1.15rem; }
.hub-tile p { font-size: .86rem; line-height: 1.45; }
.counters { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (max-width: 900px) { .counters { grid-template-columns: repeat(3, 1fr); } }
.counters div { padding: .8rem 1rem; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); text-align: center; }
.counters b { display: block; font: 700 1.6rem/1.1 var(--font-mono); color: var(--fg); font-variant-numeric: tabular-nums; }
.counters span { font-size: .75rem; color: var(--fg-muted); }
.counters div:nth-child(1) b { color: var(--g-elec); } .counters div:nth-child(2) b { color: var(--g-gen); } .counters div:nth-child(3) b { color: var(--g-civil-text); }
.counters div:nth-child(4) b { color: var(--qatar); } .counters div:nth-child(5) b { color: var(--saudi); } .counters div:nth-child(6) b { color: var(--egypt); }
.card-wrap { position: relative; display: grid; }
.fav { position: absolute; top: .5rem; inset-inline-end: .5rem; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--line-hi); cursor: pointer; display: grid; place-items: center; }
.fav::before { content: ""; position: absolute; inset: -7px; } /* ACC-5: 44 px touch target */
.fav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav:hover { color: var(--egypt-gold); }
.fav[aria-pressed="true"] { color: var(--egypt-gold); }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.favs { margin-bottom: 1.25rem; }
.fav-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.fav-row button { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg); font-size: .85rem; font-weight: 500; cursor: pointer; }
.fav-row .ico { width: 26px; height: 26px; border-radius: 50%; --depth: 1px; }
/* ---------- SEASON ---------- */
.season-pill { position: relative; display: inline-flex; margin-top: .9rem; padding: .3rem .8rem; border-radius: 999px; background: rgba(253,230,138,.18); border: 1px solid rgba(253,230,138,.45); color: #fde68a; font-weight: 600; font-size: .85rem; }
.lanterns { position: absolute; top: 0; inset-inline-end: 18%; width: 140px; height: 120px; z-index: 0; }
.lantern { animation: sway 3.2s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
/* ---------- RTL ---------- */
[dir="rtl"] .arrow, [dir="rtl"] .back svg, [dir="rtl"] .hub-tile .arrow { transform: scaleX(-1); }
[dir="rtl"] .home-hero h1 { letter-spacing: 0; }
[dir="rtl"] .label, [dir="rtl"] .brand-tag { letter-spacing: .02em; }
[dir="rtl"] .w-bubble { direction: rtl; }
/* ---------- BLUEPRINT BACKGROUND ---------- */
body { background-color: var(--bg);
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px), linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; background-attachment: fixed; }

/* ---------- FIXES: header fit, RTL hero, mixed-language text ---------- */
.brand { flex: none; }
.brand-name { white-space: nowrap; }
@media (max-width: 1440px) { .brand-text { display: none; } }
.nav a { padding: .5rem .6rem; }
[dir="rtl"] .home-hero { padding-right: calc(clamp(64px, 20%, 220px) + 1.5rem); }
[dir="rtl"] .label, [dir="rtl"] .home-hero cite, [dir="rtl"] .brand-tag { font-family: var(--font-sans); text-transform: none; }
#r-fact, #weekly-text, .icon-card span, .lead, .article li, .article p, .note, .tip, .shelf-sec li, .msg-text, .job p { unicode-bidi: plaintext; }

@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 0; padding-block: .35rem 0; }
  .site-header .nav { order: 10; flex-basis: 100%; margin-inline-start: 0; margin-inline: -4px; padding-bottom: .35rem; }
  .brand { margin-inline-end: auto; }
  .sugg-panel { top: calc(env(safe-area-inset-top, 0px) + 104px); }
}

/* ---------- HERO v2: engineering drawing card ---------- */
.home-hero {
  background:
    radial-gradient(60% 90% at 8% 0%, rgba(56,189,248,.45) 0%, transparent 60%),
    radial-gradient(50% 80% at 85% 110%, rgba(138,21,56,.75) 0%, transparent 65%),
    radial-gradient(35% 60% at 55% 40%, rgba(192,147,0,.18) 0%, transparent 70%),
    linear-gradient(135deg, #071a33 0%, #0b2a55 45%, #0e2244 100%) !important;
  box-shadow: 0 30px 60px -30px rgba(7,26,51,.75), inset 0 1px 0 rgba(255,255,255,.12) !important;
  padding-bottom: clamp(4.5rem, 7vw, 5.5rem) !important;
  border: 1px solid rgba(255,255,255,.08);
}
.home-hero::before { mask-image: radial-gradient(ellipse 80% 90% at 30% 30%, #000 20%, transparent 75%) !important; background-size: 32px 32px !important; }
/* slimmer Qatar edge */
.home-hero::after { width: 58px !important; right: 0 !important; opacity: 1 !important; }
@media (max-width: 560px) { .home-hero::after { width: 36px !important; } .home-hero h1, .home-hero cite { padding-right: 24px; } } /* MOB-3: slimmer Qatar-flag edge on phones */
.qa-flag { width: 50px !important; }
[dir="rtl"] .home-hero { padding-right: calc(58px + 1.75rem) !important; }
.home-hero > *:not(.qa-flag):not(.tri-band):not(.hero-wave):not(.title-block):not(.lanterns) { padding-right: 70px; }
[dir="rtl"] .home-hero > *:not(.qa-flag):not(.tri-band):not(.hero-wave):not(.title-block):not(.lanterns) { padding-right: 0; }
/* label as glass pill */
.home-hero p.status { display: inline-flex !important; padding: .35rem .8rem .35rem .6rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); }
/* shimmering gold emphasis */
.home-hero h1 em { background: linear-gradient(100deg, #fcd34d 0%, #f59e0b 30%, #fff1b8 50%, #f59e0b 70%, #fcd34d 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important; text-shadow: none !important; animation: shimmer 6s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.home-hero.struck h1 em { animation: shimmer 6s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(252,211,77,.7)); }
.home-hero h1 { font-size: clamp(1.45rem, 1rem + 2vw, 2.4rem) !important; max-width: 30ch !important; }
/* three-phase waveform */
.hero-wave { position: absolute; left: 0; right: 58px; bottom: 6px; height: 74px; width: calc(100% - 58px); z-index: 0; opacity: .7; pointer-events: none;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 70%, transparent 100%); }
.hero-wave .ph { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ph0 { stroke: #f0628f; filter: drop-shadow(0 0 4px rgba(240,98,143,.8)); }
.ph1 { stroke: #34d399; filter: drop-shadow(0 0 4px rgba(52,211,153,.8)); }
.ph2 { stroke: #fbbf24; filter: drop-shadow(0 0 4px rgba(251,191,36,.8)); }
.wave-move { animation: wave-run 5s linear infinite; }
@keyframes wave-run { from { transform: translateX(0); } to { transform: translateX(-200px); } }
/* drawing title block */
.title-block { position: absolute; right: 78px; bottom: 16px; z-index: 1; display: grid; grid-template-columns: repeat(3, auto); border: 1px solid rgba(255,255,255,.35); background: rgba(7,26,51,.55); backdrop-filter: blur(4px);
  font-family: var(--font-mono); color: #fff; }
.title-block div { padding: .28rem .6rem; border-right: 1px solid rgba(255,255,255,.25); border-bottom: 1px solid rgba(255,255,255,.25); display: grid; }
.title-block div:nth-child(3) { border-right: 0; }
.title-block .tb-wide { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.title-block span { font-size: .72rem; letter-spacing: .14em; color: rgba(255,255,255,.6); }
.title-block b { font-size: .72rem; font-weight: 600; letter-spacing: .06em; }
[dir="rtl"] .title-block { right: auto; left: 18px; }
@media (max-width: 760px) { .title-block { display: none; } .home-hero > *:not(.qa-flag):not(.tri-band):not(.hero-wave):not(.title-block):not(.lanterns) { padding-right: 44px; } }
:root[data-mode="dark"] .home-hero::after { background: #fff; opacity: .9 !important; }
@media (prefers-reduced-motion: reduce) { .wave-move, .home-hero h1 em { animation: none; } }

.home-hero > .hero-wave, .home-hero > .title-block, .home-hero > .lanterns { position: absolute; }

.home-hero > p.status { padding: .35rem .8rem .35rem .6rem !important; max-width: calc(100% - 70px); }
@media (max-width: 760px) { .home-hero > p.status { max-width: calc(100% - 48px); } }
[dir="rtl"] .home-hero > p.status { max-width: 100%; }

/* ---------- SIDE RAILS v2: calm drawing-sheet frame ---------- */
@media (min-width: 1400px) { .rail { justify-content: center; gap: 1rem; } }
.zones { position: absolute; top: 0; bottom: 0; width: 18px; display: flex; flex-direction: column; border-inline: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.rail-left .zones { left: -14px; } .rail-right .zones { right: -14px; }
.zones span { flex: 1; display: grid; place-items: center; font: 600 .72rem var(--font-mono); color: color-mix(in srgb, var(--accent) 55%, var(--fg-dim)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.zones span:last-child { border-bottom: 0; }
.rail-card { margin-inline: 14px 0; }
.rail-right .rail-card { margin-inline: 0 14px; }
.rail-card > .label { display: block; color: var(--fg); font-weight: 600; margin-bottom: .75rem; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem .5rem; }
.quick-grid button { display: grid; justify-items: center; gap: .4rem; background: none; border: 0; padding: .25rem; cursor: pointer; color: var(--fg); font-size: .72rem; font-weight: 500; line-height: 1.25; text-align: center; border-radius: 10px; }
.quick-grid button:hover { background: var(--bg-sunk); }
.quick-grid .ico { width: 40px; height: 40px; border-radius: 12px; --depth: 3px; }
.quick-all { margin-top: .9rem; width: 100%; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; font-size: .8rem; font-weight: 600; color: var(--accent-hi); cursor: pointer; }
.quick-all:hover { border-color: var(--accent-hi); }
.clock b { font-size: clamp(1.4rem, 1.9vw, 2rem) !important; }
.fact p { min-height: 6em; }
.fact-nav { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .4rem; }
.fact-nav > button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg-muted); font-size: 1rem; line-height: 1; cursor: pointer; flex: none; }
.fact-nav > button:hover { color: var(--g-gen); border-color: var(--g-gen); }
.fact-dots { margin-top: 0 !important; justify-content: center; }
.fact-dots button { width: 7px; height: 7px; padding: 0; border-radius: 50%; border: 0; background: var(--line-hi); cursor: pointer; }
.fact-dots button.on { background: var(--g-gen); }

.fact-dots { gap: 3px !important; flex-wrap: nowrap !important; }
.fact-dots button { width: 5px !important; height: 5px !important; flex: none; }
.quick-all { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #34d399; margin-inline-end: .4rem; box-shadow: 0 0 0 3px rgba(52,211,153,.25); vertical-align: 1px; }

/* ---------- LATEST JOBS RAIL ---------- */
.jr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.jr-head .label { color: var(--fg); font-weight: 600; margin: 0 !important; }
.jr-li { width: 20px; height: 20px; border-radius: 4px; background: #0a66c2; color: #fff; font: 700 .72rem/20px var(--font-sans); text-align: center; }
.jr-loc { width: 100%; padding: .45rem .72rem; border-radius: 7px; border: 1px solid var(--line-hi); background: var(--bg-sunk); color: var(--fg); font-size: .8rem; margin-bottom: .6rem; }
.jr-list { list-style: none; margin: 0; padding: 0; display: grid; }
.jr-list a { display: grid; grid-template-columns: 8px 1fr 14px; gap: .5rem; align-items: center; padding: .48rem .25rem; border-top: 1px solid var(--line); color: var(--fg); font-size: .8rem; font-weight: 500; text-decoration: none; }
.jr-list li:first-child a { border-top: 0; }
.jr-list a i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.jr-list a svg { width: 13px; height: 13px; fill: none; stroke: var(--fg-dim); stroke-width: 1.8; }
.jr-list a:hover { color: #0a66c2; }
.jr-list a:hover svg { stroke: #0a66c2; }
:root[data-mode="dark"] .jr-list a:hover, :root[data-mode="dark"] .jr-list a:hover svg { color: #70b5f9; stroke: #70b5f9; }
.jr-note { font-size: .72rem; color: var(--fg-dim); margin-top: .4rem; line-height: 1.35; }
.jr-sub { display: block; font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ok); margin-bottom: .3rem; }
#jr-member { display: grid; gap: .35rem; margin-bottom: .5rem; }
#jr-member:empty { display: none; }
.jr-post { text-align: start; display: grid; gap: .05rem; background: color-mix(in srgb, var(--ok) 8%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); border-radius: 8px; padding: .45rem .72rem; cursor: pointer; color: var(--fg); }
.jr-post b { font-size: .78rem; } .jr-post span { font-size: .72rem; color: var(--fg-muted); }

.jr-post { text-decoration: none; }
a.jr-post:hover { border-color: var(--ok); }
.jr-post small { font-size: .72rem; color: var(--fg-dim); }
.jr-sub.li { color: #0a66c2; margin-top: .3rem; }
:root[data-mode="dark"] .jr-sub.li { color: #70b5f9; }

.rail-card.jobs-rail { max-height: 100%; overflow-y: auto; scrollbar-width: thin; padding: .85rem; }
.jobs-rail .jr-post { padding: .38rem .5rem; gap: 0; min-width: 0; }
.jobs-rail .jr-post b, .jobs-rail .jr-post span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.jobs-rail .jr-post b { font-size: .76rem; } .jobs-rail .jr-post span { font-size: .72rem; }
.jobs-rail .jr-list a { padding: .34rem .2rem; font-size: .76rem; }
.jobs-rail .jr-loc { margin-bottom: .5rem; padding: .35rem .5rem; }
.jobs-rail .quick-all { margin-top: .5rem; padding: .4rem; }

/* side panels on medium-wide windows: narrow the centre column to make room */
@media (min-width: 1100px) and (max-width: 1459px) {
  :root { --wrap: calc(100vw - 330px); }
  .rail { width: 148px !important; }
}
@media (min-width: 1100px) and (max-width: 1300px) {
  .counters b { font-size: 1.3rem; }
  .hub-tile { padding: 1.1rem; gap: .75rem; }
  .hub-tile .ico { width: 46px; height: 46px; }
  .hub-tile h2 { font-size: 1.02rem; }
  .title-block { display: none; }
}

.fact-nav { min-width: 0; }
.fact-dots { min-width: 0; overflow: hidden; flex: 1; }
@media (max-width: 1459px) { .fact-dots { display: none !important; } .fact-nav { justify-content: center; gap: 1rem; } }
@media (max-width: 1340px) { .sugg-txt, .about-txt { display: none; } .sugg-btn { padding: .4rem; } .about-pill { padding: .3rem; } }

/* ---------- EARNINGS ---------- */
.buy { flex: none; font: 600 .72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ct, var(--c, var(--accent-hi))); border: 1px solid currentColor; border-radius: 999px; padding: .2rem .72rem; }
.aff-note { margin-top: 1rem; font-style: italic; }
.pro-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--egypt-gold) 40%, transparent); background: linear-gradient(110deg, color-mix(in srgb, var(--egypt-gold) 12%, var(--bg-raised)), var(--bg-raised)); }
.pro-banner .ico { width: 46px; height: 46px; --depth: 3px; }
.pro-banner b { font-size: 1.05rem; }
.pro-banner p { color: var(--fg-muted); font-size: .9rem; }
@media (max-width: 640px) { .pro-banner { grid-template-columns: auto 1fr; } .pro-banner .pro-btn { grid-column: 1 / -1; justify-content: center; } }
.pro-btn { background: var(--egypt-gold) !important; white-space: nowrap; }
.pro-btn:hover { filter: brightness(1.08); text-decoration: none; }
.is-soon { opacity: .6; cursor: default; pointer-events: none; }
.support { color: var(--fg-muted); font-weight: 500; }

/* ---------- SITE SEARCH ---------- */
.gs-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(7,17,33,.55); backdrop-filter: blur(4px); display: grid; justify-items: center; align-items: start;
  padding: calc(env(safe-area-inset-top, 0px) + 9vh) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.gs-box { width: min(640px, 100%); background: var(--bg-raised); border: 1px solid var(--line-hi); border-radius: 16px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); overflow: hidden; }
.gs-input { display: flex; align-items: center; gap: .72rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.gs-input svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--fg-dim); stroke-width: 2; stroke-linecap: round; }
.gs-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 1.05rem; }
.gs-input kbd { font: .72rem var(--font-mono); color: var(--fg-dim); border: 1px solid var(--line-hi); border-radius: 5px; padding: .15rem .4rem; }
.gs-results { max-height: min(60vh, 520px); overflow-y: auto; padding: .4rem; }
.gs-item { display: grid; grid-template-columns: 36px 1fr auto; gap: .75rem; align-items: center; width: 100%; text-align: start; padding: .72rem .72rem; border: 0; border-radius: 10px; background: none; color: var(--fg); cursor: pointer; }
.gs-item.on, .gs-item:hover { background: var(--bg-sunk); }
.gs-item .ico { width: 36px; height: 36px; border-radius: 10px; --depth: 2px; }
.gs-t { min-width: 0; display: grid; }
.gs-t b { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-t small { font-size: .78rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.gs-k { font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); white-space: nowrap; }
.gs-hint { padding: 1rem; color: var(--fg-muted); font-size: .9rem; }
#search-btn svg { fill: none; }
/* ---------- SHARE ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 1.25rem; }
.share .label { margin-inline-end: .25rem; }
.sh { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg); font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.sh svg { width: 15px; height: 15px; fill: currentColor; }
.sh.cp svg { fill: none; }
.sh.li:hover { border-color: #0a66c2; color: #0a66c2; text-decoration: none; }
.sh.wa:hover { border-color: #25d366; color: #128c4a; text-decoration: none; }
.sh.cp:hover { border-color: var(--accent-hi); color: var(--accent-hi); }
#tool-share .share { margin: -.75rem 0 1.25rem; }
.results .copy-res { display: inline-flex; }


/* ---- home: start block, primary cards, more ---- */
.sec-h { font-size: 1.15rem; font-weight: 700; margin: 0 0 .8rem; color: var(--fg); }
.start { margin: 1.5rem 0 1.75rem; }
.start-search { width: 100%; display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-radius: 14px; border: 1.5px solid var(--line-hi); background: var(--bg-raised); color: var(--fg-muted); font: inherit; font-size: 1.02rem; cursor: text; text-align: start; box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 12px 30px -20px rgba(15,30,54,.35); margin-bottom: 1.5rem; }
.start-search:hover, .start-search:focus-visible { border-color: var(--accent); }
.start-search svg { width: 22px; height: 22px; color: var(--accent-hi); flex: none; }
.start-search span { flex: 1; }
.start-search kbd { font: 600 .75rem var(--font-mono); padding: .2rem .45rem; border-radius: 6px; border: 1px solid var(--line-hi); color: var(--fg-muted); background: var(--bg-sunk); }
@media (max-width: 600px) { .start-search kbd { display: none; } }
.intents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 980px) { .intents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .intents { grid-template-columns: 1fr; } }
.intent { display: flex; align-items: center; gap: .75rem; min-height: 76px; padding: .8rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg); font: inherit; text-align: start; cursor: pointer; }
.intent:hover { border-color: var(--c); }
.intent .ico { width: 40px; height: 40px; border-radius: 11px; --depth: 2px; flex: none; }
.intent b { display: block; font-size: .95rem; line-height: 1.3; }
.intent small { display: block; font-size: .8rem; line-height: 1.4; color: var(--fg-muted); margin-top: .1rem; }
.hub.hub-main { grid-template-columns: repeat(2, 1fr) !important; gap: 1.25rem; }
.hub-tile.big { padding: 1.6rem 1.7rem; min-height: 132px; }
.hub-tile.big .ico { width: 64px; height: 64px; }
.hub-tile.big h2 { font-size: 1.45rem; }
.hub-tile.big p { font-size: .95rem; }
.home-more { margin-top: 2rem; }
.hub.hub-more { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: .75rem; }
.hub-tile.small { padding: .9rem 1rem; gap: .75rem; min-height: 88px; grid-template-columns: auto 1fr; }
.hub-tile.small .ico { width: 42px; height: 42px; border-radius: 12px; }
.hub-tile.small h2 { font-size: 1rem; }
.hub-tile.small p { font-size: .82rem; line-height: 1.4; }
.hub-tile.small .arrow { display: none; }
.home-more .tools-row { margin-top: .75rem; }
.counters.compact { margin: 1.5rem 0 1.25rem; }
.counters.compact div { padding: .6rem .8rem; background: transparent; border-style: dashed; }
.counters.compact b { font-size: 1.25rem; }
.counters.compact span { font-size: .78rem; }
@media (max-width: 980px) { .hub.hub-more { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 640px) { .hub.hub-main { grid-template-columns: 1fr !important; } .hub.hub-more { grid-template-columns: 1fr !important; } .hub-tile.big { min-height: 0; padding: 1.2rem; } }

.trust-note { display: flex; gap: .55rem; align-items: flex-start; margin: .9rem 0 0; padding: .65rem .85rem; border-radius: 10px; font-size: .88rem; line-height: 1.5; color: var(--fg); background: color-mix(in srgb, var(--warn) 8%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent); max-width: 60rem; }
.page-head .trust-note { font-size: .9rem; color: var(--fg); }
.trust-note svg { width: 17px; height: 17px; flex: none; color: var(--warn); margin-top: .12rem; }
.chat-panel .trust-note { margin: .75rem .9rem 0; }
.qa-k { color: var(--accent-hi); }
.qa-foot { display: block; margin-top: .7rem; padding-top: .55rem; border-top: 1px dashed var(--line-hi); font-size: .8rem; color: var(--fg-muted); }
.jr-safe { margin-top: .4rem; }

/* ---- design pass: type scale, card rhythm, contrast ---- */
.page-head h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); line-height: 1.15; }
.page-head p { font-size: 1.06rem; line-height: 1.6; max-width: 62ch; color: var(--fg-muted); }
.label { color: var(--fg-muted); }
.article p, .article li { max-width: 72ch; }
.icon-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); align-items: stretch; }
.icon-card { grid-template-rows: auto auto 1fr; align-content: start; min-height: 168px; padding: 1.25rem .9rem 1.1rem; gap: .6rem; }
.icon-card .ico { width: 52px; height: 52px; }
.icon-card b { font-size: .95rem; }
.icon-card span { font-size: .82rem; color: var(--fg-muted); }
.hub-tile p, .intent small, .next-card small { color: var(--fg-muted); }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  .icon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .icon-card { min-height: 150px; }
  .chip, .glo-tabs button, .fc-modes button { min-height: 40px; }
  .page-head { margin-bottom: 1.4rem; }
}
[dir="rtl"] .label { letter-spacing: 0; font-family: var(--font-sans); font-size: .8rem; }
[dir="rtl"] .hub-tile, [dir="rtl"] .intent, [dir="rtl"] .next-card { text-align: right; }
[dir="rtl"] .hub-tile .arrow { transform: scaleX(-1); }

/* ---- Excel sheets + use-with ---- */
.sheets-sec { margin: .5rem 0 0; }
.sheet-grid, .use-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: .9rem; }
.sheet-card { display: flex; flex-direction: column; gap: .65rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line-hi); border-top: 3px solid var(--c); background: var(--bg-raised); box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 10px 24px -18px rgba(15,30,54,.25); }
.sheet-card header { display: flex; gap: .75rem; align-items: center; }
.sheet-card .ico { width: 44px; height: 44px; border-radius: 12px; --depth: 2px; flex: none; }
.sheet-card h3 { font-size: 1rem; line-height: 1.3; }
.sheet-card p { font-size: .88rem; color: var(--fg-muted); line-height: 1.5; }
.tier { display: inline-block; font: 700 .72rem var(--font-sans); padding: .1rem .5rem; border-radius: 999px; margin-bottom: .2rem; }
.tier.free { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tier.pro { color: #8a6500; background: color-mix(in srgb, var(--egypt-gold) 18%, transparent); }
.sheet-meta { font-size: .78rem; color: var(--fg-dim); margin: .5rem 0 .75rem; }
.tabs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.tabs-list li { font-size: .75rem; padding: .15rem .5rem; border-radius: 6px; background: var(--bg-sunk); border: 1px solid var(--line); color: var(--fg-muted); }
.sheet-card .btn { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; }
.sheet-card .btn svg { width: 15px; height: 15px; }
.use-with { margin-top: 2rem; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) .label { letter-spacing: 0; } /* FABLE M9 */
:lang(ar) .readout small, :lang(ar) .readout .label, :lang(ar) .res-head .label { letter-spacing: 0; font-family: var(--font-sans); }
#view-tool #tool-share { margin-top: 1.25rem; }
.tool-peek { display: none; }
@media (max-width: 760px) {
  .tool-peek:not([hidden]) { display: flex; position: fixed; inset-inline: 10px; bottom: 10px; z-index: 40; align-items: center; gap: .6rem; padding: .6rem .85rem; border-radius: 12px; background: var(--bg-elev, var(--bg)); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.18); color: var(--fg); text-decoration: none; font-size: .85rem; }
  .tool-peek span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); }
  .tool-peek b { font-size: 1.05rem; white-space: nowrap; }
  .tool-peek i { font-style: normal; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 99px; }
  .tool-peek .pk-ok { background: color-mix(in srgb, #1a9b55 18%, transparent); color: #1a7a45; }
  .tool-peek .pk-warn { background: color-mix(in srgb, #d08a00 20%, transparent); color: #8a5c00; }
  .tool-peek .pk-bad { background: color-mix(in srgb, #d13b3b 18%, transparent); color: #a52424; }
}
@media print { .tool-peek { display: none !important; } }
.calc-about { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 72ch; color: var(--fg-muted); }
.calc-about h2 { font-size: 1.1rem; color: var(--fg); margin-bottom: .5rem; }
.calc-about p { margin: 0 0 .6rem; }
.load-note { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 90; padding: .75rem 1rem; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line-hi); box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: .9rem; }
.use-grid { align-items: start; }
.article ul.tabs-list { display: flex !important; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.article .tabs-list li, [dir="rtl"] .article .tabs-list li { display: inline-block; margin: 0; padding: .15rem .5rem; list-style: none; width: auto; }
.article .tabs-list li::before { content: none; display: none; }
.article .sheet-card p { margin: 0; }
.use-with h2 { font-size: 1.15rem; }
/* ---- calculator: grouped inputs, status, basis ---- */
.inputs { display: block; }
.fset { border: 0; margin: 0 0 1.1rem; padding: 0; }
.fset:last-child { margin-bottom: 0; }
.fset legend { font: 600 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: .7rem; padding: 0; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
@media (max-width: 520px) { .fgrid { grid-template-columns: 1fr; } }
.field label { font-size: .875rem; color: var(--fg); font-weight: 600; }
.unit span { color: var(--fg-muted); font-size: .8rem; }
[dir="rtl"] .unit input { padding-right: .75rem; padding-left: 3.6rem; }
[dir="rtl"] .unit span { right: auto; left: .75rem; }
.fmsg { min-height: 0; font-size: .78rem; line-height: 1.35; }
.fmsg:empty { display: none; }
.fmsg.err { color: var(--bad); } .fmsg.warn { color: var(--warn); }
.field input.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--bg-sunk)); }
.field input.warnf { border-color: var(--warn); }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.prelim { font-size: .75rem; font-weight: 600; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: .2rem .55rem; border-radius: 999px; }
.status { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 10px; border: 1px solid; font-size: .9rem; line-height: 1.45; }
.status svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.status b { display: block; font-size: .92rem; }
.status ul { margin: .3rem 0 0; padding-inline-start: 1.1rem; font-size: .85rem; }
.status.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--bg-raised)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.status.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--bg-raised)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.status.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--bg-raised)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.status span, .status li { color: var(--fg); }
.verify-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 600; color: var(--accent-hi); text-decoration: none; }
.verify-link svg { width: 16px; height: 16px; }
.res-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.res-actions .copy-res + .copy-res { margin-inline-start: 0; }
.tool-basis { margin-top: 1.5rem; display: grid; gap: 1.25rem; }
.verify-box { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--bg-raised)); border-radius: var(--radius); padding: 1rem 1.2rem; scroll-margin-top: 90px; }
.verify-box h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin-bottom: .5rem; color: var(--fg); }
.verify-box h2 svg { width: 20px; height: 20px; color: var(--warn); }
.verify-box ul { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .3rem; font-size: .92rem; line-height: 1.5; }
.basis { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); }
.basis > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 1.05rem; }
.basis > summary::-webkit-details-marker { display: none; }
.basis > summary::before { content: "▸"; color: var(--ct, var(--c, var(--accent))); margin-inline-end: .5rem; transition: transform .15s; display: inline-block; }
.basis[open] > summary::before { transform: rotate(90deg); }
.basis > summary span { flex: 1; }
.basis > summary small { font-size: .78rem; font-weight: 500; color: var(--fg-muted); }
.basis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
@media (max-width: 760px) { .basis-grid { grid-template-columns: 1fr; } }
.bcard { background: var(--bg-raised); padding: 1rem 1.2rem; }
.bcard.wide { grid-column: 1 / -1; }
.bcard h3 { font: 600 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ct, var(--c, var(--accent-hi))); margin-bottom: .55rem; }
[dir="rtl"] .bcard h3, [dir="rtl"] .fset legend { font-family: var(--font-sans); letter-spacing: 0; font-size: .85rem; }
.bcard ul { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: .3rem; font-size: .9rem; line-height: 1.5; }
.bcard ul.std li { font-family: var(--font-mono); font-size: .82rem; }
.btab { width: 100%; border-collapse: collapse; font-size: .85rem; }
.btab td { padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.btab td:nth-child(2), .btab td:nth-child(3) { font-family: var(--font-mono); color: var(--fg-muted); white-space: nowrap; }
.btab-note { font-size: .75rem; color: var(--fg-muted); margin-top: .35rem; }
.ex { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 640px) { .ex { grid-template-columns: 1fr; } }
.ex ul { list-style: none; padding: 0; }
.ex li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.ex li span { color: var(--fg-muted); }
.ex li b { font: 500 .85rem var(--font-mono); text-align: end; }
.ex-res { display: grid; gap: .2rem; padding: .9rem 1rem; border-radius: 10px; background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--bg-sunk)); }
.ex-res span { font-size: .82rem; color: var(--fg-muted); }
.ex-res b { font: 600 1.5rem var(--font-mono); color: var(--fg); }
.ex-res small { font-size: .82rem; color: var(--fg-muted); }
.next-steps h2 { font-size: 1.05rem; margin-bottom: .6rem; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
a.next-card { text-decoration: none; }
.more-calcs { margin-top: 1.25rem; }
.next-card { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--bg-raised); color: var(--fg); text-align: start; cursor: pointer; font: inherit; min-height: 64px; }
.next-card:hover { border-color: var(--c, var(--accent)); }
.next-card .ico { width: 38px; height: 38px; border-radius: 11px; --depth: 2px; flex: none; }
.next-card small { display: block; font-size: .75rem; color: var(--fg-muted); }
.next-card b { font-size: .92rem; line-height: 1.3; }
.results .copy-res + .copy-res { margin-inline-start: .5rem; }
/* ---------- REPORT ---------- */
.rep-overlay { position: fixed; inset: 0; z-index: 130; background: rgba(7,17,33,.6); backdrop-filter: blur(4px); overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 2rem) max(16px, env(safe-area-inset-right, 0px)) 2rem max(16px, env(safe-area-inset-left, 0px)); }
.rep-wrap { max-width: 820px; margin: 0 auto; display: grid; gap: .75rem; }
.rep-bar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; color: #fff; }
.rep-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.rep-bar .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.rep-sheet { background: #fff; color: #0f1e36; border-radius: 6px; padding: clamp(1.25rem, 4vw, 2.5rem); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); font-size: .9rem; }
.rs-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: start; border-bottom: 3px solid #0f1e36; padding-bottom: .9rem; }
.rs-brand { display: flex; gap: .75rem; align-items: center; }
.rs-brand svg { width: 42px; height: 42px; }
.rs-brand b { display: block; font-size: 1.25rem; letter-spacing: -.01em; }
.rs-brand span { color: #4d5d78; }
.rs-ref { display: grid; grid-template-columns: 1fr 70px; border: 1px solid #c6d3e4; min-width: 240px; }
.rs-ref .rf { border-right: 1px solid #c6d3e4; } .rs-ref .rf:last-child { border-right: 0; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #c6d3e4; border-top: 0; margin-bottom: 1rem; }
@media (max-width: 600px) { .rs-grid { grid-template-columns: 1fr; } }
.rf { display: grid; gap: .1rem; padding: .4rem .6rem; border-bottom: 1px solid #dde5f0; border-right: 1px solid #dde5f0; }
.rf span { font: 600 .6rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #7a879c; }
.rf input { border: 0; outline: 0; background: transparent; font: 500 .9rem var(--font-sans); color: #0f1e36; padding: 0; min-width: 0; }
.rf input:focus { background: #eef3f9; }
.rep-sheet h3 { font: 600 .72rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ct, var(--c, #0369a1)); margin: 1.1rem 0 .4rem; }
.rs-table { width: 100%; border-collapse: collapse; }
.rs-table td { border: 1px solid #dde5f0; padding: .4rem .6rem; }
.rs-table td:last-child { font-family: var(--font-mono); font-weight: 600; text-align: end; width: 40%; }
.rs-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; padding: .72rem .8rem; background: #eef3f9; border-left: 4px solid var(--c, #0284c7); margin-bottom: .5rem; }
.rs-main b { font: 700 1.5rem var(--font-mono); }
.rs-main small { color: #4d5d78; }
.rs-verdict { font-weight: 600; margin: .3rem 0 .6rem; } .rs-verdict.ok { color: #047857; } .rs-verdict.bad { color: #dc2626; }
.rs-formula { font-family: var(--font-mono); background: #f3f6fb; padding: .5rem .72rem; border: 1px dashed #c6d3e4; }
.rs-note { color: #4d5d78; font-size: .82rem; margin-top: .4rem; }
.rs-remarks { width: 100%; border: 1px solid #dde5f0; padding: .5rem; font: .88rem var(--font-sans); color: #0f1e36; background: #fff; resize: vertical; }
.rs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1.25rem; padding-top: .6rem; border-top: 1px solid #c6d3e4; font-size: .72rem; color: #7a879c; }
body.rep-open { overflow: hidden; }
@media print {
  @page { size: A4; margin: 14mm; }
  body.rep-open > *:not(.rep-overlay) { display: none !important; }
  body.rep-open { background: #fff !important; }
  .rep-overlay { position: static; background: none; padding: 0; backdrop-filter: none; overflow: visible; }
  .rep-bar { display: none !important; }
  .rep-sheet { box-shadow: none; border-radius: 0; padding: 0; }
  .rf input:focus { background: transparent; }
  .rep-wrap { max-width: none; display: block; }
  .rep-sheet { font-size: 10pt; }
  .rep-sheet h3 { margin: .72rem 0 .3rem; }
  .rs-table td { padding: .28rem .5rem; }
  .rs-remarks { resize: none; min-height: 2.6rem; }
  .rs-foot, .rs-main, .rs-table tr { break-inside: avoid; }
  .rs-foot { display: block; margin-top: .6rem; padding-top: .35rem; font-size: 7.5pt; }
  .rs-foot span { display: inline; } .rs-foot span + span::before { content: " · "; }
  .rs-remarks { min-height: 2rem; height: 2.2rem; }
  .rs-head { padding-bottom: .5rem; } .rs-grid { margin-bottom: .6rem; } .rf { padding: .25rem .5rem; }
}

/* ---------- CHECKLISTS ---------- */
.cl-progress { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.25rem; }
.cl-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--bg-sunk); border: 1px solid var(--line); overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: var(--c, var(--accent)); transition: width .3s ease; }
.cl-progress b { font: 600 1rem var(--font-mono); min-width: 4.5ch; text-align: end; }
.cl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cl-list label { display: grid; grid-template-columns: 22px 1fr; gap: .75rem; align-items: start; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); cursor: pointer; }
.cl-list input { width: 20px; height: 20px; margin: 0; accent-color: var(--c, var(--accent)); }
.cl-list label:has(input:checked) { background: color-mix(in srgb, var(--ok) 7%, var(--bg-raised)); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.cl-list label:has(input:checked) span { color: var(--fg-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--fg-dim) 60%, transparent); }
.cl-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
/* ---------- REFERENCE ---------- */
.ref-sec { margin-bottom: 2rem; }
.ref-sec h2 { font-size: var(--step-2); margin-bottom: .3rem; }
.ref-sec > p { color: var(--fg-muted); margin-bottom: .8rem; max-width: 60ch; }
.ktable.ref td:first-child { white-space: nowrap; }
.ktable.ref td { font-variant-numeric: tabular-nums; }
.ktable.ref td:not(:first-child) { font-family: var(--font-mono); }

.ref-tools { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; }
.ref-tools .filters { margin: 0; }
.ref-search { margin: 0; flex: 0 1 300px; }
.chip .n { font: 600 .72rem var(--font-mono); opacity: .65; margin-inline-start: .25rem; }
.ref-jump { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin: 1rem 0 1.25rem; }
.ref-jump .label { margin-inline-end: .25rem; }
.ref-jump a { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .72rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg-muted); font-size: .8rem; text-decoration: none; }
.ref-jump a:hover { color: var(--fg); border-color: var(--c); }
.ref-jump a i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .ref-grid { grid-template-columns: 1fr; } }
.ref-card { grid-column: span 1; border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; box-shadow: 0 1px 2px rgba(15,30,54,.05), 0 12px 30px -20px rgba(15,30,54,.3); scroll-margin-top: 90px; }
.ref-card.wide { grid-column: 1 / -1; }
.ref-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, var(--bg-raised)), var(--bg-raised) 70%); border-top: 3px solid var(--c); }
.ref-head .ico { width: 38px; height: 38px; border-radius: 11px; --depth: 2px; flex: none; }
.ref-head > div { flex: 1; min-width: 0; }
.ref-head h2 { font-size: 1.08rem; line-height: 1.25; }
.ref-grp { font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ct, var(--c)); }
.ref-count { font: 500 .72rem var(--font-mono); color: var(--fg-dim); white-space: nowrap; }
.ref-copy { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border-radius: 8px; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg-muted); font-size: .78rem; font-weight: 600; cursor: pointer; }
.ref-copy:hover { color: var(--fg); border-color: var(--c); }
.ref-copy svg { width: 14px; height: 14px; }
.ref-scroll { overflow: auto; max-height: min(72vh, 680px); }
.rtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.rtable th { position: sticky; top: 0; z-index: 1; text-align: start; padding: .6rem .9rem; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: var(--fg); background: color-mix(in srgb, var(--c) 9%, var(--bg-raised)); border-bottom: 2px solid color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; }
.rtable td { padding: .72rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rtable tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--fg) 2.5%, var(--bg-raised)); }
.rtable tbody tr:hover td { background: color-mix(in srgb, var(--c) 8%, var(--bg-raised)); }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable td:first-child { font-weight: 700; color: var(--fg); white-space: nowrap; position: sticky; inset-inline-start: 0; background-clip: padding-box; }
.rtable td:first-child, .rtable th:first-child { border-inline-end: 1px solid var(--line); }
.rtable tbody tr td:first-child { background-color: var(--bg-raised); }
.rtable tbody tr:nth-child(even) td:first-child { background-color: color-mix(in srgb, var(--fg) 2.5%, var(--bg-raised)); }
.rtable td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .86rem; white-space: nowrap; }
.rtable td:first-child.num { color: var(--ct, var(--c)); }
.rtable .sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-inline-end: .45rem; vertical-align: -.1rem; border: 1px solid rgba(15,30,54,.25); }
.ref-note { display: flex; gap: .5rem; align-items: flex-start; margin: 0; padding: .75rem 1.1rem; font-size: .8rem; line-height: 1.5; color: var(--fg-muted); border-top: 1px solid var(--line); background: var(--bg-sunk); }
.ref-note svg { width: 15px; height: 15px; flex: none; margin-top: .1rem; color: var(--ct, var(--c)); }
@media (max-width: 600px) { .ref-head { flex-wrap: wrap; } .ref-count { display: none; } .rtable { font-size: .85rem; } .ref-jump { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; } .ref-jump a { white-space: nowrap; } .ref-search { flex-basis: 100%; } }
@media print { .ref-tools, .ref-jump, .ref-copy { display: none !important; } .ref-grid { display: block; } .ref-card { break-inside: avoid; margin-bottom: 1rem; box-shadow: none; } .ref-scroll { max-height: none; overflow: visible; } }
/* ---------- SYMBOLS ---------- */
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.sym { display: grid; justify-items: center; gap: .45rem; text-align: center; padding: 1rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.sym svg { width: 64px; height: 64px; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sym svg .f { fill: var(--fg); stroke: none; }
.sym svg text { fill: var(--fg); stroke: none; font: 700 13px var(--font-sans); }
.sym b { font-size: .85rem; line-height: 1.25; }
.sym span { font-size: .85rem; color: var(--fg-muted); }
.sym { position: relative; cursor: help; transition: border-color .15s, box-shadow .15s, transform .15s; outline: none; }
.sym:hover, .sym:focus { border-color: var(--c, var(--accent)); box-shadow: 0 6px 18px rgba(15,30,54,.10); transform: translateY(-2px); z-index: 30; }
.sym:hover svg, .sym:focus svg { stroke: var(--c, var(--accent)); }
.sym:hover svg .f, .sym:focus svg .f, .sym:hover svg text, .sym:focus svg text { fill: var(--c, var(--accent)); }
.sym-tip { position: absolute; left: 50%; bottom: calc(100% + 10px); width: 250px; transform: translate(-50%, 6px); background: var(--fg); color: var(--bg-raised); border-radius: 10px; padding: .72rem .85rem; font-size: .8rem; line-height: 1.5; text-align: start; box-shadow: 0 10px 28px rgba(15,30,54,.25); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 40; }
.sym-tip strong { display: block; font-size: .82rem; margin-bottom: .2rem; color: inherit; }
.sym-tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--fg); }
.sym-tip.below { bottom: auto; top: calc(100% + 10px); transform: translate(-50%, -6px); }
.sym-tip.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--fg); }
.sym-tip.al-l { left: 0; transform: translate(0, 6px); } .sym-tip.al-l::after { left: 40px; }
.sym-tip.al-r { left: auto; right: 0; transform: translate(0, 6px); } .sym-tip.al-r::after { left: auto; right: 34px; }
.sym-tip.below.al-l, .sym-tip.below.al-r { transform: translate(0, -6px); }
.sym:hover .sym-tip, .sym:focus .sym-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.sym:not(:hover):not(:focus) .sym-tip { display: none; } /* MOB-2: hidden tips no longer widen the page on phones */
#view-symbols { overflow-x: clip; }
.sym:hover .sym-tip.al-l, .sym:focus .sym-tip.al-l, .sym:hover .sym-tip.al-r, .sym:focus .sym-tip.al-r { transform: none; }
.sym-hint { display: flex; align-items: center; gap: .5rem; color: var(--fg-muted); font-size: .9rem; margin: 0 0 1.2rem; }
.sym-hint svg { width: 16px; height: 16px; flex: none; color: var(--accent-hi); }
/* ---------- MORE TOOLS ROW ---------- */
/* LEAD-1 */
.hb-card { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem 1.1rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--line-hi); border-radius: 14px; background: var(--bg-raised); margin: 1.25rem 0; }
.hb-ico svg { width: 42px; height: 42px; fill: none; stroke: var(--g-elec, #2563eb); stroke-width: 1.6; }
.hb-txt h3 { margin: .2rem 0 .3rem; font-size: 1.05rem; } .hb-txt p { margin: 0 0 .3rem; color: var(--fg-muted); font-size: .9rem; }
@media (max-width: 640px) { .hb-card { grid-template-columns: 1fr; } .hb-ico { display: none; } .hb-card .btn { justify-self: start; } }
/* TPL-3 */
.tpl-proj { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; margin: .5rem 0 1rem; background: var(--bg-raised); }
.tpl-proj summary { cursor: pointer; font-weight: 600; }
.tpl-proj .tpl-fields { margin-top: .7rem; }
.tpl-doc .tpl-fields label, .tpl-proj .tpl-fields label { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; }
.tpl-doc .tpl-fields label.wide { grid-column: 1 / -1; }
.tpl-doc .tpl-fields input, .tpl-doc .tpl-fields textarea, .tpl-proj input { font: inherit; font-size: .9rem; padding: .4rem .5rem; border: 1px solid var(--line-hi); border-radius: 8px; background: var(--bg); color: var(--fg); }
.tpl-doc .tpl-fields textarea { resize: vertical; }
.tpl-add { margin: .4rem 0 .8rem; }
@media print {
  @page { size: A4; margin: 14mm; }
  body.tpl-printing * { visibility: hidden; }
  body.tpl-printing #tpl-doc, body.tpl-printing #tpl-doc * { visibility: visible; }
  body.tpl-printing #tpl-doc { position: absolute; inset: 0 auto auto 0; width: 100%; box-shadow: none; border: 0; background: #fff; color: #000; }
  body.tpl-printing .tpl-add { display: none !important; }
  body.tpl-printing .tpl-doc input, body.tpl-printing .tpl-doc textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; background: none; }
}
/* VIS-1 */
.sld-wrap { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 1.25rem 2rem; align-items: start; }
@media (max-width: 760px) { .sld-wrap { grid-template-columns: 1fr; } }
.sld { width: 100%; height: auto; display: block; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; }
.sld-l path, .sld-l circle, .sld-l rect { fill: none; stroke: var(--fg-muted); stroke-width: 1.6; }
.sld-l .sld-bus { stroke: var(--fg); stroke-width: 4; }
.sld text { fill: var(--fg); font: 500 10px var(--font-sans); stroke: none; }
.sld .sld-b { font-weight: 700; font-size: 11px; }
.sld .sld-s { fill: var(--fg-muted); font-size: 9.5px; }
.sld .sld-n { fill: var(--fg-muted); font-size: 9px; font-style: italic; }
.sld-m circle { fill: var(--g-elec, #2563eb); stroke: var(--bg-raised); stroke-width: 2; }
.sld-m text { fill: #fff; font-weight: 700; font-size: 10px; }
.sld-m:hover circle, .sld-m:focus circle { fill: var(--accent); }
.sld-legend { margin: 0; padding-inline-start: 2.4rem; columns: 2 12rem; column-gap: 1.5rem; font-size: .9rem; }
.sld-legend li { margin: 0 0 .35rem; break-inside: avoid; }
.sld-legend li::marker { color: var(--g-elec, #2563eb); font-weight: 700; }
/* LIB-2 */
.lib-checked { font-size: .8rem; color: var(--fg-muted); margin: -.2rem 0 .7rem; }
/* JOBS-1 */
.job-share p { color: var(--fg-muted); font-size: .9rem; margin: .4rem 0 .9rem; }
.job-rules { font-size: .82rem; color: var(--fg-muted); border-inline-start: 3px solid var(--g-gen, var(--accent)); padding: .35rem .7rem; margin: 0 0 1rem; }
.job-report { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; font-size: .85rem; }
.job-report select { margin-inline-start: .35rem; }
/* ELEC-1 */
.hub-chip { display: inline-flex; align-items: center; gap: .45rem; margin-top: .75rem; padding: .45rem .8rem; border: 1px solid var(--line-hi); border-radius: 999px; background: var(--bg-raised); color: var(--fg); font-weight: 600; font-size: .88rem; text-decoration: none; }
.hub-chip svg { width: 18px; height: 18px; fill: none; stroke: var(--g-elec, #c98a00); stroke-width: 2; stroke-linejoin: round; }
.hub-chip:hover { border-color: var(--g-elec, #c98a00); }
.elec-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .25rem 0 1.25rem; color: var(--fg-muted); }
.elec-stats b { color: var(--fg); font-size: 1.15rem; }
.elec-sec { margin: 1.75rem 0; }
.elec-sec .sec-h small { font-size: .8rem; color: var(--fg-muted); font-weight: 500; }
.elec-note { color: var(--fg-muted); font-size: .9rem; margin: .25rem 0 .9rem; }
.elec-path { margin: .9rem 0; }
.elec-path h3 { font-size: .95rem; margin: 0 0 .5rem; }
.elec-path ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; counter-reset: st; }
.elec-path li { counter-increment: st; display: flex; align-items: center; gap: .5rem; }
.elec-path li:not(:last-child)::after { content: "→"; color: var(--fg-muted); }
[dir="rtl"] .elec-path li:not(:last-child)::after { content: "←"; }
.elec-path a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border: 1px solid var(--line-hi); border-radius: 10px; background: var(--bg-raised); color: var(--fg); text-decoration: none; font-weight: 600; font-size: .88rem; }
.elec-path a::before { content: counter(st); display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--c, var(--accent)); color: #fff; font-size: .72rem; }
.elec-path a:hover { border-color: var(--c, var(--accent)); }
/* CALC-Q */
details.basis > summary:has(.calc-q) { flex-wrap: wrap; }
.basis summary small.calc-q { display: flex; flex-wrap: wrap; gap: .2rem .75rem; font-size: .74rem; flex: 1 0 100%; margin-top: .3rem; }
.calc-q .cq { white-space: nowrap; }
.calc-q .cq-ok { color: var(--ok, #1f7a4d); font-weight: 600; }
.cq-badge { display: inline-block; margin-top: .35rem; font: 600 .68rem var(--font-sans); font-style: normal; color: var(--ok, #1f7a4d); }
/* HOME-1 */
.home-hero p.hero-value { margin-top: .9rem; font-size: var(--step-0, 1rem); font-weight: 600; color: #fff; max-width: 40rem; }
.home-hero p.hero-trust { margin-top: .45rem; font: 500 .74rem/1.45 var(--font-mono); letter-spacing: .02em; color: rgba(255,255,255,.72); max-width: 40rem; }
[dir="rtl"] .home-hero p.hero-trust { font-family: var(--font-sans); }
@media (max-width: 560px) {
  .home-hero h1 { font-size: 1.2rem !important; }
  .home-hero cite { font-size: .75rem; margin-top: .35rem; }
  .home-hero p.hero-value { font-size: .92rem; margin-top: .6rem; }
}
.featured { margin: 1.75rem 0 1.5rem; }
.feat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; }
@media (max-width: 1000px) { .feat-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .feat-row { grid-template-columns: repeat(2, 1fr); } }
.feat-all { display: inline-block; margin-top: .6rem; font-weight: 600; font-size: .9rem; }
.whatsnew { margin: 1.5rem 0; }
.new-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.new-list a { display: flex; gap: .75rem; align-items: baseline; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); color: var(--fg); text-decoration: none; }
.new-list a:hover { border-color: var(--accent-hi); }
.new-d { flex: none; font: 600 .72rem var(--font-mono); color: var(--accent-hi, var(--accent)); text-transform: uppercase; }
.tools-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin-top: 1.25rem; }
@media (max-width: 1000px) { .tools-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .tools-row { grid-template-columns: repeat(2, 1fr); } }
.tools-row button { display: flex; align-items: center; gap: .6rem; padding: .72rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg); font-weight: 600; font-size: .85rem; cursor: pointer; text-align: start; box-shadow: 0 1px 2px rgba(15,30,54,.05); }
.tools-row button:hover { border-color: var(--accent-hi); }
.tools-row .ico { width: 34px; height: 34px; border-radius: 10px; --depth: 2px; flex: none; }

/* ---------- NEWS & EVENTS ---------- */
.news-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
.news-grid > * { min-width: 0; }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }
.sec-h { font-size: var(--step-1); margin-bottom: .8rem; }
.news-item { display: grid; gap: .3rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); margin-bottom: .75rem; color: var(--fg); text-decoration: none; box-shadow: 0 1px 2px rgba(15,30,54,.05); }
a.news-item:hover { border-color: var(--accent-hi); text-decoration: none; }
.news-item .meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .75rem; color: var(--fg-dim); }
.news-item .meta .stage { color: #fff; background: var(--c, var(--accent)); }
.news-item b { font-size: 1rem; line-height: 1.35; }
.news-item p { font-size: .88rem; color: var(--fg-muted); }
.event { display: grid; grid-template-columns: 64px 1fr; gap: .9rem; align-items: center; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); margin-bottom: .6rem; color: var(--fg); text-decoration: none; }
a.event:hover { border-color: var(--accent-hi); text-decoration: none; }
.ev-date { display: grid; justify-items: center; border-radius: 10px; padding: .4rem 0; background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--bg-raised)); color: var(--ct, var(--c, var(--accent-hi))); }
.ev-date b { font: 700 1.3rem/1 var(--font-mono); }
.ev-date span { font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.event b { display: block; font-size: .95rem; }
.event small { color: var(--fg-muted); font-size: .8rem; }
/* ---------- ASK AI ---------- */
.ask { max-width: 52rem; display: grid; gap: 1rem; }
.ask-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ask-chips button { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--bg-raised); color: var(--fg); font-size: .82rem; cursor: pointer; text-align: start; }
.ask-chips button:hover { border-color: var(--accent-hi); color: var(--accent-hi); }
.ask-log { display: grid; gap: .9rem; }
.ask-log:empty { display: none; }
.qa-q { justify-self: end; max-width: 85%; padding: .72rem .9rem; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.qa-a { padding: 1rem 1.15rem; border-radius: 4px 14px 14px 14px; background: var(--bg-raised); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; unicode-bidi: plaintext; }
.qa-a.thinking { color: var(--fg-dim); font-style: italic; }
.qa-a.err { color: var(--bad); }
.ask-form { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); }
.ask-btns { display: flex; gap: .5rem; }
.ask-off { padding: 1.25rem; border: 1px dashed var(--line-hi); border-radius: var(--radius); color: var(--fg-muted); }
/* ---------- NEWSLETTER ---------- */
.newsletter { display: grid; grid-template-columns: auto 1fr minmax(260px, 380px); gap: 1rem 1.25rem; align-items: center; margin-top: 1.5rem; padding: 1.2rem 1.4rem; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--qatar) 30%, transparent); background: linear-gradient(110deg, color-mix(in srgb, var(--qatar) 8%, var(--bg-raised)), var(--bg-raised)); }
@media (max-width: 860px) { .newsletter { grid-template-columns: auto 1fr; } .nl-input { grid-column: 1 / -1; } }
.newsletter .ico { width: 46px; height: 46px; --depth: 3px; }
.nl-text b { font-size: 1.05rem; } .nl-text p { color: var(--fg-muted); font-size: .88rem; }
.nl-input { display: flex; gap: .5rem; }
.nl-input input { flex: 1; min-width: 0; padding: .72rem .8rem; border-radius: 6px; border: 1px solid var(--line-hi); background: var(--bg-sunk); color: var(--fg); font-size: .9rem; }
.nl-input input:focus { outline: none; border-color: var(--accent-hi); }
.newsletter .form-msg { grid-column: 1 / -1; margin: 0; }
.newsletter .form-msg:empty { display: none; }

/* ---------- RTL content polish ---------- */
[dir="rtl"] .article li, [dir="rtl"] .article .lead, [dir="rtl"] .article .tip, [dir="rtl"] .icon-card span, [dir="rtl"] .ktable td { unicode-bidi: isolate; direction: rtl; text-align: right; }
[dir="rtl"] .ktable th, [dir="rtl"] .ktable td:first-child, [dir="rtl"] .art-nav button span, [dir="rtl"] .tip .label, [dir="rtl"] .share .label, [dir="rtl"] .calc-title .label { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; }
[dir="rtl"] .ktable th { font-size: .82rem; }

/* ---------- DOWNLOAD SIGN-UP ---------- */
.lead-overlay { position: fixed; inset: 0; z-index: 125; background: rgba(7,17,33,.55); backdrop-filter: blur(4px); display: grid; place-items: center; overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.lead-box { width: min(480px, 100%); background: var(--bg-raised); border: 1px solid var(--line-hi); border-radius: 16px; padding: 1.5rem; display: grid; gap: .9rem; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); }
.lead-head { display: flex; gap: .9rem; align-items: center; }
.lead-head .ico { width: 48px; height: 48px; flex: none; --depth: 3px; }
.lead-head h2 { font-size: var(--step-1); }
.lead-head p { color: var(--fg-muted); font-size: .88rem; }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: .6rem; align-items: start; font-size: .88rem; cursor: pointer; padding: .72rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--saudi); }
.lead-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.lead-box .form-msg:empty { display: none; }
#cl-xlsx { background: var(--saudi); }
#cl-xlsx svg { width: 16px; height: 16px; }
.cl-xnote { margin-top: .5rem; }

footer { border-top: 1px solid var(--line); padding-block: 1.75rem 5.5rem; }
.view h1:focus { outline: none; }
/* ACC-3: clear focus ring for keyboard users everywhere */
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.search input:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .composer textarea:focus-visible, .nl-input input:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; }
.gs-input:focus-within, .rf:focus-within { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.sym:focus-visible { outline: 2px solid var(--c, var(--accent-hi)); outline-offset: 2px; }
.view h1:focus-visible { outline: none; }
footer .foot-link, .priv-link, .nl-priv a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.nl-priv { grid-column: 1 / -1; margin: .35rem 0 0; font-size: .78rem; color: var(--fg-dim); }
html.public [data-go="chat"], html.public [data-go="ask"], html.public #job-form, html.public #chat-trust { display: none !important; }
.report-box { margin: 1.5rem 0 0; padding: .8rem 1rem; border: 1px dashed var(--line-hi); border-radius: 10px; background: var(--bg-raised); }
.report-box summary { cursor: pointer; font-weight: 600; color: var(--fg-muted); }
.report-form { display: grid; gap: .6rem; margin-top: .7rem; }
.report-form textarea, .report-form input { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line-hi); border-radius: 8px; background: var(--bg); color: var(--fg); }
.priv { max-width: 760px; } .priv h1 { margin-bottom: .3rem; } .priv .upd { color: var(--fg-dim); font-size: .85rem; margin-bottom: 1.4rem; }
.priv h2 { font-size: 1.05rem; margin-top: 1.5rem; }
.pro-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: center; padding: 1.5rem 0 1rem; }
.pro-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.1; } .pro-hero .sub { color: var(--fg-muted); margin: .8rem 0 1.1rem; font-size: 1.05rem; }
.pro-hero img { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 18px 40px -20px rgba(15,30,54,.55); }
.pro-buy { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; } .pro-price { font-size: 1.6rem; font-weight: 800; color: var(--fg); }
.pro-buy .fine { flex-basis: 100%; color: var(--fg-dim); font-size: .85rem; }
.pro-gets { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem; margin: 1.2rem 0 .5rem; padding: 0; list-style: none; }
.pro-gets li { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); font-size: .92rem; }
.pro-group h2 { margin: 2rem 0 .3rem; font-size: 1.2rem; } .pro-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: .7rem; }
.pro-file { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; display: flex; flex-direction: column; }
.pro-file a.shot { display: block; aspect-ratio: 16 / 9.5; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.pro-file a.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.pro-file div { padding: .8rem 1rem 1rem; } .pro-file h3 { font-size: 1rem; } .pro-file p { color: var(--fg-muted); font-size: .9rem; margin-top: .3rem; }
.pro-faq details { border-bottom: 1px solid var(--line); padding: .7rem 0; } .pro-faq summary { cursor: pointer; font-weight: 700; } .pro-faq p { color: var(--fg-muted); margin-top: .4rem; }
.pro-soon { padding: .9rem 1rem; border: 1px dashed var(--line-hi); border-radius: 12px; color: var(--fg-muted); }
@media (max-width: 760px) { .pro-hero { grid-template-columns: 1fr; } } .priv .legal-note { margin-top: 2rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); font-size: .85rem; color: var(--fg-dim); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--fg-dim); font-size: .875rem; }
