
/* =====================================================================
   Lubab — shared styles on the Crypton design system (prototype)
   Tokens copied from "Crypton Design System.fig" (variable sets
   Primitives + Tokens, Light/Dark modes; text styles LTR/RTL;
   effect styles; Spacing/Radius floats). See docs/06-ui-ux-design.md.
   Light is the default mode, also without JavaScript; dark only via the theme toggle.
   No gradients anywhere (founder's rule, PRODUCT.md).
   ===================================================================== */

:root {
  /* ---- Crypton primitives (Color/*) ---- */
  --alpha-00: #ffffff; --alpha-50: #f8f9fc; --alpha-100: #f2f3f6; --alpha-200: #e9ebee;
  --alpha-300: #dadcde; --alpha-400: #b7b8bb; --alpha-500: #97989b; --alpha-600: #6f7072;
  --alpha-700: #5b5c5f; --alpha-800: #3c3e40; --alpha-900: #1c1d1f; --alpha-1000: #212529;
  --alpha-1100: #272c30; --alpha-1200: #2d3338; --alpha-1300: #394047; --base-dbg: #1b1f24;
  --blue-50: #e6f1ff; --blue-100: #b0d3ff; --blue-300: #54a1ff; --blue-400: #338eff; --blue-500: #0072ff;
  --blue-600: #0066e8; --blue-700: #0051b5; --blue-800: #003f8c; --blue-900: #00306b; --blue-1000: #022652;
  --cyan-400: #33d1ff; --cyan-500: #00c6ff; --cyan-600: #00b4e8; --cyan-1000: #04303d; --cyan-50: #e6f9ff;
  --green-50: #e9f6ef; --green-400: #4bb581; --green-500: #1ea362; --green-700: #157446; --green-1000: #172920;
  --red-50: #fbebed; --red-400: #dd6171; --red-600: #c13446; --red-1000: #2e1f21;
  --orange-50: #fcf1e8; --orange-400: #e68b45; --orange-500: #e06e16; --orange-1000: #332214;
  --purple-50: #f3eeff; --purple-400: #9f79ff; --purple-600: #7b50e8; --purple-1000: #2d214a;


  /* ---- Legacy names used by page styles, mapped onto Crypton ---- */
  --paper: var(--bg-main);
  --sheet: var(--bg-raised);
  --ink: var(--t-primary);
  --ink-2: var(--t-secondary);
  --ink-3: var(--t-tertiary);
  --feint: var(--line);
  --feint-soft: var(--bg-c);
  --stamp: var(--t-brand);
  --stamp-wash: var(--brand-tonal);
  --amber: var(--t-warning);
  --amber-wash: var(--warning-tonal);
  --danger: var(--t-error);
  --danger-wash: var(--error-tonal);
  --accent-num: var(--t-brand);

  /* ---- Type: Crypton LTR = Poppins, RTL = Inter + IRANSansX (Vazirmatn as the free stand-in) ---- */
  --font-display: "Poppins", "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Poppins", "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-small: 0.75rem;     /* Caption 12/18 */
  --t-body: 1rem;         /* Body 2 16/24 */
  --t-lead: 1.125rem;     /* Body 1 18/28 */
  --t-h3: 1.25rem;        /* Title 3 20/30 */
  --t-h2: clamp(1.5rem, 2.6vw, 2rem);      /* Title 2 → Title 1 */
  --t-h1: clamp(2rem, 4.6vw, 3.5rem);      /* display, above Title 1 */

  /* ---- Spacing / radius (Spacing/*, Radius/*) ---- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-7: 32px; --s-8: 40px; --s-9: 48px; --s-10: 56px; --s-11: 72px; --s-12: 88px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 24px; --r-full: 360px;

  /* ---- Layout ---- */
  --rule-x: 0px;
  --rule-w: 0px;
  --gutter: 0px;
  --edge: clamp(16px, 4vw, 40px);
  --content: 1200px;
  --side: 264px;           /* app sidebar width */
  --measure: 62ch;
}

