/**
 * Artisanely — calculators (hub /calculateurs/, tool pages, and the travaux-calculateurs plugin themed with the site
 * tokens). « Le journal d’atelier »: encre header with a brass rule, Nº-numbered steps in the serif italic, square
 * fields with visible labels (unit in the label), sang de bœuf « Calculer », encre outline « Réinitialiser », result
 * on lin with the key figure in large serif first, « Demander un devis » under the result.
 * Loaded by inc/50-calculators.php on the hub, on tool pages and wherever a [tc_calculator] is embedded.
 * Mobile first; container queries inside the calculator card (it can sit in any column).
 *
 * Contents: 1 plugin tokens · 2 calculator card · 3 steps and fields · 4 rows · 5 actions · 6 result · 7 wide card ·
 * 8 heroes (hub carnet, tool fiche) · 9 hub shelves and tool cards · 10 tool page · 11 breakpoints · 12 motion, print
 */

/* ── 1. Plugin tokens (--tc-*, contract of the travaux-calculateurs plugin) ── */
.tc-calc {
	--tc-bg: var(--ae-base);
	--tc-primary: var(--ae-ink);
	--tc-primary-soft: var(--ae-brass-light);
	--tc-secondary: var(--ae-blue);
	--tc-cta: var(--ae-oxblood);
	--tc-accent: var(--ae-brass);
	--tc-accent-text: var(--ae-oxblood);
	--tc-link: var(--ae-blue);
	--tc-muted: var(--ae-taupe);
	--tc-line: var(--ae-line);
	--tc-field-border: #857A74; /* 4.3:1 on white: UI contrast ≥ 3:1 */
	--tc-surface: var(--ae-linen);
	--tc-surface-alt: #FAF6F0;
	--tc-error: var(--ae-oxblood);
	--tc-radius: 2px;
	--tc-radius-control: 2px;
	--tc-font-head: var(--ae-serif);
	--tc-font-text: var(--ae-sans);
	--tc-shadow: 0 34px 60px -46px rgb(32 27 30 / 0.55);
}

