:root {
    --doc-bg: #f4f8f6;
    --doc-surface: #ffffff;
    --doc-surface-2: #f7fbf9;
    --doc-ink: #06242c;
    --doc-muted: #5a7178;
    --doc-line: #d7e6e0;
    --doc-primary: #208f70;
    --doc-primary-2: #186e57;
    --doc-accent: #003b4d;
    --doc-get: #208f70;
    --doc-post: #3b6cff;
    --doc-put: #c27803;
    --doc-delete: #dc4c4c;
    --doc-shadow: 0 24px 60px rgba(6, 36, 44, 0.08);
    --doc-radius: 20px;
    --doc-font: "Plus Jakarta Sans", "Segoe UI", Tahoma, sans-serif;
    --doc-mono: "IBM Plex Mono", "Cascadia Code", ui-monospace, Consolas, monospace;
    --sidebar: 272px;
}

html[data-theme="dark"] {
    --doc-bg: #061418;
    --doc-surface: #0d232a;
    --doc-surface-2: #123039;
    --doc-ink: #eaf4f7;
    --doc-muted: #92a8b0;
    --doc-line: #1c3c46;
    --doc-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--doc-font);
    background:
        radial-gradient(900px 420px at 80% -10%, rgba(32, 143, 112, .14), transparent 55%),
        radial-gradient(700px 380px at -10% 20%, rgba(0, 59, 77, .12), transparent 50%),
        var(--doc-bg);
    color: var(--doc-ink);
    color-scheme: light;
}
html[data-theme="dark"] body { color-scheme: dark; }

.doc-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.doc-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: 1.2rem 0.9rem 2rem;
    background:
        radial-gradient(380px 220px at 20% 0%, rgba(32, 143, 112, .35), transparent 60%),
        linear-gradient(180deg, #003b4d 0%, #072f32 100%);
    color: #eaf7f2;
}
.doc-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    text-decoration: none;
    padding: 0.4rem 0.55rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 0.7rem;
}
.doc-brand img { height: 22px; filter: brightness(0) invert(1); }
.doc-brand span { font-size: 0.72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .72; font-weight: 700; }

.doc-nav-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .5;
    padding: 0.95rem 0.75rem 0.3rem;
}
.doc-nav a {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 11px;
    font-size: 0.9rem;
    opacity: .86;
}
.doc-nav a:hover, .doc-nav a.active {
    background: rgba(32, 143, 112, .28);
    opacity: 1;
}

.doc-main { min-width: 0; }
.doc-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: .65rem;
    align-items: center;
    padding: .8rem 1.5rem;
    background: color-mix(in srgb, var(--doc-bg) 78%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--doc-line);
}
.doc-menu {
    display: none;
    border: 1px solid var(--doc-line);
    background: var(--doc-surface);
    color: var(--doc-ink);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    cursor: pointer;
}
.doc-search-wrap { position: relative; flex: 1; }
.doc-search {
    width: 100%;
    border: 1px solid var(--doc-line);
    background: var(--doc-surface);
    color: var(--doc-ink);
    border-radius: 13px;
    padding: .72rem .95rem;
    font: inherit;
}
.doc-search:focus { outline: 2px solid color-mix(in srgb, var(--doc-primary) 40%, transparent); border-color: var(--doc-primary); }
.doc-kbd {
    position: absolute;
    right: .7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    color: var(--doc-muted);
    border: 1px solid var(--doc-line);
    border-radius: 7px;
    padding: .12rem .38rem;
    pointer-events: none;
}
.doc-top a, .doc-icon-btn {
    border: 1px solid var(--doc-line);
    background: var(--doc-surface);
    color: var(--doc-ink);
    border-radius: 12px;
    padding: .62rem .9rem;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}
.doc-icon-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; }
.token-chip {
    font-size: .75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .35rem .7rem;
    background: #ece9ff;
    color: #4b3fc9;
}
.token-chip.on { background: #e8f5f0; color: var(--doc-primary-2); }

.doc-hero, .doc-section { padding: 1.6rem 1.8rem 0; max-width: 1120px; }
.doc-kicker {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    background: #e8f5f0;
    color: var(--doc-primary-2);
    border-radius: 999px;
    padding: .3rem .75rem;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
html[data-theme="dark"] .doc-kicker { background: rgba(32,143,112,.18); color: #8ee0c6; }
.doc-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.35rem); letter-spacing: -.05em; margin: .75rem 0 .45rem; line-height: 1.05; }
.doc-lead { color: var(--doc-muted); font-size: 1.08rem; max-width: 64ch; line-height: 1.65; }
.doc-lead a { color: var(--doc-primary-2); font-weight: 700; }

.doc-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.15rem 0 0; }
.doc-pill {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: 999px;
    padding: .42rem .78rem;
    font-size: .8rem;
    color: var(--doc-muted);
}

.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; margin-top: 1.2rem; }
.doc-card, .doc-panel {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-radius);
    box-shadow: var(--doc-shadow);
}
.doc-card { padding: 1.15rem 1.2rem; }
.doc-card h3, .doc-panel h2, .doc-section h2 { margin: 0 0 .4rem; letter-spacing: -.025em; }
.doc-card p, .doc-muted { color: var(--doc-muted); line-height: 1.55; }
.doc-card code, .doc-muted code, .doc-lead code { font-family: var(--doc-mono); font-size: .86em; }

.journey {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}
.journey-item { text-align: center; }
.journey-item h3 { margin: .8rem 0 .25rem; font-size: .95rem; }
.journey-item code { font-size: .68rem; color: var(--doc-muted); }
.journey-arrow { display: none; }

