@import url("../api/stylesheet.css");

:root {
    --tutorial-accent: #2a6b9b;
    --tutorial-accent-soft: #eaf3fb;
    --tutorial-success: #2f7a48;
    --tutorial-success-soft: #eef8f1;
    --tutorial-warn: #9b641f;
    --tutorial-warn-soft: #fff7ec;
    --tutorial-danger: #9d3c3c;
    --tutorial-danger-soft: #fff1f1;
    --tutorial-border: #ccd8e3;
    --tutorial-surface: #ffffff;
    --tutorial-surface-soft: #f8fbfe;
    --tutorial-text-soft: #42576b;
    --tutorial-shadow: 0 10px 30px rgba(28, 54, 77, 0.06);
}

body {
    line-height: 1.65;
}

.docs-home,
.tutorial-doc {
    min-height: 100vh;
}

.docs-home-wrap,
.tutorial-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px 42px;
}

#tutorialTopbar {
    margin-bottom: 16px;
    border: 1px solid var(--tutorial-border);
    border-radius: 10px;
    background: var(--tutorial-surface);
    box-shadow: var(--tutorial-shadow);
    overflow: hidden;
}

#tutorialTopbar .top-links {
    margin-bottom: 0;
    border: 0;
    background: transparent;
    padding: 12px 16px;
}

.top-links .link-btn,
.top-links .link-btn:visited {
    appearance: none;
    border: 1px solid #c4d3e1;
    background: #ffffff;
    color: #1a5f91;
    border-radius: 6px;
    padding: 7px 12px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.top-links .link-btn:hover {
    background: #f4f8fc;
    text-decoration: none;
}

.top-links .link-btn.theme-icon-btn,
.top-links .link-btn.theme-icon-btn:visited {
    width: 40px;
    min-width: 40px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-hero,
.tutorial-article {
    border: 1px solid var(--tutorial-border);
    border-radius: 10px;
    background: var(--tutorial-surface);
    box-shadow: var(--tutorial-shadow);
}

.home-hero {
    padding: 32px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #fafcff 0%, #edf5fb 100%);
}

.home-hero .member-path {
    margin-bottom: 10px;
    font-size: 42px;
}

.home-hero .lead,
.tutorial-hero .lead {
    max-width: 900px;
    font-size: 18px;
    color: var(--tutorial-text-soft);
}

.home-grid,
.summary-grid,
.two-col {
    display: grid;
    gap: 16px;
}

.home-grid,
.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card,
.home-card,
.tutorial-panel,
.callout,
.pager-card {
    border: 1px solid var(--tutorial-border);
    border-radius: 8px;
    background: var(--tutorial-surface-soft);
}

.summary-card,
.home-card,
.pager-card {
    padding: 16px 18px;
}

.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.sample-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--tutorial-border);
    border-radius: 8px;
    background: var(--tutorial-surface-soft);
    padding: 16px 18px;
}

.sample-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sample-card-head h3 {
    margin: 0;
}

.sample-card p {
    margin: 0;
}

.sample-card pre.code {
    margin: auto 0 0 0;
}

.sample-launch-code {
    position: relative;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sample-launch-code:hover,
.sample-launch-code:focus-visible {
    border-color: #8fb6d8;
    box-shadow: 0 10px 24px rgba(26, 55, 82, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.sample-lightbox-open {
    overflow: hidden;
}

.sample-lightbox[hidden] {
    display: none;
}

.sample-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px;
}

.sample-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 16, 27, 0.64);
    backdrop-filter: blur(5px);
}

.sample-lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(1080px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--tutorial-border);
    border-radius: 14px;
    background: var(--tutorial-surface);
    box-shadow: 0 28px 80px rgba(4, 14, 24, 0.34);
}

.sample-lightbox-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--tutorial-border);
    background: var(--tutorial-surface-soft);
}

.sample-lightbox-title {
    color: var(--tutorial-heading);
    font-size: 18px;
    font-weight: 800;
}

.sample-lightbox-path {
    margin-top: 3px;
    color: var(--tutorial-text-soft);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

.sample-lightbox-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--tutorial-border);
    border-radius: 999px;
    background: var(--tutorial-surface);
    color: var(--tutorial-heading);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.sample-lightbox-close:hover,
.sample-lightbox-close:focus-visible {
    border-color: #8fb6d8;
    outline: none;
}

.sample-lightbox-code {
    flex: 1;
    min-height: 0;
    margin: 0;
    overflow: auto;
    border: 0;
    border-radius: 0;
}