/* Light mode (Tokens → Light): the default, with or without JavaScript */
:root, :root[data-theme="light"] {
  --bg-main: var(--alpha-00); --bg-raised: var(--alpha-00);
  --bg-a: var(--alpha-50); --bg-b: var(--alpha-100); --bg-c: var(--alpha-200); --bg-d: var(--alpha-300);
  --t-primary: var(--alpha-900); --t-secondary: var(--alpha-700); --t-tertiary: #6f7072; --t-disabled: var(--alpha-300);
  --t-brand: var(--blue-600); --t-brand-2: var(--cyan-600); --t-success: var(--green-700); --t-error: var(--red-600); --t-warning: #b0560f;
  --o-primary: var(--alpha-900); --o-secondary: var(--alpha-400); --o-tertiary: var(--alpha-300); --o-disabled: var(--alpha-200);
  --line: var(--alpha-200);
  --brand-a: var(--blue-600); --brand-b: var(--blue-600);
  --brand-tonal: var(--blue-50); --success-tonal: var(--green-50); --error-tonal: var(--red-50);
  --warning-tonal: var(--orange-50); --cyan-tonal: var(--cyan-50); --purple-tonal: var(--purple-50);
  --shadow-1: 0 6px 18px rgba(0, 0, 0, 0.08);
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 4v18a5 5 0 0 0 5 5h3' fill='none' stroke='%2314181E' stroke-width='3.4' stroke-linecap='round'/%3E%3Cpath d='M15.6 15.2C15.6 9.4 11.6 5.6 5.8 5.6c0 5.8 4 9.6 9.8 9.6z' fill='%2314181E'/%3E%3Ccircle cx='4.4' cy='4.4' r='3' fill='%230066E8'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* Dark mode (Tokens → Dark): only when chosen with the theme toggle */
:root[data-theme="dark"] {
  --bg-main: var(--base-dbg);         /* Bg-Main */
  --bg-raised: var(--alpha-1100);     /* Bg-Raised is Alpha 1200 in Crypton; one step darker here so tertiary text passes AA */
  --bg-a: var(--alpha-1000);          /* Bg-Neutral A */
  --bg-b: var(--alpha-1100);          /* Bg-Neutral B */
  --bg-c: var(--alpha-1200);          /* Bg-Neutral C */
  --bg-d: var(--alpha-1300);          /* Bg-Natural D */
  --t-primary: var(--alpha-200);
  --t-secondary: var(--alpha-400);
  --t-tertiary: var(--alpha-500);     /* Crypton dark uses Alpha 600 (2.6:1 on cards); raised to pass AA */
  --t-disabled: var(--alpha-700);
  --t-brand: var(--blue-300);         /* Blue 400 is 3.9:1 on cards */
  --t-brand-2: var(--cyan-500);
  --t-success: var(--green-400);
  --t-error: #e27a88;                 /* Red 300 */
  --t-warning: var(--orange-400);
  --o-primary: var(--alpha-200);
  --o-secondary: var(--alpha-500);
  --o-tertiary: var(--alpha-600);
  --o-disabled: var(--alpha-800);
  --line: var(--alpha-1300);          /* hairlines inside surfaces */
  --brand-a: var(--blue-400);         /* Bg-Brand pr A */
  --brand-b: var(--blue-600);         /* button fill: Blue 600 as in the Crypton Button/Primary default (white text 5.2:1) */
  --brand-tonal: var(--blue-1000);    /* Bg-Brand pr Tonal */
  --success-tonal: var(--green-1000);
  --error-tonal: var(--red-1000);
  --warning-tonal: var(--orange-1000);
  --cyan-tonal: var(--cyan-1000);
  --purple-tonal: var(--purple-1000);
  --shadow-1: 0 6px 18px rgba(255, 255, 255, 0.04);      /* D-shadow 1, softened */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 4v18a5 5 0 0 0 5 5h3' fill='none' stroke='%23E9EBEE' stroke-width='3.4' stroke-linecap='round'/%3E%3Cpath d='M15.6 15.2C15.6 9.4 11.6 5.6 5.8 5.6c0 5.8 4 9.6 9.8 9.6z' fill='%23E9EBEE'/%3E%3Ccircle cx='4.4' cy='4.4' r='3' fill='%2354A1FF'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--t-primary);
  font: 400 var(--t-body)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(ar) body, body:lang(ar) { line-height: 1.8; }

img, svg { max-width: 100%; display: block; }
a { color: var(--t-brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 2px; border-radius: var(--r-sm); }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.display, h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; color: var(--t-primary); }
h1 { font-size: var(--t-h1); line-height: 1.15; }
h2 { font-size: var(--t-h2); line-height: 1.3; }
h3 { font-size: var(--t-h3); line-height: 1.5; font-weight: 600; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) .display { letter-spacing: 0; line-height: 1.5; }

.lead { font-size: var(--t-lead); line-height: 1.6; color: var(--t-secondary); max-width: 36em; }
.small { font-size: var(--t-small); line-height: 1.5; color: var(--t-tertiary); }
.muted { color: var(--t-secondary); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.hash { font-family: var(--font-mono); font-size: 0.8125rem; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; color: var(--t-secondary); }
[dir="rtl"] dd.hash, [dir="rtl"] td.hash { text-align: right; }
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- Page frame ---------- */
.page { width: 100%; max-width: calc(var(--content) + 2 * var(--edge)); margin-inline: auto; padding-inline: var(--edge); overflow-x: clip; }
.in-margin { position: static; }

/* ---------- App bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-6);
  min-height: 72px; padding-block: var(--s-3);
  margin-inline: calc(-1 * var(--edge)); padding-inline: var(--edge);
  background: var(--bg-main);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--t-primary); text-decoration: none !important; line-height: 1; }
.brand::before {
  content: ""; width: 30px; height: 30px; flex: none;
  background: var(--mark) center / contain no-repeat;
}
.brand .latin { font: 600 1.375rem/1 var(--font-display); letter-spacing: -0.015em; text-transform: lowercase; }
.brand .arabic { font: 500 1rem/1 "Vazirmatn", sans-serif; color: var(--t-tertiary); }
.top-nav { display: flex; gap: var(--s-6); font-size: 0.875rem; font-weight: 500; }
.top-nav a { color: var(--t-secondary); padding-block: 6px; white-space: nowrap; }
.top-nav a:hover, .top-nav a[aria-current="page"] { color: var(--t-primary); text-decoration: none; }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s-2); }
@media (max-width: 1100px) { .top-nav { display: none; } }
@media (max-width: 640px) { .top { gap: var(--s-3); min-height: 64px; } }

.lang, .theme {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 12px;
  font: 500 0.875rem/1 var(--font-body); color: var(--t-secondary);
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer;
}
.lang:hover, .theme:hover { color: var(--t-primary); border-color: var(--o-tertiary); }
.lang:lang(ar) { font-family: "Vazirmatn", sans-serif; }
.theme { padding: 0; width: 40px; }
.theme svg { width: 18px; height: 18px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
:root[data-theme="dark"] .theme .sun { display: none; }

/* ---------- Buttons (Crypton: 44px, radius 8, Button 1/2) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 var(--s-6);
  font: 500 1rem/1 var(--font-body);
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--brand-b); color: #fff;
  text-decoration: none !important; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--blue-700); }
.btn:active { background: var(--blue-800); }
.btn.quiet { background: transparent; color: var(--t-primary); border-color: var(--o-tertiary); }
.btn.quiet:hover { border-color: var(--t-secondary); background: var(--bg-b); box-shadow: none; }
.btn.small { min-height: 40px; font-size: 0.875rem; padding: 0 var(--s-4); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--bg-d); color: var(--t-disabled); border-color: transparent; box-shadow: none; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--t-brand); cursor: pointer; }
.linkish:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Cards and data tables ---------- */
.sheet {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.sheet-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--s-6);
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--line);
}
.sheet-title { font: 600 1.125rem/1.5 var(--font-display); color: var(--t-primary); }
.sheet-note { font-size: var(--t-small); color: var(--t-tertiary); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; font-size: 0.875rem; }
table.ledger th {
  font-weight: 500; font-size: var(--t-small); color: var(--t-tertiary);
  text-align: start; white-space: nowrap;
  padding: 12px var(--s-6); background: var(--bg-a); border-bottom: 1px solid var(--line);
}
table.ledger td { padding: 16px var(--s-6); border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--t-secondary); }
table.ledger tr:last-child > td { border-bottom: 0; }
table.ledger .r { text-align: end; }
table.ledger td.strong { font-weight: 600; color: var(--t-primary); }

