/* ==========================================================================
   future.css — the v3 visual language: "a bright lab in 2040".
   One look for every page: glass panels, beams of light along edges,
   HUD details, a living grid and lattice tiles. It restyles the shared
   components, so pages need no extra markup.

   Brand limits kept: white + ice + sky blues lead; dark blue only for text,
   lines and small marks; Mars orange only for dots; Dubai font only;
   logos always on white or their own sky tile, never faded or distorted.

   Contents
     1. Layer tokens
     2. Sections (living grid, soft edges)
     3. Labels (signal diamond)
     4. Cards (glass, light beam)
     5. Icon tiles
     6. Lists: steps, facts, timeline, pills, chips
     7. Stats
     8. Tabs and accordion
     9. Forms and contact cards
    10. Page heroes
    11. Legal pages and table of contents
    12. Header and menu
    13. Buttons
    14. Footer
    15. Other parts (tree panel, meter, quote, partners, sitemap, 404, QALY, cookie)
    16. Floating capsule header
    17. Home hero
    18. Company structure
    19. Brand cards and social icons (Follow sections)
   ========================================================================== */

/* ---- 1. Layer tokens ----------------------------------------------------- */
:root {
  --glass: rgba(255, 255, 255, 0.84);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-line: rgba(185, 218, 241, 0.95);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 18px 50px rgba(75, 151, 200, 0.12);
  /* No live blur on cards and buttons: blurring moving content behind many panels
     makes pages lag. The floating header and the QALY panel keep their own blur. */
  --glass-blur: none;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---- 2. Sections ---------------------------------------------------------- */
/* overflow-x: clip keeps wide decorations (floors, rings) from widening the page,
   without breaking the pinned (sticky) story sections. */
.section { isolation: isolate; }
main > section { overflow-x: clip; }
.section--ice {
  background: linear-gradient(180deg, rgba(232, 244, 252, 0) 0%, rgba(232, 244, 252, 0.8) 14%, rgba(232, 244, 252, 0.8) 86%, rgba(232, 244, 252, 0) 100%);
}
/* A fine lab grid behind the footer and the partners section (still: it used to drift,
   which repainted the whole area every frame). Pale sections carry the living lattice
   band instead (lattice-field.js). */
.site-footer::before, .section--partners::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(113, 181, 226, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 181, 226, 0.13) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

/* The soft living lattice along the start side of every pale section (added by lattice-field.js).
   It fades to clear toward the middle, so the far side of the page stays calm. */
.section-field {
  position: absolute; z-index: -1; top: 0; inset-inline-start: 0; width: min(46%, 660px); height: 100%; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
}
/* (On small screens lattice-field.js draws the soft tiles fainter itself, so orange tiles stay full strength.) */
@media (max-width: 860px) { .section-field { width: 80%; } }
/* While the page scrolls, the lattice never shows beside the floating header: lattice-field.js gives a
   field that reaches up under the header a soft cut ending just below the header bar (--hdr-cut). */
.lattice-field.is-under-header {
  -webkit-mask-image: linear-gradient(180deg, transparent var(--hdr-cut), #000 calc(var(--hdr-cut) + 36px));
  mask-image: linear-gradient(180deg, transparent var(--hdr-cut), #000 calc(var(--hdr-cut) + 36px));
}
.section-field.is-under-header {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%), linear-gradient(180deg, transparent var(--hdr-cut), #000 calc(var(--hdr-cut) + 36px));
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 84%, transparent 100%), linear-gradient(180deg, transparent var(--hdr-cut), #000 calc(var(--hdr-cut) + 36px));
  mask-composite: intersect;
}
.section-head h2 { max-width: 20ch; }
/* "We start the conversation. You choose the path.": room for one sentence per line (balanced). */
#pathway .section-head h2 { max-width: 26ch; }

/* ---- 3. Labels: a small lattice tile sends a signal ------------------------ */
.section-head .label, .page-hero .stack-l > .label, .hero__copy > .label, .stack > .label:first-child, .stack-l > .label:first-child {
  display: inline-flex; align-items: center; gap: 0.75em; width: fit-content;
}
.section-head .label::before, .page-hero .stack-l > .label::before, .hero__copy > .label::before,
.stack > .label:first-child::before, .stack-l > .label:first-child::before {
  content: ""; flex: none; width: 7px; height: 7px; background: var(--sky); rotate: 45deg;
  box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.18);
}
@media (prefers-reduced-motion: no-preference) {
  .section-head .label::before, .page-hero .stack-l > .label::before, .hero__copy > .label::before,
  .stack > .label:first-child::before, .stack-l > .label:first-child::before { animation: signal 2.8s var(--ease) infinite; }
}
@keyframes signal { 0%, 100% { box-shadow: 0 0 0 3px rgba(113, 181, 226, 0.22); } 50% { box-shadow: 0 0 0 8px rgba(113, 181, 226, 0); } }

/* ---- 4. Cards: glass and a beam of light along the edge ---------------------- */
/* (v4.31: the small HUD corner marks are removed from every card.) */
.card, .section--ice .card {
  position: relative; isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: 24px;
  box-shadow: var(--glass-shadow);
  transition: box-shadow 0.4s var(--ease-out), border-color 0.4s, translate 0.5s var(--ease-out), transform 0.35s var(--ease-out);
}
.card:hover { border-color: rgba(113, 181, 226, 0.9); box-shadow: inset 0 1px 0 #fff, 0 26px 70px rgba(75, 151, 200, 0.2); }
.card--link:hover { transform: none; translate: 0 -5px; }
/* The beam: light travels once around the edge when the card arrives, and on hover. */
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 1;
  background: conic-gradient(from var(--ang), transparent 0deg 250deg, rgba(113, 181, 226, 0.9) 300deg, #FFFFFF 325deg, rgba(113, 181, 226, 0.9) 340deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .motion .card.is-in::before, .motion .is-in > .card::before { animation: beam-once 2.4s var(--ease-out) calc(var(--rd, 0ms) + 200ms) both; }
  .card:hover::before { animation: beam 3.2s linear infinite !important; opacity: 1; }
}
@keyframes beam { from { --ang: 0deg; } to { --ang: 360deg; } }
@keyframes beam-once { 0% { --ang: 0deg; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { --ang: 360deg; opacity: 0; } }
.card__more .icon { transition: translate 0.35s var(--ease-out); }
.card--link:hover .card__more .icon, .btn:hover .icon.arrow { translate: 5px 0; }
[dir="rtl"] .card--link:hover .card__more .icon, [dir="rtl"] .btn:hover .icon.arrow { translate: -5px 0; }

/* ---- 5. Icon tiles: glass, with a slow signal ring -------------------------- */
.icon-tile {
  position: relative; border-radius: 16px;
  background: linear-gradient(150deg, #FFFFFF 30%, var(--ice));
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(75, 151, 200, 0.16);
}
.icon-tile::after { content: ""; position: absolute; inset: -6px; border-radius: 21px; border: 1px solid var(--sky); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .icon-tile::after { animation: tile-ping 3.6s var(--ease-out) infinite; animation-delay: calc(var(--rd, 0ms) + 1s); }
}
@keyframes tile-ping { 0% { opacity: 0.8; scale: 0.92; } 70%, 100% { opacity: 0; scale: 1.28; } }

/* ---- 6. Lists ---------------------------------------------------------------- */
/* Steps: glass rows with a numbered ring and a connecting line. */
.steps { position: relative; gap: var(--s3); }
.steps li {
  position: relative; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: center; gap: var(--s4);
  padding: var(--s3) var(--s4); border-top: 0;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: 18px; box-shadow: var(--glass-shadow);
  transition: border-color 0.3s, translate 1s var(--ease-out) var(--rd, 0ms), opacity 0.9s var(--ease-out) var(--rd, 0ms), filter 0.9s var(--ease-out) var(--rd, 0ms);
}
.steps li:hover { border-color: var(--sky); }
.steps li::before {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: #FFFFFF; border: 1.5px solid var(--sky); font-size: 0.85rem; color: var(--ink);
  box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.12);
}
/* Facts: icon + text rows get a thin guide line. */
.fact { position: relative; padding-bottom: var(--s4); }
.fact::after { content: ""; position: absolute; inset-inline: 72px 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
[dir="rtl"] .fact::after { background: linear-gradient(270deg, var(--line), transparent); }
.facts > li:last-child .fact::after, .facts > .fact:last-child::after { display: none; }
/* Timeline: a line with a pulse of light running along it. */
.timeline::before { width: 2px; background: linear-gradient(180deg, var(--sky), var(--blue-light)); overflow: hidden; }
.timeline::after {
  content: ""; position: absolute; inset-inline-start: 34px; top: 12px; width: 2px; height: 70px;
  background: linear-gradient(180deg, transparent, #FFFFFF, transparent); opacity: 0.95;
}
@media (prefers-reduced-motion: no-preference) { .timeline::after { animation: run-down 3.6s linear infinite; } }
@keyframes run-down { from { transform: translateY(0); } to { transform: translateY(calc(var(--tl-h, 400px))); } }
.timeline__year { background: var(--glass-strong); box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.14); }
/* Pills and chips: glass capsules with a tile marker. */
.pill-list li, .section--ice .pill-list li {
  display: inline-flex; align-items: center; gap: 0.55em;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.pill-list li::before { content: ""; width: 6px; height: 6px; background: var(--sky); rotate: 45deg; flex: none; }
.chip {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line); box-shadow: var(--glass-shadow);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, translate 1s var(--ease-out) var(--rd, 0ms), opacity 0.9s var(--ease-out) var(--rd, 0ms), filter 0.9s var(--ease-out) var(--rd, 0ms);
}
.chip:hover { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.16), 0 10px 26px rgba(75, 151, 200, 0.16); }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.22), 0 10px 26px rgba(75, 151, 200, 0.22); }

/* ---- 7. Stats: glass tiles with a scanning bar ---------------------------------- */
.stat {
  position: relative; overflow: hidden; border-top: 0; padding: var(--s5);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: 22px; box-shadow: var(--glass-shadow);
}
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--sky), var(--blue-light)); }
.stat::after { content: ""; position: absolute; top: 0; height: 3px; width: 40%; left: -40%; background: linear-gradient(90deg, transparent, #FFFFFF, transparent); }
.stat::after { left: 0; width: 100%; transform: translateX(-100%); background: linear-gradient(90deg, transparent 30%, #FFFFFF 50%, transparent 70%); }
@media (prefers-reduced-motion: no-preference) { .stat::after { animation: scan-x 3.8s linear infinite; animation-delay: var(--rd, 0ms); } }

/* ---- 8. Tabs and accordion ---------------------------------------------------------- */
.tabs__list {
  background: rgba(232, 244, 252, 0.8); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.accordion details {
  position: relative; overflow: hidden;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); border-radius: 18px; box-shadow: var(--glass-shadow);
  transition: border-color 0.3s, box-shadow 0.3s, translate 1s var(--ease-out) var(--rd, 0ms), opacity 0.9s var(--ease-out) var(--rd, 0ms), filter 0.9s var(--ease-out) var(--rd, 0ms);
}
.accordion details:hover { border-color: var(--sky); }
.accordion details[open] { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.14), 0 20px 50px rgba(75, 151, 200, 0.16); }
.accordion details[open]::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: linear-gradient(180deg, var(--sky), var(--blue-light)); }
.accordion summary .icon { width: 30px; height: 30px; padding: 5px; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .accordion details[open] .accordion__body { animation: acc-in 0.55s var(--ease-out); }
}
@keyframes acc-in { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }

/* ---- 9. Forms and contact cards ---------------------------------------------------- */
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"], .field select, .field textarea {
  background: var(--glass-strong); border-color: var(--glass-line); border-radius: 14px;
  transition: border-color 0.25s, box-shadow 0.35s var(--ease-out), background 0.25s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--sky); }
