:root {
    --green: #4f8f3a;
    --blue: #2f6fa3;
    --orange: #e98a2b;
    --ink: #20252a;
    --muted: #66707a;
    --paper: #fff;
    --soft: #f4f6f7;
    --rule: #d9dee2;
    --measure: 56rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: #eef1f2;
    font-family: "Noto Sans", Arial, Helvetica, sans-serif;
    line-height: 1.62;
    font-size: 17px;
}


/* Main page structure */

body > header,
body > nav,
body > section {
    width: min(calc(100% - 3rem), 74rem);
    margin-inline: auto;
    background: var(--paper);
    padding-inline: clamp(1.5rem, 5vw, 6rem);
}


/* Cover */

.report-cover {
    margin-top: 2rem;
    padding-top: 5rem;
    padding-bottom: 4rem;
    border-top: .55rem solid var(--orange);
}

.cover-title {
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    line-height: 1.08;
    margin: 0 0 1.2rem;
    max-width: 18ch;
    font-weight: 700;
}

.cover-kicker {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--blue);
    max-width: 45rem;
}

.report-cover p {
    max-width: var(--measure);
}

.cover-author {
    margin-top: 3rem;
    color: var(--muted);
}

.about-heading {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Contents */

.contents {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.contents > h2 {
    margin-top: 0;
}

.contents ul {
    list-style: none;
    padding-left: 0;
}

.contents ul ul {
    padding-left: 1rem;
    margin: .3rem 0 .7rem;
}

.contents li {
    margin: .2rem 0;
}

.contents a {
    text-decoration: none;
    color: var(--ink);
}

.contents ul ul a {
    color: var(--muted);
    font-size: .82rem;
}

.contents a:hover {
    color: var(--blue);
    text-decoration: underline;
}


/* Sections */

section.level1 {
    padding-top: 4rem;
    padding-bottom: 3rem;
}

section.level2 {
    padding-top: 1.8rem;
}

section.level3 {
    padding-top: 1.1rem;
}

section.level4 {
    padding-top: .7rem;
}


/* Headings */

h1,
h2,
h3,
h4 {
    line-height: 1.22;
    scroll-margin-top: 1rem;
}

h1 {
    font-size: 2.15rem;
    margin: 0 0 1.5rem;
    border-bottom: 3px solid var(--orange);
    padding-bottom: .55rem;
}

h2 {
    font-size: 1.55rem;
    margin: 2.2rem 0 .8rem;
    color: #234f73;
}

h3 {
    font-size: 1.2rem;
    margin: 1.7rem 0 .65rem;
    padding-left: .65rem;
    border-left: 3px solid #efbd8a;
}

h4 {
    font-size: 1.05rem;
    margin: 1.4rem 0 .55rem;
}

.reference-index {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .65rem;
    margin: 0 0 2rem;
    max-width: var(--measure);
}

.reference-index strong {
    margin-right: .25rem;
}

.reference-letter {
    margin-top: 2.5rem;
}


/* Text */

p,
ol,
ul,
blockquote {
    max-width: var(--measure);
}

a {
    color: #1d628f;
    text-underline-offset: .15em;
}

strong {
    font-weight: 700;
}

blockquote {
    margin-left: 0;
    padding-left: 1.2rem;
    border-left: 4px solid var(--green);
    color: #41484e;
}


/* Figures */

figure {
    max-width: 64rem;
    margin: 2.6rem auto;
    padding: 1rem;
    border: 1px solid var(--rule);
    background: #fff;
}

figure img {
    display: block;
    width: 100%;
    height: auto;
    margin: auto;
}

figcaption {
    margin-top: .8rem;
    padding-top: .65rem;
    border-top: 1px solid #efbd8a;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.45;
}

/* Tables */

table {
    width: 100%;
    max-width: 64rem;
    margin: 1.8rem 0 2.2rem;
    border-collapse: collapse;
}

th,
td {
    padding: .7rem .85rem;
    text-align: left;
    vertical-align: top;
}

/* Stronger divider beneath headings */
thead th {
    border-bottom: 2px solid var(--orange);
    background: var(--soft);
}

/* Internal horizontal rules only */
tbody tr + tr td {
    border-top: 1px solid #efbd8a;
}

/* Internal vertical rules only */
th + th,
td + td {
    border-left: 1px solid #efbd8a;
}

th {
    font-weight: 700;
}

tr {
    break-inside: avoid;
    page-break-inside: avoid;
}


/* Footnotes */

.footnote-ref {
    text-decoration: none;
    font-weight: 700;
    color: var(--orange);
}

section.footnotes {
    border-top: 1px solid var(--rule);
    margin-top: 3rem;
    padding-top: 1rem;
    font-size: .9rem;
}

section.footnotes ol {
    max-width: 60rem;
}


/* Navigation */

.back-to-top {
    display: inline-block;
    margin-top: 2.5rem;
    font-size: .85rem;
    color: var(--muted);
}


/* Desktop */

@media (min-width: 1180px) {

    body {
        padding-left: 18rem;
    }

    .contents {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 18rem;
        overflow: auto;
        margin: 0;
        padding: 1.25rem 1rem 2rem;
        border: 0;
        border-right: 1px solid var(--rule);
        background: #f8f9fa;
        z-index: 10;
    }

    .contents > h2 {
        font-size: 1.15rem;
        border-bottom: 3px solid var(--orange);
        padding-bottom: .45rem;
    }

    .contents li {
        margin: .45rem 0;
        line-height: 1.3;
    }

    .contents a {
        font-size: .86rem;
    }

    body > header,
    body > section {
        width: min(calc(100% - 3rem), 74rem);
    }
}


/* Mobile */

@media (max-width: 700px) {

    body {
        font-size: 16px;
    }

    body > header,
    body > nav,
    body > section {
        width: 100%;
        padding-inline: 1.15rem;
    }

    .report-cover {
        margin-top: 0;
        padding-top: 3rem;
    }

    section.level1 {
        padding-top: 3rem;
    }

    figure {
        margin: 2rem -.3rem;
        padding: .4rem;
    }
}


/* Print / PDF */

@media print {

    @page {
        size: A4;
        margin: 18mm 16mm 20mm 18mm;
    }

    body {
        background: #fff;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10.5pt;
        line-height: 1.45;
        padding: 0;
    }

    body > header,
    body > nav,
    body > section {
        width: auto;
        margin: 0;
        padding: 0;
    }

    .report-cover {
        border-top: 0;
        padding-top: 30mm;
        page-break-after: always;
    }

    .contents {
        position: static;
        width: auto;
        border: 0;
        page-break-after: always;
    }

    .contents ul ul {
        display: block;
    }

    section.level1 {
        padding: 0;
        break-before: page;
    }

    #executive-summary {
        break-before: auto;
    }

    h1 {
        font-size: 18pt;
    }

    h2 {
        font-size: 14pt;
    }

    h3 {
        font-size: 12pt;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    figure {
        border: 0;
        padding: 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    figure img {
        max-height: 220mm;
        object-fit: contain;
    }
    
        thead {
        display: table-header-group;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .back-to-top {
        display: none;
    }
}

/* Electric bus reference additions */
.table-tools {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem .75rem;
    align-items: center;
    max-width: 64rem;
    margin: 1.25rem 0 .7rem;
    padding: .8rem;
    background: var(--soft);
    border: 1px solid var(--rule);
}

.table-tools label {
    font-size: .88rem;
    font-weight: 700;
}

.table-tools input,
.table-tools select,
.table-tools button {
    font: inherit;
    font-size: .9rem;
    padding: .45rem .6rem;
    border: 1px solid #b8c0c7;
    background: #fff;
    color: var(--ink);
}

.table-tools input {
    min-width: min(18rem, 100%);
}

.table-tools button {
    cursor: pointer;
}

.table-scroll {
    width: 100%;
    max-width: 64rem;
    max-height: 72vh;
    overflow: auto;
    position: relative;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 2.2rem;
    border-bottom: 1px solid var(--rule);
    scrollbar-gutter: stable;
}

.table-scroll table {
    width: max-content;
    min-width: 100%;
    margin: 0;
}

.comparison-table th,
.comparison-table td {
    min-width: 8.5rem;
    white-space: normal;
}

.comparison-table th:nth-child(4),
.comparison-table td:nth-child(4),
.comparison-table th:nth-child(5),
.comparison-table td:nth-child(5),
.comparison-table th:nth-child(6),
.comparison-table td:nth-child(6),
.comparison-table th:nth-child(7),
.comparison-table td:nth-child(7),
.comparison-table th:nth-child(8),
.comparison-table td:nth-child(8) {
    min-width: 7.5rem;
}

.sticky-col {
    position: sticky;
    z-index: 2;
    background: var(--paper);
}

.sticky-1 {
    left: 0;
    min-width: 9rem !important;
    max-width: 9rem;
}

.sticky-2 {
    left: 9rem;
    min-width: 11rem !important;
    max-width: 11rem;
    box-shadow: 3px 0 4px -4px rgba(0,0,0,.45);
}

.comparison-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--soft);
}

.comparison-table thead .sticky-col {
    z-index: 8;
    background: var(--soft);
}

.comparison-table tbody tr:hover td {
    background: #fafbfb;
}

.comparison-table tbody tr:hover .sticky-col {
    background: #fafbfb;
}

.comparison-table tr[hidden] {
    display: none;
}

@media (max-width: 700px) {
    .table-tools {
        margin-inline: 0;
        align-items: stretch;
    }

    .table-tools label {
        width: 100%;
        margin-bottom: -.35rem;
    }

    .table-tools input,
    .table-tools select,
    .table-tools button {
        width: 100%;
    }

    .table-scroll {
        margin-right: -1.15rem;
        width: calc(100% + 1.15rem);
        padding-bottom: .25rem;
    }
    
    .table-scroll {
        max-height: 78vh;
    }

    .sticky-1 {
        min-width: 7.5rem !important;
        max-width: 7.5rem;
    }

    .sticky-2 {
        left: 7.5rem;
        min-width: 9rem !important;
        max-width: 9rem;
    }

    .comparison-table th,
    .comparison-table td {
        font-size: .86rem;
        padding: .6rem .65rem;
    }
}

@media print {
    .table-tools {
        display: none;
    }

    .table-scroll {
        overflow: visible;
        max-width: none;
        border-bottom: 0;
    }

    .table-scroll table {
        width: 100%;
    }

    .sticky-col {
        position: static;
        box-shadow: none;
    }
}
