.sessions {
	border: 1px solid #7f3035;
	margin: 50px auto;
	width: min(94%, 1500px);
	text-align: center;
}

.sessions [hidden] {
	display: none !important;
}

.session-img {
	display: block;
	max-width: 320px;
	width: 30%;
}

.sessions > h2 {
	font-size: clamp(2rem, 4vw, 2.8rem);
}

.option-records,
.all-records {
	border: 1px solid #7f3035;
	box-shadow: 0 5px 30px rgba(127, 48, 53, 0.45);
	margin: 30px auto;
	padding: 20px;
	width: 98%;
}

.option-records {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.record-options-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 12px;
	width: 100%;
}

.option-records h3,
.title-records {
	font-size: 1.8rem;
	margin: 0 0 20px;
}

.option-records .button {
	font-size: 1rem;
	margin: 3px;
	max-width: 420px;
	width: 100%;
}

.all-records {
	display: flex;
	flex-direction: column;
	min-height: 500px;
	min-width: 0;
	text-align: left;
}

.title-records {
	text-align: center;
}

.record-status {
	min-height: 1.5em;
	margin: 6px 0 12px;
	text-align: center;
}

.record-status.is-error {
	color: #a31515;
	font-weight: 600;
}

.record-status.is-success {
	color: #1c6b35;
}

.record-status.is-loading::before {
	content: "";
	display: inline-block;
	width: 0.75em;
	height: 0.75em;
	margin-right: 0.5em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: record-assistant-spin 0.75s linear infinite;
}

@keyframes record-assistant-spin {
	to { transform: rotate(360deg); }
}

.table-scroll {
	flex: 1;
	overflow: auto;
}

/* The record grid (#389). main.css lays every table out as a block and every
   cell as an inline block; this one is a real table, each part in its table
   role, so its six columns line up under their filters and headers, with
   fixed widths so a long address or detector list wraps inside its column
   rather than pushing the Load button off screen. */
.record-grid {
	border-collapse: collapse;
	display: table;
	table-layout: fixed;
	width: 100%;
}

.record-grid thead {
	display: table-header-group;
	font-size: 1rem;
}

.record-grid tbody {
	display: table-row-group;
}

.record-grid tr {
	display: table-row;
}

.record-grid th,
.record-grid td {
	display: table-cell;
}

/* Both header rows share the thead's accent, not the alternating row tint. */
.record-grid thead tr:nth-child(even) {
	background-color: transparent;
}

.record-grid th,
.record-grid td {
	font-size: 1rem;
	padding: 10px 8px;
	text-align: left;
	vertical-align: top;
	word-break: break-word;
}

.record-grid th[data-sort-column="date"] {
	width: 13%;
}

.record-grid th[data-sort-column="batch"] {
	width: 12%;
}

.record-grid .record-grid-action {
	width: 85px;
}

/* The filter row sits above the headers, inside the thead so it scrolls with
   the columns it filters. Inputs fill their column. */
.record-grid-filters td {
	padding: 8px 6px 4px;
}

.grid-filter {
	box-sizing: border-box;
	font-size: 0.95rem;
	margin: 0;
	min-width: 0;
	padding: 4px 6px;
	width: 100%;
}

/* A header is a button: the column's name, and the order it is in when it is
   the sort. The arrow is drawn from aria-sort, which is also what a screen
   reader announces, so the picture and the announcement cannot disagree. */
.sort-button {
	background: none;
	border: 0;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	height: auto;
	line-height: inherit;
	margin: 0;
	padding: 0;
	text-align: left;
	white-space: normal;
}

.sort-button:hover,
.sort-button:focus-visible {
	text-decoration: underline;
}

th[aria-sort="ascending"] .sort-button::after {
	content: " \2191";
}

th[aria-sort="descending"] .sort-button::after {
	content: " \2193";
}

.record-grid tbody tr {
	cursor: pointer;
}

.record-grid tbody tr:nth-child(even) {
	background: rgba(127, 48, 53, 0.06);
}

.record-grid tbody tr:hover {
	background: rgba(127, 48, 53, 0.14);
}

.record-grid tbody tr:focus-visible {
	outline: 2px solid #7f3035;
	outline-offset: -2px;
}

.result-load-button {
	font-size: 0.8rem;
	margin: 0;
	padding: 5px 10px;
}

.show-more-records {
	align-self: center;
	margin-top: 12px;
}

.options-overlay {
	background-color: rgba(240, 240, 240, 0.94);
	bottom: 0;
	left: 0;
	overflow: auto;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 100;
}

.options-overlay-container {
	background: var(--background-color, #fff);
	border: 1px solid #7f3035;
	box-sizing: border-box;
	margin: 50px auto;
	max-height: calc(100vh - 100px);
	min-height: 400px;
	overflow-y: auto;
	padding: 24px;
	width: min(760px, 90%);
}

.options-overlay-container h2 {
	font-size: 1.8rem;
	margin: 0 0 12px;
	padding: 0;
}

#option1-container,
#option2-container,
#new-customer-container {
	text-align: center;
}

#customer-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 20px auto;
	max-width: 650px;
}

#customer-options .button {
	height: auto;
	min-height: 44px;
	white-space: normal;
	width: 100%;
}

.customer-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 18px;
	margin: 20px 0;
	text-align: left;
}

.customer-form-grid label {
	display: flex;
	flex-direction: column;
	font-weight: 600;
}

.customer-form-grid input {
	margin-top: 4px;
	width: 100%;
}

.customer-form-grid .full-width {
	grid-column: 1 / -1;
}

/* Both close controls sit in the same corner on purpose: the overlay's X is
   the one on top while the overlay is open (z-index 100 against the page's 1),
   so the top-right X always closes the topmost thing. */
.close-record-assistant,
.overlay-close {
	position: fixed;
	right: 20px;
	top: 20px;
}

@media screen and (max-width: 560px) {
	.session-img {
		width: 60%;
	}

	.option-records,
	.all-records {
		margin: 10px auto;
		padding: 12px;
	}

	.customer-form-grid {
		grid-template-columns: 1fr;
	}

	.customer-form-grid .full-width {
		grid-column: auto;
	}

	/* Phone width: each row is a card with its cells labelled, the filters
	   stay stacked above the list, and the sort headers become a row of
	   buttons so the order can still be changed. */
	.record-grid,
	.record-grid thead,
	.record-grid tbody,
	.record-grid tr,
	.record-grid th,
	.record-grid td {
		display: block;
		width: 100% !important;
	}

	.record-grid .record-grid-filters td {
		padding: 4px 0;
	}

	.record-grid .record-grid-filters .record-grid-action {
		display: none;
	}

	.record-grid .record-grid-headers {
		display: flex;
		flex-wrap: wrap;
		gap: 4px 14px;
		padding: 8px 0;
	}

	.record-grid .record-grid-headers th {
		padding: 0;
		width: auto !important;
	}

	.record-grid .record-grid-headers .record-grid-action {
		display: none;
	}

	.record-grid tbody tr {
		border-bottom: 1px solid #7f3035;
		padding: 8px 0;
	}

	.record-grid tbody td {
		padding: 4px 0;
	}

	.record-grid tbody td[data-label]::before {
		content: attr(data-label) ": ";
		font-weight: 600;
	}
}
