/**
 * MK Sell Device — front end styles.
 *
 * Mobile first. The grids collapse to two columns, the step chips scroll
 * horizontally, and the primary action sticks to the bottom of the viewport on
 * small screens so it is always reachable with a thumb.
 */

.mksd-form {
	--mksd-primary: #1f3fa0;
	--mksd-accent: #e02b20;
	--mksd-complete: #1aa34a;
	--mksd-text: #333;
	--mksd-cols: 4;
	--mksd-border: #e2e5ea;
	--mksd-muted: #6b7280;
	--mksd-radius: 6px;

	box-sizing: border-box;
	max-width: 1180px;
	margin: 0 auto;
	padding: 10px;
	background: var(--mksd-primary);
	color: var(--mksd-text);
	font-size: 16px;
	line-height: 1.5;
}

.mksd-form *,
.mksd-form *::before,
.mksd-form *::after {
	box-sizing: inherit;
}

.mksd-form .mksd-config {
	display: none;
}

/* --- Progress chips ----------------------------------------------------- */

.mksd-steps {
	display: flex;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0 0 8px;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.mksd-step {
	flex: 1 0 auto;
	min-width: 120px;
	margin: 0;
}

.mksd-step-btn {
	display: block;
	width: 100%;
	height: 100%;
	padding: 12px 10px;
	border: 0;
	border-radius: 4px;
	background: #e6e8eb;
	color: #1a1a1a;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	cursor: default;
	font-family: inherit;
}

.mksd-step-num {
	margin-right: 2px;
}

.mksd-step.is-done .mksd-step-btn {
	background: var(--mksd-complete);
	color: #fff;
	cursor: pointer;
}

.mksd-step.is-done .mksd-step-btn:hover,
.mksd-step.is-done .mksd-step-btn:focus-visible {
	filter: brightness(0.92);
}

.mksd-step.is-current .mksd-step-btn {
	background: var(--mksd-accent);
	color: #fff;
}

/* --- Panel -------------------------------------------------------------- */

.mksd-crumb,
.mksd-body {
	background: #fff;
}

.mksd-crumb {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--mksd-border);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mksd-muted);
}

.mksd-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #2ea3d6;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.mksd-back:hover,
.mksd-back:focus-visible {
	background: #eef7fb;
}

.mksd-body {
	min-height: 240px;
	padding: 24px 16px 32px;
}

.mksd-loading {
	padding: 48px 0;
	text-align: center;
	color: var(--mksd-muted);
}

.mksd-noscript {
	margin: 0;
	padding: 20px;
	background: #fff;
	color: #b32d2e;
}

/* --- Headings ----------------------------------------------------------- */

.mksd-heading {
	margin: 0 0 24px;
	font-size: 26px;
	font-weight: 400;
	line-height: 1.25;
	text-align: center;
	color: #444;
}

.mksd-heading em {
	font-style: normal;
	color: var(--mksd-accent);
}

/* --- Choice grids ------------------------------------------------------- */

.mksd-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	background: var(--mksd-border);
	border: 1px solid var(--mksd-border);
}

.mksd-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 120px;
	padding: 18px 12px;
	border: 0;
	background: #fff;
	color: #2b6cb0;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	transition: box-shadow 0.12s ease, transform 0.12s ease;
}

.mksd-tile:hover,
.mksd-tile:focus-visible {
	box-shadow: inset 0 0 0 2px var(--mksd-primary);
	outline: none;
}

.mksd-tile.is-selected {
	box-shadow: inset 0 0 0 2px var(--mksd-accent);
}

.mksd-tile-icon {
	font-size: 34px;
	line-height: 1;
}

.mksd-tile-img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	flex-shrink: 0;
}

.mksd-tile-name {
	font-weight: 600;
	word-break: break-word;
}

/* --- Search and pagination ---------------------------------------------- */

.mksd-search-row {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.mksd-search-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 11px 14px;
	border: 1px solid var(--mksd-border);
	border-radius: var(--mksd-radius);
	font-size: 16px;
	font-family: inherit;
	color: var(--mksd-text);
	background: #fff;
}

.mksd-search-input:focus {
	outline: 2px solid var(--mksd-primary);
	outline-offset: -1px;
}

.mksd-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 18px;
}

.mksd-pager-info {
	color: var(--mksd-muted);
	font-size: 14px;
}

/* --- Buttons ------------------------------------------------------------ */

