:root {
    --bg: #f7f3ea;
    --surface: #ffffff;
    --surface-soft: #f8fbf9;
    --border: #d8e2df;
    --text: #1C3A60;
    --heading: #000000;
    --muted: #6A747D;
    --primary: #007965;
    --primary-dark: #005f50;
    --accent: #A6F0D8;
    --warm: #F0E5D1;
    --code-bg: #1C3A60;
    --shadow: 0 12px 30px rgba(28, 58, 96, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Geist, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: clip;
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 74px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--heading);
    font-size: 24px;
    font-weight: 600;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 64px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(28, 58, 96, 0.08);
}

.brand-logo img {
    width: 58px;
    height: auto;
    object-fit: contain;
}

.title {
    padding-left: 20px;
    border-left: 1px solid var(--border);
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    font-weight: 500;
}

.topnav a {
    color: var(--text);
    border-bottom: 3px solid transparent;
    padding: 24px 0 21px;
}

.topnav a:hover {
    color: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}

.topnav a.active {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    width: 100%;
    min-height: calc(100vh - 74px);
}

.sidebar {
    position: sticky;
    top: 74px;
    z-index: 15;
    align-self: start;
    height: calc(100vh - 74px);
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0 40px;
}

.nav-group {
    margin-bottom: 28px;
}

