html, body {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    font-size: 13px;
    font-family: "Amazon Ember", Arial, sans-serif;
}
body {
    padding: 8px 16px;
    width: 100%;
    box-sizing: border-box;
}
h1 {
    margin-bottom: 0;
    font-size: 18px;
    margin-top: 8px;
    margin-bottom: 12px;
}
h2 {
    margin-bottom: 0;
    font-size: 16px;
    margin-top: 8px;
}
h3 {
    margin-bottom: 0;
    font-size: 14px;
    margin-top: 8px;
}
.group .error_message {
    display: none;
}
.group {
    margin-top: 12px;
}
.group .input-wrapper {
    display: flex;
}
.group[data-cols="1"] .input-wrapper
{
    display: block;
}
.group[data-cols="2"] .input-wrapper > div {
    flex: 1 1 50%;
}
.group[data-cols="3"] .input-wrapper > div:first-of-type {
    flex: 1 1 50%;
}
.group[data-cols="3"] .input-wrapper > div:first-of-type > input {
    width: 100%;
}

.group[data-cols="3"] .input-wrapper > div {
    flex: 1 1 calc(25% - 6px);
}

.group.error .error_message {
    display: block;
    color: #f33;
    margin-bottom: 4px;
}
.group input.error {
    border: 1px solid #f33 !important;
    box-shadow: 0 0 1px 1px #f33 !important;
}
.input-wrapper input, 
.input-wrapper select
{
    box-sizing: border-box;
    width: 100%;
    height: 28px;
    padding: 4px;

    border: 1px solid #999;
    border-radius: 3px;
    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0);
    transition: .17s linear;
}
.input-wrapper input:focus {
    outline: none;
    border: 1px solid #fdd734;
    box-shadow: 0 0 1px 1px #fdd734;
}
.input-wrapper > div {
    margin-left: 12px;
}
.input-wrapper > div:first-of-type {
    margin-left: 0;
}
.input-wrapper.submit {
    margin-top: 16px;
}
#address .map {
    margin-top: 8px;
    display: none;
    height: 160px;
    width: 100%;
    position: relative;
}
input[type='submit'] {
    background-color: rgb(35, 155, 86);
    color: white;
    height: 24px;
    border-radius: 5px;
    font-size: 16px;
    border: none;
    padding: 8px 16px 24px;
    margin-bottom: 20px;
}               

#show_algo_params-wrapper {
    display: none;
    /* display: flex; */
    align-items: center;
    margin-top: 12px;
}

#show_algo_params-wrapper * {
    cursor: pointer;
}
#algo_params_time, #algo_params {
    display: none;
}

section.params {
    /* min-width: 320px; */
    min-width: 288px;
    /* max-width: 480px; */
    max-width: 448px;
}

section.result {
    min-width: 320px;
    display: none;
}

@media screen and (min-width: 1008px) {
    main {
        display: flex;
    }
    section.params {
        flex: 1 0 320px;
    }
    section.result {
        flex: 1 0 640px;
        margin-left: 16px;
    }
}

