/* ── RESET & BASE ───────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --meta: #9ca3af;
    --link: #2563eb;
    --link-h: #1d4ed8;
    --divider: #e5e7eb;
    --divider-lt: #f3f4f6;
    --green: #059669;
    --red: #dc2626;
    --max-w: 1600px;
    --pin-bg: #fffbeb;
    --pin-border: #fde68a;
    --new-bg: #ecfdf5;
    /* Subtle green for "New since last visit" */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--text);
    transition: transform .25s ease;
}

.site-header.header-collapsed {
    transform: translateY(-100%);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 8px 16px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--divider-lt);
    gap: 12px;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    font-size: 18px;
}

.brand-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 11px;
    color: var(--muted);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
}

.stat-pill {
    color: var(--muted);
}

.stat-pill.accent {
    color: var(--green);
    font-weight: 600;
}

.header-time-block {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.time-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--meta);
}

.header-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
}

.header-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 10px;
    font: 600 12px/1 inherit;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
}

.tab-btn:hover {
    color: var(--text);
    border-color: var(--divider);
}

.tab-btn.active {
    color: var(--text);
    border-color: var(--text);
    background: var(--divider-lt);
}

.mobile-filters-toggle {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--muted);
    transition: color .15s;
}

.mobile-filters-toggle:hover,
.mobile-filters-toggle.active {
    color: var(--text);
}

.pin-status-bar {
    display: none;
    /* Redundant: inherited from .site-header stickiness */
    background: var(--link);
    color: #fff;
    padding: 8px 16px;
    justify-content: space-between;
    align-items: center;
    font: 600 12px/1 inherit;
    cursor: pointer;
    transition: background .15s, opacity .2s, transform .2s;
    /* Removed box-shadow to blend with header bottom border better or add subtle one */
}

.pin-status-bar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.pin-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pin-status-bar:hover {
    background: var(--link-h);
}

.share-pinned-btn-mini {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 10px;
    font: 600 11px/1 inherit;
    color: #fff;
    cursor: pointer;
    transition: all .2s;
}

.share-pinned-btn-mini:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.tap-view {
    font-size: 10px;
    opacity: .8;
    font-weight: 500;
}

/* ── PROGRESS ────────────────────────────────────────────────────────────── */
.progress-wrap {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 12px;
}

.progress-label {
    color: var(--muted);
    font-weight: 500;
}

.progress-track {
    flex: 1;
    height: 2px;
    background: var(--divider-lt);
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--text);
    transition: width .3s;
}

.refresh-countdown,
.footer-countdown {
    color: var(--muted);
    font: 11px/1 'JetBrains Mono', monospace;
}

/* ── CONTROLS ────────────────────────────────────────────────────────────── */
.controls-bar {
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.filter-row-label {
    font: 700 9px/1 inherit;
    text-transform: uppercase;
    color: var(--meta);
    min-width: 38px;
    flex-shrink: 0;
}

.filter-chips {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: none;
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 2px 8px;
    font: 500 11px/1 inherit;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    min-height: 24px;
}

.filter-chip:hover {
    color: var(--text);
    border-color: var(--muted);
}

.filter-chip.active {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
    font-weight: 600;
}

.filter-row-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.search-input {
    background: transparent;
    border: 1px solid var(--divider);
    border-radius: 20px;
    color: var(--text);
    font: 13px/1 inherit;
    padding: 8px 32px 8px 30px;
    width: 100%;
    min-height: 36px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
    border-color: var(--text);
}

.search-input::placeholder {
    color: var(--meta);
}

.search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: var(--meta);
    padding: 4px;
}

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

.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    color: var(--meta);
    transition: transform 0.2s, color 0.1s;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.pin-btn:hover {
    transform: translateY(-50%) scale(1.2);
    color: var(--text);
}

.pin-btn.active {
    color: #f59e0b;
    transform: translateY(-50%) scale(1.25);
}

