:root {
    color-scheme: light;
    --bg: #f7fbff;
    --bg-strong: #eef6ff;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-solid: #fbfdff;
    --surface-muted: rgba(238, 246, 255, 0.86);
    --border: rgba(15, 23, 42, 0.12);
    --border-strong: rgba(15, 23, 42, 0.2);
    --text: #101827;
    --muted: #5f6d80;
    --soft: #8a98ab;
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.1);
    --twitch: #9146ff;
    --youtube: #e82727;
    --ok: #0f9f7a;
    --warning: #b45309;
    --shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
    --header-height: 64px;
    --radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.dark {
    color-scheme: dark;
    --bg: #060b14;
    --bg-strong: #091324;
    --surface: rgba(10, 20, 38, 0.76);
    --surface-solid: #0c1728;
    --surface-muted: rgba(14, 27, 48, 0.8);
    --border: rgba(191, 219, 254, 0.15);
    --border-strong: rgba(191, 219, 254, 0.25);
    --text: #edf4ff;
    --muted: #a7b4c6;
    --soft: #718096;
    --accent: #91b4ff;
    --accent-soft: rgba(145, 180, 255, 0.12);
    --twitch: #a970ff;
    --youtube: #ff6b6b;
    --ok: #34d399;
    --warning: #fbbf24;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.08), transparent 28%),
        linear-gradient(225deg, rgba(145, 70, 255, 0.08), transparent 30%),
        linear-gradient(180deg, transparent 0%, rgba(20, 184, 166, 0.05) 100%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 46%, var(--bg) 100%);
    background-attachment: fixed;
    font-size: 16px;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.nav-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

code,
kbd {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
    padding: 0.13rem 0.36rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted);
    color: color-mix(in srgb, var(--text) 86%, var(--accent));
    font-size: 0.92em;
}

kbd {
    display: inline-flex;
    min-width: 1.65rem;
    height: 1.55rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.42rem;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface-solid);
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    transform: translateY(-140%);
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    background: var(--text);
    color: var(--bg);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-solid) 80%, transparent);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.topbar-inner {
    display: flex;
    max-width: 1440px;
    height: 100%;
    align-items: center;
    gap: 1rem;
    margin: 0 auto;
    padding: 0 1.35rem;
}

.brand {
    display: inline-flex;
    min-width: max-content;
    align-items: center;
    gap: 0.58rem;
    font-weight: 700;
    letter-spacing: 0;
}

.brand img {
    border-radius: 7px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.18);
}

.brand-docs {
    padding-left: 0.55rem;
    border-left: 1px solid var(--border-strong);
    color: var(--muted);
    font-weight: 600;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.top-links a,
.sidebar-link,
.toc a {
    border-radius: 7px;
    color: var(--muted);
    transition: color 0.15s ease, background 0.15s ease;
}

.top-links a {
    padding: 0.42rem 0.66rem;
    font-size: 0.92rem;
}

.top-links a:hover,
.sidebar-link:hover,
.toc a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
}

.language-control {
    display: inline-flex;
    height: 38px;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.language-control label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
    white-space: nowrap;
}

.language-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--muted);
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.language-select {
    max-width: 7.5rem;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    outline: 0;
    cursor: pointer;
}

.language-select option {
    background: var(--surface-solid);
    color: var(--text);
}

.search-trigger,
.theme-toggle,
.nav-toggle,
.copy-page {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.search-trigger:hover,
.theme-toggle:hover,
.nav-toggle:hover,
.copy-page:hover {
    border-color: var(--border-strong);
    background: var(--surface-solid);
}

.search-trigger:active,
.theme-toggle:active,
.nav-toggle:active,
.copy-page:active {
    transform: translateY(1px);
}

.search-trigger {
    display: inline-flex;
    min-width: 210px;
    height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.5rem 0 0.78rem;
    color: var(--muted);
    text-align: left;
}

.search-trigger kbd {
    height: 1.35rem;
    min-width: 2.2rem;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.theme-icon {
    display: block;
    width: 20px;
    height: 20px;
    color: var(--muted);
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

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

.dark .theme-icon-moon {
    display: none;
}

.dark .theme-icon-sun {
    display: block;
    color: #f6c453;
}

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    margin: 3px auto;
    border-radius: 999px;
    background: var(--text);
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 820px) 220px;
    gap: 2.2rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.35rem;
}

.sidebar {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    align-self: start;
    border-right: 1px solid var(--border);
}

.sidebar-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 1.4rem 1rem 2.4rem 0;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--soft) 42%, transparent) transparent;
}