.field input:focus, .field select:focus, .field textarea:focus { background: #fff; box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.22), 0 12px 30px rgba(75, 151, 200, 0.14); }
.form {
  padding: clamp(1.25rem, 3vw, 2.25rem); border-radius: 28px;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.form-result { background: var(--glass-strong); border: 1px solid var(--glass-line); }
.contact-card__value { font-size: 1.2rem; }

/* ---- 10. Page heroes ------------------------------------------------------------------ */
.page-hero { isolation: isolate; }
.page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky) 20%, var(--blue-light) 70%, transparent);
}
.page-hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.2rem); max-width: 16ch; }
.crumbs ol {
  width: fit-content; padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
}
.crumbs li + li::before { content: ""; display: inline-block; width: 5px; height: 5px; background: var(--sky); rotate: 45deg; vertical-align: middle; margin-inline-end: 0.5rem; }
.page-hero__logo { box-shadow: 0 30px 80px rgba(75, 151, 200, 0.18); border-color: var(--glass-line); }

/* ---- 11. Legal pages and table of contents -------------------------------------------- */
.legal-layout { align-items: start; }
.toc {
  top: 118px; padding: var(--s5); border-radius: 22px; gap: 0.15rem;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.toc::before { content: ""; display: block; height: 3px; border-radius: 3px; margin-bottom: var(--s3);
  background: linear-gradient(90deg, var(--sky) calc(var(--read, 0) * 100%), var(--ice) calc(var(--read, 0) * 100%)); }
[dir="rtl"] .toc::before { background: linear-gradient(270deg, var(--sky) calc(var(--read, 0) * 100%), var(--ice) calc(var(--read, 0) * 100%)); }
.toc a { position: relative; display: block; padding: 0.35rem 0.6rem; border-radius: 10px; transition: background 0.3s, color 0.3s, padding 0.35s var(--ease-out); }
.toc a:hover { background: var(--ice); text-decoration: none; }
.toc a.is-active { background: rgba(113, 181, 226, 0.18); font-weight: 700; padding-inline-start: 1.3rem; }
.toc a.is-active::before { content: ""; position: absolute; inset-inline-start: 0.5rem; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--sky); rotate: 45deg; }
.prose {
  counter-reset: sec; padding: clamp(1.25rem, 4vw, 3rem); border-radius: 30px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.prose > h2 { counter-increment: sec; display: flex; align-items: center; gap: 0.7rem; scroll-margin-top: 120px; }
.prose > h2:first-child { margin-top: 0; }
.prose > h2::before {
  content: counter(sec, decimal-leading-zero); flex: none; display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem; border-radius: 50%; font-size: 0.8rem; font-variant-numeric: tabular-nums;
  color: var(--ink); background: #fff; border: 1.5px solid var(--sky); box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.12);
}
.prose ul { list-style: none; padding-inline-start: 0; }
.prose ul li { position: relative; padding-inline-start: 1.3rem; }
.prose ul li::before { content: ""; position: absolute; inset-inline-start: 0.2rem; top: 0.68em; width: 6px; height: 6px; background: var(--sky); rotate: 45deg; }

/* ---- 12. Header and menu ------------------------------------------------------------------- */
.site-header {
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 0;
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; opacity: 0; transition: opacity 0.4s;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.site-header.is-scrolled::after { opacity: 1; }
.site-header.is-scrolled { box-shadow: 0 12px 40px rgba(75, 151, 200, 0.1); }
.lang-switch, .menu-toggle {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line); transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease-out);
}
.lang-switch:hover, .menu-toggle:hover { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.16); background: var(--glass-strong); }
.nav__menu {
  background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(75, 151, 200, 0.2);
}
@media (max-width: 1199px) {
  .nav { background: rgba(255, 255, 255, 0.985); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 30px 60px rgba(75, 151, 200, 0.18); }
  .nav.is-open .nav__list > li { animation: menu-in 0.5s var(--ease-out) both; }
  .nav.is-open .nav__list > li:nth-child(2) { animation-delay: 40ms; } .nav.is-open .nav__list > li:nth-child(3) { animation-delay: 80ms; }
  .nav.is-open .nav__list > li:nth-child(4) { animation-delay: 120ms; } .nav.is-open .nav__list > li:nth-child(5) { animation-delay: 160ms; }
  .nav.is-open .nav__list > li:nth-child(6) { animation-delay: 200ms; } .nav.is-open .nav__list > li:nth-child(7) { animation-delay: 240ms; }
  .nav.is-open .nav__list > li:nth-child(8) { animation-delay: 280ms; } .nav.is-open .nav__list > li:nth-child(9) { animation-delay: 320ms; }
}
@keyframes menu-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

