:root {
    --brand: #6bb8e3;
    --bg: #0f1923;
    --panel: #1a2332;
    --panel-soft: #161f2c;
    --line: rgba(255, 255, 255, 0.12);
    --text: #e8eff8;
    --text-soft: #9fb0c4;
    --green: #2fcf76;
    --red: #ff6a72;
    --gray: #8b96a5;
    --gold: #f4c45a;
    --toast: #243447;
}

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

body {
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -15%, rgba(107, 184, 227, 0.2), transparent 36%),
        linear-gradient(180deg, #0d1620 0%, var(--bg) 60%, #0f1822 100%);
    min-height: 100vh;
    line-height: 1.55;
}

a {
    color: inherit;
}

.reading-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 80;
}

.reading-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #6bb8e3, #95d8ff);
    transition: width 0.08s linear;
}

.topbar {
    position: sticky;
    top: 4px;
    z-index: 70;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    background: rgba(15, 25, 35, 0.92);
}

.topbar-inner {
    width: min(1240px, calc(100% - 2.2rem));
    margin: 0 auto;
    padding: 0.85rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.brand img {
    width: 210px;
    height: auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.95rem;
    font-size: 0.9rem;
    color: #c4d6ea;
    text-decoration: none;
}

.back-link:hover {
    color: #e7f2fe;
}

.page-shell {
    width: min(1240px, calc(100% - 2.2rem));
    margin: 1.2rem auto 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.article-panel,
.related-panel {
    background: linear-gradient(180deg, rgba(26, 35, 50, 0.95), rgba(22, 30, 43, 0.95));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.article-panel {
    padding: 1.1rem;
}

.article-title {
    font-size: clamp(1.45rem, 2.8vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin-bottom: 0.8rem;
}

.meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.72rem;
}

.source-badge,
.meta-chip,
.sentiment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 0.22rem 0.54rem;
    font-size: 0.72rem;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.02);
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.22rem 0.54rem;
    font-size: 0.68rem;
    color: #c6d4e1;
    background: rgba(255, 255, 255, 0.03);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.tier-badge.small {
    font-size: 0.64rem;
    padding: 0.14rem 0.38rem;
    margin-left: auto;
}

.source-badge {
    color: #d7ebfb;
    border-color: rgba(107, 184, 227, 0.45);
    background: rgba(107, 184, 227, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

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

.sentiment-dot.bullish {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 207, 118, 0.2);
}

.sentiment-dot.bearish {
    background: var(--red);
    box-shadow: 0 0 0 3px rgba(255, 106, 114, 0.2);
}

.sentiment-dot.neutral {
    background: var(--gray);
    box-shadow: 0 0 0 3px rgba(139, 150, 165, 0.2);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.tag-pill {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #d8e6f5;
    padding: 0.15rem 0.44rem;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.video-embed {
    position: relative;
    width: 100%;
    margin: 0.82rem 0 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-brief {
    margin: 0.35rem 0 0;
    color: #dfebf7;
}

.article-brief p {
    margin-bottom: 1.05rem;
    font-size: 1.05rem;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

.article-brief p:last-child {
    margin-bottom: 0;
}

.original-cta-wrap {
    margin-top: 1.15rem;
}

.original-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(107, 184, 227, 0.72);
    background: linear-gradient(180deg, rgba(107, 184, 227, 0.95), rgba(82, 169, 214, 0.95));
    color: #0f1a24;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    padding: 0.68rem 1rem;
    box-shadow: 0 12px 24px rgba(107, 184, 227, 0.25);
    transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.original-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(107, 184, 227, 0.32);
    filter: brightness(1.05);
}

.original-cta-disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-soft);
    box-shadow: none;
    cursor: not-allowed;
}

.action-bar {
    margin-top: 1rem;
    position: sticky;
    bottom: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.72rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 25, 35, 0.85);
    backdrop-filter: blur(10px);
}

.action-btn {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #e2ecf7;
    font: inherit;
    font-size: 0.86rem;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(107, 184, 227, 0.64);
    background: rgba(107, 184, 227, 0.16);
}

.back-link:focus-visible,
.action-btn:focus-visible,
.original-cta:focus-visible,
.related-card:focus-visible,
.brand:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 184, 227, 0.28), 0 0 0 4px rgba(15, 25, 35, 0.88);
    border-color: rgba(107, 184, 227, 0.7);
}

.action-btn.active {
    border-color: rgba(244, 196, 90, 0.8);
    background: rgba(244, 196, 90, 0.16);
    color: #ffe7b8;
}

.action-count {
    color: var(--gold);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.82rem;
}

.related-panel {
    padding: 0.92rem;
}

.related-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #e2eefb;
    margin-bottom: 0.6rem;
}

.related-list {
    display: grid;
    gap: 0.55rem;
}

.related-card {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 10px;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.related-card:hover {
    border-color: rgba(107, 184, 227, 0.6);
    background: rgba(107, 184, 227, 0.1);
    transform: translateY(-1px);
}

.related-card h3 {
    font-size: 0.88rem;
    color: #e7f0fa;
    line-height: 1.35;
    margin-bottom: 0.44rem;
}

.related-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #bccde0;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.toast-wrap {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    display: grid;
    gap: 0.45rem;
}

.toast {
    background: var(--toast);
    color: #e9f2fd;
    border: 1px solid rgba(107, 184, 227, 0.45);
    border-radius: 9px;
    padding: 0.45rem 0.7rem;
    font-size: 0.84rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
    animation: toast-in 0.2s ease;
}

.no-related {
    color: var(--text-soft);
    font-size: 0.9rem;
    padding: 0.65rem 0.2rem;
}

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

@media (prefers-reduced-motion: reduce) {
    .reading-progress,
    .original-cta,
    .action-btn,
    .related-card,
    .toast {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 1024px) {
    .page-shell {
        grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
    }
}

@media (max-width: 980px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    .related-panel {
        order: 2;
    }

    .action-bar {
        position: static;
    }
}

@media (max-width: 640px) {
    .topbar-inner,
    .page-shell {
        width: calc(100% - 1.2rem);
    }

    .brand img {
        width: 165px;
    }

    .article-panel,
    .related-panel {
        padding: 0.8rem;
    }

    .meta-bar {
        gap: 0.4rem;
    }

    .source-badge,
    .meta-chip,
    .sentiment-chip,
    .tier-badge {
        font-size: 0.74rem;
    }

    .article-brief p {
        font-size: 1rem;
    }

    .action-bar {
        padding: 0.56rem;
    }

    .original-cta,
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}