.block-sec-link {
    font-size: 10px;
    color: var(--link);
    text-decoration: underline;
    margin-right: 32px;
    margin-left: auto;
}

.share-btn {
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 5px 12px;
    font: 700 11px/1 inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 30px;
    transition: opacity .2s;
}

.share-btn:hover {
    opacity: .8;
}

/* ── SHARE MODAL ─────────────────────────────────────────────────────────── */
/* (Kept mostly standard but tweaked slightly denser) */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--divider);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    overflow: hidden;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--divider);
}

.share-modal-title {
    font: 800 14px/1 inherit;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    border-radius: 4px;
}

.share-modal-close:hover {
    color: var(--text);
}

.share-modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-url-row {
    display: flex;
    gap: 6px;
}

.share-url-input {
    flex: 1;
    border: 1px solid var(--divider);
    border-radius: 6px;
    padding: 6px 10px;
    font: 11px/1 'JetBrains Mono', monospace;
    color: var(--muted);
    background: var(--divider-lt);
    outline: none;
    min-width: 0;
}

.share-copy-btn {
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font: 700 11px/1 inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
}

.share-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--divider);
    border-radius: 6px;
    background: var(--divider-lt);
    font: 600 12px/1 inherit;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}

.share-action-btn:hover {
    border-color: var(--text);
    background: #fff;
}

.share-x-btn:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.share-email-btn:hover {
    background: var(--link);
    color: #fff;
    border-color: var(--link);
}

.share-hint {
    font-size: 10px;
    color: var(--meta);
    text-align: center;
}

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.site-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 16px 48px; /* Removed 16px top padding */
}

/* ── COMPACT HEATMAP STRIP (Pill Design) ─────────────────────────────────── */
.compact-heatmap-section {
    position: relative;
    padding: 0 0 16px 0; /* Already 0 at top, keeping tight */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.treemap-container-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for clean look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.treemap-container-wrapper::-webkit-scrollbar {
    display: none;
}

.compact-heatmap-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 20px;
    flex-wrap: wrap;
}

.compact-heatmap-title {
    font: 700 10px/1 inherit;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
}

.compact-heatmap-sub {
    font-size: 10px;
    color: var(--meta);
}

.compact-mosaic {
    position: relative;
    /* overflow must be visible so the wide treemap can overflow into the scrollable parent wrapper */
    overflow: visible;
    background: var(--bg);
}

.treemap-sector {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    cursor: default;
    /* Thick border clearly delineates each ecosystem category */
    border: 2px solid rgba(0, 0, 0, 0.55);
}

