/* =====================================================================
   Ari Growth — dark mode
   Loaded last. Overrides the color variables from styles.css and theme.css.
   "Match my device" follows the system setting; Light or Dark (user menu)
   sets data-theme on <html> and wins over the system.
   Feature panels (sign-in, hero cards, the Ari Way header) stay dark in
   both modes, and Ari yellow keeps its near-black text.
   ===================================================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  /* base */
  --ari-bg: #121316;
  --ari-fg: #F2F2F3;
  --ari-fg-rgb: 242 242 243;
  --ari-ink: #F2F2F3;
  --ari-ink-800: rgba(255,255,255,.90);
  --ari-ink-700: rgba(255,255,255,.84);
  --ari-ink-600: rgba(255,255,255,.72);
  --ari-ink-500: rgba(255,255,255,.58);
  --ari-ink-400: rgba(255,255,255,.45);
  --ari-ink-300: rgba(255,255,255,.28);
  --ari-ink-200: rgba(255,255,255,.18);
  --ari-ink-100: rgba(255,255,255,.10);
  --ari-ink-050: rgba(255,255,255,.06);
  --ari-on-ink: #121316;
  /* surfaces */
  --ari-border: #2E3138;
  --ari-surface: #1B1D21;
  --ari-surface-raised: #23262B;
  --ari-surface-alt: #1E2024;
  --ari-surface-hover: #2A2D33;
  --ari-surface-pressed: #30343A;
  --ari-surface-sunken: #15171A;
  --ari-surface-stepper-active: #3A3E45;
  --ari-input-bg-hover: #2A2D33;
  --topbar-bg: rgba(18,19,22,.92);
  /* inverse (small dark chips become light) */
  --ari-inverse-bg: #E9E9EB;
  --ari-inverse-bg-hover: #D4D4D8;
  --ari-inverse-fg: #121316;
  --ari-inverse-scrim: rgba(44,47,54,.97);
  /* status */
  --ari-positive: #8CC29A;
  --ari-positive-bg: rgba(140,194,154,.16);
  --ari-positive-border: rgba(140,194,154,.45);
  --ari-negative: #E8958C;
  --ari-negative-bg: rgba(232,149,140,.14);
  --ari-negative-border: rgba(232,149,140,.45);
  --ari-warning-fg: #F3D27A;
  --ari-warning-bg: rgba(255,198,7,.14);
  --ari-warning-border: rgba(255,198,7,.35);
  --ari-flag-hot-bg: #3A2419;
  --ari-flag-hot-fg: #F4A97F;
  --ari-flag-default-bg: #2A2D33;
  --ari-flag-default-fg: #C9CED6;
  --ari-hairline: 1px solid rgba(255,255,255,.06);
  --ari-hairline-strong: 1px solid rgba(255,255,255,.18);
  --ari-border-selected: 1.5px solid #F2F2F3;
  --ari-border-dashed: 1.5px dashed rgba(255,255,255,.28);
  --ari-shadow-flag: 0 1px 2px rgba(0,0,0,.5);
  --ari-shadow-floating: 0 14px 34px rgba(0,0,0,.6);
  /* brand on dark: yellow stays yellow; tints become translucent glows */
  --accent-deep: #FFC607;
  --accent-tint: rgba(255,198,7,.10);
  --accent-tint-hover: rgba(255,198,7,.18);
  --accent-line: rgba(255,198,7,.38);
  --brand-gold-text: #E2BE5C;
  --brand-gold-tint: rgba(196,154,42,.14);
  --brand-gold-line: rgba(196,154,42,.42);
  --brand-charcoal: #26282D;
  --level-accent-text: #FFC607;
  --level-tint: rgba(255,198,7,.10);
  --level-line: rgba(255,198,7,.38);
  --proto-fg: #F3D27A;
  --tip-green-bg: rgba(140,194,154,.10);
  --tip-green-line: rgba(140,194,154,.35);
  --tip-gray-bg: #1E2024;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* base */
    --ari-bg: #121316;
    --ari-fg: #F2F2F3;
    --ari-fg-rgb: 242 242 243;
    --ari-ink: #F2F2F3;
    --ari-ink-800: rgba(255,255,255,.90);
    --ari-ink-700: rgba(255,255,255,.84);
    --ari-ink-600: rgba(255,255,255,.72);
    --ari-ink-500: rgba(255,255,255,.58);
    --ari-ink-400: rgba(255,255,255,.45);
    --ari-ink-300: rgba(255,255,255,.28);
    --ari-ink-200: rgba(255,255,255,.18);
    --ari-ink-100: rgba(255,255,255,.10);
    --ari-ink-050: rgba(255,255,255,.06);
    --ari-on-ink: #121316;
    /* surfaces */
    --ari-border: #2E3138;
    --ari-surface: #1B1D21;
    --ari-surface-raised: #23262B;
    --ari-surface-alt: #1E2024;
    --ari-surface-hover: #2A2D33;
    --ari-surface-pressed: #30343A;
    --ari-surface-sunken: #15171A;
    --ari-surface-stepper-active: #3A3E45;
    --ari-input-bg-hover: #2A2D33;
    --topbar-bg: rgba(18,19,22,.92);
    /* inverse (small dark chips become light) */
    --ari-inverse-bg: #E9E9EB;
    --ari-inverse-bg-hover: #D4D4D8;
    --ari-inverse-fg: #121316;
    --ari-inverse-scrim: rgba(44,47,54,.97);
    /* status */
    --ari-positive: #8CC29A;
    --ari-positive-bg: rgba(140,194,154,.16);
    --ari-positive-border: rgba(140,194,154,.45);
    --ari-negative: #E8958C;
    --ari-negative-bg: rgba(232,149,140,.14);
    --ari-negative-border: rgba(232,149,140,.45);
    --ari-warning-fg: #F3D27A;
    --ari-warning-bg: rgba(255,198,7,.14);
    --ari-warning-border: rgba(255,198,7,.35);
    --ari-flag-hot-bg: #3A2419;
    --ari-flag-hot-fg: #F4A97F;
    --ari-flag-default-bg: #2A2D33;
    --ari-flag-default-fg: #C9CED6;
    --ari-hairline: 1px solid rgba(255,255,255,.06);
    --ari-hairline-strong: 1px solid rgba(255,255,255,.18);
    --ari-border-selected: 1.5px solid #F2F2F3;
    --ari-border-dashed: 1.5px dashed rgba(255,255,255,.28);
    --ari-shadow-flag: 0 1px 2px rgba(0,0,0,.5);
    --ari-shadow-floating: 0 14px 34px rgba(0,0,0,.6);
    /* brand on dark: yellow stays yellow; tints become translucent glows */
    --accent-deep: #FFC607;
    --accent-tint: rgba(255,198,7,.10);
    --accent-tint-hover: rgba(255,198,7,.18);
    --accent-line: rgba(255,198,7,.38);
    --brand-gold-text: #E2BE5C;
    --brand-gold-tint: rgba(196,154,42,.14);
    --brand-gold-line: rgba(196,154,42,.42);
    --brand-charcoal: #26282D;
    --level-accent-text: #FFC607;
    --level-tint: rgba(255,198,7,.10);
    --level-line: rgba(255,198,7,.38);
    --proto-fg: #F3D27A;
    --tip-green-bg: rgba(140,194,154,.10);
    --tip-green-line: rgba(140,194,154,.35);
    --tip-gray-bg: #1E2024;
  }
}

