/* Carnet — cuir vert bouteille, papier vergé froid, ruban lie-de-vin */

:root {
  --leather: #1d3b37;
  --leather-deep: #142a27;
  --leather-hi: #2b524c;
  --on-leather: #e6ebe4;
  --on-leather-soft: #a9b8b2;
  --paper: #eceee8;
  --paper-edge: #dfe3dc;
  --ink: #1f2826;
  --ink-soft: #5b6661;
  --ink-faint: #8a948f;
  --rule: rgba(31, 40, 38, .085);
  --margin-line: rgba(125, 47, 53, .22);
  --brass: #b08d4a;
  --brass-hi: #cdae6c;
  --ribbon: #7d2f35;
  --ribbon-deep: #5e2328;
  --desk: #c9cfc7;
  --danger: #9a3a3a;
  --focus: #b08d4a;
  --m1: #5d6878; --m2: #5a8296; --m3: #8a958d; --m4: #b38f45; --m5: #c97633;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --line: 2rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --leather: #13261f;
    --leather-deep: #0c1915;
    --leather-hi: #1f3a33;
    --paper: #171d1c;
    --paper-edge: #101514;
    --ink: #dfe5df;
    --ink-soft: #9ba7a1;
    --ink-faint: #6d7873;
    --rule: rgba(223, 229, 223, .06);
    --margin-line: rgba(196, 98, 106, .22);
    --desk: #0b100f;
    --ribbon: #8e3a41;
    --ribbon-deep: #6a2a30;
    --danger: #d77a7a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { width: 1.15em; height: 1.15em; flex: none; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- texture cuir */
.spine, .cover {
  background-color: var(--leather);
  background-image:
    radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.07), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(0,0,0,.28), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  color: var(--on-leather);
}

/* ---------- boutons */
.btn-ink, .btn-brass {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-weight: 600; font-size: .95rem; letter-spacing: .01em;
  padding: .85em 1.35em; border-radius: 999px;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn-ink { background: var(--leather); color: var(--on-leather); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 18px -8px rgba(20,42,39,.55); }
.btn-ink:hover { background: var(--leather-hi); }
.btn-ink:active, .btn-brass:active { transform: translateY(1px); }
.btn-ink.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-faint); }
.btn-ink.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ink.small { padding: .6em 1.1em; font-size: .88rem; }
@media (prefers-color-scheme: dark) { .btn-ink { background: var(--brass); color: #1a1408; } .btn-ink:hover { background: var(--brass-hi); } }
.btn-brass {
  width: 100%;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass));
  color: #231a08;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 20px -10px rgba(0,0,0,.6);
}
.btn-brass:hover { filter: brightness(1.05); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; color: inherit; display: inline-flex; align-items: center; gap: .3em; }
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .45em .9em; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; box-shadow: inset 0 0 0 1px var(--rule), inset 0 0 0 1px var(--ink-faint);
  color: var(--ink-soft); font-size: .85rem; font-weight: 500; text-decoration: none;
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chip.on { color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.chip.on svg { fill: currentColor; }
.chip.danger { color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 50%, transparent); }
.chip.danger:hover { box-shadow: inset 0 0 0 1px var(--danger); }

