/* ======================
   LIVEFEED PAGE STYLES
   ====================== */

/* --- Trade Feed Container --- */
#tradeFeed {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 2rem;
}

/* --- Trade Card (sentence layout) --- */
.trade-card {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: opacity 250ms ease-out, transform 250ms ease-out, background-color 200ms ease;
}

.trade-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Time */
.trade-card__time {
    flex: 0 0 auto;
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.22);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Sentence body */
.trade-card__sentence {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
}

/* Bond name — underlined, no bold */
.trade-card__bond-name {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.2);
    text-underline-offset: 2px;
}

/* Meta (tenure, rating) — dim connector text */
.trade-card__meta {
    color: rgba(255, 255, 255, 0.3);
}

/* Separator dash */
.trade-card__sep {
    color: rgba(255, 255, 255, 0.15);
}

/* Value — most prominent */
.trade-card__value {
    color: rgba(255, 255, 255, 0.95);
    font-variant-numeric: tabular-nums;
}

/* Yield — most prominent */
.trade-card__yield {
    color: rgba(255, 255, 255, 0.95);
    font-variant-numeric: tabular-nums;
}

/* --- Animation: Entering (SSE drip-feed) --- */
.trade-card--entering {
    opacity: 0;
    transform: translateY(-20px);
}

.trade-card--visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Animation: Highlight glow for new trades --- */
.trade-card--new {
    animation: trade-highlight 1.2s ease-out;
}

@keyframes trade-highlight {
    0% { background-color: rgba(255, 255, 255, 0.08); }
    100% { background-color: transparent; }
}

/* --- Animation: Initial load stagger --- */
.trade-card--initial {
    animation: fadeSlideIn 300ms ease-out both;
    animation-delay: calc(var(--stagger-index) * 40ms);
}

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

/* --- Connection Status Indicator --- */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: lowercase;
}

.connection-status__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: background-color 300ms ease;
}

.connection-status--connected .connection-status__dot {
    background-color: #69db7c;
    box-shadow: 0 0 4px rgba(105, 219, 124, 0.5);
}

.connection-status--connected .connection-status__text {
    color: rgba(105, 219, 124, 0.7);
}

.connection-status--reconnecting .connection-status__dot {
    background-color: #ffd666;
    animation: pulse-dot 1s ease-in-out infinite;
}

.connection-status--reconnecting .connection-status__text {
    color: rgba(255, 214, 102, 0.7);
}

.connection-status--disconnected .connection-status__dot {
    background-color: #ff6b6b;
}

.connection-status--disconnected .connection-status__text {
    color: rgba(255, 107, 107, 0.7);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- Status Bar (timer + disclaimer) --- */
.livefeed-status-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 0 0.6rem 0;
    gap: 16px;
}

.market-timer {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.3);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.bonds-footnote-inline {
    font-size: 0.6rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.2);
    text-align: right;
    line-height: 1.4;
}

/* --- Filter Chips --- */
.livefeed-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group__label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
}

.filter-group__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-chip {
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 500;
    font-family: 'Manrope', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.7);
}

.filter-chip--active {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

.filter-group--hidden {
    display: none;
}

/* --- New Trades Badge (scroll-aware) --- */
.new-trades-badge {
    position: sticky;
    top: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 14px;
    margin: 0 auto 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: opacity 200ms ease;
    width: fit-content;
}

.new-trades-badge--visible {
    display: flex;
}

.new-trades-badge:hover {
    background: rgba(50, 50, 50, 0.95);
}

/* --- Loading / Empty / Error States --- */
.livefeed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    gap: 12px;
}

.livefeed-loading__spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.livefeed-loading__text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.livefeed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    gap: 8px;
}

.livefeed-empty__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
}

.livefeed-empty__subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.2);
}

.livefeed-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    gap: 12px;
}

.livefeed-error__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 107, 107, 0.8);
}

.livefeed-error__message {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
}

.livefeed-error__retry {
    margin-top: 8px;
    padding: 6px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms ease;
}

.livefeed-error__retry:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* --- Infinite Scroll Spinner --- */
.load-more-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.load-more-spinner__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: load-dot 1s ease-in-out infinite;
    margin: 0 3px;
}

.load-more-spinner__dot:nth-child(2) { animation-delay: 0.2s; }
.load-more-spinner__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes load-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
    40% { opacity: 1; transform: scale(1.3); }
}

