/* Program Summary on a phone (handoff 8c).
   Phones only: App.razor links this file with media="screen and (max-width: 719.98px) and (hover: none) and
   (pointer: coarse)", so nothing here can reach desktop or print (docs/mobile-phone-layout.md).

   8c, from the title down (the header, Program / Date Range bar and chip row are chrome.css): the title block and
   the Filter by row (two 48px selects); the Record Overview tiles 2-up with Survey Responses a full-width navy bar;
   then each panel one full-width card in desktop order, its title above a rule: Records Completed (donut, legend
   rows), Hot Sheets Generated (donut beside its figure, then Hot Sheet Tracking), Records Excluded During Import
   (bars only: the total and "% of excluded" go to the line under the title), Items of Interest (the two desktop
   cards as one, a caption per collection), and the footnote. Text sits 16px from the screen edge, cards 12px.
   Content and order are desktop's; the m-only lines are in ProgramSummary.razor.

   Every selector starts .report-card.ps-page: the tile, card and header classes are shared with Hot Sheet Stats,
   and pages.css (later, the fallback) must not win a tie. */

/* ----- Page: its own insets at any chrome gutter ----- */

/* The full width of the screen whatever .app-content's side padding is, so the 16px text and 12px card insets
   are the mock's. */
.report-card.ps-page {
	margin-inline: calc(50% - 50vw);
}

/* Hover is none on a phone, but a tapped element keeps :hover until the next tap: no row fill left behind. */
.report-card.ps-page .ps-line:hover,
.report-card.ps-page .ps-ex-row:hover,
.report-card.ps-page .ps-tracking .ps-line:hover { background: none; }

/* A figure's link covers its whole tile or row, so every tap target is 44px or more. */
.report-card.ps-page .ps-tile,
.report-card.ps-page .ps-line,
.report-card.ps-page .ps-ex-row { position: relative; }

.report-card.ps-page a.ps-tile-figure::after,
.report-card.ps-page a.ps-line-count::after,
.report-card.ps-page .ps-count a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* ----- Title block ----- */

.report-card.ps-page .title-block {
	display: block;
	margin: 0 16px 14px;
}

.report-card.ps-page .title-block .eyebrow {
	margin: 0 0 8px;
	font-size: 10.5px;
	letter-spacing: 1px;
}

.report-card.ps-page h1 {
	margin: 0 0 4px;
	font-size: 22px;
	line-height: 1.2;
	letter-spacing: -0.5px;
}

.report-card.ps-page .report-subtitle { font-size: 14px; }

/* Filter by row: the two selects side by side (1 : 1.3), 48px with 16px text so iOS doesn't zoom, each with its
   desktop caption above it. The active filter's chip takes its own line. */
.report-card.ps-page .ps-filter {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
	align-items: end;
	gap: 8px;
	max-width: none;
	margin-top: 14px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
}

.report-card.ps-page .ps-filter label {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	min-width: 0;
}

.report-card.ps-page .ps-filter-caption {
	padding: 0 2px;
	font-size: 12px;
	line-height: 1.3;
}

.report-card.ps-page .ps-filter select {
	width: 100%;
	max-width: none;
	min-width: 0;
	height: 48px;
	padding: 0 10px;
	border-radius: 10px;
	background-color: var(--surface);
	font-size: 16px;
	font-weight: 500;
}

.report-card.ps-page .ps-filter-chip {
	grid-column: 1 / -1;
	justify-self: start;
	max-width: 100%;
	margin: 2px 0 0;
	padding: 0 0 0 12px;
	font-size: 13px;
}

/* The × is a 44px target; it reaches a little past the 38px chip. */
.report-card.ps-page .ps-filter-clear {
	width: 44px;
	height: 44px;
	margin: -4px 0;
	font-size: 18px;
}

