.ek-annotation-host {
    margin: -2px 0 14px;
    padding-right: 4px;
    position: relative;
}

.ek-annotation-trigger {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ek-annotation-trigger-ink, #4f4438);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    opacity: 1;
    padding: 3px 6px;
    transition: opacity .16s ease, color .16s ease, background .16s ease;
    border-radius: 999px;
    font-weight: 700;
}

[data-ek-annotation-block]:hover + .ek-annotation-host .ek-annotation-trigger,
.ek-annotation-trigger:focus-visible,
.ek-annotation-trigger.has-items {
    opacity: 1;
    color: #8a611c;
    background: #faf4e8;
}

.ek-annotation-thread {
    display: grid;
    gap: 7px;
    margin-top: 5px;
    max-width: 760px;
}

.ek-annotation-card {
    border-right: 2px solid #c4a05f;
    background: #fbf8f1;
    border-radius: 0 9px 9px 0;
    padding: 7px 10px 8px;
    color: #243445;
}

.ek-annotation-card.is-private_note {
    border-right-color: #7692a5;
    background: #f3f7f9;
}

.ek-annotation-card.is-issue_report {
    border-right-color: #b27665;
    background: #fbf4f1;
}

.ek-annotation-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 9px;
    font-size: 11px;
    color: #776d60;
    margin-bottom: 3px;
}

.ek-annotation-card__meta strong {
    color: #26394a;
    font-size: 12px;
}

.ek-annotation-card__meta span:not(.ek-annotation-card__status) {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(114, 96, 65, .07);
}

.ek-annotation-card__status {
    color: #865b27;
}

.ek-annotation-card__body,
.ek-learning__body .ek-annotation-card__body {
    margin: 0;
    font-size: 13px;
    line-height: 1.85;
    color: #334455;
}

.ek-annotation-card__category {
    display: inline-block;
    margin-top: 5px;
    color: #855f50;
}

.ek-annotation-card__review,
.ek-learning__body .ek-annotation-card__review {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px dashed #d8c4b9;
    font-size: 12px;
    color: #6b564d;
}

.ek-annotation-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.ek-annotation-card__actions button {
    appearance: none;
    border: 0;
    background: transparent;
    color: #6f6559;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    padding: 2px 0;
}

.ek-annotation-card__actions button.is-danger {
    color: #995747;
}

.ek-annotation-composer {
    margin-top: 7px;
    max-width: 760px;
    border: 1px solid #ddd1bd;
    background: #fffdf9;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(44, 36, 23, .06);
}

.ek-annotation-composer__title {
    display: block;
    margin-bottom: 8px;
    color: #24384b;
    font-size: 13px;
}

.ek-annotation-composer__types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.ek-annotation-composer__types button {
    appearance: none;
    border: 1px solid #ddd1bd;
    background: #fff;
    color: #675c4e;
    cursor: pointer;
    border-radius: 999px;
    padding: 5px 9px;
    font: inherit;
    font-size: 11px;
}

.ek-annotation-composer__types button.is-active {
    background: #17334d;
    border-color: #17334d;
    color: #fff;
}

.ek-annotation-composer__issue {
    display: grid;
    grid-template-columns: auto minmax(160px, 240px);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #62594d;
}

.ek-annotation-composer__issue select,
.ek-annotation-composer textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d9cfbf;
    border-radius: 9px;
    background: #fff;
    color: #22364a;
    font: inherit;
}

.ek-annotation-composer__issue select {
    padding: 6px 8px;
}

.ek-annotation-composer textarea {
    min-height: 92px;
    resize: vertical;
    padding: 8px 10px;
    line-height: 1.8;
}

.ek-annotation-composer__help {
    display: block;
    color: #7c7265;
    margin-top: 6px;
    font-size: 11px;
}

.ek-annotation-composer__help.is-error {
    color: #9a473a;
}

.ek-annotation-composer__actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 8px;
}

.ek-annotation-composer__actions button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    padding: 7px 11px;
}

.ek-annotation-composer__actions .is-primary {
    background: #17334d;
    color: #fff;
}

.ek-annotation-composer__actions .is-ghost {
    background: #f2eee7;
    color: #62584c;
}

@media (max-width: 720px) {
    .ek-annotation-trigger {
        opacity: .72;
        padding-inline: 3px;
    }

    .ek-annotation-thread,
    .ek-annotation-composer {
        max-width: 100%;
    }

    .ek-annotation-card {
        padding: 7px 8px;
    }

    .ek-annotation-composer__issue {
        grid-template-columns: 1fr;
    }
}


/* EKHTEBAR_ANNOTATION_EDIT_DELETE_V1_3 */
.ek-annotation-card__actions {
    opacity: .72;
    transition: opacity .15s ease;
}

.ek-annotation-card:hover .ek-annotation-card__actions,
.ek-annotation-card:focus-within .ek-annotation-card__actions {
    opacity: 1;
}

.ek-annotation-card__actions button {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 3px 7px;
    line-height: 1.5;
}

.ek-annotation-card__actions button.is-edit {
    color: #5f6e78;
    background: #f3f6f7;
    border-color: #e1e7ea;
}

.ek-annotation-card__actions button.is-danger {
    color: #934f42;
    background: #fbf1ef;
    border-color: #f0dcd7;
}

.ek-annotation-card__actions button:hover,
.ek-annotation-card__actions button:focus-visible {
    filter: brightness(.98);
    text-decoration: none;
}

@media (max-width: 720px) {
    .ek-annotation-card__actions {
        opacity: 1;
    }
}


