/* Chatbot panel — admin.ys-legal.eu. Loaded after desk.css. */

.main-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 28px;
  border-bottom: 1px solid #d6e0e9;
}
.main-tabs button,
.sub-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #3e5674;
  font-size: 15px;
  font-weight: 700;
}
.main-tabs button[aria-selected="true"],
.sub-tabs button[aria-selected="true"] {
  color: #0a223f;
  border-bottom-color: #0a223f;
}
/* Same container for Desk and Chatbot: no width jump when switching tabs. */
html { scrollbar-gutter: stable; }
.desk { width: min(1180px, calc(100% - 32px)); }
.desk [hidden] { display: none !important; }

.cb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}
.cb-head .lede { margin: 0; }
.cb-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cb-engine { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #3e5674; }
.cb-dot { width: 10px; height: 10px; border-radius: 5px; background: #9aa9bb; flex: none; }
.cb-dot.is-on { background: #2f7d4f; }
.cb-dot.is-off { background: #8b2e2e; }
.cb-actions .primary { padding: 0 20px; }
.primary:disabled { background: #9aa9bb; cursor: default; }
.cb-saved { font-size: 14px; color: #1e5ba1; min-height: 1.3em; }
.cb-saved.is-error { color: #8b2e2e; }

.sub-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid #d6e0e9; }

.cb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.cb-col { display: grid; gap: 16px; }
.card {
  padding: 20px 22px;
  border: 1px solid #d6e0e9;
  border-radius: 16px;
  background: #fff;
}
.card h3 { margin: 0; font-size: 17px; }
.card .note { margin: 4px 0 0; font-size: 14px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-top span { font-size: 14px; color: #3e5674; }

.switch {
  flex: none;
  width: 60px;
  height: 34px;
  padding: 3px;
  border: 0;
  border-radius: 17px;
  background: #b8c3d0;
  display: flex;
  justify-content: flex-start;
}
.switch::after {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: #fff;
}
.switch[aria-checked="true"] { background: #2f7d4f; justify-content: flex-end; }

.tones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tones button {
  min-height: 48px;
  padding: 0 4px;
  border: 1px solid #c5d3e2;
  border-radius: 12px;
  background: #fff;
  color: #0f2644;
  font-size: 14px;
  font-weight: 700;
}
.tones button[aria-pressed="true"] { background: #0a223f; border-color: #0a223f; color: #fff; }
.tone-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3e5674;
}

.cb-field { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 700; }
.cb-field small { font-weight: 400; color: #3e5674; font-size: 13px; }
.desk textarea {
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border: 1px solid #c5d3e2;
  border-radius: 10px;
  background: #fff;
  color: #0f2644;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  resize: vertical;
}
.cb-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cb-count { justify-self: end; font-weight: 400; color: #3e5674; font-size: 12px; font-variant-numeric: tabular-nums; }
.cb-count.is-over { color: #8b2e2e; }

.card.locked { background: #eef3f8; border-color: #d0dcea; }
.locked h3 { display: flex; align-items: center; gap: 8px; }
.locked h3 small { font-size: 13px; font-weight: 400; color: #3e5674; }
.locked ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 20px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.try { display: flex; flex-direction: column; min-height: 640px; padding: 0; overflow: hidden; }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #e2eaf4; }
.try-head .pill { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: #eef3f8; color: #3e5674; white-space: nowrap; }
.try-log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; background: #f8fafc; overflow-y: auto; max-height: 560px; }
.try-empty { margin: auto 0; text-align: center; color: #3e5674; font-size: 14px; }
.bubble { max-width: 86%; padding: 12px 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.q { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #0a223f; color: #fff; }
.bubble.a { align-self: flex-start; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid #d6e0e9; }
.bubble.a.is-off { color: #8b2e2e; }
.bubble-meta { align-self: flex-start; margin-top: -6px; font-size: 12px; color: #3e5674; }
.try-form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 22px; border-top: 1px solid #e2eaf4; }
.try-form textarea { min-height: 48px; height: 48px; resize: none; }
.icon-send {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #0a223f;
  color: #fff;
  display: grid;
  place-items: center;
}
.icon-send:disabled { background: #9aa9bb; cursor: default; }

.src-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.src-table th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: #3e5674; padding: 0 0 8px; }
.src-table td { padding: 12px 0; border-top: 1px solid #d6e0e9; vertical-align: top; }
.src-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.src-list { display: grid; margin: 0; padding: 0; list-style: none; }
.src-list li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid #d6e0e9; font-size: 15px; }
.src-list code { font-size: 13px; color: #1e5ba1; font-weight: 700; }

.conv { display: grid; gap: 12px; }
.conv article { padding: 16px 18px; border: 1px solid #d6e0e9; border-radius: 14px; background: #fff; }
.conv time { font-size: 13px; color: #3e5674; font-variant-numeric: tabular-nums; }
.conv p { margin: 6px 0 0; }
.conv .conv-a { color: #3e5674; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) {
  .cb-grid, .cb-pair, .locked ul { grid-template-columns: 1fr; }
  .tones { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .try { min-height: 480px; }
}
