/* ============================================================================
   AurumGamma COT Terminal — v4 layout (sectioned, explained, animated)
   Scoped under .cx so nav, footer, paywall and modal styles are untouched.
   ============================================================================ */

.cx {
    --cx-bg: #07090e;
    --cx-panel: #0f141c;
    --cx-panel-2: #131a25;
    --cx-line: rgba(148, 163, 184, 0.14);
    --cx-line-strong: rgba(148, 163, 184, 0.28);
    --cx-ink: #f1f5f9;
    --cx-ink-2: #cbd5e1;
    --cx-ink-3: #8b97a8;
    --cx-gold: #ffd700;
    --cx-cyan: #00f0ff;
    /* status (polarity): always shipped with an arrow/label, never colour alone */
    --cx-up: #22c55e;
    --cx-up-soft: rgba(34, 197, 94, 0.14);
    --cx-dn: #ef4444;
    --cx-dn-soft: rgba(239, 68, 68, 0.14);
    --cx-neu: #f59e0b;
    --cx-neu-soft: rgba(245, 158, 11, 0.14);
    /* series identity (validated: dark surface #0f141c, CVD ΔE ≥ 8) */
    --cx-s-funds: #c98500;
    --cx-s-retail: #3987e5;
    --cx-s-oi: #199e70;
    --cx-s-price: #cbd5e1;
    --cx-radius: 14px;
    --cx-mono: 'Share Tech Mono', ui-monospace, Consolas, monospace;
    --cx-sans: 'Inter', 'Outfit', system-ui, sans-serif;
    background:
        radial-gradient(1200px 500px at 15% -5%, rgba(0, 240, 255, 0.06), transparent 60%),
        radial-gradient(900px 500px at 95% 5%, rgba(255, 215, 0, 0.05), transparent 60%),
        var(--cx-bg);
    color: var(--cx-ink);
    font-family: var(--cx-sans);
}

/* overflow-x:hidden on these turns them into scroll containers and breaks the
   sticky section nav; clip keeps the no-horizontal-scroll guarantee without that. */
html, body.saas-layout, .saas-page.cx { overflow-x: clip !important; overflow-y: visible !important; }

.cx-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx strong, .cx b { font-weight: 700; }
.cx .num, .cx [data-num] { font-variant-numeric: tabular-nums; }

.tone-bull { color: var(--cx-up); }
.tone-bear { color: var(--cx-dn); }
.tone-neu  { color: var(--cx-neu); }

/* ---------- HERO ---------- */
.cx-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: end;
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--cx-line);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.07), rgba(255, 215, 0, 0.04) 55%, transparent),
        var(--cx-panel);
    position: relative;
    overflow: hidden;
    min-height: 196px;
}
.cx-hero::after {
    content: "";
    position: absolute; inset: auto -10% -60% auto;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.10), transparent 65%);
    pointer-events: none;
}
.cx-eyebrow {
    font-family: var(--cx-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--cx-cyan);
    margin-bottom: 0.55rem;
}
.cx-title {
    font-size: clamp(1.55rem, 2.6vw, 2.25rem);
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 0.6rem;
    color: var(--cx-ink);
    letter-spacing: -0.01em;
}
.cx-lede { color: var(--cx-ink-2); font-size: 0.98rem; line-height: 1.55; max-width: 62ch; margin: 0; }

.cx-hero-side { display: flex; flex-direction: column; gap: 0.75rem; align-items: stretch; position: relative; z-index: 1; }
.cx-weeknav {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--cx-line-strong);
    border-radius: 12px;
    padding: 0.45rem;
}
.cx-weeknav-btn, .cx-weeknav-latest {
    background: var(--cx-panel-2);
    color: var(--cx-ink);
    border: 1px solid var(--cx-line-strong);
    border-radius: 9px;
    height: 40px; min-width: 40px;
    font-size: 1.35rem; line-height: 1;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}
