/**
 * Part dialog on phones (600px wide and under).
 *
 * Loaded after sp-modal.css and only adds rules inside the phone media query,
 * so tablets and desktops are unchanged (one rule near the end sets the text
 * size of fields on a phone turned on its side). The layout: the dialog fills
 * the screen, a slim header, one row of tabs (icon and short name, with a dot
 * on a tab that has something added), a shorter preview with its zoom and
 * view buttons in a View menu, and the total in the footer. The preview
 * scrolls away with the pane until only a strip of it is left.
 * sp-modal-phone.js adds the View button, the strip and the hole picker.
 *
 * The panes' own sheets (finishing.css, hole-wizard.css) load after this one,
 * so a rule here that changes something of theirs names the dialog as well,
 * to win over them.
 */

/* Wider screens keep the estimate line and chips, and none of the phone's
   preview controls. */
.quoteandcut-sp-modal__phone-total,
.quoteandcut-sp-rail__tab-glyph,
.quoteandcut-sp-rail__tab-short,
.quoteandcut-sp-stage__views,
.quoteandcut-sp-stage__strip,
.quoteandcut-sp-stage__pick,
.quoteandcut-sp-stage__pickbar {
	display: none;
}

@media (max-width: 600px) {

	/* Full screen, no card. The dialog fills the backdrop, so neither of
	   them scrolls. Text kept for screen readers sits wherever its pane put
	   it, often far below the screen's foot: the dialog box holds it (as its
	   transform does on larger screens) and cuts it off there. Left to reach
	   the backdrop, it let the whole dialog slide up under a finger. */
	.quoteandcut-sp-overlay,
	.quoteandcut-sp-overlay.is-fullscreen {
		padding: 0;
		overflow: hidden;
		overflow: clip;
		background: var(--quoteandcut-card-bg, #fff);
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.quoteandcut-sp-modal,
	.quoteandcut-sp-overlay.is-fullscreen .quoteandcut-sp-modal {
		position: relative;
		overflow: hidden;
		overflow: clip;

		/* Two quick taps on − or + are two taps, not a zoom into the page. */
		touch-action: manipulation;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		transform: none;
		animation: quoteandcut-modal-fade-in 0.16s ease-out forwards;
	}

	/* The page behind takes no pull while the dialog is open (the class is
	   set by sp-modal-phone.js). On Android a pull down from the header
	   would otherwise reload the page, and the parts on it would be lost. */
	html.quoteandcut-sp-dialog-open,
	html.quoteandcut-sp-dialog-open body {
		overscroll-behavior: none;
	}

	/* Header: name and material on the left, close on the right. */
	.quoteandcut-sp-modal__header {
		gap: 8px;
		min-height: 56px;
		padding: 6px 6px 6px 16px;
	}

	.quoteandcut-sp-modal__file {
		display: none;
	}

	.quoteandcut-sp-modal__title {
		overflow: hidden;
		font-size: 16px;
		line-height: 1.25;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.quoteandcut-sp-modal__subtitle {
		margin-top: 1px;
		overflow: hidden;
		font-size: 12.5px;
		line-height: 1.3;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.quoteandcut-sp-modal__close {
		width: 44px;
		height: 44px;
		border-color: transparent;
		background-color: transparent;
	}

	/* Previous and next part: 40px buttons in a 44px pill, and a tap anywhere
	   in the pill reaches the nearer one. */
	.quoteandcut-sp-modal__stepper {
		padding: 1px;
	}

	.quoteandcut-sp-modal__step {
		width: 40px;
		height: 40px;
		border-radius: 10px;
	}

	.quoteandcut-sp-modal__step::after {
		content: "";
		position: absolute;
		inset: -2px -1px;
	}

	.quoteandcut-sp-modal__step--previous::after {
		left: -2px;
	}

	.quoteandcut-sp-modal__step--next::after {
		right: -2px;
	}

	/* Tabs: one row, icon over a short name. They share the row equally while
	   their names fit; with more tabs or longer names each keeps its name
	   whole and the row scrolls sideways, with the bar's edge fade as the cue. */
	.quoteandcut-sp-modal__tabbar {
		padding: 0;
	}

	.quoteandcut-sp-rail__tabs,
	.quoteandcut-sp-modal__tabbar .quoteandcut-sp-rail__tabs {
		display: flex;
		flex-wrap: nowrap;
		gap: 0;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
	}

	.quoteandcut-sp-rail__tabs::-webkit-scrollbar {
		display: none;
	}

	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab,
	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab.is-active {
		position: relative;
		flex: 1 0 0;
		flex-direction: column;
		justify-content: center;
		gap: 4px;
		min-width: auto;
		min-height: 56px;
		margin: 0;
		padding: 6px 4px 4px;
		border: 0;
		border-bottom: 2.5px solid transparent;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		color: var(--quoteandcut-text-secondary);
	}

	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab.is-active {
		border-bottom-color: var(--quoteandcut-sp-accent-ink, var(--quoteandcut-accent-ink, #ad571f));
		color: var(--quoteandcut-sp-accent-ink, var(--quoteandcut-accent-ink, #ad571f));
	}

	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab.is-unavailable:not(.is-active) {
		opacity: 0.6;
	}

	/* The focus ring sits inside the tab, where the row's scrolling cannot clip it. */
	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab:focus-visible {
		outline-offset: -3px;
	}

	.quoteandcut-sp-rail__tab-icon {
		display: none;
	}

	/* The full name and what is set are not shown, but stay as the tab's
	   name for screen readers (the short name is hidden from them). */
	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab-label,
	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab-state {
		position: absolute;
		display: block;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.quoteandcut-sp-rail__tab-glyph {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 22px;
		height: 22px;
	}

	.quoteandcut-sp-rail__tab-glyph .quoteandcut-sp-icon {
		width: 20px;
		height: 20px;
	}

	.quoteandcut-sp-rail__tab-dot {
		position: absolute;
		top: -2px;
		right: -5px;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: var(--quoteandcut-success, #2e8a5a);
		box-shadow: 0 0 0 2px var(--quoteandcut-card-bg, #fff);
	}

	.quoteandcut-sp-rail__tab-text {
		display: block;
	}

	.quoteandcut-sp-rail__tab-short {
		display: block;
		font-size: 11px;
		font-weight: var(--quoteandcut-weight-semibold, 600);
		line-height: 1.2;
		white-space: nowrap;
	}

	/* The preview is shorter, and scrolls away with the pane: it stops once
	   only its bottom strip is left, and sp-modal-phone.js shows the strip's
	   line and button then. Nothing changes size as the pane scrolls, so the
	   pane is never pushed back under the finger. */
	.quoteandcut-sp-modal {
		--quoteandcut-sp-stage-h: clamp(170px, 31vh, 260px);
		--quoteandcut-sp-strip-h: 56px;
	}

	.quoteandcut-sp-modal__body {
		overscroll-behavior: contain;

		/* A field or section scrolled into view stops clear of the strip. */
		scroll-padding-top: calc(var(--quoteandcut-sp-strip-h) + 8px);
	}

	.quoteandcut-sp-stage {
		top: calc(var(--quoteandcut-sp-strip-h) - var(--quoteandcut-sp-stage-h));
		height: var(--quoteandcut-sp-stage-h);
	}

	/* A pane that is worked on the preview (def.keepPreview, as Etching is)
	   keeps it pinned in full, a little taller, and scrolls beneath it. */
	.quoteandcut-sp-modal.keeps-preview {
		--quoteandcut-sp-stage-h: clamp(160px, 36vh, 300px);
	}

	@supports (height: 1svh) {

		.quoteandcut-sp-modal.keeps-preview {
			--quoteandcut-sp-stage-h: clamp(160px, 36svh, 300px);
		}
	}

	.quoteandcut-sp-modal.keeps-preview .quoteandcut-sp-stage,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage {
		top: 0;
	}

	.quoteandcut-sp-modal.keeps-preview .quoteandcut-sp-modal__body,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-modal__body {
		scroll-padding-top: calc(var(--quoteandcut-sp-stage-h) + 8px);
	}

	/* The drawing's zoom bar and the model's view buttons open from the View
	   button rather than covering the part. */
	.quoteandcut-sp-stage__controls,
	.quoteandcut-sp-stage__model-bar {
		display: none;
	}

	.quoteandcut-sp-stage.is-views-open .quoteandcut-sp-stage__controls:not([hidden]),
	.quoteandcut-sp-stage.is-views-open .quoteandcut-sp-stage__model-bar:not([hidden]) {
		display: flex;
		top: auto;
		right: 8px;
		bottom: 56px;
		left: auto;
		z-index: 5;
		flex-wrap: wrap;
		justify-content: flex-end;
		max-width: calc(100% - 16px);
		background: var(--quoteandcut-card-bg, #fff);
		transform: none;
	}

	/* Its buttons are finger sized. The dialog's own narrowing of them (for
	   a bar that must stay on one row) does not apply to a menu. */
	.quoteandcut-sp-stage__controls .quoteandcut-sp-stage__button {
		min-width: 40px;
		height: 40px;
	}

	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__controls {
		max-width: calc(100% - 16px);
	}

	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__button,
	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__model-bar.is-compact .quoteandcut-sp-model-bar__button--text {
		width: 40px;
		min-width: 40px;
		height: 40px;
		min-height: 40px;
		padding: 0;
	}

	/* As wide as its longest row, the seven set views. */
	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__model-bar {
		justify-content: space-between;
		gap: 4px 0;
		width: min-content;
		max-width: calc(100% - 16px);
		padding: 6px 4px;
	}

	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__group {
		gap: 2px;
		padding: 0 4px;
		border-left: 0;
	}

	/* The seven set views take the menu's second row; how the part is shown,
	   its sizes and Clear view share the first. */
	.quoteandcut-sp-modal .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__group {
		order: 2;
	}

	.quoteandcut-sp-modal .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__group:first-child,
	.quoteandcut-sp-modal .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__group--sizes,
	.quoteandcut-sp-modal .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__group--clear {
		order: 1;
	}

	.quoteandcut-sp-stage__views {
		position: absolute;
		right: 8px;
		bottom: 8px;
		z-index: 4;
		display: inline-flex;
		align-items: center;
		gap: 6px;
		height: 40px;
		padding: 0 12px;
		border: 1px solid var(--quoteandcut-border-color);
		border-radius: 10px;
		background: var(--quoteandcut-card-bg, #fff);
		box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
		color: var(--quoteandcut-text-primary);
		font: inherit;
		font-size: 13px;
		font-weight: var(--quoteandcut-weight-semibold, 600);
	}

	.quoteandcut-sp-stage__views[hidden] {
		display: none;
	}

	.quoteandcut-sp-stage__views .quoteandcut-sp-icon {
		width: 16px;
		height: 16px;
	}

	.quoteandcut-sp-stage.is-views-open .quoteandcut-sp-stage__views {
		border-color: var(--quoteandcut-sp-accent-ink, #ad571f);
		background: var(--quoteandcut-sp-accent-soft, #fff1e8);
	}

	/* The face label ("Front · the etched side") takes the bottom corner
	   beside the View button, off the rows the part is fitted under
	   (sp-modal.js leaves it out of its measuring on phones). */
	.quoteandcut-sp-stage .quoteandcut-sp-stage__face {
		top: auto !important;
		bottom: 8px;
		left: 8px;
		display: flex;
		align-items: center;
		min-height: 40px;
		max-width: calc(100% - 112px);
		padding: 4px 10px;
		border-radius: 10px;
		font-size: 12.5px;
		line-height: 1.25;
	}

	.quoteandcut-sp-stage .quoteandcut-sp-stage__face[hidden] {
		display: none;
	}

	/* Clear view puts the controls away; these are controls too. */
	.quoteandcut-sp-stage.is-clear-view .quoteandcut-sp-stage__views,
	.quoteandcut-sp-stage.is-clear-view .quoteandcut-sp-stage__pick {
		display: none;
	}

	/* The strip left showing once the preview has scrolled away. */
	.quoteandcut-sp-stage__strip {
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 6;
		display: flex;
		align-items: center;
		gap: 12px;
		height: var(--quoteandcut-sp-strip-h);
		padding: 0 8px 0 12px;
		background: #f5f7fa;
		cursor: pointer;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.16s ease, visibility 0s linear 0.16s;
	}

	.quoteandcut-sp-modal.is-stage-away .quoteandcut-sp-stage__strip {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.16s ease, visibility 0s linear 0s;
	}

	/* Only the strip is in reach then, and a drag on it scrolls the pane. */
	.quoteandcut-sp-modal.is-stage-away .quoteandcut-sp-stage {
		touch-action: pan-y;
	}

	.quoteandcut-sp-stage__strip-thumb {
		flex: none;
		width: 64px;
		height: 40px;
		border: 1px solid var(--quoteandcut-border-color);
		border-radius: 8px;
		background: #fff;
		object-fit: contain;
	}

	.quoteandcut-sp-stage__strip-thumb[hidden] {
		display: none;
	}

	.quoteandcut-sp-stage__strip-text {
		flex: 1 1 auto;
		min-width: 0;
		color: var(--quoteandcut-text-secondary);
		font-size: 13px;
		line-height: 1.3;
	}

	.quoteandcut-sp-stage__untuck {
		display: inline-flex;
		flex: none;
		align-items: center;
		gap: 6px;
		height: 40px;
		padding: 0 12px;
		border: 1px solid var(--quoteandcut-border-color);
		border-radius: 10px;
		background: var(--quoteandcut-card-bg, #fff);
		color: var(--quoteandcut-text-primary);
		font: inherit;
		font-size: 13px;
		font-weight: var(--quoteandcut-weight-semibold, 600);
	}

	.quoteandcut-sp-stage__untuck .quoteandcut-sp-icon {
		width: 16px;
		height: 16px;
	}

	/* Typing on a pane that keeps the preview: the dialog takes just the
	   screen left above the keyboard (sp-modal-phone.js measures it), and
	   the tabs, the footer and the preview's buttons step aside, so the
	   preview and the field being typed in both fit. */
	.quoteandcut-sp-overlay.is-keyboard {
		top: var(--quoteandcut-sp-vv-top, 0);
		bottom: auto;
		height: var(--quoteandcut-sp-vv-height, 100%);
	}

	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-modal {
		--quoteandcut-sp-stage-h: clamp(96px, calc(var(--quoteandcut-sp-vv-height, 320px) * 0.42), 220px);
		height: 100%;
		max-height: 100%;
	}

	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-modal__tabbar,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-modal__footer,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-stage__chips,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-stage__legend,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-stage__face,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-stage__views,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-stage__controls,
	.quoteandcut-sp-overlay.is-keyboard .quoteandcut-sp-stage__model-bar {
		display: none !important;
	}

	/* Overview: the part facts in two columns, label over value. */
	.quoteandcut-sp-facts {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 10px 14px;
		padding-top: 10px;
	}

	.quoteandcut-sp-facts__row,
	.quoteandcut-sp-facts__row:last-child {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 1px;
		min-height: 0;
		padding: 0;
		border: 0;
		font-size: 13px;
	}

	.quoteandcut-sp-facts__row dt .quoteandcut-sp-icon {
		display: none;
	}

	.quoteandcut-sp-facts__row dd {
		text-align: left;
	}

	.quoteandcut-sp-facts__row--units {
		grid-column: 1 / -1;
		flex-wrap: nowrap;
		align-items: stretch;
	}

	.quoteandcut-sp-facts__row--units dd.quoteandcut-sp-facts__hint {
		flex: none;
		margin-top: 4px;
	}

	.quoteandcut-sp-facts__row--units dd.quoteandcut-sp-facts__units {
		justify-content: flex-start;
		width: 100%;
	}

	.quoteandcut-sp-facts__row--units .quoteandcut-sp-units-select {
		width: 100%;
		min-height: 44px;
	}

	.quoteandcut-sp-overview .quoteandcut-sp-card {
		padding: 14px;
	}

	/* Powder coating: colours as a list, so full names fit. */
	.quoteandcut-sp-powder__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.quoteandcut-sp-powder__swatch {
		flex-direction: row;
		align-items: center;
		gap: 12px;
		min-height: 50px;
		padding: 0 4px;
		border-bottom: 1px solid var(--quoteandcut-border-color);
		font-size: 15px;
		text-align: left;
	}

	.quoteandcut-sp-powder__dot {
		flex: none;
		width: 30px;
		height: 30px;
		border-radius: 50%;
	}

	.quoteandcut-sp-powder__dot--other {
		font-size: 14px;
	}

	.quoteandcut-sp-powder__label {
		flex: 1 1 auto;
		white-space: normal;
	}

	.quoteandcut-sp-powder__swatch.is-selected .quoteandcut-sp-powder__dot {
		box-shadow: 0 0 0 2px var(--quoteandcut-card-bg, #fff), 0 0 0 4px var(--quoteandcut-accent-ink, var(--quoteandcut-accent-primary, #ff7618));
	}

	.quoteandcut-sp-powder__swatch.is-selected::after {
		content: "";
		flex: none;
		width: 22px;
		height: 22px;
		border-radius: 6px;
		background: var(--quoteandcut-sp-accent-ink, #ad571f) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
	}

	/* Panes sit flat on the page rather than in a card. */
	.quoteandcut-sp-rail__pane:not([data-sp-active="overview"]) {
		margin: 0;
		padding: 14px 16px 18px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.quoteandcut-sp-rail__pane,
	.quoteandcut-sp-rail.is-single .quoteandcut-sp-rail__pane {
		padding: 14px 16px 18px;
	}

	/* Footer: the total on the left, Done on the right. What is added is
	   listed on the Overview tab, so the chips row goes. */
	.quoteandcut-sp-modal__footer {
		flex-wrap: nowrap;
		gap: 12px;
		padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.quoteandcut-sp-modal__added {
		display: none;
	}

	/* The estimate line is not shown, but still read out as it changes; the
	   total that is shown instead is hidden from screen readers. */
	.quoteandcut-sp-modal__estimate {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.quoteandcut-sp-modal__phone-total {
		display: block;
		flex: 1 1 auto;
		min-width: 0;
		margin: 0;
		font-size: 13px;
		line-height: 1.3;
	}

	.quoteandcut-sp-modal__phone-total b {
		display: block;
		color: var(--quoteandcut-text-primary);
		font-size: 16px;
		font-weight: var(--quoteandcut-weight-bold, 700);
	}

	.quoteandcut-sp-modal__phone-total span {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		overflow: hidden;
		color: var(--quoteandcut-text-secondary);
	}

	.quoteandcut-sp-modal__phone-total span:empty {
		display: none;
	}

	.quoteandcut-sp-modal__done {
		flex: none;
		min-width: 110px;
		min-height: 48px;
	}
}

/* Holes on phones: sizes as compact buttons, and the picker that fills the
   screen with the drawing. */
@media (max-width: 600px) {

	/* Sizes two to a row, the note under each wrapping rather than taking a
	   row per size (hole-wizard.js leaves these rows out of fitChoiceRows). */
	.quoteandcut-hole-wizard__op-choices,
	.quoteandcut-hole-wizard__op-choices.is-single {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.quoteandcut-hole-wizard__op-choices > .quoteandcut-sp-choice {
		min-height: 52px;
		padding: 6px 8px;
	}

	.quoteandcut-hole-wizard__op-choices > :last-child:nth-child(odd) {
		grid-column: auto;
	}

	.quoteandcut-hole-wizard__op-choices .quoteandcut-hole-wizard__choice-sub {
		font-size: 12px;
		white-space: normal;
	}

	.quoteandcut-hole-wizard__depth-line {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 4px 12px;
		padding: 12px 14px;
		border: 1px solid var(--quoteandcut-border-color);
		border-radius: 10px;
	}

	.quoteandcut-hole-wizard__depth-line-text {
		flex: 1 1 auto;
		font-size: 14px;
	}

	.quoteandcut-hole-wizard__depth-link {
		min-height: 32px;
		font-size: 14px;
		font-weight: var(--quoteandcut-weight-semibold, 600);
	}

	.quoteandcut-hole-wizard__depth-line .quoteandcut-hole-wizard__hole-meta {
		flex-basis: 100%;
		margin: 0;
	}

	.quoteandcut-hole-wizard__depth {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 8px;
	}

	.quoteandcut-hole-wizard__depth-field input {
		min-height: 44px;
		font-size: 16px;
	}

	.quoteandcut-hole-wizard__depth-step {
		display: inline-flex;
		gap: 8px;
	}

	.quoteandcut-hole-wizard__depth-step .quoteandcut-sp-button {
		width: 44px;
		min-height: 44px;
		padding: 0;
		font-size: 20px;
		line-height: 1;
	}

	.quoteandcut-hole-wizard__depth .quoteandcut-hole-wizard__hole-meta,
	.quoteandcut-hole-wizard__depth .quoteandcut-hole-wizard__depth-note {
		flex-basis: 100%;
	}

	/* The Pick holes button, on the Holes tab. */
	.quoteandcut-sp-stage__pick {
		position: absolute;
		left: 8px;
		bottom: 8px;
		z-index: 4;
		display: inline-flex;
		align-items: center;
		gap: 6px;
		height: 40px;
		padding: 0 12px;
		border: 0;
		border-radius: 10px;
		background: var(--quoteandcut-sp-accent-ink, #ad571f);
		box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
		color: #fff;
		font: inherit;
		font-size: 13px;
		font-weight: var(--quoteandcut-weight-semibold, 600);
	}

	.quoteandcut-sp-stage__pick[hidden],
	.quoteandcut-sp-stage__pickbar[hidden] {
		display: none;
	}

	.quoteandcut-sp-stage__pick .quoteandcut-sp-icon {
		width: 16px;
		height: 16px;
	}

	/* Picking: the drawing takes most of the screen; the tabs and footer step
	   aside and the panel below works as a sheet for the picked holes. */
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-modal__tabbar,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-modal__footer,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__chips,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__legend,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__face,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__views,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__model-bar,
	.quoteandcut-sp-modal.is-picking .quoteandcut-hole-wizard__crumbs,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__mode,
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__tooltip,
	.quoteandcut-sp-modal.is-picking .quoteandcut-hole-wizard__step {
		display: none !important;
	}

	.quoteandcut-sp-modal.is-picking {
		--quoteandcut-sp-stage-h: 46vh;
	}

	/* The zoom bar stays out while picking: a small hole wants zooming in on. */
	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-stage__controls:not([hidden]) {
		display: inline-flex;
	}

	.quoteandcut-sp-stage__pickbar {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		z-index: 5;
		display: flex;
		align-items: center;
		gap: 10px;
		min-height: 52px;
		padding: 6px 8px 6px 14px;
		border-bottom: 1px solid var(--quoteandcut-border-color);
		background: var(--quoteandcut-card-bg, #fff);
	}

	.quoteandcut-sp-stage__pickbar-text {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-width: 0;
		font-size: 12.5px;
		color: var(--quoteandcut-text-secondary);
	}

	.quoteandcut-sp-stage__pickbar-text strong {
		color: var(--quoteandcut-text-primary);
		font-size: 15px;
	}

	.quoteandcut-sp-stage__pickbar-text span {
		line-height: 1.3;
		text-wrap: balance;
	}

	.quoteandcut-sp-stage__pickbar-clear {
		flex: none;
		min-height: 44px;
		padding: 0 6px;
		border: 0;
		background: none;
		color: var(--quoteandcut-text-primary);
		font: inherit;
		font-size: 14px;
		text-decoration: underline;
	}

	.quoteandcut-sp-stage__pickbar .quoteandcut-sp-button {
		flex: none;
		min-width: 76px;
	}

	.quoteandcut-sp-modal.is-picking .quoteandcut-sp-modal__body {
		padding-bottom: env(safe-area-inset-bottom, 0);
	}

	.quoteandcut-sp-modal.is-picking [data-sp-pane] {
		min-height: 42vh;
		border-top: 1px solid var(--quoteandcut-border-color);
		border-radius: 14px 14px 0 0;
		box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.08);
	}
}

/* Short screens: a small phone on its side, or a page the keyboard has shrunk
   (some browsers shrink the page for it). The header, tabs and footer tighten
   and the preview is shorter, to leave the pane some room. */
@media (max-width: 600px) and (max-height: 520px) {

	.quoteandcut-sp-modal,
	.quoteandcut-sp-modal.keeps-preview {
		--quoteandcut-sp-stage-h: clamp(110px, 36vh, 200px);
	}

	.quoteandcut-sp-overlay:not(.is-keyboard) .quoteandcut-sp-modal:not(.is-picking) .quoteandcut-sp-modal__body.has-sizes {
		--quoteandcut-sp-stage-h: clamp(120px, 44vh, 260px);
	}

	/* No room to keep the preview in view for a pane that is worked on it:
	   it scrolls away as on the other tabs (typing still brings it back). */
	.quoteandcut-sp-overlay:not(.is-keyboard) .quoteandcut-sp-modal.keeps-preview:not(.is-picking) .quoteandcut-sp-stage {
		top: calc(var(--quoteandcut-sp-strip-h) - var(--quoteandcut-sp-stage-h));
	}

	.quoteandcut-sp-overlay:not(.is-keyboard) .quoteandcut-sp-modal.keeps-preview:not(.is-picking) .quoteandcut-sp-modal__body {
		scroll-padding-top: calc(var(--quoteandcut-sp-strip-h) + 8px);
	}

	.quoteandcut-sp-modal__header {
		min-height: 46px;
		padding-top: 1px;
		padding-bottom: 1px;
	}

	.quoteandcut-sp-modal__subtitle {
		display: none;
	}

	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab,
	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab.is-active {
		gap: 2px;
		min-height: 44px;
		padding-top: 4px;
		padding-bottom: 2px;
	}

	.quoteandcut-sp-modal__footer {
		padding-top: 6px;
		padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
	}

	.quoteandcut-sp-modal__phone-total span {
		-webkit-line-clamp: 1;
	}

	.quoteandcut-sp-modal__done {
		min-height: 44px;
	}
}

/* Short screens: the model's View menu reaches up to the top row of the
   preview, so that row steps aside while the menu is open. */
@media (max-width: 600px) and (max-height: 659px) {

	.quoteandcut-sp-stage.is-views-open.is-showing-model .quoteandcut-sp-stage__chips,
	.quoteandcut-sp-stage.is-views-open.is-showing-model .quoteandcut-sp-stage__legend {
		visibility: hidden;
	}
}

/* Narrow phones: tighter tabs, so seven names still fit the row, and on the
   narrowest slightly smaller names. */
@media (max-width: 379px) {

	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab,
	.quoteandcut-sp-rail__tabs .quoteandcut-sp-rail__tab.is-active {
		padding-right: 2px;
		padding-left: 2px;
	}
}

@media (max-width: 339px) {

	.quoteandcut-sp-rail__tab-short {
		font-size: 10px;
		letter-spacing: -0.01em;
	}

	/* The seven set views are a little narrower, to fit their row. */
	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__model-bar .quoteandcut-sp-model-bar__button,
	.quoteandcut-sp-modal .quoteandcut-sp-stage .quoteandcut-sp-stage__model-bar.is-compact .quoteandcut-sp-model-bar__button--text {
		width: 38px;
		min-width: 38px;
	}
}

/* Fingers and small screens: what the audit of the phone layout found. */
@media (max-width: 600px) {

	/* Fields: 16px text. iOS zooms the page in on a field with smaller text,
	   and leaves it zoomed. */
	.quoteandcut-sp-modal select,
	.quoteandcut-sp-modal textarea,
	.quoteandcut-sp-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]) {
		font-size: 16px;
	}

	/* Buttons are 44px high in the panes. */
	.quoteandcut-sp-modal .quoteandcut-sp-button,
	.quoteandcut-sp-card__action,
	.quoteandcut-sp-menu__item,
	.quoteandcut-sp-engrave__item {
		min-height: 44px;
	}

	.quoteandcut-sp-card__action {
		padding: 0 14px 0 12px;
	}

	.quoteandcut-sp-menu__item {
		font-size: 14px;
	}

	/* The panes' own sheets (holes, finishing) load after this one, so a
	   rule that changes them names the dialog too, to win. */
	.quoteandcut-sp-modal .quoteandcut-hole-wizard__step-button {
		width: 44px;
		height: 44px;
	}

	.quoteandcut-sp-modal .quoteandcut-hole-wizard__hole-chips {
		gap: 8px;
	}

	.quoteandcut-sp-modal .quoteandcut-hole-wizard__hole-chip {
		min-height: 44px;
		padding-inline: 8px 12px;
	}

	.quoteandcut-sp-engrave__angle {
		height: 44px;
	}

	.quoteandcut-sp-engrave__angle .quoteandcut-sp-engrave__angle-step {
		min-width: 44px;
	}

	.quoteandcut-sp-modal .quoteandcut-sp-engrave__angle .quoteandcut-sp-engrave__angle-input {
		width: 58px;
		font-size: 16px;
	}

	.quoteandcut-sp-dims__check input + span {
		min-height: 40px;
	}

	.quoteandcut-sp-dims__switch button {
		min-height: 36px;
	}

	/* A notice's close button: the same cross, in a box a finger can hit. The
	   margins keep the notice's layout as it was. */
	.quoteandcut-sp-rail__notice-dismiss {
		width: 40px;
		height: 40px;
		margin: -9px -7px -9px -9px;
	}

	/* Text links and small controls keep their look and take a taller tap:
	   an unseen box around each one catches it. */
	.quoteandcut-sp-link,
	.quoteandcut-sp-status__link,
	.quoteandcut-sp-rail__notice-undo,
	.quoteandcut-sp-toggle,
	.quoteandcut-sp-added__more,
	.quoteandcut-sp-dims__clear,
	.quoteandcut-sp-dims__list summary,
	.quoteandcut-sp-stage__mode .quoteandcut-sp-modal__mode-button,
	button.quoteandcut-hole-wizard__crumb,
	.quoteandcut-hole-wizard__depth-link {
		position: relative;
	}

	.quoteandcut-sp-link::after,
	.quoteandcut-sp-status__link::after,
	.quoteandcut-sp-rail__notice-undo::after,
	.quoteandcut-sp-toggle::after,
	.quoteandcut-sp-finishbar__jump::before,
	.quoteandcut-sp-added__more::after,
	.quoteandcut-sp-dims__clear::after,
	.quoteandcut-sp-dims__list summary::after,
	.quoteandcut-sp-stage__mode .quoteandcut-sp-modal__mode-button::after,
	button.quoteandcut-hole-wizard__crumb::after,
	.quoteandcut-hole-wizard__depth-link::after {
		content: "";
		position: absolute;
		inset: -6px 0;
	}

	.quoteandcut-sp-link::after,
	.quoteandcut-sp-dims__list summary::after {
		inset: -14px 0;
	}

	.quoteandcut-sp-status__link::after,
	.quoteandcut-sp-rail__notice-undo::after,
	.quoteandcut-sp-toggle::after {
		inset: -11px 0;
	}

	/* "Finish level needed" on the powder status line: the whole line takes
	   the tap. The line is the box this fills, as the link itself is not
	   positioned. */
	.quoteandcut-sp-finishbar__jump::before {
		inset: 0;
	}

	.quoteandcut-sp-added__more::after {
		inset: -5px;
	}

	.quoteandcut-sp-dims__clear::after {
		inset: -8px;
	}

	.quoteandcut-sp-stage__mode .quoteandcut-sp-modal__mode-button::after {
		inset: -4px 0;
	}

	.quoteandcut-sp-link.quoteandcut-hole-wizard__depth-link::after {
		inset: -6px 0;
	}

	/* The Key opens over the preview's buttons, and scrolls when it has more
	   entries than the short preview has room for. */
	.quoteandcut-sp-stage__legend.is-open {
		z-index: 5;
	}

	.quoteandcut-sp-stage__legend.is-open .quoteandcut-sp-stage__legend-items {
		max-height: calc(var(--quoteandcut-sp-stage-h) - 68px);
		overflow-y: auto;
		background: var(--quoteandcut-card-bg, #fff);
	}

	/* With sizes showing, the drawing needs room for them: the preview is
	   as tall as it was before the phone layout. */
	.quoteandcut-sp-overlay:not(.is-keyboard) .quoteandcut-sp-modal:not(.is-picking) .quoteandcut-sp-modal__body.has-sizes {
		--quoteandcut-sp-stage-h: clamp(220px, 40vh, 340px);
	}

	/* A short pane fills the page, rather than ending in a grey band. */
	.quoteandcut-sp-rail__pane:not([data-sp-active="overview"]) {
		flex: 1 0 auto;
	}

	/* Overview: a row's summary takes two lines before it is cut. */
	.quoteandcut-sp-added__summary {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		white-space: normal;
	}

	/* Finishing: a card's description is not cut short, and a choice's name
	   wraps rather than being cut. */
	.quoteandcut-sp-modal .quoteandcut-sp-fcard__desc {
		display: block;
		-webkit-line-clamp: unset;
	}

	.quoteandcut-sp-modal .quoteandcut-sp-seg__label {
		overflow: visible;
		line-height: 1.2;
		text-align: center;
		text-overflow: clip;
		white-space: normal;
	}

	/* Powder coating: the status line wraps, so the colour's name is whole.
	   The dot stands to the left of both lines. */
	.quoteandcut-sp-finishbar {
		flex-wrap: wrap;
		gap: 2px 10px;
		padding: 8px 16px 8px 42px;
	}

	.quoteandcut-sp-finishbar__dot {
		position: absolute;
		top: 14px;
		left: 16px;
	}

	.quoteandcut-sp-finishbar__sep {
		display: none;
	}

	.quoteandcut-sp-finishbar__name {
		max-width: 100%;
	}
}

/* Narrow phones: the Overview row's badge goes under its text, which
   otherwise has no room. */
@media (max-width: 379px) {

	.quoteandcut-sp-added__row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 4px 6px;
	}

	.quoteandcut-sp-added__item {
		grid-column: 1;
		grid-row: 1;
	}

	.quoteandcut-sp-added__more {
		grid-column: 2;
		grid-row: 1;
	}

	.quoteandcut-sp-added__pill,
	.quoteandcut-sp-added__pill:last-child {
		grid-column: 1 / -1;
		grid-row: 2;
		justify-self: start;
		margin: 0 0 4px 54px;
	}
}

/* A phone on its side (over 600px wide) keeps the landscape layout of
   sp-modal.css. Only its fields change here: 16px text, so that iOS does not
   zoom the page in on them. */
@media (min-width: 601px) and (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {

	.quoteandcut-sp-modal select,
	.quoteandcut-sp-modal textarea,
	.quoteandcut-sp-modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]),
	.quoteandcut-sp-modal .quoteandcut-sp-engrave__angle .quoteandcut-sp-engrave__angle-input {
		font-size: 16px;
	}

	.quoteandcut-sp-modal .quoteandcut-sp-engrave__angle .quoteandcut-sp-engrave__angle-input {
		width: 58px;
	}
}

@media (max-width: 600px) and (prefers-reduced-motion: reduce) {

	.quoteandcut-sp-stage__strip,
	.quoteandcut-sp-modal.is-stage-away .quoteandcut-sp-stage__strip {
		transition: none;
	}
}
