/* Coherent theme tokens. Semantic error/success/warning and third-party marks stay intact. */
html body.theme-modern { --ink-400:#64748b; --ink-500:#556272; color:var(--ink-900); }
html body.theme-modern .main .muted { color:var(--ink-500); }
html body.theme-modern .sidebar {
  background:linear-gradient(170deg,var(--navy-900),var(--navy-800)) !important;
  color:#f4f5ef;
}
html body.theme-modern .sidebar .nav-item:not(.nav-item--alert) { color:rgba(255,255,255,.86); opacity:1; }
html body.theme-modern .sidebar .nav-item:not(.nav-item--alert):hover { background:rgba(var(--theme-rgb),.14); color:#fff; }
html body.theme-modern .sidebar .nav-item.active:not(.nav-item--alert) {
  background:rgba(var(--theme-rgb),.2); color:var(--theme-hero-accent);
  box-shadow:inset -3px 0 var(--theme-hero-accent);
}
html body.theme-modern .sidebar .ai-chip.chip-inc,
html body.theme-modern .sidebar .ai-chip.chip-free {
  background:rgba(var(--theme-rgb),.16) !important; color:var(--theme-hero-accent) !important; border-color:rgba(var(--theme-rgb),.4) !important;
}
html body.theme-modern .sidebar .sidebar__section-label { color:rgba(255,255,255,.76); }
html body.theme-modern .sidebar .sidebar__user > span { color:rgba(255,255,255,.8); }
html body.theme-modern .sidebar .btn--ghost:hover { color:var(--theme-hero-accent); border-color:var(--theme-hero-accent); background:rgba(var(--theme-rgb),.12); }
html body.theme-modern .nav__link { color:var(--navy-700); }
html body.theme-modern .nav__link:hover { color:var(--theme-action); }
html body.theme-modern .badge--teal,
html body.theme-modern .ai-chip:not(.chip-beta):not(.chip-soon) {
  color:var(--theme-action); background:var(--theme-soft); border-color:rgba(var(--theme-rgb),.3);
}
html body.theme-modern .sidebar .ai-chip:not(.chip-beta):not(.chip-soon) { color:var(--theme-hero-accent); background:rgba(var(--theme-rgb),.16); }
html body.theme-modern .input:not(.error):not(.is-invalid):not([aria-invalid="true"]):focus {
  border-color:var(--theme-action); box-shadow:0 0 0 3px var(--theme-action-shadow);
}
html input[type="checkbox"],html input[type="radio"] { accent-color:var(--theme-action); }
html body.theme-modern .stat b { color:var(--navy-900); }
html body.theme-modern .btn--amber { background:var(--navy-900); color:#fff; }
html body.theme-modern .btn--amber:hover { background:var(--navy-800); }
html body.theme-modern .btn--outline { color:var(--theme-action); border-color:var(--theme-action); }
html body.theme-modern .btn--outline:hover { background:var(--theme-soft); }
html body.theme-modern .lang-switch { color:var(--navy-700); }
html body.theme-modern .input::placeholder { color:#68756d; opacity:1; }
html body.theme-modern .main .text-teal,
html body.theme-modern .main .teal { color:var(--theme-action); }
html body.theme-modern .main a:not(.btn):not(.nav-item) { color:var(--theme-action); }
.mz-chart-bars > div > div[style*="linear-gradient"] { background:linear-gradient(180deg,var(--theme-action),var(--theme-action-hover)) !important; }
html {
  --theme-rgb:45,212,191;
  --theme-action:#0c746c; --theme-action-hover:#095e58;
  --theme-action-shadow:rgba(12,116,108,.24); --theme-soft:#e6f4f1;
  --theme-hero-accent:#67dec8;
}
html[data-occasion="national"], html[data-occasion="national"] .home-v2-root {
  --theme-rgb:18,130,78;
  --teal-50:#edf8f0 !important; --teal-100:#daf0e2 !important;
  --teal-200:#b8e4c9 !important; --teal-300:#95dbb5 !important;
  --teal-400:#79ddb0 !important; --teal-500:#12824e !important;
  --teal-600:#086b40 !important; --teal-700:#065432 !important;
  --teal-800:#06432a !important; --teal-900:#052d20 !important;
  --theme-action:#087047; --theme-action-hover:#055735;
  --theme-action-shadow:rgba(8,112,71,.24); --theme-soft:#e5f3e9;
  --theme-hero-accent:#79ddb0;
}
html[data-occasion="founding"], html[data-occasion="founding"] .home-v2-root {
  --theme-rgb:138,100,54;
  --teal-50:#faf5eb !important; --teal-100:#f2e6d0 !important;
  --teal-200:#e7d3b2 !important; --teal-300:#ddc193 !important;
  --teal-400:#eed09a !important; --teal-500:#8a6436 !important;
  --teal-600:#765229 !important; --teal-700:#5d3f20 !important;
  --teal-800:#4b321b !important; --teal-900:#392719 !important;
  --theme-action:#79562f; --theme-action-hover:#5d3f20;
  --theme-action-shadow:rgba(121,86,47,.24); --theme-soft:#f4ead8;
  --theme-hero-accent:#eed09a;
}
html[data-occasion="national"] body.theme-modern {
  --navy-700:#16543c; --navy-600:#246b4c; --navy-500:#4d7a62;
  --ink-900:#182c22; --ink-800:#24392f; --ink-700:#3d5147;
  --ink-600:#53655b; --ink-500:#64766b; --ink-400:#647568;
}
html[data-occasion="founding"] body.theme-modern {
  --navy-700:#644a30; --navy-600:#7a5b3b; --navy-500:#8a7152;
  --ink-900:#30281f; --ink-800:#44372c; --ink-700:#594a3c;
  --ink-600:#6c5e4f; --ink-500:#796c5b; --ink-400:#7f7366;
}
html .home-v2-root .btn:not(.ghost):not(.hero-ghost):not(.amber),
html .btn--primary, html .btn-primary {
  background:linear-gradient(135deg,var(--theme-action),var(--theme-action-hover)) !important;
  color:#fff !important; border-color:transparent;
  box-shadow:0 6px 18px -6px var(--theme-action-shadow);
}
html .home-v2-root .btn:not(.ghost):not(.hero-ghost):not(.amber):hover,
html .btn--primary:hover, html .btn-primary:hover {
  box-shadow:0 10px 24px -6px var(--theme-action-shadow);
}
html .home-v2-root .hero h1 em, html .home-v2-root .hero-badge,
html .home-v2-root .hero .stat b.teal { color:var(--theme-hero-accent); }
html .home-v2-root .hero-badge { box-shadow:none; }
html .home-v2-root .ht-chip svg { color:var(--theme-hero-accent); }
html .home-v2-root .ht-chip svg [stroke] { stroke:currentColor; }
html .home-v2-root .hero-origin-copy { display:inline-block; text-align:center; white-space:nowrap; min-width:0; }
html .home-v2-root .hero-origin-flag { display:block; width:23px; height:16px; object-fit:cover; border-radius:2px; flex:0 0 auto; }
html .home-v2-root .hero > .hero-badge { max-width:900px !important; width:calc(100% - 24px); gap:7px; }
html .home-v2-root .hero > .hero-patriotic-quote {
  order:2; width:calc(100% - 40px); max-width:900px; box-sizing:border-box;
  margin:4px auto 18px; padding:14px 18px;
  border-top:1px solid rgba(255,255,255,.22);
  border-bottom:1px solid rgba(255,255,255,.16);
  color:#fff; font-size:18px; font-size:clamp(15px,1.5vw,20px); font-weight:800;
  line-height:2; text-align:center; position:relative; z-index:1;
}
html[data-occasion][data-occasion-raw] .home-v2-root .hero > .hero-in { order:3; }
html .home-v2-root.home-v2-root.home-v2-root.home-v2-root .hero > .hero-in {
  width:calc(100% - 22px); max-width:1160px; min-width:0; box-sizing:border-box;
}
html .home-v2-root.home-v2-root.home-v2-root.home-v2-root .hero h1 {
  width:100%; max-width:900px; margin:0 auto 18px; line-height:1.6;
  font-size:clamp(11px,2.6vw,40px); white-space:nowrap !important;
  text-wrap:nowrap !important;
}
html .home-v2-root.home-v2-root.home-v2-root.home-v2-root .hero h1 em { display:inline !important; }
html .home-v2-root.home-v2-root.home-v2-root.home-v2-root .hero h1 br { display:none; }
html[data-occasion-raw="saudi"] .mz-brand-wrap {
  width:184px; height:68px;
  --mz-saudi-wordmark:url("/themes/saudi-wordmark-static-light.svg?v=20261107layers1");
}
html[data-occasion-raw="saudi"] .mz-brand-wrap.mz-brand-wrap:before,
html[data-occasion-raw="saudi"] .mz-brand-wrap.mz-brand-wrap:after {
  content:""; position:absolute; inset:auto 0 auto 0; top:50%;
  width:100%; height:auto; aspect-ratio:580 / 200; pointer-events:none;
  background-position:center; background-size:100% 100%; background-repeat:no-repeat;
}
/* Physically separate artwork: the animated file contains NO wordmark.
   No percentage crop can bisect an Arabic letter or an English glyph. */
html[data-occasion-raw="saudi"] .mz-brand-wrap.mz-brand-wrap:before {
  background-image:url("/themes/saudi-flag-motion-only.svg?v=20261110webp1");
  clip-path:none;
  transform-origin:18% 40%;
  animation:mzSaudiClothWaveV3 3.2s ease-in-out infinite;
  will-change:transform;
}
html[data-occasion-raw="saudi"] .mz-brand-wrap.mz-brand-wrap:after {
  content:""; background-image:var(--mz-saudi-wordmark);
  clip-path:none; z-index:2;
  transform:translateY(-50%); animation:none;
}
html[data-occasion-raw="saudi"] .home-v2-root header .mz-brand-wrap {
  --mz-saudi-wordmark:url("/themes/saudi-wordmark-static-navy.svg?v=20261107layers1");
}
/* Login, registration, recovery, reset and OTP share a white auth card.
   Keep the light wordmark for dark sidebars, never for this light surface. */
html[data-occasion-raw="saudi"] .auth-card .mz-brand-wrap {
  --mz-saudi-wordmark:url("/themes/saudi-wordmark-static-navy.svg?v=20261107layers1");
}
@keyframes mzSaudiClothWaveV3 {
  0%,100% { transform:translateY(calc(-50% - 3.6px)) skewX(-3deg) rotate(-.15deg) scaleY(.91); }
  28% { transform:translateY(calc(-50% - 2.6px)) skewX(3.2deg) rotate(.2deg) scaleY(.995); }
  56% { transform:translateY(calc(-50% - 3.5px)) skewX(-1.8deg) rotate(-.1deg) scaleY(.94); }
  78% { transform:translateY(calc(-50% - 2.85px)) skewX(1.8deg) rotate(.12deg) scaleY(1.01); }
}
@media(prefers-reduced-motion:reduce) {
  html[data-occasion-raw="saudi"] .mz-brand-wrap.mz-brand-wrap:before {
    animation:none; transform:translateY(calc(-50% - 3px)); will-change:auto;
  }
}
@media(max-width:640px) {
  html .home-v2-root.home-v2-root.home-v2-root.home-v2-root .hero > .hero-badge { padding:6px; gap:5px; }
  html .home-v2-root .hero-origin-flag { width:20px; height:14px; }
  html .home-v2-root .hero > .hero-badge { font-size:12px !important; padding:10px 12px; }
  html[lang="en"] .home-v2-root .hero > .hero-badge { font-size:10.5px !important; }
  html .home-v2-root .hero > .hero-patriotic-quote { padding:12px 8px; font-size:15px; line-height:1.9; }
  html[data-occasion-raw="saudi"] .mz-brand-wrap { width:130px; height:50px; }
}
