/* ============================================================
   FTF Dashboard — Monochrome Command Center v4
   Goals: full-viewport fit (no scroll), percentage-based rows,
   monochrome grays except status indicators and signal colors.
   ============================================================ */

:root {
    /* Surfaces — monochrome dark */
    --bg:           #0a0a0a;
    --bg-deep:      #050505;
    --panel:        #141414;
    --panel-soft:   #181818;
    --panel-hover:  #1f1f1f;
    --border:       #2a2a2a;
    --border-soft:  #1f1f1f;

    /* Text — neutral grays */
    --text:         #e8e8e8;
    --text-strong:  #ffffff;
    --muted:        #888888;
    --muted-soft:   #555555;

    /* Accents — kept only for indicators, deltas, and signal lines */
    --accent:       #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft:  rgba(59, 130, 246, 0.12);
    --accent-light: #7dd3fc;
    --accent-light-soft: rgba(125, 211, 252, 0.14);
    --accent-green: #10b981;
    --accent-green-soft: rgba(16, 185, 129, 0.12);
    --danger:       #ef4444;
    --danger-soft:  rgba(239, 68, 68, 0.12);
    --warning:      #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);

    /* Effects */
    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 4px 16px rgba(0, 0, 0, 0.4);

    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Reset --- */
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
    display: flex;
    flex-direction: column;
}

/* --- Top bar (7vh) --- */
.ftf-topbar {
    flex: 0 0 8vh;
    min-height: 50px;
    max-height: 80px;
    display: grid;
    grid-template-columns: minmax(220px, auto) 1fr minmax(220px, auto);
    align-items: center;
    gap: 20px;
    padding: 0 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
}
.ftf-brand {
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
    height: 100%;
    padding: 8px 0;
}
.ftf-logo-img {
    height: 100%;
    max-height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
    border-radius: 0px;
}
.ftf-brand-text { line-height: 1.2; min-width: 0; }
.ftf-brand-text p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Search --- */
.ftf-search {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.ftf-search-input {
    width: 100%;
    padding: 7px 64px 7px 34px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 12.5px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
    height: 34px;
}
.ftf-search-input::placeholder { color: var(--muted-soft); }
.ftf-search-input:focus {
    border-color: var(--muted);
    background: var(--panel-soft);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.ftf-search-icon {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.ftf-search-go {
    position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 11px;
    color: var(--text);
    background: var(--panel-hover);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}
.ftf-search-go:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}
.ftf-search-go:active { transform: translateY(-50%) scale(0.95); }

/* --- Header right meta --- */
.ftf-header-meta {
    display: flex; align-items: center; gap: 10px;
    justify-content: flex-end;
}
.ftf-status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px;
    background: var(--accent-green-soft);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 999px;
    font-size: 10.5px; font-weight: 500;
}
.ftf-status-pill .dot {
    width: 5px; height: 5px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.ftf-timestamp {
    font-size: 10.5px; color: var(--muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* --- Body shell — fills remaining 90vh, percentage rows --- */
.ftf-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    /* 4 visible rows: kpi (20), middle (35), modules row 1 (20), modules row 2 (15) */
    grid-template-rows: 15fr 50fr 28fr;
    gap: 8px;
    padding: 0 12px 12px;
}

/* --- Section title (compact, near-invisible) --- */
.ftf-section-title {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 0 4px;
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-soft);
}
.ftf-section-title .meta {
    font-weight: 400; color: var(--muted-soft);
    text-transform: none; letter-spacing: normal;
    font-size: 10px;
}

/* --- KPI row (Signal Highlights) --- */
.ftf-kpi-row {
    display: flex; flex-direction: column;
    min-height: 0;
}
.ftf-kpi-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    min-height: 0;
}
.ftf-kpi {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s;
    display: flex; flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}
.ftf-kpi:hover { border-color: var(--muted-soft); }
.ftf-kpi-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2px;
}
.ftf-kpi-label {
    font-size: 10.5px; color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ftf-kpi-icon {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    border-radius: 5px;
    background: var(--accent-light-soft);
    color: var(--accent-light);
}
.ftf-kpi-value {
    font-size: 20px; font-weight: 300;
    color: var(--text-strong);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 2px;
}
.ftf-kpi-meta {
    font-size: 11px; color: var(--muted);
}
.ftf-kpi-delta {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 3px;
    margin-top: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px; font-weight: 600;
    font-family: var(--font-mono);
}
.ftf-kpi-delta.up   { background: var(--accent-green-soft); color: var(--accent-green); }
.ftf-kpi-delta.down { background: var(--danger-soft);       color: var(--danger); }
.ftf-kpi-delta.flat { background: var(--panel-hover);       color: var(--muted); }

/* --- Middle row (placeholder, no label) --- */
.ftf-middle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-height: 0;
}
.ftf-middle-right {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    min-height: 0;
}
.ftf-placeholder {
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted-soft);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-height: 0;
    transition: border-color 0.15s;
}
.ftf-placeholder:hover { border-color: var(--muted-soft); }