.treemap-sector:hover {
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.treemap-sector-title {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 5;
    font: 700 8px/1 'Inter', sans-serif;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 5px;
    border-radius: 2px;
    pointer-events: none;
    white-space: nowrap;
}

.treemap-block {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: filter 0.15s, transform 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    border: none;
}

.treemap-block:hover {
    filter: brightness(0.85);
    z-index: 20;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.tm-ticker {
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.2px;
}

.tm-pct {
    margin-top: 3px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.9;
}

/* ── LATEST NEWS (Last 24h) ──────────────────────────────────────────────── */
.top-stories-section {
    margin-bottom: 24px;
}

.section-title {
    font: 700 15px/1 inherit;
    text-transform: uppercase;
    letter-spacing: -.2px;
}

.title-accent-subtle {
    font-size: 10px;
    font-weight: 600;
    color: var(--link);
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.news-link {
    font-weight: 500;
}

.news-item {
    margin-bottom: 6px;
}

.eco-section {
    opacity: 0.85;
}

.eco-section .block-name {
    font-size: 13px;
}

.eco-section .news-link {
    font-size: 12px;
    font-weight: 400;
}

.eco-section .inline-meta {
    font-size: 11px;
}

.eco-section .tier-header {
    padding: 8px 12px;
    margin-bottom: 8px;
}

.eco-section .tier-badge {
    font-size: 13px;
}

.top-stories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.top-stories-title {
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--divider);
}

.top-story-card {
    padding: 12px 14px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--divider-lt);
    transition: all .2s;
    position: relative;
    border-top: 1px solid var(--divider-lt);
}

.top-stories-section .top-story-card {
    border-top: 1px solid var(--divider-lt);
    position: relative;
    padding-bottom: 30px;
}

.top-story-card:first-child {
    border-top: 1px solid var(--divider-lt);
}

.top-story-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.top-story-card.new-item {
    background: var(--new-bg);
    border-left: 2px solid var(--green);
    padding-left: 10px;
}

.top-story-link {
    font: 600 14px/1.35 inherit;
    display: block;
    margin: 2px 0 4px;
}

.top-story-link:hover {
    color: var(--link-h);
    text-decoration: underline;
}

.story-summary {
    font: 400 13px/1.6 inherit;
    color: var(--meta);
    margin: 0 0 6px;
    padding: 0;
}

/* ── PINNED SECTION ──────────────────────────────────────────────────────── */
.pinned-section {
    background: #ffffff;
    border: 1px solid var(--divider);
    border-radius: 12px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.pinned-header {
    background: var(--link);
    color: #ffffff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pinned-badge {
    font: 700 15px/1 inherit;
    text-transform: uppercase;
    letter-spacing: -.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinned-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-pinned-btn,
.toggle-pinned-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font: 600 12px/1 inherit;
    color: #ffffff;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.share-pinned-btn:hover,
.toggle-pinned-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.pinned-content {
    padding: 20px;
    background: #fafafa;
}

.pinned-grid .company-block {
    border: 1px solid var(--divider);
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 12px;
    padding: 8px;
}

.pinned-grid .block-news-list .news-link {
    font-size: 12px;
    font-weight: 400;
}

.eco-section .company-block {
    border: 1px solid var(--divider) !important;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
    margin-bottom: 12px !important;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.eco-section .company-block:hover {
    border-color: var(--meta);
}

/* ── TIER HEADERS ────────────────────────────────────────────────────────── */
.tier-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--text);
    padding-bottom: 6px;
    margin-top: 10px;
    margin-bottom: 12px;
}

.tier-badge {
    font: 800 14px/1 inherit;
    text-transform: uppercase;
    letter-spacing: -.2px;
}

.tier-live-badge {
    font: 700 9px/1 inherit;
    text-transform: uppercase;
    color: var(--green);
    border: 1px solid var(--green);
    padding: 1px 5px;
    border-radius: 3px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

.tier-count {
    font: 600 10px/1 'JetBrains Mono', monospace;
    color: var(--meta);
}

.tier-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    color: var(--meta);
    margin-left: auto;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all .15s;
    min-height: 24px;
    min-width: 24px;
}

.tier-collapse-btn:hover {
    background: var(--divider-lt);
    color: var(--text);
}

/* ── ECO SUMMARY BAR ─────────────────────────────────────────────────────── */
.eco-summary-bar {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
    background: #f8fafc;
    border-left: 2px solid var(--text);
    padding: 6px 10px;
    margin-bottom: 10px;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    line-height: 1.4;
}

.eco-summary-label {
    color: #374151;
}

.news-line-wrap {
    display: block;
    line-height: 1.4;
}

.inline-meta {
    font-size: 11px;
    color: var(--meta);
    margin-left: 4px;
    white-space: nowrap;
}

.inline-meta::before {
    content: "—";
    margin-right: 4px;
    color: var(--divider);
}

.inline-meta .news-source-org {
    font-weight: 600;
}

.inline-meta .news-time {
    margin-left: 2px;
}

.inline-meta .news-time::before {
    content: "·";
    margin-right: 2px;
}

/* ── COMPANY GRIDS ───────────────────────────────────────────────────────── */
.tier-grid {
    column-gap: 32px;
}

.companies-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── COMPANY BLOCK ───────────────────────────────────────────────────────── */
.company-block {
    break-inside: avoid;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--divider-lt);
}

.company-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    position: relative;
}

