.how-page {
    overflow-x: clip;
    color: #0f172a;
}
.how-page main {
    background: #f5f7fa;
}
.how-hero {
    padding: clamp(110px, 11vw, 154px) 0 clamp(36px, 6vw, 68px);
    border-bottom: 1px solid #e2e8f0;
    background: radial-gradient(ellipse at 85% 0%, #fff0cf, transparent 60%), #fff;
}
.how-hero h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 4.1rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -.045em;
}
.how-hero h1 span { color: #9a4108; }
.how-hero p {
    max-width: 37rem;
    margin: 1rem 0 1.35rem;
    color: #475569;
    font-size: 1rem;
    line-height: 1.65;
}
.how-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
}
.how-actions a, .how-support .btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 44px;
}
.how-link {
    color: #82400e;
    font-size: .88rem;
    font-weight: 650;
    text-underline-offset: .22em;
}
.how-link:hover { color: #572809; }
.how-page main a:focus-visible {
    outline: 2px solid #9a4108;
    outline-offset: 3px;
}
.how-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(18px, 3vw, 34px);
    padding-block: clamp(22px, 4vw, 44px) clamp(36px, 6vw, 76px);
}
.how-layout, .how-topic, #how-index-title { scroll-margin-top: 86px; }
.how-index {
    align-self: start;
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 18px;
    background: #fff;
}
.how-index h2 {
    margin: 2px 6px 10px;
    font-size: 1rem;
    font-weight: 700;
}
.how-index ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(126px, 100%), 1fr));
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.how-index a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 7px 8px;
    border-radius: 9px;
    color: #334155;
    font-size: .83rem;
    line-height: 1.35;
    text-decoration: none;
    box-shadow: inset 3px 0 transparent;
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.how-index a:hover, .how-index a:focus-visible {
    background: #f3eadb;
    color: #713f12;
}
.how-index a[aria-current="location"] {
    background: linear-gradient(110deg, #16263d 0%, #243a57 100%);
    color: #fff8e8;
    box-shadow: inset 3px 0 #f59e0b, 0 7px 18px rgba(15, 23, 42, .18);
    font-weight: 700;
}
.how-topics { min-width: 0; }
.how-availability {
    margin: 0 0 18px;
    padding: 12px 16px;
    border: 1px solid #eddab6;
    border-radius: 12px;
    background: #fffcf4;
    color: #634519;
    font-size: .88rem;
    line-height: 1.55;
}
.how-topic {
    margin-bottom: 18px;
    border: 1px solid #dfe6ef;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 22px #17203308;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.how-layout:not(.has-topic-tracking) .how-topic:target, .how-topic.is-current {
    border-color: #dea451;
    box-shadow: 0 10px 28px #92400e12;
}
.how-topic-copy { padding: clamp(16px, 3vw, 28px); }
.how-topic h2, .how-support h2 {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 2.4vw, 1.65rem);
    font-weight: 720;
    letter-spacing: -.025em;
    line-height: 1.18;
}
.how-route {
    margin: 0 0 14px;
    color: #87430f;
    font-size: .84rem;
    font-weight: 650;
}
.how-topic ol {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding-left: 1.3rem;
    color: #334155;
    font-size: .94rem;
    line-height: 1.55;
}
.how-topic li { padding-left: 4px; }
.how-topic li::marker { color: #8a400d; font-weight: 700; }
.how-topic-copy .how-availability { margin-top: 14px; }
.how-back-to-index {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin: 0 clamp(16px, 3vw, 28px) 8px;
}
.how-gallery { min-width: 0; }
.how-screen {
    margin: 0 clamp(10px, 2.5vw, 24px) clamp(10px, 2.5vw, 24px);
    overflow: hidden;
    border: 1px solid #dce4ee;
    border-radius: 14px;
    background: #f8fafc;
}
.how-screen-portrait {
    width: min(390px, calc(100% - 24px));
    margin-inline: auto;
}
.how-screen img {
    display: block;
    width: 100%;
    height: auto;
}
.how-screen figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 12px;
    min-height: 44px;
    padding: 0 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: .78rem;
}
.how-screen figcaption a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    text-decoration: none;
}
.how-screen figcaption a:hover { text-decoration: underline; }
.how-screen figcaption a i { transition: transform .2s ease; }
.how-screen figcaption a:hover i { transform: scale(1.2); }
.how-screen figcaption .how-open-mobile { display: none; }

