:root {
    --bd-sheet-z-overlay: 9988;
    --bd-sheet-z-panel: 9989;
    --bd-sheet-radius: 24px;
    --bd-sheet-bg: #ffffff;
    --bd-sheet-text: #151821;
    --bd-sheet-muted: #6b7280;
    --bd-sheet-line: #e7e9ee;
    --bd-sheet-shadow: 0 -18px 50px rgba(15, 23, 42, 0.20);
}

html.bd-sheet-open,
body.bd-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.bd-common-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--bd-sheet-z-overlay);
    background: rgba(9, 12, 20, 0.52);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.bd-common-sheet-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.bd-common-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: var(--bd-sheet-z-panel);
    width: min(100%, 560px);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    background: var(--bd-sheet-bg);
    color: var(--bd-sheet-text);
    border-radius: var(--bd-sheet-radius) var(--bd-sheet-radius) 0 0;
    box-shadow: var(--bd-sheet-shadow);
    transform: translate(-50%, calc(100% + 24px));
    visibility: hidden;
    transition: transform 260ms cubic-bezier(.22,.8,.3,1), visibility 260ms ease;
    overflow: hidden;
}

.bd-common-sheet.is-open {
    transform: translate(-50%, 0);
    visibility: visible;
}

.bd-common-sheet__handle {
    width: 44px;
    height: 5px;
    margin: 10px auto 4px;
    border-radius: 999px;
    background: #d4d7dd;
    flex: 0 0 auto;
}

.bd-common-sheet__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 18px 14px;
    border-bottom: 1px solid var(--bd-sheet-line);
}

.bd-common-sheet__heading {
    min-width: 0;
    flex: 1;
}

.bd-common-sheet__title {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.bd-common-sheet__subtitle {
    margin: 4px 0 0;
    color: var(--bd-sheet-muted);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;
}

.bd-common-sheet__close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #171a22;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bd-common-sheet__close:active {
    transform: scale(.96);
}

.bd-common-sheet__close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.bd-common-sheet__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 18px max(22px, env(safe-area-inset-bottom));
}

@media (min-width: 700px) {
    .bd-common-sheet {
        bottom: 18px;
        border-radius: var(--bd-sheet-radius);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bd-common-sheet,
    .bd-common-sheet-overlay {
        transition: none;
    }
}
