/* VolaraID — Dashboard Theme
   Navy/Gold color scheme with Oswald headings, Raleway body */

:root {
    --navy: #0a1628;
    --navy-light: #132240;
    --navy-card: #1a2d4a;
    --gold: #d4a017;
    --gold-light: #e8b824;
    --gold-dim: rgba(212, 160, 23, 0.3);
    --text: #e0e0e0;
    --text-dim: #a8bbd0;
    --green: #00c853;
    --red: #ff1744;
    --blue: #2196f3;
    --border: rgba(212, 160, 23, 0.2);
    --radius: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --text-xs: 0.65rem;
    --text-sm: 0.75rem;
    --text-base: 0.85rem;
    --text-md: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.1rem;
}

/* ── Light Mode ─────────────────────────────────────────── */

body.light,
html.light body {
    --navy: #f0f4fa;
    --navy-light: #e2e8f4;
    --navy-card: #ffffff;
    --gold: #9a6f00;
    --gold-light: #b8860b;
    --gold-dim: rgba(154, 111, 0, 0.15);
    --text: #1a2332;
    --text-dim: #4a5f7a;
    --border: rgba(154, 111, 0, 0.25);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --blue: #1976d2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Raleway', sans-serif;
    background: var(--navy);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */

.app-header {
    background: var(--navy-light);
    border-bottom: 2px solid var(--gold);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    height: 36px;
    width: auto;
}

.logo-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 42px;
}
.logo-volara {
    font-weight: 500;
    fill: var(--text);
}
.logo-id {
    font-weight: 700;
    fill: var(--gold);
}

.header-subtitle {
    font-size: var(--text-xs);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Tab Navigation ─────────────────────────────────────── */

.tab-nav {
    display: flex;
    gap: 0.25rem;
}

.tab-link {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-md);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: all 0.2s;
    border: 1px solid transparent;
    border-bottom: none;
}

.tab-link:hover {
    color: var(--gold-light);
    background: rgba(184, 134, 11, 0.1);
}

.tab-link.active {
    color: var(--gold);
    background: var(--navy);
    border-color: var(--gold);
    border-bottom-color: var(--navy);
    margin-bottom: -2px;
}

.tab-icon {
    width: 15px;
    height: 15px;
    margin-right: 0.35rem;
    vertical-align: -0.15em;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.tab-link:hover .tab-icon,
.tab-link.active .tab-icon {
    opacity: 1;
}

/* ── Main Content ───────────────────────────────────────── */

.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tab-content h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.tab-content > p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    font-size: var(--text-md);
}

/* ── Cards ──────────────────────────────────────────────── */

.card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card-header {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xl);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-base);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gold);
    color: var(--navy);
}

.btn-primary:hover {
    background: var(--gold-light);
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-secondary:hover {
    background: rgba(184, 134, 11, 0.1);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger:hover {
    background: rgba(255, 23, 68, 0.1);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-sm);
}

.btn-theme {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    font-size: var(--text-lg);
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-theme:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--gold-dim);
}

/* ── Form Elements ──────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-base);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Raleway', sans-serif;
    font-size: var(--text-md);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(184, 134, 11, 0.2);
}

.form-input::placeholder {
    color: var(--text-dim);
}

select.form-input {
    cursor: pointer;
}

.form-input-sm {
    padding: 0.35rem 0.55rem;
    font-size: var(--text-sm);
}

/* ── Ticker Pills ───────────────────────────────────────── */

.ticker-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ticker-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--gold-dim);
    color: var(--gold-light);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 1px;
}

.ticker-pill .remove-ticker {
    cursor: pointer;
    opacity: 0.6;
    font-size: var(--text-base);
}

.ticker-pill .remove-ticker:hover {
    opacity: 1;
    color: var(--red);
}

/* ── Badge ──────────────────────────────────────────────── */

.badge {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--gold-dim);
    color: var(--gold);
}

/* ── Period Pills ───────────────────────────────────────── */

.period-pills {
    display: flex;
    gap: 0.3rem;
}

.period-pill {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.2s;
}

.period-pill:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.period-pill.active {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    font-weight: 600;
}

/* ── Progress Bar ───────────────────────────────────────── */

.progress-container {
    display: none;
    margin: 1.5rem 0;
}

.progress-container.visible {
    display: block;
}

.progress-bar-outer {
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 2rem;
    overflow: hidden;
    position: relative;
}

.progress-bar-inner {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: var(--radius);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-base);
    color: var(--text);
    z-index: 1;
}

/* ── Config Grid ────────────────────────────────────────── */

.config-category {
    margin-bottom: 2rem;
}

.config-category h3 {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-lg);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.config-item {
    position: relative;
}

.config-item.modified .form-input {
    border-color: var(--gold);
    background: rgba(184, 134, 11, 0.05);
}

.config-item .default-hint {
    font-size: var(--text-xs);
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* ── Autocomplete ──────────────────────────────────────── */

.autocomplete-container {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-light);
    border: 1px solid var(--gold);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: var(--text-base);
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(184, 134, 11, 0.15);
}

.autocomplete-symbol {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    color: var(--gold);
    min-width: 60px;
    letter-spacing: 1px;
}

.autocomplete-name {
    color: var(--text-dim);
    font-size: var(--text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-empty {
    padding: 0.75rem 0.8rem;
    color: var(--text-dim);
    font-size: var(--text-base);
    font-style: italic;
}

/* Staging area — selected tickers before adding */

.staging-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.staging-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--green);
    color: var(--navy);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 1px;
}

.staging-remove {
    cursor: pointer;
    font-size: var(--text-md);
    opacity: 0.7;
    line-height: 1;
}

.staging-remove:hover {
    opacity: 1;
}

.staging-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ── Toast Notification ────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-base);
    letter-spacing: 1px;
    z-index: 200;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--green);
    color: var(--navy);
}

.toast-error {
    background: var(--red);
    color: #fff;
}

/* ── Footer ─────────────────────────────────────────────── */

.app-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1.5rem 1rem;
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.footer-inner {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.footer-section {
    min-width: 120px;
}

.footer-section-label {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text);
}

.footer-bottom {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-dim);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.footer-sep {
    margin: 0 0.5rem;
    opacity: 0.4;
}

@media (max-width: 480px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
    }
    .footer-links {
        align-items: center;
    }
}

/* ── Table Scroll Wrapper ── */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.summary-table {
    min-width: 520px;
}

/* ── Utilities ──────────────────────────────────────────── */

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* ── Responsive Breakpoints ──────────────────────────────── */

