﻿/* CuteChat 6.0 Modern — shared styles for widget + operator console */

:root {
  --cc-accent: #6d5cff;
  --cc-accent-2: #8e7bff;
  --cc-bg: #ffffff;
  --cc-panel: #f6f6fb;
  --cc-border: #e4e4ef;
  --cc-text: #1c1c28;
  --cc-muted: #7a7a8c;
  --cc-me: linear-gradient(135deg, #6d5cff, #8e7bff);
  --cc-me-text: #ffffff;
  --cc-them: #eef0f6;
  --cc-them-text: #1c1c28;
  --cc-radius: 16px;
  --cc-shadow: 0 12px 40px rgba(28, 28, 60, .18);
  --cc-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cc-bg: #16161f;
    --cc-panel: #1e1e2a;
    --cc-border: #2c2c3c;
    --cc-text: #eceaf6;
    --cc-muted: #9a97ad;
    --cc-them: #262635;
    --cc-them-text: #eceaf6;
    --cc-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  }
}

/* ---------- launcher bubble ---------- */
.cc-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--cc-me);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--cc-shadow);
  display: grid;
  place-items: center;
  z-index: 2147483000;
  transition: transform .15s ease;
}
.cc-launcher:hover { transform: scale(1.07); box-shadow: 0 14px 44px rgba(109, 92, 255, .45); }
.cc-launcher:active { transform: scale(.96); }
.cc-launcher svg { width: 28px; height: 28px; }
.cc-launcher .cc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ff4d67;
  color: #fff;
  font: 700 12px/20px var(--cc-font);
  text-align: center;
  display: none;
}
.cc-launcher .cc-badge.on { display: block; }

/* ---------- chat panel ---------- */
.cc-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  font-family: var(--cc-font);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483001;
}
.cc-panel.open { display: flex; animation: cc-pop .18s ease; }
@keyframes cc-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.cc-header {
  background: var(--cc-me);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.cc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  display: grid;
  place-items: center;
  font: 700 15px var(--cc-font);
  position: relative;
  flex: 0 0 auto;
}
.cc-avatar .cc-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3ddc84;
  border: 2px solid #fff;
}
.cc-avatar .cc-dot.away { background: #f5b849; }
.cc-avatar .cc-dot.off { background: #9a97ad; }
.cc-header .cc-title { font-weight: 600; font-size: 15px; }
.cc-header .cc-sub { font-size: 12px; opacity: .85; }
.cc-header .cc-actions { margin-left: auto; display: flex; gap: 4px; }
.cc-header button {
  border: 0; background: transparent; color: #fff; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
}
.cc-header button:hover { background: rgba(255, 255, 255, .18); }

/* ---------- message list ---------- */
.cc-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--cc-panel);
  scroll-behavior: smooth;
}

/* Slim scrollbars — the default chrome is heavy inside a small chat panel. */
.cc-body, .op-side, .im-side, .ch-side, .cc-form {
  scrollbar-width: thin;
  scrollbar-color: var(--cc-border) transparent;
}
.cc-body::-webkit-scrollbar,
.op-side::-webkit-scrollbar,
.im-side::-webkit-scrollbar,
.ch-side::-webkit-scrollbar,
.cc-form::-webkit-scrollbar { width: 8px; }
.cc-body::-webkit-scrollbar-track,
.op-side::-webkit-scrollbar-track,
.im-side::-webkit-scrollbar-track,
.ch-side::-webkit-scrollbar-track,
.cc-form::-webkit-scrollbar-track { background: transparent; }
.cc-body::-webkit-scrollbar-thumb,
.op-side::-webkit-scrollbar-thumb,
.im-side::-webkit-scrollbar-thumb,
.ch-side::-webkit-scrollbar-thumb,
.cc-form::-webkit-scrollbar-thumb {
  background: var(--cc-border);
  border-radius: 4px;
}
.cc-body::-webkit-scrollbar-thumb:hover,
.op-side::-webkit-scrollbar-thumb:hover,
.im-side::-webkit-scrollbar-thumb:hover,
.ch-side::-webkit-scrollbar-thumb:hover { background: var(--cc-muted); }

