﻿/**
 * CITS WP E-Learning Pro — Component library (E75.3).
 *
 * Design tokens + component styles for the 8 primitive PHP components
 * under src/Frontend/Components/*.
 *
 * Every rule uses design tokens; no hardcoded hex outside the :root
 * declaration. Enforced by tools/lint-css-hex.php (E75.9).
 */

/* ─────────────────────────────────────────────────────────────────
 * Design tokens
 * ───────────────────────────────────────────────────────────────── */
:root {
    /* Brand chain — resolves through Customizer + palette (E71.0.4) */
    --cits-wpel-primary-color: #3a6b35;
    --cits-wpel-accent-color:  #7c3aed;
    --cits-wpel-success-color: #16a34a;
    --cits-wpel-danger-color:  #dc2626;
    --cits-wpel-neutral-color: #475569;

    /* Derived surfaces */
    --et-surface:        #ffffff;
    --et-surface-sunken: #fafafa;
    --et-surface-tint:   rgba(58, 107, 53, 0.06);

    /* Borders */
    --et-border:      #e5e7eb;
    --et-border-soft: #f0f2f5;

    /* Ink */
    --et-ink:       #111827;
    --et-ink-soft:  #374151;
    --et-ink-muted: #6b7280;
    --et-ink-faint: #9ca3af;

    /* Typography */
    --et-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --et-font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;

    --et-fs-eyebrow: 10px;
    --et-fs-body:    14px;
    --et-fs-body-lg: 15px;
    --et-fs-h4:      15px;
    --et-fs-h3:      17px;
    --et-fs-h2:      20px;
    --et-fs-h1:      26px;

    --et-lh-body:  1.5;
    --et-lh-tight: 1.2;

    /* Spacing (4-point grid) */
    --et-space-1:  4px;
    --et-space-2:  8px;
    --et-space-3:  12px;
    --et-space-4:  16px;
    --et-space-5:  20px;
    --et-space-6:  24px;
    --et-space-8:  32px;
    --et-space-10: 40px;
    --et-space-12: 48px;
    --et-space-16: 64px;

    /* Radius */
    --et-radius-sm:   6px;
    --et-radius:      10px;
    --et-radius-lg:   16px;
    --et-radius-pill: 999px;

    /* Elevation */
    --et-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --et-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
    --et-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --et-shadow-lg: 0 8px 24px -12px rgba(37, 99, 235, 0.45);

    /* Motion */
    --et-motion-fast:   120ms cubic-bezier(0.2, 0, 0, 1);
    --et-motion-medium: 200ms cubic-bezier(0.2, 0, 0, 1);
    --et-motion-slow:   300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reduced-motion: collapse every transition */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ─────────────────────────────────────────────────────────────────
 * 3.1 Hero band
 * ───────────────────────────────────────────────────────────────── */
.cwl-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--et-space-6);
    align-items: center;
    padding: var(--et-space-8) var(--et-space-6);
    border-radius: var(--et-radius-lg);
    margin-bottom: var(--et-space-6);
    color: var(--et-ink);
    container-type: inline-size;
}

.cwl-hero--brand {
    background: linear-gradient(135deg, var(--cits-wpel-primary-color) 0%, color-mix(in srgb, var(--cits-wpel-primary-color) 70%, #000) 100%);
    color: #ffffff;
    box-shadow: var(--et-shadow-lg);
}

.cwl-hero--slim {
    background: var(--et-surface-sunken);
    padding-top: var(--et-space-5);
    padding-bottom: var(--et-space-5);
}

.cwl-hero--sunken {
    background: var(--et-surface-sunken);
    border: 1px solid var(--et-border);
    padding: var(--et-space-6);
    text-align: center;
    max-width: 480px;
    margin-inline: auto;
}

.cwl-hero__eyebrow {
    font-size: var(--et-fs-eyebrow);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    margin: 0 0 var(--et-space-2);
    opacity: 0.85;
}

.cwl-hero__title {
    font-size: var(--et-fs-h1);
    line-height: var(--et-lh-tight);
    font-weight: 700;
    margin: 0 0 var(--et-space-2);
    letter-spacing: -0.01em;
    color: inherit;
}

.cwl-hero__subtitle {
    font-size: var(--et-fs-body-lg);
    line-height: var(--et-lh-body);
    margin: 0;
    opacity: 0.9;
    max-width: 60ch;
}

.cwl-hero__cta-row {
    margin: var(--et-space-4) 0 0;
}

.cwl-hero__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--et-space-3);
    min-width: 260px;
}

.cwl-hero--brand .cwl-hero__stats .cwl-stat--pill {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

@container (max-width: 640px) {
    .cwl-hero {
        grid-template-columns: 1fr;
    }

    .cwl-hero__stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─────────────────────────────────────────────────────────────────
 * 3.2 Stat tile
 * ───────────────────────────────────────────────────────────────── */
.cwl-stat {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-1);
    padding: var(--et-space-3) var(--et-space-4);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    text-decoration: none;
    color: inherit;
}

.cwl-stat--pill {
    padding: var(--et-space-2) var(--et-space-3);
    border-radius: var(--et-radius-sm);
    text-align: center;
}

.cwl-stat--linked:hover {
    box-shadow: var(--et-shadow-sm);
    transform: translateY(-1px);
    transition: transform var(--et-motion-fast), box-shadow var(--et-motion-fast);
}

.cwl-stat__value {
    font-size: var(--et-fs-h1);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: inherit;
}

.cwl-stat--pill .cwl-stat__value {
    font-size: var(--et-fs-h2);
}

.cwl-stat__label {
    font-size: var(--et-fs-eyebrow);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--et-ink-muted);
    line-height: 1.1;
}

.cwl-stat--pill .cwl-stat__label {
    opacity: 0.85;
}

.cwl-stat__trend {
    font-size: var(--et-fs-eyebrow);
    font-weight: 600;
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--et-radius-sm);
    margin-top: var(--et-space-1);
}

.cwl-stat__trend--up {
    background: color-mix(in srgb, var(--cits-wpel-success-color) 12%, transparent);
    color: var(--cits-wpel-success-color);
}

.cwl-stat__trend--down {
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 12%, transparent);
    color: var(--cits-wpel-danger-color);
}

/* ─────────────────────────────────────────────────────────────────
 * 3.3 Card
 * ───────────────────────────────────────────────────────────────── */
.cwl-card {
    display: block;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    padding: var(--et-space-5);
    box-shadow: var(--et-shadow-xs);
    color: var(--et-ink);
    text-decoration: none;
}

.cwl-card--elevated:hover {
    box-shadow: var(--et-shadow-sm);
    transform: translateY(-1px);
    transition: transform var(--et-motion-fast), box-shadow var(--et-motion-fast);
}

.cwl-card--interactive {
    cursor: pointer;
}

.cwl-card--interactive:hover,
.cwl-card--interactive:focus-visible {
    box-shadow: var(--et-shadow-sm);
    transform: translateY(-1px);
    border-color: var(--cits-wpel-primary-color);
    transition: transform var(--et-motion-fast), box-shadow var(--et-motion-fast), border-color var(--et-motion-fast);
    outline: none;
}

.cwl-card--empty {
    border-style: dashed;
    background: var(--et-surface-sunken);
    text-align: center;
}

.cwl-card--danger {
    border-color: color-mix(in srgb, var(--cits-wpel-danger-color) 40%, transparent);
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 4%, var(--et-surface));
}

.cwl-card__header {
    margin-bottom: var(--et-space-3);
}

.cwl-card__eyebrow {
    font-size: var(--et-fs-eyebrow);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--et-ink-muted);
    font-weight: 600;
    margin: 0 0 var(--et-space-1);
}

.cwl-card__title {
    font-size: var(--et-fs-h3);
    font-weight: 600;
    margin: 0;
    color: var(--et-ink);
    line-height: var(--et-lh-tight);
}

.cwl-card__body {
    font-size: var(--et-fs-body);
    line-height: var(--et-lh-body);
    color: var(--et-ink-soft);
}

.cwl-card__footer {
    margin-top: var(--et-space-4);
    padding-top: var(--et-space-3);
    border-top: 1px solid var(--et-border-soft);
    font-size: var(--et-fs-body);
}

/* ─────────────────────────────────────────────────────────────────
 * 3.4 Empty state card / 3.5 Access denied
 * ───────────────────────────────────────────────────────────────── */
.cwl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--et-space-10) var(--et-space-6);
    background: var(--et-surface-sunken);
    border: 1px dashed var(--et-border);
    border-radius: var(--et-radius-lg);
    color: var(--et-ink);
    max-width: 560px;
    margin-inline: auto;
}

.cwl-empty__icon {
    color: var(--cits-wpel-primary-color);
    opacity: 0.6;
    margin-bottom: var(--et-space-4);
}

.cwl-empty__title {
    font-size: var(--et-fs-h3);
    font-weight: 600;
    margin: 0 0 var(--et-space-2);
    color: var(--et-ink);
}

.cwl-empty__diagnostic {
    font-size: var(--et-fs-body);
    line-height: var(--et-lh-body);
    color: var(--et-ink-muted);
    max-width: 44ch;
    margin: 0 0 var(--et-space-5);
}

.cwl-empty__cta {
    margin: 0 0 var(--et-space-3);
}

.cwl-empty__secondary {
    margin: 0;
    font-size: var(--et-fs-body);
}

/* ─────────────────────────────────────────────────────────────────
 * 3.6 Widget shell
 * ───────────────────────────────────────────────────────────────── */
.cwl-widget {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    padding: var(--et-space-5);
    box-shadow: var(--et-shadow-xs);
    display: flex;
    flex-direction: column;
    gap: var(--et-space-3);
}

.cwl-widget__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--et-space-3);
}

.cwl-widget__title {
    font-size: var(--et-fs-h4);
    font-weight: 600;
    margin: 0;
    color: var(--et-ink);
    line-height: var(--et-lh-tight);
}

.cwl-widget__body {
    font-size: var(--et-fs-body);
    line-height: var(--et-lh-body);
    color: var(--et-ink-soft);
}

.cwl-widget__footer {
    padding-top: var(--et-space-3);
    border-top: 1px solid var(--et-border-soft);
    font-size: var(--et-fs-body);
}

.cwl-widget__view-all {
    font-weight: 600;
}

.cwl-widget__stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--et-space-3);
}

/* E75.4 — auth surface layout: hero (sunken) above a centered card.
 * v1.5.2 — widened to 560px; some themes constrain content to a narrow
 * column, so we also override the inner hero's max-width and force
 * balanced text-wrap on the H1 so short titles like "Welcome back"
 * don't stack mid-word inside a narrow theme container. */
.cwl-auth-surface {
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
    padding-block: var(--et-space-6);
    box-sizing: border-box;
}

.cwl-auth-surface .cwl-hero {
    margin-bottom: var(--et-space-4);
    display: block;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.cwl-auth-surface .cwl-hero--sunken {
    max-width: 100%;
}

.cwl-auth-surface .cwl-hero__body {
    max-width: 100%;
}

.cwl-auth-surface .cwl-hero__title {
    text-wrap: balance;
    word-break: normal;
    overflow-wrap: normal;
}

.cwl-auth-surface .cwl-hero__subtitle {
    text-wrap: balance;
    max-width: 100%;
    margin-inline: auto;
}

.cwl-auth-surface .cits-wpel-auth-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────────
 * E75.10 — KPI card (top-of-dashboard tile)
 * ───────────────────────────────────────────────────────────────── */
.cwl-kpi {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-2);
    padding: var(--et-space-4) var(--et-space-5);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    box-shadow: var(--et-shadow-xs);
    color: var(--et-ink);
    text-decoration: none;
    min-height: 108px;
    justify-content: space-between;
}

.cwl-kpi--linked {
    transition: transform var(--et-motion-fast), box-shadow var(--et-motion-fast), border-color var(--et-motion-fast);
}

.cwl-kpi--linked:hover,
.cwl-kpi--linked:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--et-shadow-sm);
    border-color: var(--cits-wpel-primary-color);
    outline: none;
}

.cwl-kpi__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--et-space-3);
}

.cwl-kpi__label {
    font-size: var(--et-fs-body);
    color: var(--et-ink-muted);
    font-weight: 500;
    line-height: 1.2;
}

.cwl-kpi__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--et-radius-sm);
    flex: 0 0 40px;
}

.cwl-kpi__icon svg {
    width: 20px;
    height: 20px;
}

/* Tone treatments — icon square background + stroke colour. */
.cwl-kpi--brand   .cwl-kpi__icon { background: color-mix(in srgb, var(--cits-wpel-primary-color) 12%, transparent); color: var(--cits-wpel-primary-color); }
.cwl-kpi--success .cwl-kpi__icon { background: color-mix(in srgb, var(--cits-wpel-success-color) 12%, transparent); color: var(--cits-wpel-success-color); }
.cwl-kpi--accent  .cwl-kpi__icon { background: color-mix(in srgb, var(--cits-wpel-accent-color) 12%, transparent);  color: var(--cits-wpel-accent-color);  }
.cwl-kpi--warn    .cwl-kpi__icon { background: color-mix(in srgb, #f59e0b 12%, transparent);                        color: #f59e0b; }
.cwl-kpi--neutral .cwl-kpi__icon { background: color-mix(in srgb, var(--cits-wpel-neutral-color) 12%, transparent); color: var(--cits-wpel-neutral-color); }

.cwl-kpi__value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--et-ink);
}

.cwl-kpi__helper {
    font-size: 12px;
    color: var(--et-ink-muted);
    font-weight: 500;
    line-height: 1.2;
}

/* Grid wrapper: 4-across on wide, 2-across on tablet, 1-across on mobile.
   Container-query driven so it degrades when hosted inside a narrow theme. */
.cwl-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--et-space-4);
    container-type: inline-size;
}

@container (max-width: 720px) {
    .cwl-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (max-width: 480px) {
    .cwl-kpi-row {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────────────────
 * E75.10 — Dark card variant (for Continue Learning primary CTA)
 * ───────────────────────────────────────────────────────────────── */
.cwl-card--dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    border-color: transparent;
    box-shadow: var(--et-shadow-md);
}

.cwl-card--dark .cwl-card__eyebrow {
    color: color-mix(in srgb, var(--cits-wpel-primary-color) 60%, #ffffff);
    letter-spacing: 0.15em;
}

.cwl-card--dark .cwl-card__title,
.cwl-card--dark .cwl-card__body {
    color: #f1f5f9;
}

.cwl-card--dark .cwl-btn--primary {
    background: var(--cits-wpel-primary-color);
    border-color: var(--cits-wpel-primary-color);
    color: #ffffff;
}

.cwl-card--dark .cwl-btn--primary:hover,
.cwl-card--dark .cwl-btn--primary:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 80%, #ffffff);
    border-color: color-mix(in srgb, var(--cits-wpel-primary-color) 80%, #ffffff);
}

/* ─────────────────────────────────────────────────────────────────
 * E75.10 — Two-column body layout (main + right rail)
 *
 * Adopt: `<div class="cwl-body cwl-body--split">` in surfaces that
 * want the two-column layout. Left = main content (auto), right =
 * 320px sidebar. Collapses to single-column below 960px container.
 * ───────────────────────────────────────────────────────────────── */
.cwl-body {
    display: block;
    container-type: inline-size;
}

.cwl-body--split {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--et-space-5);
}

@container (min-width: 960px) {
    .cwl-body--split {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: flex-start;
    }
}

.cwl-body__main {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-4);
    min-width: 0;
}

.cwl-body__rail {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-4);
    min-width: 0;
}

/* ─────────────────────────────────────────────────────────────────
 * E75.10 — Upcoming deadline row (compact list item inside a widget)
 * ───────────────────────────────────────────────────────────────── */
.cwl-deadline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--et-space-3);
}

.cwl-deadline {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: var(--et-space-3);
    align-items: center;
    padding: var(--et-space-2) 0;
    text-decoration: none;
    color: inherit;
}

.cwl-deadline__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    color: var(--cits-wpel-primary-color);
    border-radius: var(--et-radius-sm);
    flex: 0 0 32px;
}

.cwl-deadline__icon svg { width: 16px; height: 16px; }

.cwl-deadline__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cwl-deadline__title {
    font-size: var(--et-fs-body);
    font-weight: 600;
    color: var(--et-ink);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cwl-deadline__sub {
    font-size: 12px;
    color: var(--et-ink-muted);
    line-height: 1.3;
}

.cwl-deadline__due {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--et-radius-sm);
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 10%, transparent);
    color: var(--cits-wpel-danger-color);
    white-space: nowrap;
}

.cwl-deadline__due--soon {
    background: color-mix(in srgb, #f59e0b 12%, transparent);
    color: #b45309;
}

.cwl-deadline__due--later {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    color: var(--cits-wpel-primary-color);
}

.cwl-deadline:hover .cwl-deadline__title,
.cwl-deadline:focus-visible .cwl-deadline__title {
    color: var(--cits-wpel-primary-color);
}

/* E75.10 — Continue-learning dark card specifics. */
.cwl-continue .cwl-card__eyebrow {
    font-size: var(--et-fs-eyebrow);
    font-weight: 700;
}

.cwl-continue__next {
    margin: 0 0 var(--et-space-4);
    font-size: var(--et-fs-body);
    line-height: 1.5;
}

.cwl-continue__next-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    margin-bottom: 2px;
}

