/* =====================================================================
   Eternal Funding - design system
   One stylesheet for the trader app. Dark surfaces, one gold, Inter.

   How it is organised
     1. Font
     2. Tokens (colour, type, spacing, radii, elevation, layout)
     3. Base (scoped to body.ef: every trader page sets it)
     4. App shell (sidebar, topbar, content, mobile nav) - applies everywhere
     5. Components (page header, cards, stats, tables, buttons, forms,
        tabs, badges, progress, steps, empty states, alerts, modals,
        charts, lists, auth layout, grid list, toolbar, spinner, toggle,
        objectives, prose)
     6. Utilities
     7. Page sections (only what a page cannot express with components)

   Naming: every class is prefixed ef-. Pages carry no <style> blocks;
   page-specific rules live in section 7, scoped to body.ef-page-<name>.
   Element-level rules only apply under body.ef. admin/ has its own CSS.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Font - Inter variable, self-hosted (fonts/inter-var.woff2)
   --------------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------------------------------
   2. Tokens
   --------------------------------------------------------------------- */
:root {
    /* Surfaces: separated by tone and hairlines, not glow */
    --ef-bg:          #0b0b0c;   /* app background */
    --ef-surface:     #121214;   /* cards, sidebar */
    --ef-surface-2:   #18181b;   /* inputs, raised rows, hover */
    --ef-surface-3:   #1f1f23;   /* active / pressed / table head */
    --ef-line:        rgba(255, 255, 255, 0.07);
    --ef-line-strong: rgba(255, 255, 255, 0.12);

    /* Text (all pass WCAG AA on --ef-surface-3 and darker) */
    --ef-text:   #ededef;        /* primary */
    --ef-text-2: #a8a8b0;        /* secondary */
    --ef-text-3: #8b8b94;        /* muted, captions, table heads */

    /* The one gold. Primary actions, active nav, key figures only. */
    --ef-gold:        #f0b429;
    --ef-gold-hover:  #f6c552;
    --ef-gold-press:  #d99e17;
    --ef-gold-ink:    #1a1305;   /* text on gold */
    --ef-gold-tint:   rgba(240, 180, 41, 0.10);
    --ef-gold-line:   rgba(240, 180, 41, 0.32);

    /* Semantic */
    --ef-pos:       #3fcf8e;
    --ef-pos-tint:  rgba(63, 207, 142, 0.10);
    --ef-neg:       #f47272;
    --ef-neg-tint:  rgba(244, 114, 114, 0.10);
    --ef-warn:      #e9a23b;
    --ef-warn-tint: rgba(233, 162, 59, 0.10);
    --ef-info:      #8db4ff;
    --ef-info-tint: rgba(141, 180, 255, 0.10);

    /* Chart palette (Chart.js configs use these hex values; keep in sync) */
    --ef-chart-1: #f0b429;       /* primary series: equity, balance */
    --ef-chart-2: #8b8b94;       /* comparison / benchmark */
    --ef-chart-3: #3fcf8e;       /* profit */
    --ef-chart-4: #f47272;       /* loss */
    --ef-chart-5: #8db4ff;       /* extra category */
    --ef-chart-grid: rgba(255, 255, 255, 0.06);

    /* Type */
    --ef-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ef-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --ef-fs-xs:  0.75rem;    /* 12 captions, badges */
    --ef-fs-sm:  0.8125rem;  /* 13 secondary, tables */
    --ef-fs-md:  0.875rem;   /* 14 body */
    --ef-fs-lg:  1rem;       /* 16 card titles */
    --ef-fs-xl:  1.25rem;    /* 20 section titles */
    --ef-fs-2xl: 1.5rem;     /* 24 page titles, stat values */
    --ef-fs-3xl: 2rem;       /* 32 hero figures */
    --ef-lh: 1.5;
    --ef-lh-tight: 1.2;

    /* Spacing (4px base) */
    --ef-s1: 4px;
    --ef-s2: 8px;
    --ef-s3: 12px;
    --ef-s4: 16px;
    --ef-s5: 20px;
    --ef-s6: 24px;
    --ef-s8: 32px;
    --ef-s10: 40px;
    --ef-s12: 48px;

    /* Radii */
    --ef-r-sm: 6px;
    --ef-r:    10px;
    --ef-r-lg: 14px;

    /* Elevation: kept low; only floating layers get a real shadow */
    --ef-e1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --ef-e2: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--ef-line-strong);

    /* Layout */
    --ef-sidebar-w: 240px;
    --ef-topbar-h: 56px;
    --ef-content-max: 1280px;
    --ef-ease: cubic-bezier(0.2, 0.7, 0.3, 1);

}

/* ---------------------------------------------------------------------
   3. Base - converted pages only (body.ef). Wrapped in :where() so
   element defaults never outrank a component class.
   --------------------------------------------------------------------- */
:where(body.ef),
:where(body.ef) *,
:where(body.ef) *::before,
:where(body.ef) *::after { box-sizing: border-box; }

html:has(body.ef) { background: var(--ef-bg); }

body.ef {
    margin: 0;
    min-height: 100vh;
    background: var(--ef-bg);
    color: var(--ef-text);
    font-family: var(--ef-font);
    font-size: var(--ef-fs-md);
    line-height: var(--ef-lh);
    font-feature-settings: 'cv11', 'ss01';
    font-variant-numeric: tabular-nums;   /* every figure lines up */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
:where(body.ef) :where(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    font-weight: 600;
    line-height: var(--ef-lh-tight);
    letter-spacing: -0.011em;
    color: var(--ef-text);
}
:where(body.ef) :where(p) { margin: 0; }
/* Prose keeps proportional figures and punctuation: Inter's tnum also widens
   the hyphen, which looks spaced out in words like "Two-Stage". Zero
   specificity, so any figure component (.ef-stat-value, .ef-figure, .ef-num,
   tables, .ef-dl values, progress values) still gets tabular numbers. */
:where(body.ef) :where(h1, h2, h3, h4, h5, h6, p, label, li, small, .ef-page-sub, .ef-card-sub, .ef-section-sub,
    .ef-alert, .ef-help, .ef-empty-text, .ef-badge, .ef-btn, .ef-nav-link, .ef-tab, .ef-modal, .ef-check,
    .ef-stat-meta, .ef-step, .ef-dl-row dt, .ef-auth-sub, .ef-list-sub, .ef-list-title, .ef-progress-label, .ef-crumbs, .ef-menu,
    .ef-gt-title, .ef-gt-sub, .ef-table td.wrap, .ef-prose) { font-variant-numeric: normal; }
:where(body.ef) :where(a) { color: inherit; text-decoration: none; }
:where(body.ef) :where(img, svg) { display: block; max-width: 100%; }
:where(body.ef) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(body.ef) :where(button) { cursor: pointer; }
body.ef ::selection { background: rgba(240, 180, 41, 0.28); color: #fff; }
:where(body.ef) :focus-visible { outline: 2px solid var(--ef-gold); outline-offset: 2px; }
body.ef [hidden] { display: none !important; }

/* Quiet dark scrollbars */
body.ef, body.ef * { scrollbar-width: thin; scrollbar-color: #2e2e33 transparent; }
body.ef ::-webkit-scrollbar { width: 10px; height: 10px; }
body.ef ::-webkit-scrollbar-thumb { background: #2a2a2f; border: 2px solid var(--ef-bg); border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
    body.ef *, body.ef *::before, body.ef *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------------
   4. App shell
   Selectors pair the ef- class with the older class names (.sidebar,
   .topbar) that the shell scripts still look up.
   --------------------------------------------------------------------- */
.ef-shell { min-height: 100vh; background: var(--ef-bg); }

/* 4a. Sidebar */
.sidebar.ef-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--ef-sidebar-w);
    min-width: 0;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--ef-surface);
    border: 0;
    border-right: 1px solid var(--ef-line);
    border-radius: 0;
    box-shadow: none;
    transform: none;
    font-family: var(--ef-font);
    font-size: var(--ef-fs-md);
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    color: var(--ef-text-2);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
.sidebar.ef-sidebar::before, .sidebar.ef-sidebar::after { content: none; display: none; }
.ef-sidebar *, .ef-sidebar *::before, .ef-sidebar *::after { box-sizing: border-box; }
.ef-sidebar a { text-decoration: none; }

.ef-sidebar-brand {
    display: flex;
    align-items: center;
    height: var(--ef-topbar-h);
    padding: 0 var(--ef-s5);
    border-bottom: 1px solid var(--ef-line);
    flex-shrink: 0;
}
.ef-sidebar-brand img { height: 26px; width: auto; display: block; }

.ef-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--ef-s4) var(--ef-s3);
}
.ef-nav-section + .ef-nav-section { margin-top: var(--ef-s5); }
.ef-nav-label {
    padding: 0 var(--ef-s3) var(--ef-s2);
    font-size: var(--ef-fs-xs);
    font-weight: 500;
    color: var(--ef-text-3);
    letter-spacing: 0;
    text-transform: none;
}
.ef-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--ef-s3);
    height: 36px;
    padding: 0 var(--ef-s3);
    margin: 1px 0;
    border-radius: var(--ef-r-sm);
    color: var(--ef-text-2);
    font-size: var(--ef-fs-md);
    font-weight: 500;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}
.ef-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.ef-nav-link:hover { background: var(--ef-surface-2); color: var(--ef-text); }
.ef-nav-link.active { background: var(--ef-surface-3); color: var(--ef-text); }
.ef-nav-link.active svg { color: var(--ef-gold); opacity: 1; }
.ef-nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 2px;
    background: var(--ef-gold);
}
.ef-nav-link .ef-nav-ext { margin-left: auto; width: 14px; height: 14px; opacity: .5; }

.ef-sidebar-foot {
    flex-shrink: 0;
    padding: var(--ef-s4);
    border-top: 1px solid var(--ef-line);
    display: grid;
    gap: var(--ef-s3);
}
.ef-sidebar-foot small { font-size: var(--ef-fs-xs); color: var(--ef-text-3); text-align: center; }

.ef-sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ef-line-strong);
    border-radius: var(--ef-r-sm);
    background: var(--ef-surface-2);
    color: var(--ef-text-2);
    cursor: pointer;
    padding: 0;
}
.ef-sidebar-close svg { width: 18px; height: 18px; }

.mobile-nav-overlay.ef-overlay {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    display: block;
}
.mobile-nav-overlay.ef-overlay.active { opacity: 1; visibility: visible; }

/* 4b. Main column */
.ef-main {
    margin-left: var(--ef-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ef-content {
    width: 100%;
    max-width: calc(var(--ef-content-max) + 2 * var(--ef-s8));
    margin: 0 auto;
    padding: var(--ef-s8);
    flex: 1;
    min-width: 0;
}

/* 4c. Topbar */
.topbar.ef-topbar {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 30;
    width: auto;
    height: var(--ef-topbar-h);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--ef-s4);
    padding: 0 var(--ef-s8);
    background: rgba(11, 11, 12, 0.96);
    border: 0;
    border-bottom: 1px solid var(--ef-line);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
    font-family: var(--ef-font);
    font-size: var(--ef-fs-md);
    line-height: 1.5;
    color: var(--ef-text-2);
    -webkit-font-smoothing: antialiased;
}
.topbar.ef-topbar::before, .topbar.ef-topbar::after { content: none; display: none; }
.ef-topbar *, .ef-topbar *::before, .ef-topbar *::after { box-sizing: border-box; }
.ef-topbar a { text-decoration: none; }
.ef-topbar-left { display: flex; align-items: center; gap: var(--ef-s3); flex: 1; min-width: 0; }
.ef-topbar-right { display: flex; align-items: center; gap: var(--ef-s3); }

.ef-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ef-line-strong);
    border-radius: var(--ef-r-sm);
    background: transparent;
    color: var(--ef-text);
    cursor: pointer;
    padding: 0;
}
.ef-menu-toggle svg { width: 18px; height: 18px; }
.ef-topbar-logo { display: none; height: 22px; width: auto; }

