/* Hassanates : « Aujourd'hui », le ciel vivant et la journée. Chargée par /app/ seulement. S'appuie sur identite.css et app.css. */
.app-main.is-bleed > * { animation: none; } /* le ciel ne flotte pas : il est là, ou il se lève avec l'ouverture */
/* ---------- « Aujourd'hui » : le ciel vivant (dégradé CSS de repli, canvas par-dessus : sky-canvas.js) ---------- */
.app-main.is-bleed { width: min(100%, var(--app-maxw)); gap: 0; }
.now { position: relative; display: grid; grid-template-rows: auto 1fr; min-height: clamp(400px, 60svh, 560px); margin-top: calc(-1 * (var(--top-h) + var(--safe-t))); padding: calc(var(--top-h) + var(--safe-t)) var(--gutter) 42px; background: var(--sky-grad); color: var(--on-sky); overflow: hidden; isolation: isolate; transition: color .8s; }
.sky-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
/* Repli sans canvas : un astre simple, placé au-dessus du texte */
.sky { position: absolute; inset: calc(var(--top-h) + var(--safe-t) + 34px) 10% auto; height: 34%; z-index: -1; }
.now.has-canvas .sky { display: none; }
.orb { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: color-mix(in srgb, var(--sky-low) 30%, #fff); box-shadow: 0 0 0 10px color-mix(in srgb, #fff 18%, transparent); }
.now-place { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero-place { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -10px; padding: 0 10px; border-radius: var(--r-md); background: transparent; color: inherit; border: 0; font: 600 .9rem var(--f-body); cursor: pointer; transition: transform .35s var(--spring), background-color .15s; }
.hero-place span { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.hero-place:active { transform: scale(.94); }
.now-prayed { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-right: -4px; padding: 0 12px; border: 0; border-radius: var(--r-md); background: color-mix(in srgb, var(--on-sky) 14%, transparent); color: inherit; font: 600 .9rem var(--f-body); cursor: pointer; animation: fade .5s var(--ease) both; transition: transform .35s var(--spring); }
.now-prayed:active { transform: scale(.94); }
.now-prayed[disabled] { cursor: default; background: transparent; }
.now :focus-visible { outline-color: currentColor; }
.now-body { align-self: end; display: flex; flex-direction: column; transition: opacity .5s; }
.now-lead { align-self: flex-start; margin: 0 0 2px; font: 600 .95rem/1.2 var(--f-body); }
.now .now-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 0; font: 800 clamp(3.4rem, 19vw, 5.6rem)/.92 var(--f-moment); letter-spacing: -.03em; }
.now-ar { font: 700 clamp(1.8rem, 9vw, 2.6rem)/1 var(--f-kufi); letter-spacing: 0; }
.now-at { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 10px 0 0; font: 500 1rem/1.3 var(--f-body); }
.now-left, .now-time { align-self: flex-start; }
.now-time { font: 700 1.5rem/1 var(--f-moment); font-variant-numeric: tabular-nums; }
.now-left { font-variant-numeric: tabular-nums; }
.now-ramadan { margin: 8px 0 0; font-weight: 600; }

/* La dernière heure : le temps restant passe devant le nom de la prière */
.now[data-approche] .now-at { display: contents; }
.now[data-approche] .now-lead { order: 0; }
.now[data-approche] .now-left { order: 1; margin: 0 0 8px; font: 800 clamp(3rem, 15.5vw, 4.6rem)/.95 var(--f-moment); letter-spacing: -.03em; animation: rise .6s var(--ease) both; }
.now[data-approche] .now-name { order: 2; font-size: clamp(1.7rem, 8vw, 2.3rem); letter-spacing: -.01em; }
.now[data-approche] .now-name .now-ar { font-size: 1em; }
.now[data-approche] .now-time { order: 3; margin-top: 8px; font-size: 1.3rem; }
.now[data-approche] .now-iq { order: 4; margin-top: 4px; }
.now[data-approche] .now-ramadan { order: 5; }
.now[data-approche="imminent"] .now-left { font-size: clamp(3.6rem, 19vw, 5.6rem); }

/* À l'heure : le nom arabe, et rien d'autre */
.now.is-arrived .now-body, .now.is-arrived .now-place { opacity: 0; transition: opacity .6s; pointer-events: none; }
.now-arrive { position: absolute; inset: 0 var(--gutter) 22px; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; animation: arrive 1.4s var(--ease) both; }
.now-arrive b { font: 700 clamp(3.8rem, 21vw, 6.4rem)/1.2 var(--f-kufi); }
.now-arrive span { font: 600 1rem/1.3 var(--f-body); }
@keyframes arrive { from { opacity: 0; } }

@supports (animation-timeline: scroll()) {
  .now-body { animation: sky-away linear both; animation-timeline: scroll(root); animation-range: 0 320px; }
  @keyframes sky-away { to { transform: translateY(-36px); opacity: .25; } }
}
@media (prefers-reduced-motion: reduce) { .now-body { animation: none; } }

/* Feuille qui recouvre le ciel quand on fait défiler */
.sheet-day { position: relative; z-index: 1; margin-top: -22px; padding: 6px var(--gutter) 8px; background: var(--c-bg); border-radius: var(--r-xl) var(--r-xl) 0 0; display: grid; gap: 10px; }
.sheet-day::before { content: ''; justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--c-surface-3); margin: 4px 0 2px; }
.ruler-cap { margin: 4px 0 -6px; font: 600 .8rem var(--f-body); color: var(--accent-fg); }
.ruler { list-style: none; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 2px; display: grid; grid-template-columns: repeat(6, auto); justify-content: space-between; gap: 2px 6px; overflow-x: auto; scrollbar-width: none; }
/* Grand texte ou écran très étroit : deux rangées de trois, jamais de défilement caché. */
@media (max-width: 359px) { .ruler { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 519px) { :root[data-text] .ruler { grid-template-columns: repeat(3, 1fr); } }
.ruler li { position: relative; display: grid; gap: 3px; padding: 10px 0 8px; text-align: center; }
.r-name { font: 500 .8125rem/1 var(--f-body); letter-spacing: -.02em; color: var(--c-muted); white-space: nowrap; }
.r-t { font: 700 1.14rem/1 var(--f-moment); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.r-iq { font: 500 .8125rem/1 var(--f-body); color: var(--c-muted); font-variant-numeric: tabular-nums; }
.ruler .is-past { opacity: .45; }
.ruler .is-next { color: var(--c-text); }
.ruler .is-next .r-name { color: var(--accent-fg); font-weight: 700; }
.ruler .is-next::before { content: ''; position: absolute; left: 50%; top: 0; width: 18px; height: 5px; margin-left: -9px; border-radius: 0 0 3px 3px; background: var(--mark); }
.day-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: .86rem; }
.day-meta .hijri { font: 700 1.08rem/1.3 var(--f-kufi); }
.near { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 2px; }
.near a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: var(--r-md); background: var(--c-surface); color: var(--c-text); font: 600 .88rem var(--f-body); text-decoration: none; transition: transform .35s var(--spring); }
.near a:active { transform: scale(.94); }

/* Emplacements réservés : la page ne saute pas quand ils se remplissent */
.slot { border-radius: var(--r-lg); }
.slot-notice { min-height: 0; }
.slot-todo { min-height: 238px; }
.slot-resume { min-height: 64px; }
.slot-verse { min-height: 210px; }
.block { display: block; padding: 16px 0 10px; color: inherit; text-decoration: none; animation: fade .35s var(--ease) both; }
.todo, .verse { box-shadow: inset 0 1px 0 var(--c-line); }
.resume, .notice { border-radius: var(--r-lg); }
.notice { background: var(--c-surface); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.app-main .block-head h2 { margin: 0; font-size: 1.12rem; }
.streak { display: inline-flex; align-items: center; gap: 4px; font: 600 .82rem var(--f-body); color: var(--accent-fg); text-decoration: none; min-height: 44px; }
.todo-list { list-style: none; margin: 0 calc(-1 * var(--gutter)); padding: 0; }
.todo-item { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px var(--gutter); color: inherit; text-decoration: none; transition: background-color .15s; }
.todo-item:active { background: var(--c-surface-2); }
.todo-item > .ico { color: var(--c-muted); }
.todo-list li + li .todo-item { box-shadow: inset 0 1px 0 var(--c-line); }
.tick { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--c-line-strong); color: var(--on-brand); }
.is-done .tick { background: var(--jade); box-shadow: none; }
.is-done b { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--c-muted); }
.todo-txt b { display: block; font-weight: 600; line-height: 1.25; }
.todo-txt small { color: var(--c-muted); font-size: .82rem; }
.more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; font: 600 .9rem var(--f-body); color: var(--accent-fg); text-decoration: none; }
.more .ico { transition: transform .35s var(--spring); }
.more:hover .ico, .more:active .ico { transform: translateX(4px); }
.resume, .notice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; }
.resume { background: var(--c-solid); color: var(--c-on-solid); }
.resume small, .notice small { display: block; font-size: .8rem; opacity: .75; }
.resume b, .notice b { display: block; font-weight: 600; }
.resume:active, .notice:active { transform: scale(.985); }
.verse .quran { font-size: clamp(1.6rem, 6.4vw, 2rem); line-height: 2.15; text-align: right; margin: 10px 0 6px; }
.ref { font: 600 .84rem var(--f-body); color: var(--c-muted); }

/* « Aujourd'hui » sur grand écran : le ciel à gauche (fixe), la journée à droite */
@media (min-width: 1000px) {
  body[data-page="accueil"] .app-top { background: var(--c-bg); animation: none; }
  body[data-page="accueil"] .app-top > * { color: var(--c-text); }
  .app-main.is-bleed { width: min(100% - 56px, 1180px); grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 32px; align-items: start; margin-top: 8px; }
  .now { position: sticky; top: calc(var(--top-h) + var(--safe-t) + 8px); min-height: calc(100dvh - var(--top-h) - 40px); margin-top: 0; padding: 20px 32px 40px; border-radius: var(--r-xl); }
  .sky { inset: 90px 48px auto; height: 44%; }
  .sheet-day { margin-top: 0; padding: 0; border-radius: 0; background: transparent; }
  .sheet-day::before { display: none; }
  .now-body { animation: none; }
}
