/* Royal documentation: product-first docs index, collection browser, and article reader. */
.royal-docs {
    min-height: 70vh;
    color: var(--royal-ink);
    background: #fbfdfc;
}

.royal-docs a {
    text-decoration: none;
}

.royal-docs-home-section {
    padding: 5.25rem 0 7rem;
    background:
        radial-gradient(circle at 6% 20%, rgba(239, 118, 88, .07), transparent 24rem),
        #fff;
}

.royal-docs-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.35rem;
}

.royal-docs-section-head > div {
    max-width: 760px;
}

.royal-docs-section-head h2,
.royal-docs-content-head h2,
.royal-docs-next-step h2 {
    margin: .75rem 0 .6rem;
    color: var(--royal-ink);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.45rem, 4.6vw, 4.3rem);
    font-weight: 600;
    line-height: .96;
    letter-spacing: -.045em;
}

.royal-docs-section-head p,
.royal-docs-content-head p,
.royal-docs-next-step p {
    margin: 0;
    color: var(--royal-muted);
    font-size: .98rem;
    line-height: 1.75;
}

.royal-docs-collection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.royal-docs-collection-card {
    position: relative;
    display: flex;
    min-height: 340px;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
    border: 1px solid var(--royal-line);
    border-radius: 1.3rem;
    color: var(--royal-ink);
    background:
        linear-gradient(rgba(8, 127, 120, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 127, 120, .04) 1px, transparent 1px),
        #fff;
    background-size: 32px 32px, 32px 32px, auto;
    box-shadow: 0 18px 45px rgba(16, 35, 61, .07);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.royal-docs-collection-card::after {
    content: "";
    position: absolute;
    right: -4rem;
    bottom: -5rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(223, 247, 241, .82);
    pointer-events: none;
}

.royal-docs-collection-card:hover {
    z-index: 1;
    border-color: #9ed4ce;
    box-shadow: 0 24px 60px rgba(16, 35, 61, .12);
    transform: translateY(-5px);
}

.royal-docs-collection-card__top,
.royal-docs-collection-card__foot,
.royal-docs-result-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.royal-docs-collection-logo {
    position: relative;
    z-index: 1;
    display: grid;
    width: 3.4rem;
    height: 3.4rem;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid #cfe3e0;
    border-radius: 1rem;
    color: var(--royal-accent-dark);
    background: #f1fbf8;
    font-size: 1.15rem;
    font-weight: 800;
}

.royal-docs-collection-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.royal-docs-collection-logo--large {
    width: 4.75rem;
    height: 4.75rem;
    border-radius: 1.3rem;
    background: #fff;
    box-shadow: 0 16px 40px rgba(16, 35, 61, .1);
}

.royal-docs-card-arrow {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid var(--royal-line);
    border-radius: 50%;
    color: var(--royal-accent);
    background: rgba(255, 255, 255, .92);
    font-size: 1.05rem;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.royal-docs-collection-card:hover .royal-docs-card-arrow {
    color: #fff;
    background: var(--royal-accent);
    transform: rotate(10deg);
}

.royal-docs-collection-card__body {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 2rem 0 1.5rem;
}

.royal-docs-card-kicker {
    display: block;
    margin-bottom: .65rem;
    color: var(--royal-accent);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.royal-docs-collection-card h3,
.royal-docs-result-card h3,
.royal-docs-section-card h3 {
    margin: 0;
    color: var(--royal-ink);
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.025em;
}

.royal-docs-collection-card__body p,
.royal-docs-result-card p,
.royal-docs-section-card p {
    margin: .8rem 0 0;
    color: var(--royal-muted);
    font-size: .88rem;
    line-height: 1.7;
}

.royal-docs-collection-card__foot {
    position: relative;
    z-index: 1;
    padding-top: 1.1rem;
    border-top: 1px solid var(--royal-line);
    color: var(--royal-muted);
    font-size: .76rem;
}

.royal-docs-collection-card__foot strong {
    color: var(--royal-ink);
    font-size: .78rem;
}

.royal-docs-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.royal-docs-result-card {
    padding: 1.55rem;
    border: 1px solid var(--royal-line);
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 14px 36px rgba(16, 35, 61, .055);
}

.royal-docs-result-card__meta {
    margin-bottom: 1rem;
    color: var(--royal-accent);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.royal-docs-result-card > a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 1.1rem;
    color: var(--royal-accent-dark);
    font-size: .8rem;
    font-weight: 800;
}

.royal-docs-empty {
    display: flex;
    min-height: 330px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 3rem;
    border: 1px dashed #b9d8d4;
    border-radius: 1.3rem;
    text-align: center;
    background: #f7fcfb;
}

.royal-docs-empty--wide {
    grid-column: 1 / -1;
}

.royal-docs-empty__icon {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 1rem;
    color: var(--royal-accent);
    background: #dff7f1;
}

.royal-docs-empty h3 {
    margin: 0;
    font-size: 1.25rem;
}

.royal-docs-empty p {
    max-width: 520px;
    margin: .6rem 0 1.35rem;
    color: var(--royal-muted);
    line-height: 1.7;
}

.royal-docs-masthead {
    position: relative;
    overflow: hidden;
    padding: 3rem 0 3.4rem;
    border-bottom: 1px solid var(--royal-line);
    background:
        linear-gradient(rgba(16, 35, 61, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 35, 61, .035) 1px, transparent 1px),
        linear-gradient(135deg, #f9fcff, #eff8f6);
    background-size: 48px 48px, 48px 48px, auto;
}

.royal-docs-masthead::after {
    content: "";
    position: absolute;
    top: -12rem;
    right: -8rem;
    width: 30rem;
    height: 30rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 127, 120, .13), transparent 68%);
    pointer-events: none;
}

.royal-docs-breadcrumb {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 2rem;
    color: var(--royal-muted);
    font-size: .74rem;
    font-weight: 700;
}

.royal-docs-breadcrumb a:hover {
    color: var(--royal-accent);
}

.royal-docs-breadcrumb span:last-child {
    min-width: 0;
    overflow: hidden;
    color: var(--royal-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.royal-docs-masthead__grid,
.royal-docs-masthead__identity,
.royal-docs-masthead__action {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
}

.royal-docs-masthead__grid {
    justify-content: space-between;
    gap: 3rem;
}

.royal-docs-masthead__identity {
    min-width: 0;
    gap: 1.5rem;
}

.royal-docs-masthead__identity > div {
    max-width: 790px;
}

.royal-docs-masthead__identity h1 {
    margin: .6rem 0 .55rem;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.55rem, 5vw, 4.6rem);
    font-weight: 600;
    line-height: .96;
    letter-spacing: -.045em;
}

.royal-docs-masthead__identity p {
    max-width: 720px;
    margin: 0;
    color: var(--royal-muted);
    font-size: .94rem;
    line-height: 1.7;
}

.royal-docs-masthead__action {
    flex: 0 0 auto;
    align-items: flex-end;
    flex-direction: column;
    gap: .75rem;
}

.royal-docs-masthead__action > span {
    color: var(--royal-muted);
    font-size: .72rem;
    font-weight: 700;
}

.royal-docs-workspace {
    padding: 3.5rem 0 7rem;
    background: #fbfdfc;
}

.royal-docs-workspace__grid {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
}

.royal-docs-workspace__grid.has-toc {
    grid-template-columns: 250px minmax(0, 1fr) 210px;
}

.royal-docs-sidebar,
.royal-docs-toc {
    position: sticky;
    top: 5.8rem;
}

.royal-docs-side-panel,
.royal-docs-toc__panel,
.royal-docs-help-card {
    border: 1px solid var(--royal-line);
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 14px 36px rgba(16, 35, 61, .055);
}

.royal-docs-side-panel {
    overflow: hidden;
    padding: .85rem;
}

.royal-docs-side-home {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .72rem .75rem;
    color: var(--royal-muted);
    font-size: .75rem;
    font-weight: 800;
}

.royal-docs-side-home:hover {
    color: var(--royal-accent);
}

.royal-docs-side-search {
    position: relative;
    margin: .35rem 0 1rem;
}

.royal-docs-side-search > svg {
    position: absolute;
    top: 50%;
    left: .85rem;
    color: var(--royal-accent);
    font-size: .75rem;
    transform: translateY(-50%);
}

.royal-docs-side-search input {
    width: 100%;
    height: 2.85rem;
    padding: 0 .8rem 0 2.25rem;
    border: 1px solid var(--royal-line);
    border-radius: .8rem;
    outline: none;
    color: var(--royal-ink);
    background: #f8fbfa;
    font-size: .75rem;
}

.royal-docs-side-search input:focus {
    border-color: #76bdb5;
    box-shadow: 0 0 0 3px rgba(8, 127, 120, .08);
}

.royal-docs-side-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem .75rem;
    border-top: 1px solid var(--royal-line);
    border-bottom: 1px solid var(--royal-line);
    color: var(--royal-ink);
    font-size: .76rem;
    font-weight: 800;
}

.royal-docs-side-title small {
    color: var(--royal-muted);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.royal-docs-tree {
    display: grid;
    gap: .22rem;
    padding-top: .65rem;
}

.royal-docs-tree-link {
    display: flex;
    min-height: 2.65rem;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .55rem .7rem;
    border-radius: .72rem;
    color: #52647a;
    font-size: .73rem;
    font-weight: 700;
    line-height: 1.4;
    transition: color .18s ease, background .18s ease;
}

.royal-docs-tree-link:hover {
    color: var(--royal-accent-dark);
    background: #f0f8f6;
}

.royal-docs-tree-link.is-active {
    color: var(--royal-accent-dark);
    background: #dff7f1;
}

.royal-docs-tree-chevron {
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
    transition: transform .18s ease;
}

.royal-docs-tree-link.is-expanded .royal-docs-tree-chevron {
    transform: rotate(90deg);
}

.royal-docs-tree-children {
    display: grid;
    gap: .15rem;
    margin-left: .9rem;
    padding-left: .55rem;
    border-left: 1px solid #cfe3e0;
}

.royal-docs-main {
    min-width: 0;
}

.royal-docs-content-head {
    max-width: 730px;
    margin-bottom: 2rem;
}

.royal-docs-content-head h2 {
    font-size: clamp(2.35rem, 4.3vw, 3.8rem);
}

.royal-docs-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.royal-docs-section-card {
    display: flex;
    min-height: 280px;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--royal-line);
    border-radius: 1.2rem;
    color: var(--royal-ink);
    background: #fff;
    box-shadow: 0 16px 42px rgba(16, 35, 61, .06);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.royal-docs-section-card:hover {
    border-color: #9ed4ce;
    box-shadow: 0 22px 50px rgba(16, 35, 61, .1);
    transform: translateY(-4px);
}

.royal-docs-section-card__number {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    margin-bottom: 1.7rem;
    border-radius: .85rem;
    color: var(--royal-accent-dark);
    background: #dff7f1;
    font-size: .72rem;
    font-weight: 800;
}

.royal-docs-section-card > div {
    flex: 1;
}

.royal-docs-section-card__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--royal-line);
    color: var(--royal-accent-dark);
    font-size: .76rem;
    font-weight: 800;
}

.royal-docs-article {
    overflow: hidden;
    border: 1px solid var(--royal-line);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 18px 48px rgba(16, 35, 61, .065);
}

.royal-docs-article__meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 1rem clamp(1.35rem, 4vw, 3.2rem);
    border-bottom: 1px solid var(--royal-line);
    color: var(--royal-muted);
    background: #f8fbfa;
    font-size: .69rem;
    font-weight: 700;
}

