.mhg-annotation-toolbar {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

@media (hover: hover) and (pointer: fine) {
    .mhg-annotation-toolbar [data-tooltip] {
        position: relative;
    }

    .mhg-annotation-toolbar [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        right: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        background: rgba(20, 20, 20, 0.85);
        color: #f5f5f5;
        font-size: 12px;
        line-height: 1.2;
        padding: 6px 8px;
        border-radius: 8px;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 1000000;
    }

    .mhg-annotation-toolbar [data-tooltip]:hover::after,
    .mhg-annotation-toolbar [data-tooltip]:focus-visible::after {
        opacity: 1;
        visibility: visible;
    }
}

.mhg-annotation-toolbar__history {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.mhg-annotation-toolbar__frames,
.mhg-annotation-toolbar__toggle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #d8cbb8;
    background-color: #ffffff;
    color: #2b1b12;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.mhg-annotation-toolbar__text-wrap {
    position: relative;
    margin-top: 8px;
}

.mhg-annotation-toolbar__eraser,
.mhg-annotation-toolbar__pencil,
.mhg-annotation-toolbar__shape,
.mhg-annotation-toolbar__stamp,
.mhg-annotation-toolbar__move,
.mhg-annotation-toolbar__main,
.mhg-annotation-toolbar__trash,
.mhg-annotation-toolbar__export,
.mhg-annotation-toolbar__undo,
.mhg-annotation-toolbar__redo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #d8cbb8;
    background-color: #ffffff;
    color: #2b1b12;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    margin-top: 8px;
}

.mhg-annotation-toolbar__text-wrap .mhg-annotation-toolbar__toggle {
    margin-top: 0;
}

