/* Tutorial step player — uses site design tokens */
.tut-intro { padding: var(--space-sm) 0 var(--space-md); }
.tut-intro.panel { padding: var(--space-xl) var(--space-lg) var(--space-2xl); }
.tut-intro__tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--accent-soft);
    border: 1px solid rgba(10, 132, 255, .15);
    text-decoration: none !important;
}
.tut-intro__tag:hover { color: var(--primary-hover); }
.tut-intro__tag--soft {
    color: var(--text-secondary);
    background: var(--surface);
    border-color: var(--border);
}
.tut-intro__tag--soft:hover {
    color: var(--primary);
    border-color: rgba(10, 132, 255, .25);
    background: var(--accent-soft);
}
.tut-intro__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}
.tut-intro__title {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.15rem);
    font-weight: 800;
    line-height: 1.28;
    color: var(--text-primary);
}
.tut-intro__excerpt {
    margin: var(--space-md) auto 0;
    max-width: 62ch;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
}

/* Prep cards grid */
.tut-prep-grid {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    text-align: right;
}
@media (min-width: 720px) {
    .tut-prep-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}
.tut-prep-card {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(165deg, rgba(255,255,255,.98) 0%, var(--surface-secondary) 100%);
    box-shadow: var(--shadow-soft);
}
.tut-prep-card__head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.tut-prep-card__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1;
}
.tut-prep-card__icon--prereq { background: rgba(10, 132, 255, .12); }
.tut-prep-card__icon--req { background: rgba(48, 209, 88, .14); }
.tut-prep-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.tut-prep-card__hint {
    margin: .2rem 0 0;
    font-size: 12px;
    color: var(--text-tertiary);
}
.tut-prep-card__subtitle {
    margin: 0 0 var(--space-xs);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.tut-prep-card__group + .tut-prep-card__group {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border);
}
.tut-prep-card__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .45rem;
}
.tut-prep-card__list--ordered { counter-reset: tut-prep; }
.tut-prep-card__list--ordered .tut-prep-chip {
    counter-increment: tut-prep;
}
.tut-prep-card__list--ordered .tut-prep-chip__link::before,
.tut-prep-card__list--ordered .tut-prep-chip__body::before {
    content: counter(tut-prep);
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
}
.tut-prep-chip {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.tut-prep-chip:hover {
    border-color: rgba(10, 132, 255, .25);
    box-shadow: var(--shadow-sm);
}
.tut-prep-chip__link,
.tut-prep-chip__body {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .65rem .75rem;
    color: inherit;
    text-decoration: none;
}
.tut-prep-chip__text { flex: 1; min-width: 0; }
.tut-prep-chip__name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}
.tut-prep-chip__link .tut-prep-chip__name { color: var(--primary); }
.tut-prep-chip__link:hover .tut-prep-chip__name { color: var(--primary-hover); }
.tut-prep-chip__note {
    display: block;
    margin-top: .15rem;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-tertiary);
}
.tut-prep-chip__ext {
    margin-right: auto;
    margin-top: .1rem;
    font-size: .85rem;
    color: var(--text-tertiary);
    opacity: .7;
}

/* Hero */
.tut-hero {
    position: relative;
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}
.tut-hero__media { position: relative; }
.tut-hero__cover {
    display: block;
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 320px;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
}
.tut-hero__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
}
.tut-hero__body {
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
    text-align: center;
}
.tut-hero:has(.tut-hero__media) .tut-hero__body {
    position: absolute;
    inset: auto 0 0;
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
    color: #fff;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
}
.tut-hero:has(.tut-hero__media) .tut-intro__title,
.tut-hero:has(.tut-hero__media) .tut-intro__excerpt { color: #fff; }
.tut-hero:has(.tut-hero__media) .tut-intro__excerpt { opacity: .92; }
.tut-hero:has(.tut-hero__media) .tut-intro__tag {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.32);
    color: #fff;
}
.tut-hero:has(.tut-hero__media) .tut-intro__tag:hover { color: #fff; background: rgba(255,255,255,.24); }
.tut-hero:has(.tut-hero__media) .tut-badge--beginner,
.tut-hero:has(.tut-hero__media) .tut-badge--intermediate,
.tut-hero:has(.tut-hero__media) .tut-badge--advanced,
.tut-hero:has(.tut-hero__media) .tut-badge--muted {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.28);
    color: #fff;
}
.tut-hero__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
    margin-bottom: var(--space-md);
}
.tut-badge {
    display: inline-flex;
    align-items: center;
    padding: .28rem .7rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}