/* ---------- couverture (connexion) */
body.is-cover {
  background:
    radial-gradient(70% 60% at 50% 30%, #2a3330 0%, #121816 70%) fixed;
  min-height: 100vh;
}
.cover-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.cover {
  position: relative; width: min(400px, 100%);
  border-radius: 6px 16px 16px 6px;
  box-shadow:
    inset 14px 0 18px -10px rgba(0,0,0,.55),
    inset 0 0 0 1px rgba(255,255,255,.05),
    6px 0 0 -2px #d8dbd3, 9px 1px 0 -3px #c3c7bf, 12px 2px 0 -4px #b3b7ae,
    0 40px 80px -30px rgba(0,0,0,.8);
  animation: cover-in .9s cubic-bezier(.2,.7,.2,1) both;
}
.cover::before { /* surpiqûre */
  content: ""; position: absolute; inset: 12px 12px 12px 22px; border-radius: 4px 10px 10px 4px;
  border: 1px dashed rgba(230,235,228,.18); pointer-events: none;
}
@keyframes cover-in { from { opacity: 0; transform: translateY(14px) rotate(-.6deg); } to { opacity: 1; transform: none; } }
.cover-band {
  position: absolute; top: -6px; bottom: -6px; right: 54px; width: 14px;
  background: linear-gradient(90deg, var(--ribbon-deep), var(--ribbon) 40%, var(--ribbon-deep));
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 2px 0 6px rgba(0,0,0,.35);
  border-radius: 3px;
}
.cover-inner { position: relative; padding: 56px 88px 44px 44px; display: grid; gap: 36px; }
.cover.small .cover-inner { padding-bottom: 40px; }
.emboss h1 {
  margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: 3.6rem; line-height: 1; letter-spacing: -.01em;
  color: rgba(230, 235, 228, .82);
  text-shadow: 0 -1px 0 rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.12);
}
.cover.small .emboss h1 { font-size: 2.4rem; }
.emboss p { margin: .7em 0 0; color: var(--on-leather-soft); font-size: .95rem; }
.emboss-mark {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 28px;
  border-radius: 50%; border: 1.5px solid var(--brass);
  font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--brass-hi);
}
.cover-form { display: grid; gap: 16px; }
.cover-form label { display: grid; gap: 6px; font-size: .82rem; color: var(--on-leather-soft); font-weight: 500; }
.cover-form input:not([type=checkbox]) {
  width: 100%; padding: .75em .9em; border-radius: 8px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(230,235,228,.14);
  color: var(--on-leather); font-size: 1rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.25);
}
.cover-form input:focus { outline: none; border-color: var(--brass); }
.check { display: flex !important; align-items: center; gap: .6em !important; grid-auto-flow: column; cursor: pointer; }
.check input { accent-color: var(--brass); width: 1.05em; height: 1.05em; }
.cover-error { margin: 0; color: #f0b9b0; font-size: .88rem; }
.cover .btn-brass { margin-top: 6px; }
@media (max-width: 420px) {
  .cover-inner { padding: 44px 64px 34px 32px; }
  .cover-band { right: 34px; }
  .emboss h1 { font-size: 3rem; }
}

/* ---------- bureau : dos du carnet + page */
.desk { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; min-height: 100vh; }
.spine {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  box-shadow: inset -18px 0 24px -16px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 22px 28px 0;
  padding-top: max(22px, env(safe-area-inset-top));
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.25px solid var(--brass); color: var(--brass-hi);
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; line-height: 1;
}
.brand-name { font-family: var(--serif); font-style: italic; font-size: 1.3rem; }
.topnav { display: flex; align-items: center; gap: 18px; font-size: .84rem; color: var(--on-leather-soft); }
.topnav a { text-decoration: none; }
.topnav a:hover, .topnav a.on, .topnav button:hover { color: var(--on-leather); }
.topnav form { margin: 0; }
.topnav .linkish { text-decoration: none; }

.spine-body { padding: 44px 28px 32px; display: flex; flex-direction: column; gap: 28px; flex: 1; }
.hello { margin: 0; font-family: var(--serif); font-size: 2.15rem; line-height: 1.12; font-weight: 300; letter-spacing: -.01em; }
.hello em { font-style: italic; font-weight: 400; color: #fff; }
@media (prefers-color-scheme: dark) { .hello em { color: var(--brass-hi); } }
.hello-sub { margin: -16px 0 0; color: var(--on-leather-soft); }

/* calendrier */
.cal { background: rgba(0,0,0,.16); border-radius: 14px; padding: 14px 14px 12px; box-shadow: inset 0 1px 3px rgba(0,0,0,.3), 0 1px 0 rgba(255,255,255,.05); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 1.15rem; text-transform: none; }
.cal-head h2::first-letter { text-transform: uppercase; }
.cal-nav { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--on-leather-soft); }
.cal-nav:hover { background: rgba(255,255,255,.07); color: var(--on-leather); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-dow { font-size: .68rem; color: var(--on-leather-soft); opacity: .7; padding-bottom: 4px; }
.cal-day {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%;
  font-size: .82rem; text-decoration: none; color: var(--on-leather); font-variant-numeric: tabular-nums;
}
a.cal-day:hover { background: rgba(255,255,255,.08); }
.cal-day.out { opacity: .3; }
.cal-day.future { opacity: .35; }
.cal-day.today { box-shadow: inset 0 0 0 1.25px var(--brass); }
.cal-day.has { background: rgba(230,235,228,.13); font-weight: 600; }
.cal-day.has::after {
  content: ""; position: absolute; bottom: 12%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--on-leather-soft);
}
.cal-day[data-mood="1"]::after { background: #8f9bb0; }
.cal-day[data-mood="2"]::after { background: #86b3c9; }
.cal-day[data-mood="3"]::after { background: #b5c0b8; }
.cal-day[data-mood="4"]::after { background: #d9b66b; }
.cal-day[data-mood="5"]::after { background: #f0a159; }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--on-leather-soft); }
.search input {
  width: 100%; padding: .75em 1em .75em 2.6em; border-radius: 999px;
  background: rgba(0,0,0,.18); border: 1px solid rgba(230,235,228,.1); color: var(--on-leather);
}
.search input::placeholder { color: var(--on-leather-soft); opacity: .8; }
.search input:focus { outline: none; border-color: var(--brass); }
.filters { display: flex; gap: 6px; margin-top: -16px; flex-wrap: wrap; }
.filters a { font-size: .82rem; text-decoration: none; padding: .35em .8em; border-radius: 999px; color: var(--on-leather-soft); }
.filters a:hover { color: var(--on-leather); }
.filters a.on { background: rgba(230,235,228,.12); color: var(--on-leather); }

.tally { margin: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(230,235,228,.12); padding-top: 18px; }
.tally div { display: flex; flex-direction: column-reverse; gap: 2px; }
.tally dt { font-size: .74rem; color: var(--on-leather-soft); }
.tally dd { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-variant-numeric: lining-nums tabular-nums; }

/* la page */
.paper {
  position: relative; background: var(--paper);
  padding: 72px clamp(24px, 6vw, 96px) 96px;
  min-height: 100vh;
}
.paper > * { max-width: 680px; }
.ribbon {
  position: absolute; top: 0; right: clamp(28px, 7vw, 96px); width: 16px; height: 128px;
  background: linear-gradient(90deg, var(--ribbon-deep), var(--ribbon) 45%, var(--ribbon-deep));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.18));
  transform-origin: top center;
  animation: ribbon-sway 1.6s cubic-bezier(.3,.8,.3,1) .2s both;
}
@keyframes ribbon-sway { 0% { transform: scaleY(.2) rotate(4deg); } 60% { transform: scaleY(1) rotate(-1.5deg); } 100% { transform: none; } }

.today-card { padding-bottom: 44px; border-bottom: 1px solid var(--rule); margin-bottom: 44px; }
.today-date { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.today-date::first-letter { text-transform: uppercase; }
.today-line {
  margin: .25em 0 1.1em; font-family: var(--serif); font-weight: 300;
  font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -.015em; max-width: 18ch;
}

.paper-h { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 1.35rem; margin: 0 0 14px; }
.memories { margin-bottom: 48px; }
.memory {
  display: grid; grid-template-columns: 4.2rem 1fr; gap: 14px; align-items: baseline;
  padding: 12px 0; text-decoration: none; border-top: 1px dashed var(--rule);
}
.memory:hover .memory-text { color: var(--ink); }
.memory-year { font-family: var(--serif); color: var(--brass); font-size: 1.15rem; font-variant-numeric: lining-nums; }
.memory-text { color: var(--ink-soft); font-family: var(--serif); font-size: 1.08rem; line-height: 1.45; }
.filter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; color: var(--ink-soft); font-size: .88rem; }
.filter-head .paper-h { color: var(--ink); margin: 0; }

.month { margin-bottom: 40px; }
.month-h { margin: 0 0 4px; font-size: .82rem; font-weight: 600; color: var(--ink-faint); letter-spacing: .01em; }
.month-h::first-letter { text-transform: uppercase; }
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid; grid-template-columns: 4.2rem 1fr; gap: 14px;
  padding: 20px 0 22px; text-decoration: none; border-bottom: 1px solid var(--rule);
  transition: background-color .2s ease;
}
.entry:hover .entry-num { color: var(--ribbon); }
@media (prefers-color-scheme: dark) { .entry:hover .entry-num { color: var(--brass-hi); } }
.entry-num {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 3.1rem; line-height: .9; color: var(--ink); font-variant-numeric: lining-nums;
  transition: color .2s ease;
}
.entry-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.entry-meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-faint); }
.entry-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; line-height: 1.25; }
.entry-excerpt { font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }
.mood-ico[data-mood="1"], [data-mood="1"] > svg { color: var(--m1); }
.mood-ico[data-mood="2"], [data-mood="2"] > svg { color: var(--m2); }
.mood-ico[data-mood="3"], [data-mood="3"] > svg { color: var(--m3); }
.mood-ico[data-mood="4"], [data-mood="4"] > svg { color: var(--m4); }
.mood-ico[data-mood="5"], [data-mood="5"] > svg { color: var(--m5); }
.fav-ico { color: var(--brass); fill: var(--brass); width: .95em; height: .95em; }