.ef-crumbs { display: flex; align-items: center; gap: var(--ef-s2); min-width: 0; font-size: var(--ef-fs-sm); }
.ef-crumbs a { color: var(--ef-text-3); }
.ef-crumbs a:hover { color: var(--ef-text); }
.ef-crumbs svg { width: 14px; height: 14px; color: var(--ef-text-3); flex-shrink: 0; }
.ef-crumbs .active { color: var(--ef-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ef-dropdown { position: relative; }
.ef-user-btn {
    display: flex;
    align-items: center;
    gap: var(--ef-s2);
    height: 36px;
    padding: 0 var(--ef-s2) 0 4px;
    border: 1px solid transparent;
    border-radius: var(--ef-r-sm);
    background: transparent;
    color: var(--ef-text);
    font-size: var(--ef-fs-sm);
    font-weight: 500;
    cursor: pointer;
}
.ef-user-btn:hover { background: var(--ef-surface-2); border-color: var(--ef-line); }
.ef-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--ef-surface-3); }
.ef-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ef-avatar-lg { width: 40px; height: 40px; }
.ef-user-btn .ef-caret { width: 14px; height: 14px; color: var(--ef-text-3); }

.dropdown-menu.ef-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    min-width: 260px;
    padding: var(--ef-s2);
    background: var(--ef-surface-2);
    border: 0;
    border-radius: var(--ef-r);
    box-shadow: var(--ef-e2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s var(--ef-ease), visibility .15s;
}
.dropdown-menu.ef-menu.visible { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu.ef-menu.hidden { display: none; }
.ef-menu-head { display: flex; align-items: center; gap: var(--ef-s3); padding: var(--ef-s3); }
.ef-menu-name { color: var(--ef-text); font-weight: 600; font-size: var(--ef-fs-md); }
.ef-menu-email { color: var(--ef-text-3); font-size: var(--ef-fs-xs); word-break: break-all; }
.ef-menu-role { color: var(--ef-text-2); font-size: var(--ef-fs-xs); margin-top: 2px; }
.ef-menu-sep { height: 1px; background: var(--ef-line); margin: var(--ef-s1) 0; }
.ef-menu-item {
    display: flex;
    align-items: center;
    gap: var(--ef-s3);
    padding: 0 var(--ef-s3);
    height: 36px;
    border-radius: var(--ef-r-sm);
    color: var(--ef-text-2);
    font-size: var(--ef-fs-sm);
    font-weight: 500;
}
.ef-menu-item svg { width: 16px; height: 16px; }
.ef-menu-item:hover { background: var(--ef-surface-3); color: var(--ef-text); }
.ef-menu-item.is-danger:hover { color: var(--ef-neg); }

/* Toasts the topbar script creates (.temp-notification) */
.temp-notification { font-family: var(--ef-font) !important; }

/* Platform picker the sidebar script can create (.modal-overlay > .platform-btn) */
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}
.platform-btn {
    display: block;
    width: 100%;
    padding: var(--ef-s3) var(--ef-s4);
    border: 1px solid var(--ef-line-strong);
    border-radius: var(--ef-r);
    background: var(--ef-surface-2);
    color: var(--ef-text);
    text-align: left;
    cursor: pointer;
    font-family: var(--ef-font);
    font-size: var(--ef-fs-md);
}
.platform-btn:hover { background: var(--ef-surface-3); border-color: var(--ef-gold-line); }

/* 4d. Mobile bottom navigation */
.mobile-bottom-nav.ef-mobile-nav { display: none; }

/* 4e. Footer (footer.php; no trader page includes it any more, kept for any stray include) */
.ef-footer {
    margin-top: var(--ef-s10);
    padding: var(--ef-s6) var(--ef-s8);
    border-top: 1px solid var(--ef-line);
    font-family: var(--ef-font);
    font-size: var(--ef-fs-xs);
    color: var(--ef-text-3);
    text-align: center;
}
.ef-footer p { margin: 0; }
.ef-footer p + p { margin-top: var(--ef-s1); }

/* 4f. Shell responsive */
@media (max-width: 1024px) {
    .ef-content { padding: var(--ef-s6); }
    .topbar.ef-topbar { padding: 0 var(--ef-s6); }
}
@media (max-width: 768px) {
    .sidebar.ef-sidebar {
        width: min(300px, 86vw);
        transform: translateX(-100%);
        transition: transform .22s var(--ef-ease);
    }
    .sidebar.ef-sidebar.mobile-open { transform: translateX(0); box-shadow: var(--ef-e2); }
    .ef-sidebar-close { display: inline-flex; }
    .ef-main { margin-left: 0; }
    .ef-content { padding: var(--ef-s5) var(--ef-s4) calc(84px + env(safe-area-inset-bottom)); }
    .topbar.ef-topbar { padding: 0 var(--ef-s4); }
    .ef-menu-toggle { display: inline-flex; }
    .ef-topbar-logo { display: block; }
    .ef-crumbs { display: none; }
    .ef-user-btn .ef-user-name, .ef-user-btn .ef-caret { display: none; }
    /* topbar script sets left/right 0.5rem on mobile: span the viewport */
    .dropdown-menu.ef-menu { position: fixed; top: calc(var(--ef-topbar-h) + 4px); }

    .mobile-bottom-nav.ef-mobile-nav {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 35;
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(18, 18, 20, 0.98);
        border-top: 1px solid var(--ef-line);
        font-family: var(--ef-font);
    }
    .ef-mobile-nav-inner {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        height: 64px;
        max-width: 520px;
        margin: 0 auto;
    }
    .ef-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        border: 0;
        background: none;
        color: var(--ef-text-3);
        font-family: var(--ef-font);
        font-size: 11px;
        font-weight: 500;
        text-decoration: none;
        cursor: pointer;
        padding: 0;
    }
    .ef-mobile-nav-item svg { width: 20px; height: 20px; }
    .ef-mobile-nav-item.active { color: var(--ef-gold); }
    .ef-mobile-fab {
        justify-self: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 0;
        background: var(--ef-gold);
        color: var(--ef-gold-ink);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
    }
    .ef-mobile-fab svg { width: 20px; height: 20px; }
}

/* ---------------------------------------------------------------------
   5. Components
   --------------------------------------------------------------------- */

/* 5a. Page header - one pattern on every page */
.ef-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ef-s4);
    flex-wrap: wrap;
    margin-bottom: var(--ef-s6);
}
.ef-page-title { font-size: var(--ef-fs-2xl); font-weight: 600; letter-spacing: -0.018em; }
.ef-page-sub { margin-top: var(--ef-s1); color: var(--ef-text-2); font-size: var(--ef-fs-md); max-width: 64ch; }
.ef-page-actions { display: flex; align-items: center; gap: var(--ef-s2); flex-wrap: wrap; }

.ef-section { margin-top: var(--ef-s8); }
.ef-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ef-s4); margin-bottom: var(--ef-s4); }
.ef-section-title { font-size: var(--ef-fs-lg); font-weight: 600; }
.ef-section-sub { color: var(--ef-text-3); font-size: var(--ef-fs-sm); }

/* 5b. Layout grids */
.ef-grid { display: grid; gap: var(--ef-s4); }
.ef-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ef-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ef-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ef-grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.ef-stack { display: grid; gap: var(--ef-s4); }
.ef-stack-sm { display: grid; gap: var(--ef-s2); }
.ef-row { display: flex; align-items: center; gap: var(--ef-s3); }
.ef-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--ef-s3); }
.ef-wrap { flex-wrap: wrap; }
@media (max-width: 1100px) {
    .ef-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ef-grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .ef-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .ef-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .ef-grid-4 { grid-template-columns: minmax(0, 1fr); }
    .ef-grid-4.ef-grid-keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 5c. Cards */
.ef-card {
    background: var(--ef-surface);
    border: 1px solid var(--ef-line);
    border-radius: var(--ef-r-lg);
    min-width: 0;
}
.ef-card-pad { padding: var(--ef-s6); }
.ef-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ef-s3);
    padding: var(--ef-s5) var(--ef-s6);
    border-bottom: 1px solid var(--ef-line);
}
.ef-card-title { font-size: var(--ef-fs-lg); font-weight: 600; color: var(--ef-text); }
.ef-card-sub { margin-top: 2px; font-size: var(--ef-fs-sm); color: var(--ef-text-3); }
.ef-card-body { padding: var(--ef-s6); }
.ef-card-footer { padding: var(--ef-s4) var(--ef-s6); border-top: 1px solid var(--ef-line); }
.ef-card-flush .ef-card-body { padding: 0; }
.ef-card.is-raised { background: var(--ef-surface-2); }
.ef-card.is-selected { border-color: var(--ef-gold-line); box-shadow: inset 0 0 0 1px var(--ef-gold-line); }
@media (max-width: 768px) {
    .ef-card-pad, .ef-card-body { padding: var(--ef-s4); }
    .ef-card-header { padding: var(--ef-s4); }
    .ef-card-footer { padding: var(--ef-s3) var(--ef-s4); }
}

/* 5d. Stat tiles */
.ef-stat {
    background: var(--ef-surface);
    border: 1px solid var(--ef-line);
    border-radius: var(--ef-r-lg);
    padding: var(--ef-s5);
    min-width: 0;
}
.ef-stat-label { font-size: var(--ef-fs-sm); color: var(--ef-text-2); font-weight: 500; display: flex; align-items: center; gap: var(--ef-s2); }
.ef-stat-label svg { width: 16px; height: 16px; color: var(--ef-text-3); }
.ef-stat-value {
    margin-top: var(--ef-s2);
    font-size: var(--ef-fs-2xl);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ef-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ef-stat-value.is-key { color: var(--ef-gold); }
.ef-stat-meta { margin-top: var(--ef-s1); font-size: var(--ef-fs-xs); color: var(--ef-text-3); }
.ef-delta { font-variant-numeric: tabular-nums; font-weight: 500; }
.ef-delta.is-pos, .ef-pos { color: var(--ef-pos); }
.ef-delta.is-neg, .ef-neg { color: var(--ef-neg); }

@media (max-width: 480px) {
    .ef-stat { padding: var(--ef-s4); }
    .ef-stat-value { font-size: var(--ef-fs-xl); }
}

/* Key figure: one per view, the hero number */
.ef-figure { font-size: var(--ef-fs-3xl); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* 5e. Tables */
.ef-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ef-table { width: 100%; border-collapse: collapse; font-size: var(--ef-fs-sm); font-variant-numeric: tabular-nums; }
.ef-table th {
    text-align: left;
    font-weight: 500;
    font-size: var(--ef-fs-xs);
    color: var(--ef-text-3);
    padding: var(--ef-s3) var(--ef-s4);
    border-bottom: 1px solid var(--ef-line);
    white-space: nowrap;
    background: transparent;
}
.ef-table td {
    padding: var(--ef-s3) var(--ef-s4);
    border-bottom: 1px solid var(--ef-line);
    color: var(--ef-text);
    vertical-align: middle;
    white-space: nowrap;
}
.ef-table td.wrap { white-space: normal; min-width: 180px; }
.ef-table tbody tr:last-child td { border-bottom: 0; }
.ef-table tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
.ef-table .num, .ef-table th.num { text-align: right; white-space: nowrap; }
.ef-table .muted { color: var(--ef-text-3); }
.ef-table th:first-child, .ef-table td:first-child { padding-left: var(--ef-s6); }
.ef-table th:last-child, .ef-table td:last-child { padding-right: var(--ef-s6); }
@media (max-width: 768px) {
    .ef-table th:first-child, .ef-table td:first-child { padding-left: var(--ef-s4); }
    .ef-table th:last-child, .ef-table td:last-child { padding-right: var(--ef-s4); }
}

/* Definition rows: label left, value right */
.ef-dl { display: grid; margin: 0; }
.ef-dl-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ef-s4); padding: var(--ef-s3) 0; border-bottom: 1px solid var(--ef-line); font-size: var(--ef-fs-sm); }
.ef-dl-row:last-child { border-bottom: 0; }
.ef-dl-row dt, .ef-dl-row .ef-dl-label { color: var(--ef-text-2); margin: 0; }
.ef-dl-row dd, .ef-dl-row .ef-dl-value { color: var(--ef-text); margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.ef-dl-row dd.ef-pos { color: var(--ef-pos); }
.ef-dl-row dd.ef-neg { color: var(--ef-neg); }
.ef-dl-row dd.ef-gold { color: var(--ef-gold); }

/* 5f. Buttons: primary (gold), secondary, ghost, danger */
.ef-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ef-s2);
    height: 38px;
    padding: 0 var(--ef-s4);
    border: 1px solid transparent;
    border-radius: var(--ef-r-sm);
    font-family: var(--ef-font);
    font-size: var(--ef-fs-md);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.005em;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.ef-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.ef-btn:active { transform: translateY(1px); }
