@charset "UTF-8";
/*!
 * CryptoPilot-style application theme
 * ---------------------------------------------------------------------------
 * Design system for the redesigned user area.  The reference design is a
 * Tailwind 4 + ApexCharts crypto dashboard, so this stylesheet mirrors its
 * vocabulary: soft surface cards on a tinted page, 16px radii, hairline
 * borders, tabular numerics, indigo/violet accent with emerald/rose for
 * market direction, and a first-class dark theme.
 *
 * Layout:  sidebar (collapsible) + sticky header + content grid
 * Themes:  [data-theme="light" | "dark"] on <html>, driven by cp.js
 * Icons:   inline SVG only - no emoji, no icon fonts
 */ 

/* ---------------------------------------------------------------- tokens -- */
:root {
    color-scheme: light;

    --cp-font: "Inter", "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cp-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --cp-bg: #f4f6fb;
    --cp-bg-soft: #eef1f8;
    --cp-surface: #ffffff;
    --cp-surface-2: #f8fafc;
    --cp-surface-3: #eef2f7;
    --cp-line: #e3e8f0;
    --cp-line-strong: #d3dae6;

    --cp-text: #0f172a;
    --cp-text-soft: #475569;
    --cp-text-mute: #7b8798;

    --cp-primary: #4f46e5;
    --cp-primary-hover: #4338ca;
    --cp-primary-soft: rgba(79, 70, 229, 0.1);
    --cp-violet: #314e4b;
   --cp-gradient: linear-gradient(135deg, #314e4b, #04271d);

    --cp-up: #059669;
    --cp-up-soft: rgba(5, 150, 105, 0.12);
    --cp-down: #e11d48;
    --cp-down-soft: rgba(225, 29, 72, 0.12);
    --cp-warn: #d97706;
    --cp-warn-soft: rgba(217, 119, 6, 0.14);
    --cp-info: #0284c7;
    --cp-info-soft: rgba(2, 132, 199, 0.12);

    --cp-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --cp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.16);
    --cp-shadow-lg: 0 24px 48px -24px rgba(15, 23, 42, 0.28);

    --cp-r-sm: 8px;
    --cp-r: 12px;
    --cp-r-lg: 16px;
    --cp-r-xl: 20px;

    --cp-sidebar-w: 264px;
    --cp-sidebar-rail: 76px;
    --cp-header-h: 64px;
}

[data-theme="dark"] {
    color-scheme: dark;

    --cp-bg: #070b16;
    --cp-bg-soft: #0b1120;
    --cp-surface: #0f172a;
    --cp-surface-2: #131c31;
    --cp-surface-3: #1b2540;
    --cp-line: #1e293b;
    --cp-line-strong: #2b3a55;

    --cp-text: #e8edf7;
    --cp-text-soft: #a9b6cc;
    --cp-text-mute: #7c8aa3;

    --cp-primary: #d3d3dc;
    --cp-primary-hover: #818cf8;
    --cp-primary-soft: rgba(99, 102, 241, 0.16);
    --cp-violet: #8b5cf6;

    --cp-up: #34d399;
    --cp-up-soft: rgba(52, 211, 153, 0.14);
    --cp-down: #fb7185;
    --cp-down-soft: rgba(251, 113, 133, 0.14);
    --cp-warn: #fbbf24;
    --cp-warn-soft: rgba(251, 191, 36, 0.16);
    --cp-info: #38bdf8;
    --cp-info-soft: rgba(56, 189, 248, 0.14);

    --cp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --cp-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    --cp-shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.cp {
    margin: 0;
    min-height: 100vh;
    background: var(--cp-bg);
    color: var(--cp-text);
    font-family: var(--cp-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--cp-text); font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--cp-primary); text-decoration: none; }
a:hover { color: var(--cp-primary-hover); }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--cp-line); margin: 18px 0; }
small { font-size: 12px; }

:focus-visible { outline: 2px solid var(--cp-primary); outline-offset: 2px; border-radius: 6px; }

.cp-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.cp-scroll::-webkit-scrollbar-thumb { background: var(--cp-line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.cp-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- layout -- */
.cp-app { min-height: 100vh; }

.cp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: var(--cp-sidebar-w);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--cp-surface);
    border-right: 1px solid var(--cp-line);
    transition: width 0.22s ease, transform 0.24s ease;
}

/* drawer scrim - sits under the sidebar, never over it */
.cp-sidebar__backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(5, 9, 18, 0.6);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.cp-nav-open .cp-sidebar__backdrop { opacity: 1; visibility: visible; pointer-events: auto; }

@media (min-width: 1025px) {
    .cp-sidebar__backdrop { display: none; }
}

.cp-main {
    min-height: 100vh;
    margin-left: var(--cp-sidebar-w);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.22s ease;
}

body.cp-rail .cp-sidebar { width: var(--cp-sidebar-rail); }
body.cp-rail .cp-main { margin-left: var(--cp-sidebar-rail); }
body.cp-rail .cp-sidebar .cp-nav__label,
body.cp-rail .cp-sidebar .cp-nav__caret,
body.cp-rail .cp-sidebar .cp-sidebar__foot,
body.cp-rail .cp-sidebar .cp-brand__text,
body.cp-rail .cp-sidebar .cp-nav__badge { display: none; }
body.cp-rail .cp-nav__link { justify-content: center; padding-left: 0; padding-right: 0; }
body.cp-rail .cp-nav__link > span:not(.cp-nav__icon) { display: none; }
body.cp-rail .cp-subnav { display: none !important; }
body.cp-rail .cp-brand { justify-content: center; }
body.cp-rail .cp-sidebar__toggle svg { transform: rotate(180deg); }