.royal-docs-article__content {
    padding: clamp(1.5rem, 5vw, 3.4rem);
    color: #263a50;
    font-size: .95rem;
    line-height: 1.82;
}

.royal-docs-article__content > :first-child {
    margin-top: 0 !important;
}

.royal-docs-article__content h1,
.royal-docs-article__content h2,
.royal-docs-article__content h3,
.royal-docs-article__content h4 {
    scroll-margin-top: 7rem;
    color: var(--royal-ink);
}

.royal-docs-article__content h1,
.royal-docs-article__content h2 {
    margin: 2.25rem 0 .9rem;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.royal-docs-article__content h1 {
    font-size: clamp(2.2rem, 5vw, 3.7rem);
}

.royal-docs-article__content h2 {
    padding-top: .35rem;
    font-size: clamp(1.9rem, 4vw, 2.85rem);
}

.royal-docs-article__content h3 {
    margin: 1.75rem 0 .65rem;
    font-size: 1.2rem;
    font-weight: 800;
}

.royal-docs-article__content p,
.royal-docs-article__content ul,
.royal-docs-article__content ol {
    margin: 0 0 1.05rem;
}

.royal-docs-article__content ul,
.royal-docs-article__content ol {
    padding-left: 1.4rem;
}

.royal-docs-article__content li + li {
    margin-top: .35rem;
}

.royal-docs-article__content a {
    color: var(--royal-accent-dark);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(8, 127, 120, .3);
    text-underline-offset: .18em;
}

.royal-docs-article__content img,
.royal-docs-article__content video,
.royal-docs-article__content iframe {
    max-width: 100%;
    height: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--royal-line);
    border-radius: 1rem;
}

