/*
 * CLECOD — SAV et preuves d'achat dans l'espace client.
 * Same grammar as client-space.css: flat panels, #e7e7e7 hairlines, #ed1c24
 * accent, square corners. Written for a phone first; wider layouts are added
 * with container queries because the WooCommerce side menu changes the width
 * left to the app.
 */
.clecod-client-space #cc-sav {
	container-type: inline-size;
	container-name: sav;
}

.sav {
	--sav-ok: #256039;
	--sav-ok-bg: #edf7f0;
	--sav-warn: #755015;
	--sav-warn-bg: #fff6e3;
	--sav-off: #6a6d75;
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.sav > .cc-intro,
.sav > .cc-notice {
	margin: 0;
}

.sav .cc-intro h2 {
	font-size: clamp(26px, 7.5cqi, 44px);
	overflow-wrap: anywhere;
}

.sav h3 {
	margin: 0;
	font-size: 18px;
}

.sav-notice {
	position: sticky;
	top: var(--cc-menu-top, 12px);
	z-index: 3;
}

/* ---------- Scan buttons ---------- */
.sav-scan {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.clecod-client-space .sav-scan button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 56px;
	line-height: 1.2;
}

.clecod-client-space .sav-scan--compact button {
	min-height: 48px;
}

.sav-scan svg,
.sav-iconbtn svg {
	flex: none;
}

.sav-tip {
	margin: -6px 0 0;
	color: var(--cc-muted);
	font-size: 13px;
	line-height: 1.5;
}

.sav-or {
	margin: 4px 0 0;
	color: var(--cc-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* ---------- Blocks ---------- */
.sav-block {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-top: 18px;
	border-top: 1px solid var(--cc-line);
}

.sav-block__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.sav .cc-help {
	margin: 0;
}

.sav-requests,
.sav-tickets {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sav-request {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--cc-line);
	background: #fff;
}

.sav-request.is-todo {
	border-left: 4px solid var(--cc-red);
}

.sav-request.is-closed {
	background: var(--cc-soft);
}

.sav-request h3 {
	margin: 8px 0 4px;
	font-size: 17px;
	overflow-wrap: anywhere;
}

.sav-request p {
	margin: 0;
	color: var(--cc-muted);
	font-size: 13px;
}

.sav-request p strong {
	color: var(--cc-ink);
}

.clecod-client-space .sav-request > button {
	width: 100%;
}

/* ---------- Coverage chips ---------- */
.sav-covers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.sav > .sav-covers {
	margin-top: 0;
}

.sav-cover {
	display: inline-block;
	padding: 5px 9px;
	border: 1px solid var(--cc-line);
	background: #fff;
	color: var(--sav-off);
	font-size: 12px;
	line-height: 1.35;
}

.sav-cover b {
	font-weight: 700;
}

.sav-cover--active {
	border-color: #bfdcc8;
	background: var(--sav-ok-bg);
	color: var(--sav-ok);
}

.sav-cover--case,
.sav-cover--unknown {
	border-color: #ecd9ad;
	background: var(--sav-warn-bg);
	color: var(--sav-warn);
}

.sav-cover--expired b {
	text-decoration: line-through;
}

.sav-coverage {
	margin-top: 4px;
	padding: 14px;
	background: var(--cc-soft);
}

/* ---------- Tickets ---------- */
.sav-ticket {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 14px;
	padding: 14px;
	border: 1px solid var(--cc-line);
	background: #fff;
}

.sav-ticket.is-draft {
	border-style: dashed;
	border-color: var(--cc-red);
}

.sav-ticket__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 96px;
	overflow: hidden;
	background: var(--cc-soft);
	color: var(--cc-muted);
	font-size: 11px;
	font-weight: 700;
	text-decoration: none;
}

.sav-ticket__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sav-ticket__head strong,
.sav-ticket__head span {
	display: block;
}

.sav-ticket__head span {
	color: var(--cc-muted);
	font-size: 13px;
}

.sav-ticket__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin-top: 10px;
}

.clecod-client-space .sav-ticket__foot button {
	min-height: 40px;
	padding: 8px 0;
}

.clecod-client-space button.sav-link--quiet {
	color: var(--cc-muted);
}

.sav-lines {
	display: flex;
	flex-direction: column;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.sav-lines li {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 0;
	border-top: 1px solid var(--cc-line);
}

.sav-lines--orders {
	margin: 0;
}

.sav-lines--orders li:first-child {
	border-top: 0;
	padding-top: 0;
}

.sav-lines li > div > strong {
	display: block;
	overflow-wrap: anywhere;
}

.sav-lines li > div > span:not(.sav-cover) {
	display: block;
	color: var(--cc-muted);
	font-size: 13px;
}

.clecod-client-space .sav-lines button {
	width: 100%;
	min-height: 44px;
	padding: 10px 16px;
}

/* ---------- Forms ---------- */
.sav-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.sav-step,
.sav-items {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
	margin: 0;
	padding: 18px 16px;
	border: 1px solid var(--cc-line);
	background: #fff;
}

.sav-step legend,
.sav-items legend {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 8px;
	margin-left: -8px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-transform: uppercase;
}

.sav-step legend span {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	background: var(--cc-ink);
	color: #fff;
	font-size: 13px;
	letter-spacing: 0;
}

.sav-step legend small,
.sav-field small {
	color: var(--cc-muted);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.sav-field {
	display: block;
	min-width: 0;
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.clecod-client-space .sav-field input,
.clecod-client-space .sav-field select,
.clecod-client-space .sav-field textarea,
.clecod-client-space .sav-composer textarea {
	width: 100%;
	min-width: 0;
	height: 52px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--cc-field);
	border-radius: 0;
	background: #fff;
	color: var(--cc-ink);
	display: block;
	margin-top: 6px;
	/* 16px: iOS zooms on anything smaller when a field takes focus. */
	font-size: 16px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
}

.clecod-client-space .sav-field textarea,
.clecod-client-space .sav-composer textarea {
	height: auto;
	min-height: 112px;
	padding: 12px 14px;
	line-height: 1.5;
	resize: vertical;
}

.clecod-client-space .sav-field input:focus,
.clecod-client-space .sav-field select:focus,
.clecod-client-space .sav-field textarea:focus,
.clecod-client-space .sav-composer textarea:focus {
	border-color: var(--cc-red);
	outline: 2px solid rgba(237, 28, 36, 0.18);
	outline-offset: 0;
}

.sav-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

.sav-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
}

.clecod-client-space .sav-check input,
.clecod-client-space .sav-choice input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--cc-red);
}