::selection { background: color-mix(in srgb, var(--cc-accent) 28%, transparent); }
.cc-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: cc-msg-in .18s ease-out;
}
.cc-msg.me { align-self: flex-end; align-items: flex-end; }
.cc-msg.them { align-self: flex-start; align-items: flex-start; }
@keyframes cc-msg-in { from { opacity: 0; transform: translateY(4px); } }

.cc-bubble {
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(28, 28, 60, .07);
}
.cc-msg.me .cc-bubble {
  background: var(--cc-me);
  color: var(--cc-me-text);
  border-bottom-right-radius: 5px;
  box-shadow: 0 2px 8px rgba(109, 92, 255, .28);
}
.cc-msg.them .cc-bubble {
  background: var(--cc-them);
  color: var(--cc-them-text);
  border-bottom-left-radius: 5px;
}

/* ---- grouping: a run from one sender reads as a single block ---- */
.cc-msg.cc-cont { margin-top: -6px; }
.cc-msg.cc-cont.me .cc-bubble { border-top-right-radius: 5px; }
.cc-msg.cc-cont.them .cc-bubble { border-top-left-radius: 5px; }
/* the timestamp only needs saying once per run — but never hide the ticks */
.cc-msg.cc-cont .cc-meta > span:first-child { display: none; }
.cc-msg.them.cc-cont .cc-meta { display: none; }
.cc-msg.cc-cont:hover .cc-meta { display: flex; }
.cc-msg.cc-cont:hover .cc-meta > span:first-child { display: inline; }

.cc-meta { font-size: 11px; color: var(--cc-muted); margin-top: 3px; display: flex; gap: 5px; align-items: center; min-height: 14px; }
.cc-meta .cc-ticks { font-size: 11px; letter-spacing: -2px; }
.cc-meta .cc-ticks.read { color: var(--cc-accent); }
.cc-meta .cc-fail { color: #ff4d67; cursor: pointer; text-decoration: underline; }
.cc-sysmsg {
  align-self: center;
  font-size: 12px;
  color: var(--cc-muted);
  background: var(--cc-them);   /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--cc-them) 70%, transparent);
  padding: 5px 14px;
  border-radius: 12px;
  max-width: 90%;
  text-align: center;
  margin: 2px 0;
}
.cc-sender { font-size: 11px; font-weight: 600; color: var(--cc-muted); margin: 0 6px 3px; }

/* the scroller wraps the body so the jump button can float over it */
.cc-scroller { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.cc-scroller > .cc-body { flex: 1 1 auto; }
.cc-jump {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--cc-me); color: #fff;
  font: 600 12px var(--cc-font); padding: 7px 14px;
  box-shadow: 0 4px 14px rgba(109, 92, 255, .4);
  z-index: 4;
}
.cc-jump[hidden] { display: none; }
.cc-jump:hover { filter: brightness(1.08); }

/* an /me action */
.cc-emote {
  align-self: stretch;
  font-size: 13.5px; font-style: italic; color: var(--cc-text);
  padding: 3px 6px; line-height: 1.5;
}
.cc-emote .star { color: var(--cc-accent); font-style: normal; }
.cc-emote b { font-style: normal; }

/* @mentions */
.cc-at {
  font-weight: 600;
  color: var(--cc-accent);
  background: color-mix(in srgb, var(--cc-accent) 14%, transparent);
  border-radius: 5px; padding: 0 3px;
}
.cc-msg.me .cc-at { color: #fff; background: rgba(255, 255, 255, .22); }
/* a message addressed to you */
.cc-msg.cc-atme .cc-bubble {
  background: color-mix(in srgb, var(--cc-accent) 13%, var(--cc-them));
  box-shadow: inset 3px 0 0 var(--cc-accent), 0 1px 2px rgba(28, 28, 60, .07);
}

/* typing indicator */
.cc-typing { display: none; align-items: center; gap: 8px; padding: 0 14px 8px; color: var(--cc-muted); font: 12px var(--cc-font); }
.cc-typing.on { display: flex; }
.cc-typing .d { width: 6px; height: 6px; border-radius: 50%; background: var(--cc-muted); animation: cc-blink 1.2s infinite; }
.cc-typing .d:nth-child(2) { animation-delay: .2s; }
.cc-typing .d:nth-child(3) { animation-delay: .4s; }
@keyframes cc-blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

/* ---------- composer ---------- */
.cc-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--cc-border);
  background: var(--cc-bg);
}
.cc-composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  background: var(--cc-panel);
  color: var(--cc-text);
  font: 14px/1.4 var(--cc-font);
  padding: 9px 12px;
  max-height: 110px;
  outline: none;
}
.cc-composer textarea:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-accent) 15%, transparent);
}
.cc-composer textarea::placeholder { color: var(--cc-muted); }
.cc-send {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cc-me);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.cc-send {
  transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
  box-shadow: 0 2px 8px rgba(109, 92, 255, .3);
}
.cc-send:hover:not(:disabled) { transform: scale(1.06); }
.cc-send:active:not(:disabled) { transform: scale(.94); }
.cc-send:disabled { opacity: .35; cursor: default; box-shadow: none; }