.cp-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--cp-header-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    background: color-mix(in srgb, var(--cp-bg) 86%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cp-line);
}

.cp-content { padding: 22px; max-width: 1560px; width: 100%; margin: 0 auto; }
.cp-content--flush { padding-top: 0; }
.cp-stack { display: grid; gap: 18px; }
.cp-stack--sm { gap: 12px; }
.cp-stack--lg { gap: 26px; }

.cp-grid { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.cp-col-3 { grid-column: span 3; }
.cp-col-4 { grid-column: span 4; }
.cp-col-5 { grid-column: span 5; }
.cp-col-6 { grid-column: span 6; }
.cp-col-7 { grid-column: span 7; }
.cp-col-8 { grid-column: span 8; }
.cp-col-9 { grid-column: span 9; }
.cp-col-12 { grid-column: span 12; }

.cp-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cp-row--between { justify-content: space-between; }
.cp-row--end { justify-content: flex-end; }
.cp-row--tight { gap: 8px; }
.cp-grow { flex: 1 1 auto; min-width: 0; }
.cp-spacer { flex: 1 1 auto; }

/* ------------------------------------------------------------- sidebar UI -- */
.cp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 14px;
    color: var(--cp-text);
}
.cp-brand:hover { color: var(--cp-text); }
.cp-brand__logo {
  width: 664px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: block;
}
.cp-brand__name {
  display: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cp-brand__tag { display: block; font-size: 11px; color: var(--cp-text-mute); text-transform: uppercase; letter-spacing: 0.09em; }

.cp-sidebar__toggle {
    position: absolute;
    top: 24px;
    right: -13px;
    width: 26px; height: 26px;
    border-radius: 999px;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-text-soft);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: var(--cp-shadow-sm);
}
.cp-sidebar__toggle:hover { color: var(--cp-primary); border-color: var(--cp-primary); }
.cp-sidebar__toggle svg { transition: transform 0.22s ease; }

.cp-sidebar__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 12px 16px;
}
.cp-sidebar__foot {
    flex: 0 0 auto;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--cp-line);
    background: var(--cp-surface);
}
.cp-brand { flex: 0 0 auto; }

.cp-nav { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.cp-nav__label {
    margin: 16px 6px 6px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cp-text-mute);
}
.cp-nav__item { position: relative; }

.cp-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--cp-text-soft);
    font-size: 13.5px;
    font-weight: 550;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease;
}
.cp-nav__link:hover { background: var(--cp-surface-3); color: var(--cp-text); }
.cp-nav__link.is-active { background: var(--cp-primary-soft); color: var(--cp-primary); font-weight: 650; }
.cp-nav__link.is-active .cp-nav__icon { color: var(--cp-primary); }
.cp-nav__icon { flex: 0 0 18px; display: inline-flex; color: var(--cp-text-mute); }
.cp-nav__link:hover .cp-nav__icon { color: var(--cp-text); }
.cp-nav__caret { margin-left: auto; color: var(--cp-text-mute); transition: transform 0.2s ease; }
.cp-nav__item.is-open > .cp-nav__link .cp-nav__caret { transform: rotate(180deg); }
.cp-nav__badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--cp-primary);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
}
.cp-nav__item.is-open > .cp-nav__link { color: var(--cp-text); background: var(--cp-surface-3); }

.cp-subnav { display: none; margin: 3px 0 6px; padding: 0 0 0 28px; list-style: none; }
.cp-nav__item.is-open > .cp-subnav { display: block; animation: cp-fade 0.2s ease; }
.cp-subnav__link {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 8px;
    color: var(--cp-text-mute); font-size: 13px; font-weight: 500;
}
.cp-subnav__link:hover { background: var(--cp-surface-3); color: var(--cp-text); }
.cp-subnav__link.is-active { color: var(--cp-primary); font-weight: 650; background: var(--cp-primary-soft); }
.cp-subnav__dot { width: 5px; height: 5px; border-radius: 999px; background: currentColor; opacity: 0.55; }

/* -------------------------------------------------------------- header UI -- */
.cp-header__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cp-header__eyebrow { font-size: 11.5px; font-weight: 620; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cp-text-mute); }
.cp-header__page { font-size: 14px; font-weight: 660; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-header__page::before { content: "/"; color: var(--cp-line-strong); margin-right: 8px; font-weight: 500; }

/* page heading block (reference pages carry their own H1 inside the content) */
.cp-pagehead {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
    margin-bottom: 2px;
}
.cp-pagehead h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.cp-pagehead__sub { margin: 6px 0 0; color: var(--cp-text-mute); font-size: 13.2px; max-width: 60em; }
.cp-pagehead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cp-pagehead--bordered { padding-bottom: 16px; border-bottom: 1px solid var(--cp-line); }

.cp-iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-text-soft);
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.cp-iconbtn:hover { color: var(--cp-text); border-color: var(--cp-line-strong); }
.cp-iconbtn__dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 999px; background: var(--cp-down); box-shadow: 0 0 0 2px var(--cp-surface); }

.cp-search { position: relative; display: flex; align-items: center; min-width: 0; }
.cp-search svg { position: absolute; left: 11px; color: var(--cp-text-mute); pointer-events: none; }
.cp-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border-radius: 10px;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-text);
    font-size: 13px;
}
.cp-search input::placeholder { color: var(--cp-text-mute); }
.cp-search input:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px var(--cp-primary-soft); }

