/**
 * Cleafs Wallet — frontend design system (Moje Konto)
 * Ported from design bundle (claude.ai/design). Sidebar is NOT ported —
 * WooCommerce My Account has its own menu; our templates render as content.
 *
 * Design tokens + layout + all component styles used by:
 *   - Portfel (views/portfel.php)
 *   - Punkty Promowania (views/zasiegi.php)
 *   - Misje (views/missions.php)
 *   - Shortcode [cleafs_wallet_ranks_comparison]
 */

.cleafs-wallet {
    --cw-brand: #0E2868;
    --cw-brand-dark: #174a9a;
    --cw-brand-ink: #091a47;
    --cw-accent: #FFDE65;
    --cw-accent-dark: #e6c84e;
    --cw-blue-mid: #1E5ABC;
    --cw-blue-bright: #3b82f6;
    --cw-light: #f0f2ff;
    --cw-surface: #ffffff;
    --cw-bg: #f5f7ff;
    --cw-line: #e5e7eb;
    --cw-line-strong: #d1d5db;
    --cw-muted: #6b7280;
    --cw-muted-2: #9ca3af;
    --cw-ink: #0b1630;
    --cw-pos: #1f7a3a;
    --cw-neg: #b42a2a;
    --cw-shadow-sm: 0 1px 2px rgba(14,40,104,.06);
    --cw-shadow-md: 0 8px 24px rgba(14,40,104,.08), 0 2px 6px rgba(14,40,104,.04);
    --cw-shadow-lg: 0 24px 60px rgba(14,40,104,.14), 0 8px 20px rgba(14,40,104,.06);
    --cw-r-sm: 8px;
    --cw-r-md: 12px;
    --cw-r-lg: 18px;
    --cw-r-xl: 24px;

    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--cw-ink);
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
}
.cleafs-wallet *,
.cleafs-wallet *::before,
.cleafs-wallet *::after { box-sizing: border-box; }
.cleafs-wallet .cw-mono { font-family: 'JetBrains Mono', Menlo, ui-monospace, monospace; }
.cleafs-wallet .cw-tabular { font-variant-numeric: tabular-nums; }

/* === Buttons === */
.cleafs-wallet .cw-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
    text-decoration: none;
}
.cleafs-wallet .cw-btn-primary { background: var(--cw-brand); color: #fff; box-shadow: 0 2px 8px rgba(14,40,104,.2); }
.cleafs-wallet .cw-btn-primary:hover { background: var(--cw-brand-dark); color: #fff; }
.cleafs-wallet .cw-btn-accent { background: var(--cw-accent); color: var(--cw-brand-ink); box-shadow: 0 4px 14px rgba(255,222,101,.45); }
.cleafs-wallet .cw-btn-accent:hover { background: var(--cw-accent-dark); color: var(--cw-brand-ink); }
.cleafs-wallet .cw-btn-ghost { background: transparent; color: var(--cw-brand); border-color: var(--cw-line); }
.cleafs-wallet .cw-btn-ghost:hover { background: var(--cw-light); border-color: var(--cw-brand); }
.cleafs-wallet .cw-btn-sm { padding: 7px 12px; font-size: 12px; }
.cleafs-wallet .cw-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* === Card === */
.cleafs-wallet .cw-card {
    background: var(--cw-surface);
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-lg);
    box-shadow: var(--cw-shadow-sm);
}
.cleafs-wallet .cw-card-padded { padding: 24px; }
.cleafs-wallet .cw-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--cw-line);
}
.cleafs-wallet .cw-card-title { font-size: 15px; font-weight: 600; margin: 0; }

/* === Wallet hero === */
.cleafs-wallet .cw-wallet-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--cw-r-xl);
    padding: 32px 36px;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255,222,101,.22), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(59,130,246,.28), transparent 55%),
        linear-gradient(135deg, #0E2868 0%, #174a9a 60%, #1E5ABC 100%);
    box-shadow: var(--cw-shadow-lg);
}
.cleafs-wallet .cw-wallet-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,.06) 0, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255,222,101,.06) 0, transparent 40%);
    pointer-events: none;
}
.cleafs-wallet .cw-wallet-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
}
@media (max-width: 820px) {
    .cleafs-wallet .cw-wallet-hero-grid { grid-template-columns: 1fr; gap: 28px; }
}
.cleafs-wallet .cw-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 600;
    opacity: .75;
    margin-bottom: 10px;
}
.cleafs-wallet .cw-hero-amount {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.cleafs-wallet .cw-hero-amount small { font-size: 22px; font-weight: 500; opacity: .7; }
.cleafs-wallet .cw-hero-sub { font-size: 13px; opacity: .7; margin-top: 12px; max-width: 360px; line-height: 1.55; }
.cleafs-wallet .cw-hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

.cleafs-wallet .cw-hero-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--cw-r-lg);
    padding: 20px;
    backdrop-filter: blur(8px);
}
.cleafs-wallet .cw-hero-meta-item { padding: 4px 0; }
.cleafs-wallet .cw-hero-meta-label {
    font-size: 10px;
    opacity: .6;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.cleafs-wallet .cw-hero-meta-value {
    font-size: 20px;
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: -0.01em;
    color: #fff;
}
.cleafs-wallet .cw-hero-meta-hint { font-size: 11px; opacity: .6; margin-top: 2px; }

/* === Wallet gauge (health bar) === */
.cleafs-wallet .cw-wallet-gauge { margin-top: 18px; max-width: 360px; }
.cleafs-wallet .cw-wallet-gauge-track {
    height: 8px;
    background: rgba(255,255,255,.14);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.cleafs-wallet .cw-wallet-gauge-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
    background: linear-gradient(90deg, #34d399, #10b981);
    box-shadow: 0 0 12px rgba(16,185,129,.5);
}
.cleafs-wallet .cw-wallet-gauge-critical .cw-wallet-gauge-fill {
    background: linear-gradient(90deg, #f87171, #ef4444);
    box-shadow: 0 0 12px rgba(239,68,68,.55);
}
.cleafs-wallet .cw-wallet-gauge-low .cw-wallet-gauge-fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 12px rgba(245,158,11,.5);
}
.cleafs-wallet .cw-wallet-gauge-medium .cw-wallet-gauge-fill {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 12px rgba(59,130,246,.5);
}
.cleafs-wallet .cw-wallet-gauge-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    opacity: .85;
}
.cleafs-wallet .cw-wallet-gauge-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #10b981;
}
.cleafs-wallet .cw-wallet-gauge-critical .cw-wallet-gauge-dot { background: #ef4444; }
.cleafs-wallet .cw-wallet-gauge-low .cw-wallet-gauge-dot { background: #f59e0b; }
.cleafs-wallet .cw-wallet-gauge-medium .cw-wallet-gauge-dot { background: #3b82f6; }
.cleafs-wallet .cw-wallet-gauge-label { font-weight: 600; }
.cleafs-wallet .cw-wallet-gauge-hint { opacity: .7; }

/* === Wallet alert banner === */
.cleafs-wallet .cw-wallet-alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--cw-r-lg);
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.cleafs-wallet .cw-wallet-alert-critical {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: #fecdd3;
    color: #881337;
}
.cleafs-wallet .cw-wallet-alert-low {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    color: #78350f;
}
.cleafs-wallet .cw-wallet-alert-icon { font-size: 22px; line-height: 1; }
.cleafs-wallet .cw-wallet-alert-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cleafs-wallet .cw-wallet-alert-body strong { font-size: 14px; font-weight: 700; }
.cleafs-wallet .cw-wallet-alert-body span { font-size: 13px; opacity: .85; line-height: 1.45; }
.cleafs-wallet .cw-wallet-alert .cw-btn { flex-shrink: 0; }
@media (max-width: 640px) {
    .cleafs-wallet .cw-wallet-alert { flex-wrap: wrap; }
    .cleafs-wallet .cw-wallet-alert .cw-btn { width: 100%; text-align: center; }
}

/* === Moje dane (profile tasks) === */
.cleafs-wallet .cw-profile-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--cw-r-xl);
    padding: 28px 32px;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(167,243,208,.25), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(59,130,246,.30), transparent 55%),
        linear-gradient(135deg, #0E2868 0%, #174a9a 60%, #1E5ABC 100%);
    box-shadow: var(--cw-shadow-lg);
    margin-bottom: 24px;
}
.cleafs-wallet .cw-profile-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
}
@media (max-width: 820px) {
    .cleafs-wallet .cw-profile-hero-grid { grid-template-columns: 1fr; gap: 24px; }
}

