/* ═══════════════════════════════════════════════════════════
   Competitive Intelligence Dashboard — Dark Theme
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #263548;
    --bg-sidebar: #0f172a;
    --bg-input: #334155;
    --border-color: #334155;
    --border-light: #475569;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    --accent-purple: #a855f7;
    --accent-teal: #14b8a6;

    --green-bg: rgba(34, 197, 94, 0.1);
    --red-bg: rgba(239, 68, 68, 0.1);

    --sidebar-width: 240px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

html { font-size: 14px; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout: Sidebar + Content ──────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.content {
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

/* ── Sidebar Components ─────────────────────────────────── */
.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-section { padding: 12px 0; }

.nav-label {
    display: block;
    padding: 0 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.15s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item:hover svg { opacity: 1; }

.nav-section-admin { border-top: 1px solid var(--border-color); margin-top: auto; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.last-updated {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Mobile Header & Responsive ─────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 101;
}

.mobile-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-overlay { display: block; }
    .content { margin-left: 0; padding: 68px 16px 24px; }
}

/* ── Page Header ────────────────────────────────────────── */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── KPI Cards Grid ─────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border-top: 3px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card.positive { border-top-color: var(--accent-green); }
.kpi-card.negative { border-top-color: var(--accent-red); }
.kpi-card.neutral  { border-top-color: var(--accent-blue); }

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.kpi-change {
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
}

.kpi-change.up {
    color: var(--accent-green);
    background: var(--green-bg);
}

.kpi-change.down {
    color: var(--accent-red);
    background: var(--red-bg);
}

.kpi-change.flat {
    color: var(--text-muted);
}

/* ── Card (generic container) ───────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -12px;
    margin-bottom: 16px;
}

/* ── Chart Grid (2-column) ──────────────────────────────── */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .chart-grid { grid-template-columns: 1fr; }
}

.chart-container {
    position: relative;
    height: 300px;
}

@media (max-width: 768px) {
    .chart-container { height: 200px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .chart-container { height: 250px; }
}

/* ── Section Headers ────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.section-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

/* ── Data Tables ────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead {
    background: rgba(59, 130, 246, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.12);
}

.data-table th .sort-arrow {
    margin-left: 4px;
    opacity: 0.4;
    font-size: 0.7rem;
}

.data-table th.sort-asc .sort-arrow,
.data-table th.sort-desc .sort-arrow { opacity: 1; color: var(--accent-blue); }

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--bg-card-hover);
}

/* Numeric columns: right-aligned, no-wrap (numbers shouldn't break across lines) */
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Colour-coded values */
.val-good { color: var(--accent-green); font-weight: 600; }
.val-warn { color: var(--accent-yellow); font-weight: 600; }
.val-bad  { color: var(--accent-red); font-weight: 600; }

/* ── Table Search Input ─────────────────────────────────── */
.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.table-search input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 280px;
    max-width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

.table-search input:focus {
    border-color: var(--accent-blue);
}

.table-search input::placeholder {
    color: var(--text-muted);
}

/* ── Two-column layout ──────────────────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ── Login Page ─────────────────────────────────────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-card h1 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.login-card .logo {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-blue);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}
.btn-primary:hover {
    background: #2563eb;
    text-decoration: none;
}

.btn-danger {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 6px 12px;
    font-size: 0.8rem;
}
.btn-danger:hover {
    background: var(--red-bg);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 0.8rem;
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
}

.btn-full { width: 100%; }

/* ── Alerts / Flash Messages ────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.85rem;
    border: 1px solid;
}

.alert-success {
    background: var(--green-bg);
    color: var(--accent-green);
    border-color: rgba(34, 197, 94, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.2);
}

.alert-error, .alert-danger {
    background: var(--red-bg);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

/* ── Competitor Callout ─────────────────────────────────── */
.callout {
    background: var(--bg-card);
    border-left: 4px solid var(--accent-yellow);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.callout-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.callout-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ── Token / Admin ──────────────────────────────────────── */
.token-display {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-active {
    background: var(--green-bg);
    color: var(--accent-green);
}

.badge-revoked {
    background: var(--red-bg);
    color: var(--accent-red);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.95rem;
}

/* ── Utility ────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.8rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* ── Text Truncation ───────────────────────────────────── */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Disabled / Validation States ──────────────────────── */
input:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-error { border-color: var(--accent-red) !important; }
.input-success { border-color: var(--accent-green) !important; }

/* ── Dark Scrollbars ───────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* ── Mobile sticky header offset ───────────────────────── */
@media (max-width: 768px) {
    .data-table thead { top: 0; }
    .content { scroll-padding-top: 68px; }
}

/* ═══════════════════════════════════════════════════════════
   Help System — Tooltips & Page Explainers
   ═══════════════════════════════════════════════════════════ */

/* ── Page Explainer (collapsible help banner) ─────────── */
.page-explainer {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
}

.page-explainer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 6px;
}

.page-explainer-toggle svg {
    transition: transform 0.2s;
}

.page-explainer-toggle.collapsed svg {
    transform: rotate(-90deg);
}

.page-explainer-body {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
    overflow: hidden;
    max-height: 300px;
    transition: max-height 0.3s ease;
}

.page-explainer-body.collapsed {
    max-height: 0;
}

.page-explainer-body strong {
    color: var(--text-primary);
}

/* ── Help Tooltip Icon ────────────────────────────────── */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.25);
    color: var(--text-muted);
    font-size: 0.55rem;
    font-weight: 700;
    font-style: italic;
    margin-left: 5px;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}