/* emoji picker */
.cc-composer { position: relative; }
.cc-emoji-btn {
  border: 0; background: transparent; font-size: 20px; cursor: pointer;
  width: 34px; height: 38px; flex: 0 0 auto; border-radius: 8px;
}
.cc-emoji-btn:hover { background: var(--cc-panel); }
.cc-emoji-pop {
  display: none;
  position: absolute;
  left: 8px;
  bottom: 56px;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  box-shadow: var(--cc-shadow);
  padding: 8px;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  z-index: 10;
}
.cc-emoji-pop.open { display: grid; }
.cc-emoji-pop button {
  border: 0; background: transparent; font-size: 19px; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
}
.cc-emoji-pop button:hover { background: var(--cc-panel); }

/* flood-control notice */
.cc-flood {
  display: none;
  padding: 5px 14px 8px;
  background: var(--cc-bg);
  color: #b4551f;
  font: 12px var(--cc-font);
}
.cc-flood.on { display: block; }
@media (prefers-color-scheme: dark) { .cc-flood { color: #f5b849; } }

/* composer drag-and-drop target */
.cc-composer.cc-drop { outline: 2px dashed var(--cc-accent); outline-offset: -4px; background: var(--cc-panel); }

/* attachments */
.cc-attach-btn {
  border: 0; background: transparent; font-size: 17px; cursor: pointer;
  width: 34px; height: 38px; flex: 0 0 auto; border-radius: 8px;
}
.cc-attach-btn:hover { background: var(--cc-panel); }
.cc-bubble.cc-hasfile { padding: 4px; background: transparent !important; }
.cc-img {
  max-width: 220px; max-height: 180px; border-radius: 12px; display: block;
  border: 1px solid var(--cc-border);
}
.cc-filechip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cc-them); color: var(--cc-them-text);
  border: 1px solid var(--cc-border); border-radius: 12px;
  padding: 9px 13px; font-size: 13px; text-decoration: none; max-width: 100%;
}
.cc-filechip .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-filechip .s { color: var(--cc-muted); font-size: 11px; flex: 0 0 auto; }
.cc-filechip-gone { opacity: .65; cursor: default; }
.cc-bubble a { color: inherit; text-decoration: underline; }

/* rating stars */
.cc-stars button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 26px; color: var(--cc-border); transition: color .1s;
}
.cc-stars button.lit, .cc-stars button:hover { color: #f5b849; }

/* ---------- pre-chat form / states ---------- */
.cc-form { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.cc-form h3 { margin: 0; font-size: 17px; }
.cc-form p { margin: 0; font-size: 13px; color: var(--cc-muted); }
.cc-form label { font-size: 12px; font-weight: 600; color: var(--cc-muted); display: block; margin-bottom: 4px; }
.cc-form input, .cc-form select, .cc-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  background: var(--cc-panel);
  color: var(--cc-text);
  font: 14px var(--cc-font);
  padding: 10px 12px;
  outline: none;
}
.cc-form input:focus, .cc-form select:focus, .cc-form textarea:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-accent) 15%, transparent);
}
.cc-form label { letter-spacing: .02em; }
.cc-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: var(--cc-me);
  color: #fff;
  font: 600 14px var(--cc-font);
  cursor: pointer;
}
.cc-btn {
  transition: filter .12s ease, transform .12s ease;
  box-shadow: 0 2px 10px rgba(109, 92, 255, .25);
}
.cc-btn:hover { filter: brightness(1.07); }
.cc-btn:active { transform: translateY(1px); }
.cc-btn.ghost {
  background: transparent;
  color: var(--cc-accent);
  box-shadow: none;
  border: 1px solid var(--cc-border);
}
.cc-btn.ghost:hover { border-color: var(--cc-accent); filter: none; background: color-mix(in srgb, var(--cc-accent) 8%, transparent); }
.cc-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--cc-muted);
  font: 14px var(--cc-font);
}
.cc-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--cc-border);
  border-top-color: var(--cc-accent);
  animation: cc-spin .8s linear infinite;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ---------- sign-in gates (messenger / rooms / operator) ----------
 * These three pages each open on a small identity card. Shared here so they
 * stay consistent instead of drifting apart per page.
 */