.ef-btn:disabled, .ef-btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ef-btn-primary { background: var(--ef-gold); color: var(--ef-gold-ink); }
.ef-btn-primary:hover { background: var(--ef-gold-hover); }
.ef-btn-primary:active { background: var(--ef-gold-press); }
.ef-btn-secondary { background: var(--ef-surface-2); border-color: var(--ef-line-strong); color: var(--ef-text); }
.ef-btn-secondary:hover { background: var(--ef-surface-3); border-color: rgba(255, 255, 255, 0.18); }
.ef-btn-ghost { background: transparent; color: var(--ef-text-2); }
.ef-btn-ghost:hover { background: var(--ef-surface-2); color: var(--ef-text); }
.ef-btn-danger { background: transparent; border-color: rgba(244, 114, 114, 0.4); color: var(--ef-neg); }
.ef-btn-danger:hover { background: var(--ef-neg-tint); }
.ef-btn-sm { height: 32px; padding: 0 var(--ef-s3); font-size: var(--ef-fs-sm); }
.ef-btn-lg { height: 46px; padding: 0 var(--ef-s6); font-size: var(--ef-fs-lg); }
.ef-btn-block { display: flex; width: 100%; }
.ef-btn-icon { width: 38px; padding: 0; }
.ef-link { color: var(--ef-gold); font-weight: 500; }
.ef-link:hover { color: var(--ef-gold-hover); text-decoration: underline; text-underline-offset: 3px; }

/* 5g. Forms and validation */
.ef-form { display: grid; gap: var(--ef-s4); }
.ef-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.ef-label { font-size: var(--ef-fs-sm); font-weight: 500; color: var(--ef-text); }
.ef-label .ef-optional { color: var(--ef-text-3); font-weight: 400; }
.ef-input, .ef-select, .ef-textarea {
    width: 100%;
    height: 40px;
    padding: 0 var(--ef-s3);
    background: var(--ef-surface-2);
    border: 1px solid var(--ef-line-strong);
    border-radius: var(--ef-r-sm);
    color: var(--ef-text);
    font-family: var(--ef-font);
    font-size: var(--ef-fs-md);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.ef-textarea { height: auto; min-height: 96px; padding: var(--ef-s3); line-height: var(--ef-lh); resize: vertical; }
.ef-select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b8b94' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.ef-select option { background: var(--ef-surface-2); color: var(--ef-text); }
.ef-input::placeholder, .ef-textarea::placeholder { color: var(--ef-text-3); }
.ef-input:hover, .ef-select:hover, .ef-textarea:hover { border-color: rgba(255, 255, 255, 0.2); }
.ef-input:focus, .ef-select:focus, .ef-textarea:focus {
    outline: none;
    border-color: var(--ef-gold);
    box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.16);
}
.ef-input:disabled, .ef-input[readonly] { color: var(--ef-text-2); background: var(--ef-surface); }
.ef-input-group { position: relative; }
.ef-input-group .ef-input { padding-right: 44px; }
.ef-input-addon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--ef-r-sm);
    background: transparent;
    color: var(--ef-text-3);
    cursor: pointer;
    padding: 0;
}
.ef-input-addon:hover { color: var(--ef-text); background: var(--ef-surface-3); }
.ef-input-addon svg { width: 16px; height: 16px; }
.ef-input-addon i { font-size: 14px; }
.ef-help { font-size: var(--ef-fs-xs); color: var(--ef-text-3); }
.ef-error-text { font-size: var(--ef-fs-xs); color: var(--ef-neg); }
.ef-field.is-invalid .ef-input, .ef-field.is-invalid .ef-select,
.ef-input.is-invalid, .ef-input.error, .ef-select.is-invalid, .ef-select.error {
    border-color: rgba(244, 114, 114, 0.7);
}
.ef-field.is-invalid .ef-input:focus, .ef-input.is-invalid:focus, .ef-input.error:focus { box-shadow: 0 0 0 3px rgba(244, 114, 114, 0.16); }
.ef-input.is-valid, .ef-input.success { border-color: rgba(63, 207, 142, 0.55); }
.ef-check { display: flex; align-items: flex-start; gap: var(--ef-s2); font-size: var(--ef-fs-sm); color: var(--ef-text-2); cursor: pointer; line-height: 1.45; }
.ef-check input[type=checkbox], .ef-check input[type=radio] {
    width: 16px; height: 16px; margin: 2px 0 0; flex-shrink: 0;
    accent-color: var(--ef-gold);
}
.ef-check a { color: var(--ef-gold); }
.ef-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ef-s3); }
.ef-form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ef-s3); }
@media (max-width: 520px) {
    .ef-form-row { grid-template-columns: minmax(0, 1fr); }
}
/* Toggle switch (wraps a checkbox) */
.ef-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.ef-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.ef-switch-track { position: absolute; inset: 0; border-radius: 20px; background: var(--ef-surface-3); border: 1px solid var(--ef-line-strong); transition: background-color .15s ease; cursor: pointer; }
.ef-switch-track::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: var(--ef-text-2); transition: transform .15s var(--ef-ease), background-color .15s ease; }
.ef-switch input:checked + .ef-switch-track { background: var(--ef-gold); border-color: var(--ef-gold); }
.ef-switch input:checked + .ef-switch-track::before { transform: translateX(16px); background: var(--ef-gold-ink); }
.ef-switch input:focus-visible + .ef-switch-track { outline: 2px solid var(--ef-gold); outline-offset: 2px; }

/* 5h. Tabs and segmented control */
.ef-tabs {
    display: flex;
    gap: var(--ef-s1);
    border-bottom: 1px solid var(--ef-line);
    margin-bottom: var(--ef-s6);
    overflow-x: auto;
    scrollbar-width: none;
}
.ef-tabs::-webkit-scrollbar { display: none; }
.ef-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--ef-s2);
    height: 40px;
    padding: 0 var(--ef-s3);
    border: 0;
    background: none;
    color: var(--ef-text-2);
    font-size: var(--ef-fs-md);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.ef-tab:hover { color: var(--ef-text); }
.ef-tab.active, .ef-tab[aria-selected="true"] { color: var(--ef-text); }
.ef-tab.active::after, .ef-tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    left: var(--ef-s3);
    right: var(--ef-s3);
    bottom: -1px;
    height: 2px;
    background: var(--ef-gold);
}
.ef-segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--ef-surface-2); border: 1px solid var(--ef-line); border-radius: var(--ef-r-sm); }
.ef-segmented > * {
    height: 28px; padding: 0 var(--ef-s3); border: 0; border-radius: 4px; background: transparent;
    color: var(--ef-text-2); font-size: var(--ef-fs-sm); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.ef-segmented > *:hover { color: var(--ef-text); }
.ef-segmented > .active, .ef-segmented > [aria-pressed="true"] { background: var(--ef-surface-3); color: var(--ef-text); }

/* 5i. Badges - account and payment status. Small, squared, dot + label. */
.ef-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: var(--ef-fs-xs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--ef-text-2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ef-line);
}
.ef-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ef-badge.no-dot::before { display: none; }
.ef-badge.is-pending   { color: var(--ef-warn); background: var(--ef-warn-tint); border-color: rgba(233, 162, 59, 0.22); }
.ef-badge.is-pending::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.ef-badge.is-active    { color: var(--ef-pos); background: var(--ef-pos-tint); border-color: rgba(63, 207, 142, 0.22); }
.ef-badge.is-phase1,
.ef-badge.is-phase2    { color: var(--ef-text); background: rgba(255, 255, 255, 0.05); border-color: var(--ef-line-strong); }
.ef-badge.is-phase1::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ef-gold); }
.ef-badge.is-phase2::before { background: var(--ef-gold); }
.ef-badge.is-funded    { color: var(--ef-gold-ink); background: var(--ef-gold); border-color: var(--ef-gold); }
.ef-badge.is-breached,
.ef-badge.is-failed    { color: var(--ef-neg); background: var(--ef-neg-tint); border-color: rgba(244, 114, 114, 0.22); }
.ef-badge.is-paid      { color: var(--ef-pos); background: var(--ef-pos-tint); border-color: rgba(63, 207, 142, 0.22); }
.ef-badge.is-refunded  { color: var(--ef-info); background: var(--ef-info-tint); border-color: rgba(141, 180, 255, 0.22); }
.ef-badge.is-neutral   { color: var(--ef-text-2); }
.ef-badge.is-gold      { color: var(--ef-gold); background: var(--ef-gold-tint); border-color: var(--ef-gold-line); }

/* 5j. Progress - profit target (gold) and drawdown (green, amber, red) */
.ef-progress { display: grid; gap: var(--ef-s2); }
.ef-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ef-s3); font-size: var(--ef-fs-sm); }
.ef-progress-label { color: var(--ef-text-2); font-weight: 500; }
.ef-progress-value { color: var(--ef-text); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ef-progress-value small { color: var(--ef-text-3); font-weight: 400; font-size: inherit; }
.ef-progress-track { position: relative; height: 6px; border-radius: 6px; background: var(--ef-surface-3); overflow: hidden; }
.ef-progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--ef-text-2);
    transition: width .6s var(--ef-ease);
}
.ef-progress.is-target .ef-progress-bar, .ef-progress-bar.is-target { background: var(--ef-gold); }
.ef-progress.is-drawdown .ef-progress-bar, .ef-progress-bar.is-drawdown { background: var(--ef-pos); }
.ef-progress.is-warn .ef-progress-bar, .ef-progress-bar.is-warn { background: var(--ef-warn); }
.ef-progress.is-danger .ef-progress-bar, .ef-progress-bar.is-danger { background: var(--ef-neg); }
.ef-progress.is-days .ef-progress-bar, .ef-progress-bar.is-days { background: var(--ef-text-2); }
.ef-progress-foot { font-size: var(--ef-fs-xs); color: var(--ef-text-3); }

/* 5k. Steps (evaluation phases, checkout steps) */
.ef-steps { display: flex; align-items: center; gap: var(--ef-s3); list-style: none; margin: 0; padding: 0; }
.ef-step { display: flex; align-items: center; gap: var(--ef-s2); color: var(--ef-text-3); font-size: var(--ef-fs-sm); font-weight: 500; white-space: nowrap; }
.ef-step-dot {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 11px; font-weight: 600;
    border: 1px solid var(--ef-line-strong); color: var(--ef-text-3); background: var(--ef-surface-2);
}
.ef-step-dot svg { width: 12px; height: 12px; }
.ef-step.is-current { color: var(--ef-text); }
.ef-step.is-current .ef-step-dot { border-color: var(--ef-gold); color: var(--ef-gold); background: var(--ef-gold-tint); }
.ef-step.is-done { color: var(--ef-text-2); }
.ef-step.is-done .ef-step-dot { border-color: var(--ef-gold); background: var(--ef-gold); color: var(--ef-gold-ink); }
.ef-step-line { flex: 1; min-width: 16px; height: 1px; background: var(--ef-line-strong); }
.ef-step-line.is-done { background: var(--ef-gold-line); }
.ef-step-sub { display: block; font-size: var(--ef-fs-xs); color: var(--ef-text-3); font-weight: 400; }

