/* Queued-message tray above the composer (frontend/chat/chat-queue.js). The tray's own rules are the
   Control UI's composer-queue.css, synced into openclaw-composer.css; this file only places it in the
   ClawChats input column and supplies what the Control UI sets on its composer shell / .chat-footer
   (the tray sits outside .agent-chat__input here, so it doesn't inherit those). Colours come from
   composer-tokens.css via .input-area. */

.input-area .chat-queue-dock {
  /* composer-queue.css: .agent-chat__composer-shell */
  --chat-queue-divider: color-mix(in srgb, var(--text-strong) 6%, transparent);
  --chat-stack-icon-size: 14px;
  --chat-stack-leading-inset: 13px;
  --chat-stack-trailing-control-size: 24px;
  --chat-stack-trailing-inset: 8px;
  /* composer-surface.css: .chat-footer, with ClawChats' composer surface (composer-compat.css) */
  --chat-composer-surface: var(--input-bg);
  --composer-attached-surface: color-mix(in srgb, var(--chat-composer-surface) 60%, var(--background, var(--bg)));
  --chat-composer-hairline: color-mix(in srgb, var(--text-strong) 16%, transparent);
  /* base.css: transcript text colour */
  --chat-text: var(--text-primary);

  width: 100%;
  max-width: 760px;
  /* the Control UI's composer shell stacks the tray and the input 6px apart */
  margin: 0 auto 6px;
  box-sizing: border-box;
}

:root[data-theme="dark"] .input-area .chat-queue-dock {
  --chat-composer-hairline: color-mix(in srgb, var(--text-strong) 9%, transparent);
}

.input-area .chat-queue-dock[hidden] { display: none; }

/* The ⋯ menu: the Control UI's wa-dropdown renders in the top layer, outside the tray's overflow clip.
   Ours is position: fixed (placed top-end by chat-queue.js), which escapes the clip only while no
   ancestor is its containing block — and backdrop-filter makes the tray one. The tray's surface is
   opaque, so dropping the blur while the menu is open changes nothing visible. */
.input-area .chat-queue__overflow > .cc-dd__menu {
  z-index: 70;
  /* composer-queue.css gives the wa-dropdown panel 132px and the menu inside sizes to its items; the generic
     .cc-dd min-width: 100% would be the whole viewport once fixed */
  width: max-content;
  min-width: 132px;
  /* base.css wa-dropdown::part(menu): the shared popup surface (Web Awesome supplies it in the Control UI) */
  border: 1px solid var(--overlay-border);
  border-radius: var(--menu-radius);
  background: var(--popover);
  box-shadow: var(--overlay-shadow);
}
.input-area .chat-queue:has(.chat-queue__overflow[open]) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* chat-author-avatar (shown once queued items carry a sender: multi-user chats). */
.chat-queue__item > .chat-author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
}
.chat-author-avatar__image { width: 100%; height: 100%; object-fit: cover; }
.chat-author-avatar__initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: hsl(var(--chat-author-avatar-hue, 210) 45% 42%);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
}

/* A row with attachments: composer-queue-content.css (2026.11) adds a 24px [images] column before the text
   (.chat-queue__item--with-images); the synced 9.7 grid has fixed columns, so the row's cells move one along. */
.chat-queue__item--with-images {
  grid-template-columns: var(--chat-stack-icon-size) 20px 24px minmax(0, 1fr) auto;
}
.chat-queue__item--with-images.chat-queue__item--no-avatar {
  grid-template-columns: var(--chat-stack-icon-size) 24px minmax(0, 1fr) auto;
}
.chat-queue__item--with-images .chat-queue__copy,
.chat-queue__item--with-images .chat-queue__edit-input { grid-column: 4; }
.chat-queue__item--with-images .chat-queue__actions { grid-column: 5; }
.chat-queue__item--with-images .chat-queue__error,
.chat-queue__item--with-images .chat-queue__mentions { grid-column: 4 / -1; }
.chat-queue__item--with-images.chat-queue__item--no-avatar .chat-queue__copy,
.chat-queue__item--with-images.chat-queue__item--no-avatar .chat-queue__edit-input { grid-column: 3; }
.chat-queue__item--with-images.chat-queue__item--no-avatar .chat-queue__actions { grid-column: 4; }
.chat-queue__item--with-images.chat-queue__item--no-avatar .chat-queue__error,
.chat-queue__item--with-images.chat-queue__item--no-avatar .chat-queue__mentions { grid-column: 3 / -1; }

/* composer-queue-content.css .chat-queue__images */
.chat-queue__images {
  display: block;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--text) 24%, var(--panel));
  border-radius: calc(var(--radius-sm) * 2 / 3);
  background: var(--panel);
  object-fit: cover;
}
/* ClawChats: the same tile with a file glyph when the row carries files and no image */
.chat-queue__file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.chat-queue__file svg { width: 14px; height: 14px; }