dl.rows { display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; }
dl.rows > dt, dl.rows > dd { padding: 14px var(--s-6); border-bottom: 1px solid var(--line); }
dl.rows > dt { color: var(--t-tertiary); font-size: 0.875rem; }
dl.rows > dd { color: var(--t-primary); font-size: 0.9375rem; }
dl.rows > dd.muted { color: var(--t-secondary); }
dl.rows > dt:last-of-type, dl.rows > dd:last-of-type { border-bottom: 0; }
@media (max-width: 640px) {
  dl.rows { grid-template-columns: 1fr; }
  dl.rows > dt { border-bottom: 0; padding-bottom: 0; }
  dl.rows > dd { padding-top: 4px; }
}

/* ---------- Status: "stamp" is now a Crypton status badge ---------- */
.stamp {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  font: 600 0.75rem/1.4 var(--font-body);
  color: var(--t-success); background: var(--success-tonal);
  border: 1px solid color-mix(in srgb, var(--t-success) 40%, transparent);
  border-radius: var(--r-md); padding: 6px 12px;
  white-space: nowrap;
}
.stamp::before { content: none; }
.stamp.big { font-size: 0.875rem; padding: 8px 14px; }
.stamp small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--t-secondary); }
.stamp.specimen { color: var(--t-warning); background: var(--warning-tonal); border-color: color-mix(in srgb, var(--t-warning) 40%, transparent); }

