/**
 * The assistant's panel.
 *
 * Ported from the prototype's design, and carrying its own tokens.
 *
 * ── Why every colour is declared here ───────────────────────────────────────
 *
 * The prototype's stylesheet used about twenty custom properties it never
 * defined — --bone, --ink, --clay, --serif and the rest — inheriting them from
 * the YEMMA theme. The obvious way to keep that working is to declare a
 * dependency on the theme's stylesheet handle.
 *
 * That is the one solution that must not be used. If the handle is not
 * registered — a different theme, a context whose manifest excluded it —
 * WordPress does not skip the dependency, it DROPS THE DEPENDENT ITEM. The
 * panel's stylesheet would not print at all, on shops we cannot predict, with
 * no error anywhere.
 *
 * So each token is ours, named --ya-*, and takes the theme's value when there
 * is one and a hard fallback when there is not. It looks like the shop here,
 * and it still looks like something on a shop that is not this one.
 *
 * @package YemmaAssistant
 */

.ya-launch,
.ya-chat {
	--ya-bone:    var(--bone, #FAF6EF);
	--ya-bone-2:  var(--bone-2, #F3ECE0);
	--ya-sand:    var(--sand, #E7DBC7);
	--ya-line:    var(--line, #DFD4C2);
	--ya-line-2:  var(--line-2, #C9BCA6);
	--ya-ink:     var(--ink, #14100D);
	--ya-ink-2:   var(--ink-2, #241D17);
	--ya-ink-3:   var(--ink-3, #3B322A);
	--ya-muted:   var(--muted, #8A7B6B);
	--ya-clay:    var(--clay, #A9522F);
	--ya-clay-d:  var(--clay-d, #8B3F22);

	/* The storefront's brass: the hairline under an eyebrow, and the deep one
	   for small capitals on cream (AA, as the theme measured it). */
	--ya-brass:   var(--brass, #B98B45);
	--ya-brass-d: var(--brass-d, #896227);

	/* The shop's "it is here" green — the colour its own cards print "Ready to
	   ship" in, so a state reads the same in the panel as on the grid. */
	--ya-ok:      var(--ok, #3F7A55);
	--ya-serif:   var(--serif, "Cormorant Garamond", Georgia, serif);
	--ya-sans:    var(--sans, "Jost", "Helvetica Neue", Arial, sans-serif);
	--ya-ease:    var(--ease-out, cubic-bezier(.16, 1, .3, 1));

	/* The head's brown, derived so it moves if the palette moves. */
	--ya-brown:   #673926;
	--ya-brown:   color-mix(in srgb, var(--ya-clay-d) 55%, var(--ya-ink-3) 45%);

	--ya-ground:  #FCF9F4;
	--ya-card:    #FFFDFA;
	--ya-r:       22px;
	--ya-r-bub:   18px;
}

/* ── The launcher ─────────────────────────────────────────────────────────── */
.ya-launch {
	position: fixed;
	z-index: 99990;
	right: clamp(14px, 3vw, 28px);
	bottom: clamp(14px, 3vw, 28px);
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 999px;
	background: var(--ya-brown);
	color: var(--ya-bone);
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(20, 16, 13, .12), 0 18px 34px -14px rgba(20, 16, 13, .5);
	transition: transform .3s var(--ya-ease), box-shadow .3s var(--ya-ease);
}

.ya-launch:hover,
.ya-launch:focus-visible {
	transform: translateY(-2px);
}

.ya-launch[hidden] {
	display: none;
}

.ya-launch__mark {
	width: 30px;
	height: 30px;
	margin: auto;
	stroke: currentColor;
	fill: none;
}

.ya-launch__tip {
	position: absolute;
	right: calc(100% + 12px);
	display: grid;
	gap: 1px;
	padding: 9px 14px;
	border-radius: 12px;
	background: var(--ya-card);
	color: var(--ya-ink-2);
	font-family: var(--ya-sans);
	font-size: 12px;
	line-height: 1.35;
	white-space: nowrap;
	text-align: right;
	box-shadow: 0 1px 2px rgba(20, 16, 13, .06), 0 14px 28px -14px rgba(20, 16, 13, .35);
	opacity: 0;
	transform: translateX(6px);
	pointer-events: none;
	transition: opacity .25s var(--ya-ease), transform .25s var(--ya-ease);
}

.ya-launch__tip b {
	font-weight: 500;
	color: var(--ya-ink);
}

.ya-launch:hover .ya-launch__tip,
.ya-launch:focus-visible .ya-launch__tip {
	opacity: 1;
	transform: none;
}

/* ── The panel ────────────────────────────────────────────────────────────── */
.ya-chat {
	position: fixed;
	z-index: 99991;
	right: clamp(14px, 3vw, 28px);
	bottom: clamp(14px, 3vw, 28px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 400px;
	max-width: calc(100vw - 28px);
	height: min(720px, calc(100vh - 56px));
	border-radius: var(--ya-r);
	background: var(--ya-ground);
	font-family: var(--ya-sans);
	font-weight: 300;
	color: var(--ya-ink-2);
	box-shadow: 0 1px 2px rgba(20, 16, 13, .05), 0 34px 78px -36px rgba(20, 16, 13, .4);
	animation: ya-in .32s var(--ya-ease) both;
}

@keyframes ya-in {
	from { opacity: 0; transform: translateY(14px) scale(.98); }
}

@media (prefers-reduced-motion: reduce) {
	.ya-chat { animation: none; }
	.ya-launch { transition: none; }
}

.ya-chat[hidden] {
	display: none;
}

.ya-chat *,
.ya-chat *::before,
.ya-chat *::after {
	box-sizing: border-box;
}

.ya-chat svg {
	stroke: currentColor;
	fill: none;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ── The head ─────────────────────────────────────────────────────────────── */
.ya-chat__head {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	padding: 14px 14px 14px 18px;
	background: var(--ya-brown);
	color: var(--ya-bone);
}

.ya-chat__mark svg {
	display: block;
	width: 28px;
	height: 28px;
}

.ya-chat__id {
	display: grid;
	gap: 1px;
	margin-right: auto;
	line-height: 1.25;
}

.ya-chat__id b {
	font-family: var(--ya-serif);
	font-size: 1.06rem;
	font-weight: 500;
	letter-spacing: .01em;
}

.ya-chat__id span {
	font-size: 9.5px;
	letter-spacing: .22em;
	text-transform: uppercase;
	opacity: .72;
}

.ya-chat__act {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: inherit;
	cursor: pointer;
	opacity: .8;
}

.ya-chat__act:hover,
.ya-chat__act:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, .12);
}

.ya-chat__act svg {
	width: 17px;
	height: 17px;
}

/* Sound on. The icon already changes from a crossed speaker to a sounding
   one, which is the signal; this only lifts it out of the row's half-opacity
   so the state reads from across a desk rather than on inspection. */
.ya-chat__act.is-on {
	opacity: 1;
}

/* Start again. One of the head's controls, so it wears their clothes — the
   same resting opacity, the same soft wash on hover — and speaks in the head's
   quietest type, the spaced capitals of the "Assistant" line beside it. Wide
   enough for its word, and no wider; it never draws a fill or a border, which
   is what keeps it from reading as a second send button. */
.ya-chat__again {
	grid-auto-flow: column;
	gap: 6px;
	width: auto;
	padding: 0 11px 0 9px;
	font-family: var(--ya-sans);
	font-size: 9.5px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: .2em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* `display: grid` above would otherwise outrank the browser's own [hidden]. */
.ya-chat__again[hidden] {
	display: none;
}

.ya-chat__again svg {
	width: 14px;
	height: 14px;
}

.ya-chat__again[disabled] {
	opacity: .45;
	cursor: default;
}

/* On the narrowest phones the word steps aside and the arrow stays, a round
   control like its neighbours. Clipped rather than removed, so the button keeps
   its name for anybody who cannot see the arrow. */
@media (max-width: 380px) {
	.ya-chat__again {
		width: 32px;
		padding: 0;
	}

	.ya-chat__again-t {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* ── The conversation ─────────────────────────────────────────────────────── */
.ya-chat__scroll {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;

	/* Stated rather than assumed. The property does not inherit, so a theme's
	   `html { scroll-behavior: smooth }` cannot reach in here — but a theme with
	   a `*` reset can, and smooth scrolling would turn every frame of a reveal
	   into an argument with the frame before it. */
	scroll-behavior: auto;
}

.ya-chat__body {
	display: grid;
	gap: 16px;
	padding: 20px 18px;
}

/* The conversation, for a screen reader: the answer said once, in full, while
   the visible one is still being written out a word at a time.
   Clipped rather than `display: none`, which is not announced at all — and with
   its own rules rather than the theme's `.screen-reader-text`, for the reason
   written at the top of this file. */
.ya-chat__say {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ya-turn {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.ya-turn--you {
	flex-direction: row-reverse;
}

.ya-turn__av {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	border: 1px solid var(--ya-line);
	background: var(--ya-card);
	color: var(--ya-muted);
}

.ya-turn__av svg {
	width: 15px;
	height: 15px;
}

.ya-turn--you .ya-turn__av {
	border-color: transparent;
	background: var(--ya-sand);
	color: var(--ya-ink-3);
}

.ya-turn__said {
	display: grid;
	gap: 8px;
	min-width: 0;
	max-width: 80%;
}

/* ── Arriving ─────────────────────────────────────────────────────────────────
 * Each part of a turn rises into place rather than appearing, and the script
 * staggers them so a turn reads in the order it was written: the sentence, then
 * what the sentence points at.
 *
 * `both` is what makes a stagger a stagger — it holds a block invisible through
 * its delay instead of letting it flash first and then animate. It also means
 * the column's height is settled before anything can be seen in it, so the view
 * is not chasing a page that is still growing.
 *
 * Every turn is included, the visitor's own as well. A bubble that popped into
 * place beside ones that glide would read as a fault rather than as a choice.
 */
.ya-turn__said > * {
	animation: ya-rise .34s var(--ya-ease) both;
}

@keyframes ya-rise {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* A turn put back from an earlier page. It was said already; it arrives the
   way the page around it does, all at once, rather than rising in as though
   it were being said again. */
.ya-turn--kept .ya-turn__said > * {
	animation: none;
}

/* The tail of a sentence being written. `currentColor` and `1em` so it takes
   the bubble's own colour and size and neither the brown one nor the bone one
   needs a rule of its own — and `steps(1)` so it blinks rather than breathes,
   which is the difference between a cursor and a decoration. */
.ya-caret {
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 1px;
	vertical-align: -.14em;
	background: currentColor;
	opacity: .5;
	animation: ya-caret 1s steps(1) infinite;
}

@keyframes ya-caret {
	50% {
		opacity: 0;
	}
}

/* Somebody who has asked for less movement gets the answer whole and at once.
   The script reads the same question and skips the reveal entirely, so this
   only has to catch the parts CSS owns. */
@media (prefers-reduced-motion: reduce) {
	.ya-turn__said > * {
		animation: none;
	}

	.ya-caret {
		display: none;
	}
}

/* ── The blocks ───────────────────────────────────────────────────────────── */
.ya-bub {
	padding: 11px 15px;
	border-radius: var(--ya-r-bub);
	border-top-left-radius: 6px;
	background: var(--ya-bone-2);
	font-size: 14px;
	line-height: 1.65;
	color: var(--ya-ink-2);
	overflow-wrap: anywhere;
}

.ya-turn--you .ya-bub {
	border-top-left-radius: var(--ya-r-bub);
	border-top-right-radius: 6px;
	background: var(--ya-brown);
	color: var(--ya-bone);
}

.ya-bub a {
	color: inherit;
	text-underline-offset: 3px;
}

.ya-bub--handoff {
	border-left: 3px solid var(--ya-clay);
	border-top-left-radius: 6px;
	background: var(--ya-card);
}

/* ── Being handed to a person ─────────────────────────────────────────────────
 * The one moment in the conversation where the machine steps back, so it is
 * drawn to look like an introduction rather than an error: a sentence, a name,
 * what they answer in, and a door. Every part below the sentence is printed
 * only when the shop has actually filled it in, so these rules must all read
 * correctly with any of them absent.
 */
.ya-hand__who {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	align-items: baseline;
	margin-top: 10px;
}

.ya-hand__name {
	font-family: var(--ya-serif);
	font-size: 15px;
	color: var(--ya-ink);
}

.ya-hand__role {
	font-size: 11.5px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ya-muted);
}

.ya-hand__note {
	margin-top: 3px;
	font-size: 12.5px;
	color: var(--ya-muted);
}

/* The door. Weighted more than a .ya-link, because it is the one thing on the
 * turn worth tapping — and full-width, so it is a thumb target on a phone. */
.ya-hand__go {
	display: flex;
	gap: 9px;
	align-items: center;
	justify-content: center;
	margin-top: 13px;
	padding: 11px 16px;
	border: 1px solid var(--ya-clay);
	border-radius: 12px;
	background: transparent;
	color: var(--ya-clay);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: background .18s var(--ya-ease), color .18s var(--ya-ease);
}

.ya-hand__go:hover,
.ya-hand__go:focus-visible {
	background: var(--ya-clay);
	color: var(--ya-bone);
}

.ya-hand__go svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
	.ya-hand__go {
		transition: none;
	}
}

.ya-facts {
	display: grid;
	gap: 7px;
	padding: 13px 15px;
	border: 1px solid var(--ya-line);
	border-radius: 14px;
	background: var(--ya-card);
	font-size: 13px;
	line-height: 1.5;
}

.ya-fact {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	color: var(--ya-ink-2);
}

.ya-fact svg {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	margin-top: 2px;
	color: var(--ya-clay);
}

/*
 * The line over the facts — what they are the answer to ("Your room,
 * 4.5 × 3.6 m"). Drawn only when a block carries one, so a block without it
 * looks exactly as it did. Darker and a little heavier than the facts under
 * it, and no icon: it is the question restated, not one more fact.
 */
.ya-facts__lead {
	color: var(--ya-ink);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.45;
}

/*
 * A door inside a fact — "Try it in our room planner". Underlined in the
 * clay the icons use, so it reads as a link on the card's pale ground
 * without becoming a button.
 */
.ya-fact a {
	color: var(--ya-clay-d);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ya-fact a:hover,
.ya-fact a:focus-visible {
	color: var(--ya-clay);
}

/*
 * The one fact a door marks as the answer — "9 × 12 ft (274 × 366 cm)".
 * The facts are set light, so a plain `bolder` lifts it a single step and
 * the mark all but disappears; the lead's own ink and weight make it read.
 */
.ya-fact strong {
	color: var(--ya-ink);
	font-weight: 500;
}

.ya-link {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 11px 15px;
	border: 1px solid var(--ya-line);
	border-radius: 14px;
	background: var(--ya-card);
	color: var(--ya-ink-2);
	font-size: 13px;
	text-decoration: none;
}

.ya-link:hover,
.ya-link:focus-visible {
	border-color: var(--ya-line-2);
}

.ya-link svg {
	width: 16px;
	height: 16px;
	color: var(--ya-clay);
}

/* ── Waiting ──────────────────────────────────────────────────────────────── */
.ya-typing {
	display: flex;
	gap: 4px;
	padding: 15px;
	border-radius: var(--ya-r-bub);
	border-top-left-radius: 6px;
	background: var(--ya-bone-2);
	width: max-content;
}

.ya-typing i {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--ya-muted);
	animation: ya-blink 1.3s infinite;
}

.ya-typing i:nth-child(2) { animation-delay: .18s; }
.ya-typing i:nth-child(3) { animation-delay: .36s; }

@keyframes ya-blink {
	0%, 60%, 100% { opacity: .25; }
	30%           { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ya-typing i { animation: none; opacity: .6; }
}

/* ── The chips ────────────────────────────────────────────────────────────────
 * Ported from the prototype's foot (themplates/assets/css/assistant.css): a
 * hairline pill on the card ground, light type in the third ink, and the head's
 * brown when it is pointed at. The look is the prototype's; three things about
 * it are not, each for a reason.
 *
 * Under the answer, in the scroller — not above the composer. Up there the strip
 * took its height out of the conversation every time it filled and gave it back
 * every time it emptied. Here it scrolls with the answer it belongs to, and the
 * composer does not move by a pixel.
 *
 * Wrapping, not a sideways scroll. A row that scrolls hides its fourth chip on
 * a phone behind an edge nobody can see is there; wrapped, every offer is on
 * the screen.
 *
 * Forty-four pixels to press, drawn as the prototype's slimmer pill. The button
 * is the whole height and owns no paint; the pill is its `::before`, inset five
 * pixels top and bottom. So the finger gets the full target, the eye gets the
 * light pill, and a wrapped row's targets meet edge to edge without one ever
 * overlapping the next.
 */
.ya-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;

	/* Pulled up into the log's own bottom padding, so the strip sits close
	   under the answer it belongs to; and indented past the avatar, so it hangs
	   from the answer's column rather than from the panel's edge. */
	margin-top: -14px;
	padding: 0 18px 14px 56px;
}

.ya-chips[hidden] {
	display: none;
}

.ya-chip {
	position: relative;

	/* Its own stacking context, so the pill can sit behind the words without
	   falling behind the panel. */
	z-index: 0;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 44px;
	max-width: 100%;
	margin: 0;
	padding: 10px 14px;
	border: 0;
	background: none;
	color: var(--ya-ink-3);
	font-family: var(--ya-sans);
	font-size: 12px;
	font-weight: 300;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	overflow-wrap: anywhere;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: color .3s var(--ya-ease);
	animation: ya-rise .35s var(--ya-ease) both;
}

.ya-chip::before {
	content: '';
	position: absolute;
	z-index: -1;
	top: 5px;
	right: 0;
	bottom: 5px;
	left: 0;
	border: 1px solid var(--ya-line);
	border-radius: 999px;
	background: var(--ya-card);
	transition: background-color .3s var(--ya-ease), border-color .3s var(--ya-ease);
}

.ya-chip:hover {
	color: var(--ya-bone);
}

.ya-chip:hover::before {
	border-color: var(--ya-brown);
	background: var(--ya-brown);
}

/* The ring goes round the pill, not round the taller box it sits in — and in
   the composer's clay, so a keyboard moving from a chip to the input sees one
   kind of focus, not two. The theme's own ring is put away here because it
   would draw a rectangle round the invisible target. */
.ya-chip:focus-visible {
	outline: none;
}

.ya-chip:focus-visible::before {
	outline: 2px solid var(--ya-clay);
	outline-offset: 2px;
}

/* The colour a chip narrows to. A hairline ring, because the colours a rug comes
   in include the undyed cream this pill is painted in. */
.ya-chip__dot {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 999px;
	box-shadow: inset 0 0 0 1px rgba(20, 16, 13, .16);
}

.ya-chip:hover .ya-chip__dot {
	box-shadow: 0 0 0 1px rgba(250, 246, 239, .55);
}

/* Put back from an earlier page: there, rather than arriving. */
.ya-chips.is-kept .ya-chip {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.ya-chip {
		animation: none;
	}

	.ya-chip,
	.ya-chip::before {
		transition: none;
	}
}

/* ── The composer ─────────────────────────────────────────────────────────── */
.ya-chat__compose {
	display: flex;
	gap: 8px;
	align-items: center;
	flex: 0 0 auto;
	padding: 12px 14px;
	border-top: 1px solid var(--ya-line);
	background: var(--ya-bone);
}

.ya-chat__in {
	flex: 1 1 auto;
	min-width: 0;
	padding: 11px 15px;
	border: 1px solid var(--ya-line);
	border-radius: 999px;
	background: var(--ya-card);
	font-family: inherit;
	font-size: 14px;
	color: var(--ya-ink-2);
}

.ya-chat__in:focus {
	outline: 2px solid var(--ya-clay);
	outline-offset: 1px;
	border-color: transparent;
}

.ya-chat__send {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--ya-brown);
	color: var(--ya-bone);
	cursor: pointer;
}

.ya-chat__send[disabled] {
	opacity: .45;
	cursor: default;
}

.ya-chat__send svg {
	width: 18px;
	height: 18px;
}

/* ── Under the composer ───────────────────────────────────────────────────────
 * What is answering, said once more where the customer is about to type, and
 * the door to a person beside it. Printed only when the shop has said them, so
 * none of this reaches a panel without them.
 *
 * The panel's quietest voice: the muted ink, small and light, on the composer's
 * own ground and pulled up under it, so it reads as the composer's foot rather
 * than as one more thing in the conversation. Centred under the input it
 * describes, and allowed to wrap rather than run under the edge on the
 * narrowest phones.
 *
 * The door is the one part that does anything, so it is the one part that is
 * not muted: the clay the panel's other links wear, underlined, in the same
 * small type as the words before it — a link-sized door, not a button competing
 * with Send.
 */
.ya-chat__compose:has(+ .ya-chat__note) {
	padding-bottom: 8px;
}

/* A paragraph, so a theme's measure for paragraphs (this shop's is 62ch) would
   stop its ground short of the panel's edge; stated away. */
.ya-chat__note {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 2px 8px;
	max-width: none;
	margin: 0;
	padding: 0 14px 10px;
	background: var(--ya-bone);
	color: var(--ya-muted);
	font-family: var(--ya-sans);
	font-size: 11px;
	font-weight: 300;
	line-height: 1.45;
	letter-spacing: .02em;
	text-align: center;
}

.ya-chat__note-t {
	min-width: 0;
	overflow-wrap: anywhere;
}

/*
 * The dot between the two halves, the one the words themselves use — drawn
 * here only when there is a door after the words, and given an empty
 * alternative so a screen reader does not read the punctuation aloud. A
 * browser that does not know the alternative keeps the first declaration.
 */
.ya-chat__note-t:not(:last-child)::after {
	content: "·";
	content: "·" / "";
	margin-left: 8px;
}

/*
 * A link-sized door with a finger-sized target, thirty pixels tall: the
 * padding that makes the target is handed straight back by the margin, so the
 * line keeps the height of its words. It reaches up into the composer's own
 * bottom padding and no further, where there is nothing else to press.
 */
.ya-chat__note-person {
	position: relative;
	min-width: 0;
	min-height: 0;
	margin: -7px -6px;
	padding: 7px 6px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--ya-clay-d);
	font-family: inherit;
	font-size: inherit;
	font-weight: 400;
	line-height: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	text-transform: none;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: color .18s var(--ya-ease);
}

.ya-chat__note-person:hover {
	color: var(--ya-clay);
}

/* The composer's ring, so a keyboard moving on from Send sees one kind of
   focus. Round the target the finger gets, which is the button's whole box. */
.ya-chat__note-person:focus-visible {
	outline: 2px solid var(--ya-clay);
	outline-offset: 0;
	color: var(--ya-clay);
}

@media (prefers-reduced-motion: reduce) {
	.ya-chat__note-person {
		transition: none;
	}
}

/* ── On a phone it is the whole screen ────────────────────────────────────── */
@media (max-width: 520px) {
	.ya-chat {
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}

	.ya-turn__said {
		max-width: 86%;
	}
}

/* ── Things worth looking at ──────────────────────────────────────────────────
 * The block that takes the model out of the fact-stating business: it says
 * "here are three that might suit" with no figure in it, and these carry the
 * prices, drawn by the server out of Core's own rows.
 *
 * Sized for a panel rather than a page. The panel is a 400px box on a desktop
 * and goes full screen at 520px and under, so the list gets 250-285px either
 * way — two tiles to a row, not a grid of thumbnails nobody can read.
 */
.ya-cards {
	display: grid;
	gap: 11px;
}

.ya-cards__lead {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--ya-ink-2);
}

/*
 * Two to a row, and the photograph leads.
 *
 * This was a stack of rows with a 60px thumbnail beside the words, which reads
 * as a list of links rather than as a shop. Two to a row makes each card
 * narrower and the whole thing considerably BIGGER, because the picture stops
 * being a bullet and becomes the card: sixty square becomes about a hundred and
 * thirty-five by ninety-six, which is roughly four times the area.
 *
 * `minmax(0, 1fr)` and not `1fr`: a grid track's default minimum is its
 * content, so one long unbroken word would push the column wider than half and
 * the rows would stop lining up.
 */
.ya-cards__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 9px;
}

.ya-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;

	/* None — the photograph goes to the card's own edge. */
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--ya-line);

	/*
	 * Rounded, and kept rounded on purpose after trying it square.
	 *
	 * The shop's own corner is sharp — every image on the storefront is 0px
	 * and a button is 2px — so 2px was tried here and looked, on the page,
	 * more like the site and less like the panel. The panel is not the page:
	 * it is a soft overlay with a 22px shell and a pill for an input, and a
	 * square card inside it read as a fragment of the storefront that had
	 * fallen into the chat. Judged on screen rather than from the token
	 * table. If this is ever revisited, revisit the shell with it.
	 */
	border-radius: 16px;
	background: var(--ya-card);
	color: inherit;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(20, 16, 13, .035);
	transition:
		border-color .18s var(--ya-ease),
		box-shadow .18s var(--ya-ease),
		transform .18s var(--ya-ease);

	/* A grid item's minimum is its content; one unbroken word would otherwise
	   widen the card past its column. */
	min-width: 0;
}

/*
 * The part of a card that goes somewhere.
 *
 * The card is a `div` and this anchor holds its photograph and its words, so
 * that the buttons a card will grow — a heart, an "Add to bag" — can sit
 * beside the link instead of illegally inside it. It is laid out exactly as
 * the card used to be, and it takes the card's whole height, so the tile that
 * can be pressed is still the whole tile.
 *
 * Unpositioned on purpose: the pill over the photograph measures itself from
 * the card, and the anchor starts at the card's own top edge, so it lands
 * where it always did.
 */
.ya-card__link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

/*
 * The photograph, and the space it keeps when there is none.
 *
 * The panel builds an `<img>` only when the server sent a URL, so a card whose
 * picture is missing used to start its words flush against the padding while
 * every card around it indented past a thumbnail — one unset category
 * photograph and the whole column looked broken. The `:has()` rule draws an
 * empty tile in the same box instead, so the list stays a list. It is a held
 * place and not a fake photograph: no icon, no "no image" text, just the paper
 * the picture would have sat on.
 */
/*
 * One number, used twice. The pill is positioned off the bottom of the
 * photograph, so when this was a literal in both places the two drifted apart
 * the first time the tile was resized and the pill floated into the words.
 */
.ya-cards {
	--ya-shot: 124px;
}

/*
 * The held place is drawn by whatever holds the words: the anchor when the
 * card goes somewhere — so the empty tile can be pressed like the photograph
 * it stands in for — and the card itself when it does not.
 *
 * `--ya-ratio` is unset here, and `auto` changes nothing for a box whose
 * height is already given. The plates below set a ratio and let the height
 * follow it instead.
 */
.ya-card__shot,
.ya-card__link:not(:has(.ya-card__shot))::before,
.ya-card:not(:has(.ya-card__link, .ya-card__shot))::before {
	flex: 0 0 auto;
	width: 100%;
	height: var(--ya-shot);
	aspect-ratio: var(--ya-ratio, auto);
	object-fit: cover;
	background: var(--ya-bone-2);
}

.ya-card__link:not(:has(.ya-card__shot))::before,
.ya-card:not(:has(.ya-card__link, .ya-card__shot))::before {
	content: '';
	background:
		linear-gradient(135deg, var(--ya-bone-2) 0%, var(--ya-bone) 100%);
	box-shadow: inset 0 -1px 0 rgba(223, 212, 194, .9);
}

/*
 * The state, over the picture: how many are on the floor, or that this one is
 * made to order. Bottom left rather than top, so it sits nearest the words it
 * qualifies, and over the darkest part of most rug photographs.
 *
 * `backdrop-filter` is the nicety and the solid background is the guarantee —
 * the colour underneath is a photograph nobody chose, so this cannot rely on
 * translucency alone to stay readable.
 */
.ya-card__tag {
	position: absolute;
	top: var(--ya-shot);
	left: 8px;
	z-index: 1;
	transform: translateY(-100%);
	margin-top: -8px;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(255, 253, 250, .92);
	backdrop-filter: blur(6px);
	box-shadow: 0 1px 3px rgba(20, 16, 13, .12);
	color: var(--ya-ink-2);
	font-size: 10.5px;
	line-height: 1.3;
	letter-spacing: .02em;
	max-width: calc(100% - 16px);

	/*
	 * It wraps rather than truncating, and that is the whole point of it.
	 * "None on the floor today" is twenty-three characters in a tile about a
	 * hundred and thirty-five wide, so on one line it came out as "None on the
	 * floor to…" — a state label cut in half, which tells a customer less than
	 * no label would. Two lines is fine; a half-read state is not. This is the
	 * same mistake the count made when it lived in the sentence, one element
	 * over.
	 */
	text-wrap: pretty;
}

.ya-card__words {
	display: grid;
	gap: 3px;
	min-width: 0;
	padding: 9px 10px 11px;
}

/*
 * Two lines, not one with an ellipsis. At half the panel's width a name like
 * "Kilim & Flatweave" does not fit on one line, and truncating the name of the
 * thing the card is for is the one truncation that makes a card useless.
 */
.ya-card__t {
	font-family: var(--ya-serif);
	font-size: 15px;
	line-height: 1.22;
	letter-spacing: .005em;
	color: var(--ya-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/*
 * Two lines, and the cap is what makes the column read as a column.
 *
 * The meta carries a sentence the shop wrote plus a count, and those run from
 * fifteen characters to eighty — unclamped, the cards ranged from about
 * sixty-eight pixels tall to a hundred and the list jittered. Clamped, every
 * card is the height of its photograph and the eye runs straight down them.
 */
.ya-card__m {
	font-size: 11.5px;
	line-height: 1.42;
	color: var(--ya-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/*
 * The door out, under the tiles.
 *
 * Deliberately NOT shaped like a card. The tiles above it are things to look
 * at; this is a place to go, and if it wore the same clothes it would read as
 * a ninth collection with a missing photograph. So: full width, a marked
 * icon, an arrow, and no picture — the same row the storefront uses for the
 * same job.
 */
.ya-cards__more {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 13px 9px 9px;
	border: 1px solid var(--ya-line);
	border-radius: 16px;
	background: var(--ya-card);
	color: var(--ya-ink-2);
	font-size: 13px;
	text-decoration: none;
	transition: border-color .18s var(--ya-ease), background-color .18s var(--ya-ease);
}

.ya-cards__more-mark {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: var(--ya-bone-2);
	color: var(--ya-clay);
}

.ya-cards__more-mark svg {
	width: 16px;
	height: 16px;
}

/* The label takes the slack, which pushes the arrow to the far edge. */
.ya-cards__more-t {
	flex: 1 1 auto;
	min-width: 0;
}

.ya-cards__more > svg {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: var(--ya-line-2);
	transition: transform .18s var(--ya-ease), color .18s var(--ya-ease);
}

.ya-cards__more:hover,
.ya-cards__more:focus-visible {
	border-color: var(--ya-clay);
	background-color: var(--ya-ground);
}

.ya-cards__more:hover > svg,
.ya-cards__more:focus-visible > svg {
	color: var(--ya-clay);
	transform: translateX(3px);
}

/*
 * ── Compact: many small things at once ────────────────────────────────────
 *
 * Every wool a shop dyes, seen whole: a round picture and a name, as many to a
 * row as fit — five in the panel's column on a phone and on a desktop — under
 * a heading for each family. The storefront's own idiom, from the header's wool
 * panel: the circle painted in its colour first and the photograph laid over
 * it, a hairline ring above both so a cream wool on cream still has an edge,
 * and a small letter-spaced name. The heading is the storefront's eyebrow — a
 * brass capital and a brass hairline — and not a pill: a widget's chrome reads
 * as foreign on this shop.
 *
 * The column takes the turn's full width, as a plate does, so the grid is laid
 * out by the column and not by whichever photograph has loaded.
 */
.ya-turn__said:has(> .ya-cards--compact) {
	width: 100%;
}

.ya-cards--compact .ya-cards__list {
	grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
	gap: 11px 4px;
}

.ya-cards__group {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 5px 0 -2px;
	font-family: var(--ya-sans);
	font-size: 9.5px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ya-brass-d);
}

.ya-cards__group:first-child {
	margin-top: 0;
}

.ya-cards__group-n {
	font-weight: 400;
	letter-spacing: .06em;
	color: var(--ya-muted);
}

.ya-cards__group::after {
	content: '';
	flex: 1 1 auto;
	height: 1px;
	background: color-mix(in srgb, var(--ya-brass) 36%, transparent);
}

.ya-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	min-width: 0;
	color: var(--ya-ink-3);
	text-decoration: none;
	transition: color .18s var(--ya-ease);
}

.ya-tile__dot {
	position: relative;
	display: block;
	width: min(100%, 44px);
	aspect-ratio: 1;
	border-radius: 50%;
	overflow: hidden;
	background: var(--c, var(--ya-bone-2));
	transition: transform .18s var(--ya-ease), box-shadow .18s var(--ya-ease);
}

.ya-tile__dot img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Above the photograph, so the edge is the wool's and not the picture's. */
.ya-tile__dot::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(20, 16, 13, .14);
	pointer-events: none;
}

.ya-tile__dot.is-pale::after {
	box-shadow: inset 0 0 0 1px rgba(20, 16, 13, .24);
}

/* Never cut: a long name ("Orange Tangerine") wraps between its words. */
.ya-tile__t {
	font-size: 10px;
	line-height: 1.25;
	letter-spacing: .02em;
	text-align: center;
	overflow-wrap: anywhere;
}

a.ya-tile:hover,
a.ya-tile:focus-visible {
	color: var(--ya-clay);
}

a.ya-tile:hover .ya-tile__dot {
	transform: scale(1.05);
}

/* The ring goes round the wool, not round the box the name makes. */
a.ya-tile:focus-visible {
	outline: none;
}

a.ya-tile:focus-visible .ya-tile__dot {
	box-shadow: 0 0 0 2px var(--ya-card), 0 0 0 3.5px var(--ya-clay);
}

@media (prefers-reduced-motion: reduce) {
	.ya-tile__dot {
		transition: none;
	}

	a.ya-tile:hover .ya-tile__dot {
		transform: none;
	}
}

/*
 * A tile is its own affordance, so there is no chevron here — the row layout
 * needed one to say "this is a door", and a photograph with a name under it
 * does not. What it lifts on instead is the whole card.
 *
 * Asked of the anchor inside, and answered by the card around it. The card
 * is no longer the link, and a card with no address must not lift at all —
 * so the question is "is the link in this card pointed at", which is exactly
 * what `:has()` asks. When the buttons arrive beside the link, pointing at
 * one of them will not lift the card as though it were about to be left.
 */
.ya-card:has(.ya-card__link:hover),
.ya-card:has(.ya-card__link:focus-visible) {
	border-color: var(--ya-clay);
	box-shadow: 0 6px 18px rgba(169, 82, 47, .12);
	transform: translateY(-2px);
}

.ya-card:has(.ya-card__link:hover) .ya-card__shot,
.ya-card:has(.ya-card__link:focus-visible) .ya-card__shot {
	transform: scale(1.03);
}

/*
 * The focus ring goes round the card, in the composer's clay.
 *
 * Not round the anchor, where it used to be when the anchor was the card: the
 * card clips its corners with `overflow: hidden`, and an anchor's ring drawn
 * just outside the anchor is drawn just outside what the card lets be seen —
 * a keyboard would land on a card with no ring at all. So the anchor's own is
 * put away, but only where the card can draw one in its place.
 */
.ya-card:has(.ya-card__link:focus-visible) {
	outline: 2px solid var(--ya-clay);
	outline-offset: 2px;
}

@supports selector(:has(*)) {
	.ya-card__link:focus-visible {
		outline: none;
	}
}

/* And where it cannot, the anchor's ring is drawn inside its own edge, where
   the clipping cannot reach it. */
@supports not selector(:has(*)) {
	.ya-card__link:focus-visible {
		outline-offset: -3px;
	}
}

.ya-card__shot {
	transition: transform .35s var(--ya-ease);
}

/*
 * One to a row only on a genuinely tiny screen — and the first version of this
 * had the threshold wrong in a way worth recording.
 *
 * It read 380px, on the assumption that a phone gives the cards less room than
 * a desktop. It gives them almost the same: the panel is a fixed 400px box on
 * a desktop, and at 520px and under it goes FULL SCREEN, so a 375px phone
 * hands the list about 258px against a desktop's 283. Tiles of 125px against
 * 137. The old threshold would have flipped an iPhone SE to one column for no
 * reason, and eight full-width tiles is about nineteen hundred pixels of
 * scroll where two-up is nine hundred.
 *
 * 330px is where two tiles really do stop being tiles — a folded phone, not a
 * normal one.
 */
@media (max-width: 330px) {
	.ya-cards__list {
		grid-template-columns: minmax(0, 1fr);
	}

	/* One to a row can afford a taller picture, and needs one to not look odd. */
	.ya-cards {
		--ya-shot: 150px;
	}
}

/* ── Plates: one card leading, or one card in full ────────────────────────────
 * Drawn only when a block asks for a layout — `ya-cards--lead` for a handful
 * with one leading, `ya-cards--feature` for a single thing shown whole — and
 * never otherwise, so every tile above keeps exactly the look it had.
 *
 * The owner's choice, drawn live against two others: the first card a wide
 * plate (photograph 5:4), the rest two to a row beneath it as objects
 * (photograph 1:1). The name, the colours as dots, the price in clay — the
 * one "buy" colour in this house — and the state as a small line with a dot,
 * which on a plate replaces the pill the tiles wear.
 *
 * **Names of any length must hold.** Shop names run from two words to a
 * hundred and fifty characters, and none of them may widen a card, push a
 * price off its line or leave half a word hanging. So a name is two lines at
 * most, breaks anywhere rather than overflow, hyphenates where the language
 * allows, and balances its two lines. Every flex and grid child here carries
 * `min-width: 0`, because the minimum of either is its content by default
 * and a single unbroken word is enough content to break a column. The script
 * keeps the whole name in a `title` and in the card's label.
 */

/*
 * A plate is sized by the column, not by its pictures. Left to content, the
 * turn takes the width of whatever has loaded — a lazy photograph has none yet
 * — and the plates would open narrow and then jump. The turn's own cap
 * (80%, 86% on a phone) still decides how wide the column may be.
 */
.ya-turn__said:has(> .ya-cards--lead),
.ya-turn__said:has(> .ya-cards--feature) {
	width: 100%;
}

/* The photograph keeps a ratio instead of a height, so the box is reserved at
   its final size before a byte of the picture arrives. */
:is(.ya-cards--lead, .ya-cards--feature) {
	--ya-shot: auto;
	--ya-ratio: 1 / 1;
}

.ya-cards--feature,
.ya-card--hero {
	--ya-ratio: 5 / 4;
}

.ya-card--hero {
	grid-column: 1 / -1;
}

.ya-cards--feature .ya-cards__list {
	grid-template-columns: minmax(0, 1fr);
}

/* A column rather than the tiles' grid, so the state can be pushed to the
   foot of a two-up card and the two lines under a pair sit level. */
:is(.ya-cards--lead, .ya-cards--feature) .ya-card__words {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 5px;
	padding: 10px 11px 12px;
}

/*
 * Two lines, and on the two-up cards exactly two — `min-height` and the clamp
 * agree at 2.4em, because the line height is 1.2. A short name still takes
 * both lines, so the prices beside each other sit on one level and a pair
 * reads as two things to compare rather than two loose cards.
 */
:is(.ya-cards--lead, .ya-cards--feature) .ya-card__t {
	min-width: 0;
	min-height: 2.4em;
	font-size: 14.5px;
	line-height: 1.2;
	overflow-wrap: anywhere;
	hyphens: auto;
	text-wrap: balance;
}

/* `vw` because the plate is as wide as the screen on the phone that needs the
   smaller size; on a desktop the panel is a fixed box and this rests at 21. */
.ya-card--hero .ya-card__t,
.ya-cards--feature .ya-card__t {
	min-height: 0;
	font-size: clamp(17px, 5.2vw, 21px);
}

/* One line, cut with an ellipsis: what a rug is made of and in how many sizes
   is worth a glance, not a second line. */
:is(.ya-cards--lead, .ya-cards--feature) .ya-card__m {
	display: block;
	min-width: 0;
	-webkit-line-clamp: none;
	line-clamp: none;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* As drawn: under the plate the two-up cards are objects — a picture, a name,
   a price, a state. At half the plate's width the line would only ever be
   its first two words. */
.ya-cards--lead .ya-card:not(.ya-card--hero) .ya-card__m {
	display: none;
}

/*
 * The colours left, the price right, and wrapping rather than squeezing. On a
 * narrow card six dots and "from $ 2,450.00" do not share a line, and the
 * price then takes its own — still on the right, by its own margin, so the
 * eye finds it in the same place on every card.
 */
.ya-card__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	min-width: 0;
}

.ya-card__dots {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

/* A hairline ring, for the reason the chip's dot has one: the colours a rug
   comes in include the cream this card is printed on. */
.ya-card__dot {
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border-radius: 999px;
	background: var(--c, transparent);
	box-shadow: inset 0 0 0 1px rgba(20, 16, 13, .18);
}

.ya-card__plus {
	margin-inline-start: 2px;
	font-size: 10px;
	line-height: 1;
	color: var(--ya-muted);
}

/* No `nowrap`. The money keeps itself together — the space after the currency
   is a non-breaking one — and anything longer may wrap rather than overflow. */
.ya-card__price {
	min-width: 0;
	margin-inline-start: auto;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--ya-clay);
	text-align: end;
	overflow-wrap: anywhere;
}

.ya-card--hero .ya-card__price,
.ya-cards--feature .ya-card__price {
	font-size: 15px;
}

/*
 * The state, as a line. Small capitals, spaced, with a dot in its own colour.
 *
 * Two lines at most, and deliberately not one with an ellipsis. "You choose
 * the colours" and "Made to order · 2–4 weeks" are twenty-odd capitals in a
 * card about a hundred and seventeen pixels wide, so on one line they would
 * come out as "Made to order · …" — a state cut in half, which tells a
 * customer less than no state at all. The pill above learned the same thing.
 * The dot hangs in the margin, so a second line starts under the words and
 * not under the dot.
 *
 * Pushed to the foot of the card: in a pair whose prices wrap differently, the
 * two states still sit on one level.
 */
.ya-card__avail {
	position: relative;
	min-width: 0;
	margin-top: auto;
	padding-inline-start: 12px;
	font-size: 9.5px;
	line-height: 1.45;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: var(--ya-muted);
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Centred on the first line: half the line height, less half the dot. */
.ya-card__avail::before {
	content: '';
	position: absolute;
	top: calc(.725em - 3px);
	inset-inline-start: 0;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: currentColor;
}

.ya-card__avail.is-good {
	color: var(--ya-ok);
}

.ya-card__avail.is-quiet {
	color: var(--ya-muted);
}

.ya-card__avail.is-pick {
	color: var(--ya-clay-d);
}

/* The shop's own "Sold" colour — and an empty ring rather than a full dot, so
   it does not read as the same state as the clay one above it. */
.ya-card__avail.is-alert {
	color: var(--ya-clay-d);
}

.ya-card__avail.is-alert::before {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px currentColor;
}

/*
 * A feature card's facts, under its link. Label left in the muted ink, value
 * right in the card's own, and a hairline between pairs — a receipt rather
 * than a paragraph. The theme styles `dl`, `dt` and `dd` for articles, so
 * every margin is stated here rather than inherited.
 */
.ya-card__specs {
	display: grid;
	min-width: 0;
	margin: 0;
	padding: 0 11px 6px;
}

.ya-card__spec {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 10px;
	align-items: baseline;
	min-width: 0;
	padding: 8px 0;
	border-top: 1px solid var(--ya-line);
}

.ya-card__spec-k,
.ya-card__spec-v {
	min-width: 0;
	margin: 0;
	padding: 0;
	font-weight: inherit;
	overflow-wrap: anywhere;
}

.ya-card__spec-k {
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--ya-muted);
}

.ya-card__spec-v {
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--ya-ink-2);
	text-align: end;
	text-wrap: pretty;
}

/*
 * On the folded-phone width where the tiles above go one to a row, the plates
 * go with them — and every card then becomes a plate, 5:4, rather than a tall
 * square a whole column wide. The two-line floor on the names is let go too:
 * with nothing beside it, there is no neighbour to line up with.
 */
@media (max-width: 330px) {
	.ya-cards--lead {
		--ya-ratio: 5 / 4;
	}

	.ya-cards--lead .ya-card__t {
		min-height: 0;
	}
}

/* ── What a card can do ───────────────────────────────────────────────────────
 * The owner's choice, drawn live against two others (design A): a round toggle
 * on the photograph, top corner, and one full-width button under everything
 * else. Filled ink when the tap does the thing itself, a hairline outline when
 * it only leads somewhere, the shop's green outline once it is done. Small
 * spaced capitals and a 3px corner — the shop's own buttons, not the panel's
 * pills, because this is the one control on the card that is the shop
 * speaking rather than the conversation.
 *
 * The prototype's foot (themplates/assets/css/assistant.css, `.chat__add`,
 * `.chat__heart`) supplied the clothes; its pill and its 26px heart were the
 * parts design A changed. Every colour is one of this file's tokens.
 *
 * **Labels of any length must hold.** On a two-up card the short label stays
 * on one line down to the narrowest width that still draws two to a row; a
 * label on a plate may wrap to a second line and never a third; and nothing
 * is ever wider than its card — every control here may break a word rather
 * than overflow it.
 */

/*
 * Over the photograph, at the corner the state pill does not use. Its own
 * paper, at .92 with a hairline, for the reason the pill has one: the picture
 * under it is one nobody chose, and a toggle that vanishes into a pale rug is
 * a toggle nobody presses. Above the pill and the photograph, under nothing.
 */
.ya-card__heart {
	position: absolute;
	top: 10px;
	inset-inline-end: 10px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(20, 16, 13, .14);
	border-radius: 999px;
	background: rgba(255, 253, 250, .92);
	backdrop-filter: blur(6px);
	box-shadow: 0 1px 3px rgba(20, 16, 13, .1);
	color: var(--ya-ink-3);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .25s var(--ya-ease), color .25s var(--ya-ease), transform .25s var(--ya-ease);
}

.ya-card__heart svg {
	width: 18px;
	height: 18px;
	transition: fill .25s var(--ya-ease);
}

.ya-card__heart:hover {
	background: var(--ya-card);
	color: var(--ya-clay);
}

.ya-card__heart:active {
	transform: scale(.94);
}

/*
 * Pressed: the heart filled in the house's clay. Stated outright, because the
 * panel's `.ya-chat svg { fill: none }` would otherwise keep every icon in this
 * file an outline — and the state is carried by `aria-pressed` alone, so the
 * look follows the very attribute a screen reader reads.
 */
.ya-card__heart[aria-pressed="true"] {
	color: var(--ya-clay);
}

.ya-card__heart[aria-pressed="true"] svg {
	fill: currentColor;
}

.ya-card__heart[aria-busy="true"] {
	cursor: progress;
}

.ya-card__heart:focus-visible {
	outline: 2px solid var(--ya-clay);
	outline-offset: 2px;
}

/*
 * The foot: under the words and the facts, on the card's own ground. Pushed
 * to the bottom, so in a pair whose names wrap differently the two buttons
 * still sit level — the anchor above already takes the slack, and this is the
 * guarantee for a card with no anchor to take it.
 */
.ya-card__foot {
	display: grid;
	gap: 2px;
	min-width: 0;
	margin-top: auto;
	padding: 8px 12px 12px;
}

/* A form is a box like any other here; the theme's spacing for forms is for
   forms on pages. */
.ya-card__form {
	display: block;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/*
 * One look for three elements — a button, a link, and the button inside a
 * form — so each has every inherited style stated rather than trusted, the
 * way `.ya-chip` does: a theme's button and link rules reach in here too.
 */
.ya-card__act {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 10px 8px;
	border: 1px solid var(--ya-ink);
	border-radius: 3px;
	background: transparent;
	color: var(--ya-ink);
	font-family: var(--ya-sans);
	font-size: 10.5px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: .16em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	overflow-wrap: anywhere;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .25s var(--ya-ease), border-color .25s var(--ya-ease), color .25s var(--ya-ease), opacity .25s var(--ya-ease);
}

/* Two lines at most, balanced when there are two. The span is what is clipped,
   never the control, so its border and its focus ring stay whole. */
.ya-card__act-t {
	display: -webkit-box;
	min-width: 0;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-wrap: balance;
}

/* The head's brown on a pointer, as the chips and the prototype's foot had it.
   Asked of the element, so a disabled button and a "done" label that goes
   nowhere never answer a hover. */
button.ya-card__act:not(:disabled):hover,
a.ya-card__act:hover {
	border-color: var(--ya-brown);
	background: var(--ya-brown);
	color: var(--ya-bone);
}

/* The one that does the thing: filled, in ink. */
.ya-card__act--buy {
	background: var(--ya-ink);
	color: var(--ya-ground);
}

/* Done — the shop's green, outlined: a state, and still a way onward. */
.ya-card__act.is-done {
	border-color: var(--ya-ok);
	background: transparent;
	color: var(--ya-ok);
}

a.ya-card__act.is-done:hover {
	border-color: var(--ya-ok);
	background: var(--ya-ok);
	color: var(--ya-bone);
}

span.ya-card__act {
	cursor: default;
}

.ya-card__act:disabled {
	cursor: default;
	opacity: .5;
}

.ya-card__act[aria-busy="true"] {
	cursor: progress;
	opacity: .7;
}

/* The ring in the composer's clay, as everywhere else in the panel; the foot's
   padding is what keeps it inside the card's clipped corners. */
.ya-card__act:focus-visible {
	outline: 2px solid var(--ya-clay);
	outline-offset: 2px;
}

/*
 * A second action, when a card has one: a line of text, not a second box. Two
 * buttons of one weight would make the customer choose between them; this
 * says plainly which is the way and which is the aside.
 */
.ya-card__act--quiet {
	width: auto;
	justify-self: center;
	padding: 6px 4px;
	border: 0;
	background: none;
	color: var(--ya-ink-3);
	font-size: 11.5px;
	font-weight: 300;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: underline;
	text-decoration-color: var(--ya-clay);
	text-underline-offset: 4px;
}

button.ya-card__act--quiet:not(:disabled):hover,
a.ya-card__act--quiet:hover {
	border-color: transparent;
	background: none;
	color: var(--ya-clay);
}

.ya-card__act--quiet.is-done,
a.ya-card__act--quiet.is-done:hover {
	border-color: transparent;
	background: none;
	color: var(--ya-ok);
	text-decoration-color: var(--ya-ok);
}

/*
 * Two to a row, at the narrow end of two to a row.
 *
 * Measured rather than guessed: at 331px — the narrowest width that still
 * draws two to a row, see the tiles above — a two-up card is about 122px
 * wide, which leaves design A's spacing about 80px for a label. "Add to bag"
 * in spaced capitals is 75 to 82px depending on which font arrived, so it
 * fitted in Jost and broke in the fallback. A little less margin and a little
 * less spacing gives it 96px and one line in either; nothing above 380px is
 * touched, and one to a row has the room without it.
 */
@media (min-width: 331px) and (max-width: 380px) {
	.ya-cards:not(.ya-cards--feature) .ya-card:not(.ya-card--hero) .ya-card__foot {
		padding-inline: 8px;
	}

	.ya-cards:not(.ya-cards--feature) .ya-card:not(.ya-card--hero) .ya-card__act:not(.ya-card__act--quiet) {
		padding-inline: 4px;
		letter-spacing: .12em;
	}
}

/*
 * What a tap led to, said once under the cards: the host's sentence with a
 * dot in the colour of how it went, then its ways onward as the strip's own
 * chips — the same pill, the same 44px target — because they are offers like
 * the chips are, and the strip under the answer is where the eye goes next.
 */
.ya-cards__after {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 6px;
	min-width: 0;
}

.ya-cards__note {
	position: relative;
	flex: 1 0 100%;
	min-width: 0;
	padding-inline-start: 13px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--ya-ink-2);
	overflow-wrap: anywhere;
	text-wrap: pretty;
}

/* Centred on the first line, as the state line's dot is. */
.ya-cards__note::before {
	content: '';
	position: absolute;
	top: calc(.75em - 3px);
	inset-inline-start: 0;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--ya-muted);
}

.ya-cards__after.is-ok .ya-cards__note::before {
	background: var(--ya-ok);
}

/* Refused: the empty clay ring the "Sold" line wears, not a full dot. */
.ya-cards__after.is-not .ya-cards__note::before {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--ya-clay-d);
}

/* A link wearing the chip's clothes — the theme's link rules stated away. */
.ya-cards__after a.ya-chip {
	text-decoration: none;
}

/* ── Boxes the customer types into ────────────────────────────────────────────
 * An entry: a few labelled boxes and one button, on the card's own ground, in
 * the composer's clothes — the same hairline, the same clay ring on focus —
 * because this is the panel asking, not a page's form that wandered in. The
 * label sits over its box in the panel's small muted voice and is always
 * shown: a placeholder that vanishes as the first letter is typed is a label
 * nobody can read back.
 *
 * A card that holds boxes takes the whole row and draws no held place for a
 * photograph it was never going to have: two boxes in half a panel are two
 * boxes nobody can type a whole answer into.
 */
.ya-cards__list > .ya-card:has(.ya-card__entry) {
	grid-column: 1 / -1;
}

.ya-turn__said:has(.ya-card__entry) {
	width: 100%;
}

.ya-card:has(.ya-card__entry) .ya-card__link:not(:has(.ya-card__shot))::before,
.ya-card:has(.ya-card__entry):not(:has(.ya-card__link, .ya-card__shot))::before {
	content: none;
	display: none;
}

/* The line under the name says what the boxes are for; it is read whole, never cut. */
.ya-card:has(.ya-card__entry) .ya-card__m {
	display: block;
	-webkit-line-clamp: none;
	line-clamp: none;
	overflow: visible;
	white-space: normal;
	text-overflow: clip;
}

/* A form is a box like any other here, as the submit's is. */
.ya-card__entry {
	display: grid;
	gap: 10px;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.ya-entry__field {
	display: grid;
	gap: 5px;
	min-width: 0;
	margin: 0;
	padding: 0;
	font-weight: inherit;
	cursor: text;
}

.ya-entry__field[hidden] {
	display: none;
}

.ya-entry__label {
	min-width: 0;
	font-family: var(--ya-sans);
	font-size: 11.5px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: .02em;
	color: var(--ya-ink-3);
	overflow-wrap: anywhere;
}

/*
 * Every inherited style stated, as `.ya-chat__in` states them: a theme's input
 * rules reach in here too, and a box that took the theme's 50px height and its
 * square corners would be the page's, not the panel's.
 */
.ya-entry__in {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	min-height: 42px;
	margin: 0;
	padding: 10px 13px;
	border: 1px solid var(--ya-line-2);
	border-radius: 10px;
	background: var(--ya-ground);
	box-shadow: none;
	color: var(--ya-ink-2);
	font-family: var(--ya-sans);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: normal;
	-webkit-appearance: none;
	appearance: none;
}

.ya-entry__in:focus {
	outline: 2px solid var(--ya-clay);
	outline-offset: 1px;
	border-color: transparent;
}

.ya-entry__in:disabled {
	opacity: .55;
	cursor: default;
}

/*
 * The switch under the boxes: a line of underlined words, the card's quiet
 * action's voice, never a second button competing with the first. Pressed, it
 * says so the way a toggle does — in `aria-pressed`, with the clay it wears on
 * a pointer — and the box it hides is simply gone.
 */
.ya-entry__alt {
	justify-self: start;
	min-width: 0;
	min-height: 0;
	margin: -4px 0 0;
	padding: 6px 2px;
	border: 0;
	border-radius: 6px;
	background: none;
	box-shadow: none;
	color: var(--ya-ink-3);
	font-family: var(--ya-sans);
	font-size: 11.5px;
	font-weight: 300;
	line-height: 1.4;
	letter-spacing: normal;
	text-align: start;
	text-transform: none;
	text-decoration: underline;
	text-decoration-color: var(--ya-clay);
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	overflow-wrap: anywhere;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: color .18s var(--ya-ease);
}

.ya-entry__alt:not(:disabled):hover,
.ya-entry__alt[aria-pressed="true"] {
	color: var(--ya-clay-d);
}

.ya-entry__alt:focus-visible {
	outline: 2px solid var(--ya-clay);
	outline-offset: 2px;
}

.ya-entry__alt:disabled {
	opacity: .5;
	cursor: default;
}

/*
 * What a host drew in answer: its sentence, in the clothes of the line under
 * the cards it stands in place of, and then one opened card.
 */
.ya-cards__answer {
	display: grid;
	gap: 9px;
	min-width: 0;
}

.ya-cards__said {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	min-width: 0;
}

.ya-cards__said.is-ok .ya-cards__note::before {
	background: var(--ya-ok);
}

.ya-cards__said.is-not .ya-cards__note::before {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--ya-clay-d);
}

/*
 * On a phone: every box, the button and the switch a thumb's height, and the
 * boxes' type at sixteen pixels — under it, a phone zooms the whole page into
 * the box the moment it is touched and leaves it zoomed.
 */
@media (max-width: 520px) {
	.ya-entry__in {
		min-height: 44px;
		font-size: 16px;
	}

	.ya-card__entry .ya-card__act {
		min-height: 44px;
	}

	.ya-entry__alt {
		min-height: 44px;
		margin: -8px 0 -4px;
		padding: 10px 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ya-entry__alt {
		transition: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ya-card__heart,
	.ya-card__heart svg,
	.ya-card__act {
		transition: none;
	}

	.ya-card__heart:active {
		transform: none;
	}
}

/* ── The shop's own words ─────────────────────────────────────────────────────
 * Quoted rather than retold, so it is drawn as a quotation: an edge down the
 * left, the shop's serif for the heading, and a citation under it. It must not
 * look like the assistant talking, because it is not.
 */
.ya-passage {
	padding: 13px 15px;
	border-left: 3px solid var(--ya-line-2);
	border-radius: 0 14px 14px 0;
	background: var(--ya-card);
}

.ya-passage__h {
	margin-bottom: 5px;
	font-family: var(--ya-serif);
	font-size: 15px;
	color: var(--ya-ink);
}

.ya-passage__t {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--ya-ink-2);
}

.ya-passage__t p {
	margin: 0 0 8px;
}

.ya-passage__t p:last-child {
	margin-bottom: 0;
}

/*
 * A link inside the shop's own paragraph — a policy's cross-reference, a
 * chapter of a film. The theme takes every anchor's colour and underline away
 * (`a { color: inherit; text-decoration: none }`), and nothing gave them back
 * here, so a link read as the words around it and nobody knew it was there.
 * The citation's clay, underlined, so it is plainly something to press.
 */
.ya-passage__t a {
	color: var(--ya-clay);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ya-passage__c {
	display: inline-flex;
	gap: 7px;
	align-items: center;
	margin-top: 10px;
	color: var(--ya-clay);
	font-size: 12.5px;
	text-decoration: none;
}

.ya-passage__c:hover,
.ya-passage__c:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ya-passage__c svg {
	width: 14px;
	height: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.ya-card,
	.ya-card__shot {
		transition: none;
	}

	/* The border and the shadow still answer a hover; nothing moves. */
	.ya-card:has(.ya-card__link:hover),
	.ya-card:has(.ya-card__link:focus-visible) {
		transform: none;
	}

	.ya-card:has(.ya-card__link:hover) .ya-card__shot,
	.ya-card:has(.ya-card__link:focus-visible) .ya-card__shot {
		transform: none;
	}
}
