/* ============================================================
   Tufwud Door Selector — guided spec finder
   Scoped under .tds.

   Same design system as the hero above it and the compliance
   library: warm #f6f4f0 ground, white cards floating on it with
   a soft shadow rather than a hard border, Playfair for headings
   and numerals ONLY, Inter for everything else, orange accent on
   navy ink, inline SVG. No monospace anywhere.

   TWO RULES IF YOU EDIT THIS FILE

   1. Never write `.tds p { ... }`. That is specificity 0,1,1 and
      it outranks every BEM class at 0,1,0 — layout rules then
      stop applying with no error anywhere and no obvious cause.
      Resets live in :where(), which is 0,0,0.

   2. Buttons, inputs and selects are written `.tds .tds-thing`
      (0,2,0), not `.tds-thing` (0,1,0). Themes and Elementor ship
      rules like `.elementor button` and `.site input[type=text]`
      at 0,1,1 and 0,2,0, and those beat a single class. That is
      how a styled button ends up SHOUTING IN CAPS on a live site
      and how an icon ends up sitting on top of placeholder text.
      Keep the double class on anything interactive.
   ============================================================ */

:where(.tds, .tds *) { box-sizing: border-box; }

:where(.tds p, .tds h2, .tds h3, .tds ul, .tds ol, .tds li) { margin: 0; padding: 0; }
:where(.tds ul, .tds ol) { list-style: none; }
:where(.tds input, .tds button, .tds textarea, .tds select) { font-family: inherit; }

.tds {
	/* ── Adjust these ── */
	--tds-max:      1180px;   /* the panel is a WORKSPACE, not a page-
	                             wide grid — see the note on .tds-panel */
	--tds-radius:   18px;
	--tds-radius-s: 12px;

	/* ── Palette ── */
	--tds-ground:  #f6f4f0;
	--tds-card:    #ffffff;
	--tds-sunk:    #f4f2ee;
	--tds-chip:    #f1f2f4;
	--tds-navy:    #12263f;
	--tds-ink:     #17181a;
	--tds-text:    #33475f;
	--tds-muted:   #6a7c92;
	--tds-soft:    #93a2b5;
	--tds-line:    rgba(20, 41, 63, 0.10);
	--tds-line-2:  rgba(20, 41, 63, 0.06);

	--tds-accent:   #d4581e;
	--tds-accent-2: #e86526;
	--tds-accent-w: rgba(212, 88, 30, 0.08);

	--tds-shadow:   0 1px 2px rgba(18, 38, 63, 0.04), 0 10px 30px -14px rgba(18, 38, 63, 0.18);
	--tds-shadow-2: 0 2px 4px rgba(18, 38, 63, 0.05), 0 24px 48px -20px rgba(18, 38, 63, 0.28);

	--tds-serif: "Playfair Display", "Instrument Serif", "Libre Baskerville", Georgia, serif;
	--tds-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	position: relative;
	background: var(--tds-ground);
	font-family: var(--tds-sans);
	font-size: 16px;
	line-height: 1.6;
	color: var(--tds-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ── Numerals in the serif face ───────────────────────
   Playfair Display's default figures are OLD-STYLE. Measured at
   100px/700: cap height 71, x-height 53, and every digit 52-53 —
   the numbers sit at x-height, not cap height, and the 4 drops 16
   below the baseline.

   That is the whole bug. It is NOT a missing font falling back to
   Georgia; Playfair loads fine and Playfair is the culprit. Every
   serif thing here carrying a number was hit: the rating plate
   rendered 120 as three small mismatched shapes, the quantity
   numerals did the same to 11-50, and the product code FD120ID
   came out reading as FD12oID. Small, uneven, half-sunk — it looks
   like a broken font rather than a number.

   Playfair ships an `lnum` set, so asking for lining figures fixes
   it at the source (verified: it changes the rendered advance
   width, so the feature really is applied and not silently
   ignored). One rule rather than a patch at each of the four
   sites, because they fail for one reason.

   A face with no `lnum` ignores this and is unharmed, so it stays
   correct if the stack ever changes. Change --tds-serif above and
   this is the line that keeps the numbers honest. ─────────── */
.tds-q,
.tds-plate b,
.tds-numeral,
.tds-card__t,
.tds-lead__t,
.tds-done__t {
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1;
}

/* These two show one figure per card across a row of cards, so they
   also ask for equal digit widths, to keep 11-50 and 51-200 sitting
   the same in adjacent tiles. On Playfair this is a no-op — its
   lining set is already tabular — but it costs nothing and holds
   the row steady if the serif is ever swapped for a face whose
   figures are proportional. Titles are left alone: tabular spacing
   in running text is worse, not better. */
.tds-plate b,
.tds-numeral {
	font-variant-numeric: lining-nums tabular-nums;
	font-feature-settings: "lnum" 1, "tnum" 1;
}

.tds__in {
	max-width: var(--tds-max);
	margin-inline: auto;
	padding: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem) clamp(2.5rem, 5vw, 4rem);
}

/* 1180px, not the 1500px the hero and library use.
   Those are display surfaces you scan; this is a form you work
   through, and a question with four options stretched over 1500px
   makes the eye travel for no reason. Narrower reads as focused. */
.tds-panel {
	background: var(--tds-card);
	border: 1px solid var(--tds-line-2);
	border-radius: var(--tds-radius);
	box-shadow: var(--tds-shadow);
	overflow: hidden;
}

.tds-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Casing and shadows reclaimed from the theme. 0,2,0 — see rule 2. */
.tds .tds-btn,
.tds .tds-restart__b {
	text-transform: none;
	letter-spacing: normal;
	font-family: var(--tds-sans);
	text-shadow: none;
	min-height: 0;
	width: auto;
}

/* ── Progress rail ──────────────────────────────────────────
   Four labelled steps, not four anonymous dashes. Somebody two
   questions in wants to know what is still coming.

   Each step carries an icon badge, and the badge is what does the
   work: an outline while the step is ahead of you, solid orange
   while you are on it, and a tick once it is behind you. Four
   text labels with hairlines under them had nothing for the eye
   to land on. ─────────────────────────────────────────────── */

.tds-rail {
	padding: clamp(1.1rem, 2vw, 1.5rem) clamp(1.1rem, 2.6vw, 2.25rem) 0;
	background: var(--tds-card);
	border-bottom: 1px solid var(--tds-line-2);
}

.tds-rail__steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(0.5rem, 1.4vw, 1.1rem);
}

