:root {
    --bt-purple: #70439f;
    --bt-purple-dark: #4b2a72;
    --bt-orange: #ff9b3b;

    --bt-bg: #ffffff;
    --bt-bg-soft: #f7f5fa;
    --bt-surface: #ffffff;
    --bt-border: #e6e1ee;
    --bt-text: #1f1a26;
    --bt-text-muted: #645c70;
    --bt-link: #70439f;
    --bt-accent-soft: #f1eaf9;
    --bt-mark: #ffe2c4;
    --bt-shadow: 0 10px 30px rgba(40, 20, 70, 0.12);

    --bt-tip: #e8f4ec;
    --bt-tip-border: #3c9a5f;
    --bt-note: #eef3fd;
    --bt-note-border: #3d6fd1;
    --bt-warning: #fff4e5;
    --bt-warning-border: #e08a1e;

    --bt-header-height: 64px;
    --bt-footer-height: 32px;
    --bt-sidebar-width: 280px;
    --bt-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bt-bg: #15121a;
        --bt-bg-soft: #1c1823;
        --bt-surface: #211c29;
        --bt-border: #332c3e;
        --bt-text: #ece8f2;
        --bt-text-muted: #a89fb5;
        --bt-link: #c5a6ec;
        --bt-accent-soft: #2c2338;
        --bt-mark: #6b4417;
        --bt-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        --bt-tip: #18291f;
        --bt-note: #18213a;
        --bt-warning: #33240f;
        color-scheme: dark;
    }
}

:root[data-theme='dark'] {
    --bt-bg: #15121a;
    --bt-bg-soft: #1c1823;
    --bt-surface: #211c29;
    --bt-border: #332c3e;
    --bt-text: #ece8f2;
    --bt-text-muted: #a89fb5;
    --bt-link: #c5a6ec;
    --bt-accent-soft: #2c2338;
    --bt-mark: #6b4417;
    --bt-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --bt-tip: #18291f;
    --bt-note: #18213a;
    --bt-warning: #33240f;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-padding-top: calc(var(--bt-header-height) + 16px);
}

body {
    margin: 0;
    background: var(--bt-bg);
    color: var(--bt-text);
    font-family: var(--bt-font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--bt-link);
}

/* ---------- Header ---------- */

.bt-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--bt-header-height);
    padding: 0 24px;
    background: var(--bt-bg);
    border-bottom: 1px solid var(--bt-border);
}

.bt-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: var(--bt-text);
    text-decoration: none;
    font-weight: 600;
}

.bt-brand img {
    height: 34px;
    width: auto;
}

.bt-brand-docs {
    padding-left: 10px;
    border-left: 1px solid var(--bt-border);
    color: var(--bt-text-muted);
    font-weight: 500;
}

.bt-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid var(--bt-border);
    border-radius: 8px;
    background: var(--bt-surface);
    color: var(--bt-text);
    cursor: pointer;
}

.bt-logo-dark {
    display: none;
}

:root[data-theme='dark'] .bt-logo-light {
    display: none;
}

:root[data-theme='dark'] .bt-logo-dark {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .bt-logo-light {
        display: none;
    }

    :root:not([data-theme='light']) .bt-logo-dark {
        display: block;
    }
}

.bt-theme-toggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    background: transparent;
    color: var(--bt-text-muted);
    cursor: pointer;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.bt-theme-toggle:hover {
    background: var(--bt-bg-soft);
    color: var(--bt-text);
}

.bt-theme-toggle svg {
    width: 18px;
    height: 18px;
}

.bt-theme-icon-sun {
    display: none;
}

:root[data-theme='dark'] .bt-theme-icon-sun {
    display: block;
}

:root[data-theme='dark'] .bt-theme-icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .bt-theme-icon-sun {
        display: block;
    }

    :root:not([data-theme='light']) .bt-theme-icon-moon {
        display: none;
    }
}

/* ---------- Search ---------- */

.bt-search {
    position: relative;
    flex: 1;
    max-width: 520px;
    margin-left: 24px;
}

.bt-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--bt-text-muted);
    pointer-events: none;
}

.bt-search input {
    width: 100%;
    height: 40px;
    padding: 0 52px 0 40px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    background: var(--bt-bg-soft);
    color: var(--bt-text);
    font: inherit;
    font-size: 15px;
    outline: none;
}

.bt-search input:focus {
    border-color: var(--bt-purple);
    background: var(--bt-surface);
    box-shadow: 0 0 0 3px rgba(112, 67, 159, 0.18);
}

.bt-search-kbd {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 1px 7px;
    border: 1px solid var(--bt-border);
    border-radius: 6px;
    color: var(--bt-text-muted);
    font-size: 12px;
    pointer-events: none;
}

.bt-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow);
}