.cleafs-wallet .cw-profile-tasks { display: flex; flex-direction: column; gap: 10px; }
.cleafs-wallet .cw-profile-task {
    background: var(--cw-surface);
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-lg);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.cleafs-wallet .cw-profile-task:hover { border-color: #c7d2fe; }
.cleafs-wallet .cw-profile-task.is-complete {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #86efac;
}
.cleafs-wallet .cw-profile-task-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.cleafs-wallet .cw-profile-task-summary::-webkit-details-marker { display: none; }
.cleafs-wallet .cw-profile-task-summary::after {
    content: "›";
    font-size: 22px;
    color: var(--cw-muted);
    transition: transform .2s;
    margin-left: auto;
    line-height: 1;
}
.cleafs-wallet .cw-profile-task[open] .cw-profile-task-summary::after { transform: rotate(90deg); }
.cleafs-wallet .cw-profile-task-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59,130,246,.08);
    border-radius: 12px;
}
.cleafs-wallet .cw-profile-task.is-complete .cw-profile-task-icon {
    background: rgba(16,185,129,.14);
}
.cleafs-wallet .cw-profile-task-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cleafs-wallet .cw-profile-task-main strong { font-size: 15px; font-weight: 600; color: var(--cw-brand-ink); }
.cleafs-wallet .cw-profile-task-desc { font-size: 12.5px; color: var(--cw-muted); line-height: 1.4; }
.cleafs-wallet .cw-profile-task-status { flex-shrink: 0; }
.cleafs-wallet .cw-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.cleafs-wallet .cw-profile-badge-done {
    background: #10b981;
    color: #fff;
}
.cleafs-wallet .cw-profile-badge-reward {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    border: 1px solid #fcd34d;
}
.cleafs-wallet .cw-profile-badge-pending {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fde68a;
}
.cleafs-wallet .cw-profile-badge-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.cleafs-wallet .cw-profile-task.is-pending { border-color: #fcd34d; background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.cleafs-wallet .cw-profile-task.is-pending .cw-profile-task-icon { background: rgba(245,158,11,.14); }
.cleafs-wallet .cw-profile-task.is-rejected { border-color: #fecaca; background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); }
.cleafs-wallet .cw-profile-task.is-rejected .cw-profile-task-icon { background: rgba(239,68,68,.14); }

.cleafs-wallet .cw-profile-state-alert {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 8px;
}
.cleafs-wallet .cw-profile-state-alert strong { font-size: 13.5px; font-weight: 700; }
.cleafs-wallet .cw-profile-state-pending {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}
.cleafs-wallet .cw-profile-state-rejected {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.cleafs-wallet .cw-profile-state-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 12.5px;
}

.cleafs-wallet .cw-profile-task-form {
    padding: 8px 22px 22px 22px;
    border-top: 1px solid var(--cw-line);
    background: #fafbff;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cleafs-wallet .cw-profile-task.is-complete .cw-profile-task-form { background: rgba(255,255,255,.7); }
.cleafs-wallet .cw-profile-field { display: flex; flex-direction: column; gap: 6px; }
.cleafs-wallet .cw-profile-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-ink);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cleafs-wallet .cw-profile-field input[type="text"],
.cleafs-wallet .cw-profile-field input[type="email"],
.cleafs-wallet .cw-profile-field input[type="tel"],
.cleafs-wallet .cw-profile-field input[type="date"],
.cleafs-wallet .cw-profile-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    font-size: 14px;
    background: #fff;
    color: var(--cw-ink);
    transition: border-color .15s, box-shadow .15s;
}
.cleafs-wallet .cw-profile-field input:focus,
.cleafs-wallet .cw-profile-field select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.cleafs-wallet .cw-profile-check {
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
}
.cleafs-wallet .cw-profile-check input { width: 18px; height: 18px; accent-color: #3b82f6; }
.cleafs-wallet .cw-profile-help { color: var(--cw-muted); font-size: 12px; }
.cleafs-wallet .cw-profile-task-actions { margin-top: 6px; }

/* === Sklep punktów (rewards shop) === */
.cleafs-wallet .cw-shop-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--cw-light, #f0f2ff);
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    margin-bottom: 20px;
}
.cleafs-wallet .cw-shop-filter {
    padding: 8px 14px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
    background: transparent;
    color: var(--cw-brand-ink, #091a47);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: background .15s, color .15s;
}
.cleafs-wallet .cw-shop-filter:hover { background: #fff; }
.cleafs-wallet .cw-shop-filter.is-active {
    background: #0E2868;
    color: #fff;
}
.cleafs-wallet .cw-shop-balance-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--cw-line);
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-ink);
}
.cleafs-wallet .cw-shop-balance-pill strong { color: #0E2868; }
.cleafs-wallet .cw-shop-balance-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: linear-gradient(135deg, #FFDE65, #e6c84e);
}

.cleafs-wallet .cw-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.cleafs-wallet .cw-shop-card {
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cleafs-wallet .cw-shop-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cw-shadow-md);
    border-color: #0E2868;
}
.cleafs-wallet .cw-shop-card.is-unaffordable { opacity: .75; }
.cleafs-wallet .cw-shop-card.is-unaffordable:hover { transform: none; }

.cleafs-wallet .cw-shop-card-media {
    aspect-ratio: 16 / 10;
    position: relative;
    display: grid;
    place-items: center;
    background: repeating-linear-gradient(135deg, #eef2ff 0 8px, #fff 8px 16px);
}
.cleafs-wallet .cw-shop-card-media-coupon {
    background: repeating-linear-gradient(135deg, #fffaec 0 8px, #fffdf4 8px 16px);
}
.cleafs-wallet .cw-shop-card-media-booster,
.cleafs-wallet .cw-shop-card-media-other {
    background: repeating-linear-gradient(135deg, #eaf1ff 0 8px, #f5f9ff 8px 16px);
}
.cleafs-wallet .cw-shop-card-media-rank {
    background: repeating-linear-gradient(135deg, #fff5d1 0 8px, #fffaec 8px 16px);
}
.cleafs-wallet .cw-shop-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.cleafs-wallet .cw-shop-card-glyph {
    font-size: 52px;
    line-height: 1;
    opacity: .85;
    filter: drop-shadow(0 2px 6px rgba(14,40,104,.12));
}

.cleafs-wallet .cw-shop-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #FFDE65;
    color: #091a47;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 4px 9px;
    border-radius: 99px;
    text-transform: uppercase;
    z-index: 2;
}

.cleafs-wallet .cw-shop-card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.cleafs-wallet .cw-shop-card-kind {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--cw-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.cleafs-wallet .cw-shop-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.005em;
    line-height: 1.3;
    color: var(--cw-brand-ink, #091a47);
}
.cleafs-wallet .cw-shop-card-preview {
    font-size: 12.5px;
    font-weight: 600;
    color: #0E2868;
    margin-top: 2px;
}
.cleafs-wallet .cw-shop-card-desc {
    font-size: 12.5px;
    color: var(--cw-muted);
    line-height: 1.5;
    margin: 2px 0 0;
    flex: 1;
}
.cleafs-wallet .cw-shop-card-meta {
    font-size: 11px;
    color: var(--cw-muted);
    margin-top: 6px;
}
.cleafs-wallet .cw-shop-card-alert {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    line-height: 1.4;
}
.cleafs-wallet .cw-shop-card-alert-blocked {
    background: #fef2f2;
    color: #b42a2a;
    border: 1px solid #fecaca;
}

.cleafs-wallet .cw-shop-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--cw-line);
    background: #fdfdff;
    gap: 12px;
}
.cleafs-wallet .cw-shop-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.cleafs-wallet .cw-shop-price-val {
    font-size: 20px;
    font-weight: 700;
    color: #0E2868;
    letter-spacing: -0.01em;
}
.cleafs-wallet .cw-shop-price-unit {
    font-size: 11px;
    color: var(--cw-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cleafs-wallet .cw-shop-card.is-unaffordable .cw-shop-price-val { color: var(--cw-muted); }
.cleafs-wallet .cw-shop-card-form { margin: 0; }
.cleafs-wallet .cw-shop-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--cw-muted);
    background: var(--cw-light, #f0f2ff);
    border-radius: var(--cw-r-md);
    font-size: 14px;
}

/* Btn small variant */
.cleafs-wallet .cw-btn-sm {
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 10px;
}

/* === Shop redeem modal === */
.cleafs-wallet .cw-shop-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 26, 71, 0.55);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    z-index: 99999;
    padding: 16px;
    animation: cwShopFade .15s ease;
}
.cleafs-wallet .cw-shop-modal-backdrop[hidden] { display: none; }
@keyframes cwShopFade { from { opacity: 0; } to { opacity: 1; } }

.cleafs-wallet .cw-shop-modal {
    background: #fff;
    border-radius: var(--cw-r-xl, 24px);
    max-width: 520px;
    width: 100%;
    box-shadow: var(--cw-shadow-lg);
    overflow: hidden;
    animation: cwShopSlide .25s cubic-bezier(.2,.8,.2,1);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}
@keyframes cwShopSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.cleafs-wallet .cw-shop-modal-hero {
    padding: 28px 28px 20px;
    background: linear-gradient(135deg, #0E2868, #091a47);
    color: #fff;
    position: relative;
}
.cleafs-wallet .cw-shop-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    transition: background .15s;
}
.cleafs-wallet .cw-shop-modal-close:hover { background: rgba(255, 255, 255, 0.2); }
.cleafs-wallet .cw-shop-modal-kind {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .75;
}
.cleafs-wallet .cw-shop-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0 4px;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.2;
}
.cleafs-wallet .cw-shop-modal-sub {
    font-size: 13px;
    opacity: .75;
    margin: 0;
    line-height: 1.5;
}
.cleafs-wallet .cw-shop-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
}
.cleafs-wallet .cw-shop-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--cw-line);
    font-size: 13.5px;
    color: var(--cw-ink);
}
.cleafs-wallet .cw-shop-modal-row:last-of-type { border-bottom: none; }
.cleafs-wallet .cw-shop-modal-row strong { font-weight: 600; }
.cleafs-wallet .cw-shop-modal-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cleafs-wallet .cw-shop-modal-v-neg { color: #b42a2a; }
.cleafs-wallet .cw-shop-modal-v-brand { color: #0E2868; }
.cleafs-wallet .cw-shop-modal-row-total { padding-top: 16px; font-size: 15px; }
.cleafs-wallet .cw-shop-modal-row-total .cw-shop-modal-v { font-size: 20px; }
.cleafs-wallet .cw-shop-modal-note {
    font-size: 12px;
    color: var(--cw-muted);
    margin: 16px 0 0;
    line-height: 1.5;
}
.cleafs-wallet .cw-shop-modal-footer {
    padding: 20px 28px;
    background: var(--cw-light, #f0f2ff);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
@media (max-width: 520px) {
    .cleafs-wallet .cw-shop-modal-footer { flex-direction: column-reverse; }
    .cleafs-wallet .cw-shop-modal-footer .cw-btn { width: 100%; }
}

/* === Topup modal === */
.cleafs-wallet .cw-topup-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 26, 71, 0.55);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    z-index: 99999;
    padding: 16px;
    animation: cwTopupFade .15s ease;
}
.cleafs-wallet .cw-topup-modal-backdrop[hidden] { display: none; }
@keyframes cwTopupFade { from { opacity: 0; } to { opacity: 1; } }

.cleafs-wallet .cw-topup-modal {
    background: #fff;
    border-radius: var(--cw-r-xl, 24px);
    max-width: 560px;
    width: 100%;
    box-shadow: var(--cw-shadow-lg);
    overflow: hidden;
    animation: cwTopupSlide .25s cubic-bezier(.2,.8,.2,1);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}
@keyframes cwTopupSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.cleafs-wallet .cw-topup-modal-hero {
    padding: 28px 28px 20px;
    background: linear-gradient(135deg, #0E2868 0%, #174a9a 60%, #1E5ABC 100%);
    color: #fff;
    position: relative;
}
.cleafs-wallet .cw-topup-modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: background .15s !important;
    box-shadow: none !important;
}
.cleafs-wallet .cw-topup-modal-close:hover { background: rgba(255, 255, 255, 0.2) !important; }
.cleafs-wallet .cw-topup-modal-kind {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .75;
}
.cleafs-wallet .cw-topup-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 6px 0 4px;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.2;
}
.cleafs-wallet .cw-topup-modal-sub {
    font-size: 13px;
    opacity: .85;
    margin: 4px 0 0;
    line-height: 1.5;
}
.cleafs-wallet .cw-topup-modal-body {
    padding: 22px 24px 24px;
    overflow-y: auto;
}
.cleafs-wallet .cw-topup-variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.cleafs-wallet .cw-topup-variant {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 16px 18px;
    background: #fff;
    border: 2px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    color: var(--cw-ink);
    transition: transform .15s, border-color .15s, box-shadow .15s;
    position: relative;
    overflow: hidden;
}
.cleafs-wallet .cw-topup-variant:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: #0E2868;
    box-shadow: var(--cw-shadow-md);
}
.cleafs-wallet .cw-topup-variant:disabled {
    opacity: .6;
    cursor: wait;
}
.cleafs-wallet .cw-topup-variant-icon {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(14, 40, 104, .15));
}
.cleafs-wallet .cw-topup-variant-price {
    font-size: 20px;
    font-weight: 700;
    color: #0E2868;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.cleafs-wallet .cw-topup-variant-cta {
    font-size: 11.5px;
    font-weight: 600;
    color: #0E2868;
    opacity: 0;
    transition: opacity .15s;
}
.cleafs-wallet .cw-topup-variant:hover:not(:disabled) .cw-topup-variant-cta {
    opacity: 1;
}