/* Header fit: a little wider than the page, tighter menu, and the header
   "Ask QALY" shows its label from 1200px up (below that the menu folds away). */
.site-header .wrap { max-width: 1360px; }
.site-header__bar { gap: var(--s4); }
.nav__list a { padding: 0.55rem 0.62rem; font-size: 0.95rem; }
.btn--ask { white-space: nowrap; }
@media (max-width: 1199px) { .btn--ask span { display: none; } .btn--ask { padding-inline: 0.8rem; } }

@keyframes morph { 0% { opacity: 0; filter: blur(6px); translate: 0 6px; } 100% { opacity: 1; filter: blur(0); translate: 0 0; } }

/* ---- 13. Buttons -------------------------------------------------------------------------- */
.btn { transition: background 0.3s, border-color 0.3s, box-shadow 0.35s var(--ease-out), transform 0.3s var(--ease-out), translate 1s var(--ease-out) var(--rd, 0ms), opacity 0.9s var(--ease-out) var(--rd, 0ms), filter 0.9s var(--ease-out) var(--rd, 0ms); }
.btn--primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 26px rgba(113, 181, 226, 0.35); }
.btn--primary:hover { background: var(--sky); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 5px rgba(113, 181, 226, 0.2), 0 16px 36px rgba(113, 181, 226, 0.45); }
.btn--ghost {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line); box-shadow: var(--glass-shadow);
}
.btn--ghost:hover { background: var(--glass-strong); border-color: var(--sky); box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.16), 0 14px 32px rgba(75, 151, 200, 0.18); }

/* ---- 14. Footer ------------------------------------------------------------------------------ */
.site-footer {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(180deg, rgba(232, 244, 252, 0.35), rgba(232, 244, 252, 0.95) 40%);
}
.site-footer .lattice { background: transparent; }
.site-footer__brand {
  padding: var(--s5); border-radius: 26px; align-self: start;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.site-footer__tagline { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.site-footer__col ul { gap: 0.2rem; }
.site-footer__col a, .site-footer__col .linkish {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; transition: translate 0.35s var(--ease-out), color 0.3s;
}
.site-footer__col a::before, .site-footer__col .linkish::before { content: ""; width: 0; height: 1px; background: var(--sky); transition: width 0.35s var(--ease-out); }
.site-footer__col a:hover, .site-footer__col .linkish:hover { text-decoration: none; }
.site-footer__col a:hover::before, .site-footer__col .linkish:hover::before { width: 14px; }
.site-footer__hud { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; padding-block: 0 var(--s5); }
.site-footer__hud time { font-variant-numeric: tabular-nums; }
/* Social icons (X, Instagram, TikTok, LinkedIn, Facebook, YouTube, WhatsApp): big, clear buttons.
   One line when there is room (400px or more), otherwise rows of four. */
.social-wrap { container-type: inline-size; margin-top: var(--s2); }
ul.social { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 48px); gap: 10px; }
@container (min-width: 400px) { ul.social { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 48px; } }
.social a, .social .social__soon {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--ink);
  background: #FFFFFF; border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(75, 151, 200, 0.12);
}
.social .icon { width: 22px; height: 22px; }
/* No link yet: the same clear icon, just not clickable (no hover, no signal). */
.social .social__soon { cursor: default; }
.social a {
  background: var(--glass); border-color: var(--glass-line); border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease-out), translate 1s var(--ease-out) var(--rd, 0ms);
}
.social a:hover { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.18), 0 10px 24px rgba(75, 151, 200, 0.2); }
.site-footer__legal { border-top: 0; position: relative; }
.site-footer__legal::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }

/* ---- 15. Other parts ---------------------------------------------------------------------------- */
.tree-panel, .meter-card {
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow); border-radius: 26px;
}
.meter-card { position: relative; overflow: hidden; transition: transform 0.35s var(--ease-out); }
.meter-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image: linear-gradient(rgba(113, 181, 226, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(113, 181, 226, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
}
.meter-card { isolation: isolate; }
.meter-years span { border-radius: 4px; }
.quote { position: relative; padding-inline-start: var(--s5); }
.quote::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.2em; bottom: 0.2em; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--sky), var(--blue-light)); }
.partner-card { transition: transform 0.35s var(--ease-out); }
.partner-card__logo { background: #FFFFFF; border-color: var(--glass-line); border-radius: 18px; box-shadow: inset 0 0 0 6px rgba(232, 244, 252, 0.6); }
.sitemap-list section {
  padding: var(--s5); border-radius: 22px;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.sitemap-list a { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; padding: 0.15rem 0; }
.sitemap-list a::before { content: ""; width: 6px; height: 6px; background: var(--sky); rotate: 45deg; transition: scale 0.3s var(--ease-out); }
.sitemap-list a:hover::before { scale: 1.6; }
.table { background: var(--glass-strong); border-radius: 18px; overflow: hidden; }
.table th { background: rgba(232, 244, 252, 0.8); }

/* QALY launcher and panel: glass, with an orbit ring around the orange dot. */
.ai-launcher {
  background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line); box-shadow: 0 16px 40px rgba(75, 151, 200, 0.24);
}
.ai-launcher:hover { box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.18), 0 18px 44px rgba(75, 151, 200, 0.3); }
.ai-panel {
  background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3);
  border-color: var(--glass-line); border-radius: 26px;
}
.ai-panel__head { background: linear-gradient(135deg, rgba(232, 244, 252, 0.95), rgba(255, 255, 255, 0.7)); }
@media (prefers-reduced-motion: no-preference) {
  .ai-panel:not([hidden]) { animation: panel-in 0.5s var(--ease-out); }
  .msg { animation: msg-in 0.45s var(--ease-out); }
}
@keyframes panel-in { from { opacity: 0; translate: 0 18px; scale: 0.97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes msg-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.cookie {
  background: rgba(255, 255, 255, 0.88); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line); border-radius: 24px;
}
@media (prefers-reduced-motion: no-preference) { .cookie:not([hidden]) { animation: panel-in 0.6s var(--ease-out) 0.8s both; } }

/* Two-column text sections: the answer side becomes a glass panel. */
.split > .stack:last-child {
  position: relative; padding: clamp(1.25rem, 3vw, 2.25rem); border-radius: 26px;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.split > .stack:last-child::before {
  content: ""; position: absolute; top: 22px; bottom: 22px; inset-inline-start: -1px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--sky), rgba(113, 181, 226, 0));
}
.split > .stack:first-child { position: sticky; top: 120px; align-self: start; }
@media (max-width: 860px) { .split > .stack:first-child { position: static; } }

/* Closing message: a portal panel with slow orbit rings. */
.portal {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(2rem, 6vw, 4.5rem); border-radius: 36px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(232, 244, 252, 0.85));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: 0 40px 100px rgba(75, 151, 200, 0.18), inset 0 1px 0 #fff;
}
.portal::before {
  content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; top: 50%; inset-inline-end: -180px; margin-top: -310px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 620 620'%3E%3Cg fill='none' stroke='%23B9DAF1' stroke-width='1.5'%3E%3Ccircle cx='310' cy='310' r='90'/%3E%3Ccircle cx='310' cy='310' r='160' stroke-dasharray='4 10'/%3E%3Ccircle cx='310' cy='310' r='230'/%3E%3Ccircle cx='310' cy='310' r='300' stroke-dasharray='2 12'/%3E%3C/g%3E%3Cg fill='%2371B5E2'%3E%3Cpath d='M310 214l6 6-6 6-6-6z'/%3E%3Cpath d='M540 304l6 6-6 6-6-6z'/%3E%3Cpath d='M92 404l6 6-6 6-6-6z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) { .portal::before { animation: spin 70s linear infinite; } }
.portal .quote { max-width: 20ch; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.2rem); padding-inline-start: 0; }
.portal .quote::before { display: none; }