.cp-user { position: relative; }
.cp-user__btn {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    cursor: pointer;
    color: var(--cp-text);
}
.cp-user__btn:hover { border-color: var(--cp-line-strong); }
.cp-user__meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.cp-user__name { font-size: 12.8px; font-weight: 640; }
.cp-user__role { font-size: 11px; color: var(--cp-text-mute); }

.cp-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    flex: 0 0 32px;
    border-radius: 999px;
    background: var(--cp-gradient);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.cp-avatar--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }
.cp-avatar--lg { width: 46px; height: 46px; flex-basis: 46px; font-size: 15px; }
.cp-avatar--soft { background: var(--cp-primary-soft); color: var(--cp-primary); }

/* --------------------------------------------------------------- cards UI -- */
.cp-card {
    background: var(--cp-surface);
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-r-lg);
    box-shadow: var(--cp-shadow-sm);
    overflow: hidden;
}
.cp-card--flat { box-shadow: none; }
.cp-card--pad { padding: 18px; }
.cp-card--sm { padding: 14px; }
.cp-card__head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--cp-line);
}
.cp-card__head--plain { border-bottom: 0; padding-bottom: 6px; }
.cp-card__body { padding: 18px; }
.cp-card__title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 650; }
.cp-card__title svg { color: var(--cp-primary); }
.cp-card__sub { font-size: 12.5px; color: var(--cp-text-mute); margin: 2px 0 0; }
.cp-card__link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cp-card__foot { padding: 12px 18px; border-top: 1px solid var(--cp-line); background: var(--cp-surface-2); font-size: 12.5px; color: var(--cp-text-mute); }

.cp-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--cp-r-lg);
    border: 1px solid var(--cp-line);
    background: var(--cp-gradient);
    color: #fff;
    padding: 22px;
}
.cp-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 200px at 88% -10%, rgba(255, 255, 255, 0.28), transparent 70%),
        radial-gradient(400px 180px at 10% 120%, rgba(255, 255, 255, 0.16), transparent 70%);
    pointer-events: none;
}
.cp-hero > * { position: relative; z-index: 1; }
.cp-hero__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.cp-hero__value { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cp-hero__meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 12.5px; opacity: 0.92; }
.cp-hero__meta b { font-weight: 650; }
.cp-hero .cp-btn--ghost { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.32); color: #fff; }
.cp-hero .cp-btn--ghost:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.cp-hero .cp-btn--light {
  background: #fff;
  border-color: #fff;
  color: #141f18;
}
.cp-hero .cp-btn--light:hover { color: #4338ca; }

.cp-hero--dark {
    background:
        radial-gradient(700px 240px at 90% -20%, rgba(99, 102, 241, 0.55), transparent 70%),
        linear-gradient(135deg, #101a33, #0b1220);
}

/* ----------------------------------------------------------- stats / KPI -- */
.cp-stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp-stat {
    background: var(--cp-surface);
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-r-lg);
    padding: 15px 16px;
    box-shadow: var(--cp-shadow-sm);
}
.cp-stat__top { display: flex; align-items: center; gap: 8px; }
.cp-stat__label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cp-text-mute); }
.cp-stat__value { margin-top: 8px; font-size: 23px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cp-stat__foot { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cp-text-mute); }
.cp-stat__icon {
    margin-left: auto;
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cp-primary-soft);
    color: var(--cp-primary);
}
.cp-stat__icon--up { background: var(--cp-up-soft); color: var(--cp-up); }
.cp-stat__icon--down { background: var(--cp-down-soft); color: var(--cp-down); }
.cp-stat__icon--warn { background: var(--cp-warn-soft); color: var(--cp-warn); }
.cp-stat__icon--info { background: var(--cp-info-soft); color: var(--cp-info); }

.cp-kpi { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--cp-r); background: var(--cp-surface); border: 1px solid var(--cp-line); }
.cp-kpi__value { font-size: 16px; font-weight: 680; font-variant-numeric: tabular-nums; }
.cp-kpi__label { font-size: 11.5px; color: var(--cp-text-mute); }

/* ------------------------------------------------------------- chips/badges */
.cp-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--cp-surface-3);
    color: var(--cp-text-soft);
    font-size: 11.5px;
    font-weight: 620;
    white-space: nowrap;
}
.cp-badge--up { background: var(--cp-up-soft); color: var(--cp-up); }
.cp-badge--down { background: var(--cp-down-soft); color: var(--cp-down); }
.cp-badge--warn { background: var(--cp-warn-soft); color: var(--cp-warn); }
.cp-badge--info { background: var(--cp-info-soft); color: var(--cp-info); }
.cp-badge--primary { background: var(--cp-primary-soft); color: var(--cp-primary); }
.cp-badge--solid { background: var(--cp-primary); color: #fff; }
.cp-badge--outline { background: transparent; border: 1px solid var(--cp-line-strong); color: var(--cp-text-soft); }
.cp-badge--lg { padding: 5px 12px; font-size: 12.5px; }

.cp-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 640; font-variant-numeric: tabular-nums; }
.cp-delta--up { color: var(--cp-up); }
.cp-delta--down { color: var(--cp-down); }

.cp-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex: 0 0 8px; }
.cp-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--cp-up); text-transform: uppercase; letter-spacing: 0.08em; }
.cp-live .cp-dot { animation: cp-pulse 1.8s ease-in-out infinite; }

