/* ============================================================
   SINC SPORTS - Inline help (js/sinc-help.js)
   A help icon (a.sinc-help, written by web.HelpLink) opens its topic in a card (#sincHelpPop),
   under the icon, or centered near the top when the server opens it (web.HelpOpenScript).

   Its own file, not sinc-setup.css, because every master loads it and most masters do not
   load sinc-setup.css. So it stands alone: each --setup-* token carries its value as a
   fallback, and the icons are SVG masks rather than Material Design Icons, which not every
   master loads either.
   ============================================================ */

a.sinc-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 2px;
    border-radius: 50%;
    color: var(--setup-text-muted, #94a3b8);
    vertical-align: middle;
    text-decoration: none;
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
a.sinc-help:hover, a.sinc-help[aria-expanded=true] { color: var(--setup-blue, #3b82f6); background-color: var(--setup-blue-light, #eff6ff); text-decoration: none; }
a.sinc-help:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--setup-accent-glow, rgba(92, 184, 48, 0.25)); }

/* Icons: the glyph is the element's own color through an SVG mask (paths from Material Design Icons) */
.sinc-help-ico, .sinc-help-x-ico, .sinc-help-edit-ico {
    display: inline-block;
    flex: none;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}
.sinc-help-ico {
    width: 17px;
    height: 17px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z'/%3E%3C/svg%3E");
}
.sinc-help-x-ico {
    width: 18px;
    height: 18px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z'/%3E%3C/svg%3E");
}
.sinc-help-edit-ico {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z'/%3E%3C/svg%3E");
}

/* The card */
.sinc-help-pop {
    position: absolute;
    z-index: 100010;   /* above the slide-out help tab (#helpdiv, 100000), whose "...more" link opens a card */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 380px;
    max-width: calc(100vw - 16px);
    max-height: 60vh;
    background: var(--setup-card, #ffffff);
    border: 1px solid var(--setup-border, #e2e8f0);
    border-radius: var(--setup-radius, 12px);
    box-shadow: var(--setup-shadow-lg, 0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.06));
    font-family: var(--setup-font, 'DM Sans', 'Inter', system-ui, sans-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--setup-text, #1e293b);
    text-align: left;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.sinc-help-pop.open { opacity: 1; transform: none; }
/* Opened by the page itself (?iHelp=, Master.BuildHelp): a little wider, with no icon to sit under */
.sinc-help-pop.sinc-help-centered { width: 440px; }
.sinc-help-pop[hidden], .sinc-help-pop [hidden] { display: none; }
.sinc-help-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 8px 6px 16px; }
.sinc-help-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-top: 2px;
    font-family: var(--setup-font-heading, 'Outfit', 'Poppins', system-ui, sans-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--setup-primary, #0f172a);
}
.sinc-help-x {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--setup-radius-sm, 8px);
    background: transparent;
    color: var(--setup-text-secondary, #64748b);
    cursor: pointer;
    transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sinc-help-x:hover { background-color: var(--setup-border-light, #f1f5f9); color: var(--setup-text, #1e293b); }
.sinc-help-x:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--setup-accent-glow, rgba(92, 184, 48, 0.25)); }
.sinc-help-body { padding: 0 16px 14px; overflow-y: auto; overflow-wrap: anywhere; }
.sinc-help-body p { margin: 0 0 8px; }
.sinc-help-body p:last-child, .sinc-help-body ul:last-child, .sinc-help-body ol:last-child { margin-bottom: 0; }
.sinc-help-body ul, .sinc-help-body ol { margin: 0 0 8px; padding-left: 20px; }
.sinc-help-body img { max-width: 100%; height: auto; }
.sinc-help-body a { color: var(--setup-blue, #3b82f6); }
.sinc-help-note { color: var(--setup-text-secondary, #64748b); }
.sinc-help-spin {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border: 2px solid var(--setup-border, #e2e8f0);
    border-top-color: var(--setup-text-secondary, #64748b);
    border-radius: 50%;
    animation: sinc-help-spin 0.8s linear infinite;
}
@keyframes sinc-help-spin { to { transform: rotate(360deg); } }
.sinc-help-foot { padding: 8px 16px; border-top: 1px solid var(--setup-border-light, #f1f5f9); font-size: 13px; }
.sinc-help-foot a { color: var(--setup-text-secondary, #64748b); font-weight: 500; text-decoration: none; }
.sinc-help-foot a:hover { color: var(--setup-blue, #3b82f6); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
    .sinc-help-pop { transition: none; transform: none; }
    .sinc-help-spin { animation-duration: 2s; }
}