/* 5l. Empty states */
.ef-empty {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: var(--ef-s2);
    padding: var(--ef-s12) var(--ef-s6);
}
.ef-empty-icon {
    width: 44px; height: 44px; border-radius: var(--ef-r);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ef-surface-2); border: 1px solid var(--ef-line); color: var(--ef-text-2);
    margin-bottom: var(--ef-s2);
}
.ef-empty-icon svg { width: 20px; height: 20px; }
.ef-empty-title { font-size: var(--ef-fs-lg); font-weight: 600; color: var(--ef-text); }
.ef-empty-text { max-width: 42ch; color: var(--ef-text-2); font-size: var(--ef-fs-md); }
.ef-empty .ef-btn { margin-top: var(--ef-s3); }

/* 5m. Alerts */
.ef-alert {
    display: flex;
    gap: var(--ef-s3);
    align-items: flex-start;
    padding: var(--ef-s3) var(--ef-s4);
    border-radius: var(--ef-r);
    border: 1px solid var(--ef-line-strong);
    background: var(--ef-surface-2);
    color: var(--ef-text);
    font-size: var(--ef-fs-sm);
    line-height: 1.5;
}
.ef-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.ef-alert-title { font-weight: 600; }
.ef-alert.is-info    { border-color: rgba(141, 180, 255, 0.28); background: var(--ef-info-tint); }
.ef-alert.is-info svg { color: var(--ef-info); }
.ef-alert.is-success { border-color: rgba(63, 207, 142, 0.28); background: var(--ef-pos-tint); }
.ef-alert.is-success svg { color: var(--ef-pos); }
.ef-alert.is-warn    { border-color: rgba(233, 162, 59, 0.28); background: var(--ef-warn-tint); }
.ef-alert.is-warn svg { color: var(--ef-warn); }
.ef-alert.is-danger  { border-color: rgba(244, 114, 114, 0.3); background: var(--ef-neg-tint); }
.ef-alert.is-danger svg { color: var(--ef-neg); }

/* 5n. Modals */
.ef-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--ef-s4);
    background: rgba(0, 0, 0, 0.68);
}
.ef-modal-backdrop.active, .ef-modal-backdrop.show, .ef-modal-backdrop.open, .ef-modal-backdrop.is-open { display: flex; }
.ef-modal {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--ef-surface);
    border-radius: var(--ef-r-lg);
    box-shadow: var(--ef-e2);
    animation: ef-modal-in .18s var(--ef-ease);
}
.ef-modal-lg { max-width: 640px; }
.ef-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ef-s4); padding: var(--ef-s5) var(--ef-s6); border-bottom: 1px solid var(--ef-line); }
.ef-modal-title { font-size: var(--ef-fs-lg); font-weight: 600; }
.ef-modal-close { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--ef-r-sm); background: transparent; color: var(--ef-text-3); cursor: pointer; font-size: 20px; line-height: 1; padding: 0; }
.ef-modal-close:hover { background: var(--ef-surface-2); color: var(--ef-text); }
.ef-modal-close svg { width: 18px; height: 18px; }
.ef-modal-body { padding: var(--ef-s6); }
.ef-modal-footer { display: flex; justify-content: flex-end; gap: var(--ef-s2); padding: var(--ef-s4) var(--ef-s6); border-top: 1px solid var(--ef-line); }
@keyframes ef-modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
    .ef-modal-footer { flex-direction: column-reverse; }
    .ef-modal-footer .ef-btn { width: 100%; }
}

/* 5o. Charts */
.ef-chart { position: relative; width: 100%; height: 280px; }
.ef-chart-sm { height: 200px; }
.ef-chart-lg { height: 340px; }
.ef-chart canvas { width: 100% !important; height: 100% !important; }
.ef-legend { display: flex; flex-wrap: wrap; gap: var(--ef-s4); font-size: var(--ef-fs-xs); color: var(--ef-text-2); }
.ef-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.ef-legend-swatch { width: 10px; height: 2px; border-radius: 2px; background: var(--ef-chart-1); }
@media (max-width: 768px) {
    .ef-chart { height: 220px; }
}

/* 5p. Lists (activity, settings rows) */
.ef-list { display: grid; }
.ef-list-item { display: flex; align-items: center; gap: var(--ef-s3); padding: var(--ef-s3) 0; border-bottom: 1px solid var(--ef-line); min-width: 0; }
.ef-list-item:last-child { border-bottom: 0; }
.ef-list-main { flex: 1; min-width: 0; }
.ef-list-title { font-size: var(--ef-fs-md); font-weight: 500; color: var(--ef-text); }
.ef-list-sub { font-size: var(--ef-fs-xs); color: var(--ef-text-3); }
.ef-list-icon { width: 32px; height: 32px; border-radius: var(--ef-r-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--ef-surface-2); border: 1px solid var(--ef-line); color: var(--ef-text-2); flex-shrink: 0; }
.ef-list-icon svg { width: 16px; height: 16px; }

/* 5q. Auth layout (login, register) and standalone status pages */
.ef-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--ef-s10) var(--ef-s4);
}
.ef-auth-box { width: 100%; max-width: 400px; }
.ef-auth-box.is-wide { max-width: 520px; }
.ef-auth-logo { display: flex; justify-content: center; margin-bottom: var(--ef-s8); }
.ef-auth-logo img { height: 34px; width: auto; }
.ef-auth-card { background: var(--ef-surface); border: 1px solid var(--ef-line); border-radius: var(--ef-r-lg); padding: var(--ef-s8); }
.ef-auth-title { font-size: var(--ef-fs-xl); font-weight: 600; letter-spacing: -0.015em; }
.ef-auth-sub { margin-top: var(--ef-s1); color: var(--ef-text-2); font-size: var(--ef-fs-md); }
.ef-auth-head { margin-bottom: var(--ef-s6); }
.ef-auth-foot { margin-top: var(--ef-s5); text-align: center; color: var(--ef-text-2); font-size: var(--ef-fs-sm); }
.ef-auth-legal { margin-top: var(--ef-s6); text-align: center; color: var(--ef-text-3); font-size: var(--ef-fs-xs); }
@media (max-width: 480px) {
    .ef-auth { padding: var(--ef-s8) var(--ef-s4); place-items: start center; }
    .ef-auth-card { padding: var(--ef-s5); }
}

/* 5r. Grid list (row list that looks like .ef-table, for pages whose JS
       filters rows with row.style.display = 'grid'), toolbar, search input,
       date input, bullets */
/* A row list that
   looks exactly like .ef-table but is built from CSS grid rows, for pages
   whose JS filters rows with row.style.display = 'grid'. Each page sets
   --ef-gt-cols (desktop columns) and its own mobile grid areas. */
.ef-gt-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ef-gt { min-width: 920px; font-size: var(--ef-fs-sm); font-variant-numeric: tabular-nums; }
.ef-gt-head,
.ef-gt-row {
    display: grid;
    grid-template-columns: var(--ef-gt-cols, 1fr);
    gap: var(--ef-s4);
    align-items: center;
    padding: var(--ef-s3) var(--ef-s6);
    border-bottom: 1px solid var(--ef-line);
}
.ef-gt-head { font-size: var(--ef-fs-xs); font-weight: 500; color: var(--ef-text-3); white-space: nowrap; }
.ef-gt-row { color: var(--ef-text); min-height: 60px; }
.ef-gt-row:last-child { border-bottom: 0; }
.ef-gt-row:hover { background: rgba(255, 255, 255, 0.018); }
.ef-gt .num { text-align: right; white-space: nowrap; justify-self: end; }
.ef-gt .muted { color: var(--ef-text-3); }
.ef-gt-title { font-weight: 500; color: var(--ef-text); }
.ef-gt-sub { font-size: var(--ef-fs-xs); color: var(--ef-text-3); margin-top: 2px; }
.ef-gt-method { display: inline-flex; align-items: center; gap: 6px; color: var(--ef-text-2); white-space: nowrap; }
.ef-gt-method svg { width: 16px; height: 16px; color: var(--ef-text-3); }
.ef-gt-actions { display: flex; justify-content: flex-end; gap: var(--ef-s1); }
.ef-gt-actions .ef-btn svg { width: 14px; height: 14px; }
@media (max-width: 768px) {
    .ef-gt { min-width: 0; }
    .ef-gt-head { display: none; }
    .ef-gt-row { padding: var(--ef-s4); gap: 6px var(--ef-s3); grid-template-columns: minmax(0, 1fr) auto; }
    .ef-gt-hide-sm { display: none; }
    .ef-gt-actions { justify-content: flex-start; margin-top: var(--ef-s1); }
}

/* toolbar row above a list: search, segmented, dates */
.ef-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ef-s3); padding: var(--ef-s4) var(--ef-s6); border-bottom: 1px solid var(--ef-line); }
.ef-toolbar-grow { flex: 1 1 240px; min-width: 0; }
.ef-toolbar .ef-date-range { display: flex; gap: var(--ef-s2); align-items: center; }
.ef-toolbar .ef-date-range .ef-input { width: 150px; }
@media (max-width: 768px) {
    .ef-toolbar { padding: var(--ef-s4); }
    .ef-toolbar .ef-segmented { overflow-x: auto; max-width: 100%; }
    .ef-toolbar .ef-date-range { width: 100%; }
    .ef-toolbar .ef-date-range .ef-input { width: auto; flex: 1; min-width: 0; }
}

/* input with a leading search icon */
.ef-input-search { position: relative; }
.ef-input-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ef-text-3); pointer-events: none; }
.ef-input-search .ef-input { padding-left: 36px; }

/* native date pickers in dark mode */
.ef-input[type="date"] { color-scheme: dark; font-variant-numeric: tabular-nums; }

/* plain bullet list inside alerts and cards */
.ef-bullets { margin: var(--ef-s1) 0 0; padding-left: 18px; color: var(--ef-text-2); }
.ef-bullets li + li { margin-top: 2px; }

/* 5s. Inline field message (icon + text) that JS shows with display:flex */
.ef-field-msg { align-items: center; gap: 6px; font-size: var(--ef-fs-xs); }
.ef-field-msg svg { width: 14px; height: 14px; flex-shrink: 0; }

/* 5t. Button spinner (injected by submit handlers) */
.ef-spinner {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(26, 19, 5, 0.25); border-top-color: currentColor;
    animation: ef-spin .7s linear infinite;
}
@keyframes ef-spin { to { transform: rotate(360deg); } }

/* 5u. Div toggle: same look as .ef-switch, for markup whose onclick toggles .active */
.ef-toggle {
    position: relative; flex-shrink: 0; width: 36px; height: 20px; border-radius: 20px; cursor: pointer;
    background: var(--ef-surface-3); border: 1px solid var(--ef-line-strong); transition: background-color .15s ease;
}
.ef-toggle .toggle-slider {
    position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%;
    background: var(--ef-text-2); transition: transform .15s var(--ef-ease), background-color .15s ease;
}
.ef-toggle.active { background: var(--ef-gold); border-color: var(--ef-gold); }
.ef-toggle.active .toggle-slider { transform: translateX(16px); background: var(--ef-gold-ink); }

/* 5v. Objectives (includes/objectives.php): target, max loss, daily rule */
.ef-objectives { gap: var(--ef-s5); }
.ef-objectives .ef-objectives-rule { padding: var(--ef-s3) 0 0; border-top: 1px solid var(--ef-line); border-bottom: 0; }