/* --- Feed + Side Tables Layout --- */
.livefeed-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.livefeed-layout__feed {
    flex: 1;
    min-width: 0;
}

.livefeed-layout__side {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
}

/* --- Side Tables --- */
.side-table {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
}

.side-table__title {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.25);
    padding: 10px 12px 6px;
    margin: 0;
}

.side-table__body {
    padding: 0 0 4px;
}

.side-table__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    cursor: pointer;
    transition: background-color 150ms ease;
    gap: 8px;
}

.side-table__row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.side-table__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.side-table__name {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.15);
    text-underline-offset: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-table__detail {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.2);
}

.side-table__numbers {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.side-table__value {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.side-table__yield {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.35);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.side-table__highlight {
    color: rgba(255, 255, 255, 0.95);
}

.side-table__empty {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.15);
    padding: 12px;
    text-align: center;
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .trade-card {
        transition: none;
    }
    .trade-card--initial {
        animation: none;
    }
    .trade-card--new {
        animation: none;
    }
    .trade-card--entering {
        opacity: 1;
        transform: none;
    }
    .livefeed-loading__spinner {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.4);
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .trade-card {
        padding: 0.65rem 0.75rem;
        gap: 8px;
    }

    .trade-card__time {
        font-size: 0.62rem;
    }

    .trade-card__sentence {
        font-size: 0.72rem;
    }

    .livefeed-layout__side {
        display: none;
    }

    /* Mobile filter bar */
    .mobile-filter-bar {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 8px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mobile-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .mobile-filter-bar .filter-chip {
        flex-shrink: 0;
    }
}

@media (min-width: 769px) {
    .mobile-filter-bar {
        display: none;
    }
    .livefeed-ctas {
        display: none !important;
    }
    .livefeed-sheet {
        display: none !important;
    }
}

/* --- Mobile Bottom Sheet Panels for Livefeed --- */
@media (max-width: 768px) {
    .livefeed-ctas {
        position: fixed;
        bottom: 56px;
        left: 12px;
        right: 12px;
        display: flex;
        justify-content: center;
        gap: 8px;
        z-index: 10000;
        pointer-events: none;
    }

    .livefeed-cta-btn {
        pointer-events: auto;
        padding: 7px 16px;
        font-size: 0.72rem;
        font-weight: 600;
        font-family: 'Manrope', sans-serif;
        color: rgba(255, 255, 255, 0.8);
        background: rgba(30, 30, 30, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 20px;
        cursor: pointer;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transition: all 150ms ease;
    }

    .livefeed-cta-btn:active {
        background: rgba(60, 60, 60, 0.95);
    }

    .livefeed-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 65vh;
        background: rgba(15, 15, 15, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 16px 16px 0 0;
        z-index: 10002;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 0 16px 20px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .livefeed-sheet.visible {
        transform: translateY(0);
    }

    .livefeed-sheet .side-table__row {
        padding: 10px 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .livefeed-sheet .side-table__name {
        font-size: 0.75rem;
    }

    .livefeed-sheet .side-table__detail {
        font-size: 0.65rem;
    }

    .livefeed-sheet .side-table__value,
    .livefeed-sheet .side-table__yield {
        font-size: 0.72rem;
    }

    /* Hide desktop mobile-filter-bar since we have floating pills */
    .mobile-filter-bar {
        display: none !important;
    }
}

/* ==============================================================
   CARDBOARD LIVEFEED REDESIGN v3
   3-column layout: left (filters+pulse) | center (feed) | right (tables)
   Two-line cards with time on left
   Scoped under body.cardboard
   ============================================================== */

/* ── Page offset for fixed navbar + ticker ── */
body.cardboard {
    padding-top: var(--cb-top-offset);
}

/* ══════════════════════════════════════════════════════════
   AMBIENT BACKGROUND SYSTEM
   Layer 1 (::before): Animated gradient + glow spots
   Layer 2 (::after):  Noise grain texture
   ══════════════════════════════════════════════════════════ */

/* ── Layer 1: Animated gradient + ambient glow spots ── */
body.cardboard::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        /* Glow spot 1: blue-indigo, top-left */
        radial-gradient(ellipse 800px 700px at 5% 8%,
            rgba(80, 120, 220, 0.22) 0%,
            transparent 65%),
        /* Glow spot 2: warm amber, bottom-right */
        radial-gradient(ellipse 700px 800px at 90% 85%,
            rgba(220, 150, 50, 0.18) 0%,
            transparent 65%),
        /* Glow spot 3: teal accent, center-bottom */
        radial-gradient(ellipse 600px 500px at 45% 95%,
            rgba(50, 190, 160, 0.14) 0%,
            transparent 65%),
        /* Slow-moving animated gradient base */
        linear-gradient(
            135deg,
            rgba(80, 120, 220, 0.08) 0%,
            transparent 25%,
            rgba(200, 130, 50, 0.06) 50%,
            transparent 75%,
            rgba(50, 180, 150, 0.07) 100%
        );
    background-size:
        100% 100%,
        100% 100%,
        100% 100%,
        400% 400%;
    animation: cb-ambient-drift 40s ease-in-out infinite;
}

@keyframes cb-ambient-drift {
    0%   { background-position: 0 0, 0 0, 0 0, 0% 0%; }
    25%  { background-position: 0 0, 0 0, 0 0, 100% 50%; }
    50%  { background-position: 0 0, 0 0, 0 0, 50% 100%; }
    75%  { background-position: 0 0, 0 0, 0 0, 0% 50%; }
    100% { background-position: 0 0, 0 0, 0 0, 0% 0%; }
}

/* ── Layer 2: Noise grain texture ── */
body.cardboard::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ── Light mode: stronger glows on white (desktop only; mobile stays dark) ── */
@media (min-width: 769px) {
    body.cardboard[data-theme="light"]::before {
        background:
            radial-gradient(ellipse 800px 700px at 5% 8%,
                rgba(60, 100, 200, 0.15) 0%,
                transparent 65%),
            radial-gradient(ellipse 700px 800px at 90% 85%,
                rgba(210, 140, 40, 0.12) 0%,
                transparent 65%),
            radial-gradient(ellipse 600px 500px at 45% 95%,
                rgba(40, 180, 150, 0.10) 0%,
                transparent 65%),
            linear-gradient(
                135deg,
                rgba(60, 100, 200, 0.06) 0%,
                transparent 25%,
                rgba(210, 140, 40, 0.05) 50%,
                transparent 75%,
                rgba(40, 180, 150, 0.05) 100%
            );
        background-size: 100% 100%, 100% 100%, 100% 100%, 400% 400%;
        animation: cb-ambient-drift 40s ease-in-out infinite;
    }

    body.cardboard[data-theme="light"]::after {
        opacity: 0.05;
    }
}

/* ── Main Body (3-column grid) ── */
body.cardboard .cb-livefeed-body {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 24px;
    align-items: start;
    max-width: var(--cb-max-width);
    margin: 0 auto;
    padding: 20px 24px 80px;
}

/* ── Left Panel (filters + pulse) ── */
body.cardboard .cb-livefeed-left {
    position: sticky;
    top: calc(var(--cb-top-offset) + 16px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - var(--cb-top-offset) - 32px);
    overflow: hidden;
}

/* ── Right Panel (biggest + highest) ──
   Sticky column that sizes to its content so both tables show all their rows.
   Previously this forced a fixed 100vh height and split it 50/50 between the
   two cards with overflow:hidden, which clipped the 5th row on laptop-height
   viewports. Now the cards size naturally; the whole column scrolls only if
   the two tables together ever exceed the viewport. */
body.cardboard .cb-livefeed-right {
    position: sticky;
    top: calc(var(--cb-top-offset) + 16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - var(--cb-top-offset) - 32px);
    overflow-y: auto;
    /* hide the scrollbar while keeping scrollability */
    scrollbar-width: none;
}

body.cardboard .cb-livefeed-right::-webkit-scrollbar {
    display: none;
}

/* ── Center Feed ── */
body.cardboard .cb-livefeed-tape {
    min-width: 0;
}

/* ── Frosted glass cards (depth over ambient bg) ── */
body.cardboard .cb-livefeed-left .cb-card,
body.cardboard .cb-livefeed-right .cb-card {
    background: color-mix(in srgb, var(--cb-bg-surface) 80%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ── Search Card ── */
body.cardboard .cb-livefeed-search-card {
    padding: 10px 12px;
}

body.cardboard .cb-livefeed-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-sm);
    background: var(--cb-bg-base);
    transition: border-color var(--cb-duration-fast) ease;
}

body.cardboard .cb-livefeed-search-wrap:focus-within {
    border-color: var(--cb-border-accent);
}

body.cardboard .cb-livefeed-search-icon {
    flex-shrink: 0;
    color: var(--cb-text-dim);
}

body.cardboard .cb-livefeed-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--cb-font);
    font-size: 0.72rem;
    color: var(--cb-text-primary);
    min-width: 0;
}

body.cardboard .cb-livefeed-search-input::placeholder {
    color: var(--cb-text-dim);
}

body.cardboard .cb-livefeed-search-clear {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--cb-text-muted);
    padding: 0 2px;
    font-family: var(--cb-font);
}

body.cardboard .cb-livefeed-search-clear:hover {
    color: var(--cb-text-primary);
}

/* ── Yield Disclaimer (sticky banner at top of feed) ── */
body.cardboard .cb-livefeed-disclaimer {
    position: sticky;
    top: var(--cb-top-offset);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 5px 14px;
    margin-bottom: 2px;
    background: color-mix(in srgb, var(--cb-bg-base) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cb-border);
}

body.cardboard .cb-livefeed-disclaimer-text {
    font-size: 0.58rem;
    color: var(--cb-text-dim);
    font-style: italic;
}

/* New Trades Badge */
body.cardboard .cb-livefeed-new-badge {
    position: sticky;
    top: calc(var(--cb-top-offset) + 8px);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 14px;
    margin: 0 auto 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--cb-text-primary);
    background: color-mix(in srgb, var(--cb-bg-elevated) 90%, transparent);
    border: 1px solid var(--cb-border-hover);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    width: fit-content;
    transition: background var(--cb-duration-fast) ease;
}