.im-gate, .ch-gate, .op-gate {
  background:
    radial-gradient(900px 460px at 15% -10%, color-mix(in srgb, var(--cc-accent) 16%, transparent), transparent 60%),
    var(--cc-panel) !important;
}
.im-card, .ch-card, .op-card {
  border-radius: 20px !important;
  animation: cc-card-in .22s ease-out;
}
@keyframes cc-card-in { from { opacity: 0; transform: translateY(8px); } }
.im-card h3, .ch-card h3, .op-card h3 { font-size: 19px; letter-spacing: -.01em; }
.im-card input, .ch-card input, .ch-card select, .op-card input {
  transition: border-color .12s ease, box-shadow .12s ease;
}
.im-card input:focus, .ch-card input:focus, .ch-card select:focus, .op-card input:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-accent) 15%, transparent);
  outline: none;
}

/* ---------- accessibility ---------- */

/*
 * One visible focus ring for every interactive element. :focus-visible means
 * mouse users never see it, so there is no reason to suppress it anywhere.
 */
.cc-launcher:focus-visible,
.cc-panel button:focus-visible,
.cc-composer button:focus-visible,
.cc-emoji-pop button:focus-visible,
.cc-stars button:focus-visible,
.cc-btn:focus-visible,
.cc-fail:focus-visible,
.cc-filechip:focus-visible,
.cc-bubble a:focus-visible,
.cc-form input:focus-visible,
.cc-form select:focus-visible,
.cc-form textarea:focus-visible,
.cc-composer textarea:focus-visible,
/* the 6.0 controls: reaction pills, add-reaction, reply/delete, thread links, picker, sign-in */
.cc-react:focus-visible,
.cc-react-add:focus-visible,
.cc-reply-btn:focus-visible,
.cc-replies:focus-visible,
.cc-picker button:focus-visible,
.rm-sso:focus-visible,
.rm-reply-x:focus-visible,
.rm-ai:focus-visible,
[data-cc-activatable]:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
  border-radius: 6px;
}
/* on the accent-coloured header the purple ring would disappear */
.cc-header button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* Rows that behave as buttons (conversation lists) must show they are focused. */
[data-cc-activatable] { cursor: pointer; }

/* Visually hidden, still announced. */
.cc-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/*
 * Respect a reduced-motion preference: drop the entrance animation, the
 * spinner spin, the typing blink and smooth scrolling. Everything stays
 * legible — the spinner keeps its ring, the typing dots stay visible.
 */
@media (prefers-reduced-motion: reduce) {
  .cc-panel.open { animation: none; }
  .cc-spinner { animation: none; border-top-color: var(--cc-accent); }
  .cc-typing .d { animation: none; opacity: .6; }
  .cc-body { scroll-behavior: auto; }
  .cc-launcher, .cc-stars button, .cc-send, .cc-btn, .card { transition: none; }
  .cc-msg { animation: none; }
  .im-card, .ch-card, .op-card { animation: none; }
  .cc-launcher:hover, .cc-send:hover, .cc-btn:active { transform: none; }
}

/* ---------- responsive two-pane layout ----------
 * The consoles are a list beside a conversation. Below ~640px there is not
 * room for both — a 260px sidebar leaves barely 100px of chat — so the panes
 * become one screen at a time, list first, with a back control.
 *
 * Opt in by marking the container [data-cc-panes] and its children
 * [data-cc-pane="list"] / [data-cc-pane="detail"], then toggle the
 * `cc-show-detail` class (see CuteChatUI.showPane).
 */