.block-name {
    font: 700 13px/1 inherit;
    color: var(--text);
    letter-spacing: -.1px;
}

.block-ticker {
    font: 10px/1 'JetBrains Mono', monospace;
    color: var(--meta);
}

.block-eco-tag {
    font-size: 11px;
    color: var(--muted);
}

.private-label {
    color: #aaa;
    font-style: italic;
    font-size: 10px;
}

.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--meta);
    padding: 0;
    margin-left: 2px;
    transition: color .15s;
    outline: none;
    min-height: 24px;
    min-width: 24px;
}

.pin-btn:hover,
.pin-btn.active {
    color: var(--text);
}

.block-sec-link {
    font: 700 8px/1 'JetBrains Mono', monospace;
    color: var(--link);
}

.block-sec-link:hover {
    text-decoration: underline;
}

/* ── NEWS LIST ───────────────────────────────────────────────────────────── */
.block-news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.news-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: -4px;
}

.news-item.related {
    padding-left: 10px;
    border-left: 2px solid var(--divider);
    margin-top: 1px;
}

.news-item.new-item {
    background: var(--new-bg);
}

.news-empty {
    font-size: 11px;
    color: var(--meta);
    font-style: italic;
    padding-left: 4px;
}

.news-link {
    font: 500 14px/1.35 inherit;
    color: var(--text);
}

.news-link:hover {
    color: var(--link-h);
    text-decoration: underline;
}

.news-item.related .news-link {
    font: 500 12px/1.35 inherit;
    color: var(--muted);
}

.news-meta {
    display: flex;
    gap: 6px;
    font-size: 10px;
    align-items: center;
}

.new-dot {
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    font-size: 9px;
}

.news-source {
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
}

.news-source-org {
    color: var(--meta);
}