/* ── 2. Calculator card ──────────────────────────────── */
.tc-calc {
	overflow: clip; /* not hidden: keeps the sticky result working on wide cards */
	margin: 0;
	border: 1px solid var(--ae-ink);
	font-size: 1rem;
}
.tc-calc__head {
	padding: 1.25rem 1.1rem 1.5rem;
	background-color: var(--ae-ink);
	background-image:
		repeating-linear-gradient(90deg, rgb(201 162 91 / 0.28) 0 1px, transparent 1px 12px),
		repeating-linear-gradient(90deg, rgb(201 162 91 / 0.55) 0 1px, transparent 1px 60px);
	background-size: 100% 7px, 100% 14px;
	background-repeat: no-repeat;
	background-position: 0 100%, 0 100%;
}
.tc-calc__head::before { display: none; }
.tc-calc__head::after { height: 4px; background: none; border-top: 1px solid var(--ae-linen); border-bottom: 1px solid var(--ae-brass); bottom: 14px; left: 1.1rem; right: auto; width: 72px; }
.tc-calc .tc-calc__badge { gap: 0.45rem; color: var(--ae-brass-light); font-family: var(--ae-sans); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.01em; }
.tc-calc .tc-calc__badge .ae-glyph { width: 18px; height: 18px; }
.tc-calc .tc-calc__title {
	margin: 0.5rem 0 0.35rem;
	color: var(--ae-base);
	font-family: var(--ae-serif);
	font-size: clamp(1.55rem, 6cqi, 2.15rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.015em;
}
.tc-calc .tc-calc__sub { max-width: 60ch; padding-bottom: 1.1rem; color: var(--ae-linen); font-size: 1rem; line-height: 1.5; }
.tc-calc .tc-calc__notice { border-radius: 0; background: var(--ae-linen); border: 1px solid var(--ae-brass); color: var(--ae-ink); }
.tc-calc .tc-calc__notice::before { background: var(--ae-oxblood); color: var(--ae-base); }

/* ── 3. Steps and fields ─────────────────────────────── */
.tc-calc__inputs { padding: 0.25rem 1.1rem 0; }
.tc-step { padding: 1.4rem 0 1.5rem; border-bottom: 1px solid var(--ae-line); }
.tc-calc .tc-step__title {
	align-items: baseline;
	gap: 0.75rem;
	margin: 0 0 1.1rem;
	font-family: var(--ae-serif);
	font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.5rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
}
.tc-calc .tc-step__num {
	display: inline;
	width: auto;
	height: auto;
	border-radius: 0;
	background: none;
	color: var(--ae-brass-text);
	font-family: var(--ae-serif);
	font-size: 1.05rem;
	font-style: italic;
	font-weight: 400;
	font-variant-numeric: lining-nums tabular-nums;
}
.tc-calc .tc-step__num::before { content: "Nº\00a0" "0"; }
.tc-calc__grid { gap: 1.15rem; }
.tc-field > label,
.tc-field > legend,
.tc-rows__legend { margin-bottom: 0.4rem; font-family: var(--ae-sans); font-size: 0.975rem; font-weight: 600; line-height: 1.35; color: var(--ae-ink); }
.tc-field__opt { margin-left: 0.15rem; color: var(--ae-taupe); font-size: 0.85rem; font-weight: 400; font-style: italic; }
.tc-field__control { min-height: 52px; border: 1px solid var(--tc-field-border); background: var(--ae-base); box-shadow: inset 0 1px 0 rgb(32 27 30 / 0.04); }
.tc-field__control:hover { border-color: var(--ae-ink); }
.tc-field__control:focus-within { border-color: var(--ae-blue); box-shadow: 0 0 0 3px rgb(44 63 122 / 0.28); }
.tc-calc .tc-field__control input,
.tc-calc .tc-field__control select { min-height: 50px; padding: 0.7rem 0.85rem; color: var(--ae-ink); font-family: var(--ae-sans); font-size: 1.0625rem; }
.tc-calc .tc-field__control select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23201B1E' stroke-width='1.8' fill='none'/%3E%3C/svg%3E"); }
.tc-calc .tc-field__control input[type="date"] { min-width: 0; appearance: none; -webkit-appearance: none; }
.tc-calc .tc-field__control input::placeholder { color: #8C817B; }
.tc-field__unit { color: var(--ae-taupe); font-size: 0.9375rem; }
.tc-field__help { margin-top: 0.4rem; color: var(--ae-taupe); font-size: 0.875rem; line-height: 1.5; }
.tc-field__error { color: var(--ae-oxblood); }
.tc-field__error::before { background: var(--ae-oxblood); }
.tc-field__control:has([aria-invalid="true"]) { border-color: var(--ae-oxblood); background: #FBF3F3; box-shadow: inset 3px 0 0 var(--ae-oxblood); }

/* Pills: a segmented rule of choices; the chosen one in encre. */
.tc-pills { gap: 0; padding: 0; border: 1px solid var(--tc-field-border); border-radius: 0; background: var(--ae-base); grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr)); }
.tc-pill + .tc-pill span { box-shadow: inset 1px 0 0 var(--ae-line); }
.tc-pill span { min-height: 50px; padding: 0.55rem 0.8rem; border-radius: 0; color: var(--ae-ink); font-size: 0.95rem; font-weight: 600; }
.tc-pill:hover span { background: var(--ae-linen); }
.tc-pill input:checked + span { background: var(--ae-ink); color: var(--ae-base); box-shadow: none; }
.tc-pill input:checked + span::before { content: ""; flex: none; width: 7px; height: 7px; margin-right: 0.5rem; background: var(--ae-brass); transform: rotate(45deg); }
.tc-pill input:focus-visible + span { outline: 3px solid var(--ae-blue); outline-offset: -3px; }

/* ── 4. Repeatable rows ──────────────────────────────── */
.tc-calc .tc-row { padding: 0.7rem 0.9rem 1rem; border: 1px solid var(--ae-line); border-left: 3px solid var(--ae-brass); border-radius: 0; background: var(--tc-surface-alt); }
.tc-row__title { font-family: var(--ae-serif); font-style: italic; font-weight: 600; font-size: 1.1rem; color: var(--ae-ink); }
.tc-row__title::before { display: none; }
.tc-row__remove { border-radius: 0; color: var(--ae-oxblood); }
.tc-row__remove:hover { background: #F6E7E9; }
.tc-rows__add { border: 1px dashed var(--ae-blue); border-radius: 0; color: var(--ae-blue); font-family: var(--ae-sans); font-weight: 600; }
.tc-rows__add:hover { background: var(--ae-blue-tint); border-style: solid; }

/* ── 5. Errors and actions ───────────────────────────── */
.tc-calc__errors { border: 1px solid rgb(125 36 51 / 0.45); border-left: 3px solid var(--ae-oxblood); border-radius: 0; background: #FBF3F3; color: #5E1A26; }
.tc-calc__actions { gap: 0.75rem; margin: 1.4rem 0 1.6rem; }
.tc-calc__btn { min-height: 54px; padding: 0.8rem 1.6rem; border-radius: var(--ae-radius); font-family: var(--ae-sans); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0.005em; }
.tc-calc__btn--go { background: var(--ae-oxblood); color: var(--ae-base); box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.22); }
.tc-calc__btn--go:hover { background: var(--ae-ink); }
.tc-calc__btn--go:active { box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.22); }
.tc-calc__btn--reset { border: 1px solid var(--ae-ink); background: transparent; color: var(--ae-ink); }
.tc-calc__btn--reset:hover { background: var(--ae-ink); color: var(--ae-base); }

/* ── 6. Result (key figure first) ────────────────────── */
.tc-calc__results { padding: 1.4rem 1.1rem 1.5rem 1.35rem; border-top: 1px solid var(--ae-ink); background: var(--ae-linen); scroll-margin-top: 1rem; }
.tc-calc__results::before { width: 4px; background: var(--ae-brass); box-shadow: 2px 0 0 var(--ae-linen), 3px 0 0 var(--ae-ink); }
.tc-calc .tc-calc__empty {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	margin: 0;
	padding: 1rem 1.1rem;
	border: 1px dashed rgb(101 92 91 / 0.55);
	background: var(--ae-base);
	color: var(--ae-taupe);
	font-family: var(--ae-serif);
	font-style: italic;
	font-size: 1.1rem;
	line-height: 1.4;
}
.tc-calc__key { gap: 0.2rem; margin: 0.25rem 0 1.25rem; }
.tc-calc__key-label { color: var(--ae-ink); font-family: var(--ae-sans); font-weight: 600; font-size: 0.975rem; }
.tc-calc__key-value {
	color: var(--ae-oxblood);
	font-family: var(--ae-serif);
	font-size: clamp(2.5rem, 12cqi, 3.6rem);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.02em;
	font-variant-numeric: lining-nums tabular-nums;
}
.tc-calc__key-value.is-long { font-size: clamp(1.7rem, 7cqi, 2.4rem); line-height: 1.1; }
.tc-calc__key-value::after { width: 72px; height: 4px; margin-top: 0.85rem; border-radius: 0; background: none; border-top: 1px solid var(--ae-ink); border-bottom: 1px solid var(--ae-brass); }
.tc-calc .tc-calc__list { padding: 0.15rem 1rem; border: 1px solid var(--ae-line); border-radius: 0; background: var(--ae-base); box-shadow: none; }
.tc-calc__item { padding: 0.7rem 0; border-top: 1px solid var(--ae-line); }
.tc-calc .tc-calc__item dt { gap: 0.6rem; color: var(--ae-ink); font-size: 0.95rem; }
.tc-calc .tc-calc__item dd { color: var(--ae-ink); font-weight: 700; }
.tc-calc__item.is-wide dd { margin-left: 2.35rem; font-weight: 500; line-height: 1.5; }
.tc-calc__icon { width: 28px; height: 28px; padding: 5px; background: var(--ae-blue-tint); color: var(--ae-blue); box-shadow: none; }
.tc-calc__detail { margin-top: 1rem; border: 1px solid var(--ae-line); border-radius: 0; background: var(--ae-base); }
.tc-calc__detail summary { min-height: 48px; color: var(--ae-blue); font-family: var(--ae-sans); font-weight: 600; }
.tc-calc .tc-calc__detail-list { padding: 0 1rem 1rem 1.6rem; list-style: none; counter-reset: ae-dt; color: var(--ae-ink); font-size: 0.925rem; line-height: 1.6; }
.tc-calc .tc-calc__detail-list li { position: relative; counter-increment: ae-dt; padding-left: 0.2rem; }
.tc-calc .tc-calc__detail-list li::before { content: counter(ae-dt, decimal-leading-zero); position: absolute; left: -1.45rem; top: 0.1rem; color: var(--ae-brass-text); font-family: var(--ae-serif); font-style: italic; font-size: 0.85rem; }
.tc-calc .tc-calc__note { margin-top: 1rem; color: var(--ae-taupe); font-size: 0.875rem; }
.tc-calc__note strong { color: var(--ae-ink); }
.tc-calc__tools { gap: 0.6rem; margin-top: 1rem; }
.tc-calc__tool { min-height: 46px; border: 1px solid var(--ae-ink); border-radius: var(--ae-radius); background: transparent; color: var(--ae-ink); font-family: var(--ae-sans); }
.tc-calc__tool:hover { background: var(--ae-base); border-color: var(--ae-ink); }
.tc-calc__tool.is-copied { border-color: var(--ae-blue); color: var(--ae-blue); }
.tc-calc__results.is-stale .tc-step__title::after { color: var(--ae-oxblood); font-family: var(--ae-sans); font-style: normal; }

/* « Demander un devis » under the result. */
.tc-calc .tc-calc__devis {
	display: grid;
	gap: 0.75rem;
	flex: 1 1 100%;
	margin: 0.6rem 0 0;
	padding: 1rem 0 0;
	border-top: 1px dashed rgb(101 92 91 / 0.6);
	font-size: 0.975rem;
	line-height: 1.5;
	color: var(--ae-ink);
}
.tc-calc__devis span { font-family: var(--ae-serif); font-style: italic; font-size: 1.1rem; }
.tc-calc__devis .ae-btn { justify-self: stretch; min-height: 50px; }

/* ── 7. Wide card: form left, result right (sticky) ──── */
@container (min-width: 560px) {
	.tc-calc__head { padding: 1.6rem 2rem 1.8rem; }
	.tc-calc__head::after { left: 2rem; }
	.tc-calc__inputs { padding: 0.25rem 2rem 0; }
	.tc-calc__results { padding: 1.6rem 2rem 1.75rem 2.25rem; }
	.tc-calc__devis { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
	.tc-calc__devis .ae-btn { justify-self: end; }
}
@container (min-width: 940px) {
	.tc-calc__form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
	.tc-calc__inputs { padding-right: 2.25rem; border-right: 1px solid var(--ae-line); }
	.tc-calc__results { position: sticky; top: 1rem; border-top: 0; min-height: 100%; box-sizing: border-box; }
	.tc-calc__list { grid-template-columns: minmax(0, 1fr); }
	.tc-calc__item:nth-child(2) { border-top: 1px solid var(--ae-line); }
	.tc-calc__devis { grid-template-columns: minmax(0, 1fr); }
	.tc-calc__devis .ae-btn { justify-self: stretch; }
}

/* ── 8. Heroes ───────────────────────────────────────── */
.ae-calc-hero { padding-top: clamp(2.25rem, 1.5rem + 3.5vw, 4.5rem); }
.ae-calc-hero__inner { display: grid; gap: 2.5rem; padding-bottom: clamp(2.25rem, 1.5rem + 2.5vw, 4rem); }
.ae-calc-hero__main { min-width: 0; }
.ae-calc-hero .ae-hero__title { max-width: 18ch; }
.ae-calc-hero--hub .ae-hero__title { font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.4rem); line-height: 0.98; }
.ae-calc-hero .ae-hero__title em { font-style: italic; font-weight: 500; color: var(--ae-oxblood); }
.ae-calc-hero__crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.55rem; margin: 0 0 0.9rem; font-weight: 600; font-size: 0.9375rem; }
.ae-calc-hero__crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ae-brass-text); text-decoration: none; }
.ae-calc-hero__crumbs a:hover { color: var(--ae-oxblood); text-decoration: underline; }
.ae-calc-hero__crumbs span { color: var(--ae-taupe); }
.ae-calc-hero__no { margin: 0 0 0.85rem; font-family: var(--ae-serif); font-style: italic; font-size: 1.3rem; line-height: 1.2; color: var(--ae-brass-text); }
.ae-calc-hero__no span { color: var(--ae-taupe); font-size: 0.85em; }
.ae-calc-hero--tool .ae-hero__title { font-size: clamp(2.1rem, 1.35rem + 3.1vw, 3.9rem); max-width: 20ch; }
.ae-calc-hero__facts { display: flex; flex-wrap: wrap; gap: 0.45rem 1.4rem; margin: 1.6rem 0 0; padding: 0.95rem 0 0; border-top: 1px solid var(--ae-ink); list-style: none; font-size: 0.975rem; }
.ae-calc-hero__facts li { display: inline-flex; align-items: center; gap: 0.4rem; }
.ae-calc-hero__facts strong { font-family: var(--ae-serif); font-size: 1.25rem; font-weight: 600; }
.ae-calc-hero__facts .ae-glyph { color: var(--ae-oxblood); }
.ae-calc-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; }