.sidebar-heading {
    margin: 1.05rem 0 0.28rem;
    padding: 0 0.62rem;
    color: var(--soft);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.sidebar-heading:first-child {
    margin-top: 0;
}

.sidebar-link {
    display: block;
    padding: 0.42rem 0.62rem;
    font-size: 0.92rem;
}

.sidebar-link.active,
.toc a.active {
    color: var(--text);
    background: var(--accent-soft);
}

.content {
    min-width: 0;
    padding: 3.4rem 0 5rem;
}

.doc-article {
    position: relative;
}

.eyebrow {
    margin-bottom: 0.55rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
    line-height: 1.2;
}

h1 {
    max-width: 720px;
    font-size: 2.8rem;
    font-weight: 760;
}

h2 {
    padding-top: 0.1rem;
    font-size: 2.25rem;
    font-weight: 720;
}

h3 {
    margin-top: 1.8rem;
    font-size: 1.08rem;
    font-weight: 720;
}

p {
    margin: 0.85rem 0 0;
    color: var(--muted);
}

.lead {
    max-width: 760px;
    margin-top: 1.1rem;
    color: color-mix(in srgb, var(--text) 78%, var(--muted));
    font-size: 1.1rem;
    line-height: 1.85;
}

.copy-page {
    position: absolute;
    top: 0.3rem;
    right: 0;
    padding: 0.42rem 0.66rem;
    color: var(--muted);
    font-size: 0.84rem;
}

.intro-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 2.2rem 0 3rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.intro-strip div {
    min-width: 0;
    padding: 1rem 1.05rem;
    border-right: 1px solid var(--border);
}

.intro-strip div:last-child {
    border-right: 0;
}

.intro-strip strong,
.intro-strip span {
    display: block;
}

.intro-strip strong {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
}

.intro-strip span {
    color: var(--muted);
    font-size: 0.92rem;
}

.doc-section {
    padding: 3.1rem 0;
    border-top: 1px solid var(--border);
}

.doc-section:first-of-type {
    border-top: 0;
}

.final-section {
    padding-bottom: 0;
}

.steps {
    margin: 1rem 0 0;
    padding-left: 1.3rem;
    color: var(--muted);
}

.steps li {
    padding-left: 0.25rem;
    margin: 0.62rem 0;
}

.steps.prominent {
    display: grid;
    gap: 0.85rem;
    padding: 0;
    list-style: none;
}

.steps.prominent li {
    position: relative;
    margin: 0;
    padding: 0 0 0.95rem 2.2rem;
    border-bottom: 1px solid var(--border);
}

.steps.prominent li::before {
    content: counter(list-item);
    position: absolute;
    top: 0.12rem;
    left: 0;
    display: inline-flex;
    width: 1.4rem;
    height: 1.4rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
}

.steps.prominent span {
    display: block;
    margin-bottom: 0.14rem;
    color: var(--text);
    font-weight: 700;
}

.compact-list {
    margin: 1rem 0 0;
    padding-left: 1.15rem;
    color: var(--muted);
}

.compact-list li {
    margin: 0.48rem 0;
    padding-left: 0.18rem;
}

.callout {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface-muted));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.callout strong {
    display: block;
    color: var(--text);
}

.callout p {
    margin-top: 0.28rem;
}

.callout.warning {
    background: color-mix(in srgb, var(--warning) 9%, var(--surface-muted));
}

.definition-table,
.mode-table,
.permission-list {
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.definition-table div,
.mode-table div,
.permission-list div {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.88rem 1rem;
    border-bottom: 1px solid var(--border);
}

.definition-table div:last-child,
.mode-table div:last-child,
.permission-list div:last-child {
    border-bottom: 0;
}

.definition-table strong,
.mode-table strong,
.permission-list strong {
    color: var(--text);
}

.definition-table span,
.mode-table span,
.permission-list span {
    color: var(--muted);
}

.mode-table.compact div {
    grid-template-columns: 140px minmax(0, 1fr);
}

.embed-position-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.embed-position-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
}