.cwl-continue__cta {
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────────
 * E75.10 — Sidebar polish: brand mark up top + user pill at bottom
 *
 * These rules layer on top of native-account.css sidebar styles.
 * Scope selectors to `.cwa-side-nav` to avoid theme collisions.
 * ───────────────────────────────────────────────────────────────── */
.cwa-side-nav {
    display: flex;
    flex-direction: column;
}

.cwa-side-nav__brand {
    display: flex;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-4) var(--et-space-5);
    margin-bottom: var(--et-space-2);
    color: var(--et-ink);
    border-bottom: 1px solid var(--et-border-soft);
}

.cwa-side-nav__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 12%, transparent);
    color: var(--cits-wpel-primary-color);
    border-radius: var(--et-radius-sm);
    flex: 0 0 36px;
}

.cwa-side-nav__brand-name {
    font-size: var(--et-fs-h4);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--et-ink);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scroll region between brand + user pill */
.cwa-side-nav__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.cwa-side-nav__user {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) var(--et-space-4);
    margin-top: var(--et-space-2);
    border-top: 1px solid var(--et-border-soft);
    background: var(--et-surface-sunken);
    border-radius: 0 0 var(--et-radius) var(--et-radius);
}

.cwa-side-nav__user-avatar {
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px;
}

.cwa-side-nav__user-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cwa-side-nav__user-name {
    font-size: var(--et-fs-body);
    font-weight: 600;
    color: var(--et-ink);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cwa-side-nav__user-persona {
    font-size: 11px;
    color: var(--et-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.cwa-side-nav__user-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--et-radius-sm);
    color: var(--et-ink-muted);
    text-decoration: none;
    transition: background var(--et-motion-fast), color var(--et-motion-fast);
}

.cwa-side-nav__user-logout:hover,
.cwa-side-nav__user-logout:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 10%, transparent);
    color: var(--cits-wpel-danger-color);
    outline: none;
}

/* ─────────────────────────────────────────────────────────────────
 * E75.11 — Reference-style dashboard shell (LearnHub pattern).
 *
 * Every colour flows through the design-token chain — no literal
 * hex. Sidebar dark chrome uses `var(--et-ink)` so it inherits the
 * theme's ink colour; brand tints use `var(--cits-wpel-primary-color)`.
 * Category chip palette is computed via `color-mix()` from ink +
 * brand + accent tokens so the 5 chip tones vary but still inherit
 * the operator's colour scheme.
 * ───────────────────────────────────────────────────────────────── */

/* ---- KPI card reference variant ---- */
.cwl-kpi--layout-reference {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--et-space-5) var(--et-space-5);
    border-radius: 14px;
    min-height: 0;
    gap: var(--et-space-3);
}

.cwl-kpi--layout-reference .cwl-kpi__stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cwl-kpi--layout-reference .cwl-kpi__label {
    font-size: 12.5px;
    color: var(--et-ink-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.cwl-kpi--layout-reference .cwl-kpi__value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-top: 2px;
    color: var(--et-ink);
}

.cwl-kpi--layout-reference .cwl-kpi__helper {
    font-size: 11.5px;
    color: var(--cits-wpel-success-color);
    font-weight: 500;
    margin-top: 4px;
}

.cwl-kpi--layout-reference .cwl-kpi__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex: 0 0 44px;
}

.cwl-kpi--layout-reference .cwl-kpi__icon svg {
    width: 22px;
    height: 22px;
}

/* ---- Dashboard topbar (replaces gradient hero on Overview) ---- */
.cwl-dash-topbar {
    background: var(--et-surface);
    border-bottom: 1px solid var(--et-border);
    padding: var(--et-space-4) var(--et-space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-4);
    margin: calc(-1 * var(--et-space-5)) calc(-1 * var(--et-space-5)) var(--et-space-6);
    border-radius: var(--et-radius) var(--et-radius) 0 0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.cwl-dash-topbar__eyebrow {
    display: block;
    font-size: var(--et-fs-eyebrow);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    color: var(--cits-wpel-primary-color);
    margin-bottom: 2px;
}

.cwl-dash-topbar__title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--et-ink);
    margin: 0;
}

.cwl-dash-topbar__subtitle {
    font-size: 12.5px;
    color: var(--et-ink-muted);
    font-weight: 500;
    margin: 2px 0 0;
}

.cwl-dash-topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--et-space-3);
}

.cwl-dash-topbar__bell {
    position: relative;
    color: var(--et-ink-muted);
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--et-radius-sm);
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.cwl-dash-topbar__bell:hover,
.cwl-dash-topbar__bell:focus-visible {
    background: var(--et-surface-sunken);
    color: var(--et-ink);
    outline: none;
}

.cwl-dash-topbar__bell svg {
    width: 20px;
    height: 20px;
}

.cwl-dash-topbar__bell-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cits-wpel-danger-color);
    border: 2px solid var(--et-surface);
}

/* ---- Stat grid (4-across, container-query responsive) ---- */
.cwl-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--et-space-4);
    margin-bottom: var(--et-space-6);
    container-type: inline-size;
}

@container (max-width: 760px) {
    .cwl-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (max-width: 480px) {
    .cwl-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Two-col body (1fr 380px per reference) ---- */
.cwl-body--split-lg {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--et-space-6);
    container-type: inline-size;
}

@container (min-width: 1000px) {
    .cwl-body--split-lg {
        grid-template-columns: minmax(0, 1fr) 380px;
        align-items: flex-start;
    }
}

/* ---- Rich course rows (My Courses widget) ---- */
.cwl-course-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cwl-course-row {
    border-bottom: 1px solid var(--et-border);
}

.cwl-course-row:last-child {
    border-bottom: 0;
}

.cwl-course-row__link {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--et-space-4);
    padding: var(--et-space-4) 0;
    text-decoration: none;
    color: inherit;
    transition: background var(--et-motion-fast);
}

.cwl-course-row__link:hover,
.cwl-course-row__link:focus-visible {
    background: var(--et-surface-sunken);
    outline: none;
}

.cwl-course-row__link:focus-visible {
    box-shadow: inset 0 0 0 2px var(--cits-wpel-primary-color);
    border-radius: var(--et-radius-sm);
}

/* Course thumbnail — tinted square with letter or bg image. */
.cwl-course-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex: 0 0 48px;
    background-size: cover;
    background-position: center;
}

.cwl-course-thumb--muted {
    background: color-mix(in srgb, var(--et-ink) 6%, var(--et-surface));
    color: var(--et-ink-muted);
}

.cwl-course-thumb--brand {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 12%, var(--et-surface));
    color: var(--cits-wpel-primary-color);
}

.cwl-course-thumb--success {
    background: color-mix(in srgb, var(--cits-wpel-success-color) 12%, var(--et-surface));
    color: var(--cits-wpel-success-color);
}

/* When a real thumbnail image is present the letter hides. */
.cwl-course-thumb--image {
    background-color: var(--et-surface-sunken);
    color: transparent;
}

.cwl-course-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cwl-course-title-row {
    display: flex;
    align-items: center;
    gap: var(--et-space-2);
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.cwl-course-title {
    font-size: 13.5px;
    font-weight: 650;
    color: var(--et-ink);
    line-height: 1.3;
}

.cwl-course-meta {
    font-size: 12px;
    color: var(--et-ink-muted);
    margin-bottom: 6px;
}

.cwl-course-bar {
    display: block;
    height: 6px;
    background: color-mix(in srgb, var(--et-ink) 8%, var(--et-surface));
    border-radius: 99px;
    overflow: hidden;
    width: 100%;
    --cwl-bar-width: 0%;
}

.cwl-course-bar__fill {
    display: block;
    height: 100%;
    width: var(--cwl-bar-width);
    border-radius: 99px;
    transition: width var(--et-motion-medium);
}

.cwl-course-bar__fill--muted   { background: var(--et-ink-muted); }
.cwl-course-bar__fill--brand   { background: var(--cits-wpel-primary-color); }
.cwl-course-bar__fill--success { background: var(--cits-wpel-success-color); }

.cwl-course-ring-wrap {
    flex-shrink: 0;
}

/* ---- Progress ring ---- */
.cwl-ring {
    display: block;
    transform: rotate(-90deg);
}

.cwl-ring__track {
    stroke: color-mix(in srgb, var(--et-ink) 10%, var(--et-surface));
}

.cwl-ring--muted   .cwl-ring__fill { stroke: var(--et-ink-muted); }
.cwl-ring--brand   .cwl-ring__fill { stroke: var(--cits-wpel-primary-color); }
.cwl-ring--success .cwl-ring__fill { stroke: var(--cits-wpel-success-color); }

.cwl-ring__fill {
    transition: stroke-dashoffset var(--et-motion-slow);
}

.cwl-ring__text {
    transform: rotate(90deg);
    transform-origin: center;
    font-size: 11px;
    font-weight: 700;
    fill: var(--et-ink);
}

/* ---- Category chip 5-tone palette (all token-driven via color-mix) ---- */
.cwl-badge--tone-1 { background: color-mix(in srgb, var(--cits-wpel-primary-color) 14%, transparent); color: var(--cits-wpel-primary-color); }
.cwl-badge--tone-2 { background: color-mix(in srgb, var(--cits-wpel-success-color) 14%, transparent); color: var(--cits-wpel-success-color); }
.cwl-badge--tone-3 { background: color-mix(in srgb, var(--cits-wpel-accent-color)  14%, transparent); color: var(--cits-wpel-accent-color); }
.cwl-badge--tone-4 { background: color-mix(in srgb, var(--cits-wpel-danger-color)  14%, transparent); color: var(--cits-wpel-danger-color); }
.cwl-badge--tone-5 { background: color-mix(in srgb, var(--et-ink)                  10%, transparent); color: var(--et-ink); }

/* ---- Dark sidebar refresh (via `.cwa-side-nav` chain) ----
   Inherits theme ink via `var(--et-ink)`. Text inside inverts.
   Scoped under `.cits-wpel-account.cwa-dashboard-v2` to avoid
   colliding with the WC endpoint sidebar rendering. */
.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav {
    background: var(--et-ink);
    color: color-mix(in srgb, var(--et-surface) 92%, transparent);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__brand {
    color: var(--et-surface);
    border-bottom-color: color-mix(in srgb, var(--et-surface) 12%, transparent);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__brand-name {
    color: var(--et-surface);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__brand-mark {
    background: linear-gradient(135deg, var(--cits-wpel-primary-color), var(--cits-wpel-accent-color));
    color: var(--et-surface);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__group-label {
    color: color-mix(in srgb, var(--et-surface) 55%, transparent);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__item {
    color: color-mix(in srgb, var(--et-surface) 72%, transparent);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 2px 8px;
    transition: background var(--et-motion-fast), color var(--et-motion-fast);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__item:hover {
    background: color-mix(in srgb, var(--et-surface) 8%, transparent);
    color: var(--et-surface);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__item[aria-current="page"] {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 18%, transparent);
    color: color-mix(in srgb, var(--cits-wpel-primary-color) 60%, var(--et-surface));
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__user {
    background: transparent;
    border-top-color: color-mix(in srgb, var(--et-surface) 12%, transparent);
    border-radius: 0;
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__user-name {
    color: color-mix(in srgb, var(--et-surface) 92%, transparent);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__user-persona {
    color: color-mix(in srgb, var(--et-surface) 55%, transparent);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__user-logout {
    color: color-mix(in srgb, var(--et-surface) 55%, transparent);
}

.cits-wpel-account.cwa-dashboard-v2 .cwa-side-nav__user-logout:hover {
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 15%, transparent);
    color: color-mix(in srgb, var(--cits-wpel-danger-color) 60%, var(--et-surface));
}

/* ═══════════════════════════════════════════════════════════════════
 * E75.13 — Account hub shell (`[cits_wpel_my_account]` v1.5.0).
 *
 * Clean WooCommerce-style my-account layout: dark hero band with
 * avatar + name, left sidebar nav (light bg, brand-accent active
 * pill), right main column with 5-tile stat grid + filter tabs +
 * courses table.
 *
 * Chromeless full-viewport surface — the plugin's own template
 * (`templates/my-account/hub-template.php`) is served instead of the
 * theme's, so the shell owns the whole viewport. All colours flow
 * through `--cits-wpel-*` + `--et-*` tokens which cascade from the
 * active theme's palette (no hardcoded hex outside :root).
 * ═══════════════════════════════════════════════════════════════════ */
/* v1.5.1 — chromeless template retired; theme header/footer wrap the
 * shell again. These resets neutralise theme container padding that
 * would leave a wide margin around the hero band while keeping the
 * shell responsive inside the theme's content column. */
body.cwl-acct-page .entry-content,
body.cwl-acct-page .site-content .content-area,
body.cwl-acct-page .content-area .site-main {
    max-width: none;
}

.cwl-acct {
    display: block;
    background: var(--et-surface-sunken);
    color: var(--et-ink);
    container-type: inline-size;
    border-radius: var(--et-radius-lg);
    overflow: hidden;
    box-shadow: var(--et-shadow-xs);
    margin-block: var(--et-space-4);
}

/* ---- HERO BAND ---- */
/* v1.5.4 — hero background inherits the theme's primary color instead
 * of the plugin's fixed dark ink, so the surface adapts to whatever
 * brand the operator's theme (or plugin Customizer override) resolves
 * to. Falls back to --et-ink via color-mix() for a slightly-darker
 * variant of the brand so text contrast stays readable on light
 * primaries too. */
.cwl-acct__hero {
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    padding: var(--et-space-6) var(--et-space-6);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.cwl-acct__hero-inner {
    display: flex;
    align-items: center;
    gap: var(--et-space-5);
    /* v1.5.25 — removed the 1280px cap so the shell honours the width
     * of its host container (Elementor / block wrapper / theme content
     * column). Operators who want the boxed look wrap the shortcode in
     * a boxed Elementor container; those who want edge-to-edge use a
     * full-width container. No more internal centring gap either way. */
    max-width: 100%;
    padding-inline: var(--et-space-4);
}
.cwl-acct__hero-avatar-wrap {
    display: inline-flex;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: color-mix(in srgb, #ffffff 30%, transparent);
    flex-shrink: 0;
}
.cwl-acct__hero-avatar-wrap img,
.cwl-acct__hero-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.cwl-acct__hero-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.cwl-acct__hero-name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--cits-wpel-button-text, #ffffff);
    letter-spacing: -0.01em;
}
.cwl-acct__hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0;
    font-size: 13px;
    color: color-mix(in srgb, var(--cits-wpel-button-text, #ffffff) 85%, transparent);
}
.cwl-acct__hero-role-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: color-mix(in srgb, #ffffff 22%, transparent);
    color: var(--cits-wpel-button-text, #ffffff);
    border-radius: var(--et-radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.6;
}
.cwl-acct__hero-email {
    opacity: 0.85;
}

/* ---- BODY GRID (sidebar + main) ---- */
.cwl-acct__body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--et-space-5);
    /* v1.5.25 — see hero-inner note. Shell fills its container instead
     * of enforcing a 1280px cap that fought with Elementor full-width
     * containers. */
    max-width: 100%;
    padding: var(--et-space-6) var(--et-space-4);
    align-items: start;
    /* v1.5.41 — position: relative anchors the mobile top-down sheet
     * (.cwl-acct__sidebar) and its backdrop, so they slide from the
     * top of .cwl-acct__body — not the viewport top. Theme header
     * stays visible above the shell. */
    position: relative;
}

/* ---- SIDEBAR ---- */
.cwl-acct__sidebar {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-3);
    box-shadow: var(--et-shadow-xs);
    position: sticky;
    top: var(--et-space-5);
}
.cwl-acct__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cwl-acct__nav-item {
    display: flex;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) var(--et-space-4);
    border-radius: var(--et-radius);
    color: var(--et-ink-soft);
    text-decoration: none;
    font-size: var(--et-fs-body);
    font-weight: 500;
    line-height: 1.2;
    transition: background var(--et-motion-fast), color var(--et-motion-fast);
}
.cwl-acct__nav-item:hover,
.cwl-acct__nav-item:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 8%, transparent);
    color: var(--cits-wpel-primary-color);
    outline: none;
}
.cwl-acct__nav-item--active {
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
}
.cwl-acct__nav-item--active:hover,
.cwl-acct__nav-item--active:focus-visible {
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    filter: brightness(0.95);
}
.cwl-acct__nav-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.cwl-acct__nav-icon svg {
    width: 100%;
    height: 100%;
}
.cwl-acct__nav-label {
    flex: 1;
    min-width: 0;
}
.cwl-acct__nav-chevron {
    display: inline-flex;
    width: 14px;
    height: 14px;
    opacity: 0.7;
}
.cwl-acct__nav-chevron svg {
    width: 100%;
    height: 100%;
}

/* ---- MOBILE NAV: full-width "My Account · {section}" bar ----
 * v1.5.43 — replaces the hero-corner hamburger. The bar is a proper
 * labeled section-switcher that reads distinctly from theme hamburger
 * navigation (which lives in the theme header). Hidden on desktop
 * (sidebar is always visible there); shown on mobile as the trigger
 * for the top-down sheet. The chevron rotates 180° when the sheet
 * is open to signal state. */
.cwl-acct__mobile-nav-bar {
    display: none; /* shown by mobile @container query */
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    width: 100%;
    padding: 12px 16px;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    color: var(--et-ink);
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
    box-shadow: var(--et-shadow-xs);
}
.cwl-acct__mobile-nav-bar:hover,
.cwl-acct__mobile-nav-bar:focus-visible {
    border-color: var(--cits-wpel-primary-color);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color) 15%, transparent);
}
.cwl-acct__mobile-nav-bar-label {
    flex: 1;
    min-width: 0;
    color: var(--et-ink);
    font-weight: 600;
    /* v1.5.45 — label simplified to just "My Account" (the section name
     * is now shown by the page-header title below, so the bar doesn't
     * need to duplicate it). Nowrap defends against any translation
     * that produces a longer label. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwl-acct__mobile-nav-bar-chevron {
    display: inline-flex;
    align-items: center;
    color: var(--et-ink-muted);
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}
.cwl-acct__mobile-nav-bar-chevron svg { display: block; }
.cwl-acct[data-cwl-nav-open] .cwl-acct__mobile-nav-bar-chevron {
    transform: rotate(180deg);
}
.cwl-acct[data-cwl-nav-open] .cwl-acct__mobile-nav-bar {
    border-color: var(--cits-wpel-primary-color);
}

.cwl-acct__nav-backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--et-ink) 45%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 9;
}
.cwl-acct[data-cwl-nav-open] .cwl-acct__nav-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* ---- MAIN COLUMN ---- */
.cwl-acct__main {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-5);
    min-width: 0;
}

/* ---- STAT GRID (5 tiles, tinted icon on left + label/value stack) ---- */
.cwl-acct__stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--et-space-4);
}
.cwl-acct__stat {
    display: flex;
    align-items: center;
    gap: var(--et-space-4);
    padding: var(--et-space-4) var(--et-space-5);
    background: var(--et-surface-sunken);
    border: 1px solid transparent;
    border-radius: var(--et-radius-lg);
}
.cwl-acct__stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cwl-acct__stat-icon svg {
    width: 22px;
    height: 22px;
}
.cwl-acct__stat-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cwl-acct__stat-label {
    font-size: var(--et-fs-body);
    color: var(--et-ink-muted);
    line-height: 1.3;
}
.cwl-acct__stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--et-ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* Tinted stat variants — icon bg uses theme tokens with color-mix()
 * so the accent inherits from the operator's palette. Icon stroke
 * color matches the same source token at full opacity. */
.cwl-acct__stat--blue   .cwl-acct__stat-icon { background: color-mix(in srgb, var(--cits-wpel-primary-color) 12%, transparent); color: var(--cits-wpel-primary-color); }
.cwl-acct__stat--purple .cwl-acct__stat-icon { background: color-mix(in srgb, var(--cits-wpel-accent-color)  15%, transparent); color: var(--cits-wpel-accent-color); }
.cwl-acct__stat--indigo .cwl-acct__stat-icon { background: color-mix(in srgb, var(--cits-wpel-primary-color) 18%, transparent); color: var(--cits-wpel-primary-color); }
.cwl-acct__stat--green  .cwl-acct__stat-icon { background: color-mix(in srgb, var(--cits-wpel-success-color) 15%, transparent); color: var(--cits-wpel-success-color); }
.cwl-acct__stat--red    .cwl-acct__stat-icon { background: color-mix(in srgb, var(--cits-wpel-danger-color)  15%, transparent); color: var(--cits-wpel-danger-color); }

/* ---- FILTER TABS ---- */
.cwl-acct__tabs {
    display: flex;
    gap: var(--et-space-5);
    border-bottom: 1px solid var(--et-border);
    padding-inline: var(--et-space-2);
    overflow-x: auto;
    /* v1.5.15 — hide the browser scrollbar entirely. Horizontal scroll
     * still works via wheel + touch swipe; visual scrollbar was rendering
     * even when no overflow existed and looked like a stray UI mark. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cwl-acct__tabs::-webkit-scrollbar {
    display: none;
}
.cwl-acct__tab {
    display: inline-flex;
    align-items: center;
    padding: var(--et-space-3) 0;
    color: var(--et-ink-muted);
    text-decoration: none;
    font-size: var(--et-fs-body);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color var(--et-motion-fast), border-color var(--et-motion-fast);
}
.cwl-acct__tab:hover,
.cwl-acct__tab:focus-visible {
    color: var(--et-ink);
    outline: none;
}
.cwl-acct__tab--active {
    color: var(--cits-wpel-primary-color);
    border-bottom-color: var(--cits-wpel-primary-color);
    font-weight: 600;
}
.cwl-acct__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    margin-left: 6px;
    background: color-mix(in srgb, var(--et-ink-muted) 12%, transparent);
    color: var(--et-ink-muted);
    border-radius: var(--et-radius-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.cwl-acct__tab--active .cwl-acct__tab-count {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 15%, transparent);
    color: var(--cits-wpel-primary-color);
}
.cwl-acct__user-action--secondary {
    color: var(--et-ink-muted);
    margin-left: var(--et-space-3);
}
.cwl-acct__empty-hint {
    margin: 0 0 var(--et-space-4);
    color: var(--et-ink-muted);
    font-size: 13px;
}

/* ---- COURSES TABLE ---- */
.cwl-acct__table-wrap {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    overflow: hidden;
    box-shadow: var(--et-shadow-xs);
}
.cwl-acct__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--et-fs-body);
}
.cwl-acct__th {
    background: var(--et-surface-sunken);
    color: var(--et-ink-muted);
    font-weight: 600;
    text-align: left;
    padding: var(--et-space-4) var(--et-space-5);
    border-bottom: 1px solid var(--et-border);
    font-size: 13px;
}
.cwl-acct__th--name {
    padding-left: var(--et-space-6);
}
.cwl-acct__td {
    padding: var(--et-space-4) var(--et-space-5);
    border-bottom: 1px solid var(--et-border-soft, var(--et-border));
    color: var(--et-ink);
    vertical-align: middle;
}
.cwl-acct__tr:last-child .cwl-acct__td {
    border-bottom: 0;
}
/* v1.5.81 — "View" link on the orders table row action column. */
.cwl-acct__row-action {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    border: 1px solid var(--cits-wpel-primary-color);
    border-radius: var(--et-radius-sm, 6px);
    transition: background var(--et-motion-fast, 120ms ease);
}
.cwl-acct__row-action:hover,
.cwl-acct__row-action:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    outline: none;
}
.cwl-acct__row-action-none {
    color: var(--et-ink-muted);
    font-size: 0.85rem;
}
.cwl-acct__td--name {
    padding-left: var(--et-space-6);
}
.cwl-acct__course {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-4);
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    font-weight: 500;
}
.cwl-acct__course:hover,
.cwl-acct__course:focus-visible {
    text-decoration: underline;
    outline: none;
}
.cwl-acct__course-thumb {
    width: 64px;
    height: 44px;
    border-radius: var(--et-radius-sm);
    background-color: var(--et-surface-sunken);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cits-wpel-primary-color);
    font-weight: 700;
    font-size: 16px;
}
.cwl-acct__course-thumb--letter {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
}
.cwl-acct__course-title {
    color: var(--et-ink);
    font-weight: 500;
}
.cwl-acct__result {
    font-variant-numeric: tabular-nums;
}