.empty { color: var(--ink-soft); font-family: var(--serif); font-size: 1.15rem; line-height: 1.55; max-width: 34ch; }
.empty.first p { margin: 0 0 .5em; }

/* ---------- feuille (écrire / lire / réglages) */
body.is-writing, body.is-reading { background: var(--desk); }
.reader-wrap { min-height: 100vh; }
.reader-wrap > .topbar { max-width: 820px; margin: 0 auto; padding-bottom: 22px; color: var(--ink); }
.reader-wrap .topnav { color: var(--ink-soft); }
.reader-wrap .topnav a:hover, .reader-wrap .topnav a.on, .reader-wrap .topnav button:hover { color: var(--ink); }
.reader-wrap .brand-mark { color: var(--brass); }

.sheet {
  position: relative; max-width: 820px; margin: 0 auto;
  background: var(--paper);
  padding: 64px clamp(22px, 7vw, 88px) 56px;
  border-radius: 3px;
  box-shadow:
    0 1px 0 var(--paper-edge),
    0 3px 0 -1px var(--paper), 0 4px 0 -1px var(--paper-edge),
    0 6px 0 -2px var(--paper), 0 7px 0 -2px var(--paper-edge),
    0 30px 60px -30px rgba(10,20,18,.35);
}

/* écriture */
.writer { min-height: 100vh; padding: 0 0 48px; }
.writer-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 820px; margin: 0 auto; padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--desk) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .9rem; color: var(--ink-soft);
}
.writer-bar .back { text-decoration: none; }
.writer-status { font-size: .8rem; color: var(--ink-faint); flex: 1; text-align: center; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 24px; margin-bottom: 28px; padding-right: 36px; }
.day-pick { position: relative; cursor: pointer; }
.day-label {
  display: block; font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.1; border-bottom: 1px dashed transparent;
}
.day-label::first-letter { text-transform: uppercase; }
.day-pick:hover .day-label { border-bottom-color: var(--ink-faint); }
.day-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.day-pick input:focus-visible + * , .day-pick:focus-within .day-label { border-bottom-color: var(--brass); }
.moods { border: 0; margin: 0; padding: 0; }
.moods legend { font-size: .78rem; color: var(--ink-faint); margin-bottom: 6px; padding: 0; }
.mood-row { display: flex; gap: 2px; }
.mood {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 54px; padding: 7px 0 5px; border-radius: 10px; cursor: pointer; color: var(--ink-faint);
  transition: background-color .15s ease, color .15s ease;
}
.mood input { position: absolute; opacity: 0; pointer-events: none; }
.mood svg { width: 26px; height: 26px; color: var(--ink-faint) !important; transition: color .15s ease, transform .2s ease; }
.mood span { font-size: .68rem; }
.mood:hover { background: var(--rule); }
.mood:has(input:checked) { background: var(--rule); color: var(--ink); }
.mood[data-mood="1"]:has(input:checked) svg { color: var(--m1) !important; }
.mood[data-mood="2"]:has(input:checked) svg { color: var(--m2) !important; }
.mood[data-mood="3"]:has(input:checked) svg { color: var(--m3) !important; }
.mood[data-mood="4"]:has(input:checked) svg { color: var(--m4) !important; }
.mood[data-mood="5"]:has(input:checked) svg { color: var(--m5) !important; }
.mood:has(input:checked) svg { transform: scale(1.12); }
.mood:has(input:focus-visible) { outline: 2px solid var(--focus); }

