body.finance-page {
    background: var(--gradient-hero);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

body.finance-page .header {
    background: rgba(10, 12, 18, 0.92);
    border-bottom: 1px solid #222a32;
}

body.finance-page main {
    padding: 48px 0 88px;
}

.cot-container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.cot-hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
}

.cot-hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    margin: 0;
}

.cot-hero p {
    color: #9aa4ad;
    margin: 0;
    max-width: 720px;
}

.sentiment {
    background: rgba(20, 24, 29, 0.88);
    border: 1px solid #222a32;
    border-radius: 22px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.sentiment-header {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
    align-items: flex-start;
}

.sentiment-header h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.6vw, 1.7rem);
}

.sentiment-header p {
    margin: 8px 0 0;
    max-width: 600px;
    color: #9aa4ad;
}

.sentiment-errors {
    color: #ff5c6c;
    font-size: 14px;
    min-height: 18px;
}

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.sentiment-card {
    --sentiment-accent: #22c55e;
    position: relative;
    background: rgba(12, 16, 22, 0.92);
    border: 1px solid #1f252d;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sentiment-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 65%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.sentiment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.sentiment-card:hover::before {
    opacity: 1;
}

.sentiment-card.is-disabled {
    opacity: 0.55;
    filter: grayscale(0.2);
}

.sentiment-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sentiment-card__tag {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa4ad;
    border: 1px solid #222a32;
    border-radius: 999px;
    padding: 4px 10px;
}

.sentiment-card__status {
    font-size: 13px;
    font-weight: 600;
    color: var(--sentiment-accent);
}

.sentiment-score {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.sentiment-value {
    font-size: clamp(2.4rem, 5vw, 3.1rem);
    font-weight: 700;
    color: #e6ecf1;
    line-height: 1;
}

.sentiment-delta {
    font-size: 14px;
    color: #9aa4ad;
}

.sentiment-delta.up {
    color: #2dbf71;
}

.sentiment-delta.down {
    color: #ff5c6c;
}

.sentiment-progress {
    position: relative;
    padding-top: 6px;
}

.sentiment-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 22%, #eab308 50%, #22c55e 75%, #16a34a 100%);
    opacity: 0.9;
}

.sentiment-pointer {
    position: absolute;
    top: -6px;
    width: 4px;
    height: 24px;
    border-radius: 999px;
    left: 0;
    transform: translateX(-50%);
    background: var(--sentiment-accent);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
    transition: left 0.35s ease, background 0.25s ease;
}

.sentiment-pointer::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sentiment-accent);
    transform: translate(-50%, 50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.sentiment-spark {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}

.sentiment-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    font-size: 13px;
    color: #e6ecf1;
}

.sentiment-metrics div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(34, 42, 50, 0.9);
    background: rgba(255, 255, 255, 0.02);
}

.sentiment-metrics dt {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7e8896;
}

.sentiment-metrics dd {
    margin: 0;
    font-size: 1rem;
    color: #e6ecf1;
}

.sentiment-footer {
    margin-top: auto;
    font-size: 12px;
}

.sentiment-footer a {
    color: #9aa4ad;
    text-decoration: none;
}

.sentiment-footer a:hover {
    color: #e6ecf1;
}

.macro-dashboard {
    background: rgba(20, 24, 29, 0.88);
    border: 1px solid #222a32;
    border-radius: 22px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
}

.macro-dashboard__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.macro-dashboard__head p {
    margin: 0;
    color: #9aa4ad;
    max-width: 560px;
}

.macro-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.macro-card {
    background: rgba(12, 16, 22, 0.92);
    border: 1px solid #1f252d;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.macro-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.macro-card.is-disabled {
    opacity: 0.6;
}

.macro-card__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.macro-card__header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.macro-card__asof {
    font-size: 0.85rem;
    color: #9aa4ad;
}

.macro-card__headline {
    display: flex;
    gap: 14px;
    align-items: baseline;
}

.macro-card__value {
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #e6ecf1;
}

.macro-card__delta {
    font-size: 0.95rem;
    color: #9aa4ad;
}

