/* Gmail and Google Calendar cards in chat, and the "/" commands menu (gmail-calendar.js).
   The card frame (.gw-card, .gm-field, .gm-draft-*) comes from style.css. */
.gc-card .gc-body {
  display: block; width: 100%; box-sizing: border-box; min-height: 96px; padding: 0.8rem 1rem; resize: vertical;
  border: 0; outline: none; background: transparent; color: var(--text-primary, var(--r-text, #ececef));
  font: inherit; font-size: 0.9rem; line-height: 1.55;
}
.gc-card .gc-when { flex-wrap: wrap; gap: 0.5rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.gc-card .gc-when input {
  flex: 0 0 auto; padding: 0.35rem 0.5rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03); color: var(--text-primary, #ececef); font: inherit; font-size: 0.86rem; color-scheme: dark;
}
html[data-theme="light"] .gc-card .gc-when input { color-scheme: light; border-color: rgba(0,0,0,0.12); background: #fff; }
.gc-card .gc-when em { font-style: normal; color: var(--text-secondary, #a9a9b2); font-size: 0.82rem; }
.gc-card .gc-notes { margin: 0; padding: 0.6rem 1rem; color: var(--text-secondary, #a9a9b2); font-size: 0.84rem; white-space: pre-wrap; }
.gc-card .gm-draft-note.error { color: var(--r-danger, #f87171); }
.gc-card.sent .gc-body { opacity: 0.8; }

/* "/" commands */
.chat-composer-wrap { position: relative; }
.cmd-menu {
  position: absolute; left: 50%; transform: translateX(-50%); width: min(780px, calc(100% - 16px)); box-sizing: border-box;
  bottom: calc(100% + 8px); z-index: 50;
  max-height: min(340px, 50vh); overflow-y: auto; padding: 6px;
  border-radius: 14px; background: var(--r-surface, #17181b); border: 1px solid var(--r-border-strong, rgba(255,255,255,0.14));
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.cmd-menu[hidden] { display: none; }
.cmd-item {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "name ex tag" "about about about"; column-gap: 8px; row-gap: 1px;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left;
  color: var(--r-text, #ececef); font: inherit;
}
.cmd-item b { grid-area: name; font: 600 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--r-accent-text, var(--r-accent, #2ee6b6)); }
.cmd-item i { grid-area: ex; font-style: normal; font-size: 12.5px; color: var(--r-text-3, #6b6b74); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item span { grid-area: about; font-size: 12.5px; color: var(--r-text-2, #a9a9b2); }
.cmd-item.on, .cmd-item:hover { background: var(--r-surface-2, rgba(255,255,255,0.06)); }
.cmd-group {
  padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--r-text-3, #6b6b74);
}
.cmd-group:first-child { padding-top: 4px; }
.cmd-group { display: flex; align-items: center; gap: 7px; }
.cmd-group-logos { display: inline-flex; gap: 3px; }
.cmd-group-logos:empty { display: none; }
.cmd-group-logos svg { width: 14px; height: 14px; }
.cmd-tag {
  grid-area: tag; align-self: center; font-style: normal; font-size: 11px; white-space: nowrap;
  padding: 1px 7px; border-radius: 999px; color: var(--r-text-2, #a9a9b2);
  border: 1px solid var(--r-border-strong, rgba(255,255,255,0.14));
}
@media (max-width: 520px) { .cmd-item i { display: none; } }
.brand-logo { display: block; object-fit: contain; flex: 0 0 auto; }

/* "/connectors" panel in chat (app.js connectorsPanelHTML) */
.cx-panel {
  max-width: 560px; border-radius: 16px; overflow: hidden;
  background: var(--r-surface, #17181b); border: 1px solid var(--r-border, rgba(255,255,255,0.08));
}
.cx-panel.loading { padding: 14px 16px; }
.cx-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--r-border, rgba(255,255,255,0.08));
}
.cx-head b { display: block; font-size: 15px; color: var(--r-text, #ececef); }
.cx-head span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--r-text-3, #6b6b74); }
.cx-list { padding: 6px; }
.cx-section {
  padding: 12px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--r-text-3, #6b6b74);
}
.cx-row {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px;
}
.cx-row:hover { background: var(--r-surface-2, rgba(255,255,255,0.04)); }
.cx-row.off { opacity: 0.6; }
.cx-logo {
  flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: var(--r-surface-2, rgba(255,255,255,0.05)); border: 1px solid var(--r-border, rgba(255,255,255,0.08));
  color: var(--r-text, #ececef);
}
.cx-text { flex: 1; min-width: 0; }
.cx-name { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; color: var(--r-text, #ececef); }
.cx-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.cx-sub {
  margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--r-text-2, #a9a9b2);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cx-row.on .cx-sub { color: var(--r-text-2, #a9a9b2); }
.cx-tries { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.cx-try {
  font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--r-text-2, #a9a9b2); border: 1px solid var(--r-border-strong, rgba(255,255,255,0.14));
}
.cx-try:hover { color: var(--r-text, #ececef); border-color: var(--r-accent, #2ee6b6); }
.cx-row .ws-btn { flex: 0 0 auto; min-width: 96px; justify-content: center; }
.cx-row .th-error { margin-top: 6px; font-size: 12px; color: var(--r-danger, #f87171); }
.cx-foot { margin: 0; padding: 10px 16px 14px; font-size: 12px; color: var(--r-text-3, #6b6b74); }
html[data-theme="light"] .cx-panel { background: #fff; border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .cx-logo { background: #f6f7f9; border-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .cx-row:hover { background: rgba(0,0,0,0.03); }
html[data-theme="light"] .cx-head { border-bottom-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .cx-try { border-color: rgba(0,0,0,0.14); color: #55565e; }
html[data-theme="light"] .cx-try:hover { color: #16171a; }
@media (max-width: 520px) {
  .cx-row { flex-wrap: wrap; }
  .cx-row .ws-btn { margin-left: 52px; }
}

/* See-through "glass" design for the video and picture cards in chat (Veo, GPT Image, Puter):
   the chat shows faintly through, with a soft blur and a thin light edge. */
.ai-video-gen, .ai-image-gen {
  background: color-mix(in srgb, var(--r-surface, #17181b) 38%, transparent) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.18);
  border-radius: 18px !important;
}
.veo-card { background: transparent; }
.veo-opts select {
  background: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.12) !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
html[data-theme="light"] .ai-video-gen, html[data-theme="light"] .ai-image-gen {
  background: rgba(255,255,255,0.45) !important; border-color: rgba(15,23,42,0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 10px 30px rgba(15,23,42,0.08);
}
html[data-theme="light"] .veo-opts select { background: rgba(255,255,255,0.6) !important; border-color: rgba(15,23,42,0.14) !important; }

/* Smooth: cards rise and fade in, and their contents cross-fade when they change. */
@keyframes gx-rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.ai-video-gen, .ai-image-gen, .gc-card, .ref-card {
  animation: gx-rise 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* The "/" menu is centred with translateX(-50%), so its rise has to keep that (gx-rise ends at transform: none). */
@keyframes gx-menu-rise { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.985); } to { opacity: 1; transform: translateX(-50%); } }
.cmd-menu:not([hidden]) { animation: gx-menu-rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ai-video-gen > *, .ai-image-gen > * { animation: gx-rise 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ai-video-gen video, .ai-image-gen img { border-radius: 14px 14px 0 0; }
.veo-opts select, .ws-btn, .cmd-item { transition: background 0.2s, border-color 0.2s, transform 0.15s, opacity 0.2s; }
.ws-btn:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) {
  .ai-video-gen, .ai-image-gen, .gc-card, .ref-card, .cmd-menu, .ai-video-gen > *, .ai-image-gen > * { animation: none; }
}

/* Spot Bots → Chats: one row per bot, newest first, like WhatsApp (app.js renderBotChats). */
.bt-chats { display: flex; flex-direction: column; margin-bottom: 1.4rem; border-radius: 18px; overflow: hidden;
  background: color-mix(in srgb, var(--r-surface, #17181b) 55%, transparent); border: 1px solid var(--r-border, rgba(255,255,255,0.08));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.bt-chats[hidden], #bt-chats-label[hidden] { display: none !important; }
.bt-chat { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 0.15s; animation: gx-rise 0.32s cubic-bezier(0.2,0.8,0.2,1) both; }
.bt-chat + .bt-chat { border-top: 1px solid var(--r-border, rgba(255,255,255,0.06)); }
.bt-chat:hover { background: var(--r-surface-2, rgba(255,255,255,0.05)); }
.bt-chat-face { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--r-surface-2, rgba(255,255,255,0.05)); }
.bt-chat-face svg { display: block; }
.bt-chat-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bt-chat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bt-chat-top b { font-size: 15px; color: var(--r-text, #ececef); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-chat-top time { flex: 0 0 auto; font-size: 12px; color: var(--r-text-3, #6b6b74); }
.bt-chat-preview { font-size: 13.5px; color: var(--r-text-2, #a9a9b2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
