/* Entraide — 4 couleurs : bleu #167DB5, gris #707070, noir #111111, blanc #FFFFFF */
:root {
  --blue: #167DB5; --gray: #707070; --ink: #111111; --bg: #FFFFFF;
  --blue-14: rgba(22,125,181,0.14); --blue-16: rgba(22,125,181,0.16); --blue-12: rgba(22,125,181,0.12);
  --gray-22: rgba(112,112,112,0.22); --gray-8: rgba(112,112,112,0.08); --veil: rgba(17,17,17,0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #FFFFFF; --bg: #111111; --gray: #9A9A9A;
  --gray-22: rgba(154,154,154,0.28); --gray-8: rgba(154,154,154,0.14); --veil: rgba(0,0,0,0.6);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; }
body { overscroll-behavior: none; }
*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); }
#app { max-width: 560px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg); }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scroll { flex: 1; overflow: auto; min-height: 0; }
.scroll > * { flex-shrink: 0; }
.pad { padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px; }

/* Bandeau du haut (fin, ligne du titre uniquement) */
.top { flex: none; background: var(--blue-14); padding: 6px 8px; display: flex; align-items: center; gap: 6px; min-height: 56px; }
.top .title { flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title.brand { font-size: 20px; font-weight: 600; color: var(--blue); padding-left: 10px; }
.top .sub { font-size: 12px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .tlink { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; background: none; border: 0; text-align: left; padding: 0; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--blue); border-radius: 22px; position: relative; flex: none; text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.gray { color: var(--gray); }
.badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; border: 1px solid var(--blue); background: var(--bg); color: var(--blue); font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Boutons : jamais remplis */
.btn { height: 50px; border-radius: 14px; border: 1.5px solid var(--blue); background: var(--bg); color: var(--blue); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 16px; width: 100%; }
.btn.sec { border: 1px solid var(--gray); color: var(--ink); height: 48px; font-size: 15px; }
.btn.off { border-color: var(--gray); color: var(--gray); }
.btn.small { height: 40px; width: auto; font-size: 14px; border-radius: 20px; padding: 0 14px; border-width: 1px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--blue); font-size: 14px; cursor: pointer; min-height: 32px; text-align: left; }
.linkbtn.gray { color: var(--gray); }
.row-btns { display: flex; gap: 10px; }
.row-btns > * { flex: 1; }

/* Champs */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gray); min-width: 0; }
.in { height: 46px; border: 1px solid var(--gray); border-radius: 12px; padding: 0 12px; font-size: 16px; background: var(--bg); color: var(--ink); width: 100%; min-width: 0; }
.in:focus { outline: none; border-color: var(--blue); }
textarea.in { height: auto; padding: 10px 12px; resize: none; }
.pw { position: relative; }
.pw .in { padding-right: 48px; }
.pw .icon-btn { position: absolute; right: 2px; top: 1px; color: var(--gray); }
.hint { font-size: 12px; color: var(--gray); line-height: 1.45; }
.ok { font-size: 14px; color: var(--blue); }
.warn { font-size: 14px; color: var(--ink); line-height: 1.45; }
.two { display: flex; gap: 10px; }
.two > * { flex: 1; }

/* Pastilles de choix */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scrollx { flex-wrap: nowrap; overflow-x: auto; padding: 10px 14px; }
.chip { height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--gray-22); background: var(--bg); font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.chip.on { border-color: var(--blue); background: var(--blue-12); }
.choice { min-height: 48px; border-radius: 12px; border: 1px solid var(--gray-22); background: var(--bg); cursor: pointer; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; text-align: left; color: var(--ink); width: 100%; }
.choice.on { border-color: var(--blue); background: var(--blue-12); }
.choice .s { font-size: 12px; color: var(--gray); }

