/* GÉNÉRÉ par operations/charte/build.py — ne pas éditer à la main.
 * Source : DESIGN.md v0.23.1. Toute correction se fait dans la source.
 */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/web/Archivo-Regular.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Archivo-Regular.ttf?v=0.23.1") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/web/Archivo-Medium.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Archivo-Medium.ttf?v=0.23.1") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/web/Archivo-SemiBold.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Archivo-SemiBold.ttf?v=0.23.1") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/web/Newsreader-Regular.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Newsreader-Regular.ttf?v=0.23.1") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/web/Newsreader-Medium.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Newsreader-Medium.ttf?v=0.23.1") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/web/Newsreader-SemiBold.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Newsreader-SemiBold.ttf?v=0.23.1") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/web/Newsreader-Italic.woff2?v=0.23.1") format("woff2"), url("../fonts/static/Newsreader-Italic.ttf?v=0.23.1") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader Display";
  src: url("../fonts/web/NewsreaderDisplay-SemiBold.woff2?v=0.23.1") format("woff2"), url("../fonts/static/NewsreaderDisplay-SemiBold.ttf?v=0.23.1") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/web/SpaceMono-Regular.woff2?v=0.23.1") format("woff2"), url("../fonts/static/SpaceMono-Regular.ttf?v=0.23.1") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/web/SpaceMono-Bold.woff2?v=0.23.1") format("woff2"), url("../fonts/static/SpaceMono-Bold.ttf?v=0.23.1") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Couleurs */
  --ha-paper: #fbf8f1;
  --ha-surface: #f3efe4;
  --ha-ink: #1b1a17;
  --ha-ink-soft: #3a372f;
  --ha-muted: #6e6a5e;
  --ha-hairline: #d3c7b0;
  --ha-cue: #a63a2b;
  --ha-cue-strong: #8c2e22;
  --ha-cue-tint: #f6e7e1;
  --ha-on-cue: #ffffff;
  --ha-ok-tint: #e3ece5;
  --ha-warn-tint: #f6ecd7;
  --ha-info-tint: #e4ebef;
  --ha-ok: #2f6b4f;
  --ha-warn: #8a5a12;
  --ha-danger: #8c2e22;
  --ha-info: #35566b;
  --ha-theme-synthese: #3d2b00;
  --ha-theme-synthese-tint: #ffe066;
  --ha-theme-exploitation: #0f3d26;
  --ha-theme-exploitation-tint: #b8e6cc;
  --ha-theme-urbanisme: #2f194d;
  --ha-theme-urbanisme-tint: #d5c7f0;
  --ha-theme-bati: #103047;
  --ha-theme-bati-tint: #bfd9ed;
  --ha-theme-piece-tint: #d9eaf7;
  --ha-theme-travaux: #4f2500;
  --ha-theme-travaux-tint: #f7cb99;
  --ha-series-1: #1b1a17;
  --ha-series-2: #2b4152;
  --ha-series-3: #a63a2b;
  --ha-series-4: #8a8377;
  --ha-series-5: #9fb4c0;
  --ha-series-6: #d9d2c1;

  /* Familles */
  --ha-font-sans: Archivo, Inter, "Liberation Sans", sans-serif;
  --ha-font-serif: Newsreader, "Source Serif 4", "Liberation Serif", serif;
  --ha-font-mono: "Space Mono", "IBM Plex Mono", monospace;

  /* Échelle typographique (écran) */
  --ha-text-caption-family: var(--ha-font-sans);
  --ha-text-caption-size: 12px;
  --ha-text-caption-line: 1.35;
  --ha-text-caption-weight: 500;
  --ha-text-caption-tracking: 0.06em;
  --ha-text-small-family: var(--ha-font-sans);
  --ha-text-small-size: 13px;
  --ha-text-small-line: 1.45;
  --ha-text-small-weight: 400;
  --ha-text-body-family: var(--ha-font-sans);
  --ha-text-body-size: 15px;
  --ha-text-body-line: 1.5;
  --ha-text-body-weight: 400;
  --ha-text-body-lg-family: var(--ha-font-sans);
  --ha-text-body-lg-size: 17px;
  --ha-text-body-lg-line: 1.55;
  --ha-text-body-lg-weight: 400;
  --ha-text-h3-family: var(--ha-font-sans);
  --ha-text-h3-size: 20px;
  --ha-text-h3-line: 1.35;
  --ha-text-h3-weight: 500;
  --ha-text-h2-family: var(--ha-font-sans);
  --ha-text-h2-size: 24px;
  --ha-text-h2-line: 1.3;
  --ha-text-h2-weight: 600;
  --ha-text-h1-family: var(--ha-font-serif);
  --ha-text-h1-size: 44px;
  --ha-text-h1-line: 1.2;
  --ha-text-h1-weight: 400;
  --ha-text-h1-tracking: -0.015em;
  --ha-text-display-family: var(--ha-font-serif);
  --ha-text-display-size: 62px;
  --ha-text-display-line: 1.06;
  --ha-text-display-weight: 400;
  --ha-text-display-tracking: -0.02em;
  --ha-text-letter-family: var(--ha-font-serif);
  --ha-text-letter-size: 14.6667px;
  --ha-text-letter-line: 1.5;
  --ha-text-letter-weight: 400;
  --ha-text-letter-title-family: var(--ha-font-serif);
  --ha-text-letter-title-size: 17.3333px;
  --ha-text-letter-title-line: 1.3;
  --ha-text-letter-title-weight: 600;
  --ha-text-data-family: var(--ha-font-mono);
  --ha-text-data-size: 13.5px;
  --ha-text-data-line: 1.5;
  --ha-text-data-weight: 400;
  --ha-text-data-tracking: 0;
  --ha-text-figure-family: var(--ha-font-sans);
  --ha-text-figure-size: 13px;
  --ha-text-figure-line: 1.3;
  --ha-text-figure-weight: 500;
  --ha-text-cover-family: var(--ha-font-serif);
  --ha-text-cover-size: 88px;
  --ha-text-cover-line: 1.02;
  --ha-text-cover-weight: 400;
  --ha-text-cover-tracking: -0.025em;
  --ha-text-machine-family: var(--ha-font-mono);
  --ha-text-machine-size: 12px;
  --ha-text-machine-line: 1.4;
  --ha-text-machine-weight: 700;
  --ha-text-machine-tracking: 0.14em;
  --ha-text-label-family: var(--ha-font-mono);
  --ha-text-label-size: 13px;
  --ha-text-label-line: 1.33;
  --ha-text-label-weight: 400;
  --ha-text-label-tracking: 0.06em;

  /* Rayons, espacements, mise en page */
  --ha-radius-none: 0px;
  --ha-radius-sm: 0px;
  --ha-radius-md: 0px;
  --ha-radius-lg: 0px;
  --ha-radius-pill: 999px;
  --ha-space-4: 4px;
  --ha-space-8: 8px;
  --ha-space-12: 12px;
  --ha-space-16: 16px;
  --ha-space-24: 24px;
  --ha-space-32: 32px;
  --ha-space-48: 48px;
  --ha-space-64: 64px;
  --ha-space-96: 96px;
  --ha-space-128: 128px;
  --ha-space-160: 160px;
  --ha-space-control: 34px;
  --ha-space-head: 40px;
  --ha-space-inset: 16px;
  --ha-space-row-lg: 44px;
  --ha-space-section: 96px;
  --ha-space-section-sm: 48px;
  --ha-space-section-content: 24px;
  --ha-space-page-max: 1280px;
  --ha-space-letter-margin: 75.59px;
  --ha-space-letter-measure: 623.62px;
  --ha-space-a3-margin: 56.69px;

  /* Tokens d'application (v0.9) : géométries partagées bureau/admin. */
  --ha-measure-form: 400px;
  --ha-measure-read: 66ch;
  --ha-measure-toc: 176px;
  --ha-row-height: 39px;
  --ha-motion-fade: 120ms;
  --ha-motion-flip: 180ms;
  --ha-space-crumb: 12px;
  --ha-space-title: 16px;
  --ha-space-filters: 24px;
  --ha-space-band: 56px;

  /* Pas d'ombre : un filet fait le travail (charte, Formes). */
  --ha-shadow-none: none;
  --ha-rule: 1px solid var(--ha-hairline);
  --ha-rule-ink: 1px solid var(--ha-ink);
  color-scheme: light;
}

