:root {
    --bg: #09090b;
    --bg-elevated: #111116;
    --bg-soft: #18181f;
    --panel: rgba(19, 19, 26, 0.88);
    --panel-strong: #1a1a22;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.12);
    --violet-bright: #baa3ff;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}
img {
    max-width: 100%;
    display: block;
}
button,
input,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: rgba(9, 9, 11, 0.82);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    padding: 22px 18px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 18px;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
}

.brand-name {
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 1.08rem;
}

.brand-tag {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-transform: uppercase;
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
}

.sidebar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.sidebar-search input::placeholder {
    color: var(--muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section-title {
    padding: 8px 10px 6px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-item {
    display: block;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    transition: 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text);
    border-color: var(--line);
    background: var(--violet-soft);
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crumb {
    color: var(--muted);
    font-size: 0.85rem;
}

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

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.ghost-button,
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--line);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
    cursor: pointer;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.primary-btn {
    background: linear-gradient(135deg, var(--violet), #8b5cf6);
    color: white;
    border-color: transparent;
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.35);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.ghost-button:hover,
.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-1px);
}

.content-wrap {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 90px;
}

.doc-page {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.hero-block {
    padding: 54px 22px 22px;
    border-radius: 28px;
    background: linear-gradient(
        180deg,
        rgba(124, 58, 237, 0.12),
        rgba(17, 17, 22, 0.76)
    );
    border: 1px solid var(--line);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.hero-block::before {
    content: "";
    position: absolute;
    inset: auto -10% -45% auto;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(168, 85, 247, 0.22),
        transparent 62%
    );
    pointer-events: none;
}

.eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--violet-bright);
    font-weight: 700;
}

.hero-block h1,
.section-block h2,
.doc-article h1,
.doc-article h2,
.doc-article h3 {
    letter-spacing: -0.05em;
    line-height: 1.05;
    margin: 0 0 0.7em;
}

.hero-title {
    display: flex;
    flex-direction: column;
    max-width: 720px;
    margin-top: 14px;
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 0.96;
    font-weight: 700;
}

.gradient-word {
    background: linear-gradient(
        135deg,
        #f5f3ff 0%,
        #c4b5fd 26%,
        #8b5cf6 65%,
        #ddd6fe 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    max-width: 780px;
    margin: 18px 0 0;
    font-size: 1.08rem;
    color: var(--muted);
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.info-grid,
.card-grid,
.feature-columns {
    display: grid;
    gap: 18px;
}

.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.doc-card,
.doc-article,
.note-box,
.callout,
.code-block,
.table-wrap,
.assistant-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.info-card {
    padding: 24px;
}

.card-kicker {
    color: var(--violet-bright);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.info-card h3,
.doc-card h3,
.step-item h3 {
    margin: 12px 0 8px;
    font-size: 1.2rem;
}

.info-card p,
.doc-card p,
.step-item p,
.doc-article p,
.doc-article li,
.callout p {
    color: var(--muted);
}

.section-block {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
}
.section-block h2 {
    font-size: clamp(1.8rem, 2.8vw, 2.7rem);
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
}

.step-no {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--violet-soft);
    border: 1px solid rgba(124, 58, 237, 0.35);
    color: var(--violet-bright);
    font-weight: 700;
}

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

.doc-card {
    padding: 22px 20px;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease;
}

.doc-card:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.4);
}

.doc-card-top {
    font-size: 2rem;
    margin-bottom: 12px;
}

.feature-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-columns > div {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}

.doc-article {
    padding: 32px 32px 48px;
}
.doc-article h1 {
    font-size: clamp(2.2rem, 4vw, 3.3rem);
}
.doc-article h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    margin-top: 2rem;
}
.doc-article p,
.doc-article li {
    font-size: 1.02rem;
}
.doc-article ul,
.doc-article ol {
    padding-left: 1.2rem;
}
.doc-article pre {
    overflow-x: auto;
    padding: 1rem 1.1rem;
    background: #0c0c12;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #e9d5ff;
}
.doc-article code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.92em;
}

.note-box,
.callout {
    margin: 1.4rem 0;
    padding: 1rem 1.1rem;
}
.note-box strong,
.callout strong {
    color: var(--text);
}

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.68);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 50;
}

.search-overlay.hidden {
    display: none;
}

.search-panel {
    width: min(720px, calc(100vw - 32px));
    background: rgba(19, 19, 26, 0.98);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 18px 18px 12px;
}

.search-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.search-input-row input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
}

.close-search,
.assistant-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
}

.search-result {
    display: block;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.search-result small {
    color: var(--muted);
}

.assistant-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(186, 163, 255, 0.35);
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.96),
        rgba(139, 92, 246, 0.9)
    );
    color: white;
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.4);
    cursor: pointer;
}

.assistant-launcher.hidden {
    display: none;
}

.assistant-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.assistant-panel {
    position: fixed;
    right: 22px;
    bottom: 86px;
    width: min(360px, calc(100vw - 26px));
    padding: 0;
    z-index: 45;
    background: rgba(17, 17, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
}

.assistant-panel.hidden {
    display: none;
}

.assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.assistant-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.assistant-icon.tiny {
    width: 16px;
    height: 16px;
    font-size: 0.72rem;
}

.gemini-form {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(24, 24, 31, 0.96);
}

.input-shell:focus-within {
    border-color: rgba(124, 58, 237, 0.6);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.input-shell input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    min-height: 40px;
}

.input-shell input::placeholder {
    color: var(--muted);
}

.send-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: white;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.18s ease;
}

.send-button.active {
    opacity: 1;
    background: linear-gradient(135deg, var(--violet), #8b5cf6);
}

.send-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.gemini-answer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 330px;
    min-height: 170px;
    padding: 16px;
    overflow-y: auto;
    background: rgba(5, 5, 8, 0.32);
}

.chat-bubble {
    width: fit-content;
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.chat-bubble strong {
    color: #ffffff;
    font-weight: 700;
}

.chat-bubble code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.28);
    color: #ddd0ff;
    font-size: 0.82em;
}

.chat-bubble.assistant {
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: #1b1923;
    color: #e8e5ef;
}

.chat-bubble.user {
    align-self: flex-end;
    border: 1px solid rgba(145, 96, 255, 0.35);
    background: linear-gradient(135deg, #7138e8, #4f2ca9);
    color: #ffffff;
}

.chat-bubble.error {
    border-color: rgba(250, 204, 21, 0.2);
    background: rgba(250, 204, 21, 0.08);
    color: #f5f5f5;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(320px, 42vw);
        height: 100vh;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        overflow-y: auto;
    }

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

    .mobile-menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .three-up,
    .card-grid,
    .feature-columns {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 721px) and (max-width: 980px) {
    .topbar {
        padding: 16px 24px;
    }

    .content-wrap {
        width: min(900px, calc(100% - 48px));
    }

    .three-up,
    .card-grid,
    .feature-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 14px 16px;
    }

    .sidebar {
        width: min(300px, 86vw);
    }

    .crumb {
        max-width: 52vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ghost-button {
        padding: 0.65rem 0.8rem;
        font-size: 0.86rem;
    }
}