.nav-heading {
    padding: 0 24px 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar a {
    display: block;
    padding: 8px 24px;
    color: var(--text);
    font-weight: 500;
    border-left: 4px solid transparent;
}

.sidebar a:hover,
.sidebar a:focus,
.sidebar a.active {
    color: var(--primary);
    background: rgba(166, 240, 216, 0.24);
    border-left-color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.content {
    width: min(900px, 100%);
    margin: 0 auto;
    padding: 38px 28px calc(72px + 45vh);
}

.doc-card {
    margin-bottom: 24px;
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    scroll-margin-top: 94px;
}

.doc-card h1,
.doc-card h2,
.doc-card h3,
.doc-card h4 {
    margin: 0 0 14px;
    color: var(--heading);
    line-height: 1.25;
}

.doc-card h1 {
    font-size: 34px;
}

.doc-card h2 {
    font-size: 28px;
}

.doc-card h3 {
    margin-top: 26px;
    font-size: 20px;
}

.doc-card h4 {
    font-size: 17px;
}

.doc-card p {
    margin: 0 0 18px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lead {
    font-size: 20px;
    color: var(--text);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 28px;
}

.chips span {
    padding: 5px 12px;
    color: var(--text);
    background: rgba(166, 240, 216, 0.28);
    border: 1px solid rgba(0, 121, 101, 0.18);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

hr {
    height: 1px;
    margin: 28px 0;
    border: 0;
    background: var(--border);
}

.callout {
    margin: 20px 0;
    padding: 16px 18px;
    background: rgba(166, 240, 216, 0.16);
    border: 1px solid rgba(0, 121, 101, 0.24);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
}

.actions,
.grid {
    display: grid;
    gap: 14px;
}

.actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 24px;
}

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

.credentials-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
}

.button,
.reference-card,
.download-card {
    display: block;
    padding: 14px 16px;
    color: var(--primary);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 800;
    text-align: center;
}

.button:hover,
.reference-card:hover,
.download-card:hover {
    border-color: var(--primary);
    background: rgba(166, 240, 216, 0.20);
    text-decoration: none;
}

.button.primary {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.info-box,
.reference-card,
.download-card {
    text-align: left;
}

.info-box {
    padding: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
}

dl,
dd {
    margin: 0;
}

.copy-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: stretch;
    max-width: 100%;
    overflow: hidden;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
}

dd code {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

.copy-row code {
    min-width: 0;
    padding: 2px 6px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.copy-button {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-height: 26px;
    padding: 0;
    color: var(--muted);
    background: rgba(166, 240, 216, 0.18);
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.copy-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.copy-button:hover,
.copy-button:focus,
.copy-button.copied {
    color: var(--primary);
    background: rgba(166, 240, 216, 0.42);
    border-color: rgba(0, 121, 101, 0.28);
}

dt {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

code {
    padding: 2px 6px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--heading);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

pre {
    overflow-x: auto;
    margin: 14px 0 20px;
    padding: 18px;
    background: var(--code-bg);
    border-radius: 6px;
}

pre code {
    padding: 0;
    color: #ffffff;
    background: transparent;
    border: 0;
}

.steps {
    margin: 0;
    padding-left: 22px;
}

.steps li {
    margin-bottom: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
}

th,
td {
    padding: 13px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(240, 229, 209, 0.58);
    font-size: 14px;
}

tr:last-child td {
    border-bottom: 0;
}

.operations-table {
    table-layout: fixed;
}

.operations-table th:nth-child(1),
.operations-table td:nth-child(1) {
    width: 68px;
}

.operations-table th:nth-child(2),
.operations-table td:nth-child(2) {
    width: 46%;
}

.operations-table th:nth-child(3),
.operations-table td:nth-child(3) {
    width: auto;
}

.operations-table td:nth-child(2) code {
    white-space: normal;
    overflow-wrap: anywhere;
}

.method {
    display: inline-block;
    min-width: 48px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.method.get {
    background: var(--primary);
}

.method.post {
    background: var(--text);
}

.diagram-wrap {
    max-width: 100%;
    margin: 18px 0 28px;
    padding: 16px;
    overflow-x: auto;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.sequence-diagram {
    display: block;
    width: 100%;
    min-width: 700px;
    height: auto;
}

.sequence-diagram marker path {
    fill: var(--text);
}

.diagram-node rect {
    fill: rgba(166, 240, 216, 0.24);
    stroke: rgba(0, 121, 101, 0.22);
    stroke-width: 1.2;
}

.diagram-node text,
.diagram-message text {
    fill: var(--heading);
    font-family: Geist, sans-serif;
    font-size: 15px;
    text-anchor: middle;
}

.diagram-node text {
    font-weight: 600;
}

.diagram-line line {
    stroke: rgba(0, 121, 101, 0.16);
    stroke-width: 2;
}

.diagram-message line,
.diagram-message path {
    fill: none;
    stroke: var(--text);
    stroke-width: 1.8;
}

.diagram-message .dashed {
    stroke-dasharray: 4 4;
}

.diagram-message .self {
    stroke-width: 1.6;
}

.diagram-caption {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.resource-list {
    margin: 16px 0 0;
    padding: 18px 22px 18px 34px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.resource-list li {
    margin-bottom: 8px;
}

.resource-list li:last-child {
    margin-bottom: 0;
}

.reference-card strong,
.download-card strong {
    display: block;
    margin-bottom: 8px;
}

.reference-card span,
.download-card span {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

.check-list {
    margin: 0;
    padding-left: 20px;
}

.check-list li {
    margin-bottom: 10px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 28px;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.back-to-top:hover {
    color: #ffffff;
    background: var(--primary);
    text-decoration: none;
}

.copy-toast {
    position: fixed;
    right: 28px;
    bottom: 88px;
    z-index: 31;
    padding: 10px 13px;
    color: var(--primary);
    background: #ffffff;
    border: 1px solid rgba(0, 121, 101, 0.26);
    border-radius: 6px;
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.copy-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1020px) {
    .topbar {
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px 18px;
    }

    .title {
        order: 3;
        width: 100%;
        padding: 8px 0 0;
        border-left: 0;
        border-top: 1px solid var(--border);
        white-space: normal;
    }

    .topnav {
        gap: 14px;
    }

    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        z-index: 10;
        display: flex;
        height: auto;
        gap: 18px;
        overflow-x: auto;
        padding: 12px 18px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-group {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .nav-heading {
        display: none;
    }

    .sidebar a {
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: 6px;
    }

    .content {
        width: min(900px, 100%);
    }
}

@media (max-width: 900px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        background: #ffffff;
        font-size: 18px;
        line-height: 1.55;
    }

    .topbar {
        gap: 14px;
        position: static;
        padding: 14px 16px;
        max-width: 100vw;
        overflow: hidden;
    }

    .brand {
        order: 1;
    }

    .brand span {
        font-size: 24px;
    }

    .brand-logo {
        width: 60px;
        height: 52px;
    }

    .brand-logo img {
        width: 48px;
        height: auto;
    }

    .title {
        order: 2;
        min-width: 0;
        font-size: 19px;
        overflow-wrap: anywhere;
    }

    .topnav {
        order: 3;
        display: flex;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        gap: 16px;
        overflow-x: auto;
        padding-top: 6px;
        border-top: 1px solid var(--border);
    }

    .topnav a {
        flex: 0 0 auto;
        padding: 9px 0 7px;
        font-size: 16px;
        white-space: nowrap;
    }

    .sidebar {
        display: none;
    }

    .content {
        width: 100%;
        max-width: 100vw;
        padding: 0 0 48px;
        overflow-x: hidden;
    }

    .doc-card {
        max-width: 100vw;
        margin-bottom: 10px;
        padding: 24px 18px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .doc-card h1 {
        font-size: 34px;
    }

    .doc-card h2 {
        font-size: 30px;
    }

    .doc-card h3 {
        font-size: 23px;
    }

    .doc-card h4 {
        font-size: 20px;
    }

    .lead {
        font-size: 20px;
    }

    .chips {
        gap: 6px;
        margin: 14px 0 22px;
    }

    .chips span {
        padding: 4px 9px;
        font-size: 12px;
    }

    .button,
    .reference-card,
    .download-card {
        padding: 13px 14px;
    }

    .actions,
    .grid.two {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .operations-table {
        display: table;
        table-layout: auto;
        white-space: normal;
    }

    .operations-table thead {
        display: none;
    }

    .operations-table,
    .operations-table tbody,
    .operations-table tr,
    .operations-table td {
        width: 100%;
    }

    .operations-table tr {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
    }

    .operations-table tr:last-child {
        border-bottom: 0;
    }

    .operations-table td {
        display: block;
        padding: 4px 14px;
        border-bottom: 0;
        white-space: normal;
    }

    .operations-table td:nth-child(1),
    .operations-table td:nth-child(2),
    .operations-table td:nth-child(3) {
        width: 100%;
    }

    .operations-table td:nth-child(2) code {
        display: inline;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .footer {
        flex-direction: column;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }

    .copy-toast {
        right: 16px;
        bottom: 72px;
    }
}
