:root {
    color-scheme: light;
    --bg: #fff;
    --surface: #f8fafc;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e4eaf1;
    --blue: #2563eb;
    --light-blue: #eff6ff;
    --nav: #0f172a;
    --top: 64px
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.7
}

a {
    color: var(--blue);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button,
input {
    font: inherit
}

.topbar {
    height: var(--top);
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 28px;
    border-bottom: 1px solid #243047;
    background: var(--nav);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20
}

.brand {
    color: white;
    font-size: 17px;
    letter-spacing: -.02em;
    font-weight: 750;
    display: flex;
    gap: 12px;
    align-items: center;
    white-space: nowrap
}

.brand:hover {
    text-decoration: none
}

.brand-mark {
    width: 34px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    background: #3b82f6;
    border-radius: 10px;
    font-weight: 850;
    font-size: 20px
}

.brand-logo {
    width: 34px;
    height: 40px;
    background-image: url(../assets/icon.png);
    background-size: cover;
    border-radius: 10px;
    font-weight: 850;
    font-size: 20px
}

.brand-muted {
    font-weight: 450;
    color: #8fa1be
}

.topbar-center {
    color: #91a0b7;
    font-size: 13px;
    margin-left: 20px
}

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

.search-trigger {
    cursor: pointer;
    border: 1px solid #334155;
    background: #1e293b;
    color: #b9c6da;
    border-radius: 8px;
    padding: 6px 9px 6px 13px;
    min-width: 235px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 11px
}

.search-trigger span {
    font-size: 24px;
    line-height: 1
}

.search-trigger kbd {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 6px;
    color: #aebdd2;
    border: 1px solid #475569;
    border-radius: 4px
}

.github-link {
    color: #c5d1e3;
    font-weight: 600
}

.github-link:hover {
    color: #fff
}

.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 210px;
    min-height: calc(100vh - var(--top));
    max-width: 1650px;
    margin: auto
}

.sidebar {
    position: sticky;
    top: var(--top);
    height: calc(100vh - var(--top));
    padding: 29px 14px 15px 20px;
    border-right: 1px solid var(--border);
    overflow: auto;
    display: flex;
    flex-direction: column;
    background: #fbfcfe
}

.sidebar-label {
    font-size: 11px;
    letter-spacing: .10em;
    font-weight: 800;
    color: #94a3b8;
    padding: 0 14px;
    margin-bottom: 15px;
    text-transform: uppercase
}

.nav-group {
    margin-bottom: 22px
}

.nav-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 800;
    color: #94a3b8;
    margin: 0 14px 7px
}

.nav-link {
    display: block;
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 7px;
    color: #536477;
    font-weight: 540;
    line-height: 1.35
}

.nav-link:hover {
    background: #eff4fb;
    color: var(--text);
    text-decoration: none
}

.nav-link.active {
    background: #eaf2ff;
    color: #1d4ed8;
    font-weight: 750
}

.nav-packages {
    list-style: none;
    margin: 0 0 0 14px;
    padding: 0
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 17px 6px 0;
    color: #91a0b2;
    font-size: 11px
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 5px
}

.side-version {
    float: right
}

.content-wrap {
    min-width: 0
}

.content-inner {
    max-width: 940px;
    padding: 31px clamp(26px, 5vw, 75px) 60px;
    margin: auto
}

.breadcrumbs {
    display: flex;
    gap: 9px;
    align-items: center;
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 27px
}

.breadcrumbs a {
    color: #64748b
}

.breadcrumbs .sep {
    color: #cbd5e1
}

.doc-content {
    font-size: 15px;
    line-height: 1.85
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
    color: #0f172a;
    letter-spacing: -.035em;
    line-height: 1.35;
    scroll-margin-top: 90px
}

.doc-content h1 {
    font-size: 37px;
    font-weight: 780;
    margin: 0 0 18px
}

.doc-content h2 {
    font-size: 25px;
    margin: 43px 0 14px;
    padding-top: 3px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px
}

.doc-content h3 {
    font-size: 19px;
    margin-top: 29px
}

.doc-content p {
    margin: 12px 0 20px
}

.doc-content ul,
.doc-content ol {
    padding-left: 25px
}

.doc-content li {
    margin: 7px 0
}

.doc-content strong {
    color: #243348
}

.doc-content code {
    background: #f1f5f9;
    color: #bb3554;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: .86em
}

.doc-diagram {
    margin: 1.25em 0;
    overflow-x: auto
}

.doc-diagram svg {
    display: block;
    margin-inline: auto
}

.doc-content pre {
    overflow: auto;
    background: #101b2b;
    color: #d5e2f2;
    padding: 19px 22px;
    border-radius: 10px;
    line-height: 1.55;
    font-size: 13px
}

.doc-content pre code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit
}

.doc-content blockquote {
    margin: 22px 0;
    padding: 10px 19px;
    border-left: 4px solid #60a5fa;
    background: #eff6ff;
    border-radius: 0 8px 8px 0;
    color: #36506c
}

