/**
 * The booking form.
 *
 * Hand-written and enqueued as-is (D-009). WordPress bundles the jQuery UI
 * Datepicker SCRIPT but not its stylesheet, so the picker's own chrome is styled
 * here too — without it the calendar renders as an unstyled table.
 *
 * Deliberately unopinionated about colour and typography: this form is dropped
 * into an Elementor page whose theme owns both, and a plugin that restyles the
 * shop's own site is a plugin the shop fights.
 */

/*
 * THE CARD HAS NO PADDING OF ITS OWN (#343). Its title bar and its body both
 * bring their own, so this was a second inset around the first — which is why
 * the renter card's tinted head stopped short of the card's edges instead of
 * spanning them the way the prototype has it.
 *
 * WHAT PAID FOR IT was everything sitting directly in a card rather than in its
 * body: the calendar, the day count and the two notes under it were held off
 * the edge by this and nothing else. They are padded below, by name, because a
 * rule that padded every direct child would also pad the renter card's head and
 * body, which already have their own.
 */
.srs-card {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 8px;
	margin: 0 0 1.5rem;
}

/*
 * A CARD PADS ITSELF UNLESS SOMETHING INSIDE ALREADY DOES. Removing the padding
 * outright was wrong: the review page's six cards put their content straight
 * into `.srs-card` with no padded body under it, so every one of them would
 * have gone flush against its own border. This asks instead.
 */
.srs-card:not( :has( > .srs-card__body ) ):not( :has( > .srs-renter__body ) ) {
	padding: 1.25rem;
}

/*
 * The title supplies its own, so it is not inset twice — and with the padding
 * goes the header band, which needs two card edges to reach and has neither
 * here. It was rendering as a tinted stripe floating inside the card's padding,
 * stopping short of the border on both sides. A card that pads itself has a
 * plain heading; a card with a body has a header.
 */
.srs-card:not( :has( > .srs-card__body ) ):not( :has( > .srs-renter__body ) ) > .srs-card__title {
	padding: 0;
	border-bottom: 0;
	background: none;
}

.srs-card > .srs-range,
.srs-card > .srs-days,
.srs-card > .srs-note,
.srs-card > .srs-errors {
	padding-left: 18px;
	padding-right: 18px;
}

/*
 * A MARGIN, NOT PADDING, FOR THE ONES THAT CARRY A GROUND. The closures panel
 * and the announcements are tinted boxes: padding moves their text inward and
 * leaves the box itself touching the card's border, which reads as a panel that
 * has escaped rather than one that is inset.
 */
.srs-card > .srs-closures,
.srs-card > .srs-announcements {
	margin-left: 18px;
	margin-right: 18px;
}

/* The last of them needs the foot the card no longer supplies. */
.srs-card > .srs-note:last-child,
.srs-card > .srs-announcements:last-child {
	padding-bottom: 16px;
}

/*
 * DOUBLED SO THE COMPONENT KEEPS ITS OWN SIZE, WEIGHT AND COLOUR. Wolf styles
 * `.entry-content h2/h3/h4` at (0,1,1); a single class is (0,1,0) and loses, so
 * this heading rendered at the theme's heading size in the theme's ink. Repeating
 * the class is the same idiom the buttons here already use, and it keeps the
 * values in the one place that owns them rather than restating them elsewhere.
 */
.srs-card__title.srs-card__title {
	font-size: 1.125rem;
	margin: 0 0 1rem;
	background-color: #fbfcfd;
	border-top-left-radius: 8px;
	border-top-right-radius: 8px;
}

/*
 * §4.1: two columns on desktop, stacked on mobile. Grid rather than floats so
 * the fields keep equal widths as labels translate to different lengths.
 */
/*
 * The two-column grid belongs to the RENTAL PERIOD card, which holds two date
 * fields — not to every card body in the plugin. Written unscoped in #30, when
 * the period card was the only card there was; by the time the contact,
 * delivery, emergency and review cards existed it was quietly laying all of
 * them out in two columns, which is why the entry gate's button sat beside its
 * own explanatory text.
 */
