/* Platform roles
   ==============
   Semantic tokens the platform needs that the Easy Group DS doesn't expose (yet), and the few DS
   component rules that read palette stops directly, re-pointed at those roles. Brand themes
   (css/themes/<brand>.css) retarget the platform by overriding roles here and DS tokens, never by
   writing selectors against components.

   Naming: a role that belongs in the DS uses the DS namespace (--ee-*) and is listed in
   Documentation/Reskin/README.md as a DS proposal. Platform-only roles use --ep-*.
   Sizes are px so themes behave the same on pages that still load the old 10px-root theme CSS. */

:root {
  /* Brand action role. DS gap: .ee-btn--primary, .ee-tag--brand, .ee-fin--brand, .ee-stat--brand,
     .ee-stats--tone-brand and .ee-bottomnav__badge read --ee-color-red-* directly. */
  --ee-color-bg-brand: var(--ee-color-red-600);
  --ee-color-bg-brand-hover: var(--ee-color-red-700);
  --ee-color-text-on-brand: var(--ee-color-white);
  --ee-color-text-brand-display: var(--ee-color-red-500);
  /* Gain colour. DS gap: .ee-move--up reads --ee-color-teal-700 directly (loss already uses the
     --ee-color-text-error role), so a partner can't recolour gains. */
  --ee-color-text-gain: var(--ee-color-teal-700);

  /* Shape roles. DS gap: buttons are hard-wired to radius-pill, and cards have no border or shadow
     role, so a theme could only change them by restyling the component. */
  --ee-radius-button: var(--ee-radius-pill);
  --ee-card-border-color: var(--ee-color-border-hairline);
  --ee-card-shadow: none;

  /* Shell (platform only): header, section nav, footer, app bar, bottom nav. */
  --ep-header-bg: var(--ee-color-bg-surface);
  --ep-header-fg: var(--ee-color-text-primary);
  --ep-header-border: var(--ee-color-border-hairline);
  --ep-header-icon: var(--ee-color-text-primary);
  --ep-nav-fg: var(--ee-color-text-tertiary);
  --ep-nav-fg-active: var(--ee-color-text-accent);
  --ep-nav-indicator: var(--ee-color-border-accent);
  --ep-footer-bg: var(--ee-color-bg-page);
  --ep-footer-fg: var(--ee-color-text-secondary);
  --ep-footer-border: var(--ee-color-border-hairline);
  --ep-appbar-bg: var(--ee-color-bg-page);
  --ep-appbar-fg: var(--ee-color-text-primary);
  --ep-bottomnav-bg: var(--ee-color-bg-surface);
  --ep-bottomnav-fg-active: var(--ee-color-text-accent);
  --ep-page-max: 1168px;      /* --ee-container-web (73rem) at the 16px base */
  --ep-page-gutter: 24px;     /* --ee-gutter-web */

  /* Logos never stretch: a fixed optical height per brand, width from the file's own ratio. */
  --ep-logo-h: 26px;
  --ep-logo-h-sm: 22px;
  --ep-logo-max-w: 220px;
  /* Header logo on desktop: the design's 136 x 19 (design review, 21 Nov 2026). The footer keeps --ep-logo-h. */
  --ep-header-logo-h: 19px;

  /* Account accent. The view sets --ep-account-tint / --ep-account-accent on the account switcher
     and page from the trading currency (DS AccountColours table); these are the fallbacks. */
  --ep-account-tint: var(--ee-color-pink-50);
  --ep-account-accent: var(--ee-color-red-600);

  /* Data series, in order (allocation, performance). Chart.js reads them with getComputedStyle. */
  --ep-chart-1: var(--ee-color-blue-400);
  --ep-chart-2: var(--ee-color-teal-400);
  --ep-chart-3: var(--ee-color-violet-500);
  --ep-chart-4: var(--ee-color-peach-300);
  --ep-chart-5: var(--ee-color-ink-300);
  --ep-chart-6: var(--ee-color-yellow-400);
  --ep-chart-7: var(--ee-color-pink-600);
  --ep-chart-8: var(--ee-color-teal-700);
  --ep-chart-empty: var(--ee-color-sand-100);
  --ep-chart-line: var(--ee-color-violet-500);
  --ep-chart-area: rgba(89, 49, 202, 0.14);
  --ep-chart-grid: var(--ee-color-border-hairline);
  --ep-chart-label: var(--ee-color-text-tertiary);
  /* Gain and loss in charts (sparklines and anything that shows direction by colour): the DS
     Movement colours, as the old sparklines' green and red. */
  --ep-chart-positive: var(--ee-color-teal-700);
  --ep-chart-negative: var(--ee-color-pink-600);
  /* Price/performance line for a period that went up or down. The old Highcharts charts coloured it
     green or red by the sign; the Easy prototype draws it violet whatever the sign, so both default
     to the line colour. SatrixNOW points them at its positive/negative colours. */
  --ep-chart-line-up: var(--ep-chart-line);
  --ep-chart-line-down: var(--ep-chart-line);

  /* Component shape and weight roles (DS proposals). Added for the SatrixNOW theme, which keeps
     Satrix's square, outlined look on the new components; the defaults are exactly what the DS
     hard-wires today, so the Easy skin doesn't change.
     Buttons: DS weight is bold and the border is --ee-border-width-control (shared with inputs). */
  --ee-btn-font-weight: var(--ee-font-weight-bold);
  --ee-btn-border-width: var(--ee-border-width-control);
  /* Secondary button: DS uses border-strong at rest and only darkens the border on hover. */
  --ee-btn-secondary-border: var(--ee-color-border-strong);
  --ee-btn-secondary-hover-bg: transparent;
  --ee-btn-secondary-hover-fg: var(--ee-color-text-primary);
  --ee-btn-secondary-hover-border: var(--ee-color-border-contrast);
  /* Segmented control (.ee-btn-group): DS hard-wires a pill track and a white selected item. */
  --ee-segmented-track-bg: var(--ee-color-bg-subtle);
  --ee-segmented-fg: var(--ee-color-text-tertiary);
  --ee-segmented-selected-bg: var(--ee-color-bg-surface);
  --ee-segmented-selected-fg: var(--ee-color-text-accent);
  --ee-radius-segmented: var(--ee-radius-pill);
  /* Table header cells: DS has no band colour or case for them. */
  --ee-table-head-bg: transparent;
  --ee-table-head-fg: var(--ee-color-text-tertiary);
  --ee-table-head-transform: none;
  /* FinancialValue amounts: DS hard-wires bold, and extrabold at the lg and display sizes. */
  --ee-fin-weight: var(--ee-font-weight-bold);
  --ee-fin-weight-large: var(--ee-font-weight-extrabold);
  /* Headings: base.css sets h1-h6 to --ee-font-weight-bold, the same token as every bold UI label,
     so a brand whose UI is regular-weight but whose headings are bold (SatrixNOW) can't split them. */
  --ee-font-weight-heading: var(--ee-font-weight-bold);
  /* Menu items: DS hard-wires semibold. */
  --ee-menu-item-weight: var(--ee-font-weight-semibold);
  /* Platform numbers (.ep-num in base.css) are bold Satoshi on the Easy skin. */
  --ep-num-weight: var(--ee-font-weight-bold);
}

