:root {
    /* Cyber Grid theme colors */
    --color-bg: #000;
    --color-surface: #0e131a;
    --color-surface-2: #121924;
    --color-border: #1a2733;
    --color-text: #dfe7ef;
    --color-text-muted: #90a3b7;
    --color-accent: #22d3ee;
    --color-accent-2: #a78bfa;

    /* Chart colors - cold tones (blue) */
    --color-bar: #c7e9ff;
    --color-bar-value: #0a0d12;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--color-surface);
    color: var(--color-text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

#chartBars {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    overflow: auto;
    scrollbar-width: none;
}

#chartBars::-webkit-scrollbar {
    display: none;
}

.bar-wrap {
    flex-shrink: 0;
}

.bar-row {
    position: relative;
    height: var(--barH, 20px);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: visible;
}

.bar-row:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(180deg,
        color-mix(in hsl, var(--color-bar) 96%, #fff 4%),
        var(--color-bar));
}

.bar-label {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--color-bar-value);
    pointer-events: none;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    max-width: 75%;
}

.bar-value {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 6px;
    font-size: 14px;
    color: var(--color-bar-value);
    font-weight: 700;
    pointer-events: none;
    padding: 0;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease, left 0.15s ease, right 0.15s ease;
    z-index: 1;
}

.bar-value.outside {
    position: absolute;
    right: auto;
}

.bar-name {
    margin-top: 4px;
    font-size: 18px;
    line-height: 1.1;
    color: var(--color-text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.bar-icon {
    position: absolute;
    width: 30px;
    height: 30px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.bar-link {
    display: block;
    position: relative;
    text-decoration: none;
}

.bar-link:hover .bar-fill {
    filter: brightness(1.08);
}

.chart-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 420px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(10, 12, 16, 0.92);
    color: var(--color-text);
    font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    white-space: pre-line;
}

.chart-tooltip.show {
    opacity: 1;
    transform: translate(-50%, -8px);
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#seoTooltipIndex {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

#seoTooltipIndex ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
