/* Plume — une colonne façon téléphone : orbe-micro au cœur de « Aujourd'hui », cartes calmes, 4 onglets en bas. */
:root {
  --bg: #EDF0F2;
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --ink: #1A2230;
  --muted: #5E6878;
  --line: #DCE1E7;
  --accent: #E58A3C;
  --accent-ink: #9A4F12;
  --accent-soft: #FBE7D6;
  --sage: #4F8579;
  --sage-soft: #DCEBE6;
  --danger: #B3423A;
  --c-agenda: #3E6FB0; --c-tache: #4F8579; --c-papier: #A4643A; --c-note: #6B5FA8; --c-humeur: #C2577A;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171E; --surface: #1B222C; --surface-2: #161C25; --ink: #E9EDF2; --muted: #9AA4B2; --line: #2B3440;
    --accent: #F09A4E; --accent-ink: #F6B57C; --accent-soft: #3A2A1E; --sage: #7DB5A8; --sage-soft: #1E302C; --danger: #E57A72;
    --c-agenda: #7FA6DE; --c-tache: #7DB5A8; --c-papier: #D99A6C; --c-note: #A89CE0; --c-humeur: #E68AAA;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.splash { height: 100%; display: grid; place-items: center; }
.splash img { border-radius: 20px; animation: breathe 2s ease-in-out infinite; }

.app { max-width: 480px; margin: 0 auto; min-height: 100%; padding-inline: 16px; padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(110px + env(safe-area-inset-bottom, 0px)); }

/* En-tête */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { font-family: var(--display); font-weight: 700; font-size: 1.65rem; line-height: 1.15; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.date { color: var(--muted); font-size: .9rem; margin: 2px 0 0; }
.avatars { display: flex; border: 0; background: none; padding: 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 .85rem var(--body); color: #fff; background: var(--av, var(--sage)); border: 2px solid var(--bg); }
.avatars .avatar + .avatar { margin-left: -10px; }
.avatar.sm { width: 22px; height: 22px; font-size: .68rem; border-width: 0; }

/* Orbe */
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-block: 18px 6px; }
.orb-wrap { position: relative; width: 148px; height: 148px; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; transform: scale(.8); pointer-events: none; }
.listening .ring, .thinking .ring { animation: ripple 1.8s ease-out infinite; }
.listening .ring:nth-child(2), .thinking .ring:nth-child(2) { animation-delay: .6s; }
.listening .ring:nth-child(3), .thinking .ring:nth-child(3) { animation-delay: 1.2s; }
.thinking .ring { border-color: var(--sage); }
@keyframes ripple { 0% { opacity: .55; transform: scale(.75); } 100% { opacity: 0; transform: scale(1.35); } }
.orb { width: 110px; height: 110px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #FFD9B0 0%, var(--accent) 48%, #B85E1E 100%);
  box-shadow: 0 14px 40px -10px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 -6px 18px rgba(0,0,0,.18);
  animation: breathe 4.5s ease-in-out infinite; transition: transform .2s; }
.orb:active { transform: scale(.95); }
.thinking .orb { background: radial-gradient(circle at 35% 30%, #CDEBE3 0%, var(--sage) 50%, #2E5E54 100%); }
.listening .orb { animation: none; transform: scale(1.06); }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.orb svg { width: 36px; height: 36px; fill: #fff; }
.wave { display: flex; gap: 4px; height: 26px; align-items: center; }
.wave i { width: 4px; height: 5px; border-radius: 4px; background: var(--accent); opacity: .5; }
.listening .wave i { animation: bar .9s ease-in-out infinite; opacity: 1; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .2s; }
@keyframes bar { 0%, 100% { height: 5px; } 50% { height: 24px; } }
.status { min-height: 3em; text-align: center; max-width: 36ch; font-size: 1.02rem; text-wrap: balance; }
.status .heard { color: var(--muted); font-style: italic; display: block; font-size: .88rem; margin-bottom: 2px; }

/* Saisie */
.composer { display: flex; gap: 8px; margin-top: 4px; }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 12px 16px; }
.btn { border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; padding: 12px 18px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: .84rem; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.dashed { border-style: dashed; }

/* Sections et cartes */
.sect { margin-top: 20px; }
.sect-title { font-family: var(--display); font-weight: 500; font-size: 1.08rem; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sect-title small { font-family: var(--body); font-size: .8rem; color: var(--muted); font-weight: 400; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; animation: in .3s ease both; }
@keyframes in { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--c); }
.item .t { font-weight: 600; overflow-wrap: anywhere; }
.item.done .t { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: .8rem; color: var(--muted); }
.tag { color: var(--c); font-weight: 600; }
.who { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px 1px 2px; background: var(--surface-2); font-size: .78rem; color: var(--ink); }
.who.none { padding-left: 8px; color: var(--muted); border-style: dashed; }
.bring { font-size: .84rem; margin-top: 5px; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: transparent; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.check.on { background: var(--c-tache); border-color: var(--c-tache); }
.check.on::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.del { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.empty { color: var(--muted); text-align: center; padding: 22px 14px; border: 1px dashed var(--line); border-radius: var(--r); font-size: .92rem; }
.daylabel { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
details.donebox summary { color: var(--muted); font-size: .88rem; cursor: pointer; margin: 14px 0 8px; }

.banner { border-radius: var(--r); padding: 14px 16px; display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.banner.sage { background: var(--sage-soft); }
.banner.accent { background: var(--accent-soft); }
.banner b { display: block; font-family: var(--display); font-weight: 500; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; }
.banner.sage b { color: var(--sage); } .banner.accent b { color: var(--accent-ink); }
.banner p { margin: 2px 0 0; font-size: .92rem; }
.banner button { margin-left: auto; flex: none; }
.linkbtn { border: 0; background: none; font-weight: 600; font-size: .85rem; padding: 4px; color: inherit; text-decoration: underline; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.code { font: 700 1.5rem var(--display); letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mood { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 96px; }
.mood div { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: .7rem; color: var(--muted); }
.mood span { width: 100%; max-width: 22px; border-radius: 6px; background: var(--c-humeur); }
.switch { width: 46px; height: 28px; border-radius: 999px; border: 0; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--sage); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Accès : connexion et famille */
.gate { max-width: 400px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding-inline: 20px; padding-block: calc(32px + env(safe-area-inset-top, 0px)) 32px; gap: 18px; }
.gate .logo { width: 64px; height: 64px; border-radius: 18px; }
.gate h1 { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1.1; margin: 0; text-wrap: balance; }
.gate p.lead { color: var(--muted); margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; }
.field input { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.msg { font-size: .9rem; border-radius: 12px; padding: 10px 12px; }
.msg.err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.msg.ok { background: var(--sage-soft); color: var(--sage); }
.or { text-align: center; color: var(--muted); font-size: .85rem; }

/* Bouton micro flottant (hors « Aujourd'hui ») et feuille d'écoute */
.fab { position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #FFD9B0 0%, var(--accent) 50%, #B85E1E 100%); box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--accent) 80%, transparent); display: grid; place-items: center; z-index: 5; }
.fab svg { width: 24px; height: 24px; fill: #fff; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); width: min(448px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.25); z-index: 6; }

/* Onglets */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
nav.tabs .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
nav.tabs button { position: relative; border: 0; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 5px; border-radius: 12px; }
nav.tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs button[aria-selected="true"] { color: var(--ink); }
nav.tabs button[aria-selected="true"] svg { stroke: var(--accent); }
nav.tabs .badge { position: absolute; top: 5px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

#toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem; z-index: 10; max-width: calc(100% - 32px); text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
