/*
 * CoolSim design system, Daylight theme: the simulation report (data_center_report.html), the
 * Summary Report, its PDF and the CPV pages. The only stylesheet they load.
 *
 * Every color here is a Daylight token from infra/comm-server/webapp/coolsim-design/dist/tokens.css
 * or a 15% tint of a status token over white; tests/test_design_tokens.php fails on any other literal.
 * Color means temperature: blue and red mark cold and hot air only, never a link or a button state
 * that could be read as one.
 *
 * The PDF renderer is wkhtmltopdf 0.12.6 (Qt 4.8 WebKit, run with --print-media-type): no flexbox,
 * grid, calc() or CSS variables, CSS2 font weights only, TTF fonts only. Anything newer sits
 * inside @media screen, which the PDF never reads.
 */

@font-face { font-family: 'Inter'; src: url(fonts/Inter-Regular.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Inter'; src: url(fonts/Inter-SemiBold.ttf) format('truetype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Inter'; src: url(fonts/Inter-Bold.ttf) format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/IBMPlexMono-400.ttf) format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/IBMPlexMono-500.ttf) format('truetype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'IBM Plex Mono'; src: url(fonts/IBMPlexMono-600.ttf) format('truetype'); font-weight: 600; font-style: normal; }

/* ------------------------------------------------------------------ page */

html, body { background: #ffffff; }
body { margin: 0; color: #1a1a1a; font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 13px; line-height: 1.45; -webkit-print-color-adjust: exact; }
a { color: #1a1a1a; }
b, strong { font-weight: 600; }
small { font-size: 12px; color: #666666; }
sup, sub { font-size: 70%; line-height: 0; }
#constants, #unitSystem, #coolsimComponent, #cfdCalcValues, .cs_hide { display: none; }

/* every number: mono */
span[name=unitValue], .m, .tbl td.n, .cs-kpi-val, .cs-kpi-ticks, .cs-kpi-acr { font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace; }
span[name=unitValue], .m { font-size: 12px; }
/* a word in place of a number (Off, No data, n/a) reads as text and drops its unit */
span.w { font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #666666; }
span.w + span.u { display: none; }
.u { color: #666666; }

/* ------------------------------------------------------------------ top bar and title
   #top, not .bar: the summary's verdict bar is a table.bar */

#top { background: #ffffff; border-bottom: 1px solid #cccccc; }
.bar-in { overflow: hidden; }
.logo { float: left; display: block; width: 112px; height: 48px; }
.bar-r { float: right; }
.partner { max-height: 40px; max-width: 200px; vertical-align: middle; }
.bar-r .btn { margin-left: 12px; vertical-align: middle; }
#mastTitle { padding: 20px 0 4px 0; }
.eyebrow { color: #666666; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; line-height: 16px; }
.title { font-size: 24px; line-height: 32px; font-weight: 700; margin-top: 2px; }

/* ------------------------------------------------------------------ sections */

.sec { padding: 20px 0; border-top: 1px solid #e0e0e0; }
.sec > h2 { margin: 0 0 12px 0; font-size: 17px; line-height: 24px; font-weight: 700; }
.sec > .lede { margin: -6px 0 12px 0; color: #666666; }
.pb { page-break-before: always; }
.keep { page-break-inside: avoid; }
.print { display: none; }
h1.h1 { font-size: 22px; line-height: 30px; font-weight: 700; margin: 0; padding: 0; color: #1a1a1a; }
h3 { margin: 0 0 8px 0; font-size: 13px; line-height: 20px; font-weight: 600; }
.note { color: #666666; font-size: 11px; line-height: 16px; margin-top: 6px; }
p.note { font-size: 12px; line-height: 18px; margin: 6px 0 0 0; }
.over { color: #c62828; font-weight: 600; }

/* a long table folds away behind one line (csPageFold unwraps the short ones) */
details, summary { display: block; }
details.fold > summary { cursor: pointer; padding: 7px 12px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 4px; font-weight: 600; }
details.fold > summary:hover { background: #e8e8e8; }
details.fold[open] > summary { margin-bottom: 8px; }
.fold-n { color: #666666; font-weight: 400; margin-left: 4px; }

/* ------------------------------------------------------------------ tables */

.tbl { width: 100%; border-collapse: collapse; }
.tbl + .tbl { margin-top: 16px; }
.tbl caption { text-align: left; font-size: 13px; font-weight: 600; line-height: 20px; padding: 0 0 6px 0; }
.tbl th { text-align: left; color: #666666; font-size: 11px; font-weight: 600; line-height: 14px; padding: 5px 8px; border-bottom: 1px solid #cccccc; vertical-align: bottom; }
.tbl th .u { font-weight: 400; }
.tbl th.span { text-align: center; }
.tbl td { padding: 5px 8px; border-bottom: 1px solid #e8e8e8; font-size: 12px; }
.tbl .n { text-align: right; }
.tbl td.n { white-space: nowrap; }
.tbl td[rowspan], .tbl td.rs { vertical-align: top; }
.tbl tfoot th { color: #1a1a1a; font-size: 12px; line-height: 16px; vertical-align: top; border-top: 1px solid #cccccc; border-bottom: 0; }
.tbl tfoot tr + tr th { border-top: 0; }
.tbl tfoot th.n span[name=unitValue] { font-weight: 600; }
.tbl.data tr.first td { border-top: 1px solid #cccccc; }
/* a row's figure as a bar (csPageBars): grey, since none of these is a temperature */
.tbl th.bar, .tbl td.bar { width: 24%; padding-left: 4px; }
.dbar { position: relative; height: 8px; }
.dbar-0 { position: absolute; top: -3px; bottom: -3px; width: 1px; margin-left: -1px; left: 50%; background: #999999; }
.dbar-f { position: absolute; top: 0; height: 8px; background: #999999; }
.tbl.grp-t { margin-bottom: 16px; }

/* key-value tables: the model and room, liquid cooling */
.tbl.kv th { width: 42%; color: #666666; font-size: 12px; font-weight: 400; line-height: 18px; vertical-align: top; border-bottom: 1px solid #e8e8e8; }
.tbl.kv td { font-size: 12px; line-height: 18px; }
.tbl.kv tr.grp th { width: auto; padding-top: 0; color: #1a1a1a; font-size: 11px; font-weight: 600; line-height: 16px; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid #cccccc; }
.k-sub { color: #999999; font-size: 12px; margin-left: 6px; }

/* a rack outside the ASHRAE recommended range: red when too hot, blue when too cold; a rack row's
   name spans rows and stays white. The tiles with the lowest and highest flow are grey. */
tr[data-ashrae=cold] td { background: #e3f2fd; }
tr[data-ashrae=hot] td { background: #f6dfdf; }
tr[data-ashrae] td.rs { background: #ffffff; }
#report_tile tr[data-highlight-status] td { background: #e8e8e8; }
tr[data-status=disabled] td, tr[data-status=nodata] td { color: #999999; }
tr[data-status=disabled] span.w, tr[data-status=nodata] span.w { color: #999999; }
td.act { background: #e8e8e8; font-weight: 600; }

.pill { display: inline-block; border-radius: 999px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; line-height: 16px; padding: 1px 8px; white-space: nowrap; }
.pill.pass { background: #dee9e0; color: #256d32; }
.pill.cold { background: #e3f2fd; color: #0d47a1; }
.pill.hot { background: #f6dfdf; color: #c62828; }
.pill.na { background: #e8e8e8; color: #666666; }

/* ------------------------------------------------------------------ energy */

.tbl.met td { width: 25%; vertical-align: top; padding: 10px 16px 10px 0; }
.met-k { color: #666666; font-size: 11px; font-weight: 600; line-height: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.met-v { margin-top: 2px; font-size: 20px; line-height: 28px; font-weight: 600; }
.met-v span[name=unitValue] { font-size: 20px; }
.met-v .u { font-size: 13px; font-weight: 400; }
.met-v span.w { font-size: 14px; font-weight: 400; }
.met-s { color: #666666; font-size: 11px; line-height: 15px; }

.btn { display: inline-block; background: #ffffff; color: #1a1a1a; border: 1px solid #cccccc; border-radius: 4px; padding: 5px 12px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 13px; font-weight: 600; line-height: 18px; cursor: pointer; }
.btn:hover { background: #e0e0e0; }

.calc h3 { margin: 0; }
.calc > p.note { margin: 2px 0 10px 0; }
.calc-mode label { display: block; font-size: 13px; line-height: 22px; }
.calc-mode input { margin: 0 6px 0 0; vertical-align: -1px; }
.calc-in { margin-top: 10px; }
.fld { display: block; margin: 0 0 8px 0; }
.fld span { display: block; color: #666666; font-size: 12px; line-height: 16px; margin-bottom: 3px; }
.fld input { display: block; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; border: 1px solid #cccccc; border-radius: 4px; padding: 5px 8px; background: #ffffff; color: #1a1a1a; font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace; font-size: 13px; }
table.calc-out { width: 100%; border-collapse: collapse; margin-top: 12px; border-top: 1px solid #cccccc; }
table.calc-out th { text-align: left; color: #666666; font-weight: 400; padding: 5px 0; border-bottom: 1px solid #e8e8e8; }
table.calc-out td { text-align: right; padding: 5px 0; border-bottom: 1px solid #e8e8e8; white-space: nowrap; }
table.calc-out .m { font-size: 13px; font-weight: 600; }
#mValueMethodClass, #mValueMethodClassOut { display: none; }
#energyCalcMain.meas #copMethodClass { display: none; }
#energyCalcMain.meas #mValueMethodClass { display: block; }
#energyCalcMain.meas #mValueMethodClassOut { display: table-row; }

/* ------------------------------------------------------------------ energy dashboard tiles (scripts/csKpiTiles.php) */

.cs-kpi-wrap { margin: -8px -8px 0 -8px; }
.cs-kpi-grid { width: 100%; border-collapse: separate; border-spacing: 8px; }
/* the cell is the card, so the two cards in a row share a height */
.cs-kpi-cell { width: 50%; vertical-align: top; background: #ffffff; border: 1px solid #cccccc; border-radius: 6px; padding: 16px; }
.cs-kpi { color: #1a1a1a; }
.cs-kpi-head { height: 16px; line-height: 16px; }
.cs-kpi-name { color: #666666; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.cs-kpi-acr { float: right; color: #666666; font-size: 11px; }
.cs-kpi-main { position: relative; height: 32px; margin-top: 8px; }
.cs-kpi-val { font-size: 22px; line-height: 32px; font-weight: 600; color: #1a1a1a; }
.cs-kpi-unit { font-size: 14px; font-weight: 400; color: #666666; margin-left: 2px; }
.cs-kpi-val.cs-na { color: #666666; font-weight: 400; }
.cs-kpi-chip { position: absolute; right: 0; top: 6px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; line-height: 16px; padding: 2px 8px; white-space: nowrap; }
.cs-kpi-meter { position: relative; height: 16px; margin-top: 12px; }
.cs-kpi-track { position: absolute; left: 0; right: 0; top: 5px; height: 6px; border-radius: 3px; overflow: hidden; background: #e8e8e8; }
.cs-kpi-seg { position: absolute; top: 0; height: 6px; }
.cs-kpi-seg.cs-gap { border-left: 2px solid #ffffff; }
.cs-kpi-ideal { position: absolute; top: 0; width: 2px; height: 16px; margin-left: -1px; background: #666666; }
.cs-kpi-mark { position: absolute; top: 1px; width: 10px; height: 10px; margin-left: -7px; border-radius: 999px; background: #1a1a1a; border: 2px solid #ffffff; }
.cs-kpi-mark.cs-off { background: #ffffff; border-color: #1a1a1a; }
.cs-kpi-ticks { position: relative; height: 16px; margin-top: 4px; color: #666666; font-size: 10px; line-height: 16px; }
.cs-kpi-ticks span { position: absolute; top: 0; width: 32px; margin-left: -16px; text-align: center; }
.cs-kpi-ticks span.cs-first { margin-left: 0; text-align: left; }
.cs-kpi-ticks span.cs-last { margin-left: -32px; text-align: right; }
.cs-kpi-poles { height: 16px; color: #666666; font-size: 11px; line-height: 16px; }
.cs-kpi-poles .cs-r { float: right; }
.cs-kpi-sub { margin-top: 8px; color: #666666; font-size: 12px; line-height: 16px; }
/* ------------------------------------------------------------------ Summary Report pages 1-3 (scripts/csSummaryPages.php)
   On screen they are the top of the report, not cards; in print, pages of their own */

#csSummary { color: #1a1a1a; font-size: 13px; line-height: 20px; }
#csSummary sub { font-size: 70%; line-height: 0; }
#csSummary .cnt-n, #csSummary .f-n, #csSummary .lg-r, #csSummary .lg-r span, #csSummary .lg-n, #csSummary svg tspan.m { font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace; }

#csSummary .hdr { width: 100%; border-collapse: collapse; }
#csSummary .hdr td { vertical-align: bottom; padding: 0 0 12px 0; }
#csSummary .hdr-r { text-align: right; }
#csSummary .meta { color: #666666; font-size: 12px; line-height: 18px; }

#csSummary .verdict { border: 1px solid #cccccc; border-left: 6px solid #1565c0; border-radius: 6px; padding: 14px 18px 12px 18px; }
#csSummary .v-eyebrow { color: #666666; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
#csSummary .v-title { font-size: 28px; line-height: 34px; font-weight: 700; margin-top: 2px; }
#csSummary .v-line { font-size: 15px; line-height: 22px; font-weight: 600; margin-top: 4px; }
#csSummary .v-why { font-size: 13px; line-height: 20px; color: #1a1a1a; margin-top: 4px; }
#csSummary .v-barlab { color: #666666; font-size: 12px; margin: 12px 0 6px 0; }
#csSummary .bar { width: 100%; border-collapse: collapse; }
#csSummary .bar td { height: 12px; padding: 0; }
#csSummary .cnts { width: 100%; border-collapse: collapse; margin-top: 8px; }
#csSummary .cnt { width: 33%; vertical-align: top; padding-right: 12px; }
#csSummary .cnt-n { font-size: 20px; line-height: 28px; font-weight: 600; }
#csSummary .sw { display: inline-block; width: 10px; height: 10px; margin: 0 8px 2px 0; }
#csSummary .cnt-l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #1a1a1a; }
#csSummary .cnt-s { font-size: 12px; color: #666666; line-height: 16px; }

#csSummary h2.sh { margin: 20px 0 0 0; padding: 0; color: #666666; font-size: 11px; line-height: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
#csSummary .p1-k h2.sh { margin-bottom: 4px; }
#csSummary .finds { width: 100%; border-collapse: collapse; margin-top: 4px; }
#csSummary .finds td { vertical-align: top; padding: 8px 0; border-top: 1px solid #e8e8e8; }
#csSummary .f-k { width: 76px; color: #666666; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; line-height: 20px; }
#csSummary .f-n { width: 116px; font-size: 14px; font-weight: 600; }
#csSummary .f-t { font-size: 13px; }
#csSummary .foot { margin-top: 14px; color: #999999; font-size: 11px; line-height: 16px; }

#csSummary .run { color: #999999; font-size: 11px; border-bottom: 1px solid #e8e8e8; padding-bottom: 6px; margin-bottom: 12px; }
#csSummary .lede { font-size: 13px; line-height: 20px; margin-top: 4px; }
#csSummary h3.h3 { font-size: 13px; line-height: 20px; font-weight: 600; margin: 16px 0 8px 0; padding: 0; color: #1a1a1a; }
/* no height:auto here: wkhtmltopdf's Qt 4.8 WebKit draws an inline <svg> with height:auto at zero
   height, so the PDF keeps the width and height attributes and only a browser rescales */
#csSummary svg.rackmap { display: block; max-width: 100%; }
#csSummary .legend, #studyMaps .legend { border-collapse: collapse; margin-top: 8px; width: 100%; }
#csSummary .lg, #studyMaps .lg { vertical-align: top; padding-right: 8px; width: 25%; }
#csSummary .lg-sw, #studyMaps .lg-sw { height: 10px; }
#csSummary .lg-t, #studyMaps .lg-t { font-size: 11px; font-weight: 600; line-height: 16px; margin-top: 4px; }
#csSummary .lg-r, #studyMaps .lg-r { font-size: 10px; line-height: 14px; color: #666666; }
#csSummary .lg-n { font-size: 10px; line-height: 14px; color: #1a1a1a; }

/* ------------------------------------------------------------------ parametric study (scripts/csStudy.php):
   the run bar over every page of a study, the line under it on a run's page, the study page's tables */

.sw { display: inline-block; width: 10px; height: 10px; margin: 0 6px 0 0; }
.study { background: #f5f5f5; border-bottom: 1px solid #e0e0e0; font-size: 12px; line-height: 32px; }
.study-k { color: #666666; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-right: 12px; white-space: nowrap; }
.study a { display: inline-block; padding: 0 12px; color: #666666; text-decoration: none; white-space: nowrap; }
.study a:hover { color: #1a1a1a; }
.study a[aria-current] { background: #ffffff; color: #1a1a1a; font-weight: 600; }
.study-note { margin: 16px 0; padding: 8px 12px; background: #f5f5f5; border-left: 3px solid #666666; line-height: 20px; }
.mast-s { color: #666666; margin-top: 4px; }
.tbl.cmp td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; line-height: 18px; }
.tbl.cmp td b { font-size: 13px; }
.tbl.cmp .stk-c { width: 24%; }
.tbl .stk { width: 100%; border-collapse: collapse; margin-top: 4px; }
.tbl .stk td { height: 10px; padding: 0; border: 0; }
.stk-l { margin-top: 4px; color: #666666; font-size: 11px; line-height: 16px; }
.stk-n { white-space: nowrap; margin-right: 12px; }
.stk-n .sw { width: 8px; height: 8px; margin-right: 4px; }
.stk-n .m { font-size: 11px; color: #1a1a1a; }
tr.dnf td { color: #666666; }
.stk-x { margin-top: 2px; color: #666666; font-size: 11px; line-height: 16px; }
/* a run's rack map, two to a row in the PDF */
.map { display: inline-block; width: 48.5%; margin: 0 1% 16px 0; vertical-align: top; page-break-inside: avoid; }
.map-h { font-size: 13px; line-height: 20px; }
.map-s { color: #666666; font-size: 11px; line-height: 16px; margin-bottom: 6px; }
.map svg.rackmap { display: block; max-width: 100%; }
.map-none { padding: 24px 16px; background: #f5f5f5; border: 1px solid #e0e0e0; color: #666666; font-size: 12px; }
.tbl.racks td.hot { background: #f6dfdf; }
.tbl.racks td.cold { background: #e3f2fd; }
td.chg { background: #e8e8e8; font-weight: 600; }

/* ------------------------------------------------------------------ screen: the bar, two columns, narrow windows
   (grid and flexbox only in here: the PDF renderer has neither) */

@media screen {
	#top { position: -webkit-sticky; position: sticky; top: 0; z-index: 5; }
	.bar-in { max-width: 1600px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 20px; height: 48px; overflow: visible; }
	.logo { float: none; width: auto; height: 26px; flex: none; }
	.bar-r { float: none; order: 2; flex: none; display: flex; align-items: center; gap: 12px; }
	.bar-r .btn { margin-left: 0; }
	.partner { max-height: 28px; }
	.nav { order: 1; flex: 1 1 auto; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
	.nav::-webkit-scrollbar { display: none; }
	.nav a { flex: none; display: flex; align-items: center; padding: 0 10px; color: #666666; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
	.nav a:hover { color: #1a1a1a; border-bottom-color: #1a1a1a; }

	#reportContent { max-width: 1600px; margin: 0 auto; padding: 0 24px 48px 24px; }
	#summaryReport { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; column-gap: 48px; }
	#summaryReport > * { grid-column: 1 / -1; min-width: 0; }
	#summaryReport > .half { grid-column: auto; }
	.sec, #csSummary { scroll-margin-top: 56px; }
	.sec { overflow-x: auto; }
	.fld input:focus { outline: 2px solid #1a1a1a; outline-offset: -1px; }

	details.fold > summary { list-style: none; }
	details.fold > summary::-webkit-details-marker { display: none; }
	details.fold > summary:before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 10px 2px 2px; border-right: 2px solid #666666; border-bottom: 2px solid #666666; transform: rotate(-45deg); }
	details.fold[open] > summary:before { transform: rotate(45deg); margin-bottom: 4px; }

	.en { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 40px; align-items: start; }
	.calc { border-left: 1px solid #e0e0e0; padding-left: 24px; }
	.calc-mode label { display: inline-block; margin-right: 20px; }
	/* the mode's three fields and the electricity cost fill a 2 x 2 grid */
	.calc-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
	#copMethodClass, #energyCalcMain.meas #mValueMethodClass { display: contents; }
	.tbl.kv { max-width: 640px; }
	/* a data table is as wide as its columns: stretched to 1600 px a row is hard to follow across */
	.tbl.data { width: auto; }
	.tbl.data th, .tbl.data td { padding-left: 16px; padding-right: 16px; }
	/* ...unless it carries a bar, which takes the rest of the row so the figures stay together */
	.tbl.data.has-bar { width: 100%; }
	.tbl th.bar, .tbl td.bar { width: 100%; min-width: 160px; padding-left: 4px; }
	.tbl.data.has-bar thead th:not(.bar) { min-width: 88px; }

	.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px 40px; align-items: start; }
	.kv-grid .tbl + .tbl { margin-top: 0; }

	/* a wide table scrolls inside its page, as in a .sec, rather than widen the window */
	#csSummary .page { padding: 0; min-width: 0; overflow-x: auto; }
	#csSummary .run { display: none; }
	/* verdict and findings side by side, the four indices in one row under them; the verdict box
	   keeps its own height rather than stretch empty to the findings' */
	.p1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "hdr hdr" "v f" "k k" "foot foot"; column-gap: 40px; padding: 20px 0; }
	.p1 > .hdr { grid-area: hdr; }
	.p1 > .verdict { grid-area: v; align-self: start; }
	.p1 > .p1-k { grid-area: k; }
	.p1 > .p1-f { grid-area: f; }
	.p1 > .p1-f h2.sh { margin-top: 0; }
	.p1 > .foot { grid-area: foot; }
	.p1 .cs-kpi-wrap { margin: 0; }
	.p1 .cs-kpi-grid { display: block; }
	.p1 .cs-kpi-grid tbody { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
	.p1 .cs-kpi-grid tr { display: contents; }
	.p1 .cs-kpi-cell { display: block; width: auto; min-width: 0; }
	.p23 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 48px; align-items: start; padding: 20px 0; border-top: 1px solid #e0e0e0; }
	.p23 h1.h1 { font-size: 17px; line-height: 24px; }
	.p23 .page + .page h3.h3 { margin-top: 0; font-size: 17px; line-height: 24px; font-weight: 700; margin-bottom: 12px; }
	#csSummary svg.rackmap { height: auto; }

	/* a study's pages carry the run bar over the section bar, so a section scrolls to under both */
	.study-in { max-width: 1600px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; overflow-x: auto; scrollbar-width: none; }
	.study-in::-webkit-scrollbar { display: none; }
	.study a { flex: none; }
	.in-study .sec, .in-study #csSummary { scroll-margin-top: 90px; }
	.in-study .bar-r { margin-left: auto; }
	.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 32px; }
	.map { display: block; width: auto; max-width: 760px; margin: 0; }
	.map svg.rackmap { width: 100%; height: auto; }
	#studyMaps .legend { max-width: 760px; margin-top: 16px; }
	/* the rack list and the unit list share a row when both fit, and each takes its own when they do not */
	.study-cols { display: flex; flex-wrap: wrap; column-gap: 48px; align-items: flex-start; }
	.study-cols > .sec { flex: 1 1 420px; min-width: 0; }
	.study-cols .tbl.data { width: 100%; }
	.mast-s { max-width: 720px; }
}
@media screen and (max-width: 1300px) {
	.p1 .cs-kpi-grid tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 1200px) {
	.p23 { grid-template-columns: minmax(0, 1fr); }
	.p23 .page + .page { margin-top: 20px; }
}
@media screen and (max-width: 1100px) {
	#summaryReport { grid-template-columns: minmax(0, 1fr); }
	.p1 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hdr" "v" "f" "k" "foot"; }
	.p1 > .p1-f h2.sh { margin-top: 20px; }
	.en { grid-template-columns: minmax(0, 1fr); }
	.calc { border-left: 0; padding-left: 0; border-top: 1px solid #e0e0e0; margin-top: 16px; padding-top: 16px; }
}
@media screen and (max-width: 760px) {
	.bar-in, .study-in, #reportContent { padding-left: 16px; padding-right: 16px; }
	.bar-in { gap: 12px; }
	.partner { display: none; }
	.title { font-size: 20px; line-height: 28px; }
	#csSummary .hdr td { display: block; text-align: left; }
	.tbl.met, .tbl.met tbody, .tbl.met tr { display: block; }
	.tbl.met tr { overflow: hidden; }
	.tbl.met td { float: left; width: 50%; -webkit-box-sizing: border-box; box-sizing: border-box; }
	.tbl.kv th { width: 45%; }
	.k-sub { display: block; margin-left: 0; }
	.kv-grid { grid-template-columns: minmax(0, 1fr); }
	.p1 .cs-kpi-grid tbody { grid-template-columns: minmax(0, 1fr); }
	#csSummary .finds tr { display: block; padding: 8px 0; border-top: 1px solid #e8e8e8; }
	#csSummary .finds td { display: inline-block; width: auto; padding: 0 12px 0 0; border-top: 0; }
	#csSummary .finds td.f-t { display: block; padding: 2px 0 0 0; }
}

/* ------------------------------------------------------------------ print (wkhtmltopdf runs with --print-media-type) */

@media print {
	.screen, summary { display: none; }
	.print { display: block; }
	h1.h1.print { margin: 0 0 8px 0; }
	#top { border-bottom: 0; padding: 0 0 8px 0; }
	#mastTitle { padding-top: 8px; }
	.study-note { margin-top: 0; }
	.tbl.cmp th { font-size: 9px; line-height: 12px; padding: 4px 5px; }
	.tbl.cmp td { font-size: 10px; padding: 6px 5px; }
	.sec { border-top: 0; padding: 14px 0 0 0; }
	#summaryReport > .sec:first-of-type, #appendix + .sec { padding-top: 0; }
	.sec > h2 { page-break-after: avoid; }
	/* the energy figures fit on one page: keep them there rather than leave the heading at a page foot */
	#report_energy { page-break-inside: avoid; }
	.kv-grid .tbl.kv { display: inline-table; width: 48%; margin: 0 1.5% 14px 0; vertical-align: top; }
	thead { display: table-header-group; }
	tfoot { display: table-row-group; }
	tr, .cs-kpi-grid tr { page-break-inside: avoid; }
	.tbl.data th { font-size: 9px; line-height: 12px; padding: 4px 5px; }
	.tbl.data td, .tbl.data tfoot th { font-size: 10px; padding: 4px 5px; }
	.tbl.data span[name=unitValue] { font-size: 10px; }
	.pill { font-size: 8px; padding: 0 5px; line-height: 13px; letter-spacing: 0.05em; }
	#csSummary .page { margin: 0 0 20px 0; }
	#csSummary .verdict { margin-top: 16px; }
}