.tds-rail__step {
	display: grid;
	grid-template-columns: auto auto minmax(0, 1fr);
	align-items: center;
	gap: 0 0.45rem;
	padding-bottom: 0.9rem;
	position: relative;
}

/* The badge ------------------------------------------------- */

.tds-rail__ico {
	position: relative;
	width: 2.1rem;
	height: 2.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--tds-line);
	border-radius: 50%;
	background: var(--tds-card);
	color: var(--tds-soft);
	flex: none;
	transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease;
}

.tds-rail__ico svg { width: 1.05rem; height: 1.05rem; }

/* Both glyphs live in the badge; only one is ever shown. */
.tds-rail__ico-i,
.tds-rail__ico-d { display: flex; }
.tds-rail__ico-d { display: none; }

/* Current: solid orange, white icon. */
.tds-rail__step.is-on .tds-rail__ico {
	background: var(--tds-accent);
	border-color: var(--tds-accent);
	color: #fff;
	box-shadow: 0 6px 16px -8px rgba(212, 88, 30, 0.9);
}

/* Done: tinted, orange tick. Quieter than the current step, so the
   eye still lands on where you are rather than where you have been. */
.tds-rail__step.is-done .tds-rail__ico {
	background: var(--tds-accent-w);
	border-color: rgba(212, 88, 30, 0.4);
	color: var(--tds-accent);
}

.tds-rail__step.is-done .tds-rail__ico-i { display: none; }
.tds-rail__step.is-done .tds-rail__ico-d { display: flex; }
.tds-rail__step.is-done .tds-rail__ico svg { width: 0.85rem; height: 0.85rem; }

/* Type ------------------------------------------------------ */

/* Sans, not serif, and the same size and weight as the label beside
   it. Playfair at 13px next to Inter-bold at 13px does not read as a
   numeral device, it reads as the wrong font. The two are one unit —
   "01 Building" — so only colour should separate them. */
.tds-rail__n {
	font-family: var(--tds-sans);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	color: var(--tds-soft);
	font-variant-numeric: tabular-nums;
	transition: color 0.22s ease;
}

.tds-rail__l {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.2;
	color: var(--tds-soft);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.22s ease;
}

/* The bar is the progress indicator: a 2px track that fills. */
.tds-rail__bar {
	grid-column: 1 / -1;
	height: 2px;
	margin-top: 0.7rem;
	border-radius: 2px;
	background: var(--tds-line);
	overflow: hidden;
	position: relative;
}

.tds-rail__bar::after {
	content: "";
	position: absolute;
	inset: 0 100% 0 0;
	background: var(--tds-accent);
	transition: inset-inline-end 0.4s cubic-bezier(0.22, 0.7, 0.3, 1);
}

