/* The admin's tooltip (design-system/row-tip.js): the same dark bubble with a pointer the course page puts under
   its fact marks, one for the whole screen, placed beside whichever element opened it. First the course list's
   row marks; the ClickHouse export's outcomes since item 259; the course page's cut words since item 684, where the
   admin's radius token is not loaded (hence its fallback). */
.cil-rowtip {
    position: fixed;
    z-index: 300;
    max-width: 280px;
    padding: 9px 12px;
    border-radius: var(--cil-radius-sm, 8px);
    background: var(--cil-rowtip-bg, var(--cil-black));
    color: var(--cil-white);
    font-size: 13px;
    line-height: 1.35;
    text-align: start;
    /* A note written on several lines keeps them (the journey's links, item 604); spaces still fold as in a sentence. */
    white-space: pre-line;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}
.cil-rowtip[hidden] { display: none; }
/* Open, the note takes the pointer, so it can be hovered and read or selected (row-tip.js keeps it open). */
.cil-rowtip.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* A machine's words (an error as the system gave it): wider, kept as written, read left to right. */
.cil-rowtip.is-raw {
    max-width: min(460px, calc(100vw - 16px));
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* A long note (words cut with "…" shown whole): wider and a size larger (no inner scroll, which would clip its
   pointer; the longest local summary, 378 characters, takes five to six). On the course hero, whose ground is the bubble's own grey, it takes the course page's darker tip (facts.css) and an edge. */
.cil-rowtip.is-wide {
    --cil-rowtip-bg: var(--cil-black-dark-4);
    box-shadow: 0 0 0 1px var(--cil-black-regular-9);
    max-width: min(440px, calc(100vw - 16px));
    font-size: 14px;
    line-height: 1.45;
}

/* The pointer down to the mark, or up to it when the bubble had to sit underneath. */
.cil-rowtip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: var(--cil-rowtip-arrow, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--cil-rowtip-bg, var(--cil-black));
}
.cil-rowtip.is-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--cil-rowtip-bg, var(--cil-black));
}

@media (prefers-reduced-motion: reduce) {
    .cil-rowtip { transition: none; transform: none; }
    .cil-rowtip.is-open { transform: none; }
}