/* 404: a craft circles Mars (our flat orange dot). */
.notfound { min-height: 72vh; text-align: start; }
.notfound__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s7); align-items: center; }
@media (max-width: 860px) { .notfound__grid { grid-template-columns: 1fr; } .notfound__orbit { order: -1; max-width: 320px; } }
.notfound .display { margin-inline: 0; font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4.4rem); }
.notfound__orbit { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; justify-self: center; }
.nf-ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1.5px dashed var(--blue-light); }
.nf-ring.r1 { width: 44%; height: 44%; border-style: solid; }
.nf-ring.r2 { width: 72%; height: 72%; }
.nf-ring.r3 { width: 100%; height: 100%; border-color: rgba(113, 181, 226, 0.5); }
.nf-mars { position: absolute; inset: 0; margin: auto; width: 24%; height: 24%; border-radius: 50%; background: var(--orange); }
.nf-path { position: absolute; inset: 0; margin: auto; width: 72%; height: 72%; }
.nf-craft { position: absolute; top: -22px; left: 50%; margin-left: -22px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow); rotate: 90deg; }
.nf-code { position: absolute; bottom: 4%; inset-inline-end: 2%; font-size: clamp(2.4rem, 2rem + 2vw, 3.6rem); font-weight: 700; color: var(--blue-light); letter-spacing: -0.02em; }
@media (prefers-reduced-motion: no-preference) {
  .nf-path { animation: spin 12s linear infinite; }
  .nf-ring.r2 { animation: spin 50s linear infinite reverse; }
}

/* ---- 16. Floating capsule header ------------------------------------------------------------- */
/* The header floats over the page: it keeps no space of its own (negative margin). */
.site-header { top: env(safe-area-inset-top, 0px); padding-top: 10px; margin-bottom: -82px; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; pointer-events: none; }
section[id], main [id] { scroll-margin-top: 96px; }
.site-header.is-scrolled { box-shadow: none; }
.site-header::after { display: none; }
.site-header__bar {
  pointer-events: auto; position: relative; min-height: 76px; max-width: min(1320px, calc(100% - 2 * var(--gutter)));
  padding-inline: 40px 10px; margin-inline: auto; border-radius: 999px;
  background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 #fff, 0 16px 44px rgba(75, 151, 200, 0.16);
  transition: box-shadow 0.4s var(--ease-out), background 0.4s;
}
/* Keep the capsule clear of the screen edges at every width (".site-header .wrap" would otherwise win). */
.site-header .site-header__bar { max-width: min(1360px, calc(100% - 2 * var(--gutter))); }
.site-header.is-scrolled .site-header__bar { background: rgba(255, 255, 255, 0.86); box-shadow: inset 0 1px 0 #fff, 0 20px 50px rgba(75, 151, 200, 0.22); }
/* The logo sits in the middle of the capsule's rounded end, with room around it (never cramped). */
.site-header .brand { display: flex; align-items: center; align-self: center; }
.site-header .brand img { width: 176px; border-radius: 8px; }
/* Wide screens (full menu showing): the logo sits in the free space between the start of the capsule
   and the menu, a little before its middle (v4.13: the end padding moves it toward the start), so it
   moves with the screen width and never crowds the menu. From 1360px the logo and capsule are a
   little bigger. */
@media (min-width: 1200px) {
  .site-header .brand { margin-inline: auto; padding-inline-end: 87px; }   /* 87px: the place the "For clinics" link used to take (v4.24), so the logo stays where it was set */
  .site-header .nav { margin-inline-start: 0; }
  .site-header .brand img { width: 182px; }
}
@media (min-width: 1360px) {
  .site-header .site-header__bar { min-height: 80px; }
  .site-header .brand { padding-inline-end: 127px; }
  .site-header .brand img { width: 194px; }
  .i18n-note { top: calc(env(safe-area-inset-top, 0px) + 98px); }
}
.site-header__bar > .scroll-progress { position: absolute; left: 34px; right: 34px; bottom: 5px; width: auto; height: 2px; border-radius: 2px; pointer-events: none; }
/* Arabic notice on pages still in English: a small chip just under the floating header
   (it used to sit behind the header). */
.i18n-note {
  position: absolute; z-index: 5; top: calc(env(safe-area-inset-top, 0px) + 92px); left: 50%; translate: -50% 0;
  width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 0.45rem 1rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--glass-line); box-shadow: 0 10px 26px rgba(75, 151, 200, 0.14);
  font-size: 0.85rem; line-height: 1.4; text-align: center;
}
@media (max-width: 1199px) { .i18n-note { top: calc(env(safe-area-inset-top, 0px) + 82px); } }
/* The page starts under the floating header. */
main > .page-hero:first-child { padding-top: 150px; }
main > .notfound:first-child { padding-top: 150px; }
@media (max-width: 1199px) {
  .site-header__bar { min-height: 68px; padding-inline: 30px 8px; }
  .site-header .brand img { width: 158px; }
  .nav { inset: 84px var(--gutter) auto var(--gutter); border-radius: 26px; border: 1px solid var(--glass-line); max-height: calc(100vh - 110px); }
}
@media (max-width: 420px) { .site-header__bar { padding-inline-start: 22px; } .site-header .brand img { width: 128px; } }
/* Small phones: everything in the capsule still fits (logo, language, Ask QALY, menu). */
@media (max-width: 380px) {
  .site-header .site-header__bar { padding-inline-start: 16px; gap: 8px; }
  .site-header .brand img { width: 108px; }
  .site-header__tools { gap: 6px; }
}
@media (max-width: 340px) {
  .site-header .brand img { width: 86px; }
  .site-header .lang-switch { padding-inline: 0.6rem; }
  .site-header .menu-toggle { width: 40px; }
}

