/* Apollo — CANSLIM Market Timing page (standalone). Dark theme, matches apollo.css. */
.ct-page { max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px; }

.ct-asof { color: #8b9bb4; font-size: 0.85rem; }

/* WOO banner */
.ct-banner { border-radius: 10px; padding: 16px 20px; margin-bottom: 18px; border: 1px solid #2a3346; }
.ct-banner-open { background: linear-gradient(90deg, rgba(34,197,94,0.14), rgba(34,197,94,0.04)); border-color: rgba(34,197,94,0.5); }
.ct-banner-corr { background: linear-gradient(90deg, rgba(239,68,68,0.16), rgba(239,68,68,0.04)); border-color: rgba(239,68,68,0.55); }
.ct-banner-neutral { background: rgba(255,255,255,0.04); }
.ct-banner-flag { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.5px; }
.ct-banner-open .ct-banner-flag { color: #34d27e; }
.ct-banner-corr .ct-banner-flag { color: #ff6b6b; }
.ct-deep { color: #ffb454; font-weight: 700; margin-left: 6px; }

/* card grid */
.ct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 900px) { .ct-grid { grid-template-columns: 1fr; } }
.ct-card { background: #1a1f2e; border: 1px solid #2a3346; border-radius: 10px; padding: 16px 18px; }
.ct-card h3 { margin: 0 0 12px; font-size: 1rem; color: #cfe0f2; }
.ct-window, .ct-card h3 .ct-window { color: #6b7a90; font-weight: 400; font-size: 0.85rem; }

/* signal lights */
.ct-light { width: 26px; height: 26px; border-radius: 50%; display: inline-block; box-shadow: 0 0 12px currentColor; }
.ct-green { color: #22c55e; } .ct-green.ct-light { background: #22c55e; }
.ct-yellow { color: #eab308; } .ct-yellow.ct-light { background: #eab308; }
.ct-red { color: #ef4444; } .ct-red.ct-light { background: #ef4444; }
.ct-neutral { color: #6b7a90; } .ct-neutral.ct-light { background: #6b7a90; }

/* key-value tables */
.ct-kv { width: 100%; border-collapse: collapse; }
.ct-kv td { padding: 5px 0; font-size: 0.9rem; color: #c7d2e0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ct-kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ct-trend-up { color: #22c55e; } .ct-trend-down { color: #ef4444; }
.ct-yes { color: #34d27e; font-weight: 600; } .ct-no { color: #ff6b6b; font-weight: 600; }
.ct-hint { color: #7e8ca3; font-size: 0.8rem; margin: 10px 0 0; }
.ct-explain { color: #8fa1bd; font-size: 0.82rem; line-height: 1.55; margin: 8px 0 12px; padding-left: 10px; border-left: 3px solid #2a3346; }

/* distribution count (consolidated table cells) */
.ct-ddnum-sm { font-size: 1.15rem; font-weight: 800; line-height: 1; }
.ct-ddband { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.5px; }
td.ct-dd-normal, .ct-dd-normal .ct-ddnum-sm, .ct-dd-normal .ct-ddband { color: #22c55e; }
td.ct-dd-warning, .ct-dd-warning .ct-ddnum-sm, .ct-dd-warning .ct-ddband { color: #eab308; }
td.ct-dd-topping, .ct-dd-topping .ct-ddnum-sm, .ct-dd-topping .ct-ddband { color: #ef4444; }

/* tables */
.ct-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.85rem; }
.ct-table th { text-align: left; color: #8b9bb4; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #2a3346; }
.ct-table td { padding: 6px 8px; color: #c7d2e0; border-bottom: 1px solid rgba(255,255,255,0.04); font-variant-numeric: tabular-nums; }
.ct-dd-table { margin-top: 12px; }

/* chart */
.ct-chart-card { margin-bottom: 18px; }
#ct-chart { width: 100% !important; height: 360px !important; }
.ct-leg-ftd { color: #22c55e; font-weight: 600; }
.ct-leg-ftdq { color: #2dd4bf; font-weight: 600; }
.ct-leg-dd { color: #ef4444; font-weight: 600; }
.ct-leg-stall { color: #ffb454; font-weight: 600; }
.ct-leg-pt { color: #34d27e; font-weight: 600; }

/* Power Trend chip in the WOO banner */
.ct-pt-chip { display: inline-block; background: rgba(34,197,94,0.18); color: #34d27e;
    border: 1px solid rgba(34,197,94,0.55); border-radius: 5px; font-size: 0.78rem;
    font-weight: 800; letter-spacing: 1px; padding: 2px 9px; }

/* FTD tracker (promoted card) */
.ct-ftd-card { margin-bottom: 18px; }
.ct-ftd-status { margin: 0 0 4px; font-size: 0.85rem; }
.ct-nextday-pos { color: #22c55e; font-weight: 700; }
.ct-nextday-neg { color: #ef4444; font-weight: 700; }
.ct-nextday-pending { color: #6b7a90; font-style: italic; }
.ct-undercut { color: #ffb454; font-size: 0.75rem; font-weight: 600; margin-left: 6px; white-space: nowrap; }

/* FTD type badges (classic vs all-session ftd_quality, 2026-07-22) */
.ct-ftd-type-badge { display: inline-block; background: rgba(34,197,94,0.15); color: #22c55e;
    border: 1px solid rgba(34,197,94,0.45); border-radius: 4px; font-size: 0.68rem;
    font-weight: 700; letter-spacing: 0.5px; padding: 0 5px; white-space: nowrap; }
.ct-ftd-quality-badge { background: rgba(45,212,191,0.12); color: #2dd4bf;
    border-color: rgba(45,212,191,0.4); }
.ct-ftdq { color: #2dd4bf; }

/* per-pillar index tag (card headers) */
.ct-idx-tag { display: inline-block; background: rgba(0,212,255,0.08); color: #00d4ff;
    border: 1px solid rgba(0,212,255,0.3); border-radius: 4px; font-size: 0.66rem;
    font-weight: 700; letter-spacing: 0.6px; padding: 0 5px; margin-left: 6px;
    vertical-align: 2px; white-space: nowrap; }

/* stalling badge in the DD table */
.ct-stall-badge { display: inline-block; background: rgba(255,180,84,0.15); color: #ffb454;
    border: 1px solid rgba(255,180,84,0.45); border-radius: 4px; font-size: 0.68rem;
    font-weight: 700; letter-spacing: 0.5px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }

.ct-footnote { color: #6b7a90; font-size: 0.78rem; line-height: 1.5; margin-top: 16px; border-top: 1px solid #2a3346; padding-top: 12px; }

/* Power Trend UNDER PRESSURE (A8) — amber tier between ON and OFF */
.ct-amber { color: #f59e0b; } .ct-amber.ct-light { background: #f59e0b; }
.ct-pt-chip-up { background: rgba(245,158,11,0.16); color: #f5a623; border-color: rgba(245,158,11,0.5); }
.ct-leg-pt-up { color: #f5a623; font-weight: 600; }
.ct-up-tag { color: #f5a623; font-size: 0.8em; font-weight: 600; }

/* ═══════════ Three-pillar consolidated layout (A9 v2, 2026-08-22) ═══════════ */

/* hero — power-trend status board (3-up even on mobile) */
.ct-hero-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.ct-hero-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ct-hero-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
    background: rgba(255,255,255,0.05); border: 1px solid #2a3346; border-radius: 9px;
    padding: 10px 6px; text-decoration: none; }
.ct-hero-cell:hover { background: rgba(255,255,255,0.08); }
.ct-hero-idx { color: #8b9bb4; font-size: 0.78rem; font-weight: 700; letter-spacing: 1px; }
.ct-hero-state { display: inline-flex; align-items: center; gap: 7px; font-size: 1.05rem; }
.ct-hero-sub { color: #7e8ca3; font-size: 0.72rem; }
.ct-light-sm { width: 12px; height: 12px; box-shadow: 0 0 6px currentColor; vertical-align: -1px; }

/* consolidated indicator cards/tables */
.ct-ind-card { margin-bottom: 14px; }
.ct-ind-card .ct-table-scroll + .ct-hint { margin-top: 6px; }
/* per-index changelog dropdowns (PT + WOO tables) */
tr.ct-expand { cursor: pointer; }
tr.ct-expand:hover td { background: rgba(0, 212, 255, 0.05); }
.ct-caret { display: inline-block; margin-right: 6px; color: #00d4ff; font-size: 0.68rem; transition: transform 0.15s ease; }
tr.ct-expand-open .ct-caret { transform: rotate(90deg); }
.ct-hint .ct-caret { margin-right: 3px; }
tr.ct-sub-row > td { background: #141926; padding: 10px 14px 14px; }
.ct-sub-head { font-size: 0.76rem; color: #8b95a8; letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 6px; }
.ct-sub-scroll { max-height: 340px; overflow-y: auto; }
.ct-sub-table { width: auto; min-width: 300px; }
.ct-sub-table th, .ct-sub-table td { padding: 4px 14px 4px 0; font-size: 0.8rem; white-space: nowrap; }
.ct-sub-table thead th { position: sticky; top: 0; background: #141926; z-index: 1; }
tr.ct-flip td { background: rgba(0, 212, 255, 0.07); }
.ct-flip-tag { font-size: 0.66rem; color: #00d4ff; border: 1px solid rgba(0, 212, 255, 0.45); border-radius: 3px; padding: 0 4px; margin-left: 6px; letter-spacing: 0.4px; text-transform: uppercase; vertical-align: 1px; }
.ct-ind-card h3 .ct-learn-link { float: right; font-weight: 400; }
.ct-ind-table th { white-space: nowrap; }
.ct-ind-table td { white-space: normal; }
.ct-ind-table td:first-child { color: #dbe6f5; white-space: nowrap; }

/* FTD Focus */
.ct-focus-name { color: #00d4ff; }
.ct-focus-row td { background: rgba(0,212,255,0.06); }
.ct-focus-badge { display: inline-block; background: rgba(0,212,255,0.14); color: #00d4ff;
    border: 1px solid rgba(0,212,255,0.45); border-radius: 4px; font-size: 0.66rem;
    font-weight: 800; letter-spacing: 0.6px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }

/* chart tabs */
.ct-chart-tabs { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: 2px; }
.ct-chart-tab { padding: 3px 12px; font-size: 0.74rem; background: transparent; color: #8b9bb4;
    border-color: #2a3346; }
.ct-chart-tab:hover { color: #c7d2e0; background: rgba(255,255,255,0.05); }
.ct-chart-tab-active, .ct-chart-tab-active:hover { background: rgba(0,212,255,0.14); color: #00d4ff;
    border-color: rgba(0,212,255,0.45); }

/* DD cluster badge (both indexes ≥4 active DDs) */
.ct-cluster-badge { display: inline-block; background: rgba(239,68,68,0.15); color: #ff6b6b;
    border: 1px solid rgba(239,68,68,0.5); border-radius: 5px; font-size: 0.75rem;
    font-weight: 800; letter-spacing: 0.8px; padding: 2px 9px; white-space: nowrap; }

/* WOO conditions card (full-width, first in the flow) */
.ct-woo-card { margin-bottom: 18px; }
.ct-woo-card .ct-kv { max-width: 520px; }

/* collapsible explainers — open on desktop, JS collapses on mobile at load */
.ct-explain-wrap { margin: 8px 0 12px; }
.ct-explain-wrap summary { cursor: pointer; color: #6b7a90; font-size: 0.78rem; user-select: none; }
.ct-explain-wrap[open] summary { margin-bottom: 4px; }
.ct-explain-wrap .ct-explain { margin: 4px 0 0; }

/* horizontal-scroll wrapper so DD/FTD tables don't blow out narrow screens */
.ct-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ═══════════ Learning & Research Center (public page, 2026-07-19) ═══════════ */

/* public standalone header — deliberately NO app navigation */
.ct-public-header { background: #10141f; border-bottom: 1px solid #2a3346; padding: 14px 20px; }
.ct-public-header-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.ct-public-header .header-logo { font-size: 1.8rem; color: #00d4ff; }
.ct-public-header h1 { margin: 0; font-size: 1.25rem; color: #e6edf6; letter-spacing: 0.3px; }
.ct-public-tag { margin: 2px 0 0; color: #6b7a90; font-size: 0.8rem; }
.ct-public-badge { margin-left: auto; background: rgba(0,212,255,0.1); color: #00d4ff;
    border: 1px solid rgba(0,212,255,0.4); border-radius: 5px; font-size: 0.72rem;
    font-weight: 800; letter-spacing: 1px; padding: 3px 10px; white-space: nowrap; }
.ct-journal-link { color: #e6edf6; text-decoration: none; font-size: 0.85rem; font-weight: 600; white-space: nowrap;
    padding: 7px 14px; border-radius: 8px; background: linear-gradient(135deg, rgba(0,180,224,0.25), rgba(0,144,255,0.18));
    border: 1px solid rgba(0,212,255,0.45); transition: transform 0.15s, box-shadow 0.25s; }
.ct-journal-link:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,160,255,0.3); }

/* section divider between live status and the learning center */
.ct-lc-divider { margin: 34px 0 18px; border-top: 2px solid #2a3346; padding-top: 22px; }
.ct-lc-divider h2 { margin: 0 0 8px; font-size: 1.35rem; color: #e6edf6; }
.ct-lc-divider p { margin: 0; color: #8fa1bd; font-size: 0.92rem; line-height: 1.6; max-width: 860px; }

/* chapters — TLDR-first with collapsible detail */
.ct-chapter { margin-bottom: 18px; }
.ct-chapter-tldr { color: #b6c3d8; font-size: 0.9rem; line-height: 1.65; margin: 0 0 10px; max-width: 860px; }
.ct-chapter-tldr strong { color: #dbe6f5; }
.ct-prose { max-width: 860px; }
.ct-prose p { color: #b6c3d8; font-size: 0.92rem; line-height: 1.7; margin: 0 0 12px; }
.ct-prose strong { color: #dbe6f5; }
.ct-prose em { color: #cfd9ea; }
.ct-ladder { font-weight: 700; letter-spacing: 0.4px; font-size: 0.95rem !important; }
.ct-learn-link { color: #00d4ff; text-decoration: none; font-size: 0.78rem; white-space: nowrap; }
.ct-learn-link:hover { text-decoration: underline; }

/* parameter tables */
.ct-param-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; font-size: 0.85rem; }
.ct-param-table th { text-align: left; color: #8b9bb4; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #2a3346; }
.ct-param-table td { padding: 6px 8px; color: #c7d2e0; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: top; }
.ct-param-table td:first-child { white-space: nowrap; color: #dbe6f5; font-weight: 600; }
.ct-param-table code { color: #00d4ff; font-size: 0.82rem; }

/* per-chapter history blocks */
.ct-history-block { margin-top: 16px; border-top: 1px solid #2a3346; padding-top: 12px; }
.ct-history-block h4 { margin: 0 0 8px; font-size: 0.92rem; color: #cfe0f2; }
.ct-row-click { cursor: pointer; }
.ct-row-click:hover td { background: rgba(0,212,255,0.05); }
.ct-ftd-statline { margin-bottom: 8px; }

/* buttons */
.ct-btn { background: rgba(0,212,255,0.12); color: #00d4ff; border: 1px solid rgba(0,212,255,0.45);
    border-radius: 6px; font-size: 0.82rem; font-weight: 700; padding: 6px 14px; cursor: pointer; }
.ct-btn:hover { background: rgba(0,212,255,0.22); }
.ct-btn-ghost { background: transparent; color: #8b9bb4; border-color: #2a3346; margin-top: 8px; }
.ct-btn-ghost:hover { color: #c7d2e0; background: rgba(255,255,255,0.04); }
.ct-btn-preset { background: rgba(239,68,68,0.1); color: #ff8f8f; border-color: rgba(239,68,68,0.4);
    font-weight: 600; font-size: 0.78rem; padding: 5px 10px; }
.ct-btn-preset:hover { background: rgba(239,68,68,0.2); }

/* lookback controls */
.ct-lb-controls { margin: 4px 0 14px; }
.ct-lb-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 10px; }
.ct-lb-presets-label { color: #8b9bb4; font-size: 0.82rem; font-weight: 600; }
.ct-lb-row label { color: #8b9bb4; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 6px; }
.ct-lb-row input[type="date"], .ct-lb-row select { background: #10141f; color: #c7d2e0;
    border: 1px solid #2a3346; border-radius: 6px; padding: 5px 8px; font-size: 0.82rem; }
#ct-lb-chart { width: 100% !important; height: 420px !important; }
.ct-leg-corr { color: #ff6b6b; font-weight: 600; }

/* as-of readout panel */
.ct-lb-readout { margin-top: 14px; background: #10141f; border: 1px solid #2a3346; border-radius: 10px; padding: 14px 16px; }
.ct-lb-readout h4 { margin: 0 0 10px; font-size: 0.95rem; color: #cfe0f2; }
.ct-lb-readout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ct-lb-readout-item { background: #1a1f2e; border: 1px solid #2a3346; border-radius: 8px; padding: 8px 10px; }
.ct-lb-readout-label { display: block; color: #6b7a90; font-size: 0.72rem; letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 3px; }
.ct-lb-readout-item strong { font-size: 0.98rem; font-variant-numeric: tabular-nums; }

/* trend health — stacked candlestick charts over active power trends */
#trend-health .ct-th-legend { margin: 2px 0 12px; }
.ct-th-lg-ema { color: #b06cf0; font-weight: 600; }
.ct-th-lg-sma { color: #f5a623; font-weight: 600; }
.ct-th-block { margin-top: 14px; background: #10141f; border: 1px solid #2a3346; border-radius: 10px; padding: 12px 14px; }
.ct-th-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ct-th-meta { color: #8b9bb4; font-size: 0.8rem; }
.ct-th-ustreak { margin-left: auto; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.3px; }
.ct-th-canvas-wrap { position: relative; height: 260px; }

/* mobile polish */
@media (max-width: 900px) {
    .ct-page { padding: 12px 12px 48px; }
    .ct-card { padding: 13px 14px; }
    .ct-banner { padding: 12px 14px; }
    .ct-banner-flag { font-size: 1.2rem; }
    .ct-hero-strip { gap: 6px; }
    .ct-hero-cell { padding: 8px 4px; }
    .ct-hero-state { font-size: 0.9rem; }
    .ct-hero-state strong { letter-spacing: 0; }
    .ct-hero-sub { font-size: 0.66rem; }
    .ct-chart-tabs { margin-left: 0; display: flex; margin-top: 8px; }
    .ct-ind-card h3 .ct-learn-link { float: none; margin-left: 8px; }
    .ct-table th, .ct-table td { padding: 5px 6px; font-size: 0.8rem; }
    .ct-chapter-tldr { font-size: 0.85rem; }
    #ct-chart { height: 300px !important; }
    #ct-lb-chart { height: 320px !important; }
    .ct-th-canvas-wrap { height: 210px; }
    .ct-th-ustreak { margin-left: 0; width: 100%; }
    .ct-public-header h1 { font-size: 1.05rem; }
    .ct-public-badge { display: none; }
    .ct-journal-link { margin-left: auto; padding: 6px 10px; font-size: 0.78rem; }
    .ct-prose p { font-size: 0.88rem; }
}