.mark {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 0.75rem/1.5 var(--font-body);
  padding: 2px 10px; border-radius: var(--r-full);
  color: var(--t-secondary); background: var(--bg-c);
  white-space: nowrap;
}
.mark::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mark.done { color: var(--t-success); background: var(--success-tonal); }
.mark.wait { color: var(--t-warning); background: var(--warning-tonal); }
.mark.stop { color: var(--t-error); background: var(--error-tonal); }
.mark.info { color: var(--t-brand); background: var(--brand-tonal); }

/* ---------- Inputs (Crypton: 48px, radius 8, outline tertiary) ---------- */
label.field { display: block; }
label.field > span, .field-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 8px; color: var(--t-primary); }
.field-hint { font-size: var(--t-small); color: var(--t-tertiary); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px;
  font: 400 0.9375rem/1.4 var(--font-body);
  color: var(--t-primary);
  background: var(--bg-a);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
input::placeholder, textarea::placeholder { color: var(--t-tertiary); }
input:hover, select:hover, textarea:hover { border-color: var(--o-tertiary); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--brand-a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 25%, transparent); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--blue-500); }
input[type="range"], input[type="radio"], input[type="checkbox"] { accent-color: var(--blue-500); }

/* ---------- Message banners ---------- */
.notice {
  display: block; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--brand-tonal); color: var(--t-secondary); font-size: 0.875rem;
  border: 1px solid color-mix(in srgb, var(--t-brand) 30%, transparent);
}
.notice.legal { background: var(--bg-b); border-color: var(--line); }
.notice.amber { background: var(--warning-tonal); border-color: color-mix(in srgb, var(--t-warning) 35%, transparent); color: var(--t-secondary); }
.notice strong { color: var(--t-primary); font-weight: 600; }

/* ---------- Footer ---------- */
.foot { margin-top: var(--s-12); padding-block: var(--s-8) var(--s-11); border-top: 1px solid var(--line); color: var(--t-tertiary); font-size: 0.8125rem; }
.foot a { color: var(--t-secondary); }
.foot p + p { margin-top: 12px; }
.foot .legal { max-width: 82ch; }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; margin-bottom: var(--s-6); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

