.spice-hover-text[data-spice-hover] {
    position: relative;
    display: inline;
    cursor: help;
    border-bottom: 1px dotted currentColor;
    text-decoration: none;
}

.spice-hover-text[data-spice-hover]::before,
.spice-hover-text[data-spice-hover]::after {
    position: absolute;
    left: 50%;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.spice-hover-text[data-spice-hover]::before {
    content: attr(data-spice-hover);
    bottom: calc(100% + 11px);
    width: max-content;
    max-width: min(340px, 80vw);
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(35, 38, 41, .97);
    color: #fff;
    box-shadow: 0 10px 32px rgba(0,0,0,.18);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    white-space: normal;
}

.spice-hover-text[data-spice-hover]::after {
    content: '';
    bottom: calc(100% + 5px);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(35, 38, 41, .97);
}

.spice-hover-text[data-spice-hover]:hover::before,
.spice-hover-text[data-spice-hover]:hover::after,
.spice-hover-text[data-spice-hover]:focus::before,
.spice-hover-text[data-spice-hover]:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.spice-hover-toolbar-label {
    display: inline-block;
    min-width: 40px;
    padding: 0 2px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .01em;
}

.spice-hover-format-popover .components-popover__content {
    min-width: 320px;
}

.spice-hover-format-panel {
    width: 320px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 16px;
}

.spice-hover-format-panel__title {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.spice-hover-format-panel__help {
    margin: 0 0 12px;
    color: #646970;
    font-size: 12px;
    line-height: 1.45;
}

.spice-hover-format-panel__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* On the frontend a body-level tooltip avoids clipping by rounded/overflow-hidden SPICE cards. */
.spice-hover-runtime-ready .spice-hover-text[data-spice-hover]::before,
.spice-hover-runtime-ready .spice-hover-text[data-spice-hover]::after {
    content: none;
    display: none;
}

.spice-hover-floating-tooltip {
    position: fixed;
    z-index: 2147483000;
    width: max-content;
    max-width: min(340px, calc(100vw - 24px));
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(35, 38, 41, .97);
    color: #fff;
    box-shadow: 0 10px 32px rgba(0,0,0,.18);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease;
}

.spice-hover-floating-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}