@media (max-width: 900px) {
    .app-main {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .header-logo {
        height: 28px;
    }

    .header-subtitle {
        display: none;
    }

    .tab-nav {
        gap: 0.25rem;
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .tab-link {
        font-size: var(--text-xs);
        padding: 0.35rem 0.6rem;
    }

    .btn-theme {
        margin-left: auto;
    }

    .app-main {
        padding: 1rem 0.75rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-group {
        min-width: unset;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.6rem 0.75rem;
    }

    .header-logo {
        height: 24px;
    }

    .tab-link {
        font-size: var(--text-xs);
        padding: 0.3rem 0.5rem;
    }

    .tab-link .tab-icon {
        display: none;
    }

    .app-main {
        padding: 0.75rem 0.5rem;
    }

    .btn {
        font-size: var(--text-xs);
        padding: 0.4rem 0.75rem;
    }

    .autocomplete-dropdown {
        max-height: 200px;
    }
}

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Shared container */
.home-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ── Hero ── */
.home-hero {
    position: relative;
    overflow: hidden;
    background: var(--navy);
    border-bottom: 1px solid var(--border);
}

.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 70% 50%, var(--gold-dim) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 50%, rgba(33, 150, 243, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.home-hero .home-container {
    text-align: center;
    position: relative;
    z-index: 1;
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.hero-logo-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 4px 20px rgba(212, 160, 23, 0.3));
}

.hero-title {
    font-family: 'Oswald', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 1rem;
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-description {
    font-size: var(--text-md);
    color: var(--text-dim);
    max-width: 680px;
    margin: 0 auto 2rem;
    line-height: 1.7;
    opacity: 0.85;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 0.9rem 2.5rem;
    font-size: var(--text-lg);
}

/* Hero feature highlights */
.hero-features {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    min-width: 200px;
    flex: 1;
    max-width: 260px;
    backdrop-filter: blur(4px);
    transition: border-color 0.2s, background 0.2s;
}

.hero-feature-item:hover {
    border-color: var(--gold);
    background: var(--gold-dim);
}

.hero-feature-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.hero-feature-name {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.5px;
}

.hero-feature-desc {
    font-size: var(--text-sm);
    color: var(--text-dim);
    margin-top: 0.1rem;
}

/* Plan saving line */
.plan-saving {
    font-size: var(--text-sm);
    color: var(--green);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* Pro Annual badge variant */
.plan-badge-green {
    background: var(--green);
    color: #fff;
}

/* ── Sections ── */
.home-section {
    border-top: 1px solid var(--border);
}

.home-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 2.5rem;
}

/* ── Capabilities ── */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.capability-card {
    text-align: center;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.capability-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.capability-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.5rem;
}

.capability-desc {
    font-size: var(--text-md);
    color: var(--text-dim);
    line-height: 1.5;
    margin: 0;
}

/* ── Plans ── */
.home-section-plans {
    padding-bottom: 2rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.plan-card-featured {
    border: 2px solid var(--gold);
    box-shadow: 0 0 24px var(--gold-dim);
}

.plan-card-trial {
    border: 2px solid transparent;
    background-image: linear-gradient(var(--navy-card), var(--navy-card)), linear-gradient(135deg, var(--gold), #00bcd4);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.12);
}

.plan-badge-trial {
    background: linear-gradient(135deg, var(--gold), #00bcd4);
    color: var(--navy-deep);
    font-weight: 700;
}

.plan-badge {
    position: absolute;
    top: -1px;
    right: 1.5rem;
    background: var(--gold);
    color: var(--navy);
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.2rem 0.75rem;
    border-radius: 0 0 var(--radius) var(--radius);
}

.plan-name {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.plan-price {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    margin: 0 0 0.25rem;
}

.plan-period {
    font-family: 'Raleway', sans-serif;
    font-size: var(--text-sm);
    color: var(--text-dim);
    font-weight: 400;
}

.plan-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

.plan-features {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.plan-features li {
    font-size: var(--text-md);
    color: var(--text-dim);
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.plan-features li::before {
    content: "✓";
    color: var(--gold);
    font-weight: 700;
    flex-shrink: 0;
}

.plan-features li.plan-feature-dim {
    opacity: 0.45;
}

.plan-features li.plan-feature-dim::before {
    content: "–";
    color: var(--text-dim);
}

.plan-cta {
    width: 100%;
    text-align: center;
    margin-top: auto;
}

.plan-cta:disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

/* ── Home Responsive ── */
@media (max-width: 900px) {
    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .hero-logo-icon { width: 80px; height: 80px; }

    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .home-container {
        padding: 2rem 1rem;
    }

    .home-hero .home-container {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .hero-logo-icon { width: 72px; height: 72px; }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-features {
        gap: 0.75rem;
    }

    .hero-feature-item {
        min-width: 160px;
        padding: 0.6rem 1rem;
    }

    .hero-social-proof {
        gap: 0.4rem 0.6rem;
        padding: 0.5rem 1rem;
    }

    .hero-proof-sep {
        display: none;
    }

    .hero-proof-item {
        font-size: 0.72rem;
    }

    .hero-product-preview {
        margin-top: 1.5rem;
    }

    .tier-col-feature { width: 40%; }
    .tier-col-free, .tier-col-pro { width: 30%; }
}

@media (max-width: 480px) {
    .capabilities-grid {
        grid-template-columns: 1fr;
    }

    .hero-logo-icon { width: 64px; height: 64px; }

    .hero-title {
        font-size: 1.5rem;
    }

    .btn-hero {
        padding: 0.8rem 1.5rem;
        width: 100%;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-feature-item {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

/* ── Smooth scroll ── */
html {
    scroll-behavior: smooth;
}

/* ── Hero Premium Label ── */
.hero-premium-label {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin: 2rem 0 1rem;
    opacity: 0.85;
}

/* ── Hero feature item as link ── */
a.hero-feature-item {
    text-decoration: none;
    color: inherit;
}

/* ── Hero social proof strip ── */
.hero-social-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 1.75rem;
    padding: 0.6rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    opacity: 0.8;
}

.hero-proof-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    color: var(--text-dim);
    white-space: nowrap;
}

.hero-proof-icon {
    font-size: 0.9rem;
}

.hero-proof-sep {
    color: var(--border);
    font-size: 1rem;
    line-height: 1;
}

/* ── Hero product preview ── */
.hero-product-preview {
    margin: 2rem auto 0;
    max-width: 860px;
    width: 100%;
}

.hero-product-img {
    display: block;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 160, 23, 0.12);
    transition: box-shadow 0.3s;
}

.hero-product-img:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 160, 23, 0.25);
}

.hero-product-caption {
    font-size: 0.72rem;
    color: var(--text-dim);
    opacity: 0.5;
    margin-top: 0.6rem;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Light mode adjustments */
body.light .hero-product-img,
html.light .hero-product-img {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(180, 120, 0, 0.15);
}

/* ── Tier compare table ── */
.tier-compare {
    margin: 0 0 2.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    min-width: 460px;
}

.tier-table thead tr {
    background: var(--navy-card);
}

.tier-col-feature {
    width: 38%;
    padding: 0.65rem 1rem;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.tier-col-free {
    width: 31%;
    padding: 0.65rem 1rem;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: center;
    border-bottom: 2px solid var(--border);
}

.tier-col-pro {
    width: 31%;
    padding: 0.65rem 1rem;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold);
    text-align: center;
    border-bottom: 2px solid var(--gold);
    background: var(--gold-dim);
}

.tier-pro-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.tier-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.tier-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.tier-table tbody td {
    padding: 0.6rem 1rem;
    color: var(--text-dim);
    vertical-align: middle;
}

.tier-table tbody td:first-child {
    font-weight: 500;
    color: var(--text);
}

.tier-table tbody td:nth-child(2) {
    text-align: center;
    font-size: 0.8rem;
}

.tier-pro-cell {
    text-align: center;
    background: rgba(212, 160, 23, 0.04);
    font-size: 0.8rem;
    border-left: 1px solid var(--gold-dim);
    border-right: 1px solid var(--gold-dim);
}

.tier-check {
    color: var(--green);
    font-weight: 700;
    margin-right: 0.2rem;
}

.tier-dash {
    color: var(--text-dim);
    opacity: 0.4;
}

/* ── Feature Detail Sections ── */
.feature-details-section {
    background: var(--navy-light);
}

.feature-detail-block {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 80px;
}

.feature-detail-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.feature-detail-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.feature-detail-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.feature-detail-name {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 0.2rem;
}

.feature-detail-tagline {
    font-size: var(--text-md);
    color: var(--text-dim);
    margin: 0;
}

.feature-detail-body {
    font-size: var(--text-md);
    color: var(--text-dim);
    line-height: 1.7;
    margin: 0 0 1.5rem;
    max-width: 780px;
}

.feature-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.feature-metric {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}

.feature-metric-label {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 0.35rem;
}

.feature-metric-value {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.4;
}

/* Feature detail responsive */
@media (max-width: 900px) {
    .feature-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .feature-metrics-grid {
        grid-template-columns: 1fr;
    }

    .feature-detail-header {
        gap: 0.75rem;
    }

    .feature-detail-icon {
        font-size: 2rem;
    }
}

/* ============================================================
   AUTH NAV
   ============================================================ */

.auth-nav {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}

/* Login button */
.btn-auth-login {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: var(--radius);
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.btn-auth-login:hover { opacity: 0.85; }

/* Avatar wrapper */
.auth-avatar {
    position: relative;
    align-items: center;
}

.auth-avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--navy-light);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
}

.auth-avatar-btn:hover { border-color: var(--gold); }

.auth-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.auth-avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gold);
    background: var(--navy-card);
    border-radius: 50%;
}

/* Dropdown */
.auth-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 200;
    overflow: hidden;
}

.auth-dropdown.open { display: block; }

.auth-dropdown-info {
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-dropdown-name {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text);
}

.auth-dropdown-email {
    font-size: var(--text-xs);
    color: var(--text-dim);
    word-break: break-all;
}

.auth-dropdown-divider {
    border-top: 1px solid var(--border);
}

.auth-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: var(--text-md);
    color: var(--text-dim);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-dropdown-item:hover {
    background: var(--navy-light);
    color: var(--text);
}

.auth-dropdown-logout { color: var(--red); }
.auth-dropdown-logout:hover { color: var(--red); }

.auth-dropdown-guide-row { display:flex; align-items:center; gap:0.4rem; }
.auth-dropdown-guide-label { flex:1; }
.auth-dropdown-guide-link {
    font-size:0.72rem; font-weight:600; padding:0.2rem 0.5rem;
    border:1px solid var(--border); border-radius:4px;
    color:var(--text-dim); text-decoration:none;
    transition:background 0.15s, color 0.15s;
    white-space:nowrap;
}
.auth-dropdown-guide-link:hover { background:var(--blue); border-color:var(--blue); color:#fff; }

/* ── FAQ ────────────────────────────────────────────────────────────────────── */
.home-section-faq { padding: 3rem 0 4rem; }
.faq-lang-toggle { display:flex; justify-content:center; gap:0.5rem; margin-bottom:2rem; }
.faq-lang-btn { padding:0.35rem 1.1rem; border:1px solid var(--border); border-radius:20px;
  background:none; color:var(--text-dim); cursor:pointer; font-size:0.82rem;
  transition:background 0.15s, color 0.15s, border-color 0.15s; }
.faq-lang-btn.active { background:var(--blue); border-color:var(--blue); color:#fff; }
.faq-category { margin-bottom:2rem; }
.faq-category-title { font-size:0.9rem; font-weight:700; color:var(--blue);
  margin-bottom:0.75rem; padding-bottom:0.4rem; border-bottom:1px solid var(--border);
  text-transform:uppercase; letter-spacing:0.04em; }
.faq-item { border:1px solid var(--border); border-radius:8px; margin-bottom:0.5rem;
  overflow:hidden; transition:border-color 0.2s; }
.faq-item.open { border-color:var(--blue); }
.faq-q { display:flex; justify-content:space-between; align-items:center;
  padding:0.85rem 1rem; cursor:pointer; font-weight:600; font-size:0.88rem;
  color:var(--text); user-select:none; }
.faq-q::after { content:'▸'; transition:transform 0.2s; font-size:0.75rem;
  color:var(--text-dim); flex-shrink:0; margin-left:0.5rem; }
.faq-item.open .faq-q::after { transform:rotate(90deg); }
.faq-a { padding:0 1rem 1rem 1rem; font-size:0.83rem; color:var(--text-dim);
  line-height:1.7; display:none; }
.faq-item.open .faq-a { display:block; }
@media (max-width:640px) {
  .faq-q { font-size:0.82rem; }
  .faq-a { font-size:0.78rem; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 0.75rem;
    display: block;
}

.login-logo h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 0.5rem;
}

.login-logo p {
    font-size: var(--text-md);
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
}


/* ── Auth Gate (sign-in required screen) ─────────────────────────────── */
.auth-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.auth-gate-card {
    text-align: center;
    padding: 3rem 2.5rem;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-gate-logo {
    width: 72px;
    height: 72px;
}

.auth-gate-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}

.auth-gate-desc {
    font-size: var(--text-md);
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
}

.login-note {
    font-size: var(--text-sm);
    color: var(--text-dim);
    margin: 0;
}

.login-back a {
    font-size: var(--text-sm);
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.login-back a:hover { color: var(--gold); }

/* ============================================================
   AUTH MODAL
   ============================================================ */

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal-card {
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    z-index: 301;
    overflow: hidden;
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0;
    gap: 0.75rem;
}

.auth-modal-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.auth-modal-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.auth-modal-close:hover {
    color: var(--text);
    background: var(--navy-light);
}

/* ── Error / Success banner ── */
.auth-error {
    margin: 0.75rem 1.5rem 0;
    padding: 0.6rem 0.875rem;
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid rgba(255, 23, 68, 0.3);
    border-radius: var(--radius);
    color: var(--red);
    font-size: var(--text-sm);
    line-height: 1.4;
}
.auth-success-msg {
    background: rgba(0, 200, 83, 0.1);
    border-color: rgba(0, 200, 83, 0.3);
    color: var(--green);
}

/* ── Panels — all hidden; data-state reveals the active one ── */
.auth-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
}

#authModal[data-state="sign-in"]        #authPanelSignin { display: flex; }
#authModal[data-state="sign-up"]        #authPanelSignup { display: flex; }
#authModal[data-state="forgot-password"] #authPanelForgot { display: flex; }
#authModal[data-state="verify-pending"] #authPanelVerify { display: flex; }

/* ── Tabs ── */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 0.5rem;
    font-family: 'Raleway', sans-serif;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}
.auth-tab.active,
.auth-tab:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* ── Form fields group ── */
.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* ── Submit button ── */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: var(--radius);
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-md);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.auth-submit-btn:hover   { background: var(--gold-light); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── CSS-only spinner ── */
.auth-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }


/* ── Link buttons ── */
.auth-link-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: var(--text-sm);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.15s;
    text-align: center;
}
.auth-link-btn:hover { color: var(--gold); }

.auth-forgot-link { align-self: flex-end; }
.auth-back-link   { align-self: flex-start; }

/* ── Verify panel ── */
.auth-verify-icon {
    font-size: 2.5rem;
    text-align: center;
}
.auth-panel-desc {
    font-size: var(--text-md);
    color: var(--text-dim);
    line-height: 1.5;
    text-align: center;
}
.auth-resend-status {
    font-size: var(--text-sm);
    color: var(--green);
    text-align: center;
    min-height: 1.2em;
}

/* ── Auth provider badge in dropdown ── */
.auth-dropdown-provider {
    display: inline-block;
    font-size: var(--text-xs);
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    background: var(--gold-dim);
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* ============================================================
   EXPORT TOOLBAR
   ============================================================ */

.export-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.875rem;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.export-label {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-right: 0.2rem;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PAYMENT & SUBSCRIPTION STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Plan badge in nav dropdown ─────────────────────────────────────────── */
.nav-plan-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), #e5a800);
    color: var(--navy);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 2px;
}

.auth-dropdown-upgrade {
    color: var(--gold) !important;
    font-weight: 600;
}

/* ── Grace period banner ─────────────────────────────────────────────────── */
.grace-period-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #b45309;
    color: #fff;
    text-align: center;
    font-size: 0.85rem;
    padding: 8px 16px;
    font-weight: 500;
}

/* ── Payment toast ───────────────────────────────────────────────────────── */
.payment-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 400;
    min-width: 260px;
    max-width: 380px;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    animation: toast-in 0.2s ease;
}

.payment-toast--success { background: #166534; color: #dcfce7; border-left: 4px solid #22c55e; }
.payment-toast--error   { background: #7f1d1d; color: #fee2e2; border-left: 4px solid #ef4444; }

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

/* ── Payment / Subscription modals ──────────────────────────────────────── */
.payment-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.payment-modal-card {
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.payment-modal-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.payment-modal-body {
    padding: 20px;
}

.payment-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.1);
}

/* ── Subscription status rows ─────────────────────────────────────────── */
.sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.sub-row:last-child { border-bottom: none; }
.sub-label { font-size: 0.85rem; color: var(--text-dim); }
.sub-value  { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.sub-expiry-warning {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(180, 83, 9, 0.15);
    border: 1px solid #b45309;
    color: #fbbf24;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}
.light .sub-expiry-warning {
    background: #fef3c7;
    border-color: #d97706;
    color: #92400e;
}

/* ── Upgrade prompt modal ─────────────────────────────────────────────── */
.upgrade-prompt-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Duration picker modal ────────────────────────────────────────────── */
.duration-picker-card {
    max-width: 560px;
}

.duration-picker-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: -4px 0 16px;
    text-align: center;
}

.duration-options {
    display: flex;
    gap: 10px;
}

.duration-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 12px 16px;
    background: var(--navy-light);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    color: var(--text);
    text-align: center;
    min-height: 140px;
    justify-content: flex-start;
}

.duration-option:hover {
    border-color: var(--gold);
    background: rgba(212,160,23,0.07);
    box-shadow: 0 4px 16px rgba(212,160,23,0.15);
    transform: translateY(-2px);
}

.duration-option-featured {
    border-color: var(--gold);
    background: rgba(212,160,23,0.06);
    box-shadow: 0 2px 10px rgba(212,160,23,0.12);
}

.duration-option-badge {
    display: inline-block;
    background: var(--gold);
    color: #0d1b2a;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    align-self: center;
}

.duration-option-badge--value {
    background: #3a9e6b;
    color: #fff;
}

.duration-option-spacer {
    height: 20px;
    flex-shrink: 0;
}

.duration-option-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.duration-option-price {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1.2;
    margin-top: 2px;
}

.duration-option-period {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.duration-save {
    font-size: 0.72rem;
    color: #3a9e6b;
    font-weight: 600;
    margin-top: 2px;
}

@media (max-width: 500px) {
    .duration-options {
        flex-direction: column;
    }
    .duration-option {
        flex-direction: row;
        min-height: unset;
        padding: 12px 14px;
        gap: 10px;
        justify-content: flex-start;
        align-items: center;
    }
    .duration-option-spacer {
        display: none;
    }
    .duration-option-badge,
    .duration-option-badge--value {
        margin-bottom: 0;
    }
}

/* ── Mayar payment iframe modal ───────────────────────────────────────── */
.mayar-payment-card {
    max-width: 640px;
    width: 95%;
    height: 85vh;
    max-height: 720px;
    display: flex;
    flex-direction: column;
}

.mayar-iframe-container {
    flex: 1;
    position: relative;
    min-height: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

#mayarPaymentIframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.mayar-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--navy);
    color: var(--text-dim);
    font-size: 0.9rem;
}

@media (max-width: 500px) {
    .mayar-payment-card {
        height: 92vh;
        max-height: none;
    }
}

/* ── Custom dialog & toast system (ui-dialog.js) ─────────────────────── */
.ui-dialog-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ui-dialog-card {
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 28px 20px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: uiDialogIn 0.18s ease;
}

@keyframes uiDialogIn {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ui-dialog-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
}

.ui-dialog-message {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin: 0 0 18px;
}

.ui-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.ui-prompt-input {
    margin-top: 14px;
    width: 100%;
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    padding: 8px 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.ui-prompt-input:focus {
    border-color: var(--gold);
}

/* Toast container */
#uiToastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 500;
    pointer-events: none;
}

.ui-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--navy);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    padding: 11px 14px;
    min-width: 260px;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.ui-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.ui-toast--success { border-left-color: #3a9e6b; }
.ui-toast--error   { border-left-color: #e05c5c; }
.ui-toast--warning { border-left-color: #d4a017; }
.ui-toast--info    { border-left-color: #4a9fd4; }

.ui-toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.ui-toast--success .ui-toast-icon { color: #3a9e6b; }
.ui-toast--error   .ui-toast-icon { color: #e05c5c; }
.ui-toast--warning .ui-toast-icon { color: #d4a017; }
.ui-toast--info    .ui-toast-icon { color: #4a9fd4; }

.ui-toast-msg {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.4;
}

.ui-toast-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
}

.ui-toast-close:hover {
    color: var(--text);
}

/* ── Export toolbar lock state ────────────────────────────────────────── */
.export-btn-locked {
    opacity: 0.55;
    cursor: pointer !important; /* still clickable — opens upgrade prompt */
}

.export-lock {
    font-size: 0.75rem;
    margin-left: 2px;
    vertical-align: middle;
}

/* ── Pro feature locked sections ─────────────────────────────────────── */
.section-locked {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.5;
}

.section-locked-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.65;
    margin-top: 1px;
}

.section-locked a {
    color: var(--gold, #f59e0b);
    text-decoration: underline;
    cursor: pointer;
}

.section-locked a:hover { opacity: 0.8; }

/* Small inline lock badge (used in key metrics grid and prediction summary bar) */
.inline-pro-lock {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 0.15rem 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.inline-pro-lock a {
    color: var(--gold, #f59e0b);
    text-decoration: underline;
    cursor: pointer;
}

/* ── Danger button ────────────────────────────────────────────────────── */
.btn-danger {
    background: #7f1d1d;
    color: #fee2e2;
    border: 1px solid #ef4444;
}
.btn-danger:hover { background: #991b1b; }

/* ── Research Tab ────────────────────────────────────────────────────── */

.research-wrapper {
    margin-top: 1rem;
}

/* Sub-tab bar */
.research-sub-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0;
}

.sub-tab {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-base);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab:hover {
    color: var(--gold-light);
    background: rgba(184, 134, 11, 0.1);
}

.sub-tab.active {
    color: var(--gold);
    background: var(--navy-card);
    border-color: var(--border);
    border-bottom-color: var(--navy-card);
    margin-bottom: -2px;
}

/* Panels */
.research-panel {
    display: none;
}

.research-panel.active {
    display: block;
}

/* Search bar */
.research-search-bar {
    margin-bottom: 1rem;
}

/* Search input wrapper */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
    font-size: 1rem;
}

.search-input-wrapper .search-with-icon {
    padding-left: 2.5rem;
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.search-clear-btn:hover {
    opacity: 1;
    color: var(--text);
}

/* Loading state */
.research-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    color: var(--text-dim);
    font-size: var(--text-md);
}

/* Empty state */
.research-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-dim);
    font-size: var(--text-md);
}

.empty-state-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.empty-state-title {
    font-size: var(--text-md);
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.empty-state-hint {
    font-size: var(--text-sm);
    color: var(--text-dim);
    opacity: 0.6;
}

.research-panel .table-scroll-wrapper {
    max-height: 60vh;
    overflow-y: auto;
}

/* Shareholders table */
.shareholders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: var(--text-base);
}

.shareholders-table th {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--navy-card);
}

.shareholders-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
    vertical-align: middle;
}

.shareholders-table th.text-right,
.shareholders-table td.text-right {
    text-align: right;
}

.shareholders-table tbody tr:nth-child(even) {
    background: rgba(212, 160, 23, 0.03);
}

.shareholders-table tbody tr {
    cursor: pointer;
    transition: background 0.12s;
}
.shareholders-table tbody tr:hover {
    background: rgba(212, 160, 23, 0.08);
}
/* Clickable row → show a subtle right-arrow indicator on the last cell */
.shareholders-table tbody tr:hover .sh-actions-cell::after {
    content: ' ›';
    color: var(--gold);
    opacity: 0.5;
    font-size: 0.9rem;
}

.research-type-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--gold-dim);
    color: var(--gold);
}

.type-badge-institution {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.type-badge-insider {
    background: var(--gold-dim);
    color: var(--gold);
}

.type-badge-other {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.type-badge-government {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.type-badge-public {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
}

/* Free Float filter bar */
.research-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.filter-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-right: 0.25rem;
}
.ff-filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.ff-filter-btn:hover:not(.disabled) {
    border-color: var(--gold);
    color: var(--gold);
}
.ff-filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-deep);
    font-weight: 600;
}
.ff-filter-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Result info */
.research-result-info {
    font-size: var(--text-sm);
    color: var(--text-dim);
    padding: 0.35rem 0;
    margin-bottom: 0.5rem;
}

/* Skeleton loader */
.skeleton-row {
    height: 1rem;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Pagination */
.research-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.research-page-info {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

/* Feature blur overlay */
.feature-blur-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius);
    z-index: 10;
}

.feature-blur-content {
    text-align: center;
    padding: 2rem;
    max-width: 360px;
}

.feature-blur-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-blur-content h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.feature-blur-content p {
    color: var(--text-dim);
    font-size: var(--text-base);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Holder link (clickable shareholder name) */
.holder-link {
    color: var(--gold);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted var(--gold-dim);
    transition: color 0.2s, border-color 0.2s;
}
.holder-link:hover {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
}

/* HHI concentration colours */
.hhi-low { color: #4ade80; }
.hhi-moderate { color: #fbbf24; }
.hhi-high { color: #f87171; }

/* HHI tooltip */
.hhi-tooltip {
    cursor: help;
    font-size: 0.75em;
    opacity: 0.6;
}
.hhi-tooltip:hover {
    opacity: 1;
}

/* Pro lock icon (inline in table cells) */
.pro-lock-icon {
    cursor: pointer;
    opacity: 0.5;
    font-size: 0.85em;
    transition: opacity 0.2s;
}
.pro-lock-icon:hover {
    opacity: 1;
}
.pro-col-cell .pro-lock-icon {
    display: inline-block;
}

/* Trend button */
.class-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--blue);
    cursor: pointer;
    padding: 1px 5px;
    font-size: 0.75em;
    margin-left: 0.4rem;
    transition: background 0.2s;
    vertical-align: middle;
}
.class-btn:hover {
    background: rgba(96,165,250,0.12);
}
.trend-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--gold);
    cursor: pointer;
    padding: 1px 5px;
    font-size: 0.75em;
    margin-left: 0.4rem;
    transition: background 0.2s;
    vertical-align: middle;
}
.trend-btn:hover {
    background: var(--gold-dim);
}

/* Chart modal */
.chart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.chart-modal-card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.chart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.chart-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}
.chart-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.chart-modal-close:hover {
    color: var(--text-primary);
}
.chart-modal-body {
    padding: 1.25rem;
    position: relative;
    min-height: 300px;
}
.chart-modal-body canvas {
    width: 100% !important;
    height: 300px !important;
}

/* Sort arrows */
.sort-arrow {
    font-size: 0.7em;
    opacity: 0.5;
    margin-left: 0.25rem;
}
.sort-arrow.active {
    opacity: 1;
    color: var(--gold);
}

/* Relation fallback rows */
.relation-fallback-row {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.relation-fallback-row:last-child {
    border-bottom: none;
}

/* Coming Soon */
.research-coming-soon {
    text-align: center;
    padding: 3rem 1rem;
}

.research-coming-soon-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.research-coming-soon h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.research-coming-soon p {
    color: var(--text-dim);
    font-size: var(--text-md);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Research responsive */
@media (max-width: 768px) {
    .research-sub-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .sub-tab {
        font-size: var(--text-xs);
        padding: 0.4rem 0.75rem;
        white-space: nowrap;
    }

    .shareholders-table {
        min-width: 500px;
    }

    .chart-modal-card {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .chart-modal-body canvas {
        height: 250px !important;
    }

    .insight-pills {
        gap: 0.3rem;
    }

    .insight-pill {
        font-size: var(--text-xs);
        padding: 0.25rem 0.6rem;
    }

    .insight-breadth-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ff-summary-grid {
        grid-template-columns: 1fr;
    }
    .ff-summary-card-wide {
        grid-column: span 1;
    }
    .ff-search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ff-search-bar .search-input-wrapper {
        flex: 1;
    }
}

/* ── Insights ──────────────────────────────────────────── */

.insight-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.insight-pill {
    font-family: 'Raleway', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.insight-pill:hover {
    color: var(--gold-light);
    border-color: var(--gold-dim);
    background: rgba(212, 160, 23, 0.08);
}

.insight-pill.active {
    color: var(--navy);
    background: var(--gold);
    border-color: var(--gold);
    font-weight: 700;
}

/* Locked (pro) insight pill style */
.insight-pill.locked {
    opacity: 0.55;
    position: relative;
    cursor: pointer;
}
.insight-pill.locked::after {
    content: '\1F512'; /* lock emoji */
    font-size: 0.95em;
    margin-left: 0.4em;
    vertical-align: middle;
    opacity: 0.7;
}

.insights-content-wrap {
    position: relative;
    min-height: 280px;
}

.insight-content {
    min-height: 120px;
}

/* ── Sector Rotation (RRG Chart) ──────────────────────────────────────── */

.insight-content-box {
    position: relative;
}

.rrg-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
}

/* Back button for drill-down mode */
.rrg-back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--navy-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    z-index: 10;
}

.rrg-back-btn:hover {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

body.light .rrg-back-btn {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

body.light .rrg-back-btn:hover {
    background: var(--gold);
    color: #fff;
}

#rrg-canvas,
#conglomerate-canvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--navy-card);
}

.rrg-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--navy-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rrg-fullscreen-btn:hover {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

/* Fullscreen mode */
.rrg-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--navy);
    padding: 2rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rrg-fullscreen #rrg-canvas,
.rrg-fullscreen #conglomerate-canvas {
    max-width: 1400px;
    max-height: 90vh;
    margin: 0 auto;
}

.rrg-fullscreen .rrg-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
}

/* RRG Tooltip */
.rrg-tooltip {
    position: fixed;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    pointer-events: none;
    z-index: 1000;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.rrg-tooltip-sector {
    font-weight: 700;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.rrg-tooltip-quadrant {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: white;
}

.quadrant-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}

.rrg-methodology-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.4rem 0;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 600;
}
.rrg-methodology-toggle:hover {
    color: var(--text);
}

.rrg-tooltip-metrics {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}

.rrg-tooltip-metrics div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.rrg-tooltip-metrics .label {
    color: var(--text-dim);
}

.rrg-tooltip-metrics .value {
    font-weight: 600;
    color: var(--text);
}

.rrg-tooltip-metrics .positive {
    color: var(--green);
}

.rrg-tooltip-metrics .negative {
    color: var(--red);
}

#sector-table-container {
    margin-top: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--navy-light);
}

#sector-table-container::-webkit-scrollbar {
    height: 8px;
}

#sector-table-container::-webkit-scrollbar-track {
    background: var(--navy-light);
    border-radius: 4px;
}

#sector-table-container::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

#sector-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

#conglomerate-table-container {
    margin-top: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--navy-light);
}