.srs-card--period .srs-card__body {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media ( min-width: 40em ) {
	.srs-card--period .srs-card__body {
		grid-template-columns: 1fr 1fr;
	}
}

.srs-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.srs-field label {
	font-weight: 600;
}

.srs-field__heading {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem 0.6rem;
}

.srs-size-chart {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border: 1px solid currentColor;
	border-radius: 4px;
	font-size: 0.75rem;
	line-height: 1.5;
	text-decoration: none;
}

.srs-size-chart:hover {
	text-decoration: underline;
}

.srs-size-chart:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.srs-date {
	background-color: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.28 );
	border-radius: 4px;
	cursor: pointer;
	padding: 0.5rem 0.625rem;
	width: 100%;
}

.srs-date:focus {
	/* Never removed without a replacement: the picker is keyboard-reachable. */
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.srs-days {
	font-weight: 600;
	margin: 0rem 0 0;
	min-height: 1.5em;
}

.srs-note {
	font-size: 0.875rem;
	margin: 0.5rem 0 0;
	opacity: 0.8;
}

/* ------------------------------------------------------------------------ *
 * jQuery UI Datepicker
 *
 * Core registers the script and leaves the styling to the theme, which for a
 * front-end form means nobody. These rules are the minimum that makes the
 * calendar legible.
 * ------------------------------------------------------------------------ */

.ui-datepicker {
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.18 );
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.12 );
	display: none;
	padding: 0.75rem;
	width: 19rem;
	z-index: 100;
}

.ui-datepicker table {
	border-collapse: collapse;
	width: 100%;
}

.ui-datepicker th,
.ui-datepicker td {
	padding: 0;
	text-align: center;
}

.ui-datepicker td a,
.ui-datepicker td span {
	border-radius: 4px;
	display: block;
	line-height: 2.25;
	text-decoration: none;
}

.ui-datepicker td a:hover {
	background: #2878cd;
	color: #fff;
}