/* ---- USERS SECTION (v1.5.5, admin-only) ---- */
.cwl-acct__users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-4);
    flex-wrap: wrap;
}
.cwl-acct__section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--et-ink);
    letter-spacing: -0.01em;
}
.cwl-acct__users-search {
    display: flex;
    gap: var(--et-space-2);
    min-width: 280px;
    flex: 1 1 320px;
    max-width: 460px;
}
.cwl-acct__users-search input[type="search"] {
    flex: 1;
    padding: var(--et-space-3) var(--et-space-4);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    background: var(--et-surface);
    color: var(--et-ink);
    font-size: var(--et-fs-body);
    min-width: 0;
}
.cwl-acct__users-search input[type="search"]:focus-visible {
    outline: none;
    border-color: var(--cits-wpel-primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color) 20%, transparent);
}
.cwl-acct__users-search-btn {
    padding: var(--et-space-3) var(--et-space-5);
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    border: 0;
    border-radius: var(--et-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--et-fs-body);
}
.cwl-acct__users-search-btn:hover,
.cwl-acct__users-search-btn:focus-visible {
    filter: brightness(0.95);
    outline: none;
}
.cwl-acct__user-cell {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-3);
}
.cwl-acct__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cwl-acct__user-cell-body {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cwl-acct__user-cell-name {
    color: var(--et-ink);
    font-weight: 500;
}
.cwl-acct__user-cell-login {
    color: var(--et-ink-muted);
    font-size: 12px;
}
.cwl-acct__role-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 12%, transparent);
    color: var(--cits-wpel-primary-color);
    border-radius: var(--et-radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.6;
    margin-right: 4px;
    margin-bottom: 2px;
}
.cwl-acct__role-chip--muted {
    background: color-mix(in srgb, var(--et-ink-muted) 10%, transparent);
    color: var(--et-ink-muted);
}
.cwl-acct__role-chip--success {
    background: color-mix(in srgb, var(--cits-wpel-success-color) 15%, transparent);
    color: var(--cits-wpel-success-color);
}

/* ---- LEADERBOARD SECTION (v1.5.11) ---- */
.cwl-acct__lb-viewer {
    display: flex;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) var(--et-space-4);
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color) 20%, transparent);
    border-radius: var(--et-radius);
    color: var(--et-ink);
}
.cwl-acct__lb-viewer--hint {
    background: color-mix(in srgb, var(--et-ink-muted) 8%, transparent);
    border-color: var(--et-border);
}
.cwl-acct__lb-viewer-badge {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.cwl-acct__lb-viewer-text {
    margin: 0;
    font-weight: 500;
}
.cwl-acct__th--rank,
.cwl-acct__td--rank {
    width: 90px;
}
.cwl-acct__rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 28px;
    padding: 0 10px;
    background: color-mix(in srgb, var(--et-ink-muted) 10%, transparent);
    color: var(--et-ink);
    border-radius: var(--et-radius-pill);
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.cwl-acct__rank-badge--gold {
    background: color-mix(in srgb, #f5b301 25%, transparent);
    color: #8a6600;
}
.cwl-acct__rank-badge--silver {
    background: color-mix(in srgb, #b8bcc4 30%, transparent);
    color: #4c525e;
}
.cwl-acct__rank-badge--bronze {
    background: color-mix(in srgb, #cd7f32 25%, transparent);
    color: #7a4c1e;
}
.cwl-acct__tr--viewer {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 6%, transparent);
}
.cwl-acct__tr--viewer .cwl-acct__td {
    font-weight: 600;
}

/* ---- NOTICES (v1.5.12) ---- */
.cwl-acct__notice {
    padding: var(--et-space-3) var(--et-space-4);
    border-radius: var(--et-radius);
    font-weight: 500;
    margin-bottom: var(--et-space-2);
}
.cwl-acct__notice--success {
    background: color-mix(in srgb, var(--cits-wpel-success-color) 12%, transparent);
    color: var(--cits-wpel-success-color);
    border: 1px solid color-mix(in srgb, var(--cits-wpel-success-color) 30%, transparent);
}
.cwl-acct__notice--error {
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 12%, transparent);
    color: var(--cits-wpel-danger-color);
    border: 1px solid color-mix(in srgb, var(--cits-wpel-danger-color) 30%, transparent);
}

/* ---- SETTINGS FORM ---- */
.cwl-acct__form {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-5);
}
.cwl-acct__form-group {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-5) var(--et-space-5) var(--et-space-4);
    margin: 0;
}
.cwl-acct__form-legend {
    padding: 0 var(--et-space-2);
    font-size: var(--et-fs-body-lg);
    font-weight: 700;
    color: var(--et-ink);
}
.cwl-acct__form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--et-space-4);
}
.cwl-acct__form-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--et-space-4);
    margin-top: 0;
}
@container (max-width: 640px) {
    .cwl-acct__form-two-col {
        grid-template-columns: 1fr;
    }
}
.cwl-acct__form-label {
    font-weight: 600;
    color: var(--et-ink);
    font-size: var(--et-fs-body);
}
.cwl-acct__form-input {
    padding: var(--et-space-3) var(--et-space-4);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    background: var(--et-surface);
    color: var(--et-ink);
    font-size: var(--et-fs-body);
    width: 100%;
    box-sizing: border-box;
}
.cwl-acct__form-input:focus-visible {
    outline: none;
    border-color: var(--cits-wpel-primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color) 20%, transparent);
}
.cwl-acct__form-static {
    padding: var(--et-space-2) 0;
    color: var(--et-ink-muted);
    font-family: monospace;
    font-size: 14px;
}
.cwl-acct__form-hint {
    color: var(--et-ink-muted);
    font-size: 13px;
}
.cwl-acct__form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--et-space-3);
}
.cwl-acct__form-submit {
    padding: var(--et-space-3) var(--et-space-6);
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    border: 0;
    border-radius: var(--et-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--et-fs-body);
}
.cwl-acct__form-submit:hover,
.cwl-acct__form-submit:focus-visible {
    filter: brightness(0.95);
    outline: none;
}

/* ---- TEACHING PORTAL LAUNCHER (v1.5.18 — visual polish) ----
 * Fixes the "haphazard" feel of v1.5.17: uniform auto-fill grid so
 * cards align across sections regardless of count, tighter group
 * spacing, richer per-card treatment (larger tinted icon square,
 * hover elevation, arrow reveal), consistent card height. */
.cwl-acct__lead {
    margin: 0 0 var(--et-space-3);
    color: var(--et-ink-muted);
    font-size: var(--et-fs-body);
    max-width: 60ch;
}
.cwl-acct__launcher-group {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-3);
    /* Tighter vertical rhythm than the default main-column gap so
     * groups feel cohesive, not disconnected. */
    margin-top: var(--et-space-2);
}
.cwl-acct__launcher-group:first-of-type {
    margin-top: 0;
}
.cwl-acct__launcher-group-label {
    margin: 0;
    padding-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--et-ink-muted);
    border-bottom: 1px solid var(--et-border);
}
.cwl-acct__launcher-grid {
    display: grid;
    /* auto-fill keeps track sizes consistent across sections so a
     * 1-card section has the same card width as a 3-card section —
     * no more ragged widths. */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--et-space-3);
}
.cwl-acct__launcher-card {
    display: flex;
    align-items: center;
    gap: var(--et-space-4);
    padding: var(--et-space-4);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    color: var(--et-ink);
    text-decoration: none;
    min-height: 92px;
    box-shadow: var(--et-shadow-xs);
    transition: border-color var(--et-motion-fast), transform var(--et-motion-fast), box-shadow var(--et-motion-fast);
    position: relative;
}
.cwl-acct__launcher-card:hover,
.cwl-acct__launcher-card:focus-visible {
    border-color: color-mix(in srgb, var(--cits-wpel-primary-color) 60%, var(--et-border));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    outline: none;
}
.cwl-acct__launcher-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 12%, transparent);
    color: var(--cits-wpel-primary-color);
    /* Squircle-style rounded square feels more app-launcher-like than
     * a circle and pairs better with the card's rounded corners. */
    border-radius: 12px;
    transition: background var(--et-motion-fast);
}
.cwl-acct__launcher-card:hover .cwl-acct__launcher-icon,
.cwl-acct__launcher-card:focus-visible .cwl-acct__launcher-icon {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 20%, transparent);
}
.cwl-acct__launcher-icon svg { width: 22px; height: 22px; }
.cwl-acct__launcher-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.cwl-acct__launcher-title {
    font-weight: 600;
    color: var(--et-ink);
    line-height: 1.25;
    font-size: 15px;
}
.cwl-acct__launcher-desc {
    color: var(--et-ink-muted);
    font-size: 13px;
    line-height: 1.4;
}
.cwl-acct__launcher-arrow {
    color: var(--et-ink-muted);
    font-size: 18px;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--et-motion-fast), transform var(--et-motion-fast), color var(--et-motion-fast);
}
.cwl-acct__launcher-card:hover .cwl-acct__launcher-arrow,
.cwl-acct__launcher-card:focus-visible .cwl-acct__launcher-arrow {
    color: var(--cits-wpel-primary-color);
    opacity: 1;
    transform: translateX(0);
}
/* External-view cards get a subtle indicator so the operator knows
 * they'll jump out of the shell (matches WP admin convention). */
.cwl-acct__launcher-card--external::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: color-mix(in srgb, var(--et-ink-muted) 60%, transparent);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>") center/contain no-repeat;
}

