.mobile-sheet {
    position: fixed;
    inset: 0;
    z-index: 1250;
    visibility: hidden;
    pointer-events: none;
}

.mobile-sheet--visible {
    visibility: visible;
    pointer-events: auto;
}

.mobile-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sheet--visible .mobile-sheet__backdrop {
    opacity: 1;
    pointer-events: auto;
}

.mobile-sheet__dialog {
    position: absolute;
    inset-inline: 0;
    bottom: calc(env(safe-area-inset-bottom) + 5.75rem);
    padding-inline: 1rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.mobile-sheet--visible .mobile-sheet__dialog {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-sheet__panel {
    width: min(640px, 100%);
    max-height: calc(100vh - 7rem);
    background-color: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
}

.mobile-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.mobile-sheet__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.mobile-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background-color: #edf2f7;
    color: #1f2937;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.mobile-sheet__close:hover,
.mobile-sheet__close:focus-visible {
    background-color: #e2e8f0;
    outline: none;
}

.mobile-sheet__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-sheet__group {
    display: flex;
    flex-direction: column;
}

.mobile-sheet__section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
    margin: 0 0 0.75rem;
}

.mobile-sheet__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-sheet__item {
    display: flex;
}

.mobile-sheet__link,
.mobile-sheet__button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background-color: #f8fafc;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mobile-sheet__button {
    cursor: pointer;
}

.mobile-sheet__link:hover,
.mobile-sheet__link:focus-visible,
.mobile-sheet__button:hover,
.mobile-sheet__button:focus-visible {
    border-color: rgba(90, 55, 140, 0.35);
    background-color: rgba(90, 55, 140, 0.08);
    color: #3c366b;
    outline: none;
}

.mobile-sheet__link {
    justify-content: space-between;
}

.mobile-sheet__link:visited {
    color: #1f2937;
}

.mobile-sheet__button {
    justify-content: flex-start;
}

.mobile-sheet__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #5a378c;
    font-size: 1rem;
}

.mobile-sheet__text {
    flex: 1;
    text-align: left;
}

.mobile-sheet__chevron {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-left: 0.75rem;
}

.mobile-sheet__toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mobile-sheet__toggle:hover,
.mobile-sheet__toggle:focus-within {
    border-color: rgba(90, 55, 140, 0.35);
    background-color: rgba(90, 55, 140, 0.08);
}

.mobile-sheet__toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mobile-sheet__toggle-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    color: #1f2937;
    font-weight: 600;
}

.mobile-sheet__switch {
    position: relative;
    flex-shrink: 0;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background-color: #cbd5f5;
    transition: background-color 0.2s ease;
}

.mobile-sheet__switch::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease;
}

.mobile-sheet__toggle-input:checked + .mobile-sheet__switch {
    background-color: #5a378c;
}

.mobile-sheet__toggle-input:checked + .mobile-sheet__switch::after {
    transform: translateX(1.25rem);
}

body.mobile-sheet-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .mobile-sheet {
        display: none;
    }
}