.embed-position-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 7px;
}

.settings-position-figure {
    max-width: 660px;
    margin: 1rem 0 0;
}

.embed-position-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.embed-position-heading strong {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
}

.embed-position-heading span {
    color: var(--muted);
    font-size: 0.86rem;
}

.platform-sketch {
    position: relative;
    overflow: hidden;
    min-height: 270px;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-solid), var(--surface-muted));
}

.sketch-player {
    display: flex;
    height: 126px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #0f172a;
}

.sketch-player span {
    display: block;
    width: 0;
    height: 0;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 20px solid rgba(255, 255, 255, 0.72);
}

.rtl-pill {
    display: inline-flex;
    width: max-content;
    min-height: 30px;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.72rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.rtl-pill::before {
    content: "";
    width: 0.78rem;
    height: 0.78rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.youtube-pill {
    background: var(--youtube);
}

.twitch-pill {
    background: var(--twitch);
}

.yt-above-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    gap: 0.75rem;
}

.youtube-pill.is-optional {
    opacity: 0.68;
}

.youtube-pill.is-default {
    outline: 2px solid color-mix(in srgb, var(--youtube) 38%, white);
    outline-offset: 3px;
}

.sketch-title-line {
    width: 72%;
    height: 10px;
    margin: 0.12rem 0 0.78rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 20%, transparent);
}

.yt-channel-row,
.twitch-live-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
}

.sketch-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text) 18%, transparent);
}

.sketch-channel-lines {
    display: grid;
    min-width: 74px;
    gap: 0.4rem;
}

.sketch-channel-lines i {
    display: block;
    height: 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 18%, transparent);
}

.sketch-channel-lines i:first-child {
    width: 72px;
}

.sketch-channel-lines i:last-child {
    width: 46px;
    opacity: 0.72;
}

.youtube-pill.is-channel-right {
    margin-left: 0;
}

.sketch-native-actions {
    width: 76px;
    height: 30px;
    flex: 0 0 auto;
    margin-left: auto;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 9%, transparent);
}

.yt-channel-below {
    margin-top: 0.7rem;
    padding-left: 0;
}

.twitch-player {
    height: 142px;
}

.twitch-live-row {
    margin-top: 0.88rem;
}

.twitch-live-row .rtl-pill {
    margin-left: auto;
}

.twitch-follow-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 0.78rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--twitch) 18%, var(--surface-solid));
    color: var(--twitch);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.position-legend {
    margin: 0.85rem 0 0;
    padding-left: 1.15rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.position-legend li {
    margin: 0.42rem 0;
    padding-left: 0.15rem;
}

.position-legend strong {
    color: var(--text);
}

.embed-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.embed-mode-option {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
}

.embed-mode-option.is-default {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 68%), var(--surface);
}

.embed-mode-preview {
    display: flex;
    min-height: 112px;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(7, 12, 23, 0.96), rgba(10, 18, 32, 0.96));
}

.embed-simple-button,
.embed-input-button {
    display: inline-flex;
    max-width: 100%;
    height: 38px;
    align-items: center;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.embed-simple-button > span,
.embed-input-button > span {
    flex-shrink: 0;
}

.embed-simple-button > span:not(.preview-separator),
.embed-input-button > span:not(.preview-separator) {
    display: inline-flex;
    align-items: center;
}

.embed-simple-button > span:first-child,
.embed-input-button .preview-clock {
    margin-left: 0.85rem;
}

.embed-simple-button > span:nth-child(2),
.embed-input-button > span:last-child {
    padding: 0 0.85rem 0 0.45rem;
}

.embed-placeholder {
    min-width: 110px;
    max-width: 140px;
    height: 100%;
    padding: 0 0.85rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
    color: rgba(248, 250, 252, 0.46);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.17);
}

.preview-clock {
    position: relative;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.preview-clock::before,
.preview-clock::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: bottom center;
}

.preview-clock::before {
    height: 5px;
    transform: translateX(-50%);
}

.preview-clock::after {
    height: 6px;
    transform: translateX(-50%) rotate(132deg);
}

.preview-chevron {
    position: relative;
    width: 36px;
    height: 100%;
}

.preview-chevron::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -62%) rotate(45deg);
}

.embed-mode-copy {
    padding: 0.95rem 1rem 1.05rem;
}