.summary-card h3,
.home-card h3,
.pager-card .pager-title {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.summary-card p,
.home-card p,
.pager-card p {
    margin: 0;
    color: var(--tutorial-text-soft);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tutorial-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.tutorial-sidebar {
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tutorial-panel {
    overflow: hidden;
}

.tutorial-panel .nav-pane-header {
    margin: 0;
}

.tutorial-panel-body {
    padding: 14px;
}

.tutorial-nav-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutorial-nav-group {
    overflow: hidden;
    border: 1px solid #d7e2eb;
    border-radius: 8px;
    background: #ffffff;
}

.tutorial-nav-group-button {
    width: 100%;
    appearance: none;
    border: 0;
    background: #f4f8fc;
    color: #36546d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

.tutorial-nav-group-button:hover {
    background: #eef5fa;
}

.tutorial-nav-group.is-open .tutorial-nav-group-button {
    background: #eaf3fb;
    color: #123e64;
}

.tutorial-nav-group-chevron {
    color: #68829a;
    transition: transform 0.16s ease;
}

.tutorial-nav-group.is-open .tutorial-nav-group-chevron {
    transform: rotate(180deg);
}

.tutorial-nav-group-panel {
    padding: 8px;
    border-top: 1px solid #d7e2eb;
}

.tutorial-nav-group-panel[hidden] {
    display: none;
}

.tutorial-nav-list,
.toc-list,
.guide-list {
    margin: 0;
    padding-left: 18px;
}

.tutorial-nav-list {
    list-style: none;
    padding-left: 0;
}

.tutorial-nav-list li + li {
    margin-top: 3px;
}

.tutorial-nav-list a {
    display: block;
    padding: 7px 9px;
    border-radius: 6px;
    color: #274861;
    text-decoration: none;
}

.tutorial-nav-list a:hover {
    background: #eef5fa;
}

.tutorial-nav-list a.current {
    background: var(--tutorial-accent-soft);
    color: #123e64;
    font-weight: 700;
}

.tutorial-nav-group-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #486179;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tutorial-main {
    min-width: 0;
}

.tutorial-article {
    padding: 26px 30px 30px;
}

.tutorial-hero {
    margin-bottom: 24px;
}

.tutorial-article h2 {
    margin-top: 32px;
}

.tutorial-article h2:first-of-type {
    margin-top: 0;
}

.tutorial-article h3 {
    margin: 18px 0 8px 0;
    font-size: 18px;
    color: #30495f;
}

.tutorial-article p {
    margin: 0 0 12px 0;
}

.guide-section + .guide-section {
    margin-top: 28px;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 18px;
    table-layout: fixed;
}

.guide-table th,
.guide-table td {
    border: 1px solid #d7e2eb;
    padding: 10px 12px;
    vertical-align: top;
}

.guide-table th {
    background: #eef4fa;
    color: #30495f;
    text-align: left;
    font-weight: 600;
}

.tutorial-screenshot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0 18px;
}

.tutorial-figure {
    margin: 0;
    border: 1px solid var(--tutorial-border);
    border-radius: 10px;
    background: var(--tutorial-surface-soft);
    padding: 12px;
}

.tutorial-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(20, 45, 64, 0.16);
}

.tutorial-figure figcaption {
    margin-top: 10px;
    color: var(--tutorial-text-soft);
    font-size: 0.92rem;
    line-height: 1.45;
}

.callout {
    padding: 14px 16px;
    margin: 16px 0;
    border-left: 4px solid var(--tutorial-accent);
    background: #f6fbff;
}

.callout-title {
    margin: 0 0 6px 0;
    font-weight: 700;
    color: #234c6c;
}

.callout.warn {
    border-left-color: var(--tutorial-warn);
    background: var(--tutorial-warn-soft);
}

.callout.warn .callout-title {
    color: #6d4614;
}

.callout.success {
    border-left-color: var(--tutorial-success);
    background: var(--tutorial-success-soft);
}

.callout.success .callout-title {
    color: #255b37;
}

.callout.danger {
    border-left-color: var(--tutorial-danger);
    background: var(--tutorial-danger-soft);
}

.callout.danger .callout-title {
    color: #6f2a2a;
}

.callout p:last-child,
.callout ul:last-child,
.callout ol:last-child {
    margin-bottom: 0;
}

.doc-checklist {
    margin: 0;
    padding-left: 18px;
}

.doc-checklist li + li {
    margin-top: 6px;
}

.doc-pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.tutorial-footer {
    margin-top: 22px;
    border: 1px solid var(--tutorial-border);
    border-radius: 10px;
    background: rgba(248, 251, 254, 0.96);
    box-shadow: var(--tutorial-shadow);
}

.tutorial-footer-inner {
    padding: 12px 16px;
}

.tutorial-footer p {
    margin: 0;
    color: var(--tutorial-text-soft);
    font-size: 0.95rem;
}

.tutorial-footer a {
    color: #1a5f91;
}

.footer-separator {
    padding: 0 0.45rem;
    color: #9fb1c1;
}

.pager-card .small {
    display: block;
    margin-bottom: 8px;
}

.pager-card a {
    font-weight: 600;
}

.home-section {
    margin-top: 22px;
}

.home-section .h2,
.tutorial-article .h2 {
    display: block;
}

pre.code {
    margin: 14px 0 18px;
    line-height: 1.5;
    font-size: 13px;
}

pre.code code {
    font-family: Consolas, "Courier New", monospace;
}

code.inline-strong {
    font-weight: 700;
}

.tok-com,
.tok-cmt {
    color: #6b7f93;
    font-style: italic;
}

.docs-home .member-summary,
.tutorial-doc .member-summary {
    margin: 0;
}

.constructor-list .member-summary + .member-summary {
    margin-top: 16px;
}

.constructor-list .member-summary .doc-code {
    margin-bottom: 12px;
}

body.theme-dark .home-hero,
body.theme-dark .tutorial-article,
body.theme-dark #tutorialTopbar {
    background: #121a23;
    border-color: #3a4a59;
    box-shadow: none;
}