.mksd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	border: 0;
	border-radius: 4px;
	background: #111;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
}

.mksd-btn:hover:not(:disabled),
.mksd-btn:focus-visible:not(:disabled) {
	filter: brightness(1.25);
}

.mksd-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.mksd-btn-secondary {
	background: #fff;
	color: var(--mksd-primary);
	border: 1px solid var(--mksd-border);
	text-transform: none;
	font-weight: 600;
}

.mksd-btn-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--mksd-primary);
	font-family: inherit;
	font-size: 15px;
	text-decoration: underline;
	cursor: pointer;
}

.mksd-actions {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.mksd-actions .mksd-btn {
	width: 100%;
}

/* --- Condition step ----------------------------------------------------- */

.mksd-condition {
	display: grid;
	gap: 24px;
}

.mksd-issue-prompt {
	margin: 0 0 6px;
	font-size: 15px;
	color: #2b6cb0;
}

.mksd-textarea,
.mksd-input,
.mksd-select {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--mksd-border);
	border-radius: var(--mksd-radius);
	background: #fff;
	color: var(--mksd-text);
	font-family: inherit;
	font-size: 16px;
}

.mksd-textarea {
	min-height: 84px;
	resize: vertical;
}

.mksd-input:focus,
.mksd-textarea:focus,
.mksd-select:focus {
	outline: 2px solid var(--mksd-primary);
	outline-offset: -1px;
}

.mksd-subhead {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 22px 0 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--mksd-border);
	font-size: 16px;
	font-weight: 700;
}

.mksd-check-list {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	border: 0;
}

.mksd-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 6px;
	border-radius: 4px;
	cursor: pointer;
}

.mksd-check:hover {
	background: #f7f8fa;
}

.mksd-check input {
	margin: 3px 0 0;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	accent-color: var(--mksd-primary);
}

.mksd-check-text {
	flex: 1 1 auto;
}

.mksd-check-desc {
	display: block;
	color: var(--mksd-muted);
	font-size: 13px;
}

.mksd-question {
	margin-bottom: 18px;
}

.mksd-question-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

.mksd-question-help {
	display: block;
	margin-bottom: 8px;
	color: var(--mksd-muted);
	font-size: 13px;
	font-weight: 400;
}

.mksd-req {
	color: var(--mksd-accent);
}

.mksd-radio-row {
	display: grid;
	gap: 2px;
}

/* --- Summary panel ------------------------------------------------------ */

.mksd-summary {
	padding: 18px 20px;
	background: #f7f8fa;
	border: 1px solid var(--mksd-border);
	border-radius: var(--mksd-radius);
}

.mksd-summary h3 {
	margin: 0 0 12px;
	font-size: 16px;
	color: var(--mksd-accent);
	text-align: center;
}

.mksd-summary-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mksd-summary-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--mksd-border);
	font-size: 15px;
}

.mksd-summary-list li:last-child {
	border-bottom: 0;
}

.mksd-summary-key {
	display: block;
	color: var(--mksd-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* --- Calendar ----------------------------------------------------------- */

.mksd-datetime {
	display: grid;
	gap: 24px;
}

.mksd-calendar {
	border: 1px solid var(--mksd-border);
	border-radius: var(--mksd-radius);
	overflow: hidden;
}

.mksd-cal-selected {
	padding: 14px;
	background: #1fa8dc;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	text-align: center;
}

.mksd-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--mksd-border);
}

.mksd-cal-title {
	font-weight: 700;
}

.mksd-cal-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: #eceff3;
	color: #444;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.mksd-cal-arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.mksd-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
}

.mksd-cal-dow {
	padding: 10px 0;
	background: #f7f8fa;
	color: var(--mksd-muted);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

.mksd-cal-day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-top: 1px solid var(--mksd-border);
	border-right: 1px solid var(--mksd-border);
	background: #fff;
	color: var(--mksd-text);
	font-family: inherit;
	font-size: 15px;
	cursor: pointer;
}

.mksd-cal-day:nth-child(7n + 7) {
	border-right: 0;
}

.mksd-cal-day.is-empty {
	background: #fbfbfc;
	cursor: default;
}

.mksd-cal-day:disabled {
	color: #c3c7cd;
	background: #fbfbfc;
	cursor: not-allowed;
}

.mksd-cal-day.is-open:hover,
.mksd-cal-day.is-open:focus-visible {
	background: #eef7fb;
}