#conglomerate-table-container::-webkit-scrollbar {
    height: 8px;
}

#conglomerate-table-container::-webkit-scrollbar-track {
    background: var(--navy-light);
    border-radius: 4px;
}

#conglomerate-table-container::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

#conglomerate-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

#conglomerate-table {
    width: 100%;
    min-width: 700px; /* Ensure table doesn't get too cramped on mobile */
    border-collapse: collapse;
}

#conglomerate-table th,
#conglomerate-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#conglomerate-table th {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    white-space: nowrap;
}

#conglomerate-table td {
    font-size: var(--text-sm);
    color: var(--text);
}

#conglomerate-table tbody tr:hover {
    background: var(--navy-light);
}

#conglomerate-table .text-right {
    text-align: right;
}

#conglomerate-table .text-dim {
    color: var(--text-dim);
}

#conglomerate-table .text-green {
    color: var(--green);
}

#conglomerate-table .text-red {
    color: var(--red);
}

/* Mobile: make first column (Conglomerate name) sticky for better UX */
@media (max-width: 768px) {
    #conglomerate-table-container {
        position: relative;
    }
    
    /* Scroll hint gradient on the right edge */
    #conglomerate-table-container::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to left, var(--navy-card), transparent);
        pointer-events: none;
        float: right;
        margin-left: -30px;
    }
    
    #conglomerate-table th,
    #conglomerate-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    #conglomerate-table thead th:first-child,
    #conglomerate-table tbody td:first-child {
        position: sticky;
        left: 0;
        background: var(--navy-card);
        z-index: 10;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    }
    
    #conglomerate-table thead th:first-child {
        z-index: 11; /* Higher than body cells */
    }
    
    #conglomerate-table tbody tr:hover td:first-child {
        background: var(--navy-light);
    }
}

/* ── Sector Rotation Table (same styling as Conglomerate) ────────────────── */
#sector-table {
    width: 100%;
    min-width: 650px; /* Slightly smaller than conglomerate since fewer columns */
    border-collapse: collapse;
}

#sector-table th,
#sector-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#sector-table th {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    white-space: nowrap;
}

#sector-table td {
    font-size: var(--text-sm);
    color: var(--text);
}

#sector-table tbody tr:hover {
    background: var(--navy-light);
}

#sector-table .text-right {
    text-align: right;
}

#sector-table .text-dim {
    color: var(--text-dim);
}

#sector-table .text-green {
    color: var(--green);
}

#sector-table .text-red {
    color: var(--red);
}

/* Mobile: make first column (Sector name) sticky for better UX */
@media (max-width: 768px) {
    #sector-table-container {
        position: relative;
    }
    
    /* Scroll hint gradient on the right edge */
    #sector-table-container::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to left, var(--navy-card), transparent);
        pointer-events: none;
        float: right;
        margin-left: -30px;
    }
    
    #sector-table th,
    #sector-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    #sector-table thead th:first-child,
    #sector-table tbody td:first-child {
        position: sticky;
        left: 0;
        background: var(--navy-card);
        z-index: 10;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    }
    
    #sector-table thead th:first-child {
        z-index: 11; /* Higher than body cells */
    }
    
    #sector-table tbody tr:hover td:first-child {
        background: var(--navy-light);
    }
}

/* ── RRG Period Selector */
.rrg-period-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.rrg-period-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
}

.rrg-period-pill {
    background: var(--navy-light);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.rrg-period-pill:hover {
    border-color: var(--gold);
    color: var(--text);
}

.rrg-period-pill.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
}

.rrg-period-note {
    font-size: 11px;
    color: var(--text-dim);
    font-style: italic;
}

.rrg-snapshot-date {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: auto;   /* push to the right end of the flex row */
}

.rrg-snapshot-date strong {
    color: var(--text);
}