body.cardboard .cb-livefeed-new-badge:hover {
    background: var(--cb-bg-elevated);
}

/* ── Two-Line Trade Cards ── */
body.cardboard .cb-trade-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cb-border);
    cursor: pointer;
    transition: background-color var(--cb-duration-fast) ease,
                opacity 250ms ease-out, transform 250ms ease-out;
}

body.cardboard .cb-trade-card:hover {
    background-color: var(--cb-accent-glow);
}

/* Line 1: bond name + yield */
body.cardboard .cb-trade-line1 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

body.cardboard .cb-trade-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cb-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

body.cardboard .cb-trade-yield {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cb-text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

body.cardboard .cb-trade-yield-suffix {
    font-size: 0.58rem;
    font-weight: 500;
    color: var(--cb-text-dim);
    margin-left: 2px;
}

/* Line 2: time · meta .................. value */
body.cardboard .cb-trade-line2 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

body.cardboard .cb-trade-line2-left {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

body.cardboard .cb-trade-time {
    font-size: 0.62rem;
    color: var(--cb-text-dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

body.cardboard .cb-trade-meta {
    font-size: 0.68rem;
    color: var(--cb-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

body.cardboard .cb-trade-value {
    font-size: 0.72rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--cb-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Large Trade Accent (10L+) ── */
body.cardboard .cb-trade-card--large {
    border-left: 3px solid var(--cb-border-accent);
    padding-left: 11px;
}

body.cardboard .cb-trade-card--large .cb-trade-value {
    font-weight: 700;
    color: var(--cb-text-primary);
}

/* Trade Card Animations */
body.cardboard .cb-trade-card--entering {
    opacity: 0;
    transform: translateY(-16px);
}

body.cardboard .cb-trade-card--visible {
    opacity: 1;
    transform: translateY(0);
}

body.cardboard .cb-trade-card--new {
    animation: cb-trade-highlight 1.2s ease-out;
}

@keyframes cb-trade-highlight {
    0% { background-color: var(--cb-accent-glow); }
    100% { background-color: transparent; }
}

body.cardboard .cb-trade-card--initial {
    animation: cb-trade-fadein 300ms ease-out both;
    animation-delay: calc(var(--stagger-index) * 40ms);
}

@keyframes cb-trade-fadein {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Time Separator */
body.cardboard .cb-trade-time-sep {
    position: sticky;
    top: calc(var(--cb-top-offset) + 28px);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 6px;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--cb-text-muted);
    text-transform: lowercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--cb-bg-base) 94%, transparent);
    backdrop-filter: blur(8px);
}

body.cardboard .cb-trade-time-sep::before,
body.cardboard .cb-trade-time-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cb-border-hover);
}

/* ── Panel Title (shared) ── */
body.cardboard .cb-livefeed-panel-title {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--cb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 10px 0;
}

/* ── Filters Card ── */
body.cardboard .cb-livefeed-filter-card {
    padding: 16px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

body.cardboard .cb-livefeed-filter-group {
    margin-bottom: 12px;
}

body.cardboard .cb-livefeed-filter-group:last-of-type {
    margin-bottom: 0;
}

body.cardboard .cb-livefeed-filter-group--hidden {
    display: none;
}

body.cardboard .cb-livefeed-filter-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--cb-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

body.cardboard .cb-livefeed-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

body.cardboard .cb-livefeed-chip {
    padding: 3px 10px;
    font-size: 0.68rem;
    font-weight: 500;
    font-family: var(--cb-font);
    border: 1px solid var(--cb-border);
    border-radius: 20px;
    background: transparent;
    color: var(--cb-text-muted);
    cursor: pointer;
    transition: all var(--cb-duration-fast) ease;
    white-space: nowrap;
    text-transform: lowercase;
}

body.cardboard .cb-livefeed-chip:hover {
    border-color: var(--cb-border-hover);
    color: var(--cb-text-secondary);
}

body.cardboard .cb-livefeed-chip.cb-livefeed-chip--active {
    border-color: var(--cb-border-accent);
    color: var(--cb-text-primary);
    background: var(--cb-accent-glow);
}

body.cardboard .cb-livefeed-clear {
    display: block;
    margin-top: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    font-family: var(--cb-font);
    color: var(--cb-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--cb-duration-fast) ease;
}

body.cardboard .cb-livefeed-clear:hover {
    color: var(--cb-text-primary);
}

/* ── Today's Pulse Stats ── */
body.cardboard .cb-livefeed-pulse {
    padding: 16px;
}

body.cardboard .cb-livefeed-pulse-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--cb-border);
    border-radius: var(--cb-radius-sm);
    overflow: hidden;
}

body.cardboard .cb-livefeed-stat {
    background: var(--cb-bg-surface);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.cardboard .cb-livefeed-stat-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cb-text-dim);
}

body.cardboard .cb-livefeed-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cb-text-primary);
    font-variant-numeric: tabular-nums;
}