/* ---------- components that need a hand in dark mode ----------
   Feature panels stay dark, so their text stays white; the charcoal outline and the
   active menu tab need more contrast against the dark page. */
:root[data-theme="dark"] .rs-head, :root[data-theme="dark"] .rs-head h2, :root[data-theme="dark"] .rs-logo, :root[data-theme="dark"] .rs-logo .logo-mark, :root[data-theme="dark"] .rs-logo .logo-sub, :root[data-theme="dark"] .confidential, :root[data-theme="dark"] .login-brand { color: #fff; }
:root[data-theme="dark"] .rs-head .muted, :root[data-theme="dark"] .confidential svg { color: rgba(255,255,255,.72); }
:root[data-theme="dark"] .stats:not(.ov-stats) .stat:nth-child(3) { border-color: var(--ari-ink-300); }
:root[data-theme="dark"] .topnav a.active { background: var(--ari-ink); color: var(--ari-on-ink); }
:root[data-theme="dark"] .btn-outline { border-color: var(--ari-ink-400); }
:root[data-theme="dark"] .hero-card, :root[data-theme="dark"] .you-card, :root[data-theme="dark"] .doc-hero-ariWay { box-shadow: inset 0 0 0 1px var(--ari-border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rs-head, :root:not([data-theme="light"]) .rs-head h2, :root:not([data-theme="light"]) .rs-logo, :root:not([data-theme="light"]) .rs-logo .logo-mark, :root:not([data-theme="light"]) .rs-logo .logo-sub, :root:not([data-theme="light"]) .confidential, :root:not([data-theme="light"]) .login-brand { color: #fff; }
  :root:not([data-theme="light"]) .rs-head .muted, :root:not([data-theme="light"]) .confidential svg { color: rgba(255,255,255,.72); }
  :root:not([data-theme="light"]) .stats:not(.ov-stats) .stat:nth-child(3) { border-color: var(--ari-ink-300); }
  :root:not([data-theme="light"]) .topnav a.active { background: var(--ari-ink); color: var(--ari-on-ink); }
  :root:not([data-theme="light"]) .btn-outline { border-color: var(--ari-ink-400); }
  :root:not([data-theme="light"]) .hero-card, :root:not([data-theme="light"]) .you-card, :root:not([data-theme="light"]) .doc-hero-ariWay { box-shadow: inset 0 0 0 1px var(--ari-border); }
}
