/* ============================================================
   CHAT.général
   ============================================================ */
.chat { position: relative; height: 100%; display: flex; flex-direction: column; background: var(--cream); overflow: hidden; }
.chat * { box-sizing: border-box; }
.ch-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--mint); border-bottom: var(--bd); }
.ch-globe { width: 42px; height: 42px; display: grid; place-items: center; font-size: 24px; background: var(--paper); border: var(--bd); border-radius: 50%; }
.ch-head b { display: block; font: 17px var(--f-title); }
.ch-head small { font-weight: 700; font-size: 13px; }
.ch-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 3px; user-select: text; -webkit-user-select: text;
  background-image: radial-gradient(rgba(20, 16, 31, .06) 1px, transparent 1.2px); background-size: 14px 14px; }
.ch-empty { margin: auto; display: grid; justify-items: center; gap: 8px; font-size: 48px; opacity: .6; }
.ch-empty small { font-size: 14px; font-weight: 700; }
.ch-day { align-self: center; margin: 12px 0 6px; padding: 3px 12px; font-size: 12px; font-weight: 800; text-transform: capitalize; background: var(--ink); color: #fff; border-radius: 99px; }
.ch-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; max-width: 86%; animation: ch-in .2s ease both; }
.ch-row.cont { margin-top: 0; }
.ch-row.me { align-self: flex-end; }
.ch-av { flex: none; width: 32px; height: 32px; display: grid; place-items: center; font: 14px var(--f-title); color: #fff; border: 2px solid var(--ink); border-radius: 50%; }
.ch-row.cont .ch-av { visibility: hidden; height: 0; border: 0; }
.ch-bub { position: relative; min-width: 0; padding: 7px 12px 6px; background: #fff; border: 2px solid var(--ink); border-radius: 14px 14px 14px 4px; box-shadow: 2px 2px 0 var(--ink); }
.ch-row.cont .ch-bub { border-radius: 4px 14px 14px 4px; }
.ch-row.me .ch-bub { background: var(--pink); color: #fff; border-radius: 14px 14px 4px 14px; }
.ch-row.me.cont .ch-bub { border-radius: 14px 4px 4px 14px; }
.ch-name { display: block; font-size: 13px; font-weight: 800; margin-bottom: 1px; }
.ch-bub p { margin: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.ch-bub a { color: inherit; font-weight: 700; }
.ch-at { color: var(--violet); }
.ch-row.me .ch-at { color: var(--yellow); }
.ch-at.is-me { background: var(--yellow); color: var(--ink); border-radius: 4px; padding: 0 3px; }
.ch-bub time { display: block; text-align: right; font-size: 11px; opacity: .55; margin-top: 1px; }
.ch-new { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 2; padding: 7px 14px; font-weight: 800; background: var(--yellow); border: var(--bd); border-radius: 99px; box-shadow: var(--sh-s); }
.ch-send { display: flex; gap: 8px; padding: 10px; border-top: var(--bd); background: var(--paper); }
.ch-send input { flex: 1; min-width: 0; font-size: 16px; padding: 11px 14px; border: var(--bd); border-radius: 99px; background: #fff; outline: none; user-select: text; -webkit-user-select: text; }
.ch-send input:focus { box-shadow: 0 0 0 3px var(--pink); }
.ch-send button { flex: none; width: 50px; height: 50px; font-size: 20px; color: #fff; background: var(--pink); border: var(--bd); border-radius: 50%; box-shadow: var(--sh-s); }
.ch-send button:disabled { opacity: .5; }
.ch-guest { padding: 12px; border-top: var(--bd); background: var(--paper); display: grid; }
@keyframes ch-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- onglets + concours de poèmes ---------- */
.ch-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: var(--bd); background: var(--paper); }
.ch-tabs button { padding: 10px 6px; border: 0; background: none; font: 700 14px var(--f-ui); color: var(--ink); opacity: .55; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.ch-tabs button.on { opacity: 1; border-bottom-color: var(--pink); }
.chat.is-poem .ch-list, .chat.is-poem .ch-send, .chat.is-poem .ch-guest, .chat.is-poem .ch-new { display: none; }
.ch-poems { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.ch-poems.hidden { display: none; }
.po-intro { display: grid; gap: 4px; padding: 14px 16px; border: var(--bd); border-radius: 14px; background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); }
.po-intro b { font: 17px/1.15 var(--f-title); }
.po-intro span { font-size: 14px; line-height: 1.4; }
.po-form { display: grid; gap: 8px; }
.po-form textarea { width: 100%; resize: vertical; padding: 12px 14px; border: var(--bd); border-radius: 12px; font: italic 16px/1.5 Georgia, 'Playfair Display', serif; background: #fff; color: var(--ink); user-select: text; -webkit-user-select: text; }
.po-form div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.po-count { font-size: 12px; opacity: .6; }
.po-guest { display: grid; }
.po-list { display: grid; gap: 10px; }
.po-empty { margin: 20px auto; text-align: center; opacity: .6; font-weight: 700; }
.po-card { padding: 12px 14px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.po-card.is-top { background: #fff8d6; box-shadow: 3px 3px 0 var(--ink), 0 0 0 3px var(--yellow); }
.po-card header { display: flex; align-items: center; gap: 8px; }
.po-card header b { font-size: 15px; }
.po-card header em { margin-left: auto; padding: 2px 9px; border-radius: 99px; background: var(--ink); color: #fff; font: 800 11px var(--f-ui); font-style: normal; }
.po-card header em.me { background: var(--pink); }
.po-card header em + em { margin-left: 4px; }
.po-card p { margin: 10px 0; font: italic 16px/1.55 Georgia, 'Playfair Display', serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.po-card footer { display: flex; align-items: center; gap: 8px; }
.po-like { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; font: 800 14px var(--f-ui); color: var(--ink); }
.po-like svg { width: 18px; height: 18px; fill: none; stroke: var(--pink); stroke-width: 2.4; }
.po-like.on { background: var(--pink); color: #fff; }
.po-like.on svg { fill: #fff; stroke: #fff; }
.po-like:disabled { opacity: .6; }
.po-del { margin-left: auto; padding: 6px 10px; border: 0; background: none; color: #c1121f; font-weight: 700; }

.po-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.po-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 0; border-radius: 8px; background: none; font: 800 14px var(--f-ui); color: var(--ink); }
.po-tabs button.on { background: var(--ink); color: #fff; }
.po-tabs i { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font: 800 11px/18px var(--f-ui); font-style: normal; }
.po-tabs i:empty { display: none; }