/* ---- 17. Home hero: a person made of light over our giant name ------------------------------ */
.hero--v3 { min-height: min(100svh, 980px); padding-block: 132px var(--s6); display: grid; align-content: space-between; }
/* A clear white stage in the middle for the figure; the lattice frames it. */
.hero--v3 .hero__veil, [dir="rtl"] .hero--v3 .hero__veil {
  background:
    radial-gradient(ellipse 34% 62% at 50% 52%, #FFFFFF 0%, #FFFFFF 42%, rgba(255, 255, 255, 0.75) 66%, rgba(255, 255, 255, 0) 92%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.9) 100%);
}
/* (The soft tiles are drawn at 80% by the canvas itself, data-alpha, so the orange tiles stay flat.) */
.hero__figure { position: absolute; z-index: 0; left: 50%; top: 70px; width: min(780px, 62vw); height: calc(100% - 70px); translate: -50% 0; pointer-events: none; }
.hero__word {
  position: absolute; z-index: 0; left: 0; right: 0; bottom: -0.16em; margin: 0; text-align: center; pointer-events: none; user-select: none;
  font-size: clamp(7rem, 27vw, 26rem); font-weight: 700; line-height: 1; letter-spacing: 0.02em; direction: ltr;
  color: rgba(185, 218, 241, 0.34); -webkit-text-stroke: 1.5px rgba(113, 181, 226, 0.75);
}
.hero__word span { display: inline-block; }
/* The A, as in our logo: no crossbar and the orange dot inside (flat Mars orange, like every dot). */
.hero__a svg { display: inline-block; width: 0.668em; height: 0.648em; margin-inline-end: 0.02em; vertical-align: baseline; overflow: visible; }
.hero__a polygon { fill: rgba(185, 218, 241, 0.34); stroke: rgba(113, 181, 226, 0.75); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-linejoin: miter; }
.hero__a circle { fill: var(--orange); }
@media (prefers-reduced-motion: no-preference) {
  .motion .hero__word span { animation: word-rise 1.4s var(--ease-out) both; }
  .motion .hero__word span:nth-child(2) { animation-delay: 0.1s; }
  .motion .hero__word span:nth-child(3) { animation-delay: 0.2s; }
  .motion .hero__word span:nth-child(4) { animation-delay: 0.3s; }
}
@keyframes word-rise { from { translate: 0 40%; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.hero--v3 .hero__grid { position: relative; z-index: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr) minmax(0, 0.78fr); gap: var(--s6); align-items: start; }
.hero--v3 .hero__copy { grid-column: 1; }
.hero--v3 .hero__copy .display { font-size: clamp(3rem, 1.6rem + 4.6vw, 6.2rem); max-width: 9ch; }
.hero--v3 .hero__side {
  grid-column: 3; margin-top: var(--s6); padding: var(--s5); border-radius: 28px;
  background: rgba(255, 255, 255, 0.8); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
}
.hero--v3 .hero__side .lead { font-size: 1.05rem; }
.hero--v3 .hero__hud { position: relative; z-index: 1; margin-top: var(--s6); }
@media (max-width: 1100px) {
  .hero--v3 .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero--v3 .hero__side { grid-column: 2; }
  .hero__figure { width: min(620px, 70vw); opacity: 0.8; }
}
/* Phone: one column in reading order: title, figure over the giant name, text panel. */
@media (max-width: 760px) {
  .hero--v3 { padding-top: 100px; min-height: 0; display: flex; flex-direction: column; }
  .hero--v3 .hero__grid { display: contents; }
  .hero--v3 .hero__copy { order: 1; margin-inline: var(--gutter); position: relative; z-index: 2; }
  .hero__figure { order: 2; position: relative; left: auto; top: auto; translate: none; width: 100%; height: 330px; margin-top: -10px; z-index: 1; }
  .hero__word { order: 3; position: relative; left: auto; right: auto; bottom: auto; margin-top: -170px; font-size: 36vw; line-height: 0.9; }
  .hero--v3 .hero__side { order: 4; grid-column: auto; margin: -36px var(--gutter) 0; position: relative; z-index: 2; }
  .hero--v3 .hero__hud { order: 5; }
}

/* ---- 18. Company structure: the Qaly system (tree.js) ------------------------------------------ */
/* Qaly Health Shield is the centre and the five companies travel on orbits round it. Without
   JavaScript the cards sit in rows (pages.css). With it (.is-system), tree.js places every card and
   sets the size of the system (--sys-h), its centre (--cx, --cy), the tilt of the orbits (--tilt,
   1 = seen from above), the diamond ring size (--halo) and the centre card width (--core-w).
   Depth: everything in the plane of the orbits sits low (z-index 1-5, lights included, so nothing
   ever covers a logo); cards get z-index 1000 + their height on screen, so the ones in front cover
   the ones behind. tree.js moves cards and lights with the CSS "translate" property. */
/* v4.9: no card and no number. Each company is its logo floating free, its caption, and under them a
   line of light with a small diamond (the base); it stretches out for the selected company, the one
   under the pointer and the one the shield wave reaches. The logo artwork itself is never
   touched: no shadow, glow or effect on it (brand rule). */
.tree__node {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: 7px; padding: 10px 10px 18px; border: 0; border-radius: 14px;
  background: none; color: inherit;
}
.tree__cap {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
  white-space: nowrap; text-align: center; padding: 3px 14px;
  /* an edgeless white glow behind the words, so the orbit lines never cut through them */
  background: radial-gradient(farthest-side, rgba(255, 255, 255, 0.95) 55%, rgba(255, 255, 255, 0));
  transition: color 0.3s;
}
:lang(ar) .tree__cap { letter-spacing: 0; font-size: 0.82rem; }
.tree[data-mode="mid"] .tree__cap { font-size: 0.62rem; letter-spacing: 0.08em; }
/* The centre's caption sits on the sky glow: no white backing there. */
.tree__node--main .tree__cap { background: none; }
.tree[data-mode="small"] .tree__node { padding: 6px 6px 14px; }
/* The base: a line of light with a small sky diamond in the middle. */
.tree__node::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 54%; height: 10px; translate: -50% 0; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0.8 L9.2 5 L5 9.2 L0.8 5 Z' fill='%2371B5E2' stroke='%23FFFFFF' stroke-width='1.2'/%3E%3C/svg%3E") center / 10px 10px no-repeat,
    linear-gradient(90deg, rgba(113, 181, 226, 0), #71B5E2 30%, #71B5E2 70%, rgba(113, 181, 226, 0)) center / 100% 1.5px no-repeat;
  opacity: 0.6; transition: width 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
}
.tree__node:hover::after, .tree__node:focus-visible::after, .tree__node.is-active::after, .tree__node.is-visit::after { width: 92%; opacity: 1; }
/* (v4.27: no corner brackets around the companies; the selected one is shown by its line of light.) */
.tree__node:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; }

/* The parts of the system (shown only once tree.js has taken over). */
.tree__orbits, .tree__sun, .tree__halo, .tree__wave, .tree__light, .tree__comet, .tree__tail { display: none; }
.tree.is-system {
  display: block; height: var(--sys-h, 520px); padding: 0; margin-block: var(--s2);
  transform: perspective(1600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.tree.is-system .tree__node {
  position: absolute; left: 0; top: 0; margin: 0; width: max-content;   /* the logo, or the caption if longer */
  transform-origin: 50% 50%; will-change: translate, transform;
}
.tree.is-system .tree__node img { max-width: none; }   /* keep the logo at its set size inside a min-content card */
.tree.is-system .tree__node--main { z-index: 1000; }
/* The card under the pointer (or with focus) comes forward and grows a little (tree.js);
   the system eases to a stop meanwhile. */
.tree.is-system .tree__node:not(.tree__node--main):hover,
.tree.is-system .tree__node:not(.tree__node--main):focus-visible { z-index: 3000 !important; }

/* The orbits: a soft glow, a fine line and a ring of small ticks (SVG drawn by tree.js). */
.tree.is-system .tree__orbits { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.tree__orbits ellipse { fill: none; }
.tree__orbits .orbit-glow { stroke: rgba(113, 181, 226, 0.14); stroke-width: 9; }
.tree__orbits .orbit { stroke: var(--sky); stroke-width: 1.4; }
.tree__orbits .orbit-ticks { stroke: var(--blue-light); stroke-width: 6; stroke-dasharray: 0.0016 0.0124; opacity: 0.9; }

/* The centre glows like a soft sun: sky blue light (no white), slow fine rays. */
.tree.is-system .tree__sun {
  display: block; position: absolute; z-index: 2; left: var(--cx); top: var(--cy); width: calc(var(--core-w, 280px) * 1.9); aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%; pointer-events: none;
  /* v4.15: no white in the middle; a soft sky glow only, so the centre logo sits on blue light. */
  background: radial-gradient(circle, rgba(185, 218, 241, 0.62) 0 20%, rgba(185, 218, 241, 0.42) 36%, rgba(113, 181, 226, 0.16) 54%, transparent 70%);
}
.tree__rays {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(113, 181, 226, 0.26) 0deg 1deg, transparent 1deg 9deg);
  -webkit-mask-image: radial-gradient(circle, transparent 27%, #000 34%, transparent 69%); mask-image: radial-gradient(circle, transparent 27%, #000 34%, transparent 69%);
}
/* A ring of lattice diamonds round the centre, lying in the plane of the orbits. tree.js turns it
   slowly one way and the rays the other way. */
.tree.is-system .tree__halo {
  display: block; position: absolute; z-index: 3; left: var(--cx); top: var(--cy); width: calc(var(--halo, 220px) * 2); height: calc(var(--halo, 220px) * 2);
  translate: -50% -50%; transform: scaleY(var(--tilt, 0.4)); pointer-events: none;
}
.tree__halo-spin { position: absolute; inset: 0; }
.tree__halo-spin svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tree__halo-spin path { fill: #FFFFFF; stroke: var(--blue-light); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tree__halo-spin path.on { fill: var(--sky); stroke: none; }
/* The shield wave: a ring of light that spreads out from Qaly over the orbits (tree.js moves it). */
.tree.is-system .tree__wave {
  display: block; position: absolute; z-index: 4; left: 0; top: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  border: 1.5px solid rgba(113, 181, 226, 0.8);
  box-shadow: 0 0 0 5px rgba(113, 181, 226, 0.1), inset 0 0 26px rgba(113, 181, 226, 0.22);
  will-change: transform, opacity;
}
/* Lights travelling on the orbits: small sky diamonds. */
.tree.is-system .tree__light {
  display: block; position: absolute; z-index: 5; left: -5px; top: -5px; rotate: 45deg; will-change: translate; width: 10px; height: 10px; pointer-events: none;
  background: var(--sky); border: 2px solid #FFFFFF; border-radius: 2px;
  box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.2), 0 0 14px rgba(113, 181, 226, 0.7);
  opacity: 0; transition: opacity 0.8s var(--ease-out);
}
/* Our touch of orange: one comet on the outer orbit, with a short fading tail. */
.tree.is-system .tree__comet {
  display: block; position: absolute; z-index: 5; left: -6px; top: -6px; width: 12px; height: 12px; pointer-events: none; rotate: 45deg;
  background: var(--orange); border: 2px solid #FFFFFF; border-radius: 2px;
  box-shadow: 0 0 0 4px rgba(242, 107, 29, 0.16), 0 0 14px rgba(242, 107, 29, 0.5);
  will-change: translate; opacity: 0; transition: opacity 0.8s var(--ease-out);
}
.tree.is-system .tree__tail {
  display: block; position: absolute; z-index: 5; left: -4px; top: -4px; width: 8px; height: 8px; pointer-events: none; border-radius: 1.5px; rotate: 45deg;
  background: var(--orange); scale: calc(1 - var(--t) * 0.13); will-change: translate; opacity: 0; transition: opacity 0.8s var(--ease-out);
}
.tree.is-built .tree__light, .tree.is-built .tree__comet { opacity: 1; }
.tree.is-built .tree__tail { opacity: calc(0.62 - var(--t) * 0.1); }
/* A soft lattice floor under the orbits. */
.tree::after {
  content: ""; position: absolute; z-index: -1; left: 2%; right: 2%; top: 14%; bottom: -8%; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M20 5 L35 20 L20 35 L5 20 Z' fill='none' stroke='%2371B5E2' stroke-width='1.2'/%3E%3C/svg%3E");
  background-size: 40px 40px; transform-origin: 50% 50%; transform: perspective(800px) rotateX(62deg);
  -webkit-mask-image: radial-gradient(ellipse 48% 46% at 50% 50%, #000, transparent 72%); mask-image: radial-gradient(ellipse 48% 46% at 50% 50%, #000, transparent 72%);
  opacity: 0.5;
}
.tree:not(.is-system)::after { display: none; }
/* The still parts get layers of their own, so the moving cards never make the browser repaint them. */
.tree.is-system::after, .tree.is-system .tree__orbits, .tree.is-system .tree__sun, .tree.is-system .tree__halo { will-change: transform; }
/* When the shield wave reaches a company, its base line lights up (rules above). */

/* The panel under the system: the selected company's details, like a readout. */
.tree-panel { border-color: var(--glass-line); box-shadow: var(--glass-shadow); }
.tree-panel::before {
  content: ""; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; translate: -50% 0; rotate: 45deg;
  background: var(--sky); border: 2px solid #FFFFFF; border-radius: 2px; box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.2);
}
@media (min-width: 760px) {
  .tree-panel__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); column-gap: var(--s7); row-gap: var(--s3); align-items: start; }
  .tree-panel__body > .label { grid-area: 1 / 1; }
  .tree-panel__body > h3 { grid-area: 2 / 1; }
  .tree-panel__body > .btn { grid-area: 3 / 1; margin-top: var(--s2); }
  .tree-panel__body > p:not(.label) { grid-area: 1 / 2 / 4 / 3; align-self: center; }
  /* A panel with no label (Qaly Health Shield, v4.33): the name starts at the top. */
  .tree-panel__body > h3:first-child { grid-area: 1 / 1; }
  .tree-panel__body > h3:first-child ~ .btn { grid-area: 2 / 1; }
  .tree-panel__body > h3:first-child ~ p { grid-area: 1 / 2 / 3 / 3; }
}
.tree-panel__body { animation: morph 0.6s var(--ease-out); }

@media (prefers-reduced-motion: no-preference) {
  /* Start-up: hidden until the system comes into view, then the centre appears, the orbits draw
     themselves and the companies spiral out (tree.js). */
  .tree.is-armed:not(.is-on) .tree__node { opacity: 0; }
  .tree.is-armed .tree__node--main { scale: 0.7; transition: scale 1s var(--ease-out), opacity 0.7s var(--ease-out); }
  .tree.is-armed.is-on .tree__node--main { scale: 1; }
  .tree.is-armed .tree__sun, .tree.is-armed .tree__halo { opacity: 0; transition: opacity 1.4s var(--ease-out) 0.2s; }
  .tree.is-armed.is-on .tree__sun, .tree.is-armed.is-on .tree__halo { opacity: 1; }
  .tree.is-armed .tree__orbits .orbit, .tree.is-armed .tree__orbits .orbit-glow { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease-out) 0.25s; }
  .tree.is-armed.is-on .tree__orbits .orbit, .tree.is-armed.is-on .tree__orbits .orbit-glow { stroke-dashoffset: 0; }
  .tree.is-armed .tree__orbits .orbit-ticks { opacity: 0; transition: opacity 1.2s var(--ease-out) 1s; }
  .tree.is-armed.is-on .tree__orbits .orbit-ticks { opacity: 0.9; }
}
/* ---- 19. Brand cards: a company's logo, our sentence and its social icons -------------------- */
/* Made by build.py from src/data/socials.json ({{brand_card:KEY}}). Same idea as the footer card:
   logo, "Turning Vision Into Value.", one short line, then one icon per platform. */
.brand-card {
  display: flex; flex-direction: column; gap: var(--s3);
  padding: clamp(1.25rem, 2.4vw, 2rem); border-radius: 26px;
}
.brand-card__tagline { margin: 0; font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.65rem); font-weight: 700; line-height: 1.2; color: var(--ink); }
.brand-card__about { margin: 0; flex: 1 1 auto; color: var(--muted); }
/* The icons sit on one line under a thin rule. */
.brand-card .social-wrap { margin-top: auto; padding-top: var(--s4); border-top: 1px solid rgba(185, 218, 241, 0.7); }

/* Grids of brand cards: two per row on desktop (room for all icons on one line), one on phones. */
.brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.brand-grid--trio > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 860px) { .brand-grid { grid-template-columns: minmax(0, 1fr); } }