.title-in, .body-in { display: block; width: 100%; border: 0; background: transparent; padding: 0; resize: none; }
.title-in { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; margin-bottom: 8px; line-height: var(--line); padding-bottom: 4px; }
.title-in:focus, .body-in:focus { outline: none; }
.title-in::placeholder, .body-in::placeholder { color: var(--ink-faint); opacity: .75; font-style: italic; font-weight: 300; }
.body-in {
  font-family: var(--serif); font-size: 1.2rem; line-height: var(--line);
  min-height: calc(var(--line) * 14);
  background-image: linear-gradient(to bottom, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
  background-size: 100% var(--line);
  background-attachment: local;
  padding-top: 2px;
}
.sheet-foot { margin: 20px 0 0; text-align: right; font-size: .78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.is-writing .sheet::before { /* marge */
  content: ""; position: absolute; top: 0; bottom: 0; left: clamp(12px, 4vw, 56px); width: 1px; background: var(--margin-line);
}

/* lecture */
.read-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 30px; padding-right: 36px; }
.read-num {
  font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(5rem, 14vw, 7.5rem);
  line-height: .75; color: var(--ribbon); font-variant-numeric: lining-nums; letter-spacing: -.03em;
}
@media (prefers-color-scheme: dark) { .read-num { color: var(--brass); } }
.read-date { margin: 0 0 4px; font-family: var(--serif); font-size: 1.15rem; color: var(--ink-soft); }
.read-date::first-letter { text-transform: uppercase; }
.read-mood { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-faint); }
.read-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 22px; max-width: 26ch; }
.prose { font-family: var(--serif); font-size: 1.22rem; line-height: 1.72; max-width: 62ch; overflow-wrap: anywhere; hyphens: auto; }
.prose p { margin: 0 0 1em; }
.prose p:first-child::first-letter {
  float: left; font-size: 3.6em; line-height: .82; padding: .06em .08em 0 0;
  font-style: italic; font-weight: 300; color: var(--ink);
}
.read-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--ink-faint); }
.read-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.read-actions form { margin: 0; }
.turn { max-width: 820px; margin: 22px auto 60px; padding: 0 16px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; font-size: .88rem; color: var(--ink-soft); }
.turn a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.turn a:hover { color: var(--ink); }
.turn a[rel=next] { justify-self: end; }