/* --- Modules rows --- */
.ftf-modules-row {
    display: flex; flex-direction: column;
    min-height: 0;
}
.ftf-module-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-height: 0;
}
.ftf-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    overflow: hidden;
    transition: border-color 0.15s;
    display: flex; flex-direction: column;
    min-height: 0;
}
.ftf-card:hover { border-color: var(--muted-soft); }
.ftf-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.ftf-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600;
    color: var(--text-strong);
    letter-spacing: -0.01em;
}
.ftf-card-title .icon {
    width: 20px; height: 20px;
    display: grid; place-items: center;
    border-radius: 4px;
    background: var(--accent-light-soft);
    color: var(--accent-light);
}
.ftf-card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex; flex-direction: column;
}

/* --- Status badges --- */
.ftf-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 9.5px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ftf-badge.active   { background: var(--accent-green-soft); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.2); }
.ftf-badge.testing  { background: var(--warning-soft);      color: var(--warning);      border: 1px solid rgba(245,158,11,0.2); }
.ftf-badge.soon     { background: var(--panel-hover);       color: var(--muted);        border: 1px solid var(--border); }
.ftf-badge.beta     { background: var(--panel-hover);       color: var(--text);         border: 1px solid var(--border); }

/* --- Card content --- */
.ftf-card-data {
    background: var(--bg-deep);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 11.5px;
    color: var(--text);
    line-height: 1.55;
    font-family: var(--font-mono);
    overflow: auto;
}
.ftf-card-empty {
    flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--muted);
    text-align: center;
    min-height: 0;
}
.ftf-card-empty .icon {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 6px;
    background: var(--panel-hover);
    color: var(--muted);
    margin-bottom: 6px;
}
.ftf-card-empty h4 {
    margin: 0 0 2px;
    font-size: 11.5px; font-weight: 600; color: var(--text);
}
.ftf-card-empty p { margin: 0; font-size: 10.5px; }

/* --- Health card list --- */
.ftf-health-list { list-style: none; padding: 0; margin: 0; flex: 1 1 auto; overflow: auto; }
.ftf-health-list li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 11.5px;
}
.ftf-health-list li:last-child { border-bottom: 0; }
.ftf-health-list .label { color: var(--text); display: flex; align-items: center; gap: 7px; }
.ftf-health-list .label .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--muted);
}
.ftf-health-list .label .dot.online   { background: var(--accent-green); box-shadow: 0 0 0 2px rgba(16,185,129,0.18); }
.ftf-health-list .label .dot.testing  { background: var(--warning);      box-shadow: 0 0 0 2px rgba(245,158,11,0.18); }
.ftf-health-list .label .dot.offline  { background: var(--danger);       box-shadow: 0 0 0 2px rgba(239,68,68,0.18); }

/* --- Followers card body --- */
#followers-data {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1.5;
    margin-bottom: 4px;
    flex-shrink: 0;
}
#master-tickers-data {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.55;
}
.ftf-chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}
#followers-chart { width: 100% !important; height: 100% !important; }