.ui-datepicker .ui-state-active {
	background: rgba( 0, 0, 0, 0.85 );
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * D-108's range.
 *
 * The inline calendar is the control now; the two fields above it are a
 * read-only summary of what it holds. jQuery UI has no range mode, so the ends
 * and the days between them are painted by classes `beforeShowDay` adds.
 * ------------------------------------------------------------------------ */

/*
 * `hidden` HAS TO BEAT A CLASS THAT SETS `display`. The attribute's only
 * strength is the user agent stylesheet, which any rule of ours outranks — so
 * `.srs-field { display: flex }` quietly kept the LINE and WeChat fields on
 * screen with `hidden` set on them, and the same went for the fee rows. Every
 * `hidden` toggle in this form depends on this one rule.
 */
[hidden] {
	display: none !important;
}

/*
 * SHUT UNTIL ASKED FOR. An always-open calendar pushed the rest of the form a
 * screen further down and stayed there after the customer had finished with it.
 * It opens from either date field and closes once the range is whole.
 */
.srs-range {
	display: none;
	margin-top: 0rem;
}

.srs-range.is-open {
	display: block;
}

/*
 * Inline, so it is always open and never floats over the rest of the form — and
 * a flex row, because jQuery UI ships its own multi-month stylesheet and we
 * deliberately do not load it (see the note above). Without this the two months
 * stack and the row-break spacer pushes the last week onto a line of its own.
 *
 * ONE `display` DECLARATION, ON ONE SELECTOR. An earlier version set `block`
 * here and `flex` on `.ui-datepicker-multi`, which is the same element with the
 * same specificity — a cascade race that is invisible in the file and decided by
 * source order. A single month has a single group and fills the row, so there is
 * nothing the split bought.
 */
.srs-range .ui-datepicker {
	box-shadow: none;

	/*
	 * `!important` HERE IS NOT A SHORTCUT, and is the only tool that works.
	 * jQuery UI writes `style="display: block; width: 34em"` onto this element
	 * itself when it renders a multi-month picker, and an element style beats
	 * every stylesheet rule that is not marked important. Without these two the
	 * months stack and the calendar is a fixed 34em wide whatever it is sitting
	 * in — which is what happened, and which reads as the CSS simply not
	 * loading rather than as being outranked.
	 */
	display: flex !important;
	flex-wrap: wrap;
	gap: 1.5rem;
	width: auto !important;
}

/*
 * WRAPPING RATHER THAN A BREAKPOINT. Each month asks for about 16rem and takes
 * an equal share of whatever is left, so two sit side by side when there is room
 * and stack when there is not — without a media query having to guess at the
 * width, which is the wrong question anyway when the form can sit in a narrow
 * column on a wide screen.
 */
.srs-range .ui-datepicker-multi .ui-datepicker-group {
	flex: 1 1 16rem;
	min-width: 0;
}

.srs-range .ui-datepicker-row-break {
	display: none;
}

/* One month is narrow enough to want a ceiling rather than the full column. */
.srs-range .ui-datepicker:not( .ui-datepicker-multi ) {
	max-width: 22rem;
}

.srs-range .srs-range-between a,
.srs-range .srs-range-between span {
	background: rgba( 0, 0, 0, 0.07 );
	border-radius: 0;
}

/* The two ends carry the same weight as a single chosen day, so a one-day
 * rental and the start of a longer one look identical — which they are. */
/*
 * THE COLOUR IS FORCED AND THE BACKGROUND IS NOT, which looks inconsistent and
 * is not. The background only has jQuery UI's own rules to beat and wins on
 * specificity; the text colour is competing with whatever the active THEME sets
 * for a link inside post content, which is out of this plugin's control and
 * routinely more specific. Losing that one puts near-black text on a near-black
 * tile — the selected start date became unreadable, which is how this was found.
 */
.srs-range td.srs-range-start a,
.srs-range td.srs-range-end a {
	/*
	 * The background is forced for the same reason as the colour. jQuery UI marks
	 * whichever day was clicked last as `ui-state-active`, and the theme paints
	 * that its own accent — so the two ends of one range came out different
	 * colours depending on which had been clicked second, which reads as a bug
	 * rather than as a highlight.
	 */
	background: #366ba3 !important;
	color: #fff !important;
}

.srs-range td.srs-range-start a:hover,
.srs-range td.srs-range-end a:hover {
	background: #2878cd !important;
}

/* Square off the inner edges so a run of days reads as one bar rather than as
 * a row of separate pills. */
.srs-range .srs-range-start a {
	border-radius: 4px 0 0 4px;
}

.srs-range .srs-range-end a {
	border-radius: 0 4px 4px 0;
}

/* A single day is both ends at once and keeps all four corners. */
.srs-range .srs-range-start.srs-range-end a {
	border-radius: 4px;
}

/* A date before the booking cutoff, or before the chosen start date. */
.ui-datepicker .ui-state-disabled {
	cursor: not-allowed;
	opacity: 0.35;
}

/*
 * A MONTH ARROW WITH NOWHERE TO GO IS HIDDEN, NOT DIMMED. The earliest month is
 * usually the current one, so "Previous" spends most of its life disabled — and
 * a permanently greyed control reads as something broken rather than as
 * something unavailable. `visibility` rather than `display` so it keeps its
 * space and the month stays centred.
 */
.ui-datepicker .ui-datepicker-prev.ui-state-disabled,
.ui-datepicker .ui-datepicker-next.ui-state-disabled {
	opacity: 1;
	visibility: hidden;
}

/* And when there is somewhere to go, it should look like it. */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
	border-radius: 4px;
	color: #366ba3;
	font-weight: 600;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
	background: rgba( 0, 0, 0, 0.06 );
	color: #2878cd;
}

/*
 * THE ORDER IN THE MARKUP IS prev, next, title — not prev, title, next. Left as
 * a plain `space-between` row that puts the month last and the two arrows
 * side by side at the left, which is why the month sat on top of "Previous".
 * `order` puts them back into the arrangement a person expects.
 */
.ui-datepicker .ui-datepicker-header {
	align-items: center;
	display: flex;
	margin-bottom: 0.5rem;
}

.ui-datepicker .ui-datepicker-prev {
	order: 1;
}

