/**
 * Global HTML tooltips (see static/js/app-tooltip.js).
 * Dark surface by default, readable rich content, arrow per placement.
 */
.app-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483000;
    max-width: min(360px, calc(100vw - 16px));
    padding: 7px 10px;
    border-radius: 6px;
    background: #202124;
    color: #fff;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.app-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

.app-tooltip__arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #202124;
    border-radius: 1px;
    transform: rotate(45deg);
    pointer-events: none;
}

.app-tooltip[data-placement="top"] .app-tooltip__arrow {
    left: var(--tooltip-arrow-x, 50%);
    bottom: -4px;
    transform: translateX(-50%) rotate(45deg);
}

.app-tooltip[data-placement="bottom"] .app-tooltip__arrow {
    left: var(--tooltip-arrow-x, 50%);
    top: -4px;
    transform: translateX(-50%) rotate(45deg);
}

.app-tooltip[data-placement="left"] .app-tooltip__arrow {
    top: var(--tooltip-arrow-y, 50%);
    right: -4px;
    transform: translateY(-50%) rotate(45deg);
}

.app-tooltip[data-placement="right"] .app-tooltip__arrow {
    top: var(--tooltip-arrow-y, 50%);
    left: -4px;
    transform: translateY(-50%) rotate(45deg);
}

.app-tooltip__content > :first-child {
    margin-top: 0;
}

.app-tooltip__content > :last-child {
    margin-bottom: 0;
}

.app-tooltip__content p {
    margin: 0 0 6px;
}

.app-tooltip__content ul,
.app-tooltip__content ol {
    margin: 0 0 6px;
    padding-left: 1.15rem;
}

.app-tooltip__content li {
    margin: 1px 0;
}

.app-tooltip__content strong,
.app-tooltip__content b {
    font-weight: 600;
    color: #fff;
}

.app-tooltip__content small {
    font-size: 11px;
    color: #d2d4d7;
}

.app-tooltip__content a {
    color: #8ab4f8;
    text-decoration: underline;
}

.app-tooltip__content code,
.app-tooltip__content kbd {
    padding: 0 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.14);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.app-tooltip__content hr {
    margin: 6px 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.app-tooltip__content table {
    width: 100%;
    border-collapse: collapse;
}

.app-tooltip__content th,
.app-tooltip__content td {
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    text-align: left;
    vertical-align: top;
}

.app-tooltip__content th {
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .app-tooltip {
        transition: none;
    }
}
