@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hedvig Serif";
  src: url("/assets/fonts/hedvig-letters-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hedvig Serif";
  src: url("/assets/fonts/hedvig-letters-serif-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --page: #f3f4f6;
  --surface: #ffffff;
  --ink: #0f1217;
  --ink-2: #4b525e;
  --muted: #858b96;
  --grid: #eaecef;
  --base: #cdd1d7;
  --bar: #d5d9df;
  --hair: rgba(15, 18, 23, 0.08);
  --wash: rgba(15, 18, 23, 0.04);
  --red: #c93434;
  --green: #17803a;
  --c-plainte: #d03b3b;
  --c-question: #c98500;
  --c-idee: #7048e8;
  --c-achat: #2f9e44;
  --c-temoignage: #0b8fa8;
  --c-autre: #9aa0aa;
  --radius: 16px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Hedvig Serif", ui-serif, Georgia, serif;
  --pad: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0c0d0f;
    --surface: #15171b;
    --ink: #eef0f3;
    --ink-2: #b3b9c3;
    --muted: #8e95a1;
    --grid: #22252b;
    --base: #343841;
    --bar: #363b44;
    --hair: rgba(255, 255, 255, 0.07);
    --wash: rgba(255, 255, 255, 0.04);
    --red: #f06a6a;
    --green: #3fbf66;
    --c-plainte: #e66767;
    --c-question: #e0a020;
    --c-idee: #9085e9;
    --c-achat: #3fae55;
    --c-temoignage: #2bb0c8;
    --c-autre: #7c838f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.45 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }
h1, h2, p { margin: 0; }
.num, .tile-num, .hero-figure, table { font-variant-numeric: tabular-nums; }
.sr { position: absolute; top: 0; left: 0; display: block; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chart, .tile { position: relative; }

/* ---------- top bar ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px var(--pad) 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface), 0 0 0 1.5px var(--accent);
}
.pill-example {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--wash);
  border: 1px dashed var(--muted);
}
.day {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  color: var(--ink-2);
}
.day time { padding: 0 4px; white-space: nowrap; }
.day .d-long { display: none; }
.day-step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
}
a.day-step:hover { background: var(--wash); }
span.day-step { color: var(--base); }

.stale {
  max-width: 1280px;
  margin: 0 auto 6px;
  padding: 0 var(--pad);
  font-size: 13px;
  color: var(--ink-2);
}
.stale::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: 2px;
}

/* ---------- board ---------- */
.board {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4px 10px 24px;
  display: grid;
  gap: 10px;
}
.stack { display: grid; gap: 10px; min-width: 0; align-content: start; grid-template-columns: minmax(0, 1fr); }
.board > section, .duo > section, .stack > section {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: var(--pad);
  min-width: 0;
}
.duo { display: grid; gap: 10px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.duo:has(> :only-child) > section { grid-column: 1 / -1; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.sec-note { font-size: 13px; color: var(--muted); }
.count { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------- hero ---------- */
.hero { display: grid; gap: 18px; padding-top: 20px; }
.hero-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 29px;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hero-figure { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; }
.hero-figure .num {
  font-size: 64px;
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.hero-figure .unit { font-size: 15px; color: var(--ink-2); }
.hero-ratio { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.hero-ratio b { font-weight: 650; color: var(--ink); }
.hero-ratio.is-viral b {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 7px;
  padding: 1px 7px;
  margin-right: 2px;
}
.facts { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--ink-2); }
.facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-why { margin-top: 12px; font-size: 14px; color: var(--ink-2); max-width: 46ch; }
.xlink {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  color: var(--accent-ink);
}
.xlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero--risk .hero-meta { color: var(--red); font-weight: 600; }
.hero--risk .xlink { color: var(--ink); }

.chart { margin: 0; min-width: 0; }
.chart figcaption, .tile figcaption { font-size: 13px; color: var(--muted); }
.chart--hero .plot { height: 168px; margin-top: 8px; }
.chart--hero.is-risk .g-bar.is-sel { fill: var(--red); }
.hero--risk .hero-figure .unit { color: var(--red); }

/* ---------- trend tiles ---------- */
.seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--wash); border: 1px solid var(--hair); }
.seg button {
  font: 500 13px var(--sans);
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--hair); }
.tiles { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.tile { margin: 0; min-width: 0; }
.tile-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.tile-num .num { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.delta { font-size: 13px; font-weight: 550; white-space: nowrap; }
/* Deltas stay neutral: green belongs to the "achat" category, red to risks and complaints. */
.delta--up, .delta--down { color: var(--ink-2); }
.delta--flat { color: var(--muted); }
.tile-num .na { font-size: 22px; color: var(--muted); }
.delta-ref { color: var(--muted); font-weight: 400; }
.tile .plot { height: 84px; margin-top: 8px; }
.mentions .plot { height: 120px; }

/* ---------- charts (svg drawn by app.js) ---------- */
.plot { position: relative; touch-action: pan-y; }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.g-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.g-base { stroke: var(--base); stroke-width: 1; shape-rendering: crispEdges; }
.g-tick { fill: var(--muted); font: 500 12px var(--sans); font-variant-numeric: tabular-nums; }
.g-bar { fill: var(--bar); }
.g-bar.is-sel { fill: var(--accent); }
.g-bar.is-cut:not(.is-sel) { opacity: 0.45; }
.g-bar.is-hover { fill: var(--ink-2); }
.g-bar.is-sel.is-hover { fill: var(--accent); opacity: 0.85; }
.g-missing { fill: var(--grid); }
.g-break { stroke: var(--surface); stroke-width: 3; }
.g-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-line--gap { stroke: var(--base); stroke-width: 1.5; }
.g-line:not(.g-line--gap) { stroke: var(--ink-2); }
.g-label--muted { fill: var(--ink-2) !important; font-weight: 550 !important; }
.g-label { fill: var(--ink); font: 650 12px var(--sans); font-variant-numeric: tabular-nums; }
.asof { color: var(--muted); }
.g-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.g-dot--past { fill: var(--ink); }
.g-guide { stroke: var(--base); stroke-width: 1; }
.tip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  background: var(--ink);
  color: var(--surface);
  font: 500 12px/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
  padding: 5px 8px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 2;
}
.tip b { font-weight: 650; }

/* ---------- posts ranking ---------- */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.rank-line { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; }
.rank-line a, .rank-line span:first-child { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rank-line a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rank-line .num { color: var(--ink-2); flex: none; }
.bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--wash); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 3px; background: var(--bar); }
.rank .is-top .bar span { background: var(--accent); }
.rank .is-top .rank-line .num { color: var(--ink); font-weight: 600; }

/* ---------- answers ---------- */
.answers { list-style: none; margin: 0; padding: 0; }
.answers li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--grid);
}
.answers li:first-child { border-top: 0; padding-top: 0; }
.answers .who { font-weight: 600; font-size: 14px; }
.ans-text { grid-column: 1; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ans-link {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--hair);
  white-space: nowrap;
}
.ans-link:hover { background: var(--wash); }

/* ---------- comparison ---------- */
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 10px 0; border-top: 1px solid var(--grid); text-align: left; font-weight: 400; vertical-align: middle; }
.cmp thead th { border-top: 0; padding-top: 0; font-size: 12px; color: var(--muted); }
.cmp .r { text-align: right; padding-right: 14px; }
.cmp .who { display: block; font-weight: 600; }
.cmp .role { display: block; font-size: 12px; color: var(--ink-2); }
.cmp td .delta { display: block; font-size: 12px; }
.cmp-bar { width: 38%; }
.cmp-bar .bar { margin: 0 0 3px; height: 8px; border-radius: 4px; }
.cmp-bar .num { font-size: 13px; color: var(--ink-2); }
.role-moi .cmp-bar .bar span { background: var(--accent); }
.role-moi .who::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 2px; }
.cmp thead .cmp-bar-h { padding-left: 0; }

