/* NPF visual system v2 — Mist / ضباب
   The default is intentionally between the existing paper-light and midnight-dark modes:
   a calm blue-green glass canvas, softened surfaces, deep readable ink, and restrained lime/cyan accents.
   All values are semantic tokens so the same visual language can be tuned without scattering hex colors.
*/
:root[data-theme="mist"] {
  color-scheme: light;
  --background: #a8bdb9;
  --foreground: #142d35;
  --card: #d5e0da;
  --card-foreground: #142d35;
  --popover: #dce6e0;
  --popover-foreground: #142d35;
  --primary: #103f42;
  --primary-foreground: #f7fbf8;
  --secondary: #b9cdc7;
  --secondary-foreground: #153c3d;
  --muted: #becfca;
  --muted-foreground: #283f45;
  --accent: #d9e8aa;
  --accent-foreground: #263b31;
  --accent-strong: #103f42;
  --border: rgba(28, 60, 64, 0.28);
  --input: rgba(28, 60, 64, 0.34);
  --ring: #0f3e41;
  --radius: 1.15rem;
  --chart-1: #125654;
  --chart-2: #405d2d;
  --chart-3: #2c474d;
  --chart-4: #164f54;
  --chart-5: #664d24;
  --anti-flash-white: #e5ede8;
  --anti-flash-navy: #173234;
  --nile-bg0: #a8bdb9;
  --nile-bg1: #98b0ab;
  --nile-bg2: #c5d3ce;
  --nile-glowA: rgba(92, 177, 193, 0.34);
  --nile-glowB: rgba(157, 190, 120, 0.27);
  --nile-glowC: rgba(239, 244, 231, 0.4);
  --nile-text: #142d35;
  --nile-text2: #283f45;
  --nile-text3: #283f45;
  --nile-accent: #103f42;
  --nile-accent2: #507b45;
  --nile-cy: #143f42;
  --nile-gr: #708f3b;
  --nile-teal: #267a70;
  --nile-surf: rgba(229, 237, 231, 0.9);
  --nile-glass: linear-gradient(
    145deg,
    rgba(230, 239, 233, 0.84),
    rgba(195, 213, 205, 0.78)
  );
  --nile-glass2: linear-gradient(
    145deg,
    rgba(235, 242, 236, 0.94),
    rgba(205, 220, 212, 0.9)
  );
  --nile-glass3: rgba(225, 236, 229, 0.82);
  --nile-stroke: rgba(250, 253, 249, 0.82);
  --nile-stroke2: rgba(33, 70, 71, 0.31);
  --nile-hair: rgba(33, 70, 71, 0.24);
  --nile-bezel: linear-gradient(
    150deg,
    rgba(235, 243, 237, 0.92),
    rgba(180, 203, 196, 0.88)
  );
  --nile-win:
    radial-gradient(
      70% 50% at 46% 36%,
      rgba(231, 241, 234, 0.68),
      transparent 72%
    ),
    radial-gradient(
      60% 40% at 12% 96%,
      rgba(159, 192, 134, 0.2),
      transparent 70%
    ),
    linear-gradient(182deg, #9cb8b6, #b6ccc5 55%, #d4dfd6);
  --nile-rimA: rgba(255, 255, 255, 0.94);
  --nile-rimB: rgba(109, 174, 176, 0.58);
  --nile-rimC: rgba(173, 197, 128, 0.52);
  --nile-rimD: rgba(255, 255, 255, 0.72);
  --nile-ol: rgba(255, 255, 255, 0.76);
  --nile-olA: rgba(255, 255, 255, 0.92);
  --nile-olB: rgba(236, 244, 238, 0.82);
  --nile-h1b: linear-gradient(112deg, #0f4d4f, #165d5b 48%, #405a35);
  --nile-lineg: linear-gradient(90deg, #348b91, #779b52);
  --nile-orb:
    radial-gradient(
      circle at 30% 24%,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0) 34%
    ),
    radial-gradient(
      circle at 50% 58%,
      rgba(180, 216, 208, 0.44),
      rgba(93, 157, 162, 0.42) 62%,
      rgba(60, 111, 118, 0.28)
    ),
    radial-gradient(
      circle at 76% 92%,
      rgba(180, 205, 137, 0.38),
      rgba(180, 205, 137, 0) 48%
    );
  --nile-packShadow: rgba(29, 62, 64, 0.32);
  --nile-dsh: rgba(29, 62, 64, 0.18);
  --nile-olt: rgba(42, 75, 76, 0.26);
  --nile-giant: rgba(60, 105, 105, 0.1);
  --nile-focus: #0f3e41;
  --nile-panel: linear-gradient(
    150deg,
    rgba(244, 249, 246, 0.76),
    rgba(213, 229, 223, 0.55) 58%,
    rgba(224, 236, 229, 0.64)
  );
  --nile-panel-strong: linear-gradient(
    145deg,
    rgba(245, 250, 246, 0.98),
    rgba(216, 230, 221, 0.96)
  );
  --nile-panel-soft: rgba(232, 241, 235, 0.72);
  --nile-panel-ink: linear-gradient(145deg, #31585a, #203f43 72%);
  --nile-edge: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(92, 169, 174, 0.5) 42%,
    rgba(177, 204, 128, 0.5) 72%,
    rgba(255, 255, 255, 0.78)
  );
  --nile-page-shadow: 0 28px 68px -38px rgba(25, 60, 62, 0.45);
  --nile-card-shadow: 0 18px 38px -26px rgba(25, 60, 62, 0.36);
  --nile-page-max: 1328px;
  --nile-section-gap: clamp(22px, 3vw, 40px);
  --nile-radius-sm: 15px;
  --nile-radius: 24px;
  --nile-radius-lg: 32px;
  --nile-shadow: 0 24px 65px -38px rgba(27, 61, 64, 0.48);
  --nile-cta: linear-gradient(112deg, #165d5b, #28726c 58%, #3f704d);
  --nile-ctaText: #f7fbf8;
  --nile-ctaGlow: rgba(35, 109, 105, 0.28);
  --nile-nodeBg: #edf4ef;
  --nile-nodeInk: #176c68;
  --nile-tabOn: rgba(36, 112, 108, 0.1);
  --nile-ghost: rgba(26, 68, 70, 0.055);
  --ca-ink: #173234;
  --ca-paper: #f0f5f1;
  --ca-blue: #103f42;
  --ca-line: rgba(40, 78, 77, 0.16);
  --ca-muted: #283f45;
  --ca-acid: #d9e8aa;
  --theme-success-600: #507b45;
  --theme-text: #142d35;
  --mist-ink: #142d35;
  --mist-ink-muted: #283f45;
  --mist-ink-subtle: #283f45;
  --theme-ink: #142d35;
  --theme-ink-muted: #283f45;
  --theme-ink-subtle: #283f45;
  --theme-header-surface: linear-gradient(
    145deg,
    rgba(235, 242, 236, 0.96),
    rgba(205, 220, 212, 0.92)
  );
  --theme-header-control: rgba(219, 232, 223, 0.92);
  --theme-outline: rgba(28, 64, 67, 0.3);
  --theme-stroke: rgba(248, 252, 247, 0.92);
  --theme-rim: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.96),
    rgba(50, 136, 143, 0.64) 48%,
    rgba(153, 181, 98, 0.6)
  );
  --theme-shadow: 0 20px 48px -28px rgba(25, 60, 62, 0.38);
  --mist-surface: rgba(229, 237, 231, 0.94);
  --mist-surface-soft: rgba(220, 232, 224, 0.86);
  --mist-surface-strong: linear-gradient(
    145deg,
    rgba(239, 245, 239, 0.98),
    rgba(206, 222, 213, 0.94)
  );
  --mist-outline: rgba(30, 70, 72, 0.3);
  --mist-radius-card: 26px;
  --mist-shadow-soft:
    0 18px 46px -30px rgba(26, 60, 61, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f4f6f2;
  --foreground: #172d35;
  --card: #ffffff;
  --card-foreground: #172d35;
  --popover: #ffffff;
  --popover-foreground: #172d35;
  --primary: #12625f;
  --primary-foreground: #ffffff;
  --secondary: #e6eee8;
  --secondary-foreground: #183b3e;
  --muted: #e8efea;
  --muted-foreground: #40595f;
  --accent: #e0edc0;
  --accent-foreground: #263d2c;
  --accent-strong: #12625f;
  --border: rgba(27, 61, 68, 0.2);
  --input: rgba(27, 61, 68, 0.28);
  --ring: #147b7c;
  --chart-1: #08607f;
  --chart-2: #237a45;
  --chart-3: #2f4a6b;
  --chart-4: #176b76;
  --chart-5: #0a2240;
  --muted-foreground: #40595f;
  --nile-bg0: #f4f6f2;
  --nile-bg1: #e9efea;
  --nile-bg2: #dce7e0;
  --nile-glowA: rgba(89, 174, 190, 0.18);
  --nile-glowB: rgba(150, 187, 126, 0.14);
  --nile-glowC: rgba(255, 255, 255, 0.64);
  --nile-text: #172d35;
  --nile-text2: #344d54;
  --nile-text3: #455e64;
  --nile-accent: #12625f;
  --nile-accent2: #527b43;
  --nile-cy: #197984;
  --nile-gr: #6d8e45;
  --nile-teal: #287d73;
  --nile-surf: rgba(255, 255, 255, 0.96);
  --nile-glass: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.92),
    rgba(234, 241, 235, 0.84)
  );
  --nile-glass2: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.98),
    rgba(237, 243, 238, 0.92)
  );
  --nile-glass3: rgba(251, 253, 250, 0.9);
  --nile-stroke: rgba(255, 255, 255, 0.98);
  --nile-stroke2: rgba(30, 66, 71, 0.22);
  --nile-hair: rgba(30, 66, 71, 0.17);
  --nile-panel: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.96),
    rgba(230, 239, 233, 0.88)
  );
  --nile-panel-strong: linear-gradient(145deg, #ffffff, #edf3ee);
  --nile-panel-soft: rgba(255, 255, 255, 0.88);
  --nile-page-shadow: 0 24px 55px -38px rgba(25, 60, 62, 0.3);
  --nile-card-shadow: 0 14px 32px -24px rgba(25, 60, 62, 0.26);
  --nile-focus: #147b7c;
  --nile-h1b: linear-gradient(112deg, #123e59, #12625f 52%, #527b43);
  --nile-cta: linear-gradient(112deg, #155f5c, #26726e 62%, #527b43);
  --nile-ctaText: #ffffff;
  --nile-ctaGlow: rgba(31, 103, 99, 0.24);
  --ca-ink: #172d35;
  --ca-paper: #f8faf7;
  --ca-blue: #12625f;
  --ca-muted: #455e64;
  --ca-acid: #dbe9b7;
  --theme-ink: #172d35;
  --theme-ink-muted: #344d54;
  --theme-ink-subtle: #455e64;
  --theme-header-surface: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.98),
    rgba(236, 243, 237, 0.96)
  );
  --theme-header-control: #f8faf7;
  --theme-outline: rgba(26, 61, 68, 0.23);
  --theme-stroke: rgba(255, 255, 255, 0.98);
  --theme-rim: linear-gradient(
    125deg,
    #ffffff,
    rgba(48, 132, 142, 0.42) 48%,
    rgba(151, 179, 97, 0.42)
  );
  --theme-shadow: 0 18px 42px -28px rgba(25, 60, 62, 0.28);
}

