/* Chat pane: header, transcript, composer, new-chat screen. Tokens only. */

/* ---- header ------------------------------------------------------------ */
.chat-header {
  height: 56px; min-height: 56px;
  padding: 0 20px;
  display: flex; align-items: center; gap: 10px;
}
.chat-header .avatar { flex: none; display: inline-flex; }
.chat-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-actions { margin-left: auto; display: flex; gap: 4px; }
.chat-back { display: none; flex: none; } /* mobile.css reveals this */

/* ---- messages area ----------------------------------------------------- */
.chat-msgs {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 24px 24px 8px;
}
.chat-msgs-inner { max-width: 100%; }

.msg-divider {
  text-align: center;
  font-size: 13px; color: var(--text-tertiary);
  margin: 18px 0;
}

.msg-row { display: flex; align-items: center; margin-bottom: 10px; min-width: 0; }
.msg-row.user { justify-content: flex-end; }

.bubble {
  border-radius: var(--radius-bubble);
  padding: 12px 16px;
  font-size: 16px; line-height: 1.4;
  color: var(--text-primary);
  width: fit-content;
  user-select: text; -webkit-user-select: text;
  overflow-wrap: break-word; min-width: 0;
}
.bubble.agent { background: var(--bg-bubble-agent); }
.bubble.user  { background: var(--bg-bubble-user); max-width: 62%; margin-left: auto; }

/* hover toolbar + timestamp */
.msg-tools {
  display: flex; gap: 2px; margin-left: 6px; flex: none;
  opacity: 0; transition: opacity .15s ease;
}
.msg-row:hover .msg-tools { opacity: 1; }
.msg-tools .icon-btn { width: 28px; height: 28px; border-radius: 8px; color: var(--text-tertiary); }
.msg-tools .icon-btn:hover { color: var(--text-primary); background: var(--bg-elev1); }
.msg-time {
  margin-left: auto; padding-left: 12px; flex: none;
  font-size: 13px; color: var(--text-tertiary);
  opacity: 0; transition: opacity .15s ease;
}
.msg-row:hover .msg-time { opacity: 1; }

/* ---- agent cards -------------------------------------------------------- */
.card {
  position: relative;
  background: var(--bg-bubble-agent);
  border-radius: var(--radius-card);
  padding: 16px;
  font-size: 16px; line-height: 1.45;
  color: var(--text-primary);
  user-select: text; -webkit-user-select: text;
  min-width: 0; overflow-wrap: break-word;
}
.card.rich    { max-width: 760px; }
.card.paste   { max-width: 900px; }
.card.options { max-width: 780px; }
.card .line   { font-size: 16px; }
.card .spacer { height: 12px; }
.card .link-line { color: var(--blue); }

.mono-block {
  background: var(--bg-code);
  border-radius: 12px;
  padding: 16px; margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap; overflow-x: auto;
  color: var(--text-primary);
}

/* options card */
.opt-title { font-size: 17px; font-weight: 600; padding-right: 30px; }
.card-x {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--text-tertiary);
}
.card-x:hover { color: var(--text-primary); background: var(--bg-elev2); }
.opt-sub { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }
.opt-list {
  margin-top: 14px;
  border-radius: 12px; overflow: hidden;
  background: var(--bg-elev2);
}
.opt-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; padding: 12px 14px;
  font-size: 16px; text-align: left;
  transition: background .15s ease;
}
.opt-row + .opt-row { border-top: 1px solid var(--hairline); }
.opt-row:hover, .opt-row.selected { background: var(--bg-elev3); }
.opt-chip {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  background: var(--bg-elev3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-secondary);
}
.opt-row:hover .opt-chip, .opt-row.selected .opt-chip { background: var(--bg-elev2); }
.opt-label { min-width: 0; }
.opt-own {
  display: block; width: 100%; height: 48px;
  margin-top: 10px; padding: 0 14px;
  background: var(--bg-input);
  border-radius: 12px;
  font-size: 16px;
}

/* checklist card */
.chk-intro { margin-bottom: 10px; }
.chk-outro { margin-top: 10px; }
.chk-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.chk-row + .chk-row { margin-top: 10px; }
.chk-box {
  width: 20px; height: 20px; margin-top: 1px; flex: none;
  border-radius: 6px; border: 1.5px solid var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white-btn);
  transition: background .15s ease, border-color .15s ease;
}
.chk-box svg { opacity: 0; transition: opacity .15s ease; }
.chk-box.on { background: var(--blue); border-color: var(--blue); }
.chk-box.on svg { opacity: 1; }
.chk-text { font-size: 16px; min-width: 0; }