/* ── RRG → Screener filter banner */
.rrg-filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--navy-light);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 13px;
    color: var(--text);
}

.rrg-banner-clear {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.rrg-banner-clear:hover {
    color: var(--text);
    background: var(--border);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #rrg-canvas,
    #conglomerate-canvas {
        min-height: 400px;
    }
    
    .rrg-fullscreen {
        padding: 1rem;
    }
    
    .rrg-fullscreen-btn {
        padding: 0.4rem 0.6rem;
        font-size: 12px;
    }
}

/* ── Sprint 33: Top Tickers in Sector/Conglomerate ───────────────────────── */

.top-tickers-section {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.top-tickers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.top-tickers-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
    margin: 0;
}

.top-tickers-sort-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-tickers-sort-toggle .toggle-label {
    font-size: 12px;
    color: var(--text-dim);
}

.sort-pill {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.3rem 0.7rem;
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sort-pill:hover {
    border-color: var(--gold);
    color: var(--text);
}

.sort-pill.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
}

.top-tickers-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 13px;
}

.top-tickers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.top-ticker-card {
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.top-ticker-card:hover {
    border-color: var(--gold);
    background: var(--navy);
}

.top-ticker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.top-ticker-symbol {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.top-ticker-change {
    font-size: 12px;
    font-weight: 500;
}

.top-ticker-change.positive { color: var(--green); }
.top-ticker-change.negative { color: var(--red); }

.top-ticker-name {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-ticker-metrics {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.top-ticker-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.top-ticker-metric-label {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.top-ticker-metric-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}

.top-ticker-metric-value.highlight {
    color: var(--gold);
}

.top-ticker-phase {
    font-size: 10px;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--navy);
    color: var(--text-dim);
}

.top-tickers-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-dim);
    font-size: 13px;
}

/* Light mode adjustments */
body.light .top-tickers-section {
    background: #fff;
}

body.light .top-ticker-card {
    background: #f8f9fa;
}

body.light .top-ticker-card:hover {
    background: #f0f1f3;
}

body.light .sort-pill.active {
    color: #fff;
}

@media (max-width: 600px) {
    .top-tickers-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .top-tickers-grid {
        grid-template-columns: 1fr;
    }
}

/* Sprint 33: Top Tickers RRG Mini Chart */
.top-tickers-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.top-tickers-close:hover {
    color: var(--text);
}

.top-tickers-rrg-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#sector-top-tickers-canvas,
#conglomerate-top-tickers-canvas {
    width: 100%;
    height: 280px;
    background: var(--navy);
    border-radius: 8px;
}

.top-tickers-legend {
    width: 100%;
}

.top-tickers-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.top-tickers-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--navy-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s ease;
}

.top-tickers-legend-item:hover {
    background: var(--navy);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-ticker {
    font-weight: 600;
    color: var(--text);
    min-width: 45px;
}

.legend-change {
    font-size: 11px;
    font-weight: 500;
}

.legend-change.positive { color: var(--green); }
.legend-change.negative { color: var(--red); }

.legend-ratio,
.legend-mom {
    font-size: 10px;
    color: var(--text-dim);
}

/* Light mode for RRG mini chart */
body.light #sector-top-tickers-canvas,
body.light #conglomerate-top-tickers-canvas {
    background: #f0f1f3;
}

body.light .top-tickers-legend-item {
    background: #f8f9fa;
}

body.light .top-tickers-legend-item:hover {
    background: #e9ecef;
}

@media (max-width: 600px) {
    #sector-top-tickers-canvas,
    #conglomerate-top-tickers-canvas {
        height: 220px;
    }
    
    .top-tickers-legend-grid {
        grid-template-columns: 1fr;
    }
}

/* Breadth summary cards */
.insight-breadth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.insight-card {
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.insight-card-label {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

.insight-card-value {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Foreign Flow Dashboard ─────────────────────────────────────────────── */
.ff-dashboard {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ff-summary-date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.ff-summary-date strong {
    color: var(--gold);
}
.ff-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.ff-summary-card {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--navy-light);
}
.ff-summary-card-wide {
    grid-column: span 2;
}
.ff-summary-label {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.ff-summary-value {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}
.ff-summary-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.ff-ticker-chip {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.ff-chip-buy {
    background: rgba(0, 200, 83, 0.12);
    color: var(--green);
}
.ff-chip-sell {
    background: rgba(255, 23, 68, 0.12);
    color: var(--red);
}

/* Foreign Flow search */
.ff-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.ff-search-bar .search-input-wrapper {
    flex: 0 1 280px;
}
.ff-result-count {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

/* Foreign Flow sortable headers */
.ff-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.ff-sortable:hover {
    color: var(--gold-light);
}
.ff-sort-arrow {
    font-size: 0.7em;
    color: var(--gold);
    margin-left: 0.2rem;
}

/* Foreign Flow table min-width for 8 columns */
.ff-table {
    min-width: 900px;
}
.ff-table thead th { position: sticky; top: 0; z-index: 10; background: var(--navy-card); }
.ff-table tbody tr:hover { background: rgba(212,160,23,0.06); }

/* FF filter action bar */
.ff-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.ff-filter-actions .btn-sm {
    font-size: var(--text-xs);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.ff-filter-actions .btn-sm:hover,
.ff-filter-actions .btn-sm.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(184,134,11,0.1);
}

/* FF Anomaly banner */
.ff-anomaly-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(184,134,11,0.07);
    border: 1px solid rgba(184,134,11,0.2);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}
.ff-anomaly-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.25rem;
}
.ff-anomaly-chip {
    border: 1px solid rgba(184,134,11,0.3) !important;
}
.ff-anomaly-row-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(184,134,11,0.18);
    color: var(--gold);
    margin-left: 5px;
    vertical-align: middle;
}
tr.ff-row-anomaly td:first-child {
    border-left: 2px solid var(--gold);
}

/* FF Sector Heatmap */
.ff-sector-heatmap {
    margin-bottom: 1rem;
}
.ff-sector-label {
    font-size: var(--text-xs);
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}
.ff-sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.4rem;
}
.ff-sector-card {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.ff-sector-card.ff-sector-buy {
    background: rgba(0,200,83,0.06);
    border-color: rgba(0,200,83,0.2);
}
.ff-sector-card.ff-sector-sell {
    background: rgba(255,23,68,0.06);
    border-color: rgba(255,23,68,0.2);
}
.ff-sector-name {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-dim);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ff-sector-value {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text);
}
.ff-sector-card.ff-sector-buy .ff-sector-value { color: var(--green); }
.ff-sector-card.ff-sector-sell .ff-sector-value { color: var(--red); }
.ff-sector-meta {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
}

/* ── FF Top Accumulators ─────────────────────────────────── */

.ff-accum-section {
    margin-bottom: 24px;
}

.ff-accum-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ff-accum-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ff-accum-info {
    color: var(--text-dim);
    font-size: 0.8rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}
.ff-accum-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.74rem;
    color: var(--text);
    line-height: 1.45;
    z-index: 200;
    white-space: normal;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.ff-accum-info:hover .ff-accum-tooltip,
.ff-accum-info.active .ff-accum-tooltip {
    display: block;
}

.ff-accum-subtitle {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0 0 12px;
    line-height: 1.4;
}

.ff-accum-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    background: var(--navy-light);
    border-radius: 8px;
}

.ff-accum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
    gap: 10px;
    margin-bottom: 0;
}

.ff-accum-card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px 10px;
    position: relative;
    transition: border-color 0.15s;
    overflow: hidden;
}

.ff-accum-card:hover {
    border-color: var(--gold);
}

.ff-accum-card-top {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.ff-accum-rank {
    font-size: 0.65rem;
    color: var(--text-dim);
    min-width: 18px;
}

.ff-accum-ticker {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--gold);
    text-decoration: none;
    flex: 1;
}

.ff-accum-ticker:hover {
    text-decoration: underline;
}

.ff-accum-sector {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-vp-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    margin-bottom: 6px;
    font-weight: 600;
}

.ff-vp-badge--below { background: rgba(34,197,94,0.12);  color: var(--green); }
.ff-vp-badge--at    { background: rgba(234,179,8,0.12);  color: #eab308; }
.ff-vp-badge--above { background: rgba(239,68,68,0.12);  color: var(--red); }

.ff-accum-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 8px;
    margin-bottom: 8px;
}

.ff-accum-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ff-accum-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ff-accum-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.ff-accum-sparkline {
    display: block;
    width: 100%;
    height: 40px;
    margin-top: 4px;
}

.ff-accum-card--blurred {
    min-height: 100px;
}

.ff-accum-blur-overlay {
    position: absolute;
    inset: 32px 0 0;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 7px 7px;
}

.ff-lock-icon {
    font-size: 1.1rem;
}

.ff-accum-cta {
    margin-top: 12px;
    padding: 13px 16px;
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ff-accum-cta-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.ff-accum-cta-btn {
    white-space: nowrap;
    padding: 7px 14px;
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.ff-accum-cta-btn:hover {
    opacity: 0.88;
}

/* ── Shareholder row type borders ───────────────────────── */
tr.sh-row-corp   { border-left: 3px solid #22c55e; }
tr.sh-row-inst   { border-left: 3px solid #3b82f6; }
tr.sh-row-retail { border-left: 3px solid #f59e0b; }
tr.sh-row-corp:hover,
tr.sh-row-inst:hover,
tr.sh-row-retail:hover { background: rgba(212,160,23,0.04); }

body.light .ff-accum-blur-overlay {
    background: rgba(240, 244, 255, 0.78);
}

body.light .ff-accum-cta {
    background: #f1f5f9;
}

/* ── Data Update Button ──────────────────────────────────── */

.sh-update-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font-size: var(--text-xs); font-weight: 600; font-family: 'Oswald', sans-serif;
    letter-spacing: 0.4px; text-transform: uppercase;
    background: var(--gold-dim); color: var(--gold);
    border: 1px solid var(--border); border-radius: 4px;
    cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.sh-update-btn:hover {
    background: rgba(212,160,23,0.18); border-color: var(--gold);
}

/* ── Data Update Modal ───────────────────────────────────── */

.du-modal-card { max-width: 500px; width: 95vw; overflow: hidden; }

/* Header inner layout: icon + title/subtitle block */
.du-modal-header-inner {
    display: flex; align-items: center; gap: 0.65rem;
}
.du-modal-icon {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    background: var(--gold-dim); color: var(--gold);
    border: 1px solid var(--border);
}
.du-modal-title {
    font-size: 1rem; font-weight: 700; margin: 0;
    font-family: var(--font-heading); color: var(--text);
}
.du-modal-subtitle {
    font-size: 0.72rem; color: var(--text-dim); margin: 0.1rem 0 0;
}

.du-modal-body { padding: 1rem 1.25rem; }
.du-modal-footer {
    display: flex; justify-content: flex-end;
    padding: 0.75rem 1.25rem; border-top: 1px solid var(--border);
}

/* Stats row */
.du-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0; margin-bottom: 1.25rem;
    background: var(--navy-light);
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.du-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 0.9rem 0.5rem;
    border-right: 1px solid var(--border);
}
.du-stat:last-child { border-right: none; }
.du-stat-value {
    font-size: 1.6rem; font-weight: 700; font-family: 'Oswald', sans-serif; line-height: 1;
}
.du-stat-label {
    font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase;
    letter-spacing: 0.6px; margin-top: 0.25rem; text-align: center;
}
.du-stat-green   { color: var(--green); }
.du-stat-gold    { color: var(--gold); }
.du-stat-neutral { color: var(--text); }

/* Section blocks */
.du-section { margin-bottom: 1.1rem; }
.du-section-label {
    font-size: 0.63rem; font-family: 'Oswald', sans-serif; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--gold);
    border-left: 2px solid var(--gold); padding-left: 0.45rem;
    margin-bottom: 0.55rem;
}

/* New tickers row */
.du-new-ticker-row {
    display: flex; align-items: center; gap: 0.65rem;
    background: var(--navy-light); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.55rem 0.75rem; margin-bottom: 0.5rem;
}
.du-new-icon {
    width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
    background: var(--gold-dim); color: var(--gold);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}
.du-new-desc { font-size: 0.8rem; color: var(--text); margin: 0; }
.du-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.1rem; }
.du-ticker-chip {
    display: inline-block; padding: 0.15rem 0.5rem;
    background: var(--navy-light); border: 1px solid var(--border);
    border-radius: 4px; font-size: 0.7rem; font-weight: 700;
    font-family: 'Oswald', sans-serif; color: var(--gold);
    cursor: default; letter-spacing: 0.4px;
    transition: border-color 0.15s;
}
.du-ticker-chip:hover { border-color: var(--gold); }

/* Investor change rows */
.du-investor-row {
    display: flex; align-items: center; gap: 0.65rem;
    background: var(--navy-light); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.5rem 0.75rem; margin-bottom: 0.35rem;
    font-size: 0.8rem; color: var(--text);
}
.du-investor-icon {
    width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; border: 1px solid var(--border);
}
.du-investor-in  .du-investor-icon { background: rgba(0,200,83,0.1);  color: var(--green); }
.du-investor-out .du-investor-icon { background: rgba(255,23,68,0.1); color: var(--red); }
.du-investor-in  strong { color: var(--green); }
.du-investor-out strong { color: var(--red); }

/* ── Network Button ──────────────────────────────────────── */

.network-btn {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #4FC3F7;
    border: 1px solid rgba(79,195,247,0.35);
    border-radius: 3px;
    padding: 0 4px;
    vertical-align: middle;
    transition: color 0.2s, border-color 0.2s;
}
.network-btn:hover {
    color: #81D4FA;
    border-color: rgba(79,195,247,0.7);
}

/* ── Network Graph Legend ────────────────────────────────── */

.du-network-legend {
    display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
    padding: 0.4rem 0.75rem; font-size: 0.72rem; color: var(--text-dim);
}
.du-legend-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}
.du-legend-center  { background: #FFB703; }
.du-legend-ticker  { background: #4FC3F7; }
.du-legend-inst    { background: #A5D6A7; }
.du-legend-individual { background: #CE93D8; }

/* ── Data Update Modal — investor detail list ──────────────────────── */
.du-modal-card { max-width: 640px; }

.du-stats-grid { grid-template-columns: repeat(4, 1fr); }

.du-stat-red { color: var(--red); }

.du-label-green { color: var(--green); border-left-color: var(--green); }
.du-label-red   { color: var(--red);   border-left-color: var(--red);   }

.du-empty { color: var(--text-dim); font-size: 0.8rem; padding: 0.5rem 0; margin: 0; }

.du-inv-scroll {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.du-inv-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}
.du-inv-row:last-child { border-bottom: none; }

.du-inv-type {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 62px;
    text-align: center;
}
.du-type-insider  { background: rgba(206,147,216,0.15); color: #CE93D8; }
.du-type-inst     { background: rgba(129,199,132,0.15); color: #81C784; }
.du-type-other    { background: rgba(148,163,184,0.12); color: var(--text-dim); }

.du-inv-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.du-inv-name    { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.du-inv-company { color: var(--text-dim); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.du-inv-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}
.du-inv-ticker { color: var(--gold); font-weight: 700; font-size: 0.78rem; }
.du-inv-pct    { color: var(--text-dim); font-size: 0.72rem; }

/* ── Connection Network Modal ─────────────────────────────────────── */
.network-modal-card {
    max-width: 980px;
    width: 95vw;
}

.network-fs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.network-fs-btn:hover {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: rgba(255,183,3,0.08);
}

/* Fullscreen mode — modal card fills the viewport */
#networkModal.network-fs-mode {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}
#networkModal.network-fs-mode .network-modal-card {
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
#networkModal.network-fs-mode .chart-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0.5rem;
}
#networkModal.network-fs-mode #networkCanvas {
    flex: 1;
    width: 100% !important;
}

/* ── Shareholders Delta Styles ───────────────────────────── */

.delta-btn {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold-dim);
    cursor: pointer;
    border: 1px solid var(--gold-dim);
    border-radius: 3px;
    padding: 0 4px;
    vertical-align: middle;
    transition: color 0.2s, border-color 0.2s;
}
.delta-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* ── Shareholders Actions Column ─────────────────────────── */

.sh-actions-cell { white-space: nowrap; vertical-align: middle; }
.sh-action-btns  { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }

/* Unified pill style — overrides legacy icon-class per-color rules */
.sh-action-btns .sh-action-btn {
    display: inline-flex;
    align-items: center;
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    margin: 0;
    padding: 0.22rem 0.55rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    vertical-align: unset;
    white-space: nowrap;
}
.sh-action-btns .sh-action-btn:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
/* Classification button gets a subtle accent to stand out (available to all) */
.sh-action-btns .sh-action-btn.class-btn {
    border-color: rgba(96,165,250,0.45);
    color: var(--blue);
}
.sh-action-btns .sh-action-btn.class-btn:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

/* Light mode overrides */
body.light .sh-action-btns .sh-action-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}
body.light .sh-action-btns .sh-action-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}
body.light .sh-action-btns .sh-action-btn.class-btn {
    border-color: #93c5fd;
    color: #2563eb;
}

.sh-delta-header {
    display: flex;
    gap: 2rem;
    font-size: var(--text-sm);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.sh-delta-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.sh-delta-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-family: 'Raleway', sans-serif;
}
.sh-delta-accum { background: rgba(0,200,83,0.12); color: var(--green); }
.sh-delta-dist  { background: rgba(255,23,68,0.12); color: var(--red); }
.sh-delta-new   { background: rgba(33,150,243,0.12); color: var(--blue); }
.sh-delta-exit  { background: rgba(148,163,184,0.12); color: var(--text-dim); }
.sh-delta-ff    { font-size: var(--text-sm); align-self: center; margin-left: auto; }

.sh-row-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    letter-spacing: 0.3px;
    font-family: 'Oswald', sans-serif;
}
.sh-badge-accum { background: rgba(0,200,83,0.15);  color: var(--green); }
.sh-badge-dist  { background: rgba(255,23,68,0.15);  color: var(--red); }
.sh-badge-new   { background: rgba(33,150,243,0.15); color: var(--blue); }
.sh-badge-exit  { background: rgba(148,163,184,0.1); color: var(--text-dim); }

tr.sh-delta-exited td { opacity: 0.55; }

/* ── Shareholders Screener Panel ──────────────────────────── */

.sh-screener-toggle {
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: 'Raleway', sans-serif;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all 0.2s;
    white-space: nowrap;
}
.sh-screener-toggle:hover,
.sh-screener-toggle.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(184,134,11,0.1);
}

.sh-screener-panel {
    padding: 1rem;
    background: rgba(184,134,11,0.04);
    border: 1px solid rgba(184,134,11,0.15);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}
.sh-screener-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.sh-screener-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-dim);
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.35rem;
}
.sh-screener-checks {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.sh-check-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    color: var(--text-dim);
    cursor: pointer;
}
.sh-screener-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sh-screener-mode-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gold);
    border: 1px solid rgba(184,134,11,0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-family: 'Oswald', sans-serif;
}