.ui-datepicker .ui-datepicker-title {
	flex: 1;
	order: 2;
	text-align: center;
}

.ui-datepicker .ui-datepicker-next {
	order: 3;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
	cursor: pointer;
	padding: 0 0.5rem;

	/*
	 * BACK INTO THE ROW. Something upstream positions these absolutely, which
	 * takes them out of the flex flow entirely — so the centred month spanned the
	 * whole header and the arrow sat on top of it. `order` cannot help an element
	 * that is not participating in the layout.
	 */
	position: static;
}

.ui-datepicker .ui-datepicker-title {
	font-weight: 600;
}

/* §4.10: the pair is the problem, so both tiles are flagged, not just the new one. */
.srs-gear__item.is-conflicting {
	outline: 2px solid #d63638;
	outline-offset: 2px;
	border-radius: 3px;
}

.srs-gear__conflict {
	margin: 0.5rem 0 0;
	color: #d63638;
	font-weight: 600;
}

/* §4.14: the message sits with the thing it is about, not in a list at the top. */
/*
 * Outlined rather than side-tabbed, for the same reason as the review notice:
 * the left-edge accent is a wp-admin convention, and this is a customer's page.
 */
/*
 * AN ERROR BOX IS A ROW, NEVER A CELL. `.srs-card__body` is a two-column grid,
 * so a block placed in it takes ONE cell: the Delivery & Return Collection
 * summary sat in the first column, pushed Delivery time into the second, and
 * wrapped Return collection time onto a row of its own. The panel looked broken
 * only while it was telling the customer something, which is the worst moment
 * for it.
 *
 * `grid-column` is ignored on anything that is not a grid item, so this is safe
 * on the boxes that sit outside a grid — the summary at the top of the form,
 * and the sections whose body is not a grid.
 */
.srs-errors {
	grid-column: 1 / -1;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid #b3261e;
	border-radius: 3px;
	background: #fbe6e4;
	color: #1d2327;
}

/*
 * ONE FIELD'S OWN MESSAGE, written by `validation.js` before the form is sent.
 *
 * QUIETER THAN THE SECTION BOX ON PURPOSE. The box is a summary of what a whole
 * panel is missing and earns a fill and a border; this is a single sentence
 * under a single field, sitting beside a field that is already outlined red, so
 * a fill here would make a form of eight empty fields into eight red slabs.
 */
.srs-field__error {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.35;
	color: #b3261e;
}

/*
 * The field itself says so too, because a message the eye skips is a message
 * that did not arrive. Set from `aria-invalid`, so the outline and the sentence
 * cannot disagree — there is one flag, not a flag and a class.
 */
.srs-field [aria-invalid="true"] {
	border-color: #b3261e;
}

.srs-field [aria-invalid="true"]:focus {
	outline: 2px solid #b3261e;
	outline-offset: 1px;
}

.srs-errors ul {
	margin: 0;
	padding-left: 1.25rem;
}

.srs-errors--summary {
	font-weight: 600;
}

.srs-errors--summary:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/*
 * NO DARK BLOCK HERE ANY MORE. This file began as admin styling and carried a
 * `prefers-color-scheme: dark` rule painting the error summary #2c1b1c in
 * wp-admin's dark palette. It is enqueued on the FRONTEND only — `srs-booking-
 * form` is registered in `Frontend\BookingForm` and no admin screen asks for it
 * — and the frontend palette is light throughout, hard-coded down to
 * `--srs-card: #fff`. So on a visitor whose OS prefers dark, one banner turned
 * dark maroon in the middle of a light page while nothing around it moved.
 *
 * Supporting dark properly is a palette-wide decision, not a per-component one.
 * Until that decision is taken, honouring the preference in two isolated widgets
 * is worse than not honouring it at all.
 */

/*
 * D-095's "I have only one legal name" control.
 *
 * `.srs-field` is a flex column whose label is bold, which is right for a text
 * field and wrong for a checkbox: the label here is the sentence beside the
 * box, not a heading above it.
 *
 * DOUBLED CLASS, DELIBERATELY. `.srs-field label` and `.srs-field--check label`
 * have identical specificity, so which one wins would depend on the order these
 * rules happen to sit in — the kind of thing that survives review and breaks
 * when somebody sorts the file. `.srs-field.srs-field--check` outranks it
 * outright.
 */