/* Under the title block: the drill-down banner (a box, on the card inset) and the filter's notes (text). */
.report-card.ps-page .drill-banner { margin: 0 12px 12px; }
.report-card.ps-page .drill-reset { min-height: 44px; }
.report-card.ps-page .ps-filter-note,
.report-card.ps-page .drill-banner + .ps-filter-note,
.report-card.ps-page .ps-filter-note + .ps-filter-note { margin: 0 16px 12px; }

.report-card.ps-page > .validation { margin: 0 16px 14px; }

/* ----- Record Overview: 2-up tiles, Survey Responses full width ----- */

.report-card.ps-page .ps-kpis { margin: 0 12px 12px; }

/* The desktop heading stays, in the card-title type, on the text inset. */
.report-card.ps-page .ps-kpis > .ps-header {
	margin: 0 4px 10px;
	font-size: 14.5px;
}

.report-card.ps-page .ps-overview {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.report-card.ps-page .ps-tile { padding: 14px 16px; }
.report-card.ps-page .ps-tile-caption { margin-bottom: 10px; }
.report-card.ps-page .ps-tile-figure { font-size: 26px; }

.report-card.ps-page .ps-tile.emph {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.report-card.ps-page .ps-tile.emph .ps-tile-caption { margin-bottom: 0; }

/* ----- Cards: the title above a rule, the body under it ----- */

.report-card.ps-page .ps-pair {
	display: block;
	margin: 0;
}

.report-card.ps-page .ps-card,
.report-card.ps-page .ps-pair .ps-card {
	margin: 0 12px 12px;
	padding: 0;
}

.report-card.ps-page .ps-card > .ps-header {
	margin: 0;
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--rule);
	font-size: 14.5px;
}

/* Records Excluded: its sub-line joins the title above the rule. */
.report-card.ps-page .ps-card > .ps-header:has(+ .ps-card-sub) {
	padding-bottom: 0;
	border-bottom: 0;
}

.report-card.ps-page .ps-card-sub {
	margin: 0;
	padding: 3px 16px 12px;
	border-bottom: 1px solid var(--rule);
	font-size: 12px;
	line-height: 1.4;
	color: var(--text-quiet);
}

/* Legend rows (Records Completed, Hot Sheet Tracking, Items of Interest): the swatch, the label over its
   "% of …" line, the navy figure on the right; divided by rules. */
.report-card.ps-page .ps-lines { gap: 0; }

.report-card.ps-page .ps-line {
	align-items: flex-start;
	gap: 10px;
	padding: 11px 0;
	border-radius: 0;
}

.report-card.ps-page .ps-line-label {
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	line-height: 1.35;
}

.report-card.ps-page .ps-line-label .ps-chip {
	width: 9px;
	height: 9px;
	margin-top: 5px;
}

.report-card.ps-page .ps-line-sub {
	margin-top: 2px;
	font-size: 12px;
	color: var(--text-quiet);
}

.report-card.ps-page .ps-line.swatched .ps-line-sub { margin-left: 19px; }

.report-card.ps-page .ps-line-count { font-size: 15px; }
.report-card.ps-page a.ps-line-count,
.report-card.ps-page a.ps-line-count:hover { color: var(--navy); }

.report-card.ps-page .ps-pie-body > .ps-lines:not(.ps-hot-lines) > .ps-line,
.report-card.ps-page .ps-tracking .ps-line,
.report-card.ps-page .ps-ioi .ps-line {
	border-bottom: 1px solid var(--rule);
}

.report-card.ps-page .ps-pie-body > .ps-lines:not(.ps-hot-lines) > .ps-line:last-child,
.report-card.ps-page .ps-tracking .ps-line:last-child,
.report-card.ps-page .ps-ioi .ps-line:last-child {
	border-bottom: 0;
}

/* Records Completed: the donut centred above its legend. */
.report-card.ps-page .ps-pie-body {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	gap: 0;
	padding: 14px 16px 16px;
}

.report-card.ps-page .ps-pie-body > .ps-donut {
	width: 112px;
	height: 112px;
	margin: 4px auto 10px;
}

.report-card.ps-page .ps-pie-body > .ps-lines { flex: 1 1 100%; }

.report-card.ps-page .ps-donut-value {
	font-size: 19px;
	letter-spacing: -0.5px;
}

.report-card.ps-page .ps-donut-caption {
	margin-top: 3px;
	font-size: 10.5px;
}

/* Hot Sheets Generated: a 96px donut beside its figure (caption, figure, "% of Survey Responses"), then Hot
   Sheet Tracking under a rule. The rows' wrapper steps aside so its two parts sit in the body's two lines. */
.report-card.ps-page .ps-pie-body:has(> .ps-hot-lines) > .ps-donut {
	width: 96px;
	height: 96px;
	margin: 0 16px 10px 0;
}

.report-card.ps-page .ps-pie-body:has(> .ps-hot-lines) .ps-donut-hole { inset: 12px; }

.report-card.ps-page .ps-lines.ps-hot-lines { display: contents; }

.report-card.ps-page .ps-hot-lines > .ps-line {
	flex: 1 1 0;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0;
	min-width: 0;
	margin-bottom: 10px;
	padding: 0;
	border: 0;
}

.report-card.ps-page .ps-hot-lines > .ps-line > .ps-line-name { display: contents; }

.report-card.ps-page .ps-hot-lines > .ps-line .ps-line-label {
	order: 1;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--text-quiet);
}

