/* ---------- Dashboard shell ---------- */
.site-topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 16px 32px;
}

.site-topbar-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-logo {
    height: 28px;
    width: auto;
    display: block;
}

.topbar-methodology-link {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--maroon);
    border: 1px solid var(--maroon);
    border-radius: 20px;
    padding: 7px 16px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.topbar-methodology-link:hover {
    background: var(--maroon);
    color: #fff;
}

.dash-intro {
    padding-bottom: 36px;
}

.dash-intro .page-signal {
    inset: auto;
    top: 4%;
    bottom: auto;
    right: 0;
    left: 56%;
    height: 85%;
    opacity: 0.9;
}

.landing-tabs-bar {
    border-bottom: 1px solid var(--line);
    padding-bottom: 4px;
    margin-bottom: 40px;
}

.landing-tabs {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 36px;
}

/* ---------- Layout: sidebar + content ---------- */
.dash-body {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 32px 100px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: start;
}

.batch-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 24px;
}

.batch-btn {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.batch-btn:hover {
    border-color: var(--maroon);
}

.batch-btn.active {
    background: var(--maroon);
    border-color: var(--maroon);
    color: #fff;
}

.batch-btn.overview-btn {
    background: var(--paper-warm);
    color: var(--maroon);
    font-weight: 700;
}

/* ---------- Stat row ---------- */
.stat-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 40px;
}

.dash-tag {
    background: var(--maroon);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
}

.stat-box {
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 14px 24px;
    position: relative;
    text-align: center;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--maroon);
    border-radius: 2px;
}

.stat-box .stat-label {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--maroon);
    font-size: 15px;
    margin-bottom: 4px;
}

.stat-box .stat-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
}

.stat-box.stat-number .stat-value {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 700;
    color: var(--maroon);
}

.stat-box.stat-number .stat-label {
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 13px;
}

/* ---------- Chart sections ---------- */
.dash-section {
    margin-bottom: 56px;
}

.dash-section h2 {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--maroon);
    margin-bottom: 18px;
}

.dash-section-sub {
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: -10px;
    margin-bottom: 16px;
}

.chart-frame {
    position: relative;
    width: 100%;
}

.chart-frame.h-320 { height: 320px; }
.chart-frame.h-260 { height: 260px; }
.chart-frame.h-380 { height: 380px; }

/* ---------- Dual-handle range slider ---------- */
.range-slider {
    position: relative;
    height: 46px;
    margin: 0 0 8px;
}

.range-slider .range-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--maroon);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.range-track-wrap {
    position: relative;
    height: 26px;
}

.range-label {
    position: absolute;
    top: -2px;
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 2px 6px;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.range-track-bg {
    position: absolute;
    top: 11px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
}

.range-track-fill {
    position: absolute;
    top: 11px;
    height: 4px;
    background: var(--maroon);
    border-radius: 2px;
}

.range-slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 26px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    pointer-events: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--maroon);
    cursor: grab;
    margin-top: 4px;
}

.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--maroon);
    cursor: grab;
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
}

