/* CSS-Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #20312e;
    --muted: #5c6c68;
    --green: #185642;
    --line: #d9e4df;
    --pale: #f3f7f5;
}
body {
    margin: 0;
    line-height: 1.6;
}
a {
    color: var(--green);
}
a:hover {
    color: #24745e;
}
header {
    background: #173d34;
    color: white;
}
header .container {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}
header span {
    border-left: 1px solid #6b8b80;
    padding-left: 24px;
    color: #d8e8e1;
}
.brand {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.logo-link {
    display: inline-flex;
    align-items: center;
}

.logo {
    height: 40px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
}

.container {
    width: min(1080px, calc(100% - 40px));
    margin: auto;
}
nav {
    margin: 24px 0 30px;
    color: var(--muted);
    font-size: 0.92rem;
}
nav a {
    text-decoration: none;
}
.intro {
    padding: 4px 0 4px;
}
.eyebrow {
    margin: 0 0 8px;
    color: #24745e;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.76rem;
    font-weight: bold;
}
.red {
    color: red;
    font-weight: 700;
}
h1,
h2,
h3,
p {
    hyphens: auto;
    overflow-wrap: break-word;
}
h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.12;
    margin: 0 0 16px;
}
h2 {
    font-size: 1.55rem;
    margin: 0 0 20px;
}
h3 {
    font-size: 1.2rem;
    line-height: 1.35;
    margin: 0 0 10px;
}
.lead {
    font-size: 1.18rem;
    color: var(--muted);
}
main > h2 {
    margin-bottom: 20px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.card,
.panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 15px;
    background: white;
    margin-bottom: 10px;
}
.card {
    min-height: 210px;
}
.symbol {
    font-size: 1.8rem;
    margin-bottom: 12px;
}
.muted {
    background: #fafcfb;
}
.muted small {
    color: var(--muted);
}
.panel {
    background: var(--pale);
    margin-top: 36px;
}
.panel p:last-child {
    margin-bottom: 0;
}
.panel a {
    text-decoration: none;
}
.placeholder {
    border: 1px dashed #9eb7ac;
    border-radius: 8px;
    padding: 24px;
    background: white;
}
.placeholder p {
    margin-bottom: 0;
    color: var(--muted);
}
dl {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 0 16px;
}
dt,
dd {
    padding: 10px 0;
    border-top: 1px solid var(--line);
    margin: 0;
}
dt {
    font-weight: bold;
}
.back {
    margin: 32px 0 48px;
}
footer {
    margin-top: 60px;
    padding: 24px 0;
    background: #edf3f0;
    color: var(--muted);
    font-size: 0.9rem;
}
.chart-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    height: clamp(480px, 55vh, 720px);
}

.chart-canvas-area {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
}

.chart-canvas-area > canvas#co2Chart {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart-legend-container {
    flex: 0 0 clamp(280px, 30vw, 280px);
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.chart-legend li {
    align-items: flex-start;
    line-height: 1.35;
    padding: 4px 6px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.chart-legend li > span:last-child {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 650px) {
    .chart-wrap {
        display: flex;
        flex-direction: column;
        height: 400px;
        min-height: 0;
    }

    .chart-wrap:has(> .chart-canvas-area) {
        height: auto;
    }

    .chart-canvas-area {
        flex: 0 0 auto;
        height: clamp(300px, 90vw, 420px);
        min-height: 300px;
    }

    .chart-canvas-area > canvas#co2Chart {
        display: block;
        width: 100% !important;
        height: 100% !important;
    }

    .chart-legend-container {
        flex: 0 0 auto;
        max-height: 280px;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    dl {
        grid-template-columns: 1fr;
    }
    dd {
        padding-top: 0;
        border-top: 0;
    }
    header .container {
        gap: 14px;
    }
    header span {
        padding-left: 14px;
    }
}

@media (max-width: 650px) and (orientation: portrait) {
    .chart-wrap {
        height: 400px;
        min-height: 0;
        align-items: stretch;
    }

    .chart-wrap:has(> .chart-canvas-area) {
        height: auto;
    }

    .chart-canvas-area {
        flex: 0 0 400px !important;
        width: 100%;
        height: 400px;
        min-height: 400px;
    }

    .chart-canvas-area > canvas#co2Chart {
        width: 100% !important;
        height: 100% !important;
    }
}

@media screen and (max-width: 650px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
    body {
        max-width: 34rem;
        margin-inline: auto;
        padding-inline: 1rem;
    }
}

@media screen and (min-width: 651px) and (max-width: 1280px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
    body {
        max-width: 70rem;
        margin-inline: auto;
    }

    .container {
        width: calc(100% - 40px);
        max-width: 70rem;
    }
}