.bt-search-result {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--bt-text);
    text-decoration: none;
}

.bt-search-result:hover,
.bt-search-result.is-active {
    background: var(--bt-accent-soft);
}

.bt-search-result-section {
    color: var(--bt-purple);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bt-search-result-title {
    font-weight: 600;
}

.bt-search-result-summary {
    color: var(--bt-text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.bt-search-results mark {
    background: var(--bt-mark);
    color: inherit;
    border-radius: 3px;
}

.bt-search-empty {
    padding: 14px;
    color: var(--bt-text-muted);
    font-size: 14px;
}

/* ---------- Ask AI (search results and Common questions) ---------- */

.bt-ask-ai {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 12px 12px 8px;
    border-top: 1px solid var(--bt-border);
}

/* Pinned to the bottom of the results box, so it stays visible when many guides match. */
.bt-search-results .bt-ask-ai {
    position: sticky;
    bottom: -6px;
    margin: 6px -6px -6px;
    padding: 10px 18px 12px;
    border-top: 2px solid var(--bt-purple);
    border-radius: 0 0 12px 12px;
    background: var(--bt-accent-soft);
}

.bt-ask-ai-label {
    flex-basis: 100%;
    overflow: hidden;
    color: var(--bt-link);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bt-ask-ai-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: var(--bt-orange);
    vertical-align: -3px;
}

.bt-search-results .bt-ask-ai-link {
    border-color: var(--bt-purple);
    color: var(--bt-link);
    font-weight: 600;
}

.bt-search-results .bt-ask-ai-link:hover,
.bt-search-results .bt-ask-ai-link:focus-visible {
    background: var(--bt-purple);
    color: #ffffff;
}

.bt-ask-ai-hint {
    margin: 12px 0 0;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-ask-ai-hint strong {
    color: var(--bt-link);
}

.bt-ask-ai-link,
.bt-ask-ai-button {
    padding: 4px 12px;
    border: 1px solid var(--bt-border);
    border-radius: 999px;
    background: var(--bt-surface);
    color: var(--bt-text);
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
}

.bt-ask-ai-link:hover,
.bt-ask-ai-link:focus-visible,
.bt-ask-ai-button:hover,
.bt-ask-ai-button:focus-visible {
    border-color: var(--bt-purple);
    color: var(--bt-link);
}

.bt-ask-ai-note {
    flex-basis: 100%;
    color: var(--bt-text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.bt-ask-ai-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 8px;
}

.bt-ask-ai-form input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--bt-border);
    border-radius: 8px;
    background: var(--bt-surface);
    color: var(--bt-text);
    font: inherit;
    font-size: 14px;
}

.bt-ask-ai-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Layout ---------- */

.bt-layout {
    display: grid;
    grid-template-columns: var(--bt-sidebar-width) minmax(0, 1fr);
}

.bt-sidebar {
    position: sticky;
    top: var(--bt-header-height);
    height: calc(100vh - var(--bt-header-height) - var(--bt-footer-height));
    overflow-y: auto;
    padding: 24px 16px 40px;
    border-right: 1px solid var(--bt-border);
    background: var(--bt-bg);
    scrollbar-width: thin;
}

.bt-nav-section + .bt-nav-section {
    margin-top: 4px;
}

.bt-nav-section summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-radius: 8px;
    color: var(--bt-text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

.bt-nav-section summary::-webkit-details-marker {
    display: none;
}

.bt-nav-section summary::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-right: 1.5px solid var(--bt-text-muted);
    border-bottom: 1.5px solid var(--bt-text-muted);
    opacity: 0.6;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.bt-nav-section[open] > summary::after {
    transform: rotate(45deg);
}

.bt-nav-section summary:hover {
    background: var(--bt-bg-soft);
}

.bt-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--bt-purple);
}

.bt-nav-section summary .bt-icon {
    width: 18px;
    height: 18px;
    color: var(--bt-purple);
}

.bt-nav-section[open] > summary {
    color: var(--bt-link);
}

.bt-nav-section ul {
    margin: 2px 0 10px 15px;
    padding: 0 0 0 10px;
    border-left: 1px solid var(--bt-border);
    list-style: none;
}

.bt-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--bt-text-muted);
    font-size: 14px;
    line-height: 1.45;
    text-decoration: none;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}

a.bt-nav-link:hover {
    background: var(--bt-bg-soft);
    color: var(--bt-text);
}

a.bt-nav-link[aria-current='page'] {
    background: var(--bt-accent-soft);
    color: var(--bt-link);
    font-weight: 500;
}

.bt-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 10px 6px;
    color: var(--bt-text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bt-nav-group::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bt-border);
}