/* Breadcrumb-style back link inside section-title. */
.cwl-acct__crumb-back {
    color: var(--et-ink-muted);
    text-decoration: none;
    font-weight: 500;
}
.cwl-acct__crumb-back:hover,
.cwl-acct__crumb-back:focus-visible {
    color: var(--cits-wpel-primary-color);
    outline: none;
    text-decoration: underline;
}
.cwl-acct__crumb-sep {
    color: var(--et-ink-muted);
    margin-inline: 8px;
}

/* Embedded shortcode container — scoped reset so sub-shortcode markup
 * doesn't collide with shell rules. Kept minimal — sub-shortcodes bring
 * their own styling. */
.cwl-acct__embedded-shortcode {
    display: block;
}

/* ---- COURSE-FORM WIZARD MODE (v1.5.23) ----
 * Opt-in via `data-cits-wpel-wizard` attribute on the form. The wizard
 * JS module toggles `.cwb-wizard-hidden` on non-active sections; this
 * rule collapses them so only one section is visible at a time. Also
 * styles the Prev / Next nav injected into each section footer. */
form.cwb-wizard-mode .et-form-section.cwb-wizard-hidden {
    display: none !important;
}
/* v1.5.24 — wizard mode collapses the 2-col builder grid to a single
 * column and hides the outline rail. The rail duplicates the top tab
 * nav + curriculum tree (which the Curriculum section already renders
 * inline), so keeping both wastes ~320px of horizontal real estate. */
.cits-wpel-builder-layout.cwb-wizard-layout {
    grid-template-columns: minmax(0, 1fr) !important;
}
.cits-wpel-builder-layout.cwb-wizard-layout .cits-wpel-builder-rail {
    display: none !important;
}
.cwb-wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    margin-top: var(--et-space-5);
    padding-top: var(--et-space-4);
    border-top: 1px solid var(--et-border);
}
.cwb-wizard-nav-spacer { display: inline-block; }
.cwb-wizard-prev,
.cwb-wizard-next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--et-space-3) var(--et-space-5);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    background: var(--et-surface);
    color: var(--et-ink);
    font-weight: 600;
    font-size: var(--et-fs-body);
    cursor: pointer;
    transition: border-color var(--et-motion-fast), background var(--et-motion-fast);
}
.cwb-wizard-prev:hover,
.cwb-wizard-prev:focus-visible {
    border-color: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-primary-color);
    outline: none;
}
.cwb-wizard-next {
    margin-left: auto;
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    border-color: var(--cits-wpel-primary-color);
}
.cwb-wizard-next:hover,
.cwb-wizard-next:focus-visible {
    filter: brightness(0.95);
    outline: none;
}

/* ---- AVATAR EDITOR (v1.5.16) ---- */
.cwl-acct__avatar-editor {
    display: flex;
    align-items: flex-start;
    gap: var(--et-space-5);
    margin-top: var(--et-space-4);
}
.cwl-acct__avatar-preview-wrap {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: color-mix(in srgb, var(--et-ink-muted) 10%, transparent);
    border: 2px solid var(--et-border);
}
.cwl-acct__avatar-preview-wrap img,
.cwl-acct__avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cwl-acct__avatar-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.cwl-acct__form-input--file {
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
}
.cwl-acct__form-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--et-space-2);
    color: var(--et-ink-muted);
    font-size: 13px;
    cursor: pointer;
}
@container (max-width: 640px) {
    .cwl-acct__avatar-editor {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
/* v1.5.87 — Action-column buttons on My Courses / My Exams tables.
 * Rendered as proper primary-colour buttons (not naked text links);
 * consistent visual weight with the primary CTAs elsewhere in the
 * plugin (course landing "Enrol now", checkout "Place order", etc.). */
.cwl-acct__user-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--cits-wpel-primary-color);
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.2;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 120ms ease, box-shadow 120ms ease, transform 60ms ease;
    white-space: nowrap;
    cursor: pointer;
}
.cwl-acct__user-action:hover {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 88%, #000);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.cwl-acct__user-action:focus-visible {
    outline: 2px solid var(--cits-wpel-primary-color);
    outline-offset: 2px;
    text-decoration: none;
    color: #ffffff;
}
.cwl-acct__user-action:active {
    transform: translateY(1px);
}
/* Disabled / access-ended state — subdued grey pill, no interaction. */
.cwl-acct__user-action--muted {
    background: transparent;
    color: var(--et-ink-muted);
    border: 1px solid color-mix(in srgb, var(--et-ink-muted, #6b7280) 30%, transparent);
    cursor: default;
    box-shadow: none;
}
.cwl-acct__user-action--muted:hover,
.cwl-acct__user-action--muted:focus-visible {
    background: transparent;
    color: var(--et-ink-muted);
    box-shadow: none;
}
.cwl-acct__pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-4);
    padding-block: var(--et-space-2);
}
.cwl-acct__page-btn {
    display: inline-flex;
    align-items: center;
    padding: var(--et-space-2) var(--et-space-4);
    background: var(--et-surface);
    color: var(--et-ink);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--et-fs-body);
}
.cwl-acct__page-btn:hover,
.cwl-acct__page-btn:focus-visible {
    border-color: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-primary-color);
    outline: none;
}
.cwl-acct__page-btn--disabled {
    color: var(--et-ink-muted);
    background: transparent;
    cursor: default;
    pointer-events: none;
}
.cwl-acct__page-of {
    color: var(--et-ink-muted);
    font-size: var(--et-fs-body);
}

/* ---- EMPTY TABLE ---- */
.cwl-acct__empty {
    background: var(--et-surface);
    border: 1px dashed var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-8) var(--et-space-6);
    text-align: center;
}
.cwl-acct__empty-msg {
    margin: 0 0 var(--et-space-4);
    color: var(--et-ink-muted);
}
.cwl-acct__empty-cta {
    display: inline-flex;
    align-items: center;
    padding: var(--et-space-3) var(--et-space-6);
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    text-decoration: none;
    border-radius: var(--et-radius);
    font-weight: 500;
}
.cwl-acct__empty-cta:hover,
.cwl-acct__empty-cta:focus-visible {
    filter: brightness(0.95);
    outline: none;
}
.cwl-acct__empty-actions {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--et-space-3);
    justify-content: center;
}
.cwl-acct__empty-cta--secondary {
    background: transparent;
    color: var(--cits-wpel-primary-color);
    border: 1px solid var(--cits-wpel-primary-color);
}
.cwl-acct__empty-cta--secondary:hover,
.cwl-acct__empty-cta--secondary:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    filter: none;
}

/* ═════════════════════════════════════════════════════════════════════
 * MEMBERSHIPS SECTION (v1.5.78)
 * Personal-inventory view of the viewer's plan grants. Active cards
 * on top, past (expired/cancelled) below with a muted treatment.
 * Grid folds to single column at narrow container widths.
 * ═════════════════════════════════════════════════════════════════════ */
.cwl-acct__memberships-group {
    margin-top: var(--et-space-5);
}
.cwl-acct__memberships-group:first-of-type {
    margin-top: var(--et-space-3);
}
.cwl-acct__memberships-group-title {
    font-size: var(--et-fs-h5, 1.05rem);
    font-weight: 600;
    color: var(--et-ink, #0f172a);
    margin: 0 0 var(--et-space-3);
}
.cwl-acct__memberships-group--past .cwl-acct__memberships-group-title {
    color: var(--et-ink-muted, #64748b);
}
.cwl-acct__memberships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--et-space-4);
}
.cwl-acct__membership-card {
    background: var(--et-surface, #ffffff);
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    border-left: 4px solid var(--cits-wpel-primary-color, #2563eb);
    border-radius: var(--et-radius);
    padding: var(--et-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--et-space-3);
}
.cwl-acct__membership-card--expired,
.cwl-acct__membership-card--cancelled {
    border-left-color: var(--et-ink-muted, #94a3b8);
    opacity: 0.85;
}
.cwl-acct__membership-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--et-space-3);
}
.cwl-acct__membership-card-title {
    font-size: var(--et-fs-h6, 1rem);
    font-weight: 600;
    color: var(--et-ink, #0f172a);
    margin: 0;
    line-height: 1.3;
}
.cwl-acct__membership-card-desc {
    font-size: 0.875rem;
    color: var(--et-ink-muted, #64748b);
    margin: 0;
    line-height: 1.45;
}
.cwl-acct__memberships-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.cwl-acct__memberships-chip--active {
    background: color-mix(in srgb, var(--cits-wpel-success-color) 14%, transparent);
    color: var(--cits-wpel-success-color);
}
.cwl-acct__memberships-chip--expired {
    background: color-mix(in srgb, var(--cits-wpel-neutral-color) 14%, transparent);
    color: var(--cits-wpel-neutral-color);
}
.cwl-acct__memberships-chip--cancelled {
    background: color-mix(in srgb, var(--cits-wpel-danger-color) 14%, transparent);
    color: var(--cits-wpel-danger-color);
}
.cwl-acct__membership-card-meta {
    margin: 0;
    display: grid;
    gap: var(--et-space-1);
}
.cwl-acct__membership-card-meta-row {
    display: flex;
    justify-content: space-between;
    gap: var(--et-space-2);
    font-size: 0.85rem;
    align-items: baseline;
}
.cwl-acct__membership-card-meta-row dt {
    color: var(--et-ink-muted, #64748b);
    margin: 0;
}
.cwl-acct__membership-card-meta-row dd {
    margin: 0;
    color: var(--et-ink, #0f172a);
    font-weight: 500;
    text-align: right;
}
.cwl-acct__membership-card-meta-row--muted {
    padding-top: var(--et-space-2);
    border-top: 1px dashed var(--et-border, rgba(15, 23, 42, 0.08));
    margin-top: var(--et-space-1);
}
.cwl-acct__membership-card-meta-row--muted dd {
    color: var(--et-ink-muted, #64748b);
    font-weight: 400;
    font-size: 0.8rem;
}

/* ═════════════════════════════════════════════════════════════════════
 * ADMIN DASHBOARD (v1.5.30 — enterprise polish)
 * All accents inherit from --cits-wpel-primary-color (theme-aware).
 * Responsive via @container queries + viewport @media fallback.
 * ═════════════════════════════════════════════════════════════════════ */

/* Section header row: title left, quick actions right. */
.cwl-acct__admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--et-space-4);
    margin-bottom: var(--et-space-5);
}
.cwl-acct__admin-head-titles {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-1);
}
.cwl-acct__admin-head-sub {
    margin: 0;
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--et-ink) 55%, transparent);
}

/* Quick actions — pill buttons with plus icon. */
.cwl-acct__quickbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--et-space-2);
}
.cwl-acct__quickbtn {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-1);
    padding: 6px 12px;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color) 30%, var(--et-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 6%, transparent);
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
    transition: background 120ms ease, border-color 120ms ease;
}
.cwl-acct__quickbtn:hover,
.cwl-acct__quickbtn:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 15%, transparent);
    border-color: color-mix(in srgb, var(--cits-wpel-primary-color) 55%, var(--et-border));
    outline: none;
}
.cwl-acct__quickbtn svg { flex-shrink: 0; }

/* ── KPI HERO GRID ── */
.cwl-acct__kpi-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--et-space-4);
    margin-bottom: var(--et-space-6);
}
@container (min-width: 640px) {
    .cwl-acct__kpi-hero { grid-template-columns: 1fr 1fr; }
}
@container (min-width: 1100px) {
    .cwl-acct__kpi-hero { grid-template-columns: repeat(4, 1fr); }
}
/* Viewport @media fallback for older browsers without container queries. */
@media (min-width: 640px)  { .cwl-acct__kpi-hero { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .cwl-acct__kpi-hero { grid-template-columns: repeat(4, 1fr); } }

.cwl-acct__kpi-card {
    position: relative;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-4) var(--et-space-5) var(--et-space-3);
    color: var(--cits-wpel-primary-color); /* Drives currentColor for sparkline. */
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}
.cwl-acct__kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-2);
    margin-bottom: var(--et-space-2);
}
.cwl-acct__kpi-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--et-ink) 65%, transparent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cwl-acct__kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--et-ink);
    letter-spacing: -0.01em;
    word-break: break-word;
}
@container (min-width: 900px) {
    .cwl-acct__kpi-value { font-size: 2rem; }
}
.cwl-acct__kpi-sublabel {
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--et-ink) 50%, transparent);
    margin-top: 2px;
}
.cwl-acct__kpi-spark {
    margin-top: auto;
    padding-top: var(--et-space-3);
    line-height: 0;
}
.cwl-acct__spark-svg {
    width: 100%;
    height: 40px;
    display: block;
}

/* Delta badge — green up / red down. Colours derive from success/danger
 * design tokens which the operator can override in the Customizer. */
.cwl-acct__delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}
.cwl-acct__delta--up {
    background: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 12%, transparent);
    color: var(--cits-wpel-success-color, #16a34a);
}
.cwl-acct__delta--down {
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 12%, transparent);
    color: var(--cits-wpel-danger-color, #dc2626);
}

/* ── ROLE COMPOSITION STACKED BAR ── */
.cwl-acct__composition {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-5);
    margin-bottom: var(--et-space-6);
}
.cwl-acct__composition-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--et-space-3);
    margin-bottom: var(--et-space-3);
}
.cwl-acct__composition-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.cwl-acct__composition-total {
    font-size: 0.8125rem;
    color: color-mix(in srgb, var(--et-ink) 55%, transparent);
}
.cwl-acct__composition-bar {
    display: flex;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--et-ink) 6%, transparent);
    margin-bottom: var(--et-space-4);
}
.cwl-acct__composition-seg {
    display: block;
    height: 100%;
    transition: filter 120ms ease;
}
.cwl-acct__composition-seg:hover { filter: brightness(1.08); }
/* Colour ramp — pure tints of the theme primary so the whole chart
 * inherits the operator's brand. Admin darkest, guest lightest. */
.cwl-acct__composition-seg--admin,
.cwl-acct__composition-dot--admin   { background: var(--cits-wpel-primary-color); }
.cwl-acct__composition-seg--staff,
.cwl-acct__composition-dot--staff   { background: color-mix(in srgb, var(--cits-wpel-primary-color) 70%, #ffffff); }
.cwl-acct__composition-seg--learner,
.cwl-acct__composition-dot--learner { background: color-mix(in srgb, var(--cits-wpel-primary-color) 42%, #ffffff); }
.cwl-acct__composition-seg--guest,
.cwl-acct__composition-dot--guest   { background: color-mix(in srgb, var(--cits-wpel-primary-color) 18%, #ffffff); }

.cwl-acct__composition-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--et-space-2);
}
@container (min-width: 500px) {
    .cwl-acct__composition-legend { grid-template-columns: repeat(2, 1fr); }
}
@container (min-width: 800px) {
    .cwl-acct__composition-legend { grid-template-columns: repeat(4, 1fr); }
}
.cwl-acct__composition-legend-item {
    display: flex;
    align-items: center;
    gap: var(--et-space-2);
    font-size: 0.85rem;
}
.cwl-acct__composition-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cwl-acct__composition-legend-label { flex: 1; color: color-mix(in srgb, var(--et-ink) 75%, transparent); }
.cwl-acct__composition-legend-value { font-weight: 600; color: var(--et-ink); }
.cwl-acct__composition-legend-pct {
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--et-ink) 50%, transparent);
}

/* ── ADMIN TABS (v1.5.32) ── */
/* Single-column tabbed layout. Tabstrip at the top; only one panel
 * visible at a time (WAI-ARIA tabs pattern). Wraps the 4 admin
 * cards (Activity / Needs / Top courses / Content overview). */
.cwl-acct__admin-tabs {
    margin-top: var(--et-space-4);
}
.cwl-acct__admin-tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid var(--et-border);
    margin-bottom: var(--et-space-4);
    overflow-x: auto;
    scrollbar-width: none;
}
.cwl-acct__admin-tablist::-webkit-scrollbar { display: none; }
.cwl-acct__admin-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-2);
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: color-mix(in srgb, var(--et-ink) 60%, transparent);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
    position: relative;
    top: 1px; /* overlaps the tablist border so active tab bottom-border merges */
}
.cwl-acct__admin-tab:hover,
.cwl-acct__admin-tab:focus-visible {
    color: var(--cits-wpel-primary-color);
    outline: none;
}
.cwl-acct__admin-tab:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 8%, transparent);
    border-radius: var(--et-radius) var(--et-radius) 0 0;
}
.cwl-acct__admin-tab.is-active,
.cwl-acct__admin-tab[aria-selected="true"] {
    color: var(--cits-wpel-primary-color);
    border-bottom-color: var(--cits-wpel-primary-color);
    font-weight: 600;
}
.cwl-acct__admin-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 15%, transparent);
    color: var(--cits-wpel-danger-color, #dc2626);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.cwl-acct__admin-tabpanel {
    /* Panels are hidden via the `hidden` attribute + class toggle. No
     * transition — instant swap for perceived responsiveness. */
}
.cwl-acct__admin-tabpanel[hidden] { display: none; }
.cwl-acct__admin-card {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-5);
}
.cwl-acct__admin-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--et-space-3);
    margin-bottom: var(--et-space-3);
    padding-bottom: var(--et-space-3);
    border-bottom: 1px solid var(--et-border);
}
.cwl-acct__admin-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.cwl-acct__admin-card-sublinks {
    font-size: 0.8125rem;
    color: color-mix(in srgb, var(--et-ink) 55%, transparent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cwl-acct__admin-card-link {
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
}
.cwl-acct__admin-card-link:hover,
.cwl-acct__admin-card-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* ── ACTIVITY TIMELINE ── */
.cwl-acct__activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cwl-acct__activity-item {
    display: flex;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) 0;
    border-bottom: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}
.cwl-acct__activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.cwl-acct__activity-item:first-child { padding-top: 0; }
.cwl-acct__activity-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    color: var(--cits-wpel-primary-color);
    flex-shrink: 0;
    overflow: hidden;
}
.cwl-acct__activity-glyph img,
.cwl-acct__activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.cwl-acct__activity-item--order .cwl-acct__activity-glyph {
    background: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 10%, transparent);
    color: var(--cits-wpel-success-color, #16a34a);
}
.cwl-acct__activity-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cwl-acct__activity-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--et-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwl-acct__activity-subtitle {
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--et-ink) 55%, transparent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwl-acct__activity-meta {
    display: flex;
    align-items: center;
    gap: var(--et-space-2);
    flex-shrink: 0;
    font-size: 0.8rem;
}
.cwl-acct__activity-amount {
    font-weight: 600;
    color: var(--et-ink);
}
.cwl-acct__activity-time {
    color: color-mix(in srgb, var(--et-ink) 45%, transparent);
    font-size: 0.75rem;
    white-space: nowrap;
}
.cwl-acct__activity-chip {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: color-mix(in srgb, var(--et-ink) 8%, transparent);
    color: color-mix(in srgb, var(--et-ink) 70%, transparent);
    text-transform: capitalize;
}
.cwl-acct__activity-chip--paid {
    background: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 15%, transparent);
    color: var(--cits-wpel-success-color, #16a34a);
}
.cwl-acct__activity-chip--pending {
    background: color-mix(in srgb, #f59e0b 15%, transparent);
    color: #b45309;
}
.cwl-acct__activity-chip--failed,
.cwl-acct__activity-chip--cancelled,
.cwl-acct__activity-chip--refunded {
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 12%, transparent);
    color: var(--cits-wpel-danger-color, #dc2626);
}
/* Below 480px the meta cluster wraps under the body for readability. */
@container (max-width: 480px) {
    .cwl-acct__activity-item { flex-wrap: wrap; }
    .cwl-acct__activity-meta { width: 100%; padding-left: 44px; }
}

/* ── CONTENT OVERVIEW LIST ── */
.cwl-acct__content-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cwl-acct__content-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) 0;
    border-bottom: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}