.royal-docs-article__content iframe {
    width: 100%;
    min-height: 420px;
}

.royal-docs-article__content blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.2rem;
    border-left: 4px solid var(--royal-accent);
    border-radius: 0 .8rem .8rem 0;
    color: #37566b;
    background: #eef8f6;
}

.royal-docs-article__content pre {
    max-width: 100%;
    overflow: auto;
    margin: 1.35rem 0;
    padding: 1.15rem;
    border-radius: .9rem;
    color: #dff7f1;
    background: #10233d;
    font-size: .81rem;
    line-height: 1.7;
}

.royal-docs-article__content :not(pre) > code {
    padding: .16rem .38rem;
    border: 1px solid #d8e9e6;
    border-radius: .38rem;
    color: #075f5a;
    background: #eef8f6;
    font-size: .84em;
}

.royal-docs-article__content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 1.3rem 0;
    border-collapse: collapse;
}

.royal-docs-article__content th,
.royal-docs-article__content td {
    min-width: 140px;
    padding: .75rem;
    border: 1px solid var(--royal-line);
    text-align: left;
}

.royal-docs-article__content th {
    color: var(--royal-ink);
    background: #f0f8f6;
}

.royal-docs-next-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 1.25rem;
    padding: 2rem;
    border: 1px solid #bfe2dd;
    border-radius: 1.2rem;
    background:
        linear-gradient(rgba(8, 127, 120, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 127, 120, .035) 1px, transparent 1px),
        #effaf8;
    background-size: 28px 28px, 28px 28px, auto;
}