/* réglages / admin */
.panel { margin-bottom: 60px; }
.panel-title { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 2.6rem; margin: 0 0 8px; }
.panel-sec { padding: 28px 0; border-top: 1px solid var(--rule); }
.panel-sec:first-of-type { margin-top: 18px; }
.panel-sec h2 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; margin: 0 0 6px; }
.hint { color: var(--ink-soft); margin: 0 0 16px; max-width: 58ch; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.row-form input { flex: 1 1 200px; }
.stack-form { display: grid; gap: 14px; max-width: 380px; }
.stack-form label:not(.check) { display: grid; gap: 6px; font-size: .84rem; color: var(--ink-soft); font-weight: 500; }
.stack-form .btn-ink { justify-self: start; }
.panel input:not([type=checkbox]) {
  padding: .7em .9em; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  background: color-mix(in srgb, var(--paper) 60%, #fff 40%);
}
@media (prefers-color-scheme: dark) { .panel input:not([type=checkbox]) { background: rgba(0,0,0,.25); } }
.panel input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 25%, transparent); }

.people { list-style: none; margin: 24px 0 8px; padding: 0; }
.person { padding: 16px 0; border-top: 1px solid var(--rule); }
.person-id { display: flex; align-items: center; gap: 14px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--leather); color: var(--on-leather); font-family: var(--serif); font-style: italic; font-size: 1.2rem; flex: none; }
.person-name { margin: 0; font-weight: 600; }
.person-meta { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.tag { font-size: .7rem; font-weight: 600; color: var(--brass); border: 1px solid var(--brass); border-radius: 999px; padding: .05em .55em; margin-left: 4px; vertical-align: 2px; }
.person-tools { margin: 8px 0 0 56px; }
.person-tools summary { cursor: pointer; font-size: .84rem; color: var(--ink-soft); width: max-content; }
.person-tools[open] summary { margin-bottom: 12px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; background: var(--leather-deep); color: var(--on-leather);
  padding: 12px 20px; border-radius: 999px; font-size: .9rem; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5);
  animation: toast 4.2s ease both; max-width: calc(100% - 32px);
}
.toast p { margin: 0; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 6px); visibility: hidden; } }

