/*
 * Repair Wizard — structure only ("My theme" mode in Appearance).
 *
 * No colours, fonts, borders or shadows: just what the script needs to work (hidden state,
 * stacked step panels, honeypot, grids). Everything is wrapped in :where() so specificity is
 * zero and any theme rule wins; buttons, inputs and headings inherit from the theme.
 */

:where(.rw-wizard) {
	--rw-gap: 1rem;
	--rw-cols: 3;
	--rw-step-duration: 280ms;
	--rw-shift: 2rem;
	position: relative;
}

:where(.rw-wizard *, .rw-wizard *::before, .rw-wizard *::after) { box-sizing: border-box; }
:where(.rw-wizard [hidden]) { display: none !important; }
:where(.rw-wizard__live) {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:where(.rw-wizard__top) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: var(--rw-gap); }
:where(.rw-progress) { flex: 1 1 12rem; }
:where(.rw-progress__label) { margin: 0 0 .25rem; }
:where(.rw-progress__bar) { display: block; height: .4rem; overflow: hidden; background: rgb(128 128 128 / .25); }
:where(.rw-progress__fill) { display: block; width: var(--rw-progress, 0%); height: 100%; background: currentColor; transition: width var(--rw-step-duration) ease; }
:where(.rw-wizard__assist) { display: flex; margin-left: auto; }
:where(.rw-wizard__crumbs) { margin-bottom: var(--rw-gap); }
:where(.rw-crumbs) { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
:where(.rw-crumbs__btn, .rw-btn) { cursor: pointer; font: inherit; }
:where(.rw-panel__title) { margin-top: 0; }
:where(.rw-panel__title:focus) { outline: none; }
:where(.rw-panel__title--hidden) {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:where(.rw-panel__nav) { margin-top: var(--rw-gap); }

/* Steps stack in one cell so entering and leaving panels overlap during the swap. */
:where(.rw-wizard__viewport) { display: grid; overflow-x: clip; }
:where(.rw-wizard__viewport > .rw-panel) { grid-area: 1 / 1; min-width: 0; }

:where(.rw-panel) { transition: opacity var(--rw-step-duration) ease, transform var(--rw-step-duration) ease; }
:where(.rw-panel--leave) { opacity: 0; pointer-events: none; }
:where(.rw-panel--leave.rw-panel--forward) { transform: translateX(calc(var(--rw-shift) * -1)); }
:where(.rw-panel--leave.rw-panel--back) { transform: translateX(var(--rw-shift)); }
:where(.rw-panel--enter) { opacity: 0; }
:where(.rw-panel--enter.rw-panel--forward) { transform: translateX(var(--rw-shift)); }
:where(.rw-panel--enter.rw-panel--back) { transform: translateX(calc(var(--rw-shift) * -1)); }

@media (prefers-reduced-motion: reduce) {
	:where(.rw-wizard) { --rw-step-duration: 0ms; }
}

/* Steps 1-3: grid of boxes. */
:where(.rw-grid) {
	display: grid;
	grid-template-columns: repeat(var(--rw-cols), minmax(0, 1fr));
	gap: var(--rw-gap);
	margin: 0; padding: 0; list-style: none;
}
:where(.rw-item) {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: .5rem; width: 100%; height: 100%; cursor: pointer; text-align: center;
}
:where(.rw-item__media) { display: block; width: 100%; aspect-ratio: 4 / 3; }
:where(.rw-item__img) { width: 100%; height: 100%; object-fit: var(--rw-img-fit, contain); }

/* Step 4: text list. */
:where(.rw-list) { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
:where(.rw-service) { display: grid; gap: .25rem; width: 100%; cursor: pointer; text-align: left; }
:where(.rw-service__title) { font-weight: 600; }
:where(.rw-service__media) { display: block; width: 4.5rem; aspect-ratio: 1; overflow: hidden; }
:where(.rw-service__img) { display: block; width: 100%; height: 100%; object-fit: var(--rw-img-fit, contain); }

/* Step 5. */
:where(.rw-final) { display: grid; gap: var(--rw-gap); }
:where(.rw-summary) { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
:where(.rw-summary__row) { display: contents; }
:where(.rw-summary__label) { font-weight: 600; }
:where(.rw-summary__value) { margin: 0; }
:where(.rw-brief__image) { max-width: 100%; height: auto; }
:where(.rw-form) { display: grid; gap: .75rem; }
:where(.rw-field) { display: grid; gap: .25rem; margin: 0; }
:where(.rw-field__input) { width: 100%; font: inherit; }
:where(.rw-field--trap) { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
:where(.rw-form__status:empty, .rw-form__captcha:empty) { display: none; }
:where(.rw-form__status--error, .rw-field__error) { color: #b32d2e; }
:where(.rw-form__status--ok) { color: #1a7f37; }
:where(.rw-field--error .rw-field__input) { border-color: #b32d2e; }
/* Chosen photos: list of thumbnails + drop highlight. Structure only; the look is the theme's. */
:where(.rw-photos) { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
:where(.rw-photos__item) { display: flex; align-items: center; gap: .6rem; max-width: 100%; }
:where(.rw-photos__img) { flex: none; width: 2.75rem; height: 2.75rem; object-fit: cover; }
:where(.rw-photos__name) { overflow: hidden; max-width: 11rem; white-space: nowrap; text-overflow: ellipsis; }
:where(.rw-photos__item--error) { outline: 1px solid #b32d2e; }
:where(.rw-form--dragover) { outline: 2px dashed currentColor; outline-offset: .5rem; }

:where(.rw-success) { display: grid; gap: .75rem; }
:where(.rw-success__text, .rw-success__ref, .rw-success__actions) { margin: 0; }

@media (max-width: 720px) {
	:where(.rw-wizard) { --rw-cols: 2; }
}
@media (max-width: 420px) {
	:where(.rw-wizard) { --rw-cols: 1; }
}

/* Option search: filtered-out boxes/rows must disappear whatever display the theme gives them. */
.rw-grid__cell[hidden], .rw-list__row[hidden], .rw-filter__none[hidden] { display: none !important; }
:where(.rw-search) { margin: 0 0 var(--rw-gap); }
:where(.rw-search__input) { width: 100%; box-sizing: border-box; }
