/* Pas à Pas · styles */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

:root {
  --bg: #F5F4FB; --surface: #FFFFFF; --surface-2: #EFEDF8; --surface-3: #E3E0F1;
  --ink: #1A1830; --ink-2: #3B3856; --muted: #6E6A86; --line: #E4E1EF;
  --primary: #5B4BFF; --primary-2: #8B5CF6; --primary-soft: #ECEAFF; --on-primary: #fff;
  --ok: #16A34A; --ok-soft: #E3F6EA; --warn: #B45309; --warn-soft: #FFF4D6; --danger: #DC2626; --danger-soft: #FDE8E8;
  --toast-bg: #1A1830; --toast-ink: #fff; --toast-act: #B9B0FF;
  --shadow-sm: 0 1px 2px rgba(26, 24, 48, .05);
  --shadow: 0 1px 2px rgba(26, 24, 48, .04), 0 6px 20px rgba(26, 24, 48, .07);
  --shadow-lg: 0 14px 44px rgba(26, 24, 48, .2);
  --r: 20px; --r-sm: 14px;
  --font: 'Lexend', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 68px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0E17; --surface: #1A1926; --surface-2: #242334; --surface-3: #312F46;
    --ink: #F3F2FA; --ink-2: #D2CFE6; --muted: #A3A0B8; --line: #2D2B3F;
    --primary: #7C6CFF; --primary-2: #A78BFA; --primary-soft: #262245;
    --ok: #4ADE80; --ok-soft: #15301F; --warn: #FBBF24; --warn-soft: #36290D; --danger: #F87171; --danger-soft: #3A1A1D;
    --toast-bg: #F3F2FA; --toast-ink: #1A1830; --toast-act: #5B4BFF;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --shadow-lg: 0 14px 44px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0E17; --surface: #1A1926; --surface-2: #242334; --surface-3: #312F46;
  --ink: #F3F2FA; --ink-2: #D2CFE6; --muted: #A3A0B8; --line: #2D2B3F;
  --primary: #7C6CFF; --primary-2: #A78BFA; --primary-soft: #262245;
  --ok: #4ADE80; --ok-soft: #15301F; --warn: #FBBF24; --warn-soft: #36290D; --danger: #F87171; --danger-soft: #3A1A1D;
  --toast-bg: #F3F2FA; --toast-ink: #1A1830; --toast-act: #5B4BFF;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --shadow-lg: 0 14px 44px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.spacer { width: 44px; height: 44px; flex: none; }

#app { max-width: 560px; margin: 0 auto; padding: calc(20px + var(--sat)) 16px calc(var(--nav-h) + 40px + var(--sab)); }

/* ---------- en-têtes ---------- */
.page-head { margin: 4px 2px 18px; }
.page-head .date { color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head > p.muted { margin-top: 6px; font-size: 15px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pill.fire { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.sec-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 4px 10px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 16px; text-align: center; transition: transform .12s ease, background-color .2s, box-shadow .2s; user-select: none; -webkit-user-select: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--primary); background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 32%, transparent); }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.ghost { color: var(--primary); }
.btn.danger-ghost { color: var(--danger); }
.btn.big { min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn.sm { min-height: 38px; padding: 8px 13px; font-size: 14px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn small { font-weight: 500; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; color: var(--ink-2); background: var(--surface-2); flex: none; font-size: 20px; font-weight: 600; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 11px; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.link { color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }

/* ---------- cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h2 { font-size: 19px; }
.empty { text-align: center; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .btn { margin-top: 4px; }
.empty-emoji { font-size: 56px; line-height: 1; }

.progress-card { display: flex; align-items: center; gap: 16px; }
.progress-card h2 { font-size: 19px; margin-bottom: 2px; }
.ring-sm-wrap { position: relative; width: 64px; height: 64px; flex: none; }
.ring-sm { width: 64px; height: 64px; transform: rotate(-90deg); }
.rs-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.rs-fg { fill: none; stroke: var(--ok); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.rs-txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; }

/* ---------- carte principale (à faire maintenant) ---------- */
.hero { position: relative; border-radius: 24px; padding: 20px 20px 20px 24px; background: var(--surface); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 17%, var(--surface)) 0%, var(--surface) 72%); border: 1.5px solid color-mix(in srgb, var(--c) 35%, var(--line)); box-shadow: var(--shadow); overflow: hidden; transition: opacity .22s, transform .22s; }
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--c); }
.hero-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.subj-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--ink); color: color-mix(in srgb, var(--c) 72%, var(--ink)); font-weight: 600; font-size: 14px; max-width: 100%; }
.subj-chip.sm { font-size: 13px; padding: 4px 10px; }
.tag { font-size: 13px; color: var(--muted); font-weight: 500; }
.hero-title { font-size: 22px; font-weight: 700; margin: 14px 0 8px; overflow-wrap: anywhere; }
.notes { color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; font-weight: 500; }
.late { color: var(--danger) !important; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; }
.hero-actions .btn.primary { flex: 1; }
.btn.check { width: 58px; min-height: 58px; padding: 0; border-radius: 18px; background: var(--ok-soft); color: var(--ok); font-size: 24px; font-weight: 700; }

