@font-face {
    font-family: Anybody;
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 50% 150%;
    font-display: swap;
    src: url("../fonts/anybody-latin-BlY0JmM.woff2") format('woff2');
}

@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-next-latin-kiaiMj2.woff2") format('woff2');
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html[data-theme='night'] {
    color-scheme: dark;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: var(--font-text);
    font-size: 17px;
    line-height: 27px;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
    margin: 0;
}

a {
    color: var(--link);
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 10;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-control);
    background: var(--ink);
    color: var(--page);
    font-weight: 700;
    transform: translateY(-200%);
}

.skip-link:focus-visible {
    transform: none;
}

.zn-wordmark {
    display: inline-block;
    padding: 6px 14px 8px;
    border-radius: var(--radius-chip);
    background: var(--page);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 30px;
    font-stretch: 150%;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.zn-palette-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-chip);
    background: var(--page);
    color: var(--ink);
    cursor: pointer;
}

/* The widest word, the French very-high one at 145% width and weight 900, is 8.9em and never wraps: below the 352px of text of the desktop panel it shrinks with its panel (10.8cqi). The first size is for browsers without container units. */
.zn-word {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 38px;
    font-size: min(38px, 10.8cqi);
    line-height: 40px;
    white-space: nowrap;
}

.zn-word[data-level='low'] {
    font-stretch: 70%;
    font-weight: 400;
}

.zn-word[data-level='moderate'] {
    font-stretch: 88%;
    font-weight: 550;
}

.zn-word[data-level='high'] {
    font-stretch: 115%;
    font-weight: 750;
}

.zn-word[data-level='very_high'] {
    font-stretch: 145%;
    font-weight: 900;
}

.zn-word[data-level='unknown'] {
    color: var(--muted);
    font-size: 24px;
    font-stretch: 100%;
    font-weight: 500;
    white-space: normal;
}

.zn-word--small,
.zn-word--small[data-level='unknown'] {
    font-size: 17px;
    line-height: 22px;
}

[data-level='low'] {
    --zn-heat: var(--heat-low);
}

[data-level='moderate'] {
    --zn-heat: var(--heat-moderate);
}

[data-level='high'] {
    --zn-heat: var(--heat-high);
}

[data-level='very_high'] {
    --zn-heat: var(--heat-very-high);
}

[data-level='unknown'] {
    --zn-heat: var(--heat-unknown);
}

.zn-rating {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    row-gap: var(--space-1);
    padding: var(--space-3) 0 14px;
    border-top: 1px solid var(--line);
}

.zn-rating__label,
.zn-rating__count {
    font-size: 15px;
    line-height: 22px;
}

.zn-rating__label {
    color: var(--muted);
}

.zn-rating__count {
    color: var(--text);
    text-align: right;
}

.zn-rating .zn-word,
.zn-rating__bar,
.zn-rating__note {
    grid-column: 1 / -1;
}

.zn-rating__note {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.zn-rating__bar {
    height: 6px;
    border-radius: var(--radius-bar);
    background: var(--zn-heat);
}

.zn-rating[data-level='unknown'] .zn-rating__bar {
    outline: 1px dashed var(--muted);
    outline-offset: -1px;
}

.zn-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3) var(--space-4);
    padding: 14px 18px 12px;
    border-radius: var(--radius-control);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}

.zn-legend__item {
    display: grid;
    gap: 7px;
}

.zn-legend__swatch {
    display: block;
    height: 8px;
    border-radius: var(--radius-bar);
    background: var(--zn-heat);
}

.zn-legend__item[data-level='unknown'] .zn-legend__swatch {
    outline: 1px dashed var(--muted);
    outline-offset: -1px;
}

.zn-dpe {
    display: grid;
    gap: 6px;
}

.zn-dpe__bar {
    display: flex;
    gap: 3px;
    height: 6px;
}

.zn-dpe__segment {
    border-radius: var(--radius-bar);
}

.zn-dpe__segment--insufficient {
    background: var(--heat-very-high);
}

.zn-dpe__segment--average {
    background: var(--heat-moderate);
}

.zn-dpe__segment--good {
    background: var(--heat-low);
}

.zn-dpe__caption {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.zn-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: 0 var(--space-5);
    border: 0;
    border-radius: var(--radius-control);
    font-family: var(--font-text);
    font-size: 17px;
    font-weight: 700;
    line-height: 24px;
    text-decoration: none;
    cursor: pointer;
}

.zn-button--primary {
    background: var(--accent);
    color: var(--on-accent);
}

.zn-button--primary:hover {
    background: var(--accent-hover);
}

.zn-button--secondary {
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 0 0 1.5px var(--control);
}

.zn-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    width: 100%;
    max-width: 384px;
}

.zn-search__label {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
}

.zn-search__field {
    position: relative;
    display: flex;
    gap: var(--space-2);
}

.zn-search__icon {
    position: absolute;
    top: 16px;
    left: 18px;
    color: var(--muted);
    pointer-events: none;
}

.zn-search__input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 var(--space-4) 0 50px;
    border: 1.5px solid var(--control);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 17px;
}

.zn-search__input::placeholder {
    color: var(--muted);
}

.zn-search__submit {
    min-height: 52px;
    padding: 0 var(--space-4);
}