.cx-weeknav-latest { font-size: 0.8rem; font-weight: 700; padding: 0 0.8rem; letter-spacing: .02em; color: var(--cx-gold); }
.cx-weeknav-btn:hover, .cx-weeknav-latest:hover { border-color: var(--cx-gold); background: #1a2230; }
.cx-weeknav-btn:active { transform: scale(0.96); }
.cx-weeknav-btn:disabled { opacity: .35; cursor: default; border-color: var(--cx-line); }
.cx-weeknav-label { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cx-weeknav-label span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cx-ink-3); padding-left: 2px; }
.cx-weeknav-label select {
    width: 100%;
    background: transparent; color: var(--cx-ink);
    border: 0; font: 700 1.05rem var(--cx-mono);
    cursor: pointer; outline: none; padding: 0;
}
.cx-weeknav-label select option { background: #0f141c; color: #f1f5f9; }

.cx-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cx-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.8rem; color: var(--cx-ink-2);
    border: 1px solid var(--cx-line-strong);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
}
.cx-chip strong { color: var(--cx-ink); font-family: var(--cx-mono); font-weight: 400; font-size: 0.86rem; }
.cx-chip-ok { color: var(--cx-cyan); border-color: rgba(0, 240, 255, 0.4); background: rgba(0, 240, 255, 0.08); font-weight: 700; font-size: 0.74rem; letter-spacing: .04em; }
.cx-chip-ok.provisional { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.5); background: rgba(196, 181, 253, 0.1); }
.cx-chip-live { border-color: rgba(255, 215, 0, 0.35); }
.cx-chip-live strong { color: var(--cx-gold); }
.cx-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--cx-gold); box-shadow: 0 0 0 0 rgba(255, 215, 0, .6); animation: cx-pulse 2s infinite; }
@keyframes cx-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, .55); } 70% { box-shadow: 0 0 0 9px rgba(255, 215, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); } }
.cx-hero-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; font-size: 0.74rem; color: var(--cx-ink-3); }
.cx-hero-meta strong { font-family: var(--cx-mono); font-weight: 400; color: var(--cx-ink-2); }

/* ---------- SECTION NAV ---------- */
.cx-steps {
    position: sticky; top: var(--cx-sticky-top, 110px); z-index: 40;
    display: flex; gap: 0.35rem;
    overflow-x: auto; scrollbar-width: none;
    padding: 0.45rem;
    margin: 0 0 1.75rem;
    background: rgba(7, 9, 14, 0.82);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--cx-line);
    border-radius: 12px;
}
.cx-steps::-webkit-scrollbar { display: none; }
.cx-steps a {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    color: var(--cx-ink-3); text-decoration: none;
    font-size: 0.84rem; font-weight: 600;
    transition: color .15s, background .15s;
}
.cx-steps a b {
    display: inline-grid; place-items: center;
    width: 20px; height: 20px; border-radius: 6px;
    font: 700 0.7rem var(--cx-mono);
    background: rgba(255, 255, 255, 0.06); color: var(--cx-ink-2);
}
.cx-steps a:hover { color: var(--cx-ink); background: rgba(255, 255, 255, 0.04); }
.cx-steps a.active { color: var(--cx-ink); background: rgba(255, 215, 0, 0.1); }
.cx-steps a.active b { background: var(--cx-gold); color: #000; }

/* ---------- SECTIONS ---------- */
.cx-sec { margin: 0 0 2.75rem; scroll-margin-top: 130px; }
.cx-sec-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.cx-sec-num {
    font: 700 0.85rem var(--cx-mono);
    color: var(--cx-gold);
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.06);
    border-radius: 8px;
    padding: 0.3rem 0.5rem;
    margin-top: 0.15rem;
}
.cx-sec-head h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 0.25rem; color: var(--cx-ink); letter-spacing: -0.005em; }
.cx-sec-head p { margin: 0; color: var(--cx-ink-3); font-size: 0.92rem; line-height: 1.5; max-width: 80ch; }

.cx-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--cx-panel);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    padding: 1.25rem;
    position: relative;
    min-width: 0;
    transition: border-color .2s, transform .2s;
}
.cx-card:hover { border-color: var(--cx-line-strong); }
.cx-card-label {
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.09em;
    color: var(--cx-ink-3);
    margin-bottom: 0.85rem;
}
.cx-k { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cx-ink-3); margin-bottom: 3px; }