/* ---------- mobile */
@media (max-width: 900px) {
  .desk { grid-template-columns: 1fr; }
  .spine { position: relative; height: auto; box-shadow: inset 0 -18px 24px -18px rgba(0,0,0,.5); }
  .topbar { padding: 16px 16px 0; padding-top: max(16px, env(safe-area-inset-top)); }
  .spine-body { padding: 28px 16px 24px; gap: 22px; }
  .hello { font-size: 1.85rem; }
  .hello-sub { margin-top: -12px; }
  .cal { padding: 10px; }
  .cal-day { font-size: .8rem; }
  .filters { margin-top: -10px; }
  .tally { margin-top: 4px; }
  .paper { padding: 44px 16px 72px; min-height: auto; }
  .ribbon { right: 24px; height: 92px; width: 14px; }
  .today-card { padding-bottom: 32px; margin-bottom: 32px; }
  .entry { grid-template-columns: 3.2rem 1fr; gap: 10px; }
  .entry-num { font-size: 2.5rem; }
  .memory { grid-template-columns: 3.2rem 1fr; gap: 10px; }
  .reader-wrap > .topbar { padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
  .sheet { padding: 48px 20px 40px; border-radius: 0; }
  .is-writing .sheet::before { left: 10px; }
  .mood { width: 50px; }
  .sheet-head { padding-right: 28px; }
  .person-tools { margin-left: 0; }
}
@media (max-width: 400px) {
  .topnav { gap: 12px; }
  .brand-name { display: none; }
  .mood { width: 46px; }
  .mood span { font-size: .62rem; }
}

/* bouton flottant mobile */
.fab { display: none; }
@media (max-width: 900px) {
  .fab {
    display: inline-flex; align-items: center; gap: .5em; position: fixed; z-index: 20;
    right: 16px; bottom: max(18px, env(safe-area-inset-bottom));
    padding: .9em 1.3em; border-radius: 999px; text-decoration: none; font-weight: 600;
    background: var(--leather); color: var(--on-leather);
    box-shadow: 0 14px 30px -10px rgba(10,25,22,.6), inset 0 0 0 1px rgba(255,255,255,.06);
  }
  .fab svg { color: var(--brass-hi); }
}
@media (max-width: 900px) and (prefers-color-scheme: dark) { .fab { background: var(--brass); color: #1a1408; } .fab svg { color: inherit; } }
@media (max-width: 900px) {
  .cal-day { aspect-ratio: auto; height: 38px; width: 38px; justify-self: center; }
  .cal-day.has::after { bottom: 3px; }
  .tally { padding-top: 14px; }
}