/* One company's page: words on one side, its card floating on the other. */
.follow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.follow__text p:not(.label) { max-width: 46ch; }
.follow__stage { position: relative; isolation: isolate; padding-block: clamp(1rem, 4vw, 3rem); }
.link-arrow { display: inline-flex; align-items: center; gap: 0.45rem; }
.link-arrow .icon { width: 18px; height: 18px; flex: none; transition: translate 0.35s var(--ease-out); }
.link-arrow:hover .icon { translate: 5px 0; }
[dir="rtl"] .link-arrow:hover .icon { translate: -5px 0; }
[dir="rtl"] .link-arrow .icon, [dir="rtl"] .card__more .icon { scale: -1 1; }
.follow__stage > .brand-card { background-color: rgba(255, 255, 255, 0.94); }
@media (max-width: 860px) { .follow { grid-template-columns: minmax(0, 1fr); } .follow__stage { max-width: 520px; } }
@media (prefers-reduced-motion: no-preference) {
  .follow__stage > .brand-card.is-in { animation: node-float 7s ease-in-out 1.4s infinite; }
}

/* Live social links send out a soft signal, one after another, every few seconds. */
.social a { position: relative; }
.social a::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid var(--sky); opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .social a::after { animation: social-wave 6s var(--ease-out) infinite; }
  .social li:nth-child(2) a::after { animation-delay: 0.14s; }
  .social li:nth-child(3) a::after { animation-delay: 0.28s; }
  .social li:nth-child(4) a::after { animation-delay: 0.42s; }
  .social li:nth-child(5) a::after { animation-delay: 0.56s; }
  .social li:nth-child(6) a::after { animation-delay: 0.7s; }
  .social li:nth-child(7) a::after { animation-delay: 0.84s; }
}
@keyframes social-wave { 0% { opacity: 0; scale: 1; } 4% { opacity: 0.9; } 22%, 100% { opacity: 0; scale: 1.38; } }

/* ---- 20. Logo stage: a company logo on its small white tile ------------------------------------ */
/* Used by the company cards on Our companies, the BioScript page and every brand card.
   v4.23: no lattice and no motion here, only a calm soft-blue background (the IT Project Lead's
   choice). The tile keeps the logo on white (brand rule) and never fades or stretches it. */