.tut-badge--beginner { background: rgba(48, 209, 88, .14); color: #15803d; border-color: rgba(48, 209, 88, .25); }
.tut-badge--intermediate { background: rgba(255, 159, 10, .14); color: #b45309; border-color: rgba(255, 159, 10, .28); }
.tut-badge--advanced { background: rgba(255, 69, 58, .12); color: #b91c1c; border-color: rgba(255, 69, 58, .22); }
.tut-badge--muted {
    background: var(--surface-secondary);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* Start CTA bar */
.tut-start-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(10, 132, 255, .18);
    background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(255,255,255,.95) 100%);
    box-shadow: var(--shadow-soft);
}
.tut-start-bar__info {
    display: grid;
    gap: .2rem;
    text-align: right;
}
.tut-start-bar__info strong {
    font-size: 15px;
    color: var(--text-primary);
}
.tut-start-bar__info span {
    font-size: 13px;
    color: var(--text-secondary);
}
.tut-start-bar__btn { flex-shrink: 0; }

.tut-player { max-width: 760px; margin: 0 auto; }
.tut-step-head {
    margin: 0 0 .85rem;
    font-size: .82rem;
    text-align: center;
}
.tut-step-head a {
    color: var(--text-tertiary) !important;
    text-decoration: none !important;
    font-weight: 600;
}
.tut-step-head a:hover { color: var(--primary) !important; }
.tut-progress {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--muted);
}
.tut-progress__bar {
    flex: 1;
    height: 6px;
    background: var(--surface-secondary);
    border-radius: 999px;
    overflow: hidden;
}
.tut-progress__fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--teal));
    border-radius: 999px;
    transition: width .25s ease;
}
.tut-step-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.tut-step-card__figure {
    margin: 0;
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border);
}
.tut-step-card__figure img {
    display: block;
    width: 100%;
    max-height: min(52vh, 420px);
    object-fit: contain;
    margin: 0 auto;
}
.tut-step-card__body { padding: 1.35rem 1.4rem 1.5rem; }
.tut-step-card__label {
    margin: 0 0 .35rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .03em;
    text-transform: uppercase;
}
.tut-step-card__title {
    margin: 0 0 .75rem;
    font-size: 1.3rem;
    line-height: 1.35;
    font-weight: 700;
}
.tut-step-card__text {
    margin: 0;
    line-height: 1.75;
    white-space: pre-wrap;
    font-size: .98rem;
}
.tut-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.25rem;
}
.tut-nav__group { display: flex; flex-wrap: wrap; gap: .5rem; }
.tut-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none !important;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary) !important;
    cursor: pointer;
    font-family: inherit;
    transition: transform .15s var(--ease-out), box-shadow .2s;
}
.tut-nav__btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}
.tut-nav__btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff !important;
    box-shadow: var(--primary-shadow);
}
.tut-nav__btn--primary:hover {
    background: var(--primary-hover);
    filter: none;
}
.tut-nav__btn:focus-visible {
    outline: 3px solid var(--primary-ring);
    outline-offset: 2px;
}
.tut-nav__btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}
.tut-outline {
    margin-top: 2rem;
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}
.tut-outline h2 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 700; }
.tut-outline ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .35rem;
}
.tut-outline a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .7rem;
    border-radius: 10px;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-size: 15px;
    transition: background .2s ease;
}
.tut-outline a:hover { background: var(--surface-secondary); }
.tut-outline a.is-current {
    background: var(--accent-soft);
    color: var(--primary) !important;
    font-weight: 600;
}
.tut-outline__num {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-secondary);
    font-size: .78rem;
    font-weight: 700;
}
.tut-outline a.is-current .tut-outline__num { background: var(--primary); color: #fff; }
.tut-body-intro {
    margin-top: 0;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    text-align: start;
    font-size: .95rem;
    line-height: 1.75;
}

/* Mobile — tutorial player */
@media (max-width: 768px) {
    .tut-player {
        max-width: 100%;
        padding-inline: 0;
    }
    .tut-intro.panel {
        padding: 1.15rem 1rem 1.35rem;
        border-radius: var(--radius-lg);
    }
    .tut-prep-card { padding: .85rem .95rem; }
    .tut-hero__body,
    .tut-hero:has(.tut-hero__media) .tut-hero__body {
        padding: 1rem .95rem 1.15rem;
    }
    .tut-hero__cover { max-height: 220px; aspect-ratio: 16 / 10; }
    .tut-start-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .tut-start-bar__info { text-align: center; }
    .tut-start-bar__btn { width: 100%; justify-content: center; }
    .tut-intro__title {
        font-size: 1.25rem;
    }
    .tut-progress {
        flex-wrap: wrap;
        gap: .5rem;
    }
    .tut-progress__bar {
        order: 3;
        flex: 1 1 100%;
        height: 5px;
    }
    .tut-step-card {
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }
    .tut-step-card__figure img {
        max-height: min(40vh, 320px);
    }
    .tut-step-card__body {
        padding: 1rem .95rem 1.15rem;
    }
    .tut-step-card__title {
        font-size: 1.12rem;
    }
    .tut-step-card__text {
        font-size: .92rem;
        line-height: 1.7;
    }
    .tut-nav {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 1rem -0.15rem 0;
        padding: .65rem .5rem calc(.65rem + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, .92);
        backdrop-filter: blur(14px) saturate(1.2);
        border-top: 1px solid var(--border);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .12);
        flex-direction: column;
        gap: .5rem;
    }
    .tut-nav__group {
        width: 100%;
        justify-content: stretch;
    }
    .tut-nav__group:first-child {
        order: 2;
    }
    .tut-nav__group:last-child {
        order: 1;
    }
    .tut-nav__btn {
        flex: 1;
        justify-content: center;
        padding: .6rem .75rem;
        font-size: .85rem;
        min-height: 2.75rem;
    }
    .tut-nav__btn--primary {
        flex: 1.2;
    }
    .tut-outline {
        margin-top: 1.25rem;
        padding: .95rem .85rem;
    }
    .tut-outline a {
        padding: .6rem .65rem;
        font-size: .88rem;
    }
    body:has(.tut-nav) main {
        padding-bottom: .5rem;
    }
}