/* --------------------------------------------------------------- buttons -- */
.cp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 620;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.cp-btn:hover { border-color: var(--cp-line-strong); color: var(--cp-text); }
.cp-btn:active { transform: translateY(1px); }
.cp-btn:disabled, .cp-btn[disabled], .cp-btn.is-loading { opacity: 0.6; pointer-events: none; }
.cp-btn--primary {
  background: #1f3e38;
  border-color: var(--cp-primary);
  color: #fff;
}
.cp-btn--primary:hover { background: var(--cp-primary-hover); border-color: var(--cp-primary-hover); color: #fff; }
.cp-btn--gradient { background: var(--cp-gradient); border-color: transparent; color: #fff; }
.cp-btn--success { background: var(--cp-up); border-color: var(--cp-up); color: #fff; }
.cp-btn--success:hover { color: #fff; filter: brightness(1.05); }
.cp-btn--danger { background: var(--cp-down-soft); border-color: transparent; color: var(--cp-down); }
.cp-btn--ghost { background: transparent; border-color: var(--cp-line); color: var(--cp-text-soft); }
.cp-btn--ghost:hover { background: var(--cp-surface-3); color: var(--cp-text); }
.cp-btn--link { background: transparent; border-color: transparent; color: var(--cp-primary); padding: 0 4px; height: auto; }
.cp-btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.cp-btn--xs { height: 27px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; gap: 5px; }
.cp-btn--lg { height: 46px; padding: 0 22px; font-size: 14px; border-radius: 12px; }
.cp-btn--block { width: 100%; }
.cp-btn--icon { width: 38px; padding: 0; }
.cp-btn.is-loading svg { animation: cp-spin 0.9s linear infinite; }

.cp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- forms --- */
.cp-field { display: grid; gap: 6px; margin-bottom: 14px; }
.cp-label { font-size: 12.5px; font-weight: 620; color: var(--cp-text-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-label a { font-size: 12px; font-weight: 600; }
.cp-hint { font-size: 12px; color: var(--cp-text-mute); }

.cp-input, .cp-select, .cp-textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-text);
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cp-textarea { min-height: 96px; resize: vertical; }
.cp-input::placeholder, .cp-textarea::placeholder { color: var(--cp-text-mute); }
.cp-input:focus, .cp-select:focus, .cp-textarea:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px var(--cp-primary-soft); }
.cp-input:disabled, .cp-select:disabled { background: var(--cp-surface-2); color: var(--cp-text-mute); cursor: not-allowed; }
.cp-input--mono { font-family: var(--cp-mono); font-size: 12.5px; }
.cp-input--invalid { border-color: var(--cp-down); }
.cp-input-group { position: relative; display: flex; align-items: center; }
.cp-input-group > svg { position: absolute; left: 11px; color: var(--cp-text-mute); pointer-events: none; }
.cp-input-group > svg + .cp-input { padding-left: 34px; }
.cp-input-group__action {
    position: absolute; right: 6px;
    border: 0; background: transparent; color: var(--cp-text-mute);
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.cp-input-group__action:hover { background: var(--cp-surface-3); color: var(--cp-text); }
.cp-input-suffix { position: absolute; right: 12px; font-size: 12px; color: var(--cp-text-mute); font-weight: 600; }

.cp-check { display: inline-flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--cp-text-soft); cursor: pointer; }
.cp-check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--cp-primary); }

.cp-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cp-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cp-switch__track {
    width: 38px; height: 22px; border-radius: 999px;
    background: var(--cp-line-strong);
    position: relative; flex: 0 0 38px;
    transition: background 0.18s ease;
}
.cp-switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 999px; background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform 0.18s ease;
}
.cp-switch input:checked + .cp-switch__track { background: var(--cp-primary); }
.cp-switch input:checked + .cp-switch__track::after { transform: translateX(16px); }
.cp-switch__text { display: grid; }
.cp-switch__text b { font-size: 13px; font-weight: 620; color: var(--cp-text); }
.cp-switch__text span { font-size: 12px; color: var(--cp-text-mute); }
.cp-switch--row { justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--cp-line); }
.cp-switch--row:last-child { border-bottom: 0; }

.cp-segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--cp-surface-3); border: 1px solid var(--cp-line); }
.cp-segmented a, .cp-segmented button {
    border: 0; background: transparent; color: var(--cp-text-mute);
    font-family: inherit; font-size: 12.5px; font-weight: 620;
    padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.cp-segmented a:hover, .cp-segmented button:hover { color: var(--cp-text); }
.cp-segmented .is-active { background: var(--cp-surface); color: var(--cp-text); box-shadow: var(--cp-shadow-sm); }

.cp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--cp-line); background: var(--cp-surface);
    color: var(--cp-text-soft); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cp-chip:hover { border-color: var(--cp-line-strong); color: var(--cp-text); }
.cp-chip.is-active { background: var(--cp-primary); border-color: var(--cp-primary); color: #fff; }

.cp-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--cp-line); margin: 0 0 18px; overflow-x: auto; }
.cp-tab {
    position: relative; padding: 10px 2px; font-size: 13px; font-weight: 620;
    color: var(--cp-text-mute); border: 0; background: transparent; cursor: pointer; white-space: nowrap;
}
.cp-tab:hover { color: var(--cp-text); }
.cp-tab.is-active { color: var(--cp-primary); }
.cp-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--cp-primary); }