/* Hub: the carnet de cotes — squared sheet in a passe-partout, brass ruler on top, the maker's mark as a stamp. */
.ae-carnet, .ae-fiche { position: relative; align-self: center; padding: 12px; background: var(--ae-base); border: 1px solid var(--ae-brass); box-shadow: 0 30px 50px -36px rgb(32 27 30 / 0.6); }
.ae-carnet__sheet {
	position: relative;
	padding: 2rem 1.1rem 1.1rem;
	background-color: #FBFAF7;
	background-image:
		linear-gradient(90deg, var(--ae-brass) 0 1px, transparent 1px),
		repeating-linear-gradient(90deg, rgb(122 90 30 / 0.7) 0 1px, transparent 1px 10px),
		repeating-linear-gradient(90deg, rgb(122 90 30 / 0.9) 0 1px, transparent 1px 50px),
		linear-gradient(rgb(44 63 122 / 0.09) 1px, transparent 1px),
		linear-gradient(90deg, rgb(44 63 122 / 0.09) 1px, transparent 1px);
	background-size: 100% 1px, 100% 7px, 100% 13px, 18px 18px, 18px 18px;
	background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
	background-position: 0 13px, 0 0, 0 0, 0 0, 0 0;
	outline: 1px solid rgb(32 27 30 / 0.12);
}
.ae-carnet__stamp { position: absolute; top: -1.6rem; right: -0.6rem; width: 92px; height: 92px; color: var(--ae-oxblood); transform: rotate(9deg); background: radial-gradient(circle, rgb(255 255 255 / 0.85) 0 62%, transparent 63%); }
.ae-carnet__eyebrow { margin: 0; font-weight: 600; font-size: 0.875rem; color: var(--ae-blue); }
.ae-carnet__title { margin: 0.2rem 0 0.9rem; padding-right: 4.5rem; font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); font-weight: 600; font-style: italic; line-height: 1.1; }
.ae-carnet__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ae-ink); }
.ae-carnet__list li { border-bottom: 1px solid var(--ae-line); }
.ae-carnet__list a { display: flex; align-items: center; gap: 0.6rem; min-height: 50px; color: var(--ae-ink); text-decoration: none; }
.ae-carnet__list a:hover .ae-carnet__name { color: var(--ae-oxblood); text-decoration: underline; }
.ae-carnet__no { flex: none; width: 2.6rem; font-family: var(--ae-serif); font-style: italic; color: var(--ae-brass-text); }
.ae-carnet__icon { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ae-oxblood); color: var(--ae-linen); box-shadow: inset 0 0 0 2px var(--ae-oxblood), inset 0 0 0 3px var(--ae-brass); }
.ae-carnet__name { font-family: var(--ae-serif); font-weight: 600; font-size: 1.1rem; line-height: 1.15; }
.ae-carnet__dots { flex: 1; min-width: 1rem; align-self: center; margin-top: 0.4rem; border-bottom: 2px dotted rgb(101 92 91 / 0.55); }
.ae-carnet__count { flex: none; font-weight: 600; font-size: 0.875rem; color: var(--ae-taupe); font-variant-numeric: tabular-nums; }
.ae-carnet__foot { margin: 0.9rem 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ae-taupe); }