.cwl-acct__content-row:last-child { border-bottom: none; padding-bottom: 0; }
.cwl-acct__content-row:first-child { padding-top: 0; }
.cwl-acct__content-label {
    font-size: 0.9rem;
    color: color-mix(in srgb, var(--et-ink) 75%, transparent);
}
.cwl-acct__content-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--et-ink);
    font-variant-numeric: tabular-nums;
}
.cwl-acct__content-link {
    font-size: 0.8rem;
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color) 25%, var(--et-border));
    border-radius: 999px;
    background: transparent;
    transition: background 120ms ease;
}
.cwl-acct__content-link:hover,
.cwl-acct__content-link:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    outline: none;
}
.cwl-acct__content-link--muted {
    color: color-mix(in srgb, var(--et-ink) 35%, transparent);
    border-color: transparent;
    pointer-events: none;
}


/* Top courses / ranked list widget. */
.cwl-acct__top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cwl-acct__top-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) 0;
    border-bottom: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}
.cwl-acct__top-row:last-child { border-bottom: none; padding-bottom: 0; }
.cwl-acct__top-row:first-child { padding-top: 0; }
.cwl-acct__top-rank {
    font-size: 0.75rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--et-ink) 45%, transparent);
    font-variant-numeric: tabular-nums;
    min-width: 24px;
}
.cwl-acct__top-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cwl-acct__top-title {
    font-size: 0.875rem;
    color: var(--et-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwl-acct__top-bar {
    display: block;
    height: 4px;
    background: color-mix(in srgb, var(--et-ink) 6%, transparent);
    border-radius: 999px;
    overflow: hidden;
}
.cwl-acct__top-bar-fill {
    display: block;
    height: 100%;
    background: var(--cits-wpel-primary-color);
    border-radius: 999px;
    transition: width 200ms ease;
}
.cwl-acct__top-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--et-ink);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}

/* Clickable activity title. */
.cwl-acct__activity-title--link {
    text-decoration: none;
    color: var(--et-ink);
    transition: color 120ms ease;
}
.cwl-acct__activity-title--link:hover,
.cwl-acct__activity-title--link:focus-visible {
    color: var(--cits-wpel-primary-color);
    outline: none;
    text-decoration: underline;
}

/* Activity pagination. */
.cwl-acct__pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    padding-top: var(--et-space-3);
    margin-top: var(--et-space-3);
    border-top: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
    font-size: 0.8125rem;
}
.cwl-acct__pager-summary {
    color: color-mix(in srgb, var(--et-ink) 55%, transparent);
}
.cwl-acct__pager-controls {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-2);
}
.cwl-acct__pager-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color) 25%, var(--et-border));
    border-radius: 999px;
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    background: transparent;
    transition: background 120ms ease;
}
.cwl-acct__pager-btn:hover,
.cwl-acct__pager-btn:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    outline: none;
}
.cwl-acct__pager-btn--muted {
    color: color-mix(in srgb, var(--et-ink) 30%, transparent);
    border-color: transparent;
    pointer-events: none;
    background: transparent;
}
.cwl-acct__pager-page {
    color: color-mix(in srgb, var(--et-ink) 60%, transparent);
    padding: 0 var(--et-space-2);
    font-variant-numeric: tabular-nums;
}

/* Pending / needs-attention card. */
.cwl-acct__pending-card--clear {
    background: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 6%, var(--et-surface));
    border-color: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 20%, var(--et-border));
}
.cwl-acct__pending-clear {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--et-space-4) 0;
    color: var(--cits-wpel-success-color, #16a34a);
}
.cwl-acct__pending-clear-msg {
    margin: var(--et-space-2) 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--et-ink);
}
.cwl-acct__pending-clear-hint {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: color-mix(in srgb, var(--et-ink) 55%, transparent);
}
.cwl-acct__pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cwl-acct__pending-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--et-space-3);
    padding: var(--et-space-3) 0;
    border-bottom: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}
.cwl-acct__pending-row:last-child { border-bottom: none; padding-bottom: 0; }
.cwl-acct__pending-row:first-child { padding-top: 0; }
.cwl-acct__pending-label {
    font-size: 0.9rem;
    color: color-mix(in srgb, var(--et-ink) 75%, transparent);
}
.cwl-acct__pending-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--et-ink);
    font-variant-numeric: tabular-nums;
}

/* Flash notices. */
.cwl-acct__flash {
    padding: var(--et-space-3) var(--et-space-4);
    border-radius: var(--et-radius);
    margin-bottom: var(--et-space-4);
    font-size: 0.9rem;
}
.cwl-acct__flash--success {
    background: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 12%, transparent);
    color: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 90%, var(--et-ink));
    border: 1px solid color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 25%, transparent);
}
.cwl-acct__flash--error {
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 12%, transparent);
    color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 90%, var(--et-ink));
    border: 1px solid color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 25%, transparent);
}

/* ─────────────────────────────────────────────
 * Notifications inbox (v1.5.63 — v1.5.64 table view)
 * Table + expandable rows on desktop, reflowed to stacked
 * cards below 720px container width.
 * ───────────────────────────────────────────── */

/* Sidebar unread badge — sits after the label. */
.cwl-acct__nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    margin-left: auto;
    background: var(--cits-wpel-danger-color, #dc2626);
    color: #ffffff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
}
.cwl-acct__nav-item--active .cwl-acct__nav-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Toolbar mark-all-read button — !important defends against theme button
 * globals (Blocksy / Astra / etc. set `button { background: brand }` at
 * high specificity + sometimes with !important themselves). */
.cwl-acct__notif-mark-all-form {
    margin: 0;
}
.cwl-acct button.cwl-acct__notif-mark-all {
    display: inline-flex !important;
    align-items: center !important;
    padding: var(--et-space-2) var(--et-space-3) !important;
    background: transparent !important;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 30%, transparent) !important;
    border-radius: var(--et-radius) !important;
    color: var(--cits-wpel-primary-color, #2563eb) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: background-color 120ms ease !important;
    text-decoration: none !important;
    min-height: 0 !important;
}
.cwl-acct button.cwl-acct__notif-mark-all:hover,
.cwl-acct button.cwl-acct__notif-mark-all:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 8%, transparent) !important;
    color: var(--cits-wpel-primary-color, #2563eb) !important;
    outline: none !important;
}

/* Bulk actions bar — appears between toolbar + table when 1+ rows are
 * selected. Sticks the primary CTAs (Mark read / Archive / Delete) at the
 * top of the visible list so long lists stay actionable. */