.doc-content blockquote p {
    margin: 4px 0
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 25px;
    display: block;
    overflow: auto
}

.doc-content th,
.doc-content td {
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--border)
}

.doc-content th {
    background: #f7f9fc
}

.doc-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 36px 0
}

.doc-content a {
    font-weight: 520
}

.doc-content .soup-lead {
    font-size: 18px;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 26px
}

.soup-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0 37px
}

.soup-tile {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: 0 2px 9px #0f172a04;
    color: #334155;
    transition: border-color .2s, transform .2s
}

.soup-tile:hover {
    text-decoration: none;
    transform: translateY(-2px);
    border-color: #93c5fd
}

.soup-tile strong {
    font-size: 16px;
    color: #1d4ed8
}

.soup-tile span {
    font-size: 13px;
    line-height: 1.65;
    color: #64748b
}

.toc {
    position: sticky;
    top: var(--top);
    height: calc(100vh - var(--top));
    padding: 32px 20px 18px 4px;
    overflow-y: auto
}

.toc-heading {
    font-size: 11px;
    letter-spacing: .09em;
    font-weight: 850;
    color: #94a3b8;
    margin: 0 0 13px
}

.toc a {
    display: block;
    padding: 5px 10px;
    border-left: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.55
}

.toc a:hover {
    color: var(--blue);
    text-decoration: none
}

.toc a.level-3 {
    padding-left: 20px
}

.toc .toc-footer {
    margin-top: 24px;
    border: 0;
    color: #2563eb
}

.bottom-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 50px;
    padding-top: 22px;
    border-top: 1px solid var(--border)
}

.bottom-navigation a {
    max-width: 48%;
    font-size: 13px;
    color: #475569
}

.bottom-navigation a span {
    display: block;
    font-size: 11px;
    color: #94a3b8
}

footer {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 35px
}

.menu-button {
    display: none
}

.search-layer[hidden] {
    display: none
}

.search-layer {
    position: fixed;
    inset: 0;
    z-index: 50
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: #0f172aaa;
    backdrop-filter: blur(3px)
}

.search-dialog {
    position: relative;
    max-width: 650px;
    margin: 12vh auto 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 28px 100px #0f172a66;
    overflow: hidden
}

.search-field {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
    border-bottom: 1px solid var(--border)
}

.search-field>span {
    font-size: 28px;
    color: #64748b
}

.search-field input {
    flex: 1;
    outline: 0;
    border: 0;
    min-width: 0;
    font-size: 16px
}

.search-field button {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 11px;
    padding: 2px 7px;
    color: #64748b;
    cursor: pointer
}

.search-results {
    max-height: 50vh;
    overflow: auto;
    padding: 9px
}

.search-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    border-radius: 7px;
    padding: 12px 13px;
    display: block;
    cursor: pointer;
    color: #334155
}

.search-item:hover,
.search-item:focus {
    background: #eff6ff;
    outline: none
}

.search-item strong {
    display: block;
    font-size: 14px
}

.search-item small {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px
}

.search-empty {
    padding: 20px;
    text-align: center;
    color: #94a3b8
}

.search-hint {
    border-top: 1px solid var(--border);
    color: #94a3b8;
    padding: 10px 18px;
    font-size: 11px
}

.mobile-overlay {
    display: none
}

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

    .toc {
        display: none
    }
}

@media(max-width:750px) {
    .topbar {
        padding: 0 14px;
        gap: 10px
    }

    .topbar-center,
    .github-link,
    .search-trigger kbd {
        display: none
    }

    .search-trigger {
        min-width: auto;
        font-size: 0;
        padding: 5px 10px;
        gap: 0
    }

    .search-trigger span {
        font-size: 23px
    }

    .menu-button {
        display: block;
        background: none;
        border: 0;
        color: #fff;
        font-size: 23px;
        cursor: pointer
    }

    .layout {
        display: block
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: var(--top);
        bottom: 0;
        width: 270px;
        height: auto;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform .2s;
        box-shadow: 12px 0 25px #0f172a14
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .mobile-overlay.visible {
        display: block;
        position: fixed;
        inset: var(--top) 0 0;
        background: #0f172a55;
        z-index: 25
    }

    .content-inner {
        padding: 24px 22px 48px
    }

    .doc-content h1 {
        font-size: 30px
    }

    .doc-content h2 {
        font-size: 23px
    }

    .soup-tiles {
        grid-template-columns: 1fr
    }

    .search-dialog {
        margin: 8vh 12px 0
    }

    .brand {
        font-size: 15px
    }
}

.soup-brand {
  font-weight: 800;
  font-family: Verdana;
  letter-spacing: -0.04em;
  color: #262B38;
}

.studio-brand {
  color: var(--text, #262B38);
  font-weight: 800;
  font-family: Verdana;
  font-variant: small-caps;
}

/* Architecture diagram */

.architecture-figure {
  margin: 28px 0 36px;
  text-align: center;
}

.architecture-figure img {
  display: block;
  width: 100%;
  max-width: 850px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.architecture-figure a {
  display: block;
  cursor: zoom-in;
}

.architecture-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}