.macro-card__delta.up {
    color: #2dbf71;
}

.macro-card__delta.down {
    color: #ff5c6c;
}

.macro-card__spark {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}

.macro-card__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.macro-card__stats div {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(34, 42, 50, 0.9);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.macro-card__stats dt {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7e8896;
}

.macro-card__stats dd {
    margin: 0;
    font-size: 0.95rem;
    color: #e6ecf1;
}

.congress-trades {
    background: rgba(20, 24, 29, 0.88);
    border: 1px solid #222a32;
    border-radius: 22px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
}

.congress-trades__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
}

.congress-trades__head p {
    margin: 6px 0 0;
    color: #9aa4ad;
    max-width: 560px;
}

.congress-trades__updated {
    font-size: 0.9rem;
    color: #9aa4ad;
}

.congress-trades__table {
    overflow-x: auto;
}

.congress-trades table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.congress-trades thead {
    background: rgba(255, 255, 255, 0.04);
}

.congress-trades th,
.congress-trades td {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(34, 42, 50, 0.9);
}

.congress-trades tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.congress-trades__empty {
    font-size: 0.95rem;
    color: #9aa4ad;
}

.congress-trades__meta {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #9aa4ad;
}

.congress-trades__ticker {
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sentiment-events,
.sentiment-insights {
    background: rgba(20, 24, 29, 0.88);
    border: 1px solid #222a32;
    border-radius: 22px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
}

.sentiment-events__head,
.sentiment-insights__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sentiment-events__head p,
.sentiment-insights__head p {
    color: #9aa4ad;
    margin: 0;
}

.sentiment-events__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.sentiment-events__item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid #1f252d;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.sentiment-events__item.is-active {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
}

.sentiment-events__date {
    font-size: 0.9rem;
    color: #e6ecf1;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sentiment-events__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #d1d5db;
}

.sentiment-events__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sentiment-events__headline strong {
    font-size: 1.02rem;
}

.sentiment-events__badge {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 999px;
    padding: 4px 10px;
}

.sentiment-events__body p {
    margin: 0;
    color: #9aa4ad;
    font-size: 0.95rem;
}

.sentiment-events__empty {
    font-size: 0.95rem;
    color: #9aa4ad;
}

.sentiment-insights__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.sentiment-insight {
    border: 1px solid #1f252d;
    border-radius: 18px;
    padding: 20px;
    background: rgba(12, 16, 22, 0.92);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sentiment-insight::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.07), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.sentiment-insight:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.sentiment-insight:hover::after {
    opacity: 1;
}

.sentiment-insight.is-disabled {
    opacity: 0.6;
}

.sentiment-insight__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sentiment-insight__badge {
    align-self: flex-start;
    font-size: 0.85rem;
    color: var(--sentiment-accent, #9aa4ad);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 4px 10px;
}

.sentiment-insight h3 {
    margin: 0;
    font-size: 1.1rem;
}

.sentiment-insight p {
    margin: 0;
    color: #d1d5db;
    line-height: 1.55;
}

@media (max-width: 720px) {
    .sentiment {
        padding: 22px;
    }

    .sentiment-grid {
        gap: 16px;
    }

    .sentiment-metrics {
        grid-template-columns: 1fr;
    }

    .sentiment-events,
    .sentiment-insights {
        padding: 22px;
    }

    .sentiment-events__item {
        grid-template-columns: 1fr;
    }

    .macro-dashboard,
    .congress-trades {
        padding: 22px;
    }

    .macro-card__stats {
        grid-template-columns: 1fr;
    }
}

.cot-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #222a32;
    border-radius: 16px;
    padding: 16px 20px;
}

.cot-error {
    color: #ff5c6c;
    font-size: 14px;
    min-height: 18px;
}

.cot-controls label {
    font-size: 14px;
    color: #9aa4ad;
    display: flex;
    gap: 10px;
    align-items: center;
}

.cot-controls select {
    border: 1px solid #222a32;
    border-radius: 10px;
    background: #14181d;
    color: #e6ecf1;
    padding: 8px 12px;
    font-size: 14px;
}