body.theme-dark #tutorialTopbar .top-links {
    border: 0;
    background: transparent;
}

body.theme-dark .home-hero {
    background: linear-gradient(135deg, #16212c 0%, #11202d 100%);
}

body.theme-dark .home-hero .lead,
body.theme-dark .tutorial-hero .lead,
body.theme-dark .summary-card p,
body.theme-dark .home-card p,
body.theme-dark .pager-card p,
body.theme-dark .tutorial-article p {
    color: #a7b8c9;
}

body.theme-dark .summary-card,
body.theme-dark .home-card,
body.theme-dark .sample-card,
body.theme-dark .tutorial-panel,
body.theme-dark .tutorial-footer,
body.theme-dark .pager-card {
    background: #18222d;
    border-color: #3d4e5d;
}

body.theme-dark .sample-launch-code:hover,
body.theme-dark .sample-launch-code:focus-visible {
    border-color: #6b8faa;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

body.theme-dark .sample-lightbox-panel {
    background: #121a23;
    border-color: #3d4e5d;
}

body.theme-dark .sample-lightbox-header {
    background: #18222d;
    border-color: #3d4e5d;
}

body.theme-dark .sample-lightbox-close {
    background: #121a23;
    border-color: #3d4e5d;
    color: #e3edf7;
}

body.theme-dark .tutorial-footer p {
    color: #a7b8c9;
}

body.theme-dark .tutorial-footer a {
    color: #8ab9e8;
}

body.theme-dark .footer-separator {
    color: #3d4e5d;
}

body.theme-dark .tutorial-nav-group-title {
    color: #9fb0c2;
}

body.theme-dark .tutorial-nav-group {
    background: #151f29;
    border-color: #3d4e5d;
}

body.theme-dark .tutorial-nav-group-button {
    background: #1c2935;
    color: #c7d8e7;
}

body.theme-dark .tutorial-nav-group-button:hover {
    background: #233240;
}

body.theme-dark .tutorial-nav-group.is-open .tutorial-nav-group-button {
    background: #23384b;
    color: #e8f1f8;
}

body.theme-dark .tutorial-nav-group-panel {
    border-color: #3d4e5d;
}

body.theme-dark .tutorial-nav-group-chevron {
    color: #9fb0c2;
}

body.theme-dark .tutorial-nav-list a {
    color: #cfdeeb;
}

body.theme-dark .tutorial-nav-list a:hover {
    background: #233240;
}

body.theme-dark .tutorial-nav-list a.current {
    background: #23384b;
    color: #e8f1f8;
}

body.theme-dark .guide-table th,
body.theme-dark .guide-table td {
    border-color: #37495a;
}

body.theme-dark .guide-table th {
    background: #202d3a;
    color: #d4e0ec;
}

body.theme-dark .tutorial-figure {
    background: #18222d;
    border-color: #3d4e5d;
}

body.theme-dark .tutorial-figure figcaption {
    color: #a7b8c9;
}

body.theme-dark .callout {
    background: #142330;
    border-color: #4e7698;
}

body.theme-dark .callout .callout-title {
    color: #afd4f4;
}

body.theme-dark .callout.warn {
    background: #2a2114;
    border-color: #b88433;
}

body.theme-dark .callout.warn .callout-title {
    color: #f0cb8e;
}

body.theme-dark .callout.success {
    background: #14261a;
    border-color: #4f9463;
}

body.theme-dark .callout.success .callout-title {
    color: #a6ddb4;
}

body.theme-dark .callout.danger {
    background: #2b1717;
    border-color: #b35d5d;
}

body.theme-dark .callout.danger .callout-title {
    color: #f0b1b1;
}

body.theme-dark .top-links .link-btn,
body.theme-dark .top-links .link-btn:visited {
    background: #121a23;
    color: #8ab9e8;
    border-color: #3a4654;
}

body.theme-dark .top-links .link-btn:hover {
    background: #1b2530;
}

body.theme-dark .tok-com,
body.theme-dark .tok-cmt {
    color: #7f97ac;
}

@media (max-width: 980px) {
    .tutorial-layout,
    .two-col {
        grid-template-columns: 1fr;
    }

    .tutorial-sidebar {
        position: static;
    }

    .doc-pager {
        grid-template-columns: 1fr;
    }

    .tutorial-screenshot-grid {
        grid-template-columns: 1fr;
    }

    .home-hero,
    .tutorial-article {
        padding: 22px 20px;
    }
}