/* Jeu sombre (v0.8) : mêmes rôles, autres valeurs. Priorité :
 * 1) [data-theme="dark"] explicite, 2) prefers-color-scheme.
 * Un [data-theme="light"] explicite gagne sur la préférence système. */
[data-theme="dark"] {
  color-scheme: dark;
  --ha-paper: #171a1d;
  --ha-surface: #212528;
  --ha-ink: #eef1f4;
  --ha-ink-soft: #cbd1d6;
  --ha-muted: #9aa1a8;
  --ha-hairline: #414852;
  --ha-cue: #e2836c;
  --ha-cue-strong: #f0a08c;
  --ha-cue-tint: #2c2320;
  --ha-on-cue: #171a1d;
  --ha-ok-tint: #1c2723;
  --ha-warn-tint: #2a2419;
  --ha-info-tint: #1c2a31;
  --ha-ok: #8fc7a6;
  --ha-warn: #e3b96a;
  --ha-danger: #f0a08c;
  --ha-info: #9cc0d4;
  --ha-theme-synthese: #ffe066;
  --ha-theme-synthese-tint: #423400;
  --ha-theme-exploitation: #6ee7a8;
  --ha-theme-exploitation-tint: #123824;
  --ha-theme-urbanisme: #d4bbff;
  --ha-theme-urbanisme-tint: #2b1d42;
  --ha-theme-bati: #7cc4fa;
  --ha-theme-bati-tint: #153047;
  --ha-theme-piece-tint: #1b3b56;
  --ha-theme-travaux: #ffb870;
  --ha-theme-travaux-tint: #422408;
  --ha-series-1: #eef1f4;
  --ha-series-2: #2c3f4c;
  --ha-series-3: #d46955;
  --ha-series-4: #5f646a;
  --ha-series-5: #93a7b3;
  --ha-series-6: #cfd3d7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ha-paper: #171a1d;
    --ha-surface: #212528;
    --ha-ink: #eef1f4;
    --ha-ink-soft: #cbd1d6;
    --ha-muted: #9aa1a8;
    --ha-hairline: #414852;
    --ha-cue: #e2836c;
    --ha-cue-strong: #f0a08c;
    --ha-cue-tint: #2c2320;
    --ha-on-cue: #171a1d;
    --ha-ok-tint: #1c2723;
    --ha-warn-tint: #2a2419;
    --ha-info-tint: #1c2a31;
    --ha-ok: #8fc7a6;
    --ha-warn: #e3b96a;
    --ha-danger: #f0a08c;
    --ha-info: #9cc0d4;
    --ha-theme-synthese: #ffe066;
    --ha-theme-synthese-tint: #423400;
    --ha-theme-exploitation: #6ee7a8;
    --ha-theme-exploitation-tint: #123824;
    --ha-theme-urbanisme: #d4bbff;
    --ha-theme-urbanisme-tint: #2b1d42;
    --ha-theme-bati: #7cc4fa;
    --ha-theme-bati-tint: #153047;
    --ha-theme-piece-tint: #1b3b56;
    --ha-theme-travaux: #ffb870;
    --ha-theme-travaux-tint: #422408;
    --ha-series-1: #eef1f4;
    --ha-series-2: #2c3f4c;
    --ha-series-3: #d46955;
    --ha-series-4: #5f646a;
    --ha-series-5: #93a7b3;
    --ha-series-6: #cfd3d7;
  }
}


