.ds-mobile-sheet {
    position: fixed;
    inset: 0 0 0 auto;
    box-sizing: border-box;
    inline-size: min(calc(100% - 24px), 29rem);
    max-inline-size: 100%;
    block-size: 100vh;
    block-size: 100dvh;
    max-block-size: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--ds-sheet-surface);
    color: var(--ds-sheet-ink);
    box-shadow: -16px 0 50px #100f162b;
    overflow: hidden;
    overscroll-behavior: contain;
    font: inherit;
    text-align: start;
    isolation: isolate;
}

.ds-mobile-sheet[open] {
    display: flex;
    flex-direction: column;
}

.ds-mobile-sheet[data-layout="wide"] {
    inline-size: min(calc(100% - 20px), 33rem);
}

.ds-mobile-sheet[data-layout="card"] {
    inset: max(12px, env(safe-area-inset-top)) 12px auto auto;
    inline-size: min(calc(100% - 24px), 31rem);
    block-size: auto;
    max-block-size: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
    border: 1px solid var(--ds-sheet-line);
    border-radius: var(--ds-sheet-radius);
    box-shadow: 0 14px 52px #100f1638;
}

.ds-mobile-sheet::backdrop {
    background: rgba(15, 16, 20, 0.54);
    overflow: hidden;
    overscroll-behavior: contain;
}

.ds-mobile-sheet__header,
.ds-mobile-sheet__nav,
.ds-mobile-sheet__footer {
    padding-inline: clamp(18px, 5vw, 36px);
}

.ds-mobile-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    min-block-size: 70px;
    padding-block: max(12px, env(safe-area-inset-top)) 12px;
    border-block-end: 1px solid var(--ds-sheet-line);
}

.ds-mobile-sheet .ds-mobile-sheet__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-inline-size: 0;
    min-block-size: 44px;
    color: var(--ds-sheet-ink);
    text-decoration: none;
    font-family: var(--ds-sheet-heading, inherit);
    font-size: clamp(20px, 6vw, 31px);
    font-weight: 650;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.ds-mobile-sheet__brand img {
    display: block;
    inline-size: auto;
    max-inline-size: 100%;
    block-size: auto;
    max-block-size: 52px;
    object-fit: contain;
    object-position: left center;
}

.ds-mobile-sheet__brand > :is(svg, .logo-mark, .brand-mark) {
    flex-shrink: 0;
}

.ds-mobile-sheet .ds-mobile-sheet__close {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 44px;
    block-size: 44px;
    margin: 0;
    padding: 0 0 3px;
    border: 1px solid var(--ds-sheet-line);
    border-radius: min(24px, var(--ds-sheet-radius));
    background: transparent;
    color: var(--ds-sheet-ink);
    font: 400 28px/1 system-ui;
    text-transform: none;
    cursor: pointer;
}

.ds-mobile-sheet__nav {
    min-block-size: 0;
    flex: 1 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    padding-block: clamp(10px, 3vw, 24px);
}

.ds-mobile-sheet__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ds-mobile-sheet .ds-mobile-sheet__link,
.ds-mobile-sheet .ds-mobile-sheet__summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-block-size: 48px;
    padding-block: 9px;
    border-block-end: 1px solid var(--ds-sheet-line);
    color: var(--ds-sheet-ink);
    font-size: clamp(17px, 4.8vw, 23px);
    font-family: var(--ds-sheet-heading, inherit);
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.22;
    text-align: start;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.ds-mobile-sheet__link[aria-current] {
    background: color-mix(in srgb, var(--ds-sheet-accent) 9%, transparent);
    padding-inline: 8px;
}

.ds-mobile-sheet__group[data-current] > .ds-mobile-sheet__summary:not([aria-label]) {
    text-decoration: underline;
    text-decoration-color: var(--ds-sheet-accent);
    text-underline-offset: .24em;
}

.ds-mobile-sheet__summary {
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.ds-mobile-sheet__summary::-webkit-details-marker {
    display: none;
}

.ds-mobile-sheet__summary::after {
    content: "";
    inline-size: .48em;
    block-size: .48em;
    margin-inline-end: 4px;
    border-inline-end: 1.5px solid currentColor;
    border-block-end: 1.5px solid currentColor;
    rotate: 45deg;
}

.ds-mobile-sheet__group[open] > .ds-mobile-sheet__summary::after {
    rotate: 225deg;
}

.ds-mobile-sheet__split {
    position: relative;
}

.ds-mobile-sheet .ds-mobile-sheet__split > .ds-mobile-sheet__link {
    padding-inline-end: 54px;
}

.ds-mobile-sheet .ds-mobile-sheet__split > details > summary {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    display: grid;
    place-items: center;
    inline-size: 44px;
    padding: 0;
    border-block-end: 0;
    border-inline-start: 1px solid var(--ds-sheet-line);
}

.ds-mobile-sheet__group .ds-mobile-sheet__link {
    padding-inline-start: 16px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
}

.ds-mobile-sheet__footer {
    flex: none;
    padding-block: 15px max(16px, env(safe-area-inset-bottom));
    border-block-start: 1px solid var(--ds-sheet-line);
}

.ds-mobile-sheet .ds-mobile-sheet__action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-block-size: 50px;
    padding: 12px 16px;
    border-radius: var(--ds-sheet-radius);
    background: var(--ds-sheet-accent);
    color: var(--ds-sheet-accentInk);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.ds-mobile-sheet__action::after {
    content: "→" / "";
}

.ds-mobile-sheet :is(a, button, summary):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}

@media (hover: hover) {
    .ds-mobile-sheet :is(.ds-mobile-sheet__link, .ds-mobile-sheet__summary, .ds-mobile-sheet__close):hover {
        background-color: color-mix(in srgb, var(--ds-sheet-ink) 8%, transparent);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .ds-mobile-sheet[open] {
        animation: ds-sheet-enter 170ms ease-out;
    }

    @keyframes ds-sheet-enter {
        from { opacity: 0; translate: 16px 0; }
        to { opacity: 1; translate: 0; }
    }
}

@media (max-height: 460px) {
    .ds-mobile-sheet__header { min-block-size: 58px; padding-block: 7px; }
    .ds-mobile-sheet__nav { padding-block: 4px 8px; }
    .ds-mobile-sheet__footer { padding-block: 8px max(8px, env(safe-area-inset-bottom)); }
}