.report-card.ps-page .ps-hot-lines > .ps-line .ps-line-count {
	order: 2;
	margin: 4px 0 2px;
	font-size: 26px;
	line-height: 1.1;
}

.report-card.ps-page .ps-hot-lines > .ps-line a.ps-line-count { color: var(--ink); }

.report-card.ps-page .ps-hot-lines > .ps-line .ps-line-sub {
	order: 3;
	margin: 0;
	color: var(--text-secondary);
}

.report-card.ps-page .ps-tracking {
	flex: 1 1 100%;
	padding: 0;
	background: none;
	border: 0;
	border-top: 1px solid var(--rule);
	border-radius: 0;
}

.report-card.ps-page .ps-tracking-caption {
	padding: 10px 0 2px;
	letter-spacing: 0.7px;
}

.report-card.ps-page .ps-tracking .ps-line { padding: 11px 0; }

/* Open Hot Sheets: a plain tracking row, as 8c draws it. */
.report-card.ps-page .ps-line.hot,
.report-card.ps-page .ps-line.hot:hover {
	background: none;
	box-shadow: none;
	border-radius: 0;
	color: var(--ink);
}

.report-card.ps-page .ps-line.hot .ps-line-label { font-weight: 500; color: var(--ink); }
.report-card.ps-page .ps-line.hot.zero .ps-line-label { font-weight: 400; color: var(--text-quiet); }
.report-card.ps-page .ps-line.hot .ps-line-sub { color: var(--text-quiet); }
.report-card.ps-page .ps-line.hot .ps-line-count { font-size: 15px; font-weight: 500; }
.report-card.ps-page .ps-line.hot a.ps-line-count,
.report-card.ps-page .ps-line.hot a.ps-line-count:hover { color: var(--navy); }

/* ----- Records Excluded During Import: bars, no donut ----- */

.report-card.ps-page .ps-excluded {
	display: block;
	padding: 14px 16px 16px;
}

.report-card.ps-page .ps-excluded > .ps-donut { display: none; }

/* A row: the label, percentage and count on the first line, the full-width bar under them. The bar cell spans
   both lines as a subgrid, so its percentage takes the first line's middle column and the cell keeps its role. */
.report-card.ps-page .ps-ex-row {
	grid-template-columns: minmax(0, 1fr) auto 38px;
	grid-template-rows: auto auto;
	align-items: baseline;
	gap: 7px 10px;
	padding: 10px 0;
	border-radius: 0;
}

.report-card.ps-page .ps-ex-label {
	grid-column: 1;
	grid-row: 1;
	font-size: 14px;
	line-height: 20px;
}

.report-card.ps-page .ps-ex-bar {
	grid-column: 1 / -1;
	grid-row: 1 / span 2;
	display: grid;
	grid-template-columns: subgrid;
	grid-template-rows: subgrid;
	align-items: baseline;
}

