/* =====================================================================
   Guy — design system
   Identité : vert nuit, ivoire, or. Surfaces tonales (jamais de dégradé
   décoratif ni de verre dépoli). Typographie : système pour l'interface,
   serif pour les moments de marque.
   ===================================================================== */

:root {
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --night: #0f3d2e;
  --night-2: #17553f;
  --night-deep: #0a2a20;
  --ivory: #f6f1e7;
  --gold: #c8a24b;
  --gold-deep: #9a7a2c;
  --gold-ink: #33270a;

  --bg: #f1ebde;
  --surface: #fbf8f1;
  --surface-2: #f5f0e4;
  --surface-3: #ede6d6;
  --ink: #15241d;
  --ink-2: #435049;
  --muted: #76817a;
  --line: #e3dbc9;
  --line-2: #d6ccb6;

  --bub-in: #fffdf8;
  --bub-in-ink: #15241d;
  --bub-out: #0f3d2e;
  --bub-out-ink: #f6f1e7;
  --bub-agent: #e5eee1;
  --bub-agent-ink: #14291f;
  --bub-sys: #f6e9cf;
  --bub-sys-ink: #4a3410;

  --ok: #2f7d57;
  --danger: #b3402a;
  --focus: #1b7a58;

  --shadow-1: 0 1px 2px rgba(21, 36, 29, .06), 0 1px 1px rgba(21, 36, 29, .04);
  --shadow-2: 0 8px 24px rgba(21, 36, 29, .12), 0 2px 6px rgba(21, 36, 29, .06);
  --shadow-3: 0 24px 60px rgba(10, 42, 32, .28);

  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-bub: 18px;
  --side-w: 372px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --wall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%230f3d2e' fill-opacity='.055'%3E%3Cpath transform='translate(34 36) rotate(32)' d='M0 -12C8 -6 8 6 0 12C-8 6 -8 -6 0 -12Z'/%3E%3Cpath transform='translate(128 70) rotate(-48)' d='M0 -10C7 -5 7 5 0 10C-7 5 -7 -5 0 -10Z'/%3E%3Cpath transform='translate(70 128) rotate(78)' d='M0 -13C9 -6 9 6 0 13C-9 6 -9 -6 0 -13Z'/%3E%3Cpath transform='translate(150 150) rotate(12)' d='M0 -9C6 -4 6 4 0 9C-6 4 -6 -4 0 -9Z'/%3E%3Ccircle cx='96' cy='22' r='2'/%3E%3Ccircle cx='18' cy='104' r='2'/%3E%3Ccircle cx='160' cy='112' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --bg: #0a1410;
  --surface: #0f1c17;
  --surface-2: #13241d;
  --surface-3: #183029;
  --ink: #e8efe9;
  --ink-2: #b6c4ba;
  --muted: #7d8d84;
  --line: #1c3027;
  --line-2: #25402f;
  --bub-in: #15261f;
  --bub-in-ink: #e8efe9;
  --bub-out: #1a5c43;
  --bub-out-ink: #f4f7f1;
  --bub-agent: #1b3a2d;
  --bub-agent-ink: #e6f0e8;
  --bub-sys: #3b2f14;
  --bub-sys-ink: #f1e3c2;
  --focus: #5fc79b;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
  --wall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%23ffffff' fill-opacity='.028'%3E%3Cpath transform='translate(34 36) rotate(32)' d='M0 -12C8 -6 8 6 0 12C-8 6 -8 -6 0 -12Z'/%3E%3Cpath transform='translate(128 70) rotate(-48)' d='M0 -10C7 -5 7 5 0 10C-7 5 -7 -5 0 -10Z'/%3E%3Cpath transform='translate(70 128) rotate(78)' d='M0 -13C9 -6 9 6 0 13C-9 6 -9 -6 0 -13Z'/%3E%3Cpath transform='translate(150 150) rotate(12)' d='M0 -9C6 -4 6 4 0 9C-6 4 -6 -4 0 -9Z'/%3E%3Ccircle cx='96' cy='22' r='2'/%3E%3Ccircle cx='18' cy='104' r='2'/%3E%3Ccircle cx='160' cy='112' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1410; --surface: #0f1c17; --surface-2: #13241d; --surface-3: #183029;
    --ink: #e8efe9; --ink-2: #b6c4ba; --muted: #7d8d84; --line: #1c3027; --line-2: #25402f;
    --bub-in: #15261f; --bub-in-ink: #e8efe9; --bub-out: #1a5c43; --bub-out-ink: #f4f7f1;
    --bub-agent: #1b3a2d; --bub-agent-ink: #e6f0e8; --bub-sys: #3b2f14; --bub-sys-ink: #f1e3c2;
    --focus: #5fc79b; --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 8px 24px rgba(0, 0, 0, .45);
    --wall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='%23ffffff' fill-opacity='.028'%3E%3Cpath transform='translate(34 36) rotate(32)' d='M0 -12C8 -6 8 6 0 12C-8 6 -8 -6 0 -12Z'/%3E%3Cpath transform='translate(128 70) rotate(-48)' d='M0 -10C7 -5 7 5 0 10C-7 5 -7 -5 0 -10Z'/%3E%3Cpath transform='translate(70 128) rotate(78)' d='M0 -13C9 -6 9 6 0 13C-9 6 -9 -6 0 -13Z'/%3E%3Cpath transform='translate(150 150) rotate(12)' d='M0 -9C6 -4 6 4 0 9C-6 4 -6 -4 0 -9Z'/%3E%3Ccircle cx='96' cy='22' r='2'/%3E%3Ccircle cx='18' cy='104' r='2'/%3E%3Ccircle cx='160' cy='112' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--night-2); }
