/*
 * The shared (i) help tip of the non-AI-usage pages (help texts as tooltips, 2026-10-22; App\Support\HelpTip,
 * <x-sl-tip>, public/js/sitelyns-tip.js). A 24px button around a 15px icon (the negative margin keeps the line as it
 * was); its text shows on hover, keyboard focus or a tap (.is-open) and hides again after Esc (.is-dismissed) until the
 * pointer or the focus leaves. Only .sl-tip* class names: the generic tooltip classes are styled by Bootstrap, app.css
 * and the clients' own page CSS. Colours from variables so a layout can theme it.
 */
.sl-tip {
    --sl-tip-bg: #11233b;
    --sl-tip-fg: #fff;
    --sl-tip-icon: #6b7280;
    --sl-tip-icon-hover: #11233b;
    --sl-tip-focus: #2563eb;
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    font-style: normal;
}
.sl-tip__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -4.5px -4.5px -4.5px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--sl-tip-icon);
    font: inherit;
    line-height: 1;
    cursor: help;
}
.sl-tip__btn:hover,
.sl-tip.is-open .sl-tip__btn { color: var(--sl-tip-icon-hover); }
.sl-tip__btn:focus { outline: none; }
.sl-tip__btn:focus-visible { outline: 2px solid var(--sl-tip-focus); outline-offset: 0; }
.sl-tip__btn svg { width: 15px; height: 15px; }
/* the text: above its (i) by default; sitelyns-tip.js places it on the screen (position: fixed) when it shows */
.sl-tip__text {
    position: absolute;
    z-index: 1080;
    left: 50%;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: min(300px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--sl-tip-bg);
    color: var(--sl-tip-fg);
    box-shadow: 0 6px 18px rgba(16, 24, 40, .18);
    font-size: 12.5px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease;
}
/* a tip with points (HelpTip::html $points; the score cards, 2026-10-23): a title, the description, then the points below a
   divider */
.sl-tip--rich .sl-tip__text { max-width: min(340px, calc(100vw - 16px)); padding: 10px 12px; }
.sl-tip__title { display: block; margin: 0 0 4px; font-weight: 600; }
.sl-tip__p { display: block; }
.sl-tip__list { display: block; }
.sl-tip__p + .sl-tip__list { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .2); }
.sl-tip__item { display: block; position: relative; padding-left: 12px; }
.sl-tip__item + .sl-tip__item { margin-top: 4px; }
.sl-tip__item::before { content: ""; position: absolute; left: 1px; top: .6em; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .75; }
/* a closing line after the points (HelpTip::html $after; the Source code audit Start card, qa200) */
.sl-tip__list + .sl-tip__after { margin-top: 8px; }
/* the gap between the text and its (i): the pointer can move onto the text without closing it */
.sl-tip__text::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.sl-tip.is-below .sl-tip__text::after { top: auto; bottom: 100%; }
.sl-tip:is(:hover, :focus-within, .is-open):not(.is-dismissed) .sl-tip__text { opacity: 1; visibility: visible; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
    .sl-tip__text { transition: none; }
}
@media print {
    .sl-tip { display: none; }
}

/*
 * The popover mode (qa200 fix round 3, the user 2026-11-27: the Source code audit Start card's help = option d2-popover of
 * storage/app/claude-work/source-audit/lang/tip-ux; App\Support\HelpTip::popButton / popPanel, <x-sl-pop-button> / <x-sl-pop>): the
 * (i) opens a click / tap / Enter / Space popover (popover="auto", role dialog) under its heading. Only new .sl-pop* class names: the
 * shared tip's rules above stay as they are. Tokens from sitelyns-account.css (--sla-*) and sitelyns-source-audit.css (--scx-panel),
 * with fallbacks for other pages. The script (sitelyns-tip.js, window.slPop) sets top, left, width and max-height (.is-placed).
 */
