:root {
    --bg:#EEEEF7; --surface:#FFFFFF; --border:#DDDDF0;
    --text-1:#0A0A1E; --text-2:#6060A0; --text-3:#9090C0;
    --accent:#7C3AED; --accent-soft:rgba(124,58,237,.10);
    --err:#EF4444; --ok:#10B981; --warn:#F59E0B;
}
@media (prefers-color-scheme:dark) {
    :root {
        --bg:#07070F; --surface:#111122; --border:#1C1C38;
        --text-1:#DCDCF4; --text-2:#7A7AA8; --text-3:#48487A;
        --accent:#A78BFA; --accent-soft:rgba(167,139,250,.12);
    }
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
body { font-family:system-ui,-apple-system,'Segoe UI',sans-serif; background:var(--bg); color:var(--text-1); min-height:100vh; }
input, select, textarea, button { font:inherit; color:inherit; }
input, select, textarea {
    width:100%; padding:10px 12px; background:var(--bg); border:1.5px solid var(--border);
    border-radius:10px; outline:none; transition:border-color .15s;
}
input[type=checkbox] { width:auto; accent-color:var(--accent); }
input:focus, select:focus, textarea:focus { border-color:var(--accent); }
textarea { resize:vertical; line-height:1.5; }
a { color:var(--accent); }
[hidden] { display:none !important; }
.muted { color:var(--text-2); }
.small { font-size:.8125rem; }
.warn { color:var(--warn); }

.btn { border:none; border-radius:10px; padding:9px 16px; cursor:pointer; font-weight:600; font-size:.875rem; transition:opacity .15s; background:var(--accent-soft); color:var(--accent); text-decoration:none; display:inline-block; white-space:nowrap; }
.btn:hover { opacity:.85; }
.btn:disabled { opacity:.6; cursor:default; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-ghost { background:transparent; color:var(--text-2); }
.btn-sm { padding:6px 11px; font-size:.8125rem; }
.icon-btn { border:none; background:none; cursor:pointer; color:var(--text-3); font-size:.95rem; padding:4px 6px; border-radius:6px; }
.icon-btn:hover { color:var(--accent); background:var(--accent-soft); }

.card { background:var(--surface); border:1px solid var(--border); border-radius:16px; }
.logo { font-size:1.375rem; font-weight:800; letter-spacing:-.02em; display:flex; align-items:center; gap:10px; }
.logo span { color:var(--accent); }
.logo-img { width:32px; height:32px; }
.subtitle { font-size:.875rem; color:var(--text-2); margin-top:4px; }

.login-body { display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { width:100%; max-width:360px; padding:32px; display:flex; flex-direction:column; gap:14px; }
.alert { padding:10px 14px; border-radius:8px; font-size:.875rem; background:rgba(239,68,68,.1); color:var(--err); }
.back { text-align:center; font-size:.8125rem; color:var(--text-3); text-decoration:none; }

.wrap { max-width:980px; margin:0 auto; padding:24px 16px 60px; display:flex; flex-direction:column; gap:16px; }
header { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
header nav { display:flex; gap:8px; }
.tabs { display:flex; gap:6px; flex-wrap:wrap; }
.chip { border:1px solid var(--border); background:var(--surface); border-radius:999px; padding:6px 13px; font-size:.8125rem; cursor:pointer; }
.chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.chip b { background:var(--err); color:#fff; border-radius:999px; padding:0 6px; font-size:.6875rem; margin-left:3px; }
.chip b:empty { display:none; }
.chip-sm { padding:3px 10px; font-size:.75rem; }
.filters { display:flex; gap:6px; flex-wrap:wrap; }
#examples .chip { color:var(--text-2); }
.pane { display:flex; flex-direction:column; gap:16px; }
.panel { padding:18px 20px; display:flex; flex-direction:column; gap:12px; }
h2 { font-size:1rem; }
h3 { font-size:.875rem; }
.label { font-size:.8125rem; font-weight:600; color:var(--text-2); }
.hint { font-size:.75rem; color:var(--text-3); font-weight:400; }
.label-row { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.field { display:flex; flex-direction:column; gap:6px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:640px) { .grid-2 { grid-template-columns:1fr; } }
.actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.actions.start { justify-content:flex-start; }
.actions .left { margin-right:auto; }
.empty { color:var(--text-2); font-size:.875rem; padding:8px 0; }
.stack { display:flex; flex-direction:column; gap:14px; }
#settings { display:flex; flex-direction:column; gap:14px; }

.brief { background:linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.brief-lines { list-style:none; display:flex; flex-direction:column; gap:6px; font-size:.9375rem; }
.brief-lines li::before { content:'› '; color:var(--accent); font-weight:700; }

.prompts { display:flex; flex-direction:column; gap:10px; }
.prompt { display:flex; gap:12px; padding:14px; border-radius:12px; background:var(--bg); border-left:4px solid var(--accent); transition:opacity .2s, transform .2s; }
.prompt.leaving { opacity:.3; transform:translateX(8px); }
.cat-anniv { border-left-color:#EC4899; } .cat-vacances { border-left-color:#0EA5E9; }
.cat-admin { border-left-color:#F59E0B; } .cat-quotidien { border-left-color:#10B981; } .cat-info { border-left-color:var(--text-3); }
.prompt-icon { font-size:1.5rem; line-height:1; }
.prompt-body { flex:1; display:flex; flex-direction:column; gap:8px; min-width:0; }
.prompt-body .actions { justify-content:flex-start; }
.prompt-meta { font-size:.75rem; color:var(--text-3); }
.prompt-text { font-size:.9375rem; line-height:1.45; }
.ideas { font-size:.875rem; background:var(--surface); border-radius:10px; padding:10px 12px; }
.row .ideas { background:none; padding:0; }
.ideas ul { margin:6px 0 0 18px; }
.answer { display:flex; gap:8px; }
.answer input, .answer select { background:var(--surface); }

.custody { display:flex; flex-direction:column; gap:6px; }
.places { display:flex; gap:6px; flex-wrap:wrap; }
.custody > .btn { align-self:flex-start; }

.say { display:flex; gap:8px; }
.say .mic { flex:0 0 auto; }
.say .mic.listening { background:#ef4444; color:#fff; animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow:0 0 0 6px rgba(239,68,68,.25); } }
.proposal { margin-top:4px; padding:12px 14px; border-radius:12px; background:var(--accent-soft); display:flex; flex-direction:column; gap:10px; }
.proposal .actions { justify-content:flex-start; }
.ok-box { background:rgba(16,185,129,.12); }
details summary { cursor:pointer; list-style:none; }
details summary h2 { display:inline; }
details[open] summary { margin-bottom:4px; }

.inline-form { display:flex; gap:8px; flex-wrap:wrap; }
.inline-form > * { flex:1 1 130px; width:auto; }
.inline-form > [name=title], .inline-form > [name=label], .inline-form > [name=interests], .inline-form > [data-k=interests], #pr-title { flex:3 1 220px; }
.inline-form > .btn, .inline-form > .icon-btn { flex:0 0 auto; }
.rows { display:flex; flex-direction:column; gap:6px; }
.row { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px; background:var(--bg); font-size:.875rem; flex-wrap:wrap; }
.row .grow { flex:1; min-width:200px; }
.row .time { width:40px; font-weight:600; color:var(--text-2); font-size:.8125rem; }
.row .links { color:var(--text-3); }
.day-group { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.day-group h3 { text-transform:capitalize; color:var(--text-2); }
.tag { font-size:.6875rem; padding:2px 8px; border-radius:999px; background:var(--accent-soft); color:var(--accent); white-space:nowrap; }
.tag-birthday, .tag-fete { background:rgba(236,72,153,.12); color:#EC4899; }
.tag-deadline, .tag-warn { background:rgba(245,158,11,.14); color:#D97706; }
.tag-holiday, .tag-garde { background:rgba(14,165,233,.12); color:#0284C7; }
.tag-ok { background:rgba(16,185,129,.12); color:#059669; }
.tag-err { background:rgba(239,68,68,.12); color:var(--err); }
.tag-ics { background:var(--bg); color:var(--text-2); border:1px solid var(--border); }
.holiday { padding:14px; border-radius:12px; background:var(--bg); display:flex; flex-direction:column; gap:10px; }

.week { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
@media (max-width:760px) { .week { grid-template-columns:repeat(2,1fr); } }
.wd { border-radius:10px; background:var(--surface); padding:8px; font-size:.75rem; display:flex; flex-direction:column; gap:4px; min-height:80px; }
.wd h3 { font-size:.75rem; text-transform:capitalize; color:var(--accent); }

.steps { display:flex; gap:6px; flex-wrap:wrap; font-size:.75rem; }
.steps span { padding:4px 10px; border-radius:999px; background:var(--bg); color:var(--text-3); }
.steps .on { background:var(--accent); color:#fff; }
.steps .done { color:var(--accent); }
.wiz-body { display:flex; flex-direction:column; gap:12px; }
.lead { font-size:.9375rem; color:var(--text-2); }
.checks { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:6px; }
.check { display:flex; align-items:center; gap:8px; font-size:.875rem; padding:8px 10px; border-radius:10px; background:var(--bg); cursor:pointer; }
.person-row { padding:8px; border-radius:10px; background:var(--bg); }
.person-row input, .person-row select { background:var(--surface); }
.proposal-list { list-style:none; display:flex; flex-direction:column; gap:8px; font-size:.875rem; line-height:1.5; padding:14px; border-radius:12px; background:var(--accent-soft); }

.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--text-1); color:var(--surface); padding:10px 18px; border-radius:10px; font-size:.875rem; opacity:0; transition:opacity .2s; pointer-events:none; z-index:10; }
.toast.show { opacity:1; }
.gbox { padding:14px; border-radius:12px; background:var(--bg); display:flex; flex-direction:column; gap:10px; }
.gbox .check { background:var(--surface); }
.gdot { display:inline-block; width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.steps-list { margin-left:18px; display:flex; flex-direction:column; gap:4px; line-height:1.5; }
code { font-size:.8125rem; background:var(--surface); padding:2px 6px; border-radius:6px; user-select:all; word-break:break-all; }
.brush { border-color:var(--c); }
.brush.active { background:var(--c); border-color:var(--c); color:#fff; }
.dgrid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; touch-action:none; user-select:none; }
.dcell { position:relative; min-height:54px; border:1.5px solid var(--border); border-radius:8px; background:var(--surface); padding:4px 5px; display:flex; flex-direction:column; align-items:flex-start; gap:2px; font-size:.6875rem; cursor:pointer; text-align:left; overflow:hidden; }
.dcell b { font-size:.6875rem; color:var(--text-2); text-transform:capitalize; }
.dcell span { font-size:.6875rem; line-height:1.2; word-break:break-word; }
.dcell i { position:absolute; top:3px; right:4px; font-style:normal; font-size:.6875rem; }
.dcell.busy { border-style:dashed; border-color:var(--warn); }
.dcell.locked { cursor:default; background:var(--bg); color:var(--ok); border-style:solid; border-color:transparent; }
.dcell:not(.locked):hover { border-color:var(--accent); }
@media (max-width:560px) { .dcell { min-height:46px; padding:3px; } .dcell span { font-size:.625rem; } }
.work-wrap { overflow-x:auto; }
.work { border-collapse:collapse; font-size:.8125rem; width:100%; }
.work th { text-align:left; font-weight:600; color:var(--text-2); padding:4px 6px; text-transform:capitalize; white-space:nowrap; }
.work td { padding:3px 6px; }
.wk { display:flex; align-items:center; gap:5px; white-space:nowrap; }
.wk input[type=time] { width:auto; padding:4px 6px; font-size:.8125rem; }
.wk .rm { display:flex; align-items:center; gap:2px; cursor:pointer; }
.workweek { display:flex; flex-direction:column; gap:6px; }
.ww-row { display:grid; grid-template-columns:150px 170px 1fr; gap:8px; align-items:center; font-size:.875rem; }
.ww-row span { text-transform:capitalize; }
.ww-row select, .ww-row input { background:var(--surface); padding:6px 8px; }
@media (max-width:560px) { .ww-row { grid-template-columns:1fr 1fr; } .ww-row span { grid-column:1 / -1; } }
.workweek > .btn { align-self:flex-start; }
.wk-info { gap:6px; }
.wk-info .wk input { width:80px; }
.dcell ul { list-style:none; display:flex; flex-direction:column; gap:2px; width:100%; }
.dcell li { font-size:.625rem; line-height:1.25; border-radius:4px; padding:1px 3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:var(--bg); }
.dcell li em { font-style:normal; font-weight:700; margin-right:3px; opacity:.8; }
.dcell li.set { background:var(--c); color:#fff; }
.dcell li[data-locked] { color:var(--ok); background:transparent; }
.dcell.set { border-color:var(--accent); }
.dcell.locked li { color:var(--ok); background:transparent; }
.kidsel { border-style:dashed; }
.kidsel.active { background:var(--text-1); border-color:var(--text-1); color:var(--surface); border-style:solid; }
.cal-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cal-bar h2 { text-transform:capitalize; }
.cal-nav { display:flex; align-items:center; gap:6px; }
.nav-btn { border:1px solid var(--border); background:var(--surface); border-radius:8px; width:32px; height:32px; cursor:pointer; font-size:1.1rem; line-height:1; }
.nav-btn:hover { border-color:var(--accent); color:var(--accent); }
.ev { font-size:.6875rem; line-height:1.3; padding:1px 5px; border-radius:4px; background:color-mix(in srgb, var(--c) 18%, transparent); border-left:3px solid var(--c); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mgrid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.mhead { font-size:.6875rem; font-weight:600; color:var(--text-3); text-align:center; padding:2px 0; }
.mday { min-height:96px; border-radius:8px; background:var(--bg); padding:4px; display:flex; flex-direction:column; gap:2px; cursor:pointer; border:1.5px solid transparent; min-width:0; }
.mday:hover { border-color:var(--accent); }
.mday.out { opacity:.45; }
.mday.today { border-color:var(--accent); }
.mnum { font-size:.75rem; font-weight:700; color:var(--text-2); }
.mday.today .mnum { color:var(--accent); }
.more { font-size:.6875rem; color:var(--text-3); padding-left:4px; }
@media (max-width:640px) { .mday { min-height:64px; } .mday .ev { font-size:.5625rem; padding:0 3px; } }
.tgrid { display:grid; grid-template-columns:40px repeat(var(--n),minmax(0,1fr)); gap:0 4px; }
.thead { font-size:.75rem; font-weight:600; color:var(--text-2); text-align:center; padding:4px 0; text-transform:capitalize; cursor:pointer; border-radius:6px; }
.thead.today { background:var(--accent); color:#fff; }
.tall-label { font-size:.625rem; color:var(--text-3); padding-top:4px; }
.tall { display:flex; flex-direction:column; gap:2px; padding:3px 0 6px; border-bottom:1px solid var(--border); min-width:0; }
.thours { display:flex; flex-direction:column; }
.thour { font-size:.625rem; color:var(--text-3); border-top:1px solid var(--border); padding-top:1px; }
.tcol { position:relative; background:repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 48px); border-radius:4px; }
.tcol.today { background-color:var(--accent-soft); }
.tev { position:absolute; box-sizing:border-box; padding:2px 4px; border-radius:5px; font-size:.6875rem; line-height:1.25; overflow:hidden; background:color-mix(in srgb, var(--c) 22%, var(--surface)); border-left:3px solid var(--c); border-right:1px solid var(--surface); }
.row.todo input[type=checkbox] { width:18px; height:18px; flex-shrink:0; }
.row.todo.is-done .grow { text-decoration:line-through; color:var(--text-3); }
.row.todo .tag { margin-left:6px; }
.pitem { padding:8px 10px; border-radius:10px; background:var(--surface); display:flex; flex-direction:column; gap:6px; }
.pitem.ok { opacity:.7; }
.pitem.skip { opacity:.45; }
.ai-wait { animation:fade 1.6s ease-in-out infinite; }
@keyframes fade { 50% { opacity:.45; } }