/* v4.28: no big box either: only the logo on its small white tile. */
.logo-stage {
  position: relative; display: grid; place-items: center; padding-block: var(--s3) var(--s2);
}
.logo-stage__tile {
  position: relative; z-index: 1; display: grid; place-items: center; max-width: calc(100% - 40px);
  padding: 14px 18px; border-radius: 18px; background: #FFFFFF;
  border: 1px solid var(--glass-line); box-shadow: 0 16px 36px rgba(75, 151, 200, 0.24);
}
/* A fixed height from the start (so it never collapses while loading); object-fit keeps its shape. */
.logo-stage__tile img, .logo-stage .company-logo { display: block; height: 66px; width: auto; max-width: 100%; object-fit: contain; }
@media (max-width: 480px) { .logo-stage__tile img, .logo-stage .company-logo { height: 52px; } }


/* ---- 21. Our companies: the group as a family tree (companies page, org.js) ------------------- */
/* Two branches, each starting at Qaly Health Shield (from the IT Project Lead's drawing):
     Qaly Health Shield -> BioScript -> Exposome Clinic and BioScript Lab
     Qaly Health Shield -> Qaly Cell Foundry and Qaly Apothecary
   org.js draws the arrows in .org__lines from each card's data-org-parent: soft sky lines with a
   flow of light and a small arrow head, curved when two cards sit side by side, a rail on the
   start side when the cards are stacked (phones). */
.org { display: grid; gap: clamp(3.5rem, 7vw, 6rem); }
.org__branch { position: relative; display: grid; gap: clamp(2.6rem, 6vw, 5.2rem); }
.org__row { position: relative; z-index: 1; display: grid; justify-items: center; }
.org__row--kids { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2.4rem); justify-items: center; width: min(100%, 860px); margin-inline: auto; }
/* Qaly Health Shield at the top of each branch: the logo and a link to About Qaly. */
/* Every company in the tree (v4.30), like Qaly Health Shield at the top of each branch: only its logo on
   the small white tile, linking to its page (Qaly links to About Qaly). */
.org__hub { display: grid; justify-items: center; border-radius: 18px; transition: translate 0.35s var(--ease-out); }
.org__hub:hover { translate: 0 -3px; }
.org__hub:focus-visible { outline: 2px solid var(--sky); outline-offset: 6px; }
.org__hub .logo-stage__tile img { height: clamp(64px, 6vw, 84px); }
.org__node .logo-stage__tile img { height: clamp(48px, 4.4vw, 62px); }
.org__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.org__lines path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.org__lines .org-glow { stroke: rgba(113, 181, 226, 0.18); stroke-width: 8; }
.org__lines .org-line { stroke: var(--sky); stroke-width: 1.6; }
.org__lines .org-flow { stroke: #FFFFFF; stroke-width: 2.4; stroke-dasharray: 3 11; opacity: 0.9; }
.org__lines .org-head { stroke: var(--sky); stroke-width: 1.8; }
.org__lines .org-dot { fill: var(--sky); stroke: #FFFFFF; stroke-width: 1.5; }
@media (max-width: 760px) {
  .org__row--kids { grid-template-columns: 1fr; padding-inline-start: 30px; justify-items: start; width: 100%; }
  .org__node .logo-stage__tile img { height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  /* The lines draw themselves when the branch comes into view, then light flows down them. */
  .org.is-armed .org-line, .org.is-armed .org-glow { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease-out); }
  .org.is-armed .org__branch.is-on .org-line, .org.is-armed .org__branch.is-on .org-glow { stroke-dashoffset: 0; }
  .org.is-armed .org-head, .org.is-armed .org-flow, .org.is-armed .org-dot { opacity: 0; transition: opacity 0.6s var(--ease-out) 1s; }
  .org.is-armed .org__branch.is-on .org-head, .org.is-armed .org__branch.is-on .org-dot { opacity: 1; }
  .org.is-armed .org__branch.is-on .org-flow { opacity: 0.9; animation: flow 1.4s linear infinite; }
}

/* ---- 22. About: Our vision (v4.22) ----------------------------------------------------------- */
#vision .section-head .quote { font-size: clamp(1.5rem, 1rem + 1.8vw, 2.4rem); max-width: 22ch; align-self: center; }
#vision .grid-3 { margin-top: var(--s2); }
#vision .grid-3 .icon-tile { margin-bottom: var(--s2); }
.vision-beneath { margin-top: clamp(3rem, 6vw, 4.5rem); align-items: start; }

/* Our companies: Our vision and mission (v4.23). Three rows: vision, mission, what sits beneath. */
.vision-block { gap: clamp(3rem, 6vw, 4.5rem); }
.vision-block .split { align-items: start; }
.vision-block h2 { max-width: 18ch; }
.vision-block .quote { font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); max-width: 30ch; }
.vision-block em { font-style: italic; color: var(--ink); }

/* About: Four kinds of care (v4.25): company logo cards in four columns, so the logo box is a little
   lower and the logo a little smaller than on Our companies. */
.care-grid .logo-stage { padding-block: var(--s2) 0; }
.care-grid .logo-stage__tile { width: calc(100% - 16px); max-width: none; padding: 8px; border-radius: 14px; }
.care-grid .logo-stage__tile img, .care-grid .logo-stage .company-logo { width: 100%; height: auto; }

/* Home hero (v4.26): the headline is the vision, nine words, so it is set a little smaller and wider
   than the old three-word headline. "Turning Vision Into Value." sits in the side card instead. */
.hero--v3 .hero__copy .display.hero__title--vision { font-size: clamp(2.1rem, 1.1rem + 2.6vw, 3.7rem); max-width: 13ch; line-height: 1.06; }
:lang(ar) .hero--v3 .hero__copy .display.hero__title--vision { font-size: clamp(2rem, 1rem + 2.4vw, 3.4rem); max-width: 17ch; line-height: 1.3; }
/* Chinese: 8 characters a line, so the vision breaks after its comma (在疾病扎根之前，/守护生命。). */
:lang(zh) .hero--v3 .hero__copy .display.hero__title--vision { font-size: clamp(2.1rem, 1.1rem + 2.2vw, 3.3rem); max-width: 8.2em; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
/* The side card shows our mission (v4.27): a label, then the words in bold ink beside a sky bar,
   like the mission on Our companies. */
.hero__mission { gap: var(--s3); }
.hero__mission-text {
  margin: 0; padding-inline-start: var(--s4); border-inline-start: 3px solid var(--sky);
  font-size: clamp(1.02rem, 0.92rem + 0.35vw, 1.2rem); font-weight: 700; line-height: 1.45; color: var(--ink);
}

/* ---- 23. Step lists that open with an arrow (main.js, v4.28) --------------------------------- */
/* Each step shows its number, its title and an arrow; the text opens below when pressed. */
.steps--fold li { align-items: start; }
.steps--fold li::before { margin-top: 2px; }
.step__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%;
  min-height: 2.9rem; padding: 0; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink); text-align: start;
}
.step__head strong { font-weight: 700; }
.step__arrow {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: #FFFFFF; border: 1px solid var(--glass-line); color: var(--ink);
  transition: background-color 0.3s, border-color 0.3s;
}
.step__arrow .icon { width: 16px; height: 16px; rotate: 90deg; transition: rotate 0.45s var(--ease-out); }
.step__head:hover .step__arrow, .step__head:focus-visible .step__arrow { border-color: var(--sky); background: var(--ice); }
.is-open > div > .step__head .step__arrow .icon { rotate: -90deg; }
.step__head:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; border-radius: 10px; }
.step__body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.45s var(--ease-out), visibility 0s linear 0.45s; }
.step__text { overflow: hidden; min-height: 0; }
.is-open > div > .step__body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.45s var(--ease-out), visibility 0s; }
.is-open > div > .step__body .step__text { padding-bottom: var(--s2); }
@media (prefers-reduced-motion: reduce) { .step__body, .step__arrow .icon { transition: none; } }

/* ---- 24. Sign in link in the header (v4.36) --------------------------------------------------- */
.account-link {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.9rem;
  border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--ink); font-weight: 700; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.account-link .icon { width: 20px; height: 20px; }