/* ---------- lignes ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { position: relative; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px 10px 14px; box-shadow: var(--shadow-sm); overflow: hidden; transition: opacity .22s, transform .22s; }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.tick { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--muted); border-color: color-mix(in srgb, var(--c, var(--primary)) 70%, var(--line)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; transition: all .2s; }
.tick.on { background: var(--ok); border-color: var(--ok); }
.tick.sm { width: 24px; height: 24px; border-width: 2px; font-size: 12px; }
.row-main { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.row-title { font-weight: 600; font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.row-meta { font-size: 13px; color: var(--muted); }
.row-go { color: var(--muted); flex: none; display: grid; place-items: center; }
.row-go svg { width: 18px; height: 18px; }
.row.done { opacity: .62; box-shadow: none; }
.row.done .row-title { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.leaving { opacity: 0 !important; transform: translateX(28px) scale(.98) !important; }

/* ---------- bandeaux ---------- */
.banner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 12px; padding: 14px; border-radius: 18px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); margin-bottom: 14px; }
.banner-emoji { font-size: 28px; }
.banner-txt { display: flex; flex-direction: column; font-size: 14px; gap: 2px; min-width: 0; }
.banner-txt span { color: var(--muted); }
.banner-acts { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.banner-acts .btn { flex: 1; }
.late-card { background: var(--warn-soft); border-color: transparent; box-shadow: none; display: flex; flex-direction: column; gap: 12px; }
.late-card .kicker { color: var(--warn); }
.tight { background: var(--warn-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.day-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.day-actions .btn { flex: 1; min-width: 150px; }
.bag h3, .tomorrow h3 { font-size: 16px; margin-bottom: 8px; }
.bag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bag-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; overflow-wrap: anywhere; }
.bag-list li.ok { color: var(--muted); }
.soft-card { background: var(--surface-2); box-shadow: none; border-color: transparent; }

/* ---------- semaine ---------- */
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px 6px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.day.is-today { border: 1.5px solid var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.day.is-rest { background: transparent; box-shadow: none; border-style: dashed; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day-head h3 { font-size: 18px; display: inline; }
.day-head small { color: var(--muted); font-size: 13px; margin-left: 8px; }
.day-load { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.day-load.over { color: var(--warn); }
.bar { height: 6px; background: var(--surface-2); border-radius: 9px; margin: 10px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 9px; }
.bar.over i { background: var(--warn); }
.mini { list-style: none; margin: 6px 0 0; padding: 0; }
.mini button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 7px 0; font-size: 15px; }
.mini .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.mini .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini small { color: var(--muted); flex: none; font-size: 13px; }
.mini li.ok .t { text-decoration: line-through; color: var(--muted); }
.due-line { margin-top: 8px; font-size: 14px; padding: 8px 12px; border-radius: 12px; background: var(--warn-soft); overflow-wrap: anywhere; }
.due-line.ok { background: var(--ok-soft); }
.day-empty { color: var(--muted); font-size: 14px; padding: 6px 0 4px; }
.later-note { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* ---------- liste des devoirs ---------- */
.task { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; margin-bottom: 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.task-main { width: 100%; text-align: left; padding: 14px 16px 8px 18px; display: flex; flex-direction: column; gap: 6px; }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.due { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.task h3 { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.task .notes { margin: 0; }
.progress { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--c); border-radius: 9px; }
.task-sub { font-size: 13px; color: var(--muted); }
.task-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 0 12px 12px; }
.task.is-done { opacity: .7; }
.task.is-done h3 { text-decoration: line-through; }
.collapse { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); font-weight: 600; margin-top: 18px; }

/* ---------- réglages ---------- */
.set h2 { margin-bottom: 8px; }
.set > p.muted { margin-bottom: 12px; font-size: 14px; }
.set .btn + .btn, .set .stack + small, .set .btn + small { margin-top: 8px; }
.set small.muted { display: block; font-size: 13px; margin-top: 8px; }
.days { display: flex; flex-direction: column; margin: 4px 0 16px; }
.day-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.day-row:last-child { border-bottom: 0; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 72px; text-align: center; font-weight: 600; }
.subj-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.subj-row .input { padding: 10px 12px; }
.emoji-btn { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; background: var(--surface-2); background: color-mix(in srgb, var(--c) 18%, var(--surface)); flex: none; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4.5px var(--line); margin: 0 4px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; font-weight: 600; }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .2s; cursor: pointer; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.row-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.row-inline .input { flex: 1; min-width: 120px; }
.foot { text-align: center; font-size: 13px; margin: 24px 0 8px; line-height: 1.6; }

/* ---------- formulaires ---------- */
.input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.big { font-size: 18px; padding: 16px; }
.input::placeholder { color: var(--muted); opacity: .8; }
textarea.input { resize: none; line-height: 1.4; }
input[type=date].input, input[type=time].input { min-height: 50px; }
.field { display: block; margin-bottom: 18px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 2px 8px; text-transform: uppercase; letter-spacing: .05em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 13px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; border: 1.5px solid transparent; color: var(--ink-2); }
.chip.on { background: var(--primary-soft); background: color-mix(in srgb, var(--c, var(--primary)) 16%, var(--surface)); border-color: var(--c, var(--primary)); color: var(--ink); }
.inline-add { display: flex; gap: 8px; margin-top: 10px; }
.inline-add .btn { flex: none; min-width: 48px; padding: 0 14px; }
.inline-add .btn svg { width: 20px; height: 20px; }
.step-edit { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 6px 12px; border-left: 3px solid var(--line); margin-bottom: 6px; overflow-wrap: anywhere; }
.photo-pick { margin-top: 12px; }
.photo-btn { width: 100%; }
.thumb { position: relative; display: inline-block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); min-width: 80px; min-height: 60px; }
.thumb img { display: block; max-width: 100%; max-height: 200px; object-fit: cover; }
.thumb .icon-btn { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .55); color: #fff; }
.thumb.missing { display: none; }

/* ---------- navigation ---------- */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding-bottom: var(--sab); background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); }
.nav-in { max-width: 560px; margin: 0 auto; height: var(--nav-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 0; }
.nav-item svg { width: 24px; height: 24px; }
.nav-item.on { color: var(--primary); }
.fab { justify-self: center; width: 60px; height: 60px; border-radius: 20px; margin-top: -26px; background: var(--primary); background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 45%, transparent), 0 0 0 5px var(--bg); transition: transform .12s; }
.fab:active { transform: scale(.94); }
.fab svg { width: 28px; height: 28px; }

/* ---------- écrans plein écran (assistant, focus, accueil) ---------- */
.screen { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; justify-content: center; }
.screen-inner { width: 100%; max-width: 560px; height: 100%; display: flex; flex-direction: column; padding-top: var(--sat); }
.ov-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex: none; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ov-foot { padding: 12px 16px calc(16px + var(--sab)); display: flex; flex-direction: column; gap: 8px; flex: none; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--surface-3); transition: all .25s; }
.dots i.on { background: var(--primary); width: 22px; }
.wiz-body { padding: 8px 20px 32px; }
.wiz-body h2 { font-size: 26px; font-weight: 700; margin: 6px 0 8px; }
.wiz-body > .muted { font-size: 15px; }
.wiz-body > .btn.wide { margin-top: 18px; }
.wiz-body textarea.input { margin-top: 16px; }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.enter { animation: slideIn .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

.subj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
@media (min-width: 430px) { .subj-grid { grid-template-columns: repeat(3, 1fr); } }
.subj-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 600; text-align: left; min-height: 96px; transition: transform .12s, border-color .2s; overflow-wrap: anywhere; }
.subj-tile .e { font-size: 26px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.subj-tile:active { transform: scale(.96); }
.subj-tile.on { border-color: var(--c); }
.subj-tile.add { border-style: dashed; box-shadow: none; background: transparent; }
.subj-tile.add .e { background: var(--surface-2); }

.list-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 600; font-size: 17px; text-align: left; box-shadow: var(--shadow-sm); transition: transform .12s; }
.opt:active { transform: scale(.98); }
.opt-emoji { font-size: 24px; width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.opt.on { border-color: var(--primary); background: var(--primary-soft); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px 10px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); min-height: 112px; transition: transform .12s; }
.tile:active { transform: scale(.96); }
.tile .e { font-size: 30px; line-height: 1.1; }
.tile b { font-size: 17px; }
.tile small { color: var(--muted); font-size: 14px; }
.tile.on { border-color: var(--primary); background: var(--primary-soft); }

.due-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.due-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.due-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 2px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); font-size: 14px; transition: transform .12s; }
.due-btn:active { transform: scale(.95); }
.due-btn b { font-weight: 600; }
.due-btn small { color: var(--muted); font-size: 12px; }
.due-btn.big { padding: 18px 8px; border-radius: 18px; font-size: 18px; box-shadow: var(--shadow-sm); }
.due-btn.big small { font-size: 13px; }
.due-btn.we { background: transparent; }
.due-btn.on { border-color: var(--primary); background: var(--primary-soft); }
.other-date { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; margin-top: 14px; padding: 12px; border-radius: 16px; background: var(--surface-2); font-weight: 600; }
.other-date span { grid-column: 1 / -1; padding-left: 4px; }
.other-date .input { min-width: 0; }
.other-date .btn { min-height: 50px; padding: 0 18px; }