/* ── Shareholders Accumulation Summary Cards ─────────────── */

.sh-accum-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.sh-accum-card {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    min-width: 100px;
    border: 1px solid var(--border);
}
.sh-accum-buy  { background: rgba(0,200,83,0.07); border-color: rgba(0,200,83,0.2); }
.sh-accum-sell { background: rgba(255,23,68,0.07); border-color: rgba(255,23,68,0.2); }
.sh-accum-ticker {
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    color: var(--text);
}
.sh-accum-name {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.sh-accum-flag {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 0.2rem;
    font-family: 'Oswald', sans-serif;
}
.sh-accum-buy  .sh-accum-flag { color: var(--green); }
.sh-accum-sell .sh-accum-flag { color: var(--red); }

/* ── Plan feature note (add-on hint inside plan card) ───── */

.plan-feature-note {
    font-size: var(--text-xs);
    color: var(--gold);
    opacity: 0.85;
    font-style: italic;
    list-style: none;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(184, 134, 11, 0.2);
    margin-top: 0.25rem;
}
.plan-feature-note::before {
    content: none;
}

/* ── Shareholders Pro add-on callout ────────────────────── */

.plan-addon-callout {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: rgba(184, 134, 11, 0.06);
    border: 1px solid rgba(184, 134, 11, 0.25);
    border-radius: var(--radius);
}

.plan-addon-callout-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.plan-addon-callout-body {
    flex: 1;
    min-width: 0;
}

.plan-addon-callout-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 0.2rem;
}

.plan-addon-callout-desc {
    font-size: var(--text-xs);
    color: var(--text-dim);
    line-height: 1.5;
}

.plan-addon-callout-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .plan-addon-callout {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .plan-addon-callout-btn {
        width: 100%;
    }
}

/* ── Responsive: Auth modal (mobile) ────────────────────── */

@media (max-width: 480px) {
    .auth-modal-card {
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .auth-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

/* ── Responsive: Profile dropdown (mobile) ──────────────── */

@media (max-width: 480px) {
    .auth-dropdown {
        position: fixed;
        top: 60px;
        left: 0.5rem;
        right: 0.5rem;
        min-width: unset;
        width: auto;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* ── Responsive: FF search full-width (mobile) ──────────── */

@media (max-width: 480px) {
    .ff-search-bar .search-input-wrapper {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ── Responsive: Tab-nav horizontal scroll ──────────────── */

@media (max-width: 640px) {
    .tab-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tab-nav::-webkit-scrollbar {
        display: none;
    }
    .tab-link {
        flex-shrink: 0;
    }
}

/* ── Shareholders Changelog ─────────────────────────────────── */
.cl-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.cl-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cl-stat-green { border-color: var(--green); }
.cl-stat-red   { border-color: var(--red); }
.cl-stat-num   { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.cl-stat-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.cl-stat-green .cl-stat-num { color: var(--green); }
.cl-stat-red   .cl-stat-num { color: var(--red); }
.cl-stat-positive { background: rgba(34,197,94,0.08) !important; border-color: rgba(34,197,94,0.3) !important; }
.cl-stat-positive .cl-stat-num { color: var(--green); }
.cl-stat-negative { background: rgba(239,68,68,0.08) !important; border-color: rgba(239,68,68,0.3) !important; }
.cl-stat-negative .cl-stat-num { color: var(--red); }
.cl-stat-neutral  { background: rgba(212,160,23,0.08) !important; border-color: rgba(212,160,23,0.3) !important; }
.cl-stat-neutral  .cl-stat-num { color: var(--gold); }
.cl-stat-arrow { font-size: 0.7rem; margin-right: 2px; }

.cl-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 1.25rem 0 0.6rem;
}
.cl-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.cl-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
}
.cl-chip-removed { border-color: var(--red); opacity: 0.75; }
.cl-chip-ticker  { font-weight: 700; font-size: 0.82rem; color: var(--blue); }
.cl-chip-name    { font-size: 0.78rem; color: var(--text-dim); }
.cl-chip-count   { font-size: 0.72rem; background: var(--navy-mid); border-radius: 10px; padding: 0.1rem 0.4rem; color: var(--text-dim); }

.cl-accordion-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.cl-accordion-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  background: var(--card-bg);
  user-select: none;
  transition: background 0.15s;
}
.cl-accordion-header:hover { background: var(--navy-mid); }
.cl-acc-ticker { font-weight: 700; color: var(--blue); min-width: 70px; }
.cl-acc-badges { display: flex; gap: 0.4rem; flex: 1; }
.cl-acc-arrow  { color: var(--text-dim); font-size: 0.7rem; transition: transform 0.2s; }

.cl-badge { font-size: 0.7rem; border-radius: 10px; padding: 0.15rem 0.5rem; font-weight: 600; }
.cl-badge-new  { background: rgba(76,175,80,0.15); color: var(--green); }
.cl-badge-exit { background: rgba(239,83,80,0.15); color: var(--red); }

.cl-accordion-body { padding: 0.5rem 1rem; background: var(--bg); }
.cl-inv-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.cl-inv-row:last-child { border-bottom: none; }
.cl-inv-badge {
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  min-width: 34px;
  text-align: center;
}
.cl-inv-badge.new  { background: rgba(76,175,80,0.2); color: var(--green); }
.cl-inv-badge.exit { background: rgba(239,83,80,0.2); color: var(--red); }
.cl-inv-name    { font-weight: 600; color: var(--text); flex: 1; }
.cl-inv-company { color: var(--text-dim); font-size: 0.78rem; flex: 1; }
.cl-inv-pct     { font-weight: 600; color: var(--gold); min-width: 50px; text-align: right; }
.cl-inv-pct {
    position: relative;
    min-width: 80px;
}
.cl-delta-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 80px;
}
.cl-delta-bar::before {
    content: '';
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: var(--bar-width, 0%);
    background: var(--bar-color, var(--green));
    border-radius: 2px;
    opacity: 0.22;
    pointer-events: none;
}
.cl-inv-type    { color: var(--text-dim); font-size: 0.72rem; min-width: 70px; text-align: right; }

@media (max-width: 768px) {
  .cl-stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
}
@media (max-width: 480px) {
  .cl-stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; margin-bottom: 1rem; }
  .cl-stat { padding: 0.5rem; }
  .cl-stat-num { font-size: 1.2rem; }
  .cl-accordion-header { gap: 0.4rem; padding: 0.5rem 0.75rem; }
  .cl-acc-ticker { min-width: 52px; font-size: 0.82rem; }
  .cl-inv-row { flex-wrap: wrap; gap: 0.3rem; }
  .cl-inv-company { display: none; }
  .cl-inv-pct  { min-width: unset; }
  .cl-inv-type { min-width: unset; }
  .sh-inner-tab { padding: 0.4rem 0.65rem; font-size: 0.75rem; }
}


/* ── Ticker Shareholder Intel Strip (Sprint 33.5) ────────────────────────── */
.ticker-intel-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--navy-light);
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.intel-strip-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}
.intel-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.intel-link-btn svg { flex-shrink: 0; }
.intel-link-btn:hover {
    background: var(--navy-light);
    border-color: var(--blue);
}

/* ── Unified Shareholder Intelligence Modal ──────────────────────────────── */
.sh-intel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.sh-intel-card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    max-width: 820px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sh-intel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sh-intel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
    margin: 0 0 0.1rem;
}
.sh-intel-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.sh-intel-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1.25rem 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sh-intel-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.sh-intel-tab:hover  { color: var(--text); }
.sh-intel-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.sh-intel-tab svg    { flex-shrink: 0; }
.sh-intel-body {
    overflow-y: auto;
    padding: 1.25rem;
    flex: 1;
    min-height: 0;
}
.sh-intel-panel { }
.sh-intel-pro-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-dim);
}
.sh-intel-pro-cta p { margin: 0; font-size: 0.9rem; }

/* Network tab — canvas graph */
.sh-intel-net-canvas {
    display: block;
    border-radius: 6px;
    background: #0e1a2b;
    width: 100%;
    cursor: default;
}

/* Intel button in shareholders/screener action columns */
.sh-action-btn.intel-btn {
    background: var(--navy-light);
    color: var(--blue);
    border-color: var(--blue);
    opacity: 0.9;
}
.sh-action-btn.intel-btn:hover { opacity: 1; }

/* Responsive */
@media (max-width: 600px) {
    .sh-intel-card { max-height: 95vh; border-radius: 6px; }
    .sh-intel-tabs { padding: 0 0.75rem 0; overflow-x: auto; }
    .sh-intel-tab  { font-size: 0.75rem; padding: 0.4rem 0.6rem; }
    .sh-intel-body { padding: 0.9rem; }
    .ticker-intel-strip { padding: 0.4rem 0.5rem; gap: 0.3rem; }
}