/* the trigger: the same 24px (i), a pointer (it opens something), a soft fill while open */
.sl-pop { position: relative; display: inline-flex; vertical-align: middle; font-style: normal; }
.sl-pop__btn {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
    margin: -4.5px -4.5px -4.5px 0; padding: 0; border: 0; border-radius: 50%; background: none;
    color: #6b7280; font: inherit; line-height: 1; cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.sl-pop__btn svg { width: 15px; height: 15px; }
.sl-pop__btn:hover { color: #11233b; }
.sl-pop__btn:focus { outline: none; }
.sl-pop__btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 0; }
.sl-pop__btn[aria-expanded="true"] { background: var(--sla-soft, #fff1ea); color: var(--sla-btn-bg, #d84006); }

/* the (i)'s name on hover or keyboard focus (only the name, as the other short tips look): hoverable (the gap is bridged),
   dismissed with Esc (.is-dismissed, set by the script), hidden while the popover is open */
.sl-pop__name {
    position: absolute; z-index: 1080; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    width: max-content; max-width: min(260px, calc(100vw - 16px)); padding: 6px 10px; border-radius: 6px;
    background: #11233b; color: #fff; box-shadow: 0 6px 18px rgba(16, 24, 40, .18);
    font-family: var(--sla-font-body, system-ui, sans-serif); font-size: 12.5px; font-weight: 400; font-style: normal;
    line-height: 1.45; letter-spacing: normal; text-align: left; text-transform: none; white-space: nowrap;
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease;
}
.sl-pop__name::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
@media (hover: hover) {
    .sl-pop:hover:not(.is-dismissed, :has(> [aria-expanded="true"])) .sl-pop__name { opacity: 1; visibility: visible; pointer-events: auto; }
}
.sl-pop:has(> .sl-pop__btn:focus-visible):not(.is-dismissed, :has(> [aria-expanded="true"])) .sl-pop__name {
    opacity: 1; visibility: visible; pointer-events: auto;
}

/* the panel. Never set display here: the browser hides a closed popover with display: none. Without the script it opens as the
   browser places a popover (centred, fixed); the script adds .is-placed: under the heading, as high as the room left on the
   screen, its own scroll. 640px wide on a desktop (the user 2026-11-27), the screen less 16px a side on a phone. */
.sl-pop__panel {
    box-sizing: border-box; position: fixed; inset: 0; width: min(640px, calc(100vw - 32px)); height: fit-content;
    max-height: calc(100vh - 32px); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain;
    border: 1px solid var(--sla-hairline, rgba(17, 35, 59, .12)); border-top: 3px solid var(--sla-accent, #f05a22);
    border-radius: 12px; background: #fff; color: var(--sla-text, #26262b);
    box-shadow: 0 18px 48px rgba(17, 35, 59, .18), 0 2px 8px rgba(17, 35, 59, .08);
    font-family: var(--sla-font-body, system-ui, sans-serif); font-size: 16px; font-weight: 400; line-height: 1.5;
    text-align: left; scroll-padding-top: 56px;
    /* a soft shade at the bottom edge while more text is below (the white cover scrolls with the text, the shade does not) */
    background:
        linear-gradient(rgba(255, 255, 255, 0), #fff 75%) bottom / 100% 28px no-repeat local,
        radial-gradient(farthest-side at 50% 100%, rgba(17, 35, 59, .2), rgba(17, 35, 59, 0)) bottom / 100% 10px no-repeat scroll,
        #fff;
}
.sl-pop__panel.is-placed { position: absolute; inset: auto; margin: 0; }
.sl-pop__panel:focus { outline: none; }
.sl-pop__panel:focus-visible { outline: 3px solid var(--sla-focus, #b93506); outline-offset: 2px; }

/* the head stays at the top while the text scrolls: the title (names the dialog) and the close button */
.sl-pop__head {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 12px 10px 28px; border-bottom: 1px solid var(--sla-hairline, rgba(17, 35, 59, .12)); background: #fff;
}
.sl-pop__panel .sl-pop__title {
    flex: 1 1 auto; min-width: 0; margin: 4px 0 0; padding: 0;
    font-family: var(--sla-font-display, system-ui, sans-serif) !important; font-size: 18px; font-weight: 700; line-height: 1.3;
    color: var(--sla-navy, #11233b);
}
.sl-pop__panel .sl-pop__close {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0;
    padding: 0; border: 0; border-radius: 8px; background: none; color: var(--sla-muted, #3d3d44); cursor: pointer;
}
.sl-pop__panel .sl-pop__close:hover { background: rgba(17, 35, 59, .06); color: var(--sla-navy, #11233b); }
.sl-pop__panel .sl-pop__close:focus { outline: none; }
.sl-pop__panel .sl-pop__close:focus-visible { outline: 3px solid var(--sla-focus, #b93506); outline-offset: -1px; }
.sl-pop__close svg { width: 18px; height: 18px; }

/* the sections: a small label, then short points; What we check and You get first (the at-a-glance part). At 640px the 16px text
   and the side padding keep a line at about 80 characters or less (judge-ux M4) */
.sl-pop__body { padding: 2px 28px 18px; }
.sl-pop__sec { margin: 0; padding: 12px 0 0; }
.sl-pop__sec + .sl-pop__sec { margin-top: 12px; border-top: 1px solid var(--sla-hairline, rgba(17, 35, 59, .12)); }
.sl-pop__panel .sl-pop__label {
    margin: 0 0 6px; padding: 0; font-family: var(--sla-font-body, system-ui, sans-serif) !important; font-size: 12px;
    font-weight: 700; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; color: var(--sla-muted, #3d3d44);
}
.sl-pop__panel .sl-pop__list { margin: 0; padding: 0; list-style: none; }
.sl-pop__panel .sl-pop__list li {
    position: relative; margin: 0; padding: 0 0 0 16px; color: var(--sla-text, #26262b); font-size: 16px; line-height: 1.5;
    overflow-wrap: anywhere;
}
.sl-pop__panel .sl-pop__list li + li { margin-top: 5px; }
.sl-pop__list li::before {
    content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%;
    background: var(--sla-accent, #f05a22);
}
/* You get: the reports, ticked in the "ok" green (as the Completed badges) */
.sl-pop__sec--get .sl-pop__list li { padding-left: 20px; font-weight: 600; color: var(--sla-navy, #11233b); }
.sl-pop__sec--get .sl-pop__list li::before {
    left: 3px; top: .28em; width: 6px; height: 11px; border: solid var(--sla-ok, #146c43); border-width: 0 2.5px 2.5px 0;
    border-radius: 0; background: none; transform: rotate(45deg);
}
/* the closing Source line, on the card's panel grey */
.sl-pop__panel .sl-pop__foot {
    margin: 14px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--scx-panel, #f6f7f9);
    color: var(--sla-text, #26262b); font-size: 15px; line-height: 1.5;
}
.sl-pop__foot .sl-pop__k { font-weight: 700; color: var(--sla-navy, #11233b); }

/* a phone: the full width less 16px each side (the script), a little tighter */
@media (max-width: 575.98px) {
    .sl-pop__head { padding: 10px 6px 8px 16px; }
    .sl-pop__panel .sl-pop__title { font-size: 16.5px; }
    .sl-pop__body { padding: 2px 16px 14px; }
    .sl-pop__panel .sl-pop__list li { font-size: 14px; }
}

/* a browser without popovers (before Chrome / Edge 114, Safari 17, Firefox 125): no (i); the text shows as a plain box */
@supports not selector(:popover-open) {
    .sl-pop { display: none; }
    .sl-pop__panel { position: static; width: auto; max-height: none; margin: 14px 0 0; box-shadow: none; }
}
@media (prefers-reduced-motion: no-preference) {
    .sl-pop__panel:popover-open { animation: sl-pop-in .14s ease-out; }
}
@keyframes sl-pop-in { from { opacity: 0; transform: translateY(-4px); } }
@media (forced-colors: active) {
    .sl-pop__panel { border: 1px solid CanvasText; }
    .sl-pop__head { border-bottom-color: CanvasText; }
    .sl-pop__list li::before { forced-color-adjust: none; background: CanvasText; }
    .sl-pop__sec--get .sl-pop__list li::before { background: none; border-color: CanvasText; }
    .sl-pop__btn[aria-expanded="true"] { outline: 1px solid CanvasText; }
    .sl-pop__name { border: 1px solid CanvasText; }
    .sl-pop__btn:focus-visible, .sl-pop__panel:focus-visible, .sl-pop__panel .sl-pop__close:focus-visible { outline-color: Highlight; }
}
@media print {
    .sl-pop, .sl-pop__panel { display: none !important; }
}
