.ai-key-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 13, 8, 0.85);
    backdrop-filter: blur(16px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: aiKeyPromptFadeIn 0.25s ease-out;
}

.ai-key-prompt {
    background: linear-gradient(135deg, rgba(24, 34, 20, 0.95), rgba(12, 17, 10, 0.98));
    border: 1px solid rgba(200, 162, 74, 0.4);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 0 50px rgba(200, 162, 74, 0.25), 0 0 90px rgba(0, 0, 0, 0.8);
    color: #e9dfc4;
}

.ai-key-prompt__header {
    margin-bottom: 1rem;
}

.ai-key-prompt__header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #c8a24a, #7a4324);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.ai-key-prompt__description {
    font-size: 0.92rem;
    color: #a89a7d;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.ai-key-prompt__form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.ai-key-prompt__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-key-prompt__field label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #d8caa2;
}

.ai-key-prompt__field input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(200, 162, 74, 0.3);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: #e9dfc4;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-key-prompt__field input:focus {
    border-color: #c8a24a;
    box-shadow: 0 0 15px rgba(200, 162, 74, 0.3);
}

.ai-key-prompt__hint {
    font-size: 0.78rem;
    color: #8a7a5c;
}

.ai-key-prompt__hint a {
    color: #e6c877;
    text-decoration: underline;
}

.ai-key-prompt__error {
    display: none;
}

.ai-key-prompt__error:not(:empty) {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
}

.ai-key-prompt__success {
    display: none;
}

.ai-key-prompt__success:not(:empty) {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.ai-key-prompt__actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.ai-key-prompt__save {
    background: linear-gradient(135deg, #c8a24a, #e6c877);
    color: #1c2a1c;
    border: none;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(200, 162, 74, 0.4);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.ai-key-prompt__save:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.ai-key-prompt__decline {
    background: rgba(200, 162, 74, 0.08);
    border: 1px solid rgba(200, 162, 74, 0.15);
    color: #a89a7d;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-key-prompt__decline:hover {
    background: rgba(200, 162, 74, 0.15);
    color: #d8caa2;
}

.ai-key-status {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(200, 162, 74, 0.12);
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #d8caa2;
}

.ai-key-status__info {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin: -0.15rem 0;
    padding: 0;
    border: 1px solid rgba(230, 200, 119, 0.42);
    border-radius: 50%;
    background: rgba(230, 200, 119, 0.1);
    color: #e6c877;
    font: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ai-key-status__info:hover,
.ai-key-status__info:focus-visible {
    border-color: rgba(230, 200, 119, 0.8);
    background: rgba(230, 200, 119, 0.2);
    color: #f0e4c0;
    outline: none;
}

.ai-key-status__details {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    z-index: 110;
    width: min(310px, calc(100vw - 2rem));
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(230, 200, 119, 0.28);
    border-radius: 12px;
    background: rgba(18, 25, 15, 0.97);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    color: #d8caa2;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
}

.ai-key-status__details[hidden] {
    display: none;
}

.ai-key-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.ai-key-status--active .ai-key-status__dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.ai-key-status__change {
    background: transparent;
    border: 1px solid rgba(200, 162, 74, 0.4);
    color: #e6c877;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 0.3rem;
    transition: all 0.2s ease;
}

.ai-key-status__change:hover {
    background: rgba(200, 162, 74, 0.15);
}

@keyframes aiKeyPromptFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