.tds-rail__step.is-done .tds-rail__bar::after,
.tds-rail__step.is-on .tds-rail__bar::after { inset-inline-end: 0; }

.tds-rail__step.is-done .tds-rail__bar::after { background: rgba(212, 88, 30, 0.45); }

.tds-rail__step.is-on .tds-rail__n,
.tds-rail__step.is-on .tds-rail__l { color: var(--tds-accent); }

.tds-rail__step.is-done .tds-rail__n,
.tds-rail__step.is-done .tds-rail__l { color: var(--tds-navy); }

/* ── Body ───────────────────────────────────────────────────── */

.tds-body { padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.1rem, 2.6vw, 2.25rem); }

.tds-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--tds-accent);
	margin-bottom: 0.85rem;
}

.tds-eyebrow i {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--tds-accent);
	flex: none;
}

.tds-step[hidden] { display: none; }
.tds-step.is-active { animation: tds-in 0.32s cubic-bezier(0.22, 0.7, 0.3, 1) both; }

@keyframes tds-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

/* The question. Serif, because it is the one thing on screen the
   visitor has to read before acting. */
.tds-q {
	font-family: var(--tds-serif);
	font-weight: 700;
	font-size: clamp(1.375rem, 2.6vw, 2rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--tds-navy);
	margin-bottom: 0.5rem;
	outline: none;
}

.tds-q:focus-visible {
	outline: 2px solid var(--tds-accent);
	outline-offset: 5px;
	border-radius: 4px;
}

.tds-hint {
	font-size: 0.9375rem;
	line-height: 1.62;
	color: var(--tds-muted);
	max-width: 44rem;
	margin-bottom: clamp(1.35rem, 2.6vw, 2rem);
}

/* ── Options ────────────────────────────────────────────────── */

.tds-opts {
	display: grid;
	gap: clamp(0.7rem, 1.4vw, 1rem);
}

/* Photo cards for building types — the widest grid, because the
   image is doing the work and needs room to be recognisable. */
.tds-opts--image  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tds-opts--plate  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tds-opts--icon   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tds-opts--numeral { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tds-opt { display: block; cursor: pointer; height: 100%; }

/* Visually hidden but focusable and clickable — the label wraps it,
   so keyboard focus lands on a real control and :checked drives the
   card. `display:none` would break both. */
.tds-opt input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	margin: 0;
	pointer-events: none;
}

.tds-opt__card {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--tds-card);
	border: 1px solid var(--tds-line);
	border-radius: var(--tds-radius-s);
	overflow: hidden;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.tds-opt:hover .tds-opt__card {
	border-color: rgba(20, 41, 63, 0.2);
	box-shadow: var(--tds-shadow);
	transform: translateY(-2px);
}

.tds-opt input:checked + .tds-opt__card {
	border-color: var(--tds-accent);
	background: var(--tds-accent-w);
	box-shadow: 0 0 0 1px var(--tds-accent), 0 16px 34px -20px rgba(212, 88, 30, 0.5);
}

.tds-opt input:focus-visible + .tds-opt__card {
	outline: 2px solid var(--tds-accent);
	outline-offset: 3px;
}

/* Media ------------------------------------------------------- */

.tds-opt__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--tds-sunk);
	overflow: hidden;
}

/* WHY THIS IS `.tds .tds-opt__media img` AND NOT `.tds-opt__media img`
   It was the shorter one, at 0,1,1 — and Elementor ships
   `.elementor img { height: auto; }` at exactly the same 0,1,1. Equal
   specificity means whichever stylesheet loads last wins, and on the
   live page theirs did. `height: auto` put the image back on its own
   proportions, object-fit then had a box that already matched the
   image, so it had nothing to crop: a short photo left a grey band
   under it and a tall one left one beside it, while the next card over
   filled edge to edge. That is the ragged grid, and it is the same
   theme-bleed this file guards against for buttons and inputs.

   `position: absolute; inset: 0` on top of the 0,2,0 selector: the
   tile's height comes from `aspect-ratio`, and a percentage height
   resolved against an aspect-ratio-derived height is exactly the sort
   of thing engines have disagreed about. Pinning to all four edges
   does not ask the question. */
.tds .tds-opt__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* Options → Card images → "Fit the whole image inside the card".

   Cropping off: the whole picture is visible and the tile's own ground
   shows around it. The padding keeps it off the edges so the letterbox
   reads as deliberate rather than as a mistake, and `contain` keeps the
   image's aspect ratio whatever the tile is doing.

   Same 0,2,0 as the rule above, so it is not fighting it on specificity
   — it wins on being later, which is what a modifier should do. */
