/* Mon Cerveau — charte : minimalisme chaleureux, élégance naturelle */
:root {
  --bg: #F8F6F2; --surface: #FFFFFF; --surface-2: #F3EEE6; --champagne: #E8DCC8;
  --taupe: #A48B78; --gold: #B89B65; --gold-ink: #8E733F; --sage: #A8B5A0; --sage-ink: #6E7F66;
  --blue: #758D89; --blue-ink: #5C7571; --blue-soft: #E1E9E7; --green: #819174; --blue-btn: #5C7571; --blue-btn-hover: #4D6360; --on-blue: #FFFFFF;
  --ink: #292929; --ink-2: #6A625A; --line: #E8E1D6; --danger: #B4675A;
  --work: #A48B78; --shadow: 0 1px 2px rgba(41,41,41,.04), 0 6px 18px rgba(41,41,41,.04);
  --radius: 14px; --serif: 'Playfair Display', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1D1B; --surface: #282523; --surface-2: #312D2A; --champagne: #4A4236; --taupe: #B8A291;
    --gold: #C9AE7A; --gold-ink: #D9C08E; --sage: #8D9C85; --sage-ink: #AEBDA6; --ink: #F1ECE4; --ink-2: #B5ACA2;
    --blue: #8AA6A1; --blue-ink: #A9C2BD; --blue-soft: #2E3A38; --green: #9DAE90; --blue-btn: #8AA6A1; --blue-btn-hover: #A9C2BD; --on-blue: #1F1D1B;
    --line: #3A3531; --danger: #D08A7D; --shadow: 0 1px 2px rgba(0,0,0,.2); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1F1D1B; --surface: #282523; --surface-2: #312D2A; --champagne: #4A4236; --taupe: #B8A291;
  --gold: #C9AE7A; --gold-ink: #D9C08E; --sage: #8D9C85; --sage-ink: #AEBDA6; --ink: #F1ECE4; --ink-2: #B5ACA2;
    --blue: #8AA6A1; --blue-ink: #A9C2BD; --blue-soft: #2E3A38; --green: #9DAE90; --blue-btn: #8AA6A1; --blue-btn-hover: #A9C2BD; --on-blue: #1F1D1B;
  --line: #3A3531; --danger: #D08A7D; --shadow: 0 1px 2px rgba(0,0,0,.2); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue-ink); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: .1px; }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 22px; } h3 { font-size: 17px; } h4 { font-size: 15.5px; }
p { margin: .4em 0; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.muted { color: var(--ink-2); } .small { font-size: 12.5px; } .grow { flex: 1; min-width: 0; }
.late { color: var(--danger); }
.ic { width: 18px; height: 18px; flex: none; }
svg.lucide { width: 18px; height: 18px; flex: none; }

/* ── Structure ── */
.app { display: grid; grid-template-columns: 272px 1fr; height: 100vh; height: 100dvh; }
.sidebar { background: var(--surface-2); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px 12px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.scrim { display: none; }
.content { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.topbar { display: none; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
.top-brand { font-family: var(--serif); font-size: 19px; }
.main { flex: 1; overflow-y: auto; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 110px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 14px; }
.brand strong { font-family: var(--serif); font-size: 20px; font-weight: 500; display: block; }
.brand small { color: var(--ink-2); font-size: 11.5px; }
.logo { width: 38px; height: 38px; border-radius: 12px; background: var(--blue-soft); color: var(--gold); display: grid; place-items: center; }
.nav { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 14px; }
.nav:hover { background: var(--surface); color: var(--ink); }
.nav.on { background: var(--surface); box-shadow: var(--shadow); }
.nav em { margin-left: auto; font-style: normal; font-size: 11.5px; background: var(--blue-soft); color: var(--blue-ink); padding: 0 7px; border-radius: 99px; }
.nav .ic, .nav svg { color: var(--taupe); }
.nav-title { display: flex; justify-content: space-between; align-items: center; padding: 14px 10px 2px; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-2); }
.space-line { display: flex; align-items: center; }
.space-line .nav { flex: 1; padding-left: 4px; }
.tw { background: none; border: 0; color: var(--ink-2); padding: 4px; cursor: pointer; display: grid; place-items: center; transition: transform .15s; }
.space-nav.open .tw { transform: rotate(90deg); }
.subs { display: none; padding: 2px 0 6px 30px; }
.space-nav.open .subs { display: block; }
.space-nav.over { background: var(--blue-soft); border-radius: 10px; }
.sub { display: block; padding: 4px 8px; font-size: 13px; color: var(--ink-2); border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.sub:hover, .sub.on { background: var(--surface); color: var(--ink); }
.sub.add { color: var(--blue-ink); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sync-mini { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-2); padding: 4px 10px; margin: 0; }
.sync-mini svg { width: 14px; height: 14px; }
.sync-mini.error { color: var(--danger); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--taupe); color: var(--ink); }
.btn.primary { background: var(--blue-btn); border-color: var(--blue-btn); color: var(--on-blue); }
.btn.primary:hover { background: var(--blue-btn-hover); border-color: var(--blue-btn-hover); color: var(--on-blue); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn:last-child { border-radius: 0 10px 10px 0; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--ink-2); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; display: inline-flex; gap: 6px; align-items: center; }
.linkish:hover { color: var(--blue-ink); text-decoration: underline; }
.link-sm { font-size: 12.5px; color: var(--blue-ink); background: none; border: 0; cursor: pointer; font-family: inherit; }
.file-btn { cursor: pointer; }
.fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; display: flex; gap: 8px; align-items: center; background: var(--blue-btn); color: var(--on-blue); border: 0; border-radius: 99px; padding: 14px 20px; font: 600 14px var(--sans); box-shadow: 0 8px 24px rgba(92,117,113,.30); cursor: pointer; }
.fab:hover { background: var(--blue-btn-hover); }

/* ── En-têtes, cartes, statistiques ── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.4px; font-size: 11.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; margin: 0 0 4px; flex-wrap: wrap; }
.eyebrow svg { width: 14px; height: 14px; }
.space-head h1 { display: flex; gap: 10px; align-items: center; }
.space-head { border-left: 3px solid var(--c); padding-left: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.stat span { font-size: 12.5px; color: var(--ink-2); }
.stat strong { display: block; font-family: var(--serif); font-size: 30px; font-weight: 500; }
.stat.warn strong { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.wide { grid-column: 1 / -1; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h3 { display: flex; gap: 8px; align-items: center; }
.card-head h3 svg { color: var(--green); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); margin: 10px 0 6px; }
.empty { text-align: center; padding: 18px 10px; color: var(--ink-2); }
.empty svg { width: 26px; height: 26px; color: var(--champagne); }
.empty p { margin: 6px 0 0; font-size: 13.5px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plain li:last-child { border: 0; }
.plain .when { color: var(--ink-2); font-size: 12.5px; min-width: 92px; }
.plain.info li svg { color: var(--taupe); }
.numbered { list-style: decimal; padding-left: 20px; }
.numbered li { display: list-item; }
.clickable { cursor: pointer; }
.week-hours li.is-today { font-weight: 600; }
.week-hours li span { flex: 1; }
.sugg { list-style: none; padding: 0; margin: 0; }
.sugg li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sugg li:last-child { border: 0; }
.sugg svg { color: var(--green); margin-top: 2px; }
.timeline { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tl { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; cursor: default; }
.tl span { color: var(--ink-2); min-width: 92px; }
.tl b { font-weight: 500; }
.tl.work { background: color-mix(in srgb, var(--work) 16%, transparent); }
.tl.ev, .tl.task { cursor: pointer; }
.tl.task svg { color: var(--sage-ink); }

/* ── Progression, puces ── */
.progress { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; width: 100%; }
.progress span { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width .3s; }
.pbar-lg { display: flex; align-items: center; gap: 10px; max-width: 420px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.pbar-lg .progress { margin: 0; height: 7px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font: 12.5px var(--sans); color: var(--ink); cursor: default; white-space: nowrap; }
button.chip, a.chip { cursor: pointer; }
.chip[style*="--c"] { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.chip.on { background: var(--blue-soft); border-color: var(--blue); }
.chip.free { background: color-mix(in srgb, var(--sage) 18%, transparent); border-color: color-mix(in srgb, var(--sage) 40%, transparent); }
.chip svg { width: 14px; height: 14px; }
.chip button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-2); display: grid; }
.pct { font-size: 12.5px; color: var(--ink-2); min-width: 38px; text-align: right; }

/* ── Tâches ── */
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.dragging { opacity: .4; }
.check { width: 21px; height: 21px; border-radius: 50%; border: 1.6px solid var(--taupe); background: transparent; flex: none; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px; color: #fff; }
.check:hover { border-color: var(--sage-ink); background: color-mix(in srgb, var(--sage) 20%, transparent); }
.task-row.done .check { background: var(--sage); border-color: var(--sage); }
.check svg { width: 13px; height: 13px; }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-size: 14.5px; display: flex; gap: 7px; align-items: center; }
.task-row.done .task-title { text-decoration: line-through; color: var(--ink-2); }
.task-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 3px; align-items: center; }
.task-meta span { display: inline-flex; gap: 4px; align-items: center; }
.task-meta svg { width: 13px; height: 13px; }
.task-meta .status { color: var(--blue-ink); }
.prio { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.prio.p1 { background: var(--line); } .prio.p2 { background: var(--sage); } .prio.p3 { background: var(--gold); } .prio.p4 { background: var(--danger); }
.group { margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; }
.group h4 { padding: 8px 0 4px; display: flex; gap: 8px; align-items: center; }
.count { font: 12px var(--sans); color: var(--ink-2); background: var(--surface-2); border-radius: 99px; padding: 0 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { display: inline-flex; gap: 7px; align-items: center; padding: 9px 14px; border: 0; background: none; font: 500 14px var(--sans); color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--ink); border-color: var(--blue); }
.tab svg { width: 16px; height: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; border: 1px dashed transparent; }
.kcol.over { border-color: var(--blue); }
.kcol h4 { padding: 4px 6px 10px; display: flex; gap: 8px; align-items: center; }
.kcol .task-row { background: var(--surface); border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--line); padding: 10px; cursor: grab; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font: 500 13.5px var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }

/* ── Projets ── */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--c, var(--taupe)); min-height: 128px; cursor: pointer; font-family: inherit; text-align: left; color: var(--ink); }
.proj-card:hover { border-color: var(--c, var(--taupe)); color: var(--ink); }
.proj-card .pc-top { display: flex; justify-content: space-between; color: var(--c); }
.proj-card h4 { margin-top: 6px; }
.proj-card .progress { margin-top: auto; }
.proj-card.add { border: 1.5px dashed var(--line); background: transparent; box-shadow: none; align-items: center; justify-content: center; color: var(--ink-2); font-size: 14px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.status-dot.pause { background: var(--champagne); } .status-dot.termine { background: var(--taupe); }
.proj-line { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 8px; border-radius: 10px; }
.proj-line:hover { background: var(--surface-2); color: var(--ink); }
.proj-line small, .dist small, .prop small { display: block; color: var(--ink-2); font-size: 12px; }
.proj-line .progress { grid-column: 1 / -1; margin: 0; }
.dist { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 7px 0; }
.dist .progress { grid-column: 1 / -1; margin: 0; }
details.archived { margin-top: 10px; color: var(--ink-2); }

/* ── Éléments, galerie ── */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.item-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-wrap { display: flex; flex-direction: column; gap: 6px; }
.item-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); }
.item-card:hover { border-color: var(--taupe); }
.item-card.unprocessed { border-left: 3px solid var(--blue); }
.item-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.item-body { padding: 12px 14px; }
.item-body h4 { font-size: 15px; margin: 4px 0; }
.item-body p { font-size: 13px; color: var(--ink-2); white-space: pre-line; margin: 0; }
.item-body time { font-size: 11.5px; color: var(--ink-2); }
.item-body .link { display: flex; gap: 5px; align-items: center; overflow: hidden; }
.item-kind { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .8px; flex-wrap: wrap; }
.item-kind svg { width: 14px; height: 14px; color: var(--green); }
.item-kind .chip { text-transform: none; letter-spacing: 0; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filters-chips { margin-bottom: 12px; }
.quick-inbox { display: flex; gap: 8px; margin-bottom: 18px; }
.masonry { columns: 4 220px; column-gap: 12px; }
.masonry figure { break-inside: avoid; margin: 0 0 12px; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.masonry img { width: 100%; display: block; }
.masonry figcaption { padding: 8px 12px; font-size: 13px; }
.masonry figcaption small { display: block; color: var(--ink-2); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.file { width: auto; min-width: 140px; max-width: 260px; height: auto; padding: 8px 10px; }
.thumb.file a { display: flex; gap: 6px; align-items: center; font-size: 12.5px; word-break: break-all; }
.thumb audio { width: 230px; height: 34px; }
.thumb-del { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.5); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.thumb-del svg { width: 13px; height: 13px; }

/* ── Formulaires ── */
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 14px var(--sans); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--blue) 45%, transparent); border-color: var(--blue); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--blue); }
input[type=color] { padding: 2px; height: 38px; }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.form { display: flex; flex-direction: column; gap: 12px; }
.title-input { font: 500 19px var(--serif); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 2px; background: transparent; }
.title-input:focus { outline: none; border-color: var(--blue); }
.grid2, .grid3, .grid4 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: repeat(2, 1fr); } .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
legend { font-size: 13px; color: var(--ink); padding: 0 6px; display: flex; gap: 6px; align-items: center; }
legend svg { width: 15px; height: 15px; color: var(--green); }
.subtask { display: flex; gap: 8px; align-items: center; }
.subtask input:not([type]) , .subtask input[name] { border-color: transparent; background: var(--surface-2); }
.subtask.dragging { opacity: .4; }
.days { display: flex; gap: 4px; align-items: flex-end; flex-wrap: wrap; }
.day { flex-direction: row; align-items: center; gap: 3px; font-size: 12px; }
.w80 { width: 84px; flex: none; }
.steps { display: flex; flex-direction: column; gap: 6px; }
.callout { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; flex-wrap: wrap; }
.callout svg { color: var(--green); }
.mini-list { display: flex; flex-direction: column; gap: 4px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-pick label { flex-direction: row; cursor: pointer; }
.icon-pick input { display: none; }
.icon-pick svg { width: 34px; height: 34px; padding: 8px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink-2); }
.icon-pick input:checked + svg { border-color: var(--blue); background: var(--blue-soft); color: var(--ink); }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 18px; align-items: center; text-align: center; cursor: pointer; color: var(--ink); font-size: 14px; }
.drop svg { width: 26px; height: 26px; color: var(--green); }
.dictate-wrap { position: relative; }
.dictate { position: absolute; right: 6px; bottom: 8px; }
.dictate.on { background: var(--blue-btn); color: var(--on-blue); }
.rec-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; }
.week-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.settings-sec h4 { margin: 18px 0 8px; }
.toc { margin-bottom: 16px; }
.status-line { display: flex; gap: 8px; align-items: center; }
.status-line.error { color: var(--danger); }
.spaces-admin li { gap: 6px; }