/* Without subgrid (iOS Safari before 16, Chrome before 117, Samsung Internet before 24) the bar cell would stay
   a grid of its own over the whole row, its percentage on the label: it steps aside instead, so the bar and the
   percentage are placed straight on the row's three columns (the cell's role may not be announced there). */
@supports not (grid-template-columns: subgrid) {
	.report-card.ps-page .ps-ex-bar { display: contents; }
}

.report-card.ps-page .ps-bar {
	grid-column: 1 / -1;
	grid-row: 2;
	align-self: center;
	background: var(--rule);
}

/* One colour on a phone: with no donut, the slice colours have nothing to match. */
.report-card.ps-page .ps-bar-fill { background: var(--navy) !important; }

.report-card.ps-page .ps-pct {
	grid-column: 2;
	grid-row: 1;
	font-family: var(--font-mono);
	font-size: 12.5px;
	line-height: 20px;
	color: var(--text-quiet);
}

.report-card.ps-page .ps-pct-value { width: auto; }
.report-card.ps-page .ps-pct-of { display: none; }

.report-card.ps-page .ps-count {
	grid-column: 3;
	grid-row: 1;
	line-height: 20px;
}

.report-card.ps-page .ps-count a,
.report-card.ps-page .ps-count a:hover { color: var(--navy); }

.report-card.ps-page .ps-ex-row.zero .ps-ex-label { font-weight: 500; color: var(--text-secondary); }
.report-card.ps-page .ps-ex-row.zero .ps-bar { background: var(--rule); }
.report-card.ps-page .ps-ex-row.zero .ps-pct { color: var(--text-quiet); }

/* ----- Items of Interest: the two cards as one ----- */

.report-card.ps-page .ps-pair:has(> .ps-ioi) {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0 12px 12px;
	background: var(--surface);
	border: 1px solid var(--border-card);
	border-radius: 14px;
	box-shadow: var(--shadow-card);
	overflow: hidden;
}

.report-card.ps-page .ps-ioi-head {
	margin: 0;
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--rule);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ink);
}

.report-card.ps-page .ps-pair .ps-card.ps-ioi {
	margin: 0;
	padding: 0 16px;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}

.report-card.ps-page .ps-ioi-head + .ps-card.ps-ioi { padding-top: 14px; }
.report-card.ps-page .ps-pair .ps-card.ps-ioi:last-child { padding-bottom: 16px; }

/* Each card's own title ("Items of Interest — Phone Collection") stays for screen readers only; the head above
   and the caption below are what the mock draws. */
.report-card.ps-page .ps-ioi > .ps-header {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.report-card.ps-page .ps-ioi-section {
	margin: 0;
	padding: 0 0 2px;
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.7px;
	text-transform: uppercase;
	color: var(--text-quiet);
}

.report-card.ps-page .ps-card.ps-ioi + .ps-card.ps-ioi .ps-ioi-section {
	padding-top: 12px;
	border-top: 1px solid var(--rule);
}

.report-card.ps-page .ps-ioi .ps-line,
.report-card.ps-page .ps-ioi .ps-line:last-child { padding: 11px 0; }

.report-card.ps-page .ps-ioi .ps-line-label { color: var(--ink); }
.report-card.ps-page .ps-ioi .ps-line-count { font-size: 15px; }
.report-card.ps-page .ps-ioi .ps-empty .ps-line-name { font-size: 14px; }

/* ----- Footnote ----- */

.report-card.ps-page .ps-advisory {
	align-items: flex-start;
	gap: 10px;
	margin: 0 12px;
	padding: 12px 14px;
	background: var(--tint-navy);
	border-color: var(--active-nav-ring);
	font-size: 13px;
	line-height: 1.5;
	color: var(--ink-body);
}

.report-card.ps-page .ps-advisory svg {
	margin-top: 1px;
	stroke: var(--navy);
	stroke-width: 2;
}