.tds.tds--fit-contain .tds-opt__media img {
	object-fit: contain;
	padding: 0.55rem;
}

.tds-opt:hover .tds-opt__media img { transform: scale(1.04); }

.tds-opt__ph {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tds-soft);
	opacity: 0.45;
}

.tds-opt__ph svg { width: 2.25rem; height: 2.25rem; }

.tds-opt__lead {
	display: flex;
	align-items: center;
	padding: clamp(0.9rem, 1.8vw, 1.2rem) clamp(0.9rem, 1.8vw, 1.2rem) 0;
}

.tds-opt__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 10px;
	background: var(--tds-chip);
	color: var(--tds-navy);
	flex: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.tds-opt__icon svg { width: 1.4rem; height: 1.4rem; }

.tds-opt input:checked + .tds-opt__card .tds-opt__icon {
	background: var(--tds-accent);
	color: #fff;
}

/* The rating device. Serif numeral over a letterspaced unit — the
   one place numerals are allowed to be the loudest thing. */
.tds-plate {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 4.25rem;
	padding: 0.5rem 0.7rem 0.45rem;
	border-radius: 10px;
	background: var(--tds-navy);
	flex: none;
}

.tds-plate b {
	font-family: var(--tds-serif);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	letter-spacing: -0.01em;
}

.tds-plate span {
	font-size: 0.5625rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	line-height: 1;
	margin-top: 0.3rem;
	color: rgba(255, 255, 255, 0.62);
}

.tds-opt input:checked + .tds-opt__card .tds-plate { background: var(--tds-accent); }

.tds-numeral {
	font-family: var(--tds-serif);
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--tds-navy);
}

.tds-opt input:checked + .tds-opt__card .tds-numeral { color: var(--tds-accent); }

/* Text -------------------------------------------------------- */

.tds-opt__text {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: clamp(0.8rem, 1.6vw, 1.05rem) clamp(0.9rem, 1.8vw, 1.2rem);
	/* Room for the tick, which is absolutely positioned top right. */
	padding-inline-end: 2.9rem;
}

.tds-opt__t {
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tds-navy);
}

.tds-opt__s {
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--tds-muted);
}

.tds-opt__isi {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	margin-top: 0.35rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tds-accent);
}

.tds-opt__isi svg { width: 0.85rem; height: 0.85rem; flex: none; }

/* The select affordance -------------------------------------- */

.tds-opt__pick {
	position: absolute;
	top: 0.7rem;
	right: 0.7rem;
	width: 1.5rem;
	height: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid var(--tds-line);
	border-radius: 50%;
	background: var(--tds-card);
	color: transparent;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

/* Square for multi-select, round for single. The shape is the only
   cue telling someone they may pick more than one, so it has to be
   right — a round radio-looking control on step 3 is why nobody
   found multi-select on the compliance grid. */
.tds-opt__pick--box { border-radius: 6px; }

.tds-opt__pick svg { width: 0.85rem; height: 0.85rem; }

.tds-opt:hover .tds-opt__pick { border-color: var(--tds-soft); }

.tds-opt input:checked + .tds-opt__card .tds-opt__pick {
	background: var(--tds-accent);
	border-color: var(--tds-accent);
	color: #fff;
}

/* On photo cards the tick sits over the image, so it needs its own
   ground to stay visible against any photograph. */
.tds-opts--image .tds-opt__pick {
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 3px 10px -3px rgba(18, 38, 63, 0.4);
}

/* ── Navigation ─────────────────────────────────────────────── */

/* ── THE BUTTONS SIT IN RESERVED COLUMNS. DO NOT MAKE THIS FLEX.
   ──────────────────────────────────────────────────────────────
   This was `display: flex` with the hint as a `flex: 1` spacer
   between Back and Next, and the spacer is what pushed Next to
   the right edge. That works only for as long as the hint has a
   box, and the hint's whole job is to disappear:

     · syncNav() empties it the moment a step is answered
     · the 760px block below used to `display: none` it outright
     · plenty of themes ship `p:empty { display: none }` to mop up
       wpautop's stray paragraphs, which deletes the box at ANY
       width without touching our stylesheet

   Any one of those removes the spacer, the flex line collapses to
   flex-start, and Next jumps from the right edge to the left —
   on every step, every time somebody picks an option. A primary
   action that moves the instant you engage with the page is a
   Fitts's-law problem before it is an aesthetic one: the target
   is somewhere else by the time you go to click it.

   Grid with EXPLICIT column placement fixes it at the cause. Each
   control owns a column and stays in it. `display: none` on the
   hint, or on Back, leaves that column empty instead of
   reshuffling the row, because an out-of-flow item cannot pull a
   placed item into its track.

   1fr on column one is the only flexible track, so it absorbs all
   the slack — Back pinned left, hint and Next pinned right, at
   every width and in every combination of the two being present.
   ────────────────────────────────────────────────────────────── */
.tds-nav {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	column-gap: 1rem;
	padding: clamp(1rem, 2vw, 1.35rem) clamp(1.1rem, 2.6vw, 2.25rem);
	background: var(--tds-sunk);
	border-top: 1px solid var(--tds-line-2);
}

.tds-nav[hidden] { display: none; }

/* Placed by attribute rather than by class because these two carry
   the shared .tds-btn classes and nothing of their own. Written
   `.tds-nav [data-…]` (0,2,0) so a theme's own button rules cannot
   outrank the placement — the same reason every interactive rule
   in this file is double-scoped. */
.tds-nav [data-tds-back] { grid-column: 1; justify-self: start; }
.tds-nav [data-tds-next] { grid-column: 3; justify-self: end; }

/* Column 2, right-aligned, so it sits immediately left of Next.
   It exists to say why Next is disabled, and an explanation reads
   better beside the thing it explains than centred in the bar. */
.tds-nav__hint {
	grid-column: 2;
	justify-self: end;
	max-width: 22ch;
	text-align: right;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--tds-soft);
}