/* ── Side Tables (match feed card sizes) ──
   Compact density so both 5-row tables fit a full-screen laptop viewport
   without the column needing to scroll. */
body.cardboard .cb-livefeed-side-table {
    padding: 11px 14px;
}

/* tighter title above each table (scoped — left-panel titles keep their spacing) */
body.cardboard .cb-livefeed-side-table .cb-livefeed-panel-title {
    margin-bottom: 7px;
}

body.cardboard .cb-livefeed-side-table .side-table__row {
    background: transparent;
    border-radius: 0;
    padding: 5px 4px;
    border-bottom: 1px solid var(--cb-border);
}

/* keep the stacked value/yield numbers tight so they don't drive row height */
body.cardboard .cb-livefeed-side-table .side-table__value,
body.cardboard .cb-livefeed-side-table .side-table__yield {
    line-height: 1.2;
}

body.cardboard .cb-livefeed-side-table .side-table__row:last-child {
    border-bottom: none;
}

body.cardboard .cb-livefeed-side-table .side-table__row:hover {
    background: var(--cb-accent-glow);
}

body.cardboard .cb-livefeed-side-table .side-table__row:active {
    transform: scale(0.98);
    background: var(--cb-accent-glow);
}

body.cardboard .cb-livefeed-side-table .side-table__row {
    transition: background-color var(--cb-duration-fast) ease, transform 100ms ease;
}