/* DS patches: the component rules above, re-pointed at the roles. Same selectors as the DS so the
   cascade (this file loads after ds/components.css) is the only thing that changes. Delete each
   once the DS ships the role. */
.ee-btn { border-radius: var(--ee-radius-button); }
.ee-btn--primary {
  background: var(--ee-color-bg-brand);
  border-color: var(--ee-color-bg-brand);
  color: var(--ee-color-text-on-brand);
}
.ee-btn--primary:hover:not(:disabled) {
  background: var(--ee-color-bg-brand-hover);
  border-color: var(--ee-color-bg-brand-hover);
}
.ee-tag--brand { background: var(--ee-color-bg-brand); color: var(--ee-color-text-on-brand); }
.ee-fin--brand.ee-fin--display .ee-fin__amount,
.ee-stats--marketing.ee-stats--tone-brand .ee-stats__value,
.ee-stat--brand .ee-stat__value { color: var(--ee-color-text-brand-display); }
.ee-bottomnav__badge { background: var(--ee-color-bg-brand); }
.ee-move--up { color: var(--ee-color-text-gain); }
/* Outlined is the platform's everyday card (accounts, summaries, tables); raised and ink keep the
   DS elevation. */
.ee-card--outlined { border-color: var(--ee-card-border-color); box-shadow: var(--ee-card-shadow); }
.ee-table { border-color: var(--ee-card-border-color); box-shadow: var(--ee-card-shadow); }
/* Shape and weight roles (see :root above). */
.ee-btn { font-weight: var(--ee-btn-font-weight); border-width: var(--ee-btn-border-width); }
.ee-btn--secondary { border-color: var(--ee-btn-secondary-border); }
.ee-btn--secondary:hover:not(:disabled) {
  background: var(--ee-btn-secondary-hover-bg);
  color: var(--ee-btn-secondary-hover-fg);
  border-color: var(--ee-btn-secondary-hover-border);
}
.ee-btn-group { background: var(--ee-segmented-track-bg); border-radius: var(--ee-radius-segmented); }
.ee-btn-group__item { border-radius: var(--ee-radius-segmented); color: var(--ee-segmented-fg); }
.ee-btn-group__item--selected,
.ee-btn-group__item--selected:hover:not(:disabled) {
  background: var(--ee-segmented-selected-bg);
  color: var(--ee-segmented-selected-fg);
}
.ee-range { background: var(--ee-segmented-track-bg); border-radius: var(--ee-radius-segmented); }
.ee-range__segment { border-radius: var(--ee-radius-segmented); color: var(--ee-segmented-fg); }
.ee-range__segment--selected,
.ee-range__segment--selected:disabled {
  background: var(--ee-segmented-selected-bg);
  color: var(--ee-segmented-selected-fg);
}
/* Pill (.ee-pill--filter): radius and filter / selected colours as roles, each falling back to the DS value, so a page
   can give its pills a brand look (bundle amounts on SatrixNOW: pages/bundle.css). DS proposal: pill roles. */