.tds .tds-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.85rem 1.4rem;
	border: 1px solid transparent;
	border-radius: var(--tds-radius-s);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.tds-btn svg { width: 1rem; height: 1rem; flex: none; transition: transform 0.18s ease; }

.tds .tds-btn--go {
	background: var(--tds-accent);
	border-color: var(--tds-accent);
	color: #fff;
	box-shadow: 0 12px 26px -14px rgba(212, 88, 30, 0.85);
}

.tds .tds-btn--go:hover:not(:disabled) {
	background: var(--tds-accent-2);
	border-color: var(--tds-accent-2);
	color: #fff;
	transform: translateY(-1px);
}

.tds .tds-btn--go:hover:not(:disabled) svg { transform: translateX(3px); }

/* Visibly inert, not just unclickable. A disabled button that looks
   enabled reads as a broken page. */
.tds .tds-btn--go:disabled {
	opacity: 0.42;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.tds .tds-btn--go.is-busy { cursor: progress; }
.tds .tds-btn--go.is-busy svg { display: none; }

.tds .tds-btn--ghost {
	background: transparent;
	border-color: var(--tds-line);
	color: var(--tds-muted);
}

.tds .tds-btn--ghost:hover {
	border-color: var(--tds-navy);
	color: var(--tds-navy);
}

.tds .tds-btn--ghost svg { width: 0.9rem; height: 0.9rem; }
.tds .tds-btn--ghost[hidden] { display: none; }

.tds .tds-btn--wa {
	background: var(--tds-card);
	border-color: var(--tds-line);
	color: var(--tds-navy);
}

.tds .tds-btn--wa:hover {
	border-color: #25d366;
	color: #128c3f;
}

.tds .tds-btn--wa svg { width: 1.05rem; height: 1.05rem; }
.tds .tds-btn:focus-visible { outline: 2px solid var(--tds-accent); outline-offset: 3px; }

/* [hidden] is 0,1,0 and `.tds .tds-btn` above is 0,2,0 — so the class
   BEATS the browser's own hidden rule and JS setting .hidden = true does
   nothing. Every element this stylesheet gives a display value to and the
   JS also hides needs its own guard at matching specificity. This is the
   cost of rule 2 at the top of the file, and it is cheaper than losing to
   the theme. */
.tds .tds-btn--wa[hidden] { display: none; }
.tds .tds-form[hidden] { display: none; }

/* ── Result ─────────────────────────────────────────────────── */

.tds-result[hidden] { display: none; }
.tds-result { animation: tds-in 0.36s cubic-bezier(0.22, 0.7, 0.3, 1) both; }

.tds-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: clamp(1.1rem, 2vw, 1.5rem) 0 clamp(1.35rem, 2.6vw, 2rem);
}

.tds-chip {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	background: var(--tds-chip);
	font-size: 0.8125rem;
	line-height: 1.3;
	color: var(--tds-muted);
}

.tds-chip b { font-weight: 700; color: var(--tds-navy); }

.tds-cards { display: flex; flex-direction: column; gap: 0.7rem; }

