/* ── Modal overlay (shared by both modals) ─────────────────── */

#modal-custom,
#modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #ffffff;
    border: 1px solid #ccc;
    padding: 20px 24px;
    min-width: 260px;
    max-width: 340px;
    width: 100%;
}

.modal-box h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #111;
}

.modal-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.modal-row label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
}

.modal-row select,
.modal-row input[type="text"] {
    font-family: system-ui, sans-serif;
    font-size: 13px;
    color: #111;
    border: 1px solid #ccc;
    background: #fff;
    padding: 5px 8px;
    border-radius: 2px;
    outline: none;
    width: 100%;
}
.modal-row select:focus,
.modal-row input:focus {
    border-color: #999;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 6px;
}

.modal-actions button {
    padding: 5px 16px;
}

#modal-ok {
    background: #111;
    color: #fff;
    border-color: #111;
}
#modal-ok:hover { background: #333; }

/* ── AI Prompts modal ───────────────────────────────────────── */

#modal-ai-prompts {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box-wide {
    min-width: 340px;
    max-width: 680px;
    width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 18px;
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ai-modal-header h3 { margin: 0; }

#ai-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #777;
    padding: 2px 6px;
    line-height: 1;
}
#ai-modal-close:hover { color: #111; }

.ai-modal-intro {
    font-size: 12px;
    color: #555;
    margin: 0 0 12px;
    line-height: 1.5;
}

.ai-prompt-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#ai-prompt-text {
    flex: 1;
    width: 100%;
    min-height: 320px;
    max-height: 52vh;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.55;
    color: #222;
    background: #fafafa;
    border: 1px solid #ddd;
    padding: 10px 12px;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.ai-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.ai-copy-feedback {
    font-size: 12px;
    color: #2e7d32;
    font-weight: 600;
}

#ai-copy-btn {
    background: #111;
    color: #fff;
    border-color: #111;
    padding: 6px 20px;
    font-size: 13px;
}
#ai-copy-btn:hover { background: #333; }

.btn-ai {
    background: #1a237e;
    color: #fff;
    border-color: #1a237e;
    font-weight: 600;
}
.btn-ai:hover { background: #283593; border-color: #283593; }