html[data-theme="light"] {
  background-color: var(--background);
  color: var(--foreground);
}

html[data-theme="mist"] {
  background-color: var(--background);
  color: var(--foreground);
  scrollbar-color: rgba(38, 103, 103, 0.5) rgba(224, 234, 229, 0.6);
}
html[data-theme="mist"] body.ca-site {
  color: var(--foreground);
  background:
    radial-gradient(
      900px 650px at 7% 9%,
      rgba(111, 182, 195, 0.28),
      transparent 68%
    ),
    radial-gradient(
      780px 600px at 95% 20%,
      rgba(162, 198, 139, 0.22),
      transparent 70%
    ),
    radial-gradient(
      900px 650px at 45% 100%,
      rgba(236, 242, 228, 0.48),
      transparent 68%
    ),
    linear-gradient(155deg, #d4dfda 0%, #c2d4d1 48%, #d6e0da 100%);
  background-attachment: fixed;
}
html[data-theme="mist"] ::selection {
  background: #b9d996;
  color: #183a39;
}

/* One consistent floating navigation language, including mobile controls. */
html[data-theme="mist"] .ca-header {
  /* Older header CSS had its own dark palette; rebind every local override to the Mist tokens. */
  --nile-glass2: var(--theme-header-surface);
  --nile-glass3: var(--theme-header-control);
  --nile-text: var(--theme-ink);
  --nile-text2: var(--theme-ink-muted);
  --nile-text3: var(--theme-ink-subtle);
  --nile-hair: var(--theme-outline);
  --nile-stroke: var(--theme-stroke);
  --nile-stroke2: var(--theme-outline);
  --nile-rim: var(--theme-rim);
  --nile-shadow: var(--theme-shadow);
  --ca-paper: var(--theme-ink);
  background: var(--nile-glass2) !important;
  border: 1px solid var(--nile-stroke) !important;
  border-radius: 999px;
  box-shadow:
    var(--mist-shadow-soft),
    0 12px 30px -24px rgba(23, 64, 65, 0.5);
  color: var(--foreground) !important;
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
}
html[data-theme="mist"] .ca-header::before {
  background: var(--nile-rim);
}
html[data-theme="light"] .ca-header {
  --nile-glass2: var(--theme-header-surface);
  --nile-glass3: var(--theme-header-control);
  --nile-text: var(--theme-ink);
  --nile-text2: var(--theme-ink-muted);
  --nile-text3: var(--theme-ink-subtle);
  --nile-hair: var(--theme-outline);
  --nile-stroke: var(--theme-stroke);
  --nile-stroke2: var(--theme-outline);
  --nile-rim: var(--theme-rim);
  --nile-shadow: var(--theme-shadow);
  --ca-paper: var(--theme-ink);
  background: var(--nile-glass2) !important;
  border: 1px solid var(--nile-stroke) !important;
  border-radius: 999px;
  box-shadow:
    var(--nile-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color: var(--theme-ink) !important;
  backdrop-filter: blur(18px) saturate(1.12);
}
html[data-theme="light"] .ca-header::before {
  background: var(--nile-rim);
}
html[data-theme="mist"] .ca-brand-copy,
html[data-theme="mist"] .ca-header a,
html[data-theme="mist"] .ca-header button {
  color: var(--foreground);
}
html[data-theme="mist"] .ca-brand img {
  filter: saturate(0.78);
}
html[data-theme="mist"] .ca-desktop-nav > a {
  border-radius: 999px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
html[data-theme="mist"] .ca-desktop-nav > a:hover,
html[data-theme="mist"] .ca-desktop-nav a[aria-current="page"] {
  background: var(--nile-tabOn);
  color: #145c5a !important;
}
html[data-theme="mist"] .ca-header-icon,
html[data-theme="mist"] .ca-header-actions [data-slot="button"],
html[data-theme="mist"] .ca-language,
html[data-theme="mist"] .ca-menu-button {
  border: 1px solid var(--nile-hair) !important;
  border-radius: 50% !important;
  background: var(--nile-glass3) !important;
  color: var(--nile-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
html[data-theme="mist"] .ca-header-icon:hover,
html[data-theme="mist"] .ca-header-actions [data-slot="button"]:hover,
html[data-theme="mist"] .ca-language:hover {
  transform: translateY(-1px);
  box-shadow: var(--mist-shadow-soft);
}
html[data-theme="mist"] .ca-contact-top,
html[data-theme="mist"] .ca-hero-cta,
html[data-theme="mist"] .ca-solid-link,
html[data-theme="mist"] .ca-science-invite-primary {
  background: var(--nile-cta) !important;
  color: var(--nile-ctaText) !important;
  border: 1px solid rgba(255, 255, 255, 0.48) !important;
  border-radius: 999px !important;
  box-shadow:
    0 12px 26px -18px var(--nile-ctaGlow),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

/* Hero is atmospheric, not a dark block. Preserve its existing art and layout while softening the frame. */
html[data-theme="mist"] .ca-hero {
  color: var(--foreground);
}
html[data-theme="mist"] .ca-hero::before {
  border: 1px solid var(--nile-stroke2);
  border-radius: 34px;
  box-shadow: var(--nile-shadow);
}
html[data-theme="mist"] .ca-hero h1,
html[data-theme="mist"] .ca-page-intro h1 {
  color: var(--nile-text);
}
html[data-theme="mist"] .ca-hero-copy > p,
html[data-theme="mist"] .ca-hero-meta,
html[data-theme="mist"] .ca-hero-field-note {
  color: var(--nile-text2) !important;
  background-color: var(--nile-glass3);
  border-color: var(--nile-hair);
  backdrop-filter: blur(16px) saturate(1.1);
}
html[data-theme="mist"] .ca-hero h1 .h1g,
html[data-theme="mist"] .ca-hero h1 span span {
  background-image: var(--nile-h1b) !important;
}

/* Section rhythm, label hierarchy and separators. */
html[data-theme="mist"] .ca-site main > section.ca-section-pad {
  scroll-margin-top: 96px;
}
html[data-theme="mist"] .ca-section-index {
  color: var(--nile-text3) !important;
  border-color: var(--nile-hair) !important;
}
html[data-theme="mist"] .ca-editorial-rule,
html[data-theme="mist"] .ca-footer-bottom,
html[data-theme="mist"] .ca-contact-bottom,
html[data-theme="mist"] .ca-dossier-section,
html[data-theme="mist"] .ca-dossier-table th,
html[data-theme="mist"] .ca-dossier-table td {
  border-color: var(--nile-hair) !important;
}
html[data-theme="mist"] .ca-site main p,
html[data-theme="mist"] .ca-site main li {
  text-wrap: pretty;
}
html[data-theme="mist"] .ca-site main h1,
html[data-theme="mist"] .ca-site main h2,
html[data-theme="mist"] .ca-site main h3 {
  text-wrap: balance;
}

/* Shared elevated surfaces across editorial, catalog, account and Care Atlas pages. */
html[data-theme="mist"]
  :is(
    .ca-catalog-card,
    .ca-page-intro,
    .ca-contact-form-panel,
    .ca-contact-address,
    .ca-access-form,
    .ca-source-content,
    .ca-source-route,
    .ca-company-origin,
    .ca-principles,
    .ca-dossier-download,
    .ca-pdp-gallery,
    .ca-pdp-summary,
    .atlas-gateway-card,
    .atlas-workspace-panel,
    .atlas-mode-panel,
    .atlas-journey-column,
    .atlas-search-result,
    .atlas-deep-section,
    .ca-principles > ol > li,
    .ca-story-chapters > section
  ) {
  border-color: var(--nile-stroke2) !important;
  background: var(--nile-panel) !important;
  box-shadow: var(--mist-shadow-soft);
  backdrop-filter: blur(14px) saturate(1.08);
}
html[data-theme="mist"] .ca-catalog-card,
html[data-theme="mist"] .ca-page-intro,
html[data-theme="mist"] .atlas-gateway-card,
html[data-theme="mist"] .atlas-workspace-panel,
html[data-theme="mist"] .atlas-mode-panel,
html[data-theme="mist"] .atlas-journey-column,
html[data-theme="mist"] .ca-contact-address {
  border-radius: var(--mist-radius-card);
}
html[data-theme="mist"] .ca-catalog-card {
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}
html[data-theme="mist"] .ca-catalog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 139, 145, 0.38) !important;
  box-shadow: 0 24px 44px -30px rgba(24, 78, 78, 0.52);
}
html[data-theme="mist"] .ca-card-copy h3,
html[data-theme="mist"] .ca-pdp-summary h1,
html[data-theme="mist"] .ca-functional-page h1 {
  color: var(--nile-text) !important;
}
html[data-theme="mist"] .ca-card-copy > p,
html[data-theme="mist"] .ca-pdp-lead,
html[data-theme="mist"] .ca-company-prose {
  color: var(--nile-text2) !important;
}
html[data-theme="mist"] .ca-card-meta,
html[data-theme="mist"] .ca-card-price,
html[data-theme="mist"] .ca-pdp-form,
html[data-theme="mist"] .ca-pdp-identifiers,
html[data-theme="mist"] .ca-related {
  border-color: var(--nile-hair) !important;
}
html[data-theme="mist"] .ca-card-circle,
html[data-theme="mist"] .ca-card-arrow,
html[data-theme="mist"] .ca-document-icon,
html[data-theme="mist"] .atlas-search-result-icon,
html[data-theme="mist"] .atlas-workspace-hero-icon,
html[data-theme="mist"] .atlas-journey-option-icon,
html[data-theme="mist"] .ca-hero-star {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--nile-stroke) !important;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    rgba(246, 250, 247, 0.88),
    rgba(198, 221, 214, 0.72)
  ) !important;
  color: #287a79 !important;
  box-shadow:
    0 7px 18px -13px rgba(27, 86, 85, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
html[data-theme="mist"] .ca-site svg.lucide {
  color: currentColor;
  stroke-width: 1.8;
}
html[data-theme="mist"] .ca-header svg.lucide {
  stroke-width: 1.75;
}
html[data-theme="mist"] .ca-footer {
  color: var(--nile-text);
  border-color: var(--nile-hair);
}
html[data-theme="mist"] .ca-menu-sheet {
  color: var(--nile-text) !important;
  background: rgba(205, 221, 216, 0.94) !important;
  backdrop-filter: blur(24px);
}

/* Theme switch becomes a deliberate three-state control rather than a binary moon toggle. */
html[data-theme="mist"] .nile-theme-toggle > button,
html[data-theme="light"] .nile-theme-toggle > button,
html.dark .nile-theme-toggle > button {
  position: relative;
  overflow: hidden;
}
.nile-theme-toggle > button > svg {
  transition:
    transform 0.22s ease,
    opacity 0.18s ease;
}
.nile-theme-toggle > button:hover > svg {
  transform: rotate(-12deg) scale(1.08);
}
html[data-theme="mist"] .nile-theme-toggle > button::before,
html[data-theme="light"] .nile-theme-toggle > button::before,
html[data-theme="dark"] .nile-theme-toggle > button::before {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 18px;
  line-height: 1;
  color: #287a79;
}
html[data-theme="mist"] .nile-theme-toggle > button::before {
  content: "◐";
}
html[data-theme="light"] .nile-theme-toggle > button::before {
  content: "☼";
  color: #a57a27;
}
html[data-theme="dark"] .nile-theme-toggle > button::before {
  content: "☾";
  color: #65c7cf;
}
.nile-theme-toggle > button > svg {
  display: none;
}
html[data-theme="mist"] .nile-theme-toggle > button::after,
html[data-theme="light"] .nile-theme-toggle > button::after,
html[data-theme="dark"] .nile-theme-toggle > button::after {
  content: "";
  position: absolute;
  inset-inline-end: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #79a85e;
  box-shadow: 0 0 0 2px rgba(238, 245, 239, 0.88);
}
html[data-theme="light"] .nile-theme-toggle > button::after {
  background: #d4ad58;
}
html[data-theme="dark"] .nile-theme-toggle > button::after {
  background: #62c6d2;
}

/* Controls, focus and mobile comfort. */
html[data-theme="mist"] :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(52, 139, 145, 0.62);
  outline-offset: 3px;
}
html[data-theme="mist"] :is(input, select, textarea, [data-slot="input"]) {
  border-color: var(--nile-stroke2);
  background-color: rgba(242, 247, 243, 0.72);
  color: var(--nile-text);
}
html[data-theme="mist"] ::placeholder {
  color: #647d7b;
  opacity: 1;
}
html[data-theme="mist"] .ca-site a {
  text-decoration-color: rgba(35, 108, 104, 0.35);
}
html[data-theme="mist"] .ca-site a:hover {
  text-decoration-color: currentColor;
}
@media (max-width: 760px) {
  html[data-theme="mist"] .ca-header {
    border-radius: 22px;
  }
  html[data-theme="mist"] .ca-hero::before {
    border-radius: 24px;
  }
  html[data-theme="mist"] .ca-catalog-grid {
    gap: 14px;
  }
  html[data-theme="mist"]
    :is(
      .ca-catalog-card,
      .atlas-gateway-card,
      .atlas-mode-panel,
      .atlas-journey-column
    ) {
    border-radius: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nile-theme-toggle > button > svg,
  html[data-theme="mist"] .ca-catalog-card,
  html[data-theme="mist"] .ca-header-icon {
    transition: none !important;
  }
}

/* Contrast audit — separate the new middle theme decisively from Light and remove inherited
   dark-header overrides. These are global final-layer corrections for both readable light modes. */
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-header {
  --nile-glass2: var(--theme-header-surface);
  --nile-glass3: var(--theme-header-control);
  --nile-text: var(--theme-ink);
  --nile-text2: var(--theme-ink-muted);
  --nile-text3: var(--theme-ink-subtle);
  --nile-hair: var(--theme-outline);
  --nile-stroke: var(--theme-stroke);
  --nile-stroke2: var(--theme-outline);
  --nile-rim: var(--theme-rim);
  --nile-shadow: var(--theme-shadow);
  --ca-paper: var(--theme-ink);
}
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-header,
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-header a,
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-header button {
  color: var(--theme-ink) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-header
  .ca-contact-top {
  background: var(--nile-cta) !important;
  color: var(--nile-ctaText) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-brand > img {
  filter: brightness(0) saturate(100%) opacity(0.76) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-header-icon,
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-header-actions
  [data-slot="button"],
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-language,
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-menu-button {
  background: var(--theme-header-control) !important;
  border: 1px solid var(--theme-outline) !important;
  color: var(--theme-ink) !important;
}

/* Bring the hero photograph back into view. The previous combination of 14–20% photo opacity,
   luminosity blending, and a nearly opaque white veil erased image detail and washed out copy. */
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-hero-photo {
  opacity: 0.38 !important;
  mix-blend-mode: normal !important;
  filter: saturate(0.84) contrast(1.08) !important;
}
html[data-theme="mist"] .ca-hero-shade {
  background:
    radial-gradient(
      780px 520px at 20% 44%,
      rgba(72, 140, 147, 0.08),
      transparent 72%
    ),
    linear-gradient(
      180deg,
      rgba(168, 189, 185, 0.08),
      rgba(168, 189, 185, 0.16) 54%,
      rgba(168, 189, 185, 0.3)
    ) !important;
}
html[data-theme="light"] .ca-hero-shade {
  background:
    radial-gradient(
      780px 520px at 20% 44%,
      rgba(72, 140, 147, 0.06),
      transparent 72%
    ),
    linear-gradient(
      180deg,
      rgba(244, 246, 242, 0.08),
      rgba(244, 246, 242, 0.15) 54%,
      rgba(244, 246, 242, 0.28)
    ) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-hero-copy > p {
  max-width: 54ch !important;
  padding: 16px 20px !important;
  border: 1px solid var(--nile-stroke2) !important;
  border-radius: 18px !important;
  background: var(--nile-panel-strong) !important;
  color: var(--theme-ink-muted) !important;
  font-size: clamp(15px, 1.02vw, 17px) !important;
  font-weight: 500;
  line-height: 1.9 !important;
  box-shadow: 0 12px 30px -25px rgba(20, 54, 59, 0.5);
  backdrop-filter: blur(18px) saturate(1.12) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-hero-field-note {
  background: var(--nile-panel-strong) !important;
  border: 1px solid var(--nile-stroke2) !important;
  color: var(--theme-ink) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"]) .ca-hero-field-note > p,
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-hero-field-note
  > div {
  color: var(--theme-ink-muted) !important;
}

/* Keep muted copy semantic: a global ink override makes dark editorial panels unreadable. */
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site
  :is(.ca-breadcrumb, .ca-card-meta, .ca-contact-location) {
  color: var(--nile-text2);
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is([class~="text-sky-600"], [class~="text-sky-700"]) {
  color: #075985 !important;
}
html[data-theme="mist"] [class~="text-emerald-600"],
html[data-theme="light"] [class~="text-emerald-600"] {
  color: #047857 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site
  :is(.ca-origin-year, .ca-chapter-number) {
  color: var(--nile-accent) !important;
  opacity: 1 !important;
}

/* Dark editorial panels retain their own light-ink palette in Mist and Light. */
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    .ca-reading,
    .nile-science-page .ca-science-invite,
    .nile-research-page .ca-science-invite
  ) {
  --nile-text: #f3f7f5;
  --nile-text2: #d1dfdc;
  --nile-text3: #bfd2ce;
  --foreground: #f3f7f5;
  --muted-foreground: #d1dfdc;
  color: #f3f7f5 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading-questions
  details {
  border-color: rgba(236, 248, 245, 0.24) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    .ca-reading,
    .nile-science-page .ca-science-invite,
    .nile-research-page .ca-science-invite
  )
  :is(
    h1,
    h2,
    h3,
    h4,
    p,
    li,
    small,
    label,
    summary,
    figcaption,
    [class~="text-sky-600"],
    [class~="text-sky-700"],
    [class~="text-emerald-600"]
  ) {
  color: #e1ebe8 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading
  :is(h1, h2, h3, h4, summary),
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    .nile-science-page .ca-science-invite,
    .nile-research-page .ca-science-invite
  )
  :is(h1, h2, h3, h4) {
  color: #f7faf8 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-principles
  > ol
  > li {
  color: #183438 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is([class~="bg-anti-flash-navy"], [class~="bg-[#0a2240]"]) {
  --foreground: #f3f7f5;
  --muted-foreground: #d1dfdc;
  --card-foreground: #f3f7f5;
  color: #f3f7f5;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is([class~="bg-anti-flash-navy"], [class~="bg-[#0a2240]"])
  :is(
    p,
    li,
    small,
    label,
    summary,
    figcaption,
    [class~="text-zinc-500"],
    [class~="text-zinc-600"],
    [class~="text-zinc-700"]
  ) {
  color: #d1dfdc !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is([class~="bg-anti-flash-navy"], [class~="bg-[#0a2240]"])
  :is(h1, h2, h3, h4) {
  color: #f7faf8 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-section-index::before {
  content: "";
  display: inline-block;
  flex: 0 0 22px;
  width: 22px;
  height: 2px;
  margin-inline-end: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--nile-cy), var(--nile-gr));
  vertical-align: middle;
}

/* Make the glass treatment legible and unmistakable instead of barely changing the old paper palette. */
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    .ca-catalog-card,
    .ca-page-intro,
    .ca-contact-form-panel,
    .ca-contact-address,
    .ca-access-form,
    .ca-source-content,
    .ca-source-route,
    .ca-company-origin,
    .ca-principles,
    .ca-dossier-download,
    .ca-pdp-gallery,
    .ca-pdp-summary,
    .atlas-gateway-card,
    .atlas-workspace-panel,
    .atlas-mode-panel,
    .atlas-journey-column,
    .atlas-search-result
  ) {
  border: 1px solid var(--nile-stroke2) !important;
  background: var(--nile-panel) !important;
  box-shadow:
    var(--nile-card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
  backdrop-filter: blur(16px) saturate(1.08);
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    .ca-card-circle,
    .ca-card-arrow,
    .ca-document-icon,
    .atlas-search-result-icon,
    .atlas-workspace-hero-icon,
    .atlas-journey-option-icon,
    .ca-hero-star
  ) {
  border: 1px solid var(--nile-stroke2) !important;
  background: linear-gradient(
    145deg,
    var(--nile-panel-strong),
    var(--nile-panel)
  ) !important;
  color: var(--nile-accent) !important;
  box-shadow:
    0 8px 20px -14px rgba(20, 59, 62, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site
  :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--nile-focus) !important;
  outline-offset: 3px !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site
  :is(input, select, textarea, [data-slot="input"]) {
  border-color: var(--nile-stroke2) !important;
  background: var(--nile-panel-strong) !important;
  color: var(--nile-text) !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site
  :is(input, textarea)::placeholder {
  color: var(--nile-text2) !important;
  opacity: 1 !important;
}

/* Clear theme identity at a glance: Mist is mid-tone sage glass; Light is bright paper glass. */
html[data-theme="mist"] body.ca-site {
  background-color: #a8bdb9 !important;
}
html[data-theme="light"] body.ca-site {
  background-color: #f4f6f2 !important;
}
@media (max-width: 760px) {
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-hero-copy > p {
    padding: 14px 16px !important;
    font-size: 15px !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-section-index::before {
    flex-basis: 16px;
    width: 16px;
    margin-inline-end: 7px;
  }
}

/* Clinical reference: widen the reading measure and turn the evidence catalogue
   into a calm, scan-friendly card grid without changing source order. */
.nile-science-page > section[id] {
  background: var(--nile-panel) !important;
}
.nile-science-page > section[id]:nth-of-type(even) {
  background: linear-gradient(
    145deg,
    rgba(194, 216, 207, 0.78),
    rgba(221, 233, 225, 0.8)
  ) !important;
}
.nile-science-page > section:not(:first-child) > .mx-auto.max-w-4xl {
  width: min(100%, 1240px);
  max-width: 1240px;
  padding-inline: clamp(18px, 3.4vw, 52px);
  padding-block: clamp(30px, 4vw, 50px);
}
.nile-science-page > section[id] > .mx-auto.max-w-4xl {
  width: min(100%, 1240px);
  max-width: 1240px;
  padding-inline: clamp(18px, 3.4vw, 52px);
  padding-block: clamp(34px, 4.5vw, 58px);
}
.nile-science-page > section[id] .mt-4.flex.flex-col.gap-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(14px, 1.7vw, 22px);
}
.nile-science-page > section[id] article {
  min-width: 0;
  height: 100%;
  padding: clamp(18px, 2vw, 26px);
  border-radius: 20px;
}
.nile-science-page .atlas-evidence-actions {
  gap: 9px;
  margin-top: auto;
  padding-top: 16px;
}
.nile-science-page [class~="overflow-x-auto"] {
  scrollbar-color: var(--nile-accent2) transparent;
}
@media (max-width: 860px) {
  .nile-science-page > section[id] .mt-4.flex.flex-col.gap-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .nile-science-page > section[id] > .mx-auto.max-w-4xl,
  .nile-science-page > section:not(:first-child) > .mx-auto.max-w-4xl {
    padding-inline: clamp(16px, 4vw, 28px);
  }
}

/* Dark utility surfaces use light copy without mutating the color token that paints them. */
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    [class~="bg-foreground"],
    [class~="bg-foreground/85"],
    [class~="bg-primary"]
  ) {
  color: #f3f7f5;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    [class~="bg-foreground"],
    [class~="bg-foreground/85"],
    [class~="bg-primary"]
  )
  :is(
    h1,
    h2,
    h3,
    h4,
    p,
    li,
    small,
    label,
    summary,
    figcaption,
    [class~="text-zinc-500"],
    [class~="text-zinc-600"],
    [class~="text-zinc-700"],
    [class~="text-foreground"],
    [class~="text-foreground/80"],
    [class~="text-foreground/85"],
    [class~="text-muted-foreground"],
    [class~="text-sky-600"],
    [class~="text-sky-700"],
    [class~="text-emerald-600"]
  ) {
  color: #d1dfdc !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    [class~="bg-foreground"],
    [class~="bg-foreground/85"],
    [class~="bg-primary"]
  )
  :is(h1, h2, h3, h4) {
  color: #f7faf8 !important;
}

/* Scientific reference pages use a deliberate dark end-cap, not white copy on a light glass panel. */
:is(html[data-theme="mist"], html[data-theme="light"])
  :is(
    .nile-science-page > section.ca-science-invite,
    .nile-research-page > section.ca-science-invite
  ) {
  border-color: rgba(235, 249, 244, 0.28) !important;
  background:
    radial-gradient(
      60% 110% at 8% 10%,
      rgba(105, 190, 177, 0.25),
      transparent 72%
    ),
    linear-gradient(135deg, #183b40, #1e5551 62%, #2e5b45) !important;
  box-shadow: 0 22px 50px -32px rgba(16, 49, 49, 0.72);
}

/* Green/cyan nature-glass direction for Mist. Keep live text and controls in HTML;
   use generated art only as decorative, contrast-controlled backgrounds. */
html[data-theme="mist"] .ca-home .ca-hero-photo {
  opacity: 0 !important;
}
html[data-theme="mist"] .ca-home .ca-hero::before {
  background:
    linear-gradient(
      110deg,
      rgba(8, 30, 29, 0.12),
      rgba(8, 30, 29, 0.04) 48%,
      rgba(8, 30, 29, 0.18)
    ),
    url("/art/theme/green-cyan-lake.jpg") 50% 54% / cover !important;
}
html[data-theme="mist"] .ca-home .ca-hero-copy {
  box-sizing: border-box;
  padding: clamp(22px, 3vw, 38px) !important;
  border: 1px solid rgba(226, 250, 243, 0.34);
  border-radius: 28px;
  background: linear-gradient(
    145deg,
    rgba(7, 33, 32, 0.78),
    rgba(10, 50, 47, 0.58)
  );
  box-shadow:
    0 28px 64px -34px rgba(1, 23, 23, 0.82),
    inset 0 1px 0 rgba(239, 255, 248, 0.18);
  color: #f3faf7 !important;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
html[data-theme="mist"] .ca-home .ca-hero-copy > p {
  max-width: 42ch !important;
  color: #dcebe7 !important;
}
html[data-theme="mist"] .ca-home .ca-hero h1 {
  color: #f6fbf8 !important;
}
html[data-theme="mist"] .ca-home .ca-hero h1 > span:last-child,
html[data-theme="mist"] .ca-home .ca-hero-second > span:last-child {
  background-image: linear-gradient(
    105deg,
    #eefbf6,
    #a9e8dc 60%,
    #dceca9
  ) !important;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="mist"] .ca-site .ca-science-invite-copy {
  position: relative;
  z-index: 2;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid rgba(230, 250, 245, 0.28);
  border-radius: 26px;
  background: linear-gradient(
    145deg,
    rgba(7, 34, 34, 0.58),
    rgba(10, 49, 45, 0.42)
  );
  box-shadow:
    0 22px 55px -36px rgba(1, 20, 21, 0.8),
    inset 0 1px 0 rgba(240, 255, 250, 0.12);
  backdrop-filter: blur(18px) saturate(1.14);
  -webkit-backdrop-filter: blur(18px) saturate(1.14);
}
html[data-theme="mist"] .ca-site .ca-science-invite-copy h2 {
  color: #f5fbf8 !important;
}
html[data-theme="mist"] .ca-site .ca-science-invite-copy > p {
  color: #d5e6e1 !important;
}
html[data-theme="mist"] .ca-site .ca-science-invite-copy > .ca-mono {
  color: #b5eee3 !important;
}
html[data-theme="mist"] .ca-site .ca-principles {
  background:
    linear-gradient(
      140deg,
      rgba(219, 237, 228, 0.87),
      rgba(197, 222, 211, 0.82)
    ),
    url("/art/theme/dew-botanical.jpg") center 48% / cover !important;
}
html[data-theme="mist"] .ca-site .ca-reading {
  background:
    linear-gradient(
      130deg,
      rgba(5, 35, 38, 0.78),
      rgba(9, 62, 57, 0.68) 54%,
      rgba(10, 42, 37, 0.82)
    ),
    url("/art/theme/dew-botanical.jpg") center 44% / cover !important;
}

@media (prefers-reduced-transparency: reduce) {
  html[data-theme="mist"] .ca-home .ca-hero-copy,
  html[data-theme="mist"] .ca-site .ca-science-invite-copy {
    background: rgba(8, 34, 33, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Keep the generated forest texture above the more specific exported section fills. */
html[data-theme="mist"]
  .ca-site
  :is(
    .ca-home .ca-science-invite,
    .nile-science-page > section.ca-science-invite,
    .nile-research-page > section.ca-science-invite
  ) {
  background:
    linear-gradient(
      130deg,
      rgba(5, 27, 29, 0.5),
      rgba(7, 42, 37, 0.38) 58%,
      rgba(7, 34, 32, 0.52)
    ),
    url("/art/theme/misty-evergreen.jpg") center 48% / cover !important;
}

/* Product gallery carousel: progressively enhanced; the exported radio/label gallery remains
   untouched until npf-theme.js has initialized the controls. */
.pd-gallery[data-carousel="ready"] .pd-stage {
  overflow: visible;
  isolation: isolate;
  touch-action: pan-y;
  perspective: 1000px;
  box-shadow: none;
  background: transparent;
}
.pd-gallery[data-carousel="ready"] .pd-slide {
  display: flex !important;
  inset: 5% 10%;
  width: 80%;
  height: 90%;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: clamp(18px, 2vw, 30px);
  background: #fff;
  box-shadow: 0 26px 54px -32px rgba(14, 37, 43, 0.52), 0 5px 14px rgba(14, 37, 43, 0.1);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(0.88);
  transition: transform 520ms cubic-bezier(.2,.72,.2,1), opacity 420ms ease, visibility 0s linear 520ms;
  will-change: transform, opacity;
}
.pd-gallery[data-carousel="ready"] .pd-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: clamp(12px, 3vw, 32px);
}
.pd-gallery[data-carousel="ready"] .pd-slide[data-position="active"] {
  z-index: 3;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition-delay: 0s;
}
.pd-gallery[data-carousel="ready"] .pd-slide[data-position="prev"],
.pd-gallery[data-carousel="ready"] .pd-slide[data-position="next"] {
  z-index: 2;
  opacity: .72;
  visibility: visible;
  transform: translate3d(calc(var(--carousel-direction, 1) * -108%), 0, 0) scale(.88);
  transition-delay: 0s;
}
.pd-gallery[data-carousel="ready"] .pd-slide[data-position="next"] {
  transform: translate3d(calc(var(--carousel-direction, 1) * 108%), 0, 0) scale(.88);
}
.pd-gallery[data-carousel="ready"] .pd-slide[data-position="hidden"] {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 0, 0) scale(.78);
}
.pd-gallery[data-carousel="ready"] .pd-stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 13% 13%;
  border-radius: 28px;
  background: color-mix(in srgb, var(--pd-brand, #176d72) 13%, white);
  filter: blur(26px);
  opacity: .6;
}
.pd-gallery[data-carousel="ready"] .pd-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 3px 9px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--pd-brand, #176d72) 42%, transparent) transparent;
}
.pd-gallery[data-carousel="ready"] .pd-thumbs label {
  flex: 0 0 68px;
  scroll-snap-align: center;
  opacity: .68;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.pd-gallery[data-carousel="ready"] .pd-thumbs label:hover { transform: translateY(-2px); }
.pd-gallery[data-carousel="ready"] .pd-thumbs label[aria-current="true"] {
  opacity: 1 !important;
  border-color: var(--pd-brand, #176d72) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pd-brand, #176d72) 16%, transparent), 0 8px 18px rgba(16, 45, 51, .14);
}
.pd-carousel-controls {
  position: absolute;
  z-index: 5;
  inset: 50% 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 0 clamp(2px, 2.5vw, 22px);
  transform: translateY(-50%);
  pointer-events: none;
}
.pd-carousel-controls button {
  display: grid;
  width: clamp(38px, 4vw, 48px);
  height: clamp(38px, 4vw, 48px);
  place-items: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  color: #17383d;
  background: rgba(250, 253, 251, .88);
  box-shadow: 0 8px 24px rgba(13, 39, 43, .2), inset 0 1px 0 white;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.pd-carousel-controls button:hover { transform: scale(1.08); background: #fff; box-shadow: 0 10px 28px rgba(13,39,43,.26); }
.pd-carousel-controls button:focus-visible,
.pd-gallery[data-carousel="ready"] .pd-thumbs label:focus-visible {
  outline: 3px solid var(--pd-brand, #176d72);
  outline-offset: 3px;
}
.pd-carousel-controls svg { width: 19px; height: 19px; }
.pd-carousel-status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.pd-gallery[data-carousel="ready"] .pd-g-radio:focus-visible ~ .pd-stage,
.pd-gallery[data-carousel="ready"] .pd-stage:focus-visible {
  outline: 3px solid var(--pd-brand, #176d72);
  outline-offset: 5px;
}
@media (max-width: 640px) {
  .pd-gallery[data-carousel="ready"] .pd-stage { aspect-ratio: 1 / 1.06; }
  .pd-gallery[data-carousel="ready"] .pd-slide { inset: 5% 8%; width: 84%; height: 90%; }
  .pd-gallery[data-carousel="ready"] .pd-slide[data-position="prev"] { transform: translate3d(calc(var(--carousel-direction, 1) * -106%), 0, 0) scale(.84); }
  .pd-gallery[data-carousel="ready"] .pd-slide[data-position="next"] { transform: translate3d(calc(var(--carousel-direction, 1) * 106%), 0, 0) scale(.84); }
  .pd-gallery[data-carousel="ready"] .pd-slide[data-position="prev"],
  .pd-gallery[data-carousel="ready"] .pd-slide[data-position="next"] { opacity: .58; }
  .pd-gallery[data-carousel="ready"] .pd-thumbs label { flex-basis: 58px; width: 58px; height: 58px; }
  .pd-carousel-controls { padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-gallery[data-carousel="ready"] .pd-slide,
  .pd-gallery[data-carousel="ready"] .pd-thumbs label,
  .pd-carousel-controls button { transition-duration: .01ms !important; }
}
html[dir="rtl"] .pd-carousel-controls [data-carousel-step="prev"] svg,
html[dir="rtl"] .pd-carousel-controls [data-carousel-step="next"] svg { transform: scaleX(-1); }


/* Final Mist/Light contrast pass for the visible homepage and reading section. */
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site .ca-header .ca-desktop-nav {
  min-height: 48px;
  padding: 4px 10px !important;
  border: 1px solid rgba(35, 75, 74, 0.22) !important;
  border-radius: 999px;
  background: rgba(224, 235, 229, 0.97) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 16px rgba(22, 55, 57, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site .ca-header .ca-desktop-nav > a {
  color: #17363a !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site .ca-header .ca-desktop-nav > a:hover,
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site .ca-header .ca-desktop-nav > a[aria-current="page"] {
  border-color: rgba(30, 92, 83, 0.2) !important;
  background: rgba(46, 126, 111, 0.13) !important;
  color: #103f42 !important;
}

/* The home hero already has a dark glass copy panel; remove the pale nested card that
   washed out its paragraph and make the live copy read directly against that panel. */
html[data-theme="mist"] .ca-home .ca-hero-copy > p {
  max-width: 42ch !important;
  margin-top: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #eff8f4 !important;
  font-size: clamp(15px, 1.02vw, 17px) !important;
  font-weight: 500 !important;
  line-height: 1.9 !important;
  text-shadow: 0 1px 10px rgba(2, 22, 22, 0.28);
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Keep the questions over the botanical image as dark glass, not pale cards with pale type. */
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading-questions details {
  border: 1px solid rgba(226, 246, 239, 0.28) !important;
  border-radius: 16px;
  background: rgba(7, 36, 35, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(239, 255, 248, 0.1),
    0 12px 28px rgba(0, 18, 19, 0.16) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading-questions details > summary {
  color: #f4faf7 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading-questions details > summary .ca-mono {
  color: #9fe5da !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading-questions .ca-details-sign {
  color: #9fe5da !important;
  opacity: 1 !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-reading-questions details > p {
  color: #d9e9e4 !important;
}
@media (prefers-reduced-transparency: reduce) {
  :is(html[data-theme="mist"], html[data-theme="light"])
    .ca-reading-questions details {
    background: #103f42 !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Header rebuild: one glass container, one transparent centered nav, and uniform actions.
   The exported bundle positioned/styled a second dark capsule over the glass bar; reset that
   layout here for the actual Arabic/English site header, not just the nav colors. */
@media (min-width: 1181px) {
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.28fr);
    align-items: center !important;
    justify-content: initial !important;
    gap: clamp(12px, 1.4vw, 22px) !important;
    padding-inline: clamp(14px, 1.8vw, 24px) !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header > .ca-brand {
    grid-column: 1;
    justify-self: start;
    min-width: 0;
    margin: 0 !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header > .ca-desktop-nav {
    position: static !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    grid-column: 2;
    justify-self: center;
    display: flex !important;
    align-items: center;
    gap: 4px !important;
    width: max-content;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-desktop-nav > a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 999px;
    background: transparent !important;
    color: #18383c !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-desktop-nav > a:hover,
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-desktop-nav > a[aria-current="page"] {
    border-color: rgba(31, 101, 91, 0.16) !important;
    background: rgba(37, 117, 104, 0.1) !important;
    color: #103f42 !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-desktop-nav > a::after {
    display: none !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header > .ca-header-actions {
    grid-column: 3;
    justify-self: end;
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    min-width: 0;
    margin: 0 !important;
  }
}

:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header .ca-brand {
  gap: 9px;
  padding-inline-end: 12px;
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header .ca-brand img {
  flex: 0 0 auto;
  width: 28px !important;
  height: 36px !important;
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header .ca-brand-copy {
  color: #18363a !important;
  font-size: 12px;
  line-height: 1.35;
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header .ca-brand-copy small {
  color: #405b5e !important;
  font-size: 9px !important;
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions .ca-header-icon,
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions [data-slot="button"],
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions .ca-language,
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions .ca-menu-button {
  box-sizing: border-box;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 1px solid rgba(28, 64, 67, 0.22) !important;
  border-radius: 50% !important;
  background: rgba(224, 235, 229, 0.94) !important;
  color: #17363a !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions .nile-install-launcher {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(28, 64, 67, 0.22);
  border-radius: 999px;
  background: rgba(224, 235, 229, 0.94);
  color: #17363a;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions .nile-install-launcher svg {
  width: 16px;
  height: 16px;
}
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-header-actions .ca-contact-top {
  min-height: 42px;
  height: 42px;
  gap: 8px;
  padding: 0 12px 0 15px;
  border: 0 !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    min-height: 64px !important;
    padding: 7px 12px !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-desktop-nav {
    display: none !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-desktop-tool,
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-contact-top {
    display: none !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-header-actions {
    display: flex !important;
    align-items: center;
    gap: 6px !important;
    margin: 0 !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-menu-button {
    display: flex !important;
  }
}
@media (max-width: 760px) {
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header {
    top: 8px !important;
    width: calc(100% - 20px) !important;
    min-height: 58px !important;
    margin: 8px auto 0 !important;
    padding: 6px 9px !important;
    border-radius: 20px !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-brand {
    gap: 7px;
    padding-inline-end: 8px;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-brand img {
    width: 25px !important;
    height: 32px !important;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header .ca-brand-copy small {
    display: none;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header-actions .ca-header-icon,
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header-actions [data-slot="button"],
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header-actions .ca-menu-button {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }
  /* Keep the install action, but make it a compact icon control so the mobile
     wordmark and all five utility actions fit without wrapping or clipping. */
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header-actions .nile-install-launcher {
    box-sizing: border-box;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-header-actions .nile-install-launcher-icon {
    width: 38px;
    height: 38px;
    background: transparent;
    color: inherit;
  }
}


/* Theme changes are visual only: keep header geometry fixed in Dark as well as Mist/Light. */
html[data-theme="dark"] .ca-site .ca-header .ca-brand-copy,
html[data-theme="dark"] .ca-site .ca-header .ca-brand-copy small {
  color: var(--nile-text) !important;
}
html[data-theme="dark"] .ca-site .ca-header .ca-brand-copy small {
  color: var(--nile-text3) !important;
}
html[data-theme="dark"] .ca-site .ca-header .ca-desktop-nav > a {
  color: var(--nile-text2) !important;
}
html[data-theme="dark"] .ca-site .ca-header .ca-desktop-nav > a:hover,
html[data-theme="dark"] .ca-site .ca-header .ca-desktop-nav > a[aria-current="page"] {
  border-color: var(--nile-hair) !important;
  background: var(--nile-tabOn) !important;
  color: var(--nile-text) !important;
}
html[data-theme="dark"] .ca-site .ca-header-actions .ca-header-icon,
html[data-theme="dark"] .ca-site .ca-header-actions [data-slot="button"],
html[data-theme="dark"] .ca-site .ca-header-actions .ca-language,
html[data-theme="dark"] .ca-site .ca-header-actions .ca-menu-button,
html[data-theme="dark"] .ca-site .ca-header-actions .nile-install-launcher {
  border-color: var(--nile-hair) !important;
  background: var(--nile-glass3) !important;
  color: var(--nile-text) !important;
}

/* Keep dark-theme hero callouts on the same content measure as the light themes. */
html[data-theme="dark"] .ca-hero-copy > p {
  box-sizing: border-box;
  max-width: 54ch !important;
  padding: 16px 20px !important;
  border: 1px solid var(--nile-stroke2) !important;
  border-radius: 18px !important;
  background: var(--nile-panel-strong) !important;
  color: var(--nile-text2) !important;
  font-size: clamp(15px, 1.02vw, 17px) !important;
  font-weight: 500;
  line-height: 1.9 !important;
  box-shadow: 0 12px 30px -25px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.12) !important;
  backdrop-filter: blur(18px) saturate(1.12) !important;
}
html[data-theme="dark"] .ca-hero-field-note {
  background: var(--nile-panel-strong) !important;
  border: 1px solid var(--nile-stroke2) !important;
  color: var(--nile-text) !important;
}
html[data-theme="dark"] .ca-hero-field-note > p,
html[data-theme="dark"] .ca-hero-field-note > div {
  color: var(--nile-text2) !important;
}

/* Equalize the content box in the home hero and science invitation across all three themes.
   Theme-specific colors remain separate; padding, widths, and text measures do not. */
:is(html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-home .ca-hero-copy {
  box-sizing: border-box;
  padding: clamp(22px, 3vw, 38px) !important;
  border: 1px solid transparent;
  border-radius: 28px;
}
:is(html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-home .ca-hero-copy > p {
  max-width: 42ch !important;
  margin-top: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: clamp(15px, 1.02vw, 17px) !important;
  font-weight: 500 !important;
  line-height: 1.9 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html[data-theme="light"] .ca-site .ca-home .ca-hero-copy > p {
  color: var(--theme-ink-muted) !important;
}
html[data-theme="dark"] .ca-site .ca-home .ca-hero-copy > p {
  color: var(--nile-text2) !important;
}
:is(html[data-theme="light"], html[data-theme="dark"])
  .ca-site .ca-science-invite-copy {
  box-sizing: border-box;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid transparent;
  border-radius: 26px;
}
@media (max-width: 760px) {
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-site .ca-catalog-grid {
    gap: 14px;
  }
  :is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
    .ca-section-index::before {
    flex-basis: 16px;
    width: 16px;
    margin-inline-end: 7px;
  }
}

/* TEMP shared landscape art across themes. Replace the Light and Dark treatments with
   theme-specific landscapes once their dedicated image sets are generated. */
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-home .ca-hero-photo {
  opacity: 0 !important;
}
html[data-theme="mist"] .ca-home .ca-hero::before {
  background:
    linear-gradient(
      110deg,
      rgba(8, 30, 29, 0.2),
      rgba(8, 30, 29, 0.04) 48%,
      rgba(8, 30, 29, 0.2)
    ),
    url("/art/theme/meadow-mist-hero.jpg") 50% 54% / cover !important;
}
html[data-theme="light"] .ca-home .ca-hero::before {
  background:
    linear-gradient(
      110deg,
      rgba(244, 246, 242, 0.08),
      rgba(244, 246, 242, 0.02) 48%,
      rgba(244, 246, 242, 0.12)
    ),
    url("/art/theme/meadow-mist-hero.jpg") 50% 54% / cover !important;
}
html[data-theme="dark"] .ca-home .ca-hero::before {
  background:
    linear-gradient(
      110deg,
      rgba(3, 16, 31, 0.42),
      rgba(3, 16, 31, 0.17) 48%,
      rgba(3, 16, 31, 0.38)
    ),
    url("/art/theme/meadow-mist-hero.jpg") 50% 54% / cover !important;
}

/* Shared temporary image for science/research invitation end-caps. */
:is(html[data-theme="mist"], html[data-theme="light"], html[data-theme="dark"])
  .ca-site
  :is(
    .ca-home .ca-science-invite,
    .nile-science-page > section.ca-science-invite,
    .nile-research-page > section.ca-science-invite
  ) {
  background:
    linear-gradient(
      130deg,
      rgba(5, 27, 29, 0.66),
      rgba(7, 42, 37, 0.48) 58%,
      rgba(7, 34, 32, 0.62)
    ),
    url("/art/theme/meadow-mist-tree.jpg") center 48% / cover !important;
}

/* Shared temporary bloom artwork for editorial/principles panels in all theme modes. */
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site .ca-principles {
  background:
    linear-gradient(
      140deg,
      rgba(219, 237, 228, 0.9),
      rgba(197, 222, 211, 0.84)
    ),
    url("/art/theme/meadow-mist-bloom.jpg") center 52% / cover !important;
}
html[data-theme="dark"] .ca-site .ca-principles {
  background:
    linear-gradient(
      140deg,
      rgba(5, 19, 34, 0.88),
      rgba(8, 34, 47, 0.8)
    ),
    url("/art/theme/meadow-mist-bloom.jpg") center 52% / cover !important;
}
:is(html[data-theme="mist"], html[data-theme="light"])
  .ca-site .ca-reading {
  background:
    linear-gradient(
      130deg,
      rgba(5, 35, 38, 0.82),
      rgba(9, 62, 57, 0.7) 54%,
      rgba(10, 42, 37, 0.84)
    ),
    url("/art/theme/meadow-mist-bloom.jpg") center 48% / cover !important;
}
html[data-theme="dark"] .ca-site .ca-reading {
  background:
    linear-gradient(
      130deg,
      rgba(3, 15, 30, 0.88),
      rgba(5, 27, 43, 0.76) 54%,
      rgba(3, 18, 32, 0.9)
    ),
    url("/art/theme/meadow-mist-bloom.jpg") center 48% / cover !important;
}