.tds-card {
	display: flex;
	align-items: flex-start;
	gap: clamp(0.9rem, 1.8vw, 1.25rem);
	padding: clamp(1rem, 2vw, 1.35rem);
	background: var(--tds-card);
	border: 1px solid var(--tds-line);
	border-radius: var(--tds-radius-s);
	text-decoration: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

/* The first card is the primary recommendation. */
.tds-card--lead { border-color: var(--tds-accent); background: var(--tds-accent-w); }

/* Only cards that are links get lift, so hover means something. */
a.tds-card:hover {
	border-color: var(--tds-accent);
	box-shadow: var(--tds-shadow);
	transform: translateY(-2px);
}

.tds-card__plate {
	flex: none;
	width: 4.6rem;
	min-height: 4.6rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 0.5rem 0.6rem;
	border-radius: 12px;
	background: var(--tds-navy);
	/* A one-pixel top highlight. Costs nothing and stops the plate
	   reading as a flat filled rectangle. */
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.tds-card--lead .tds-card__plate { background: var(--tds-accent); }

/* Sans, and figures forced to lining + tabular.

   WHY THIS IS NOT A SERIF: Playfair's default figures are old-style
   (see the numeral note near the top of this file), so this plate
   was rendering 120 and 42 at x-height with the 4 hanging below the
   baseline — small, ragged, and nothing like a spec plate. Lining
   figures alone would fix the raggedness, but a spec plate is a
   sans device in the first place: at 28px in a 4.6rem tile a heavy
   grotesque reads as a stamped rating, and a display serif reads as
   a page number.

   lining-nums / tabular-nums stay on top of that as belt and
   braces, so the plate cannot break this way whatever face ends up
   resolving. */
.tds-card__plate b {
	font-family: var(--tds-sans);
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: lining-nums tabular-nums;
	font-feature-settings: "lnum" 1, "tnum" 1;
	color: #fff;
}

.tds-card__plate span {
	font-size: 0.5625rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	line-height: 1;
	margin-top: 0.4rem;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.66);
}

.tds-card__body { min-width: 0; flex: 1; }

/* display: block is load-bearing, not cosmetic. Both this and the tag
   below it are spans, so both defaulted to INLINE -- and vertical
   margins do not apply to an inline box. That is why the tag's
   `margin: 0.25rem 0 0.5rem` did nothing and the two ran together as
   "FD120ID Insulated Fire DoorISI MARKED". Blocking the title is what
   actually separates them; the pill below is the presentation. */
.tds-card__t {
	display: block;
	font-family: var(--tds-serif);
	font-size: 1.1875rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--tds-navy);
}

/* A pill, not loose caps. The claim it carries -- ISI marked, 42 dB --
   is the one line a specifier scans for, so it gets a container of its
   own instead of trailing off the end of the heading. */
.tds-card__tag {
	display: inline-flex;
	align-items: center;
	margin: 0.5rem 0 0.7rem;
	padding: 0.32rem 0.62rem;
	border: 1px solid rgba(212, 88, 30, 0.3);
	border-radius: 999px;
	background: var(--tds-accent-w);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1;
	text-transform: uppercase;
	color: var(--tds-accent);
}

/* The lead card's own ground IS --tds-accent-w, so an accent-w pill
   would all but vanish on it. White separates it there. */
.tds-card--lead .tds-card__tag {
	background: #fff;
	border-color: rgba(212, 88, 30, 0.34);
}

.tds-card__why { display: flex; flex-direction: column; gap: 0.3rem; }

.tds-card__why li {
	position: relative;
	padding-inline-start: 0.95rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--tds-text);
}

.tds-card__why li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.62em;
	width: 0.4rem;
	height: 1.5px;
	background: var(--tds-accent);
}

.tds-card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.7rem;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--tds-accent);
}

.tds-card__more svg { width: 0.85rem; height: 0.85rem; }

.tds-notes { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.1rem; }
.tds-notes[hidden] { display: none; }

.tds-note {
	padding: 0.85rem 1.05rem;
	border-inline-start: 3px solid var(--tds-line);
	border-radius: 0 8px 8px 0;
	background: var(--tds-sunk);
	font-size: 0.875rem;
	line-height: 1.62;
	color: var(--tds-text);
}

.tds-note--why {
	border-inline-start-color: var(--tds-accent);
	background: var(--tds-accent-w);
}

.tds-note b { color: var(--tds-navy); }

.tds-caveat {
	margin-top: clamp(1.35rem, 2.4vw, 1.85rem);
	padding: 1rem 1.15rem;
	border-radius: 10px;
	background: var(--tds-chip);
	font-size: 0.8125rem;
	line-height: 1.62;
	color: var(--tds-muted);
}

.tds-caveat b { color: var(--tds-navy); }