/* reveal on scroll */
.cx-reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.cx-reveal.cx-in { opacity: 1; transform: none; }
.cx-flash { animation: cx-flash .7s ease; }
@keyframes cx-flash { 0% { background-color: rgba(255, 215, 0, 0.10); } 100% { background-color: transparent; } }

/* ---------- 1. VERDICT ---------- */
.cx-verdict-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.25fr); gap: 1rem; }
.cx-gauge-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.cx-gauge { width: 100%; max-width: 280px; height: auto; display: block; overflow: visible; }
.cx-gauge-seg { fill: none; stroke-width: 16; stroke-linecap: butt; }
.seg-sbear { stroke: #b91c1c; }
.seg-bear  { stroke: #ef4444; opacity: .8; }
.seg-neu   { stroke: #64748b; }
.seg-bull  { stroke: #22c55e; opacity: .8; }
.seg-sbull { stroke: #15803d; }
.cx-gauge-needle { transform-box: view-box; transform-origin: 120px 120px; transition: transform 1.1s cubic-bezier(.2, 1.3, .4, 1); }
.cx-gauge-needle line { stroke: var(--cx-ink); stroke-width: 3.5; stroke-linecap: round; }
.cx-gauge-needle circle { fill: var(--cx-ink); stroke: var(--cx-panel); stroke-width: 3; }
.cx-gauge-tick { fill: var(--cx-ink-3); font: 10px var(--cx-mono); }
.cx-gauge-readout { margin-top: -0.4rem; line-height: 1; }
.cx-gauge-score { font: 800 3rem var(--cx-sans); color: var(--cx-ink); font-variant-numeric: tabular-nums; }
.cx-gauge-of { font: 600 1rem var(--cx-sans); color: var(--cx-ink-3); margin-left: 2px; }
.cx-bias { font-size: 1.35rem; font-weight: 900; letter-spacing: .06em; margin: 0.45rem 0 0.7rem; }
.cx-gauge-foot { display: flex; gap: 1.2rem; font-size: 0.82rem; color: var(--cx-ink-3); justify-content: center; flex-wrap: wrap; }
.cx-gauge-foot strong { color: var(--cx-ink); font-family: var(--cx-mono); font-weight: 400; font-size: 0.92rem; }
.cx-gauge-foot strong.tone-bull { color: var(--cx-up); }
.cx-gauge-foot strong.tone-bear { color: var(--cx-dn); }

.cx-action {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 1.5rem; font-weight: 900; letter-spacing: .04em;
    padding: 0.4rem 0.9rem;
    border-radius: 10px;
    border: 1px solid currentColor;
}
.cx-action.tone-bull { background: var(--cx-up-soft); }
.cx-action.tone-bear { background: var(--cx-dn-soft); }
.cx-action.tone-neu  { background: var(--cx-neu-soft); }
.cx-why { color: var(--cx-ink-2); font-size: 0.9rem; line-height: 1.5; margin: 0.8rem 0 1rem; }

.cx-ladder { position: relative; height: 170px; margin-left: 6px; }
.cx-ladder-track { position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--cx-line-strong), var(--cx-line-strong)); border-radius: 2px; }
.cx-ladder-pt {
    position: absolute; left: 0; right: 0;
    display: grid; grid-template-columns: 16px 1fr auto 58px; align-items: center; gap: 0.6rem;
    transform: translateY(-50%);
    transition: top .7s cubic-bezier(.2, .8, .2, 1);
    font-size: 0.85rem;
}
.cx-ladder-dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--cx-panel); background: var(--cx-ink-3); box-shadow: 0 0 0 1px var(--cx-line-strong); }
.pt-now .cx-ladder-dot { background: var(--cx-gold); box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.18); }
.pt-now .cx-ladder-name, .pt-now .cx-ladder-px { color: var(--cx-gold); font-weight: 700; }
.cx-ladder-name { color: var(--cx-ink-3); }
.cx-ladder-px { font-family: var(--cx-mono); color: var(--cx-ink); font-size: 0.95rem; }
.cx-ladder-dist { font-family: var(--cx-mono); font-size: 0.78rem; text-align: right; color: var(--cx-ink-3); }
.cx-ladder-pt.is-stop .cx-ladder-dot { background: var(--cx-dn); }
.cx-ladder-pt.is-goal .cx-ladder-dot { background: var(--cx-up); }

