:root {
  --bg: #fff; --card: #f5f5f7; --text: #1d1d1f; --text2: #6e6e73; --dot: #d2d2d7;
  --bar: rgba(255, 255, 255, .72); --hair: rgba(0, 0, 0, .08);
  --grad: linear-gradient(100deg, #e8590c 0%, #e11d5c 50%, #9b3fd6 100%);
  --accent: #ff375f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #161617; --text: #f5f5f7; --text2: #86868b; --dot: #3a3a3c;
    --bar: rgba(22, 22, 23, .72); --hair: rgba(255, 255, 255, .1);
    --grad: linear-gradient(100deg, #ff9f0a 0%, #ff375f 50%, #bf5af2 100%);
  }
}

* { box-sizing: border-box; margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.num { font-variant-numeric: tabular-nums; }
.wrap { width: min(100% - 44px, 980px); margin-inline: auto; }
.g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Barre en verre dépoli */
.bar {
  position: sticky; top: 0; z-index: 5; height: 44px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.bar .wrap { height: 100%; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); }

/* Carte widget */
main { flex: 1; display: grid; align-content: center; padding: 24px 0; }
.card { background: var(--card); border-radius: 22px; padding: clamp(20px, 3vw, 32px); }
.head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 22px; }
.big { font-size: clamp(36px, 5.2vw, 56px); font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.right { text-align: right; font-size: 15px; line-height: 1.35; color: var(--text2); }
.right b { display: block; font-weight: 600; color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11px, 1fr)); gap: 7px; }
.d { aspect-ratio: 1; border-radius: 50%; background: var(--dot); }
.d.past { background: var(--text); }
.d.today { background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.d.goal { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
body.jourj .d { background: var(--accent); box-shadow: none; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .55; } }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 24px; margin-top: 18px; font-size: 12px; color: var(--text2); }
.nojs { margin-top: 14px; font-size: 15px; color: var(--text2); }

/* Pied de page : liens très discrets */
footer { border-top: 1px solid var(--hair); font-size: 12px; color: var(--text2); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 24px; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.links { display: flex; flex-wrap: wrap; gap: 0 20px; }
footer span, footer a { display: inline-block; padding: 6px 0; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--text); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 600px) { .right { text-align: left; } }
@media (prefers-reduced-motion: reduce) { .d.today { animation: none; } }