.mhg-annotation-toolbar__stamp-history {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.mhg-annotation-toolbar__stamp-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.mhg-annotation-toolbar__stamp-wrap .mhg-annotation-toolbar__stamp-history {
    margin-top: 0;
}

.mhg-annotation-toolbar__stamp-history .mhg-annotation-toolbar__stamp-primary,
.mhg-annotation-toolbar__stamp-history .mhg-annotation-toolbar__stamp-secondary {
    margin-top: 0;
}

.mhg-annotation-toolbar__stamp-history .mhg-annotation-toolbar__stamp-secondary {
    position: absolute;
    right: calc(100% + 8px);
    top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mhg-annotation-toolbar__stamp-history.is-upstroke-visible .mhg-annotation-toolbar__stamp-secondary {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mhg-annotation-toolbar__undo {
    margin-top: 0;
}

.mhg-annotation-toolbar__redo {
    position: absolute;
    right: calc(100% + 8px);
    top: 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mhg-annotation-toolbar__history.is-redo-visible .mhg-annotation-toolbar__redo {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mhg-annotation-toolbar__pencil-wrap {
    position: relative;
    margin-top: 8px;
}

.mhg-annotation-toolbar__shape-wrap {
    position: relative;
    margin-top: 8px;
}

.mhg-annotation-toolbar__pencil-wrap .mhg-annotation-toolbar__pencil {
    margin-top: 0;
}

.mhg-annotation-toolbar__icon {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.mhg-annotation-toolbar__toggle:hover,
.mhg-annotation-toolbar__frames:hover,
.mhg-annotation-toolbar__eraser:hover,
.mhg-annotation-toolbar__pencil:hover,
.mhg-annotation-toolbar__shape:hover,
.mhg-annotation-toolbar__move:hover,
.mhg-annotation-toolbar__main:hover,
.mhg-annotation-toolbar__trash:hover,
.mhg-annotation-toolbar__export:hover,
.mhg-annotation-toolbar__undo:hover,
.mhg-annotation-toolbar__redo:hover {
    background-color: #f2f2f2;
}

.mhg-annotation-toolbar__stamp:hover {
    background-color: #ffffff;
}

.mhg-annotation-toolbar__undo:active,
.mhg-annotation-toolbar__redo:active,
.mhg-annotation-toolbar__frames:active {
    background-color: #f2e6d0;
    border-color: #d8cbb8;
}

.mhg-annotation-toolbar__stamp:active {
    background-color: #f2e6d0;
    border-color: #d8cbb8;
}

.mhg-annotation-toolbar__export:active {
    background-color: #f2e6d0;
    border-color: #d8cbb8;
}

.mhg-annotation-toolbar__eraser.is-active,
.mhg-annotation-toolbar__pencil.is-active,
.mhg-annotation-toolbar__shape.is-active,
.mhg-annotation-toolbar__move.is-active,
.mhg-annotation-toolbar__main.is-active,
.mhg-annotation-toolbar__stamp.is-active,
.mhg-annotation-toolbar__frames.is-active {
    background-color: #f2e6d0;
    border-color: #d8cbb8;
}

.mhg-annotation-toolbar.is-text-active .mhg-annotation-toolbar__toggle {
    background-color: #f2e6d0;
    border-color: #d8cbb8;
}

.mhg-annotation-toolbar.is-collapsed > :not(.mhg-annotation-toolbar__frames) {
    display: none;
}

.mhg-annotation-toolbar__undo.is-disabled,
.mhg-annotation-toolbar__redo.is-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.mhg-annotation-toolbar__export {
    margin-top: 16px;
}

.mhg-annotation-toolbar__panel {
    position: absolute;
    right: 100%;
    top: 0;
    margin-right: 10px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid #3a2a21;
    background: #f5e7cf;
    color: #2f1e14;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
    display: none;
    height: 44px;
    box-sizing: border-box;
    align-items: center;
    gap: 10px;
}

.mhg-annotation-toolbar.is-open .mhg-annotation-toolbar__panel--text {
    display: flex;
}

.mhg-annotation-toolbar.is-pencil-active .mhg-annotation-toolbar__panel--pencil {
    display: flex;
}

.mhg-annotation-toolbar.is-shape-active .mhg-annotation-toolbar__panel--shape {
    display: flex;
}

.mhg-annotation-toolbar.is-stamp-active .mhg-annotation-toolbar__panel--stamp {
    display: flex;
}

.mhg-annotation-toolbar__panel--pencil {
    top: 0;
}

.mhg-annotation-toolbar__panel--shape {
    top: 0;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px;
}

.mhg-annotation-toolbar__panel--stamp {
    top: 0;
    right: calc(100% + 52px);
}

.mhg-annotation-toolbar__group--colors,
.mhg-annotation-toolbar__group--sizes {
    gap: 6px;
}

.mhg-annotation-toolbar__group--shape-colors {
    flex-direction: column;
    gap: 6px;
}

.mhg-annotation-toolbar__color-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #c9b38d;
    background: #fff8ea;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.mhg-annotation-toolbar__color-dot.is-active,
.mhg-annotation-toolbar__size-chip.is-active {
    border-color: #5b3a26;
    box-shadow: 0 0 0 2px rgba(91, 58, 38, 0.25);
}

.mhg-annotation-toolbar__size-chip {
    min-width: 34px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #c9b38d;
    background: #fff8ea;
    color: #2f1e14;
    font-size: 12px;
    padding: 0 6px;
    cursor: pointer;
}

.mhg-annotation-toolbar__size-chip:hover,
.mhg-annotation-toolbar__color-dot:hover {
    border-color: #5b3a26;
}

.mhg-annotation-toolbar__group {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mhg-annotation-toolbar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mhg-annotation-toolbar__input {
    width: 64px;
    height: 32px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid #c9b38d;
    background: #fff8ea;
    color: #2f1e14;
    box-sizing: border-box;
}

.mhg-annotation-toolbar__styles {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mhg-annotation-toolbar__styles input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mhg-annotation-toolbar__style-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mhg-annotation-toolbar__style-toggle span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #c9b38d;
    background: #fff8ea;
    color: #2f1e14;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.mhg-annotation-toolbar__style-toggle input:checked + span {
    background: #5b3a26;
    color: #f5e7cf;
    border-color: #5b3a26;
    box-shadow: 0 4px 10px rgba(91, 58, 38, 0.35);
}