/* 5w. Prose - long-form text (articles, lessons) */
.ef-prose { color: var(--ef-text-2); font-size: 0.9375rem; line-height: 1.7; }
.ef-prose > * + * { margin-top: var(--ef-s4); }
.ef-prose > :first-child { margin-top: 0; }
.ef-prose h2 { margin-top: var(--ef-s8); font-size: var(--ef-fs-xl); color: var(--ef-text); }
.ef-prose h3 { margin-top: var(--ef-s6); font-size: var(--ef-fs-lg); color: var(--ef-text); }
.ef-prose h4 { margin-top: var(--ef-s6); font-size: var(--ef-fs-md); color: var(--ef-text); }
.ef-prose :is(h2, h3, h4) + * { margin-top: var(--ef-s3); }
.ef-prose strong { color: var(--ef-text); font-weight: 600; }
.ef-prose ul, .ef-prose ol { padding-left: 1.25em; }
.ef-prose li + li { margin-top: 6px; }
.ef-prose li::marker { color: var(--ef-text-3); }
.ef-prose p + ul, .ef-prose p + ol { margin-top: var(--ef-s2); }
.ef-prose a { color: var(--ef-gold); text-decoration: underline; text-underline-offset: 3px; }
.ef-prose code { font-family: var(--ef-mono); font-size: 0.875em; padding: 1px 5px; border-radius: 4px; background: var(--ef-surface-3); color: var(--ef-text); }
.ef-prose pre { overflow-x: auto; padding: var(--ef-s4); border: 1px solid var(--ef-line); border-radius: var(--ef-r-sm); background: var(--ef-bg); }
.ef-prose pre code { padding: 0; background: none; font-size: var(--ef-fs-sm); line-height: 1.6; }

/* ---------------------------------------------------------------------
   6. Utilities
   --------------------------------------------------------------------- */
.ef-num { font-variant-numeric: tabular-nums; }
.ef-gold { color: var(--ef-gold); }
.ef-muted { color: var(--ef-text-3); }
.ef-dim { color: var(--ef-text-2); }
.ef-strong { color: var(--ef-text); font-weight: 600; }
.ef-small { font-size: var(--ef-fs-sm); }
.ef-xs { font-size: var(--ef-fs-xs); }
.ef-right { text-align: right; }
.ef-center { text-align: center; }
.ef-mono { font-family: var(--ef-mono); font-size: 0.95em; }
.ef-divider { height: 1px; background: var(--ef-line); border: 0; margin: var(--ef-s5) 0; }
.ef-mt-0 { margin-top: 0 !important; }
.ef-mt-2 { margin-top: var(--ef-s2); }
.ef-mt-4 { margin-top: var(--ef-s4); }
.ef-mt-6 { margin-top: var(--ef-s6); }
.ef-mt-8 { margin-top: var(--ef-s8); }
.ef-mb-4 { margin-bottom: var(--ef-s4); }
.ef-w-full { width: 100%; }
.ef-show-mobile { display: none !important; }
@media (max-width: 768px) {
    .ef-hide-mobile { display: none !important; }
    .ef-show-mobile { display: revert !important; }
}
.ef-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------------
   7. Page sections
   Only what a page cannot say with the components above. Each section
   is scoped to the page's body class (body.ef-page-<name>).
   --------------------------------------------------------------------- */

/* =====================================================================
   7.1 Page: dashboard
   ===================================================================== */
/* == Page: dashboard == */

/* New-trader hero: text left, three facts right */
body.ef-page-dashboard .dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ef-s8); align-items: center; padding: var(--ef-s8); }
body.ef-page-dashboard .dash-hero-title { font-size: var(--ef-fs-2xl); font-weight: 600; letter-spacing: -0.02em; max-width: 24ch; }
body.ef-page-dashboard .dash-hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: var(--ef-s8); margin: 0; }
body.ef-page-dashboard .dash-hero-stats dt { font-size: var(--ef-fs-sm); color: var(--ef-text-3); }
body.ef-page-dashboard .dash-hero-stats dd { margin: var(--ef-s1) 0 0; font-size: var(--ef-fs-2xl); font-weight: 600; letter-spacing: -0.02em; }
body.ef-page-dashboard .dash-journey-step { display: grid; gap: var(--ef-s2); justify-items: start; align-content: start; }
body.ef-page-dashboard .dash-metrics { margin-top: var(--ef-s6); }
body.ef-page-dashboard .ef-page-header + .dash-metrics { margin-top: 0; }
body.ef-page-dashboard .dash-actions { gap: var(--ef-s2); }
body.ef-page-dashboard .dash-note { padding: 0 var(--ef-s1); }
body.ef-page-dashboard .dash-phases .ef-step { align-items: flex-start; }
body.ef-page-dashboard .dash-phases .ef-step-dot { margin-top: 1px; }

@media (max-width: 900px) {
    body.ef-page-dashboard .dash-hero { grid-template-columns: minmax(0, 1fr); padding: var(--ef-s5); }
}
@media (max-width: 640px) {
    body.ef-page-dashboard .dash-hero-stats { gap: var(--ef-s5); }
    body.ef-page-dashboard .dash-hero-stats dd { font-size: var(--ef-fs-xl); }
    body.ef-page-dashboard .dash-phases { flex-direction: column; align-items: flex-start; gap: var(--ef-s3); }
    body.ef-page-dashboard .dash-phases .ef-step-line { display: none; }
}

/* =====================================================================
   7.2 Page: myevaluations
   ===================================================================== */
/* == Page: myevaluations == */
/* One card per account: figures left, objectives right */
body.ef-page-myevaluations .me-size {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 52px; height: 32px; padding: 0 var(--ef-s2); border-radius: var(--ef-r-sm);
    background: var(--ef-surface-2); color: var(--ef-text); border: 1px solid var(--ef-line-strong);
    font-size: var(--ef-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
body.ef-page-myevaluations .me-account-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--ef-s8); align-items: start; }
body.ef-page-myevaluations .ef-tabs .ef-muted { font-size: var(--ef-fs-xs); }
@media (max-width: 900px) {
    body.ef-page-myevaluations .me-account-body { grid-template-columns: minmax(0, 1fr); gap: var(--ef-s5); }
}

/* =====================================================================
   7.3 Page: start
   ===================================================================== */
/* == Page: start (checkout) == */

/* Header: steps sit on the right of the title */
body.ef-page-start .ef-start-steps { padding-bottom: 4px; }

/* Tier comparison list. Desktop: one aligned row per tier with a header.
   Mobile: each tier becomes a card with a 2x2 figure grid. */
body.ef-page-start .ef-tier-list { display: grid; padding: var(--ef-s2) var(--ef-s4) var(--ef-s4); gap: var(--ef-s2); }
body.ef-page-start .ef-tier-head,
body.ef-page-start .ef-tier {
    display: grid;
    grid-template-columns: 20px minmax(140px, 1.5fr) repeat(5, minmax(0, 1fr));
    align-items: center;
    column-gap: var(--ef-s4);
}
body.ef-page-start .ef-tier-head {
    padding: var(--ef-s2) var(--ef-s4);
    font-size: var(--ef-fs-xs);
    font-weight: 500;
    color: var(--ef-text-3);
}
body.ef-page-start .ef-tier-head span:nth-child(n+3) { text-align: right; }
body.ef-page-start .ef-tier {
    position: relative;
    padding: var(--ef-s4);
    border: 1px solid var(--ef-line);
    border-radius: var(--ef-r);
    background: var(--ef-surface);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
body.ef-page-start .ef-tier:hover { border-color: var(--ef-line-strong); background: var(--ef-surface-2); }
body.ef-page-start .ef-tier.selected {
    border-color: var(--ef-gold-line);
    background: var(--ef-surface-2);
    box-shadow: inset 0 0 0 1px var(--ef-gold-line);
}
/* Checked indicator: a radio that fills gold */
body.ef-page-start .ef-tier-radio {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    display: inline-flex; align-items: center; justify-content: center;
}
body.ef-page-start .ef-tier.selected .ef-tier-radio { border-color: var(--ef-gold); background: var(--ef-gold); }
body.ef-page-start .ef-tier.selected .ef-tier-radio::after {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ef-gold-ink);
}
body.ef-page-start .ef-tier-size { display: flex; align-items: center; gap: var(--ef-s2); font-size: var(--ef-fs-lg); font-weight: 600; color: var(--ef-text); letter-spacing: -0.01em; }
body.ef-page-start .ef-tier-name { font-size: var(--ef-fs-xs); color: var(--ef-text-3); margin-top: 2px; }
body.ef-page-start .ef-tier-cell { display: grid; text-align: right; font-size: var(--ef-fs-md); color: var(--ef-text-2); font-variant-numeric: tabular-nums; }
body.ef-page-start .ef-tier-cell .ef-tier-label { display: none; }
body.ef-page-start .ef-tier-fee { color: var(--ef-text); font-weight: 600; }
body.ef-page-start .ef-tier.selected .ef-tier-fee { color: var(--ef-gold); }

/* Plain rules under the list */
body.ef-page-start .ef-start-rules-title { font-size: var(--ef-fs-sm); font-weight: 600; margin-bottom: var(--ef-s2); }
body.ef-page-start .ef-start-rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ef-text-2); font-size: var(--ef-fs-sm); }
body.ef-page-start .ef-start-rules li::marker { color: var(--ef-text-3); }

/* Sticky order summary under the 56px topbar */
body.ef-page-start .ef-start-summary { position: sticky; top: calc(var(--ef-topbar-h) + var(--ef-s6)); }
body.ef-page-start .ef-start-checkout { display: grid; gap: var(--ef-s3); padding-top: var(--ef-s4); border-top: 1px solid var(--ef-line); }
body.ef-page-start .ef-start-line { display: flex; justify-content: space-between; gap: var(--ef-s3); font-size: var(--ef-fs-md); color: var(--ef-text); font-weight: 500; }
body.ef-page-start .ef-start-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--ef-s3); }
body.ef-page-start .ef-start-total-label { color: var(--ef-text-2); font-size: var(--ef-fs-sm); }
body.ef-page-start .ef-start-total-value { font-size: var(--ef-fs-3xl); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; color: var(--ef-text); font-variant-numeric: tabular-nums; }
body.ef-page-start .ef-start-btn-sep { width: 1px; height: 16px; background: rgba(26, 19, 5, 0.3); }
body.ef-page-start .ef-start-fine { font-size: var(--ef-fs-xs); color: var(--ef-text-3); text-align: center; }

/* Confirmation modal */
body.ef-page-start .ef-start-order { border: 1px solid var(--ef-line); border-radius: var(--ef-r); background: var(--ef-surface-2); }
body.ef-page-start .ef-start-order-item { padding: var(--ef-s4); align-items: flex-start; }
body.ef-page-start .ef-start-order-total { padding: var(--ef-s3) var(--ef-s4); border-top: 1px solid var(--ef-line); }
body.ef-page-start .ef-start-order-amount { font-size: var(--ef-fs-xl); font-weight: 600; }
body.ef-page-start .required { color: var(--ef-text-3); font-weight: 400; }
body.ef-page-start .ef-start-secure svg { width: 16px; height: 16px; flex-shrink: 0; }
body.ef-page-start .ef-start-success { padding: var(--ef-s4) 0 0; }
body.ef-page-start .ef-start-next { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ef-text-2); font-size: var(--ef-fs-sm); }
/* Spinner the checkout script injects into the submit button */
body.ef-page-start .spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(26, 19, 5, 0.25); border-top-color: var(--ef-gold-ink);
    animation: ef-start-spin .7s linear infinite;
}
@keyframes ef-start-spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    body.ef-page-start .ef-start-summary { position: static; }
}