.bt-nav-zone-title {
    padding: 0 8px 8px;
    color: var(--bt-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bt-nav-zone-title ~ .bt-nav-zone-title {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--bt-border);
}

.bt-nav-learn {
    padding: 6px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: var(--bt-accent-soft);
}

.bt-nav-learn-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    color: var(--bt-text);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.bt-nav-learn-link .bt-icon {
    width: 18px;
    height: 18px;
}

.bt-nav-learn-link:hover,
.bt-nav-learn .bt-nav-section summary:hover,
.bt-nav-learn a.bt-nav-link:hover,
.bt-nav-learn a.bt-nav-link[aria-current='page'],
.bt-nav-learn-link[aria-current='page'] {
    background: var(--bt-bg);
}

.bt-nav-learn-link[aria-current='page'] {
    color: var(--bt-link);
}

.bt-nav-learn .bt-nav-section {
    margin-top: 2px;
}

.bt-nav-learn .bt-nav-section ul {
    margin-bottom: 4px;
}

.bt-nav-progress {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bt-bg);
    color: var(--bt-text-muted);
    font-size: 11px;
    font-weight: 600;
}

.bt-nav-course summary::after,
.bt-nav-courses > summary::after {
    margin-left: 6px;
}

.bt-nav-courses-list {
    margin: 2px 0 6px 15px;
    padding-left: 6px;
    border-left: 1px solid var(--bt-border);
}

.bt-nav-group:first-child {
    padding-top: 4px;
}

.bt-nav-soon {
    opacity: 0.45;
    cursor: default;
}

.bt-nav-soon em {
    flex-shrink: 0;
    font-size: 11px;
    font-style: normal;
    text-transform: lowercase;
}

.bt-main {
    display: grid;
    grid-template-columns: minmax(0, 780px) 220px;
    justify-content: center;
    gap: 48px;
    padding: 40px 40px 80px;
}

.bt-backdrop {
    display: none;
}

/* ---------- Article ---------- */

.bt-breadcrumb {
    margin-bottom: 8px;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.bt-breadcrumb a:hover {
    color: var(--bt-link);
}

.bt-article h1 {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.bt-lead {
    margin: 0 0 20px;
    color: var(--bt-text-muted);
    font-size: 18px;
}

.bt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.bt-chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bt-accent-soft);
    color: var(--bt-purple);
    font-size: 13px;
    font-weight: 500;
}

:root[data-theme='dark'] .bt-chip,
:root[data-theme='dark'] .bt-search-result-section {
    color: var(--bt-link);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .bt-chip,
    :root:not([data-theme='light']) .bt-search-result-section {
        color: var(--bt-link);
    }
}

.bt-article h2 {
    margin: 48px 0 12px;
    padding-top: 8px;
    font-size: 24px;
    line-height: 1.3;
}

.bt-article h3 {
    margin: 28px 0 8px;
    font-size: 18px;
}

.bt-article p,
.bt-article li {
    max-width: 70ch;
}

.bt-article ul,
.bt-article ol {
    padding-left: 22px;
}

.bt-article li + li {
    margin-top: 4px;
}

.bt-ui {
    padding: 1px 6px;
    border: 1px solid var(--bt-border);
    border-radius: 5px;
    background: var(--bt-bg-soft);
    font-size: 0.92em;
    font-weight: 600;
    white-space: nowrap;
}

/* Numbered steps */

.bt-steps {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: bt-step;
}

.bt-steps > li {
    position: relative;
    max-width: none;
    margin: 0;
    padding: 0 0 36px 52px;
    counter-increment: bt-step;
}

.bt-steps > li::before {
    content: counter(bt-step);
    position: absolute;
    top: -2px;
    left: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bt-purple);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.bt-steps > li::after {
    content: '';
    position: absolute;
    top: 36px;
    bottom: 6px;
    left: 15px;
    width: 2px;
    background: var(--bt-border);
}

.bt-steps > li:last-child::after {
    display: none;
}

.bt-step-title {
    display: block;
    margin-bottom: 4px;
    font-size: 17px;
    font-weight: 700;
}

/* Screenshots */

.bt-screenshot {
    margin: 16px 0 4px;
}

.bt-screenshot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    box-shadow: var(--bt-shadow);
}

/* Phone screenshots (Driver App): shown narrow, optionally side by side */

.bt-screenshot.bt-phone {
    max-width: 280px;
}

.bt-phone-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 16px 0 4px;
}

.bt-phone-row .bt-screenshot.bt-phone {
    flex: 1 1 220px;
    margin: 0;
}

/* ---------- Image zoom (see setupImageZoom in docs.js) ---------- */