/* Tool: the fiche de l’outil — a bristol card with punched holes and an oxblood margin line. */
.ae-fiche__sheet {
	position: relative;
	padding: 1.2rem 1.1rem 1.25rem 2.6rem;
	background:
		linear-gradient(90deg, transparent 1.85rem, rgb(125 36 51 / 0.55) 1.85rem 1.95rem, transparent 1.95rem),
		repeating-linear-gradient(transparent 0 31px, rgb(44 63 122 / 0.1) 31px 32px),
		var(--ae-linen);
	outline: 1px solid rgb(32 27 30 / 0.12);
}
.ae-fiche__sheet::before { content: ""; position: absolute; left: 0.55rem; top: 1.4rem; bottom: 1.4rem; width: 11px; background: radial-gradient(circle at 50% 50%, var(--ae-base) 0 4.5px, rgb(32 27 30 / 0.25) 5px, transparent 5.5px) 0 0 / 11px 46px repeat-y; }
.ae-fiche__head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; padding-right: 4.5rem; font-family: var(--ae-serif); font-style: italic; font-weight: 600; font-size: 1.25rem; line-height: 1.15; }
.ae-fiche__no { color: var(--ae-brass-text); font-weight: 400; }
.ae-fiche .ae-roundel { flex: none; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--ae-oxblood); color: var(--ae-linen); box-shadow: inset 0 0 0 3px var(--ae-oxblood), inset 0 0 0 4px var(--ae-brass); }
.ae-fiche__label { margin: 0; font-weight: 600; font-size: 0.875rem; color: var(--ae-blue); }
.ae-fiche__key { margin: 0.15rem 0 0.9rem; font-family: var(--ae-serif); font-weight: 600; font-size: clamp(1.45rem, 1.25rem + 0.9vw, 1.9rem); line-height: 1.1; color: var(--ae-oxblood); }
.ae-fiche__unit { display: inline-block; margin-left: 0.45rem; padding: 0.05rem 0.45rem; border: 1px solid currentColor; font-family: var(--ae-sans); font-size: 0.8rem; font-weight: 600; line-height: 1.5; vertical-align: 0.3em; }
.ae-fiche__list { display: grid; gap: 0.35rem; margin: 0; padding: 0.75rem 0 0; border-top: 1px solid var(--ae-ink); list-style: none; font-size: 0.95rem; line-height: 1.4; }
.ae-fiche__list li { display: flex; align-items: center; gap: 0.45rem; }
.ae-fiche__list .ae-glyph { flex: none; color: var(--ae-oxblood); }
.ae-fiche__list .ae-fiche__unit { margin-left: auto; color: var(--ae-taupe); vertical-align: 0; }
.ae-fiche__prep { margin: 0.9rem 0 0; padding-top: 0.75rem; border-top: 1px dashed rgb(101 92 91 / 0.55); font-size: 0.9rem; line-height: 1.5; color: var(--ae-ink); }
.ae-fiche__prep strong { display: block; font-family: var(--ae-serif); font-style: italic; font-weight: 600; font-size: 1rem; color: var(--ae-brass-text); }
.ae-fiche__stamp { position: absolute; top: -1.4rem; right: -0.5rem; width: 84px; height: 84px; color: var(--ae-oxblood); transform: rotate(-8deg); background: radial-gradient(circle, rgb(245 239 230 / 0.9) 0 62%, transparent 63%); }