/* Mobile: tier cards, and the checkout block becomes a bar above the 64px bottom nav */
@media (max-width: 768px) {
    body.ef-page-start .ef-start-steps { display: none; }
    body.ef-page-start .ef-tier-list { padding: var(--ef-s3); }
    body.ef-page-start .ef-tier-head { display: none; }
    body.ef-page-start .ef-tier { row-gap: var(--ef-s3); column-gap: var(--ef-s3); padding: var(--ef-s4); align-items: start; }
    body.ef-page-start .ef-tier-radio { margin-top: 3px; }
    body.ef-page-start .ef-tier-fee { font-size: var(--ef-fs-lg); }
    body.ef-page-start .ef-tier-fee .ef-tier-label { display: none; }
    body.ef-page-start .ef-tier > .ef-tier-cell:not(.ef-tier-fee) { text-align: left; font-size: var(--ef-fs-sm); color: var(--ef-text); }
    body.ef-page-start .ef-tier > .ef-tier-cell:not(.ef-tier-fee) .ef-tier-label { display: block; font-size: 11px; color: var(--ef-text-3); }
    /* the four figure cells flow into a 2x2 grid spanning the second row */
    body.ef-page-start .ef-tier { grid-template-columns: 20px 1fr 1fr; }
    body.ef-page-start .ef-tier-radio { grid-column: 1; grid-row: 1; }
    body.ef-page-start .ef-tier-account { grid-column: 2; grid-row: 1; }
    body.ef-page-start .ef-tier-fee { grid-column: 3; grid-row: 1; text-align: right; }
    body.ef-page-start .ef-tier > .ef-tier-cell:nth-of-type(3) { grid-column: 2; grid-row: 2; }
    body.ef-page-start .ef-tier > .ef-tier-cell:nth-of-type(4) { grid-column: 3; grid-row: 2; }
    body.ef-page-start .ef-tier > .ef-tier-cell:nth-of-type(5) { grid-column: 2; grid-row: 3; }
    body.ef-page-start .ef-tier > .ef-tier-cell:nth-of-type(6) { grid-column: 3; grid-row: 3; }

    body.ef-page-start .ef-content { padding-bottom: calc(64px + 84px + var(--ef-s6) + env(safe-area-inset-bottom)); }
    body.ef-page-start .ef-start-checkout {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(64px + env(safe-area-inset-bottom));
        z-index: 34;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "line btn" "total btn";
        column-gap: var(--ef-s3);
        row-gap: 0;
        align-items: center;
        padding: var(--ef-s3) var(--ef-s4);
        background: var(--ef-surface);
        border-top: 1px solid var(--ef-line-strong);
    }
    body.ef-page-start .ef-start-line { grid-area: line; font-size: var(--ef-fs-xs); color: var(--ef-text-2); }
    body.ef-page-start .ef-start-line-price { display: none; }
    body.ef-page-start .ef-start-total { grid-area: total; justify-content: flex-start; }
    body.ef-page-start .ef-start-total-label { display: none; }
    body.ef-page-start .ef-start-total-value { font-size: var(--ef-fs-xl); color: var(--ef-gold); }
    body.ef-page-start #start-challenge-btn { grid-area: btn; width: auto; height: 44px; padding: 0 var(--ef-s5); font-size: var(--ef-fs-md); }
    body.ef-page-start #start-challenge-btn .ef-start-btn-sep,
    body.ef-page-start #start-challenge-btn #button-price { display: none; }
    body.ef-page-start .ef-start-fine { display: none; }
}

/* =====================================================================
   7.4 Page: profile
   ===================================================================== */
/* == Page: profile == */
body.ef-page-profile .ef-profile-grid { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
body.ef-page-profile .ef-profile-id { display: grid; justify-items: center; text-align: center; gap: 2px; }
body.ef-page-profile .ef-profile-avatar {
    width: 64px; height: 64px; border-radius: 50%; margin-bottom: var(--ef-s3);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ef-surface-3); border: 1px solid var(--ef-line-strong);
    color: var(--ef-text); font-size: var(--ef-fs-xl); font-weight: 600;
}
body.ef-page-profile .ef-profile-name { font-size: var(--ef-fs-lg); font-weight: 600; color: var(--ef-text); }
body.ef-page-profile .ef-form > div:last-child .ef-btn { margin-top: var(--ef-s1); }


@media (max-width: 1100px) {
    body.ef-page-profile .ef-profile-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   7.5 Page: metrics
   ===================================================================== */
/* == Page: metrics == */
/* Built from shared components (stats, cards, objectives, dl rows, empty state). */

/* =====================================================================
   7.6 Page: billing
   ===================================================================== */
/* == Page: billing == */
body.ef-page-billing .ef-gt { --ef-gt-cols: 110px minmax(220px, 1fr) 120px 110px 120px 80px; }
body.ef-page-billing .ef-invoice-head { display: flex; justify-content: space-between; gap: var(--ef-s6); flex-wrap: wrap; }
body.ef-page-billing .ef-invoice-head .ef-right { margin-left: auto; }
body.ef-page-billing .ef-invoice-totals { margin-left: auto; max-width: 300px; }
body.ef-page-billing .ef-invoice-totals .ef-dl-row:last-child dd { color: var(--ef-gold); font-size: var(--ef-fs-lg); }
@media (max-width: 768px) {
    body.ef-page-billing .ef-gt-row { grid-template-areas: "info amount" "date status" "actions actions"; }
    body.ef-page-billing .purchase-info { grid-area: info; }
    body.ef-page-billing .purchase-amount { grid-area: amount; }
    body.ef-page-billing .purchase-date { grid-area: date; }
    body.ef-page-billing .ef-gt-status { grid-area: status; justify-self: end; }
    body.ef-page-billing .billing-actions { grid-area: actions; }
}
@media print {
    body.ef-page-billing .ef-shell { display: none; }
    body.ef-page-billing #invoiceModal { position: static; display: block; background: none; padding: 0; }
}

/* =====================================================================
   7.7 Page: payouts
   ===================================================================== */
/* == Page: payouts == */
/* Built from shared components only (stats, cards, dl rows, table, progress). */
body.ef-page-payouts .ef-card-body > .ef-empty { padding: var(--ef-s6) 0; }

/* =====================================================================
   7.8 Page: auth
   ===================================================================== */
/* == Page: auth (login, register, payment-return) == */


/* Not-yet-available link (password reset) */
body.ef-page-login .ef-auth-disabled { font-size: var(--ef-fs-sm); color: var(--ef-text-3); cursor: not-allowed; }

/* Payment return: centred status icon */
body.ef-page-payment-return .ef-return-icon { margin: 0 auto var(--ef-s4); }
body.ef-page-payment-return .ef-return-icon.is-pending { color: var(--ef-warn); background: var(--ef-warn-tint); border-color: rgba(233, 162, 59, 0.28); }
body.ef-page-payment-return .ef-return-icon.is-failed { color: var(--ef-neg); background: var(--ef-neg-tint); border-color: rgba(244, 114, 114, 0.3); }
body.ef-page-payment-return .ef-return-badge { margin-bottom: var(--ef-s3); }
body.ef-page-payment-return .ef-return-msg { margin-top: var(--ef-s2); }

/* =====================================================================
   7.9 Page: achievements
   ===================================================================== */
/* == Page: achievements == */
/* Milestone rows: .ef-list items inside cards, padded like table rows */
body.ef-page-achievements .ach-list { padding: 0 var(--ef-s6); }
body.ef-page-achievements .ach-item { padding: var(--ef-s4) 0; gap: var(--ef-s4); }
body.ef-page-achievements .ach-icon { color: var(--ef-text-3); }
body.ef-page-achievements .ach-item.is-done .ach-icon { color: var(--ef-gold); background: var(--ef-gold-tint); border-color: var(--ef-gold-line); }
body.ef-page-achievements .ach-item:not(.is-done) .ef-list-title { color: var(--ef-text-2); }
body.ef-page-achievements .ach-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; text-align: right; max-width: 260px; }
body.ef-page-achievements .ach-progress { margin-top: var(--ef-s3); max-width: 420px; gap: 6px; }
body.ef-page-achievements .ach-of { font-size: var(--ef-fs-md); font-weight: 500; color: var(--ef-text-3); letter-spacing: 0; }
body.ef-page-achievements .ach-stage { margin-top: var(--ef-s3); min-height: 26px; display: flex; align-items: center; }
@media (max-width: 768px) {
    body.ef-page-achievements .ach-list { padding: 0 var(--ef-s4); }
    body.ef-page-achievements .ach-item { flex-wrap: wrap; align-items: flex-start; }
    body.ef-page-achievements .ach-meta { flex-direction: row; align-items: center; flex-basis: 100%; max-width: none; padding-left: 48px; text-align: left; }
}

/* =====================================================================
   7.10 Page: affiliate
   ===================================================================== */
/* == Page: affiliate == */
/* Referral link: input and copy button on one line */
body.ef-page-affiliate .af-link-row { display: flex; gap: var(--ef-s2); }
body.ef-page-affiliate .af-link-row .ef-input { flex: 1; min-width: 0; font-family: var(--ef-mono); font-size: var(--ef-fs-sm); }
body.ef-page-affiliate .af-share { gap: var(--ef-s2); }
body.ef-page-affiliate .af-share > .ef-small { margin-right: var(--ef-s1); }
body.ef-page-affiliate .af-code { margin-left: auto; }
body.ef-page-affiliate .af-balance .ef-dl-row:first-child { padding-top: 0; }
body.ef-page-affiliate .af-void { text-decoration: line-through; }
/* Numbered steps in the side card */
body.ef-page-affiliate .af-steps { margin: 0; padding-left: 18px; display: grid; gap: var(--ef-s3); color: var(--ef-text-2); font-size: var(--ef-fs-sm); }
body.ef-page-affiliate .af-steps li::marker { color: var(--ef-text-3); }
@media (max-width: 520px) {
    body.ef-page-affiliate .af-link-row { flex-direction: column; }
    body.ef-page-affiliate .af-link-row .ef-input { flex: none; }
    body.ef-page-affiliate .af-code { margin-left: 0; width: 100%; }
}

/* =====================================================================
   7.11 Page: liveaccounts
   ===================================================================== */
/* == Page: liveaccounts == */
/* Account card: balances left, target and loss bars right */
body.ef-page-liveaccounts .la-account-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ef-s8); align-items: start; }
body.ef-page-liveaccounts .la-account-body .ef-dl-row:first-child { padding-top: 0; }
body.ef-page-liveaccounts .la-account-side { gap: var(--ef-s5); }
body.ef-page-liveaccounts .la-rule { padding: 0; border-bottom: 0; }
body.ef-page-liveaccounts .ef-section-head .ef-link { white-space: nowrap; }
@media (max-width: 900px) {
    body.ef-page-liveaccounts .la-account-body { grid-template-columns: minmax(0, 1fr); gap: var(--ef-s5); }
}

/* =====================================================================
   7.12 Page: course
   ===================================================================== */
/* == Page: course (course list and lesson reader) == */

/* Course list: numbered rows like a table of contents */
body.ef-page-course .ef-course-list { display: grid; }
body.ef-page-course .ef-course-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 180px 16px;
    gap: var(--ef-s5);
    align-items: start;
    padding: var(--ef-s5) var(--ef-s6);
    border-bottom: 1px solid var(--ef-line);
    color: inherit;
    transition: background-color .15s ease;
}
body.ef-page-course .ef-course-row:last-child { border-bottom: 0; }
body.ef-page-course .ef-course-row:hover { background: rgba(255, 255, 255, 0.018); }
body.ef-page-course .ef-course-row:hover .ef-course-title { color: var(--ef-gold); }
body.ef-page-course .ef-course-num { color: var(--ef-text-3); font-size: var(--ef-fs-sm); font-variant-numeric: tabular-nums; padding-top: 2px; }
body.ef-page-course .ef-course-main { display: grid; gap: 6px; min-width: 0; }
body.ef-page-course .ef-course-title { font-size: var(--ef-fs-lg); font-weight: 600; color: var(--ef-text); transition: color .15s ease; }
body.ef-page-course .ef-course-desc { color: var(--ef-text-2); font-size: var(--ef-fs-sm); line-height: 1.55; max-width: 72ch; }
body.ef-page-course .ef-course-pre { color: var(--ef-text-3); font-size: var(--ef-fs-xs); }
body.ef-page-course .ef-course-facts { display: grid; gap: 4px; justify-items: end; text-align: right; color: var(--ef-text-2); font-size: var(--ef-fs-sm); padding-top: 2px; }
body.ef-page-course .ef-course-facts span + span { color: var(--ef-text-3); font-size: var(--ef-fs-xs); }
body.ef-page-course .ef-course-chev svg { width: 16px; height: 16px; margin-top: 4px; color: var(--ef-text-3); }
@media (max-width: 768px) {
    body.ef-page-course .ef-course-row { grid-template-columns: minmax(0, 1fr); gap: var(--ef-s2); padding: var(--ef-s4); }
    body.ef-page-course .ef-course-num, body.ef-page-course .ef-course-chev { display: none; }
    body.ef-page-course .ef-course-facts { display: flex; gap: var(--ef-s3); justify-items: start; text-align: left; }
}