.cwl-acct__notif-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    padding: var(--et-space-3) var(--et-space-4);
    margin: var(--et-space-3) 0 0;
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 8%, var(--et-surface, #ffffff));
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 25%, transparent);
    border-radius: var(--et-radius);
    animation: cwl-acct-bulk-slide 160ms ease-out;
}
.cwl-acct__notif-bulk-bar[hidden] {
    display: none !important;
}
@keyframes cwl-acct-bulk-slide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.cwl-acct__notif-bulk-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__notif-bulk-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}
.cwl-acct__notif-bulk-form {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    display: inline-block;
}
.cwl-acct button.cwl-acct__notif-bulk-btn,
.cwl-acct__notif-bulk-btn {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 12px !important;
    background: var(--et-surface, #ffffff) !important;
    background-color: var(--et-surface, #ffffff) !important;
    background-image: none !important;
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.15)) !important;
    border-radius: 6px !important;
    color: var(--et-ink, #0f172a) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    min-height: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease !important;
}
.cwl-acct button.cwl-acct__notif-bulk-btn:hover,
.cwl-acct button.cwl-acct__notif-bulk-btn:focus-visible {
    background: color-mix(in srgb, var(--et-ink, #0f172a) 5%, var(--et-surface, #ffffff)) !important;
    background-color: color-mix(in srgb, var(--et-ink, #0f172a) 5%, var(--et-surface, #ffffff)) !important;
    outline: none !important;
}
.cwl-acct button.cwl-acct__notif-bulk-btn--delete,
.cwl-acct__notif-bulk-btn--delete {
    color: var(--cits-wpel-danger-color, #dc2626) !important;
    border-color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 25%, transparent) !important;
}
.cwl-acct button.cwl-acct__notif-bulk-btn--delete:hover,
.cwl-acct button.cwl-acct__notif-bulk-btn--delete:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 8%, transparent) !important;
    background-color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 8%, transparent) !important;
    color: var(--cits-wpel-danger-color, #dc2626) !important;
    border-color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 45%, transparent) !important;
}
.cwl-acct button.cwl-acct__notif-bulk-btn--clear,
.cwl-acct__notif-bulk-btn--clear {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--et-ink-muted, #64748b) !important;
    border-color: transparent !important;
}
.cwl-acct button.cwl-acct__notif-bulk-btn--clear:hover,
.cwl-acct button.cwl-acct__notif-bulk-btn--clear:focus-visible {
    background: transparent !important;
    color: var(--et-ink, #0f172a) !important;
    text-decoration: underline !important;
}

/* Empty state */
.cwl-acct__notif-empty {
    padding: var(--et-space-6) var(--et-space-4);
    text-align: center;
    background: var(--et-surface, #ffffff);
    border: 1px dashed var(--et-border, rgba(15, 23, 42, 0.15));
    border-radius: var(--et-radius);
    margin-top: var(--et-space-3);
}
.cwl-acct__notif-empty-title {
    margin: 0 0 var(--et-space-2);
    font-size: 1rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__notif-empty-hint {
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--et-ink-muted, #64748b);
    max-width: 480px;
    line-height: 1.5;
}

/* Table wrapper — allows horizontal scroll if operator's brand
 * container is unusually narrow, without breaking the layout. */
.cwl-acct__notif-table-wrap {
    margin-top: var(--et-space-3);
    background: var(--et-surface, #ffffff);
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    border-radius: var(--et-radius);
    overflow: hidden;
}

.cwl-acct__notif-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.9rem;
}

.cwl-acct__notif-thead {
    background: color-mix(in srgb, var(--et-ink, #0f172a) 4%, transparent);
    border-bottom: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
}
.cwl-acct__notif-th {
    text-align: left;
    padding: var(--et-space-3) var(--et-space-4);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--et-ink-muted, #64748b);
    white-space: nowrap;
}
.cwl-acct__notif-th--select {
    width: 44px;
    padding-right: 0;
}
.cwl-acct__notif-th--icon {
    width: 48px;
}
.cwl-acct__notif-th--time,
.cwl-acct__notif-th--actions {
    width: 120px;
}

/* Custom checkbox — theme-agnostic (browser default is inconsistent + often
 * conflicts with theme form styles). */
.cwl-acct__notif-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    width: 20px;
    height: 20px;
    margin: 0;
}
.cwl-acct__notif-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
}
.cwl-acct__notif-checkbox-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--et-surface, #ffffff);
    border: 1.5px solid var(--et-border, rgba(15, 23, 42, 0.25));
    border-radius: 4px;
    transition: background-color 120ms ease, border-color 120ms ease;
    box-sizing: border-box;
}
.cwl-acct__notif-checkbox input:hover + .cwl-acct__notif-checkbox-box,
.cwl-acct__notif-checkbox input:focus-visible + .cwl-acct__notif-checkbox-box {
    border-color: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__notif-checkbox input:checked + .cwl-acct__notif-checkbox-box {
    background: var(--cits-wpel-primary-color, #2563eb);
    border-color: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__notif-checkbox input:checked + .cwl-acct__notif-checkbox-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg) translate(-1px, -1px);
}
.cwl-acct__notif-checkbox input:indeterminate + .cwl-acct__notif-checkbox-box {
    background: var(--cits-wpel-primary-color, #2563eb);
    border-color: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__notif-checkbox input:indeterminate + .cwl-acct__notif-checkbox-box::after {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
}

.cwl-acct__notif-td--select {
    width: 44px;
    padding-right: 0;
    vertical-align: middle;
}

.cwl-acct__notif-row {
    border-bottom: 1px solid var(--et-border, rgba(15, 23, 42, 0.05));
    transition: background-color 100ms ease;
}
.cwl-acct__notif-row:last-child {
    border-bottom: 0;
}
.cwl-acct__notif-row:hover {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 3%, transparent);
}
.cwl-acct__notif-row--unread {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 4%, var(--et-surface, #ffffff));
    box-shadow: inset 3px 0 0 var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__notif-row--unread:hover {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 7%, var(--et-surface, #ffffff));
}
.cwl-acct__notif-td {
    padding: var(--et-space-3) var(--et-space-4);
    vertical-align: top;
    color: var(--et-ink, #0f172a);
}

/* Category icon cell */
.cwl-acct__notif-td--icon {
    width: 48px;
    padding-right: var(--et-space-2);
}
.cwl-acct__notif-cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}
.cwl-acct__notif-cat-badge svg {
    width: 16px;
    height: 16px;
}
.cwl-acct__notif-row--cat-announcement .cwl-acct__notif-cat-badge {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 12%, transparent);
    color: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__notif-row--cat-payment .cwl-acct__notif-cat-badge {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}
.cwl-acct__notif-row--cat-course .cwl-acct__notif-cat-badge {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}
.cwl-acct__notif-row--cat-exam .cwl-acct__notif-cat-badge {
    background: rgba(147, 51, 234, 0.12);
    color: #9333ea;
}
.cwl-acct__notif-row--cat-system .cwl-acct__notif-cat-badge {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

/* Message cell */
.cwl-acct__notif-td--message {
    min-width: 0;
}
.cwl-acct__notif-subject-row {
    display: flex;
    align-items: center;
    gap: var(--et-space-2);
    min-width: 0;
}
.cwl-acct__notif-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cits-wpel-primary-color, #2563eb);
    flex: 0 0 auto;
}
.cwl-acct__notif-subject-btn {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    text-align: left;
    color: var(--et-ink, #0f172a);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.cwl-acct__notif-subject-btn:hover .cwl-acct__notif-subject,
.cwl-acct__notif-subject-btn:focus-visible .cwl-acct__notif-subject {
    color: var(--cits-wpel-primary-color, #2563eb);
    text-decoration: underline;
}
.cwl-acct__notif-subject-btn:focus-visible {
    outline: none;
}
.cwl-acct__notif-subject {
    font-weight: 500;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__notif-row--unread .cwl-acct__notif-subject {
    font-weight: 700;
}
.cwl-acct__notif-meta {
    font-size: 0.8rem;
    color: var(--et-ink-muted, #64748b);
    margin-top: var(--et-space-1);
}

/* Time cell */
.cwl-acct__notif-td--time {
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--et-ink-muted, #64748b);
}

/* Actions cell — 3 icon buttons.
 * v1.5.66 — !important + `.cwl-acct button.class` specificity added to
 * survive theme button globals (Blocksy / Astra / Kadence all set
 * `button { background: brand-color; padding: 12px 24px; ... }` at
 * varying specificity, occasionally with !important). Without these
 * defenses the icon buttons render as huge solid-fill red rectangles. */
.cwl-acct__notif-td--actions {
    white-space: nowrap;
}
.cwl-acct__notif-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-1);
}
.cwl-acct__notif-icon-form {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
    background: transparent !important;
    border: 0 !important;
}
.cwl-acct button.cwl-acct__notif-icon-btn,
.cwl-acct__notif-icon-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    color: var(--et-ink-muted, #64748b) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font-size: 0 !important; /* removes any inherited whitespace glyphs */
    line-height: 1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease !important;
}
.cwl-acct button.cwl-acct__notif-icon-btn svg,
.cwl-acct__notif-icon-btn svg {
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
    fill: none !important;
    flex: 0 0 auto;
}
.cwl-acct button.cwl-acct__notif-icon-btn:hover,
.cwl-acct button.cwl-acct__notif-icon-btn:focus-visible,
.cwl-acct__notif-icon-btn:hover,
.cwl-acct__notif-icon-btn:focus-visible {
    background: color-mix(in srgb, var(--et-ink, #0f172a) 6%, transparent) !important;
    background-color: color-mix(in srgb, var(--et-ink, #0f172a) 6%, transparent) !important;
    color: var(--et-ink, #0f172a) !important;
    outline: none !important;
}
.cwl-acct button.cwl-acct__notif-icon-btn--view:hover,
.cwl-acct button.cwl-acct__notif-icon-btn--view:focus-visible,
.cwl-acct__notif-icon-btn--view:hover,
.cwl-acct__notif-icon-btn--view:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 12%, transparent) !important;
    background-color: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 12%, transparent) !important;
    color: var(--cits-wpel-primary-color, #2563eb) !important;
}
.cwl-acct button.cwl-acct__notif-icon-btn--archive:hover,
.cwl-acct button.cwl-acct__notif-icon-btn--archive:focus-visible,
.cwl-acct button.cwl-acct__notif-icon-btn--restore:hover,
.cwl-acct button.cwl-acct__notif-icon-btn--restore:focus-visible,
.cwl-acct__notif-icon-btn--archive:hover,
.cwl-acct__notif-icon-btn--restore:hover {
    background: rgba(217, 119, 6, 0.12) !important;
    background-color: rgba(217, 119, 6, 0.12) !important;
    color: #b45309 !important;
}
.cwl-acct button.cwl-acct__notif-icon-btn--delete:hover,
.cwl-acct button.cwl-acct__notif-icon-btn--delete:focus-visible,
.cwl-acct__notif-icon-btn--delete:hover,
.cwl-acct__notif-icon-btn--delete:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 12%, transparent) !important;
    background-color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 12%, transparent) !important;
    color: var(--cits-wpel-danger-color, #dc2626) !important;
}

/* Payload templates — inert, not rendered. */
.cwl-acct__notif-payloads {
    display: none !important;
}

/* Modal — native <dialog> */
.cwl-acct__notif-modal {
    max-width: 640px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--et-surface, #ffffff);
    color: var(--et-ink, #0f172a);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}
.cwl-acct__notif-modal::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.cwl-acct__notif-modal:not([open]) {
    display: none;
}
.cwl-acct__notif-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--et-ink-muted, #64748b);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
    z-index: 2;
}
.cwl-acct__notif-modal-close:hover,
.cwl-acct__notif-modal-close:focus-visible {
    background: color-mix(in srgb, var(--et-ink, #0f172a) 6%, transparent);
    color: var(--et-ink, #0f172a);
    outline: none;
}
.cwl-acct__notif-modal-content {
    padding: var(--et-space-5);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-sizing: border-box;
}
.cwl-acct__notif-modal-subject {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--et-ink, #0f172a);
    margin-bottom: var(--et-space-2);
    padding-right: 40px;
    line-height: 1.35;
}
.cwl-acct__notif-modal-meta {
    font-size: 0.85rem;
    color: var(--et-ink-muted, #64748b);
    margin-bottom: 2px;
}
.cwl-acct__notif-modal-time {
    font-size: 0.8rem;
    color: var(--et-ink-muted, #94a3b8);
    margin-bottom: var(--et-space-4);
}
.cwl-acct__notif-modal-body {
    font-size: 0.95rem;
    color: var(--et-ink, #0f172a);
    line-height: 1.6;
}
.cwl-acct__notif-modal-body > *:first-child { margin-top: 0; }
.cwl-acct__notif-modal-body > *:last-child { margin-bottom: 0; }
.cwl-acct__notif-modal-body blockquote {
    margin: var(--et-space-3) 0;
    padding: var(--et-space-2) var(--et-space-3);
    background: color-mix(in srgb, var(--et-ink, #0f172a) 3%, transparent);
    border-left: 3px solid var(--cits-wpel-primary-color, #2563eb);
    border-radius: var(--et-radius);
}
.cwl-acct__notif-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--et-radius);
}
.cwl-acct__notif-modal-body a {
    color: var(--cits-wpel-primary-color, #2563eb);
    text-decoration: underline;
}

/* Pager */
.cwl-acct__notif-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    margin-top: var(--et-space-4);
    padding: var(--et-space-3) 0;
    border-top: 1px solid var(--et-border, rgba(15, 23, 42, 0.06));
}
.cwl-acct__notif-pager-link {
    padding: var(--et-space-2) var(--et-space-3);
    color: var(--cits-wpel-primary-color, #2563eb);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--et-radius);
    transition: background-color 120ms ease;
}
.cwl-acct__notif-pager-link:hover,
.cwl-acct__notif-pager-link:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 8%, transparent);
    outline: none;
}
.cwl-acct__notif-pager-link.is-disabled {
    color: var(--et-ink-muted, #94a3b8);
    pointer-events: none;
    opacity: 0.5;
}
.cwl-acct__notif-pager-info {
    font-size: 0.85rem;
    color: var(--et-ink-muted, #64748b);
}

/* Responsive reflow — below 720px container, table becomes stacked
 * cards. Follows the same data-th pattern used by Certificates + My
 * Students tables. */
@container (max-width: 720px) {
    .cwl-acct__notif-table-wrap {
        border: 0;
        background: transparent;
        overflow: visible;
    }
    .cwl-acct__notif-table,
    .cwl-acct__notif-table tbody,
    .cwl-acct__notif-table tr,
    .cwl-acct__notif-table td {
        display: block;
        width: 100%;
    }
    .cwl-acct__notif-thead {
        display: none;
    }
    .cwl-acct__notif-row {
        position: relative;
        padding: var(--et-space-3) var(--et-space-3) var(--et-space-2);
        margin-bottom: var(--et-space-3);
        background: var(--et-surface, #ffffff);
        border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
        border-radius: var(--et-radius);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }
    .cwl-acct__notif-row--unread {
        border-left: 4px solid var(--cits-wpel-primary-color, #2563eb);
        box-shadow: none;
    }
    .cwl-acct__notif-td {
        padding: 2px 0;
        border: 0;
    }
    /* Checkbox floats top-left corner on mobile. */
    .cwl-acct__notif-table td.cwl-acct__notif-td--select {
        position: absolute;
        top: var(--et-space-3);
        left: var(--et-space-3);
        width: auto;
        padding: 0;
    }
    /* Category icon floats top-right on mobile — small, non-intrusive. */
    .cwl-acct__notif-td--icon {
        position: absolute;
        top: var(--et-space-3);
        right: var(--et-space-3);
        width: auto;
        padding: 0;
    }
    .cwl-acct__notif-cat-badge {
        width: 26px;
        height: 26px;
    }
    .cwl-acct__notif-cat-badge svg {
        width: 13px;
        height: 13px;
    }
    /* Message cell holds subject + meta; leave room for the corner icon
     * on the right AND the checkbox on the left. */
    .cwl-acct__notif-td--message {
        padding: 0 36px 0 32px;
        margin-bottom: var(--et-space-2);
    }
    .cwl-acct__notif-subject-btn {
        white-space: normal;
        line-height: 1.35;
    }
    /* Time renders inline with a data-th label. Specificity bumped to
     * beat the `.cwl-acct__notif-table td { display: block }` above. */
    .cwl-acct__notif-table td.cwl-acct__notif-td--time {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding-top: var(--et-space-2);
        margin-top: var(--et-space-2);
        border-top: 1px solid var(--et-border, rgba(15, 23, 42, 0.05));
    }
    .cwl-acct__notif-td--time::before {
        content: attr(data-th);
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--et-ink-muted, #94a3b8);
    }
    /* Actions row — icons align to the right, data-th label on the left. */
    .cwl-acct__notif-table td.cwl-acct__notif-td--actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: var(--et-space-2);
        padding-top: var(--et-space-2);
    }
    .cwl-acct__notif-td--actions::before {
        content: attr(data-th);
        margin-right: auto;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--et-ink-muted, #94a3b8);
    }
    .cwl-acct__notif-pager {
        flex-wrap: wrap;
        justify-content: center;
    }
    .cwl-acct__notif-pager-info {
        order: 2;
        width: 100%;
        text-align: center;
    }
}

/* Modal — full-width on small viewports. */
@media (max-width: 640px) {
    .cwl-acct__notif-modal {
        max-width: none;
        width: calc(100vw - 24px);
        border-radius: 10px;
    }
    .cwl-acct__notif-modal-content {
        padding: var(--et-space-4);
    }
}

/* Bulk bar mobile — stack vertically. */
@container (max-width: 720px) {
    .cwl-acct__notif-bulk-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--et-space-2);
    }
    .cwl-acct__notif-bulk-actions {
        justify-content: flex-start;
    }
}

/* ─────────────────────────────────────────────
 * Settings panels (v1.5.68 — notification preferences)
 * ───────────────────────────────────────────── */

.cwl-acct__settings-form {
    margin-top: var(--et-space-3);
}

/* v1.5.76 — Settings tabs. TabStrip primitive supplies its own layout;
   this is spacing + tabpanel + tab-level save-footer only. */
.cwl-acct__settings-tabpanel {
    margin-top: var(--et-space-4);
}
.cwl-acct__settings-tabfoot {
    margin-top: var(--et-space-4);
    padding-top: var(--et-space-4);
    border-top: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--et-space-3);
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .cwl-acct__settings-tabfoot {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .cwl-acct__settings-tabfoot .cwl-acct__settings-save {
        justify-content: center !important;
    }
}

.cwl-acct__settings-panel {
    background: var(--et-surface, #ffffff);
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    border-radius: var(--et-radius);
    padding: var(--et-space-5);
}
.cwl-acct__settings-panel-head {
    margin-bottom: var(--et-space-4);
    padding-bottom: var(--et-space-3);
    border-bottom: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
}
.cwl-acct__settings-panel-title {
    margin: 0 0 var(--et-space-1);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__settings-panel-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--et-ink-muted, #64748b);
    line-height: 1.55;
}

.cwl-acct__settings-group {
    margin-bottom: var(--et-space-3);
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    border-radius: var(--et-radius);
    overflow: hidden;
    background: var(--et-surface, #ffffff);
}
.cwl-acct__settings-group:last-of-type {
    margin-bottom: 0;
}
.cwl-acct__settings-group-head {
    margin: 0;
}
.cwl-acct__settings-group-title {
    margin: 0 0 2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__settings-group-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--et-ink-muted, #64748b);
}

/* Accordion — native <details>/<summary> based, default collapsed. */
.cwl-acct__settings-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    padding: var(--et-space-3) var(--et-space-4);
    cursor: pointer;
    list-style: none;
    transition: background-color 120ms ease;
}
.cwl-acct__settings-accordion-summary::-webkit-details-marker {
    display: none;
}
.cwl-acct__settings-accordion-summary:hover,
.cwl-acct__settings-accordion-summary:focus-visible {
    background: color-mix(in srgb, var(--et-ink, #0f172a) 3%, transparent);
    outline: none;
}
.cwl-acct__settings-accordion-labels {
    flex: 1 1 auto;
    min-width: 0;
}
.cwl-acct__settings-accordion-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--et-ink-muted, #94a3b8);
    transition: transform 160ms ease;
    flex: 0 0 auto;
}
.cwl-acct__settings-accordion[open] > .cwl-acct__settings-accordion-summary .cwl-acct__settings-accordion-chevron {
    transform: rotate(180deg);
}
.cwl-acct__settings-accordion[open] > .cwl-acct__settings-accordion-summary {
    border-bottom: 1px solid var(--et-border, rgba(15, 23, 42, 0.06));
}
.cwl-acct__settings-accordion > .cwl-acct__settings-table {
    margin: 0;
    width: 100%;
}
.cwl-acct__settings-accordion > .cwl-acct__settings-table th,
.cwl-acct__settings-accordion > .cwl-acct__settings-table td {
    padding-left: var(--et-space-4);
    padding-right: var(--et-space-4);
}
.cwl-acct__settings-accordion > .cwl-acct__settings-table tbody tr:last-child td,
.cwl-acct__settings-accordion > .cwl-acct__settings-table tbody tr:last-child th {
    padding-bottom: var(--et-space-3);
}

.cwl-acct__settings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--et-space-2);
}
.cwl-acct__settings-table thead {
    border-bottom: 1px solid var(--et-border, rgba(15, 23, 42, 0.06));
}
.cwl-acct__settings-table th,
.cwl-acct__settings-table td {
    padding: var(--et-space-2) var(--et-space-3);
    text-align: left;
    vertical-align: middle;
    font-size: 0.9rem;
}
.cwl-acct__settings-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--et-ink-muted, #64748b);
}
.cwl-acct__settings-th--channel {
    width: 90px;
    text-align: center;
}
.cwl-acct__settings-table tbody tr {
    border-bottom: 1px solid var(--et-border, rgba(15, 23, 42, 0.04));
}
.cwl-acct__settings-table tbody tr:last-child {
    border-bottom: 0;
}
.cwl-acct__settings-td--label {
    font-weight: 500;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__settings-td--toggle {
    text-align: center;
    width: 90px;
}

/* Toggle switch — pill-shaped, custom, theme-agnostic. */
.cwl-acct__settings-toggle {
    display: inline-block;
    position: relative;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}
.cwl-acct__settings-toggle input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
}
.cwl-acct__settings-toggle-track {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: var(--et-border, rgba(15, 23, 42, 0.2));
    border-radius: 999px;
    position: relative;
    transition: background-color 160ms ease;
    vertical-align: middle;
}
.cwl-acct__settings-toggle-thumb {
    display: block;
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 160ms ease;
}
.cwl-acct__settings-toggle input:checked + .cwl-acct__settings-toggle-track {
    background: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__settings-toggle input:checked + .cwl-acct__settings-toggle-track .cwl-acct__settings-toggle-thumb {
    transform: translateX(16px);
}
.cwl-acct__settings-toggle input:focus-visible + .cwl-acct__settings-toggle-track {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 30%, transparent);
}

.cwl-acct__settings-panel-foot {
    margin-top: var(--et-space-5);
    padding-top: var(--et-space-4);
    border-top: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--et-space-3);
    flex-wrap: wrap;
}
.cwl-acct button.cwl-acct__settings-save,
.cwl-acct__settings-save {
    display: inline-flex !important;
    align-items: center !important;
    padding: var(--et-space-2) var(--et-space-4) !important;
    background: var(--cits-wpel-primary-color, #2563eb) !important;
    background-color: var(--cits-wpel-primary-color, #2563eb) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: var(--et-radius) !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15) !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    min-height: 0 !important;
    transition: filter 120ms ease !important;
}
.cwl-acct button.cwl-acct__settings-save:hover,
.cwl-acct button.cwl-acct__settings-save:focus-visible {
    filter: brightness(0.95) !important;
    outline: none !important;
}
.cwl-acct__settings-panel-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--et-ink-muted, #64748b);
    max-width: 480px;
}
.cwl-acct__settings-panel-hint a {
    color: var(--cits-wpel-primary-color, #2563eb);
}

/* General preferences panel (v1.5.69) — timezone + locale + density */
.cwl-acct__settings-general-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--et-space-4);
}
.cwl-acct__settings-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cwl-acct__settings-field--full {
    grid-column: 1 / -1;
}
.cwl-acct__settings-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
    margin-bottom: 4px;
}
.cwl-acct__settings-field-hint {
    margin: 0 0 var(--et-space-2);
    font-size: 0.8rem;
    color: var(--et-ink-muted, #64748b);
}
.cwl-acct button.cwl-acct__settings-select,
.cwl-acct__settings-select {
    width: 100% !important;
    padding: 8px 12px !important;
    background: var(--et-surface, #ffffff) !important;
    background-color: var(--et-surface, #ffffff) !important;
    background-image: none !important;
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.15)) !important;
    border-radius: var(--et-radius) !important;
    color: var(--et-ink, #0f172a) !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: 0 !important;
    box-shadow: none !important;
    appearance: auto;
}
.cwl-acct__settings-select:focus-visible {
    outline: none !important;
    border-color: var(--cits-wpel-primary-color, #2563eb) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 25%, transparent) !important;
}

/* Radio option cards for density */
.cwl-acct__settings-radio-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--et-space-3);
}
.cwl-acct__settings-radio {
    display: flex;
    align-items: flex-start;
    gap: var(--et-space-2);
    padding: var(--et-space-3);
    background: var(--et-surface, #ffffff);
    border: 1.5px solid var(--et-border, rgba(15, 23, 42, 0.12));
    border-radius: var(--et-radius);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}
.cwl-acct__settings-radio:hover {
    border-color: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 40%, var(--et-border, rgba(15, 23, 42, 0.12)));
}
.cwl-acct__settings-radio input[type="radio"] {
    margin: 4px 0 0;
    accent-color: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__settings-radio input[type="radio"]:checked ~ .cwl-acct__settings-radio-label strong {
    color: var(--cits-wpel-primary-color, #2563eb);
}
.cwl-acct__settings-radio:has(input:checked) {
    border-color: var(--cits-wpel-primary-color, #2563eb);
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 5%, var(--et-surface, #ffffff));
}
.cwl-acct__settings-radio-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cwl-acct__settings-radio-label strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__settings-radio-label small {
    font-size: 0.75rem;
    color: var(--et-ink-muted, #64748b);
    line-height: 1.4;
}

/* Two-factor panel (v1.5.70) */
.cwl-acct__tfa-state {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-3);
}
.cwl-acct__tfa-state-line {
    display: flex;
    align-items: center;
    gap: var(--et-space-2);
    margin: 0;
    font-size: 0.9rem;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__tfa-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cwl-acct__tfa-badge--on {
    background: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 15%, transparent);
    color: color-mix(in srgb, var(--cits-wpel-success-color, #16a34a) 90%, var(--et-ink));
}
.cwl-acct__tfa-badge--off {
    background: color-mix(in srgb, var(--et-ink, #0f172a) 8%, transparent);
    color: var(--et-ink-muted, #64748b);
}
.cwl-acct__tfa-facts {
    margin: 0;
    padding-left: var(--et-space-4);
    color: var(--et-ink-muted, #64748b);
    font-size: 0.85rem;
    line-height: 1.6;
}

.cwl-acct__tfa-reveal {
    margin-bottom: var(--et-space-4);
    padding: var(--et-space-4);
    background: color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 6%, var(--et-surface, #ffffff));
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 30%, transparent);
    border-radius: var(--et-radius);
}
.cwl-acct__tfa-reveal-title {
    margin: 0 0 var(--et-space-2);
    font-size: 1rem;
    font-weight: 700;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__tfa-reveal-desc {
    margin: 0 0 var(--et-space-3);
    font-size: 0.85rem;
    color: var(--et-ink-muted, #64748b);
    line-height: 1.5;
}
.cwl-acct__tfa-reveal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--et-space-2);
    margin: 0;
    padding: 0 0 0 var(--et-space-4);
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 1rem;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__tfa-reveal-list code {
    background: transparent;
    padding: 0;
    letter-spacing: 1px;
}

.cwl-acct__tfa-setup {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-3);
}
.cwl-acct__tfa-steps {
    margin: 0;
    padding: 0 0 0 var(--et-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--et-space-4);
}
.cwl-acct__tfa-steps > li strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
    margin-bottom: 4px;
}
.cwl-acct__tfa-steps > li p {
    margin: 0 0 var(--et-space-2);
    font-size: 0.85rem;
    color: var(--et-ink-muted, #64748b);
    line-height: 1.5;
}
.cwl-acct__tfa-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--et-space-3);
    margin: var(--et-space-2) 0;
    background: #ffffff;
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    border-radius: var(--et-radius);
    min-height: 200px;
}
.cwl-acct__tfa-qr svg {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
}
.cwl-acct__tfa-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}
.cwl-acct__tfa-link-btn {
    display: inline;
    padding: 0;
    margin: 0 0 0 4px;
    background: transparent;
    border: 0;
    color: var(--cits-wpel-primary-color, #2563eb);
    font-size: inherit;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.cwl-acct__tfa-link-btn:hover,
.cwl-acct__tfa-link-btn:focus-visible {
    text-decoration: none;
    outline: none;
}

.cwl-acct__tfa-key {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: var(--et-space-2);
}
.cwl-acct__tfa-key-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--et-ink-muted, #94a3b8);
}
.cwl-acct__tfa-key-value {
    display: block;
    padding: var(--et-space-2) var(--et-space-3);
    background: color-mix(in srgb, var(--et-ink, #0f172a) 5%, transparent);
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.10));
    border-radius: 6px;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.95rem;
    color: var(--et-ink, #0f172a);
    letter-spacing: 0.5px;
    word-break: break-all;
    user-select: all;
    cursor: text;
}
.cwl-acct__tfa-key-value--wrap {
    font-size: 0.8rem;
    letter-spacing: 0;
}

.cwl-acct__tfa-form {
    margin: 0;
}
.cwl-acct__tfa-form--inline {
    display: flex;
    align-items: center;
    gap: var(--et-space-2);
    flex-wrap: wrap;
}
.cwl-acct button.cwl-acct__tfa-code-input,
.cwl-acct__tfa-code-input {
    width: 180px;
    padding: 8px 12px !important;
    background: var(--et-surface, #ffffff) !important;
    background-color: var(--et-surface, #ffffff) !important;
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.15)) !important;
    border-radius: var(--et-radius) !important;
    color: var(--et-ink, #0f172a) !important;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important;
    font-size: 1rem !important;
    letter-spacing: 2px !important;
    text-align: center !important;
    height: auto !important;
    min-height: 0 !important;
    box-shadow: none !important;
}
.cwl-acct__tfa-code-input:focus-visible {
    outline: none !important;
    border-color: var(--cits-wpel-primary-color, #2563eb) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 25%, transparent) !important;
}

.cwl-acct button.cwl-acct__tfa-primary-btn,
.cwl-acct__tfa-primary-btn {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 16px !important;
    background: var(--cits-wpel-primary-color, #2563eb) !important;
    background-color: var(--cits-wpel-primary-color, #2563eb) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: var(--et-radius) !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15) !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-height: 0 !important;
}
.cwl-acct__tfa-primary-btn:hover,
.cwl-acct__tfa-primary-btn:focus-visible {
    filter: brightness(0.95) !important;
    outline: none !important;
}
.cwl-acct button.cwl-acct__tfa-secondary-btn,
.cwl-acct__tfa-secondary-btn {
    display: inline-flex !important;
    padding: 6px 14px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--cits-wpel-primary-color, #2563eb) !important;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color, #2563eb) 30%, transparent) !important;
    border-radius: var(--et-radius) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
.cwl-acct button.cwl-acct__tfa-danger-btn,
.cwl-acct__tfa-danger-btn {
    display: inline-flex !important;
    padding: 6px 14px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--cits-wpel-danger-color, #dc2626) !important;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 30%, transparent) !important;
    border-radius: var(--et-radius) !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.cwl-acct__tfa-manage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--et-space-4);
    margin-top: var(--et-space-3);
}
.cwl-acct__tfa-manage-grid > form {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-2);
    padding: var(--et-space-3);
    background: var(--et-surface, #ffffff);
    border: 1px solid var(--et-border, rgba(15, 23, 42, 0.08));
    border-radius: var(--et-radius);
}
.cwl-acct__tfa-manage-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--et-ink, #0f172a);
}
.cwl-acct__tfa-manage-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--et-ink-muted, #64748b);
    line-height: 1.5;
}

@container (max-width: 640px) {
    .cwl-acct__tfa-manage-grid,
    .cwl-acct__tfa-reveal-list {
        grid-template-columns: 1fr;
    }
    .cwl-acct__tfa-form--inline {
        flex-direction: column;
        align-items: stretch;
    }
    .cwl-acct__tfa-code-input {
        width: 100% !important;
    }
}

/* Compact density — reduce spacing sitewide when body has the class. */
body.cwl-density-compact .cwl-acct__body {
    gap: var(--et-space-3);
}
body.cwl-density-compact .cwl-acct__notif-td {
    padding-top: var(--et-space-2);
    padding-bottom: var(--et-space-2);
}
body.cwl-density-compact .cwl-acct__nav-item {
    padding-top: 8px;
    padding-bottom: 8px;
}

@container (max-width: 640px) {
    .cwl-acct__settings-panel {
        padding: var(--et-space-4);
    }
    .cwl-acct__settings-th--channel,
    .cwl-acct__settings-td--toggle {
        width: 72px;
    }
    .cwl-acct__settings-table th,
    .cwl-acct__settings-table td {
        padding: var(--et-space-2);
    }
    .cwl-acct__settings-panel-foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .cwl-acct__settings-save {
        justify-content: center !important;
    }
    .cwl-acct__settings-general-grid {
        grid-template-columns: 1fr;
    }
    .cwl-acct__settings-radio-row {
        grid-template-columns: 1fr;
    }
    .cwl-acct__settings-accordion-summary {
        padding: var(--et-space-3);
    }
    .cwl-acct__settings-accordion > .cwl-acct__settings-table th,
    .cwl-acct__settings-accordion > .cwl-acct__settings-table td {
        padding-left: var(--et-space-3);
        padding-right: var(--et-space-3);
    }
}

/* ─────────────────────────────────────────────
 * User Edit surface (v1.5.40 — single-column card stack)
 * Full-width cards: header · profile picture · identity+role · danger zone.
 * No aside — everything stacks vertically at full container width.
 * ───────────────────────────────────────────── */
.cwl-acct__user-edit {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-5);
}

/* ── Header card ────────────────────────────── */
.cwl-acct__ue-header {
    display: flex;
    align-items: center;
    gap: var(--et-space-5);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-5) var(--et-space-6);
    position: relative;
    overflow: hidden;
}
.cwl-acct__ue-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--cits-wpel-primary-color);
}
.cwl-acct__ue-header-avatar { flex-shrink: 0; }
.cwl-acct__ue-header-avatar img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid color-mix(in srgb, var(--cits-wpel-primary-color) 25%, transparent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--et-ink) 8%, transparent);
    display: block;
}
.cwl-acct__ue-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cwl-acct__ue-header-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--et-ink);
    line-height: 1.2;
}
.cwl-acct__ue-header-login {
    font-size: 0.85rem;
    color: var(--et-ink-muted);
    margin-bottom: var(--et-space-3);
}
.cwl-acct__ue-header-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--et-space-2) var(--et-space-5);
    font-size: 0.8rem;
}
.cwl-acct__ue-header-meta li {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: var(--et-ink-muted);
}
.cwl-acct__ue-header-meta li span {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--et-ink-faint);
}
.cwl-acct__ue-header-meta li strong {
    color: var(--et-ink);
    font-weight: 600;
    font-size: 0.85rem;
}
.cwl-acct__ue-header-wpadmin {
    flex-shrink: 0;
    align-self: flex-start;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid color-mix(in srgb, var(--cits-wpel-primary-color) 30%, var(--et-border));
    border-radius: var(--et-radius);
    transition: background 120ms ease, border-color 120ms ease;
    white-space: nowrap;
}
.cwl-acct__ue-header-wpadmin:hover,
.cwl-acct__ue-header-wpadmin:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 8%, transparent);
    border-color: var(--cits-wpel-primary-color);
    outline: none;
}
@container (max-width: 640px) {
    .cwl-acct__ue-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .cwl-acct__ue-header-wpadmin {
        align-self: stretch;
        text-align: center;
    }
}

/* ── Generic card ───────────────────────────── */
.cwl-acct__ue-card {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-5) var(--et-space-6);
}
.cwl-acct__ue-card-header {
    margin: 0 0 var(--et-space-4);
    padding-bottom: var(--et-space-3);
    border-bottom: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}
.cwl-acct__ue-card-header--inner {
    margin-top: var(--et-space-5);
}
.cwl-acct__ue-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--et-ink);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}
.cwl-acct__ue-card-header p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--et-ink-muted);
}

/* ── Avatar upload card ─────────────────────── */
.cwl-acct__ue-avatar-form {
    display: flex;
    flex-direction: column;
    gap: var(--et-space-4);
    position: relative;
}
.cwl-acct__ue-avatar-body {
    display: flex;
    align-items: center;
    gap: var(--et-space-5);
}
.cwl-acct__ue-avatar-preview { flex-shrink: 0; }
.cwl-acct__ue-avatar-preview img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--et-border);
    display: block;
}
.cwl-acct__ue-avatar-picker-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.cwl-acct__ue-avatar-picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px dashed color-mix(in srgb, var(--cits-wpel-primary-color) 40%, var(--et-border));
    border-radius: var(--et-radius);
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 4%, transparent);
    color: var(--cits-wpel-primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
    position: relative;
}
.cwl-acct__ue-avatar-picker:hover,
.cwl-acct__ue-avatar-picker:focus-within {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 10%, transparent);
    border-color: var(--cits-wpel-primary-color);
}
.cwl-acct__ue-avatar-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.cwl-acct__ue-avatar-hint {
    font-size: 0.78rem;
    color: var(--et-ink-muted);
    word-break: break-word;
}
.cwl-acct__ue-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--et-space-3);
}
@container (max-width: 480px) {
    .cwl-acct__ue-avatar-body {
        flex-direction: column;
        align-items: flex-start;
    }
    .cwl-acct__ue-avatar-picker { align-self: stretch; }
    .cwl-acct__ue-avatar-picker-wrap { width: 100%; }
}

/* ── Form primitives (shared with identity + role) ── */
.cwl-acct__form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--et-space-4);
    margin-bottom: var(--et-space-3);
}
@container (min-width: 600px) {
    .cwl-acct__form-grid { grid-template-columns: 1fr 1fr; }
}
.cwl-acct__form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cwl-acct__form-row label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--et-ink-soft);
}
.cwl-acct__form-row input[type="text"],
.cwl-acct__form-row input[type="email"],
.cwl-acct__form-row select {
    padding: 10px 12px;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius);
    background: var(--et-surface);
    color: var(--et-ink);
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.cwl-acct__form-row input:focus,
.cwl-acct__form-row select:focus {
    outline: none;
    border-color: var(--cits-wpel-primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cits-wpel-primary-color) 18%, transparent);
}
.cwl-acct__form-hint {
    font-size: 0.75rem;
    color: var(--et-ink-muted);
    margin-top: 2px;
}
.cwl-acct__form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--et-space-3);
    margin-top: var(--et-space-4);
    padding-top: var(--et-space-4);
    border-top: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}