/* ── Shareholders inner tabs ─────────────────────────────────────────────── */
.sh-inner-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.sh-inner-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.sh-inner-tab:hover { color: var(--text); }
.sh-inner-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── Classification panel ────────────────────────────────────────────────── */
.sh-class-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.sh-class-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}
.sh-class-chart-wrap {
    height: 260px;
    position: relative;
}
.sh-class-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.sh-class-date, .sh-class-total {
    color: var(--text-dim);
    font-size: 0.78rem;
}
.sh-class-breakdown-table {
    width: 100%;
    min-width: 0; /* override .shareholders-table min-width on mobile */
}
.sh-class-breakdown-table th,
.sh-class-breakdown-table td {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}
.sh-class-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
    flex-shrink: 0;
}
@media (max-width: 680px) {
    .sh-class-layout {
        grid-template-columns: 1fr;
    }
    .sh-class-chart-wrap {
        height: 220px;
    }
    .sh-class-breakdown-table th,
    .sh-class-breakdown-table td {
        font-size: 0.75rem;
        padding: 0.25rem 0.35rem;
    }
}
@media (max-width: 420px) {
    .sh-class-chart-wrap { height: 190px; }
    .sh-class-meta { font-size: 0.78rem; }
}

/* ── Volume Profile ──────────────────────────────────────────────────────── */
.volume-profile-panel { padding: 0; }