.ee-pill { border-radius: var(--ee-pill-radius, var(--ee-radius-pill)); }
.ee-pill--filter {
  background: var(--ee-pill-filter-bg, transparent);
  border-color: var(--ee-pill-filter-border, var(--ee-color-border-hairline));
  color: var(--ee-pill-filter-fg, var(--ee-color-text-secondary));
}
/* Resting selected state only: the DS's own .ee-pill--selected:hover rule (accent border) must keep winning. */
.ee-pill--selected {
  background: var(--ee-pill-selected-bg, var(--ee-color-bg-accent-tint));
  color: var(--ee-pill-selected-fg, var(--ee-color-text-accent));
  border-color: var(--ee-pill-selected-border, var(--ee-color-border-accent-tint));
}
.ee-table__head {
  background: var(--ee-table-head-bg);
  color: var(--ee-table-head-fg);
  text-transform: var(--ee-table-head-transform);
}
.ee-menu__item { font-weight: var(--ee-menu-item-weight); }
.ee-fin__amount { font-weight: var(--ee-fin-weight); }
.ee-fin--lg .ee-fin__amount,
.ee-fin--display .ee-fin__amount { font-weight: var(--ee-fin-weight-large); }
/* The lg brand amount reads red-500 directly too (the display one is patched above). */
.ee-fin--brand.ee-fin--lg .ee-fin__amount { color: var(--ee-color-text-brand-display); }
/* DS heading styles that are bold by default (.ee-t-section-heading is extrabold and stays on that
   token). Dialog and sheet titles keep the UI bold token on purpose. */
.ee-t-display,
.ee-section-heading__title--heading { font-weight: var(--ee-font-weight-heading); }

/* Account colours (DS "AccountColours" table): each account takes the nearest light tint to its old
   brand colour. Views write the account's TradingCurrency.Colour, without '#', lower case, as
   data-ep-account="ed1747"; anything inside picks up --ep-account-tint / --ep-account-accent.
   Brand themes override these for partner tenants. */
