/* SignaturePro 2.1 · éditeur (barre d'outils, panneau, canevas) */
body.editeur { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }

/* ---------- Barre du haut ---------- */
.topbar { flex: none; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 17px; margin-right: 4px; }
.brand img { border-radius: 7px; }
.brand .pill { height: 20px; font-family: var(--font); font-size: 11.5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.undo-group { display: flex; gap: 2px; margin-right: 2px; }
.account-pill { border: 0; cursor: pointer; height: 30px; }
.show-xs, .only-sm { display: none; }

/* Sélecteur de signature */
.sig-switch { position: relative; min-width: 0; }
.sig-current { max-width: 280px; gap: 8px; font-weight: 600; }
.sig-current #sigName { overflow: hidden; text-overflow: ellipsis; }
.sig-current svg { width: 14px; height: 14px; color: var(--ink-3); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.menu { position: absolute; top: calc(100% + 6px); left: 0; width: 300px; padding: 6px; background: var(--bg); border-radius: 12px; box-shadow: var(--pop); z-index: 30; }
.menu-title { padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.menu-title .muted { font-weight: 400; }
.menu-list { max-height: 300px; overflow: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; font-size: 14px; color: var(--ink); }
.menu-item:hover, .menu-item.current { background: var(--bg-sunk); }
.menu-item svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-item .meta { margin-left: auto; font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.menu-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Bandeau lien partagé */
.shared-banner { flex: none; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.shared-banner .inner { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 14px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- Espace de travail ---------- */
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 78px minmax(340px, 400px) 1fr; }

/* Barre d'outils (comme Canva) */
.rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; scrollbar-width: none; }
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 62px; border: 0; border-radius: 12px; background: none; color: var(--ink-3); cursor: pointer; font-size: 11.5px; font-weight: 500; transition: background .15s, color .15s; }
.rail-btn svg { width: 23px; height: 23px; }
.rail-btn:hover { background: var(--bg-soft); color: var(--ink); }
.rail-btn[aria-selected="true"] { background: var(--bg-sunk); color: var(--ink); font-weight: 600; }
.rail-btn .tick { position: absolute; top: 7px; right: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); display: none; }
.rail-btn .tick::after { content: ''; position: absolute; left: 4.5px; top: 2.5px; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.rail-btn.done .tick { display: block; }
.rail-btn[data-tab="plus"] { margin-top: auto; }

/* Panneau */
.panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.panel-scroll { flex: 1; overflow-y: auto; padding: 0 20px; scrollbar-width: thin; }
.tab-pane { animation: fade .15s ease; padding-top: 20px; }
.pane-head { margin-bottom: 18px; }
.pane-head .step-n { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.pane-head h2 { font-size: 23px; letter-spacing: -.015em; }
.pane-head p { margin-top: 6px; font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.pane-next { position: sticky; bottom: 0; z-index: 2; margin-top: 18px; padding: 18px 0 16px; background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 38%); }
.pane-next .btn { width: 100%; }
.sec-title { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 24px 0 10px; display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2.tight { margin-top: 12px; }
.opt { font-style: normal; font-weight: 400; color: var(--ink-4); margin-left: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.callout.small { font-size: 13px; margin-bottom: 12px; }
.note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.5; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.line-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.line-setting .label { margin: 0; }
.line-setting .label b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.seg.wrap { flex-wrap: wrap; }
.range { width: 170px; accent-color: var(--ink); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }

/* Images d'exemple */
.picker { margin: -4px 0 12px; }
.picker-label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs button { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg-sunk); box-shadow: 0 0 0 1px var(--line); transition: transform .12s; }
.thumbs.round button { border-radius: 50%; }
.thumbs button img { width: 100%; height: 100%; display: block; object-fit: cover; }
.thumbs button:hover { transform: translateY(-1px); }
.thumbs button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }

/* Modèles */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; text-align: left; transition: border-color .15s, transform .12s; }
.theme-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.theme-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-card .mini { height: 112px; overflow: hidden; border-radius: 9px; background: #fff; position: relative; pointer-events: none; }
.theme-card .mini > div { position: absolute; top: 10px; left: 10px; transform: scale(.4); transform-origin: top left; width: 560px; }
.theme-card .nm { font-size: 13.5px; font-weight: 600; padding: 0 3px 2px; display: flex; align-items: center; justify-content: space-between; }
.theme-card .sw { width: 12px; height: 12px; border-radius: 50%; }
.theme-card .check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; border: 2px solid #fff; display: none; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; }
.theme-card[aria-pressed="true"] .check { display: grid; }

/* Choix illustrés */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 14px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.choice:hover { border-color: var(--line-strong); }
.choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); color: var(--ink); }
.choice svg { width: 100%; height: 34px; color: var(--ink-3); }
.choice[aria-pressed="true"] svg { color: var(--ink); }
.choice .sample { font-size: 13px; color: var(--ink); min-height: 20px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.choice .sample img { width: 14px; height: 14px; }

/* Couleurs */
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); position: relative; }
.swatch[aria-pressed="true"]::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.color-field, .field > .color-field { display: flex; gap: 6px; align-items: center; }
.color-field input[type="color"] { width: 38px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); cursor: pointer; flex: none; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-field .input { height: 38px; padding: 0 9px; }

/* Polices */
.fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.font-btn { height: 54px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink); }
.font-btn b { font-size: 19px; font-weight: normal; line-height: 1.1; }
.font-btn small { font-size: 11px; color: var(--ink-3); font-family: var(--font); }
.font-btn:hover { border-color: var(--line-strong); }
.font-btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* Réseaux */
.socials { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.social-row { display: grid; grid-template-columns: 124px 1fr auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.social-row select, .social-row input { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 9px; background: var(--bg); font-size: 14px; min-width: 0; width: 100%; }
.social-row .extra, .social-row .lbl, .social-row .ico { grid-column: 1 / 3; }
.social-row select:focus, .social-row input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.social-row.error input[type="url"] { border-color: var(--danger); }
.row-tools { display: flex; gap: 0; }
.row-tools .btn { width: 28px; height: 30px; padding: 0; color: var(--ink-3); }
.quick-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.quick-add button { height: 30px; padding: 0 11px; border: 1px dashed var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 13px; cursor: pointer; }
.quick-add button:hover { border-style: solid; color: var(--ink); background: var(--bg-soft); }
.empty { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-3); font-size: 13.5px; text-align: center; }
.cta-fields { margin-top: 12px; }
.cta-fields.off { opacity: .45; pointer-events: none; }

/* Actus */
.news-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.news-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.news-card.off { opacity: .6; }
.news-card.expired .news-head .pill { display: inline-flex; }
.news-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.news-head .ttl { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-head .pill { display: none; }
.news-body { padding: 12px 12px 2px; }
.news-body .grid2 { gap: 0 8px; }
.news-body .field { margin-bottom: 10px; }
.label-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 10px; }
.label-chips button { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 12px; color: var(--ink-2); cursor: pointer; }
.label-chips button:hover { border-color: var(--line-strong); color: var(--ink); }

/* ---------- Canevas ---------- */
.stage { position: relative; min-height: 0; display: flex; flex-direction: column; background-color: var(--bg-soft); background-image: radial-gradient(color-mix(in srgb, var(--ink) 13%, transparent) 1px, transparent 1.2px); background-size: 20px 20px; }
.stage-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 18px; flex-wrap: wrap; }
.stage-bar .seg { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.hint-click { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); background: var(--bg); padding: 5px 10px; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); }
.hint-click svg { width: 14px; height: 14px; }
.canvas { flex: 1; min-height: 0; overflow: auto; padding: 8px 28px 40px; }
.mail-wrap { display: flex; justify-content: center; }
.mail { width: 100%; max-width: 760px; background: #FFFFFF; color: #1F2328; border-radius: 16px; border: 1px solid var(--line-strong); overflow: hidden; transition: max-width .25s ease; }
.mail-wrap.mobile .mail { max-width: 380px; }
.mail-head { padding: 12px 18px 10px; border-bottom: 1px solid #EEEEEC; font-size: 13.5px; color: #3F3F3C; font-family: var(--font); }
.mail-dots { display: flex; gap: 6px; margin-bottom: 10px; }
.mail-dots i { width: 10px; height: 10px; border-radius: 50%; background: #E2E2DF; }
.mail-line { padding: 3px 0; display: flex; gap: 12px; }
.mail-line span { width: 44px; color: #9A9A95; }
.mail-body { padding: 18px 22px 26px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6; color: #1F2328; }
.mail-body > p { margin: 0 0 10px; }
.mail-body > p:last-of-type { margin-bottom: 18px; }
.preview { overflow-x: auto; }
.preview [data-edit] { cursor: pointer; border-radius: 4px; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .12s, background .12s; }
.preview [data-edit]:hover { outline-color: rgba(47, 111, 235, .55); background: rgba(47, 111, 235, .05); }
.preview [data-edit].is-editing { outline-color: #2F6FEB; background: rgba(47, 111, 235, .07); }
.preview .empty-sig { padding: 22px; border: 1px dashed #D6D6D2; border-radius: 12px; color: #8A8A85; text-align: center; font-family: var(--font); }
.mail-wrap.dark .mail { background: #1E1F20; border-color: #333; }
.mail-wrap.dark .mail-head { border-color: #333; color: #CFCFCB; }
.mail-wrap.dark .mail-body { color: #E6E6E3; }
.mail-wrap.dark .mail-line span { color: #888; }
.mail-wrap.dark .mail-dots i { background: #3A3A3A; }
.mail-wrap.dark .preview { filter: invert(1) hue-rotate(180deg); }
.mail-wrap.dark .preview img { filter: invert(1) hue-rotate(180deg); }
.stage-toggle { display: none; }

/* Vérifications */
.checks { max-width: 760px; margin: 12px auto 0; display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.check .ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.check.ok .ico { background: var(--ok-soft); color: var(--ok); }
.check.warn .ico { background: var(--warn-soft); color: var(--warn); }
.check .act { margin-left: auto; flex: none; }
.check b { color: var(--ink); }

/* Bulle d'édition directe */
.pop { position: absolute; z-index: 15; width: 320px; padding: 14px; background: var(--bg); border-radius: 14px; box-shadow: var(--pop); animation: rise .16s ease; }
.pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pop-head b { flex: 1; font-size: 14px; }
.pop .field { margin-bottom: 10px; }
.pop .pop-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pop .pop-foot a { font-size: 13px; color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; margin-right: auto; }
.pop .thumbs button { width: 36px; height: 36px; }

/* ---------- Installation ---------- */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.client { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; text-align: left; }
.client:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.client .logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; flex: none; background: var(--bg-sunk); color: var(--ink-2); }
.client b { display: block; font-size: 14.5px; }
.client small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.client .done { margin-left: auto; }
.install-intro { margin-bottom: 14px; color: var(--ink-2); }
.install-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.install-top .meta { color: var(--ink-3); font-size: 13.5px; }
.progress { height: 6px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden; margin: 0 0 16px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .25s ease; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step .num { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; background: var(--bg); transition: background .15s, border-color .15s; }
.step.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .txt, .step.done .txt b { color: var(--ink-3); }
.step .txt { font-size: 14.5px; line-height: 1.55; padding-top: 3px; }
.step .txt b { color: var(--ink); font-weight: 600; }
.step .act { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.k { display: inline-block; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--bg-soft); font-size: 12.5px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.counter { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); font-size: 13.5px; margin-bottom: 14px; }
.counter .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.counter .bar i { display: block; height: 100%; background: var(--ok); }
.counter.warn .bar i { background: var(--warn); }
.counter.over .bar i { background: var(--danger); }
.pitfalls { margin-top: 18px; }
.pitfalls h4 { font-family: var(--font); font-size: 13px; color: var(--ink-3); margin: 0 0 8px; }
.pitfalls ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pitfalls li { padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); font-size: 13.5px; color: var(--ink-2); }
.finish { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Partage et compte */
.lead { color: var(--ink-2); margin-bottom: 14px; }
.share-row { display: flex; gap: 8px; }
.share-row .input { flex: 1; min-width: 0; height: 36px; }
.soon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.soon-list li { display: flex; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.soon-list li:first-child { border-top: 0; }
.soon-list b { color: var(--ink); }
.soon-ico { font-size: 20px; width: 28px; flex: none; text-align: center; }
.small-sheet { width: min(420px, 100%) !important; }
.code-view { max-height: 220px; overflow: auto; padding: 12px; border-radius: 10px; background: var(--bg-sunk); font: 12px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); }

@media (max-width: 1180px) { .account-pill { display: none; } }

/* ---------- Téléphone et tablette étroite ---------- */
@media (max-width: 860px) {
  .hide-sm { display: none !important; }
  .only-sm { display: flex; }
  .menu-sep.only-sm { display: block; }
  .brand span:not(.pill) { display: none; }
  .sig-current { max-width: 160px; padding: 0 8px; }

  .workspace { display: flex; flex-direction: column; }
  /* Aperçu toujours visible en haut, réductible */
  .stage { order: 1; flex: none; max-height: 42vh; border-bottom: 1px solid var(--line); background-size: 16px 16px; }
  .stage-bar, .checks, .mail-head, .mail-body > p { display: none; }
  .canvas { padding: 12px 12px 6px; }
  .mail { border-radius: 12px; max-width: none; }
  .mail-body { padding: 14px; }
  .preview { overflow: visible; }
  .stage-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; height: 34px; border: 0; background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .stage-toggle .grip { width: 34px; height: 4px; border-radius: 99px; background: var(--line-strong); }
  .stage.collapsed .canvas { display: none; }
  .stage.collapsed { max-height: none; }

  .panel { order: 2; flex: 1; min-height: 0; border-right: 0; }
  .panel-scroll { padding: 0 16px; }
  .tab-pane { padding-top: 16px; }
  .pane-head h2 { font-size: 21px; }
  .pane-head .step-n { display: none; }
  .pane-next { padding: 12px 0 10px; }
  .pane-next .btn.big { height: 44px; font-size: 15px; }

  /* Barre d'outils en bas */
  .rail { order: 3; flex-direction: row; gap: 2px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .rail-btn { flex: 1 1 0; min-width: 48px; height: 54px; font-size: 10.5px; border-radius: 10px; padding: 0 2px; }
  .rail-btn svg { width: 21px; height: 21px; }
  .rail-btn[data-tab="plus"] { margin-top: 0; }
  .rail-btn .tick { top: 5px; right: calc(50% - 20px); width: 12px; height: 12px; }
  .rail-btn .tick::after { left: 3.6px; top: 1.8px; height: 5px; }

  /* La bulle devient une feuille en bas */
  .pop { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: calc(70px + env(safe-area-inset-bottom)); width: auto; max-height: 55vh; overflow: auto; }
}
@media (max-width: 480px) {
  .topbar { gap: 4px; padding: 0 8px; }
  .brand .pill { display: none; }
  .undo-group { display: none; }
  .hide-xs { display: none; }
  .show-xs { display: inline; }
  .grid2 { grid-template-columns: 1fr; }
  .social-row { grid-template-columns: 104px 1fr auto; }
  .font-btn b { font-size: 17px; }
  .menu { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; }
  .themes { gap: 8px; }
  .theme-card .mini { height: 96px; }
  .theme-card .mini > div { transform: scale(.34); }
}

/* Cartes de réglages */
.card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 4px; margin: 0 0 12px; background: var(--bg); }
.card-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.card-head .ci { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--bg-sunk); color: var(--ink-2); display: grid; place-items: center; }
.card-head .ci svg { width: 17px; height: 17px; }
.card-head b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.card-head small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.card .field:last-child, .card .line-setting:last-child { margin-bottom: 12px; }
.card .choices:last-child, .card .fonts:last-child, .card .swatches:last-child { margin-bottom: 12px; }
.card .swatches { margin-bottom: 4px; }
.card > .note:last-child { margin-bottom: 12px; }
.sec-title .ci { display: none; }

/* Exemple pré-rempli (2.3) */
.exemple-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); }
.exemple-banner .eb-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--bg); color: var(--accent); display: grid; place-items: center; }
.exemple-banner .eb-ico svg { width: 16px; height: 16px; }
.exemple-banner div { flex: 1; min-width: 0; }
.exemple-banner b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.exemple-banner small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.exemple-banner .btn { flex: none; }
.field.exemple input { color: var(--ink-2); }
.theme-card .who { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }

/* ================= Mode libre (2.4) ================= */
.rail-btn .rail-new { position: absolute; top: 9px; right: 14px; width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--accent); font-size: 0; color: transparent; overflow: hidden; }
.rail-btn.done .rail-new, .rail-btn[aria-selected="true"] .rail-new { display: none; }
.libre-note { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.libre-note span { flex: 1; }
.libre-start { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); text-align: left; cursor: pointer; margin-bottom: 8px; transition: border-color .15s, transform .12s; }
.libre-start:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.libre-start .ls-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.libre-start .ls-ico svg { width: 19px; height: 19px; }
.libre-start b { display: block; font-size: 14px; font-weight: 600; }
.libre-start small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.compos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compos.small { margin: 10px 0; }
.compo { display: flex; flex-direction: column; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; text-align: left; color: var(--ink); transition: border-color .15s, transform .12s; }
.compo:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.compo .mini { height: 120px; overflow: hidden; border-radius: 9px; background: #fff; position: relative; pointer-events: none; }
.compo .mini > div { position: absolute; top: 10px; left: 10px; transform: scale(.36); transform-origin: top left; width: 600px; }
.compo b { font-size: 13px; font-weight: 600; padding: 0 3px; }
.compo small { font-size: 11.5px; color: var(--ink-3); padding: 0 3px 3px; line-height: 1.35; }
.blocs-bar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; position: sticky; top: -1px; z-index: 3; background: var(--bg); padding: 8px 0; }
.quit-libre { margin-top: 10px; }
.cq-props textarea.input { height: auto; min-height: 64px; padding: 9px 11px; line-height: 1.45; resize: vertical; }
.item-row .input { height: 34px; }
.palette { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); padding: 12px; margin: 0 0 12px; box-shadow: var(--pop); }
.palette .pal-cible { font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px; }
.palette .pal-cat { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 6px; }
.palette .pal-cat:first-of-type { margin-top: 0; }
.palette .pal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.palette .pal-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); cursor: pointer; font-size: 12.5px; font-weight: 500; text-align: left; line-height: 1.2; }
.palette .pal-item:hover { border-color: var(--ink-4); background: var(--bg-soft); }
.palette .pal-item svg { width: 18px; height: 18px; color: var(--ink-2); }
.calques { display: flex; flex-direction: column; gap: 4px; }
.calque { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px calc(6px + var(--niv, 0) * 18px); border: 1px solid var(--line); border-radius: 10px; background: var(--bg); position: relative; }
.calque.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.calque.cache .cq-nom, .calque.cache .cq-ico { opacity: .45; }
.calque.drag { opacity: .4; }
.calque.avant::before, .calque.apres::after { content: ''; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--accent); border-radius: 2px; }
.calque.avant::before { top: -4px; } .calque.apres::after { bottom: -4px; }
.cq-poignee { flex: none; width: 16px; color: var(--ink-4); cursor: grab; display: grid; place-items: center; }
.cq-poignee svg { width: 12px; height: 12px; }
.cq-tete { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 4px; border: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.cq-ico { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--bg-sunk); color: var(--ink-2); display: grid; place-items: center; }
.cq-ico svg { width: 15px; height: 15px; }
.cq-nom { font-size: 13px; font-weight: 600; white-space: nowrap; }
.cq-resume { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cq-outils { flex: none; display: flex; gap: 0; opacity: .55; transition: opacity .15s; }
.calque:hover .cq-outils, .calque.sel .cq-outils { opacity: 1; }
.cq-outils button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.cq-outils button:hover { background: var(--bg-sunk); color: var(--ink); }
.cq-outils button:disabled { opacity: .3; cursor: default; }
.cq-outils svg { width: 14px; height: 14px; }
.cq-slot { margin-left: calc(6px + var(--niv, 0) * 18px); display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; text-align: left; }
.cq-slot:hover, .cq-slot.cible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cq-props { margin: 2px 0 8px calc(6px + var(--niv, 0) * 18px); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.cq-props .aide { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cq-props .prop > .label { display: block; margin-bottom: 6px; }
.cq-props .prop input[type="text"], .cq-props .prop input[type="url"], .cq-props .prop textarea { width: 100%; }
.cq-props .prop textarea { min-height: 64px; resize: vertical; }
.cq-props .prop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cq-props .range-row { display: flex; align-items: center; gap: 10px; }
.cq-props .range-row input { flex: 1; }
.cq-props .range-row b { font-size: 12px; font-weight: 600; min-width: 42px; text-align: right; color: var(--ink-2); }
.coul-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coul-picks button { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); cursor: pointer; position: relative; padding: 0; }
.coul-picks button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.coul-picks button.tok { width: auto; height: 24px; border-radius: 999px; padding: 0 9px 0 22px; font-size: 11.5px; color: var(--ink); background: var(--bg); text-align: left; }
.coul-picks button.tok i { position: absolute; left: 5px; top: 5px; width: 12px; height: 12px; border-radius: 50%; }
.coul-picks label.rainbow { width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); cursor: pointer; position: relative; overflow: hidden; }
.coul-picks label.rainbow input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.items-ed { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px; align-items: center; }
.item-row .em { text-align: center; padding-left: 4px; padding-right: 4px; }
.item-row .url { grid-column: 2 / 3; }
.item-row .tools { display: flex; }
.item-row .tools button { width: 24px; height: 28px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 6px; }
.item-row .tools button:hover { background: var(--bg-sunk); color: var(--ink); }
.compat { margin-top: 12px; }
.compat .compat-item { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); padding: 8px 10px; border-radius: 10px; background: var(--bg-sunk); margin-bottom: 6px; line-height: 1.4; }
#preview [data-bloc] { cursor: pointer; transition: outline-color .12s; outline: 1px dashed transparent; outline-offset: 2px; }
#preview [data-bloc]:hover { outline-color: rgba(47, 111, 235, .45); }
#preview [data-bloc].is-sel { outline: 2px solid #2F6FEB; outline-offset: 2px; }
kbd { font: 600 11px var(--font); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink-2); }
@media (max-width: 860px) {
  .palette .pal-grid { grid-template-columns: repeat(2, 1fr); }
  .rail-btn .rail-new { display: none; }
}

/* Plusieurs actus (2.5.1) */
.news-hidden { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--warn-soft); color: var(--ink-2); font-size: 12.5px; }
.news-card.masquee { border-style: dashed; }
.add-news { width: 100%; justify-content: center; margin-top: 8px; border-style: dashed; }