/* ---------------------------------------------------------------- tables -- */
.cp-table-wrap { width: 100%; overflow-x: auto; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cp-table thead th {
    position: sticky; top: 0;
    padding: 10px 14px;
    text-align: left;
    background: var(--cp-surface-2);
    color: var(--cp-text-mute);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--cp-line);
}
.cp-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--cp-line); vertical-align: middle; }
.cp-table tbody tr:last-child td { border-bottom: 0; }
.cp-table tbody tr:hover td { background: var(--cp-surface-2); }
.cp-table tfoot td { padding: 12px 14px; background: var(--cp-surface-2); font-weight: 650; border-top: 1px solid var(--cp-line); }
.cp-table--compact tbody td { padding: 8px 12px; }
.cp-table .is-num, .cp-num { text-align: right; font-variant-numeric: tabular-nums; }
.cp-table caption { caption-side: bottom; padding: 12px 14px; text-align: left; font-size: 12px; color: var(--cp-text-mute); border-top: 1px solid var(--cp-line); }
.cp-table__cell { display: flex; align-items: center; gap: 10px; }
.cp-table__main { font-weight: 620; color: var(--cp-text); }
.cp-table__sub { font-size: 11.5px; color: var(--cp-text-mute); }
.cp-total td { font-weight: 650; }

/* ------------------------------------------------------------ coin / asset */
.cp-coin {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 999px;
    background: var(--cp-surface-3);
    color: var(--cp-text);
    font-size: 10.5px; font-weight: 750;
    letter-spacing: -0.02em;
}
.cp-coin--sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 9.5px; }
.cp-coin--lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 13px; }
.cp-coin--btc { background: rgba(247, 147, 26, 0.16); color: #f7931a; }
.cp-coin--eth { background: rgba(98, 126, 234, 0.18); color: #627eea; }
.cp-coin--usdt { background: rgba(38, 161, 123, 0.16); color: #26a17b; }
.cp-coin--sol { background: rgba(153, 69, 255, 0.16); color: #9945ff; }
.cp-coin--bnb { background: rgba(240, 185, 11, 0.18); color: #f0b90b; }
.cp-coin--xrp { background: rgba(35, 41, 47, 0.14); color: #23292f; }
.cp-coin--ada { background: rgba(0, 51, 173, 0.14); color: #0033ad; }
.cp-coin--xau { background: rgba(212, 175, 55, 0.18); color: #b8860b; }
.cp-coin--default { background: var(--cp-surface-3); color: var(--cp-text-soft); }

.cp-asset { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cp-asset__name { font-weight: 620; color: var(--cp-text); font-size: 13px; }
.cp-asset__ticker { font-size: 11.5px; color: var(--cp-text-mute); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------------------------------------------------------------- ticker -- */
.cp-ticker {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    border-radius: var(--cp-r);
    padding: 8px 0;
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.cp-ticker__track { display: flex; gap: 26px; width: max-content; animation: cp-marquee 42s linear infinite; }
.cp-ticker:hover .cp-ticker__track { animation-play-state: paused; }
.cp-ticker__item { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cp-ticker__item b { font-weight: 660; }
.cp-ticker__sym { color: var(--cp-text-mute); font-weight: 620; letter-spacing: 0.03em; }

/* --------------------------------------------------------------- heatmap -- */
.cp-heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cp-heat__cell {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 12px 6px; border-radius: 10px;
    color: var(--cp-text); border: 1px solid transparent;
    font-variant-numeric: tabular-nums;
    transition: transform 0.12s ease;
}
.cp-heat__cell:hover { transform: translateY(-2px); color: var(--cp-text); }
.cp-heat__sym { font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
.cp-heat__val { font-size: 11.5px; font-weight: 600; opacity: 0.85; }
.cp-heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--cp-text-mute); }
.cp-heat-legend__bar { width: 120px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--cp-down), rgba(148, 163, 184, 0.35), var(--cp-up)); }

/* ---------------------------------------------------------------- charts -- */
.cp-chart { position: relative; width: 100%; }
.cp-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.cp-chart__tooltip {
    position: absolute; z-index: 5; pointer-events: none;
    padding: 6px 9px; border-radius: 8px;
    background: var(--cp-text); color: var(--cp-bg);
    font-size: 11.5px; font-weight: 620; white-space: nowrap;
    transform: translate(-50%, -130%); opacity: 0; transition: opacity 0.12s ease;
}
.cp-chart__tooltip.is-visible { opacity: 1; }
.cp-chart-legend { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--cp-text-mute); }
.cp-chart-legend__key { display: inline-flex; align-items: center; gap: 6px; }
.cp-chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; }
.cp-chart-empty { display: flex; align-items: center; justify-content: center; min-height: 180px; color: var(--cp-text-mute); font-size: 13px; }

.cp-range { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--cp-surface-3); }
.cp-range button { border: 0; background: transparent; color: var(--cp-text-mute); font-size: 12px; font-weight: 620; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.cp-range button.is-active { background: var(--cp-surface); color: var(--cp-text); box-shadow: var(--cp-shadow-sm); }

.cp-meter { height: 6px; border-radius: 999px; background: var(--cp-surface-3); overflow: hidden; }
.cp-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--cp-gradient); }
.cp-meter--up > span { background: linear-gradient(90deg, #10b981, #34d399); }
.cp-meter--warn > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.cp-meter--down > span { background: linear-gradient(90deg, #e11d48, #fb7185); }
.cp-meter__labels { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--cp-text-mute); }

.cp-conf { display: flex; align-items: center; gap: 10px; }
.cp-conf__bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--cp-surface-3); overflow: hidden; }
.cp-conf__bar > span { display: block; height: 100%; background: var(--cp-gradient); }

/* ----------------------------------------------------------------- lists -- */
.cp-list { display: grid; }
.cp-list__row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--cp-line);
}
.cp-list__row:last-child { border-bottom: 0; }
.cp-list__row:hover { background: var(--cp-surface-2); }
.cp-list__row--link:hover { color: inherit; }
.cp-list__body { flex: 1 1 auto; min-width: 0; }
.cp-list__title { display: flex; align-items: center; gap: 8px; font-size: 13.2px; font-weight: 620; color: var(--cp-text); }
.cp-list__sub { font-size: 11.8px; color: var(--cp-text-mute); margin-top: 1px; }
.cp-list__value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-list__value b { display: block; font-size: 13.2px; font-weight: 650; }
.cp-list__value small { color: var(--cp-text-mute); }

.cp-activity__icon {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cp-surface-3); color: var(--cp-text-soft);
}
.cp-activity__icon--up { background: var(--cp-up-soft); color: var(--cp-up); }
.cp-activity__icon--down { background: var(--cp-down-soft); color: var(--cp-down); }
.cp-activity__icon--info { background: var(--cp-info-soft); color: var(--cp-info); }

/* ------------------------------------------------------------ empty/alert */
.cp-empty { padding: 40px 22px; text-align: center; }
.cp-empty__icon {
    width: 52px; height: 52px; margin: 0 auto 14px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--cp-primary-soft); color: var(--cp-primary);
}
.cp-empty h3 { margin-bottom: 6px; }
.cp-empty p { color: var(--cp-text-mute); font-size: 13px; max-width: 460px; margin: 0 auto 16px; }

.cp-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--cp-r);
    border: 1px solid var(--cp-line);
    background: var(--cp-surface);
    font-size: 13px;
    color: var(--cp-text-soft);
    margin-bottom: 16px;
}
.cp-alert svg { flex: 0 0 auto; margin-top: 1px; }
.cp-alert--success { background: var(--cp-up-soft); border-color: transparent; color: var(--cp-up); }
.cp-alert--error { background: var(--cp-down-soft); border-color: transparent; color: var(--cp-down); }
.cp-alert--warn { background: var(--cp-warn-soft); border-color: transparent; color: var(--cp-warn); }
.cp-alert--info { background: var(--cp-info-soft); border-color: transparent; color: var(--cp-info); }
.cp-alert b { color: inherit; }