.bt-zoom {
    position: relative;
    display: block;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none' stroke-linecap='round'%3E%3Cpath d='M13.6 13.6L19 19' stroke='white' stroke-width='4.4'/%3E%3Ccircle cx='9' cy='9' r='6.2' fill='white' stroke='white' stroke-width='3'/%3E%3Cpath d='M13.6 13.6L19 19' stroke='%231f1a2e' stroke-width='2'/%3E%3Ccircle cx='9' cy='9' r='6.2' stroke='%231f1a2e' stroke-width='1.6'/%3E%3Cpath d='M9 6.6v4.8M6.6 9h4.8' stroke='%2370439f' stroke-width='1.6'/%3E%3C/svg%3E") 9 9, zoom-in;
}

.bt-zoom-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(24, 19, 36, 0.62);
    color: #ffffff;
    opacity: 0;
    backdrop-filter: blur(6px);
    transform: scale(0.92);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    pointer-events: none;
}

.bt-zoom-badge svg {
    width: 15px;
    height: 15px;
}

.bt-zoom:hover .bt-zoom-badge,
.bt-zoom:focus-visible .bt-zoom-badge {
    opacity: 1;
    transform: scale(1);
}

.bt-zoom:focus-visible {
    outline: 2px solid var(--bt-link);
    outline-offset: 3px;
    border-radius: 10px;
}

@media (hover: none) {
    .bt-zoom-badge {
        opacity: 0.85;
        transform: none;
    }
}

.bt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    overflow: auto;
    padding: 56px 24px 24px;
    background: rgba(14, 11, 20, 0.88);
    backdrop-filter: blur(4px);
    overscroll-behavior: contain;
}

.bt-lightbox.is-open {
    display: block;
    animation: bt-lightbox-in 0.16s ease-out;
}

@keyframes bt-lightbox-in {
    from {
        opacity: 0;
    }
}

.bt-lightbox-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 100%;
}

.bt-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.bt-lightbox.is-zoomable img {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none' stroke-linecap='round'%3E%3Cpath d='M13.6 13.6L19 19' stroke='white' stroke-width='4.4'/%3E%3Ccircle cx='9' cy='9' r='6.2' fill='white' stroke='white' stroke-width='3'/%3E%3Cpath d='M13.6 13.6L19 19' stroke='%231f1a2e' stroke-width='2'/%3E%3Ccircle cx='9' cy='9' r='6.2' stroke='%231f1a2e' stroke-width='1.6'/%3E%3Cpath d='M9 6.6v4.8M6.6 9h4.8' stroke='%2370439f' stroke-width='1.6'/%3E%3C/svg%3E") 9 9, zoom-in;
}

.bt-lightbox.is-actual-size .bt-lightbox-stage {
    align-items: flex-start;
}

.bt-lightbox.is-actual-size img {
    max-width: none;
    max-height: none;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none' stroke-linecap='round'%3E%3Cpath d='M13.6 13.6L19 19' stroke='white' stroke-width='4.4'/%3E%3Ccircle cx='9' cy='9' r='6.2' fill='white' stroke='white' stroke-width='3'/%3E%3Cpath d='M13.6 13.6L19 19' stroke='%231f1a2e' stroke-width='2'/%3E%3Ccircle cx='9' cy='9' r='6.2' stroke='%231f1a2e' stroke-width='1.6'/%3E%3Cpath d='M6.6 9h4.8' stroke='%2370439f' stroke-width='1.6'/%3E%3C/svg%3E") 9 9, zoom-out;
}

.bt-lightbox-caption {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    text-align: center;
}

.bt-lightbox-close {
    position: fixed;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bt-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.bt-lightbox-close svg {
    width: 14px;
    height: 14px;
}

body.bt-lightbox-open {
    overflow: hidden;
}

.bt-screenshot figcaption {
    margin-top: 8px;
    color: var(--bt-text-muted);
    font-size: 13px;
}

.bt-screenshot.is-missing img,
.bt-screenshot.is-missing .bt-zoom {
    display: none;
}

.bt-screenshot.is-missing::before {
    content: 'Screenshot coming soon';
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    border: 2px dashed var(--bt-border);
    border-radius: 10px;
    background: var(--bt-bg-soft);
    color: var(--bt-text-muted);
    font-size: 14px;
}

/* Callouts */

.bt-callout {
    margin: 20px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--bt-note-border);
    border-radius: 8px;
    background: var(--bt-note);
}

.bt-callout p {
    margin: 0;
}

.bt-callout p + p {
    margin-top: 6px;
}

.bt-callout-title {
    display: block;
    margin-bottom: 2px;
    font-weight: 700;
}

.bt-callout-tip {
    border-left-color: var(--bt-tip-border);
    background: var(--bt-tip);
}

.bt-callout-warning {
    border-left-color: var(--bt-warning-border);
    background: var(--bt-warning);
}

/* Tables */

.bt-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
}

.bt-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.bt-article th,
.bt-article td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--bt-border);
    text-align: left;
    vertical-align: top;
}

