.jp-guide {
    --guide-border: #dfe3e8;
    --guide-border-strong: #cbd1d8;
    --guide-surface: #fff;
    --guide-surface-muted: #f7f8f9;
    --guide-text: #20242a;
    --guide-text-muted: #68707b;

    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 52px 0 112px;
    color: var(--guide-text);
}

.jp-guide-header {
    margin-bottom: 48px;
    padding-bottom: 38px;
    border-bottom: 1px solid var(--guide-border);
}

.jp-guide-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    letter-spacing: -.035em;
}

.jp-guide-header > p {
    max-width: 720px;
    margin: 13px 0 0;
    color: var(--guide-text-muted);
    font-size: 15px;
    line-height: 1.75;
}

.jp-guide-search {
    position: relative;
    display: block;
    max-width: 640px;
    margin-top: 28px;
}

.jp-guide-search-label {
    display: block;
    margin-bottom: 8px;
    color: #4d5560;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.jp-guide-search input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--guide-border-strong);
    border-radius: 12px;
    background: var(--guide-surface);
    color: var(--guide-text);
    font: inherit;
    box-shadow: 0 2px 8px rgba(20, 27, 35, .035);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.jp-guide-search input::placeholder {
    color: #9299a2;
}

.jp-guide-search input:focus-visible {
    border-color: var(--label-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .13);
}

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

.jp-guide-sidebar {
    position: sticky;
    top: 4rem;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 18px 12px 12px;
    border: 1px solid var(--guide-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 24px rgba(20, 27, 35, .055);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
    scrollbar-width: thin;
}

.jp-guide-sidebar-title {
    margin: 0 0 10px;
    padding: 0 11px;
    color: #828995;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
}

.jp-guide-category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jp-guide-category-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0 0 3px;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #626a74;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease;
}

.jp-guide-category-group-toggle:hover {
    background: var(--guide-surface-muted);
    color: var(--guide-text);
}

.jp-guide-category-group-name {
    min-width: 0;
}

.jp-guide-category-group-chevron {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    margin: -3px 3px 0 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: margin .16s ease, transform .16s ease;
}

.jp-guide-category-group.is-collapsed .jp-guide-category-group-chevron {
    margin-top: 0;
    transform: rotate(-45deg);
}

.jp-guide-category-group-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.jp-guide-category-group-items[hidden] {
    display: none;
}

.jp-guide-category-button {
    position: relative;
    width: 100%;
    padding: 10px 12px 10px 15px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #555d67;
    font: inherit;
    font-size: 13.5px;
    font-weight: 550;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease;
}

.jp-guide-category-button::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background: transparent;
    content: '';
}

.jp-guide-category-button:hover {
    background: var(--guide-surface-muted);
    color: var(--guide-text);
}

.jp-guide-category-button.active {
    background: #f5f5f4;
    color: var(--label-color);
    font-weight: 700;
}

.jp-guide-category-button.active::before {
    background: var(--label-color);
}

.jp-guide-category-button:focus-visible,
.jp-guide-category-group-toggle:focus-visible,
.jp-guide-term-link:focus-visible,
.jp-guide-search-result:focus-visible {
    outline: 2px solid var(--label-color);
    outline-offset: 2px;
}

.jp-guide-content {
    min-width: 0;
}

.jp-guide-content-header {
    margin-bottom: 28px;
}

.jp-guide-content-header h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2rem);
    line-height: 1.3;
    letter-spacing: -.025em;
}

.jp-guide-content-header p {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--guide-text-muted);
    font-size: 15px;
    line-height: 1.75;
}

.jp-guide-rich-link {
    color: inherit;
    font-weight: 650;
    text-decoration-line: underline;
    text-decoration-color: #aeb5bd;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color .16s ease, text-decoration-color .16s ease;
}

.jp-guide-rich-link:hover {
    color: var(--label-color);
    text-decoration-color: currentColor;
}

.jp-guide-rich-link:focus-visible {
    border-radius: 2px;
    outline: 2px solid var(--label-color);
    outline-offset: 2px;
}

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