.recommended {
    display: flex;
    margin-top: 16px;
}
.recommended {
    font-size: 14px;
}
.recommended div {
    margin-left: 16px;
}
.recommended div:first-of-type {
    margin-left: 0;
}
.recommended label:after {
    content: ':';
}
.recommended label {
    display: inline-block;
    margin-right: 4px;
}
.recommended span {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.recommended .price span:after {
    display: inline-block;
    margin-left: 4px;
    content: '\20bd';
}
.recommended .chance span:after {
    display: inline-block;
    margin-left: 2px;
    content: '%';
}

@media screen and (max-width: 320px) {
    .recommended {
        display: flex;
        margin-top: 16px;
        flex-direction: column;
    }
    .recommended div {
        margin-top: 8px;
        margin-left: 0;
    }
    .recommended div:first-of-type {
        margin-top: 0;
        margin-left: 0;
    }
}

.chances {
    margin-top: 20px;
}
.chances label:after {
    display: inline-block;
    margin-left: 2px;
    content: '%';
}
.chances span {
    display: inline-block;
    margin-left: 16px;
}
.chances span:after {
    display: inline-block;
    margin-left: 4px;
    content: '\20bd';
}
.chances ul {
    list-style: none;
    margin-top: 4px;
    margin-bottom: 4px;
    padding-inline-start: 16px;
}

h3.ads {
    margin-top: 24px;
    margin-bottom: 8px;
}

h3.ads span {
    display: inline-block;
    margin-left: 0.25em;
    font-weight: normal;
}
h3.ads span:before {
    content: '(';
}

h3.ads span:after {
    content: ')';
}

h3.ads label {
    margin-right: .2em;
    font-weight: normal;
}

h2 select {
    margin-left: 8px;
}

h2 select,
h3.ads select {
    box-sizing: border-box;
    height: 28px;
    padding: 4px;

    border: 1px solid #999;
    border-radius: 3px;
    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0);
    transition: .17s linear;
}

ol.ads {
    list-style-position: outside;
    padding-inline-start: 0px;
    margin-inline-start: 16px;
    margin-block-start: 0;
    margin-block-end: 24px;
}

.ad .sq_total:after, 
.ad .sq_life:after, 
.ad .floor:after
{
    content: '/';
}

.ad .price:after {
    content: '\20bd';
}

@media screen and (max-width: 579px) {

    ol.ads li > div {
        height: 90px;
        position: relative;
    }

    .ad .date {
        position: absolute;
        top: 0;
    }
    .ad .date:before {
        content: 'Дата: ';
    }

    .ad .price {
        position: absolute;
        top: 0;
        left: 110px;
    }
    .ad .price:before {
        content: 'Цена: ';
    }
    .ad .ads_api_id {
        position: absolute;
        top: 0;
        left: 230px;
    }
    .ad .ads_api_id:before {
        content: 'ID: ';
    }


    .ad .room_count {
        position: absolute;
        top: 20px;
    }
    .ad .room_count:after {
        content: '-x комн.кв, ';
    }
    .ad .sq {
        position: absolute;
        left: 80px;
        top: 20px;
    }
    .ad .sq:before {
        content: 'площадь: ';
    }
    .ad .bld {
        position: absolute;
        top: 40px;
    }
    .ad .bld:after {
        content: '-эт дома, ';
    }
    .ad .bld_type:before {
        content: 'дом: ';
    }
    .ad .bld_type {
        position: absolute;
        top: 40px;
        left: 90px;
    }
    .ad .address {
        display: block;
        position: absolute;
        top: 60px;
    }
    .ad .address:before {
        content: 'Адрес: ';
    }
}

@media screen and (max-width: 320px) {
    .ad .ads_api_id {
        display: none;
        /* position: absolute; */
        /* top: 0; */
        /* left: 230px; */
    }
    .ad .ads_api_id:before {
        display: none;
        /* content: 'ID: '; */
    }
    h3.ads label {
        display: none;
        /* margin-right: .2em; */
        /* font-weight: normal; */
    }
}


@media screen and (min-width: 580px) {

    ol.ads li > div {
        height: 28px;
        display: flex;
        align-items: center;
    }

    .ad .date {
        display: inline-block;
        flex: 0 0 5.8em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ad .price {
        flex: 0 0 7em;
    }

    .ad .ads_api_id {
        display: inline-block;
        flex: 0 0 5.8em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ad .room_count {
        flex: 0 0 1.5em;
    }

    .ad .sq{
        flex: 0 0 8em;
        text-align: center;
    }

    .ad .bld{
        flex: 0 0 4em;
        text-align: center;
    }

    .ad .bld_type {
        flex: 0 1 6em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


    .ad .address {
        display: inline-block;
        flex: 1 0 10em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-left: 0.5em;
    }

}