.srs-field.srs-field--check label {
	align-items: center;
	display: flex;
	font-weight: 400;
	gap: 0.5rem;
}

.srs-field.srs-field--check input {
	flex: none;
	margin: 0;
}

/*
 * The sentence under D-095's one-name checkbox, saying when it applies.
 *
 * Indented to the checkbox's text rather than the box, so it reads as part of
 * the same thought — the gap matches `.srs-field--check`'s own gap plus the
 * box, which is why it is written as a sum rather than a round number.
 */
.srs-field.srs-field--check .srs-hint {
	display: block;
	font-size: 0.875rem;
	margin-left: calc( 1rem + 0.5rem );
	opacity: 0.8;
}

/* ---------------------------------------------------------------------------
 * The renter card's head.
 *
 * The bin sits opposite the label rather than at the foot of a long card, so a
 * customer who added a renter by mistake does not scroll past everything it is
 * about to remove in order to reach it.
 * ------------------------------------------------------------------------ */

/*
 * The head is a bar: number, name, running total, bin. It is also the control
 * that opens the card — a `<summary>`, so that is native rather than scripted —
 * which is why it is tinted and shows a pointer.
 */
.srs-renter__summary {
	align-items: center;
	background: #f2f5f8;
	border-bottom: 1px solid #d5dde6;
	cursor: pointer;
	display: flex;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-top-left-radius: 8px;
	border-top-right-radius: 8px;
}

.srs-renter__label {
	flex: 1;
	font-weight: 600;
}

/*
 * THE PREFILL, ONE LOOK IN BOTH PLACES (#347). It sits on a card's title bar on
 * the renter card and on the contact card, so it is set once for both rather
 * than twice with a difference nobody meant.
 *
 * WHITE, NOT THE QUIET BUTTON'S TINT. Both bars are tinted now, and a tinted
 * button on a tinted bar is a button that has to be looked for.
 */
.srs-renter__summary .srs-prefill,
.srs-contact__head .srs-prefill {
	flex: none;
	margin: 0;
}

.srs-renter__summary .srs-prefill__button,
.srs-contact__head .srs-prefill__button {
	background: #fff;
	font-size: 0.75rem;
	padding: 0.3rem 0.7rem;
	white-space: nowrap;
}

/*
 * The disclosure marker, at the end of the name rather than the head of the
 * bar. `flex: 1` makes the label span the rest of the row, so an `::after` on
 * it lands against the text instead of against the total on the far right.
 */
.srs-renter__label::after {
	content: "▾";
	display: inline-block;
	margin-left: 0.4rem;
	color: #5a6878;
	font-size: 0.75rem;
	transform: rotate( -90deg );
	transition: transform 120ms ease;
}

.srs-renter[open] > .srs-renter__summary .srs-renter__label::after {
	transform: rotate( 0deg );
}

/* A square, not a circle: it is an index, and a circle reads as a status. */
.srs-renter__index {
	align-items: center;
	background: #16324f;
	border-radius: 2px;
	color: #fff;
	display: inline-flex;
	flex: none;
	font-size: 0.6875rem;
	height: 1.375rem;
	justify-content: center;
	width: 1.375rem;
}

/*
 * TABULAR FIGURES, so a column of renter totals lines up on the decimal even
 * though every card is a separate element.
 */
