/* =========================================================
   RiverSync DS v2 — CHAT layer (.rs-chat)
   Customer ↔ support-staff messaging: bubbles with delivery
   states, channel chips, system events, typing indicator,
   file / image / markdown-artifact attachments, in-thread
   alert & appointment cards, slot picker, and the composer.

   Bubble styles:  .rs-chat[data-bubbles="soft"] (default,
   anchored 3/10px corners) · [data-bubbles="square"] (brand-
   tight uniform radius).
   Density:        .rs-chat[data-density="comfortable"].
   ========================================================= */

.rs-chat{
  --chat-gap:14px;
  --chat-pad:9px 12px;
  --chat-fs:13px;
  --chat-max:78%;
  display:flex; flex-direction:column; gap:var(--chat-gap);
  font-family:var(--rs-font-sans); font-size:var(--chat-fs); color:var(--fg);
}
.rs-chat[data-density="comfortable"]{--chat-gap:18px; --chat-pad:12px 15px; --chat-fs:13.5px;}

/* per-element tone remap (events, alert cards) */
.rs-chat-event[data-tone="success"], .rs-chat-alertcard[data-tone="success"]{--ct:var(--success); --ct-soft:var(--success-soft); --ct-border:var(--success-border);}
.rs-chat-event[data-tone="warning"], .rs-chat-alertcard[data-tone="warning"]{--ct:var(--warning); --ct-soft:var(--warning-soft); --ct-border:var(--warning-border);}
.rs-chat-event[data-tone="danger"], .rs-chat-alertcard[data-tone="danger"]{--ct:var(--danger); --ct-soft:var(--danger-soft); --ct-border:var(--danger-border);}
.rs-chat-event[data-tone="critical"], .rs-chat-alertcard[data-tone="critical"]{--ct:var(--critical); --ct-soft:var(--critical-soft); --ct-border:var(--critical-border);}
.rs-chat-event[data-tone="info"], .rs-chat-alertcard[data-tone="info"]{--ct:var(--info); --ct-soft:var(--info-soft); --ct-border:var(--info-border);}
.rs-chat-event[data-tone="accent"], .rs-chat-alertcard[data-tone="accent"]{--ct:var(--accent); --ct-soft:var(--accent-soft); --ct-border:var(--accent-border);}
.rs-chat-event[data-tone="neutral"], .rs-chat-alertcard[data-tone="neutral"]{--ct:var(--neutral); --ct-soft:var(--neutral-soft); --ct-border:var(--neutral-border);}

/* ---------------------------------------------------------
   1 · Message row + bubble
   --------------------------------------------------------- */
.rs-chat-msg{display:flex; gap:10px; align-items:flex-start; max-width:var(--chat-max); min-width:0;}
.rs-chat-msg.is-me{flex-direction:row-reverse; margin-left:auto;}
.rs-chat-msg__av{flex:none; padding-top:1px;}
.rs-chat-msg__wrap{min-width:0; display:flex; flex-direction:column; align-items:flex-start;}
.rs-chat-msg.is-me .rs-chat-msg__wrap{align-items:flex-end;}

.rs-chat-msg__meta{display:flex; align-items:baseline; gap:7px; margin-bottom:3px;}
.rs-chat-msg.is-me .rs-chat-msg__meta{flex-direction:row-reverse;}
.rs-chat-msg__name{font-size:12px; font-weight:600; color:var(--fg);}
.rs-chat-msg__time{font-family:var(--rs-font-mono); font-size:10px; color:var(--fg3); letter-spacing:.02em;}

/* channel chip — portal / phone / on-site, matching the ticket thread idiom */
.rs-chat-msg__ch{font-size:9.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  padding:1px 6px; border-radius:var(--r-pill); border:1px solid var(--border-strong); color:var(--fg3);}
.rs-chat-msg__ch--phone{color:var(--accent); border-color:var(--accent-border);}
.rs-chat-msg__ch--on-site{color:var(--success); border-color:var(--success-border);}

.rs-chat-msg__bubble{box-sizing:border-box; max-width:100%; font-size:var(--chat-fs); line-height:1.55; color:var(--fg);
  background:var(--surface-2); border:1px solid var(--border); padding:var(--chat-pad);
  border-radius:var(--r-sm) 10px 10px 10px; overflow-wrap:break-word;}
