.subpage-main {
    padding-top: calc(var(--nav-height) + 24px);
}

.subpage-shell {
    width: min(1160px, calc(100% - 48px));
    margin: 0 auto;
    padding-bottom: 80px;
}

.subpage-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 32px;
    align-items: end;
    padding: 56px 0 40px;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.36rem 0.9rem;
    margin-bottom: 18px;
    border-radius: 50px;
    background: rgba(74, 104, 255, 0.08);
    border: 1px solid rgba(74, 104, 255, 0.16);
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.subpage-hero h1 {
    max-width: 780px;
    margin-bottom: 18px;
    font-size: clamp(2.25rem, 5vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.hero-summary {
    max-width: 720px;
    color: var(--text-muted);
    font-size: 1.08rem;
}

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

.hero-panel,
.info-card,
.doc-section,
.endpoint-card,
.table-wrap,
.quick-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 42px rgba(16, 24, 40, 0.06);
}

.hero-panel {
    padding: 26px;
}

.hero-panel h2,
.quick-panel h2 {
    margin-bottom: 18px;
    font-size: 1.25rem;
}

.metric-list,
.check-list,
.timeline-list {
    list-style: none;
}

.metric-list {
    display: grid;
    gap: 16px;
}

.metric-list li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.metric-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.metric-value {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
}

.content-section {
    margin-top: 28px;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin-bottom: 10px;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.section-heading p {
    color: var(--text-muted);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

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

.info-card {
    padding: 24px;
}

.info-card h3 {
    margin-bottom: 10px;
    font-size: 1.12rem;
}

.info-card p {
    color: var(--text-muted);
}

.info-card .card-label {
    display: block;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
}

.check-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.check-list li {
    position: relative;
    padding-left: 24px;
    color: var(--text-muted);
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.64em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(74, 104, 255, 0.12);
}

.doc-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.doc-layout > *,
.doc-stack,
.doc-section,
.doc-nav,
.table-wrap,
.code-block {
    min-width: 0;
}

.doc-nav {
    position: sticky;
    top: 104px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.doc-nav a {
    display: block;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.doc-nav a:hover {
    color: var(--primary);
    background: rgba(74, 104, 255, 0.08);
}

.doc-stack {
    display: grid;
    gap: 20px;
}

.doc-section {
    padding: 26px;
    scroll-margin-top: 110px;
}

.doc-section h2 {
    margin-bottom: 12px;
    font-size: 1.55rem;
}

.doc-section > p {
    color: var(--text-muted);
}

.endpoint-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.endpoint-card {
    padding: 18px;
    box-shadow: none;
}

.endpoint-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.method {
    display: inline-flex;
    min-width: 58px;
    justify-content: center;
    padding: 0.28rem 0.55rem;
    border-radius: 8px;
    background: rgba(74, 104, 255, 0.1);
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 800;
}

.path {
    color: var(--text-main);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.94rem;
    font-weight: 700;
    word-break: break-word;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.06);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.code-block {
    margin-top: 16px;
    padding: 18px;
    overflow-x: auto;
    border-radius: 14px;
    background: #111827;
    color: #e5e7eb;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.65;
}

.code-block code {
    white-space: pre;
}

.table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    box-shadow: none;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.spec-table th,
.spec-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    text-align: left;
    vertical-align: top;
}

.spec-table th {
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 800;
}

.spec-table td {
    color: var(--text-muted);
}

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

.timeline-list {
    display: grid;
    gap: 14px;
    counter-reset: step;
}

.timeline-list li {
    position: relative;
    padding: 18px 18px 18px 58px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(17, 24, 39, 0.06);
    color: var(--text-muted);
}

.timeline-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 18px;
    top: 18px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
}

.timeline-list strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
}

.quick-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 36px;
    padding: 26px;
}

.quick-panel p {
    max-width: 650px;
    color: var(--text-muted);
}

.footer .link-group a[aria-current="page"] {
    color: var(--primary);
}

@media (max-width: 900px) {
    .subpage-shell {
        width: min(100% - 32px, 760px);
    }

    .subpage-hero,
    .doc-layout,
    .content-grid,
    .content-grid.two {
        grid-template-columns: 1fr;
    }

    .doc-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }
}

@media (max-width: 560px) {
    .subpage-shell {
        width: min(100% - 24px, 520px);
        padding-bottom: 56px;
    }

    .subpage-main {
        padding-top: 76px;
    }

    .subpage-hero {
        padding: 30px 0 26px;
        gap: 20px;
    }

    .subpage-hero h1 {
        font-size: 2rem;
        line-height: 1.12;
    }

    .hero-summary {
        font-size: 0.98rem;
    }

    .hero-panel h2,
    .quick-panel h2 {
        font-size: 1.15rem;
    }

    .metric-list li {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .metric-value {
        text-align: left;
    }

    .content-section {
        margin-top: 22px;
    }

    .section-heading h2 {
        font-size: 1.55rem;
    }

    .section-heading p,
    .info-card p,
    .doc-section > p {
        font-size: 0.95rem;
    }

    .hero-panel,
    .info-card,
    .doc-section,
    .quick-panel {
        padding: 18px;
    }

    .page-actions .btn {
        width: 100%;
    }

    .doc-nav {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .doc-nav a {
        padding: 8px 10px;
    }

    .endpoint-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .path {
        font-size: 0.86rem;
    }

    .code-block {
        padding: 14px;
        font-size: 0.8rem;
        border-radius: 12px;
    }

    .spec-table {
        min-width: 520px;
    }

    .spec-table th,
    .spec-table td {
        padding: 12px;
        font-size: 0.86rem;
    }

    .timeline-list li {
        padding: 16px 16px 16px 52px;
    }

    .timeline-list li::before {
        left: 16px;
        top: 16px;
    }
}

@media (max-width: 380px) {
    .subpage-hero h1 {
        font-size: 1.78rem;
    }

    .spec-table {
        min-width: 480px;
    }
}