/* ── Danger zone card ───────────────────────── */
.cwl-acct__ue-card--danger {
    border-color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 25%, var(--et-border));
    background: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 2%, var(--et-surface));
}
.cwl-acct__ue-card--danger .cwl-acct__ue-card-header {
    border-bottom-color: color-mix(in srgb, var(--cits-wpel-danger-color, #dc2626) 15%, var(--et-border));
}
.cwl-acct__ue-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--et-space-3);
    padding: var(--et-space-3) 0;
    border-bottom: 1px solid color-mix(in srgb, var(--et-border) 60%, transparent);
}
.cwl-acct__ue-action-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.cwl-acct__ue-action-row:first-of-type { padding-top: 0; }
.cwl-acct__ue-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
    flex: 1;
}
.cwl-acct__ue-action-text strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--et-ink);
}
.cwl-acct__ue-action-text span {
    font-size: 0.8rem;
    color: var(--et-ink-muted);
}
.cwl-acct__ue-action-row--danger .cwl-acct__ue-action-text strong {
    color: var(--cits-wpel-danger-color, #dc2626);
}

/* Legacy .cwl-acct__form-sub is still emitted from other surfaces —
 * kept as a lightweight sub-heading style. */
.cwl-acct__form-sub {
    margin: 0 0 var(--et-space-3);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--et-ink-muted);
}
.cwl-acct__empty-cta--danger {
    background: var(--cits-wpel-danger-color, #dc2626);
    color: #ffffff;
    border: 1px solid var(--cits-wpel-danger-color, #dc2626);
}
.cwl-acct__empty-cta--danger:hover,
.cwl-acct__empty-cta--danger:focus-visible {
    filter: brightness(0.92);
    outline: none;
}

/* ---- LOGGED-OUT STATE ---- */
.cwl-acct--loggedout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--et-space-6);
}
.cwl-acct__loggedout-card {
    max-width: 460px;
    text-align: center;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    padding: var(--et-space-8) var(--et-space-6);
    box-shadow: var(--et-shadow-sm);
}
.cwl-acct__loggedout-title {
    margin: 0 0 var(--et-space-3);
    font-size: var(--et-fs-title);
    color: var(--et-ink);
}
.cwl-acct__loggedout-sub {
    margin: 0 0 var(--et-space-5);
    color: var(--et-ink-muted);
}
.cwl-acct__loggedout-cta {
    display: inline-flex;
    align-items: center;
    padding: var(--et-space-3) var(--et-space-8);
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    text-decoration: none;
    border-radius: var(--et-radius);
    font-weight: 600;
}
.cwl-acct__loggedout-cta:hover,
.cwl-acct__loggedout-cta:focus-visible {
    filter: brightness(0.95);
    outline: none;
}