/* ── Fenêtres ── */
.modal-wrap { position: fixed; inset: 0; background: rgba(41,37,33,.36); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; backdrop-filter: blur(2px); }
.modal { background: var(--bg); border-radius: 18px; width: 100%; max-width: 560px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.2); max-height: 88vh; overflow-y: auto; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.modal-head p { margin: 2px 0 0; font-size: 13px; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding-top: 10px; flex-wrap: wrap; }
.capture-tabs { margin-bottom: 12px; }
.capture-tabs .tab { padding: 8px 10px; }
.toasts { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow); max-width: 90vw; }

/* ── Calendrier ── */
.cal-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-left: auto; }
.lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg.work::before { background: color-mix(in srgb, var(--work) 45%, transparent); }
.lg.ev::before { background: var(--champagne); } .lg.task::before { background: var(--sage); }
.lg.reserved::before { border: 1.5px dashed var(--blue); } .lg.free::before { background: color-mix(in srgb, var(--sage) 18%, transparent); }
.cal-wrap { display: grid; grid-template-columns: 1fr 240px; gap: 14px; align-items: start; }
.cal-grid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.cal-head, .cal-top { display: grid; grid-template-columns: 52px repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dh { padding: 8px 4px; text-align: center; font-size: 12.5px; font-weight: 500; text-transform: capitalize; }
.dh.is-today { color: var(--blue-ink); }
.cal-top > div { padding: 3px; min-height: 6px; display: flex; flex-direction: column; gap: 2px; }
.allday { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--champagne); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 3px; align-items: center; }
.allday svg { width: 11px; height: 11px; }
.allday.due { background: transparent; border: 1px solid var(--line); }
.allday.k-vacances, .allday.k-conge { background: color-mix(in srgb, var(--sage) 30%, transparent); }
.cal-body { display: grid; grid-template-columns: 52px repeat(var(--n), minmax(0, 1fr)); max-height: 66vh; overflow-y: auto; }
.hours .hour { font-size: 10.5px; color: var(--ink-2); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.dcol { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 46px; }
.cb { position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 2px 6px; font-size: 11px; overflow: hidden; line-height: 1.25; }
.cb span { color: var(--ink-2); margin-right: 4px; }
.cb b { font-weight: 500; }
.cb.free { background: color-mix(in srgb, var(--sage) 13%, transparent); color: var(--sage-ink); left: 0; right: 0; border-radius: 0; pointer-events: none; }
.cb.free span { display: none; }
.cb.work { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--work) 28%, transparent) 0 6px, color-mix(in srgb, var(--work) 18%, transparent) 6px 12px); pointer-events: none; }
.cb.pause { background: var(--surface-2); color: var(--ink-2); pointer-events: none; }
.cb.ev { background: var(--champagne); cursor: pointer; z-index: 2; }
.cb.reserved { border: 1.5px dashed var(--c, var(--blue)); background: color-mix(in srgb, var(--c, var(--blue)) 8%, transparent); cursor: pointer; z-index: 1; }
.cb.task { background: color-mix(in srgb, var(--c) 24%, var(--surface)); border-left: 3px solid var(--c); cursor: grab; z-index: 3; }
.cb.task.done { opacity: .5; text-decoration: line-through; }
.unsched { position: sticky; top: 0; max-height: 72vh; overflow-y: auto; }
.unsched h3 { display: flex; gap: 8px; align-items: center; }
.mini-task { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; font-size: 13px; cursor: grab; background: var(--surface); }
.mini-task small { margin-left: auto; color: var(--ink-2); white-space: nowrap; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mhead, .mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mhead div { padding: 8px; font-size: 12px; color: var(--ink-2); text-align: center; border-bottom: 1px solid var(--line); }
.mcell { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.other { background: var(--surface-2); opacity: .7; }
.mcell.is-today .mnum { background: var(--blue-btn); color: var(--on-blue); border-radius: 99px; padding: 0 7px; }
.mnum { font-size: 12.5px; font-weight: 600; align-self: flex-start; }
.mwork { font-size: 10.5px; color: var(--taupe); }
.mi { font-size: 11px; padding: 1px 5px; border-radius: 5px; background: var(--champagne); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi.task { background: color-mix(in srgb, var(--c) 22%, transparent); }
.mi.due { background: transparent; color: var(--ink-2); }
.mi.more { background: none; color: var(--ink-2); }

/* ── Planification, assistant ── */
.planner-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.prop { flex-direction: row; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink); cursor: pointer; }
.prop .when { color: var(--ink-2); font-size: 12.5px; min-width: 96px; }
.warnings { margin-top: 12px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.warnings p { display: flex; gap: 8px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.warnings svg { color: var(--green); }
.chat { display: flex; flex-direction: column; gap: 12px; }
.msgs { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; min-height: 200px; overflow-y: auto; padding: 4px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 14px; }
.msg.user { align-self: flex-end; background: var(--blue-soft); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg ul { margin: 4px 0; padding-left: 18px; }
.msg li { margin: 3px 0; }
.msg svg { width: 14px; height: 14px; vertical-align: -2px; }
.examples .chip { white-space: normal; text-align: left; }
.ctx { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctx select { width: auto; flex: 1; min-width: 200px; }
.chat-input { display: flex; gap: 8px; }

/* ── Mobile et tablette ── */
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } .unsched { position: static; max-height: none; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 50; transform: translateX(-100%); transition: transform .2s; padding-top: calc(18px + env(safe-area-inset-top)); }
  .menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .scrim { display: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 45; }
  .topbar { display: flex; }
  .page { padding: 20px 16px 110px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .grid3, .grid4 { grid-template-columns: repeat(2, 1fr); }
  .legend { margin-left: 0; }
  .cal-grid[style*="--n:7"] .cal-head, .cal-grid[style*="--n:7"] .cal-top, .cal-grid[style*="--n:7"] .cal-body { grid-template-columns: 40px repeat(7, minmax(64px, 1fr)); }
  .cal-grid[style*="--n:7"] { overflow-x: auto; }
  .kanban { grid-template-columns: repeat(4, 78vw); scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .fab span { display: none; }
  .fab { padding: 16px; }
  .mcell { min-height: 70px; }
  .mi { display: none; }
  .mcell .mwork { font-size: 9.5px; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .page-head .btn-row { width: 100%; }
  .capture-tabs .tab span { display: none; }
}