/* Side table row flash when updated */
body.cardboard .side-table__row--flash {
    animation: cb-side-flash 800ms ease-out;
}

@keyframes cb-side-flash {
    0% { background-color: var(--cb-accent-glow); }
    100% { background-color: transparent; }
}

body.cardboard .cb-livefeed-side-table .side-table__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cb-text-primary);
    text-decoration: none;
    line-height: 1.25;
}

body.cardboard .cb-livefeed-side-table .side-table__detail {
    font-size: 0.64rem;
    color: var(--cb-text-muted);
    line-height: 1.2;
}

body.cardboard .cb-livefeed-side-table .side-table__value {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--cb-text-secondary);
}

body.cardboard .cb-livefeed-side-table .side-table__yield {
    font-size: 0.68rem;
    color: var(--cb-text-muted);
}

body.cardboard .cb-livefeed-side-table .side-table__highlight {
    color: var(--cb-text-primary);
}

body.cardboard .cb-livefeed-side-table .side-table__empty {
    color: var(--cb-text-dim);
}

/* ── Type Breakdown Bar ── */
body.cardboard .cb-livefeed-breakdown {
    margin-top: 12px;
}

body.cardboard .cb-livefeed-breakdown-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

body.cardboard .cb-livefeed-breakdown-seg {
    min-width: 2px;
    transition: width 400ms ease;
}

