/* Token Autocomplete — inline popup for [[ variable insertion */

.token-ac-popup {
    position: fixed;
    z-index: 10000;
    min-width: 280px;
    max-width: 400px;
    background: var(--theme-card-bg, #1e2130);
    border: 1px solid var(--theme-border, #333);
    border-radius: var(--theme-radius, 6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 4px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow: hidden;
}

.token-ac-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.token-ac-hint {
    padding: 4px 10px;
    color: var(--theme-text-muted, #888);
    font-size: 0.65rem;
    border-bottom: 1px solid var(--theme-border, #333);
    margin-bottom: 2px;
    border-radius: calc(var(--theme-radius, 6px) - 2px) calc(var(--theme-radius, 6px) - 2px) 0 0;
}

.token-ac-category {
    padding: 4px 12px 2px;
    color: var(--theme-text-muted, #888);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 4px;
}

.token-ac-item {
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
    border-radius: calc(var(--theme-radius, 6px) - 2px);
}

.token-ac-item:hover,
.token-ac-item.selected {
    background: var(--theme-primary, #4ea8de);
    color: #fff;
}

.token-ac-item.selected .token-ac-desc,
.token-ac-item:hover .token-ac-desc {
    color: rgba(255, 255, 255, 0.7);
}

.token-ac-token {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--theme-accent, #a78bfa);
}

.token-ac-item.selected .token-ac-token,
.token-ac-item:hover .token-ac-token {
    color: #fff;
}

.token-ac-desc {
    color: var(--theme-text-muted, #888);
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.token-ac-empty {
    padding: 12px;
    text-align: center;
    color: var(--theme-text-muted, #888);
    font-size: 0.75rem;
}

.token-ac-badge {
    font-size: 0.55rem;
    padding: 1px 5px;
    border-radius: calc(var(--theme-radius, 6px) / 2);
    background: var(--theme-offset, #a78bfa);
    color: var(--theme-text-on-offset, #fff);
    white-space: nowrap;
}