.rs-chat-msg.is-me .rs-chat-msg__bubble{background:var(--accent-soft); border-color:var(--accent-border);
  border-radius:10px var(--r-sm) 10px 10px;}
.rs-chat[data-bubbles="square"] .rs-chat-msg__bubble,
.rs-chat[data-bubbles="square"] .rs-chat-msg.is-me .rs-chat-msg__bubble{border-radius:var(--r-md);}
.rs-chat-msg__bubble > * + *{margin-top:8px;}
.rs-chat-msg__bubble p{margin:0;}

/* cards under a message (attachments, alert, appointment, slots…) */
.rs-chat-msg__cards{display:flex; flex-direction:column; gap:6px; margin-top:5px; max-width:100%;
  align-items:flex-start; min-width:0;}
.rs-chat-msg.is-me .rs-chat-msg__cards{align-items:flex-end;}
.rs-chat-msg__meta:empty{display:none;}

/* internal note (staff-only) */
.rs-chat-msg__bubble.is-note{background:var(--warning-soft); border:1px dashed var(--warning-border);}
.rs-chat-msg__notetag{font-size:9.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--warning); padding:1px 6px; border:1px solid var(--warning-border); border-radius:var(--r-pill);}

/* delivery state under the bubble */
.rs-chat-msg__state{display:inline-flex; align-items:center; gap:4px; margin-top:3px;
  font-size:10.5px; color:var(--fg3);}
.rs-chat-msg__ticks{display:inline-flex;}
.rs-chat-msg__ticks .rs-ic{width:11px; height:11px;}
.rs-chat-msg__ticks .rs-ic + .rs-ic{margin-left:-7px;}
.rs-chat-msg__state.is-read{color:var(--accent);}
.rs-chat-msg__state.is-sending{font-style:italic;}

/* ---------------------------------------------------------
   2 · Day divider · unread marker · system event rows
   --------------------------------------------------------- */
.rs-chat-day{display:flex; align-items:center; gap:12px; color:var(--fg3);
  font-family:var(--rs-font-mono); font-size:10px; letter-spacing:.06em; text-transform:uppercase;}
.rs-chat-day::before, .rs-chat-day::after{content:""; flex:1; height:1px; background:var(--border);}

.rs-chat-unread{display:flex; align-items:center; gap:12px; color:var(--danger);
  font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;}
.rs-chat-unread::before, .rs-chat-unread::after{content:""; flex:1; height:1px; background:var(--danger-border);}

.rs-chat-event{display:flex; align-items:center; gap:9px; padding:1px 0; color:var(--fg3); font-size:12px;
  --ct:var(--fg3); --ct-soft:var(--surface); --ct-border:var(--border-strong);}
.rs-chat-event__ic{width:22px; height:22px; border-radius:50%; border:1.5px dashed var(--ct-border); flex:none;
  display:flex; align-items:center; justify-content:center; color:var(--ct); background:var(--ct-soft);}
.rs-chat-event__ic .rs-ic{width:12px; height:12px;}
.rs-chat-event[data-tone] .rs-chat-event__ic{border-style:solid;}
.rs-chat-event__txt{flex:1; min-width:0; line-height:1.45;}
.rs-chat-event__txt b{color:var(--fg2); font-weight:600;}
.rs-chat-event__time{font-family:var(--rs-font-mono); font-size:10px; white-space:nowrap;}

/* ---------------------------------------------------------
   3 · Typing indicator
   --------------------------------------------------------- */
.rs-chat-typing{display:inline-flex; align-items:center; gap:4px; padding:10px 13px;}
.rs-chat-typing__dot{width:5px; height:5px; border-radius:50%; background:var(--fg3); opacity:.4;}
@media (prefers-reduced-motion: no-preference){
  .rs-chat-typing__dot{animation:rsChatTyping 1.2s infinite var(--ease);}
  .rs-chat-typing__dot:nth-child(2){animation-delay:.15s;}
  .rs-chat-typing__dot:nth-child(3){animation-delay:.3s;}
  @keyframes rsChatTyping{0%,60%,100%{opacity:.35; transform:none;} 30%{opacity:1; transform:translateY(-2px);}}
}

/* ---------------------------------------------------------
   4 · File attachment card (+ upload progress / error)
   --------------------------------------------------------- */
.rs-chat-file{display:flex; gap:10px; align-items:center; min-width:230px; max-width:340px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:8px 10px;}
.rs-chat-file__ic{width:32px; height:32px; flex:none; border-radius:var(--r-sm);
  background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center;}