/* ── Help Tooltip Bubble ──────────────────────────────── */
.help-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.help-tip::after {
    content: attr(data-help);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.5;
    width: max-content;
    max-width: 280px;
    white-space: normal;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}

/* Arrow pointing down */
.help-tip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-light);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
}

.help-tip:hover::after,
.help-tip:hover::before,
.help-tip.active::after,
.help-tip.active::before {
    opacity: 1;
    visibility: visible;
}

/* Table headers: tooltip goes BELOW to avoid clipping */
.data-table th .help-tip::after {
    bottom: auto;
    top: calc(100% + 10px);
}

.data-table th .help-tip::before {
    bottom: auto;
    top: calc(100% + 4px);
    border-top-color: transparent;
    border-bottom-color: var(--border-light);
}

/* ── Responsive tooltip adjustments ───────────────────── */
@media (max-width: 768px) {
    .help-tip::after {
        max-width: 220px;
        font-size: 0.78rem;
        left: 0;
        transform: none;
    }
    .help-tip::before {
        left: 12px;
        transform: none;
    }
    .page-explainer {
        padding: 12px 14px;
    }
    .page-explainer-body {
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   Intelligence Overview — Programmatic Insights Panel
   ═══════════════════════════════════════════════════════════ */

.insights-overview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.insights-headline {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.insights-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    flex-shrink: 0;
    margin-top: 2px;
}

.insights-headline-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
}

.insights-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.insights-column {
    border-radius: var(--radius);
    padding: 16px;
}

.insights-working {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.insights-attention {
    background: rgba(234, 179, 8, 0.06);
    border: 1px solid rgba(234, 179, 8, 0.15);
}

.insights-opportunities {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.insights-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

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

.dot-green  { background: var(--accent-green); }
.dot-amber  { background: var(--accent-yellow); }
.dot-blue   { background: var(--accent-blue); }

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

.insights-list li {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.insights-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── Insights mobile ────────────────────────────────── */
@media (max-width: 768px) {
    .insights-overview {
        padding: 16px;
        margin-bottom: 16px;
    }
    .insights-headline-text {
        font-size: 0.95rem;
    }
    .insights-columns {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .insights-column {
        padding: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Mobile Chart Responsiveness
   ═══════════════════════════════════════════════════════════ */

/* Charts scroll horizontally on mobile instead of squishing */
@media (max-width: 768px) {
    .chart-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Inner wrapper added by JS — sets a minimum width so bars
       don't collapse to unreadable slivers */
    .chart-container .chart-scroll-inner {
        min-width: 500px;
        height: 280px;
    }

    /* Doughnut / pie charts don't need horizontal scroll */
    .chart-container.chart-no-scroll {
        overflow-x: visible;
    }
    .chart-container.chart-no-scroll .chart-scroll-inner {
        min-width: 0;
    }

    /* Chart grid stacks vertically on mobile */
    .chart-grid {
        grid-template-columns: 1fr;
    }

    /* Swipe hint — fades out after first interaction */
    .chart-swipe-hint {
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-muted);
        padding: 4px 0 0;
        opacity: 1;
        transition: opacity 0.5s;
    }
    .chart-swipe-hint.hidden {
        opacity: 0;
    }
}
