@charset "UTF-8";
/* Jour — feuille unique. Même grammaire que Briques (couleurs système iOS, SF, rayons),
   teinte indigo propre à Jour. Aucune ressource externe. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --fill: rgba(118, 118, 128, .12);
  --fill-strong: rgba(118, 118, 128, .2);
  --label: #1c1c1e;
  --label-2: #636366;
  --label-3: #aeaeb2;
  --separator: rgba(60, 60, 67, .18);
  --tint: #4b48c7;          /* texte, liens (AA sur blanc) */
  --tint-vivid: #5856d6;    /* barres, icônes actives */
  --tint-fill: #5856d6;     /* boutons pleins */
  --tint-soft: rgba(88, 86, 214, .12);
  --on-tint: #ffffff;
  --green: #34c759; --green-text: #1d7a3a; --green-soft: rgba(52, 199, 89, .16);
  --orange: #ff9500; --orange-text: #a35200; --orange-soft: rgba(255, 149, 0, .16);
  --red-text: #c5221a;
  --material: rgba(249, 249, 251, .88);
  --material-filter: saturate(180%) blur(20px);
  --shadow-pop: 0 10px 38px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .08);
  --r-10: 10px; --r-12: 12px; --r-16: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --tabbar-h: 50px;
  --mini-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-strong: rgba(118, 118, 128, .36);
    --label: #ffffff;
    --label-2: #aeaeb2;
    --label-3: #636366;
    --separator: rgba(84, 84, 88, .6);
    --tint: #8e8cff;
    --tint-vivid: #7d7aff;
    --tint-fill: #5e5ce6;
    --tint-soft: rgba(125, 122, 255, .2);
    --green-text: #30d158; --green-soft: rgba(48, 209, 88, .2);
    --orange-text: #ffb340; --orange-soft: rgba(255, 159, 10, .2);
    --red-text: #ff6961;
    --material: rgba(28, 28, 30, .88);
    --shadow-pop: 0 10px 38px rgba(0, 0, 0, .6), 0 0 0 .5px rgba(255, 255, 255, .1);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 400 17px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tint); }
:focus-visible { outline: 3px solid var(--tint-vivid); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gabarit ---------- */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 28px);
}
body.has-mini .page { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-bottom) + 36px); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 4px 18px; }
.head-date { margin: 0 0 2px; color: var(--label-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.head h1 { margin: 0; font: 700 34px/1.12 var(--font-display); letter-spacing: -.01em; }
.head-side { display: flex; gap: 6px; padding-bottom: 4px; }

.section-title { margin: 26px 4px 8px; font: 600 20px/1.2 var(--font-display); }
.section-title .count { color: var(--label-2); font-weight: 500; }
.hint { margin: 6px 4px 0; color: var(--label-2); font-size: 13px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--fill); color: var(--tint); font-weight: 600; font-size: 16px;
  transition: transform .12s var(--ease), opacity .12s;
}
.btn:active { transform: scale(.97); opacity: .8; }
.btn.primary { background: var(--tint-fill); color: var(--on-tint); }
.btn:disabled { opacity: .45; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--tint);
}
.icon-btn.filled { background: var(--fill); }
.icon-btn svg, .btn svg, .tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--fill-strong); }

