*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overflow-x: clip;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ---------- App Shell ---------- */
.qq-root {
  height: 100dvh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: var(--bg-page);
}

/* ---------- Auth Screen (Invite Code / Login) ---------- */
.qq-auth-wrap {
  width: 100%;
  max-width: var(--chat-max);
  padding: var(--s6) var(--s4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.qq-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--card-pad);
}

.qq-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.qq-auth-logo {
  width: var(--h-lg);
  height: var(--h-lg);
  border-radius: var(--r-control);
  flex-shrink: 0;
}

.qq-auth-title {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-bold);
  text-wrap: balance;
}

.qq-seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s1);
  padding: var(--s1);
  background: var(--bg-segment);
  border-radius: var(--r-control);
  margin-bottom: var(--s5);
}

.qq-seg-btn {
  height: var(--h-md);
  border-radius: var(--r-small);
  font-size: var(--fs-aux);
  font-weight: var(--fw-medium);
  color: var(--text-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.qq-seg-btn[aria-selected="true"] {
  background: var(--bg-card);
  color: var(--text);
  font-weight: var(--fw-bold);
}

.qq-form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.qq-field {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.qq-label {
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  font-weight: var(--fw-medium);
  color: var(--text-2);
}

.qq-input {
  height: var(--h-lg);
  width: 100%;
  padding: 0 var(--s3);
  border: 1px solid var(--line-control);
  border-radius: var(--r-control);
  background: var(--bg-card);
  font-size: var(--fs-body);
  transition: border-color 0.15s ease;
}

.qq-input:focus {
  border-color: var(--brand);
}

.qq-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
}

.qq-swatches {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.qq-swatch {
  width: var(--h-sm);
  height: var(--h-sm);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.qq-swatch[aria-pressed="true"] {
  border-color: var(--text);
  transform: scale(1.06);
}

.qq-swatch-dot {
  width: var(--s5);
  height: var(--s5);
  border-radius: var(--r-pill);
}

.qq-tone-preview {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--h-sm);
  flex-wrap: wrap;
}

.qq-tone-btn {
  height: var(--h-tag);
  padding: 0 var(--s2);
  border-radius: var(--r-small);
  font-size: var(--fs-note);
  font-weight: var(--fw-medium);
  border: 1px solid transparent;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.qq-tone-btn[aria-pressed="true"] {
  border-color: var(--text);
}

.qq-alert {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-small);
  background: var(--back-bg);
  color: var(--back);
  font-size: var(--fs-aux);
  line-height: var(--lh-aux);
}

.qq-btn-primary {
  height: var(--h-lg);
  padding: 0 var(--s4);
  border-radius: var(--r-control);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.qq-btn-primary:hover {
  background: var(--brand-hover);
}

.qq-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.qq-btn-secondary {
  height: var(--h-md);
  padding: 0 var(--s3);
  border-radius: var(--r-control);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: var(--fs-aux);
  font-weight: var(--fw-medium);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.qq-btn-secondary:hover {
  background: var(--bg-segment);
}

/* ---------- Main Single-Group Chat Stage ---------- */
.qq-stage {
  position: relative;
  width: 100%;
  max-width: var(--chat-max);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

@media (max-width: 600px) {
  .qq-stage {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }
}

/* Geometrically Centered Topbar (Symmetric 3-Column Grid) */
.qq-topbar {
  min-height: var(--s14);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: var(--s3);
  padding-right: var(--s3);
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: var(--h-lg) minmax(0, 1fr) var(--h-lg);
  align-items: center;
  gap: var(--s2);
  flex-shrink: 0;
  z-index: 10;
}

.qq-topbar-slot {
  width: var(--h-lg);
  height: var(--h-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qq-topbar-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.qq-group-title-row {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--s1);
  max-width: 100%;
  min-width: 0;
}

.qq-group-title {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qq-group-count {
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.qq-presence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qq-dot {
  width: var(--s2);
  height: var(--s2);
  border-radius: var(--r-pill);
  background: var(--av-mint);
  flex-shrink: 0;
}

.qq-dot--warn {
  background: var(--av-amber);
}

.qq-icon-btn {
  width: var(--h-lg);
  height: var(--h-lg);
  border-radius: var(--r-control);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.qq-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.qq-icon-btn svg {
  width: var(--s5);
  height: var(--s5);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Message Stream ---------- */
.qq-stream-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.qq-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--s4) var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  overscroll-behavior-y: contain;
}

.qq-msg-list {
  display: flex;
  flex-direction: column;
}

.qq-load-more {
  align-self: center;
  height: var(--h-sm);
  padding: 0 var(--s3);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: var(--fs-note);
  color: var(--text-2);
}

.qq-time-divider {
  align-self: center;
  margin-top: var(--s3);
  margin-bottom: var(--s1);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-pill);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.qq-time-divider:first-child {
  margin-top: 0;
}

.qq-sys-msg {
  align-self: center;
  margin-top: var(--s3);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-pill);
  background: var(--bg-segment);
  color: var(--text-2);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  max-width: 86%;
  text-align: center;
}

/* Floating Unread / Scroll-to-Bottom Pill */
.qq-jump-bottom {
  position: absolute;
  right: var(--s4);
  bottom: var(--s3);
  height: var(--h-sm);
  padding: 0 var(--s3);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-paper);
  color: var(--info);
  font-size: var(--fs-note);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  z-index: 14;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.qq-jump-bottom:hover {
  background: var(--brand-soft);
}

/* Message Row & Tight/Loose Rhythm */
.qq-msg {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  max-width: 100%;
  margin-top: var(--s3);
  position: relative;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.qq-msg:first-child {
  margin-top: 0;
}

/* Consecutive messages by the same sender within 3 min: tight 4px spacing */
.qq-msg--grouped {
  margin-top: var(--s1);
}

.qq-msg--me {
  flex-direction: row-reverse;
}

.qq-msg--pending {
  opacity: 0.72;
}

/* Avatar */
.qq-avatar {
  width: var(--h-md);
  height: var(--h-md);
  border-radius: var(--r-pill);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-brand);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.qq-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--img-ring);
  pointer-events: none;
}

.qq-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qq-avatar--spacer {
  width: var(--h-md);
  height: var(--s1);
  flex-shrink: 0;
  visibility: hidden;
}

.qq-av--blue { background: var(--av-blue); }
.qq-av--pink { background: var(--av-pink); }
.qq-av--amber { background: var(--av-amber); }
.qq-av--mint { background: var(--av-mint); }
.qq-av--violet { background: var(--av-violet); }
.qq-av--coral { background: var(--av-coral); }

/* Bubble Column */
.qq-msg-col {
  min-width: 0;
  max-width: 78%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s1);
}

.qq-msg--me .qq-msg-col {
  align-items: flex-end;
}

.qq-sender-line {
  display: flex;
  align-items: center;
  gap: var(--s1);
  min-width: 0;
  max-width: 100%;
}

.qq-badge {
  height: var(--h-tag);
  padding: 0 var(--s2);
  border-radius: var(--r-small);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  font-weight: var(--fw-medium);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.qq-tone--pink { background: var(--tone-pink-bg); color: var(--tone-pink-ink); }
.qq-tone--blue { background: var(--tone-blue-bg); color: var(--tone-blue-ink); }
.qq-tone--amber { background: var(--tone-amber-bg); color: var(--tone-amber-ink); }
.qq-tone--mint { background: var(--tone-mint-bg); color: var(--tone-mint-ink); }
.qq-tone--violet { background: var(--tone-violet-bg); color: var(--tone-violet-ink); }

.qq-sender-name {
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bubble + Floating Action Row */
.qq-bubble-wrap {
  display: flex;
  align-items: center;
  gap: var(--s1);
  max-width: 100%;
  position: relative;
}

.qq-msg--me .qq-bubble-wrap {
  flex-direction: row-reverse;
}

.qq-bubble {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-card);
  border-top-left-radius: var(--r-tail);
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  color: var(--text);
  font-size: var(--fs-read);
  line-height: var(--lh-read);
  min-width: 0;
  max-width: 100%;
}

.qq-msg--grouped:not(.qq-msg--me) .qq-bubble {
  border-top-left-radius: var(--r-card);
}

.qq-msg--me .qq-bubble {
  border-top-left-radius: var(--r-card);
  border-top-right-radius: var(--r-tail);
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

.qq-msg--grouped.qq-msg--me .qq-bubble {
  border-top-right-radius: var(--r-card);
}

.qq-bubble-text {
  word-break: break-word;
  white-space: pre-wrap;
}

.qq-bubble--media {
  padding: var(--s1);
  background: var(--bg-card);
  border: 1px solid var(--line);
}

.qq-msg--me .qq-bubble--media {
  background: var(--bg-card);
  border-color: var(--line);
  color: var(--text);
}

.qq-bubble--sticker {
  padding: 0;
  background: transparent;
  border: none;
}

.qq-msg--me .qq-bubble--sticker {
  background: transparent;
  border: none;
}

/* Retry Failed Send Button */
.qq-retry-btn {
  width: var(--h-sm);
  height: var(--h-sm);
  border-radius: var(--r-pill);
  background: var(--back-bg);
  color: var(--back);
  font-size: var(--fs-note);
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Reply Quote inside Bubble */
.qq-quote {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--s1) var(--s2);
  margin-bottom: var(--s1);
  border-radius: var(--r-small);
  background: var(--bg-subtle);
  color: var(--text-2);
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  text-align: left;
  max-width: 100%;
}

.qq-msg--me .qq-quote {
  background: var(--bubble-quote-me);
  color: var(--text-on-brand);
}

.qq-quote-author {
  font-weight: var(--fw-bold);
}

.qq-quote-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Image inside Bubble */
.qq-media-btn {
  display: block;
  position: relative;
  border-radius: var(--r-control);
  overflow: hidden;
  max-width: 220px;
}

.qq-media-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-control);
  box-shadow: inset 0 0 0 1px var(--img-ring);
  pointer-events: none;
}

.qq-media-btn img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.qq-sticker-img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
}

/* Hover / Touch Message Tools */
.qq-msg-tools {
  position: absolute;
  bottom: calc(100% + var(--s1));
  left: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding: var(--s1);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
  white-space: nowrap;
}

.qq-msg--me .qq-msg-tools {
  left: auto;
  right: 0;
}

.qq-msg:hover .qq-msg-tools,
.qq-msg:focus-within .qq-msg-tools,
.qq-msg.is-active .qq-msg-tools {
  opacity: 1;
  pointer-events: auto;
}

.qq-tool-chip {
  height: var(--h-sm);
  min-width: var(--h-sm);
  padding: 0 var(--s2);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-note);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.qq-tool-chip:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.qq-touch-more {
  display: none;
  width: var(--h-sm);
  height: var(--h-sm);
  border-radius: var(--r-pill);
  color: var(--text-3);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (hover: none) {
  .qq-touch-more {
    display: inline-flex;
  }
}

/* Reactions & Read Meta Row */
.qq-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s1);
}

.qq-reaction-pill {
  height: var(--h-tag);
  padding: 0 var(--s2);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: var(--fs-note);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.qq-reaction-pill[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: var(--brand-ring);
  color: var(--info);
}

.qq-read-meta {
  font-size: var(--fs-note);
  line-height: var(--lh-note);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.qq-read-meta--done {
  color: var(--info);
}

.qq-msg.is-highlighted .qq-bubble {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Bottom Composer Dock ---------- */
.qq-dock {
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  padding-top: var(--s2);
  padding-left: var(--s3);
  padding-right: var(--s3);
  padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  flex-shrink: 0;
  z-index: 12;
}

.qq-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-control);
  background: var(--bg-subtle);
  font-size: var(--fs-note);
  color: var(--text-2);
}

.qq-reply-bar-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qq-reply-close {
  width: var(--h-sm);
  height: var(--h-sm);
  border-radius: var(--r-small);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Kaomoji & Sticker Panel */
.qq-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--bg-muted);
  padding: var(--s2);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-height: 208px;
  overflow-y: auto;
}

.qq-panel-tabs {
  display: flex;
  align-items: center;
  gap: var(--s2);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s1);
}

.qq-panel-tab {
  height: var(--h-sm);
  padding: 0 var(--s3);
  border-radius: var(--r-small);
  font-size: var(--fs-note);
  font-weight: var(--fw-medium);
  color: var(--text-2);
}

.qq-panel-tab[aria-selected="true"] {
  background: var(--bg-card);
  color: var(--text);
  font-weight: var(--fw-bold);
}

.qq-kaomoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.qq-kaomoji-btn {
  height: var(--h-sm);
  padding: 0 var(--s3);
  border-radius: var(--r-small);
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: var(--fs-aux);
  color: var(--text);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.qq-kaomoji-btn:hover {
  border-color: var(--brand-ring);
  background: var(--brand-soft);
}

.qq-sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s2);
}

.qq-sticker-cell {
  position: relative;
  height: 72px;
  border-radius: var(--r-control);
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qq-sticker-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--s1);
}

.qq-sticker-add {
  height: 72px;
  border-radius: var(--r-control);
  border: 1px dashed var(--line-strong);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: var(--fs-note);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
}

/* Composer Main Bar */
.qq-composer {
  display: flex;
  align-items: flex-end;
  gap: var(--s2);
}

.qq-composer-tools {
  display: flex;
  align-items: center;
  gap: var(--s1);
  flex-shrink: 0;
}

.qq-textarea {
  flex: 1;
  min-width: 0;
  min-height: var(--h-lg);
  max-height: 112px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-control);
  border-radius: var(--r-control);
  background: var(--bg-subtle);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  resize: none;
  overflow-y: auto;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.qq-textarea:focus {
  background: var(--bg-card);
  border-color: var(--brand);
}

.qq-send-btn {
  height: var(--h-lg);
  padding: 0 var(--s4);
  border-radius: var(--r-control);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.qq-send-btn:hover {
  background: var(--brand-hover);
}

.qq-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Right Slide Drawer ---------- */
.qq-backdrop {
  position: fixed;
  inset: 0;
  background: var(--mask);
  z-index: 30;
}

.qq-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: var(--drawer-w);
  background: var(--bg-card);
  border-left: 1px solid var(--line);
  z-index: 35;
  display: flex;
  flex-direction: column;
}

.qq-drawer-head {
  height: var(--s14);
  padding: 0 var(--s4);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.qq-drawer-title {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-bold);
}

.qq-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

.qq-section {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.qq-section-title {
  margin: 0;
  font-size: var(--fs-aux);
  line-height: var(--lh-aux);
  font-weight: var(--fw-bold);
  color: var(--text-2);
}

.qq-member-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.qq-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2);
  border-radius: var(--r-control);
  background: var(--bg-subtle);
}

.qq-member-left {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.qq-member-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.qq-member-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qq-status-tag {
  height: var(--h-tag);
  padding: 0 var(--s2);
  border-radius: var(--r-pill);
  font-size: var(--fs-note);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.qq-status-tag--on {
  background: var(--pass-bg);
  color: var(--pass);
}

.qq-status-tag--off {
  background: var(--todo-bg);
  color: var(--todo);
}

.qq-avatar-picker-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

/* ---------- Image Lightbox ---------- */
.qq-lightbox {
  position: fixed;
  inset: 0;
  background: var(--mask-dark);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  gap: var(--s3);
}

.qq-lightbox img {
  max-width: 94vw;
  max-height: 80dvh;
  border-radius: var(--r-control);
  object-fit: contain;
}

.qq-lightbox-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

/* ---------- Toast ---------- */
.qq-toast {
  position: fixed;
  top: var(--s4);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--text-on-brand);
  font-size: var(--fs-aux);
  box-shadow: var(--shadow-pop);
  z-index: 60;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
