.root {
    position: relative;
    width: 240px;
    max-width: 100%;
}

.toggleButton {
    width: 100%;
    padding: var(--spacing-24) var(--spacing-16);
    border: none;
    background: none;
    border-radius: var(--letter-spacing-null);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-8);
    border-top: var(--border-width-sm) solid var(--border-color-light);
    color: var(--color-text-primary);
}

.toggleIcon {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
}

.menu {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    color: var(--color-text-primary);
    transition: grid-template-rows 0.3s, padding-bottom 0.3s;
}

.subOptions {
    display: flex;
    width: 100%;
    padding: 0;
    margin: 0;
    flex-direction: column;
    list-style: none;
    gap: 4px;
}

.option {
    transition: background-color 0.3s linear;
    border-radius: var(--border-radius-xs);
    overflow: hidden;
    cursor: pointer;
}

.option:hover {
    outline: none;
    background-color: var(--color-bg-neutral-light);
}

.option > .selected {
    background-color: var(--color-bg-neutral-medium);
}

.divider {
    cursor: default;
    overflow: hidden;
}

.optionLabel {
    width: 100%;
    transition:
        padding-top 0.3s linear,
        padding-bottom 0.3s linear;
    padding: var(--spacing-12) var(--spacing-28);
}

.dividerLabel {
    width: 100%;
    transition:
        padding-top 0.3s linear,
        padding-bottom 0.3s linear;
    padding: var(--spacing-12) var(--spacing-16);
}

.dividerLine {
    padding-top: var(--spacing-4);
    border-top: var(--border-width-sm) solid var(--border-color-light);
}

.menu.isOpen {
    gap: var(--spacing-4);
    grid-template-rows: 1fr;
}

.menuContent {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

@media (width <= 768px) {
    .root {
        width: 100%;
    }
}