/* --- Responsive — only at very small widths re-enable scrolling --- */
@media (max-width: 1100px) {
    html, body { overflow: auto; }
    .ftf-shell { grid-template-rows: auto auto auto auto; height: auto; }
    .ftf-kpi-grid    { grid-template-columns: repeat(2, 1fr); }
    .ftf-module-grid { grid-template-columns: repeat(2, 1fr); }
    .ftf-middle-row  { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .ftf-topbar      { grid-template-columns: 1fr auto; padding: 8px 12px; row-gap: 8px; height: auto; flex: 0 0 auto; }
    .ftf-search      { grid-column: 1 / -1; max-width: none; }
    .ftf-kpi-grid    { grid-template-columns: 1fr 1fr; }
    .ftf-module-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   Ticker Intelligence Panel (center / Panel A)
   ============================================================ */
.ftf-ticker-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex; flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
    transition: border-color 0.15s;
}
.ftf-ticker-panel:hover { border-color: var(--muted-soft); }

/* --- Top row: ticker meta + KPIs --- */
.ftf-ticker-head {
    display: grid;
    grid-template-columns: minmax(140px, max-content) minmax(150px, max-content) 1fr;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}
.ftf-ticker-id {
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    min-width: 0;
}
.ftf-ticker-id .ftf-ticker-company { grid-column: 1 / -1; }
.ftf-ticker-symbol {
    font-size: 26px;
    font-weight: 300;
    color: var(--text-strong);
    letter-spacing: -0.025em;
    line-height: 1;
}
.ftf-ticker-company {
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price block (right side) */
.ftf-ticker-price-wrap {
    display: flex; align-items: baseline; gap: 10px;
    flex-shrink: 0;
}
.ftf-ticker-price {
    font-family: var(--font-sans);
    font-size: 28px; font-weight: 300;
    color: var(--text-strong);
    letter-spacing: -0.02em;
    line-height: 1;
}
.ftf-ticker-change {
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
}
.ftf-ticker-change.up   { background: var(--accent-green-soft); color: var(--accent-green); }
.ftf-ticker-change.down { background: var(--danger-soft);       color: var(--danger); }

/* --- Stat strip below header --- */
.ftf-ticker-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex-shrink: 0;
}
.ftf-stat {
    background: var(--bg-deep);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.ftf-stat-label {
    font-size: 9.5px;
    color: var(--muted-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}
.ftf-stat-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

/* Sentiment badge (lives inside the .ftf-stat for sentiment) */
.ftf-sentiment-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.02em;
}
.ftf-sentiment-badge.bullish  { background: var(--accent-green-soft); color: var(--accent-green); }
.ftf-sentiment-badge.neutral  { background: var(--panel-hover);       color: var(--muted); }
.ftf-sentiment-badge.bearish  { background: var(--danger-soft);       color: var(--danger); }

/* --- Chart area (fills remaining vertical space) --- */
.ftf-ticker-chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    background: var(--bg-deep);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 8px;
}
#ticker-chart { width: 100% !important; height: 100% !important; }

/* Loading state */
.ftf-ticker-panel.is-loading .ftf-ticker-symbol,
.ftf-ticker-panel.is-loading .ftf-ticker-price { opacity: 0.5; }
.ftf-ticker-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%;
    color: var(--muted-soft);
    font-size: 12px;
}

/* ============================================================
   Panel A — chart-on-top layout v22
   Changes from v21:
   - Panel background = body bg (black) so the chart sits on black,
     and the thin border defines the box.
   - Single bottom row: symbol + company + price + change + stats
     all on one horizontal line. Stats are absolute-positioned to
     the right side of the bottom strip.
   - Ticker symbol weight 600 -> 300 (matches the slim price).
   ============================================================ */
.ftf-ticker-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg);                /* black, matches body */
    border: 1px solid var(--border);
    height: 100%;
    min-height: 0;
}

/* Chart fills the remaining space above the bottom strip */
.ftf-ticker-chart-wrap {
    order: 1;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    background: transparent;              /* shows panel's black */
    padding: 0;
    overflow: hidden;
}
#ticker-chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Crosshair tooltip */
.ftf-chart-tooltip {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    padding: 8px 11px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text);
    line-height: 1.45;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.12s ease;
}
.ftf-chart-tooltip.is-visible { opacity: 1; }
.ftf-chart-tooltip .row { display: flex; align-items: center; justify-content: space-between;
    gap: 4px; gap: 14px; }
.ftf-chart-tooltip .label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.ftf-chart-tooltip .val { color: var(--text-strong); }
.ftf-chart-tooltip .val.up   { color: var(--accent-green); }
.ftf-chart-tooltip .val.down { color: var(--danger); }
.ftf-chart-tooltip .date { font-size: 10px; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.04em; }

/* Bottom strip: head row holds symbol + company + price + change.
   Stats overlay on the right via absolute positioning. */
.ftf-ticker-head {
    order: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 320px 14px 18px;        /* right padding reserves room for stats overlay */
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin: 0;
    min-height: 60px;
}

.ftf-ticker-id {
    display: flex; flex-direction: column; gap: 1px;
    border: 0; padding: 0;
    flex: 0 0 auto;
}
.ftf-ticker-symbol {
    font-size: 22px;
    font-weight: 300;                      /* slim & airy */
    letter-spacing: -0.015em;
    color: var(--text-strong);
    line-height: 1.05;
}
.ftf-ticker-company {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.ftf-ticker-price-wrap {
    display: flex; align-items: baseline; gap: 10px;
    flex: 0 0 auto;
    padding: 0; margin: 0;
}
.ftf-ticker-price {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 300;
    letter-spacing: -0.01em;
    color: var(--text-strong);
    line-height: 1;
}
.ftf-ticker-change {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 5px;
}
.ftf-ticker-change.up   { color: var(--accent-green); background: var(--accent-green-soft); border: 1px solid rgba(16,185,129,0.2); }
.ftf-ticker-change.down { color: var(--danger);       background: var(--danger-soft);       border: 1px solid rgba(239,68,68,0.2); }
.ftf-ticker-change.flat { color: var(--muted);        background: var(--panel-hover);       border: 1px solid var(--border); }

/* Stats — overlay on right side of the bottom strip, same row as head */
.ftf-ticker-stats {
    position: absolute;
    right: 18px;
    bottom: 0;
    height: auto;
    /* match the head row vertical center */
    top: auto;
    transform: translateY(0);
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 14px 0;
    background: transparent;
    border: 0;
    margin: 0;
    min-height: 60px;
}
.ftf-stat {
    display: flex; flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    min-width: 0;
}
.ftf-stat-label {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.ftf-stat-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-strong);
    font-weight: 500;
}