/* ---- RESPONSIVE (container-query aware) ---- */
/* v1.5.41 — sidebar becomes a top-down sheet on ≤900px containers.
 * Was: wrap-row (10 items reflow into an ugly grid above main content).
 * Now: hamburger in hero + sheet slides down from top of .cwl-acct__body
 * with a backdrop. Anchored to the shell (position: absolute on the
 * shell body, not the viewport) so the theme header stays visible. */
@container (max-width: 900px) {
    /* v1.5.47 — tighten shell chrome on mobile.
     * - Drop rounded corners so the shell reads as edge-to-edge card
     *   (matches the visual if operator zeroes their Elementor
     *   container's mobile padding).
     * - Drop the shell's top/bottom margin to reclaim vertical space.
     * - Reduce hero + body padding so content gets closer to the edges. */
    .cwl-acct {
        border-radius: 0;
        margin-block: 0;
    }
    .cwl-acct__hero {
        padding: var(--et-space-5) var(--et-space-4);
    }
    .cwl-acct__hero-inner {
        padding-inline: 0;
    }
    .cwl-acct__body {
        grid-template-columns: 1fr;
        padding: var(--et-space-4) var(--et-space-3);
        /* Defensive floor so the abs-positioned sheet never exceeds the
         * body height (which would get clipped by .cwl-acct's overflow
         * hidden). Real content is almost always taller than this. */
        min-height: 380px;
    }

    /* v1.5.43 — full-width labeled bar replaces the hero-corner
     * hamburger. The bar sits at the top of the body (first grid
     * child) and reads as "My Account" so it's clearly account nav,
     * not site nav. Chevron rotates 180° when open. v1.5.46 removed
     * the close-X button — the bar itself toggles + ESC + backdrop-tap
     * + nav-item-tap all close, so the X was redundant clutter. */
    .cwl-acct__mobile-nav-bar { display: inline-flex; }

    /* Hero body regains all horizontal space — no button competing. */
    .cwl-acct__hero-name { word-break: normal; overflow-wrap: anywhere; }
    .cwl-acct__hero-meta { flex-wrap: wrap; }

    /* Sidebar becomes a top-down sheet — absolutely positioned so it
     * slides down from below the mobile-nav bar. `top` offset accounts
     * for the bar height (~46px) + the grid row gap (20px) so the sheet
     * appears attached to the bar. Hidden by default (translateY +
     * opacity 0 + pointer-events none), animated in when the shell
     * has [data-cwl-nav-open]. */
    .cwl-acct__sidebar {
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        z-index: 10;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        padding: var(--et-space-4);
        border-radius: var(--et-radius-lg);
        box-shadow: 0 12px 32px color-mix(in srgb, var(--et-ink) 18%, transparent);
        opacity: 0;
        transform: translateY(-12px);
        pointer-events: none;
        transition:
            opacity 220ms ease,
            transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
    }
    .cwl-acct[data-cwl-nav-open] .cwl-acct__sidebar {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Nav items regain their vertical stack inside the sheet. */
    .cwl-acct__nav {
        flex-direction: column;
        gap: 2px;
    }
    .cwl-acct__nav-item {
        flex: 0 0 auto;
        padding: var(--et-space-3) var(--et-space-4);
    }

    .cwl-acct__stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (prefers-reduced-motion: reduce) {
    .cwl-acct__sidebar,
    .cwl-acct__nav-backdrop {
        transition: none;
    }
}
@container (max-width: 520px) {
    .cwl-acct__stat-grid {
        grid-template-columns: 1fr;
    }
    .cwl-acct__hero-name {
        font-size: 18px;
    }
    .cwl-acct__hero-avatar-wrap {
        width: 64px;
        height: 64px;
    }
    /* Table becomes card-stack via data-th labels. */
    .cwl-acct__table thead {
        display: none;
    }
    .cwl-acct__table,
    .cwl-acct__table tbody,
    .cwl-acct__tr,
    .cwl-acct__td {
        display: block;
        width: 100%;
    }
    .cwl-acct__tr {
        padding: var(--et-space-3) 0;
        border-bottom: 1px solid var(--et-border);
    }
    .cwl-acct__td {
        padding: var(--et-space-2) var(--et-space-5);
        border: 0;
    }
    .cwl-acct__td::before {
        content: attr(data-th) ": ";
        font-weight: 600;
        color: var(--et-ink-muted);
        margin-right: var(--et-space-2);
    }
    .cwl-acct__td--name::before {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────────
 * 3.7 Data table
 * ───────────────────────────────────────────────────────────────── */
.cwl-table-wrap {
    overflow-x: auto;
    border-radius: var(--et-radius);
    border: 1px solid var(--et-border);
    background: var(--et-surface);
    container-type: inline-size;
}

.cwl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--et-fs-body);
    color: var(--et-ink);
}

.cwl-table__caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cwl-table thead th {
    position: sticky;
    top: 0;
    background: var(--et-surface-sunken);
    text-align: left;
    padding: var(--et-space-3) var(--et-space-4);
    font-size: var(--et-fs-eyebrow);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--et-ink-muted);
    border-bottom: 1px solid var(--et-border);
    font-weight: 600;
}

.cwl-table tbody td {
    padding: var(--et-space-3) var(--et-space-4);
    border-bottom: 1px solid var(--et-border-soft);
    line-height: var(--et-lh-body);
}

.cwl-table tbody tr:last-child td {
    border-bottom: 0;
}

.cwl-table tbody tr:hover {
    background: var(--et-surface-sunken);
}

@container (max-width: 600px) {
    .cwl-table thead {
        display: none;
    }

    .cwl-table,
    .cwl-table tbody,
    .cwl-table tr,
    .cwl-table td {
        display: block;
    }

    .cwl-table tbody tr {
        padding: var(--et-space-3);
        border-bottom: 1px solid var(--et-border);
    }

    .cwl-table tbody td {
        padding: var(--et-space-1) 0;
        border-bottom: 0;
        display: grid;
        grid-template-columns: minmax(80px, 30%) 1fr;
        gap: var(--et-space-3);
    }

    .cwl-table tbody td::before {
        content: attr(data-th);
        font-size: var(--et-fs-eyebrow);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--et-ink-muted);
        font-weight: 600;
        align-self: center;
    }
}

/* ─────────────────────────────────────────────────────────────────
 * 3.9 Button hierarchy
 * ───────────────────────────────────────────────────────────────── */
.cwl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--et-space-2);
    min-height: 36px;
    padding: 0 var(--et-space-4);
    font-size: var(--et-fs-body);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--et-radius-sm);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--et-motion-fast), border-color var(--et-motion-fast), color var(--et-motion-fast);
    font-family: inherit;
}

.cwl-btn--sm { min-height: 28px; padding: 0 var(--et-space-3); font-size: 13px; }
.cwl-btn--lg { min-height: 44px; padding: 0 var(--et-space-6); font-size: var(--et-fs-body-lg); }

.cwl-btn--primary {
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    border-color: var(--cits-wpel-primary-color);
}

.cwl-btn--primary:hover,
.cwl-btn--primary:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 88%, #000);
    border-color: color-mix(in srgb, var(--cits-wpel-primary-color) 88%, #000);
    outline: none;
}

.cwl-btn--secondary {
    background: transparent;
    color: var(--cits-wpel-primary-color);
    border-color: var(--cits-wpel-primary-color);
}

.cwl-btn--secondary:hover,
.cwl-btn--secondary:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 8%, transparent);
    outline: none;
}

.cwl-btn--ghost {
    background: transparent;
    color: var(--cits-wpel-primary-color);
    border-color: transparent;
}

.cwl-btn--ghost:hover,
.cwl-btn--ghost:focus-visible {
    background: color-mix(in srgb, var(--cits-wpel-primary-color) 8%, transparent);
    outline: none;
}

.cwl-link {
    color: var(--cits-wpel-primary-color);
    text-decoration: none;
    font-weight: 500;
}

.cwl-link:hover,
.cwl-link:focus-visible {
    text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────
 * 3.10 Tab strip
 * ───────────────────────────────────────────────────────────────── */
.cwl-tabs {
    display: flex;
    gap: var(--et-space-1);
    overflow-x: auto;
    border-bottom: 1px solid var(--et-border);
    margin-bottom: var(--et-space-5);
    scrollbar-width: thin;
}

.cwl-tabs__tab {
    display: inline-flex;
    align-items: center;
    padding: var(--et-space-3) var(--et-space-4);
    font-size: var(--et-fs-body);
    color: var(--et-ink-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-weight: 500;
    transition: color var(--et-motion-fast), border-color var(--et-motion-fast);
}

.cwl-tabs__tab:hover,
.cwl-tabs__tab:focus-visible {
    color: var(--et-ink);
    outline: none;
}

.cwl-tabs__tab--active {
    color: var(--et-ink);
    border-bottom-color: var(--cits-wpel-primary-color);
    font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
 * 3.11 Badge / chip / pill
 * ───────────────────────────────────────────────────────────────── */
.cwl-badge {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 var(--et-space-2);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--et-border);
    color: var(--et-ink-soft);
    border-radius: var(--et-radius-sm);
    line-height: 1;
}

.cwl-badge--success { background: color-mix(in srgb, var(--cits-wpel-success-color) 15%, transparent); color: var(--cits-wpel-success-color); }
.cwl-badge--danger  { background: color-mix(in srgb, var(--cits-wpel-danger-color) 15%, transparent); color: var(--cits-wpel-danger-color); }
.cwl-badge--brand   { background: color-mix(in srgb, var(--cits-wpel-primary-color) 15%, transparent); color: var(--cits-wpel-primary-color); }

.cwl-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--et-space-2);
    height: 28px;
    padding: 0 var(--et-space-3);
    font-size: var(--et-fs-body);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-pill);
    color: var(--et-ink-soft);
    text-decoration: none;
    cursor: pointer;
}

.cwl-chip:hover,
.cwl-chip:focus-visible {
    border-color: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-primary-color);
    outline: none;
}

.cwl-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    background: var(--cits-wpel-primary-color);
    color: var(--cits-wpel-button-text, #ffffff);
    border-radius: var(--et-radius-pill);
    line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────
 * Skeleton loader (P4 — skeleton over spinner)
 * ───────────────────────────────────────────────────────────────── */
.cwl-skeleton {
    display: block;
    background: linear-gradient(90deg, var(--et-border-soft) 0%, var(--et-border) 50%, var(--et-border-soft) 100%);
    background-size: 200% 100%;
    animation: cwl-skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--et-radius-sm);
    height: 1em;
    min-height: 16px;
}

@keyframes cwl-skeleton-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ─────────────────────────────────────────────────────────────────
 * Print styles (E75.9 pre-work)
 * ───────────────────────────────────────────────────────────────── */
@media print {
    .cwl-hero {
        background: transparent !important;
        color: var(--et-ink) !important;
        box-shadow: none !important;
        padding: 0;
        border-radius: 0;
    }

    .cwl-tabs,
    .cwl-btn,
    .cwl-widget__footer,
    .cwl-card__footer {
        display: none !important;
    }

    .cwl-card,
    .cwl-widget,
    .cwl-empty {
        border: 1px solid var(--et-ink) !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* ── v1.8.31.1 — Memberships TABLE view (replaces card grid) ── */
.cwl-acct__memberships-table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cwl-acct__memberships-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.cwl-acct__memberships-table thead th {
    text-align: left;
    padding: 12px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    white-space: nowrap;
}
.cwl-acct__memberships-table tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    vertical-align: middle;
}
.cwl-acct__memberships-table tbody tr:last-child td {
    border-bottom: 0;
}
.cwl-acct__memberships-row--cancelled td,
.cwl-acct__memberships-row--expired td {
    color: #6b7280;
}
.cwl-acct__memberships-cell-plan {
    min-width: 220px;
}
.cwl-acct__memberships-cell-plan strong {
    font-weight: 600;
    color: #111827;
    display: block;
    line-height: 1.35;
}
.cwl-acct__memberships-cell-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 2px;
}
.cwl-acct__memberships-cell-note {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
}
.cwl-acct__memberships-cell-source {
    font-size: 12px;
    color: #6b7280;
}
.cwl-acct__memberships-table-actions-col {
    width: 110px;
    text-align: right;
}
.cwl-acct__memberships-cell-actions {
    text-align: right;
    white-space: nowrap;
}
.cwl-acct__memberships-cell-actions > * {
    vertical-align: middle;
}
.cwl-acct__memberships-action-form {
    display: inline;
    margin: 0;
    padding: 0;
}
.cwl-acct__memberships-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    margin-left: 4px;
    text-decoration: none;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
    padding: 0;
}
.cwl-acct__memberships-action:hover {
    color: #111827;
    border-color: #9ca3af;
    background: #f9fafb;
}
.cwl-acct__memberships-action--switch:hover {
    color: var(--cits-wpel-primary-color, #6366f1);
    border-color: var(--cits-wpel-primary-color, #6366f1);
}
.cwl-acct__memberships-action--cancel:hover {
    color: #dc2626;
    border-color: #f87171;
    background: #fef2f2;
}
.cwl-acct__memberships-action:focus {
    outline: 2px solid var(--cits-wpel-primary-color, #6366f1);
    outline-offset: 1px;
}
.cwl-acct__memberships-action-none {
    color: #d1d5db;
    font-size: 14px;
}
/* Mobile: stack cells as label + value pairs. */
@media (max-width: 640px) {
    .cwl-acct__memberships-table thead {
        display: none;
    }
    .cwl-acct__memberships-table,
    .cwl-acct__memberships-table tbody,
    .cwl-acct__memberships-table tr,
    .cwl-acct__memberships-table td {
        display: block;
        width: 100%;
    }
    .cwl-acct__memberships-table tbody tr {
        border-bottom: 1px solid #e5e7eb;
        padding: 10px 14px;
    }
    .cwl-acct__memberships-table tbody tr:last-child {
        border-bottom: 0;
    }
    .cwl-acct__memberships-table tbody td {
        padding: 6px 0;
        border-bottom: 0;
    }
    .cwl-acct__memberships-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #6b7280;
        margin-bottom: 2px;
    }
    .cwl-acct__memberships-cell-actions {
        text-align: left;
    }
}

/* ── v1.8.31.2 — Icon-button reset for the memberships table Cancel
 * button. Themes (Blocksy/Astra/etc) often style `button` with primary
 * background + padding + no border-radius, which swallowed our icon.
 * Higher-specificity + explicit resets so the icon is visible on any
 * theme without needing !important.
 */
button.cwl-acct__memberships-action,
a.cwl-acct__memberships-action {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    padding: 0;
    margin: 0 0 0 4px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    background-color: #fff;
    background-image: none;
    color: #4b5563;
    line-height: 1;
    font: inherit;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
button.cwl-acct__memberships-action:hover,
a.cwl-acct__memberships-action:hover {
    color: #111827;
    border-color: #9ca3af;
    background: #f9fafb;
    background-color: #f9fafb;
    background-image: none;
}
button.cwl-acct__memberships-action--switch:hover,
a.cwl-acct__memberships-action--switch:hover {
    color: var(--cits-wpel-primary-color, #6366f1);
    border-color: var(--cits-wpel-primary-color, #6366f1);
}
button.cwl-acct__memberships-action--cancel,
a.cwl-acct__memberships-action--cancel {
    color: #dc2626;
}
button.cwl-acct__memberships-action--cancel:hover {
    color: #b91c1c;
    border-color: #f87171;
    background: #fef2f2;
    background-color: #fef2f2;
    background-image: none;
}
button.cwl-acct__memberships-action:focus-visible,
a.cwl-acct__memberships-action:focus-visible {
    outline: 2px solid var(--cits-wpel-primary-color, #6366f1);
    outline-offset: 1px;
}
button.cwl-acct__memberships-action svg,
a.cwl-acct__memberships-action svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
}

/* v1.8.34.1 — Renew action + expiry pill. Green tone so Renew stands
 * apart from the neutral Switch and destructive Cancel. Pills sit
 * inline in the ENDS cell to give a proactive expiry signal. */
a.cwl-acct__memberships-action--renew {
    color: #15803d;
}
a.cwl-acct__memberships-action--renew:hover {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}
.cwl-acct__memberships-expiry-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 99px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}
.cwl-acct__memberships-expiry-pill--warn {
    background: #fef3c7;
    color: #92400e;
}
.cwl-acct__memberships-expiry-pill--danger {
    background: #fee2e2;
    color: #991b1b;
}
.cwl-acct__memberships-expiry-pill--muted {
    background: #f3f4f6;
    color: #6b7280;
}