.phone {
    width: 148px;
    height: 250px;
    margin: 0 auto;
    border-radius: 22px;
    padding: 8px;
    background: #0b2a32;
    box-shadow: 0 16px 30px rgba(6, 36, 44, .28);
}
.phone-screen {
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    color: #0b2a32;
    position: relative;
    font-size: 7px;
    text-align: left;
}
.phone-bar { height: 28px; background: linear-gradient(135deg, #003b4d, #208f70); }
.phone-pad { padding: 8px; }
.phone-logo { width: 36px; height: 10px; border-radius: 4px; background: #208f70; margin: 18px auto 8px; }
.phone-field, .phone-btn, .phone-card-mini, .phone-row {
    border-radius: 5px;
    height: 12px;
    margin-top: 6px;
}
.phone-field { background: #eef4f2; }
.phone-btn { background: #208f70; }
.phone-card-mini { height: 28px; background: #f3f8f6; border: 1px solid #dce8e3; }
.phone-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 3px; margin-bottom: 6px; }
.phone-tabs span { height: 8px; background: #e8f5f0; border-radius: 99px; }
.phone-tabs span.on { background: #208f70; }
.phone-visit { display: grid; grid-template-columns: 34px 1fr; gap: 5px; height: calc(100% - 28px); }
.phone-side { background: #eef6f3; }
.phone-dot { width: 16px; height: 16px; border-radius: 50%; background: #dce8e3; margin: 8px auto; }
.phone-avatar { width: 22px; height: 22px; border-radius: 50%; background: #208f70; margin: 6px auto 8px; }
.phone-menu { height: 10px; background: #f3f8f6; border-radius: 4px; margin-top: 5px; }

.doc-flow-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.2rem;
    align-items: start;
}
.doc-flow-item { padding: 1.2rem 1.25rem; }
.doc-flow-item .figma {
    color: var(--doc-primary);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.doc-flow-item .figma a { color: inherit; text-decoration: none; }
.doc-flow-item .figma a:hover { text-decoration: underline; }
.doc-steps { margin: .7rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.doc-steps li {
    counter-increment: step;
    position: relative;
    padding: .38rem 0 .38rem 2rem;
    color: var(--doc-muted);
    font-size: .92rem;
}
.doc-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .32rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #e8f5f0;
    color: var(--doc-primary-2);
    font-size: .72rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}
html[data-theme="dark"] .doc-steps li::before { background: rgba(32,143,112,.2); color: #8ee0c6; }

.doc-code, pre {
    background: #06242c;
    color: #d7efe6;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    overflow: auto;
    font-family: var(--doc-mono);
    font-size: .8rem;
    line-height: 1.55;
}
.doc-code-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin: .85rem 0 .45rem;
    color: var(--doc-muted);
    font-size: .76rem;
}
.doc-copy {
    border: 0;
    background: #1a4a42;
    color: #d7efe6;
    border-radius: 8px;
    padding: .28rem .55rem;
    cursor: pointer;
    font-weight: 700;
}

.method {
    display: inline-flex;
    min-width: 3.5rem;
    justify-content: center;
    border-radius: 7px;
    padding: .18rem .42rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    color: #fff;
}
.method.GET { background: var(--doc-get); }
.method.POST { background: var(--doc-post); }
.method.PUT { background: var(--doc-put); }
.method.DELETE { background: var(--doc-delete); }
.auth-pill {
    font-size: .68rem;
    font-weight: 800;
    border-radius: 999px;
    padding: .16rem .48rem;
    background: #e8f5f0;
    color: var(--doc-primary-2);
}
.auth-pill.anon { background: #ece9ff; color: #5b4bd6; }

.endpoint { padding: 1.05rem 1.15rem; border-bottom: 1px solid var(--doc-line); }
.endpoint:last-child { border-bottom: 0; }
.endpoint-top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.endpoint .path { font-family: var(--doc-mono); font-size: .82rem; word-break: break-all; }
.endpoint h3 { font-size: 1rem; margin: .42rem 0 .18rem; }
details.endpoint-more { margin-top: .6rem; }
details.endpoint-more summary { cursor: pointer; color: var(--doc-primary); font-weight: 700; }

.playground { padding: 1.2rem; display: grid; gap: .85rem; }
.playground label { display: grid; gap: .3rem; font-size: .83rem; font-weight: 700; }
.playground input, .playground select {
    border: 1px solid var(--doc-line);
    background: var(--doc-surface-2);
    color: var(--doc-ink);
    border-radius: 11px;
    padding: .65rem .75rem;
    font: inherit;
}
.playground .row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; }
.playground .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.doc-btn {
    background: var(--doc-primary);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: .72rem 1rem;
    font-weight: 800;
    cursor: pointer;
}
.doc-btn:hover { background: var(--doc-primary-2); }
.doc-btn.ghost { background: transparent; color: var(--doc-ink); border: 1px solid var(--doc-line); }
#play-out { min-height: 160px; margin: 0; }

.hidden { display: none !important; }
.doc-footer { padding: 2.6rem 1.8rem 3rem; color: var(--doc-muted); font-size: .85rem; max-width: 1120px; }
.doc-footer a { color: var(--doc-primary-2); font-weight: 700; }

@media (max-width: 1100px) {
    .journey { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
    .doc-shell { grid-template-columns: 1fr; }
    .doc-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 300px);
        z-index: 40;
        transform: translateX(-110%);
        transition: transform .2s ease;
    }
    .doc-sidebar.open { transform: none; }
    .doc-menu { display: grid; place-items: center; }
    .doc-kbd { display: none; }
    .journey { grid-template-columns: repeat(2, 1fr); }
    .doc-flow-grid { grid-template-columns: 1fr; }
    .playground .row { grid-template-columns: 1fr; }
}