.cx-brief { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.cx-brief li { display: grid; grid-template-columns: 26px 1fr; gap: 0.6rem; align-items: start; font-size: 0.93rem; line-height: 1.5; color: var(--cx-ink-2); }
.cx-brief li b { color: var(--cx-ink); }
.cx-brief-ico {
    width: 26px; height: 26px; border-radius: 8px;
    display: grid; place-items: center; font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid currentColor;
}
.cx-brief-phase { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px dashed var(--cx-line-strong); font-size: 0.85rem; color: var(--cx-ink-3); }
.cx-brief-phase strong { color: var(--cx-gold); letter-spacing: .03em; }

/* ---------- 2. GROUPS ---------- */
.cx-groups-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cx-group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.cx-group-name { font-weight: 800; font-size: 1rem; color: var(--cx-ink); }
.cx-group-role { font-size: 0.78rem; color: var(--cx-ink-3); margin-top: 2px; line-height: 1.4; }
.cx-group-tag { font-size: 0.66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 0.2rem 0.45rem; border-radius: 6px; border: 1px solid currentColor; white-space: nowrap; }
.cx-group-net { font: 800 1.85rem var(--cx-sans); margin: 0.85rem 0 0.1rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cx-group-net small { font-size: 0.75rem; font-weight: 600; color: var(--cx-ink-3); margin-left: 4px; letter-spacing: 0; }
.cx-delta { display: inline-flex; align-items: center; gap: 0.3rem; font: 600 0.8rem var(--cx-mono); padding: 0.15rem 0.45rem; border-radius: 6px; }
.cx-delta.up { color: var(--cx-up); background: var(--cx-up-soft); }
.cx-delta.dn { color: var(--cx-dn); background: var(--cx-dn-soft); }
.cx-delta.flat { color: var(--cx-ink-3); background: rgba(255, 255, 255, 0.05); }
.cx-split { margin-top: 1rem; }
.cx-split-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: transparent; }
.cx-split-long { background: var(--cx-up); border-radius: 6px 2px 2px 6px; transition: flex-basis .8s cubic-bezier(.2, .8, .2, 1); }
.cx-split-short { background: var(--cx-dn); border-radius: 2px 6px 6px 2px; transition: flex-basis .8s cubic-bezier(.2, .8, .2, 1); }
.cx-split-legend { display: flex; justify-content: space-between; margin-top: 0.45rem; font-size: 0.76rem; color: var(--cx-ink-3); }
.cx-split-legend b { font-family: var(--cx-mono); font-weight: 400; color: var(--cx-ink-2); }
.cx-group-extra { margin-top: 0.75rem; padding-top: 0.65rem; border-top: 1px dashed var(--cx-line); font-size: 0.78rem; color: var(--cx-ink-3); display: flex; justify-content: space-between; }
.cx-group-extra b { font-family: var(--cx-mono); font-weight: 400; color: var(--cx-ink-2); }
.cx-group-card { border-top: 3px solid var(--cx-line-strong); display: flex; flex-direction: column; }
.cx-group-card .cx-group-head { flex: 1 0 auto; }
.cx-group-card.g-funds { border-top-color: var(--cx-s-funds); }
.cx-group-card.g-retail { border-top-color: var(--cx-s-retail); }

.cx-netbars { display: flex; flex-direction: column; gap: 0.55rem; }
.cx-netbar { display: grid; grid-template-columns: 150px 1fr 96px; gap: 0.8rem; align-items: center; font-size: 0.85rem; }
.cx-netbar-name { color: var(--cx-ink-2); font-weight: 600; }
.cx-netbar-track { position: relative; height: 18px; }
.cx-netbar-track::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--cx-line-strong); }
.cx-netbar-fill { position: absolute; top: 0; height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1), left .8s cubic-bezier(.2, .8, .2, 1); }
.cx-netbar-fill.long { background: var(--cx-up); border-radius: 0 4px 4px 0; }
.cx-netbar-fill.short { background: var(--cx-dn); border-radius: 4px 0 0 4px; }
.cx-netbar-val { font-family: var(--cx-mono); text-align: right; color: var(--cx-ink); }

