:root {
  --bg: #f6f5f2; --panel: #ffffff; --panel2: #faf9f7; --line: #e7e4de; --text: #1d1c1a; --muted: #6f6b64;
  --accent: #5b6cff; --accent-soft: #eef0ff; --ok: #0ca678; --warn: #e8590c; --danger: #d6336c;
  --shadow: 0 1px 2px rgba(20, 18, 14, .05), 0 6px 20px rgba(20, 18, 14, .05); --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151517; --panel: #1e1e21; --panel2: #232327; --line: #303036; --text: #ececee; --muted: #9a99a2;
    --accent: #8490ff; --accent-soft: #262a4d; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.boot { padding: 80px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.hide { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Structure */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 10px 14px; }
.logo span.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--panel2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
svg { width: 18px; height: 18px; flex: none; }
h2 svg, .chip svg, .item > .muted svg { vertical-align: -3px; width: 16px; height: 16px; }
.badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.badge.soft { background: var(--line); color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; display: grid; gap: 8px; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 0 10px; min-height: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.busy { background: var(--accent); animation: pulse 1s infinite; }
.dot.err { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
.main { padding: 22px 30px 60px; max-width: 1180px; width: 100%; }
.top { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.ask { flex: 1; position: relative; }
.ask input { width: 100%; padding: 11px 14px 11px 40px; border-radius: 12px; }
.ask svg { position: absolute; left: 12px; top: 11px; width: 20px; height: 20px; color: var(--accent); }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

/* Éléments */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.grid2 > div > .card + .card, .grid2 + .card { margin-top: 16px; }
[data-taskadd] input[name=title] { flex: 1 1 220px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; outline: none; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; min-height: 110px; resize: vertical; line-height: 1.5; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label.f input, label.f select, label.f textarea { color: var(--text); font-size: 15px; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; margin: 6px 0; }
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 9px; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.big { padding: 12px 18px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .55; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.btnlike { cursor: pointer; font-size: 13px; padding: 5px 12px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.list { display: grid; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 4px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item.click { cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.item.click:hover { background: var(--panel2); }
.item .t { font-weight: 600; }
.prio { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; background: var(--line); }
.prio.p1 { background: var(--warn); }
.prio.p2 { background: var(--accent); }
.date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs a.on { color: var(--accent); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.md h2 { font-size: 15px; margin: 16px 0 6px; }
.md h2:first-child { margin-top: 0; }
.md h3 { font-size: 14px; }
.md p { margin: 6px 0; }
.md ul { margin: 4px 0; padding-left: 20px; }
.md li { margin: 3px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.md .cite { font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 0 5px; cursor: pointer; }
.aibox { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.aibox b { color: var(--accent); }
.draft { background: var(--panel2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; }
.draft textarea { min-height: 150px; background: var(--panel); }
.draft .meta { display: grid; grid-template-columns: 50px 1fr; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.body-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.55; }
.banner { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); border-color: var(--warn); }

/* Tiroir et fenêtres */
.drawer { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .28); display: flex; justify-content: flex-end; }
.drawer[hidden], .modal-wrap[hidden] { display: none; }
.drawer .pane { width: min(680px, 100vw); height: 100%; background: var(--panel); padding: 20px 24px 60px; overflow-y: auto; box-shadow: -10px 0 40px rgba(0, 0, 0, .15); }
.modal-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 16px; padding: 22px; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(760px, 100%); }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: #1d1c1a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: 80vw; }
.toast.err { background: var(--danger); }

/* Connexion et accueil */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth { width: min(400px, 100%); }
.welcome { width: min(820px, 100%); }
.choice { cursor: pointer; text-align: left; transition: transform .1s; }
.choice:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.choice .ico svg { width: 22px; height: 22px; }

/* Calendrier */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--panel2); padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal .day { background: var(--panel); min-height: 104px; padding: 5px 6px; cursor: pointer; overflow: hidden; }
.cal .day:hover { background: var(--panel2); }
.cal .day.out { opacity: .45; }
.cal .day .n { font-size: 12px; font-weight: 700; color: var(--muted); display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; }
.cal .day.today .n { background: var(--accent); color: #fff; }
.ev { display: block; font-size: 12px; padding: 1px 6px; border-radius: 5px; margin-top: 2px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev.sug { background: transparent; border: 1px dashed var(--accent); }
.ev.task { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.ev.order { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

/* Commandes */
.steps { display: flex; align-items: center; gap: 0; margin: 12px 0 8px; }
.steps .s { flex: 1; text-align: center; font-size: 11px; color: var(--muted); position: relative; padding-top: 16px; }
.steps .s::before { content: ''; position: absolute; top: 4px; left: 0; right: 0; height: 3px; background: var(--line); }
.steps .s::after { content: ''; position: absolute; top: 0; left: 50%; margin-left: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.steps .s.done::before, .steps .s.done::after { background: var(--ok); }
.steps .s.done { color: var(--text); font-weight: 600; }

/* Assistant */
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.sources { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chatbar { position: sticky; bottom: 14px; display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.chatbar textarea { min-height: 44px; height: 44px; border: 0; box-shadow: none !important; resize: none; }

/* Enregistreur */
.rec { text-align: center; padding: 26px 18px; }
.rec .timer { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rec .live { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; margin-right: 8px; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 18px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.bars div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t input { padding: 4px 8px; }
code { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; word-break: break-all; }
pre.code { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo, .side-foot .status span, .side-foot .conso { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a span.lbl { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; }
  .main { padding: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .cal .day { min-height: 70px; }
}

/* Pastilles de compte et actions de l'assistant */
.chip.acc { background: transparent; gap: 4px; }
.chip.acc svg { width: 13px; height: 13px; }
.draft .meta select { width: 100%; }
.act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: var(--panel2); }
.msg .draft { background: var(--panel2); }
.msg.assistant:has(.draft) { width: 86%; }

/* Sous-dossiers du Drive */
details.folder { border-top: 1px solid var(--line); padding: 6px 0 0; }
details.folder > summary { cursor: pointer; font-weight: 600; padding: 6px 4px; display: flex; align-items: center; gap: 8px; }
details.folder > .list { padding-left: 22px; }

/* Pièces jointes d'un brouillon */
.attach-picker { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; background: var(--panel); }
.attach-picker .list { max-height: 230px; overflow-y: auto; margin-top: 6px; }
.draft .chip a { color: inherit; }

/* Pause de l'IA */
.btn.paused { background: color-mix(in srgb, var(--warn) 16%, var(--panel)); border-color: var(--warn); color: var(--warn); width: 100%; justify-content: center; }
#aipause .btn.ghost { width: 100%; justify-content: flex-start; }

/* Drive : gestionnaire de fichiers */
.drv { display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.drv > .card { margin: 0; }
.drv-tree { padding: 10px 8px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; }
.tnode { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text); cursor: pointer; font-size: 14px; }
.tnode:hover { background: var(--panel2); text-decoration: none; }
.tnode.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tnode.over, .ftile.over { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.tnode i { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px; }
.tnode svg { width: 16px; height: 16px; opacity: .7; }
.tsep { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; }
.drv-main { min-height: 420px; }
.drv-main.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; }
.crumbs { font-size: 15px; }
.crumbs a { cursor: pointer; }
.ftiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.ftile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; background: var(--panel2); }
.ftile:hover { border-color: var(--accent); text-decoration: none; }
.ftile .fold svg { width: 26px; height: 26px; }
.ftile .fold { color: var(--accent); display: grid; }
.flist { margin-top: 10px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.frow:first-child { border-top: 0; }
.frow:hover, .fcard:hover { background: var(--panel2); }
.frow.sel, .fcard.sel { background: var(--accent-soft); }
.frow.cur, .fcard.cur { box-shadow: inset 3px 0 0 var(--accent); }
.frow .t, .fcard .t, .ftile .t { font-weight: 600; }
.frow .fsize { min-width: 62px; text-align: right; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.fcard { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; }
.fcard input { position: absolute; top: 8px; left: 8px; z-index: 1; }
.fcard .thumb { height: 100px; display: grid; place-items: center; background: var(--panel2); border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.fcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.fbadge { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 6px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: #868e96; flex: none; }
.fbadge.big { min-width: 58px; height: 42px; font-size: 14px; border-radius: 9px; }
.fbadge.pdf { background: #e03131; } .fbadge.img { background: #7048e8; } .fbadge.sheet { background: #2f9e44; } .fbadge.doc { background: #1c7ed6; }
.fbadge.slide { background: #e8590c; } .fbadge.audio { background: #c2255c; } .fbadge.video { background: #0c8599; } .fbadge.zip { background: #5c5f66; } .fbadge.text { background: #495057; }
.drv-prev { width: 380px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; }
.pv-img { max-width: 100%; border-radius: 8px; display: block; }
.pv-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pv-text { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.5; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 420px; overflow-y: auto; }
@media (max-width: 1150px) { .drv { grid-template-columns: 200px minmax(0, 1fr); } .drv-prev { grid-column: 1 / -1; width: auto; position: static; max-height: none; } }
@media (max-width: 860px) { .drv { grid-template-columns: 1fr; } .drv-tree { position: static; max-height: 240px; } .frow .date { display: none; } }
.main:has(#drv) { max-width: 1560px; }      /* le Drive profite de toute la largeur de l'écran */
.crumbs { font-weight: 600; }
.crumbs a { font-weight: 500; }

/* Éditeur PDF (annoter, signer) : plein écran, au-dessus de l'application */
#pdfed { position: fixed; inset: 0; z-index: 35; background: #3a3b40; display: flex; flex-direction: column; }
#pdfed[hidden] { display: none; }
.pe-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.pe-body { flex: 1; overflow: auto; padding: 14px 12px 60px; }
.pe-hint { position: sticky; top: 0; z-index: 3; width: max-content; max-width: 90%; margin: 0 auto 10px; background: #1d1c1a; color: #fff; font-size: 13px; padding: 5px 12px; border-radius: 99px; }
#pepages { display: flex; flex-direction: column; align-items: center; gap: 46px; }
.pe-page { position: relative; background: #fff; box-shadow: 0 4px 24px rgba(0, 0, 0, .4); user-select: none; }
#pepages:not([data-tool=select]) .pe-page { cursor: crosshair; touch-action: none; }
.pe-page canvas { display: block; }
.pe-page.deleted canvas, .pe-page.deleted .pe-svg, .pe-page.deleted .pe-layer { opacity: .2; }
.pe-svg, .pe-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; }
.pe-svg .pe-a { cursor: move; }
.pe-svg .pe-a.sel { outline: 2px dashed #5b6cff; outline-offset: 3px; }
.pe-text { position: absolute; white-space: pre; line-height: 1.25; font-family: Helvetica, Arial, sans-serif; cursor: move; padding: 0; min-width: 8px; min-height: 1em; }
.pe-text.editing { cursor: text; outline: 2px solid #5b6cff; background: rgba(91, 108, 255, .08); user-select: text; }
.pe-img { position: absolute; cursor: move; }
.pe-img img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pe-text.sel, .pe-img.sel { outline: 2px dashed #5b6cff; outline-offset: 2px; }
.pe-handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: #5b6cff; border: 2px solid #fff; cursor: nwse-resize; display: none; }
.pe-img.sel .pe-handle { display: block; }
.pe-ptools { position: absolute; left: 0; right: 0; bottom: -38px; display: flex; gap: 8px; align-items: center; justify-content: center; color: #d6d6da; font-size: 12.5px; }
.pe-color { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.pe-color.on { box-shadow: 0 0 0 2px var(--accent); }
.pe-sigpad { width: 100%; height: auto; aspect-ratio: 920 / 340; border: 2px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; display: block; margin-bottom: 8px; }

/* Interface orientée action : réponses en un clic, modes de réflexion */
.modes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.modes .chip.btnlike { padding: 3px 10px; }
.modes .modehint { flex-basis: 100%; }
.quickrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.quickrow .btn.sm:not(.primary):not(.ghost) { border-radius: 99px; background: var(--panel); }
.rowacts { display: inline-flex; gap: 4px; margin-left: auto; align-items: center; }
.rowacts .btn.sm { padding: 2px 8px; font-size: 12px; }
.rowacts .btn svg { width: 13px; height: 13px; }
.item.click .rowacts .btn.ghost { opacity: .55; }
.item.click:hover .rowacts .btn.ghost { opacity: 1; }
.dprev { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.5; max-height: 6.2em; overflow: hidden; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.actbar { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin-top: 12px; background: var(--panel); }
.actbar .draft:first-child { margin-top: 0; }
.msgmeta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.nexts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.chat + .modes { position: sticky; bottom: 78px; background: var(--bg); padding: 6px 0 0; margin: 0; }
/* Petits écrans : rien ne dépasse de la largeur de la page */
.shell > *, .grid2 > * { min-width: 0; }
@media (max-width: 860px) {
  .top, .page-head, .tabs, .banner, .card > .row { flex-wrap: wrap; }
  .page-head .right { margin-left: 0; }
  .main input[style*="min-width"] { min-width: 0 !important; flex: 1 1 100%; }
  .rowacts { margin-left: 0; flex-basis: 100%; }
  .chat + .modes { bottom: 84px; }
}
.item > .grow { min-width: 0; }
.chips > .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .card { overflow-x: auto; } }
.list { grid-template-columns: minmax(0, 1fr); }

/* Assistant dans la fiche d'un email */
.askbox { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.askbox textarea { flex: 1; min-height: 38px; height: 38px; resize: vertical; }
.askbox .chips { margin-top: 6px; }
.askbox .chip.btnlike { font-size: 12px; padding: 3px 9px; }
.askq { margin: 10px 0 6px auto; width: fit-content; max-width: 90%; background: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px; padding: 6px 11px; font-size: 14px; white-space: pre-wrap; }
.askr { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 8px 12px; font-size: 14px; }
.actbar > [data-reply-zone]:first-child > [data-reply-draft]:empty { display: none; }

/* Contacts proposés pendant la frappe */
#ac { position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; max-height: 320px; overflow: auto; }
#ac[hidden] { display: none; }
.ac-item { padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.ac-item.on, .ac-item:hover { background: var(--accent-soft); }
.tochips { align-items: center; margin: 8px 0 6px; }
.tochips[hidden] { display: none; }
.chip .x { cursor: pointer; margin-left: 2px; font-size: 15px; line-height: 1; opacity: .7; }
.chip .x:hover { opacity: 1; }

.item.off { opacity: .55; }
.item .t .chip { margin-left: 6px; vertical-align: 1px; }