.embed-mode-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.embed-mode-heading h4 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.25;
}

.embed-mode-heading span {
    flex-shrink: 0;
    padding: 0.18rem 0.46rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.embed-mode-copy p {
    margin-top: 0.52rem;
    font-size: 0.94rem;
    line-height: 1.7;
}

.timeline-marker-figure {
    margin: 1rem 0 1.2rem;
}

.timeline-marker-demo {
    position: relative;
    width: min(100%, 620px);
    aspect-ratio: 619 / 75;
    overflow: hidden;
    background: #101010;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.timeline-marker-video {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 74%, rgba(129, 8, 16, 0.82) 0 9%, transparent 10%),
        radial-gradient(circle at 37% 24%, rgba(181, 139, 58, 0.28) 0 14%, transparent 15%),
        radial-gradient(circle at 70% 20%, rgba(121, 82, 36, 0.4) 0 22%, transparent 23%),
        linear-gradient(90deg, rgba(43, 22, 12, 0.92), rgba(96, 67, 35, 0.82) 50%, rgba(26, 22, 20, 0.92));
}

.timeline-marker-video::before,
.timeline-marker-video::after {
    content: "";
    position: absolute;
    opacity: 0.7;
}

.timeline-marker-video::before {
    left: 31%;
    top: 2%;
    width: 5.1%;
    height: 34%;
    border: 2px solid rgba(30, 24, 18, 0.75);
    border-radius: 2px;
    background: rgba(189, 176, 143, 0.62);
}

.timeline-marker-video::after {
    right: 7.4%;
    bottom: 22%;
    width: 23px;
    height: 18px;
    border-radius: 4px;
    background: rgba(32, 34, 38, 0.62);
    box-shadow: 34px 7px 0 rgba(32, 34, 38, 0.58);
}

.timeline-marker-control {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 42px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.66), rgba(5, 5, 5, 0.88));
}

.timeline-marker-rail,
.timeline-marker-progress {
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    height: 7px;
}

.timeline-marker-rail {
    background: rgba(90, 90, 90, 0.95);
}

.timeline-marker-progress {
    background: #a86bff;
    box-shadow: 0 0 9px rgba(168, 107, 255, 0.42);
}

.timeline-record-marker {
    position: absolute;
    top: -4px;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.42);
    transform: translateX(-50%) rotate(45deg);
}

.timeline-record-marker.marker-one {
    left: 7.8%;
}

.timeline-record-marker.marker-two {
    left: 17.6%;
}

.timeline-record-marker.marker-three {
    left: 90.4%;
}

.timeline-marker-figure figcaption {
    margin-top: 0.55rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.shortcut-grid {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.shortcut-grid div {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
}

.shortcut-grid .shortcut-combo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.shortcut-grid span:not(.shortcut-combo) {
    color: var(--muted);
    font-weight: 400;
}

.interface-annotated-figure {
    margin: 1.35rem 0 0;
}

.interface-annotated-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 1rem;
    align-items: start;
}

.interface-shot-wrap {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #071424;
    box-shadow: var(--shadow);
}

.interface-shot-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

.interface-callout-box,
.interface-callout-dot {
    position: absolute;
    pointer-events: none;
}

.interface-callout-box {
    border: 2px solid #ef4444;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.interface-callout-dot {
    display: inline-flex;
    width: 1.65rem;
    height: 1.65rem;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.26);
}

.callout-folders {
    left: 1.2%;
    top: 8.7%;
    width: 35.4%;
    height: 82.2%;
}

.callout-toolbar {
    left: 93.5%;
    top: 1.7%;
    width: 4.6%;
    height: 4.8%;
}

.callout-records {
    left: 39.2%;
    top: 9.2%;
    width: 56.8%;
    height: 69.6%;
}

.callout-create {
    left: 39.2%;
    top: 81.8%;
    width: 59%;
    height: 7.3%;
}

.callout-footer {
    left: 1%;
    top: 91%;
    width: 98%;
    height: 7.6%;
}

.dot-folders {
    left: 34.8%;
    top: 10.2%;
}

.dot-toolbar {
    left: 91.5%;
    top: 1.6%;
}

.dot-records {
    left: 92.4%;
    top: 10.5%;
}