.srs-renter__total {
	color: #1b3f66;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
 * The totals card: label left, figure right, one row each.
 * ------------------------------------------------------------------------ */

.srs-totals__row {
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	margin: 0 0 0.5rem;
}

.srs-totals__value {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* The sum is separated from its parts by a rule, the way a bill is. */
.srs-totals__row--sum {
	border-top: 1px solid rgba( 0, 0, 0, 0.12 );
	font-weight: 700;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
}

.srs-remove-renter {
	background: none;
	border: 0;
	border-radius: 4px;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	line-height: 0;
	opacity: 0.55;
	padding: 0.35rem;
}

.srs-remove-renter:hover,
.srs-remove-renter:focus-visible {
	background: rgba( 0, 0, 0, 0.07 );
	/* Destructive, and only says so on approach — a card of red bins reads as a
	   row of warnings rather than as one control per renter. */
	color: #b3261e;
	opacity: 1;
}

/* ---------------------------------------------------------------------------
 * Delivery and collection, now a block inside the rental period card rather
 * than a card of its own (D-109).
 * ------------------------------------------------------------------------ */

.srs-windows {
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	margin-top: 1.5rem;
	padding-top: 0rem;
}

/*
 * A CLOSED DAY, TOLD APART FROM A DAY THAT IS MERELY TOO SOON. Both are
 * unselectable, and jQuery UI dims both the same way — but one is "not yet" and
 * the other is "we are shut", and only the second has an explanation attached
 * to hover. The strike marks it as a decision rather than a limit.
 */
.srs-range td.srs-closed span,
.srs-range td.srs-closed a {
	text-decoration: line-through;
	opacity: 0.55;
	cursor: not-allowed;
}

/*
 * D-046's closures, listed before the customer picks. Quiet: it is a fact about
 * the shop's calendar, not a warning about this booking.
 */
.srs-closures {
	margin: 12px 0 12px 0;
	padding: 12px 14px;
	background: var( --srs-snow-2 );
	border-radius: var( --srs-radius );
	font-size: 13px;
}

.srs-closures__title {
	margin: 0 0 6px;
	font-weight: 600;
	color: var( --srs-ink-2 );
}

.srs-closures__list {
	margin: 0 0 6px;
	padding: 0;
	list-style: none;
}

.srs-closures__list li {
	margin: 0 0 3px;
}

.srs-closures__dates {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.srs-closures__why {
	color: var( --srs-ink-3 );
}

/*
 * An announcement blocks nothing, so it is tinted rather than alarming. The
 * warning kind gets the same ground the review notice uses, because a shop that
 * marked it a warning meant it to be read.
 */
.srs-announcements {
	margin: 0px 0 0;
}

.srs-announcement {
	margin: 0 0 6px;
	padding: 10px 12px;
	border-radius: var( --srs-radius );
	background: var( --srs-glacier-lite );
	color: var( --srs-ink-2 );
	font-size: 13px;
	line-height: 1.6;
}

.srs-announcement--warning {
	background: var( --srs-warn-lite );
}

/* The chart scrolls internally; the booking underneath stays in place. */
html.srs-chart-open {
	overflow: hidden;
}

dialog.srs-chart-dialog {
	position: fixed;
	inset: 0;
	margin: auto;
	width: calc( 100vw - 2rem );
	max-width: 1200px;
	max-height: calc( 100dvh - 2rem );
	padding: 1rem;
	border: 0;
	border-radius: 8px;
	box-sizing: border-box;
	background: #fff;
	color: #16324f;
}

.srs-chart-dialog[open] {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.srs-chart-dialog::backdrop {
	background: rgba( 0, 0, 0, 0.6 );
}

.srs-chart-dialog__header {
	display: flex;
	justify-content: flex-end;
	flex-shrink: 0;
}

.srs-chart-dialog__header button {
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.srs-chart-dialog__viewport {
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
}

.srs-chart-dialog__viewport img {
	display: block;
	width: 100%;
	min-width: 1000px;
	max-width: none;
	height: auto;
}

.srs-chart-dialog__viewport img[hidden] {
	display: none;
}

/* Desktop fits the full chart within a centered viewer; mobile keeps scrolling. */
@media ( min-width: 768px ) {
	dialog.srs-chart-dialog {
		width: 85vw;
		max-width: 85vw;
		max-height: 85dvh;
		margin: auto;
	}

	.srs-chart-dialog__viewport img {
		width: auto;
		min-width: 0;
		max-width: 100%;
		max-height: calc( 85dvh - 5.5rem );
		margin: auto;
		object-fit: contain;
	}
}