/* ── Enquiry form ───────────────────────────────────────────── */

.tds-lead {
	margin-top: clamp(1.75rem, 3.4vw, 2.75rem);
	padding-top: clamp(1.5rem, 3vw, 2.25rem);
	border-top: 1px solid var(--tds-line);
}

.tds-lead__t {
	font-family: var(--tds-serif);
	font-size: clamp(1.1875rem, 2.1vw, 1.5rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.015em;
	color: var(--tds-navy);
}

.tds-lead__s {
	font-size: 0.9375rem;
	line-height: 1.62;
	color: var(--tds-muted);
	max-width: 40rem;
	margin: 0.4rem 0 clamp(1.25rem, 2.4vw, 1.75rem);
}

.tds-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem 1rem;
}

.tds-f { display: flex; flex-direction: column; gap: 0.4rem; }

.tds-f label {
	display: flex;
	gap: 0.3rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tds-muted);
}

.tds-f label em { font-style: normal; color: var(--tds-accent); }

.tds .tds-f input {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0.75rem 0.9rem;
	font-size: 0.9375rem;
	line-height: 1.3;
	border: 1px solid var(--tds-line);
	border-radius: 10px;
	background: var(--tds-card);
	color: var(--tds-ink);
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tds .tds-f input::placeholder { color: var(--tds-soft); opacity: 1; }

.tds .tds-f input:focus {
	outline: none;
	border-color: var(--tds-accent);
	box-shadow: 0 0 0 3px rgba(212, 88, 30, 0.13);
}

.tds .tds-f input.has-error { border-color: #dc2626; }

.tds-either {
	margin-top: 0.7rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--tds-soft);
}

.tds-opt-in {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin-top: 1.1rem;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--tds-text);
	cursor: pointer;
}

.tds-opt-in input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.tds-opt-in__b {
	position: relative;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.12rem;
	border: 1px solid var(--tds-line);
	border-radius: 5px;
	flex: none;
	transition: background-color 0.16s ease, border-color 0.16s ease;
}

.tds-opt-in:has(input:checked) .tds-opt-in__b {
	background: var(--tds-accent);
	border-color: var(--tds-accent);
}

.tds-opt-in:has(input:checked) .tds-opt-in__b::after {
	content: "";
	position: absolute;
	inset: 3px 4px 4px 3px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(40deg) translate(-1px, -1px);
}

.tds-opt-in:has(input:focus-visible) .tds-opt-in__b {
	outline: 2px solid var(--tds-accent);
	outline-offset: 2px;
}

.tds-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tds-form__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: clamp(1.25rem, 2.4vw, 1.75rem);
}

.tds-err {
	margin-top: 1.1rem;
	padding: 0.85rem 1.05rem;
	border: 1px solid rgba(220, 38, 38, 0.3);
	border-inline-start: 3px solid #dc2626;
	border-radius: 8px;
	background: rgba(220, 38, 38, 0.06);
	font-size: 0.875rem;
	line-height: 1.55;
	color: #b91c1c;
}

.tds-err[hidden] { display: none; }

/* Done -------------------------------------------------------- */

.tds-done[hidden] { display: none; }

.tds-done {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: clamp(1.1rem, 2.2vw, 1.5rem);
	border: 1px solid rgba(22, 148, 91, 0.3);
	border-radius: var(--tds-radius-s);
	background: rgba(22, 148, 91, 0.06);
	animation: tds-in 0.32s ease both;
}

.tds-done__i { flex: none; display: flex; color: #16945b; }
.tds-done__i svg { width: 1.6rem; height: 1.6rem; }

.tds-done__t {
	font-family: var(--tds-serif);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: #0f6b42;
}

.tds-done__s { font-size: 0.9375rem; line-height: 1.6; color: var(--tds-text); margin-top: 0.25rem; }
.tds-done__c { font-size: 0.8125rem; line-height: 1.6; color: var(--tds-muted); margin-top: 0.6rem; }
.tds-done__c a { color: var(--tds-accent); }

/* Restart ----------------------------------------------------- */

.tds-restart[hidden] { display: none; }

.tds-restart {
	padding: clamp(0.9rem, 1.8vw, 1.15rem) clamp(1.1rem, 2.6vw, 2.25rem);
	background: var(--tds-sunk);
	border-top: 1px solid var(--tds-line-2);
	text-align: center;
}

.tds .tds-restart__b {
	border: 0;
	background: none;
	padding: 0.35rem 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--tds-muted);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.16s ease;
}