.bt-article th {
    background: var(--bt-bg-soft);
    font-weight: 600;
}

.bt-article tr:last-child td {
    border-bottom: none;
}

/* Related guides */

.bt-related {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.bt-related a,
.bt-related span {
    padding: 14px 16px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    color: var(--bt-text);
    font-weight: 600;
    text-decoration: none;
}

.bt-related a:hover {
    border-color: var(--bt-purple);
}

.bt-related span {
    color: var(--bt-text-muted);
    font-weight: 500;
}

/* On this page */

.bt-toc {
    position: sticky;
    top: calc(var(--bt-header-height) + 40px);
    align-self: start;
    font-size: 14px;
}

.bt-toc-title {
    margin: 0 0 10px;
    color: var(--bt-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bt-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--bt-border);
}

.bt-toc a {
    display: block;
    margin-left: -1px;
    padding: 4px 12px;
    border-left: 2px solid transparent;
    color: var(--bt-text-muted);
    line-height: 1.4;
    text-decoration: none;
}

.bt-toc a:hover {
    color: var(--bt-text);
}

.bt-toc a.is-active {
    border-left-color: var(--bt-purple);
    color: var(--bt-link);
    font-weight: 600;
}

.bt-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--bt-footer-height);
    padding: 0 24px;
    overflow: hidden;
    background: var(--bt-bg);
    border-top: 1px solid var(--bt-border);
    color: var(--bt-text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.bt-footer > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt-footer-links {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.bt-footer-links a {
    color: inherit;
    text-decoration: none;
}

.bt-footer-links a:hover {
    color: var(--bt-link);
}

/* ---------- Home page ---------- */

.bt-main-home {
    grid-template-columns: minmax(0, 1080px);
}

.bt-home .bt-header .bt-search {
    visibility: hidden;
}

.bt-home-hero {
    padding: 56px 48px 48px;
    border: 1px solid var(--bt-border);
    border-radius: 20px;
    background:
        radial-gradient(circle at 90% 0%, rgba(255, 104, 0, 0.12), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(112, 67, 159, 0.18), transparent 55%),
        var(--bt-bg-soft);
}

.bt-home-eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bt-accent-soft);
    color: var(--bt-link);
    font-size: 13px;
    font-weight: 600;
}

.bt-article .bt-home-hero h1 {
    margin-bottom: 12px;
    font-size: 44px;
    letter-spacing: -0.02em;
}

.bt-home-hero .bt-lead {
    max-width: 60ch;
    margin: 0;
}

.bt-hero-search {
    flex: none;
    max-width: 640px;
    margin: 28px 0 0;
}

.bt-hero-search input {
    height: 54px;
    padding-left: 48px;
    border-radius: 14px;
    background: var(--bt-surface);
    font-size: 17px;
}

.bt-hero-search .bt-search-icon {
    left: 16px;
    width: 20px;
    height: 20px;
}

.bt-home-search-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-home-search-hint button {
    padding: 4px 12px;
    border: 1px solid var(--bt-border);
    border-radius: 999px;
    background: var(--bt-surface);
    color: var(--bt-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
}

.bt-home-search-hint button:hover {
    border-color: var(--bt-purple);
    color: var(--bt-link);
}

.bt-home-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 48px 0 16px;
}

.bt-article .bt-home-heading h2 {
    margin: 0;
    padding: 0;
    font-size: 20px;
}

