/* Couleurs et mesures communes au site et à l'application web.
   Les teintes des catégories (--s1 à --s8) sont dans un ordre fixe, choisi pour que deux
   voisines restent distinguables y compris en cas de daltonisme ; chacune a sa variante sombre. */

:root {
  color-scheme: light dark;

  --page: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #efeee9;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #7d7b75;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;

  --accent: #8a6000;
  --accent-strong: #6f4d00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(138, 96, 0, 0.1);

  --gain: #006300;
  --loss: #c22f2f;

  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #4a3aa7;
  --s8: #e34948;

  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 10px 30px rgba(11, 11, 11, 0.06);
  --radius: 18px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #262624;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #8f8d86;
    --line: #2c2c2a;
    --line-strong: #3d3d39;

    --accent: #ebbc46;
    --accent-strong: #f5cf6c;
    --accent-ink: #1c1500;
    --accent-soft: rgba(235, 188, 70, 0.12);

    --gain: #0ca30c;
    --loss: #e66767;

    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--line);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-strong);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-danger {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--loss);
}
.btn-danger:hover {
  background: var(--surface-2);
}
.btn-small {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Marque : courbe dorée sur fond anthracite, comme l'icône de l'app */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

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