/* bullets card */
.card.bullets ul {
  margin: 8px 0 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.card.bullets li { font-size: 15.5px; }
.card.bullets li::marker { color: var(--text-secondary); }

/* ---- composer ----------------------------------------------------------- */
.composer { padding: 16px 20px 20px; flex: none; }
.composer-pill {
  border-radius: 28px;
  background: var(--bg-input);
  min-height: 56px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
}
.comp-plus {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  background: var(--bg-elev3);
  color: var(--text-primary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.comp-plus:hover { background: var(--bg-bubble-user); }
.comp-input {
  flex: 1; min-width: 0; height: 40px;
  background: transparent;
  font-size: 16px;
  padding: 0 4px;
}
.comp-mic { width: 40px; height: 40px; border-radius: 50%; flex: none; color: var(--text-secondary); }
.comp-mic:hover { background: var(--bg-elev2); color: var(--text-primary); }

/* listening state — same pill, right-side controls swap in */
.listen-ph { flex: 1; min-width: 0; padding: 0 4px; font-size: 16px; color: var(--text-tertiary); }
.listen-pill {
  display: flex; align-items: center; gap: 10px; flex: none;
  height: 36px; padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-app);
}
.listen-stop {
  width: 20px; height: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white-btn);
}
.listen-timer {
  font-size: 15px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}
.listen-wave { display: inline-flex; align-items: center; gap: 3px; height: 14px; }
.listen-wave i { width: 3px; border-radius: 2px; background: var(--text-tertiary); }
.listen-wave i:nth-child(1) { height: 6px; }
.listen-wave i:nth-child(2) { height: 12px; animation: ad-wave .8s ease-in-out infinite alternate; }
.listen-wave i:nth-child(3) { height: 8px; }
.listen-wave i:nth-child(4) { height: 4px; }
@keyframes ad-wave {
  from { transform: scaleY(.4); }
  to   { transform: scaleY(1.15); }
}
.listen-send {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--white-btn);
  color: var(--bg-app);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.listen-send:hover { transform: scale(1.05); }

/* ---- new chat screen ----------------------------------------------------- */
.nc-bar {
  height: 56px; min-height: 56px;
  padding: 0 20px;
  display: flex; align-items: center; gap: 10px;
}
.nc-to { font-size: 16px; color: var(--text-secondary); flex: none; }
.nc-input { flex: 1; min-width: 0; height: 40px; background: transparent; font-size: 16px; }

.nc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 20px; }
.nc-drop {
  width: min(720px, 100%);
  margin-left: 36px;
  background: var(--bg-menu);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
}
@media (max-width: 900px) { .nc-drop { margin-left: 0; } }

.nc-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 48px; padding: 0 12px;
  border-radius: 10px;
  font-size: 16px; text-align: left;
  transition: background .15s ease;
}
.nc-row:hover, .nc-row.selected { background: var(--bg-elev2); }
.nc-row .avatar { flex: none; display: inline-flex; }
.nc-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-create {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  background: var(--m-green);
  color: var(--white-btn);
  display: inline-flex; align-items: center; justify-content: center;
}
.nc-picon {
  width: 28px; height: 28px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.nc-chips { margin-left: auto; display: inline-flex; gap: 4px; flex: none; }
.nc-chips .key {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--bg-elev3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-secondary);
}

/* ---- chat header identity: avatar button + name/chevron switcher trigger -- */
.chat-ident { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; min-width: 0; }
.chat-av-btn {
  display: inline-flex; align-items: center; flex: none;
  padding: 4px; border-radius: 10px; cursor: pointer;
  transition: background .12s ease;
}
.chat-av-btn:hover { background: var(--bg-elev1); }
.chat-name-btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  padding: 4px 8px; border-radius: 10px; cursor: pointer;
  transition: background .12s ease;
}
.chat-name-btn:hover { background: var(--bg-elev1); }
.chat-name-btn .chat-title { min-width: 0; }
.chat-chev { display: inline-flex; flex: none; color: var(--text-tertiary); }

/* ---- agent quick-switcher popover ---------------------------------------- */
.popover.agent-switcher { width: 300px; min-width: 0; padding: 0; }
.asw-input {
  display: block; width: calc(100% - 12px); height: 38px;
  margin: 6px; padding: 0 12px;
  background: var(--bg-input); border-radius: 10px;
  font-size: 15px;
}
.asw-list { max-height: 380px; overflow-y: auto; padding: 0 6px 6px; }
.asw-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 40px; padding: 0 10px;
  border-radius: 10px; font-size: 15px; text-align: left; cursor: pointer;
  transition: background .12s ease;
}
.asw-row:hover, .asw-row.active { background: var(--bg-elev2); }
.asw-row .avatar { flex: none; display: inline-flex; }
.asw-name {
  flex: 1; min-width: 0; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asw-check { display: inline-flex; flex: none; color: var(--text-secondary); }
.asw-empty { padding: 10px 12px 12px; font-size: 14px; color: var(--text-tertiary); }
