/* The rich Quick Note: the editor the sender types into, and the note as a reader sees it.
   One file for both, because the two have to look like the same thing - what you typed is
   what lands in the email. */

.rich-note {
    max-width: 600px;
    border: 1px solid #000;
    border-radius: 6px;
    background: #fff;
}

    .rich-note.is-focused {
        box-shadow: 0 0 8px rgba(0, 150, 255, 0.55);
    }

    /* A refused send. The counter alone was too quiet to explain why nothing happened. */
    .rich-note.is-over-limit {
        border-color: #c0392b;
        box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
    }

/* The palette hangs off a button, so the toolbar cannot be a clipping box - which is why the
   container no longer hides its overflow, and the toolbar rounds its own top corners instead
   of borrowing the container's. */
.rich-note-toolbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #f6f7f9;
    border-bottom: 1px solid #dcdfe4;
    border-radius: 5px 5px 0 0;
}

.rich-note-swatches {
    position: absolute;
    top: 100%;
    left: 6px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 24px);
    gap: 6px;
    margin-top: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #d0d4da;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* The font and size lists. Same dropdown as the palette, laid out as rows rather than a grid,
   with each row set in the face or size it applies. */
.rich-note-menu {
    position: absolute;
    top: 100%;
    left: 6px;
    z-index: 20;
    min-width: 150px;

    /* Tall enough for all eight faces without a scrollbar - a list this short should not need
       scrolling to see its last item. Capped anyway, for a short viewport. */
    max-height: 340px;
    overflow-y: auto;
    margin-top: 4px;
    padding: 4px;
    background: #fff;
    border: 1px solid #d0d4da;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.rich-note-menu-item {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #212529;
    text-align: left;
    line-height: 1.3;
    cursor: pointer;
}

    .rich-note-menu-item:hover {
        background: #eaf2fd;
    }

.rich-note-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.25);
    border-radius: 4px;
    cursor: pointer;
}

    .rich-note-swatch:hover {
        outline: 2px solid #1a5fb4;
        outline-offset: 1px;
    }

    /* "None", for taking a highlight back off. A red stroke across white says removal in a way
       an empty square does not. */
    .rich-note-swatch.is-none {
        background: linear-gradient(to top right,
            #fff 0%, #fff 45%, #c0392b 45%, #c0392b 55%, #fff 55%, #fff 100%);
    }

.rich-note-btn {
    min-width: 30px;
    height: 28px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #444;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

    .rich-note-btn:hover {
        background: #e6e9ee;
        border-color: #d0d4da;
    }

    /* Bold stays lit while the caret is inside bold text - the toolbar reports state, it is
       not just a row of switches you press blind. */
    .rich-note-btn.is-active {
        background: #dce9fb;
        border-color: #9dc3f0;
        color: #0b5cad;
    }

    .rich-note-btn:disabled {
        opacity: 0.45;
        cursor: default;
    }

.rich-note-sep {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: #d0d4da;
}

.rich-note-editor {
    min-height: 96px;
    max-height: 420px;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    outline: none;
    word-break: break-word;
}

    /* contenteditable has no placeholder attribute; this is the whole trick. */
    .rich-note-editor:empty::before,
    .rich-note-editor.is-blank::before {
        content: attr(data-placeholder);
        color: #8b9098;
        pointer-events: none;
    }

    .rich-note-editor ul,
    .rich-note-editor ol {
        margin: 6px 0;
        padding-left: 26px;
    }

    .rich-note-editor a {
        color: #0066cc;
    }

    .rich-note-editor p {
        margin: 0 0 8px;
    }

.rich-note-foot {
    border-radius: 0 0 5px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 10px;
    background: #fafbfc;
    border-top: 1px solid #eceef1;
    font-size: 0.78rem;
    color: #777;
}

.rich-note-count.is-over {
    color: #c0392b;
    font-weight: 700;
}

.rich-note-status {
    font-style: italic;
}

    .rich-note-status.is-error {
        color: #c0392b;
        font-style: normal;
        font-weight: 600;
    }