/* -------------------------------------------------------- dropdown/dialog */
.cp-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    z-index: 80;
    min-width: 250px;
    background: var(--cp-surface);
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-r);
    box-shadow: var(--cp-shadow-lg);
    overflow: hidden;
    display: none;
}
.cp-dropdown.is-open { display: block; animation: cp-pop 0.16s ease; }
.cp-dropdown--wide { min-width: 360px; }
.cp-dropdown--left { right: auto; left: 0; }
.cp-dropdown__head { padding: 12px 14px; border-bottom: 1px solid var(--cp-line); display: flex; align-items: center; gap: 8px; }
.cp-dropdown__head h4 { font-size: 13px; font-weight: 660; }
.cp-dropdown__item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    color: var(--cp-text-soft);
    font-size: 13px;
    width: 100%;
    border: 0; background: transparent; text-align: left; cursor: pointer;
    font-family: inherit;
}
.cp-dropdown__item:hover { background: var(--cp-surface-2); color: var(--cp-text); }
.cp-dropdown__item svg { color: var(--cp-text-mute); }
.cp-dropdown__item--danger { color: var(--cp-down); }
.cp-dropdown__sep { height: 1px; background: var(--cp-line); margin: 4px 0; }
.cp-dropdown__scroll { max-height: 340px; overflow-y: auto; }

.cp-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}
.cp-modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
/* the fade layer only ever paints behind the dialog */
.cp-modal__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(8, 13, 26, 0.62);
    backdrop-filter: blur(3px);
}
.cp-modal__dialog {
    position: relative;
    z-index: 1;
    margin: 0;
    width: min(560px, 100%);
    pointer-events: auto;
    background: var(--cp-surface);
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-r-lg);
    box-shadow: var(--cp-shadow-lg);
    animation: cp-pop 0.18s ease;
}
.cp-modal__body { max-height: 68vh; overflow-y: auto; }
.cp-modal__dialog--wide { width: min(760px, calc(100vw - 32px)); }
.cp-modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px; border-bottom: 1px solid var(--cp-line); }
.cp-modal__body { padding: 18px; }
.cp-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--cp-line); background: var(--cp-surface-2); }
.cp-modal__close { margin-left: auto; }

/* ------------------------------------------------------------- utilities -- */
.cp-muted { color: var(--cp-text-mute); }
.cp-soft { color: var(--cp-text-soft); }
.cp-white { color: var(--cp-text); }
.cp-up { color: var(--cp-up); }
.cp-down { color: var(--cp-down); }
.cp-primary { color: var(--cp-primary); }
.cp-mono { font-family: var(--cp-mono); }
.cp-num { font-variant-numeric: tabular-nums; }
.cp-center { text-align: center; }
.cp-right { text-align: right; }
.cp-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-break { word-break: break-all; }
.cp-strong { font-weight: 650; }
.cp-tiny { font-size: 11.5px; }
.cp-small { font-size: 12.5px; }
.cp-lead { font-size: 15px; }
.cp-capitalize { text-transform: capitalize; }
.cp-uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
.cp-hidden { display: none !important; }
.cp-divider { height: 1px; background: var(--cp-line); margin: 14px 0; }
.cp-section-title { font-size: 15px; font-weight: 660; display: flex; align-items: center; gap: 8px; }
.cp-eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cp-text-mute); }