/* ---- reset en couche (ne touche pas aux composants) ---------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
svg:not([fill]) { fill: currentColor; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }
th { text-align: start; font-weight: inherit; }
hr { border: 0; border-top: 1px solid var(--ha-hairline); margin: 0; }
[hidden] { display: none !important; }


/* Base minimale — les composants vivent dans les feuilles d'application. */
html { background: var(--ha-paper); }
body {
  background: var(--ha-paper); color: var(--ha-ink);
  font-family: var(--ha-font-sans);
  font-size: var(--ha-text-body-size);
  line-height: var(--ha-text-body-line);
  -webkit-font-smoothing: antialiased;
}
h1 { font-family: var(--ha-text-h1-family); font-size: var(--ha-text-h1-size);
     font-weight: var(--ha-text-h1-weight); letter-spacing: var(--ha-text-h1-tracking);
     line-height: var(--ha-text-h1-line); text-wrap: balance; }
h2 { font-family: var(--ha-text-h2-family); font-size: var(--ha-text-h2-size);
     font-weight: var(--ha-text-h2-weight); line-height: var(--ha-text-h2-line);
     text-wrap: balance; }
a { color: var(--ha-ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--ha-cue); }
.text-muted, .text-secondary { color: var(--ha-muted) !important; }
table td, table th, .num, .tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ha-cue); outline-offset: 2px; }

/* La cale : marque structurelle, trois occurrences par page au plus. */
[data-cue] { color: var(--ha-cue); }
.cue-rule { border-bottom: 2px solid var(--ha-cue); }

/* Le signe courant : le trait — hairline pleine largeur + segment d'encre 48x2 (v0.7). */
.sec-trait { padding-top: 14px; background:
  linear-gradient(var(--ha-ink), var(--ha-ink)) left top / 48px 2px no-repeat,
  linear-gradient(var(--ha-hairline), var(--ha-hairline)) left top / 100% 1px no-repeat; }
