:root {
  --accent: #e0a33a;
  --accent-soft: #f6d99a;

  --bg: #ffffff;
  --bg-sidebar: #f6f5f2;
  --bg-raised: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --bg-selected: #e6e4df;

  --text: #16161a;
  --text-muted: #8c8c92;
  --text-faint: #b4b4ba;

  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);

  --danger: #d8443c;

  --radius: 8px;
  --sidebar-width: 16.75rem;
  --header-height: 3.25rem;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e0a33a;
    --accent-soft: #6b4f1c;

    --bg: #1c1c1e;
    --bg-sidebar: #242426;
    --bg-raised: #2c2c2e;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-selected: #3a3a3c;

    --text: #f0f0f2;
    --text-muted: #98989f;
    --text-faint: #6a6a70;

    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);

    --danger: #ff6961;

    --shadow-pop: 0 8px 30px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  /* Pivot du réglage de taille : tout le reste est exprimé en rem. */
  font-size: calc(16px * var(--text-scale, 1));
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

[hidden] {
  display: none !important;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background 0.12s ease, color 0.12s ease;
}

.icon-button:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.icon-button svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

::selection {
  background: var(--accent-soft);
}