/* ---------- Treemap ---------- */
.treemap {
    position: relative;
    width: 100%;
    height: 420px;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.treemap-cell {
    cursor: pointer;
    transition: filter 0.1s ease, outline 0.1s ease;
}

.treemap-cell:hover,
.treemap-cell:focus-visible {
    filter: brightness(1.12);
    outline: 2px solid var(--brass);
    outline-offset: -2px;
    z-index: 2;
}

.chart-tooltip {
    position: fixed;
    z-index: 50;
    background: var(--ink);
    color: #fff;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 240px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.1s ease, transform 0.1s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.chart-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.chart-tooltip .tt-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}

.chart-tooltip .tt-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #E7E4E1;
}

.chart-tooltip .tt-row b {
    color: var(--brass);
    font-weight: 700;
}

.treemap-cell {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    text-align: center;
    overflow: hidden;
}

.treemap-cell .tc-label {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.treemap-cell.tc-multiline .tc-label {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: normal;
    line-height: 1.25;
}

/* ---------- Sentiment ranked tables ---------- */
.rank-tables {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.rank-panel {
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.rank-panel-head {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 12px;
    color: var(--ink);
}

.rank-panel.neutral .rank-panel-head { background: #E7E4E1; }
.rank-panel.negative .rank-panel-head { background: #F6C9C9; }
.rank-panel.positive .rank-panel-head { background: #C8E8B8; }

.rank-list {
    list-style: none;
    margin: 0;
    padding: 6px 10px;
}

.rank-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--paper-warm);
}

.rank-row:last-child { border-bottom: none; }

.rank-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
}

.rank-bar-track {
    position: relative;
    height: 22px;
    background: var(--paper-warm);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.rank-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 3px;
}

.rank-panel.neutral .rank-bar-fill { background: #C9C2BB; }
.rank-panel.negative .rank-bar-fill { background: #E4796B; }
.rank-panel.positive .rank-bar-fill { background: #7FB86B; }

.rank-name {
    position: relative;
    z-index: 1;
    padding-left: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-soft);
    text-align: right;
}

/* ---------- Hate speech legend ---------- */
.hs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.hs-legend dt {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--maroon);
    font-size: 13px;
    margin-top: 14px;
}

.hs-legend dt:first-child { margin-top: 0; }

.hs-legend dd {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.behavior-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 36px;
}

.behavior-grid h3 {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--maroon);
    margin-bottom: 14px;
}

.data-note {
    font-size: 12.5px;
    color: var(--ink-soft);
    border-top: 1px dashed var(--line);
    padding-top: 14px;
    margin-top: 48px;
}

/* ---------- Landing page tabs ---------- */
.landing-tabs {
    display: flex;
    gap: 28px;
    flex-shrink: 0;
}

.landing-tab {
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 600;
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.landing-tab.active {
    color: var(--ink);
    border-bottom-color: var(--maroon);
}

.landing-panel {
    display: none;
}

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

/* ---------- What We Stand For panel ---------- */
.standfor-text {
    max-width: 720px;
    margin: 48px auto 0;
    text-align: center;
}

.standfor-text p {
    font-size: 18px;
    line-height: 1.85;
    color: var(--ink);
    margin-bottom: 20px;
}

.standfor-text p:last-of-type {
    margin-bottom: 0;
}

.landing-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 32px auto;
    max-width: 400px;
    color: var(--line);
}

.landing-divider .ld-line {
    flex: 1;
    height: 1px;
    background: currentColor;
}

.landing-divider .ld-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid var(--maroon);
}

.landing-divider .ld-diamond {
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--brass);
    transform: rotate(45deg);
}

.accept-cta {
    text-align: center;
    margin: 44px auto 0;
}

/* ---------- Methodology panel ---------- */
.method-intro {
    max-width: 800px;
    margin: 0 auto 20px;
    color: var(--ink-soft);
    font-size: 16.5px;
    line-height: 1.8;
}

.legal-content h3 {
    font-family: var(--font-display);
    font-size: 17.5px;
    font-weight: 600;
    color: var(--ink);
    margin: 28px 0 10px;
}

.legal-content .ref-list {
    padding-left: 20px;
    list-style: decimal;
}

.legal-content .ref-list li {
    color: var(--ink-soft);
    font-size: 16.5px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.legal-content .ref-list a {
    color: var(--maroon);
    word-break: break-all;
}

.table-title-row th {
    text-align: center;
    background: var(--maroon);
    color: #fff;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 14px 16px;
}

.legal-table-centered th {
    text-align: center;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: normal;
}

.legal-table-2col {
    table-layout: fixed;
}

.legal-table-2col th,
.legal-table-2col td {
    width: 50%;
}

.legal-table-2col td {
    font-size: 16.5px;
}

.legal-content p,
.legal-content li {
    font-size: 16.5px;
}

/* ---------- Batch page: topics with side legend ---------- */
.topics-with-legend {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: start;
}

.topic-legend {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.topic-legend dt {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--maroon);
    font-size: 12.5px;
    margin-top: 12px;
}

.topic-legend dt:first-child { margin-top: 0; }

.topic-legend dd {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.5;
}

/* ---------- Key Takeaway ---------- */
.kt-banner {
    background: var(--maroon);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 16px 32px;
    display: inline-flex;
    align-items: center;
    clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
    margin-bottom: 32px;
}

.kt-item {
    margin-bottom: 28px;
}

.kt-item h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.4;
}

.kt-item p {
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.75;
    margin-bottom: 10px;
}

.kt-item ul {
    margin: 0 0 10px;
    padding-left: 20px;
    list-style: disc;
}

.kt-item li {
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: 6px;
}

.kt-term {
    color: var(--maroon);
    font-weight: 600;
}

.kt-strong {
    color: var(--ink);
    font-weight: 700;
}

.kt-source {
    text-align: right;
    margin: 40px 0 24px;
}

.kt-source .kt-org {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--maroon);
    letter-spacing: 0.03em;
}

.kt-source .kt-date {
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 2px;
}

.kt-readmore {
    font-size: 14.5px;
    margin-bottom: 40px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .topbar-methodology-link {
        font-size: 11.5px;
        padding: 6px 12px;
    }

    .dash-body {
        grid-template-columns: 1fr;
    }

    .batch-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .dash-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .stat-row {
        grid-template-columns: 1fr;
    }

    .hs-grid,
    .behavior-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .sent-treemap,
    .rank-tables {
        grid-template-columns: 1fr;
    }

    .topics-with-legend {
        grid-template-columns: 1fr;
    }
}
