/*!
 * FoundationsEditor styles. All rules scoped under `.fnd-editor` or under
 * globally-namespaced modifiers (`.fnd-editor__overlay`, `.fnd-editor__dialog`,
 * `.fnd-editor__cell-toolbar`) that live outside the editor container.
 *
 * Palette matches Themis: #0066d4, #033266, #EAF4FF.
 */

.fnd-editor {
    box-sizing: border-box;
    border: 1px solid #708090;
    background: #ffffff;
    font-family: Verdana, Arial, Tahoma, sans-serif;
    font-size: 12px;
    color: #24435f;
    width: 100%;
}

.fnd-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px;
    background: #eaf4ff;
    border-bottom: 1px solid #708090;
}

.fnd-editor__toolbar-group {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    border-right: 1px solid #cfd8e3;
}

    .fnd-editor__toolbar-group:last-child {
        border-right: none;
    }

.fnd-editor__separator {
    display: inline-block;
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: #cfd8e3;
}

.fnd-editor__button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0 1px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    color: #033266;
    line-height: 1;
}

    .fnd-editor__button:hover {
        background: #ffffff;
        border-color: #0066d4;
    }

.fnd-editor__button--active {
    background: #ffffff;
    border-color: #033266;
    box-shadow: inset 0 0 0 1px #033266;
}

.fnd-editor__button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.fnd-editor__button--primary {
    background: #0066d4;
    color: #ffffff;
    border-color: #033266;
    padding: 4px 12px;
    width: auto;
    height: auto;
}

    .fnd-editor__button--primary:hover {
        background: #033266;
    }

.fnd-editor__paste-hint {
    padding: 4px 8px;
    background: #033266;
    color: #ffffff;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

.fnd-editor__surface {
    min-height: 100px;
    padding: 8px;
    outline: none;
    overflow: auto;
    line-height: 1.4;
    font-size: small;
    font-family: Verdana, Arial, Tahoma, "Times New Roman", sans-serif;
    color: #033266;
}

    .fnd-editor__surface:focus {
        background: #ffffff;
    }

    .fnd-editor__surface p {
        margin: 0 0 0.5em 0;
    }

.fnd-editor__surface li {
    font-size: small;
    line-height: 1.4;
}


    /* Tables inside the editor */

    .fnd-editor__surface table.fnd-editor__table,
    .fnd-editor__surface table {
        border-collapse: collapse;
        border-style: solid;
        margin: 4px 0;
    }

        .fnd-editor__surface table th,
        .fnd-editor__surface table td {
            border: 1px solid #708090;
            padding: 4px 6px;
            vertical-align: top;
            min-width: 24px;
        }

        .fnd-editor__surface table th {
            background: #eaf4ff;
            font-weight: bold;
        }

/* Dialogs and overlays */

.fnd-editor__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    font-family: Verdana, Arial, Tahoma, sans-serif;
    font-size: 12px;
    color: #24435f;
}

.fnd-editor__dialog {
    background: #ffffff;
    border: 1px solid #033266;
    border-radius: 4px;
    padding: 16px;
    min-width: 320px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fnd-editor__dialog--spellcheck {
    min-width: 520px;
}

.fnd-editor__dialog-title {
    font-weight: bold;
    color: #033266;
    border-bottom: 1px solid #cfd8e3;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.fnd-editor__dialog label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fnd-editor__dialog input[type="text"],
.fnd-editor__dialog input[type="url"],
.fnd-editor__dialog input[type="number"] {
    flex: 1;
    padding: 4px 6px;
    border: 1px solid #708090;
    border-radius: 2px;
    font: inherit;
}

.fnd-editor__dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #cfd8e3;
}

    .fnd-editor__dialog-buttons button {
        padding: 4px 12px;
        border: 1px solid #708090;
        background: #eaf4ff;
        color: #033266;
        border-radius: 2px;
        cursor: pointer;
        font: inherit;
    }

        .fnd-editor__dialog-buttons button:hover {
            background: #ffffff;
            border-color: #033266;
        }

/* Floating cell toolbar (table editing) */

.fnd-editor__cell-toolbar {
    position: absolute;
    display: inline-flex;
    background: #033266;
    border-radius: 3px;
    padding: 2px;
    z-index: 9999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

    .fnd-editor__cell-toolbar .fnd-editor__button {
        color: #ffffff;
        background: transparent;
        border-color: transparent;
        width: auto;
        height: 22px;
        padding: 0 6px;
        font-size: 11px;
    }

        .fnd-editor__cell-toolbar .fnd-editor__button:hover {
            background: #0066d4;
            border-color: #ffffff;
        }