.royal-docs-next-step > div:first-child {
    max-width: 600px;
}

.royal-docs-next-step h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.royal-docs-next-step__actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: .65rem;
}

.royal-docs-toc {
    display: grid;
    gap: 1rem;
}

.royal-docs-toc__panel,
.royal-docs-help-card {
    padding: 1.15rem;
}

.royal-docs-toc__panel > span {
    display: block;
    margin-bottom: .85rem;
    color: var(--royal-ink);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.royal-docs-toc__panel nav {
    display: grid;
    gap: .12rem;
}

.royal-docs-toc__panel a {
    padding: .42rem 0 .42rem .7rem;
    border-left: 2px solid #dce9e7;
    color: var(--royal-muted);
    font-size: .69rem;
    line-height: 1.45;
}

.royal-docs-toc__panel a:hover {
    border-left-color: var(--royal-accent);
    color: var(--royal-accent-dark);
}

.royal-docs-toc__panel a.is-subsection {
    padding-left: 1.1rem;
    font-size: .65rem;
}

.royal-docs-help-card {
    color: var(--royal-ink);
    background: #fff9ed;
}

.royal-docs-help-card__icon {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    margin-bottom: .8rem;
    border-radius: .75rem;
    color: #9b6423;
    background: #ffe6af;
}

.royal-docs-help-card strong {
    display: block;
    font-size: .82rem;
}

.royal-docs-help-card p {
    margin: .45rem 0 .75rem;
    color: #756b5e;
    font-size: .68rem;
    line-height: 1.6;
}

.royal-docs-help-card a {
    color: #8a571d;
    font-size: .7rem;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .royal-docs-workspace__grid.has-toc {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .royal-docs-toc {
        display: none;
    }
}

@media (max-width: 920px) {
    .royal-docs-collection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .royal-docs-workspace__grid,
    .royal-docs-workspace__grid.has-toc {
        grid-template-columns: 1fr;
    }

    .royal-docs-sidebar {
        position: static;
    }

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

    .royal-docs-tree-children {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .royal-docs-masthead__grid {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.5rem;
    }

    .royal-docs-masthead__action {
        align-items: center;
        flex-direction: row;
    }
}

@media (max-width: 720px) {
    .royal-docs-home-section,
    .royal-docs-workspace {
        padding-top: 3.75rem;
        padding-bottom: 5rem;
    }

    .royal-docs-section-head,
    .royal-docs-next-step {
        align-items: flex-start;
        flex-direction: column;
    }

    .royal-docs-collection-grid,
    .royal-docs-result-grid,
    .royal-docs-section-grid,
    .royal-docs-tree,
    .royal-docs-tree-children {
        grid-template-columns: 1fr;
    }

    .royal-docs-collection-card {
        min-height: 315px;
    }

    .royal-docs-masthead {
        padding: 2.3rem 0 2.8rem;
    }

    .royal-docs-masthead__identity {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .royal-docs-masthead__identity h1 {
        font-size: clamp(2.45rem, 13vw, 3.75rem);
    }

    .royal-docs-masthead__action {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .royal-docs-masthead__action .royal-button {
        justify-content: center;
    }

    .royal-docs-article__content iframe {
        min-height: 260px;
    }

    .royal-docs-next-step__actions {
        width: 100%;
    }

    .royal-docs-next-step__actions .royal-button {
        justify-content: center;
    }
}

/* Royal minimal documentation lock */
.royal-docs {
    background: #fff;
}

.royal-docs-section-head h2,
.royal-docs-content-head h2,
.royal-docs-next-step h2,
.royal-docs-masthead__identity h1,
.royal-docs-article__content h1,
.royal-docs-article__content h2 {
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: 1.02;
}

.royal-docs-home-section {
    background: radial-gradient(circle at 8% 8%, rgba(255, 95, 87, .055), transparent 24rem), #fff;
}

.royal-docs-collection-card {
    border-color: #ececef;
    border-radius: 1rem;
    background:
        linear-gradient(rgba(255, 95, 87, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 95, 87, .025) 1px, transparent 1px),
        #fff;
    background-size: 32px 32px, 32px 32px, auto;
    box-shadow: 0 10px 30px rgba(20, 20, 20, .05);
}

.royal-docs-collection-card::after {
    background: rgba(255, 226, 223, .7);
}

.royal-docs-collection-card:hover {
    border-color: #ffc8c4;
    box-shadow: 0 18px 42px rgba(20, 20, 20, .09);
}

.royal-docs-collection-logo {
    border-color: #ffd8d5;
    background: #fff4f3;
    color: #d94841;
}

.royal-docs-card-kicker,
.royal-docs-card-arrow {
    color: #d94841;
}

.royal-docs-collection-card:hover .royal-docs-card-arrow {
    background: #ff5f57;
}