/* Course view header */
body.ef-page-course .ef-course-back { margin-left: calc(-1 * var(--ef-s3)); }
body.ef-page-course .ef-course-headfacts { display: flex; gap: var(--ef-s4); color: var(--ef-text-3); font-size: var(--ef-fs-sm); white-space: nowrap; }
body.ef-page-course .ef-course-kicker { color: var(--ef-text-3); font-size: var(--ef-fs-xs); }
body.ef-page-course .ef-course-lesson-title { margin-top: 6px; font-size: var(--ef-fs-xl); font-weight: 600; letter-spacing: -0.012em; }

/* Boxes inside the lesson: key points, exercise, quiz */
body.ef-page-course .ef-course-box,
body.ef-page-course .ef-course-quiz {
    padding: var(--ef-s5);
    border: 1px solid var(--ef-line);
    border-radius: var(--ef-r);
    background: var(--ef-surface-2);
}
body.ef-page-course .ef-course-box-title { font-size: var(--ef-fs-md); font-weight: 600; color: var(--ef-text); }
body.ef-page-course .ef-course-box .ef-bullets { margin-top: var(--ef-s3); font-size: var(--ef-fs-sm); line-height: 1.6; }
body.ef-page-course .ef-course-quiz { display: grid; gap: var(--ef-s5); }

/* Quiz */
body.ef-page-course .ef-quiz-q { margin: 0; padding: 0; border: 0; min-width: 0; }
body.ef-page-course .ef-quiz-legend { padding: 0; font-size: var(--ef-fs-md); font-weight: 500; color: var(--ef-text); line-height: 1.5; }
body.ef-page-course .ef-quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ef-s2); margin-top: var(--ef-s3); }
body.ef-page-course .ef-quiz-option {
    min-height: 40px;
    padding: var(--ef-s2) var(--ef-s3);
    border: 1px solid var(--ef-line-strong);
    border-radius: var(--ef-r-sm);
    background: var(--ef-surface);
    color: var(--ef-text-2);
    font-size: var(--ef-fs-sm);
    text-align: left;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
body.ef-page-course .ef-quiz-option:hover { border-color: rgba(255, 255, 255, 0.2); color: var(--ef-text); }
body.ef-page-course .ef-quiz-option.selected { border-color: var(--ef-gold); color: var(--ef-text); background: var(--ef-gold-tint); }
body.ef-page-course .ef-quiz-option.is-correct { border-color: rgba(63, 207, 142, 0.55); background: var(--ef-pos-tint); color: var(--ef-text); }
body.ef-page-course .ef-quiz-option.is-wrong { border-color: rgba(244, 114, 114, 0.55); background: var(--ef-neg-tint); color: var(--ef-text); }
body.ef-page-course .ef-quiz-explain { margin-top: var(--ef-s3); color: var(--ef-text-2); font-size: var(--ef-fs-sm); line-height: 1.55; }
@media (max-width: 520px) {
    body.ef-page-course .ef-quiz-options { grid-template-columns: minmax(0, 1fr); }
}

/* Lesson navigation in the side column */
body.ef-page-course .ef-course-lessons { list-style: none; margin: 0; padding: var(--ef-s2); }
body.ef-page-course .ef-course-lesson {
    display: flex;
    gap: var(--ef-s3);
    align-items: flex-start;
    padding: var(--ef-s3);
    border-radius: var(--ef-r-sm);
    color: inherit;
    transition: background-color .15s ease;
}
body.ef-page-course .ef-course-lesson:hover { background: var(--ef-surface-2); }
body.ef-page-course .ef-course-lesson.is-active { background: var(--ef-surface-3); }
body.ef-page-course .ef-course-lesson-num {
    width: 22px; height: 22px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--ef-line-strong);
    background: var(--ef-surface-2);
    color: var(--ef-text-3);
    font-size: 11px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
body.ef-page-course .ef-course-lesson.is-active .ef-course-lesson-num { border-color: var(--ef-gold); color: var(--ef-gold); background: var(--ef-gold-tint); }
body.ef-page-course .ef-course-lesson-main { display: grid; gap: 2px; min-width: 0; }
body.ef-page-course .ef-course-lesson-name { font-size: var(--ef-fs-sm); font-weight: 500; color: var(--ef-text-2); line-height: 1.4; }
body.ef-page-course .ef-course-lesson.is-active .ef-course-lesson-name { color: var(--ef-text); }
body.ef-page-course .ef-course-lesson-sub { font-size: var(--ef-fs-xs); color: var(--ef-text-3); }


/* Prose keeps proportional figures and hyphens (see section 3) */
body.ef-page-course :where(.ef-course-desc, .ef-course-pre, .ef-course-title, .ef-course-lesson-name, .ef-course-lesson-title, .ef-quiz-legend, .ef-quiz-option, .ef-quiz-explain, .ef-prose) { font-variant-numeric: normal; }
body.ef-page-course .ef-prose { max-width: 72ch; }

/* =====================================================================
   7.13 Page: education
   ===================================================================== */
/* == Page: education == */

/* Course cards: the whole card is the link */
body.ef-page-education .ef-edu-course {
    display: flex;
    flex-direction: column;
    gap: var(--ef-s2);
    padding: var(--ef-s5) var(--ef-s6);
    color: inherit;
    transition: border-color .15s ease, background-color .15s ease;
}
body.ef-page-education .ef-edu-course:hover { border-color: var(--ef-line-strong); background: var(--ef-surface-2); }
body.ef-page-education .ef-edu-course:hover .ef-edu-title { color: var(--ef-gold); }
body.ef-page-education .ef-edu-level { font-size: var(--ef-fs-xs); font-weight: 500; color: var(--ef-text-3); }
body.ef-page-education .ef-edu-title { font-size: var(--ef-fs-lg); font-weight: 600; color: var(--ef-text); transition: color .15s ease; }
body.ef-page-education .ef-edu-desc { color: var(--ef-text-2); font-size: var(--ef-fs-sm); line-height: 1.55; flex: 1; }
body.ef-page-education .ef-edu-meta { margin-top: var(--ef-s2); padding-top: var(--ef-s3); border-top: 1px solid var(--ef-line); color: var(--ef-text-3); font-size: var(--ef-fs-xs); }

/* Trading styles: four columns divided by hairlines */
body.ef-page-education .ef-edu-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
body.ef-page-education .ef-edu-style { padding: var(--ef-s5) var(--ef-s6); border-left: 1px solid var(--ef-line); }
body.ef-page-education .ef-edu-style:first-child { border-left: 0; }
body.ef-page-education .ef-edu-style dt { font-size: var(--ef-fs-md); font-weight: 600; color: var(--ef-text); }
body.ef-page-education .ef-edu-style dd { margin: var(--ef-s2) 0 0; color: var(--ef-text-2); font-size: var(--ef-fs-sm); line-height: 1.55; }
body.ef-page-education .ef-edu-style dd.ef-edu-hold { color: var(--ef-text-3); font-size: var(--ef-fs-xs); }
@media (max-width: 1100px) {
    body.ef-page-education .ef-edu-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.ef-page-education .ef-edu-style:nth-child(3) { border-left: 0; }
    body.ef-page-education .ef-edu-style:nth-child(n+3) { border-top: 1px solid var(--ef-line); }
}
@media (max-width: 600px) {
    body.ef-page-education .ef-edu-styles { grid-template-columns: minmax(0, 1fr); }
    body.ef-page-education .ef-edu-style { border-left: 0; padding: var(--ef-s4); }
    body.ef-page-education .ef-edu-style + .ef-edu-style { border-top: 1px solid var(--ef-line); }
}

/* Resource rows are links */
body.ef-page-education .ef-edu-res { padding-top: var(--ef-s2); padding-bottom: var(--ef-s2); }
body.ef-page-education .ef-edu-res .ef-list-item { color: inherit; }
body.ef-page-education .ef-edu-res .ef-list-main { display: grid; gap: 2px; }
body.ef-page-education .ef-edu-res .ef-list-item:hover .ef-list-title { color: var(--ef-gold); }
body.ef-page-education .ef-edu-chev { width: 16px; height: 16px; color: var(--ef-text-3); flex-shrink: 0; }
body.ef-page-education .ef-edu-cta { align-self: start; }

/* Prose keeps proportional figures and hyphens (see section 3) */
body.ef-page-education :where(.ef-edu-desc, .ef-edu-title, .ef-edu-style dd, .ef-edu-style dt, .ef-list-title, .ef-list-sub) { font-variant-numeric: normal; }

/* =====================================================================
   7.14 Page: news
   ===================================================================== */
/* == Page: news (list and article reader) == */

/* List: date column, title + excerpt, chevron. Rows read like a table of contents. */
body.ef-page-news .ef-news-list { display: grid; }
body.ef-page-news .ef-news-item {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) 16px;
    gap: var(--ef-s5);
    align-items: start;
    padding: var(--ef-s5) var(--ef-s6);
    border-bottom: 1px solid var(--ef-line);
    cursor: pointer;
    transition: background-color .15s ease;
}
body.ef-page-news .ef-news-item:last-child { border-bottom: 0; }
body.ef-page-news .ef-news-item:hover { background: rgba(255, 255, 255, 0.018); }
body.ef-page-news .ef-news-item:hover .ef-news-title a { color: var(--ef-gold); }
body.ef-page-news .ef-news-item:hover .ef-news-chev { color: var(--ef-text-2); transform: translateX(2px); }
body.ef-page-news .ef-news-date {
    display: grid;
    gap: var(--ef-s2);
    justify-items: start;
    padding-top: 2px;
    font-size: var(--ef-fs-sm);
    color: var(--ef-text-3);
    font-variant-numeric: tabular-nums;
}
body.ef-page-news .ef-news-main { min-width: 0; }
body.ef-page-news .ef-news-title { font-size: var(--ef-fs-lg); font-weight: 600; line-height: 1.35; }
body.ef-page-news .ef-news-title a { color: var(--ef-text); transition: color .15s ease; }
body.ef-page-news .ef-news-title a:focus-visible { outline: 2px solid var(--ef-gold); outline-offset: 2px; border-radius: 2px; }
body.ef-page-news .ef-news-excerpt { margin-top: 6px; color: var(--ef-text-2); font-size: var(--ef-fs-md); max-width: 72ch; }
body.ef-page-news .ef-news-meta { margin-top: var(--ef-s2); color: var(--ef-text-3); font-size: var(--ef-fs-xs); }
body.ef-page-news .ef-news-chev { width: 16px; height: 16px; margin-top: 4px; color: var(--ef-text-3); transition: transform .15s ease, color .15s ease; }
body.ef-page-news .ef-news-item.is-latest .ef-news-title { font-size: var(--ef-fs-xl); letter-spacing: -0.012em; }

@media (max-width: 768px) {
    body.ef-page-news .ef-news-item { grid-template-columns: minmax(0, 1fr); gap: var(--ef-s2); padding: var(--ef-s4); }
    body.ef-page-news .ef-news-date { display: flex; align-items: center; }
    body.ef-page-news .ef-news-chev { display: none; }
    body.ef-page-news .ef-news-item.is-latest .ef-news-title { font-size: var(--ef-fs-lg); }
}

