@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F6F7F5;
  --surface: #FFFFFF;
  --surface-2: #EEF2F1;
  --ink: #102A30;
  --ink-2: #3E555B;
  --muted: #7A8C90;
  --line: #DFE6E5;
  --teal: #0B4F5C;
  --teal-deep: #073943;
  --teal-soft: #E3EEEF;
  --teal-glow: rgba(11, 79, 92, 0.14);

  --n1: #3E8E5E;  /* vert */
  --n2: #DFA43A;  /* jaune orangé */
  --n3: #DD7637;  /* orange */
  --n4: #A9473A;  /* rouge brique */
  --n0: #9AA9AC;  /* à qualifier */
  --n1-soft: #E6F1EA; --n2-soft: #FBF1DE; --n3-soft: #FBEADF; --n4-soft: #F4E3E0; --n0-soft: #EEF1F2;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --shadow-1: 0 1px 2px rgba(16, 42, 48, 0.05), 0 2px 8px rgba(16, 42, 48, 0.04);
  --shadow-2: 0 2px 4px rgba(16, 42, 48, 0.05), 0 12px 32px rgba(16, 42, 48, 0.09);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.brand { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.brand b { color: var(--teal); font-weight: 700; }
.brand .x { margin: 0 0.5em; color: var(--muted); font-weight: 400; }

.serif { font-family: var(--serif); font-optical-sizing: auto; letter-spacing: -0.01em; }

/* Pastille de niveau */
.lvl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: 999px; white-space: nowrap; }
.lvl::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lvl-1 { color: var(--n1); background: var(--n1-soft); }
.lvl-2 { color: #A87414; background: var(--n2-soft); }
.lvl-2::before { background: var(--n2); }
.lvl-3 { color: #B85A20; background: var(--n3-soft); }
.lvl-3::before { background: var(--n3); }
.lvl-4 { color: var(--n4); background: var(--n4-soft); }
.lvl-0 { color: #5E7074; background: var(--n0-soft); }
.lvl-0::before { background: var(--n0); }
.lvl-bar-1 { --lvl: var(--n1); } .lvl-bar-2 { --lvl: var(--n2); } .lvl-bar-3 { --lvl: var(--n3); } .lvl-bar-4 { --lvl: var(--n4); } .lvl-bar-0 { --lvl: var(--n0); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 18px;
  font-weight: 600; font-size: 15px; transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 18px var(--teal-glow); }
.btn-primary:hover { background: var(--teal-deep); }
.btn-primary:disabled { opacity: 0.35; box-shadow: none; cursor: default; }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--line); }
.btn-ghost:hover { background: var(--teal-soft); }
.btn-danger { background: transparent; color: var(--n4); border-color: #EBCFCA; }
.btn-danger:hover { background: var(--n4-soft); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-2); transition: all 0.35s var(--ease); pointer-events: none; z-index: 100; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.conn { position: fixed; top: 10px; right: 10px; z-index: 90; font-size: 12px; padding: 6px 10px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-1); color: var(--ink-2); display: none; }
.conn.off { display: block; }
.conn.off::before { content: '●'; color: var(--n3); margin-right: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