:root[data-theme="dark"] a { color: #7fd1aa; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

#app { height: 100dvh; }
.boot { display: grid; place-items: center; background: var(--night); }
.boot-mark svg { animation: bootpulse 1.6s var(--ease) infinite; border-radius: 16px; }
@keyframes bootpulse { 0%, 100% { transform: scale(1); opacity: .9 } 50% { transform: scale(1.06); opacity: 1 } }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .15s var(--ease), background .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--night); color: var(--ivory); box-shadow: var(--shadow-1); }
.btn-primary:hover:not([disabled]) { background: var(--night-2); box-shadow: var(--shadow-2); }
:root[data-theme="dark"] .btn-primary { background: var(--night-2); }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover:not([disabled]) { background: #d4b05c; }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover:not([disabled]) { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--ink-2); transition: background .15s, color .15s, transform .15s var(--ease); position: relative;
}
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.on { color: var(--night-2); background: var(--surface-3); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label small { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line-2); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--night-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--night-2) 20%, transparent); }
.hint { font-size: 13px; color: var(--muted); margin: -6px 0 12px; }
.err-text { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; }
.switch .sw-text b { display: block; font-weight: 600; }
.switch .sw-text span { font-size: 13px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--night-2); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 999px; gap: 2px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Marque ---------- */
.wm { font-family: var(--font-serif); font-size: 22px; letter-spacing: -.01em; font-weight: 600; color: var(--ink); line-height: 1; }
.wm i { font-style: italic; color: var(--night-2); }
:root[data-theme="dark"] .wm i { color: #7fd1aa; }
.logo { width: 34px; height: 34px; border-radius: 9px; display: block; }

/* ---------- Avatars ---------- */
.avatar {
  --size: 46px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * .38); letter-spacing: .02em;
  color: #f6f1e7; background: hsl(var(--hue, 150) 36% 30%);
  user-select: none;
}
.avatar.sm { --size: 32px; }
.avatar.lg { --size: 56px; }
.avatar.mame { background: none; border-radius: 28%; overflow: hidden; }
.avatar.mame svg { width: 100%; height: 100%; display: block; }
.avatar.group { background: var(--night-2); }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--surface); }

/* ---------- Ecrans d'accès ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
  background: var(--night); color: var(--ivory); padding: 56px 56px 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: var(--wall); background-size: 180px; opacity: 1; filter: invert(1) brightness(2); mix-blend-mode: soft-light; opacity: .55; pointer-events: none; }
.auth-art > * { position: relative; }
.auth-art .wm { color: var(--ivory); font-size: 30px; }
.auth-art .wm i { color: var(--gold); }
.auth-quote { font-family: var(--font-serif); font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -.015em; max-width: 14em; }
.auth-quote em { color: var(--gold); font-style: italic; }
.auth-foot { font-size: 14px; color: color-mix(in srgb, var(--ivory) 70%, transparent); max-width: 30em; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--font-serif); font-size: 32px; letter-spacing: -.015em; margin: 0 0 6px; font-weight: 600; }
.auth-card p.lead { margin: 0 0 26px; color: var(--ink-2); }
.auth-card .brandline { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.pw-wrap { position: relative; }
.pw-wrap .iconbtn { position: absolute; right: 2px; top: 2px; width: 42px; height: 42px; }
.pw-wrap .input { padding-right: 48px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card .brandline { display: flex; }
}

/* ---------- Coque de l'application ---------- */
.app { height: 100dvh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); background: var(--surface); overflow: hidden; position: relative; }

.side { position: relative; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: var(--surface); height: 100dvh; }
.side-top { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t)) 14px 8px 16px; }
.side-top .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.me-btn { border-radius: 50%; }
.search { margin: 4px 14px 10px; position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input { width: 100%; height: 42px; border-radius: 999px; border: 0; background: var(--surface-3); padding: 0 16px 0 40px; }
.search input:focus { outline: 2px solid var(--focus); }
.filters { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--night); color: var(--ivory); border-color: var(--night); }
:root[data-theme="dark"] .chip.on { background: var(--night-2); border-color: var(--night-2); }
.chip .n { margin-left: 6px; font-size: 12px; opacity: .8; }