.dot-create {
    left: 94.6%;
    top: 80.5%;
}

.dot-footer {
    left: 93%;
    top: 89.7%;
}

.interface-notes {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.interface-notes li {
    position: relative;
    min-width: 0;
    padding: 0.72rem 0.78rem 0.72rem 2.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.interface-notes li::before {
    content: counter(list-item);
    position: absolute;
    top: 0.76rem;
    left: 0.74rem;
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 850;
}

.interface-notes strong,
.interface-notes span {
    display: block;
}

.interface-notes strong {
    color: var(--text);
    line-height: 1.25;
}

.interface-notes span {
    margin-top: 0.24rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.record-actions-figure {
    margin: 1.1rem 0 0;
}

.record-actions-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.48fr);
    gap: 1rem;
    align-items: start;
}

.record-actions-shot-wrap {
    position: relative;
    min-width: 0;
    align-self: start;
}

.record-actions-shot {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #071424;
    box-shadow: var(--shadow);
}

.record-action-callout-box,
.record-action-callout-dot {
    position: absolute;
    pointer-events: none;
}

.record-action-callout-box {
    border: 2px solid #ef4444;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.record-action-callout-dot {
    display: inline-flex;
    width: 1.65rem;
    height: 1.65rem;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.26);
}

.menu-trigger {
    left: 93.8%;
    top: 1.6%;
    width: 4.6%;
    height: 4.8%;
}

.menu-search,
.menu-batch,
.menu-organize,
.menu-import,
.menu-backup,
.menu-trash {
    left: 71.9%;
    width: 25.2%;
    height: 5.2%;
}

.menu-search {
    top: 8.8%;
}

.menu-batch {
    top: 15.5%;
}

.menu-organize {
    top: 22.2%;
}

.menu-import {
    top: 28.9%;
}

.menu-backup {
    top: 35.6%;
}

.menu-trash {
    top: 42.3%;
}

.dot-menu-trigger {
    left: 91.8%;
    top: 1.6%;
}

.dot-menu-search,
.dot-menu-batch,
.dot-menu-organize,
.dot-menu-import,
.dot-menu-backup,
.dot-menu-trash {
    left: 69.9%;
}

.dot-menu-search {
    top: 8.6%;
}

.dot-menu-batch {
    top: 15.3%;
}

.dot-menu-organize {
    top: 22%;
}

.dot-menu-import {
    top: 28.7%;
}

.dot-menu-backup {
    top: 35.4%;
}

.dot-menu-trash {
    top: 42.1%;
}