body.cardboard .cb-livefeed-breakdown-seg--govt { background: #5b8def; }
body.cardboard .cb-livefeed-breakdown-seg--corporate { background: #e8a838; }
body.cardboard .cb-livefeed-breakdown-seg--sgb { background: #50c878; }
body.cardboard .cb-livefeed-breakdown-seg--tax-free { background: #b07cd8; }
body.cardboard .cb-livefeed-breakdown-seg--unknown { background: var(--cb-border); }

body.cardboard .cb-livefeed-breakdown-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

body.cardboard .cb-livefeed-breakdown-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.58rem;
    color: var(--cb-text-muted);
}

body.cardboard .cb-livefeed-breakdown-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

body.cardboard .cb-livefeed-breakdown-pct {
    font-weight: 600;
    color: var(--cb-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ── Most Active Bonds ── */
body.cardboard .cb-livefeed-most-active {
    padding: 14px;
}

body.cardboard .cb-livefeed-active-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    border-bottom: 1px solid var(--cb-border);
    cursor: pointer;
    transition: background-color var(--cb-duration-fast) ease;
}

body.cardboard .cb-livefeed-active-row:last-child {
    border-bottom: none;
}

body.cardboard .cb-livefeed-active-row:hover {
    background: var(--cb-accent-glow);
}

body.cardboard .cb-livefeed-active-row:active {
    transform: scale(0.98);
}

body.cardboard .cb-livefeed-active-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cb-text-primary);
}

body.cardboard .cb-livefeed-active-count {
    font-size: 0.62rem;
    color: var(--cb-text-dim);
    font-variant-numeric: tabular-nums;
}

body.cardboard .cb-livefeed-active-count strong {
    color: var(--cb-text-muted);
    font-weight: 600;
}

/* ── Loading / Empty / Error States ── */
body.cardboard .livefeed-loading__spinner {
    border-color: var(--cb-border);
    border-top-color: var(--cb-text-secondary);
}

body.cardboard .livefeed-loading__text {
    color: var(--cb-text-muted);
}

body.cardboard .livefeed-empty__title {
    color: var(--cb-text-secondary);
}

body.cardboard .livefeed-empty__subtitle {
    color: var(--cb-text-dim);
}

body.cardboard .livefeed-error__retry {
    font-family: var(--cb-font);
    color: var(--cb-text-secondary);
    background: var(--cb-accent-glow);
    border-color: var(--cb-border);
    border-radius: var(--cb-radius-sm);
}

/* ── Responsive: Tablet (hide side panels, show 1-col) ── */
@media (max-width: 1080px) {
    body.cardboard .cb-livefeed-body {
        grid-template-columns: 1fr;
        padding: 12px 16px 80px;
        gap: 16px;
    }

    body.cardboard .cb-livefeed-left,
    body.cardboard .cb-livefeed-right {
        display: none;
    }
}

/* ── Responsive: Mobile ── */
@media (max-width: 768px) {
    body.cardboard .cb-livefeed-body {
        grid-template-columns: 1fr;
        padding: 12px 12px 80px;
        gap: 12px;
    }

    body.cardboard .cb-livefeed-left,
    body.cardboard .cb-livefeed-right {
        display: none;
    }

    body.cardboard .cb-trade-card {
        padding: 10px 12px;
    }

    body.cardboard .cb-trade-name {
        font-size: 0.76rem;
    }

    body.cardboard .cb-trade-yield {
        font-size: 0.76rem;
    }

    body.cardboard .cb-livefeed-disclaimer {
        padding: 4px 12px;
    }
}

/* ── Collapsible filter group (rating row slide-in) ──
   The rating row uses a grid 0fr→1fr reveal so it slides open to exactly its
   content height instead of snapping in with display:none. */
body.cardboard .cb-livefeed-filter-group--collapsible {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 280ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 220ms ease,
                margin-bottom 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.cardboard .cb-livefeed-filter-group--collapsible .cb-livefeed-filter-group__inner {
    overflow: hidden;
    min-height: 0;
    transform: translateY(0);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Compound selector wins over the base `--hidden { display:none }` rule. */
body.cardboard .cb-livefeed-filter-group--collapsible.cb-livefeed-filter-group--hidden {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
}

body.cardboard .cb-livefeed-filter-group--collapsible.cb-livefeed-filter-group--hidden .cb-livefeed-filter-group__inner {
    transform: translateY(-4px);
}

/* ── Filter group change flash (adaptive yield buckets) ──
   A short glow so the user registers that the yield filter just re-bucketed
   itself under them when they switched category. */
body.cardboard .cb-livefeed-chips-fade,
body.cardboard #yieldChips {
    transition: opacity 150ms ease;
}

body.cardboard .cb-filter-group--flash {
    animation: cb-filter-group-flash 750ms ease-out;
    border-radius: 8px;
}

@keyframes cb-filter-group-flash {
    0%   { background-color: transparent; box-shadow: 0 0 0 0 var(--cb-accent-glow); }
    25%  { background-color: var(--cb-accent-glow); box-shadow: 0 0 0 4px var(--cb-accent-glow); }
    100% { background-color: transparent; box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
    body.cardboard .cb-livefeed-filter-group--collapsible,
    body.cardboard .cb-livefeed-filter-group--collapsible .cb-livefeed-filter-group__inner,
    body.cardboard #yieldChips {
        transition: none;
    }
    body.cardboard .cb-filter-group--flash {
        animation: none;
    }
}

/* ── Side tables: prominent #1 hero + clean list ──
   The leader sits in its own elevated, accent-shaded card with a slanted rank
   badge (à la a "year in music" #01); rows 2–5 stay a tight single-metric list.
   Each table is colour-keyed to its metric: amber for value, blue for yield. */
body.cardboard .cb-livefeed-side-table .side-table__hero {
    --hero-accent: var(--cb-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 9px;
    padding: 10px 11px;
    cursor: pointer;
    background: var(--cb-bg-elevated);
    border: 1px solid var(--cb-border);
    border-left: 3px solid var(--hero-accent);
    border-radius: var(--cb-radius-sm);
    transition: transform 120ms ease, border-color var(--cb-duration-fast) ease;
}

body.cardboard .cb-livefeed-side-table .side-table__hero--value { --hero-accent: var(--cb-accent-amber); }
body.cardboard .cb-livefeed-side-table .side-table__hero--yield { --hero-accent: var(--cb-accent-yield); }

body.cardboard .cb-livefeed-side-table .side-table__hero:hover {
    border-color: var(--hero-accent);
    transform: translateY(-1px);
}

body.cardboard .cb-livefeed-side-table .side-table__hero:active {
    transform: scale(0.99);
}

/* slanted accent rank badge */
body.cardboard .cb-livefeed-side-table .side-table__hero-rank {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    background: var(--hero-accent);
    color: #0a0a0a;
    font-size: 0.92rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    border-radius: 7px;
    transform: rotate(-5deg);
}

body.cardboard .cb-livefeed-side-table .side-table__hero-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.cardboard .cb-livefeed-side-table .side-table__hero-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

body.cardboard .cb-livefeed-side-table .side-table__hero-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--cb-text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.cardboard .cb-livefeed-side-table .side-table__hero-metric {
    flex: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hero-accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
}

body.cardboard .cb-livefeed-side-table .side-table__hero-sub {
    font-size: 0.64rem;
    color: var(--cb-text-muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* List rows under the hero: name + context on the left, one metric on the right. */
body.cardboard .cb-livefeed-side-table .side-table__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 6px;
}

body.cardboard .cb-livefeed-side-table .side-table__primary {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--cb-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* When the leader changes, the hero gets an accent ring instead of a fill flash. */
body.cardboard .side-table__hero.side-table__row--flash {
    animation: cb-hero-flash 800ms ease-out;
}

@keyframes cb-hero-flash {
    0%   { box-shadow: 0 0 0 2px var(--hero-accent); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