/* Popularny wariant — złota ramka + badge */
.cleafs-wallet .cw-topup-variant.is-popular {
    border-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 60%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, .18);
    /* Miejsce na badge pod krawędzią */
    padding-top: 38px;
}
.cleafs-wallet .cw-topup-variant.is-popular:hover:not(:disabled) {
    border-color: #d97706;
    box-shadow: 0 8px 24px rgba(245, 158, 11, .28);
}
.cleafs-wallet .cw-topup-variant.is-popular .cw-topup-variant-price {
    color: #78350f;
}
.cleafs-wallet .cw-topup-variant-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 5px 6px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #451a03;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cleafs-wallet .cw-topup-modal-note {
    margin: 18px 0 0;
    padding: 12px 14px;
    background: #f0f2ff;
    border-radius: var(--cw-r-md);
    font-size: 12.5px;
    color: var(--cw-muted);
    line-height: 1.5;
}
@media (max-width: 480px) {
    .cleafs-wallet .cw-topup-variants-grid { grid-template-columns: 1fr 1fr; }
}

/* === Polecaj znajomego (referrals) === */
.cleafs-wallet .cw-referral-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--cw-r-xl);
    padding: 32px 36px;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255,222,101,.28), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(16,185,129,.28), transparent 55%),
        linear-gradient(135deg, #0E2868 0%, #174a9a 60%, #1E5ABC 100%);
    box-shadow: var(--cw-shadow-lg);
    margin-bottom: 24px;
}
.cleafs-wallet .cw-referral-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 820px) {
    .cleafs-wallet .cw-referral-hero-grid { grid-template-columns: 1fr; gap: 24px; }
}

.cleafs-wallet .cw-referral-code-box,
.cleafs-wallet .cw-referral-link-box {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--cw-r-md);
    padding: 6px;
    backdrop-filter: blur(6px);
}
.cleafs-wallet .cw-referral-code {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .06em;
    color: #FFDE65;
    background: rgba(0,0,0,.2);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}
.cleafs-wallet .cw-referral-link-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    color: #fff;
    background: rgba(0,0,0,.2);
    border: none;
    border-radius: 8px;
    min-width: 0;
    text-overflow: ellipsis;
}
.cleafs-wallet .cw-referral-link-input:focus {
    outline: none;
    background: rgba(0,0,0,.3);
}
.cleafs-wallet .cw-referral-code-box .cw-btn,
.cleafs-wallet .cw-referral-link-box .cw-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.cleafs-wallet .cw-referral-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.cleafs-wallet .cw-referral-share-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--cw-surface, #fff);
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-lg);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: var(--cw-brand-ink, #091a47);
    font-family: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cleafs-wallet .cw-referral-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--cw-shadow-md);
    border-color: #0E2868;
    text-decoration: none;
}
.cleafs-wallet .cw-referral-share-btn strong {
    font-size: 14.5px;
    font-weight: 700;
}
.cleafs-wallet .cw-referral-share-btn small {
    font-size: 12px;
    color: var(--cw-muted);
    font-weight: 500;
}
.cleafs-wallet .cw-referral-share-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 4px;
}