.how-lightbox {
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #ffffff36;
    border-radius: 16px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 24px 80px #02061770;
}
.how-lightbox[open] { animation: how-lightbox-in .22s ease-out; }
.how-lightbox::backdrop { background: #020617b8; }
html:has(.how-lightbox[open]) { overflow: hidden; }
@keyframes how-lightbox-in {
    from { opacity: 0; transform: translateY(8px) scale(.99); }
    to { opacity: 1; transform: none; }
}
.how-lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding: 8px 8px 8px 16px;
}
.how-lightbox-title {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    font-size: .91rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.how-lightbox-close {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    border: 1px solid #ffffff30;
    border-radius: 10px;
    background: #ffffff10;
    color: inherit;
    transition: background-color .2s ease;
}
.how-lightbox-close:hover { background-color: #ffffff26; }
.how-lightbox-close:focus-visible, .how-lightbox-stage:focus-visible { outline: 2px solid #fbbf24; outline-offset: -3px; }
.how-lightbox-stage {
    max-height: calc(100vh - 106px);
    max-height: calc(100dvh - 106px);
    overflow: auto;
    overscroll-behavior: contain;
    background: #070d18;
}
.how-lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    margin-inline: auto;
}
.how-lightbox-image[hidden] { display: none; }
.how-lightbox-error { margin: 0; padding: 16px; }
.how-support {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: clamp(16px, 3vw, 26px);
    border-radius: 18px;
    background: #111827;
    color: #fff;
}
.how-support .how-link { color: #fde7ba; }
.how-support .how-link:focus-visible { outline-color: #fde7ba; }

@media (max-width: 991.98px) {
    .has-topic-tracking .how-index {
        position: sticky;
        z-index: 2;
        top: 74px;
        padding: 9px 10px 5px;
        box-shadow: 0 6px 20px #17203312;
    }
    .has-topic-tracking .how-index h2 { margin-bottom: 4px; font-size: .88rem; }
    .has-topic-tracking .how-index ul {
        display: flex;
        padding: 4px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .has-topic-tracking .how-index a { padding-inline: 10px; white-space: nowrap; }
    .has-topic-tracking .how-topic { scroll-margin-top: 175px; }
    .how-screen-responsive {
        width: min(390px, calc(100% - 24px));
        margin-inline: auto;
    }
    .how-screen-responsive figcaption .how-open-primary { display: none; }
    .how-screen-responsive figcaption .how-open-mobile { display: inline-flex; }
}

@media (max-width: 575px) {
    .how-lightbox { max-width: calc(100% - 12px); border-radius: 12px; }
}

@media (min-width: 768px) {
    .how-gallery:has(.how-screen-portrait + .how-screen-portrait) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 390px));
        justify-content: center;
        align-items: start;
        gap: 12px;
        margin: 0 16px 16px;
    }
    .how-gallery:has(.how-screen-portrait + .how-screen-portrait) .how-screen {
        width: 100%;
        margin: 0;
    }
    #ai .how-gallery:has(.how-screen-portrait:nth-child(3)) {
        grid-template-columns: repeat(3, minmax(0, 390px));
    }
}

@media (min-width: 992px) {
    .how-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
    .how-index { position: sticky; top: 84px; max-height: calc(100dvh - 100px); overflow-y: auto; }
    .how-index ul { grid-template-columns: 1fr; }
    .how-index a { min-height: 34px; }
    .how-back-to-index { display: none; }
    .how-topic:has(> .how-gallery > .how-screen-portrait:only-child) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) clamp(270px, 30vw, 390px);
        align-items: center;
        gap: 12px;
        padding: clamp(16px, 3vw, 28px);
    }
    .how-topic:has(> .how-gallery > .how-screen-portrait:only-child) .how-topic-copy { padding: 0; }
    .how-gallery > .how-screen-portrait:only-child { width: 100%; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .how-index a, .how-topic, .how-lightbox-close, .how-screen figcaption a i { transition: none; }
    .how-lightbox[open] { animation: none; }
}