.proto-flag { margin-top: var(--s-6); font-size: 0.75rem; color: var(--t-tertiary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell with side navigation (dashboard, application) ---------- */
.shell .page { max-width: none; margin: 0; padding-inline: calc(var(--side) + var(--s-8)) var(--s-8); }
.shell .top { margin-inline: calc(-1 * (var(--side) + var(--s-8))) calc(-1 * var(--s-8)); padding-inline: var(--s-6) var(--s-8); }
.shell .top .brand { width: calc(var(--side) - var(--s-6)); }
.sidenav {
  position: fixed; inset-block: 72px 0; inset-inline-start: 0; width: var(--side); z-index: 10;
  padding: var(--s-6) var(--s-4); overflow-y: auto;
  background: var(--bg-a); border-inline-end: 1px solid var(--line);
}
@media (max-width: 1080px) {
  .shell .page { padding-inline: var(--edge); }
  .shell .top { margin-inline: calc(-1 * var(--edge)); padding-inline: var(--edge); }
  .shell .top .brand { width: auto; }
  .sidenav { position: static; width: auto; padding: 0; background: none; border: 0; overflow: visible; }
}

svg.defs { position: absolute; }


/* ---------- Landing page: the group map ---------- */
:root { --wire: #A9B3C1; --wire-on: var(--blue-600); }
:root[data-theme="dark"] { --wire: #4A5563; --wire-on: var(--blue-300); }
::selection { background: var(--brand-tonal); color: var(--t-primary); }
body { background: var(--bg-a); }
.top { background: var(--bg-a); }
.edges { z-index: 2; }
.edge-label { z-index: 3; }
html { scrollbar-color: var(--o-tertiary) transparent; }

.top-nav a { padding-block: 8px; }
.top-actions .short { display: none; }
@media (max-width: 560px) { .top-actions .long, .top .brand .arabic { display: none; } .top-actions .short { display: inline; } }

main > section { padding-top: clamp(72px, 9vw, 128px); scroll-margin-top: 80px; }
main > section > h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.02em; margin-bottom: var(--s-6); max-width: 18em; }

/* Opening */
main > section.open { padding-top: clamp(40px, 6vw, 72px); }
.open h1 { font-size: clamp(2.125rem, 3.8vw, 3.25rem); line-height: 1.08; letter-spacing: -0.03em; max-width: 22em; text-wrap: pretty; }
.open h1 span { display: block; }
.open .lead { margin-top: var(--s-4); max-width: 44em; }

/* Hero with animated illustration */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero .lead { max-width: 34em; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-art { max-width: 520px; } }
/* Illustrations are drawn on paper; in dark mode they sit on a paper card so the ink stays legible. */
.art { margin: 0; border-radius: var(--r-xl); overflow: hidden; background: #FAFAFA; border: 1px solid var(--line); }
.art video, .art img { display: block; width: 100%; height: auto; }
.art.band { margin-bottom: var(--s-6); }
.art.band img { height: clamp(180px, 24vw, 320px); object-fit: cover; }

/* The map */
.map {
  position: relative; margin-top: clamp(32px, 4vw, 48px);
  padding: clamp(40px, 3.6vw, 48px) clamp(20px, 4vw, 56px) clamp(20px, 2.4vw, 32px);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-xl);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 200px) minmax(0, 1fr);
  grid-template-areas: "runs core holds" ". owners .";
  column-gap: clamp(48px, 9vw, 140px); row-gap: clamp(32px, 3.6vw, 44px); align-items: center;
}
.map-id { position: absolute; top: 16px; inset-inline-end: 20px; font-size: 0.75rem; color: var(--t-tertiary); }
.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.edges path { fill: none; stroke: var(--wire); stroke-width: 1.5; transition: stroke 0.2s ease-out, opacity 0.2s ease-out; }
.edges path.on { stroke: var(--wire-on); stroke-width: 2; }
.map.focusing .edges path:not(.on) { opacity: 0.35; }
.map.drawn .edges path { stroke-dasharray: 1; animation: draw 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.edge-label { position: absolute; font-size: 0.75rem; font-weight: 500; color: var(--t-tertiary); background: var(--bg-raised); padding: 0 6px; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; }

.runs { grid-area: runs; display: grid; gap: 12px; }
.node {
  display: block; position: relative; z-index: 1; text-decoration: none !important;
  padding: 14px 18px; border-radius: var(--r-lg);
  background: var(--bg-raised); border: 1.5px solid var(--t-primary); color: var(--t-primary);
  transition: border-color 0.2s ease-out, transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.node b { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.node span { display: block; margin-top: 4px; font-size: 0.875rem; line-height: 1.5; color: var(--t-secondary); }
a.node:hover, a.node:focus-visible { border-color: var(--wire-on); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 24, 30, 0.08); outline: none; }
.node.holds { grid-area: holds; border-color: var(--t-brand); }
.node.owners { grid-area: owners; text-align: center; justify-self: center; width: max-content; max-width: 420px; }
.core {
  grid-area: core; position: relative; z-index: 1; aspect-ratio: 1 / 0.85;
  display: grid; place-items: center; align-content: center; gap: 10px;
  border-radius: var(--r-xl); background: var(--t-primary); color: var(--bg-main);
  font: 600 1.375rem/1 var(--font-display); letter-spacing: -0.015em;
}
.core svg { width: 48px; height: 48px; }

@media (max-width: 860px) {
  .map { grid-template-columns: 1fr; grid-template-areas: "core" "runs" "holds" "owners"; row-gap: 36px; padding-inline-start: 56px; }
  .core { width: min(200px, 100%); justify-self: start; aspect-ratio: auto; padding: 18px 0; }
  .runs { gap: 12px; }
  .node.owners { text-align: start; justify-self: stretch; width: auto; max-width: none; }
}

/* What we build: rows, not cards */
.rows-list { border-top: 1px solid var(--line); }
.rows-list > li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px 48px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.rows-list h3 { font-size: 1.375rem; letter-spacing: -0.01em; }
.rows-list p { color: var(--t-secondary); max-width: 34em; }
@media (max-width: 760px) { .rows-list > li { grid-template-columns: 1fr; } }

.pending { color: var(--t-tertiary) !important; font-size: 0.9375rem; }

/* What we hold: the chart's own convention for undisclosed entities */
.hold-lead { color: var(--t-primary); font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.45; max-width: 30em; }
.holdmap { margin-top: var(--s-7); display: flex; align-items: center; padding: clamp(24px, 3vw, 40px); background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-xl); }
.mini-core { flex: none; display: grid; place-items: center; width: 112px; height: 88px; border-radius: var(--r-lg); background: var(--t-primary); color: var(--bg-main); font: 600 1.125rem/1 var(--font-display); }
.hold-edge { flex: 0 0 clamp(48px, 8vw, 120px); height: 1.5px; background: var(--wire); position: relative; }
.hold-edge span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--bg-raised); padding: 0 6px; font-size: 0.75rem; font-weight: 500; color: var(--t-tertiary); }
.unlisted { flex: 1; max-width: 460px; display: grid; gap: 12px; position: relative; }
.unlisted::before { content: ""; position: absolute; inset-inline-start: 0; top: 28px; bottom: 28px; width: 1.5px; background: var(--wire); }
.ghost { position: relative; margin-inline-start: 24px; border: 1.5px dashed var(--o-secondary); border-radius: var(--r-lg); padding: 14px 16px; }
.ghost::before { content: ""; position: absolute; inset-inline-start: -25.5px; top: 50%; width: 24px; height: 1.5px; background: var(--wire); }
.ghost b { display: block; font-weight: 600; font-size: 0.9375rem; }
.ghost span { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--t-tertiary); }
@media (max-width: 860px) {
  .holdmap { flex-direction: column; align-items: stretch; }
  .mini-core { width: 200px; height: 80px; }
  .hold-edge { flex: 0 0 32px; width: 1.5px; height: auto; align-self: flex-start; margin-inline-start: 0; }
  .hold-edge span { left: 0; transform: translate(8px, -50%); }
  [dir="rtl"] .hold-edge span { left: auto; right: 0; transform: translate(-8px, -50%); }
  .unlisted { max-width: none; }
  .unlisted::before { top: -2px; }
}

/* Shareholders */
.owners-panel { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.terms-list { display: grid; border-top: 1px solid var(--line); }
.terms-list > div { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.terms-list dt { font-weight: 600; }
.terms-list dd { color: var(--t-secondary); }
.signin { padding: 28px; border-radius: var(--r-xl); background: var(--bg-a); border: 1px solid var(--line); display: grid; gap: 16px; justify-items: start; }
.signin h3 { font-size: 1.25rem; }
.signin p { color: var(--t-secondary); font-size: 0.9375rem; }
@media (max-width: 860px) { .owners-panel { grid-template-columns: 1fr; } .terms-list > div { grid-template-columns: 1fr; gap: 4px; } }

/* Company facts: hairline ruled list, full width */
.facts { border-top: 1px solid var(--line); }
.facts dl.rows > dt, .facts dl.rows > dd { padding-inline: 0; }
.facts dl.rows > dt:last-of-type, .facts dl.rows > dd:last-of-type { border-bottom: 1px solid var(--line); }
