.npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled {
    display: grid !important;
    align-items: end;
    gap: 14px !important;
    width: 100%;
}

.npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-item {
    min-width: 0;
    width: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    box-sizing: border-box;
}

.npm-property-search--top .npm-top-search-layout-item > label,
.npm-property-search--top .npm-top-search-layout-item > legend,
.npm-property-search--top .npm-top-search-layout-item .npm-property-search__label,
.npm-property-search--top .npm-top-search-layout-item .npm-search-label {
    width: 100%;
    box-sizing: border-box;
}

.npm-property-search--top .npm-top-search-layout-composite {
    display: flex !important;
    align-items: stretch;
    gap: 10px !important;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.npm-property-search--top .npm-top-search-layout-composite--single {
    display: block !important;
}

.npm-property-search--top .npm-top-search-layout-composite--single > .npm-top-search-layout-control-wrap:not([hidden]) {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 100% !important;
    margin: 0 !important;
}

/*
 * 先頭側の子項目（都道府県／沿線）を無効にして、
 * 後方側の子項目（市区町村／駅）だけを表示する場合の補正。
 * hidden属性が残った状態でも、有効な後方項目を親幅いっぱいに表示します。
 */
.npm-property-search--top .npm-property-search__prefecture-city.npm-top-search-layout-composite--single:has(> :first-child[hidden]) > :last-child,
.npm-property-search--top .npm-property-search__route-station.npm-top-search-layout-composite--single:has(> :first-child[hidden]) > :last-child {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 100% !important;
    margin: 0 !important;
}

.npm-property-search--top .npm-top-search-layout-composite--empty {
    display: none !important;
}

.npm-property-search--top .npm-top-search-layout-control-wrap {
    min-width: 0;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.npm-property-search--top .npm-top-search-control-hidden,
.npm-property-search--top [hidden].npm-top-search-layout-control-wrap,
.npm-property-search--top .npm-top-search-layout-composite > [hidden] {
    display: none !important;
}

.npm-property-search--top .npm-top-search-layout-control-wrap > select,
.npm-property-search--top .npm-top-search-layout-control-wrap > input,
.npm-property-search--top .npm-top-search-layout-control-wrap > button,
.npm-property-search--top .npm-top-search-layout-control {
    width: 100% !important;
    min-width: 0;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.npm-property-search--top .npm-top-search-layout-item:not(.npm-property-search__field) select,
.npm-property-search--top .npm-top-search-layout-item:not(.npm-property-search__field) input,
.npm-property-search--top .npm-top-search-layout-item:not(.npm-property-search__field) button,
.npm-property-search--top .npm-property-search__field:not(:has(.npm-top-search-layout-composite)) select,
.npm-property-search--top .npm-property-search__field:not(:has(.npm-top-search-layout-composite)) input,
.npm-property-search--top .npm-property-search__field:not(:has(.npm-top-search-layout-composite)) button {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.npm-property-search--top .npm-top-search-layout-submit {
    justify-self: stretch;
    margin-left: 0 !important;
}

.npm-property-search--top .npm-top-search-layout-submit button,
.npm-property-search--top .npm-top-search-layout-submit input[type="submit"] {
    width: 100% !important;
}

@media (min-width: 1200px) {
    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled {
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-item {
        grid-column: span var(--npm-item-pc, 2);
        order: var(--npm-order-pc, 1);
    }

    .npm-property-search--top .npm-top-search-layout-composite:not(.npm-top-search-layout-composite--single) > .npm-top-search-layout-control-wrap {
        flex: var(--npm-control-pc, 1) 1 0 !important;
        flex-basis: 0 !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-submit {
        grid-column: var(--npm-submit-pc-start, 10) / 13 !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-item {
        grid-column: span var(--npm-item-tablet, 2);
        order: var(--npm-order-tablet, 1);
    }

    .npm-property-search--top .npm-top-search-layout-composite:not(.npm-top-search-layout-composite--single) > .npm-top-search-layout-control-wrap {
        flex: var(--npm-control-tablet, 1) 1 0 !important;
        flex-basis: 0 !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-submit {
        grid-column: var(--npm-submit-tablet-start, 5) / 7 !important;
    }
}

@media (min-width: 651px) and (max-width: 767px) {
    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 12px 10px !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-item {
        grid-column: span var(--npm-item-mobile, 2);
        order: var(--npm-order-mobile, 1);
    }

    .npm-property-search--top .npm-top-search-layout-composite:not(.npm-top-search-layout-composite--single) > .npm-top-search-layout-control-wrap {
        flex: var(--npm-control-mobile, 1) 1 0 !important;
        flex-basis: 0 !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-submit {
        grid-column: var(--npm-submit-mobile-start, 3) / 5 !important;
    }
}

@media (max-width: 650px) {
    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px 10px !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-item {
        grid-column: span var(--npm-item-compact, 2);
        order: var(--npm-order-compact, 1);
    }

    .npm-property-search--top .npm-top-search-layout-composite:not(.npm-top-search-layout-composite--single) > .npm-top-search-layout-control-wrap {
        flex: var(--npm-control-compact, 1) 1 0 !important;
        flex-basis: 0 !important;
    }

    .npm-property-search--top .npm-property-search__top-row.npm-top-search-layout-enabled > .npm-top-search-layout-submit {
        grid-column: var(--npm-submit-compact-start, 1) / 3 !important;
    }
}
