dialog {
    width: 840px;
}
dialog #agency-tab {
    display: flex;
    flex-direction: column;
}
dialog #agency-tab ul[role=tablist] {
    align-self: stretch;
    display: flex;
    border-radius: 5px;
    overflow: hidden;
}
dialog #agency-tab ul[role=tablist] li[role=tab] {
    flex: 1 0 50%;
    background: #e5edf5;
    font-weight: 500;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    display: flex;
    height: 4.6rem;
    justify-content: center;
    align-items: center;
    color: #121212;
    cursor: pointer;
}
dialog #agency-tab ul[role=tablist] li[role=tab].active {
    background: #243853;
    color: #fff;
}
dialog #agency-tab div[role=tabpanel] {
    display: none;
    flex-grow: 1;
    margin-top: 2rem;
    row-gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior-y: none;
    position: relative;
    --scrollTop: 0;
}
dialog #agency-tab div[role=tabpanel].active {
    display: grid;
    grid-template-columns: 4rem 1fr;
}
dialog #agency-tab div[role=tabpanel] span {
    background-color: #eaf2fc;
    font-weight: 500;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    color: #121212;
    display: flex;
    justify-content: center;
    align-items: center;
}
dialog #agency-tab div[role=tabpanel] ul {
    background-color: #f4f7fa;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    padding: 1rem;
}
dialog #agency-tab div[role=tabpanel] ul li {
    display: flex;
    align-items: center;
    height: 3.5rem;
    background: left 1rem center/18px 18px no-repeat;
    padding-left: 3.5rem;
    font-weight: 500;
    font-size: 1.3rem;
    letter-spacing: -0.03em;
    color: #121212;
}

@media (max-width: 480px) {
    dialog #agency-tab div[role=tabpanel].active {
        grid-template-columns: 1fr;
    }
    dialog #agency-tab div[role=tabpanel] span {
        background-color: unset;
        justify-content: flex-start;
        font-weight: 700;
        font-size: 1.8rem;
    }
    dialog #agency-tab div[role=tabpanel] span br {
        display: none;
    }
    dialog #agency-tab div[role=tabpanel] span ~ span {
        margin-top: 2rem;
    }
    dialog #agency-tab div[role=tabpanel] ul {
        border-radius: 10px;
    }
}