.cleafs-wallet .cw-referral-share-whatsapp {
    border-left: 4px solid #25D366;
}
.cleafs-wallet .cw-referral-share-whatsapp:hover { border-color: #25D366; }
.cleafs-wallet .cw-referral-share-messenger {
    border-left: 4px solid #0084FF;
}
.cleafs-wallet .cw-referral-share-messenger:hover { border-color: #0084FF; }
.cleafs-wallet .cw-referral-share-email {
    border-left: 4px solid #f59e0b;
}
.cleafs-wallet .cw-referral-share-email:hover { border-color: #f59e0b; }
.cleafs-wallet .cw-referral-share-copy {
    border-left: 4px solid #6366f1;
}
.cleafs-wallet .cw-referral-share-copy:hover { border-color: #6366f1; }

/* === Currency chips === */
.cleafs-wallet .cw-balance-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 24px 0 0;
}
.cleafs-wallet .cw-balance-chip {
    background: var(--cw-surface);
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cleafs-wallet .cw-balance-chip-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--cw-muted);
    letter-spacing: .08em;
}
.cleafs-wallet .cw-balance-chip-val {
    font-size: 18px;
    font-weight: 600;
    color: var(--cw-brand-ink);
    font-variant-numeric: tabular-nums;
}
.cleafs-wallet .cw-balance-chip-val.neg { color: var(--cw-neg); }

/* === Section title === */
.cleafs-wallet .cw-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 36px 0 16px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cleafs-wallet .cw-section-title small {
    font-size: 12px;
    font-weight: 500;
    color: var(--cw-muted);
    margin-left: auto;
}

/* === Ledger table === */
.cleafs-wallet .cw-ledger { width: 100%; border-collapse: collapse; }
.cleafs-wallet .cw-ledger th {
    text-align: left;
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cw-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--cw-light);
    border-bottom: 1px solid var(--cw-line);
}
.cleafs-wallet .cw-ledger td {
    padding: 16px 20px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--cw-line);
    vertical-align: top;
    color: var(--cw-ink);
}
.cleafs-wallet .cw-ledger tr:last-child td { border-bottom: none; }
.cleafs-wallet .cw-ledger tr:hover td { background: #fafbff; }
.cleafs-wallet .cw-ledger .cw-date { color: var(--cw-muted); font-size: 12.5px; white-space: nowrap; }
.cleafs-wallet .cw-ledger .cw-amount { font-weight: 700; font-size: 14.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cleafs-wallet .cw-ledger .cw-amount.pos { color: var(--cw-pos); }
.cleafs-wallet .cw-ledger .cw-amount.neg { color: var(--cw-neg); }
.cleafs-wallet .cw-ledger .cw-note { color: var(--cw-muted); font-size: 12px; display: block; margin-top: 2px; }

/* === Reason pills === */
.cleafs-wallet .cw-reason-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    background: var(--cw-light);
    color: var(--cw-brand);
}
.cleafs-wallet .cw-reason-pill.refund { background: #fef3f3; color: var(--cw-neg); }
.cleafs-wallet .cw-reason-pill.topup { background: #ecfdf5; color: var(--cw-pos); }
.cleafs-wallet .cw-reason-pill.purchase { background: #fffaec; color: #8a6400; }
.cleafs-wallet .cw-reason-pill.cashback { background: #eef2ff; color: var(--cw-brand); }
.cleafs-wallet .cw-reason-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* === Rank hero (Punkty Promowania) === */
.cleafs-wallet .cw-rank-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--cw-r-xl);
    padding: 36px;
    background:
        radial-gradient(80% 100% at 100% 0%, rgba(255,222,101,.3), transparent 55%),
        linear-gradient(135deg, #0E2868 0%, #091a47 100%);
    color: #fff;
    box-shadow: var(--cw-shadow-lg);
}
.cleafs-wallet .cw-rank-hero-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 36px;
    align-items: center;
}
@media (max-width: 720px) {
    .cleafs-wallet .cw-rank-hero-grid { grid-template-columns: 1fr; }
}
.cleafs-wallet .cw-medal { width: 140px; height: 140px; flex-shrink: 0; }
.cleafs-wallet .cw-points-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--cw-accent);
    color: var(--cw-brand-ink);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.cleafs-wallet .cw-rank-name { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin: 10px 0 8px; color: #fff; }
.cleafs-wallet .cw-rank-cashback { font-size: 13px; opacity: .8; }
.cleafs-wallet .cw-rank-cashback strong { color: var(--cw-accent); font-weight: 700; }

.cleafs-wallet .cw-progress-wrap { margin-top: 24px; }
.cleafs-wallet .cw-progress-meta { display: flex; justify-content: space-between; font-size: 12px; opacity: .75; margin-bottom: 8px; }
.cleafs-wallet .cw-progress-meta strong { opacity: 1; font-weight: 600; }
.cleafs-wallet .cw-progress-bar { height: 12px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; position: relative; }
.cleafs-wallet .cw-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--cw-accent) 0%, #ffe890 100%);
    box-shadow: 0 0 20px rgba(255,222,101,.4);
    transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.cleafs-wallet .cw-progress-to-next { font-size: 13px; margin-top: 10px; opacity: .85; }
.cleafs-wallet .cw-progress-to-next strong { color: var(--cw-accent); font-weight: 700; }

/* Rank ladder */
.cleafs-wallet .cw-ladder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.cleafs-wallet .cw-ladder-step {
    background: var(--cw-surface);
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    padding: 16px 14px;
    text-align: center;
    position: relative;
    transition: all .2s ease;
}
.cleafs-wallet .cw-ladder-step.achieved { border-color: var(--cw-brand); background: linear-gradient(180deg, #fff, var(--cw-light)); }
.cleafs-wallet .cw-ladder-step.current { border-color: var(--cw-accent); background: #fffdf4; box-shadow: 0 0 0 4px rgba(255,222,101,.25); }
.cleafs-wallet .cw-ladder-medal { width: 56px; height: 56px; margin: 0 auto 8px; }
.cleafs-wallet .cw-ladder-name { font-size: 13px; font-weight: 600; color: var(--cw-brand-ink); }
.cleafs-wallet .cw-ladder-meta { font-size: 11px; color: var(--cw-muted); margin-top: 4px; }
.cleafs-wallet .cw-ladder-step.current .cw-ladder-meta { color: var(--cw-brand); font-weight: 600; }
.cleafs-wallet .cw-ladder-lock { opacity: .5; }
.cleafs-wallet .cw-ladder-lock .cw-ladder-medal { filter: grayscale(1) opacity(.6); }

/* === Expiry alert === */
.cleafs-wallet .cw-expiry-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--cw-r-md);
    padding: 14px 18px;
    background: #fffaec;
    border: 1px solid #f3e4a8;
    color: #5a4400;
    font-size: 13px;
    margin-top: 24px;
}
.cleafs-wallet .cw-expiry-alert.urgent { background: #fdf0f0; border-color: #f3c2c2; color: #7a1e1f; }

/* === Earn Points (missions) === */
.cleafs-wallet .cw-earn-hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 20px;
    margin-bottom: 28px;
}
@media (max-width: 900px) { .cleafs-wallet .cw-earn-hero { grid-template-columns: 1fr; } }
.cleafs-wallet .cw-earn-hero-card {
    background: linear-gradient(135deg, #0E2868 0%, #1d3c87 100%);
    color: #fff;
    border-radius: var(--cw-r-lg);
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}
.cleafs-wallet .cw-earn-hero-card::before {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255,222,101,.35), transparent 70%);
    pointer-events: none;
}
.cleafs-wallet .cw-earn-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .7;
    margin-bottom: 10px;
}
.cleafs-wallet .cw-earn-hero-stat {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: #fff;
}
.cleafs-wallet .cw-earn-hero-stat small { font-size: 14px; font-weight: 500; opacity: .75; letter-spacing: 0; }
.cleafs-wallet .cw-earn-hero-sub { font-size: 13.5px; opacity: .85; margin-top: 12px; max-width: 380px; line-height: 1.5; }

.cleafs-wallet .cw-earn-kpis { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.cleafs-wallet .cw-earn-kpi {
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.cleafs-wallet .cw-earn-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--cw-light);
    color: var(--cw-brand);
    font-weight: 700;
    font-size: 18px;
}
.cleafs-wallet .cw-earn-kpi-icon.accent { background: #fff5d1; color: #7a5d00; }
.cleafs-wallet .cw-earn-kpi-val { font-size: 24px; font-weight: 700; line-height: 1; color: var(--cw-brand-ink); font-variant-numeric: tabular-nums; }
.cleafs-wallet .cw-earn-kpi-val small { font-size: 12px; font-weight: 500; color: var(--cw-muted); margin-left: 4px; }
.cleafs-wallet .cw-earn-kpi-lab { font-size: 12px; color: var(--cw-muted); margin-top: 4px; }

.cleafs-wallet .cw-earn-group { margin-bottom: 32px; }
.cleafs-wallet .cw-earn-group-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.cleafs-wallet .cw-earn-group-title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; color: var(--cw-brand-ink); }
.cleafs-wallet .cw-earn-group-hint { font-size: 12px; color: var(--cw-muted); }
.cleafs-wallet .cw-earn-group-count { margin-left: auto; font-size: 11px; color: var(--cw-muted); font-family: 'JetBrains Mono', monospace; }

/* Task list */
.cleafs-wallet .cw-task-list {
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md);
    /* overflow: visible — pozwala popoverom (manual_form, external_action details) wyjść poza box.
       `.cw-task-list { overflow:hidden }` wcześniej clippowało formularz i dlatego „etykieta
       pojawiała się pod boxem". Rogi zaokrąglamy explicit na first/last row. */
    overflow: visible;
}
.cleafs-wallet .cw-task-list > .cw-task-row:first-child {
    border-top-left-radius: var(--cw-r-md);
    border-top-right-radius: var(--cw-r-md);
}
.cleafs-wallet .cw-task-list > .cw-task-row:last-child {
    border-bottom-left-radius: var(--cw-r-md);
    border-bottom-right-radius: var(--cw-r-md);
}
/* Motywy typu Metamax ustawiają globalnie margin-top:15px dla button / input w kontekście
   My Account. Resetujemy wewnątrz kart misji, żeby „Odbierz" siedział w jednej linii
   z inputem kodu, a nie wisiał 15px niżej. */
.cleafs-wallet .cw-task-action .cw-task-btn,
.cleafs-wallet .cw-task-action button,
.cleafs-wallet .cw-task-action input,
.cleafs-wallet .cw-task-action textarea,
.cleafs-wallet .cw-task-action select,
.cleafs-wallet .cw-task-action form,
.cleafs-wallet .cw-task-action a.cw-task-btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Pojedynczy przycisk „Szczegóły" w kolumnie akcji — teraz jedyny CTA na karcie.
   Kliknięcie otwiera modal z pełnym opisem i właściwą akcją (claim/kod/link/formularz). */
.cleafs-wallet .cw-task-details-btn {
    min-width: 120px;
    justify-content: center;
}

/* === Progress bar na karcie misji (pod chipami) === */
.cleafs-wallet .cw-task-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    grid-column: 1 / -1;
}
.cleafs-wallet .cw-task-progress-bar {
    flex: 1;
    height: 8px;
    background: #e8ebf3;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.cleafs-wallet .cw-task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cw-brand, #0E2868) 0%, var(--cw-accent, #FFD54A) 100%);
    border-radius: 999px;
    transition: width .4s cubic-bezier(.2, .8, .2, 1);
}
.cleafs-wallet .cw-task-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* === Progress bar w modalu (większy, z labelem) === */
.cleafs-wallet .cw-mission-modal-progress {
    background: #f5f7ff;
    border: 1px solid #cfd9ff;
    border-radius: var(--cw-r-md, 12px);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.cleafs-wallet .cw-mission-modal-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 13px;
}
.cleafs-wallet .cw-mission-modal-progress-head strong {
    color: var(--cw-ink);
    font-weight: 600;
    font-size: 13px;
}
.cleafs-wallet .cw-mission-modal-progress-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--cw-brand);
    font-variant-numeric: tabular-nums;
}
.cleafs-wallet .cw-mission-modal-progress-bar {
    height: 12px;
    background: rgba(14, 40, 104, 0.1);
    border-radius: 999px;
    overflow: hidden;
}
.cleafs-wallet .cw-mission-modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cw-brand) 0%, var(--cw-accent) 100%);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.cleafs-wallet .cw-mission-modal-progress-hint {
    font-size: 12px;
    color: var(--cw-muted);
    margin: 8px 0 0;
}

