/* Walkthrough player styles. Adapted from the Guincoin walkthrough
 * pattern: SVG-mask spotlight (click-through to the target), tooltip
 * positioned per step, mobile bottom-sheet at <640px, full a11y for
 * keyboard + reduced motion users.
 */

/* -------- SVG overlay -------- */
.walkthrough-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9990;
    /* Allow clicks on the spotlit element (the mask cutout has no
     * painted fill, so visiblePainted misses it) while still capturing
     * clicks on the dim area to dampen accidental interactions outside
     * the highlighted control. */
    pointer-events: none;
}
.walkthrough-overlay rect[mask] {
    transition: none;
}

/* -------- Tooltip dialog (desktop) -------- */
.walkthrough-tooltip {
    position: fixed;
    background: #fff;
    color: #1a1a2e;
    border-radius: 8px;
    padding: 14px 16px 12px;
    width: 320px;
    max-width: calc(100vw - 24px);
    /* Tighter, more "callout"-feeling shadow than the bottom-sheet's
     * dramatic top-shadow, plus an accent border-top so the tooltip
     * reads as a guided-tour element, not a generic card. */
    border-top: 3px solid #fcb040;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    font-size: 14px;
    line-height: 1.45;
    transition: top 0.18s ease, left 0.18s ease;
}
.walkthrough-tooltip:focus { outline: none; }
.walkthrough-tooltip__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.walkthrough-tooltip__title {
    font-size: 15px;
    color: #1a1a2e;
}
.walkthrough-tooltip__counter {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.walkthrough-tooltip__body p {
    margin: 0 0 8px;
}
.walkthrough-tooltip__body p:last-child {
    margin-bottom: 0;
}
.walkthrough-tooltip__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.walkthrough-tooltip__actions .btn {
    padding: 6px 12px;
    font-size: 13px;
}
.walkthrough-tooltip__primary {
    background: #fcb040;
    color: #1a1a2e;
    border: none;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
}
.walkthrough-tooltip__primary:focus-visible {
    outline: 2px solid #1a1a2e;
    outline-offset: 2px;
}

/* -------- Mobile bottom-sheet variant (only at <640px) -------- */
.walkthrough-tooltip--sheet {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    width: 100%;
    max-width: 100%;
    border-top: 3px solid #fcb040;
    border-radius: 12px 12px 0 0;
    padding: 18px 18px 22px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
}

/* -------- Bottom-right "Take the tour" prompt -------- */
.walkthrough-prompt {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    width: 320px;
    max-width: calc(100vw - 24px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    z-index: 9988;
    font-size: 14px;
}
.walkthrough-prompt__sub {
    color: #ccc;
    font-size: 13px;
    margin-top: 4px;
    line-height: 1.4;
}
.walkthrough-prompt__actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
}
.walkthrough-prompt .btn {
    background: #fcb040;
    color: #1a1a2e;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}
.walkthrough-prompt .btn-link {
    background: transparent;
    color: #ccc;
}
@media (max-width: 640px) {
    .walkthrough-prompt {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* -------- Reduced motion: drop transitions, drop scroll smoothness -------- */
@media (prefers-reduced-motion: reduce) {
    .walkthrough-tooltip { transition: none; }
}

/* -------- Admin step editor (unchanged) -------- */
.walkthrough-step-editor-row {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.walkthrough-step-editor-row .row-grid {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 100px 100px;
    gap: 10px;
    align-items: start;
}
.walkthrough-step-editor-row textarea,
.walkthrough-step-editor-row input,
.walkthrough-step-editor-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}
.walkthrough-step-editor-row textarea {
    min-height: 44px;
    resize: vertical;
}
.walkthrough-step-editor-row label {
    font-size: 11px;
    color: #666;
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.walkthrough-step-editor-row .row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}

/* [2026-07-07 Shane] The house palette's [data-palette="house"] .btn rule
   turned the tour's primary CTA navy-on-navy (unreadable Next/Finish).
   walkthrough.css loads after theme.css, so these equal-specificity
   overrides win and restore the gold primary in both palettes. */
[data-palette="house"] .walkthrough-tooltip__primary,
.walkthrough-tooltip .walkthrough-tooltip__primary {
    background: var(--nx-gold, #fcb040);
    color: var(--nx-on-accent, #1a1a2e);
}
[data-palette="house"] .walkthrough-tooltip__primary:hover,
.walkthrough-tooltip .walkthrough-tooltip__primary:hover {
    background: var(--nx-gold-bright, #ffd27a);
    color: var(--nx-on-accent, #1a1a2e);
}