/* ── 9. Hub shelves and tool cards ───────────────────── */
.ae-calc-shelf { padding-block: clamp(2.75rem, 2rem + 3vw, 4.5rem); }
.ae-calc-shelf--alt { background: var(--ae-base); }
.ae-calc-shelf .ae-shead { margin-bottom: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }
.ae-tools { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.ae-tools > li { margin: 0; }
.ae-tool {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	height: 100%;
	box-sizing: border-box;
	padding: 1.15rem 1.2rem 1.1rem;
	background: var(--ae-base);
	border: 1px solid var(--ae-line);
	border-top: 3px double var(--ae-ink);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ae-calc-shelf--alt .ae-tool { background: var(--ae-linen); }
.ae-tool:hover { border-color: var(--ae-brass); border-top-color: var(--ae-ink); box-shadow: 0 22px 34px -30px rgb(32 27 30 / 0.7); }
.ae-tool__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ae-tool__icon { display: inline-grid; place-items: center; width: 52px; height: 52px; background: var(--ae-blue); color: var(--ae-base); }
.ae-tool.is-soon .ae-tool__icon { background: var(--ae-blue-tint); color: var(--ae-blue); }
.ae-tool__no { font-size: 1.2rem; }
.ae-tool__title { margin: 0.2rem 0 0; font-family: var(--ae-serif); font-weight: 600; font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.6rem); line-height: 1.1; }
.ae-tool__title a { color: var(--ae-ink); text-decoration: none; }
.ae-tool__title a::after { content: ""; position: absolute; inset: 0; }
.ae-tool:hover .ae-tool__title a { color: var(--ae-oxblood); }
.ae-tool__title a:focus-visible { outline: none; }
.ae-tool:has(.ae-tool__title a:focus-visible) { outline: 3px solid var(--ae-focus); outline-offset: 2px; }
.ae-tool__line { margin: 0; color: var(--ae-taupe); font-size: 0.975rem; line-height: 1.55; }
.ae-tool__gives { margin: 0; padding-top: 0.6rem; border-top: 1px dashed rgb(101 92 91 / 0.45); font-size: 0.9rem; line-height: 1.5; color: var(--ae-ink); }
.ae-tool__gives-label { display: block; font-family: var(--ae-serif); font-style: italic; font-size: 0.975rem; color: var(--ae-brass-text); }
.ae-tool__foot { display: flex; margin: auto 0 0; padding-top: 0.35rem; }
.ae-tool__go { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; font-weight: 700; font-size: 0.9375rem; color: var(--ae-oxblood); text-decoration: underline; text-underline-offset: 0.2em; }
.ae-tool__go::before { content: ""; width: 18px; height: 8px; border: 1px solid currentColor; background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 4px) 0 0 / 100% 4px no-repeat; }