/* ---------- 3. SIGNALS ---------- */
.cx-signals-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.cx-signal { display: flex; flex-direction: column; }
.cx-signal-title { font-size: 0.82rem; font-weight: 700; color: var(--cx-ink-2); }
.cx-signal-value { font: 800 1.7rem var(--cx-sans); color: var(--cx-ink); margin: 0.5rem 0 0.15rem; font-variant-numeric: tabular-nums; }
.cx-signal-value small { font-size: 0.8rem; color: var(--cx-ink-3); font-weight: 600; margin-left: 3px; }
.cx-signal-sub { font-size: 0.76rem; color: var(--cx-ink-3); min-height: 1.1em; }
.cx-meter { position: relative; margin: 0.85rem 0 0.35rem; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(239, 68, 68, .55), rgba(100, 116, 139, .45) 50%, rgba(34, 197, 94, .55)); }
.cx-meter.inv { background: linear-gradient(90deg, rgba(34, 197, 94, .55), rgba(100, 116, 139, .45) 50%, rgba(239, 68, 68, .55)); }
.cx-meter.plain { background: linear-gradient(90deg, rgba(25, 158, 112, .2), rgba(25, 158, 112, .7)); }
.cx-meter-mark {
    position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%;
    background: var(--cx-ink); border: 3px solid var(--cx-panel); box-shadow: 0 0 0 1px var(--cx-line-strong);
    transform: translate(-50%, -50%);
    transition: left .9s cubic-bezier(.2, .9, .2, 1);
}
.cx-meter-scale { display: flex; justify-content: space-between; font-size: 0.66rem; color: var(--cx-ink-3); font-family: var(--cx-mono); }
.cx-signal-tag { align-self: flex-start; margin-top: 0.8rem; font-size: 0.72rem; font-weight: 800; letter-spacing: .05em; padding: 0.25rem 0.55rem; border-radius: 6px; border: 1px solid currentColor; }
.cx-signal-tag.tone-bull { background: var(--cx-up-soft); }
.cx-signal-tag.tone-bear { background: var(--cx-dn-soft); }
.cx-signal-tag.tone-neu { background: var(--cx-neu-soft); }
.cx-signal-means { font-size: 0.8rem; color: var(--cx-ink-3); line-height: 1.45; margin-top: 0.6rem; }

/* ---------- 4. FLOWS HEATMAP ---------- */
.cx-heat-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cx-heat { width: 100%; border-collapse: separate; border-spacing: 2px; min-width: 720px; font-size: 0.85rem; }
.cx-heat th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cx-ink-3); font-weight: 700; padding: 0.4rem 0.5rem; text-align: center; }
.cx-heat th:first-child, .cx-heat td:first-child { text-align: left; }
.cx-heat tbody th { text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: var(--cx-ink-2); font-weight: 600; padding: 0.6rem 0.6rem 0.6rem 0; white-space: nowrap; }
.cx-heat tbody th small { display: block; color: var(--cx-ink-3); font-weight: 400; font-size: 0.72rem; }
.cx-heat td {
    text-align: center; font-family: var(--cx-mono); color: var(--cx-ink);
    padding: 0.6rem 0.4rem; border-radius: 6px;
    background: rgba(100, 116, 139, 0.08);
    transition: background-color .5s ease, transform .15s;
    cursor: default;
}
.cx-heat td:hover { transform: scale(1.04); box-shadow: 0 0 0 1px var(--cx-line-strong); }
.cx-heat-legend { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.8rem; font-size: 0.76rem; color: var(--cx-ink-3); flex-wrap: wrap; }
.cx-heat-legend .sw { width: 18px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 0.5rem; }
.cx-heat-legend .sw-dn { background: rgba(239, 68, 68, .6); margin-left: 0; }
.cx-heat-legend .sw-0 { background: rgba(100, 116, 139, .25); }
.cx-heat-legend .sw-up { background: rgba(34, 197, 94, .6); }