.bt-home-heading p {
    margin: 0;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-popular {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bt-popular-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    border: 1px solid var(--bt-border);
    border-radius: 14px;
    background: var(--bt-surface);
    color: var(--bt-text);
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.bt-popular-card:hover {
    border-color: var(--bt-purple);
    box-shadow: var(--bt-shadow);
    transform: translateY(-2px);
}

.bt-popular-section {
    color: var(--bt-link);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bt-popular-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.bt-popular-summary {
    color: var(--bt-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.bt-popular-cta {
    margin-top: auto;
    padding-top: 8px;
    color: var(--bt-link);
    font-size: 14px;
    font-weight: 600;
}

.bt-section-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.bt-section-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border: 1px solid var(--bt-border);
    border-radius: 16px;
    background: var(--bt-surface);
    transition: border-color 0.15s ease;
}

.bt-section-card:hover {
    border-color: rgba(112, 67, 159, 0.45);
}

.bt-section-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bt-section-card-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bt-accent-soft);
}

.bt-section-card-icon .bt-icon {
    color: var(--bt-link);
}

.bt-article .bt-section-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
}

.bt-section-card-count {
    color: var(--bt-text-muted);
    font-size: 13px;
}

.bt-article .bt-section-card p {
    margin: 0;
    color: var(--bt-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.bt-article .bt-section-card ul {
    margin: 4px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--bt-border);
    list-style: none;
}

.bt-article .bt-section-card li {
    max-width: none;
    margin: 0;
}

.bt-section-card li a,
.bt-section-card li span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    text-decoration: none;
}

.bt-section-card li a {
    color: var(--bt-text);
    font-weight: 500;
}

.bt-section-card li a::after {
    content: '→';
    color: var(--bt-link);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.bt-section-card li a:hover {
    color: var(--bt-link);
}

.bt-section-card li a:hover::after {
    opacity: 1;
}

.bt-section-card li span {
    color: var(--bt-text-muted);
    opacity: 0.6;
}

.bt-section-card li span em,
.bt-section-card li a em {
    margin-left: auto;
    font-size: 12px;
    font-style: normal;
}

.bt-section-card li a em {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--bt-accent-soft);
    color: var(--bt-link);
    font-weight: 600;
    text-align: center;
}

.bt-section-card h3 a {
    color: inherit;
    text-decoration: none;
}

.bt-section-card h3 a:hover {
    color: var(--bt-link);
}

.bt-guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.bt-guide-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: var(--bt-surface);
    color: var(--bt-text);
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

a.bt-guide-card:hover {
    border-color: var(--bt-purple);
    box-shadow: var(--bt-shadow);
}

.bt-guide-card-title {
    font-weight: 600;
    line-height: 1.35;
}

.bt-guide-card-summary {
    color: var(--bt-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.bt-guide-card.is-soon {
    opacity: 0.55;
}

.bt-help-card {
    margin-top: 48px;
    padding: 28px 32px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--bt-purple), var(--bt-purple-dark));
    color: #ffffff;
}

.bt-article .bt-help-card h2 {
    margin: 0 0 6px;
    padding: 0;
    color: #ffffff;
    font-size: 20px;
}

.bt-article .bt-help-card p {
    max-width: 70ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
}

.bt-help-card .bt-ui {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* The normal link color is purple, which disappears on the card's purple background. */
.bt-article .bt-help-card a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bt-article .bt-help-card a:hover {
    text-decoration-thickness: 2px;
}

/* ---------- Learn: courses, lessons and questions ---------- */

.bt-nav-lesson-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--bt-bg-soft);
    font-size: 11px;
    font-weight: 600;
}

.bt-nav-link .bt-nav-lesson-number + * {
    flex: 1;
}

.bt-nav-lesson {
    justify-content: flex-start;
}

.bt-nav-check {
    margin-left: auto;
    color: var(--bt-tip-border);
    font-weight: 700;
}

.bt-lesson-header {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-lesson-header a {
    color: var(--bt-link);
    font-weight: 600;
    text-decoration: none;
}

.bt-goals,
.bt-quick-answer {
    margin: 20px 0 28px;
    padding: 16px 20px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: var(--bt-bg-soft);
}

.bt-quick-answer {
    border-left: 4px solid var(--bt-purple);
}

.bt-goals-title,
.bt-quick-answer-title {
    display: block;
    margin-bottom: 6px;
    color: var(--bt-link);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bt-goals ul {
    margin: 0;
    padding-left: 20px;
}

.bt-quick-answer p {
    margin: 0;
}

.bt-callout-danger {
    border-left-color: #d64545;
    background: #fdecec;
}

:root[data-theme='dark'] .bt-callout-danger {
    background: #3a1a1c;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .bt-callout-danger {
        background: #3a1a1c;
    }
}

.bt-pass-button,
.bt-course-cta {
    display: inline-block;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--bt-purple);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.bt-pass-button:hover,
.bt-course-cta:hover {
    background: var(--bt-purple-dark);
}

.bt-quiz-confirm {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-top: 1px solid var(--bt-border);
}

.bt-quiz-confirm p {
    flex: 1 1 320px;
    margin: 0;
    font-weight: 600;
}

.bt-quiz-confirm label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid var(--bt-border);
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

.bt-quiz-confirm input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--bt-tip-border);
}

.bt-quiz-confirm label:has(input:checked) {
    border-color: var(--bt-tip-border);
    background: var(--bt-tip);
    font-weight: 600;
}

.bt-quiz {
    margin: 32px 0;
    padding: 20px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
}

.bt-quiz-title {
    display: block;
    font-weight: 700;
}

