@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #f2f2f2;
  --bg: #ffffff;
  --surface: #f5f5f5;
  --line: #e5e5e5;
  --ink: #0a0a0a;
  --grey: #737373;
  --grey-2: #a3a3a3;
  --red: #ff3b30;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Une colonne de téléphone, centrée sur un grand écran. */
.app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 520px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

.screen {
  padding: calc(22px + env(safe-area-inset-top)) 22px calc(32px + env(safe-area-inset-bottom));
}
.screen.enter { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen.enter, .scrim, .sheet { animation: none !important; } }

/* Connexion */
.login { display: grid; gap: 14px; }
.login h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 40px 0 0; }
.login .lead { margin: 0 0 12px; color: var(--grey); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--grey); }
.field input {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
  padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
}
.error { margin: 0; min-height: 1.4em; font-size: 14px; font-weight: 600; color: var(--red); }

/* Haut d'écran */
.nav { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13px; color: var(--grey); font-weight: 500; }
.crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.back, .gear {
  border: 0; background: var(--surface); width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.back { font-size: 22px; line-height: 1; }
.gear { margin-left: auto; color: var(--ink); }
.gear svg { width: 18px; height: 18px; }

/* Chiffre et anneau */
.ring-wrap { position: relative; width: 100%; max-width: 300px; margin: 18px auto 8px; }
.ring { display: block; width: 100%; }
.ring path { stroke: #fff; stroke-width: 3; transition: opacity .15s; }
.ring path[data-part] { cursor: pointer; }
.ring path[data-part]:hover { opacity: .85; }
.verdict { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.verdict .count { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.verdict .sub { margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--grey); }

.big { font-size: 56px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.big small { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin-left: 6px; color: var(--grey); }

/* Lignes */
.rows { display: grid; margin-top: 14px; }
.row {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 15px 0;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row .sq { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.row .txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row .txt b { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.row .txt small { color: var(--grey); font-size: 13px; }
.row .n { font-weight: 600; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--grey-2); font-size: 22px; line-height: 1; }
.empty { margin-top: 40px; text-align: center; color: var(--grey); }
.empty b { display: block; color: var(--ink); font-size: 22px; font-weight: 700; margin-bottom: 6px; }

/* Détail */
.detail h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 16px 0 6px; text-wrap: balance; }
.detail .meta { font-size: 13px; color: var(--grey); font-variant-numeric: tabular-nums; }
.detail h3 { font-size: 12px; font-weight: 600; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 6px; }
.detail p { margin: 0; font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--grey); }
.tag.red { background: #ffe9e7; color: #d92c20; }
.tag.green { background: #e6f9ee; color: #15803d; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 16px; font-weight: 600;
  text-align: center; text-decoration: none; background: var(--ink); color: #fff; margin-top: 26px;
}
.btn:active { transform: scale(.98); }

.foot { margin-top: 26px; font-size: 12px; color: var(--grey); }
.foot.problem { color: var(--ink); font-weight: 600; }
.linkbtn { border: 0; background: transparent; padding: 0; color: var(--ink); cursor: pointer; font-weight: 600; text-decoration: underline; }

/* Réglages */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); z-index: 8; display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s ease-out; }
.sheet { width: 100%; max-width: 480px; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 22px calc(26px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.sheet .sub { font-size: 13px; color: var(--grey); margin: 0 0 14px; }
.opt {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 12px; border: 1px solid var(--line);
  border-radius: 14px; background: transparent; cursor: pointer; margin-top: 8px; text-align: left;
}
.opt[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt .grad { display: flex; gap: 3px; flex: none; }
.opt .grad i { width: 18px; height: 18px; border-radius: 5px; display: block; }
.opt b { flex: 1; font-weight: 600; font-size: 15px; }
.opt .ck { font-weight: 700; opacity: 0; }
.opt[aria-checked="true"] .ck { opacity: 1; }
.sheet .actions { display: grid; gap: 8px; margin-top: 18px; }
.sheet .plain { border: 0; background: var(--surface); border-radius: 14px; padding: 14px; font-weight: 600; cursor: pointer; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
