.guide-page {
    background: var(--site-page);
    color: var(--site-text);
    font: 16px/1.5 system-ui, sans-serif;
}

.guides {
    padding-block: 20px 56px;
}

.guides [hidden], .guide-player [hidden] {
    display: none;
}

.guide-intro h1 {
    margin: 0;
    color: var(--site-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.12;
}

.guide-intro p, .guide-text p, .guide-library small {
    color: var(--site-muted);
}

.guide-intro p {
    margin: 10px 0 24px;
}

.guide-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 28%);
    gap: 18px;
    align-items: start;
}

.guide-current, .guide-library {
    background: var(--site-surface);
    border: 1px solid var(--site-line);
    border-radius: 18px;
}

.guide-screen {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 17px 17px 0 0;
    background: #101722;
}

.guide-screen video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.guide-screen[data-portrait] {
    aspect-ratio: 4 / 5;
    max-height: min(60svh, 600px);
}

/* Native short demos keep the original 9:16 ratio and a readable width. */
.guide-screen.guide-demo-screen {
    aspect-ratio: 9 / 16;
    width: min(100%, 360px);
    max-height: none;
    margin-inline: auto;
    border-radius: 16px;
    background: #f7f1e7;
}
.guide-demo-cover {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #f7f1e7;
    color: white;
    cursor: pointer;
    font: inherit;
}
.guide-demo-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.guide-demo-label {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 18px;
    padding: 14px 8px;
    border-radius: 12px;
    background: #193d35;
    color: white;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}
.guide-demo-fallback { margin: 12px 16px; font: 14px/1.5 system-ui, sans-serif; color: var(--site-muted); }
.guide-demo-fallback a { color: var(--site-link); }
.guide-embed figcaption { padding: 12px 16px; font: 14px/1.6 system-ui, sans-serif; color: var(--site-muted); }

.guide-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #080c1780;
}

.guide-player button, .guide-player select {
    min-height: 44px;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    padding: 7px 10px;
    background: var(--site-surface);
    color: var(--site-text);
    font: inherit;
}

.guide-player button:not(:disabled), .guide-player select:not(:disabled) {
    cursor: pointer;
}

.guide-player button:disabled, .guide-player select:disabled {
    opacity: .55;
}

.guide-player .guide-overlay button {
    padding-inline: 20px;
    border-color: transparent;
    background: #fff;
    color: #173a34;
    font-weight: 700;
}

.guide-controls, .guide-gesture, .guide-skip {
    position: absolute;
    inset: 0;
}

.guide-controls, .guide-skip, .guide-settings {
    pointer-events: none;
}

.guide-gesture, .guide-skip {
    bottom: 52px;
}

.guide-gesture {
    pointer-events: auto;
    touch-action: manipulation;
    cursor: pointer;
}

.guide-skip {
    display: flex;
    justify-content: space-around;
    align-items: center;
    opacity: 0;
    transition: opacity 150ms ease;
}

.guide-skip:has(:focus-visible), .guide-screen[data-touch-controls] .guide-skip {
    opacity: 1;
}

.guide-skip:has(:focus-visible) button, .guide-screen[data-touch-controls] .guide-skip button {
    pointer-events: auto;
}

@media (hover: hover) {
    .guide-screen:hover .guide-skip {
        opacity: 1;
    }
    .guide-screen:hover .guide-skip button {
        pointer-events: auto;
    }
}

.guide-settings {
    position: absolute;
    inset: auto 12px 52px;
}

.guide-settings summary, .guide-player .guide-skip button {
    color: white;
    background: rgb(15 20 27 / 85%);
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 24px;
    min-height: 44px;
}

.guide-settings summary {
    display: grid;
    place-items: center;
    width: 44px;
    margin-inline-start: auto;
    pointer-events: auto;
    cursor: pointer;
    list-style: none;
}

.guide-settings summary::-webkit-details-marker {
    display: none;
}

.guide-settings-panel {
    position: absolute;
    inset: auto 0 calc(100% + 8px) auto;
    width: min(260px, 100%);
    box-sizing: border-box;
    padding: 8px 12px;
    pointer-events: auto;
    background: rgb(15 20 27 / 96%);
    color: white;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 12px;
    font: .875rem/1.4 system-ui, sans-serif;
}

.guide-settings-panel label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.guide-settings-panel label + label {
    margin-top: 6px;
}

.guide-player .guide-settings-panel select {
    background: #252e3b;
    color: white;
    color-scheme: dark;
    border-color: #536272;
    padding: 4px;
    min-height: 36px;
}

.guide-status {
    margin: 12px 16px 0;
    color: var(--site-danger);
}

.guide-embed {
    display: block;
    margin: 20px 0;
}

.guide-embed[data-guide-id] {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    background: var(--site-surface);
    border: 1px solid var(--site-line);
    border-radius: 12px;
}

.guide-embed .guide-screen {
    border-radius: 12px;
}

.guide-embed figcaption {
    margin-top: 6px;
    color: var(--site-muted);
    font-size: .875rem;
}

.guide-text, .guide-library {
    padding: 16px;
}

.guide-text h2, .guide-library h2 {
    margin: 0;
    color: var(--site-heading);
    font-size: 1.125rem;
    overflow-wrap: anywhere;
}

.guide-text p {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.guide-library ol {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.guide-library a {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--site-link);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.guide-library a:hover, .guide-library a[aria-current] {
    background: var(--site-soft);
}

.guide-library a[aria-current] {
    font-weight: 700;
}

.guide-text-link a {
    color: var(--site-link);
}

.guides :focus-visible {
    outline: 2px solid var(--site-link);
    outline-offset: 3px;
}

.guide-screen :focus-visible {
    outline: 2px solid #fff;
    outline-offset: -3px;
}

@media (max-width: 700px) {
    .guide-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 450px) {
    .guide-settings-panel {
        inset: auto 52px 0 auto;
        width: min(260px, calc(100% - 52px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .guide-skip {
        transition: none;
    }
}