/* ---------- Groupes / cellules ---------- */
.group { background: var(--surface); border-radius: var(--r-12); overflow: hidden; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--separator); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-sub { color: var(--label-2); font-size: 15px; overflow-wrap: anywhere; }
.row-meta { color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
button.row { width: 100%; border: 0; background: none; text-align: left; }
button.row:active { background: var(--fill); }
.chev { width: 8px; height: 13px; color: var(--label-3); flex: none; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Carte d'état vide ---------- */
.empty {
  display: grid; justify-items: center; gap: 6px; padding: 36px 24px; text-align: center;
  background: var(--surface); border-radius: var(--r-12); color: var(--label-2);
}
.empty svg { width: 36px; height: 36px; stroke: var(--label-3); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty strong { color: var(--label); font-size: 17px; }
.empty p { margin: 0; font-size: 15px; max-width: 34ch; }

/* ---------- Plan du jour ---------- */
.daynav { display: flex; align-items: center; gap: 2px; }
.summary {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--r-12);
}
.ring { width: 46px; height: 46px; flex: none; }
.ring circle { fill: none; stroke-width: 5; }
.ring .bgc { stroke: var(--fill-strong); }
.ring .fgc { stroke: var(--green); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .4s var(--ease); }
.summary-text strong { display: block; font-size: 17px; }
.summary-text span { color: var(--label-2); font-size: 15px; }
.plan-source { margin: 8px 4px 0; color: var(--label-2); font-size: 13px; }

.timeline { display: grid; gap: 10px; margin-top: 14px; }
.ex {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  padding: 14px 14px 12px 16px; background: var(--surface); border-radius: var(--r-12);
  transition: opacity .2s;
}
.ex-top { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; color: var(--label-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-emoji { font-size: 15px; }
.ex-title { margin: 0; font: 600 17px/1.3 var(--font); overflow-wrap: anywhere; }
.ex-body { grid-column: 1; display: grid; gap: 6px; }
.ex-line { display: flex; gap: 8px; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.ex-line .k { flex: none; width: 18px; text-align: center; }
.ex-line.res { color: var(--label-2); }
.ex-line.crit { color: var(--green-text); }
.ex-actions { grid-column: 2; grid-row: 2 / span 2; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.check {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
}
.check i {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--label-3); transition: background .15s, border-color .15s, transform .15s var(--ease);
}
.check svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; stroke-linecap: round; stroke-linejoin: round; }
.check[aria-checked="true"] i { background: var(--green); border-color: var(--green); }
.check[aria-checked="true"] svg { opacity: 1; }
.check:active i { transform: scale(.9); }
.ex.done { opacity: .62; }
.ex.done .ex-title { text-decoration: line-through; text-decoration-color: var(--label-3); }
.timer {
  min-width: 64px; height: 32px; padding: 0 10px; border: 0; border-radius: 16px;
  background: var(--fill); color: var(--label-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.timer.on { background: var(--orange-soft); color: var(--orange-text); }
.bloc { display: flex; align-items: center; gap: 10px; padding: 4px 16px; color: var(--label-2); font-size: 15px; }
.bloc .t { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; min-width: 84px; }
.note { padding: 12px 16px; background: var(--tint-soft); border-radius: var(--r-12); font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }

/* ---------- Écoute ---------- */
.addlink { display: flex; gap: 8px; padding: 10px; background: var(--surface); border-radius: var(--r-12); }
.addlink input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--surface-2); font-size: 16px;
}
.dl-state { font-size: 13px; font-weight: 600; }
.dl-state.attente, .dl-state.en_cours { color: var(--orange-text); }
.dl-state.fini { color: var(--green-text); }
.dl-state.erreur { color: var(--red-text); }
.art {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px;
  background: var(--tint-soft); color: var(--tint-vivid);
}
.art svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row.playing .art { background: var(--tint-vivid); color: #fff; }
.row.playing .row-title { color: var(--tint); }
.bar { height: 3px; margin-top: 6px; border-radius: 2px; background: var(--fill-strong); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--tint-vivid); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 8px; background: var(--green-soft); color: var(--green-text); font-size: 12px; font-weight: 600; }
.qtools { display: flex; gap: 0; }
.qtools .icon-btn { width: 36px; height: 44px; color: var(--label-2); }

/* Mini-lecteur */
.mini {
  position: fixed; z-index: 20; left: 8px; right: 8px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  max-width: 664px; margin: 0 auto; height: var(--mini-h);
  display: flex; align-items: center; gap: 10px; padding: 0 6px 0 8px;
  background: var(--material); -webkit-backdrop-filter: var(--material-filter); backdrop-filter: var(--material-filter);
  border-radius: 14px; box-shadow: var(--shadow-pop);
}
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; padding: 0; border: 0; background: none; text-align: left; }
.mini-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.mini .bar { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; margin: 0; background: transparent; }

/* Feuille (lecteur plein, documents) */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 680px; margin: 0 auto;
  max-height: calc(100% - var(--safe-top) - 24px); overflow: auto;
  padding: 8px 20px calc(var(--safe-bottom) + 24px);
  background: var(--surface); border-radius: 16px 16px 0 0;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.sheet.show { transform: none; }
.grab { width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--fill-strong); }
.sheet-close { position: absolute; top: 6px; right: 8px; }
.player-art {
  display: grid; place-items: center; width: min(62vw, 240px); aspect-ratio: 1; margin: 20px auto 22px;
  border-radius: 20px; background: linear-gradient(145deg, var(--tint-vivid), #af52de); color: #fff;
  box-shadow: 0 12px 30px rgba(88, 86, 214, .35);
}
.player-art svg { width: 38%; height: 38%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.player-title { margin: 0; font: 700 20px/1.25 var(--font-display); text-align: center; overflow-wrap: anywhere; }
.player-sub { margin: 4px 0 0; color: var(--label-2); text-align: center; font-size: 15px; }
.scrub { margin: 22px 0 4px; }
.scrub input { width: 100%; margin: 0; accent-color: var(--tint-vivid); height: 28px; }
.times { display: flex; justify-content: space-between; color: var(--label-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 10px; }
.controls .icon-btn { width: 56px; height: 56px; color: var(--label); }
.controls .icon-btn svg { width: 30px; height: 30px; }
.controls .big { width: 72px; height: 72px; background: var(--tint-fill); color: #fff; }
.controls .big svg { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.skip { position: relative; }
.skip small { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-40%); font-size: 10px; font-weight: 700; }
.player-foot { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.speed { min-width: 72px; }

/* ---------- Lecture ---------- */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper input {
  width: 64px; height: 36px; border: 0; border-radius: 8px; background: var(--surface-2);
  text-align: center; font-variant-numeric: tabular-nums; font-size: 16px;
}
.stepper .icon-btn { width: 36px; height: 36px; background: var(--fill); }
.fmt { display: inline-block; min-width: 36px; padding: 2px 6px; border-radius: 6px; background: var(--fill); color: var(--label-2); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; }

/* ---------- Routines ---------- */
.routine[open] summary .chev { transform: rotate(90deg); }
.routine summary { list-style: none; }
.routine summary::-webkit-details-marker { display: none; }
.routine .chev { transition: transform .2s var(--ease); }
.out {
  margin: 0 16px 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2);
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: var(--label-3); }

/* ---------- Virelangues / cartes ---------- */
.cards { display: grid; gap: 10px; }
.card { padding: 16px; background: var(--surface); border-radius: var(--r-12); }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card .txt { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.card.vire .txt { font: 600 22px/1.35 var(--font-display); }
.card .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.card .src { margin-top: 8px; color: var(--label-2); font-size: 13px; }
.card-row { display: flex; gap: 8px; align-items: flex-start; }
.card-row > div { flex: 1; min-width: 0; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--material); -webkit-backdrop-filter: var(--material-filter); backdrop-filter: var(--material-filter);
  border-top: .5px solid var(--separator);
}
.tab {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 0; border: 0; background: none; color: var(--label-2); font-size: 10px; font-weight: 600;
}
.tab svg { width: 25px; height: 25px; stroke-width: 1.8; }
.tab[aria-current="page"] { color: var(--tint-vivid); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-top) + 10px);
  transform: translate(-50%, -140%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 22px; background: var(--material); box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: var(--material-filter); backdrop-filter: var(--material-filter);
  font-size: 15px; font-weight: 500; transition: transform .3s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }

.loading { padding: 60px 0; text-align: center; color: var(--label-2); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login form { width: min(100%, 360px); display: grid; gap: 14px; text-align: center; }
.login .logo { width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 18px; }
.login h1 { margin: 0; font: 700 28px/1.2 var(--font-display); }
.login p { margin: 0; color: var(--label-2); font-size: 15px; }
.login input {
  height: 50px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--surface); font-size: 17px;
}
.login .btn { min-height: 50px; }
.login .err { color: var(--red-text); font-size: 15px; }

@media (min-width: 700px) {
  .head h1 { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Agenda (cours du jour) en tête du plan */
.agenda .row { min-height: 40px; padding-top: 7px; padding-bottom: 7px; font-size: 15px; }
.agenda .row-title { font-weight: 500; }
.agenda .ev-t { min-width: 92px; color: var(--label); font-weight: 600; }
.gap { height: 12px; }
.agenda + .empty { margin-top: 12px; }
.card .txt.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