.bt-quiz-intro {
    margin: 2px 0 12px;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-quiz-question {
    padding: 14px 0;
    border-top: 1px solid var(--bt-border);
}

.bt-quiz-question > p {
    margin: 0 0 10px;
    font-weight: 600;
}

.bt-quiz-options {
    display: grid;
    gap: 8px;
}

.bt-quiz-option {
    padding: 10px 14px;
    border: 1px solid var(--bt-border);
    border-radius: 8px;
    background: var(--bt-surface);
    color: var(--bt-text);
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.bt-quiz-option:hover:not(:disabled) {
    border-color: var(--bt-purple);
}

.bt-quiz-option:disabled {
    cursor: default;
}

.bt-quiz-option.is-right {
    border-color: var(--bt-tip-border);
    background: var(--bt-tip);
    font-weight: 600;
}

.bt-quiz-option.is-wrong {
    border-color: #d64545;
    opacity: 0.7;
    text-decoration: line-through;
}

.bt-quiz-explain {
    display: none;
    margin: 10px 0 0;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-quiz-question.is-correct .bt-quiz-explain {
    display: block;
}

.bt-quiz-summary {
    margin: 12px 0 0;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-quiz-summary.is-done {
    color: var(--bt-tip-border);
    font-weight: 600;
}

.bt-lesson-pass {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 18px 20px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
}

.bt-lesson-pass strong,
.bt-lesson-pass span {
    display: block;
}

.bt-lesson-pass span {
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-lesson-pass.is-passed {
    border-color: var(--bt-tip-border);
    background: var(--bt-tip);
}

.bt-lesson-pass.is-passed .bt-pass-button {
    background: var(--bt-tip-border);
}

.bt-lesson-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.bt-lesson-nav a {
    padding: 12px 16px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    color: var(--bt-text);
    font-weight: 600;
    text-decoration: none;
}

.bt-lesson-nav a:hover {
    border-color: var(--bt-purple);
}

.bt-lesson-nav span {
    display: block;
    color: var(--bt-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.bt-lesson-nav-next {
    text-align: right;
}

.bt-progress {
    overflow: hidden;
    height: 8px;
    margin: 16px 0 10px;
    border-radius: 999px;
    background: var(--bt-bg-soft);
}

.bt-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--bt-purple), var(--bt-orange));
    transition: width 0.3s ease;
}

.bt-course-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.bt-course-card {
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    border: 1px solid var(--bt-border);
    border-radius: 16px;
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow);
}

.bt-course-card-head {
    flex: 1;
}

/* Medium screens: 2 cards per row, a lone last card takes the full width */
@media (min-width: 640px) and (max-width: 1099px) {
    .bt-course-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bt-course-card:nth-child(2n + 1):last-child {
        grid-column: span 2;
    }
}

/* Wide screens: 3 cards per row, and a short last row stretches to the full width (no empty slot) */
@media (min-width: 1100px) {
    .bt-course-cards {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .bt-course-card {
        grid-column: span 2;
    }

    .bt-course-card:nth-child(3n + 1):nth-last-child(2),
    .bt-course-card:nth-child(3n + 2):last-child {
        grid-column: span 3;
    }

    .bt-course-card:nth-child(3n + 1):last-child {
        grid-column: span 6;
    }
}

.bt-course-card.is-complete {
    border-color: var(--bt-tip-border);
}

.bt-course-eyebrow {
    color: var(--bt-orange);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bt-article .bt-course-card h3 {
    margin: 4px 0 6px;
    font-size: 20px;
}

.bt-course-card h3 a {
    color: var(--bt-text);
    text-decoration: none;
}

.bt-course-card p {
    margin: 0;
    color: var(--bt-text-muted);
}

.bt-course-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-article .bt-lesson-list {
    display: grid;
    gap: 10px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.bt-article .bt-lesson-list li,
.bt-article .bt-top-questions li {
    max-width: none;
    margin-top: 0;
}

.bt-lesson-row {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    color: var(--bt-text);
    text-decoration: none;
}

a.bt-lesson-row:hover {
    border-color: var(--bt-purple);
}

.bt-lesson-row.is-soon {
    opacity: 0.55;
}

.bt-lesson-row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bt-accent-soft);
    color: var(--bt-link);
    font-weight: 700;
}

.bt-lesson-row.is-passed .bt-lesson-row-number {
    background: var(--bt-tip);
    color: var(--bt-tip-border);
}

.bt-lesson-row-text {
    flex: 1;
    min-width: 0;
}

.bt-lesson-row-text strong,
.bt-lesson-row-text span {
    display: block;
}

.bt-lesson-row-text span,
.bt-lesson-row-meta {
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-lesson-row-meta {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    align-items: center;
}

.bt-lesson-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--bt-border);
    border-radius: 50%;
    font-size: 12px;
}

.bt-lesson-dot.is-passed {
    border-color: var(--bt-tip-border);
    background: var(--bt-tip-border);
    color: #ffffff;
}

.bt-lesson-dot.is-soon {
    border-style: dashed;
}

.bt-course-reset {
    margin-top: 20px;
    color: var(--bt-text-muted);
    font-size: 14px;
}

.bt-course-reset button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--bt-link);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.bt-question {
    margin: 10px 0;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: var(--bt-surface);
}

.bt-question summary {
    padding: 14px 18px;
    font-weight: 600;
    cursor: pointer;
}

.bt-question[open] summary {
    color: var(--bt-link);
}

.bt-question-answer {
    padding: 0 18px 16px;
}

.bt-question-answer p {
    margin: 0 0 10px;
}

.bt-question-more {
    font-weight: 600;
}

.bt-top-questions ul {
    columns: 2;
    column-gap: 40px;
}

.bt-top-questions li {
    break-inside: avoid;
}

.bt-top-questions {
    padding: 22px 24px;
    border: 1px solid var(--bt-border);
    border-radius: 16px;
}

.bt-article .bt-top-questions h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.bt-top-questions ul {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.bt-top-questions li a {
    display: block;
    padding: 7px 0;
    border-bottom: 1px solid var(--bt-border);
    text-decoration: none;
}

.bt-top-questions li a:hover {
    text-decoration: underline;
}

/* ---------- Page transitions ---------- */

@view-transition {
    navigation: auto;
}

.bt-header {
    view-transition-name: bt-header;
}

.bt-footer {
    view-transition-name: bt-footer;
}

.bt-sidebar {
    view-transition-name: bt-sidebar;
}

.bt-main {
    view-transition-name: bt-main;
}

/* No crossfade: two different pages drawn on top of each other show the old text through the new one. */
::view-transition-group(*),
::view-transition-new(*) {
    animation: none;
}

::view-transition-old(*) {
    animation: none;
    opacity: 0;
}

::view-transition-new(bt-main) {
    animation: bt-content-in 150ms ease-out both;
}

@keyframes bt-content-in {
    from {
        opacity: 0.5;
    }
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }
}

/* ---------- Embed mode (inside the TMS app) ---------- */

.bt-embedded {
    --bt-footer-height: 0px;
}

.bt-open-new-tab {
    flex-shrink: 0;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    color: var(--bt-text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.bt-open-new-tab:hover {
    background: var(--bt-bg-soft);
    color: var(--bt-text);
}

.bt-intro-video-btn,
.bt-guided-tours-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid var(--bt-purple);
    border-radius: 10px;
    background: transparent;
    color: var(--bt-link);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.bt-intro-video-btn:hover,
.bt-guided-tours-btn:hover {
    background: var(--bt-accent-soft);
}

.bt-intro-video-btn svg,
.bt-guided-tours-btn svg {
    width: 18px;
    height: 18px;
}

.bt-intro-video-btn + .bt-guided-tours-btn,
.bt-intro-video-btn + .bt-open-new-tab,
.bt-guided-tours-btn + .bt-open-new-tab {
    margin-left: 0;
}

.bt-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 12px 12px;
    background: rgba(0, 0, 0, 0.75);
}

.bt-video-stage {
    position: relative;
    width: min(1280px, 100%, calc((100vh - 80px) * 16 / 9));
}

.bt-video-stage iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
}

.bt-video-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
}

.bt-video-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    .bt-main {
        grid-template-columns: minmax(0, 780px);
    }

    .bt-toc {
        display: none;
    }
}

