/* Double-click to edit: equations and blocks (available on all pages) */
.wiki-equation { display: inline; }
.wiki-equation-clickable { cursor: pointer; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.06); }
.wiki-equation-clickable:hover { background: rgba(0,0,0,.1); }
.wiki-equation-editable { cursor: text; }
.wiki-equation-editable:hover { background: rgba(0,0,0,.06); border-radius: 4px; }
.wiki-block-editable { cursor: text; }
.wiki-block-editable:hover { background: rgba(0,0,0,.04); border-radius: 4px; }
.wiki-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.wiki-modal.wiki-modal-open { opacity: 1; visibility: visible; }
.wiki-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.wiki-modal-content { position: relative; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.2); max-width: 640px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }
.wiki-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #eee; }
.wiki-modal-title { margin: 0; font-size: 1.1rem; }
.wiki-modal-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #666; padding: 0 .25rem; }
.wiki-modal-close:hover { color: #000; }
.wiki-modal-body { padding: 1.25rem; overflow-y: auto; line-height: 1.6; }
.wiki-modal-body .wiki-equation-rendered { display: inline-block; margin: 0 .2em; }

/* Plus button per line: visible on hover, opens AI prompt */
.wiki-block-with-ai { position: relative; }
.wiki-ai-plus-btn {
    position: absolute;
    left: -1.75rem;
    top: 0.1em;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wiki-ai-plus-btn:hover { background: #e8f4fc; color: #0d6efd; border-color: #0d6efd; }
.wiki-article .wiki-block-with-ai:hover .wiki-ai-plus-btn { opacity: 1; }
.wiki-ai-prompt {
    margin: 0.5rem 0 0.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}
.wiki-ai-prompt input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.35rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}
.wiki-ai-prompt .wiki-ai-generate-btn { white-space: nowrap; }
.wiki-ai-prompt .wiki-ai-prompt-error { color: #dc3545; font-size: 0.9rem; width: 100%; }

/* Generate page from selection: floating button */
.wiki-generate-page-btn {
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