.cp-fill { width: 100%; }
.cp-fit { width: fit-content; }
.cp-scroll-y { max-height: 360px; overflow-y: auto; }

.cp-gap-4 { gap: 4px; } .cp-gap-6 { gap: 6px; } .cp-gap-8 { gap: 8px; }
.cp-gap-12 { gap: 12px; } .cp-gap-16 { gap: 16px; } .cp-gap-20 { gap: 20px; }
.cp-mt-0 { margin-top: 0; } .cp-mt-4 { margin-top: 4px; } .cp-mt-8 { margin-top: 8px; }
.cp-mt-12 { margin-top: 12px; } .cp-mt-16 { margin-top: 16px; } .cp-mt-20 { margin-top: 20px; } .cp-mt-24 { margin-top: 24px; }
.cp-mb-0 { margin-bottom: 0; } .cp-mb-4 { margin-bottom: 4px; } .cp-mb-8 { margin-bottom: 8px; }
.cp-mb-12 { margin-bottom: 12px; } .cp-mb-16 { margin-bottom: 16px; } .cp-mb-20 { margin-bottom: 20px; }
.cp-p-16 { padding: 16px; } .cp-p-18 { padding: 18px; } .cp-p-0 { padding: 0; }

.cp-grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cp-grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp-grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ------------------------------------------------------------ animations -- */
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-pop { from { opacity: 0; transform: translateY(-6px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes cp-spin { to { transform: rotate(360deg); } }
@keyframes cp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes cp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes cp-draw { from { stroke-dashoffset: var(--cp-dash, 1200); } to { stroke-dashoffset: 0; } }
.cp-animate-draw { animation: cp-draw 1s ease forwards; }

body.cp-no-anim .cp-chart svg, body.cp-no-anim .cp-ticker__track { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 1400px) {
    .cp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
    .cp-col-3 { grid-column: span 6; }
    .cp-col-4 { grid-column: span 6; }
    .cp-col-5 { grid-column: span 12; }
    .cp-col-7 { grid-column: span 12; }
    .cp-col-8 { grid-column: span 12; }
    .cp-col-9 { grid-column: span 12; }
    .cp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .cp-sidebar {
        transform: translateX(-104%);
        width: min(var(--cp-sidebar-w), 86vw);
        box-shadow: none;
    }
    .cp-main { margin-left: 0; }
    body.cp-nav-open .cp-sidebar { transform: none; box-shadow: var(--cp-shadow-lg); }
    body.cp-nav-open { overflow: hidden; }
    body.cp-rail .cp-sidebar { width: min(var(--cp-sidebar-w), 86vw); }
    body.cp-rail .cp-sidebar .cp-brand__text, body.cp-rail .cp-nav__label { display: block; }
    body.cp-rail .cp-nav__link { justify-content: flex-start; padding-left: 11px; padding-right: 11px; }
    body.cp-rail .cp-nav__link > span:not(.cp-nav__icon) { display: inline; }
    body.cp-rail .cp-sidebar__foot { display: block; }
    body.cp-rail .cp-subnav { display: none !important; }
    body.cp-rail .cp-nav__item.is-open > .cp-subnav { display: block !important; }
    .cp-sidebar__toggle { display: none; }
    .cp-col-3, .cp-col-4, .cp-col-6, .cp-col-7, .cp-col-8, .cp-col-9 { grid-column: span 12; }
    .cp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .cp-modal.is-open { padding: 0; align-items: flex-end; }
    .cp-modal__dialog {
        width: 100%;
        border-radius: var(--cp-r-lg) var(--cp-r-lg) 0 0;
        animation: cp-sheet 0.22s ease;
    }
    .cp-modal__body { max-height: 58vh; }
    .cp-modal__foot {
        position: sticky;
        bottom: 0;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .cp-toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

@keyframes cp-sheet {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: none; opacity: 1; }
}

@media (max-width: 760px) {
    .cp-content { padding: 16px 14px 28px; }
    .cp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cp-pagehead__actions { width: 100%; }
    .cp-header { padding: 10px 14px; gap: 10px; }
    .cp-header__title span { display: none; }
    .cp-stats { grid-template-columns: 1fr; }
    .cp-grid-2, .cp-grid-3, .cp-grid-4 { grid-template-columns: 1fr; }
    .cp-hero__value { font-size: 27px; }
    .cp-card__head { padding: 14px; }
    .cp-card__body { padding: 14px; }
    .cp-user__meta { display: none; }
}
@media print {
    .cp-sidebar, .cp-header, .cp-actions, .cp-ticker { display: none !important; }
    .cp-main { margin: 0; }
    body.cp { background: #fff; }
}

/* ------------------------------------------------------------------ toasts */
.cp-toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 40px));
    pointer-events: none;
}

.cp-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--cp-line);
    border-left: 3px solid var(--cp-primary);
    border-radius: var(--cp-r);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow-lg);
    color: var(--cp-text);
    font-size: 13px;
    line-height: 1.5;
    pointer-events: auto;
    animation: cp-toast-in 0.22s ease;
}

