/* Rayor Docs — habillage « Style Suisse » (régénéré depuis app.css legacy).
   Encre/papier + rouge unique, Helvetica grotesque, radius 0, aplats, inversion.
   NB : seul le CHROME est suissifié — la page-document (.doc-page) garde ses
   couleurs fonctionnelles d'éditeur (papier blanc/encre, surlignages, commentaires). */
:root {
  --bg: #f4f4f4;
  --panel: #ffffff;
  --ink: #0a0a0a;
  --muted: rgba(10,10,10,.58);
  --line: rgba(10,10,10,.14);
  --accent: #8e0004;
  --accent-soft: #f4f4f4;
  --shadow: none;
  --doc-blue: #4285f4;
  --slides-amber: #f4b400;
  --sheet-green: #0f9d58;
  --hover: #f4f4f4;
}
[data-theme="dark"] {
  --bg: #0b0b0c;
  --panel: #101013;
  --ink: #f4f4f4;
  --muted: rgba(244,244,244,.62);
  --line: rgba(255,255,255,.16);
  --accent: #e23b3f;
  --accent-soft: #141417;
  --shadow: none;
  --hover: #141417;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--accent); }
button { font-family: inherit; }
[hidden] { display: none !important; }

.btn {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--ink); padding: 8px 16px; font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
[data-theme="dark"] .btn-primary { color: #131314; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 10px; }
.w100 { width: 100%; margin-top: 8px; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; font-size: 17px;
  width: 38px; height: 38px; border-radius: 50%; color: var(--muted);
}
.icon-btn:hover { background: var(--hover); }
.muted { color: var(--muted); }

.doc-c    { background: var(--doc-blue); }
.slides-c { background: var(--slides-amber); }
.sheet-c  { background: var(--sheet-green); }

/* ============ Landing ============ */
.landing { display: flex; min-height: 100vh; align-items: center; justify-content: center; text-align: center; }
.land-wrap { max-width: 860px; padding: 48px 20px; }
.land-logo { display: flex; align-items: center; justify-content: center; gap: 14px; }
.land-logo img { border-radius: 14px; }
.land-logo h1 { font-size: 38px; margin: 0; font-weight: 400; }
.land-logo h1 span { color: var(--accent); font-weight: 700; }
.land-tag { color: var(--muted); font-size: 17px; line-height: 1.6; margin: 18px 0 28px; }
.land-cards { display: flex; gap: 16px; margin-top: 44px; flex-wrap: wrap; justify-content: center; }
.land-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: 240px; text-align: left; box-shadow: var(--shadow);
}
.land-card h3 { margin: 12px 0 6px; }
.land-card p { color: var(--muted); margin: 0; line-height: 1.5; }
.lc-ico {
  width: 46px; height: 46px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 24px; color: #fff;
}
.land-foot { margin-top: 42px; color: var(--muted); font-size: 13px; }

/* ============ Barre du haut (accueil) ============ */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 8px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 20px; }
.brand img { border-radius: 8px; }
.brand b { color: var(--accent); }
.search {
  flex: 1; max-width: 640px; display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 24px; padding: 9px 18px; color: var(--muted);
}
.search input { flex: 1; border: 0; background: transparent; outline: 0; font-size: 15px; color: var(--ink); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; overflow: hidden;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Accueil ============ */
.home-body { display: flex; min-height: calc(100vh - 57px); }
.sidenav { width: 232px; padding: 16px 10px; flex-shrink: 0; }
.newbtn {
  display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 14px;
  padding: 13px 20px; font-size: 15px; cursor: pointer; margin-bottom: 16px; color: var(--ink);
}
.newbtn:hover { background: var(--hover); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-radius: 0 20px 20px 0;
  color: var(--ink); text-decoration: none; margin-bottom: 2px; font-size: 14px;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.files { flex: 1; padding: 22px 28px; max-width: 1280px; }
.create-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.create-card {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; cursor: pointer;
  color: var(--ink); text-align: left; min-width: 210px;
}
.create-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.create-card small { color: var(--muted); display: block; }
.cc-ico {
  width: 40px; height: 40px; border-radius: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.files-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.files-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; position: relative; outline-color: var(--accent);
}
.card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.card-prev { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 42px; opacity: .92; }
.card-meta { padding: 10px 12px; }
.card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-more {
  position: absolute; top: 6px; right: 6px; border: 0; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; background: rgba(255,255,255,.85); color: #333; font-size: 16px;
}
.card-more:hover { background: #fff; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; font-size: 15px; }

.ctx, .dropdown {
  position: absolute; z-index: 200; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.18); padding: 6px; min-width: 220px;
}
.dropdown { position: fixed; }
.ctx button, .dropdown button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ink);
}
.ctx button:hover, .dropdown button:hover:not(:disabled) { background: var(--hover); }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* ============ Éditeur : entête ============ */
.ed-top {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.ed-logo {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 21px; text-decoration: none; flex-shrink: 0; color: #fff;
}
.ed-meta { flex: 1; min-width: 0; }
.ed-titlerow { display: flex; align-items: center; gap: 6px; }
#docTitle {
  font-size: 17px; border: 1px solid transparent; border-radius: 6px; padding: 3px 8px;
  background: transparent; color: var(--ink); min-width: 80px; max-width: 420px; width: 100%;
}
#docTitle:hover { border-color: var(--line); }
#docTitle:focus { border-color: var(--accent); outline: 0; }
.ed-titlerow .icon-btn { width: 30px; height: 30px; font-size: 15px; }
.ed-titlerow .icon-btn.on { color: #f4b400; }
.save-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-state.ok { color: var(--sheet-green); }
.save-state.err { color: #d93025; }
.ed-menubar { display: flex; gap: 2px; margin-top: 2px; }
.ed-menubar button {
  border: 0; background: transparent; padding: 3px 10px; border-radius: 6px;
  cursor: pointer; color: var(--muted); font-size: 13px;
}
.ed-menubar button:hover { background: var(--hover); }
.ed-right { display: flex; align-items: center; gap: 10px; }
.ro-badge {
  background: var(--hover); color: var(--muted); border-radius: 14px;
  padding: 4px 12px; font-size: 12px; white-space: nowrap;
}
.presence { display: flex; gap: 4px; }
.pres {
  width: 32px; height: 32px; border-radius: 50%; position: relative;
  border: 2px solid var(--pc, var(--accent)); overflow: visible; display: block;
}
.pres img, .pres i {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: flex;
  align-items: center; justify-content: center; font-style: normal; background: var(--pc); color: #fff; font-size: 13px;
}
.pres-edit {
  position: absolute; bottom: -4px; right: -4px; background: var(--pc); color: #fff;
  border-radius: 50%; width: 15px; height: 15px; font-size: 9px; display: flex;
  align-items: center; justify-content: center; font-weight: 400;
}

/* ============ Barre d'outils ============ */
.toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 57px; z-index: 55;
}
.toolbar button {
  border: 0; background: transparent; min-width: 32px; height: 30px; border-radius: 6px;
  cursor: pointer; font-size: 14px; color: var(--ink); padding: 0 7px;
}
.toolbar button:hover { background: var(--hover); }
.toolbar button.act { background: var(--accent-soft); color: var(--accent); }
.toolbar select {
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
  color: var(--ink); height: 30px; padding: 0 6px; font-size: 13px;
}
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.tb-color {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.tb-color:hover { background: var(--hover); }
.tb-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.readonly .toolbar { opacity: .55; pointer-events: none; }
body.readonly.type-sheet .toolbar { opacity: 1; pointer-events: auto; } /* barre de formule lisible */
body.readonly #fxInput { pointer-events: auto; }

/* ============ Éditeur de texte (façon Google Docs) ============ */
.doc-stage {
  padding: 32px 12px 110px; display: flex; justify-content: center; position: relative;
  background: var(--bg); transition: padding-right .18s ease;
}
body.with-comments .doc-stage { padding-right: 320px; }
.doc-zoom { transform-origin: top center; }
.doc-page {
  background: #fff; color: #202124; width: 816px; max-width: 100%; min-height: 1056px;
  box-shadow: 0 1px 3px rgba(60,64,67,.24), 0 6px 18px rgba(60,64,67,.08);
  border: 1px solid #e6e7e9; border-radius: 2px;
  padding: 96px 96px; outline: 0; line-height: 1.5;
  font-family: Arial, Helvetica, "Segoe UI", Roboto, sans-serif; font-size: 11pt;
}
[data-theme="dark"] .doc-page { background: #1e1f20; color: #e8eaed; border-color: #2c2d2f; }
.doc-page h1 { font-size: 20pt; font-weight: 400; margin: 20px 0 6px; line-height: 1.2; }
.doc-page h2 { font-size: 16pt; font-weight: 400; margin: 18px 0 4px; line-height: 1.2; }
.doc-page h3 { font-size: 14pt; font-weight: 400; color: #434343; margin: 16px 0 4px; line-height: 1.2; }
.doc-page h4 { font-size: 12pt; font-weight: 700; color: #666; margin: 14px 0 4px; }
[data-theme="dark"] .doc-page h3 { color: #c0c4c9; }
[data-theme="dark"] .doc-page h4 { color: #9aa0a6; }
.doc-page .dt-title { font-size: 26pt; font-weight: 400; margin: 0 0 2px; line-height: 1.15; }
.doc-page .dt-subtitle { font-size: 15pt; font-weight: 400; color: #666; margin: 0 0 14px; }
[data-theme="dark"] .doc-page .dt-subtitle { color: #9aa0a6; }
.doc-page p { margin: 0; }
.doc-page img { max-width: 100%; }
.doc-page a { color: #1155cc; }
[data-theme="dark"] .doc-page a { color: #8ab4f8; }
.doc-page blockquote { border-left: 3px solid #dadce0; margin: 6px 0; padding: 2px 16px; color: #5f6368; }
.doc-page pre { background: #f1f3f4; border-radius: 8px; padding: 12px; overflow: auto; font-size: 10.5pt; font-family: "Roboto Mono", ui-monospace, Consolas, monospace; }
[data-theme="dark"] .doc-page pre { background: #28292a; }
.doc-page ul, .doc-page ol { margin: 0; padding-left: 28px; }
/* Listes de tâches */
.doc-page ul.doc-check { list-style: none; padding-left: 4px; }
.doc-page ul.doc-check > li { position: relative; padding-left: 28px; margin: 2px 0; }
.doc-page ul.doc-check > li::before {
  content: ""; position: absolute; left: 2px; top: .2em; width: 15px; height: 15px;
  border: 1.5px solid #80868b; border-radius: 3px; cursor: pointer; box-sizing: border-box;
}
.doc-page ul.doc-check > li[data-done="1"] { color: #80868b; text-decoration: line-through; }
.doc-page ul.doc-check > li[data-done="1"]::before {
  content: "✓"; border-color: #1a73e8; background: #1a73e8; color: #fff;
  font-size: 12px; line-height: 13px; text-align: center; font-weight: 700;
}
/* Tableaux */
.doc-page table.doc-table { border-collapse: collapse; margin: 8px 0; }
.doc-page table.doc-table td, .doc-page table.doc-table th {
  border: 1px solid #bdc1c6; padding: 5px 9px; min-width: 42px; vertical-align: top;
}
[data-theme="dark"] .doc-page table.doc-table td { border-color: #5f6368; }
/* Saut de page */
.doc-page .page-break {
  height: 0; border-top: 1px dashed #bdc1c6; margin: 26px -96px; position: relative;
}
.doc-page .page-break::after {
  content: "Saut de page"; position: absolute; right: 100px; top: -9px; font-size: 10px;
  color: #9aa0a6; background: #fff; padding: 0 6px;
}
[data-theme="dark"] .doc-page .page-break::after { background: #1e1f20; }
/* Ancres de commentaires */
.doc-page .cmt { background: #fff2a8; border-bottom: 2px solid #f9c513; cursor: pointer; }
.doc-page .cmt.cmt-focus { background: #ffe066; }
.doc-page .cmt.cmt-draft { background: #fde293; }
[data-theme="dark"] .doc-page .cmt { background: #5c5219; border-bottom-color: #c9a227; color: #f5e6a8; }
/* Surlignage Rechercher (API CSS Custom Highlight) */
::highlight(rc-find) { background: #fff176; color: #202124; }
::highlight(rc-find-cur) { background: #f9ab00; color: #202124; }
.doc-page.painting { cursor: copy; }

.doc-foot {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 6px 18px;
  background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
  display: flex; gap: 16px; z-index: 40;
}

/* ============ Icônes (sprite SVG) ============ */
.ic-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; display: inline-block; vertical-align: middle; pointer-events: none; flex: none; }
.fb-nav .ic, .fb-x .ic, .ol-x .ic, .cp-x .ic, .ct-reply-b .ic, .ct-resolve .ic { width: 16px; height: 16px; }
.modal-x .ic { width: 15px; height: 15px; }

/* ============ Barre d'outils document (Google Docs) ============ */
.gdoc-tb { justify-content: center; gap: 1px; padding: 5px 12px; }
.gdoc-tb .tb-btn {
  border: 0; background: transparent; min-width: 30px; height: 30px; border-radius: 5px;
  cursor: pointer; font-size: 14px; color: var(--ink); padding: 0 5px; display: inline-flex;
  align-items: center; justify-content: center;
}
.gdoc-tb .tb-btn:hover { background: var(--hover); }
.gdoc-tb .tb-btn.act { background: var(--accent-soft); color: var(--accent); }
.gdoc-tb .tb-zoom { width: 66px; }
.gdoc-tb .tb-style { width: 122px; }
.gdoc-tb .tb-font { width: 124px; }
.gdoc-tb select { height: 30px; }
.tb-fs { display: inline-flex; align-items: center; gap: 1px; }
.tb-fs .fs-step { font-size: 18px; min-width: 24px; line-height: 1; }
.tb-fsnum {
  width: 38px; height: 28px; text-align: center; border: 1px solid var(--line);
  border-radius: 5px; background: var(--panel); color: var(--ink); font-size: 13px;
}
.tb-fsnum:focus { border-color: var(--accent); outline: 0; }
.gdoc-tb .tb-color { flex-direction: column; gap: 0; min-width: 30px; height: 30px; padding-top: 4px; }
.tbc-ico { width: 17px; height: 16px; }
.tbc-bar { width: 18px; height: 4px; border-radius: 1px; background: #202124; margin-top: 1px; }
.has-caret { padding: 0 3px; }
.has-caret .cv { width: 11px; height: 11px; margin-left: -1px; color: var(--muted); }
#commentBtn { position: relative; }
#commentBtn.has-n::after {
  content: attr(data-n); position: absolute; top: -1px; right: -1px; background: var(--accent);
  color: #fff; font-size: 9px; min-width: 14px; height: 14px; line-height: 14px; border-radius: 7px;
  padding: 0 3px; font-weight: 700;
}
[data-theme="dark"] #commentBtn.has-n::after { color: #131314; }

/* ============ Rechercher et remplacer ============ */
.find-bar {
  position: fixed; top: 104px; right: 22px; z-index: 120; display: flex; gap: 8px;
  align-items: flex-start; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.2); padding: 10px 12px;
}
.fb-fields { display: flex; flex-direction: column; gap: 8px; }
.fb-row { display: flex; align-items: center; gap: 6px; }
.fb-row input {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; font-size: 13px;
  background: var(--bg); color: var(--ink); width: 220px;
}
.fb-row input:focus { border-color: var(--accent); outline: 0; }
.fb-count { font-size: 12px; color: var(--muted); min-width: 56px; text-align: center; }
.fb-nav { border: 0; background: transparent; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); font-size: 11px; }
.fb-nav:hover { background: var(--hover); }
.fb-act { padding: 6px 12px; font-size: 13px; }
.fb-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 14px; width: 28px; height: 28px; border-radius: 6px; }
.fb-x:hover { background: var(--hover); }

/* ============ Plan du document ============ */
.doc-outline {
  position: fixed; left: 0; top: 99px; bottom: 0; width: 252px; background: var(--panel);
  border-right: 1px solid var(--line); padding: 14px 12px 20px 16px; overflow-y: auto; z-index: 45;
}
.ol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.ol-x, .cp-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 26px; height: 26px; border-radius: 50%; }
.ol-x:hover, .cp-x:hover { background: var(--hover); }
.ol-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink);
  padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; border-left: 2px solid transparent;
}
.ol-item:hover { background: var(--hover); border-left-color: var(--accent); }
.ol-l0 { font-weight: 600; }
.ol-l1 { padding-left: 8px; }
.ol-l2 { padding-left: 22px; color: var(--muted); }
.ol-l3 { padding-left: 36px; color: var(--muted); }
.ol-l4 { padding-left: 50px; color: var(--muted); }
.ol-empty { color: var(--muted); font-size: 13px; padding: 8px; line-height: 1.5; }
.outline-toggle {
  position: fixed; left: 14px; top: 116px; z-index: 44; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer;
  box-shadow: var(--shadow); font-size: 15px;
}
.outline-toggle:hover { background: var(--hover); }

/* ============ Volet de commentaires ============ */
.comments-panel {
  position: fixed; right: 0; top: 99px; bottom: 0; width: 304px; background: var(--panel);
  border-left: 1px solid var(--line); overflow-y: auto; z-index: 45; padding: 12px;
}
.cp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cmt-thread {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer;
}
.cmt-thread.cmt-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ct-quote {
  border-left: 3px solid #f9c513; background: #fff8db; color: #5f6368; font-size: 12px;
  padding: 3px 8px; border-radius: 0 6px 6px 0; margin-bottom: 8px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
[data-theme="dark"] .ct-quote { background: #3a3413; color: #c9cdd2; }
.ct-main b, .ct-reply b { font-size: 13px; }
.ct-main small, .ct-reply small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.ct-main p, .ct-reply p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.ct-reply { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ct-input {
  width: 100%; min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  font-family: inherit; font-size: 13px; background: var(--panel); color: var(--ink); resize: vertical; margin: 6px 0;
}
.ct-actions { display: flex; gap: 8px; }
.ct-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.ct-replyin { flex: 1; border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px; font-size: 12px; background: var(--panel); color: var(--ink); }
.ct-reply-b { border: 0; background: var(--accent); color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.ct-resolve { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 16px; padding: 5px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.ct-resolve:hover { background: var(--hover); color: var(--sheet-green); }

/* ============ Statistiques (nombre de mots) ============ */
.wc-box { max-width: 360px; }
.wc-table { width: 100%; border-collapse: collapse; }
.wc-table td { padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.wc-table td:last-child { text-align: right; font-weight: 600; }
.wc-table tr:last-child td { border-bottom: 0; }

/* ============ Barre contextuelle de tableau ============ */
.table-bar {
  position: absolute; z-index: 120; display: flex; gap: 2px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 14px rgba(0,0,0,.2); padding: 3px;
}
.table-bar button { border: 0; background: transparent; padding: 5px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--ink); }
.table-bar button:hover { background: var(--hover); }

/* ============ Puce de lien ============ */
.link-chip {
  position: fixed; z-index: 130; display: flex; align-items: center; gap: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.22);
  padding: 6px 8px; max-width: 380px; font-size: 13px;
}
.lc-url { color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.lc-url:hover { text-decoration: underline; }
.lc-b { border: 0; background: transparent; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.lc-b:hover { background: var(--hover); }

/* ============ Présentations ============ */
.slides-stage { display: flex; height: calc(100vh - 102px); }
.filmstrip {
  width: 186px; overflow-y: auto; padding: 14px 10px; border-right: 1px solid var(--line);
  background: var(--panel); flex-shrink: 0;
}
.thumb { margin-bottom: 12px; cursor: pointer; display: flex; gap: 6px; align-items: flex-start; }
.th-num { color: var(--muted); font-size: 11px; width: 14px; padding-top: 2px; }
.th-box {
  width: 148px; height: 83px; border: 2px solid var(--line); border-radius: 4px;
  overflow: hidden; position: relative; background: #fff;
}
.thumb.active .th-box { border-color: var(--accent); }
.canvas-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 26px; overflow: auto; }
.slide-canvas {
  width: min(92%, 920px); aspect-ratio: 16/9; position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,.22); border-radius: 4px; overflow: hidden; background: #fff;
}
.slide-inner { position: absolute; inset: 0; }
.sl-el { position: absolute; user-select: none; }
.slide-canvas .sl-el { cursor: move; }
.sl-text { white-space: pre-wrap; overflow: hidden; line-height: 1.25; padding: 2px; }
.sl-el img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sl-el.selected { outline: 2px solid var(--accent); }
.sl-el.editing { cursor: text; user-select: text; outline: 2px dashed var(--accent); }
.sl-handle {
  position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%; cursor: nwse-resize; display: none;
}
.sl-el.selected .sl-handle { display: block; }
.th-box .sl-handle { display: none; }
.present {
  position: fixed; inset: 0; background: #000; z-index: 500;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.present-slide { position: relative; overflow: hidden; }
.present-nav {
  position: fixed; bottom: 14px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.55); font-size: 13px;
}

/* ============ Tableur ============ */
.cellref {
  min-width: 52px; text-align: center; background: var(--hover); border-radius: 6px;
  padding: 6px 8px; font-weight: 600; font-size: 13px;
}
.fx { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--panel); color: var(--ink); min-width: 160px; }
.fx:focus { border-color: var(--accent); outline: 0; }
.sheet-stage { display: flex; flex-direction: column; height: calc(100vh - 102px); }
.sheet-scroll { flex: 1; overflow: auto; background: var(--panel); }
table.sheet { border-collapse: collapse; table-layout: fixed; }
.sheet th, .sheet td {
  border: 1px solid var(--line); font-weight: 400; font-size: 13px;
  padding: 0 6px; height: 24px; overflow: hidden; white-space: nowrap;
}
.sheet thead th {
  background: var(--bg); color: var(--muted); text-align: center; font-size: 11px;
  position: sticky; top: 0; z-index: 3; width: 96px; min-width: 96px;
}
.sheet tbody th {
  background: var(--bg); color: var(--muted); text-align: center; font-size: 11px;
  position: sticky; left: 0; z-index: 2; width: 44px; min-width: 44px;
}
.sheet .rc-corner { position: sticky; left: 0; top: 0; z-index: 4; width: 44px; min-width: 44px; }
.sheet td { background: var(--panel); color: var(--ink); cursor: cell; }
.sheet td.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet td.s-b { font-weight: 700; }
.sheet td.s-err { color: #d93025; font-weight: 600; }
.sheet td.editing { padding: 0; }
.cell-input {
  width: 100%; height: 100%; border: 0; outline: 2px solid var(--accent); outline-offset: -2px;
  padding: 0 6px; font-size: 13px; font-family: inherit; background: var(--panel); color: var(--ink);
}
.sheet-tabs {
  display: flex; gap: 2px; padding: 5px 10px; background: var(--panel);
  border-top: 1px solid var(--line); overflow-x: auto;
}
.stab, .stab-add {
  border: 0; background: transparent; padding: 6px 16px; border-radius: 8px 8px 0 0;
  cursor: pointer; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.stab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.stab:hover, .stab-add:hover { background: var(--hover); }

/* ============ Modales ============ */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-box {
  background: var(--panel); border-radius: 14px; padding: 22px; width: 100%;
  max-width: 480px; max-height: 86vh; overflow-y: auto; position: relative; box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.modal-box h3 { margin: 0 36px 16px 0; font-size: 17px; }
.modal-x {
  position: absolute; top: 12px; right: 12px; border: 0; background: transparent;
  font-size: 16px; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 50%;
}
.modal-x:hover { background: var(--hover); }
.me-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.me-head small { display: block; color: var(--muted); }
.me-avatar { width: 52px; height: 52px; border-radius: 50%; }

.share-add { display: flex; gap: 8px; margin-bottom: 14px; }
.share-add input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: var(--bg); color: var(--ink); }
.share-add select, .sl-row select, .sp-sel {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--panel); color: var(--ink); font-size: 13px;
}
.share-person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-person:last-child { border-bottom: 0; }
.sp-av {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; font-weight: 700;
}
.sp-av img { width: 100%; height: 100%; object-fit: cover; }
.sp-meta { flex: 1; min-width: 0; }
.sp-meta small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; }
.sp-role { color: var(--muted); font-size: 12px; }
.share-link { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-link small { color: var(--muted); }
.sl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sl-url { display: flex; gap: 8px; margin-bottom: 8px; }
.sl-url input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; background: var(--bg); color: var(--ink); }

.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: 0; }
.hist-row small { display: block; color: var(--muted); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; border-radius: 10px; padding: 11px 20px;
  font-size: 14px; z-index: 600; box-shadow: 0 4px 16px rgba(0,0,0,.3); max-width: 90vw;
}

/* ============ Collaboration temps réel ============ */
/* Présence cliquable (mode suivre) */
.pres { cursor: pointer; transition: transform .1s ease; }
.pres:hover { transform: scale(1.08); }
.pres.following { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--pc, var(--accent)); }

/* Bannière « Vous suivez X » */
.follow-banner {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--pc, var(--accent)); color: #fff; border-radius: 22px;
  padding: 7px 7px 7px 16px; display: flex; align-items: center; gap: 10px;
  z-index: 600; box-shadow: 0 6px 20px rgba(0,0,0,.32); font-size: 13px; font-weight: 500;
}
.follow-banner .fb-name { font-weight: 700; }
.follow-banner button {
  border: 0; background: rgba(255,255,255,.25); color: #fff; border-radius: 16px;
  padding: 5px 13px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.follow-banner button:hover { background: rgba(255,255,255,.4); }

/* Curseurs distants — éditeur de texte */
.rc-cursors { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 5; }
.rc-caret { position: absolute; width: 2px; z-index: 6; animation: rc-blink 1.1s step-end infinite; }
.rc-caret .rc-label {
  position: absolute; top: -15px; left: -1px; color: #fff; font-size: 10px; line-height: 1;
  padding: 2px 5px; border-radius: 4px 4px 4px 0; white-space: nowrap;
  font-family: "Segoe UI", Roboto, Arial, sans-serif; font-weight: 600;
}
.rc-sel { position: absolute; opacity: .2; border-radius: 2px; z-index: 5; }
@keyframes rc-blink { 50% { opacity: .35; } }

/* Cellules distantes — tableur */
.rc-cells { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.rc-cell { position: absolute; border: 2px solid var(--pc); box-sizing: border-box; }
.rc-celllab {
  position: absolute; top: -15px; left: -2px; color: #fff; font-size: 10px; line-height: 1;
  padding: 2px 5px; border-radius: 4px 4px 4px 0; white-space: nowrap; font-weight: 600;
}

/* Présentations — élément sélectionné par autrui + pastilles sur le film */
.rc-elname {
  position: absolute; top: -16px; left: -2px; color: #fff; font-size: 10px; line-height: 1;
  padding: 2px 5px; border-radius: 4px 4px 4px 0; white-space: nowrap; font-weight: 600; pointer-events: none;
}
.rc-thumbpres { display: flex; gap: 3px; margin-top: 3px; }
.rc-thumbpres i { width: 9px; height: 9px; border-radius: 50%; display: block; }

/* ============ Impression ============ */
@media print {
  .ed-top, .toolbar, .doc-foot, .filmstrip, .sheet-tabs, .modal, .dropdown, .toast,
  .rc-cursors, .rc-cells, .follow-banner, .find-bar, .doc-outline, .outline-toggle,
  .comments-panel, .table-bar, .link-chip { display: none !important; }
  body { background: #fff; }
  body.with-comments .doc-stage { padding-right: 0; }
  .doc-stage { padding: 0; }
  .doc-zoom { transform: none !important; margin: 0 !important; }
  .doc-page { box-shadow: none; border: 0; min-height: 0; padding: 0; max-width: none; width: 100%; }
  .doc-page .cmt { background: transparent; border: 0; }
  .doc-page .page-break { border: 0; margin: 0; page-break-after: always; }
  .doc-page .page-break::after { display: none; }
  .slides-stage { height: auto; display: block; }
  .canvas-wrap { padding: 0; display: block; }
  .slide-canvas { width: 100%; box-shadow: none; page-break-after: always; }
  .sheet-stage { height: auto; }
  .sheet-scroll { overflow: visible; }
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .sidenav { width: 64px; }
  .nav-item { justify-content: center; padding: 10px; border-radius: 12px; }
  .nav-item span + * { display: none; }
  .nav-item { font-size: 0; }
  .nav-item span { font-size: 17px; }
  .newbtn { padding: 12px; justify-content: center; font-size: 0; }
  .files { padding: 14px; }
  .doc-page { padding: 44px 24px; width: 100%; }
  .filmstrip { width: 120px; }
  .th-box { width: 86px; height: 48px; }
  .ed-menubar { display: none; }
  .search { display: none; }
  .brand span { display: none; }
  /* Plan et commentaires deviennent des panneaux superposés sur mobile */
  .doc-outline, .comments-panel { width: 84vw; max-width: 320px; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.with-comments .doc-stage { padding-right: 12px; }
  .gdoc-tb { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
  .gdoc-tb::-webkit-scrollbar { height: 0; }
  .find-bar { right: 8px; left: 8px; top: 96px; }
  .fb-row input { width: 100%; }
}

/* ============================================================
   RAYOR FORMS (additif — n'écrase aucune règle existante)
   ============================================================ */
:root { --form-purple: #7c4dff; }
[data-theme="dark"] { --form-purple: #b39ddb; }
.form-c { background: var(--form-purple); }

.plus-pill {
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
  background: linear-gradient(135deg, #7c4dff, #d500f9); color: #fff;
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.plus-pill:hover { filter: brightness(1.08); }

/* ---- En-tête éditeur : onglets de formulaire ---- */
.form-tabs { gap: 4px; }
.ftab {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 6px 12px; border-radius: 8px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.ftab:hover { background: var(--hover); }
.ftab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rcount {
  background: var(--form-purple); color: #fff; border-radius: 999px;
  font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ---- Zone centrale ---- */
.forms-main { background: var(--bg); min-height: calc(100vh - 64px); padding: 26px 16px 80px; }
.form-canvas { max-width: 760px; margin: 0 auto; }
.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); position: relative;
}
.form-header-card { padding-top: 26px; border-top: 6px solid var(--form-purple); }
.form-accent { display: none; }
.form-desc-input {
  width: 100%; border: 0; border-bottom: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 15px; resize: none; font-family: inherit; padding: 4px 0;
}
.form-desc-input:focus { outline: none; border-bottom-color: var(--accent); }

/* ---- Carte d'un champ ---- */
.field-card {
  display: flex; gap: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.field-card:focus-within { border-color: var(--accent); }
.field-drag {
  flex: 0 0 26px; color: var(--muted); cursor: default; text-align: center;
  padding-top: 18px; user-select: none; letter-spacing: -2px; font-size: 12px; opacity: .5;
}
.field-body { flex: 1; padding: 16px 18px 12px; min-width: 0; }
.field-row1 { display: flex; gap: 12px; align-items: flex-start; }
.field-label-input {
  flex: 1; font-size: 16px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--hover); border-radius: 6px 6px 0 0; padding: 9px 10px; color: var(--ink);
}
.field-label-input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.field-type-sel, .field-help-input, .form-text, .opt-input, .set-field textarea {
  font-family: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.field-type-sel { flex: 0 0 180px; }
.field-help-input { width: 100%; margin-top: 10px; color: var(--muted); }

.opts-editor { margin-top: 14px; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opt-mark { color: var(--muted); font-size: 16px; width: 16px; text-align: center; }
.opt-input { flex: 1; }
.opt-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px; }
.opt-del:hover { background: var(--hover); color: var(--accent); }
.opt-add { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 14px; padding: 6px 4px; }

.scale-editor { margin-top: 14px; }
.scale-editor label { color: var(--muted); font-size: 14px; }
.scale-editor select { font-family: inherit; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin: 0 4px; }
.scale-labels { display: flex; gap: 12px; margin-top: 10px; }
.scale-labels input { flex: 1; font-family: inherit; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; }

.cond-editor { margin-top: 14px; padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cond-editor select { font-family: inherit; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.cond-ico { color: var(--form-purple); font-weight: 700; }
.cond-locked { background: var(--hover); color: var(--muted); }

.field-foot { display: flex; align-items: center; gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.fbtn { border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--muted); padding: 6px 9px; border-radius: 6px; }
.fbtn:hover { background: var(--hover); color: var(--accent); }
.field-sep { flex: 1; }
.req-toggle { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.add-field-btn {
  width: 100%; border: 1.5px dashed var(--line); background: var(--panel); color: var(--accent);
  border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.add-field-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---- Réglages ---- */
.settings-card h3 { margin: 0 0 14px; font-size: 16px; }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 14px; }
.switch-row.sub { padding-left: 26px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.set-field { margin-top: 12px; }
.set-field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.set-field textarea { width: 100%; resize: vertical; }

/* ---- Résultats ---- */
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.results-total { font-size: 18px; }
.results-total b { font-size: 26px; color: var(--accent); }
.results-actions { display: flex; gap: 8px; }
.results-sub { margin: 26px 0 14px; }
.result-block h4 { margin: 0 0 4px; font-size: 16px; }
.result-meta { margin: 0 0 14px; font-size: 13px; }
.chart-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.pie { flex: 0 0 140px; }
.bars { flex: 1; min-width: 240px; }
.bar-row { display: grid; grid-template-columns: minmax(80px,160px) 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bar-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--hover); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width .3s; }
.bar-val { color: var(--muted); white-space: nowrap; }
.text-answers { margin: 0; padding-left: 18px; }
.text-answers li { padding: 5px 0; border-bottom: 1px solid var(--line); list-style: none; margin-left: -18px; padding-left: 4px; }
.text-answers li:last-child { border-bottom: 0; }

.results-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.results-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.results-table th, .results-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.results-table th { background: var(--hover); position: sticky; top: 0; font-weight: 600; }
.results-table tr:last-child td { border-bottom: 0; }
.results-table .nowrap { white-space: nowrap; color: var(--muted); }
.row-del { border: 0; background: transparent; cursor: pointer; opacity: .6; }
.row-del:hover { opacity: 1; }

/* ---- Modale partage ---- */
.link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.link-row input { flex: 1; font-family: inherit; background: var(--hover); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13px; }

/* ============================================================
   PAGE PUBLIQUE DE RÉPONSE (/f/<token>)
   ============================================================ */
body.fill { background: var(--bg); }
.fill-wrap { max-width: 680px; margin: 0 auto; padding: 36px 16px 60px; }
.fill-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; margin-bottom: 16px; box-shadow: var(--shadow); }
.fill-head { border-top: 8px solid var(--form-purple); padding-top: 26px; }
.fill-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; }
.fill-desc { color: var(--muted); line-height: 1.6; margin: 8px 0 0; }
.fill-req-note { color: var(--muted); font-size: 12px; margin: 16px 0 0; }
.req { color: #d93025; font-weight: 700; }
.fill-q { padding: 20px 24px; }
.fill-q.fill-q-bad { border-color: #d93025; box-shadow: 0 0 0 1px #d93025; }
.fill-label { display: block; font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.fill-help { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.fill-input { width: 100%; font-family: inherit; font-size: 15px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; margin-top: 8px; }
.fill-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fill-textarea { resize: vertical; }
.fill-select { cursor: pointer; }
.fill-choices { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.fill-choice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.fill-choice:hover { background: var(--hover); }
.fill-choice input { width: 18px; height: 18px; accent-color: var(--form-purple); }
.fill-scale { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.fill-scale-lbl { color: var(--muted); font-size: 13px; }
.fill-scale-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; }
.fill-scale-opt input { width: 20px; height: 20px; accent-color: var(--form-purple); }
.fill-scale-opt span { font-size: 13px; color: var(--muted); }
.fill-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.fill-error { border-left: 4px solid #d93025; color: #d93025; font-weight: 500; }
.fill-msg { text-align: center; padding: 44px 26px; }
.fill-ico { font-size: 44px; margin-bottom: 10px; }
.fill-msg h1 { margin: 0 0 8px; font-size: 24px; }
.fill-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 26px; }

@media (max-width: 640px) {
  .field-row1 { flex-direction: column; }
  .field-type-sel { flex: 1; width: 100%; }
  .chart-wrap { flex-direction: column; align-items: stretch; }
  .pie { align-self: center; }
  .form-tabs { overflow-x: auto; }
}

/* =====================================================================
   COUCHE SUISSE — aplatissement / inversion / grotesque / radius 0
   Surcouche autoritative. On NE touche PAS la page-document elle-même
   (.doc-page + enfants, ::highlight, .cmt, surlignages, couleurs choisies
   par l'utilisateur) : seul le chrome (barres, menus, boutons, nav, fonds
   d'app, modales, panneaux) est suissifié.
   ===================================================================== */

/* Police grotesque sur tout le chrome (la .doc-page garde sa typo Arial) */
body, .btn, button, input, select, textarea, #docTitle, .search input,
.toolbar, .toolbar select, .ed-menubar button, .modal-box, .form-text {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif !important;
}

/* Radius 0 sur le chrome (avatars / pastilles / présences restent ronds) */
.btn, .btn-lg, .newbtn, .create-card, .card, .card-prev, .land-card, .lc-ico,
.cc-ico, .ed-logo, .ctx, .dropdown, .ro-badge, .toolbar button, .toolbar select,
.tb-color, .tb-fsnum, .gdoc-tb .tb-btn, .find-bar, .fb-row input, .fb-nav, .fb-x,
.doc-outline, .ol-item, .comments-panel, .cmt-thread, .ct-input, .ct-resolve,
.table-bar, .table-bar button, .link-chip, .modal-box, .modal-x, .toast,
.search, .nav-item, .stab, .stab-add, .field-card, .field-label-input,
.field-type-sel, .field-help-input, .form-text, .opt-input, .add-field-btn,
.cond-editor, .set-field textarea, .results-table-wrap, .bar-track, .bar-fill,
.fill-card, .fill-input, .fill-choice, .link-row input, .share-add input,
.share-add select, .sl-url input, .plus-pill, .rcount, .form-card, .cellref,
.fx, .cell-input, .tb-fs, .icon-btn, .avatar-btn, .sp-av, .pres, .ct-reply-b {
  border-radius: 0 !important;
}
/* Ronds explicitement conservés */
.icon-btn, .avatar-btn, .sp-av, .pres, .me-avatar { border-radius: 50% !important; }

/* Plat : ni ombre, ni flou (chrome uniquement) */
.card, .land-card, .newbtn, .create-card, .ctx, .dropdown, .modal-box, .toast,
.find-bar, .table-bar, .link-chip, .outline-toggle, .form-card, .field-card,
.fill-card, .results-table-wrap, .topbar, .ed-top, .toolbar, .doc-foot,
.cmt-thread, .cmt-thread.cmt-active {
  box-shadow: none !important;
}

/* Aplats : surfaces opaques, pas de fonds translucides/dégradés sur le chrome */
.topbar, .ed-top, .toolbar, .doc-foot, .filmstrip, .sheet-tabs, .sheet-scroll,
.doc-outline, .comments-panel { background: var(--panel) !important; }

/* Filets 1px nets sur les séparateurs de chrome */
.topbar, .ed-top { border-bottom: 1px solid var(--line) !important; }
.toolbar { border-bottom: 1px solid var(--line) !important; }

/* Boutons : primaire = encre pleine, survol par inversion vers le rouge */
.btn-primary {
  background: var(--ink) !important; border-color: var(--ink) !important;
  color: var(--panel) !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .04em;
}
.btn-primary:hover {
  background: var(--accent) !important; border-color: var(--accent) !important;
  color: #fff !important; filter: none !important;
}
[data-theme="dark"] .btn-primary { color: var(--bg) !important; }
.btn { letter-spacing: .02em; }
.btn-ghost { background: transparent !important; }

/* États actifs / sélection = rouge (accent unique), pas de soft bleuté coloré */
.nav-item.active, .toolbar button.act, .gdoc-tb .tb-btn.act,
.stab.active, .ftab.active, .form-tabs .active {
  background: var(--accent-soft) !important; color: var(--accent) !important;
}
.card:hover, .create-card:hover { border-color: var(--accent) !important; }
.cmt-thread.cmt-active { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) !important; }

/* Avatars / présences / pastilles partage = aplat encre, restent ronds */
.avatar-btn, .sp-av { background: var(--ink) !important; color: var(--panel) !important; }
[data-theme="dark"] .avatar-btn, [data-theme="dark"] .sp-av { color: var(--bg) !important; }

/* Marque : nom en encre, pas d'accent coloré décoratif sur le « b » de chrome */
.brand b { color: var(--accent) !important; }

/* Champs : focus rouge, filet 1px */
#docTitle:focus, .fb-row input:focus, .ct-input:focus, .fx:focus, .tb-fsnum:focus,
input:focus, select:focus, textarea:focus, .field-label-input:focus,
.fill-input:focus, .form-desc-input:focus {
  border-color: var(--accent) !important; outline: 0 !important;
  box-shadow: none !important;
}

/* ---- Rayor Forms : suissification du chrome (le violet décoratif part) ---- */
.plus-pill { background: var(--ink) !important; color: var(--panel) !important; }
[data-theme="dark"] .plus-pill { color: var(--bg) !important; }
.plus-pill:hover { background: var(--accent) !important; color: #fff !important; filter: none !important; }
.rcount { background: var(--accent) !important; color: #fff !important; }
.form-header-card { border-top-color: var(--ink) !important; }
.fill-head { border-top-color: var(--ink) !important; }
.cond-ico { color: var(--accent) !important; }
.fill-choice input, .fill-scale-opt input { accent-color: var(--accent) !important; }
.switch-row input { accent-color: var(--accent) !important; }
.add-field-btn { color: var(--accent) !important; }
.add-field-btn:hover { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.results-total b { color: var(--accent) !important; }
.bar-fill { background: var(--ink) !important; }

/* Libellés / entêtes de section en capitales + interlettrage (chrome) */
.ol-head, .cp-head, .results-table th { text-transform: uppercase; letter-spacing: .06em; }

/* =====================================================================
   GARDE-FOUS — la page-document conserve ses couleurs fonctionnelles.
   On RÉAFFIRME les valeurs d'éditeur pour qu'aucune règle suisse ne fuite.
   ===================================================================== */
.doc-page { font-family: Arial, Helvetica, "Segoe UI", Roboto, sans-serif !important; }
.doc-page .cmt { background: #fff2a8; border-bottom: 2px solid #f9c513; }
.doc-page .cmt.cmt-focus { background: #ffe066; }
.doc-page .cmt.cmt-draft { background: #fde293; }
[data-theme="dark"] .doc-page .cmt { background: #5c5219; border-bottom-color: #c9a227; color: #f5e6a8; }
.doc-page a { color: #1155cc; }
[data-theme="dark"] .doc-page a { color: #8ab4f8; }
.ct-quote { border-left: 3px solid #f9c513; background: #fff8db; }
[data-theme="dark"] .ct-quote { background: #3a3413; color: #c9cdd2; }