.success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 12px; }
.success-badge { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; font-size: 42px; background: var(--ok-soft); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.mini-task { width: 100%; text-align: left; }
.success .stack { width: 100%; margin-top: 10px; }

.onb .wiz-body { display: flex; flex-direction: column; gap: 12px; }
.onb .wiz-body .input { margin-top: 8px; }
.logo-big { width: 96px; height: 96px; margin: 18px auto 6px; filter: drop-shadow(0 12px 24px color-mix(in srgb, var(--primary) 40%, transparent)); }
.logo-big svg { width: 100%; height: 100%; }
.onb-hero { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.onb-hero h1 { font-size: 34px; }
.lead { font-size: 17px; color: var(--ink-2); line-height: 1.5; }
.onb-points { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; }
.onb-points li { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-weight: 500; }
.onb-points li span:first-child { font-size: 20px; flex: none; }

/* ---------- mode focus ---------- */
.focus { background: var(--bg); background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 22%, var(--bg)) 0%, var(--bg) 70%); }
.focus-body { padding: 4px 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.focus-title { font-size: 24px; text-align: center; font-weight: 700; max-width: 30ch; overflow-wrap: anywhere; }
.ring-wrap { position: relative; width: min(66vw, 250px); aspect-ratio: 1; margin: 6px 0; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke: color-mix(in srgb, var(--c) 14%, var(--surface-2)); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--c); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-txt span { font-size: 54px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.ring-txt small { color: var(--muted); font-weight: 500; }
.over-msg { font-weight: 600; font-size: 18px; }
.focus .row-btns { width: 100%; justify-content: center; }
.focus .row-btns .btn { flex: 0 1 160px; }
.steps { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.steps-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.steps-head small { color: var(--muted); font-weight: 600; }
.step { display: flex; gap: 12px; align-items: center; text-align: left; padding: 8px 2px; font-weight: 500; overflow-wrap: anywhere; }
.step.done > span:last-child { text-decoration: line-through; color: var(--muted); }
.step.done .tick { background: var(--ok); border-color: var(--ok); }
.tipbox { background: var(--warn-soft); border-radius: 16px; padding: 14px 16px; font-weight: 500; width: 100%; margin-top: 10px; }
.stuck { width: 100%; background: var(--surface); border: 1.5px solid var(--warn); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; animation: slideIn .3s; }
.stuck-tip { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; font-weight: 500; }
.stuck-tip span:first-child { font-size: 30px; line-height: 1; }
.win-emoji { font-size: 86px; line-height: 1; margin-top: 24px; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.win h2 { font-size: 30px; }
.star-gain { font-size: 22px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 8px 18px; border-radius: 999px; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- feuilles du bas ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 8, 25, .45); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; padding-bottom: var(--sab); }
.sheet-grab { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 10px auto 2px; flex: none; }
.sheet-x { position: absolute; top: 12px; right: 12px; z-index: 1; }
.sheet-scroll { padding: 8px 20px 24px; }
.sheet h2 { font-size: 22px; margin: 6px 52px 18px 0; }
.sheet-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sheet-wrap.enter .sheet { animation: sheetUp .34s cubic-bezier(.2, .8, .2, 1); }
.sheet-wrap.enter .sheet-backdrop { animation: fade .25s; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }
.how { padding-left: 20px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 12px; }
.how li { padding-left: 4px; }
.how li::marker { color: var(--primary); font-weight: 700; }
.kbd { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; font-size: 15px; vertical-align: -3px; }
.sheet .tipbox { margin-top: 10px; }
.install-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; margin: 0; }

.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: calc(60px + var(--sat)) 12px calc(16px + var(--sab)); }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.viewer-x { position: absolute; top: calc(12px + var(--sat)); right: 12px; background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------- toast & confettis ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + var(--sab)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; background: var(--toast-bg); color: var(--toast-ink); padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 500; width: max-content; max-width: calc(100% - 32px); transition: opacity .25s, transform .25s cubic-bezier(.2, .8, .2, 1); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--toast-act); font-weight: 700; padding: 4px 2px; flex: none; }
body.locked #toast { bottom: calc(120px + var(--sab)); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; display: none; }

/* ---------- animations d'entrée ---------- */
.view.anim > * { animation: rise .42s cubic-bezier(.2, .8, .2, 1) both; }
.view.anim > *:nth-child(2) { animation-delay: .03s; }
.view.anim > *:nth-child(3) { animation-delay: .06s; }
.view.anim > *:nth-child(4) { animation-delay: .09s; }
.view.anim > *:nth-child(5) { animation-delay: .12s; }
.view.anim > *:nth-child(6) { animation-delay: .15s; }
.view.anim > *:nth-child(n+7) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 700px) {
  #app { padding-top: calc(36px + var(--sat)); }
}
