/* =============================================================================
   Range styles shared by the public Range Viewer and the private single-range
   viewer. Grid/cell layout now lives in `range-viewer.css` + `range-editor.css`;
   this file only keeps the hover tooltip and the legend-item pills rendered
   dynamically by `range-viewer-public.js` and `range-viewer.js`.
   ============================================================================= */

/* Legend (action pills next to the grid) */
.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--pk-text-secondary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-placeholder {
    color: var(--pk-text-muted);
    font-size: 0.85rem;
}

/* Floating Tooltip (rendered on cell hover/click) */
.cell-tooltip {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    min-width: 180px;
    max-width: 240px;
}

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

.cell-tooltip .tooltip-header {
    background: var(--pk-accent);
    padding: 0.5rem 0.75rem;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cell-tooltip .tooltip-combo {
    font-family: var(--pk-font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--md-white);
    letter-spacing: 0.5px;
}

.cell-tooltip .tooltip-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cell-tooltip .tooltip-body {
    background: var(--pk-container);
    border: 1px solid var(--pk-container-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 0.6rem 0.75rem;
}

.cell-tooltip .tooltip-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: var(--pk-background);
}

.cell-tooltip .tooltip-bar-segment {
    height: 100%;
}

.cell-tooltip .tooltip-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cell-tooltip .tooltip-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.cell-tooltip .tooltip-action-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--pk-text-secondary);
}

.cell-tooltip .tooltip-action-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.cell-tooltip .tooltip-action-pct {
    font-family: var(--pk-font-mono);
    font-weight: 600;
    color: var(--pk-text-primary);
}

.cell-tooltip .tooltip-freq {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--pk-container-border);
    font-size: 0.7rem;
    color: var(--pk-text-muted);
    text-align: center;
}

.cell-tooltip .tooltip-empty {
    color: var(--pk-text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 0.25rem 0;
}

@media (max-width: 600px) {
    .cell-tooltip {
        min-width: 160px;
        max-width: 200px;
    }
}