.sav-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sav-choice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding: 14px;
	border: 1px solid var(--cc-line);
	cursor: pointer;
}

.sav-choice:has(input:checked) {
	border-color: var(--cc-ink);
	box-shadow: inset 3px 0 0 var(--cc-red);
}

.sav-choice.is-disabled {
	background: var(--cc-soft);
	color: var(--cc-muted);
	cursor: default;
}

.sav-choice span {
	min-width: 0;
}

.sav-choice strong,
.sav-choice small {
	display: block;
	overflow-wrap: anywhere;
}

.sav-choice small {
	color: var(--cc-muted);
	font-size: 13px;
}

.clecod-client-space button.sav-change {
	align-self: flex-start;
	min-height: 40px;
	margin-top: 4px;
	padding: 8px 0;
}

/* ---------- Problem type: a grid of tiles, one tap ---------- */
.sav-issues {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.sav-issue {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	min-height: 84px;
	margin: 0;
	padding: 12px 12px 13px;
	border: 1px solid var(--cc-line);
	background: #fff;
	color: var(--cc-ink);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clecod-client-space .sav-issue input,
.clecod-client-space .sav-wish input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.sav-issue svg {
	flex: none;
	color: var(--cc-muted);
	transition: color 0.15s ease;
}

.sav-issue span {
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.3;
	text-transform: none;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.sav-issue:hover {
	border-color: var(--cc-field);
}

/* Same mark as the chosen purchase in step 1: dark border, red edge, plus a tick. */
.sav-issue:has(input:checked) {
	border-color: var(--cc-ink);
	box-shadow: inset 3px 0 0 var(--cc-red);
}

.sav-issue:has(input:checked) svg {
	color: var(--cc-red);
}

.sav-issue:has(input:checked) span {
	font-weight: 700;
}

.sav-issue:has(input:checked)::after {
	content: "";
	position: absolute;
	top: 10px;
	right: 10px;
	width: 20px;
	height: 20px;
	background: var(--cc-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.sav-issue:has(input:focus-visible),
.sav-wish:has(input:focus-visible) {
	outline: 2px solid var(--cc-ink);
	outline-offset: 2px;
}

/* ---------- Wish: compact one-tap choices ---------- */
.sav-wishes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-top: 8px;
}

.sav-wish {
	position: relative;
	margin: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.sav-wish--none {
	grid-column: 1 / -1;
}

.sav-wish span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 8px 10px;
	border: 1px solid var(--cc-field);
	background: #fff;
	color: var(--cc-ink);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.25;
	text-align: center;
	text-transform: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sav-wish:hover span {
	border-color: var(--cc-ink);
}

.sav-wish input:checked + span {
	border-color: var(--cc-ink);
	background: var(--cc-ink);
	color: #fff;
	font-weight: 700;
}

.sav-wish--none input:checked + span {
	border-color: var(--cc-ink);
	background: var(--cc-soft);
	color: var(--cc-ink);
}

@media (prefers-reduced-motion: reduce) {
	.sav-issue,
	.sav-issue svg,
	.sav-wish span {
		transition: none;
	}
}

.sav-tip.sav-tip--field {
	margin: 6px 0 0;
}

/* ---------- Ticket just saved: its warranties ---------- */
.clecod-client-space .sav > button.cc-back {
	align-self: flex-start;
}

.sav-done__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 12px;
	padding: 6px 10px 6px 8px;
	background: var(--sav-ok-bg);
	color: var(--sav-ok);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1;
	text-transform: uppercase;
}

.sav-done p {
	font-size: 15px;
	line-height: 1.55;
}

/* The ticket, drawn as a receipt: soft paper with a torn bottom edge. */
.sav-receipt {
	position: relative;
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 4px 14px;
	align-items: start;
	margin-bottom: 8px;
	/* The "Corriger" button carries its own vertical padding. */
	padding: 14px 14px 6px;
	background: var(--cc-soft);
}

.sav-receipt::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -8px;
	left: 0;
	height: 8px;
	background:
		linear-gradient(-45deg, transparent 5.5px, var(--cc-soft) 0) 0 0 / 12px 8px repeat-x,
		linear-gradient(45deg, transparent 5.5px, var(--cc-soft) 0) 0 0 / 12px 8px repeat-x;
}

.sav-receipt__thumb {
	grid-row: span 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 72px;
	overflow: hidden;
	border: 1px solid var(--cc-line);
	background: #fff;
	color: var(--cc-muted);
	font-size: 11px;
	font-weight: 700;
	text-decoration: none;
}

.sav-receipt__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sav-receipt__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sav-receipt__body strong {
	font-size: 15px;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.sav-receipt__body small {
	margin-bottom: 4px;
	color: var(--cc-ink);
	font-size: 13px;
	line-height: 1.35;
}

.sav-receipt__body span {
	color: var(--cc-muted);
	font-size: 13px;
	line-height: 1.45;
}

.clecod-client-space button.sav-receipt__edit {
	grid-column: 2;
	justify-self: start;
	min-height: 36px;
	margin: 0;
	padding: 6px 0;
	font-size: 12px;
}

/* One card per article: what is covered, then the action. */
/* The theme indents nested lists: reset with the app's specificity. */
.clecod-client-space .sav-articles {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.clecod-client-space .sav-article {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	border: 1px solid var(--cc-line);
	background: #fff;
}

.sav-article__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 0;
}

.sav-article__head strong {
	min-width: 0;
	font-size: 16px;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.sav-article__head span {
	flex: none;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.clecod-client-space .sav-warranties {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 14px 16px 16px;
	list-style: none;
}

.clecod-client-space .sav-warranty {
	margin: 0;
	padding: 0;
}

.sav-warranty__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	line-height: 1.3;
}

.sav-warranty__row b {
	min-width: 0;
	font-weight: 700;
}

.sav-warranty__row span {
	flex: none;
	color: var(--sav-ok);
	font-weight: 700;
}

.sav-warranty--case .sav-warranty__row span,
.sav-warranty--unknown .sav-warranty__row span {
	color: var(--sav-warn);
}

.sav-warranty--expired .sav-warranty__row {
	color: var(--sav-off);
}

.sav-warranty--expired .sav-warranty__row span {
	color: var(--sav-off);
	font-weight: 400;
}

.sav-meter {
	height: 4px;
	margin-top: 8px;
	background: var(--cc-line);
}

.sav-meter i {
	display: block;
	height: 100%;
	background: var(--sav-ok);
}

.sav-warranty small {
	display: block;
	margin-top: 6px;
	color: var(--cc-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.clecod-client-space button.sav-article__action {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-top: 1px solid var(--cc-line);
	background: #fff;
	color: var(--cc-red);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-align: left;
	text-transform: uppercase;
}

.clecod-client-space button.sav-article__action:hover {
	background: var(--cc-red);
	color: #fff;
}

.clecod-client-space button.sav-article__action.is-running {
	color: var(--cc-ink);
}

.clecod-client-space button.sav-article__action.is-running:hover {
	background: var(--cc-ink);
	color: #fff;
}

.sav-article__action svg {
	flex: none;
}

.sav-done__foot {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
}

.clecod-client-space .sav-done__foot .cc-secondary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
}

.sav-store,
.sav-attach {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sav-store {
	padding: 14px;
	background: var(--cc-soft);
}

.sav-store .sav-tip {
	margin: 0;
}

.sav-attach__label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sav-chipfile {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 8px 8px 14px;
	border: 1px solid var(--cc-line);
	background: #fff;
	font-size: 14px;
}

.sav-chipfile span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.clecod-client-space .sav-chipfile button,
.clecod-client-space .sav-previews figure button,
.clecod-client-space .sav-item__remove {
	flex: none;
	width: 40px;
	min-height: 40px;
	padding: 0;
	border: 1px solid var(--cc-line);
	background: #fff;
	font-size: 20px;
	line-height: 1;
}

.sav-item {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--cc-line);
}

.sav-item > .sav-field:first-child {
	grid-column: 1 / -1;
}

.sav-item:has(.sav-item__remove) > .sav-field:first-child {
	padding-right: 50px;
}

.clecod-client-space .sav-item__remove {
	position: absolute;
	top: 25px;
	right: 0;
	height: 52px;
}

.sav-previews {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 8px;
}

.sav-previews figure,
.sav-previews--files a {
	position: relative;
	display: block;
	margin: 0;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--cc-soft);
	color: var(--cc-muted);
	text-decoration: none;
}

.sav-previews img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.clecod-client-space .sav-previews figure button {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 32px;
	min-height: 32px;
}

.sav-previews--files a span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 12px;
	font-weight: 700;
}

.sav-previews--files a small {
	position: absolute;
	inset: auto 0 0;
	padding: 3px 6px;
	background: rgba(17, 17, 17, 0.72);
	color: #fff;
	font-size: 10px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.sav-submit {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.clecod-client-space .sav-submit button {
	width: 100%;
	min-height: 54px;
}

.sav-submit--sticky {
	position: sticky;
	bottom: 0;
	z-index: 2;
	margin: 0 -4px;
	padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}

/* Send and cancel side by side: one row in the sticky bar on a phone. */
.sav-submit--pair {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
}

.clecod-client-space .sav-submit--pair .cc-secondary {
	padding-inline: 18px;
}

/*
 * Up to 1200px the theme fixes its tab bar (Accueil, Boutique, +…) at the
 * bottom of the screen: the sticky bar sits right above it instead of under it.
 * The theme's offset already includes the iPhone safe area.
 */
@media (max-width: 1200px) {
	/* The white bar runs down to the tab bar (its centre "+" rises over it), buttons above the "+". */
	.sav-submit--sticky {
		bottom: max(0px, calc(var(--clecod-tabbar-offset, 0px) - var(--clecod-tabbar-rise, 0px) - 4px));
		padding-bottom: calc(var(--clecod-tabbar-rise, 0px) + 14px);
	}
}

.clecod-client-space .sav button[disabled] {
	opacity: 0.55;
	cursor: progress;
}

/* ---------- Ticket review ---------- */
.sav-review {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.sav-review__image {
	display: flex;
	align-items: center;
	justify-content: center;
	max-height: 260px;
	overflow: hidden;
	border: 1px solid var(--cc-line);
	background: var(--cc-soft);
	color: var(--cc-ink);
	font-size: 13px;
	font-weight: 700;
}

.sav-review__image img {
	width: 100%;
	max-height: 260px;
	object-fit: contain;
}

.sav-review__image span {
	padding: 40px 16px;
}

.sav-reading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 56px 16px;
	border: 1px solid var(--cc-line);
	background: #fff;
	text-align: center;
}

.sav-reading p {
	margin: 0;
	color: var(--cc-muted);
}

.sav-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--cc-line);
	border-top-color: var(--cc-red);
	border-radius: 50%;
	animation: sav-spin 0.9s linear infinite;
}

@keyframes sav-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.sav-spinner { animation-duration: 3s; }
}

/* ---------- Request ---------- */
.sav-progress {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sav-progress li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--sav-off);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.25;
	text-transform: uppercase;
}

.sav-progress i {
	display: block;
	height: 4px;
	background: var(--cc-line);
}

.sav-progress .is-done i {
	background: var(--cc-ink);
}

.sav-progress .is-current i {
	background: var(--cc-red);
}

.sav-progress .is-current,
.sav-progress .is-done {
	color: var(--cc-ink);
}

.sav-rdv {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 16px;
	border: 1px solid var(--cc-ink);
	border-left: 4px solid var(--cc-red);
	background: #fff;
}

.sav-rdv.is-booked {
	border-color: #bfdcc8;
	border-left-color: var(--sav-ok);
	background: var(--sav-ok-bg);
}

.sav-rdv strong {
	display: block;
	margin-top: 4px;
	font-size: 16px;
}

.sav-rdv p {
	margin: 6px 0 0;
	font-size: 14px;
}

.sav-rdv__actions {
	display: grid;
	gap: 8px;
}

.clecod-client-space .sav-rdv__actions button {
	width: 100%;
}

.sav-chat {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--cc-line);
	background: #fff;
}

.sav-thread {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: min(60vh, 520px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2px;
}

.sav-msg {
	max-width: 88%;
	padding: 10px 12px;
	background: var(--cc-soft);
}

.sav-msg small {
	display: block;
	margin-bottom: 3px;
	color: var(--cc-muted);
	font-size: 11px;
}

.sav-msg p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.sav-msg--me {
	align-self: flex-end;
	background: var(--cc-ink);
	color: #fff;
}

.sav-msg--me small {
	color: #c6c9cf;
}

.sav-msg--team {
	align-self: flex-start;
	border-left: 3px solid var(--cc-red);
}

.sav-msg--system {
	align-self: center;
	max-width: 100%;
	padding: 4px 10px;
	background: none;
	color: var(--cc-muted);
	text-align: center;
}

.sav-msg--system p {
	font-size: 12px;
}

.sav-msg--system time {
	display: block;
	font-size: 10px;
	line-height: 1.4;
}

.clecod-client-space .sav-msg p {
	margin: 0;
}

.sav-msg__files {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.sav-msg__files a {
	color: inherit;
	font-size: 13px;
}

.sav-msg__files img {
	display: block;
	width: 96px;
	height: 96px;
	object-fit: cover;
}

.sav-composer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--cc-line);
}

.clecod-client-space .sav-composer textarea {
	min-height: 64px;
}

.sav-composer__bar {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sav-composer__files {
	flex: 1;
	min-width: 0;
	color: var(--cc-muted);
	font-size: 12px;
}

/* Removes the files waiting to leave with the next message. */
.clecod-client-space .sav-composer__clear {
	flex: none;
	padding: 4px 6px;
	border: 0;
	background: none;
	color: var(--cc-muted);
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}

.clecod-client-space .sav-composer__clear[hidden] {
	display: none;
}

.clecod-client-space .sav-iconbtn {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 48px;
	min-height: 48px;
	padding: 0;
	border: 1px solid var(--cc-field);
	background: #fff;
}

.sav-detail-foot {
	display: grid;
	gap: 8px;
}

.clecod-client-space .sav-detail-foot button {
	width: 100%;
}

.sav-fold {
	border-top: 1px solid var(--cc-line);
}

.sav-fold summary {
	padding: 14px 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.sav-fold summary b {
	color: var(--cc-muted);
}

.sav-fold .cc-meta {
	margin-top: 0;
}

.sav .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Wider containers ---------- */
@container sav (min-width: 520px) {
	.sav-scan {
		grid-template-columns: 1fr 1fr;
	}

	.sav-row {
		grid-template-columns: 1fr 1fr;
	}

	.sav-request {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.clecod-client-space .sav-request > button,
	.clecod-client-space .sav-lines button {
		flex: none;
		width: auto;
	}

	.sav-lines li {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.sav-item {
		grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.2fr);
	}

	.sav-item > .sav-field:first-child {
		grid-column: auto;
		padding-right: 0;
	}

	.sav-item:has(.sav-item__remove) {
		padding-right: 50px;
	}

	.sav-item:has(.sav-item__remove) > .sav-field:first-child {
		padding-right: 0;
	}

	.sav-submit,
	.sav-rdv__actions,
	.sav-detail-foot {
		display: flex;
		flex-flow: row wrap;
	}

	.clecod-client-space .sav-submit button,
	.clecod-client-space .sav-rdv__actions button,
	.clecod-client-space .sav-detail-foot button {
		width: auto;
	}

	.sav-submit--sticky {
		position: static;
		margin: 0;
		padding: 0;
		background: none;
	}

	.sav-ticket {
		grid-template-columns: 96px minmax(0, 1fr);
	}

	.sav-ticket__thumb {
		width: 96px;
		height: 128px;
	}

	.sav-step,
	.sav-items,
	.sav-chat {
		padding: 22px;
	}

	.sav-msg {
		max-width: 76%;
	}
}

@container sav (min-width: 760px) {
	.sav-review {
		grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
		align-items: start;
	}

	.sav-review__image,
	.sav-review__image img {
		max-height: 520px;
	}

	.sav-review__image {
		position: sticky;
		top: calc(var(--cc-menu-top, 12px) + 8px);
	}
}

/* Menu entry of the account navigation. */
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--clecod-sav a { --cc-menu-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5.5c0 4.3-2.9 7.6-7 9.5-4.1-1.9-7-5.2-7-9.5V6z'/%3E%3Cpath d='M9 12l2.2 2.2L15.2 10'/%3E%3C/svg%3E"); }

/* Ticket just saved, wider screens. */
@container sav (min-width: 520px) {
	.sav-done__foot {
		flex-direction: row;
		align-items: center;
		gap: 18px;
	}

	.clecod-client-space .sav-done__foot .cc-secondary {
		padding-inline: 24px;
	}

	.sav-receipt {
		grid-template-columns: 64px minmax(0, 1fr) auto;
		align-items: center;
		padding: 16px 18px 18px;
	}

	.sav-receipt__thumb {
		grid-row: auto;
		width: 64px;
		height: 84px;
	}

	.clecod-client-space button.sav-receipt__edit {
		grid-column: auto;
		align-self: center;
	}
}

@container sav (min-width: 760px) {
	.clecod-client-space .sav-articles {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.clecod-client-space button.sav-article__action {
		margin-top: auto;
	}
}

/* Problem type and wish, wider screens. */
@container sav (min-width: 560px) {
	.sav-issues {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@container sav (min-width: 760px) {
	/* Each choice as wide as its words, rows filled edge to edge. */
	.sav-wishes {
		display: flex;
		flex-wrap: wrap;
	}

	.sav-wish {
		flex: 1 1 auto;
	}

	.sav-wish span {
		padding-inline: 18px;
		white-space: nowrap;
	}
}

/*
 * ---------- Phone (≤ 768 px): SAV home, screen 12 of the « Mon espace » canvas ----------
 * Validated on 18/11/2026, HighRev theme language: red 55×4 bar above section
 * titles, #e2e2e2 hairlines, #f4f4f4 band at the foot of cards, square corners.
 * Scoped to the SAV home screen; wider screens keep the layout above.
 */
@media (max-width: 768px) {
	/* Intro: the buttons follow the text at the app's 18px rhythm. */
	.clecod-client-space .sav[data-screen="home"] > .cc-intro {
		margin: 0;
		padding-bottom: 0;
	}

	.woocommerce-account .clecod-client-space .sav[data-screen="home"] > .cc-intro p {
		margin: 0;
		color: #3a3a3a;
		font-size: 15px;
		line-height: 1.5;
	}

	/* Scan: red action first, outlined second. */
	.clecod-client-space .sav[data-screen="home"] > .sav-scan {
		gap: 8px;
	}

	.clecod-client-space .sav[data-screen="home"] > .sav-scan button.cc-primary {
		min-height: 52px;
		font-size: 13px;
		letter-spacing: 0.04em;
	}

	.clecod-client-space .sav[data-screen="home"] > .sav-scan button.cc-secondary {
		min-height: 50px;
		border-color: #111;
		letter-spacing: 0.05em;
	}

	/* Photo advice in a grey band, with an "i". */
	.clecod-client-space .sav[data-screen="home"] > .sav-tip {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		margin: -6px 0 0;
		padding: 12px 14px;
		background: #f4f4f4;
		color: #3a3a3a;
		font-size: 13px;
		line-height: 1.45;
	}

	.clecod-client-space .sav[data-screen="home"] > .sav-tip::before {
		content: "";
		flex: none;
		width: 20px;
		height: 20px;
		background: #111;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 7.5v.01'/%3E%3C/svg%3E") center / 20px no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 7.5v.01'/%3E%3C/svg%3E") center / 20px no-repeat;
	}

	/* Sections: the theme's red bar above each title, no hairline. */
	.clecod-client-space .sav[data-screen="home"] > .sav-block {
		gap: 12px;
		margin-top: 12px;
		padding-top: 18px;
		border-top: 0;
		background: linear-gradient(#e20100, #e20100) 0 0 / 55px 4px no-repeat;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-block__title {
		flex-wrap: nowrap;
		gap: 12px;
	}

	.woocommerce-account .clecod-client-space .sav[data-screen="home"] .sav-block__title h3 {
		min-width: 0;
		margin: 0;
		font-size: 20px;
		font-weight: 700;
		line-height: 1.05;
		letter-spacing: -0.03em;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-block__title button.cc-secondary {
		flex: none;
		min-height: 44px;
		padding: 0 12px;
		border-color: #111;
		font-size: 11px;
		letter-spacing: 0.05em;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-block > .cc-help {
		padding: 16px;
		border: 1px solid #e2e2e2;
		color: #686868;
		font-size: 14px;
		line-height: 1.5;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-requests,
	.clecod-client-space .sav[data-screen="home"] .sav-tickets {
		gap: 12px;
	}

	/* Requests: same card as the Suivi screen, the way in as a grey foot band. */
	.clecod-client-space .sav[data-screen="home"] .sav-request {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0;
		border: 1px solid #e2e2e2;
		background: #fff;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request.is-todo {
		border-left: 3px solid #e20100;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request > div {
		min-width: 0;
		padding: 16px 16px 14px;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request .cc-tag {
		padding: 0;
		background: transparent;
		color: #e20100;
		font-size: 11px;
		letter-spacing: 0.12em;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request.is-closed .cc-tag {
		color: var(--sav-ok);
	}

	.woocommerce-account .clecod-client-space .sav[data-screen="home"] .sav-request h3 {
		margin: 8px 0 4px;
		font-size: 18px;
		font-weight: 700;
		line-height: 1.1;
		letter-spacing: -0.025em;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request p {
		color: #686868;
		font-size: 13px;
		line-height: 1.45;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request > button {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		width: 100%;
		min-height: 50px;
		padding: 0 16px;
		border: 0;
		background: #f4f4f4;
		color: #111;
		font-size: 12px;
		letter-spacing: 0.05em;
		text-align: left;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request.is-todo > button {
		color: #e20100;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request > button::after {
		content: "→";
		content: "→" / "";
		font-size: 16px;
		letter-spacing: 0;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-request > button:hover {
		background: #ebebeb;
		color: #111;
	}

	/* Tickets: picture and shop on top, one row per article, then the grey band. */
	.clecod-client-space .sav[data-screen="home"] .sav-ticket {
		grid-template-columns: 90px minmax(0, 1fr);
		gap: 0;
		padding: 0;
		border: 1px solid #e2e2e2;
		background: #fff;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket.is-draft {
		border: 1px dashed #bdbdbd;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__thumb {
		width: 60px;
		height: 78px;
		margin: 16px 0 14px 16px;
		border: 1px solid #e2e2e2;
		background: #f4f4f4;
		color: #686868;
	}

	/* The body's parts become rows of the card itself (no box of their own). */
	.clecod-client-space .sav[data-screen="home"] .sav-ticket__body {
		display: contents;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__head {
		grid-column: 2;
		align-self: start;
		min-width: 0;
		padding: 16px 16px 14px 0;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__head strong {
		font-size: 14px;
		font-weight: 700;
		line-height: 1.3;
		letter-spacing: 0.03em;
		text-transform: uppercase;
		overflow-wrap: anywhere;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__head span {
		margin-top: 4px;
		color: #686868;
		font-size: 13px;
		line-height: 1.4;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket .sav-lines {
		grid-column: 1 / -1;
		margin: 0;
		padding: 0 16px;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-lines li {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		margin: 0;
		padding: 14px 0 16px;
		border-top: 1px solid #e2e2e2;
	}

	/* Article and price on one line, warranties below. */
	.clecod-client-space .sav[data-screen="home"] .sav-ticket .sav-lines li > div {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0 12px;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-lines li > div > strong {
		font-size: 15px;
		font-weight: 600;
		line-height: 1.35;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket .sav-lines li > div > strong {
		flex: 1 1 0;
		min-width: 0;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket .sav-lines li > div > span:not(.sav-cover) {
		flex: none;
		margin-left: auto;
		color: #686868;
		font-size: 15px;
		font-variant-numeric: tabular-nums;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-lines .sav-covers {
		flex: 1 0 100%;
		margin-top: 10px;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-cover--expired {
		color: #5e5e5e;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-lines button.cc-secondary {
		align-self: flex-start;
		width: auto;
		min-height: 44px;
		padding: 0 16px;
		border-color: #111;
		font-size: 11px;
		letter-spacing: 0.05em;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__foot {
		grid-column: 1 / -1;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 18px;
		min-height: 48px;
		margin: 0;
		padding: 0 16px;
		background: #f4f4f4;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__foot button {
		min-height: 44px;
		padding: 0;
		color: #111;
		font-size: 12px;
		letter-spacing: 0.05em;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__foot button.sav-link--quiet {
		color: #5e5e5e;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket.is-draft .sav-ticket__foot button:first-child {
		color: #e20100;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket.is-draft .sav-ticket__foot button:first-child::after {
		content: " →";
		content: " →" / "";
	}

	.clecod-client-space .sav[data-screen="home"] .sav-ticket__foot button:hover {
		color: #e20100;
	}

	/* Online purchases: a plain list, a hairline under each one. */
	.clecod-client-space .sav[data-screen="home"] .sav-lines--orders {
		margin: -6px 0 0;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-lines--orders li,
	.clecod-client-space .sav[data-screen="home"] .sav-lines--orders li:first-child {
		padding: 14px 0 16px;
		border-top: 0;
		border-bottom: 1px solid #e2e2e2;
	}

	.clecod-client-space .sav[data-screen="home"] .sav-lines--orders li > div > span:not(.sav-cover) {
		margin-top: 3px;
		color: #686868;
		font-size: 13px;
		line-height: 1.4;
	}
}