/* ── 10. Tool page ───────────────────────────────────── */
.ae-calc-stage { padding-block: clamp(1.75rem, 1.25rem + 2vw, 3rem) clamp(2.25rem, 1.75rem + 2vw, 3.5rem); scroll-margin-top: 0.5rem; }
.ae-calc-stage .ae-wrap > .tc-calc { margin-inline: auto; }
.ae-calc-guide { scroll-margin-top: 1rem; }
.ae-main--calc-hub .ae-calc-guide { margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); }
.ae-calc-related { padding-block: 0 var(--ae-section); }
.ae-calc-related .ae-tool { background: var(--ae-base); }

/* ── 11. Breakpoints ─────────────────────────────────── */
/* Phones: the tool hero stays short so the form comes quickly (the fiche repeats what the result shows). */
@media (max-width: 599px) {
	.ae-calc-hero--tool .ae-fiche { display: none; }
	.ae-calc-hero--tool .ae-calc-hero__inner { padding-bottom: 1.75rem; }
}
@media (min-width: 600px) {
	.ae-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
	.ae-carnet__sheet { padding: 2.25rem 1.6rem 1.4rem; }
	.ae-fiche__sheet { padding: 1.4rem 1.5rem 1.4rem 3rem; }
	.ae-carnet__stamp { width: 112px; height: 112px; top: -2rem; right: -1.1rem; }
	.ae-calc-hero--tool .ae-calc-hero__inner { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1024px) {
	.ae-calc-hero__inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 4.5rem; align-items: center; }
	.ae-calc-hero--tool .ae-calc-hero__inner { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
	.ae-carnet { transform: rotate(-1.2deg); }
	.ae-fiche { transform: rotate(0.8deg); }
	.ae-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
	/* Hub shelf: the rubrique head on the left (sticky), its tools on the right, two per row. */
	.ae-calc-shelf { padding-block: clamp(2.5rem, 2rem + 2vw, 3.75rem); }
	.ae-calc-shelf > .ae-wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.1fr); gap: 3.5rem; align-items: start; }
	.ae-calc-shelf .ae-shead { position: sticky; top: 1.5rem; display: block; margin: 0; }
	.ae-calc-shelf .ae-shead__no { margin-bottom: 0.4rem; }
	.ae-calc-shelf .ae-shead__title { font-size: clamp(2rem, 1.5rem + 1.4vw, 2.75rem); }
	.ae-calc-shelf .ae-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1440px) {
	.ae-calc-hero__inner { gap: 6rem; }
}

/* ── 12. Motion and print ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.ae-tool { transition: none; }
}
@media print {
	.ae-calc-hero, .ae-calc-related, .ae-devis, .tc-calc__devis { display: none !important; }
	.tc-calc__head { background: none !important; }
}