[data-ep-account] { --ep-account-tint: var(--ee-color-bg-subtle); --ep-account-accent: var(--ee-color-ink-300); }
[data-ep-account="ed1747"], [data-ep-account="a3011c"] { --ep-account-tint: var(--ee-color-pink-50); --ep-account-accent: var(--ee-color-red-500); }   /* ZAR, KES */
[data-ep-account="00c1f3"], [data-ep-account="005a8f"] { --ep-account-tint: var(--ee-color-blue-50); --ep-account-accent: var(--ee-color-blue-400); }  /* USD, EasyProperties */
[data-ep-account="00968a"] { --ep-account-tint: var(--ee-color-teal-50); --ep-account-accent: var(--ee-color-teal-400); }                              /* AUD */
[data-ep-account="e9653a"] { --ep-account-tint: var(--ee-color-peach-50); --ep-account-accent: var(--ee-color-peach-300); }                            /* EUR */
[data-ep-account="c12583"], [data-ep-account="7551a6"], [data-ep-account="520fb7"] { --ep-account-tint: var(--ee-color-violet-100); --ep-account-accent: var(--ee-color-violet-500); } /* GBP, TFSA, EasyCrypto */
[data-ep-account="e5be4e"] { --ep-account-tint: var(--ee-color-yellow-50); --ep-account-accent: var(--ee-color-yellow-400); }                          /* BEE */

/* Account colours by trading currency. The rules above key on the account's colour as stored in the
   database, which varies by environment; these key on the trading currency (GT247TradingCurrencyEnum
   name, lower case) that views write as data-ep-tc, so the DS AccountColours table holds wherever it
   runs. Same specificity as the colour rules and later in the file, so they win; brand themes on
   [data-brand] [data-ep-account] still win over both. Demo accounts take their currency's tint. */
[data-ep-tc="zarreal"], [data-ep-tc="zarsimulated"], [data-ep-tc="kesreal"] { --ep-account-tint: var(--ee-color-pink-50); --ep-account-accent: var(--ee-color-red-500); }
[data-ep-tc="usdreal"], [data-ep-tc="usddemo"], [data-ep-tc="easypropertieszar"] { --ep-account-tint: var(--ee-color-blue-50); --ep-account-accent: var(--ee-color-blue-400); }
[data-ep-tc="audreal"], [data-ep-tc="auddemo"] { --ep-account-tint: var(--ee-color-teal-50); --ep-account-accent: var(--ee-color-teal-400); }
[data-ep-tc="eurreal"] { --ep-account-tint: var(--ee-color-peach-50); --ep-account-accent: var(--ee-color-peach-300); }
[data-ep-tc="gbpreal"], [data-ep-tc="zartfsa"] { --ep-account-tint: var(--ee-color-violet-100); --ep-account-accent: var(--ee-color-violet-500); }
[data-ep-tc="beezar"] { --ep-account-tint: var(--ee-color-yellow-50); --ep-account-accent: var(--ee-color-yellow-400); }

/* DS checkbox under MVC's CheckBoxFor, which writes its hidden "false" input straight after the checkbox, between the
   input and .ee-checkbox__box: the DS's "input + box" state rules miss it. Same rules across the hidden input. */
.ee-checkbox__input:hover:not(:disabled) + input[type="hidden"] + .ee-checkbox__box { border-color: var(--ee-color-border-strong); }
.ee-checkbox__input:checked + input[type="hidden"] + .ee-checkbox__box { background: var(--ee-color-bg-accent); border-color: var(--ee-color-border-accent); }
.ee-checkbox__input:checked + input[type="hidden"] + .ee-checkbox__box .ee-checkbox__mark { opacity: 1; transform: none; }
.ee-checkbox__input:focus-visible + input[type="hidden"] + .ee-checkbox__box { outline: var(--ee-border-width-emphasis) solid var(--ee-color-border-accent); outline-offset: 2px; }
.ee-checkbox--error .ee-checkbox__input:checked + input[type="hidden"] + .ee-checkbox__box { background: var(--ee-color-pink-600); border-color: var(--ee-color-border-error); }
.ee-checkbox__input:disabled + input[type="hidden"] + .ee-checkbox__box { background: var(--ee-color-bg-muted); border-color: var(--ee-color-border-hairline); color: var(--ee-color-text-tertiary); --ee-color-text-tertiary: var(--ee-color-text-tertiary-on-fill); }
