.kh-masthead {
    box-sizing: border-box;
    max-width: 1402px;
    margin: 0 auto;
    background: var(--kh-surface);
    color: var(--kh-ink);
    font: 15px/1.4 "Open Sans", Arial, sans-serif;
}

.kh-masthead *,
.kh-masthead *::after {
    box-sizing: border-box;
}

.kh-header-main,
.kh-nav-inner {
    width: min(100% - 40px, 940px);
    margin-inline: auto;
}

.kh-header-main {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding-block: 10px;
}

.kh-brand {
    display: inline-flex;
    width: fit-content;
}

.kh-brand img {
    aspect-ratio: 500 / 287;
    object-fit: contain;
    display: block;
    width: 142px;
    height: auto;
    mix-blend-mode: multiply;
}

.kh-masthead a {
    color: inherit;
    text-decoration: none;
}

.kh-masthead a:hover {
    color: var(--kh-brand-deep);
}

.kh-masthead a:focus {
    outline: 2px solid var(--kh-brand-deep);
    outline-offset: 2px;
}

.kh-contact-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
    color: var(--kh-brand-deep);
    font-size: 14px;
    font-weight: 700;
}

.kh-masthead small {
    color: var(--kh-muted);
    font-size: 12px;
    font-weight: 400;
}

.kh-call .kh-phone {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--kh-ink);
    font: 700 23px/1.12 "Yanone Kaffeesatz", "Arial Narrow", sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kh-call > .kh-phone {
    font-size: 30px;
}

