/* ==========================================================================
   BBW Prime — User Guide (feature tour)
   Loaded on every shell page by templates/partials/sidebar.php. Two pieces:
   the trigger that sits beside the top-bar brand, and the stepper dialog.
   Built on the shared tokens so it inherits the shell's typography; nothing
   here overrides a page's own styles.
   ========================================================================== */

/* ---- Trigger ------------------------------------------------------------ */
.bbw-guide-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--bbw-border, #e2e7ee);
    border-radius: 10px;
    background: var(--bbw-surface, #ffffff);
    color: var(--bbw-ink, #0b1526);
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .1px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.bbw-guide-trigger:hover {
    border-color: var(--bbw-blue, #1e56e0);
    color: var(--bbw-blue, #1e56e0);
    background: #f4f7ff;
}
.bbw-guide-trigger:focus-visible {
    outline: 3px solid rgba(30, 86, 224, .35);
    outline-offset: 2px;
}
.bbw-guide-trigger-ico { font-size: 14px; line-height: 1; }
.bbw-guide-trigger-help { display: none; font-size: 15px; font-weight: 900; line-height: 1; }
@media (max-width: 640px) {
    .bbw-guide-trigger { padding: 0 9px; }
    .bbw-guide-trigger-label { display: none; }
    /* Label-less, a compass reads as decoration; "?" reads as help. */
    .bbw-guide-trigger-ico { display: none; }
    .bbw-guide-trigger-help { display: inline; }
}

/* ---- Overlay ------------------------------------------------------------ */
.bbw-guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(11, 21, 38, .55);
}
.bbw-guide-overlay[hidden] { display: none; }
body.bbw-guide-open { overflow: hidden; }
/* The floating "Ask" pill would otherwise sit on top of the dialog. */
body.bbw-guide-open .bbw-ask-fab { display: none !important; }

/* ---- Dialog ------------------------------------------------------------- */
.bbw-guide {
    display: flex;
    width: 100%;
    max-width: 900px;
    max-height: min(88vh, 760px);
    background: var(--bbw-surface, #ffffff);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(11, 21, 38, .28);
    overflow: hidden;
    outline: none;
}

/* ---- Chapter rail ------------------------------------------------------- */
.bbw-guide-rail {
    width: 236px;
    flex: 0 0 236px;
    display: flex;
    flex-direction: column;
    background: var(--bbw-surface-2, #f7f9fb);
    border-right: 1px solid var(--bbw-border, #e2e7ee);
}
.bbw-guide-rail-head {
    padding: 18px 16px 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--bbw-ink, #0b1526);
    letter-spacing: -.1px;
}
.bbw-guide-rail-sub {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--bbw-ink-3-text, #5c6b80);
}
.bbw-guide-rail-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bbw-guide-chapter {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--bbw-ink-2, #46556c);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.bbw-guide-chapter:hover { background: #eef2f8; color: var(--bbw-ink, #0b1526); }
.bbw-guide-chapter.is-active {
    background: var(--bbw-blue, #1e56e0);
    color: #ffffff;
}
.bbw-guide-chapter:focus-visible { outline: 2px solid var(--bbw-blue, #1e56e0); outline-offset: 1px; }
.bbw-guide-chapter-ico { font-size: 13px; line-height: 1; }
.bbw-guide-rail-foot {
    padding: 10px 16px 16px;
    border-top: 1px solid var(--bbw-border, #e2e7ee);
}
.bbw-guide-restart {
    border: none;
    background: none;
    padding: 0;
    color: var(--bbw-blue, #1e56e0);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---- Main pane ---------------------------------------------------------- */
.bbw-guide-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.bbw-guide-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 0;
}
.bbw-guide-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--bbw-blue, #1e56e0);
}
.bbw-guide-close {
    border: none;
    background: none;
    padding: 4px 6px;
    font-size: 22px;
    line-height: 1;
    color: var(--bbw-ink-3-text, #5c6b80);
    cursor: pointer;
    border-radius: 6px;
}
.bbw-guide-close:hover { color: var(--bbw-ink, #0b1526); }
.bbw-guide-close:focus-visible { outline: 2px solid var(--bbw-blue, #1e56e0); outline-offset: 2px; }

.bbw-guide-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 22px 18px;
}
.bbw-guide-ico {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eef3ff;
    font-size: 21px;
    margin: 6px 0 12px;
}
.bbw-guide-title {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--bbw-ink, #0b1526);
}
.bbw-guide-lede {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--bbw-ink-2, #46556c);
}
.bbw-guide-points {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.bbw-guide-points li {
    position: relative;
    padding-left: 24px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--bbw-ink, #0b1526);
}
.bbw-guide-points li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bbw-blue, #1e56e0);
}
.bbw-guide-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--bbw-blue, #1e56e0);
    text-decoration: none;
    border: 1px solid #cdd9f5;
    background: #f4f7ff;
    border-radius: 9px;
    padding: 8px 12px;
}
.bbw-guide-open:hover { background: #e8efff; }
.bbw-guide-open:focus-visible { outline: 3px solid rgba(30, 86, 224, .35); outline-offset: 2px; }

/* ---- Footer ------------------------------------------------------------- */
.bbw-guide-foot {
    padding: 12px 22px 18px;
    border-top: 1px solid var(--bbw-border, #e2e7ee);
    background: var(--bbw-surface, #ffffff);
}
.bbw-guide-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.bbw-guide-bar {
    flex: 1 1 auto;
    height: 5px;
    border-radius: 99px;
    background: #e6ebf2;
    overflow: hidden;
}
.bbw-guide-bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #1e56e0, #3b82f6);
    transition: width .2s ease;
}
.bbw-guide-count {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--bbw-ink-3-text, #5c6b80);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.bbw-guide-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bbw-guide-actions .bbw-guide-spacer { flex: 1 1 auto; }
.bbw-guide-btn {
    border: 1px solid var(--bbw-border, #e2e7ee);
    background: var(--bbw-surface, #ffffff);
    color: var(--bbw-ink, #0b1526);
    border-radius: 10px;
    padding: 9px 16px;
    min-height: 40px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
}
.bbw-guide-btn:hover { border-color: #c3cdde; background: var(--bbw-surface-2, #f7f9fb); }
.bbw-guide-btn[disabled] { opacity: .45; cursor: default; }
.bbw-guide-btn--primary {
    border-color: var(--bbw-blue, #1e56e0);
    background: var(--bbw-blue, #1e56e0);
    color: #ffffff;
}
.bbw-guide-btn--primary:hover { background: #1a4bc4; border-color: #1a4bc4; }
.bbw-guide-btn:focus-visible { outline: 3px solid rgba(30, 86, 224, .35); outline-offset: 2px; }
.bbw-guide-legal {
    margin: 10px 0 0;
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--bbw-ink-3-text, #5c6b80);
}

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 760px) {
    .bbw-guide-overlay { padding: 0; }
    .bbw-guide {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
    }
    .bbw-guide-rail { display: none; }
    .bbw-guide-head { padding: 16px 16px 0; }
    .bbw-guide-body { padding: 8px 16px 16px; }
    .bbw-guide-foot { padding: 10px 16px 14px; }
    /* thumb-sized targets: the footer buttons are the only way through the tour */
    .bbw-guide-btn { min-height: 44px; flex: 0 0 auto; }
    .bbw-guide-actions { gap: 10px; }
    .bbw-guide-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .bbw-guide-bar i { transition: none; }
    .bbw-guide-trigger { transition: none; }
}
