/*
 * Corrector ortográfico: subrayado ondulado, panel de revisión y cuadro de
 * sinónimos.
 *
 * El subrayado no se pinta con `text-decoration` sobre el texto: se dibuja en
 * una capa propia (`.layer-spell`) a partir de los rectángulos que calcula
 * `review/spellcheck.js`. Así el render del texto no cambia —y no hay que
 * partir los runs por palabra— y el subrayado aparece y desaparece sin
 * recomponer la diapositiva.
 *
 * La onda es una imagen SVG en línea repetida en horizontal: mantiene el mismo
 * grosor a cualquier zoom porque la capa se escala con la diapositiva.
 */

.layer-spell {
    z-index: 4;
}

.spell-mark {
    position: absolute;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2.2 L1.5 0.6 L3 2.2 L4.5 0.6 L6 2.2' fill='none' stroke='%23C00000' stroke-width='0.9' stroke-linecap='round'/></svg>");
    background-repeat: repeat-x;
    background-position: left bottom;
    background-size: 6px 3px;
    pointer-events: none;
}

/* ---------- Menú contextual de la palabra ---------- */

/* Las sugerencias van en negrita, como en PowerPoint, para distinguirlas de
   las acciones del menú. */
.ctxmenu--spell .ctxmenu__item--suggestion {
    font-weight: 600;
}

/* ---------- Panel de revisión ---------- */

.spell-pane {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
    background: var(--ppt-panel-bg);
    border-left: 1px solid var(--ppt-border);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
    font-family: var(--ppt-font-ui);
    font-size: var(--ppt-font-size-ui);
    color: var(--ppt-text);
    pointer-events: auto;
}

.spell-pane__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 8px 0 12px;
    border-bottom: 1px solid var(--ppt-border-soft);
}

.spell-pane__title {
    font-size: 14px;
    font-weight: 600;
}

.spell-pane__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.spell-pane__word {
    font-size: 16px;
    font-weight: 600;
    color: var(--ppt-spell-error);
    word-break: break-word;
}

.spell-pane__context {
    margin: 4px 0 14px;
    color: var(--ppt-text-muted);
    line-height: 1.4;
}

.spell-pane__label {
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--ppt-text-2);
}

.spell-pane__list {
    border: 1px solid var(--ppt-border);
    border-radius: 2px;
    max-height: 180px;
    overflow-y: auto;
}

.spell-pane__item {
    display: block;
    width: 100%;
    padding: 5px 10px;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.spell-pane__item:hover { background: var(--ppt-hover-solid); }

.spell-pane__item.is-selected {
    background: var(--ppt-text-selection);
}

.spell-pane__empty {
    padding: 6px 10px;
    color: var(--ppt-text-muted);
}

.spell-pane__status {
    margin-top: 10px;
    color: var(--ppt-text-muted);
}

.spell-pane__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid var(--ppt-border-soft);
}

/* "Agregar" ocupa la fila entera: cierra el grupo de acciones. */
.spell-pane__footer .btn:last-child {
    grid-column: 1 / -1;
}

/* ---------- Cuadro de sinónimos ---------- */

.dialog--thesaurus {
    width: 320px;
}

.thesaurus__lemma {
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}

.thesaurus__list {
    border: 1px solid var(--ppt-border);
    border-radius: 2px;
    max-height: 220px;
    overflow-y: auto;
}

.thesaurus__item {
    display: block;
    width: 100%;
    padding: 5px 10px;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.thesaurus__item:hover { background: var(--ppt-hover-solid); }
.thesaurus__item.is-selected { background: var(--ppt-text-selection); }

.thesaurus__empty {
    margin: 6px 0 0;
    color: var(--ppt-text-muted);
}