.tlist { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 96px; }
.titem { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px 10px; border-radius: var(--r-md); position: relative; transition: background .12s; }
.titem:hover { background: var(--surface-2); }
.titem.on { background: color-mix(in srgb, var(--night) 10%, var(--surface)); }
.titem.on::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.tbody { flex: 1; min-width: 0; }
.trow { display: flex; align-items: baseline; gap: 8px; }
.tname { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttime { font-size: 12px; color: var(--muted); flex: none; }
.titem.unread .ttime { color: var(--night-2); font-weight: 700; }
.tprev { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.titem.unread .tprev { color: var(--ink-2); }
.tprev .who { color: var(--ink-2); font-weight: 600; }
.tprev .typing-txt { color: var(--night-2); font-weight: 600; }
.tbadge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; flex: none; }
.tbadge.muted { background: var(--line-2); color: var(--ink-2); }
.tsub { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.tmute { width: 14px; height: 14px; color: var(--muted); }
.tsec { padding: 14px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fab {
  position: absolute; right: 18px; bottom: calc(18px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; background: var(--night); color: var(--ivory);
  display: grid; place-items: center; box-shadow: var(--shadow-2); transition: transform .15s var(--ease), background .15s; z-index: 5;
}
.fab:hover { background: var(--night-2); transform: translateY(-2px); }
.fab:active { transform: scale(.94); }
.fab .i { width: 24px; height: 24px; }
:root[data-theme="dark"] .fab { background: var(--night-2); }

/* ---------- Volet de conversation ---------- */
.pane { display: flex; flex-direction: column; min-width: 0; height: 100dvh; background: var(--bg); position: relative; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 14px 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 3; min-height: 66px; }
.chat-head .back { display: none; }
.chat-head .hmain { flex: 1; min-width: 0; text-align: left; }
.htitle { font-weight: 700; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsub.live { color: var(--night-2); font-weight: 600; }
:root[data-theme="dark"] .hsub.live { color: #7fd1aa; }

.stream { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 0 8px; background-image: var(--wall); background-size: 180px; position: relative; scroll-behavior: auto; }
.msgs { max-width: 860px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; }
.more { align-self: center; margin: 4px 0 12px; }
.dayline { align-self: center; margin: 14px 0 8px; padding: 4px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow-1); position: sticky; top: 4px; z-index: 1; }

.row { display: flex; gap: 8px; margin-top: 2px; max-width: 100%; align-items: flex-end; }
.row.first { margin-top: 10px; }
.row.out { justify-content: flex-end; }
.row .rav { width: 32px; flex: none; }
.row .col { display: flex; flex-direction: column; min-width: 0; max-width: min(78%, 620px); }
.row.out .col { align-items: flex-end; }
.sender { font-size: 12.5px; font-weight: 700; margin: 0 12px 3px; color: hsl(var(--hue, 150) 42% 34%); }
:root[data-theme="dark"] .sender { color: hsl(var(--hue, 150) 45% 68%); }
.sender small { font-weight: 500; color: var(--muted); margin-left: 6px; }

.bub {
  position: relative; padding: 8px 12px 6px; border-radius: var(--r-bub); background: var(--bub-in); color: var(--bub-in-ink);
  box-shadow: var(--shadow-1); word-wrap: break-word; overflow-wrap: anywhere; min-width: 0; max-width: 100%;
  animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.row.in .bub { border-bottom-left-radius: 6px; }
.row.in:not(.last) .bub { border-bottom-left-radius: var(--r-bub); }
.row.in:not(.first) .bub { border-top-left-radius: 8px; }
.row.out .bub { background: var(--bub-out); color: var(--bub-out-ink); border-bottom-right-radius: 6px; }
.row.out:not(.last) .bub { border-bottom-right-radius: var(--r-bub); }
.row.out:not(.first) .bub { border-top-right-radius: 8px; }
.bub.agent { background: var(--bub-agent); color: var(--bub-agent-ink); }
.bub.event { border-left: 4px solid var(--gold); padding-left: 11px; }
.bub.system { background: var(--bub-sys); color: var(--bub-sys-ink); }
.bub.err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.bub.sending { opacity: .72; }
.tag-event { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 3px; }
:root[data-theme="dark"] .tag-event { color: var(--gold); }
.tag-event .i { width: 13px; height: 13px; stroke-width: 2.2; }

.txt { white-space: pre-wrap; }
.txt p { margin: 0 0 .55em; white-space: pre-wrap; }
.txt p:last-child { margin-bottom: 0; }
.txt strong { font-weight: 700; }
.txt code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, currentColor 11%, transparent); }
.txt pre { margin: .4em 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, currentColor 9%, transparent); overflow-x: auto; white-space: pre; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.txt ul, .txt ol { margin: .3em 0 .6em; padding-left: 1.3em; white-space: normal; }
.txt li { margin: .12em 0; }
.txt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.row.out .txt a { color: #ffe9a8; }
.txt h4 { margin: .5em 0 .25em; font-size: 1em; font-weight: 750; }
.txt blockquote { margin: .4em 0; padding-left: 10px; border-left: 3px solid color-mix(in srgb, currentColor 30%, transparent); opacity: .9; }

.bub { padding-bottom: 7px; }
.txt > :last-child::after { content: ""; display: inline-block; width: 58px; height: 1px; }
.meta { position: absolute; right: 11px; bottom: 5px; display: flex; align-items: center; gap: 4px; font-size: 11.5px; opacity: .62; line-height: 1; }
.meta .i { width: 15px; height: 15px; stroke-width: 2.2; }
.meta .read { color: #8ee0bd; opacity: 1; display: inline-flex; }
.meta .read .i { color: #8ee0bd; }
.row.in .meta .read, .bub.agent .meta .read { color: var(--night-2); }
.meta .fail { color: #ff9a85; opacity: 1; display: inline-flex; }
.bub .voice, .bub .filecard { padding-bottom: 14px; }
.bub:has(> .voice, > .filecard) { min-width: 240px; }
.bub.mediaonly { padding: 0; background: transparent; box-shadow: none; }
.bub.mediaonly .media { margin: 0; }
.bub.mediaonly .meta { right: 10px; bottom: 10px; background: rgba(10, 22, 17, .55); color: #fff; opacity: 1; padding: 3px 8px; border-radius: 999px; }
.media + .txt { margin-top: 6px; }
.unreadline { align-self: stretch; text-align: center; margin: 14px 0 6px; font-size: 12.5px; font-weight: 800; color: var(--gold-deep); letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.unreadline::before, .unreadline::after { content: ""; height: 1px; flex: 1; background: color-mix(in srgb, var(--gold) 55%, transparent); }
.row .rav .avatar { visibility: hidden; }
.row.last .rav .avatar { visibility: visible; }
.typing-row .rav .avatar { visibility: visible; }

.media { display: block; margin: -4px -8px 4px; border-radius: 14px; overflow: hidden; background: var(--surface-3); position: relative; cursor: zoom-in; max-width: 320px; }
.media img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; min-width: 180px; object-fit: cover; }
.filecard { display: flex; align-items: center; gap: 12px; padding: 4px 2px 2px; min-width: 210px; text-decoration: none; color: inherit; }
.filecard .fico { width: 42px; height: 48px; border-radius: 9px; background: color-mix(in srgb, currentColor 13%, transparent); display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.filecard .fname { font-weight: 650; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.filecard .fsub { font-size: 12.5px; opacity: .7; }

.voice { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 2px 0; }
.voice .play { width: 40px; height: 40px; border-radius: 50%; background: var(--night); color: var(--ivory); display: grid; place-items: center; flex: none; transition: transform .12s var(--ease); }
.voice .play:active { transform: scale(.9); }
.row.out .voice .play { background: var(--ivory); color: var(--night); }
.voice .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.voice .wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .3; height: var(--h, 40%); transition: opacity .15s; }
.voice .wave i.on { opacity: .95; }
.voice .dur { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; min-width: 34px; text-align: right; }
.voice .spd { font-size: 11.5px; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); }

.bubbtn { display: inline-flex; margin-top: 8px; font-weight: 700; font-size: 13.5px; padding: 6px 14px; border-radius: 999px; background: var(--night); color: var(--ivory); }
.copyhint { position: absolute; top: 4px; right: -34px; opacity: 0; transition: opacity .15s; }
.row.out .copyhint { right: auto; left: -34px; }
.bub:hover .copyhint { opacity: 1; }
.copyhint .iconbtn { width: 30px; height: 30px; background: var(--surface); box-shadow: var(--shadow-1); }
.copyhint .i { width: 15px; height: 15px; }
@media (hover: none) { .copyhint { display: none; } }

.typing { display: inline-flex; align-items: center; gap: 5px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--night-2); opacity: .45; animation: bounce 1.2s infinite var(--ease); }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35 } 30% { transform: translateY(-5px); opacity: 1 } }
.typing-label { font-size: 12.5px; color: var(--muted); margin-left: 4px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px 40px; }
.qbtn { padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1.5px solid var(--night-2); color: var(--night-2); background: var(--surface); transition: background .12s, color .12s, transform .12s var(--ease); }
.qbtn:hover { background: var(--night); color: var(--ivory); }
.qbtn:active { transform: scale(.95); }
.qbtn.ok { background: var(--night); color: var(--ivory); border-color: var(--night); }
.qbtn.no { border-color: var(--line-2); color: var(--ink-2); }
.qbtn.no:hover { background: var(--surface-3); color: var(--ink); }
:root[data-theme="dark"] .qbtn { border-color: #5fc79b; color: #7fd1aa; }
:root[data-theme="dark"] .qbtn.ok { background: var(--night-2); color: #fff; border-color: var(--night-2); }

.jump { position: absolute; right: 16px; bottom: 14px; z-index: 4; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); display: grid; place-items: center; border: 1px solid var(--line); }
.jump .n { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; }

.emptychat { margin: auto; text-align: center; padding: 40px 24px; max-width: 360px; color: var(--ink-2); }
.emptychat .avatar { margin: 0 auto 14px; }
.emptychat h3 { font-family: var(--font-serif); font-size: 24px; margin: 0 0 6px; color: var(--ink); font-weight: 600; }
.nochat { display: grid; place-items: center; height: 100%; text-align: center; padding: 24px; background-image: var(--wall); background-size: 180px; }
.nochat .card { max-width: 420px; }
.nochat .logo-big { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 24px; box-shadow: var(--shadow-2); }
.nochat h2 { font-family: var(--font-serif); font-size: 30px; margin: 0 0 8px; letter-spacing: -.01em; font-weight: 600; }
.nochat p { color: var(--ink-2); margin: 0; }

/* ---------- Composeur ---------- */
.composer { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--safe-b)); z-index: 3; }
.cin { max-width: 860px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; }
.cbox { flex: 1; display: flex; align-items: flex-end; background: var(--surface-3); border-radius: 24px; padding: 2px 4px 2px 4px; border: 1.5px solid transparent; transition: border-color .15s, background .15s; min-width: 0; }
.cbox:focus-within { border-color: var(--night-2); background: var(--surface); }
.cbox textarea { flex: 1; resize: none; border: 0; background: none; padding: 11px 6px; max-height: 148px; min-height: 44px; line-height: 1.4; outline: none; min-width: 0; }
.cbox textarea::placeholder { color: var(--muted); }
.cbox .iconbtn { width: 40px; height: 40px; flex: none; }
.send { width: 48px; height: 48px; border-radius: 50%; background: var(--night); color: var(--ivory); display: grid; place-items: center; flex: none; transition: transform .15s var(--ease), background .15s; box-shadow: var(--shadow-1); }
.send:hover { background: var(--night-2); }
.send:active { transform: scale(.9); }
.send.mic { background: var(--gold); color: var(--gold-ink); }
.send.mic:hover { background: #d4b05c; }
:root[data-theme="dark"] .send:not(.mic) { background: var(--night-2); }
.tray { max-width: 860px; margin: 0 auto 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.att { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; background: var(--surface-3); border-radius: 14px; max-width: 280px; }
.att img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex: none; }
.att .fico { width: 44px; height: 44px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.att .an { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .as { font-size: 12px; color: var(--muted); }
.att .iconbtn { width: 30px; height: 30px; }
.att .iconbtn .i { width: 16px; height: 16px; }

.rec { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.rec .pill { flex: 1; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px; border-radius: 24px; background: var(--surface-3); min-width: 0; }
.rec .rdot { width: 11px; height: 11px; border-radius: 50%; background: #d64533; animation: blink 1.1s infinite; flex: none; }
@keyframes blink { 50% { opacity: .25; } }
.rec .rtime { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 44px; }
.rec .rlevel { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; overflow: hidden; }
.rec .rlevel i { width: 3px; border-radius: 2px; background: var(--night-2); flex: none; height: 4px; }
.rec .rhint { font-size: 13px; color: var(--muted); }

.dropveil { position: absolute; inset: 0; z-index: 20; background: color-mix(in srgb, var(--night) 82%, transparent); color: var(--ivory); display: grid; place-items: center; font-family: var(--font-serif); font-size: 26px; pointer-events: none; border: 3px dashed var(--gold); margin: 10px; border-radius: 22px; }

/* ---------- Feuilles (modales) ---------- */
.veil { position: fixed; inset: 0; background: rgba(10, 22, 17, .5); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .18s; }
@keyframes fade { from { opacity: 0 } }
.sheet { background: var(--surface); width: 100%; max-width: 520px; max-height: min(90dvh, 760px); border-radius: 24px; box-shadow: var(--shadow-3); display: flex; flex-direction: column; overflow: hidden; animation: rise .26s var(--ease); }
.sheet.wide { max-width: 760px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 12px 12px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; font-family: var(--font-serif); font-weight: 650; }
.sheet-body { padding: 18px 22px 22px; overflow-y: auto; }
.sheet-foot { padding: 14px 22px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sheet .sec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); margin: 22px 0 8px; }
.sheet .sec:first-child { margin-top: 0; }

.plist { display: grid; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--r-md); width: 100%; text-align: left; }
.pitem:hover { background: var(--surface-2); }
.pitem .pn { font-weight: 650; }
.pitem .ps { font-size: 13px; color: var(--muted); }
.pitem .pbody { flex: 1; min-width: 0; }
.pitem input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--night-2); }
.pitem.big { padding: 12px 8px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mcard { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; background: var(--surface); }
.mcard.off { opacity: .6; }
.mcard .mmain { flex: 1; min-width: 0; }
.mcard .mname { font-weight: 700; }
.mcard .msub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.mcard .mtags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tag.warn { background: color-mix(in srgb, var(--gold) 24%, transparent); color: var(--gold-deep); }
.tag.off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
:root[data-theme="dark"] .tag.warn { color: var(--gold); }

.linkbox { display: flex; gap: 8px; align-items: stretch; }
.linkbox input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.callout { padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: 14px; margin: 12px 0; }
.callout.bad { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.statusline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.statusline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.statusline .dot.ok { background: var(--ok); } .statusline .dot.bad { background: var(--danger); }

/* ---------- Divers ---------- */
.banner { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: var(--night-deep); color: var(--ivory); padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 70; box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 10px; }
.banner .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ivory) 30%, transparent); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 16px; }
.toast { background: var(--night-deep); color: var(--ivory); padding: 11px 18px; border-radius: 14px; font-size: 14.5px; box-shadow: var(--shadow-2); animation: rise .25s var(--ease); max-width: 440px; pointer-events: auto; }
.toast.bad { background: var(--danger); color: #fff; }
.lightbox { position: fixed; inset: 0; background: rgba(6, 14, 10, .94); z-index: 90; display: grid; place-items: center; animation: fade .15s; }
.lightbox img { max-width: 94vw; max-height: 86dvh; border-radius: 6px; box-shadow: var(--shadow-3); }
.lightbox .lb-top { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; display: flex; gap: 6px; }
.lightbox .iconbtn { color: #fff; background: rgba(255, 255, 255, .12); }
.lightbox .iconbtn:hover { background: rgba(255, 255, 255, .22); }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; font-size: 16px; }
.skel { height: 64px; margin: 6px 8px; border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .app { display: block; }
  .side, .pane { position: absolute; inset: 0; width: 100%; transition: transform .32s var(--ease); }
  .side { z-index: 2; border-right: 0; }
  .pane { z-index: 3; transform: translateX(100%); }
  .app[data-view="chat"] .pane { transform: none; }
  .app[data-view="chat"] .side { transform: translateX(-24%); }
  .chat-head .back { display: inline-grid; margin-left: -6px; }
  .row .col { max-width: 84%; }
  .msgs { padding: 0 10px; }
  .quick { margin-left: 0; }
  .sheet { max-height: 92dvh; border-radius: 24px 24px 0 0; align-self: end; }
  .veil { padding: 0; align-items: end; }
  .sheet.wide { max-width: none; }
}
@media (min-width: 901px) {
  .nochat-pane .chat-head { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* =====================================================================
   Communauté : navigation, boutique, portefeuille, « Moi », espaces
   ===================================================================== */

/* ---------- Dock de navigation (bas du volet liste) ---------- */
.dock { display: flex; border-top: 1px solid var(--line); background: var(--surface); padding: 6px 6px calc(6px + var(--safe-b)); flex: none; z-index: 6; }
.dock-btn { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 14px; color: var(--muted); font-size: 11.5px; font-weight: 650; min-width: 0; transition: color .15s, background .15s; }
.dock-btn:hover { background: var(--surface-2); }
.dock-btn.on { color: var(--night); }
:root[data-theme="dark"] .dock-btn.on { color: #7fd1aa; }
.dock-ic { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background .2s; }
.dock-btn.on .dock-ic { background: color-mix(in srgb, var(--night-2) 14%, transparent); }
.dock-ic .i { width: 22px; height: 22px; }
.dock-lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dock-badge { position: absolute; top: -4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.side .tlist { padding-bottom: 88px; }
.side .fab { bottom: calc(84px + var(--safe-b)); }
.avatar.shop { background: linear-gradient(145deg, var(--gold), var(--gold-deep)); color: var(--gold-ink); }
.avatar.shop .i { width: 52%; height: 52%; }
.ro-note { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; text-align: center; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--ink-2); font-size: 14.5px; }
.auth-alt a { font-weight: 700; }
.newchat-actions { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.team-tabs { display: flex; width: 100%; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.team-tabs button { flex: 1; white-space: nowrap; }
.team-tabs .n { margin-left: 6px; background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 1px 7px; font-size: 11.5px; font-weight: 800; }
.btn-light { background: color-mix(in srgb, #fff 16%, transparent); color: var(--ivory); border: 1px solid color-mix(in srgb, #fff 25%, transparent); }
.btn-light:hover:not([disabled]) { background: color-mix(in srgb, #fff 26%, transparent); }
.muted { color: var(--muted); }

/* ---------- Pages (volet de droite) ---------- */
.page { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg); }
.pg-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 66px; flex: none; }
.pg-head h1 { flex: 1; margin: 0; font-family: var(--font-serif); font-size: 21px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-head .back { display: none; }
.pg-actions { display: flex; align-items: center; gap: 6px; }
.pg-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px calc(28px + var(--safe-b)); max-width: 980px; width: 100%; margin: 0 auto; }
.cart-btn { position: relative; }
.cart-btn .dock-badge { top: 2px; right: 0; }
.page-pane { background: var(--bg); }
@media (max-width: 900px) { .pg-head .back { display: inline-grid; margin-left: -6px; } .pg-body { padding: 12px 12px calc(28px + var(--safe-b)); } }

/* ---------- Boutique ---------- */
.pg-search { margin: 0 0 12px; }
.pg-chips { padding: 0 0 12px; flex-wrap: nowrap; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); transition: transform .18s var(--ease), box-shadow .18s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.pcard.out .pimg { filter: grayscale(.6); opacity: .7; }
.pimg-wrap { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-3); }
.pimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.pimg.ph { display: grid; place-items: center; color: hsl(var(--hue, 150) 35% 40% / .55); background: radial-gradient(circle at 30% 25%, hsl(var(--hue, 150) 45% 90%), hsl(var(--hue, 150) 40% 78%)); }
:root[data-theme="dark"] .pimg.ph { background: radial-gradient(circle at 30% 25%, hsl(var(--hue, 150) 30% 24%), hsl(var(--hue, 150) 30% 14%)); color: hsl(var(--hue, 150) 40% 60% / .6); }
.pimg.ph .i { width: 38%; height: 38%; stroke-width: 1.4; }
.pimg.thumb { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.pimg.big { width: 100%; aspect-ratio: 1 / 1; height: auto; border-radius: 18px; }
.ptag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--gold); color: var(--gold-ink); }
.ptag.out { left: auto; right: 10px; background: var(--ink); color: var(--surface); }
.pbody2 { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.seal { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 2px 8px 2px 6px; border-radius: 999px; color: var(--gold-deep); background: color-mix(in srgb, var(--gold) 20%, transparent); }
.seal .i { width: 13px; height: 13px; stroke-width: 2; }
.seal.partner { color: var(--ink-2); background: var(--surface-3); }
:root[data-theme="dark"] .seal { color: var(--gold); }
.pname { text-align: left; font-weight: 650; font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.pprice { font-weight: 800; font-size: 15px; color: var(--night); display: flex; flex-direction: column; line-height: 1.15; }
:root[data-theme="dark"] .pprice { color: #9be3c1; }
.pprice s { font-weight: 500; font-size: 12px; color: var(--muted); }
.pprice.big { font-size: 24px; flex-direction: row; align-items: baseline; gap: 10px; }
.pact { display: flex; gap: 6px; }
.iconbtn.round { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); }
.iconbtn.round.add { background: var(--night); color: var(--ivory); }
.iconbtn.round.add[disabled] { opacity: .4; }
:root[data-theme="dark"] .iconbtn.round.add { background: var(--night-2); }
.pmore { text-align: center; margin: 18px 0 4px; }
.pdetail { display: grid; gap: 16px; }
.pdinfo { display: grid; gap: 10px; }
.pstock { font-size: 13.5px; font-weight: 700; } .pstock.ok { color: var(--ok); } .pstock.no { color: var(--danger); }
.ptagline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); } .ptagline .i { width: 16px; height: 16px; }
.pdesc { margin: 0; color: var(--ink-2); white-space: pre-line; }
.callout.soft { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 999px; padding: 3px; }
.qty .iconbtn { width: 34px; height: 34px; background: var(--surface); }
.qty-n { min-width: 28px; text-align: center; font-weight: 800; }
.qty.sm .iconbtn { width: 30px; height: 30px; }
@media (min-width: 640px) { .pdetail { grid-template-columns: 240px 1fr; align-items: start; } }

/* Panier et commande */
.cline { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cline:last-child { border-bottom: 0; }
.cinfo { flex: 1; min-width: 0; } .cname { font-weight: 650; line-height: 1.25; } .cprice { font-size: 13.5px; color: var(--muted); }
.cart-foot { display: flex; align-items: center; gap: 14px; width: 100%; justify-content: space-between; }
.ctotal { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); } .ctotal b { font-size: 20px; color: var(--ink); }
.csum { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; }
.csrow { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14.5px; }
.csrow.tot { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 10px; font-size: 16px; }
.payopts { display: grid; gap: 8px; margin-bottom: 8px; }
.payopt { text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); display: grid; gap: 2px; }
.payopt span { font-size: 13px; color: var(--muted); }
.payopt.on { border-color: var(--night-2); background: color-mix(in srgb, var(--night-2) 8%, var(--surface)); }
.success { text-align: center; padding: 8px 0 4px; }
.success h3 { font-family: var(--font-serif); font-size: 24px; margin: 8px 0 6px; font-weight: 650; }
.success p { margin: 6px 0; }
.sicon { width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); display: grid; place-items: center; margin: 0 auto; }
.sicon .i { width: 34px; height: 34px; } .sicon.warn { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold-deep); }

/* Commandes */
.ocard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; background: var(--surface); }
.ohead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ometa { font-size: 13px; color: var(--muted); margin: 4px 0 6px; } .oitems { font-size: 14px; color: var(--ink-2); }
.steps { display: flex; gap: 0; margin-top: 14px; }
.step { flex: 1; display: grid; justify-items: center; gap: 6px; position: relative; font-size: 11.5px; color: var(--muted); text-align: center; }
.step i { width: 14px; height: 14px; border-radius: 50%; background: var(--line-2); display: block; position: relative; z-index: 1; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 6px; left: 50%; width: 100%; height: 2px; background: var(--line-2); }
.step.done { color: var(--ink); font-weight: 650; } .step.done i { background: var(--night-2); } .step.done:not(:last-child)::after { background: var(--night-2); }

/* Partage */
.sharecard { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sharegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.sbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 14px; font-weight: 700; font-size: 14.5px; background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
.sbtn .i { width: 18px; height: 18px; }
.sbtn.whatsapp { background: #1fa855; color: #fff; border-color: transparent; }
.sbtn.facebook { background: #1877f2; color: #fff; border-color: transparent; }
.sbtn.telegram { background: #229ed9; color: #fff; border-color: transparent; }

/* ---------- Portefeuille ---------- */
.wal-card { background: linear-gradient(150deg, var(--night), var(--night-deep)); color: var(--ivory); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-2); position: relative; overflow: hidden; }
.wal-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 38%, transparent), transparent 70%); }
.wal-lb { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.wal-amt { font-family: var(--font-serif); font-size: 44px; font-weight: 650; margin: 6px 0 2px; letter-spacing: -.02em; } .wal-amt small { font-size: 18px; font-family: var(--font-ui); opacity: .8; }
.wal-ph { font-size: 13px; opacity: .65; font-family: ui-monospace, Menlo, Consolas, monospace; }
.wal-actions { display: flex; gap: 10px; margin-top: 20px; position: relative; z-index: 1; flex-wrap: wrap; }
.wal-lock { text-align: center; padding: 40px 18px; max-width: 420px; margin: 0 auto; } .wal-lock h3 { font-family: var(--font-serif); font-size: 24px; margin: 14px 0 8px; font-weight: 650; } .wal-lock p { color: var(--ink-2); margin: 0 0 18px; }
.hist { display: grid; gap: 2px; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.hic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); flex: none; } .hic.in { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); } .hic .i { width: 20px; height: 20px; }
.hmain2 { flex: 1; min-width: 0; display: grid; } .hmain2 span { font-size: 13px; color: var(--muted); }
.hamt { font-weight: 800; white-space: nowrap; } .hamt.in { color: var(--ok); }
.input.otp { text-align: center; font-size: 26px; letter-spacing: .4em; font-weight: 800; }

/* ---------- Moi ---------- */
.mecard { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); margin-bottom: 14px; box-shadow: var(--shadow-1); }
.mecard.col { flex-direction: column; align-items: stretch; gap: 8px; }
.mecard .memain { flex: 1; min-width: 0; } .mn { font-weight: 750; font-size: 16.5px; } .ms { font-size: 13.5px; color: var(--muted); }
.mecard.role { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.ricon { width: 46px; height: 46px; border-radius: 14px; background: var(--night); color: var(--gold); display: grid; place-items: center; flex: none; } .ricon .i { width: 24px; height: 24px; }
.sechead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mecard .sec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); margin: 0 0 4px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); } .frow:last-child { border-bottom: 0; } .frow.dim { opacity: .65; }
.fmain { flex: 1; min-width: 0; display: grid; } .fmain span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 14px 6px; width: 100%; text-align: left; font-weight: 600; border-radius: 12px; } .lrow:hover { background: var(--surface-2); } .lrow .lr { margin-left: auto; opacity: .5; } .lrow.danger { color: var(--danger); }
.kinds { display: grid; gap: 10px; }
.kind { text-align: left; display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface-2); }
.kind:hover:not([disabled]) { border-color: var(--night-2); background: var(--surface); } .kind[disabled] { opacity: .55; }
.kind .kic { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; background: var(--night); color: var(--gold); display: grid; place-items: center; } .kind .kic .i { width: 22px; height: 22px; }
.kind span { font-size: 13.5px; color: var(--muted); }

/* ---------- Fournisseur / commercial ---------- */
.reassure { display: grid; gap: 4px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, var(--night), var(--night-deep)); color: var(--ivory); margin-bottom: 14px; } .reassure b { font-family: var(--font-serif); font-size: 19px; font-weight: 650; } .reassure span { opacity: .8; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; } .stat .sv { font-size: 20px; font-weight: 800; letter-spacing: -.01em; } .stat .sl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.ok .sv { color: var(--ok); } .stat.gold { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.pg-body > .sec { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); margin: 22px 0 8px; }
.plist2, .feed { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 14px; }
.prow2 { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .prow2:last-child { border-bottom: 0; }
.pmain2 { flex: 1; min-width: 0; display: grid; } .pmain2 span { font-size: 13px; color: var(--muted); }
.psold { text-align: center; display: grid; } .psold b { font-size: 20px; } .psold span, .psold em { font-size: 12px; color: var(--muted); font-style: normal; }
.frow2 { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .frow2:last-child { border-bottom: 0; } .frow2 > div:nth-child(2) { flex: 1; min-width: 0; display: grid; } .frow2 span { font-size: 13px; color: var(--muted); }
.fdot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; } .fdot.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); } .fdot .i { width: 18px; height: 18px; }
.famt { font-weight: 800; white-space: nowrap; }
.photo-btn { width: 100%; margin-bottom: 14px; border-radius: var(--r-md); border: 1.5px dashed var(--line-2); background: var(--surface-2); min-height: 120px; display: grid; place-items: center; overflow: hidden; }
.photo-prev { display: grid; place-items: center; gap: 6px; color: var(--muted); padding: 18px; font-weight: 600; } .photo-prev .i { width: 30px; height: 30px; } .photo-prev img { max-width: 100%; max-height: 220px; display: block; }

/* ---------- Gestion ---------- */
.acard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; background: var(--surface); }
.ahead { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; } .ahead > div { flex: 1; min-width: 0; display: grid; } .ahead span:not(.tag) { font-size: 13px; color: var(--muted); }
.amsg { margin: 6px 0 10px; color: var(--ink-2); font-style: italic; }
.xtra { display: grid; gap: 4px; margin-bottom: 10px; font-size: 13.5px; } .xrow { display: flex; gap: 8px; } .xrow span { color: var(--muted); min-width: 110px; text-transform: capitalize; }
.pricegrid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 6px; }
@media (max-width: 520px) { .pricegrid { grid-template-columns: 1fr; } .pgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .wal-amt { font-size: 38px; } }