/* ---------- 5. CYCLE ---------- */
.cx-cycle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.6rem; counter-reset: ph; }
.cx-cycle li {
    position: relative;
    border: 1px solid var(--cx-line);
    border-radius: 12px;
    padding: 0.85rem 0.8rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color .3s, background .3s, transform .3s;
}
.cx-cycle li:not(:last-child)::after {
    content: "\203A"; position: absolute; right: -0.55rem; top: 50%; transform: translateY(-50%);
    color: var(--cx-ink-3); font-size: 1rem; z-index: 1;
}
.cx-cycle-n { font: 700 0.7rem var(--cx-mono); color: var(--cx-ink-3); }
.cx-cycle-name { font-weight: 800; font-size: 0.92rem; color: var(--cx-ink-2); margin: 0.2rem 0 0.25rem; }
.cx-cycle-desc { font-size: 0.74rem; color: var(--cx-ink-3); line-height: 1.4; }
.cx-cycle-prob { margin-top: 0.55rem; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cx-cycle-prob i { display: block; height: 100%; width: 0; background: var(--cx-gold); transition: width .9s ease; }
.cx-cycle li.on { border-color: rgba(255, 215, 0, 0.6); background: rgba(255, 215, 0, 0.07); transform: translateY(-3px); box-shadow: 0 10px 30px -12px rgba(255, 215, 0, 0.35); }
.cx-cycle li.on .cx-cycle-name { color: var(--cx-gold); }
.cx-cycle li.on .cx-cycle-n { color: var(--cx-gold); }
.cx-cycle-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--cx-line-strong); }
.cx-cycle-foot strong { font-size: 1.05rem; color: var(--cx-ink); }
.cx-phase-strip-wrap { margin-top: 1.1rem; }
.cx-phase-strip { display: grid; grid-template-columns: repeat(52, minmax(0, 1fr)); gap: 2px; margin-top: 0.4rem; }
.cx-phase-strip span { height: 22px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); cursor: pointer; transition: transform .12s; }
.cx-phase-strip span:hover { transform: scaleY(1.25); }
.cx-phase-strip span.same { background: rgba(255, 215, 0, 0.75); }
.cx-phase-strip span.sel { outline: 2px solid var(--cx-ink); outline-offset: 1px; }

/* ---------- 6. CHARTS ---------- */
.cx-chart-toolbar { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.cx-tabs, .cx-range, .cx-filter { display: flex; gap: 0.3rem; flex-wrap: wrap; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--cx-line); border-radius: 10px; padding: 0.3rem; }
.cx-tabs button, .cx-range button, .cx-filter button {
    background: transparent; border: 0; color: var(--cx-ink-3);
    font: 600 0.82rem var(--cx-sans); padding: 0.45rem 0.75rem; border-radius: 7px; cursor: pointer;
    transition: background .15s, color .15s;
}
.cx-tabs button:hover, .cx-range button:hover, .cx-filter button:hover { color: var(--cx-ink); }
.cx-tabs button.active, .cx-range button.active, .cx-filter button.active { background: var(--cx-panel-2); color: var(--cx-ink); box-shadow: inset 0 0 0 1px var(--cx-line-strong); }
.cx-chart-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9rem; color: var(--cx-ink-2); margin-bottom: 0.6rem; }
.cx-chart-title-sub { margin-top: 1rem; font-size: 0.8rem; color: var(--cx-ink-3); }
.cx-chart-now { margin-left: auto; font: 400 0.85rem var(--cx-mono); color: var(--cx-ink); }
.cx-swatch { width: 14px; height: 3px; border-radius: 2px; background: var(--cx-s-funds); display: inline-block; }
.cx-swatch.sw-price { background: var(--cx-s-price); }
.cx-canvas { position: relative; width: 100%; }
.cx-canvas-lg { height: 320px; }
.cx-canvas-sm { height: 140px; }
.cx-canvas-md { height: 230px; }
.cx-chart-main { margin-bottom: 1rem; }
.cx-chart-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.cx-legend { display: flex; gap: 1rem; font-size: 0.76rem; color: var(--cx-ink-3); margin: -0.2rem 0 0.6rem; }
.cx-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cx-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.cx-legend .lg-long { background: var(--cx-up); }
.cx-legend .lg-short { background: var(--cx-dn); }
.cx-legend .lg-retail { background: var(--cx-s-retail); }
.cx-legend .lg-zone { background: rgba(239, 68, 68, .35); height: 10px; }
.cx-charts { position: relative; }
.cx-charts.pro-locked { min-height: 420px !important; }