.mksd-cal-day.is-selected {
	background: #1fa8dc;
	color: #fff;
	font-weight: 700;
	box-shadow: inset 0 0 0 2px #0d5f7d;
}

/* --- Slots -------------------------------------------------------------- */

.mksd-slots h3 {
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--mksd-border);
	font-size: 17px;
	text-align: center;
}

.mksd-slot-list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mksd-slot {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 16px;
	border: 1px solid var(--mksd-border);
	border-radius: var(--mksd-radius);
	cursor: pointer;
}

.mksd-slot:hover {
	border-color: var(--mksd-primary);
}

.mksd-slot input {
	width: 18px;
	height: 18px;
	accent-color: var(--mksd-primary);
}

.mksd-slot.is-selected {
	border-color: var(--mksd-primary);
	background: #f2f6ff;
}

.mksd-empty-note {
	padding: 24px 12px;
	color: var(--mksd-muted);
	text-align: center;
}

/* --- Details form ------------------------------------------------------- */

.mksd-fields {
	display: grid;
	gap: 16px;
	max-width: 760px;
	margin: 0 auto;
}

.mksd-field {
	display: grid;
	gap: 6px;
}

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

.mksd-field-inline {
	display: flex;
	gap: 8px;
}

.mksd-field-inline .mksd-select {
	flex: 0 0 110px;
	width: auto;
}

.mksd-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 4px;
	font-size: 15px;
}

.mksd-consent input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	accent-color: var(--mksd-primary);
}

.mksd-error {
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid #f3c6c4;
	border-radius: var(--mksd-radius);
	background: #fdf2f2;
	color: #b32d2e;
	font-size: 15px;
}

.mksd-field-error {
	color: #b32d2e;
	font-size: 13px;
}

.mksd-input.has-error,
.mksd-textarea.has-error,
.mksd-select.has-error {
	border-color: #b32d2e;
}

/* --- Confirmation ------------------------------------------------------- */

.mksd-done {
	max-width: 640px;
	margin: 0 auto;
	padding: 20px 0 8px;
	text-align: center;
}

.mksd-done-tick {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--mksd-complete);
	color: #fff;
	font-size: 34px;
	line-height: 1;
}

.mksd-done h2 {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 400;
}

.mksd-ref {
	display: inline-block;
	margin: 18px 0;
	padding: 14px 26px;
	border: 1px dashed var(--mksd-border);
	border-radius: var(--mksd-radius);
	background: #f7f8fa;
}

.mksd-ref-label {
	display: block;
	color: var(--mksd-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.mksd-ref-value {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.06em;
}

.mksd-done-notes {
	margin-top: 20px;
	padding: 14px 18px;
	border: 1px solid #fde68a;
	border-radius: var(--mksd-radius);
	background: #fffbeb;
	color: #78350f;
	font-size: 14px;
	text-align: left;
}

.mksd-done-notes strong {
	display: block;
	margin-bottom: 4px;
	color: #92400e;
}

/* --- Honeypot ----------------------------------------------------------- */

.mksd-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* --- Screen reader only ------------------------------------------------- */

.mksd-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Larger screens ----------------------------------------------------- */

@media (min-width: 640px) {

	.mksd-form {
		padding: 14px;
	}

	.mksd-body {
		padding: 32px 28px 40px;
	}

	.mksd-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.mksd-tile-img {
		width: 72px;
		height: 72px;
	}

	.mksd-heading {
		font-size: 32px;
	}

	.mksd-actions .mksd-btn {
		width: auto;
		min-width: 240px;
	}

	.mksd-check-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mksd-radio-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {

	.mksd-grid {
		grid-template-columns: repeat(var(--mksd-cols), minmax(0, 1fr));
	}

	.mksd-tile-img {
        width: 110px;
        height: auto !important;
        object-fit: contain !important;
	}

	.mksd-condition {
		grid-template-columns: 1.35fr 1fr;
		align-items: start;
	}

	.mksd-datetime {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}

	.mksd-fields {
		gap: 14px;
	}

	.mksd-field {
		grid-template-columns: 200px 1fr;
		align-items: center;
		gap: 16px;
	}

	.mksd-field-label {
		text-align: right;
		font-weight: 400;
	}

	.mksd-field-full {
		grid-template-columns: 1fr;
	}

	.mksd-field-error,
	.mksd-consent {
		grid-column: 1 / -1;
	}
}

/* Respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {

	.mksd-tile {
		transition: none;
	}
}