/* Article reader: one readable column */
body.ef-page-news .ef-article { max-width: 720px; margin: 0 auto; }
body.ef-page-news .ef-back { margin-left: calc(-1 * var(--ef-s3)); }
body.ef-page-news .ef-article-head { margin: var(--ef-s5) 0 var(--ef-s8); padding-bottom: var(--ef-s6); border-bottom: 1px solid var(--ef-line); }
body.ef-page-news .ef-article-meta { display: flex; flex-wrap: wrap; gap: var(--ef-s2); color: var(--ef-text-3); font-size: var(--ef-fs-sm); }
body.ef-page-news .ef-article-title { margin-top: var(--ef-s3); font-size: var(--ef-fs-3xl); font-weight: 600; letter-spacing: -0.022em; line-height: 1.15; }
body.ef-page-news .ef-article-lede { margin-top: var(--ef-s4); color: var(--ef-text-2); font-size: var(--ef-fs-lg); line-height: 1.6; }
body.ef-page-news .ef-article-byline { margin-top: var(--ef-s4); color: var(--ef-text-3); font-size: var(--ef-fs-sm); }
body.ef-page-news .ef-article-foot { display: flex; flex-wrap: wrap; gap: var(--ef-s2); margin-top: var(--ef-s10); padding-top: var(--ef-s5); border-top: 1px solid var(--ef-line); font-size: var(--ef-fs-sm); }
@media (max-width: 768px) {
    body.ef-page-news .ef-article-title { font-size: var(--ef-fs-2xl); }
    body.ef-page-news .ef-article-lede { font-size: var(--ef-fs-md); }
}


/* Prose keeps proportional figures and hyphens (see section 3) */
body.ef-page-news :where(.ef-news-title, .ef-news-excerpt, .ef-news-meta, .ef-article-title, .ef-article-lede, .ef-article-meta, .ef-prose) { font-variant-numeric: normal; }

/* =====================================================================
   7.15 Page: help
   ===================================================================== */
/* PROMOTE: accordion row built on <details>/<summary> (.hp-faq). Generic enough
   to become .ef-accordion if another page needs one. */
body.ef-page-help .hp-faq { border-bottom: 1px solid var(--ef-line); }
body.ef-page-help .hp-faq:last-of-type { border-bottom: 0; }
body.ef-page-help .hp-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ef-s4);
    padding: var(--ef-s4) var(--ef-s6);
    list-style: none;
    cursor: pointer;
    font-size: var(--ef-fs-md);
    font-weight: 500;
    color: var(--ef-text);
    transition: background-color .15s ease;
}
body.ef-page-help .hp-faq summary::-webkit-details-marker { display: none; }
body.ef-page-help .hp-faq summary:hover { background: rgba(255, 255, 255, 0.018); }
body.ef-page-help .hp-faq summary svg {
    width: 16px; height: 16px; flex-shrink: 0;
    color: var(--ef-text-3);
    transition: transform .2s var(--ef-ease);
}
body.ef-page-help .hp-faq[open] summary svg { transform: rotate(180deg); }
body.ef-page-help .hp-faq .faq-answer {
    padding: 0 var(--ef-s6) var(--ef-s5);
    max-width: 72ch;
    color: var(--ef-text-2);
    font-size: var(--ef-fs-md);
    line-height: 1.6;
}

/* Resource links: list rows that are links */
body.ef-page-help .hp-links { padding-top: var(--ef-s2); padding-bottom: var(--ef-s2); }
body.ef-page-help .hp-link { border-radius: var(--ef-r-sm); margin: 0 calc(-1 * var(--ef-s2)); padding-left: var(--ef-s2); padding-right: var(--ef-s2); transition: background-color .15s ease; }
body.ef-page-help .hp-link:hover { background: var(--ef-surface-2); }
body.ef-page-help .hp-link .ef-list-title,
body.ef-page-help .hp-link .ef-list-sub { display: block; }

@media (max-width: 768px) {
    body.ef-page-help .hp-faq summary { padding: var(--ef-s4); }
    body.ef-page-help .hp-faq .faq-answer { padding: 0 var(--ef-s4) var(--ef-s4); }
}

/* =====================================================================
   7.16 Page: rules
   ===================================================================== */
/* Rules: label column + text, one rule per row */
body.ef-page-rules .ru-list { list-style: none; margin: 0; padding: 0; display: grid; }
body.ef-page-rules .ru-list li {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: var(--ef-s4);
    padding: var(--ef-s3) 0;
    border-bottom: 1px solid var(--ef-line);
    font-size: var(--ef-fs-md);
    color: var(--ef-text-2);
    line-height: 1.5;
}
body.ef-page-rules .ru-list li:first-child { padding-top: 0; }
body.ef-page-rules .ru-list li:last-child { border-bottom: 0; padding-bottom: 0; }
body.ef-page-rules .ru-key { color: var(--ef-text); font-weight: 500; }
body.ef-page-rules .ru-note { color: var(--ef-text-2); font-size: var(--ef-fs-sm); }
@media (max-width: 520px) {
    body.ef-page-rules .ru-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* =====================================================================
   7.17 Page: economiccalendar
   ===================================================================== */
body.ef-page-economiccalendar .ec-source { margin-bottom: var(--ef-s6); }

/* Impact counts in the toolbar */
body.ef-page-economiccalendar .ec-counts { display: flex; align-items: center; gap: var(--ef-s4); font-size: var(--ef-fs-sm); color: var(--ef-text-2); white-space: nowrap; }
body.ef-page-economiccalendar .ec-count { display: inline-flex; align-items: center; gap: 6px; }
body.ef-page-economiccalendar .ec-count strong { color: var(--ef-text); font-weight: 600; font-variant-numeric: tabular-nums; }
body.ef-page-economiccalendar .ec-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ef-text-3); }
body.ef-page-economiccalendar .ec-dot.is-high { background: var(--ef-neg); }
body.ef-page-economiccalendar .ec-dot.is-medium { background: var(--ef-warn); }

/* Impact badge: high red, medium amber, low neutral */
body.ef-page-economiccalendar .ec-badge.is-high { color: var(--ef-neg); background: var(--ef-neg-tint); border-color: rgba(244, 114, 114, 0.22); }
body.ef-page-economiccalendar .ec-badge.is-medium { color: var(--ef-warn); background: var(--ef-warn-tint); border-color: rgba(233, 162, 59, 0.22); }
body.ef-page-economiccalendar .ec-badge.is-low { color: var(--ef-text-2); }

/* Day groups */
body.ef-page-economiccalendar .ec-day-head {
    position: sticky;
    top: var(--ef-topbar-h);
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--ef-s3);
    padding: var(--ef-s3) var(--ef-s6);
    background: var(--ef-surface-2);
    border-bottom: 1px solid var(--ef-line);
    font-size: var(--ef-fs-sm);
    font-weight: 600;
    color: var(--ef-text);
}
body.ef-page-economiccalendar .ec-day-head span { font-size: var(--ef-fs-xs); font-weight: 400; color: var(--ef-text-3); }
body.ef-page-economiccalendar .ec-day:last-child .ec-event:last-child { border-bottom: 0; }

/* Event row: time, currency, name, impact */
body.ef-page-economiccalendar .ec-event {
    display: grid;
    grid-template-columns: 56px 48px minmax(0, 1fr) auto;
    gap: var(--ef-s4);
    align-items: center;
    padding: var(--ef-s3) var(--ef-s6);
    border-bottom: 1px solid var(--ef-line);
    font-size: var(--ef-fs-sm);
}
body.ef-page-economiccalendar .ec-event:hover { background: rgba(255, 255, 255, 0.018); }
body.ef-page-economiccalendar .ec-time { color: var(--ef-text-2); font-variant-numeric: tabular-nums; }
body.ef-page-economiccalendar .ec-ccy { color: var(--ef-text); font-weight: 600; font-size: var(--ef-fs-xs); letter-spacing: 0.02em; }
body.ef-page-economiccalendar .ec-name { color: var(--ef-text); min-width: 0; }
body.ef-page-economiccalendar .ec-spinner { width: 20px; height: 20px; border-color: var(--ef-line-strong); border-top-color: var(--ef-gold); }

@media (max-width: 768px) {
    body.ef-page-economiccalendar .ec-counts { width: 100%; }
    body.ef-page-economiccalendar .ec-day-head { padding: var(--ef-s3) var(--ef-s4); }
    body.ef-page-economiccalendar .ec-event {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        grid-template-areas: "time ccy impact" "name name name";
        gap: 4px var(--ef-s3);
        padding: var(--ef-s3) var(--ef-s4);
    }
    body.ef-page-economiccalendar .ec-time { grid-area: time; }
    body.ef-page-economiccalendar .ec-ccy { grid-area: ccy; }
    body.ef-page-economiccalendar .ec-name { grid-area: name; }
    body.ef-page-economiccalendar .ec-impact { grid-area: impact; }
}

/* =====================================================================
   7.18 Page: images
   ===================================================================== */
/* Generated card preview: 16:9, keeps the template's own light background */
body.ef-page-images .ef-img-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: var(--ef-r);
    border: 1px solid var(--ef-line);
    background: var(--ef-surface-2);
}

/* =====================================================================
   7.19 Page: branding_configurator
   ===================================================================== */
/* Ten setting groups as cards in two columns, each card as tall as its content */
body.ef-page-branding_configurator .ef-bc-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ef-s4);
    align-items: start;
}
@media (max-width: 1100px) {
    body.ef-page-branding_configurator .ef-bc-sections { grid-template-columns: minmax(0, 1fr); }
}

/* Colour field: hex text input plus a native swatch */
body.ef-page-branding_configurator .ef-bc-color { display: flex; gap: var(--ef-s2); }
body.ef-page-branding_configurator .ef-bc-color .ef-input { flex: 1; min-width: 0; font-family: var(--ef-mono); font-size: var(--ef-fs-sm); }
body.ef-page-branding_configurator .ef-bc-swatch {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 3px;
    background: var(--ef-surface-2);
    border: 1px solid var(--ef-line-strong);
    border-radius: var(--ef-r-sm);
    cursor: pointer;
}
body.ef-page-branding_configurator .ef-bc-swatch::-webkit-color-swatch-wrapper { padding: 0; }
body.ef-page-branding_configurator .ef-bc-swatch::-webkit-color-swatch { border: 0; border-radius: 4px; }
body.ef-page-branding_configurator .ef-bc-swatch::-moz-color-swatch { border: 0; border-radius: 4px; }

/* Logo preview on a raised tile */
body.ef-page-branding_configurator .ef-bc-logo {
    max-width: 220px;
    max-height: 64px;
    padding: var(--ef-s3);
    background: var(--ef-surface-2);
    border: 1px solid var(--ef-line);
    border-radius: var(--ef-r-sm);
}

/* Feature list rows: input + remove (rows are created by the page script) */
body.ef-page-branding_configurator .ef-bc-features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ef-s2); }
body.ef-page-branding_configurator .ef-bc-features:empty { display: none; }
body.ef-page-branding_configurator .ef-bc-features .feature-item { display: flex; gap: var(--ef-s2); align-items: center; }
body.ef-page-branding_configurator .ef-bc-features .ef-input { flex: 1; min-width: 0; }
body.ef-page-branding_configurator .add-feature-btn { justify-self: start; }

/* Save bar sticks to the bottom of the viewport while the long form scrolls */
body.ef-page-branding_configurator .ef-bc-savebar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ef-s3);
    margin-top: var(--ef-s6);
    padding: var(--ef-s3) 0;
    background: var(--ef-bg);
    border-top: 1px solid var(--ef-line);
}
body.ef-page-branding_configurator .ef-bc-savebar .ef-alert { flex: 1; padding-block: var(--ef-s2); }
@media (max-width: 768px) {
    /* clear the 64px mobile bottom nav */
    body.ef-page-branding_configurator .ef-bc-savebar { bottom: calc(64px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
    body.ef-page-branding_configurator .ef-bc-savebar .ef-btn { width: 100%; }
}