/* Cartes */
.card { border: 1px solid var(--gray-22); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.card.p { padding: 12px 14px; gap: 10px; }
.card .h { font-size: 12px; letter-spacing: 0.4px; color: var(--gray); padding: 12px 14px 10px; }
.card.p .h { padding: 0; }
.line { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 50px; border: 0; border-top: 1px solid var(--gray-22); background: var(--bg); width: 100%; text-align: left; cursor: pointer; font-size: 15px; color: var(--ink); text-decoration: none; }
.line .grow { flex: 1; min-width: 0; }
.line .r { color: var(--gray); font-size: 14px; }
.line.blue { color: var(--blue); }
.alert { border: 1.5px solid var(--blue); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.45; }
.alert .k { font-size: 12px; letter-spacing: 0.4px; color: var(--blue); }

/* Interrupteurs */
.switch { display: flex; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--gray-22); background: var(--bg); padding: 10px 14px; width: 100%; text-align: left; cursor: pointer; color: var(--ink); }
.switch .grow { flex: 1; display: flex; flex-direction: column; }
.switch .st { font-size: 14px; color: var(--gray); }
.track { width: 46px; height: 28px; border-radius: 14px; border: 1px solid var(--gray); position: relative; flex: none; background: var(--gray-8); }
.track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 11px; background: var(--bg); box-shadow: 0 1px 3px rgba(17,17,17,0.25); transition: left .15s; }
.switch[aria-checked="true"] .track { background: var(--blue-12); }
.switch[aria-checked="true"] .track::after { left: 20px; background: var(--blue); }

