/* FF — palettes communes. Spécificité supérieure aux styles Angular et aux anciens thèmes. */
html:root[data-ff-theme="cool"] {
  color-scheme: light;
  --bg: #eef3f0;
  --surface: #ffffff;
  --surface-2: #e3ebe6;
  --surface-3: #d5e0d9;
  --surface-hover: #e3ebe6;
  --border: #c3d2c9;
  --border-strong: #4e675d;
  --text: #14332b;
  --text-2: #38554c;
  --text-3: #4e675d;
  --accent: #0f6b5c;
  --ff-accent: #0f6b5c;
  --accent-strong: #0b5649;
  --accent-ink: #0f6b5c;
  --on-accent: #ffffff;
  --r-md: 14px;
  --r-lg: calc(14px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #16703b;
  --warn: #8e530a;
  --danger: #b42335;
  --info: #2454b8;
  --on-ok: #ffffff;
  --scrim: #10213966;
}
html:root[data-ff-theme="studio"] {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #ebebe8;
  --surface-3: #e0e0dc;
  --surface-hover: #ebebe8;
  --border: #cfcfca;
  --border-strong: #5c6066;
  --text: #1a1c1e;
  --text-2: #44474b;
  --text-3: #5c6066;
  --accent: #1f2328;
  --ff-accent: #1f2328;
  --accent-strong: #0b0d0f;
  --accent-ink: #1f2328;
  --on-accent: #ffffff;
  --r-md: 8px;
  --r-lg: calc(8px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #16703b;
  --warn: #8e530a;
  --danger: #b42335;
  --info: #2454b8;
  --on-ok: #ffffff;
  --scrim: #10213966;
}
html:root[data-ff-theme="graphite"] {
  color-scheme: dark;
  --bg: #14181d;
  --surface: #1c2229;
  --surface-2: #252c35;
  --surface-3: #2f3742;
  --surface-hover: #252c35;
  --border: #3b4552;
  --border-strong: #9ea9b5;
  --text: #e8ecf0;
  --text-2: #c0c8d1;
  --text-3: #9ea9b5;
  --accent: #e6b45a;
  --ff-accent: #e6b45a;
  --accent-strong: #f2c97e;
  --accent-ink: #e6b45a;
  --on-accent: #1d1405;
  --r-md: 10px;
  --r-lg: calc(10px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #6ee7a0;
  --warn: #ff9a62;
  --danger: #ff969e;
  --info: #92c5ff;
  --on-ok: #102818;
  --scrim: #05080cb3;
}
html:root[data-ff-theme="signature"] {
  color-scheme: light;
  --bg: #f1efeb;
  --surface: #fbfaf8;
  --surface-2: #e8e4dd;
  --surface-3: #dcd6cc;
  --surface-hover: #e8e4dd;
  --border: #cbc3b6;
  --border-strong: #6b5d50;
  --text: #2a211a;
  --text-2: #54473b;
  --text-3: #6b5d50;
  --accent: #86570e;
  --ff-accent: #86570e;
  --accent-strong: #6c460b;
  --accent-ink: #86570e;
  --on-accent: #ffffff;
  --r-md: 16px;
  --r-lg: calc(16px + 6px);
  --display: "Bebas Neue", "DM Sans", Impact, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #16703b;
  --warn: #a1460e;
  --danger: #b42335;
  --info: #2454b8;
  --on-ok: #ffffff;
  --scrim: #2a211a66;
}
html:root[data-ff-theme="cosmic"] {
  color-scheme: dark;
  --bg: #0c1a1f;
  --surface: #13252b;
  --surface-2: #1b323a;
  --surface-3: #234049;
  --surface-hover: #1b323a;
  --border: #2f4d56;
  --border-strong: #96b5b2;
  --text: #e6f2f1;
  --text-2: #bdd5d3;
  --text-3: #96b5b2;
  --accent: #6fd3d0;
  --ff-accent: #6fd3d0;
  --accent-strong: #9be3e0;
  --accent-ink: #6fd3d0;
  --on-accent: #062520;
  --r-md: 20px;
  --r-lg: calc(20px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #8fe39a;
  --warn: #ffc46b;
  --danger: #ff969e;
  --info: #92c5ff;
  --on-ok: #0d2a12;
  --scrim: #020a0db3;
}
html:root[data-ff-theme="glacier"] {
  color-scheme: light;
  --bg: #edf2f7;
  --surface: #ffffff;
  --surface-2: #e1e9f1;
  --surface-3: #d3dde8;
  --surface-hover: #e1e9f1;
  --border: #bfcddc;
  --border-strong: #4c6177;
  --text: #11253a;
  --text-2: #354b62;
  --text-3: #4c6177;
  --accent: #245d8f;
  --ff-accent: #245d8f;
  --accent-strong: #1b4a73;
  --accent-ink: #245d8f;
  --on-accent: #ffffff;
  --r-md: 18px;
  --r-lg: calc(18px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #16703b;
  --warn: #8e530a;
  --danger: #b42335;
  --info: #0f6f86;
  --on-ok: #ffffff;
  --scrim: #11253a66;
}
html:root[data-ff-theme="olive"] {
  color-scheme: light;
  --bg: #f1f1ea;
  --surface: #fdfdf9;
  --surface-2: #e6e7dc;
  --surface-3: #d9dbcc;
  --surface-hover: #e6e7dc;
  --border: #c9ccb6;
  --border-strong: #5d6449;
  --text: #23281a;
  --text-2: #4a5139;
  --text-3: #5d6449;
  --accent: #4f5f1f;
  --ff-accent: #4f5f1f;
  --accent-strong: #3d4a17;
  --accent-ink: #4f5f1f;
  --on-accent: #ffffff;
  --r-md: 12px;
  --r-lg: calc(12px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #16703b;
  --warn: #8e530a;
  --danger: #b42335;
  --info: #2454b8;
  --on-ok: #ffffff;
  --scrim: #23281a66;
}
html:root[data-ff-theme="soleil"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0f0;
  --surface-3: #e2e2e2;
  --surface-hover: #f0f0f0;
  --border: #8a8a8a;
  --border-strong: #000000;
  --text: #000000;
  --text-2: #1f1f1f;
  --text-3: #3b3b3b;
  --accent: #0037a6;
  --ff-accent: #0037a6;
  --accent-strong: #00287a;
  --accent-ink: #0037a6;
  --on-accent: #ffffff;
  --r-md: 6px;
  --r-lg: calc(6px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #0b6b2c;
  --warn: #7a4100;
  --danger: #a3001b;
  --info: #0037a6;
  --on-ok: #ffffff;
  --scrim: #00000080;
}
html:root[data-ff-theme="braise"] {
  color-scheme: dark;
  --bg: #171412;
  --surface: #211d1a;
  --surface-2: #2b2622;
  --surface-3: #36302b;
  --surface-hover: #2b2622;
  --border: #463e37;
  --border-strong: #ab9e91;
  --text: #f2ece6;
  --text-2: #cfc4b9;
  --text-3: #ab9e91;
  --accent: #ff8a50;
  --ff-accent: #ff8a50;
  --accent-strong: #ffa77a;
  --accent-ink: #ff8a50;
  --on-accent: #2a1206;
  --r-md: 12px;
  --r-lg: calc(12px + 6px);
  --display: "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #7ddc8c;
  --warn: #ffd36b;
  --danger: #ff7b93;
  --info: #92c5ff;
  --on-ok: #0f2a14;
  --scrim: #0a0807b3;
}
html:root[data-ff-theme="bordeaux"] {
  color-scheme: dark;
  --bg: #1a1114;
  --surface: #25181c;
  --surface-2: #301f25;
  --surface-3: #3c272e;
  --surface-hover: #301f25;
  --border: #4d3239;
  --border-strong: #bea2a9;
  --text: #f5e9ec;
  --text-2: #dcc4ca;
  --text-3: #bea2a9;
  --accent: #f2a7b8;
  --ff-accent: #f2a7b8;
  --accent-strong: #f8c4d0;
  --accent-ink: #f2a7b8;
  --on-accent: #3a0f1c;
  --r-md: 16px;
  --r-lg: calc(16px + 6px);
  --display: Georgia, "Times New Roman", serif;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ok: #8fe3a5;
  --warn: #ffcf73;
  --danger: #ff8a7a;
  --info: #92c5ff;
  --on-ok: #0f2a16;
  --scrim: #0c0608b3;
}
html:root[data-ff-theme] {
  --accent-soft: color-mix(in srgb, var(--ff-accent) 13%, var(--surface));
  --bg-grad: radial-gradient(ellipse at 5% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
  --top-bg: color-mix(in srgb, var(--surface) 93%, transparent);
  --topbar-bg: var(--top-bg);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  --r-sm: calc(var(--r-md) * .7);
  --shadow-sm: 0 1px 3px color-mix(in srgb, var(--text) 10%, transparent);
  --shadow-md: 0 8px 28px -12px color-mix(in srgb, var(--text) 25%, transparent);
  --shadow-lg: 0 24px 70px -20px color-mix(in srgb, var(--text) 30%, transparent);
  --brand-500: var(--accent);
  --brand-600: var(--accent);
  --brand-700: var(--accent-strong);
  --badge-bg: var(--surface);
  --badge-text: var(--text);
  --on-badge: var(--on-accent);
  --cb: var(--info);
  --esp: var(--ok);
  --ok-soft: color-mix(in srgb, var(--ok) 12%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 12%, var(--surface));
  --danger-soft: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --info-soft: color-mix(in srgb, var(--info) 12%, var(--surface));
  --cb-soft: color-mix(in srgb, var(--cb) 12%, var(--surface));
  --esp-soft: color-mix(in srgb, var(--esp) 12%, var(--surface));
  --rw-bg: var(--bg);
  --rw-surface: var(--surface);
  --rw-surface-2: var(--surface-2);
  --rw-surface-3: var(--surface-3);
  --rw-text: var(--text);
  --rw-text-2: var(--text-2);
  --rw-muted: var(--text-3);
  --rw-gold: var(--accent);
  --rw-gold-strong: var(--accent-strong);
  --rw-gold-soft: var(--accent);
  --rw-accent-soft: var(--accent-soft);
  --rw-on-accent: var(--on-accent);
  --rw-wood: var(--text-2);
  --rw-border: var(--border);
  --rw-border-strong: var(--border-strong);
  --rw-ok: var(--ok);
  --rw-ok-soft: var(--ok-soft);
  --rw-warn: var(--warn);
  --rw-warn-soft: var(--warn-soft);
  --rw-danger: var(--danger);
  --rw-danger-soft: var(--danger-soft);
  --rw-shadow-sm: var(--shadow-sm);
  --rw-shadow-md: var(--shadow-md);
  --rw-shadow-lg: var(--shadow-lg);
  --rw-scrim: var(--scrim);
  --rw-top-bg: var(--top-bg);
}
html:root[data-ff-theme="soleil"] { --bg-grad: none; --shadow-sm: none; --shadow-md: 0 0 0 1px var(--border); }
html:root[data-ff-theme="cosmic"] { --bg-grad: radial-gradient(ellipse at 0% 0%, #1f8a8724, transparent 55%); }
@media screen {
  html[data-ff-theme] body { background: var(--bg-grad), var(--bg); color: var(--text); font-family: var(--font); background-attachment: fixed; }
}
html[data-ff-theme] :focus-visible { outline: 3px solid var(--ff-accent); outline-offset: 3px; }
html[data-ff-theme] .brand-mark, html[data-ff-theme] .hub-ff { color: var(--on-accent); }
html[data-ff-theme] .hub-blob { background: var(--accent); }
html[data-ff-theme] .hub-blob.b2 { background: var(--info); }
html[data-ff-theme] .hub-blob.b3 { background: var(--ok); }

/* Prix emploie --accent pour un fond doux, et --green pour l'action principale. */
html:root[data-ff-theme][data-ff-app="prix"] {
  --ink: var(--text); --ink-2: var(--text-2); --muted: var(--text-3);
  --hover: var(--surface-2); --line: var(--border); --line-strong: var(--border-strong);
  --green: var(--ff-accent); --green-strong: var(--accent-strong);
  --accent: var(--accent-soft); --accent-ink: var(--ff-accent);
  --ring: color-mix(in srgb, var(--ff-accent) 45%, transparent);
  --nav: var(--surface); --nav-2: var(--surface-2); --nav-3: var(--surface-3);
  --nav-ink: var(--text-2); --nav-ink-2: var(--text);
  --nav-on: var(--accent-soft); --nav-on-ink: var(--ff-accent);
  --danger-strong: var(--danger); --danger-line: var(--danger);
  --warn-line: var(--warn); --shadow: #00000022; --radius: var(--r-md);
}
@media (prefers-reduced-motion: reduce) {
  html[data-ff-theme] .hub-blob, html[data-ff-theme] .hub-grille { animation: none; }
}
