/* Subscriber space, home (8 October 2026, Audric: « un tableau de bord avec le coach IA, Rythme, le journal »).
   One memorable element, the night panel with the next sleep in large figures; everything else stays quiet: white
   cards, hairlines, Dodo's blue. Amber only marks what waits for the parent (a check-in due). */
.home { display: grid; gap: 14px; padding: 4px 0 24px; }
main > section.home { margin-top: 0; } /* the hidden sign-in section before it must not push it down */
/* When a check-in waits, it comes first. */
.home-actions .home-due { order: -1; }
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-head h1 { margin: 8px 0 2px; }
.home-date { margin: 0; color: var(--muted); }
.home-head .chat-menu-btn { margin-top: 6px; }

/* Night panel: the next sleep, from Rythme. */
.home-night { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; padding: 22px 22px 20px; color: #EEF2FA;
  background: radial-gradient(120% 90% at 88% -10%, rgba(147, 171, 232, .38), transparent 62%), linear-gradient(165deg, #23376F 0%, #151F45 68%, #0F1733 100%); }
.home-night::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .75; pointer-events: none;
  background:
    radial-gradient(1.4px 1.4px at 12% 22%, #fff 99%, transparent), radial-gradient(1px 1px at 28% 68%, #fff 99%, transparent),
    radial-gradient(1.2px 1.2px at 46% 14%, #fff 99%, transparent), radial-gradient(1px 1px at 62% 44%, #fff 99%, transparent),
    radial-gradient(1.6px 1.6px at 74% 78%, #fff 99%, transparent), radial-gradient(1px 1px at 90% 58%, #fff 99%, transparent),
    radial-gradient(1.2px 1.2px at 36% 88%, #fff 99%, transparent), radial-gradient(1px 1px at 8% 80%, #fff 99%, transparent); }
/* The night-light: a warm crescent, the only amber in the panel. */
.home-night::after { content: ""; position: absolute; top: 20px; right: 22px; width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset -11px 7px 0 0 #F2CF92; transform: rotate(-18deg); opacity: .95; }
.home-night h2 { margin: 0; font-size: .95rem; font-weight: 600; letter-spacing: 0; color: rgba(238, 242, 250, .78); }
.home-night-time { margin: 10px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.home-night-time .kind { font-size: 1.05rem; font-weight: 600; }
.home-night-time .clock { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; font-size: clamp(2.6rem, 12vw, 3.4rem);
  line-height: 1; letter-spacing: -.02em; }
.home-night-note { margin: 0 0 16px; color: rgba(238, 242, 250, .82); font-size: .93rem; max-width: 34ch; }
.home-night-link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  color: #fff; text-decoration: none; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.home-night-link:hover { background: rgba(255, 255, 255, .2); }
.home-night-link:focus-visible { outline-color: #fff; }

/* Cards */
.home-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; align-content: start; }
.home-card h2 { margin: 0; font-size: 1.1rem; }
.home-card-head { display: flex; align-items: center; gap: 12px; }
.home-card-sub { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.home-card-text { margin: 0; }
.home-card-text:empty { display: none; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-actions .btn, .home-journal .btn { padding: 12px 20px; min-height: 44px; }
.home-journal .btn { justify-self: start; }
.btn.home-due { background: var(--warn-bg); color: var(--text); border: 1px solid var(--warn-line); }

/* The ten days of the plan: a real sequence, so one mark per day. */
.home-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.home-days li { height: 8px; border-radius: 999px; background: var(--line); }
.home-days li.done { background: var(--accent); }
.home-days li.today { background: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }
.home-days li.checkin:not(.done):not(.today) { background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Journal figures: the number first, its meaning under it. */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.home-stats div { display: flex; flex-direction: column-reverse; gap: 2px; padding: 10px 8px; border-radius: 12px; background: var(--surface); }
.home-stats dt { font-size: .76rem; line-height: 1.25; color: var(--muted); }
.home-stats dd { margin: 0; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; font-size: 1.35rem; }

.home-more { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-more a { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; }
.home-more a span { color: var(--muted); font-size: .86rem; }
.home-more a:hover { border-color: var(--line-strong); }

/* Press feedback on touch-down. */
.home .btn, .home-more a, .home-night-link { transition: transform 100ms ease-out; }
.home .btn:active, .home-more a:active, .home-night-link:active { transform: scale(.97); }

/* One orchestrated moment: the night panel settles in when the space opens. */
.home.is-ready .home-night { animation: home-in 420ms cubic-bezier(.2, .9, .25, 1) both; }
@keyframes home-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .home.is-ready .home-night { animation: none; }
  .home .btn, .home-more a, .home-night-link { transition: none; }
}

@media (min-width: 680px) {
  .home { grid-template-columns: 1fr 1fr; gap: 16px; }
  .home-head, .home-night, .home-more { grid-column: 1 / -1; }
  .home-night { padding: 28px; }
}
@media (max-width: 359px) { .home-stats { grid-template-columns: 1fr 1fr; } .home-more { grid-template-columns: 1fr; } }
/* « Vos 14 dernières nuits »: columns for noted nights, a thin dash for an unnoted one, the plan's start marked. */
.home-progress { margin: 4px 0 0; }
.home-progress figcaption { font-weight: 600; font-size: .95rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.home-progress figcaption span { font-weight: 400; font-size: .82rem; color: var(--muted); }
.progress-chart { display: block; width: 100%; height: auto; margin: 8px 0 4px; }
.progress-chart .bar { fill: var(--accent); }
.progress-chart .bar.zero { fill: var(--soft); stroke: var(--accent); stroke-width: 1; }
.progress-chart .unnoted { fill: var(--line); }
.progress-chart .axis { stroke: var(--line); stroke-width: 1; }
.progress-chart .plan-start { stroke: var(--glow); stroke-width: 1.5; stroke-dasharray: 3 3; }
.progress-chart .label { font: 500 9px var(--font-sans); fill: var(--muted); }
.progress-chart .label.end { text-anchor: end; }
.home-progress .note { margin: 0; font-size: .86rem; color: var(--muted); }