.rs-chat-file__ic .rs-ic{width:16px; height:16px;}
.rs-chat-file__body{flex:1; min-width:0;}
.rs-chat-file__name{font-size:12.5px; font-weight:600; color:var(--fg); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.rs-chat-file__sub{font-size:11px; color:var(--fg3); font-variant-numeric:tabular-nums;}
.rs-chat-file__sub b{font-weight:600; letter-spacing:.03em;}
.rs-chat-file__track{height:3px; border-radius:2px; background:var(--border); margin-top:5px; overflow:hidden;}
.rs-chat-file__fill{height:100%; border-radius:2px; background:var(--accent); transition:width .25s var(--ease);}
.rs-chat-file.is-error{border-color:var(--danger-border);}
.rs-chat-file.is-error .rs-chat-file__ic{background:var(--danger-soft); color:var(--danger);}
.rs-chat-file.is-error .rs-chat-file__sub{color:var(--danger);}

/* ---------------------------------------------------------
   5 · Image attachments + lightbox
   --------------------------------------------------------- */
.rs-chat-imgs{display:flex; flex-wrap:wrap; gap:6px; max-width:420px;}
.rs-chat-img{position:relative; padding:0; border:1px solid var(--border); border-radius:var(--r-md);
  overflow:hidden; cursor:zoom-in; background:var(--surface-2); display:block;}
.rs-chat-img img{display:block; width:138px; height:104px; object-fit:cover;}
.rs-chat-img--lg img{width:280px; height:180px;}
.rs-chat-img::after{content:""; position:absolute; inset:0; background:rgba(26,32,38,0);
  transition:background .12s var(--ease);}
.rs-chat-img:hover::after{background:rgba(26,32,38,.16);}
.rs-chat-img:focus-visible{outline:none; box-shadow:0 0 0 3px var(--ring);}

.rs-chat-lightbox{position:fixed; inset:0; z-index:120; display:flex; align-items:center; justify-content:center;
  flex-direction:column; gap:12px; background:rgba(26,32,38,.78); padding:48px; cursor:zoom-out;}
.rs-chat-lightbox img{max-width:min(960px,100%); max-height:80vh; border-radius:var(--r-md);
  box-shadow:var(--shadow-lg); background:#fff;}
.rs-chat-lightbox figcaption{color:#fff; font-size:12px; opacity:.85; display:flex; gap:10px; align-items:center;}
.rs-chat-lightbox figcaption .mono{font-family:var(--rs-font-mono); font-size:10.5px; opacity:.7;}

/* ---------------------------------------------------------
   6 · Markdown body (.rs-chat-md) — chat-scaled prose
   --------------------------------------------------------- */
.rs-chat-md{font-size:inherit; line-height:1.6; min-width:0;}
.rs-chat-md > * + *{margin-top:8px;}
.rs-chat-md p{margin:0;}
.rs-chat-md h1, .rs-chat-md h2, .rs-chat-md h3{margin:0; font-weight:600; line-height:1.35;}
.rs-chat-md h1{font-size:14.5px;} .rs-chat-md h2{font-size:13.5px;} .rs-chat-md h3{font-size:13px;}
.rs-chat-md ul, .rs-chat-md ol{margin:0; padding-left:20px; display:flex; flex-direction:column; gap:3px;}
.rs-chat-md a{color:var(--accent); text-decoration:none;}
.rs-chat-md a:hover{text-decoration:underline;}
.rs-chat-md blockquote{margin:0; padding:2px 0 2px 11px; border-left:3px solid var(--border-strong); color:var(--fg2);}
.rs-chat-md hr{border:0; border-top:1px solid var(--border); margin:2px 0;}
.rs-chat-md code{font-family:var(--rs-font-mono); font-size:.86em; background:var(--surface-3);
  border:1px solid var(--border); border-radius:var(--r-sm); padding:1px 5px;}

/* fenced code block with header (language tag + copy) */
.rs-chat-md__pre{border:1px solid var(--border); border-radius:var(--r-md); background:var(--surface);
  overflow:hidden; max-width:100%;}
.rs-chat-md__prehead{display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:5px 6px 5px 11px; border-bottom:1px solid var(--border); background:var(--surface-2);}
.rs-chat-md__lang{font-family:var(--rs-font-mono); font-size:9.5px; letter-spacing:.06em;
  text-transform:uppercase; color:var(--fg3);}
.rs-chat-md__copy{display:inline-flex; align-items:center; gap:5px; border:0; background:transparent;
  color:var(--fg3); font:500 10.5px/1 var(--rs-font-sans); padding:4px 7px; border-radius:var(--r-sm); cursor:pointer;}
.rs-chat-md__copy:hover{background:var(--surface-3); color:var(--fg);}
.rs-chat-md__copy .rs-ic{width:12px; height:12px;}
.rs-chat-md__pre pre{margin:0; padding:10px 12px; overflow:auto; font-family:var(--rs-font-mono);
  font-size:11.5px; line-height:1.6; color:var(--fg);}
.rs-chat-md__pre code{background:none; border:0; padding:0; font-size:inherit;}

.rs-chat-md table{border-collapse:collapse; width:100%; font-size:12px;}
.rs-chat-md th{font-size:10px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  color:var(--fg3); text-align:left; padding:5px 10px; border-bottom:1px solid var(--border-strong);}
.rs-chat-md td{padding:6px 10px; border-bottom:1px solid var(--border); font-variant-numeric:tabular-nums;}
.rs-chat-md tr:last-child td{border-bottom:0;}

/* ---------------------------------------------------------
   7 · Markdown artifact card (document shared into the thread)
   --------------------------------------------------------- */
.rs-chat-artifact{min-width:260px; max-width:380px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden;}
.rs-chat-artifact__head{display:flex; align-items:center; gap:10px; padding:9px 11px;}
.rs-chat-artifact__ic{width:32px; height:32px; flex:none; border-radius:var(--r-sm);
  background:var(--maintenance-soft); color:var(--maintenance); display:flex; align-items:center; justify-content:center;}
.rs-chat-artifact__ic .rs-ic{width:16px; height:16px;}
.rs-chat-artifact__t{flex:1; min-width:0;}
.rs-chat-artifact__name{font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.rs-chat-artifact__meta{font-size:11px; color:var(--fg3);}
.rs-chat-artifact__tag{font-family:var(--rs-font-mono); font-size:9px; font-weight:700; letter-spacing:.05em;
  color:var(--maintenance); border:1px solid var(--maintenance-border); border-radius:var(--r-xs); padding:1px 4px; flex:none;}
.rs-chat-artifact__peek{position:relative; max-height:96px; overflow:hidden; padding:0 11px;
  border-top:1px solid var(--border); background:var(--surface-2); font-size:11.5px;}
.rs-chat-artifact__peek .rs-chat-md{padding:8px 0; font-size:11.5px;}
.rs-chat-artifact__peek::after{content:""; position:absolute; left:0; right:0; bottom:0; height:34px;
  background:linear-gradient(to bottom, transparent, var(--surface-2));}
.rs-chat-artifact__foot{display:flex; gap:8px; padding:8px 11px; border-top:1px solid var(--border);}

/* ---------------------------------------------------------
   8 · In-thread alert / alarm card
   --------------------------------------------------------- */
.rs-chat-alertcard{display:flex; gap:10px; align-items:flex-start; min-width:280px; max-width:420px;
  background:var(--ct-soft); border:1px solid var(--ct-border); border-radius:var(--r-md); padding:10px 12px;
  --ct:var(--danger); --ct-soft:var(--danger-soft); --ct-border:var(--danger-border);}
.rs-chat-alertcard__ic{position:relative; width:28px; height:28px; flex:none; border-radius:50%;
  background:var(--surface); border:1px solid var(--ct-border); color:var(--ct);
  display:flex; align-items:center; justify-content:center;}
.rs-chat-alertcard__ic .rs-ic{width:14px; height:14px;}
.rs-chat-alertcard__body{flex:1; min-width:0;}
.rs-chat-alertcard__title{font-size:12.5px; font-weight:600; color:var(--fg); display:flex; align-items:center; gap:7px; flex-wrap:wrap;}
.rs-chat-alertcard__kicker{font-size:9.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--ct);}
.rs-chat-alertcard__desc{font-size:12px; color:var(--fg2); line-height:1.5; margin-top:2px;}
.rs-chat-alertcard__desc .mono, .rs-chat-alertcard__ref{font-family:var(--rs-font-mono); font-variant-numeric:tabular-nums;}
.rs-chat-alertcard__foot{display:flex; align-items:center; gap:10px; margin-top:7px;}
.rs-chat-alertcard__ref{font-size:10.5px; color:var(--fg3);}
.rs-chat-alertcard__link{display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:600;
  color:var(--accent); background:none; border:0; padding:0; cursor:pointer; text-decoration:none;}
.rs-chat-alertcard__link:hover{text-decoration:underline;}
.rs-chat-alertcard__link .rs-ic{width:12px; height:12px;}

/* alarm state — live incident: the icon disc pings (reduced-motion honored) */
@media (prefers-reduced-motion: no-preference){
  .rs-chat-alertcard.is-alarm .rs-chat-alertcard__ic::after{content:""; position:absolute; inset:-1px;
    border-radius:50%; border:1px solid var(--ct); animation:rsChatPing 1.8s var(--ease) infinite;}
  @keyframes rsChatPing{0%{opacity:.7; transform:scale(1);} 70%,100%{opacity:0; transform:scale(1.7);}}
}

/* ---------------------------------------------------------
   9 · Scheduling — slot picker + appointment card
   --------------------------------------------------------- */
.rs-chat-slots{min-width:280px; max-width:380px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-md); padding:11px 12px;}
.rs-chat-slots__title{display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; margin-bottom:9px;}
.rs-chat-slots__title .rs-ic{width:14px; height:14px; color:var(--accent);}
.rs-chat-slots__day{font-size:10px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  color:var(--fg3); margin:9px 0 5px;}
.rs-chat-slots__day:first-of-type{margin-top:0;}
.rs-chat-slots__row{display:flex; flex-wrap:wrap; gap:6px;}
.rs-chat-slot{appearance:none; font:500 11.5px/1 var(--rs-font-sans); font-variant-numeric:tabular-nums;
  color:var(--fg2); background:var(--surface); border:1px solid var(--border-strong); border-radius:var(--r-sm);
  padding:6px 9px; cursor:pointer; transition:border-color .12s var(--ease), background .12s var(--ease);}
.rs-chat-slot:hover{border-color:var(--accent); color:var(--accent);}
.rs-chat-slot.is-selected{background:var(--accent); border-color:var(--accent); color:#fff;}
.rs-chat-slot:disabled{opacity:.4; cursor:default; text-decoration:line-through;}
.rs-chat-slot:focus-visible{outline:none; box-shadow:0 0 0 3px var(--ring);}
.rs-chat-slots__foot{display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-top:11px; padding-top:10px; border-top:1px solid var(--border);}
.rs-chat-slots__hint{font-size:11px; color:var(--fg3);}
.rs-chat-slots.is-done{opacity:.75;}

.rs-chat-appt{display:flex; gap:12px; min-width:280px; max-width:400px; background:var(--surface);
  border:1px solid var(--border); border-radius:var(--r-md); padding:11px 12px; align-items:flex-start;}
.rs-chat-appt__date{flex:none; width:46px; border:1px solid var(--accent-border); border-radius:var(--r-sm);
  overflow:hidden; text-align:center; background:var(--surface);}
.rs-chat-appt__mo{display:block; font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:#fff; background:var(--accent); padding:2px 0;}
.rs-chat-appt__d{display:block; font-family:var(--rs-font-mono); font-size:17px; font-weight:600;
  color:var(--fg); padding:3px 0 4px; font-variant-numeric:tabular-nums;}
.rs-chat-appt__body{flex:1; min-width:0;}
.rs-chat-appt__title{font-size:12.5px; font-weight:600; display:flex; align-items:center; gap:7px; flex-wrap:wrap;}
.rs-chat-appt__sub{font-size:11.5px; color:var(--fg2); margin-top:2px; line-height:1.5;}
.rs-chat-appt__sub .mono{font-family:var(--rs-font-mono); font-size:10.5px;}
.rs-chat-appt__foot{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap;}

/* ---------------------------------------------------------
   10 · Composer
   --------------------------------------------------------- */
.rs-chat-composer{position:relative; border:1px solid var(--border); border-radius:var(--r-lg);
  background:var(--surface); transition:border-color .12s var(--ease), box-shadow .12s var(--ease);}
.rs-chat-composer:focus-within{border-color:var(--accent); box-shadow:0 0 0 3px var(--ring);}
.rs-chat-composer.is-dragover{border:1px dashed var(--accent);}
.rs-chat-composer__drop{position:absolute; inset:0; z-index:2; display:flex; align-items:center; justify-content:center;
  gap:8px; border-radius:var(--r-lg); background:var(--accent-soft); color:var(--accent);
  font-size:12.5px; font-weight:600; pointer-events:none;}
.rs-chat-composer__drop .rs-ic{width:16px; height:16px;}

.rs-chat-composer__stage{display:flex; flex-wrap:wrap; gap:6px; padding:10px 12px 0;}
.rs-chat-stagechip{display:flex; align-items:center; gap:8px; max-width:240px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:var(--r-sm); padding:5px 6px 5px 8px; font-size:11.5px;}
.rs-chat-stagechip__thumb{width:24px; height:24px; flex:none; border-radius:var(--r-xs); object-fit:cover;
  border:1px solid var(--border);}
.rs-chat-stagechip > .rs-ic{width:14px; height:14px; flex:none; color:var(--fg3);}
.rs-chat-stagechip__t{min-width:0;}
.rs-chat-stagechip__name{font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:140px;}
.rs-chat-stagechip__track{height:2px; border-radius:1px; background:var(--border); margin-top:3px; overflow:hidden;}
.rs-chat-stagechip__fill{height:100%; background:var(--accent); transition:width .2s var(--ease);}
.rs-chat-stagechip__x{appearance:none; border:0; background:transparent; color:var(--fg3); width:18px; height:18px;
  border-radius:var(--r-xs); cursor:pointer; display:flex; align-items:center; justify-content:center; flex:none;}
.rs-chat-stagechip__x:hover{background:var(--surface-3); color:var(--fg);}
.rs-chat-stagechip__x .rs-ic{width:11px; height:11px;}

.rs-chat-composer textarea{display:block; width:100%; box-sizing:border-box; border:0; background:transparent;
  resize:none; padding:11px 13px 6px; font:inherit; font-size:13px; line-height:1.55; color:var(--fg);
  min-height:42px; max-height:180px; outline:none;}
.rs-chat-composer textarea::placeholder{color:var(--fg3);}
.rs-chat-composer__preview{padding:11px 13px 6px; min-height:42px; font-size:13px;}

.rs-chat-composer__bar{display:flex; align-items:center; gap:2px; padding:5px 8px 7px;}
.rs-chat-composer__tool{appearance:none; border:0; background:transparent; color:var(--fg3); width:28px; height:28px;
  border-radius:var(--r-sm); cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  transition:background .12s var(--ease), color .12s var(--ease);}
.rs-chat-composer__tool:hover{background:var(--surface-2); color:var(--fg);}
.rs-chat-composer__tool.is-on{background:var(--accent-soft); color:var(--accent);}
.rs-chat-composer__tool .rs-ic{width:15px; height:15px;}
.rs-chat-composer__tool:focus-visible{outline:none; box-shadow:0 0 0 3px var(--ring);}
.rs-chat-composer__sep{width:1px; height:16px; background:var(--border); margin:0 5px;}
.rs-chat-composer__hint{margin-left:auto; font-size:10.5px; color:var(--fg3); display:flex; align-items:center; gap:8px;}
.rs-chat-composer__hint kbd{font-family:var(--rs-font-mono); font-size:9.5px; color:var(--fg3);
  border:1px solid var(--border-strong); border-bottom-width:2px; border-radius:var(--r-xs); padding:1px 4px; background:var(--surface);}
.rs-chat-composer__send{margin-left:8px;}

.rs-chat-composer.is-disabled{background:var(--surface-2);}
.rs-chat-composer__lockednote{display:flex; align-items:center; gap:8px; padding:13px 14px; font-size:12.5px; color:var(--fg3);}
.rs-chat-composer__lockednote .rs-ic{width:14px; height:14px;}

/* ---------------------------------------------------------
   11 · Thread header (participant strip above a conversation)
   --------------------------------------------------------- */
.rs-chat-head{display:flex; align-items:center; gap:11px; min-width:0;}
.rs-chat-head__t{flex:1; min-width:0;}
.rs-chat-head__name{font-size:13.5px; font-weight:600; display:flex; align-items:center; gap:7px;}
.rs-chat-head__sub{font-size:11.5px; color:var(--fg3); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.rs-chat-head__presence{width:7px; height:7px; border-radius:50%; background:var(--success); flex:none;}
.rs-chat-head__presence.is-away{background:var(--warning);}
.rs-chat-head__presence.is-off{background:var(--neutral);}
.rs-chat-head__actions{display:flex; gap:6px; align-items:center;}