.cot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.cot-card {
    background: #14181d;
    border: 1px solid #222a32;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.cot-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.cot-card-title {
    font-size: 1.125rem;
    margin: 0;
}

.cot-card-segment {
    font-size: 12px;
    color: #9aa4ad;
    border: 1px solid #222a32;
    border-radius: 999px;
    padding: 4px 9px;
}

.cot-card-subtitle {
    color: #9aa4ad;
    font-size: 13px;
}

.cot-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cot-kpi {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #222a32;
    border-radius: 12px;
    padding: 12px;
}

.cot-kpi-label {
    font-size: 12px;
    color: #9aa4ad;
}

.cot-kpi-value {
    font-size: 18px;
    margin-top: 6px;
}

.cot-kpi-value.up {
    color: #2dbf71;
}

.cot-kpi-value.down {
    color: #ff5c6c;
}

.cot-spark {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    margin: 12px 0 8px;
}

.cot-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9aa4ad;
}

.cot-pill {
    border-radius: 999px;
    border: 1px solid #222a32;
    padding: 5px 10px;
}

.cot-pill.up {
    border-color: rgba(45, 191, 113, 0.35);
    color: #2dbf71;
}

.cot-pill.down {
    border-color: rgba(255, 92, 108, 0.35);
    color: #ff5c6c;
}

.cot-card a {
    color: inherit;
    text-decoration: none;
}

.cot-empty {
    padding: 18px;
    border-radius: 12px;
    border: 1px dashed #222a32;
    color: #9aa4ad;
    text-align: center;
}

/* Detail page */

.cot-detail-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 32px;
}

/* News section */
.cot-news {
    margin-top: 28px;
    background: #14181d;
    border: 1px solid #222a32;
    border-radius: 16px;
    overflow: hidden;
}

.cot-news h2 {
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #222a32;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cot-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cot-news-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #222a32;
    align-items: start;
}

.cot-news-item--noimg {
    grid-template-columns: 1fr;
}

.cot-news-thumb {
    width: 140px;
    height: 84px;
    object-fit: cover;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a2030, #28344a);
    border: 1px solid #222a32;
}

.cot-news-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cot-news-item:last-child { border-bottom: none; }

.cot-news-item a { color: #e6ecf1; text-decoration: none; }
.cot-news-item a:hover { text-decoration: underline; }

.cot-news-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #9aa4ad;
    font-size: 12px;
}

.cot-tag {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #222a32;
    border-radius: 999px;
    font-size: 11px;
    color: #9aa4ad;
}

.cot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9aa4ad;
    border: 1px solid #222a32;
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
}

.cot-detail-main {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cot-detail-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.cot-detail-kpi {
    background: rgba(255,255,255,0.02);
    border: 1px solid #222a32;
    border-radius: 12px;
    padding: 12px;
}

.cot-detail-kpi .cot-kpi-label {
    font-size: 13px;
}

.cot-detail-spark {
    flex: 1 1 360px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    border-radius: 16px;
}

.cot-table-wrap {
    background: #14181d;
    border: 1px solid #222a32;
    border-radius: 16px;
    overflow: hidden;
}

.cot-table-wrap h2 {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #222a32;
    font-size: 1.1rem;
}

.cot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cot-table th,
.cot-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #222a32;
}

.cot-table th {
    text-align: left;
    color: #9aa4ad;
    font-weight: 500;
}

.cot-table td {
    text-align: right;
}

.cot-table td:first-child,
.cot-table th:first-child {
    text-align: left;
}

.cot-back-link {
    color: #9aa4ad;
    font-size: 14px;
}

@media (max-width: 768px) {
    .cot-news-item,
    .cot-news-item--noimg {
        grid-template-columns: 1fr;
    }

    .cot-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .cot-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cot-detail-hero {
        flex-direction: column;
    }

    .cot-detail-spark {
        min-height: 220px;
    }
}

@media (max-width: 520px) {
    .cot-kpi-row {
        grid-template-columns: 1fr;
    }
}