/* ---------- mentions feed ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px var(--sans);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-n { color: inherit; opacity: 0.7; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--plainte { background: var(--c-plainte); }
.dot--question { background: var(--c-question); }
.dot--idee { background: var(--c-idee); }
.dot--achat { background: var(--c-achat); }
.dot--temoignage { background: var(--c-temoignage); }
.dot--autre { background: var(--c-autre); }
.dot--risk { background: var(--red); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--grid);
}
.feed li:first-child { border-top: 0; }
.feed li[hidden] { display: none; }
.feed li > .dot { margin-top: 6px; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--muted); }
.feed-meta .who { color: var(--ink); font-weight: 600; }
.feed-text { font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.feed-link { font-size: 15px; text-decoration: none; color: var(--muted); padding: 2px 4px; }
.feed-link:hover { color: var(--ink); }

/* ---------- footer, empty, login ---------- */
.foot { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad) 28px; font-size: 12px; color: var(--muted); }
.empty, .login { display: grid; place-items: center; min-height: 78dvh; padding: 20px; }
.empty-card, .login-card {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 20px;
  padding: 28px;
}
.empty-card h1 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.15; margin: 18px 0 8px; }
.empty-card p { color: var(--ink-2); }
.empty-mark { display: block; width: 44px; height: 44px; border-radius: 50%; border: 1.5px dashed var(--base); }
.login-card { display: grid; gap: 10px; }
.login-card .brand { margin-bottom: 14px; font-size: 18px; }
.login-card label { font-size: 13px; color: var(--ink-2); }
.login-card input {
  font: 400 16px var(--sans);
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 12px 14px;
}
.login-card input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button {
  font: 600 15px var(--sans);
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) { .login-card button { color: var(--page); } }
.login-err { font-size: 13px; color: var(--red); }

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

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  :root { --pad: 26px; }
  .board { padding: 6px 20px 32px; gap: 14px; }
  .duo, .stack { gap: 14px; }
  .top { padding: 20px 28px 14px; }
  .stale { padding: 0 28px; }
  .day .d-long { display: inline; }
  .day .d-short { display: none; }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .hero-title { font-size: 38px; }
  .hero-figure .num { font-size: 84px; }
  .foot { padding: 0 28px 32px; }
}
@media (min-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; padding: 32px 32px 28px; align-items: end; }
  .hero-title { font-size: 40px; }
  .hero-figure .num { font-size: 112px; }
  .chart--hero .plot { height: 280px; }
  .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .duo .mentions { display: flex; }
  .duo .mentions .tile { flex: 1; display: flex; flex-direction: column; }
  .duo .mentions .plot { flex: 1; min-height: 120px; }
  .answers { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .answers li:nth-child(2) { border-top: 0; padding-top: 0; }
  .tile .plot { height: 110px; }
}

@media (prefers-reduced-motion: no-preference) {
  .g-bar, .bar span { transition: fill 120ms ease; }
  .board > section { animation: rise 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .board > section:nth-child(2) { animation-delay: 40ms; }
  .board > section:nth-child(3) { animation-delay: 80ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}
@media (forced-colors: active) {
  .g-bar.is-sel, .rank .is-top .bar span { fill: Highlight; background: Highlight; }
}