.news-time {
    color: var(--meta);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.news-meta {
    margin-top: 3px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.new-item-pill {
    background: #ff3b30;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.news-source-line {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

mark.search-highlight {
    background: #fef08a;
    border-radius: 2px;
    padding: 0 1px;
}

.show-more-news-btn {
    background: none;
    border: none;
    font: 600 11px/1 inherit;
    color: var(--link);
    cursor: pointer;
    text-align: left;
    padding: 4px 4px 4px 10px;
    margin-top: 2px;
}

.show-more-news-btn:hover {
    text-decoration: underline;
    color: var(--link-h);
}

.more-news-container {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.macro-stories-wrapper {
    background: var(--surface-hover);
    border-radius: 6px;
    padding: 10px;
    margin: 8px 12px;
}

.macro-header {
    font: 700 10px/1 'JetBrains Mono', monospace;
    color: var(--meta);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 16px;
}

.empty-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.empty-title {
    font: 700 16px/1 inherit;
    margin-bottom: 4px;
}

.empty-sub {
    font-size: 13px;
    color: var(--muted);
}

/* ── FULL HEATMAP (tab) ──────────────────────────────────────────────────── */
.heatmap-header {
    margin-bottom: 6px;
}

.heatmap-legend {
    display: flex;
    gap: 10px;
    font: 600 10px/1 inherit;
    margin-left: auto;
}

.heatmap-legend .legend-item.loss {
    color: var(--red);
}

.heatmap-legend .legend-item.neutral {
    color: var(--muted);
}

.heatmap-legend .legend-item.gain {
    color: var(--green);
}

.compact-heatmap-legend {
    display: flex;
    gap: 12px;
    font: 600 10px/1 inherit;
    margin-left: auto;
}

.compact-heatmap-legend .legend-loss {
    color: var(--red);
}

.compact-heatmap-legend .legend-flat {
    color: var(--muted);
}

.compact-heatmap-legend .legend-gain {
    color: var(--green);
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.heatmap-empty {
    text-align: center;
    padding: 50px 16px;
    font: 600 15px/1 inherit;
}

.heatmap-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.heatmap-section-label {
    font: 800 11px/1 inherit;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    padding: 2px 0;
    border-bottom: 2px solid var(--divider-lt);
}

.heatmap-mosaic {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.heatmap-block {
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: filter .15s, transform .1s;
    user-select: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.heatmap-block:hover {
    filter: brightness(.9);
    transform: scale(1.04);
    z-index: 2;
}

.heatmap-block-ticker {
    font: 700 9px/1.2 'JetBrains Mono', monospace;
    text-align: center;
}

.heatmap-block-pct {
    font: 600 9px/1 'JetBrains Mono', monospace;
    text-align: center;
    opacity: .9;
}

.heatmap-tooltip {
    position: fixed;
    z-index: 300;
    background: var(--text);
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    min-width: 140px;
}

.tt-name {
    font: 700 12px/1 inherit;
}

.tt-ticker {
    color: #9ca3af;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.tt-pct {
    font: 700 13px/1 inherit;
    margin-top: 2px;
}

.tt-pct.gain {
    color: #6ee7b7;
}

.tt-pct.loss {
    color: #fca5a5;
}

.tt-mcap {
    color: #d1d5db;
    font-size: 10px;
}

.tt-hint {
    color: #6b7280;
    font-size: 9px;
    margin-top: 2px;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--divider-lt);
    padding: 16px;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--meta);
    flex-wrap: wrap;
    gap: 6px;
}

.footer-link {
    color: var(--link);
    font-weight: 600;
}

.footer-link:hover {
    text-decoration: underline;
}

/* ── RESPONSIVE — DESKTOP ────────────────────────────────────────────────── */
@media (min-width: 768px) {

    .tier-grid,
    .pinned-grid {
        column-count: 2;
    }

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

    .mobile-hidden {
        display: flex !important;
    }
}

@media (min-width: 1100px) {

    .tier-grid,
    .pinned-grid {
        column-count: 3;
    }

    .top-stories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {

    .tier-grid,
    .pinned-grid {
        column-count: 4;
    }

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

/* ── RESPONSIVE — MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .header-inner {
        padding: 6px 12px;
    }

    .brand-tagline {
        display: none;
    }

    .header-time-block {
        display: none;
    }

    .mobile-filters-toggle {
        display: block;
    }

    .mobile-hidden {
        display: none;
    }

    /* Toggled by JS class removal */

    /* Make filters overlay nicely if toggled open */
    #filters-panel {
        background: var(--bg);
        border: 1px solid var(--divider);
        border-radius: 8px;
        padding: 10px;
        margin-top: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
    }

    .filter-row-label {
        min-width: 32px;
        font-size: 8px;
    }

    .filter-chip {
        font-size: 10px;
        padding: 2px 6px;
        min-height: 28px;
    }

    .search-input {
        font-size: 16px;
    }

    /* Prevent iOS zoom */
    .share-btn {
        font-size: 10px;
        padding: 6px 10px;
    }

    /* Bottom-sheet modal */
    .share-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .share-modal {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
    }

    .top-stories-grid {
        grid-template-columns: 1fr;
    }

    .tier-grid,
    .pinned-grid {
        column-count: 1;
    }

    .site-main {
        padding: 12px 10px 60px;
    }

    .eco-summary-bar {
        flex-direction: column;
        gap: 4px;
    }

    .eco-summary-label {
        min-width: unset;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .pin-btn,
    .tier-collapse-btn {
        min-height: 36px;
        min-width: 36px;
    }
}

/* ── VOTE BUTTONS ───────────────────────────────────────────────────────── */
.vote-buttons {
    position: absolute;
    bottom: 6px;
    right: 8px;
    display: flex;
    gap: 6px;
}

.vote-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    /* White-ish outline */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: color 0.2s, transform 0.1s;
}

.vote-btn:hover {
    color: #f1f5f9;
    transform: scale(1.1);
}

.vote-btn.active {
    color: #3b82f6;
    /* Blue when clicked */
}