/* Page tutorial button + video modal.
   Colours follow the existing design system (navy chrome, single blue accent). */

.acl-tut-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .95rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.acl-tut-cta:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.acl-tut-cta:focus-visible {
    outline: 3px solid rgba(29, 78, 216, .45);
    outline-offset: 2px;
}

.acl-tut-cta .bi {
    font-size: 1.05rem;
}

.acl-tut-cta-sm {
    padding: .3rem .7rem;
    font-size: .8rem;
}

.acl-tut-cta-dur {
    color: #64748b;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */

/* The <dialog> itself is only a transparent shell: showModal() promotes it to the top
   layer, so it needs no z-index and cannot be trapped by an ancestor stacking context. */
.acl-tut-dialog-el {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acl-tut-dialog-el:not([open]) {
    display: none;
}

.acl-tut-dialog-el::backdrop {
    background: rgba(5, 11, 24, .72);
    backdrop-filter: blur(2px);
}

.acl-tut-dialog {
    margin: 2rem 1.25rem;
    width: min(1120px, 100%);
    background: #0b1220;
    color: #f8fafc;
    border: 1px solid rgba(148, 173, 217, .22);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    overflow: hidden;
    outline: none;
}

.acl-tut-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 173, 217, .18);
}

.acl-tut-heading {
    min-width: 0;
}

.acl-tut-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.acl-tut-sub {
    margin: .25rem 0 0;
    font-size: .85rem;
    color: #9aa9c2;
    line-height: 1.45;
}

.acl-tut-close {
    margin-left: auto;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(148, 173, 217, .28);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.acl-tut-close:hover {
    background: rgba(148, 173, 217, .14);
    color: #fff;
}

.acl-tut-close:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .6);
    outline-offset: 2px;
}

.acl-tut-stage {
    background: #000;
    line-height: 0;
}

.acl-tut-video {
    width: 100%;
    max-height: 68vh;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}

.acl-tut-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: .8rem 1.25rem 1rem;
}

.acl-tut-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.acl-tut-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .8rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 173, 217, .28);
    background: transparent;
    color: #e2e8f0;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

.acl-tut-btn:hover {
    background: rgba(148, 173, 217, .14);
}

.acl-tut-btn:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .6);
    outline-offset: 2px;
}

.acl-tut-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .78rem;
    color: #9aa9c2;
    flex-wrap: wrap;
}

.acl-tut-ai {
    opacity: .85;
}

/* Locking the body while the dialog is open; the scroll position is restored in JS. */
body.acl-tutorial-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .acl-tut-dialog-el {
        align-items: stretch;
    }

    .acl-tut-dialog {
        margin: 0;
        border-radius: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .acl-tut-video {
        max-height: 46vh;
    }

    .acl-tut-meta {
        margin-left: 0;
        width: 100%;
    }

    .acl-tut-cta-dur {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acl-tut-cta {
        transition: none;
    }
}