.record-actions-copy {
    padding: 1rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.record-actions-copy h4 {
    margin: 0 0 0.7rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.3;
}

.record-actions-notes {
    display: grid;
    gap: 0.66rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.record-actions-notes li {
    position: relative;
    min-width: 0;
    padding-left: 2.2rem;
}

.record-actions-notes li::before {
    content: counter(list-item);
    position: absolute;
    top: 0.08rem;
    left: 0;
    display: inline-flex;
    width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 850;
    line-height: 1;
}

.record-actions-notes strong,
.record-actions-notes span {
    display: block;
}

.record-actions-notes strong {
    color: var(--text);
    line-height: 1.25;
}

.record-actions-notes span {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.52rem;
    margin-top: 1rem;
}

.status-list span {
    padding: 0.32rem 0.58rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.86rem;
}

.faq-list {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}

.faq-list details {
    border-bottom: 1px solid var(--border);
}

.faq-list summary {
    cursor: pointer;
    padding: 1rem 0;
    color: var(--text);
    font-weight: 700;
}

.faq-list p {
    margin: 0;
    padding: 0 0 1rem;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.link-row a,
.doc-section p a,
.doc-section li a {
    padding: 0.02rem 0.16rem;
    border-radius: 6px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.doc-section p a:hover,
.doc-section li a:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.link-row a {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    text-decoration: none;
}

.toc {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    align-self: start;
}

.toc-inner {
    padding-top: 3.35rem;
}

.toc-title {
    margin-bottom: 0.45rem;
    color: var(--soft);
    font-size: 0.75rem;
    font-weight: 800;
}

.toc a {
    display: block;
    padding: 0.34rem 0.5rem;
    font-size: 0.84rem;
}

.mobile-backdrop {
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: 39;
    background: rgba(2, 6, 23, 0.3);
    backdrop-filter: blur(2px);
}

.search-dialog {
    width: min(680px, calc(100vw - 2rem));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.search-dialog::backdrop {
    background: rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(5px);
}

.search-panel {
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-solid);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.search-field span {
    width: 15px;
    height: 15px;
    border: 2px solid var(--soft);
    border-radius: 50%;
    position: relative;
}

.search-field span::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: var(--soft);
    transform: rotate(45deg);
}

.search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    outline: 0;
}

.search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 0.45rem;
}

.search-results button {
    display: block;
    width: 100%;
    padding: 0.72rem 0.8rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.search-results button:hover,
.search-results button.selected {
    background: var(--accent-soft);
}

.search-results strong,
.search-results span {
    display: block;
}

.search-results span {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.empty-result {
    padding: 1rem;
    color: var(--muted);
}

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

    .toc {
        display: none;
    }

    h1 {
        font-size: 2.55rem;
    }
}

@media (max-width: 880px) {
    .top-links {
        display: none;
    }

    .nav-toggle {
        display: inline-block;
        order: -1;
    }

    .search-trigger {
        min-width: 156px;
    }

    .language-control label {
        display: none;
    }

    .search-trigger span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .docs-layout {
        display: block;
        padding: 0 1rem;
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(320px, 86vw);
        height: auto;
        border-right: 1px solid var(--border);
        background: var(--surface-solid);
        transform: translateX(-104%);
        transition: transform 0.22s ease;
        box-shadow: 20px 0 70px rgba(2, 6, 23, 0.2);
    }

    .nav-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-scroll {
        padding: 1rem;
    }

    .content {
        padding-top: 2.2rem;
    }

    h1 {
        font-size: 2.35rem;
    }

    h2 {
        font-size: 2rem;
    }

    .copy-page {
        position: static;
        margin-top: 1rem;
    }

    .intro-strip {
        grid-template-columns: 1fr;
    }

    .intro-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .intro-strip div:last-child {
        border-bottom: 0;
    }

    .definition-table div,
    .mode-table div,
    .mode-table.compact div,
    .permission-list div,
    .shortcut-grid div {
        grid-template-columns: 1fr;
    }

    .interface-annotated-layout,
    .record-actions-layout {
        grid-template-columns: 1fr;
    }

    .embed-position-grid,
    .embed-mode-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    :root {
        --header-height: 58px;
    }

    .topbar-inner {
        gap: 0.55rem;
        padding: 0 0.8rem;
    }

    .brand span:first-of-type {
        max-width: 128px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-docs {
        display: none;
    }

    .search-trigger {
        width: 38px;
        min-width: 38px;
        justify-content: center;
        padding: 0;
    }

    .language-control {
        padding: 0 0.34rem;
    }

    .language-select {
        width: 4.6rem;
        max-width: 4.6rem;
        font-size: 0.82rem;
    }

    .search-trigger span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .search-trigger kbd {
        display: none;
    }

    .search-trigger::before {
        content: "";
        width: 15px;
        height: 15px;
        border: 2px solid currentColor;
        border-radius: 50%;
    }

    .search-trigger::after {
        content: "";
        width: 7px;
        height: 2px;
        margin-left: -5px;
        margin-top: 13px;
        border-radius: 999px;
        background: currentColor;
        transform: rotate(45deg);
    }

    .doc-section {
        padding: 2.35rem 0;
    }

    h1 {
        font-size: 2.05rem;
    }

    h2 {
        font-size: 1.72rem;
    }

    .lead {
        font-size: 1rem;
    }

    .interface-notes li {
        padding-right: 0.7rem;
    }

    .record-actions-copy {
        padding: 0.9rem;
    }

    .platform-sketch {
        min-height: 248px;
        padding: 0.68rem;
    }

    .rtl-pill,
    .twitch-follow-pill {
        min-height: 28px;
        padding: 0 0.58rem;
        font-size: 0.78rem;
    }

    .sketch-native-actions {
        width: 48px;
    }

    .yt-channel-below {
        padding-left: 0;
    }
}

@media (max-width: 420px) {
    .brand span:first-of-type {
        display: none;
    }

    .top-actions {
        gap: 0.42rem;
    }

    .language-select {
        width: 4.1rem;
        max-width: 4.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