.kh-masthead .kh-phone:hover,
.kh-write .header-messengers--labeled a:hover {
    color: var(--kh-brand-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.kh-free-call {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
}

.kh-write .header-messengers {
    display: flex;
    gap: 8px;
    margin-top: 3px;
}

.kh-write .header-messengers a {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--kh-line);
    border-radius: 5px;
    background: var(--kh-inverse);
}

.kh-write .header-messengers img {
    display: block;
    width: 24px;
    height: 24px;
    flex: none;
}

.kh-write .header-messengers--labeled {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin: 0;
}

.kh-write .header-messengers--labeled a {
    min-height: 30px;
    gap: 8px;
    border: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
}

.kh-messenger-note {
    display: inline-block;
    white-space: nowrap;
}

.kh-header-tools {
    background: var(--kh-brand);
    color: var(--kh-on-brand);
}

.kh-nav-inner,
.kh-header-nav {
    display: flex;
    align-items: center;
}

.kh-header-nav a:is([aria-current], :hover):focus {
    outline-color: var(--kh-inverse);
}

.kh-nav-inner {
    justify-content: space-between;
    gap: 16px;
}

.kh-header-nav a {
    display: inline-flex;
    color: var(--kh-inverse);
    min-height: 52px;
    align-items: center;
    padding: 0 18px;
    border-block: 3px solid transparent;
    font: 700 22px/1.15 "Yanone Kaffeesatz", "Arial Narrow", sans-serif;
}

.kh-header-nav a[aria-current] {
    background: var(--kh-brand-deep);
    color: var(--kh-inverse);
    border-bottom-color: currentColor;
}

.kh-header-nav a:hover {
    background: var(--kh-brand-deep);
    color: var(--kh-inverse);
}

.kh-header-nav a:focus {
    outline-color: var(--kh-on-brand);
    outline-offset: -4px;
}

.page .newDesign .header.main > .inner.kh-header-landscape {
    height: auto;
    padding: 12px 0;
    background-position: center bottom;
    background-repeat: no-repeat;
}

/* Keep the apartment search legible against the photograph. */
.kh-header-landscape .search--home .header-search-title {
    margin: 0;
    color: var(--kh-ink);
    font: 700 clamp(26px, 3vw, 38px)/1.12 "Yanone Kaffeesatz", "Arial Narrow", sans-serif;
}

.kh-header-landscape div.form form.filter_form .element.id input[name="FLAT_ID"] {
    opacity: 1;
    color: var(--kh-ink);
    background: var(--kh-surface);
    border: 1px solid var(--kh-muted);
}

.kh-header-landscape .element.id input[name="FLAT_ID"]::placeholder {
    color: var(--kh-muted);
    opacity: 1;
}

.kh-header-landscape .filter_form .element :is(input, select):focus-visible {
    outline: 2px solid var(--kh-brand-deep);
    outline-offset: 1px;
    box-shadow: 0 0 0 4px var(--kh-inverse);
}

.kh-header-landscape .search--home {
    float: right;
}

/* Some touch tablets request the desktop template. */
@media (any-pointer: coarse) {
    .kh-masthead .kh-call .kh-phone,
    .kh-masthead .kh-write .header-messengers--labeled a {
        min-height: 44px;
    }
}

@media (max-width: 940px) {
    .kh-header-main {
        grid-template-columns: auto 1fr 1fr auto;
        column-gap: 16px;
    }
    .kh-brand img { width: 96px; }
    .kh-free-call { display: block; }
    .kh-free-call small { display: block; }
}

@media (max-width: 660px) {
    .kh-header-main {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .kh-language-control { grid-column: 2; grid-row: 1; justify-self: end; }
    .kh-call, .kh-write { grid-row: 2; align-self: start; }
    .kh-nav-inner { flex-wrap: wrap; gap: 0 10px; }
    .kh-header-nav { flex-wrap: wrap; }
    .kh-header-nav a { padding-inline: 10px; }
    .kh-nav-inner .kh-mail-action { margin-block: 3px; }
}

@media (max-width: 420px) {
    .kh-header-main { grid-template-columns: 1fr auto; }
    .kh-call, .kh-write { grid-column: 1 / -1; }
    .kh-write { grid-row: 3; }
}

@media (max-width: 999px) {
    .kh-header-landscape {
        box-sizing: border-box;
        max-width: calc(100vw - 2px);
    }

    .kh-header-landscape > .content.bottom {
        max-width: calc(100% - 32px);
    }

    .kh-header-landscape .content.bottom > .inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0 16px;
        align-items: center;
    }

    .kh-header-landscape .search {
        grid-column: 1 / -1;
        min-width: 0;
        max-width: 100%;
    }

    .kh-header-landscape .search--home {
        grid-column: 2;
    }

    .kh-header-landscape .header-search-title {
        max-width: 100%;
    }

    .kh-header-landscape .search .form {
        box-sizing: border-box;
        max-width: 100%;
    }

    .kh-header-landscape .form .filter_form {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 6px;
    }

    .kh-header-landscape .search .form .filter_form .element {
        float: none;
        margin: 0;
        height: auto;
    }

    .kh-header-landscape .form .filter_form .element.filter {
        flex: 1 1 155px;
        width: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 101px), 1fr));
        align-content: start;
        align-items: center;
        gap: 4px;
        padding: 8px;
    }

    .kh-header-landscape .filter_form .element.filter label {
        grid-column: 1 / -1;
        margin: 0;
    }

    .kh-header-landscape .form .filter_form .element.filter input,
    .kh-header-landscape .form .filter_form .element.filter select,
    .kh-header-landscape .form .filter_form .element.filter select#f_cn {
        box-sizing: border-box;
        margin: 0;
        min-width: 0;
        width: 100%;
    }

    .kh-header-landscape .form .filter_form .element.filter select#f_cn {
        grid-column: 1 / -1;
    }

    .kh-header-landscape .form .filter_form .element.id,
    .kh-header-landscape .form .filter_form .element.submitBtn {
        align-self: center;
        width: 48px;
        height: 44px;
    }

    .index .kh-header-landscape .form .filter_form {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .index .kh-header-landscape .form .filter_form .element.id {
        grid-column: span 2;
        width: min(100%, 180px);
    }

    .index .kh-header-landscape .form .filter_form .element.submitBtn {
        justify-self: end;
        width: min(100%, 140px);
    }
}

@media (max-width: 700px) {
    .kh-header-landscape .search--home,
    .kh-header-landscape .search--home > .inner {
        display: contents;
    }

    .kh-header-landscape .search--home .form {
        grid-column: 1 / -1;
        width: 100%;
    }

    .kh-header-landscape .content.bottom .polygon,
    .kh-header-landscape .content.bottom .polygon .background {
        width: 96px;
        height: 96px;
        background-size: contain;
    }

    .kh-header-landscape .polygon .background .inner {
        background-size: contain;
    }

    .index .kh-header-landscape .form .filter_form {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    }

    .index .kh-header-landscape .form .filter_form .element.id {
        grid-column: auto;
    }
}