@media (max-width: 860px) {
    .bt-header {
        gap: 10px;
        padding: 0 16px;
    }

    .bt-menu-toggle {
        display: block;
    }

    .bt-brand-docs,
    .bt-search-kbd {
        display: none;
    }

    .bt-footer {
        padding: 0 16px;
    }

    .bt-search {
        margin-left: 0;
    }

    .bt-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .bt-sidebar {
        position: fixed;
        top: var(--bt-header-height);
        left: 0;
        z-index: 25;
        width: min(var(--bt-sidebar-width), 85vw);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .bt-menu-open .bt-sidebar {
        transform: none;
        box-shadow: var(--bt-shadow);
    }

    .bt-menu-open .bt-backdrop {
        position: fixed;
        inset: var(--bt-header-height) 0 0 0;
        z-index: 20;
        display: block;
        background: rgba(0, 0, 0, 0.35);
    }

    .bt-main {
        padding: 24px 16px 64px;
    }

    .bt-article h1,
    .bt-article .bt-home-hero h1 {
        font-size: 30px;
    }

    .bt-home-hero {
        padding: 32px 20px;
    }

    .bt-home-heading {
        flex-direction: column;
        gap: 4px;
    }

    .bt-help-card {
        padding: 24px 20px;
    }

    .bt-steps > li {
        padding-left: 44px;
    }

    .bt-lesson-nav {
        grid-template-columns: minmax(0, 1fr);
    }

    .bt-top-questions ul {
        columns: 1;
    }

    .bt-lesson-row-meta {
        flex-direction: column-reverse;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .bt-brand img {
        height: 28px;
    }
}