.cp-toast--success { border-left-color: var(--cp-up); }
.cp-toast--error { border-left-color: var(--cp-down); }
.cp-toast--info { border-left-color: var(--cp-info); }
.cp-toast__icon { color: var(--cp-primary); display: inline-flex; margin-top: 1px; }
.cp-toast--success .cp-toast__icon { color: var(--cp-up); }
.cp-toast--error .cp-toast__icon { color: var(--cp-down); }
.cp-toast__close {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--cp-text-mute);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

@keyframes cp-toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* pending (submitting) buttons */
.cp-btn.is-loading { opacity: 0.7; pointer-events: none; }
.cp-btn.is-loading::after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cp-spin 0.7s linear infinite;
}

@keyframes cp-spin { to { transform: rotate(360deg); } }

/* upload dropzone */
.cp-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 16px;
    border: 1px dashed var(--cp-line-strong);
    border-radius: var(--cp-r);
    background: var(--cp-surface-2);
    text-align: center;
    cursor: pointer;
}

.cp-drop:hover { border-color: var(--cp-primary); }
.cp-drop input[type="file"] { display: none; }

/* small input variant used in table/filters toolbars */
.cp-input--sm,
.cp-select--sm {
    padding: 7px 11px;
    font-size: 13px;
}

.cp-left { text-align: left; }

/* hide on small screens (header utilities) */
@media (max-width: 720px) {
    .cp-hidden-sm { display: none !important; }
}

/* ------------------------------------------------------- notice / banners -- */
/* The modern notification block used at the top of every member page. */
.cp-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--cp-line);
    border-left: 3px solid var(--cp-primary);
    border-radius: var(--cp-r);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow-sm);
}

.cp-notice--success { border-left-color: var(--cp-up); background: linear-gradient(90deg, var(--cp-up-soft), var(--cp-surface) 62%); }
.cp-notice--warn { border-left-color: var(--cp-warn); background: linear-gradient(90deg, var(--cp-warn-soft), var(--cp-surface) 62%); }
.cp-notice--error { border-left-color: var(--cp-down); background: linear-gradient(90deg, var(--cp-down-soft), var(--cp-surface) 62%); }
.cp-notice--info { border-left-color: var(--cp-info); background: linear-gradient(90deg, var(--cp-info-soft), var(--cp-surface) 62%); }

.cp-notice__icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--cp-surface-2);
    color: var(--cp-primary);
}
.cp-notice--success .cp-notice__icon { background: var(--cp-up-soft); color: var(--cp-up); }
.cp-notice--warn .cp-notice__icon { background: var(--cp-warn-soft); color: var(--cp-warn); }
.cp-notice--error .cp-notice__icon { background: var(--cp-down-soft); color: var(--cp-down); }
.cp-notice--info .cp-notice__icon { background: var(--cp-info-soft); color: var(--cp-info); }

.cp-notice__body { min-width: 0; flex: 1 1 auto; }
.cp-notice__title { font-size: 13.5px; font-weight: 660; display: flex; align-items: center; gap: 8px; }
.cp-notice__text { font-size: 13px; color: var(--cp-text-soft); margin: 3px 0 0; line-height: 1.55; }
.cp-notice__actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cp-notice__close { margin-left: auto; }

/* action link inside the classic alert (kept for flash messages) */
.cp-alert__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ------------------------------------------------------------ rank ladder -- */
.cp-tree { display: grid; gap: 0; }

.cp-tree__item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
}

.cp-tree__rail {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.cp-tree__rail::after {
    content: "";
    position: absolute;
    top: 42px;
    bottom: -4px;
    width: 2px;
    border-radius: 2px;
    background: var(--cp-line);
}

.cp-tree__item:last-child .cp-tree__rail::after { display: none; }
.cp-tree__item.is-done .cp-tree__rail::after { background: var(--cp-up); }

.cp-tree__marker {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 2px solid var(--cp-line);
    background: var(--cp-surface);
    color: var(--cp-text-mute);
    font-size: 13px;
    font-weight: 700;
    z-index: 1;
}

.cp-tree__item.is-done .cp-tree__marker { border-color: var(--cp-up); color: var(--cp-up); background: var(--cp-up-soft); }
.cp-tree__item.is-current .cp-tree__marker {
    border-color: transparent;
    color: #fff;
    background: var(--cp-gradient);
    box-shadow: 0 0 0 4px var(--cp-primary-soft);
}

.cp-tree__card {
    padding: 12px 14px;
    border: 1px solid var(--cp-line);
    border-radius: var(--cp-r);
    background: var(--cp-surface);
    margin-bottom: 14px;
}
.cp-tree__item.is-current .cp-tree__card { border-color: var(--cp-primary); background: var(--cp-surface-2); }
.cp-tree__item.is-locked .cp-tree__card { opacity: 0.72; }

.cp-tree__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-tree__title { font-size: 13.5px; font-weight: 660; }
.cp-tree__meta { font-size: 12px; color: var(--cp-text-mute); }
.cp-tree__perks { margin: 8px 0 0; padding: 0 0 0 2px; list-style: none; display: grid; gap: 4px; }
.cp-tree__perks li { font-size: 12.5px; color: var(--cp-text-soft); display: flex; align-items: flex-start; gap: 7px; }

/* toast with a follow-up action link (eg. after buying a copy plan) */
.cp-toasts { flex-direction: column; }
.cp-toast { flex-wrap: wrap; }
.cp-toast__action {
    width: 100%;
    margin: 8px 0 0 26px;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--cp-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