.tds .tds-restart__b:hover { color: var(--tds-navy); }
.tds .tds-restart__b:focus-visible { outline: 2px solid var(--tds-accent); outline-offset: 2px; border-radius: 4px; }

/* ── Fallbacks ──────────────────────────────────────────────── */

/* :has() drives the consent checkbox. Without it, show the native
   control rather than an unusable custom box. */
@supports not selector(:has(*)) {
	.tds-opt-in input {
		position: static;
		width: auto;
		height: auto;
		opacity: 1;
		pointer-events: auto;
		accent-color: var(--tds-accent);
	}

	.tds-opt-in__b { display: none; }
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1000px) {
	.tds-opts--image { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
	.tds-opts--image,
	.tds-opts--icon,
	.tds-opts--numeral { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.tds-opts--plate { grid-template-columns: 1fr; }

	.tds-grid { grid-template-columns: 1fr; }

	/* The badge carries the step at this width; four truncated words
	   are worse than four icons. */
	.tds-rail__l { display: none; }
	.tds-rail__step { grid-template-columns: auto minmax(0, 1fr); }

	/* Hidden here rather than shrunk — three things do not fit on a
	   phone. Safe to hide now: the nav's columns are placed
	   explicitly, so removing this one leaves its track empty
	   instead of dragging Next across the bar. That was not true
	   when this file laid the nav out with flex. */
	.tds-nav__hint { display: none; }
	.tds .tds-btn { flex: 1 1 0; min-width: 0; padding-inline: 0.9rem; }
	.tds-form__foot .tds-btn { flex: 1 1 100%; }

	/* TWO columns, and Next takes whatever is left.
	   `flex` above does nothing to these two — they are grid items,
	   not flex items — so they size to their content, and on the
	   last step that content is "See recommendation".

	   Measured at 320px: Back 90px + Next 211px + 16px gap needs
	   317px inside a 251px content box. Both buttons then overflow
	   their tracks and COLLIDE — a 51px overlap, with Next's left
	   edge sitting under Back.

	   Letting the label wrap rather than tuning a breakpoint,
	   because the fix has to survive a longer translation of
	   either label. Next stretches into the leftover width and
	   takes a second line if it needs one; nothing is ever
	   squeezed past its own text. On step one Back is absent, its
	   track collapses to zero and Next spans the bar, which is the
	   right shape for a phone anyway. */
	.tds-nav { grid-template-columns: auto minmax(0, 1fr); }
	.tds-nav [data-tds-next] { grid-column: 2; justify-self: stretch; }

	/* break-word is the last-resort guard, not the mechanism. The
	   label should wrap at its space; this only stops a single
	   word longer than the button from spilling out of it, which a
	   translation can produce at any padding. */
	.tds-nav [data-tds-next] span {
		white-space: normal;
		text-align: center;
		overflow-wrap: break-word;
	}
}

@media (max-width: 420px) {
	.tds-opts--image,
	.tds-opts--icon,
	.tds-opts--numeral { grid-template-columns: 1fr; }

	.tds-opt__text { padding-inline-end: 2.75rem; }

	.tds-nav .tds-btn { padding-inline: 0.55rem; }

	/* ICON-ONLY BACK, so Next gets the width it actually needs.
	   Measured at 320px on the last step with a full-width Back:
	   Next ends up 156px wide, 138px of it content, while its own
	   contents want 149px — the word "recommendation" at 125px,
	   plus an 9px gap and a 16px arrow. The flex line overflows by
	   11px and, being centre-justified, splits the overage evenly,
	   so the label hangs 5.5px out through the left edge of its
	   own button.

	   The span cannot shrink out of the way: its min-content width
	   IS that word. Something had to give up space, and a
	   left-arrow on its own is the most understood icon in a
	   wizard — it costs the least to reduce to one. Dropping
	   Back's word frees about 56px, which is enough for Next to
	   stay on one line rather than wrapping.

	   Hidden with the .tds-sr technique, NOT `display: none`. The
	   arrow is aria-hidden, so removing the word outright would
	   leave the button with no accessible name at all — a button
	   that screen readers announce as nothing. This keeps the name
	   and only takes the pixels. */
	.tds-nav [data-tds-back] span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.tds-nav [data-tds-back] { padding-inline: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
	.tds-step.is-active,
	.tds-result,
	.tds-done { animation: none; }

	.tds-opt:hover .tds-opt__card,
	.tds-opt:hover .tds-opt__media img,
	a.tds-card:hover,
	.tds .tds-btn--go:hover:not(:disabled) { transform: none; }

	.tds .tds-btn--go:hover:not(:disabled) svg { transform: none; }
	.tds-rail__bar::after { transition: none; }
}