/* Avatars */
.av { width: 46px; height: 46px; border-radius: 23px; background: var(--gray-8); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; overflow: hidden; color: var(--ink); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.s { width: 38px; height: 38px; font-size: 13px; }
.av.xs { width: 30px; height: 30px; font-size: 11px; }
.av.l { width: 84px; height: 84px; font-size: 26px; border-radius: 42px; }

/* Liste de discussions */
.conv { position: relative; }
.conv a { display: flex; gap: 12px; align-items: center; padding: 12px 52px 12px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--gray-22); }
.conv .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv .nm { display: flex; gap: 6px; align-items: baseline; }
.conv .nm b { font-weight: 400; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.conv .tm { font-size: 12px; color: var(--gray); flex: none; }
.conv .ls { display: flex; gap: 6px; align-items: center; }
.conv .ls span.t { font-size: 14px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.conv .tag { font-size: 11px; color: var(--gray); border: 1px solid var(--gray-22); border-radius: 8px; padding: 1px 6px; flex: none; }
.conv .cnt { min-width: 22px; height: 22px; border-radius: 11px; border: 1px solid var(--blue); color: var(--blue); font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex: none; }
.conv .more { position: absolute; right: 6px; top: 50%; margin-top: -20px; width: 40px; height: 40px; }
.fab { position: absolute; right: 18px; bottom: 88px; width: 56px; height: 56px; border-radius: 28px; border: 1.5px solid var(--blue); background: var(--bg); color: var(--blue); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(17,17,17,0.15); cursor: pointer; z-index: 3; }
.fab svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.menu-pop { position: absolute; right: 18px; bottom: 152px; background: var(--bg); border: 1px solid var(--gray-22); border-radius: 14px; box-shadow: 0 6px 20px rgba(17,17,17,0.15); display: flex; flex-direction: column; overflow: hidden; z-index: 4; min-width: 240px; }
.menu-pop > * { padding: 14px 18px; font-size: 15px; border: 0; border-bottom: 1px solid var(--gray-22); background: var(--bg); color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }

/* Barre d'onglets */
.tabbar { flex: none; display: flex; border-top: 1px solid var(--gray-22); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 10px; font-size: 12px; color: var(--gray); text-decoration: none; }
.tabbar a.on { color: var(--blue); }
.tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Conversation */
.msgs { flex: 1; overflow: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.msgs > * { flex-shrink: 0; }
.daynote { align-self: center; font-size: 12px; color: var(--gray); text-align: center; max-width: 320px; line-height: 1.4; }
.unread-sep { align-self: center; font-size: 12px; color: var(--blue); border: 1px solid var(--blue); border-radius: 10px; padding: 3px 10px; }
.m { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.m.mine { align-self: flex-end; flex-direction: row-reverse; }
.bub { border-radius: 16px; padding: 8px 10px 6px; display: flex; flex-direction: column; gap: 4px; min-width: 70px; border: 1px solid var(--gray-22); background: var(--bg); position: relative; }
.m.mine .bub { background: var(--blue-16); border-color: transparent; }
.bub .au { font-size: 12px; color: var(--gray); }
.bub .tx { font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.bub .ft { display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 11px; color: var(--gray); }
.bub .rd { color: var(--blue); letter-spacing: -3px; }
.bub .q { border-left: 3px solid var(--blue); background: var(--gray-8); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.bub .q b { font-weight: 400; color: var(--blue); display: block; font-size: 12px; }
.bub img.ph { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; cursor: pointer; object-fit: cover; }
.bub .del { font-style: italic; color: var(--gray); font-size: 14px; }
.bub .opt { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border: 0; background: none; color: var(--gray); cursor: pointer; opacity: 0.8; font-size: 16px; line-height: 1; }
.m .bub { padding-right: 30px; }
.locbox, .ctbox { display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); }
.locbox .ic, .ctbox .ic { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--blue); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.composer { flex: none; padding: 8px 10px 12px; display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--gray-22); background: var(--bg); }
.composer .in { border-radius: 23px; flex: 1; }
.roundbtn { width: 46px; height: 46px; border-radius: 23px; border: 1.5px solid var(--blue); background: var(--bg); color: var(--blue); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.roundbtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.roundbtn.gray { border-color: var(--gray); color: var(--gray); }
.replybar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--gray-22); }
.replybar .q { flex: 1; min-width: 0; border-left: 3px solid var(--blue); padding-left: 8px; font-size: 13px; }
.replybar .q b { display: block; font-weight: 400; color: var(--blue); font-size: 12px; }
.attach { position: absolute; left: 10px; right: 10px; bottom: 76px; background: var(--bg); border: 1px solid var(--gray-22); border-radius: 18px; box-shadow: 0 6px 20px rgba(17,17,17,0.15); display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); padding: 10px; gap: 6px; z-index: 4; }
.attach button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; font-size: 13px; cursor: pointer; color: var(--ink); }
.attach .ic { width: 48px; height: 48px; border-radius: 24px; }
.seg { display: flex; border: 1px solid var(--blue); border-radius: 17px; overflow: hidden; height: 34px; flex: none; }
.seg button { border: 0; padding: 0 12px; font-size: 14px; background: var(--bg); color: var(--gray); cursor: pointer; }
.seg button.on { background: var(--blue-12); color: var(--blue); }
.pill { height: 34px; padding: 0 12px; border: 1px solid var(--blue); border-radius: 17px; display: flex; align-items: center; font-size: 14px; color: var(--blue); text-decoration: none; white-space: nowrap; flex: none; background: var(--bg); }
.typing { font-size: 12px; color: var(--gray); padding: 0 14px 4px; min-height: 16px; }

/* Offres */
.offer { border: 1px solid var(--gray-22); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.offer .t { font-size: 16px; line-height: 1.3; }

/* Feuilles, boîtes de dialogue, message court */
.veil { position: absolute; inset: 0; background: var(--veil); display: flex; flex-direction: column; justify-content: flex-end; z-index: 20; }
.veil.center { justify-content: center; align-items: center; padding: 24px; }
.veil > .closer { flex: 1; border: 0; background: transparent; cursor: pointer; min-height: 40px; }
.sheet { background: var(--bg); border-radius: 20px 20px 0 0; padding: 14px 0 18px; display: flex; flex-direction: column; max-height: 88%; overflow: auto; }
.sheet .st { padding: 0 22px 8px; font-size: 17px; }
.sheet .item { height: 52px; border: 0; border-top: 1px solid var(--gray-22); background: var(--bg); padding: 0 22px; font-size: 16px; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.sheet .body { padding: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.dialog { background: var(--bg); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
.dialog .dt { font-size: 17px; }
.dialog .dx { font-size: 14px; color: var(--gray); line-height: 1.5; }
#toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--bg); border: 1px solid var(--gray); color: var(--ink); font-size: 14px; padding: 10px 16px; border-radius: 12px; z-index: 40; pointer-events: none; max-width: 90%; text-align: center; display: none; }
#toast.show { display: block; }
.viewer { position: absolute; inset: 0; background: #111111; z-index: 30; display: flex; flex-direction: column; color: #FFFFFF; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .icon-btn, .viewer button { color: #FFFFFF; }
.viewer .acts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); padding: 10px 10px 22px; }
.viewer .acts button { border: 0; background: none; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; min-height: 56px; }
.viewer .acts svg { width: 22px; height: 22px; stroke: #FFFFFF; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; color: var(--gray); font-size: 14px; padding: 30px 16px; line-height: 1.5; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.steps { display: flex; gap: 8px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--gray-22); }
.steps span.on { background: var(--blue); }
.loading { padding: 40px; text-align: center; color: var(--gray); }
.hl { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.prof-tag { font-size: 12px; color: var(--blue); }