.account-link:hover, .account-link[aria-current="page"] { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.16); background: var(--glass-strong); }
.account-link:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.nav__account { display: none; }
@media (min-width: 1200px) and (max-width: 1359px) { .account-link__text { display: none; } .account-link { padding-inline: 0.7rem; } }
@media (max-width: 599px) { .account-link__text { display: none; } .account-link { padding-inline: 0.7rem; } }
/* Phones: the header has no room, so "Sign in" moves into the menu. */
@media (max-width: 459px) { .site-header .account-link { display: none; } .nav__account { display: block; } }

/* ---- 25. Your account page (account.html, account.js) ---------------------------------------- */
.account-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s8); align-items: start; }
@media (max-width: 960px) { .account-layout { grid-template-columns: 1fr; } }
.account-card .tabs__list { margin-bottom: var(--s5); }
.account-card .form { gap: var(--s4); }
.account-names { gap: var(--s4); }
.account-actions { align-items: center; gap: var(--s3); }
.form > .error { margin-top: calc(var(--s2) * -1); color: var(--ink); font-size: var(--fs-caption); font-weight: 700; }
.forgot { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.link-btn { background: none; border: 0; padding: 0.4rem 0.2rem; color: var(--ink); font: inherit; font-weight: 700; font-size: var(--fs-small);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { text-decoration-color: var(--sky); }
.pw { position: relative; }
.pw input { width: 100%; padding-inline-end: 5rem; }
.pw__toggle { position: absolute; inset-inline-end: 8px; top: 50%; translate: 0 -50%; min-height: 32px; padding: 0 0.7rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-size: var(--fs-caption); font-weight: 700; cursor: pointer; }
.pw__toggle:hover { border-color: var(--sky); }
.phone { display: grid; grid-template-columns: 8.2rem minmax(0, 1fr); gap: var(--s2); direction: ltr; }
.phone select, .phone input { min-width: 0; }
.field--mini { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s2); }
.field--mini input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.field--mini label { font-weight: 400; color: var(--text); font-size: var(--fs-caption); }
.field input:disabled { opacity: 0.55; cursor: not-allowed; }
.field [dir="ltr"] { text-align: start; }
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.account-result { margin-top: var(--s2); }
.account-result:focus { outline: none; }
.account-side { padding-top: var(--s4); }
.account-point { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: start; }
.account-point h3 { font-size: 1.1rem; }
.account-point p { font-size: var(--fs-small); }

/* ---- 26. Welcome notice on the first visit (welcome.html, welcome.js) ------------------------ */
.welcome { display: none; }
.needs-welcome body { overflow: hidden; }
.needs-welcome .welcome {
  display: grid; position: fixed; inset: 0; z-index: 1000; overflow-y: auto; overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: rgba(232, 244, 252, 0.78); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  animation: welcome-in 0.5s var(--ease-out) both;
}
.welcome__card {
  width: min(100%, 680px); margin: auto; display: grid; gap: var(--s4); outline: none;
  padding: clamp(1.25rem, 4vw, 2.5rem); background: var(--white); border: 1px solid var(--glass-line);
  border-radius: 28px; box-shadow: 0 30px 80px rgba(75, 151, 200, 0.25);
}
.welcome__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.welcome__logo { width: clamp(120px, 30vw, 160px); height: auto; }
.welcome h2 { font-size: clamp(1.6rem, 4.2vw, 2.2rem); }
.welcome__lead { color: var(--text); }
.welcome__points { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.welcome__points li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: start; }
.welcome__points .icon-tile { width: 46px; height: 46px; border-radius: 14px; }
.welcome__points .icon-tile .icon { width: 24px; height: 24px; }
.welcome__points h3 { font-size: 1.02rem; margin: 0 0 2px; }
.welcome__points p { margin: 0; font-size: var(--fs-small); color: var(--text); }
.welcome__agree { color: var(--muted); }
.welcome__actions { gap: var(--s3); }
.welcome__declined { color: var(--ink); font-weight: 700; background: var(--ice); border-radius: 14px; padding: var(--s3) var(--s4); }
.welcome.is-leaving { animation: welcome-out 0.38s ease-in forwards; }
@keyframes welcome-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes welcome-out { to { opacity: 0; visibility: hidden; } }
.welcome__card { animation: welcome-card 0.6s var(--ease-out) 0.05s both; }
@keyframes welcome-card { from { opacity: 0; translate: 0 18px; scale: 0.985; } to { opacity: 1; translate: 0 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .needs-welcome .welcome, .welcome__card, .welcome.is-leaving { animation: none; } }
@media (max-width: 480px) { .welcome__actions .btn { width: 100%; justify-content: center; } }
/* Fields side by side keep their own height (the grid row must not stretch the boxes). */
.account-card .grid > .field { align-content: start; }
.account-card .tabs__list { box-shadow: none; }

/* ---- 27. Seven languages (i18n.js, v4.37) ------------------------------------------------------ */
/* The language menu: a small pill (globe, language code, arrow); the real list is the browser's own. */
.lang-switch { position: relative; gap: 0.35rem; cursor: pointer; }
.lang-switch__code { font-weight: 700; color: var(--ink); min-width: 1.4em; text-align: center; }
.lang-switch__chev { width: 10px; height: 6px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lang-switch__select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  font: inherit; font-size: 16px; border: 0; appearance: none; -webkit-appearance: none;
}
.lang-switch:focus-within { outline: 2px solid var(--sky); outline-offset: 3px; }
.lang-switch__select option { color: var(--ink); background: var(--white); }
@media (max-width: 420px) { .lang-switch .icon { display: inline-block; } .site-header .lang-switch { gap: 0.25rem; } }
@media (max-width: 380px) { .site-header .lang-switch .icon { display: none; } }
/* Spaced capitals suit Latin letters only: Chinese and Hindi labels keep normal spacing. */
:lang(zh) .label, :lang(hi) .label, :lang(zh) .label-chip, :lang(hi) .label-chip { letter-spacing: 0; }
:lang(hi) body { line-height: 1.75; }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3, :lang(hi) .display { line-height: 1.3; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) .display { letter-spacing: 0; line-height: 1.25; }
:lang(zh) p, :lang(zh) li { line-break: strict; }
/* QALY speaks English and Arabic for now: a short note shows in the other languages. */
.ai-panel__langnote { display: none; margin: 0 var(--s4); color: var(--muted); }
[data-lang="zh"] .ai-panel__langnote, [data-lang="es"] .ai-panel__langnote, [data-lang="ru"] .ai-panel__langnote,
[data-lang="fr"] .ai-panel__langnote, [data-lang="hi"] .ai-panel__langnote { display: block; }
/* Chinese runs words together: no spaces between the pieces of a sentence that holds links. */
:lang(zh) [data-i18n-join] .sp { display: none; }
/* Header fit (main.js sets data-fit 1 to 4 on .site-header when the row is too long for the
   chosen language). Each step keeps the earlier ones. */
.site-header[data-fit] .account-link__text { display: none; }
.site-header[data-fit] .account-link { padding-inline: 0.7rem; }
.site-header[data-fit="2"] .brand, .site-header[data-fit="3"] .brand, .site-header[data-fit="4"] .brand { padding-inline-end: var(--s4); }
.site-header[data-fit="2"] .nav__list a, .site-header[data-fit="3"] .nav__list a, .site-header[data-fit="4"] .nav__list a { padding-inline: 0.45rem; }
.site-header[data-fit="3"] .btn--ask span, .site-header[data-fit="4"] .btn--ask span { display: none; }
.site-header[data-fit="3"] .btn--ask, .site-header[data-fit="4"] .btn--ask { padding-inline: 0.8rem; }
.site-header[data-fit="4"] .nav__list a { font-size: 0.88rem; }
/* Icons in the header never shrink when a label is long. */
.site-header .icon { flex-shrink: 0; }
/* The orange Hindi full stop (।) and Chinese full stop (。) sit in their own span: take them from a
   Hindi or Chinese font, so they match the letters around them (no gap, same height). */
:lang(hi) .o { font-family: "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", var(--font); }
:lang(zh) .o { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", var(--font); }
/* The language code (中文, हिं) stays on one line. */
.lang-switch__code { white-space: nowrap; }