/* === Newsletter signup form === */
.cw-newsletter-signup {
    background: linear-gradient(135deg, #f5f7ff 0%, #fff 100%);
    border: 1px solid #cfd9ff;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}
.cw-newsletter-heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #0E2868;
}
.cw-newsletter-desc {
    font-size: 14px;
    color: #555;
    margin: 0 0 16px;
}
.cw-newsletter-form { margin: 0; }
.cw-newsletter-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cw-newsletter-input-group input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border: 1px solid #cfd9ff;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}
.cw-newsletter-input-group input[type="email"]:focus {
    outline: none;
    border-color: #0E2868;
    box-shadow: 0 0 0 3px rgba(14, 40, 104, 0.1);
}
.cw-newsletter-btn {
    background: #0E2868;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background .15s;
}
.cw-newsletter-btn:hover { background: #1a3a82; }
.cw-newsletter-consent {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    cursor: pointer;
}
.cw-newsletter-consent input { margin-top: 3px; flex-shrink: 0; }
.cw-newsletter-bonus {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: #fef3c7;
    border-radius: 6px;
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
}
.cw-newsletter-flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.cw-newsletter-flash.is-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.cw-newsletter-flash.is-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.cw-newsletter-flash.is-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* === Missions toolbar — zakładki + sortowanie === */
.cleafs-wallet .cw-missions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 8px 0 20px;
    flex-wrap: wrap;
}
.cleafs-wallet .cw-missions-tabs {
    display: flex;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-md, 12px);
    padding: 4px;
}
.cleafs-wallet .cw-missions-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--cw-r-sm, 8px);
    color: var(--cw-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background .15s, color .15s;
}
.cleafs-wallet .cw-missions-tab:hover {
    background: #f5f7ff;
    color: var(--cw-brand);
}
.cleafs-wallet .cw-missions-tab.is-active {
    background: var(--cw-brand, #0E2868);
    color: #fff;
}
.cleafs-wallet .cw-missions-tab-count {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.cleafs-wallet .cw-missions-tab.is-active .cw-missions-tab-count {
    background: rgba(255, 255, 255, 0.25);
}
.cleafs-wallet .cw-missions-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cleafs-wallet .cw-missions-sort-label {
    font-size: 13px;
    color: var(--cw-muted);
    font-weight: 600;
}
.cleafs-wallet .cw-missions-sort select {
    padding: 8px 28px 8px 12px !important;
    border: 1px solid var(--cw-line) !important;
    border-radius: var(--cw-r-sm, 8px) !important;
    background: #fff !important;
    font-size: 13px !important;
    font-weight: 600;
    cursor: pointer;
    margin: 0 !important;
}
.cleafs-wallet .cw-missions-empty {
    text-align: center;
    padding: 48px 24px;
}
.cleafs-wallet .cw-missions-empty strong {
    display: block;
    font-size: 16px;
    color: var(--cw-brand-ink);
    margin-bottom: 6px;
}
.cleafs-wallet .cw-missions-empty p {
    color: var(--cw-muted);
    font-size: 14px;
    margin: 0;
}

/* Dismiss w modalu */
.cleafs-wallet .cw-mission-modal-dismiss {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--cw-line);
}
.cleafs-wallet .cw-missions-dismiss-btn {
    color: var(--cw-muted) !important;
    font-size: 12px !important;
    background: transparent !important;
    border: none !important;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 0 !important;
}
.cleafs-wallet .cw-missions-dismiss-btn:hover {
    color: var(--cw-neg, #b42a2a) !important;
}

/* Odróżnienie karty w zakładce Odrzucone — przytłumiona */
.cleafs-wallet [data-cw-missions-root] .cw-task-row.cw-task-row-dismissed {
    opacity: 0.78;
    background: #fafbfc;
}

/* === Misja wyróżniona — admin-pinned „PRIORYTET" ===
   Baner jest full-width children gridu (grid-column: 1 / -1) — zajmuje swój wiersz
   u góry karty, nie pływa absolute-nie, więc nie zaburza reszty grida (checkbox,
   ikona, akcje). Karta ma złote obramowanie i gradient. */
.cleafs-wallet .cw-task-row.cw-task-row-featured {
    background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 100%);
    border: 2px solid var(--cw-accent, #FFD54A);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
    border-radius: var(--cw-r-md, 12px);
    /* Bez `margin: 10px 0` — wcześniej powodowało przesunięcie ramki względem
       sąsiednich wierszy listy (regular `.cw-task-row` używa `border-bottom`
       jako separator, nie margin). Featured wyróżnia się gradient/border/shadow
       — vertical spacing nie jest potrzebny żeby był wizualnie odróżniony. */
    row-gap: 0;
}
.cleafs-wallet .cw-task-row.cw-task-row-featured:hover {
    background: linear-gradient(135deg, #fff9e6 0%, #fef2cc 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
}
.cleafs-wallet .cw-task-featured-banner {
    grid-column: 1 / -1;
    margin: -4px 0 6px -8px;
    background: linear-gradient(135deg, var(--cw-accent, #FFD54A) 0%, #f59e0b 100%);
    color: var(--cw-brand-ink, #0E2868);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 4px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    width: fit-content;
    justify-self: start;
}
.cleafs-wallet .cw-task-row.cw-task-row-featured .cw-task-title {
    color: var(--cw-brand-ink);
    font-weight: 700;
}

/* === Evolving badge (tiered loyalty) — chip z numerem roku i drabinka tierów === */
.cleafs-wallet .cw-badge-card-v2 .cw-badge-card-medal {
    position: relative;
}
.cleafs-wallet .cw-badge-tier-chip {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, var(--cw-accent) 0%, #f59e0b 100%);
    color: var(--cw-brand-ink);
    font-size: 11px;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    border: 2px solid #fff;
    line-height: 1;
}
.cleafs-wallet .cw-badge-card-v2.is-evolving.is-unlocked .cw-badge-card-emoji {
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

.cleafs-wallet .cw-badge-tier-ladder {
    display: flex;
    gap: 6px;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}
.cleafs-wallet .cw-badge-tier-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-radius: var(--cw-r-sm, 8px);
    border: 1px solid var(--cw-line);
    background: #fff;
    min-width: 50px;
    position: relative;
    transition: transform .15s, box-shadow .15s;
}
.cleafs-wallet .cw-badge-tier-step:hover { transform: translateY(-1px); }
.cleafs-wallet .cw-badge-tier-emoji {
    font-size: 18px;
    line-height: 1;
}
.cleafs-wallet .cw-badge-tier-years {
    font-size: 11px;
    font-weight: 700;
    color: var(--cw-brand-ink);
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-variant-numeric: tabular-nums;
}
.cleafs-wallet .cw-badge-tier-years small {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--cw-muted);
}
.cleafs-wallet .cw-badge-tier-step.cw-badge-tier-reached {
    background: linear-gradient(135deg, #fff7e6 0%, #fef2cc 100%);
    border-color: var(--cw-accent);
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}
.cleafs-wallet .cw-badge-tier-step.cw-badge-tier-future {
    opacity: 0.5;
    filter: grayscale(0.4);
}
.cleafs-wallet .cw-badge-tier-step.cw-badge-tier-locked {
    opacity: 0.35;
    filter: grayscale(0.8);
}
.cleafs-wallet .cw-badge-tier-check {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #10b981;
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid #fff;
}

/* === Licznik znaków pod textarea z minimum === */
.cleafs-wallet .cw-char-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 4px;
    padding: 4px 0;
}
.cleafs-wallet .cw-char-counter-bar {
    flex: 1;
    height: 6px;
    background: #e8ebf3;
    border-radius: 999px;
    overflow: hidden;
    min-width: 80px;
}
.cleafs-wallet .cw-char-counter-fill {
    display: block;
    height: 100%;
    background: #ef4444; /* domyślnie czerwony = nie osiągnięte */
    border-radius: 999px;
    transition: width .25s ease, background .2s;
}
.cleafs-wallet .cw-char-counter.is-met .cw-char-counter-fill {
    background: #10b981; /* zielony = spełnione */
}
.cleafs-wallet .cw-char-counter-text {
    font-size: 12px;
    color: var(--cw-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
}
.cleafs-wallet .cw-char-counter.is-met .cw-char-counter-text {
    color: #065f46;
}
.cleafs-wallet .cw-char-counter.is-low .cw-char-counter-text {
    color: #b42a2a;
}

/* Button w stanie disabled gdy min-length nie osiągnięte */
.cleafs-wallet .cw-btn[data-cw-minlen-submit][disabled],
.cleafs-wallet button[data-cw-minlen-submit][disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.3);
    pointer-events: none;
}

/* === Zgłoszenie pomysłu — banner z dwoma nagrodami === */
.cleafs-wallet .cw-idea-reward-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff7e6 0%, #fef2cc 100%);
    border: 1px solid #fcd663;
    border-radius: var(--cw-r-md, 12px);
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--cw-ink);
}
.cleafs-wallet .cw-idea-reward-banner strong { color: #92400e; font-weight: 700; }
@media (max-width: 520px) {
    .cleafs-wallet .cw-idea-reward-banner { grid-template-columns: 1fr; gap: 8px; }
}

/* === Ankieta (survey) — opcje wyboru === */
.cleafs-wallet .cw-survey-question {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--cw-line);
}
.cleafs-wallet .cw-survey-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.cleafs-wallet .cw-survey-opts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}
.cleafs-wallet .cw-survey-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-sm, 8px);
    cursor: pointer;
    transition: background .12s, border-color .12s;
    font-size: 14px;
}
.cleafs-wallet .cw-survey-opt:hover {
    background: #f5f7ff;
    border-color: #cfd9ff;
}
.cleafs-wallet .cw-survey-opt input {
    margin: 0 !important;
    accent-color: var(--cw-brand);
}
.cleafs-wallet .cw-survey-opt input:checked ~ span {
    font-weight: 600;
    color: var(--cw-brand);
}
.cleafs-wallet .cw-survey-rating {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.cleafs-wallet .cw-survey-rating-opt {
    flex: 1 1 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-sm, 8px);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background .12s, border-color .12s, color .12s;
}
.cleafs-wallet .cw-survey-rating-opt:hover {
    background: #fffbeb;
    border-color: var(--cw-accent);
}
.cleafs-wallet .cw-survey-rating-opt input {
    margin: 0 !important;
    accent-color: var(--cw-accent);
}

