/* ── Trade Intel Page ─────────────────────────────────────── */
/*
 * Typography scale (rem, base 16px):
 *  xs:   .6rem  — eyebrow labels, column headers, tiny meta
 *  sm:   .72rem — secondary labels, timestamps
 *  base: .85rem — body text, table cells, interpretations
 *  md:   1rem   — subheadings, inline values
 *  lg:   1.3rem — small hero vals (R:R, sample)
 *  xl:   1.85rem — hero metric values (win rate, avg return)
 *  2xl:  2.6rem — edge score focal number
 *  3xl:  1.75rem — brief card ticker name
 *
 *  Font weights: 400 body · 600 medium · 700 semibold · 800 bold · 900 black
 *  Font family: inherited from layout (system-ui / Inter)
 */

/* Base */
body { font-size: 16px; }

@media (max-width: 768px) {
    body { font-size: 12px; }
    .customdateslist { padding-top: 10px; font-size: 15px; }
    #tableTemplate { font-size: 9px; }
    label[for="tickerSearchzz"] { display: none; }
}

/* ── Layout ──────────────────────────────────────────────── */
.ti-page { background: #f1f4f8; min-height: 100vh; padding-bottom: 32px; }

.ti-controls-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 58px;
    z-index: 100;
}
.ti-controls-left,
.ti-controls-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.ti-ctrl-divider { width: 1px; height: 20px; background: #e2e8f0; margin: 0 4px; }

/* ── Long / Short direction toggle ──────────────────────── */
.ti-dir-toggle {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.ti-dir-btn {
    padding: 4px 12px;
    font-size: .75rem;
    font-weight: 600;
    border: none;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.ti-dir-btn:first-child {
    border-right: 1px solid #e2e8f0;
}
.ti-dir-btn.active[data-dir="long"] {
    background: #dcfce7;
    color: #16a34a;
}
.ti-dir-btn.active[data-dir="short"] {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Timeframe tabs ──────────────────────────────────────── */
.tf-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
}
.tf-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 4px 7px;
    font-size: .78rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: color .12s, border-color .12s;
    white-space: nowrap;
}
.tf-tab:hover  { color: #0f172a; }
.tf-tab.active { color: #0f172a; border-bottom-color: #3b82f6; }

/* ── Baseline comparison card ────────────────────────────── */
.bl-header {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 8px;
}
.bl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.bl-table thead th {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}
.bl-table thead th:first-child { text-align: left; }
.bl-table tbody td {
    padding: 7px 6px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: .82rem;
    text-align: center;
}
.bl-table tbody td:first-child {
    text-align: left;
    color: #64748b;
    font-weight: 500;
}
.bl-sub {
    font-size: .65rem;
    color: #94a3b8;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}
.bl-delta { font-weight: 700; }
.bl-pos     { color: #16a34a; }
.bl-neg     { color: #dc2626; }
.bl-neutral { color: #94a3b8; }
.bl-interp {
    margin-top: 10px;
    padding: 9px 12px;
    background: #f8fafc;
    border-radius: 7px;
    border-left: 3px solid #e2e8f0;
    font-size: .8rem;
    color: #475569;
    line-height: 1.55;
}

/* ── Insight chips (streak / move) in ticker bar ─────────── */
#ti-insights-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ti-insight-chip {
    display: inline-flex;
    align-items: center;
    border: none;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
}
.ti-insight-chip:hover { opacity: .85; transform: translateY(-1px); }
.chip--up   { background: rgba(22,163,74,.18);  color: #4ade80; }
.chip--down { background: rgba(220,38,38,.18);  color: #f87171; }

/* ── Ticker bar ──────────────────────────────────────────── */
.ti-ticker-bar {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 12px 16px 0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.ti-ticker-bar h4 { margin: 0; font-weight: 800; color: #0f172a; font-size: 1.05rem; }
.ti-ticker-bar .price { font-weight: 700; color: #334155; }

#ti-current-streak {
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
}
#ti-current-streak:hover { opacity: .85; transform: translateY(-1px); }
.streak-chip--up   { background: #dcfce7; color: #15803d; }
.streak-chip--down { background: #fee2e2; color: #b91c1c; }

/* ── Trade Brief Card ────────────────────────────────────── */
.ti-brief {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin: 14px 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 0 0 transparent;
}
.ti-brief-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 16px 28px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255,255,255,.06);
    border-left: 4px solid #3b82f6;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.ti-brief-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 260px; height: 180px;
    background: radial-gradient(ellipse, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}
.ti-brief-ticker {
    font-size: 1.75rem;
    font-weight: 900;
    color: #f1f5f9;
    letter-spacing: -.03em;
}
.ti-brief-sep     { color: rgba(255,255,255,.2); margin: 0 8px; }
.ti-brief-event {
    font-size: .72rem;
    font-weight: 700;
    color: #93c5fd;
    background: rgba(59,130,246,.15);
    border: 1px solid rgba(59,130,246,.3);
    border-radius: 20px;
    padding: 3px 11px;
    vertical-align: middle;
}
.ti-timing-lbl { font-size: .68rem; color: #475569; margin-top: 3px; }

/* ── Header right group (dates + scorecard) ─────────────── */
.ti-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Next Entry / Exit in header ────────────────────────── */
.ti-next-dates {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.ti-next-date-lbl {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
}
.ti-next-date-val {
    font-size: .88rem;
    font-weight: 700;
    color: #f1f5f9;
}
.ti-next-date-sub {
    font-size: .62rem;
    color: #475569;
}
.ti-next-date-sep {
    color: rgba(255,255,255,.15);
    font-size: .8rem;
    margin: 0 4px;
}

/* Verdict badge */
.ti-verdict-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.verdict-strong   { background: #dcfce7; color: #15803d; }
.verdict-moderate { background: #fef9c3; color: #a16207; }
.verdict-weak     { background: #fee2e2; color: #b91c1c; }

/* ── Hero metric grid ────────────────────────────────────── */
.ti-hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1.1fr 0.95fr 0.9fr;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}
.ti-hero-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 12px 14px;
    border-right: 1px solid #f1f5f9;
    gap: 4px;
    position: relative;
}
.ti-hero-cell::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    border-radius: 0 0 3px 3px;
}
.ti-hero-cell:last-child { border-right: none; }

/* Win Rate cell accent */
.ti-hero-cell.winrate::after         { background: linear-gradient(90deg, #4ade80, #22c55e); }
.ti-hero-cell.winrate                { background: linear-gradient(180deg, #f0fdf4 0%, #fff 55%); }

.ti-hero-val {
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.03em;
}
#edgeScore { font-size: 1.5rem; }
.ti-hero-val--sm { font-size: 1.3rem; letter-spacing: -.02em; }
.ti-hero-val.positive { color: #16a34a; }
.ti-hero-val.negative { color: #dc2626; }

.ti-hero-lbl {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #94a3b8;
    font-weight: 700;
    margin-top: 4px;
}
.ti-hero-hint {
    font-size: .6rem;
    color: #cbd5e1;
    font-style: italic;
    margin-top: 2px;
}

/* Win / Loss split cell */
.ti-hero-cell--winloss { padding: 0; gap: 0; }
.ti-winloss-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    flex: 1;
    width: 100%;
    gap: 8px;
}
.ti-winloss-row--win  { background: #f0fdf4; }
.ti-winloss-row--loss { background: #fff1f2; }
.ti-winloss-val {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.ti-winloss-row--win  .ti-winloss-val { color: #16a34a; }
.ti-winloss-row--loss .ti-winloss-val { color: #dc2626; }
.ti-winloss-lbl {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
}
.ti-winloss-divider { height: 1px; background: #e9f2fe; width: 100%; }

.ti-hero-cell--factors {
    gap: 4px;
    background: #fff;
    padding: 8px 10px;
}

/* ── AI Interpretation panel ─────────────────────────────── */
.ti-interpretation {
    padding: 16px 24px;
    font-size: .88rem;
    color: #334155;
    line-height: 1.72;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    border-left: 3px solid #3b82f6;
    margin-left: 0;
}

/* Risk row */
.ti-risk-row {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.ti-risk-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 18px;
    min-width: 90px;
    flex: 1;
}
.ti-risk-pill--win  { background: #f0fdf4; border-color: #bbf7d0; }
.ti-risk-pill--loss { background: #fff1f2; border-color: #fecdd3; }
.ti-risk-pill__val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}
.ti-risk-pill--win  .ti-risk-pill__val { color: #16a34a; }
.ti-risk-pill--loss .ti-risk-pill__val { color: #dc2626; }
.ti-risk-pill__lbl {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Score breakdown ─────────────────────────────────────── */
.ti-score-breakdown {
    display: flex;
    gap: 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin: 0 0 12px;
    padding: 8px 18px;
    background: #fafbfc;
    flex-wrap: wrap;
    gap: 6px 20px;
}
.ti-score-factor {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .75rem;
    min-width: 160px;
}
.ti-score-factor__lbl {
    color: #64748b;
    font-weight: 500;
    flex: 1;
}
.ti-score-factor__pip {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Scorecard signal bars (light theme) ─────────────────── */
.ti-bar {
    width: 8px;
    border-radius: 3px;
    background: #e2e8f0;
    transition: background .25s;
}
.ti-bar:nth-child(1) { height: 8px; }
.ti-bar:nth-child(2) { height: 11px; }
.ti-bar:nth-child(3) { height: 14px; }
.ti-bar:nth-child(4) { height: 18px; }
.ti-bar:nth-child(5) { height: 22px; }
.ti-bar--fill-red    { background: #ef4444; }
.ti-bar--fill-amber  { background: #f59e0b; }
.ti-bar--fill-green  { background: #16a34a; }

/* ── Scorecard bar ───────────────────────────────────────── */
.ti-scorecard-bar {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 20px;
    gap: 0;
}
.ti-scorecard-bar-divider {
    display: block;
    width: 1px;
    height: 40px;
    background: #e2e8f0;
    flex-shrink: 0;
    margin: 0 20px;
}
.ti-scorecard-factors-row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 0;
    border-right: none;
}
.ti-scorecard-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-right: 1px solid #f1f5f9;
    flex: 1;
}
.ti-scorecard-row:last-child { border-right: none; }
.ti-scorecard-lbl {
    font-size: .58rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
    text-align: center;
}

/* ── Edge Score (right panel of scorecard) ──────────────── */
.ti-scorecard-total { display: flex; align-items: center; }
#ti-scorecard-total {
    display: flex;
    align-items: center;
    min-width: 150px;
    padding: 0;
}
.ti-edge-meter {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    align-items: flex-start;
}
.ti-edge-meter__lbl {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #94a3b8;
    white-space: nowrap;
    order: 1;
}
.ti-edge-meter__val {
    font-size: 2.6rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -.05em;
    white-space: nowrap;
    order: 2;
}
.ti-edge-meter__track {
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    order: 3;
}
.ti-edge-meter__fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width .5s ease, background-color .5s ease;
}

.ti-scorecard-val {
    font-size: 2.6rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
    white-space: nowrap;
}
.ti-scorecard-denom {
    font-size: .9rem;
    font-weight: 500;
    color: #334155;
    margin-left: 2px;
}

.ti-score-tstat {
    font-size: .6rem;
    color: #475569;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Scorecard hero cell (unused variant) ─────────────────── */
.ti-hero-cell--scorecard {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 14px;
}
.ti-scorecard-factors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    width: fit-content;
}
.ti-scorecard-divider {
    width: 1px; height: 60px;
    background: rgba(255,255,255,.1);
    flex-shrink: 0;
}

/* Premium strip */
.ti-premium-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #0f172a 0%, #1e3a5f 100%);
    color: #94a3b8;
    font-size: .82rem;
}
.ti-premium-strip span:first-child { font-size: 1.1rem; }
.ti-unlock-btn {
    margin-left: auto;
    background: #3b82f6;
    color: #fff !important;
    text-decoration: none !important;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.ti-unlock-btn:hover { background: #2563eb; }

/* ── Chart area ──────────────────────────────────────────── */
.ti-chart-section {
    margin: 0 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.ti-chart-label {
    padding: 10px 16px 0;
    font-size: .6rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .1em;
}

/* ── Trade hint bar ─────────────────────────────────────── */
.ti-trade-hint {
    margin: 6px 16px 10px;
    padding: 8px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: .78rem;
    color: #0369a1;
    line-height: 1.5;
}
.ti-trade-hint strong { color: #0c4a6e; }

/* ── Details grid ────────────────────────────────────────── */
.ti-details-section {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 16px;
    margin: 16px 20px;
}
.ti-detail-card--dist     { grid-column: 3; grid-row: 1 / 3; }
.ti-detail-card--returns  { grid-column: 1 / 3; }
.ti-detail-card--baseline { grid-column: 1 / -1; }
.ti-detail-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ti-detail-card h6 {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    margin-bottom: 12px;
}
.ti-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .85rem;
}
.ti-stat-row:last-child { border-bottom: none; }
.ti-stat-val { font-weight: 700; color: #0f172a; }
.ti-sc-insight {
    margin: 10px 0 0;
    padding: 9px 12px;
    background: #f8fafc;
    border-radius: 7px;
    border-left: 3px solid #e2e8f0;
    font-size: .8rem;
    color: #475569;
    line-height: 1.45;
}

/* ── Skew bar ────────────────────────────────────────────── */
.ti-skew-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: .8rem;
}
.ti-skew-bar__lbl {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
}
.ti-skew-bar__val {
    font-size: .82rem;
    font-weight: 700;
}
.ti-skew-bar__val.positive { color: #16a34a; }
.ti-skew-bar__val.negative { color: #dc2626; }

/* ── Risk Profile grid inside card ──────────────────────── */
.ti-risk-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.ti-rp-cell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}
.ti-rp-cell--win   { background: #f0fdf4; border-color: #bbf7d0; }
.ti-rp-cell--loss  { background: #fff1f2; border-color: #fecdd3; }
.ti-rp-cell--best  { background: #f0fdf4; border-color: #86efac; }
.ti-rp-cell--worst { background: #fff1f2; border-color: #fca5a5; }
.ti-rp-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 4px;
}
.ti-rp-lbl {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
}
.ti-rp-cell--win .ti-rp-val,
.ti-rp-cell--best .ti-rp-val  { color: #16a34a; }
.ti-rp-cell--loss .ti-rp-val,
.ti-rp-cell--worst .ti-rp-val { color: #dc2626; }

/* ── Table section ───────────────────────────────────────── */
.ti-table-section {
    margin: 0 20px 30px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ti-table-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.ti-table-hdr h6 {
    margin: 0;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #0f172a;
}
.ti-timing-note {
    padding: 8px 16px;
    font-size: .78rem;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    display: none;
}
.ti-reactive-note {
    margin: 8px 20px;
    padding: 9px 14px;
    font-size: .8rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 7px;
}

#tableTemplate {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
#tableTemplate thead th {
    background: #f8fafc;
    color: #64748b;
    padding: 10px 14px;
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
#tableTemplate thead th:nth-child(2) { text-align: left; }
#tableTemplate tbody td {
    padding: 9px 14px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
#tableTemplate tbody td:nth-child(2) { text-align: left; color: #0f172a; font-weight: 500; }
#tableTemplate tbody tr:last-child td { border-bottom: none; }
#tableTemplate tbody tr:hover { filter: brightness(0.96); }
#tableTemplate td.percentChange          { font-weight: 700; }
#tableTemplate td.percentChange.positive { color: #16a34a; }
#tableTemplate td.percentChange.negative { color: #dc2626; }

/* ── Overlay & loading ───────────────────────────────────── */
#tradeTimeing { position: relative; }
#tradeTimeing .overlay { display: none; }
#tradeTimeing.disabled .overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(248,250,252,.92);
    display: flex; justify-content: center;
    align-items: flex-start; z-index: 10; padding-top: 120px;
}
#tradeTimeing .overlay p {
    background: #0f172a; color: #f1f5f9; padding: 16px 24px;
    border-radius: 10px; font-size: 1rem; font-weight: 600;
    max-width: 400px; text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
#loadingMessage {
    display: none; background: #fff; padding: 14px 20px;
    border: 1px solid #e2e8f0; border-radius: 10px; color: #0f172a;
    font-weight: 600; position: absolute; font-size: .95rem; z-index: 20;
    top: 40%; left: 50%; transform: translateX(-50%);
    align-items: center; gap: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.spinner {
    border: 3px solid #e2e8f0; border-top: 3px solid #3b82f6;
    border-radius: 50%; width: 18px; height: 18px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ── Tail insights ───────────────────────────────────────── */
.ti-tail-box { font-size: .78rem; color: #475569; margin-top: 8px; }
.ti-tail-layout {
    display: flex;
    gap: 0;
    align-items: stretch;
}
.ti-tail-left  { flex: 1 1 50%; padding-right: 10px; line-height: 1.6; }
.ti-tail-right { flex: 1 1 50%; padding-left: 10px; }
.ti-tail-divider { width: 1px; background: #e2e8f0; flex-shrink: 0; }
.ti-tail-heading {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin: 0 0 5px;
}
.ti-tail-line { margin: 0 0 3px; }
.ti-tail-line--danger { color: #dc2626; }
.ti-pct-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}
.ti-pct-lbl  { font-weight: 700; font-size: .78rem; color: #0f172a; min-width: 26px; }
.ti-pct-sub  { font-size: .68rem; color: #94a3b8; flex: 1; }
.ti-pct-val  { font-weight: 700; font-size: .82rem; white-space: nowrap; }
.ti-pct--pos { color: #16a34a; }
.ti-pct--neg { color: #dc2626; }

/* ── Ticker input ────────────────────────────────────────── */
#tickerInput {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 5px 10px; cursor: pointer; font-weight: 600; color: #0f172a;
    min-width: 100px; font-size: .85rem;
}
#tickerInput:hover { border-color: #3b82f6; }
.customdateslist .custom-modal-class {
    font-size: .82rem; color: #64748b; cursor: pointer;
    text-decoration: none; border: none; background: none; padding: 0;
}
.customdateslist .custom-modal-class:hover { color: #3b82f6; }

/* ── Custom events modal ─────────────────────────────────── */
#dynamic-content-modal .modal-dialog { max-width: 520px; }
#dynamic-content-modal .modal-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
}
#dynamic-content-modal .modal-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px 12px;
}
#dynamic-content-modal .modal-title {
    font-size: .95rem; font-weight: 700; color: #0f172a;
}
#dynamic-content-modal .btn-close { opacity: .35; }
#dynamic-content-modal .btn-close:hover { opacity: .7; }
#dynamic-content-modal .modal-body { padding: 0; }

/* ── Ticker search modal ─────────────────────────────────── */
#ticker-search-modal .modal-dialog { max-width: 680px; }
#ticker-search-modal .modal-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    color: #0f172a;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
}
#ticker-search-modal .modal-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 20px 10px;
}
#ticker-search-modal .modal-title {
    font-size: .9rem; font-weight: 700; color: #0f172a; letter-spacing: -.01em;
}
#ticker-search-modal .btn-close { opacity: .4; }
#ticker-search-modal .btn-close:hover { opacity: .8; }
#ticker-search-modal .modal-body { padding: 16px 20px 20px; }

/* Search input */
.ts-search-wrap { position: relative; margin-bottom: 16px; }
.ts-search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; pointer-events: none; display: flex; align-items: center;
}
#tickerSearch {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 38px 11px 40px;
    color: #0f172a;
    font-size: .95rem;
    font-weight: 500;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
#tickerSearch::placeholder { color: #94a3b8; }
#tickerSearch:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
    background: #fff;
}
.ts-clear-btn {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #94a3b8; cursor: pointer;
    font-size: 1rem; padding: 4px; line-height: 1; display: none;
}
.ts-clear-btn:hover { color: #475569; }

/* Section labels */
.ts-section-label {
    font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: #94a3b8; margin-bottom: 8px;
}
.ts-section-label--free {
    color: #d97706;
}
.ts-free-group {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px 12px;
    margin-bottom: 14px;
}
.ts-free-group .ts-chip {
    background: #fff;
    border-color: #fcd34d;
}
.ts-free-group .ts-chip:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 1px 4px rgba(245,158,11,.15);
}
}

/* Recommended chips */
.ts-chips-group { margin-bottom: 16px; }
.ts-chips-group + .ts-chips-group { margin-top: 8px; }
.ts-chips       { display: flex; flex-wrap: wrap; gap: 5px; }
.ts-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: 5px 10px; cursor: pointer;
    transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none;
}
.ts-chip:hover {
    background: #eff6ff; border-color: #93c5fd;
    box-shadow: 0 1px 4px rgba(59,130,246,.15);
}
.ts-chip-sym  { font-size: .8rem; font-weight: 700; color: #0f172a; }
.ts-chip-name { font-size: .7rem; color: #64748b; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Search result rows */
#autocompleteTable { width: 100%; border-collapse: collapse; display: none; }
#autocompleteTable tbody tr   { cursor: pointer; transition: background .1s; }
#autocompleteTable tbody tr:hover { background: #eff6ff; }
#autocompleteTable tbody tr.non-clickable { pointer-events: none; }
#autocompleteTable td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; }
#autocompleteTable tbody tr:last-child td { border-bottom: none; }
.ts-res-sym  { font-size: .88rem; font-weight: 700; color: #0f172a; white-space: nowrap; }
.ts-res-name { font-size: .78rem; color: #64748b; }
.ts-res-exch {
    font-size: .68rem; color: #3b82f6; font-weight: 600;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px; padding: 2px 8px; white-space: nowrap;
    display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}

/* No results row */
#autocompleteTable tbody tr.non-clickable td { color: #94a3b8; text-align: center; padding: 20px; font-size: .85rem; }

/* Loading shimmer */
.ts-loading { text-align: center; padding: 24px; color: #94a3b8; font-size: .85rem; }
.ts-loading::before {
    content: ''; display: inline-block; width: 16px; height: 16px;
    border: 2px solid #e2e8f0; border-top-color: #3b82f6;
    border-radius: 50%; animation: ts-spin .7s linear infinite;
    margin-right: 8px; vertical-align: middle;
}
@keyframes ts-spin { to { transform: rotate(360deg); } }

.non-clickable { pointer-events: none; }

/* ── Watermark ───────────────────────────────────────────── */
/* ── Price chart bubble ──────────────────────────────────── */
.ti-chart-wrap {
    margin: 0 20px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ti-chart-hdr {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.ti-chart-hdr-title {
    font-size: .78rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.01em;
    display: block;
}
.ti-chart-hdr-sub {
    display: block;
    font-size: .65rem;
    color: #94a3b8;
    margin-top: 2px;
}

.watermark-container { position: relative; padding: 0; overflow: hidden; background: #f8fafc; }
.watermark-container::after {
    content: 'TimedTrades.com';
    position: absolute; top: 28%; left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    font-size: 2.7em; color: rgba(0,0,0,.04);
    z-index: 0; pointer-events: none; white-space: nowrap;
}

/* ── Price / streak display ──────────────────────────────── */
.price  { font-size: 1rem; font-weight: 700; color: #34d399; margin-left: 8px; }
.streak { font-size: .85rem; color: #94a3b8; }

.ticker-container { padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin: 10px 0; background-color: #f9f9f9; }
.ticker-name      { font-size: 1.2em; font-weight: bold; }

.priceDelta { font-size: .8em; font-weight: bold; }

@media (max-width: 576px) {
    #tickerName   { font-size: 1.5em; }
    .price        { font-size: 1.0em; font-weight: bold; }
    .priceDelta   { font-size: 0.8em; font-weight: bold; }
    .streak       { padding-left: 10px; font-size: 1.0em; font-weight: bold; color: #555; }
}

.colored-hr { border: 0; height: 2px; background-color: grey; margin: 0; }

#clearSearch {
    padding: 0 10px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