.jp-guide-group {
    overflow: hidden;
    border: 1px solid var(--guide-border);
    border-radius: 16px;
    background: var(--guide-surface);
    box-shadow: 0 5px 18px rgba(20, 27, 35, .035);
}

.jp-guide-group-header {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--guide-border);
    background: var(--guide-surface-muted);
}

.jp-guide-group-header h3 {
    margin: 0;
    font-size: 19px;
    letter-spacing: -.015em;
}

.jp-guide-group-header p {
    margin: 7px 0 0;
    color: var(--guide-text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.jp-guide-term {
    scroll-margin-top: 24px;
    padding: 24px;
    border-bottom: 1px solid var(--guide-border);
    transition: background-color .25s ease;
}

.jp-guide-term:last-child {
    border-bottom: 0;
}

.jp-guide-term-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jp-guide-term-title {
    flex: 0 1 auto;
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: -.01em;
}

.jp-guide-term-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #7b838e;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.jp-guide-term-link::before {
    width: 17px;
    height: 17px;
    background: currentColor;
    content: '';
    -webkit-mask: url('/src/icons/link.svg') center / contain no-repeat;
    mask: url('/src/icons/link.svg') center / contain no-repeat;
}

.jp-guide-term-link:hover {
    border-color: var(--guide-border);
    background: var(--guide-surface-muted);
    color: var(--guide-text);
    transform: translateY(-1px);
}

.jp-guide-term-link.is-copied {
    border-color: rgba(249, 115, 22, .28);
    background: rgba(249, 115, 22, .08);
    color: var(--label-color);
}

.jp-guide-term-link.is-copied::before {
    -webkit-mask-image: url('/src/icons/check.svg');
    mask-image: url('/src/icons/check.svg');
}

.jp-guide-term-description {
    margin: 10px 0 0;
    color: #3f464f;
    font-size: 15px;
    line-height: 1.8;
}

.jp-guide-term-details {
    margin: 13px 0 0;
    padding-left: 19px;
    color: var(--guide-text-muted);
    font-size: 14px;
    line-height: 1.75;
}

.jp-guide-term-details li::marker {
    color: #9aa1a9;
}

.jp-guide-term-details li + li {
    margin-top: 5px;
}

.jp-guide-children {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.jp-guide-child-term {
    padding: 16px 17px;
    border: 1px solid var(--guide-border);
    border-radius: 10px;
    background: var(--guide-surface-muted);
}

.jp-guide-child-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.jp-guide-child-description {
    margin: 6px 0 0;
    color: var(--guide-text-muted);
    font-size: 13px;
    line-height: 1.7;
}

.jp-guide-child-term .jp-guide-term-details {
    margin-top: 7px;
    font-size: 13px;
}

.jp-guide-term-highlight {
    background: #fff7ed;
    box-shadow: inset 3px 0 var(--label-color);
}

.jp-guide-document-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.jp-guide-document-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border: 1px solid var(--guide-border-strong);
    border-radius: 9px;
    background: var(--guide-surface);
    color: var(--guide-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.jp-guide-document-link:hover {
    border-color: var(--label-color);
    color: var(--label-color);
    transform: translateY(-1px);
}

.jp-guide-document-link:focus-visible {
    outline: 2px solid var(--label-color);
    outline-offset: 2px;
}

.jp-guide-document-link-arrow {
    transition: transform .16s ease;
}

.jp-guide-document-link:hover .jp-guide-document-link-arrow {
    transform: translateX(3px);
}

.jp-guide-search-view {
    max-width: 900px;
}

.jp-guide-search-header {
    margin-bottom: 22px;
}

.jp-guide-search-header h2 {
    margin: 0;
    font-size: 24px;
}

.jp-guide-search-header p {
    margin: 6px 0 0;
    color: var(--guide-text-muted);
    font-size: 14px;
}

.jp-guide-search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.jp-guide-search-result {
    width: 100%;
    padding: 19px 20px;
    border: 1px solid var(--guide-border);
    border-radius: 12px;
    background: var(--guide-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(20, 27, 35, .03);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.jp-guide-search-result:hover {
    border-color: var(--guide-border-strong);
    box-shadow: 0 8px 22px rgba(20, 27, 35, .06);
    transform: translateY(-2px);
}

.jp-guide-search-location {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
    color: #7e8690;
    font-size: 12px;
}

.jp-guide-search-divider {
    color: #bbb;
}

.jp-guide-search-result-title {
    display: block;
    font-size: 16px;
}

.jp-guide-search-result p {
    margin: 6px 0 0;
    color: var(--guide-text-muted);
    font-size: 14px;
    line-height: 1.65;
}

.jp-guide-search-empty {
    padding: 30px;
    border: 1px solid var(--guide-border);
    border-radius: 12px;
    background: var(--guide-surface);
    text-align: center;
}

.jp-guide-search-empty p {
    margin: 7px 0 0;
    color: var(--guide-text-muted);
    font-size: 14px;
}

.jp-guide-search-view[hidden],
.jp-guide-layout[hidden] {
    display: none;
}

@media (max-width: 850px) {
    .jp-guide {
        width: calc(100% - 30px);
        padding-top: 30px;
    }

    .jp-guide-layout {
        display: block;
    }

    .jp-guide-sidebar {
        top: 0;
        z-index: 20;
        max-height: none;
        margin: 0 -15px 30px;
        padding: 12px 15px 5px;
        overflow: hidden;
        border-width: 1px 0;
        border-radius: 0;
        box-shadow: 0 8px 18px rgba(20, 27, 35, .06);
    }

    .jp-guide-sidebar-title {
        display: none;
    }

    .jp-guide-category-list {
        flex-direction: row;
        align-items: stretch;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 7px;
        scrollbar-width: thin;
    }

    .jp-guide-category-group {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .jp-guide-category-group + .jp-guide-category-group {
        padding-left: 16px;
        border-left: 1px solid var(--guide-border);
    }

    .jp-guide-category-group-toggle {
        margin-bottom: 5px;
        padding: 4px 2px;
    }

    .jp-guide-category-group-items {
        flex-direction: row;
        gap: 6px;
    }

    .jp-guide-category-button {
        width: auto;
        flex: 0 0 auto;
        padding: 8px 13px;
        border: 1px solid var(--guide-border);
        background: var(--guide-surface);
        white-space: nowrap;
    }

    .jp-guide-category-button::before {
        content: none;
    }

    .jp-guide-category-button.active {
        border-color: var(--label-color);
        background: #fff7ed;
    }
}

@media (max-width: 600px) {
    .jp-guide {
        width: calc(100% - 24px);
        padding: 25px 0 70px;
    }

    .jp-guide-header {
        margin-bottom: 30px;
        padding-bottom: 28px;
    }

    .jp-guide-header h1 {
        font-size: 26px;
    }

    .jp-guide-content-header h2 {
        font-size: 24px;
    }

    .jp-guide-group + .jp-guide-group {
        margin-top: 22px;
    }

    .jp-guide-group-header {
        padding: 19px 18px 16px;
    }

    .jp-guide-term {
        scroll-margin-top: 96px;
        padding: 20px 18px;
    }

    .jp-guide-term-title {
        font-size: 17px;
    }

    .jp-guide-children {
        grid-template-columns: 1fr;
    }

    .jp-guide-term-heading {
        align-items: flex-start;
        justify-content: space-between;
    }

    .jp-guide-document-link {
        width: 100%;
        justify-content: space-between;
        box-sizing: border-box;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jp-guide-search input,
    .jp-guide-category-button,
    .jp-guide-category-group-toggle,
    .jp-guide-category-group-chevron,
    .jp-guide-rich-link,
    .jp-guide-document-link,
    .jp-guide-document-link-arrow,
    .jp-guide-term,
    .jp-guide-term-link,
    .jp-guide-search-result {
        transition: none;
    }
}