/* === Modal „Szczegóły" — styled inside === */
.cleafs-wallet .cw-mission-modal-action {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--cw-line);
}
.cleafs-wallet .cw-mission-modal-action:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.cleafs-wallet .cw-mission-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cleafs-wallet .cw-mission-modal-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-muted);
    margin: 4px 0 -4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cleafs-wallet .cw-mission-modal-req { color: var(--cw-neg, #b42a2a); margin-left: 2px; }
.cleafs-wallet .cw-mission-modal-input {
    width: 100%;
    padding: 10px 12px !important;
    border: 1px solid var(--cw-line) !important;
    border-radius: var(--cw-r-sm, 8px) !important;
    font-size: 14px !important;
    margin: 0 !important;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}
.cleafs-wallet .cw-mission-modal-input:focus {
    outline: none;
    border-color: var(--cw-brand) !important;
    box-shadow: 0 0 0 3px rgba(14, 40, 104, 0.1);
}
.cleafs-wallet .cw-mission-modal-hint {
    font-size: 13px;
    color: var(--cw-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}
.cleafs-wallet .cw-btn-block {
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px !important;
    font-size: 14px !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}

/* Statusy (done / pending / exhausted / auto) — kolorowe bloki zamiast buttonów. */
.cleafs-wallet .cw-mission-modal-status {
    padding: 14px 16px;
    border-radius: var(--cw-r-md, 12px);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.5;
}
.cleafs-wallet .cw-mission-modal-status-done {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.cleafs-wallet .cw-mission-modal-status-pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.cleafs-wallet .cw-mission-modal-status-muted {
    background: #f3f4f6;
    color: var(--cw-muted);
    border: 1px solid var(--cw-line);
}
.cleafs-wallet .cw-mission-modal-status-auto {
    background: #eff6ff;
    color: var(--cw-brand);
    border: 1px solid #bfdbfe;
    font-weight: 500;
}

/* Długi opis w modalu — przestrzeń na HTML: nagłówki, listy, linki. */
.cleafs-wallet .cw-mission-modal-body {
    padding: 24px 28px 12px;
}
.cleafs-wallet .cw-mission-modal-long {
    font-size: 14px;
    line-height: 1.65;
    color: var(--cw-ink);
}
.cleafs-wallet .cw-mission-modal-long p { margin: 0 0 12px; }
.cleafs-wallet .cw-mission-modal-long p:last-child { margin-bottom: 0; }
.cleafs-wallet .cw-mission-modal-long ul,
.cleafs-wallet .cw-mission-modal-long ol {
    margin: 0 0 12px 20px;
    padding: 0;
}
.cleafs-wallet .cw-mission-modal-long li { margin: 4px 0; }
.cleafs-wallet .cw-mission-modal-long strong { color: var(--cw-brand); }
.cleafs-wallet .cw-mission-modal-long a {
    color: var(--cw-brand);
    text-decoration: underline;
}
.cleafs-wallet .cw-task-row {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cw-line);
    transition: background .15s ease;
}
.cleafs-wallet .cw-task-row:last-child { border-bottom: none; }
.cleafs-wallet .cw-task-row:hover { background: #fafbfd; }
.cleafs-wallet .cw-task-row.done { background: #f7fbf8; }
.cleafs-wallet .cw-task-row.locked { opacity: .55; }

.cleafs-wallet .cw-task-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--cw-line);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: transparent;
    background: #fff;
    /* Emoji (np. ⏳) potrafi wyjść poza 28px bo fonty emoji mają większe
       glyph-metrics niż font-size. Ograniczamy explicit + overflow:hidden,
       żeby klepsydra zawsze mieściła się w kółku. */
    font-size: 13px;
    line-height: 1;
    overflow: hidden;
}
.cleafs-wallet .cw-task-row.done .cw-task-check { background: #2d9d63; border-color: #2d9d63; color: #fff; }
.cleafs-wallet .cw-task-row.claim .cw-task-check { background: var(--cw-accent); border-color: var(--cw-accent); color: var(--cw-brand-ink); }
.cleafs-wallet .cw-task-row.inprogress .cw-task-check { border-color: var(--cw-brand); border-style: dashed; }

.cleafs-wallet .cw-task-main { min-width: 0; }
.cleafs-wallet .cw-task-title { font-size: 14px; font-weight: 600; color: var(--cw-brand-ink); margin: 0 0 3px; letter-spacing: -0.005em; }
.cleafs-wallet .cw-task-row.done .cw-task-title { color: var(--cw-muted); text-decoration: line-through; text-decoration-color: #c9d0dd; }
.cleafs-wallet .cw-task-desc { font-size: 12px; color: var(--cw-muted); line-height: 1.45; margin: 0; }
.cleafs-wallet .cw-task-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cleafs-wallet .cw-task-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cw-muted);
    padding: 3px 8px;
    border-radius: 999px;
    background: #f0f3f8;
    border: 1px solid var(--cw-line);
}
.cleafs-wallet .cw-task-chip.once { background: #e8eefe; border-color: #d4ddfc; color: #2a4cb5; }
.cleafs-wallet .cw-task-chip.month { background: #fffaec; border-color: #f7e8b3; color: #7a5d00; }
.cleafs-wallet .cw-task-chip.repeat { background: #eefbf2; border-color: #c9ead6; color: #2d7a4e; }
.cleafs-wallet .cw-task-chip.year { background: #fdeee8; border-color: #f9d4c3; color: #a24628; }
.cleafs-wallet .cw-task-chip.quarter { background: #eef0fb; border-color: #d7dbf4; color: #3d3b85; }

.cleafs-wallet .cw-task-reward {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 96px;
    text-align: right;
}
.cleafs-wallet .cw-task-reward-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--cw-brand-ink);
    letter-spacing: -0.01em;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}
.cleafs-wallet .cw-task-reward-val::before { content: "+"; color: #2d9d63; font-size: 14px; }
.cleafs-wallet .cw-task-reward-lab { font-size: 10.5px; color: var(--cw-muted); font-weight: 500; }

.cleafs-wallet .cw-task-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 120px; }
.cleafs-wallet .cw-task-btn {
    padding: 7px 14px;
    border-radius: var(--cw-r-sm);
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--cw-line);
    background: #fff;
    color: var(--cw-brand-ink);
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
}
.cleafs-wallet .cw-task-btn:hover { border-color: var(--cw-brand); color: var(--cw-brand); }
.cleafs-wallet .cw-task-btn.primary { background: var(--cw-accent); border-color: var(--cw-accent); color: var(--cw-brand-ink); }
.cleafs-wallet .cw-task-btn.primary:hover { background: #f3d24a; border-color: #f3d24a; color: var(--cw-brand-ink); }
.cleafs-wallet .cw-task-btn.done-badge { background: transparent; border-color: transparent; color: #2d9d63; cursor: default; }

@media (max-width: 720px) {
    .cleafs-wallet .cw-task-row { grid-template-columns: 28px 1fr; gap: 10px; }
    .cleafs-wallet .cw-task-reward,
    .cleafs-wallet .cw-task-action { grid-column: 2; align-items: flex-start; min-width: 0; }
    .cleafs-wallet .cw-task-reward { flex-direction: row; align-items: baseline; gap: 6px; }
}

/* === Benefits (Korzyści) === */
.cleafs-wallet .cw-benefits-card {
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-lg);
    box-shadow: var(--cw-shadow-sm);
    overflow: hidden;
}
.cleafs-wallet .cw-benefits-scroll { overflow-x: auto; }
.cleafs-wallet .cw-benefits-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}
.cleafs-wallet .cw-benefits-table thead th {
    background: var(--cw-brand);
    color: #fff;
    padding: 18px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    vertical-align: top;
    border-right: 1px solid rgba(255,255,255,.08);
}
.cleafs-wallet .cw-benefits-table thead th:last-child { border-right: none; }
.cleafs-wallet .cw-benefits-table thead th.bt-label { text-align: left; padding-left: 20px; }
.cleafs-wallet .cw-benefits-table thead th.current {
    background: linear-gradient(180deg, var(--cw-brand) 0%, var(--cw-brand-ink) 100%);
    box-shadow: inset 0 -3px 0 var(--cw-accent);
}
.cleafs-wallet .cw-bt-rank-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.cleafs-wallet .cw-bt-rank-you {
    font-size: 10px;
    font-weight: 700;
    color: var(--cw-brand-ink);
    background: var(--cw-accent);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cleafs-wallet .cw-benefits-table tbody td {
    padding: 16px 14px;
    text-align: center;
    font-size: 13.5px;
    color: var(--cw-ink);
    border-bottom: 1px solid var(--cw-line);
    background: #fff;
}
.cleafs-wallet .cw-benefits-table tbody tr:last-child td { border-bottom: none; }
.cleafs-wallet .cw-benefits-table tbody td.bt-label {
    text-align: left;
    padding-left: 20px;
    font-weight: 600;
    color: var(--cw-brand-ink);
    background: var(--cw-light);
    min-width: 220px;
}
.cleafs-wallet .cw-benefits-table tbody td.bt-current {
    background: #fffdf4;
    border-left: 1px solid rgba(230,200,78,.4);
    border-right: 1px solid rgba(230,200,78,.4);
    font-weight: 700;
    color: var(--cw-brand-ink);
}
.cleafs-wallet .cw-benefits-table tbody tr:last-child td.bt-current { box-shadow: inset 0 -3px 0 var(--cw-accent); }

/* === Tooltip „?" przy etykiecie korzyści === */
.cleafs-wallet .cw-bt-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #ABD4FF;
    color: #132A5F;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    user-select: none;
    transition: background 0.15s, transform 0.15s;
    position: relative;
    top: -1px;
}
.cleafs-wallet .cw-bt-tooltip:hover,
.cleafs-wallet .cw-bt-tooltip:focus {
    background: #132A5F;
    color: #fff;
    transform: scale(1.15);
    outline: none;
}
/* Floating tooltip — pozycjonowany przez JS (cleafs-wallet-frontend.js)
 * jako fixed div appendowany do <body>. Dzięki temu nie jest klipowany
 * przez `.cw-benefits-scroll` (overflow-x: auto wymusza też y-clipping).
 * Native `title` attribute zostaje jako fallback (a11y, screen readers). */
.cw-bt-tooltip-floating {
    position: fixed;
    background: #132A5F;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    width: max-content;
    max-width: min(320px, calc(100vw - 24px));
    box-shadow: 0 8px 24px rgba(19, 42, 95, 0.35);
    z-index: 99999;
    pointer-events: none;
    /* Animation: subtle fade-in */
    animation: cw-bt-tooltip-in 0.12s ease-out;
}

@keyframes cw-bt-tooltip-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile: większy padding + większy font dla touch UX */
@media (max-width: 600px) {
    .cw-bt-tooltip-floating {
        padding: 12px 16px;
        font-size: 14px;
        max-width: calc(100vw - 24px);
    }
}

/* === Flash notices === */
.cleafs-wallet .cw-notice {
    padding: 10px 14px;
    border-radius: var(--cw-r-md);
    margin-bottom: 16px;
    font-size: 13px;
}
.cleafs-wallet .cw-notice.success { background: #ecfdf5; border-left: 4px solid var(--cw-pos); color: #0c4027; }
.cleafs-wallet .cw-notice.error { background: #fef3f3; border-left: 4px solid var(--cw-neg); color: #5a1111; }

/* === JS-driven UI (toast, spinners, copy, inline errors) === */
.cw-toast-container {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 2147483647 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    pointer-events: none !important;
    font-family: 'Poppins', system-ui, sans-serif !important;
    max-width: 420px;
}
.cw-toast {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 24px 60px rgba(14,40,104,.2), 0 8px 20px rgba(14,40,104,.1) !important;
    padding: 14px 14px 14px 18px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #0b1630 !important;
    min-width: 280px !important;
    max-width: 400px !important;
    border-left: 4px solid #1f7a3a !important;
    transform: translateX(120%);
    opacity: 0;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .28s ease;
    pointer-events: auto;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}
.cw-toast--visible { transform: translateX(0) !important; opacity: 1 !important; }
.cw-toast--leaving { transform: translateX(120%) !important; opacity: 0 !important; }
.cw-toast--error { border-left-color: #b42a2a; background: #fff5f5; }
.cw-toast-msg { flex: 1; }
.cw-toast-close {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.cw-toast-close:hover { background: #f3f4f6; color: #0b1630; }

/* Spinner na przycisku aria-busy */
.cleafs-wallet button[aria-busy="true"] {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.cleafs-wallet button[aria-busy="true"]::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid var(--cw-brand-ink);
    border-top-color: transparent;
    border-radius: 50%;
    animation: cw-spin .7s linear infinite;
    opacity: .7;
}
@keyframes cw-spin { to { transform: rotate(360deg); } }

/* Inline error pod polem kod (secret_code) */
.cleafs-wallet .cw-inline-error {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--cw-neg);
    font-weight: 500;
    flex-basis: 100%;
}

/* Row transition when switching to done via AJAX */
.cleafs-wallet .cw-task-row {
    transition: background .3s ease;
}

/* Copy button (wrap around text) + tooltip */
.cleafs-wallet [data-cleafs-copy] {
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}
.cleafs-wallet [data-cleafs-copy]::after {
    content: "⧉";
    font-size: 10px;
    opacity: 0;
    transition: opacity .15s ease;
    color: var(--cw-muted);
}
.cleafs-wallet [data-cleafs-copy]:hover::after { opacity: .7; }
.cleafs-wallet .cw-copy-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--cw-brand);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 10;
}
.cleafs-wallet .cw-copy-tooltip::after {
    content: "";
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--cw-brand);
}
.cleafs-wallet .cw-copy-tooltip--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
 * PROGRAM LANDING PAGE (shortcode)
 * ============================================================ */
.cleafs-wallet.cw-program-landing {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}
.cleafs-wallet .cw-pl-hero {
    text-align: center;
    padding: 60px 20px 50px;
    background: linear-gradient(135deg, var(--cw-brand-soft, #e8edfa), var(--cw-surface, #fff));
    border-radius: 20px;
    margin-bottom: 50px;
}
.cleafs-wallet .cw-pl-hero h1 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--cw-brand, #0e2868);
}
.cleafs-wallet .cw-pl-lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--cw-muted);
    max-width: 720px;
    margin: 0 auto 32px;
}
.cleafs-wallet .cw-pl-cta .cw-btn-lg {
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
}
.cleafs-wallet .cw-pl-how,
.cleafs-wallet .cw-pl-ranks,
.cleafs-wallet .cw-pl-faq,
.cleafs-wallet .cw-pl-final-cta {
    margin-bottom: 64px;
}
.cleafs-wallet .cw-pl-how h2,
.cleafs-wallet .cw-pl-ranks h2,
.cleafs-wallet .cw-pl-faq h2,
.cleafs-wallet .cw-pl-final-cta h2 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 28px;
    text-align: center;
}
.cleafs-wallet .cw-pl-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.cleafs-wallet .cw-pl-step {
    padding: 32px 24px;
    background: var(--cw-surface, #fff);
    border: 1px solid var(--cw-border, #e5e9f2);
    border-radius: 14px;
    text-align: center;
}
.cleafs-wallet .cw-pl-step-num {
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 50%;
    background: var(--cw-brand, #0e2868);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 16px;
}
.cleafs-wallet .cw-pl-step h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}
.cleafs-wallet .cw-pl-step p {
    font-size: 14px;
    color: var(--cw-muted);
    margin: 0;
    line-height: 1.5;
}
.cleafs-wallet .cw-pl-ranks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.cleafs-wallet .cw-pl-rank {
    padding: 24px;
    background: var(--cw-surface, #fff);
    border: 1px solid var(--cw-border, #e5e9f2);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(14,40,104,0.04);
}
.cleafs-wallet .cw-pl-rank-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--cw-brand, #0e2868);
    margin-bottom: 4px;
}
.cleafs-wallet .cw-pl-rank-threshold {
    font-size: 12px;
    color: var(--cw-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}
.cleafs-wallet .cw-pl-rank-cashback {
    padding: 12px 0;
    border-top: 1px solid var(--cw-border, #e5e9f2);
    border-bottom: 1px solid var(--cw-border, #e5e9f2);
    margin-bottom: 12px;
    text-align: center;
}
.cleafs-wallet .cw-pl-rank-cashback strong {
    font-size: 32px;
    font-weight: 800;
    color: var(--cw-accent, #ffde65);
    -webkit-text-stroke: 1px var(--cw-brand, #0e2868);
    display: block;
}
.cleafs-wallet .cw-pl-rank-cashback span {
    font-size: 12px;
    color: var(--cw-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cleafs-wallet .cw-pl-rank-bonus,
.cleafs-wallet .cw-pl-rank-benefit {
    font-size: 13px;
    color: var(--cw-muted);
    padding: 4px 0;
    line-height: 1.45;
}
.cleafs-wallet .cw-pl-rank-benefit strong {
    color: var(--cw-text, #0b1640);
}
.cleafs-wallet .cw-pl-faq details {
    padding: 16px 20px;
    background: var(--cw-surface, #fff);
    border: 1px solid var(--cw-border, #e5e9f2);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}
.cleafs-wallet .cw-pl-faq summary {
    font-weight: 600;
    list-style: none;
    padding-right: 20px;
    position: relative;
}
.cleafs-wallet .cw-pl-faq summary::-webkit-details-marker { display: none; }
.cleafs-wallet .cw-pl-faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    font-size: 22px;
    color: var(--cw-muted);
    transition: transform 200ms ease;
}
.cleafs-wallet .cw-pl-faq details[open] summary::after {
    content: "−";
}
.cleafs-wallet .cw-pl-faq p {
    margin: 12px 0 0;
    color: var(--cw-muted);
    line-height: 1.6;
    font-size: 14px;
}
.cleafs-wallet .cw-pl-final-cta {
    text-align: center;
    padding: 50px 24px;
    background: var(--cw-brand, #0e2868);
    color: #fff;
    border-radius: 18px;
}
.cleafs-wallet .cw-pl-final-cta h2 { color: #fff; }
.cleafs-wallet .cw-pl-final-cta p {
    color: rgba(255,255,255,0.85);
    font-size: 16px;
    margin-bottom: 24px;
}

/* ============================================================
 * BADGES (shortcode)
 * ============================================================ */
.cleafs-wallet .cw-badges-wrap { margin: 20px 0; }
.cleafs-wallet .cw-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.cleafs-wallet .cw-badge-card {
    padding: 20px 16px;
    background: var(--cw-surface, #fff);
    border: 1px solid var(--cw-border, #e5e9f2);
    border-radius: 12px;
    text-align: center;
    transition: transform 150ms ease, box-shadow 150ms ease;
    position: relative;
}
.cleafs-wallet .cw-badge-unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14,40,104,0.08);
}
.cleafs-wallet .cw-badge-locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}
.cleafs-wallet .cw-badge-icon {
    margin-bottom: 10px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cleafs-wallet .cw-badge-emoji {
    font-size: 40px;
    line-height: 1;
}
.cleafs-wallet .cw-badge-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}
.cleafs-wallet .cw-badge-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--cw-brand, #0e2868);
    margin-bottom: 4px;
}
.cleafs-wallet .cw-badge-desc {
    font-size: 12px;
    color: var(--cw-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}
.cleafs-wallet .cw-badge-unlocked-at {
    font-size: 11px;
    color: var(--cw-success, #0f7d4a);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cleafs-wallet .cw-badge-progress {
    font-size: 11px;
    color: var(--cw-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================================
 * BADGES v2 — widok rozbudowany z hero, kategoriami, trigger hints
 * ============================================================ */
.cleafs-wallet .cw-badges-page { display: flex; flex-direction: column; }

.cleafs-wallet .cw-badges-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--cw-r-xl);
    padding: 32px 36px;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255,222,101,.28), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(124,58,237,.30), transparent 55%),
        linear-gradient(135deg, #0E2868 0%, #2d1b69 60%, #1E5ABC 100%);
    box-shadow: var(--cw-shadow-lg);
    margin-bottom: 20px;
}
.cleafs-wallet .cw-badges-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    align-items: center;
}
@media (max-width: 820px) {
    .cleafs-wallet .cw-badges-hero-grid { grid-template-columns: 1fr; gap: 24px; }
}

.cleafs-wallet .cw-badges-group-title {
    margin-top: 28px;
    margin-bottom: 16px;
}

.cleafs-wallet .cw-badges-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.cleafs-wallet .cw-badge-card-v2 {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: var(--cw-r-lg);
    overflow: hidden;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cleafs-wallet .cw-badge-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: var(--cw-shadow-md);
}

/* Unlocked — złocisty gradient */
.cleafs-wallet .cw-badge-card-v2.is-unlocked {
    border-color: #fbbf24;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 50%);
}
.cleafs-wallet .cw-badge-card-v2.is-unlocked .cw-badge-card-medal {
    background:
        radial-gradient(circle at 50% 40%, rgba(251,191,36,.35) 0%, transparent 60%),
        linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Locked — szary, wyciszony */
.cleafs-wallet .cw-badge-card-v2.is-locked {
    background: #fafbff;
    border-color: var(--cw-line);
}
.cleafs-wallet .cw-badge-card-v2.is-locked .cw-badge-card-medal {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}
.cleafs-wallet .cw-badge-card-v2.is-locked .cw-badge-card-emoji {
    filter: grayscale(0.85);
    opacity: .5;
}

.cleafs-wallet .cw-badge-card-medal {
    aspect-ratio: 1.4 / 1;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}
.cleafs-wallet .cw-badge-card-emoji {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(14,40,104,.18));
    transition: transform .2s;
}
.cleafs-wallet .cw-badge-card-v2:hover .cw-badge-card-emoji {
    transform: scale(1.1);
}
.cleafs-wallet .cw-badge-card-medal img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.cleafs-wallet .cw-badge-card-lock {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,.9);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.cleafs-wallet .cw-badge-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.cleafs-wallet .cw-badge-card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--cw-brand-ink, #091a47);
    letter-spacing: -0.005em;
    line-height: 1.3;
}
.cleafs-wallet .cw-badge-card-v2.is-locked .cw-badge-card-title {
    color: var(--cw-muted);
}
.cleafs-wallet .cw-badge-card-desc {
    font-size: 12.5px;
    color: var(--cw-muted);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}
.cleafs-wallet .cw-badge-card-status {
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    margin-top: 4px;
}
.cleafs-wallet .cw-badge-card-status-unlocked {
    background: #d1fae5;
    color: #065f46;
}
.cleafs-wallet .cw-badge-card-status-hint {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 500;
}
.cleafs-wallet .cw-badge-card-reward {
    font-size: 11px;
    font-weight: 700;
    color: #78350f;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fcd34d;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 2px;
}

/* ============================================================
 * MISSIONS — CATEGORIES + COMPLETED GREEN STATE
 * ============================================================ */

/* Ikona kategorii przy nagłówku grupy */
.cleafs-wallet .cw-earn-group-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cw-brand, #0e2868);
}
.cleafs-wallet .cw-earn-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--cw-brand-soft, #e8edfa);
    font-size: 20px;
    line-height: 1;
}
.cleafs-wallet .cw-earn-group-desc {
    font-size: 13px;
    color: var(--cw-muted);
    margin: 4px 0 16px 48px;
    line-height: 1.5;
}
.cleafs-wallet .cw-earn-group-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--cw-muted);
    padding: 4px 12px;
    background: var(--cw-surface-2, #f5f7fb);
    border-radius: 999px;
}
.cleafs-wallet .cw-earn-group {
    margin-bottom: 32px;
}
.cleafs-wallet .cw-earn-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

/* Mocniejszy zielony stan dla completed/completed_cooldown */
.cleafs-wallet .cw-task-row.done {
    background: linear-gradient(to right, rgba(15, 125, 74, 0.06), transparent 60%);
    border-color: rgba(15, 125, 74, 0.25);
}
.cleafs-wallet .cw-task-row.done:hover {
    background: linear-gradient(to right, rgba(15, 125, 74, 0.1), transparent 60%);
    border-color: rgba(15, 125, 74, 0.35);
}
.cleafs-wallet .cw-task-row.done .cw-task-check {
    background: linear-gradient(135deg, #0f7d4a, #16a05e);
    color: #fff;
    border-color: #0f7d4a;
    box-shadow: 0 2px 8px rgba(15, 125, 74, 0.25);
}
.cleafs-wallet .cw-task-row.done .cw-task-check svg {
    display: block;
    stroke-width: 3;
}
.cleafs-wallet .cw-task-row.done .cw-task-title {
    color: #0f7d4a;
}
.cleafs-wallet .cw-task-row.done .cw-task-desc {
    text-decoration: line-through;
    text-decoration-color: rgba(15, 125, 74, 0.35);
    opacity: 0.7;
}
.cleafs-wallet .cw-task-row.done .cw-task-btn.done-badge {
    background: #0f7d4a;
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(15, 125, 74, 0.2);
}
.cleafs-wallet .cw-task-row.done .cw-task-btn.done-badge svg {
    flex-shrink: 0;
}
.cleafs-wallet .cw-task-row.done .cw-task-reward-val {
    color: #0f7d4a;
}
.cleafs-wallet .cw-task-row.done .cw-task-reward-lab {
    color: rgba(15, 125, 74, 0.7);
}

/* Chip "Odebrane dziś" / "Odebrane" w meta-row */
.cleafs-wallet .cw-task-chip-done {
    background: #e6f6ed !important;
    color: #0f7d4a !important;
    border-color: rgba(15, 125, 74, 0.3) !important;
    font-weight: 600;
}
.cleafs-wallet .cw-task-chip-done::before {
    content: "✓";
    margin-right: 3px;
    font-weight: 700;
}

/* Pending jako delikatny żółty — dla kontrastu z green */
.cleafs-wallet .cw-task-row.inprogress {
    background: linear-gradient(to right, rgba(255, 222, 101, 0.1), transparent 60%);
    border-color: rgba(245, 210, 74, 0.3);
}
.cleafs-wallet .cw-task-row.inprogress .cw-task-check {
    background: #fff7dd;
    color: #8a6700;
    border-color: #f5d24a;
}

/* ============================================================
 * MISSIONS — ICON COLUMN
 * ============================================================ */
.cleafs-wallet .cw-task-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--cw-surface-2, #f5f7fb);
    border: 1px solid var(--cw-border, #e5e9f2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cleafs-wallet .cw-task-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cleafs-wallet .cw-task-icon-emoji {
    font-size: 28px;
    line-height: 1;
}

/* Done state — zielona obwódka wokół ikony */
.cleafs-wallet .cw-task-row.done .cw-task-icon {
    border-color: rgba(15, 125, 74, 0.35);
    background: rgba(15, 125, 74, 0.05);
}

/* ==========================================================================
 * MOBILE RESPONSIVE OVERRIDES (v2)
 *
 * Fixy dla inline px w views — overrides przez wysoką specyficzność klasy .cleafs-wallet.
 * Breakpointy:
 *   - >= 768px: desktop (defaults)
 *   - 481-767px: tablet (zmniejszone grid cols, mniejsze fonty)
 *   - <= 480px: mobile (1 kolumna, redukcja paddingów)
 * ========================================================================== */

@media (max-width: 767px) {
    /* Portfel / dashboard grids z 2-3 kol → 1 kol */
    .cleafs-wallet .cw-dash-main-side {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .cleafs-wallet .cw-stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .cleafs-wallet .cw-profile-rank-main {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    /* Large headings → redukcja */
    .cleafs-wallet h1, .cleafs-wallet .cw-hero-title {
        font-size: 22px !important;
    }
    .cleafs-wallet h2, .cleafs-wallet .cw-section-title, .cleafs-wallet .cw-card-title {
        font-size: 17px !important;
    }
    .cleafs-wallet h3 {
        font-size: 15px !important;
    }
    /* KPI value numbers */
    .cleafs-wallet .cw-stat-value, .cleafs-wallet .cw-kpi-value {
        font-size: 20px !important;
    }
    /* Paddings w kartach */
    .cleafs-wallet .cw-card,
    .cleafs-wallet .cw-stat,
    .cleafs-wallet .cw-hero {
        padding: 14px !important;
    }
    /* Tables — horizontal scroll zamiast pushu layoutu */
    .cleafs-wallet .cw-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .cleafs-wallet table {
        font-size: 13px;
    }
    /* Buttony obok siebie → full width w stacku */
    .cleafs-wallet .cw-btn-group {
        flex-direction: column !important;
    }
    .cleafs-wallet .cw-btn {
        width: 100%;
        justify-content: center;
    }
    /* Referral leaderboard item */
    .cw-ref-leaderboard-item {
        flex-wrap: wrap;
    }
    .cw-ref-name {
        font-size: 14px;
    }
    /* Savings dashboard grid */
    .cw-savings-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .cw-savings-card-value {
        font-size: 17px !important;
    }
    /* Gift card landing popup */
    .cw-gc-modal {
        max-width: 100% !important;
        border-radius: 12px !important;
    }
    /* Points discount widget */
    .cw-points-discount {
        padding: 14px !important;
    }
    .cw-points-discount-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .cleafs-wallet .cw-stat-grid,
    .cw-savings-grid {
        grid-template-columns: 1fr !important;
    }
    .cleafs-wallet .cw-profile-badges {
        gap: 8px !important;
    }
    .cleafs-wallet .cw-profile-badge {
        min-width: 72px !important;
    }
    /* Hero mniej dramatyczny na bardzo małych ekranach */
    .cleafs-wallet .cw-hero {
        padding: 16px !important;
    }
    .cleafs-wallet .cw-hero-kpi-value {
        font-size: 22px !important;
    }
    /* Gift card grid 2 kolumny → 1 */
    .cleafs-gift-card-landing > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Touch targets — min 44x44px dla mobile (a11y Apple/Google guidelines) */
@media (pointer: coarse) {
    .cleafs-wallet .cw-btn,
    .cleafs-wallet button,
    .cleafs-wallet a.button {
        min-height: 44px;
    }
}

/* Utility — spójny handling długich textów na mobile */
.cleafs-wallet .cw-text-overflow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
@media (max-width: 480px) {
    /* Emailowe adresy w tabelach mobilnych — truncate + tooltip */
    .cleafs-wallet td[data-cw-truncate-mobile] {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
