:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7280;
  --border: #e3e6eb; --accent: #2f6fdd; --sel: #e8f0fd;
}
/* Thème sombre : selon le système (réglage « Automatique »), ou forcé dans les Réglages */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #15181e; --panel: #1d2129; --text: #e6e8ec; --muted: #9aa1ad;
          --border: #2c313b; --accent: #6ea0ff; --sel: #243149; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #15181e; --panel: #1d2129; --text: #e6e8ec; --muted: #9aa1ad;
          --border: #2c313b; --accent: #6ea0ff; --sel: #243149; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, sans-serif; background: var(--bg); color: var(--text); height: 100vh; display: flex; flex-direction: column; }
header { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
header #account { color: var(--muted); flex: 1; }
button { font: inherit; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; }
main { --nav-w: 200px; --list-w: 380px; flex: 1; display: grid; grid-template-columns: var(--nav-w) var(--list-w) 1fr; min-height: 0; position: relative; }
/* Poignées pour ajuster la largeur des colonnes */
.splitter { position: absolute; top: 0; bottom: 0; width: 7px; margin-left: -4px; cursor: col-resize; z-index: 5; }
.splitter[data-col="nav"] { left: var(--nav-w); }
.splitter[data-col="list"] { left: calc(var(--nav-w) + var(--list-w)); }
.splitter:hover, .splitter.active { background: var(--accent); opacity: .35; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }
nav, #listcol, #reader { overflow-y: auto; border-right: 1px solid var(--border); }
#listcol { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#list { flex: 1; overflow-y: auto; }
nav { padding: 8px; }
nav a { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
nav a.active { background: var(--sel); color: var(--accent); font-weight: 600; }
#listcol, #list { background: var(--panel); }
.msg { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.msg:hover { background: var(--bg); }
.msg.active { background: var(--sel); }
.msg.unread .from, .msg.unread .subject { font-weight: 700; }
.msg .top { display: flex; justify-content: space-between; gap: 8px; }
.msg .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.msg .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
#reader { padding: 16px 24px; }
#reader h1 { font-size: 20px; margin: 0 0 8px; }
.meta { color: var(--muted); margin-bottom: 12px; }
.attachments { margin-bottom: 12px; font-size: 13px; }
#reader iframe { width: 100%; min-height: 60px; border: 0; border-radius: 6px; background: #fff; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--border); color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.card { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); margin-bottom: 10px; }
.card-head { padding: 10px 14px; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.card-head .who { flex: 1; }
.card-head .addr { color: var(--muted); font-size: 12px; }
.card-head .date { color: var(--muted); font-size: 12px; }
.card-head .preview { flex-basis: 100%; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.open .card-head .preview { display: none; }
.card-body { display: none; padding: 0 14px 14px; }
.card.open .card-body { display: block; }
#reader pre { white-space: pre-wrap; font: inherit; }
.hint { color: var(--muted); padding: 16px; }
.error { color: #c0392b; padding: 16px; }
details.wm-quote > summary { list-style: none; display: inline-block; padding: 0 8px; margin: 6px 0; border-radius: 8px; background: var(--border); color: var(--muted); cursor: pointer; font-size: 12px; letter-spacing: 2px; }
details.wm-quote > summary::-webkit-details-marker { display: none; }
details.wm-quote pre { color: var(--muted); }
.images-banner { margin: 0 0 10px; padding: 8px 12px; border-radius: 6px; background: var(--sel); font-size: 13px; }
.images-banner a { color: var(--accent); }
nav a.has-unread { font-weight: 700; }
nav a .unseen { font-size: 12px; color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: .6; cursor: default; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.compose { display: flex; flex-direction: column; gap: 8px; }
.compose label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.compose label input { flex: 1; }
.compose input, .compose textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.compose textarea { resize: vertical; min-height: 140px; }
.more-fields { display: flex; gap: 12px; font-size: 12px; }
.more-fields a { color: var(--accent); }
#reader form.compose { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); padding: 12px 14px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.compose-title { font-weight: 600; }
.compose-window { position: fixed; right: 24px; bottom: 0; width: 520px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--border); border-radius: 10px 10px 0 0; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 20; display: flex; flex-direction: column; }
.compose-window.expanded { right: 50%; bottom: 50%; transform: translate(50%, 50%); width: min(900px, calc(100vw - 32px)); border-radius: 10px; }
.compose-window.expanded textarea { min-height: 50vh; }
.compose-window-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--text); color: var(--panel); border-radius: 10px 10px 0 0; font-weight: 600; }
.compose-window-head span { flex: 1; }
.compose-window-head button { background: transparent; border: 0; color: inherit; padding: 2px 6px; }
.compose-window form { padding: 12px; }
.compose-actions { display: flex; gap: 8px; align-items: center; }
.compose .status { color: var(--muted); }
[hidden] { display: none !important; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.card.unread-mark .card-head { border-left: 3px solid var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 18px; border-radius: 8px; background: #1d2330; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.2); transition: opacity .4s; z-index: 10; }
.toast.hide { opacity: 0; }
#reader pre a { color: var(--accent); word-break: break-all; }
.toast button { margin-left: 12px; background: transparent; border: 0; color: #8ab4f8; font-weight: 600; padding: 0; }
.compose-actions .status { flex: 1; font-size: 12px; }
.compose-actions .discard { color: #d93025; border-color: #f1b8b4; }
.compose-actions .discard:hover { background: #fce8e6; }
.draft-tag { color: #d93025; font-weight: 600; font-size: 12px; }
.attachments, .attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.attach-list:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); font-size: 13px; max-width: 100%; }
.att-chip a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip a:hover { color: var(--accent); }
.att-size { color: var(--muted); font-size: 12px; }
.att-chip.uploading { color: var(--muted); font-style: italic; }
form.compose.dragging { outline: 2px dashed var(--accent); outline-offset: 2px; }
.att-chip { overflow: hidden; }
.att-chip a { min-width: 0; }
.compose-actions button { white-space: nowrap; }
.compose-actions { flex-wrap: wrap; }
.clip { font-size: 12px; }
.preview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; }
.preview-box { background: var(--panel); border-radius: 10px; width: min(1000px, 100%); height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.preview-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.preview-head span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-head a { color: var(--accent); text-decoration: none; }
.preview-body { flex: 1; display: flex; min-height: 0; background: #fff; overflow: auto; }
.preview-body iframe { flex: 1; border: 0; width: 100%; }
.preview-body img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.preview-download { padding: 4px 10px; border: 1px solid var(--accent); border-radius: 6px; }
.att-chip .att-download { font-size: 18px; line-height: 1; padding: 0 2px 0 8px; margin-left: 2px; border-left: 1px solid var(--border); color: var(--accent); }
.context-menu { position: fixed; z-index: 40; min-width: 220px; padding: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.context-menu button { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 5px; display: flex; justify-content: space-between; gap: 16px; }
.context-menu button:hover { background: var(--sel); }
.context-menu .danger { color: #d93025; }
.context-menu .key { color: var(--muted); font-size: 11px; }
.context-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.settings section { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.settings h2 { font-size: 15px; margin: 0; }
.settings label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.settings input, .settings textarea, .settings select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.hint-inline { font-size: 12px; opacity: .8; }
button.star { border: 0; background: transparent; padding: 0 4px; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; }
button.star.on { color: #f2b600; }
button.star:hover { color: #f2b600; }
.msg { position: relative; }
.msg .star { position: absolute; right: 10px; bottom: 8px; }
.msg .subject { padding-right: 24px; }
.settings label.check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); font-size: 14px; }
.settings label.check input { margin-top: 3px; }
.nav-sep { margin: 12px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
nav a.new-folder { color: var(--accent); font-size: 13px; margin-top: 6px; }
nav a.noselect { color: var(--muted); cursor: default; }
.context-menu { max-height: 70vh; overflow-y: auto; }
nav a.drop-target { background: var(--sel); outline: 2px dashed var(--accent); outline-offset: -2px; }
.msg.dragging { opacity: .5; }
#list-tools { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; white-space: nowrap; padding: 6px 10px; border-bottom: 1px solid var(--border); min-height: 40px; font-size: 13px; }
#list-tools .count { color: var(--muted); margin-right: auto; overflow: hidden; text-overflow: ellipsis; }
#list-tools button { padding: 3px 7px; font-size: 13px; flex-shrink: 0; }
#list-tools .danger { color: #d93025; border-color: #f1b8b4; }
.msg { padding-left: 36px; }
.msg input.sel { position: absolute; left: 12px; top: 12px; margin: 0; cursor: pointer; }
.msg.selected { background: var(--sel); }
#list-tools select.sort { font: inherit; font-size: 13px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
#search { flex: 1; max-width: 520px; }
#search > input { width: 100%; font: inherit; padding: 6px 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); color: var(--text); }
#search > input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--panel); }
header #account { flex: 0 1 auto; }
.msg .snippet { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-right: 24px; }
.msg mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
.result-folder { float: right; clear: right; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; margin: 2px 0 0 6px; }
#list-tools select.scope { font: inherit; font-size: 13px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); max-width: 150px; }
#search { position: relative; display: flex; align-items: center; gap: 4px; }
#search .adv-toggle { border: 0; background: transparent; color: var(--muted); padding: 4px 8px; margin-left: -44px; }
#search > input { padding-right: 48px; }
.adv-panel { position: absolute; top: calc(100% + 6px); left: 0; width: max(100%, 560px); max-width: calc(100vw - 32px); z-index: 30; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.adv-panel > label { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.adv-panel input, .adv-panel select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); min-width: 0; }
.adv-panel .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.adv-panel .row input[type=number] { width: 90px; }
.adv-panel .checks { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.adv-panel .adv-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.adv-panel .adv-actions .hint-inline { margin-right: auto; color: var(--muted); font-size: 12px; }
.deep-search { padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--muted); }
.deep-search .hint-inline { font-size: 12px; }
.adv-panel .checks label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.adv-panel input[type=checkbox] { width: auto; }
.result-folder { margin-right: 22px; }
#list-tools .count { min-width: 0; }
.att-chip .att-remove { color: var(--muted); font-size: 13px; padding-left: 4px; }
.att-chip .att-remove:hover { color: #d93025; }
.att-remove-all { align-self: center; font-size: 12px; color: var(--muted); text-decoration: none; }
.att-remove-all:hover { color: #d93025; }
.confirm-box { background: var(--panel); color: var(--text); border-radius: 10px; padding: 18px 22px; width: min(520px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.confirm-box h2 { margin: 0 0 10px; font-size: 17px; }
.confirm-box ul { margin: 0 0 10px; padding-left: 18px; }
.confirm-box .warn { color: #d93025; }
.danger-btn { background: #d93025; border-color: #d93025; color: #fff; }
.preview-body video { max-width: 100%; max-height: 100%; margin: auto; background: #000; }
.preview-body .audio-box { margin: auto; display: flex; flex-direction: column; gap: 16px; align-items: center; font-size: 16px; color: #1d2330; }
.msg .size-tag { font-weight: 600; color: var(--text); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--bg); }
.rich-toolbar[hidden] { display: none; }
.rich-toolbar button, .rich-toolbar .color { padding: 2px 8px; font-size: 13px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--text); cursor: pointer; }
.rich-toolbar button:hover, .rich-toolbar .color:hover { border-color: var(--border); background: var(--panel); }
.rich-toolbar .color { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #d93025; }
.rich-toolbar .color input { width: 22px; height: 18px; padding: 0; border: 0; background: transparent; }
.compose .rich { min-height: 160px; max-height: 50vh; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 0 0 6px 6px; background: var(--panel); color: var(--text); outline: none; line-height: 1.45; }
.compose .rich:focus { border-color: var(--accent); }
.compose-window.expanded .rich { min-height: 50vh; }
.compose .rich blockquote { color: var(--muted); }
.mode-toggle.active { background: var(--sel); border-color: var(--accent); }
.shortcuts-help table { border-collapse: collapse; margin-bottom: 10px; width: 100%; }
.shortcuts-help td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--bg); font: 12px ui-monospace, monospace; }
.fname { display: inline-flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
nav a.active .ico { color: var(--accent); }
nav a { align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand .logo { height: 22px; width: auto; display: block; }
/* En thème sombre, le logo garde son fond blanc dans un petit cartouche arrondi, pour rester lisible */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo { background: #fff; padding: 3px 6px; border-radius: 5px; box-sizing: content-box; }
}
:root[data-theme="dark"] .brand .logo { background: #fff; padding: 3px 6px; border-radius: 5px; box-sizing: content-box; }
/* Sélecteur d'applications (Mail, et plus tard Agenda, Contacts) */
.apps { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: visible; }
.apps .app { padding: 3px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.apps .app.active { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.apps .app.soon { opacity: .45; cursor: default; }
header button { white-space: nowrap; }
header > .brand, header > .apps, header > button { flex-shrink: 0; }
header #search { min-width: 160px; }
.ui-dialog .confirm-box p { margin: 0 0 12px; }
.ui-dialog .dialog-input { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); margin-bottom: 12px; }
.ui-dialog { z-index: 60; }
.header-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-right #account { color: var(--muted); font-size: 13px; }
#list-tools .refresh-btn { padding: 2px 8px; font-size: 15px; line-height: 1.2; }
/* Réglages : mon compte */
.account-settings { gap: 10px; }
form.settings { gap: 10px; }
.settings h1 { margin: 0; }
/* Rubriques repliables des Réglages */
.settings details.sect { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.settings details.sect > summary { list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.settings details.sect > summary::-webkit-details-marker { display: none; }
.settings details.sect > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.settings details.sect[open] > summary::before { transform: rotate(90deg); }
.settings details.sect > summary:hover { background: var(--bg); border-radius: 8px; }
.settings .sect-body { padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.settings .row2 { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; align-items: end; }
.settings .row2 label.check { padding-bottom: 8px; }
.settings img.qr { width: 220px; height: 220px; background: #fff; border-radius: 6px; }
.settings code.secret { user-select: all; word-break: break-all; }
/* Page admin */
.admin { max-width: 860px; }
.user-row { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: 0; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 11px; font-weight: 600; background: var(--border); color: var(--muted); }
.tag.ok { background: #d9f2e1; color: #1e7b3c; } .tag.warn { background: #fff0c9; color: #8a5a00; } .tag.bad { background: #fbd9d6; color: #b3261e; }
.settings .row2 input:not([type=checkbox]) { min-width: 0; width: 100%; }

/* ===== Version téléphone : une colonne à la fois (dossiers → liste → lecture) ===== */
.m-only { display: none; }
@media (max-width: 760px) {
  body { height: 100dvh; font-size: 15px; }
  .m-only { display: inline-block; }
  header { flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; }
  header .brand, header .apps, #account, #shortcuts-btn, .splitter { display: none; }
  #m-back { order: 0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; font-weight: 600; padding: 8px 10px; }
  #compose { order: 1; margin-left: auto; padding: 8px 10px; }
  .header-right { order: 2; margin-left: 0; gap: 4px; }
  .header-right button { padding: 8px 10px; }
  header .lbl { display: none; } /* boutons réduits à leur icône */
  header #search { order: 3; flex: 1 1 100%; max-width: none; min-width: 0; }
  #search > input { padding-top: 8px; padding-bottom: 8px; font-size: 16px; } /* 16 px : iPhone ne zoome pas */
  #search .adv-panel { position: fixed; left: 8px; right: 8px; width: auto; max-height: 75dvh; overflow-y: auto; }
  main { display: block; }
  main > nav, main > #listcol, main > #reader { display: none; height: 100%; border-right: 0; }
  body[data-view="folders"] main > nav { display: block; }
  body[data-view="list"] main > #listcol { display: flex; }
  body[data-view="reader"] main > #reader { display: block; }
  nav a { padding: 12px 14px; font-size: 16px; }
  .msg { padding: 12px 40px 12px 40px; }
  .msg input.sel { width: 18px; height: 18px; top: 13px; }
  .msg .star { font-size: 20px; padding: 4px 6px; right: 4px; bottom: 4px; }
  #list-tools { overflow-x: auto; flex-wrap: nowrap; }
  #reader { padding: 10px 12px; }
  .card-head { padding: 12px; }
  .card-body { padding: 0 10px 12px; }
  .actions button, .compose-actions button { padding: 8px 12px; }
  input, select, textarea { font-size: 16px; }
  .compose-window, .compose-window.expanded { inset: 0; width: 100%; max-width: none; transform: none; border-radius: 0; }
  .compose-window-head { border-radius: 0; }
  .preview-overlay { padding: 8px; }
  .settings .row2 { grid-template-columns: minmax(0, 1fr) 70px; }
  .settings .row2 label.check { grid-column: 1 / -1; padding-bottom: 0; }
}
.settings .sect-body > form { display: flex; flex-direction: column; gap: 12px; }
.settings .sect-body > form + form { border-top: 1px solid var(--border); padding-top: 14px; }
.settings h3 { font-size: 14px; margin: 0; }
/* Signatures : réglages et choix à l'écriture */
.sig-editor { display: flex; flex-direction: column; gap: 8px; }
.sig-title { color: var(--muted); font-size: 13px; }
.sig-list { display: flex; flex-direction: column; gap: 8px; }
.sig-card { border: 1px solid var(--border); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.sig-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sig-head .sig-name { flex: 1; min-width: 140px; }
.settings .sig-head label.check { align-items: center; white-space: nowrap; }
.settings .sig-head label.check input { margin-top: 0; }
.sig-add { align-self: flex-start; }
.compose .more-fields .sig-pick { margin-left: auto; font-size: 12px; gap: 4px; }
.compose .sig-pick select { font: inherit; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); color: var(--text); max-width: 160px; }
/* Envoi programmé */
.send-group { display: inline-flex; }
.send-group button[type=submit] { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.send-group .schedule-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,.4); padding-left: 8px; padding-right: 8px; }
.schedule-box { max-width: 420px; }
.schedule-quick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.schedule-quick button { display: flex; justify-content: space-between; gap: 12px; text-align: left; padding: 8px 12px; }
.schedule-quick button span { color: var(--muted); }
.schedule-box label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.sched-banner { padding: 8px 12px; border-radius: 6px; background: var(--sel); }
.sched-banner.failed { background: #fce8e6; color: #a50e0e; }
.sched-failed { color: #d93025; font-weight: 600; }
.sched-preview { white-space: pre-wrap; font: inherit; color: var(--text); border-top: 1px solid var(--border); padding-top: 10px; }
.scheduled-card .meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