/* ---------- 7. HISTORY ---------- */
.cx-history-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.cx-history-count { font-size: 0.8rem; color: var(--cx-ink-3); }
.cx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1px solid var(--cx-line); }
.cx-table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 0.85rem; }
.cx-table thead th {
    position: sticky; top: 0;
    background: var(--cx-panel-2); color: var(--cx-ink-3);
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
    text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--cx-line-strong);
}
.cx-table th.num, .cx-table td.num { text-align: right; }
.cx-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--cx-line); color: var(--cx-ink-2); white-space: nowrap; }
.cx-table td.num { font-family: var(--cx-mono); color: var(--cx-ink); }
.cx-table tbody tr { cursor: pointer; transition: background .12s; }
.cx-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.cx-table tbody tr.selected-row { background: rgba(255, 215, 0, 0.08); box-shadow: inset 3px 0 0 var(--cx-gold); }
.cx-table td.cx-date { font-family: var(--cx-mono); color: var(--cx-ink); }
.cx-pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 800; letter-spacing: .03em; padding: 0.2rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; }
.cx-pill.tone-bull { background: var(--cx-up-soft); }
.cx-pill.tone-bear { background: var(--cx-dn-soft); }
.cx-pill.tone-neu { background: var(--cx-neu-soft); }
.cx-scorebar { display: inline-flex; align-items: center; gap: 0.5rem; }
.cx-scorebar i { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); position: relative; overflow: hidden; }
.cx-scorebar i u { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; text-decoration: none; }
.cx-scorebar b { font-family: var(--cx-mono); font-weight: 400; color: var(--cx-ink); min-width: 1.6em; }
.cx-status { font-size: 0.7rem; font-weight: 800; letter-spacing: .06em; color: var(--cx-cyan); }
.cx-status.prov { color: #c4b5fd; }
.cx-empty { text-align: center; color: var(--cx-ink-3); padding: 2rem !important; }
.cx-more {
    display: block; margin: 1rem auto 0;
    background: var(--cx-panel-2); color: var(--cx-ink);
    border: 1px solid var(--cx-line-strong); border-radius: 10px;
    padding: 0.6rem 1.2rem; font: 600 0.85rem var(--cx-sans); cursor: pointer;
}
.cx-more:hover { border-color: var(--cx-gold); }
.cx-more[hidden] { display: none; }
.cx-source { font-size: 0.76rem; color: var(--cx-ink-3); margin: 1rem 0 0; line-height: 1.5; }

/* toast when a week is loaded from the history table */
.cx-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 1000;
    transform: translate(-50%, 20px); opacity: 0;
    background: #111827; color: var(--cx-ink);
    border: 1px solid rgba(255, 215, 0, 0.45);
    border-radius: 999px; padding: 0.6rem 1rem;
    font-size: 0.85rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
    transition: opacity .25s, transform .25s;
    pointer-events: none; white-space: nowrap;
}
.cx-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cx-toast b { color: var(--cx-gold); font-family: var(--cx-mono); font-weight: 400; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1180px) {
    .cx-verdict-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cx-brief-card { grid-column: 1 / -1; }
    .cx-groups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-signals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cx-cycle { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cx-cycle li:nth-child(3)::after { display: none; }
}
@media (max-width: 860px) {
    .cx-hero { grid-template-columns: minmax(0, 1fr); padding: 1.25rem; }
    .cx-verdict-grid { grid-template-columns: minmax(0, 1fr); }
    .cx-signals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-chart-pair { grid-template-columns: minmax(0, 1fr); }
    .cx-cycle-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .cx-container { padding: 0 12px; }
    .cx-groups-grid, .cx-signals-grid { grid-template-columns: minmax(0, 1fr); }
    .cx-cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-cycle li::after { display: none; }
    .cx-netbar { grid-template-columns: 96px 1fr 78px; gap: 0.5rem; font-size: 0.78rem; }
    .cx-phase-strip { grid-template-columns: repeat(26, minmax(0, 1fr)); }
    .cx-phase-strip span { height: 16px; }
    .cx-canvas-lg { height: 250px; }
    .cx-gauge-score { font-size: 2.6rem; }
    .cx-sec-head h2 { font-size: 1.15rem; }
    .cx-ladder-pt { grid-template-columns: 16px 1fr auto 50px; font-size: 0.8rem; }
    .cx-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
    .cx-tabs button { flex: 0 0 auto; }
}
/* Phones: reflow the two wide tables so nothing needs a sideways swipe */
@media (max-width: 640px) {
    .cx-heat-wrap { overflow: visible; }
    .cx-heat { min-width: 0; border-spacing: 0; }
    .cx-heat thead { display: none; }
    .cx-heat, .cx-heat tbody { display: block; }
    .cx-heat tbody tr {
        display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px;
        padding: 0.65rem 0; border-bottom: 1px solid var(--cx-line);
    }
    .cx-heat tbody tr:last-child { border-bottom: 0; }
    .cx-heat tbody th { grid-column: 1 / -1; padding: 0 0 0.35rem; display: flex; align-items: baseline; gap: 0.5rem; }
    .cx-heat tbody th small { display: inline; }
    .cx-heat td { padding: 0.35rem 0.1rem; font-size: 0.7rem; letter-spacing: -0.02em; border-radius: 5px; }
    .cx-heat td::before { content: attr(data-h); display: block; font: 600 0.58rem var(--cx-sans); color: var(--cx-ink-2); opacity: .8; letter-spacing: .04em; margin-bottom: 2px; }
    .cx-heat td:hover { transform: none; }

    .cx-table-wrap { border: 0; overflow: visible; }
    .cx-table { min-width: 0; }
    .cx-table thead { display: none; }
    .cx-table, .cx-table tbody { display: block; }
    .cx-table tbody tr {
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem 0.75rem;
        border: 1px solid var(--cx-line); border-radius: 12px;
        padding: 0.8rem 0.85rem; margin-bottom: 0.6rem; background: rgba(255, 255, 255, 0.02);
    }
    .cx-table tbody tr.selected-row { box-shadow: inset 3px 0 0 var(--cx-gold); border-color: rgba(255, 215, 0, 0.45); }
    .cx-table td { padding: 0; border: 0; white-space: nowrap; text-align: left !important; font-size: 0.82rem; min-width: 0; }
    .cx-table td::before { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; content: attr(data-label); display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: .07em; color: var(--cx-ink-3); margin-bottom: 2px; font-family: var(--cx-sans); }
    .cx-table td.cx-date { grid-column: 1 / 3; font-size: 0.95rem; }
    .cx-table td.cx-c-status { grid-column: 3; grid-row: 1; text-align: right !important; }
    .cx-table td.cx-c-status::before { text-align: right; }
    .cx-table td.cx-c-bias { grid-column: 1 / -1; }
    .cx-table td.cx-c-bias::before, .cx-table td.cx-date::before { display: none; }
    .cx-table td.cx-empty { grid-column: 1 / -1; }
    .cx-table td.cx-empty::before { display: none; }
    .cx-scorebar i { width: 44px; }
}
@media (max-width: 380px) {
    .cx-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cx-table td.cx-date { grid-column: 1; }
    .cx-table td.cx-c-status { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
    .cx *, .cx *::before, .cx *::after { transition: none !important; animation: none !important; }
    .cx-reveal { opacity: 1; transform: none; }
}