.vp-range-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.vp-pill {
    background: var(--navy-input, #1e293b);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.vp-pill:hover { border-color: var(--blue); color: var(--blue); }
.vp-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.vp-key-levels {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.vp-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}
.vp-level-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
}
.vp-level-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.vp-poc-level .vp-level-label,
.vp-poc-level .vp-level-value { color: var(--gold, #f59e0b); }
.vp-vah-level .vp-level-label { color: var(--blue); }
.vp-val-level .vp-level-label { color: #f97316; }

.vp-position-note {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}
.vp-no-data {
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 1rem 0;
    text-align: center;
}

/* Bars */
.vp-chart { margin: 0.25rem 0; }
.vp-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1px;
}
.vp-price {
    width: 68px;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-align: right;
    flex-shrink: 0;
}
.vp-bar-wrap {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
    height: 10px;
    position: relative;
    overflow: hidden;
}
.vp-bar {
    height: 100%;
    background: rgba(148,163,184,0.5);
    border-radius: 2px;
    transition: width 0.3s;
}
.vp-bar.vp-poc { background: var(--gold, #f59e0b); }
.vp-bar.vp-va  { background: rgba(96,165,250,0.65); }
.vp-bar.vp-hvn { background: #22c55e; }
.vp-bar.vp-lvn { background: rgba(100,116,139,0.4); }
.vp-pct {
    width: 36px;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-align: right;
    flex-shrink: 0;
}
.vp-node-label {
    width: 28px;
    font-size: 0.58rem;
    font-weight: 700;
    flex-shrink: 0;
    text-align: left;
}
.vp-node-label.hvn { color: #22c55e; }
.vp-node-label.lvn { color: #64748b; }

/* Delta rows */
.vp-delta-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 3px;
}
.vp-delta-price {
    width: 68px;
    flex-shrink: 0;
}
.vp-delta-wrap {
    flex: 1;
    display: flex;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}
.vp-delta-buy  { background: #22c55e; height: 100%; }
.vp-delta-sell { background: #ef4444; height: 100%; }
.vp-delta-spacer { width: 64px; flex-shrink: 0; }

.vp-footnote {
    font-size: 0.67rem;
    color: var(--text-dim);
    margin: 0.6rem 0 0;
    line-height: 1.55;
    opacity: 0.75;
}

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

/* ── VP custom date range picker ─────────────────────────────────────────── */
.vp-custom-picker {
    margin-bottom: 0.85rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.vp-custom-picker.visible { display: block; }
.vp-custom-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.vp-custom-label {
    font-size: 0.75rem;
    color: var(--text-dim, #64748b);
    white-space: nowrap;
}
.vp-date-input {
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
    flex: 1;
    min-width: 120px;
    max-width: 160px;
}
.vp-date-input:focus { outline: none; border-color: var(--blue); }
/* Ensure calendar icon is visible in both themes */
.vp-date-input::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; }
.vp-recalc-btn {
    background: var(--blue);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.vp-recalc-btn:hover { opacity: 0.85; }
.vp-recalc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Date range subtitle shown inside the BARS card */
.vp-date-range {
    display: block;
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
@media (max-width: 480px) {
    .vp-date-input { max-width: 100%; }
    .vp-custom-row { gap: 0.4rem; }
}

/* ── Anchored VWAP ──────────────────────────────────────────────────────── */
.avwap-panel { margin-top: 1rem; }

.avwap-pills {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.avwap-pill {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.avwap-pill.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.avwap-pill:hover:not(.active) {
    border-color: var(--blue);
}

.avwap-view { display: none; }

/* ── AVWAP 12-row table ── */
.avwap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}
.avwap-tl {
    padding: 0.28rem 0.5rem 0.28rem 0;
    color: var(--text-dim);
    width: 45%;
    vertical-align: middle;
}
.avwap-tv {
    padding: 0.28rem 0 0.28rem 0.5rem;
    color: var(--text);
    font-weight: 500;
    text-align: right;
    vertical-align: middle;
}
.avwap-tr-sep td {
    padding: 0;
    height: 1px;
    background: var(--border);
}
.avwap-tr-vwap { background: var(--navy-light); }
.avwap-tl-vwap { color: var(--gold); font-weight: 700; border-radius: 4px 0 0 4px; }
.avwap-tv-vwap { color: var(--gold); font-weight: 700; font-size: 0.92rem; border-radius: 0 4px 4px 0; }
.avwap-tr-current { background: var(--navy); }

.avwap-signal-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Config rows (Bars Back / Fixed Date inputs) ── */
.avwap-config-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.75rem 0 0.5rem;
    flex-wrap: wrap;
}
.avwap-config-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}
.avwap-number-input, .avwap-date-input {
    padding: 0.35rem 0.6rem;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.82rem;
    flex: 1 1 100px;
    min-width: 80px;
}
.avwap-number-input:focus, .avwap-date-input:focus {
    outline: none;
    border-color: var(--blue);
}
.avwap-recalc-btn {
    padding: 0.35rem 1rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}
.avwap-recalc-btn:hover:not(:disabled) { background: #2563eb; }
.avwap-recalc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.avwap-no-data {
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 1rem 0;
    text-align: center;
}

@media (max-width: 600px) {
    .avwap-pill { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
    .avwap-config-row { flex-direction: column; align-items: stretch; }
    .avwap-recalc-btn { width: 100%; }
}

/* ── Top Picks (Sprint 22) ────────────────────────────────────────── */

.top-picks-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.top-pick-card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.pick-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pick-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--navy);
}

.pick-ticker {
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--gold);
    text-decoration: none;
}

.pick-ticker:hover {
    text-decoration: underline;
}

.pick-name {
    color: var(--text);
    font-size: var(--text-base);
}

.pick-sector {
    color: var(--text-dim);
    font-size: var(--text-sm);
    margin-left: auto;
}

.pick-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.score-bar {
    flex: 1;
    height: 1.5rem;
    background: var(--navy-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green) 0%, var(--gold) 100%);
    transition: width 0.3s ease;
}

.score-value {
    font-weight: 700;
    color: var(--text);
    min-width: 4rem;
    text-align: right;
}

.pick-factors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.factor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 1rem;
    font-size: var(--text-sm);
}

.factor-label {
    color: var(--text-dim);
}

.factor-value {
    font-weight: 700;
    color: var(--gold);
}

.pick-levels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--navy-light);
    border-radius: var(--radius);
}

.level-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-label {
    color: var(--text-dim);
    font-size: var(--text-sm);
}

.level-value {
    font-weight: 700;
    color: var(--text);
}

.level-row.rr-highlight {
    grid-column: 1 / -1;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}

.level-row.rr-highlight .level-value {
    color: var(--green);
}

.pick-reasoning {
    color: var(--text-dim);
    font-size: var(--text-sm);
    line-height: 1.6;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.top-picks-disclaimer {
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.6;
}

/* Light mode overrides */
body.light .avwap-tr-vwap { background: #f0f4ff; }
body.light .avwap-tr-current { background: #f8fafc; }
body.light .avwap-number-input, body.light .avwap-date-input { background: #ffffff; }

body.light .top-pick-card {
    background: #fff;
    border-color: #e5e7eb;
}

body.light .pick-rank {
    color: #1a1a1a;
}

body.light .score-bar,
body.light .factor-chip,
body.light .pick-levels {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

body.light .pick-reasoning {
    border-top-color: #e5e7eb;
}

/* Conviction tier badges */
.conviction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.conviction-badge.high {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--gold);
}
.conviction-badge.medium {
    background: var(--navy-light);
    color: var(--blue);
    border: 1px solid var(--blue);
}
.conviction-badge.low {
    background: var(--navy-light);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
body.light .conviction-badge.high {
    background: var(--gold-dim);
    color: var(--gold);
}
body.light .conviction-badge.medium {
    background: #eff6ff;
    color: var(--blue);
    border-color: var(--blue);
}
body.light .conviction-badge.low {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

/* Market regime badge */
.regime-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-left: 8px;
    vertical-align: middle;
}
.regime-badge.regime-on {
    background: var(--navy-light);
    color: var(--green);
    border: 1px solid var(--green);
}
.regime-badge.regime-neutral {
    background: var(--navy-light);
    color: var(--gold);
    border: 1px solid var(--gold);
}
.regime-badge.regime-off {
    background: var(--navy-light);
    color: var(--red);
    border: 1px solid var(--red);
}
body.light .regime-badge.regime-on {
    background: #f0fdf4;
    border-color: var(--green);
}
body.light .regime-badge.regime-neutral {
    background: #fffbeb;
    border-color: var(--gold);
}
body.light .regime-badge.regime-off {
    background: #fef2f2;
    border-color: var(--red);
}

/* ── Sprint 30B: Setup type badges ────────────────────────────────────────── */
.pick-setup {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.setup-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.setup-spring { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.setup-sos { background: rgba(59, 130, 246, 0.2); color: var(--blue); }
.setup-markup { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.setup-absorption { background: rgba(245, 158, 11, 0.2); color: var(--gold); }
.setup-oversold { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.setup-breakout { background: rgba(6, 182, 212, 0.2); color: #06b6d4; }
.setup-fib { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.setup-momentum { background: rgba(156, 163, 175, 0.2); color: var(--text-dim); }

body.light .setup-spring { background: #dcfce7; color: #15803d; }
body.light .setup-sos { background: #dbeafe; color: #1d4ed8; }
body.light .setup-markup { background: #f3e8ff; color: #7e22ce; }
body.light .setup-absorption { background: #fef3c7; color: #b45309; }
body.light .setup-oversold { background: #fee2e2; color: #dc2626; }
body.light .setup-breakout { background: #cffafe; color: #0891b2; }
body.light .setup-fib { background: #fce7f3; color: #be185d; }
body.light .setup-momentum { background: #f3f4f6; color: #6b7280; }

.hold-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: var(--navy-light);
    color: var(--text-dim);
}

body.light .hold-chip {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Sprint 30B: 30-Day Performance Recap Banner ──────────────────────────── */
#topPicksRecap {
    display: none; /* Hidden until loaded */
    margin: 1rem 0 1rem 0;
}

.top-picks-recap {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.recap-header {
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.75rem;
    font-size: var(--text-sm);
}

.recap-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .recap-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.recap-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.recap-stat .stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
}

.recap-stat .stat-label {
    font-size: var(--text-xs);
    color: var(--text-dim);
    margin-top: 2px;
}

body.light .top-picks-recap {
    background: #fff;
    border-color: #e5e7eb;
}

body.light .recap-stat .stat-value {
    color: #1f2937;
}

/* ── Top Picks teaser (free-tier) ───────────────────────────────────────── */
.top-picks-teaser { display: flex; flex-direction: column; gap: 12px; }

.pick-card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.pick-score-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.pick-score-bar {
    flex: 1;
    height: 10px;
    background: linear-gradient(90deg, var(--green) 0%, var(--gold) 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.pick-score-label {
    font-weight: 700;
    color: var(--text);
    min-width: 2.5rem;
    text-align: right;
}

.pick-locked {
    position: relative;
    min-height: 80px;
    overflow: hidden;
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    opacity: 0.5;
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pick-preview-note {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.picks-empty-state {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-dim);
}

.picks-upgrade-cta {
    text-align: center;
    padding: 12px 0 4px;
}

.picks-unlock-btn {
    width: 100%;
    max-width: 420px;
    font-weight: 600;
}

/* ── Sortable table headers ──────────────────────────────────────────────── */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable-th:hover { color: var(--blue); }
.sortable-th.th-sorted { color: var(--blue); }
.th-sort-icon { font-size: 0.7rem; }

/* ── Insight narrative ───────────────────────────────────────────────────── */
.insight-narrative {
    margin: 0.4rem 0 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(96, 165, 250, 0.07);
    border-left: 3px solid var(--blue);
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ── Foreign Flow sparklines ─────────────────────────────────────────────── */
.ff-spark-th  { width: 70px; white-space: nowrap; }
.ff-spark-cell { width: 70px; padding: 0.25rem 0.5rem; }
.ff-sparkline  { display: block; margin: 0 auto; overflow: visible; }
.ff-spark-loading { color: var(--text-dim); font-size: 0.7rem; }

/* ── Wyckoff chart overlay (Sprint 10) ───────────────────────────────────── */
/* ── Wyckoff toggle panels (Weekly + Price Chart) ────────────────────────── */
.wk-weekly-toggle,
.wk-chart-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.3rem 0;
    border-top: 1px solid var(--border);
    cursor: pointer;
}
.wk-weekly-toggle:hover .form-label,
.wk-chart-toggle:hover .form-label { color: var(--blue); }

.wk-weekly-card {
    display: none;
    margin-top: 0.5rem;
}
.wk-weekly-card.open { display: block; }

.wk-chart-body {
    display: none;
    margin-top: 0.5rem;
}
.wk-chart-body.open { display: block; }

.wk-chart-container {
    width: 100%;
    height: 230px;
    border-radius: 6px;
    overflow: hidden;
    background: #0f172a;
}

/* ── Wyckoff fullscreen chart overlay ────────────────────────────────────── */
.wk-chart-fs-btn {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 0.1rem 0.35rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}
.wk-chart-fs-btn:hover { color: var(--blue); border-color: var(--blue); }

/* ── Wyckoff Daily/Weekly toggle buttons ─────────────────────────────────── */
.wk-chart-tf-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 0.4rem;
}
.wk-tf-btn {
    background: var(--navy);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}
.wk-tf-btn:first-child { border-radius: 4px 0 0 4px; }
.wk-tf-btn:last-child  { border-radius: 0 4px 4px 0; border-left: none; }
.wk-tf-btn:hover:not(:disabled) { background: var(--navy-light); color: var(--text); }
.wk-tf-btn.wk-tf-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.wk-tf-btn .wk-trend-hint {
    margin-left: 0.25rem;
    font-size: 0.65rem;
    opacity: 0.7;
}
body.light .wk-tf-btn { background: #f1f5f9; }
body.light .wk-tf-btn:hover:not(:disabled) { background: #e2e8f0; }
body.light .wk-tf-btn.wk-tf-active { background: var(--blue); border-color: var(--blue); color: #fff; }

.wk-fs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.wk-fs-modal {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: min(960px, 100%);
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wk-fs-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.wk-fs-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}
.wk-fs-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.15s;
}
.wk-fs-close:hover { color: var(--red); }
.wk-fs-container {
    flex: 1;
    width: 100%;
    background: var(--navy);
}

/* ── Toggle arrow animation (Wyckoff Weekly / Price Chart / Score Breakdown) */
.wk-weekly-toggle .section-toggle,
.wk-chart-toggle   .section-toggle,
.wk-factors-toggle .section-toggle {
    display: inline-block;
    transition: transform 0.2s ease;
}
.wk-weekly-toggle.open .section-toggle,
.wk-chart-toggle.open   .section-toggle,
.wk-factors-toggle.open .section-toggle {
    transform: rotate(-180deg);
}

/* ── Wyckoff Phase Timeline ─────────────────────────────────────────────── */
.wk-phase-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.4rem 0;
}
.wk-ptl-item {
    display: grid;
    grid-template-columns: 6rem 4.5rem 1fr 2.5rem;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
}
.wk-ptl-item.wk-ptl-latest {
    background: color-mix(in srgb, var(--gold) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
}
.wk-ptl-date  { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.wk-ptl-phase { font-weight: 700; font-size: 0.7rem; }
.wk-ptl-sub   { color: var(--text-dim); font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ptl-conf  { text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.wk-ptl-latest .wk-ptl-conf { color: var(--text); font-weight: 600; }

/* ── Daily Brief ─────────────────────────────────────────────────────────── */
.brief-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-top: 0.25rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border);
}

/* ── Daily Brief section cards (MI1) ─────────────────── */
.brief-section-card {
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
.brief-section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 8px;
    cursor: pointer;
    user-select: none;
}
.brief-section-card-header .brief-section-title {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 0.78rem;
}
.brief-section-card-body {
    padding: 0 14px 12px;
}
.brief-section-card-body.collapsed {
    display: none;
}
.brief-card-toggle {
    color: var(--text-dim);
    font-size: 0.75rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.brief-section-card-header.open .brief-card-toggle {
    transform: rotate(180deg);
}

.brief-phase-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.82rem;
}
.brief-phase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.brief-phase-count {
    margin-left: auto;
    font-weight: 700;
    color: var(--text);
}
.brief-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
/* Compact table used inside Daily Brief cards — overrides 600px min-width */
.brief-table {
    min-width: 0;
    width: 100%;
}
.brief-table td,
.brief-table th {
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
}
.brief-table .brief-col-sector {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .brief-grid-2 { grid-template-columns: 1fr; }
    /* Drop sector column on narrow screens */
    .brief-table .brief-col-sector { display: none; }
}

/* ── Guide language toggle bar ──────────────────────────────────────────── */
.guide-lang-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    background: var(--navy-light, #0d1f38);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.guide-lang-label {
    font-size: 0.75rem;
    color: var(--text-dim, #64748b);
    margin-right: 0.25rem;
}
.guide-lang-btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    color: var(--text-dim, #64748b);
    text-decoration: none;
    transition: all 0.15s;
}
.guide-lang-btn:hover {
    color: var(--text, #e2e8f0);
    border-color: var(--blue, #3b82f6);
}
.guide-lang-btn.guide-lang-active {
    background: var(--blue, #3b82f6);
    border-color: var(--blue, #3b82f6);
    color: #fff;
    font-weight: 600;
}

/* ── Tooltip affordance ─────────────────────────────────── */
.tooltip-hint {
    cursor: help;
    border-bottom: 1px dashed var(--text-dim);
    text-decoration: none;
}
.tooltip-hint:hover {
    border-bottom-color: var(--gold);
    color: var(--text);
}
.wk-details-row .tooltip-hint strong {
    border-bottom: none;
    text-decoration: none;
}
.amd-signal-tag[title],
.fib-confluence-badge[title] {
    cursor: help;
}
.wk-progress-seg[title] {
    cursor: help;
}

/* ── Mobile floating tooltip (tap-to-show for [title] elements) ─────── */
.vl-floating-tip {
    position: fixed;
    z-index: 9999;
    background: var(--navy-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.72rem;
    line-height: 1.55;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    max-width: min(300px, calc(100vw - 24px));
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    display: none;
}
.vl-floating-tip.vl-tip-visible {
    display: block;
    opacity: 1;
}

.cl-page-header {
    max-width: 760px;
    margin: 0 auto 2.5rem;
    text-align: center;
}
.cl-page-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    color: var(--gold);
    margin: 0 0 0.4rem;
}
.cl-page-header p {
    color: var(--text-dim);
    font-size: var(--text-md);
    margin: 0;
}

.cl-timeline {
    max-width: 760px;
    margin: 0 auto;
}

.cl-month-group {
    margin-bottom: 2rem;
}
.cl-month-label {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.cl-entry {
    background: var(--navy-card);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    border-left: 3px solid var(--gold);
}
.cl-entry.cl-entry-improvement {
    border-left-color: var(--blue);
}
.cl-entry.cl-entry-fix {
    border-left-color: var(--green);
}

.cl-entry-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.cl-tag {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
}
.cl-tag-new {
    background: rgba(22, 163, 74, 0.15);
    color: var(--green);
}
.cl-tag-improvement {
    background: rgba(234, 170, 12, 0.15);
    color: var(--gold);
}
.cl-tag-fix {
    background: rgba(33, 150, 243, 0.15);
    color: var(--blue);
}

.cl-title {
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-lg);
    color: var(--gold);
    font-weight: 500;
}

.cl-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-top: 0.3rem;
}

.badge-pro {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.12rem 0.45rem;
    border-radius: 20px;
    background: var(--gold-dim);
    color: var(--gold);
}
.badge-free {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.12rem 0.45rem;
    border-radius: 20px;
    background: rgba(0, 200, 83, 0.12);
    color: var(--green);
}

.cl-coming-next {
    max-width: 760px;
    margin: 2.5rem auto 0;
    background: var(--navy-light);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}
.cl-coming-next h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cl-coming-next ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.cl-coming-next li {
    color: var(--text-dim);
    font-size: var(--text-md);
}

/* ── Changelog tier badges ───────────────────────────────── */
.cl-tier-badge { display:inline-block; font-size:0.62rem; font-weight:700; padding:0.1rem 0.4rem; border-radius:3px; vertical-align:middle; margin-left:0.35rem; text-transform:uppercase; letter-spacing:0.03em; }
.cl-tier-pro   { background:var(--gold); color:var(--navy); }
.cl-tier-free  { background:var(--border); color:var(--text); }

/* ── Language toggle ─────────────────────────────────────── */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-right: 0.5rem;
}
.lang-btn {
    background: none;
    border: none;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.lang-btn.active {
    color: var(--text);
    background: var(--navy-light);
}
.lang-btn:hover:not(.active) { color: var(--text); }

/* ── Market Highlights (Sprint 21) ─────────────────────────────────────────── */

.mh-sub-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
    margin-top: 1.25rem;
}

.mh-pill {
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.mh-pill:hover {
    color: var(--text);
    border-color: var(--blue);
}

.mh-pill.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.mh-pill.locked {
    opacity: 0.55;
    cursor: pointer;
}
.mh-pill.locked:hover {
    color: var(--text-dim);
    border-color: var(--border);
    background: var(--navy-light);
}
.mh-pill.locked:active {
    background: var(--navy-light);
    border-color: var(--border);
    color: var(--text-dim);
}
.mh-pill.locked::after {
    content: '\1F512';
    font-size: 0.7em;
    margin-left: 0.3em;
    vertical-align: middle;
    opacity: 0.8;
}

/* ── MH Pro gate panel */
.mh-pro-gate {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 3rem 1rem;
    text-align: center;
}
.mh-pro-gate-icon {
    font-size: 1.75rem;
    line-height: 1;
}
.mh-pro-gate-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin: 0;
}

/* Smart Money event badges */
.mh-badge {
    display: inline-block;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mh-badge.spring { background: rgba(16,185,129,0.18); color: #10b981; }
.mh-badge.sos    { background: rgba(59,130,246,0.18);  color: #3b82f6; }
.mh-badge.sc     { background: rgba(245,158,11,0.18);  color: #f59e0b; }
.mh-badge.abs    { background: rgba(167,139,250,0.18); color: #a78bfa; }

/* Sector badge inside MH table */
.mh-sector-badge {
    display: inline-block;
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Breakout proximity label */
.mh-proximity {
    color: var(--gold);
    font-weight: 600;
}

/* Section header with inline date label */
.insight-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.insight-header h3 {
    margin: 0;
}

/* Date label next to section title */
.insight-date-label {
    color: var(--text-dim);
    font-size: 0.78rem;
    margin-left: 0.75rem;
}

/* Ticker hyperlink in MH tables */
.ticker-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}
.ticker-link:hover { text-decoration: underline; }
.lang-sep { font-size: 0.65rem; color: var(--border); }

/* ── Top Picks: Past Performance section ────────────────────────────────── */

.tp-perf-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.tp-perf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tp-perf-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.tp-perf-toggle {
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.tp-perf-toggle:hover { color: var(--text); border-color: var(--blue); }

/* ── Stats grid ─── */
.tp-perf-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
@media (max-width: 700px) {
    .tp-perf-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

.tp-perf-stat-card {
    background: var(--navy-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}
.tp-perf-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}
.tp-perf-stat-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tp-perf-stat-sub {
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
    opacity: 0.75;
}

/* ── Highlights row (streak / best / worst) ─── */
.tp-hl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tp-hl-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.tp-hl-win  { background: rgba(52,211,153,0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.25); }
.tp-hl-loss { background: rgba(239,68,68,0.12);  color: var(--red);   border: 1px solid rgba(239,68,68,0.25); }

/* ── Monthly breakdown ─── */
.tp-monthly-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.tp-monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}
.tp-monthly-table th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    text-transform: uppercase;
}
.tp-monthly-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
}

/* ── History table section ─── */
.tp-hist-section  { margin-top: 1.25rem; }
.tp-hist-header   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.tp-hist-title    { font-size: 0.82rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; }
.tp-hist-filters  { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tp-hist-filter   { background: var(--navy-light); border: 1px solid var(--border); border-radius: 6px; color: var(--text-dim); font-size: 0.72rem; padding: 0.2rem 0.6rem; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.tp-hist-filter:hover  { color: var(--text); }
.tp-hist-filter.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Scroll wrapper — tablets get horizontal scroll */
.tp-hist-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.tp-hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 540px; /* prevent columns collapsing before card breakpoint */
}
.tp-hist-table th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.tp-hist-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.tp-hist-table tr:hover td { background: rgba(255,255,255,0.02); }

.tp-hist-date     { color: var(--text-dim); white-space: nowrap; }
.tp-hist-ticker   { color: var(--blue); font-weight: 700; text-decoration: none; }
.tp-hist-ticker:hover { text-decoration: underline; }
.tp-hist-sector   { font-size: 0.68rem; color: var(--text-dim); }
.tp-hist-price    { font-family: 'Roboto Mono', monospace; font-size: 0.76rem; white-space: nowrap; }
.tp-hist-sl       { color: var(--red); }
.tp-hist-t1       { color: var(--green); }
.tp-hist-days     { color: var(--text-dim); font-size: 0.76rem; }
.tp-hist-pnl      { font-weight: 600; white-space: nowrap; }
.tp-hist-inv-reason { font-size: 0.68rem; color: var(--gold); margin-top: 0.15rem; line-height: 1.3; }

/* Status badges */
.tp-hist-status   { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.tp-status-win    { background: rgba(52,211,153,0.12); color: var(--green); }
.tp-status-loss   { background: rgba(239,68,68,0.12);  color: var(--red); }
.tp-status-open   { background: rgba(96,165,250,0.12); color: var(--blue); }
.tp-status-expired{ background: rgba(148,163,184,0.12);color: var(--text-dim); }
.tp-status-invalid{ background: rgba(251,191,36,0.12); color: var(--gold); }

/* Pagination */
.tp-hist-pagination { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.75rem; justify-content: center; }
.tp-pag-btn { background: var(--navy-light); border: 1px solid var(--border); border-radius: 5px; color: var(--text-dim); font-size: 0.78rem; padding: 0.25rem 0.6rem; cursor: pointer; transition: 0.15s; }
.tp-pag-btn:hover  { color: var(--text); }
.tp-pag-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Mobile card layout (≤ 580px) ── */
@media (max-width: 580px) {
    /* Remove scroll wrapper constraint — cards fill full width */
    .tp-hist-table-wrap { overflow-x: visible; border-radius: 0; }
    .tp-hist-table      { min-width: unset; }

    /* Hide thead — labels come from data-label */
    .tp-hist-table thead { display: none; }

    /* Make each row a card */
    .tp-hist-table,
    .tp-hist-table tbody { display: block; width: 100%; }

    .tp-hist-table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 0.65rem;
        background: var(--navy-light);
        overflow: hidden;
    }
    .tp-hist-table tr:hover td { background: transparent; }

    /* Each cell → label + value row */
    .tp-hist-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        vertical-align: middle;
    }
    .tp-hist-table td:last-child { border-bottom: none; }

    /* Column label from data-label attribute */
    .tp-hist-table td[data-label]::before {
        content: attr(data-label);
        font-size: 0.68rem;
        color: var(--text-dim);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
        margin-right: 0.75rem;
    }

    /* Ticker cell — stack link + sector vertically, push to right */
    .tp-hist-table td[data-label="Ticker"] { align-items: flex-start; }
    .tp-hist-table td[data-label="Ticker"] > * { text-align: right; }

    /* Status cell — allow invalidation reason to stack below badge */
    .tp-hist-table td[data-label="Status"] { align-items: flex-start; flex-wrap: wrap; }
    .tp-hist-inv-reason { width: 100%; margin-top: 0.2rem; text-align: right; }

    /* Tighten font on mobile */
    .tp-hist-table td { font-size: 0.8rem; }
    .tp-hist-price    { font-size: 0.78rem; }
}

/* Light mode overrides */
body.light .tp-perf-stat-card { background: #f0f4f8; border-color: #d0d7e0; }
body.light .tp-hist-table tr:hover td { background: rgba(0,0,0,0.02); }
body.light .tp-hist-filter  { background: #f0f4f8; border-color: #d0d7e0; }
body.light .tp-pag-btn      { background: #f0f4f8; border-color: #d0d7e0; }
body.light .tp-perf-toggle  { background: #f0f4f8; border-color: #d0d7e0; }
@media (max-width: 580px) {
    body.light .tp-hist-table tr { background: #f0f4f8; border-color: #d0d7e0; }
    body.light .tp-hist-table td { border-bottom-color: rgba(0,0,0,0.06); }
}

/* -- Sprint 31 � SMC Overlay chips (FVG / OB / Trend) ---------------------- */
.smc-overlay-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.4rem 0 0.2rem;
}
.smc-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
}
/* FVG chips */
.smc-chip.smc-fvg.smc-bullish { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.35); color: #10b981; }
.smc-chip.smc-fvg.smc-bearish { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.35);  color: #ef4444; }
/* OB chips */
.smc-chip.smc-ob.smc-bullish  { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.35); color: #3b82f6; }
.smc-chip.smc-ob.smc-bearish  { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.35); color: #f59e0b; }
/* Trend chips */
.smc-chip.smc-trend.smc-up    { background: rgba(16,185,129,0.1);  border-color: rgba(16,185,129,0.3);  color: #10b981; }
.smc-chip.smc-trend.smc-down  { background: rgba(239,68,68,0.1);   border-color: rgba(239,68,68,0.3);   color: #ef4444; }

/* Light-mode overrides */
body.light .smc-chip.smc-fvg.smc-bullish { background: rgba(16,185,129,0.08); }
body.light .smc-chip.smc-fvg.smc-bearish { background: rgba(239,68,68,0.08);  }
body.light .smc-chip.smc-ob.smc-bullish  { background: rgba(59,130,246,0.08); }
body.light .smc-chip.smc-ob.smc-bearish  { background: rgba(245,158,11,0.08); }
body.light .smc-chip.smc-trend.smc-up    { background: rgba(16,185,129,0.08); }
body.light .smc-chip.smc-trend.smc-down  { background: rgba(239,68,68,0.08);  }

/* -- Sprint 31.1 - AMD Chart with SMC overlays ------------------------------ */
.amd-chart-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.3rem 0;
    border-top: 1px solid var(--border);
    cursor: pointer;
}
.amd-chart-toggle:hover .form-label { color: var(--blue); }
.amd-chart-toggle .section-toggle { display: inline-block; transition: transform 0.2s ease; }
.amd-chart-toggle.open .section-toggle { transform: rotate(-180deg); }

.amd-chart-body {
    display: none;
    margin-top: 0.5rem;
}
.amd-chart-body.open { display: block; }

.amd-chart-container {
    width: 100%;
    height: 260px;
    border-radius: 6px;
    overflow: hidden;
    background: #0f172a;
}

body.light .amd-chart-container { background: #f8fafc; }

/* ── SMC Structure brief (in AMD card) ──────────────────────────────────── */
.smc-brief-section {
    margin: 0.5rem 0;
    padding: 0.35rem 0.6rem;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.smc-brief-header {
    font-size: 0.65rem;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    padding-bottom: 0.25rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--border);
}
.smc-brief-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.18rem 0;
    font-size: 0.73rem;
}
.smc-brief-row + .smc-brief-row { border-top: 1px solid var(--border); }
.smc-brief-label { color: var(--text-dim); flex-shrink: 0; margin-right: 0.5rem; }
.smc-brief-val   { font-weight: 600; color: var(--text); text-align: right; }
.smc-brief-label.smc-bull, .smc-brief-val.smc-bull { color: var(--green); }
.smc-brief-label.smc-bear, .smc-brief-val.smc-bear { color: var(--red); }
body.light .smc-brief-section { background: rgba(0,0,0,0.04); }

/* ── AMD Tabs (Sprint 31) ───────────────────────────────────────────── */
.amd-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 0.5rem 0 0;
    overflow-x: auto;
}
.amd-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.35rem 0.9rem;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    outline: none;
}
.amd-tab:hover { color: var(--text); }
.amd-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}
.amd-tab-active-setup { color: var(--green) !important; }
.amd-tab-warning { color: var(--gold) !important; }
.amd-tab-panel { display: none; padding-top: 0.5rem; }
.amd-tab-panel.active { display: block; }
body.light .amd-tab { color: rgba(0,0,0,0.45); }
body.light .amd-tab.active { color: var(--blue); }

/* ── SMC Signals Grid (Sprint 31) ───────────────────────────────────── */
.smc-signals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}
.smc-signal-group { display: flex; flex-direction: column; gap: 0.2rem; }
.smc-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.smc-zone-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

/* ── Zone Badge (Sprint 31) ─────────────────────────────────────────── */
.zone-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid transparent;
    text-transform: capitalize;
}
.zone-badge.premium {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}
.zone-badge.discount {
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.3);
    color: #10b981;
}
.zone-badge.equilibrium {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.25);
    color: #f59e0b;
}
body.light .zone-badge.premium    { background: rgba(239,68,68,0.08); }
body.light .zone-badge.discount   { background: rgba(16,185,129,0.08); }
body.light .zone-badge.equilibrium{ background: rgba(245,158,11,0.06); }

/* ── Trade Setup Card (Sprint 31) ───────────────────────────────────── */
.smc-setup-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--navy);
}
.smc-setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: var(--navy-light);
}
.smc-setup-type {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
}
.smc-setup-dir {
    font-size: 0.75rem;
    font-weight: 800;
}
.smc-setup-levels { padding: 0.35rem 0; }
.smc-level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.75rem;
    font-size: 0.73rem;
    border-top: 1px solid var(--border);
}
.smc-level-row:first-child { border-top: none; }
.smc-level-label { color: var(--text-dim); }
.smc-level-value { font-weight: 600; color: var(--text); }
.smc-level-row.smc-sl .smc-level-value { color: var(--red); }
.smc-level-row.smc-tp .smc-level-value { color: var(--green); }
.smc-level-row.smc-rr .smc-level-value { color: var(--blue); }
.smc-no-setup {
    padding: 1.25rem 0.75rem;
    font-size: 0.73rem;
    color: var(--text-dim);
    text-align: center;
    background: var(--navy);
    border: 1px dashed var(--border);
    border-radius: 6px;
}
body.light .smc-setup-card { background: rgba(0,0,0,0.02); }
body.light .smc-setup-header { background: rgba(0,0,0,0.04); }
body.light .smc-no-setup { background: rgba(0,0,0,0.02); }

/* ── SMC chip inline price labels ───────────────────────────────────── */
.smc-zone-chip, .smc-sweep { display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: nowrap; }
.smc-zone-range, .smc-sweep-price {
    font-size: 0.62rem;
    font-weight: 500;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Analysis Guide — SMC section ────────────────────────────────────── */
.smc-visual-block {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
}
.smc-signal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem;
    flex-wrap: wrap;
}
.smc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.smc-diagram svg {
    width: 100%;
    height: auto;
    border-radius: 6px;
}
.smc-desc ul {
    padding-left: 1.25rem;
    color: var(--text-dim);
    line-height: 1.8;
    margin: 0;
}
.smc-desc ul li { margin-bottom: 0.35rem; }
.smc-chip-label {
    margin-top: 1rem;
    font-size: var(--text-sm, 0.78rem);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* Guide SMC chip colour variants */
.smc-chip-guide {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}
.smc-chip-fvg   { background: rgba(6,182,212,0.15);  color: #06b6d4; border-color: rgba(6,182,212,0.35); }
.smc-chip-ob    { background: rgba(249,115,22,0.15);  color: #f97316; border-color: rgba(249,115,22,0.35); }
.smc-chip-bos   { background: rgba(34,197,94,0.15);   color: #22c55e; border-color: rgba(34,197,94,0.35); }
.smc-chip-choch { background: rgba(168,85,247,0.15);  color: #a855f7; border-color: rgba(168,85,247,0.35); }
.smc-chip-sh    { background: rgba(239,68,68,0.15);   color: #ef4444; border-color: rgba(239,68,68,0.35); }
.smc-chip-shk   { background: rgba(220,38,38,0.20);   color: #dc2626; border-color: rgba(220,38,38,0.40); }
.smc-chip-premium  { background: rgba(239,68,68,0.12);   color: #ef4444; border-color: rgba(239,68,68,0.30); }
.smc-chip-eq       { background: rgba(245,158,11,0.12);  color: #f59e0b; border-color: rgba(245,158,11,0.30); }
.smc-chip-discount { background: rgba(34,197,94,0.12);   color: #22c55e; border-color: rgba(34,197,94,0.30); }

/* Responsive: stack diagram + desc on small screens */
@media (max-width: 700px) {
    .smc-layout { grid-template-columns: 1fr; }
}

/* Light mode adjustments */
body.light .smc-visual-block { background: rgba(0,0,0,0.025); }

/* ── Signal sentiment summary (AN4) ───────────────────── */
.signal-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.signal-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.signal-count::before {
    content: '●';
    font-size: 0.6rem;
}
.signal-count.signal-bullish { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.signal-count.signal-bearish { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.signal-count.signal-neutral { background: rgba(212,160,23,0.12); color: var(--gold); border: 1px solid rgba(212,160,23,0.25); }

/* ── Changelog version badge & relative time (CH3) ───── */
.cl-version-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.cl-relative-time {
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
/* ── Changelog filter pills (CH1) ────────────────────── */
.cl-filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.cl-filter-pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}
.cl-filter-pill:hover { border-color: var(--gold); color: var(--text); }
.cl-filter-pill.active { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 600; }
/* ── Changelog entry image (CH2) ─────────────────────── */
.cl-entry-img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 8px 0 4px;
    display: block;
}

/* ── Analysis summary strip (AN1) ────────────────────── */
.analysis-summary-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    position: sticky;
    top: 56px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.summary-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.summary-badge:hover { opacity: 0.8; }

/* ── AN2: Wyckoff Phase Stepper ──────────────────────── */
.wk-stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 12px 0 4px;
    width: 100%;
}
.wk-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.wk-step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}
.wk-step-dot.active {
    width: 22px;
    height: 22px;
    margin-top: -3px;
    border-width: 2.5px;
}
.wk-step-dot.past {
    opacity: 0.55;
}
.wk-step-labels {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
    gap: 1px;
}
.wk-step-letter {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    line-height: 1;
}
.wk-step-sublabel {
    font-size: 0.56rem;
    color: var(--text-dim);
    opacity: 0.65;
    max-width: 44px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.wk-step-line {
    height: 2px;
    background: var(--border);
    margin-top: 7px;
    align-self: flex-start;
    min-width: 6px;
    flex: 1;
    transition: all 0.2s;
    border-top: 2px solid var(--border);
}
.wk-step-line.past {
    opacity: 0.5;
}

/* ── AN3: Price Ladder (hide on mobile) ──────────────── */
@media (max-width: 600px) {
    .pred-targets > svg,
    .pred-targets + svg { display: none; }
}

/* ── MI2: Top Picks Score Gauge ──────────────────────── */
.pick-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1;
}
.pick-gauge-score {
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: -4px;
    line-height: 1;
}
.pick-gauge-denom {
    font-size: 0.62rem;
    color: var(--text-dim);
    font-weight: 400;
}

/* ── SH1: Ownership Ring Chart ───────────────────────── */
.sh-ring-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-width: 140px;
}
.sh-ring-wrap canvas {
    max-width: 120px;
    max-height: 120px;
}

/* ── CL2: Movers View ────────────────────────────────── */
.cl-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.cl-view-btn {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.cl-view-btn:hover { border-color: var(--gold); color: var(--text); }
.cl-view-btn.active { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 600; }
.cl-movers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cl-mover-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--navy-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.cl-mover-info {
    flex: 1;
    min-width: 0;
}
.cl-mover-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cl-mover-meta {
    font-size: 0.68rem;
    color: var(--text-dim);
}
.cl-mover-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    min-width: 100px;
}
.cl-mover-pct {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}
.cl-mover-bar {
    width: 90px;
    height: 4px;
    background: var(--navy-light);
    border-radius: 2px;
    overflow: hidden;
}
.cl-mover-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* SH3 styles are defined inline in research.html (template-scoped) */