.cc-back { display: none; }

@media (max-width: 640px) {
  [data-cc-pane="list"] {
    width: 100% !important;
    max-width: none !important;
    border-right: 0 !important;
    border-left: 0 !important;
  }
  [data-cc-pane="detail"] { display: none !important; }
  [data-cc-panes].cc-show-detail [data-cc-pane="list"] { display: none !important; }
  [data-cc-panes].cc-show-detail [data-cc-pane="detail"] {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 auto;
  }
  .cc-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: 600 14px var(--cc-font);
    cursor: pointer;
    padding: 4px 8px 4px 0;
    margin-right: 2px;
  }
  /* stacked headers get cramped: let them wrap rather than overflow */
  .op-top, .im-top, .ch-top { flex-wrap: wrap; row-gap: 6px; }
  .op-top .st, .im-top .me, .ch-top .me { margin-left: 0; width: 100%; }
}

/* small screens: fill the viewport */
@media (max-width: 480px) {
  .cc-panel { right: 8px; left: 8px; bottom: 84px; width: auto; height: calc(100vh - 100px); }
}

/* markdown */
.cc-bubble code.cc-inline {
  background: color-mix(in srgb, var(--cc-text) 10%, transparent);
  border-radius: 5px; padding: 1px 5px;
  font: 12.5px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.cc-msg.me .cc-bubble code.cc-inline { background: rgba(255,255,255,.22); }
.cc-bubble pre.cc-code {
  background: color-mix(in srgb, var(--cc-text) 9%, transparent);
  border-radius: 10px; padding: 9px 12px; margin: 4px 0 2px;
  overflow-x: auto; white-space: pre;
  font: 12.5px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.cc-msg.me .cc-bubble pre.cc-code { background: rgba(255,255,255,.18); }
.cc-bubble b { font-weight: 700; }
.cc-bubble s { opacity: .75; }

/* link to the AI assistant settings, in the rooms header */
.rm-ai {
  margin-left: auto;
  margin-right: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--cc-border, #dfe3e8);
  color: inherit;
  text-decoration: none;
  opacity: .8;
}
.rm-ai:hover { opacity: 1; }

/* ---- reactions ------------------------------------------------------------
   Pills sit under the bubble and stay quiet until they mean something: a
   reaction the reader has given is outlined in the accent colour, everything
   else is a neutral chip. The add button only appears on hover so a busy room
   is not covered in plus signs. */
.cc-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  position: relative;
}

.cc-react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 2px;
  border-radius: 999px;
  border: 1px solid var(--cc-border, #dfe3e8);
  background: var(--cc-panel, #fff);
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  color: inherit;
}

.cc-react:hover { border-color: var(--cc-accent, #4a63e7); }
.cc-react b { font-weight: 600; font-variant-numeric: tabular-nums; }

.cc-react.mine {
  border-color: var(--cc-accent, #4a63e7);
  background: color-mix(in srgb, var(--cc-accent, #4a63e7) 12%, transparent);
}

.cc-react-add {
  border: 1px dashed var(--cc-border, #dfe3e8);
  background: transparent;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 13px;
  cursor: pointer;
  color: inherit;
  opacity: 0;
  transition: opacity .12s ease;
}

.cc-msg:hover .cc-react-add,
.cc-react-add:focus-visible { opacity: 1; }
.cc-react-add:hover { opacity: 1; border-style: solid; }

.cc-picker {
  position: absolute;
  bottom: 26px;
  left: 0;
  z-index: 20;
  display: flex;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 10px;
  border: 1px solid var(--cc-border, #dfe3e8);
  background: var(--cc-panel, #fff);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
}

.cc-picker button {
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 6px;
  cursor: pointer;
}

.cc-picker button:hover { background: var(--cc-hover, #eef2f6); }

@media (prefers-reduced-motion: reduce) {
  .cc-react-add { transition: none; }
}

/* ---- sign-in options ------------------------------------------------------ */
.rm-sso {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 4px;
}

.rm-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .6;
}

.rm-or::before, .rm-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cc-border, #dfe3e8);
}

/* ---- threads ---------------------------------------------------------------
   A reply carries a quiet quote of what it answers, and a parent grows a reply
   count once it has answers. Both stay subordinate to the message itself. */
.cc-quote {
  font-size: 12.5px;
  line-height: 1.4;
  opacity: .72;
  padding: 2px 0 3px 9px;
  border-left: 2px solid var(--cc-accent, #4a63e7);
  margin-bottom: 3px;
  max-width: 460px;
  cursor: default;
}

.cc-quote b { font-weight: 600; margin-right: 5px; }
.cc-quote-gone { border-left-color: var(--cc-border, #dfe3e8); font-style: italic; }

.cc-thread { display: flex; gap: 8px; align-items: center; margin-top: 2px; }

.cc-replies {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--cc-accent, #4a63e7);
  cursor: pointer;
}

.cc-replies:hover { text-decoration: underline; }

.cc-reply-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: inherit;
  opacity: 0;
  cursor: pointer;
  transition: opacity .12s ease;
}

.cc-msg:hover .cc-reply-btn,
.cc-reply-btn:focus-visible { opacity: 1; }
.cc-reply-btn:hover { opacity: 1; text-decoration: underline; }

/* a thread picked out after clicking "N replies" */
.cc-inthread { background: color-mix(in srgb, var(--cc-accent, #4a63e7) 8%, transparent); }

/* the bar above the composer while replying */
/* A class selector beats the browser's [hidden] rule, so display:flex would
   otherwise keep this visible even when hidden is set. */
.rm-reply[hidden] { display: none; }

.rm-reply {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 13px;
  border-top: 1px solid var(--cc-border, #dfe3e8);
  background: color-mix(in srgb, var(--cc-accent, #4a63e7) 7%, transparent);
}

.rm-reply-label { opacity: .7; }
.rm-reply-text { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rm-reply-x {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: .6;
}

.rm-reply-x:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) { .cc-reply-btn { transition: none; } }

/* a withdrawn message keeps its slot but loses its words */
.cc-bubble.cc-withdrawn {
  font-style: italic;
  opacity: .55;
  background: transparent;
  border: 1px dashed var(--cc-border, #dfe3e8);
}
.cc-del-btn { color: #c0453c; }

/* unread badge on a room that is not being watched */
.rm-unread {
  margin-left: auto;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cc-accent, #4a63e7);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* an edited message: a quiet marker in the meta line, and its own action button */
.cc-edited{margin-left:.4em;font-size:.72em;opacity:.55;font-style:italic}
.cc-edited::before{content:"· "}
.cc-edit-btn{color:#6b7280}
.cc-edit-btn:hover{color:#111827}

/* composer of a connection that has ended */
.cc-composer.cc-disabled{opacity:.55}

/* the top of a fully-read-back transcript */
.cc-sysmsg.cc-start{opacity:.6;font-style:italic}

/* zero-height marker that asks for the previous page of history */
.cc-top-sentinel{height:1px;flex:0 0 auto}

/* editing a message where it sits */
.cc-edit-box textarea{width:100%;min-width:14rem;box-sizing:border-box;resize:vertical;
  font:inherit;color:inherit;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.35);
  border-radius:6px;padding:.35em .5em}
.cc-edit-box textarea:focus{outline:2px solid currentColor;outline-offset:1px}
.cc-edit-hint{font-size:.72em;opacity:.7;margin-top:.25em}

/* asking for a room password, inline rather than in a browser dialog */
.cc-passform{display:flex;gap:.5em;align-items:center;flex-wrap:wrap;margin:.75em auto;padding:.7em .9em;
  max-width:34rem;border:1px solid var(--cc-border,#dfe3e8);border-radius:10px}
.cc-passform label{display:flex;gap:.5em;align-items:center;flex:1 1 16rem;font-size:.9em}
.cc-passform input{flex:1 1 8rem;min-width:6rem;font:inherit;padding:.35em .5em;
  border:1px solid var(--cc-border,#dfe3e8);border-radius:6px}

/* a room that asks something of you before letting you in */
.rm-gate{margin-left:.35em;opacity:.75;font-size:.85em}