.zn-search__results {
    max-height: min(28rem, 60vh);
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-control);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    list-style: none;
}

.zn-search__result {
    padding: 10px var(--space-3);
    border-radius: 8px;
    color: var(--ink);
    font-size: 17px;
    line-height: 24px;
    cursor: pointer;
}

.zn-search__result[aria-selected='true'],
.zn-search__result:hover {
    background: var(--accent-soft);
}

.zn-search__result[aria-selected='true'] {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.zn-search__result small {
    display: block;
    color: var(--muted);
    font-size: 15px;
    line-height: 22px;
}

.zn-panel {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 26px 28px 22px;
    border-radius: var(--radius-panel);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    color: var(--text);
}

.zn-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.zn-panel__address,
.intro__title {
    color: var(--ink);
    font-family: var(--font-display);
    font-stretch: 115%;
    font-weight: 750;
}

.zn-panel__address {
    font-size: 27px;
    line-height: 30px;
}

.zn-panel__close {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -10px -12px 0 0;
    border-radius: var(--radius-control);
    color: var(--ink);
}

.zn-panel__facts {
    margin-top: 6px;
    color: var(--muted);
    font-size: 15px;
    line-height: 22px;
}

.zn-panel__ratings {
    margin-top: 18px;
}

.zn-panel__why {
    margin-top: 14px;
    font-size: 15px;
    line-height: 23px;
}

.zn-panel__dpe {
    margin-top: var(--space-3);
}

.zn-panel__note {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.zn-panel__neighbours {
    margin-top: var(--space-5);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.zn-panel__neighbours-title {
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 24px;
}

.zn-panel__actions {
    display: grid;
    gap: 6px;
    margin-top: var(--space-5);
}

.zn-panel__expand {
    margin-top: var(--space-4);
}

.zn-panel__more .footer-links {
    margin-top: var(--space-5);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.intro__title {
    font-size: 34px;
    line-height: 38px;
}

.intro__lead {
    margin-top: var(--space-3);
    color: var(--ink);
}

.intro__hint {
    margin-top: var(--space-3);
}

.intro__subtitle {
    margin: var(--space-5) 0 var(--space-2);
    color: var(--ink);
    font-size: 21px;
    line-height: 28px;
}

.brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.language-nav {
    display: flex;
}

.language-nav a {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-chip);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.language-nav a[aria-current='page'] {
    background: var(--accent-soft);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.palette-status {
    padding: 2px var(--space-2);
    border-radius: var(--radius-chip);
    background: var(--page);
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

/* An empty status stays in the accessibility tree: a live region that appears together with its text is often not announced. */
.visually-hidden,
.palette-status:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.account-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--space-4);
}

.account-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 16px;
}

.page {
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--space-7) var(--space-4) var(--space-8);
}

.page__title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(34px, 6vw, 44px);
    font-stretch: 115%;
    font-weight: 800;
    line-height: 1.1;
}

.page__lead {
    margin-top: var(--space-4);
    color: var(--ink);
    font-size: 21px;
    line-height: 30px;
}

/* :where() keeps the prose rules at the specificity of their elements, so that a component class inside the page always wins. */
:where(.page) h2 {
    margin: var(--space-6) 0 var(--space-3);
    color: var(--ink);
    font-size: 21px;
    line-height: 28px;
}

:where(.page) h3 {
    margin: var(--space-5) 0 var(--space-2);
    color: var(--ink);
    font-size: 17px;
    line-height: 24px;
}

:where(.page) ul {
    padding-left: var(--space-5);
}

:where(.page) p + p,
:where(.page) ul + p,
:where(.page) p + ul {
    margin-top: var(--space-3);
}

:where(.page) li + li {
    margin-top: var(--space-2);
}

:where(.page) .zn-search {
    margin-top: var(--space-5);
}

/* The components inside the page space their own parts: the prose margins must not reach their paragraphs and list items. */
.zn-rating > p,
.zn-search__results > li,
.results > li {
    margin-top: 0;
}

.placeholder {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--accent);
    border-radius: var(--radius-control);
    background: var(--accent-soft);
    color: var(--ink);
}

.formula {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-control);
    background: var(--page-alt);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.sources {
    display: grid;
    gap: var(--space-5);
}

.source dt {
    color: var(--ink);
    font-weight: 700;
}

.source dd {
    color: var(--text);
    font-size: 15px;
    line-height: 23px;
}

.notice {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-control);
    background: var(--page-alt);
    color: var(--ink);
}

.results {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: 0;
    list-style: none;
}

.results__item {
    display: grid;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-control);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}

.results__label {
    color: var(--ink);
    font-weight: 700;
}

.results__status {
    color: var(--muted);
    font-size: 15px;
}

.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-4);
    padding: 0;
    list-style: none;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 15px;
}

.footer-links a[aria-current='page'],
.account-nav a[aria-current='page'] {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--page-alt);
}

.site-footer__inner {
    max-width: 44rem;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4) var(--space-6);
}

.fine {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

@media (prefers-reduced-motion: no-preference) {
    body {
        transition:
            background-color 150ms ease-out,
            color 150ms ease-out;
    }

    .zn-button,
    .zn-palette-toggle,
    .skip-link {
        transition:
            background-color 150ms ease-out,
            transform 150ms ease-out;
    }
}