.rule-short { width: 48px; height: 2px; background: var(--ha-ink); border: 0; }
/* La dentelure : exception de couverture, encre ou gris — jamais la cale, jamais en filet courant. */
.frise { padding-bottom: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='6'%3E%3Cpath d='M0 6 L3.5 0 L7 6 L10.5 0 L14 6 Z' fill='%231b1a17'/%3E%3C/svg%3E") repeat-x left bottom; }
.frise--grey { padding-bottom: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='6'%3E%3Cpath d='M0 6 L3.5 0 L7 6 L10.5 0 L14 6 Z' fill='%23d3c7b0'/%3E%3C/svg%3E") repeat-x left bottom; }
.frise--ink { padding-bottom: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='6'%3E%3Cpath d='M0 6 L3.5 0 L7 6 L10.5 0 L14 6 Z' fill='%231b1a17'/%3E%3C/svg%3E") repeat-x left bottom; }

/* En-tête de tableau : un seul filet d'encre dessous et des capitales monospace, aucun aplat. */
thead th {
  background: transparent; color: var(--ha-ink);
  font-family: var(--ha-font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  border-top: 0; border-bottom: 1px solid var(--ha-ink);
  padding: 8px 10px;
}
tbody td { border-bottom: 1px solid var(--ha-hairline); padding: 8px 10px;
  font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 1px solid var(--ha-ink); }

/* Marques de registre — ASCII et ponctuation, jamais de pictogramme. */
/* Montants : la classe prête porte la voix des chiffres (agent frais, v0.7). */
.num { font-family: var(--ha-text-data-family); font-size: var(--ha-text-data-size);
  font-weight: var(--ha-text-data-weight); font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.mark { font-family: var(--ha-font-mono); font-style: normal; font-weight: 400;
  letter-spacing: 0; font-variant-numeric: normal; white-space: nowrap; }
.mark--cue { color: var(--ha-cue); }
.mark--muted { color: var(--ha-muted); }

/* Le logotype est typographique : aucun dessin, aucune couleur de marque. */
.wordmark { display: inline-flex; align-items: baseline; gap: .45em;
  font-family: var(--ha-font-mono); font-weight: 400; text-transform: uppercase;
  letter-spacing: 0; color: var(--ha-ink); text-decoration: none; }
.wordmark .legal { font-family: var(--ha-font-sans); font-weight: 400; font-size: .62em;
  letter-spacing: 0; }

/* Statuts : teinte propre + libellé, jamais d'aplat plein (v0.6). */
.badge { display: inline-block; border-radius: var(--ha-radius-pill); padding: 2px 9px;
  font-size: 11px; font-weight: 500; font-family: var(--ha-font-sans); }
.badge--ok { background: var(--ha-ok-tint); color: var(--ha-ok); }
.badge--warn { background: var(--ha-warn-tint); color: var(--ha-warn); }
.badge--info { background: var(--ha-info-tint); color: var(--ha-info); }
.badge--danger { background: var(--ha-cue-tint); color: var(--ha-danger); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Impression : toujours le jeu clair, forcé (v0.8) — préférence et attribut ignorés. */
@media print {
  :root, [data-theme="dark"] { color-scheme: light;
    --ha-paper: #fbf8f1;
    --ha-surface: #f3efe4;
    --ha-ink: #1b1a17;
    --ha-ink-soft: #3a372f;
    --ha-muted: #6e6a5e;
    --ha-hairline: #d3c7b0;
    --ha-cue: #a63a2b;
    --ha-cue-strong: #8c2e22;
    --ha-cue-tint: #f6e7e1;
    --ha-on-cue: #ffffff;
    --ha-ok-tint: #e3ece5;
    --ha-warn-tint: #f6ecd7;
    --ha-info-tint: #e4ebef;
    --ha-ok: #2f6b4f;
    --ha-warn: #8a5a12;
    --ha-danger: #8c2e22;
    --ha-info: #35566b;
    --ha-theme-synthese: #3d2b00;
    --ha-theme-synthese-tint: #ffe066;
    --ha-theme-exploitation: #0f3d26;
    --ha-theme-exploitation-tint: #b8e6cc;
    --ha-theme-urbanisme: #2f194d;
    --ha-theme-urbanisme-tint: #d5c7f0;
    --ha-theme-bati: #103047;
    --ha-theme-bati-tint: #bfd9ed;
    --ha-theme-piece-tint: #d9eaf7;
    --ha-theme-travaux: #4f2500;
    --ha-theme-travaux-tint: #f7cb99;
    --ha-series-1: #1b1a17;
    --ha-series-2: #2b4152;
    --ha-series-3: #a63a2b;
    --ha-series-4: #8a8377;
    --ha-series-5: #9fb4c0;
    --ha-series-6: #d9d2c1;
    --ha-paper: #ffffff;
  }
  html, body { background: #ffffff; }
  a { text-decoration: none; }
  .no-print { display: none !important; }
}
