﻿/* Ops Bot cabinet (bt-*). Telegram-like chat on site tokens. */
.bt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

.bt-chat {
  display: flex;
  flex-direction: column;
  height: 620px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.bt-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.bt-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}
.bt-avatar svg { width: 22px; height: 22px; }
.bt-head-text { min-width: 0; }
.bt-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.bt-status { font-size: 13px; color: var(--accent); line-height: 1.3; }
.bt-status.is-typing { color: var(--muted); }

.bt-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 45%),
    radial-gradient(circle at 85% 90%, var(--bg-tint), transparent 50%),
    var(--surface-2);
}
.bt-msg { display: flex; flex-direction: column; max-width: min(78%, 440px); animation: bt-in 0.18s ease; }
.bt-from-bot { align-self: flex-start; }
.bt-from-user { align-self: flex-end; align-items: flex-end; }

.bt-bubble {
  position: relative;
  padding: 8px 12px 6px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.bt-from-bot .bt-bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bt-from-user .bt-bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bt-body { white-space: pre-wrap; }
.bt-from-bot .bt-body { white-space: normal; }
.bt-body p + p, .bt-body p + .bt-kv, .bt-body p + ul { margin-top: 6px; }
.bt-time { display: block; text-align: right; font-size: 11px; margin-top: 2px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bt-from-user .bt-time { color: var(--accent-ink); opacity: 0.75; }

.bt-cmds { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.bt-body code, .bt-usage code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; color: var(--accent); }

.bt-card { min-width: min(260px, 60vw); }
.bt-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bt-flag { font-size: 18px; line-height: 1; }
.bt-kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.bt-kv:last-of-type { border-bottom: 0; }
.bt-kv span { color: var(--muted); }
.bt-kv b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bt-kv b .dm-badge { margin-left: 4px; font-size: 11px; padding: 1px 7px; }
.bt-kv.is-low b { color: var(--warning-text); }
.bt-warn { font-style: normal; color: var(--warning-text); margin-right: 5px; }
.bt-kv em { font-style: normal; font-size: 12px; margin-left: 4px; }
.bt-up { color: var(--good-text); }
.bt-down { color: var(--critical-text); }
.bt-note { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.bt-note-warn { color: var(--warning-text); }
.bt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bt-tags span { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.bt-task { padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 6px; }
.bt-task.is-done { text-decoration: line-through; color: var(--muted); border-left-color: var(--good); }
.bt-countdown, .bt-meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; }
.bt-countdown span, .bt-meter span { display: block; height: 100%; border-radius: 999px; background: var(--series-1); transition: width 0.9s linear; }

.bt-kbd { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bt-kbtn {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface));
  transition: background 0.15s, transform 0.1s;
}
.bt-kbtn:hover { background: var(--accent-soft); }
.bt-kbtn:active { transform: scale(0.97); }

.bt-typing .bt-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.bt-typing .bt-bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bt-dot 1s infinite ease-in-out; }
.bt-typing .bt-bubble span:nth-child(2) { animation-delay: 0.15s; }
.bt-typing .bt-bubble span:nth-child(3) { animation-delay: 0.3s; }

.bt-chips { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: none; background: var(--surface); }
.bt-chips::-webkit-scrollbar { display: none; }
.bt-chip {
  flex: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.bt-chip:hover { border-color: var(--accent); color: var(--accent); }

.bt-input { display: flex; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.bt-field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14.5px;
  background: var(--surface-2);
  outline: none;
}
.bt-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bt-send {
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
}
.bt-send:hover { background: var(--accent-hover); }
.bt-send svg { width: 20px; height: 20px; }

/* Side panel */
.bt-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bt-side-title { margin-bottom: 12px; }
.bt-side-sub { margin-bottom: 12px; }
.bt-ints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bt-ints li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.bt-ints li div { display: flex; flex-direction: column; min-width: 0; }
.bt-ints .dm-sub { font-size: 12.5px; }
.bt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--good-soft); animation: bt-pulse 2.4s infinite; }
.bt-usage { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bt-usage li { display: grid; grid-template-columns: 84px minmax(0, 1fr) 28px; align-items: center; gap: 8px; font-size: 13.5px; }
.bt-usage li .bt-meter { margin: 0; }
.bt-usage li b { text-align: right; font-variant-numeric: tabular-nums; }
.bt-usage li.is-bump b { color: var(--accent); animation: bt-bump 0.5s ease; }

@keyframes bt-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes bt-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes bt-pulse { 50% { box-shadow: 0 0 0 5px var(--good-soft); } }
@keyframes bt-bump { 40% { transform: scale(1.3); } }

@media (max-width: 900px) {
  .bt-layout { grid-template-columns: 1fr; }
  .bt-chat { height: 560px; }
}
@media (max-width: 520px) {
  .bt-chat { height: 520px; }
  .bt-msg { max-width: 88%; }
  .bt-log { padding: 12px; }
}