/* Sentiment badge */
.ftf-sentiment-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.005em;
    font-family: var(--font-mono);
}
.ftf-sentiment-badge.bullish  { color: var(--accent-green); background: var(--accent-green-soft); border: 1px solid rgba(16,185,129,0.2); }
.ftf-sentiment-badge.neutral  { color: var(--muted);        background: var(--panel-hover);       border: 1px solid var(--border); }
.ftf-sentiment-badge.bearish  { color: var(--danger);       background: var(--danger-soft);       border: 1px solid rgba(239,68,68,0.2); }

/* Responsive: at narrower widths stats wrap below head instead of overlaying */
@media (max-width: 1100px) {
    .ftf-ticker-head  { padding-right: 18px; }
    .ftf-ticker-stats {
        position: static;
        bottom: auto; right: auto;
        padding: 4px 18px 14px;
        min-height: 0;
        order: 3;
    }
}

/* ============================================================
   v23 — Header & section-label tightening
   - Logo 25% smaller (40px tall -> 30px tall, width auto)
   - Brand container bottom padding -25%
   - Section-title (Signal Highlights / Modules) vertical pad -40%
   - Tagline becomes 2 lines via <br> in markup; tighten line-height
   ============================================================ */
.ftf-brand {
    padding-top: 8px;
    padding-bottom: 6px;            /* was 8px, -25% */
    gap: 10px;                       /* tighter logo-to-text gap */
}
.ftf-logo-img {
    height: 30px !important;        /* was 40px, -25% */
    width: auto !important;
}
.ftf-brand-text {
    line-height: 1.15;               /* tightens the 2-line tagline */
}
.ftf-brand-text p {
    margin: 0;
    line-height: 1.15;
    font-size: 11px;                 /* slightly more compact */
}

/* Section labels: compress vertical footprint ~40% */
.ftf-section-title {
    margin: 0 0 2px !important;     /* was 0 0 4px */
    line-height: 1 !important;       /* was 1.45 -> reduces total height ~35% */
}

/* ============================================================
   v25 — Bottom strip with 8 stats: 2-column grid in the bottom
   row so head and stats don\u0027t overlap. Chart spans both cols.
   ============================================================ */
.ftf-ticker-panel {
    display: grid !important;
    grid-template-rows: 1fr auto;
    grid-template-columns: auto 1fr;
}
.ftf-ticker-chart-wrap {
    grid-row: 1;
    grid-column: 1 / -1;       /* span both columns */
    flex: none;
}
.ftf-ticker-head {
    grid-row: 2;
    grid-column: 1;
    /* Reset the v22 right-padding-reservation */
    padding: 14px 18px 14px 18px !important;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
    min-height: 0;
    position: static;
    border-top: 1px solid var(--border);
}
.ftf-ticker-stats {
    grid-row: 2;
    grid-column: 2;
    /* Reset v22 absolute positioning */
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    transform: none !important;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;     /* push to right edge */
    gap: 18px;
    padding: 14px 18px 14px 0;
    background: transparent;
    border-top: 1px solid var(--border);
    margin: 0;
    min-height: 0;
    flex-wrap: nowrap;
    overflow: hidden;              /* let it clip rather than stretch panel */
}
.ftf-stat {
    display: flex; flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    min-width: 0;
    white-space: nowrap;
}
.ftf-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}
.ftf-stat-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-strong);
    font-weight: 500;
    line-height: 1.1;
}

/* At narrower widths the row wraps: stats drop to their own row below head */
@media (max-width: 1100px) {
    .ftf-ticker-panel {
        grid-template-rows: 1fr auto auto;
        grid-template-columns: 1fr;
    }
    .ftf-ticker-head {
        grid-row: 2;
        grid-column: 1;
        padding-bottom: 6px !important;
    }
    .ftf-ticker-stats {
        grid-row: 3;
        grid-column: 1;
        justify-content: space-between;
        padding: 0 18px 12px 18px;
        flex-wrap: wrap;
        gap: 16px;
        border-top: 0;
    }
}