/* EKHTEBAR_ANNOTATION_CONFIRM_MODAL_V1_4 */
body.ek-annotation-modal-open {
    overflow: hidden;
}

.ek-annotation-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(14, 27, 39, .52);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .16s ease;
}

.ek-annotation-modal.is-visible {
    opacity: 1;
}

.ek-annotation-modal__dialog {
    width: min(430px, 100%);
    background: #fffdfa;
    color: #203448;
    border: 1px solid #ded3c2;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 24px 70px rgba(13, 27, 40, .26);
    transform: translateY(6px) scale(.985);
    transition: transform .16s ease;
    direction: rtl;
}

.ek-annotation-modal.is-visible .ek-annotation-modal__dialog {
    transform: translateY(0) scale(1);
}

.ek-annotation-modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ek-annotation-modal__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f8e8e4;
    color: #9b4f40;
    font-weight: 800;
    font-size: 16px;
}

.ek-annotation-modal__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #1d3347;
}

.ek-annotation-modal__message {
    margin: 0;
    color: #675f55;
    font-size: 13px;
    line-height: 1.9;
}

.ek-annotation-modal__actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 18px;
}

.ek-annotation-modal__actions button {
    appearance: none;
    border-radius: 10px;
    min-width: 96px;
    padding: 8px 13px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    transition: transform .12s ease, box-shadow .12s ease;
}

.ek-annotation-modal__actions button:focus-visible {
    outline: 3px solid rgba(28, 77, 112, .18);
    outline-offset: 2px;
}

.ek-annotation-modal__cancel {
    border: 1px solid #ddd3c5;
    background: #f7f3ec;
    color: #62594e;
}

.ek-annotation-modal__confirm {
    border: 1px solid #183852;
    background: #183852;
    color: #fff;
}

.ek-annotation-modal__confirm.is-danger {
    border-color: #9c5547;
    background: #9c5547;
}

.ek-annotation-modal__actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(21, 34, 45, .08);
}

@media (max-width: 560px) {
    .ek-annotation-modal {
        align-items: end;
        padding: 12px;
    }

    .ek-annotation-modal__dialog {
        width: 100%;
        border-radius: 18px 18px 14px 14px;
        padding: 16px;
    }

    .ek-annotation-modal__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ek-annotation-modal__actions button {
        width: 100%;
        min-width: 0;
    }
}


/* EKHTEBAR_ANNOTATION_GUIDE_V1_6 */
.ek-annotation-guide-launcher {
    appearance: none;
    border: 0;
    background: transparent;
    color: #7a6a55;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    padding: 4px 7px;
    margin-top: 6px;
    border-radius: 999px;
    transition: background .15s ease, color .15s ease;
}

.ek-annotation-guide-launcher:hover,
.ek-annotation-guide-launcher:focus-visible {
    color: #7b5318;
    background: #faf4e8;
}

.ek-annotation-guide {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    margin: 2px 0 18px;
    padding: 11px 12px;
    border: 1px solid #e6dac5;
    border-radius: 13px;
    background: linear-gradient(
        135deg,
        #fffdf8 0%,
        #faf6ed 100%
    );
    color: #344556;
    box-shadow: 0 7px 22px rgba(42, 34, 23, .045);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease;
}

.ek-annotation-guide.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ek-annotation-guide__icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #17334d;
    color: #fff;
    font-size: 15px;
}

.ek-annotation-guide__title {
    display: block;
    color: #21384c;
    font-size: 13px;
    line-height: 1.7;
}

.ek-annotation-guide__text,
.ek-learning__body + .ek-annotation-guide__text {
    margin: 2px 0 7px;
    color: #71685c;
    font-size: 12px;
    line-height: 1.8;
}

.ek-annotation-guide__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ek-annotation-guide__chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.55;
    border: 1px solid transparent;
}

.ek-annotation-guide__chip.is-public {
    color: #795719;
    background: #fbf4e5;
    border-color: #ebd9b3;
}

.ek-annotation-guide__chip.is-private {
    color: #4c6b7c;
    background: #f1f6f8;
    border-color: #d7e4e9;
}

.ek-annotation-guide__chip.is-report {
    color: #895747;
    background: #faf1ee;
    border-color: #ead6d0;
}

.ek-annotation-guide__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #6f6559;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    white-space: nowrap;
    padding: 5px 7px;
    border-radius: 8px;
}

.ek-annotation-guide__close:hover,
.ek-annotation-guide__close:focus-visible {
    background: rgba(116, 95, 64, .07);
    color: #3f5263;
}

@media (max-width: 720px) {
    .ek-annotation-guide {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .ek-annotation-guide__close {
        grid-column: 2;
        justify-self: start;
        padding-inline: 0;
    }

    .ek-annotation-guide__chips {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/*
 * EKHTEBAR_ANNOTATION_PLAINTEXT_STRUCTURE
 *
 * Annotation bodies are deliberately stored and rendered as plain
 * text. Preserve author-entered paragraphs and line breaks without
 * allowing user-controlled HTML execution.
 */
.ek-annotation-card__body,
.ek-learning__body .ek-annotation-card__body,
.ek-annotation-card__review,
.ek-learning__body .ek-annotation-card__review {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.95 !important;
    text-align: start;
}

/*
 * Give the author enough space to write structured notes.
 * The textarea itself already preserves newline characters.
 */
.ek-annotation-composer textarea {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.9;
    min-height: 150px;
    resize: vertical;
}

