@import url('/client-refresh-shell.css');
@import url('/client-refresh-views.css');
@import url('/client-refresh-mobile.css');
@import url('/client-mobile-workflows.css');
@import url('/client-presentation.css?v=20261031b');
@import url('/client-ads-presentation.css');
@import url('/client-inbox-presentation.css?v=20261031b');
@import url('/client-inbox-responsive.css');

/* One AI workspace, with the same submenus in the sidebar and content. */
.nav-ai-workspace {
  margin: 4px 0 10px;
  border: 0;
  padding: 0;
}
.nav-ai-workspace > summary {
  padding: 12px 16px;
  color: #26415f;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
}
.nav-ai-workspace[open] > summary {
  background: #edf5ff;
  color: #1264d9;
}
#nav .nav-ai-workspace > button {
  width: calc(100% - 14px);
  margin-left: 14px;
  font-size: 13px;
}
.ai-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 20px;
  padding: 0 0 14px;
  border-bottom: 1px solid #dce6f4;
}
.ai-subnav button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #dce6f4;
  border-radius: 10px;
  background: white;
  color: #405876;
}
.ai-subnav button.active {
  background: #edf5ff;
  border-color: #1677ff;
  color: #1264d9;
  font-weight: 700;
}
.ai-setup-list {
  display: grid;
  gap: 8px;
}
.ai-setup-list > a {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid #dce6f4;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}
.ai-setup-list small {
  display: block;
  line-height: 1.6;
  margin-top: 4px;
  color: #63758d;
}
.ai-page-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #e0e8f2;
  padding: 14px 0;
}
.ai-page-row p {
  margin: 5px 0;
}
#ai-care-settings {
  margin-top: 16px;
}
#ai-care-settings .crm-workflow-editor > fieldset {
  border: 0;
  padding: 0;
}

/* Simple 2-Column Staff Chat Test & Answer Review Workspace */
.qa-workspace-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}
.qa-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2eaf4;
}
.qa-panel-header h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: #162a45;
}
.qa-panel-header p {
  margin: 0;
  font-size: 13px;
}
.qa-header-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.qa-safe-text {
  color: #0e7452;
}
.qa-status-banner {
  margin-bottom: 12px;
  background: #edf9f2;
  border-color: #9be0b8;
  color: #0b5d3e;
  font-weight: 600;
}
.qa-steps-list {
  display: grid;
  gap: 12px;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 4px;
}
.qa-step-card {
  border: 1px solid #dce6f4;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
  transition: border-color 0.15s ease;
}
.qa-step-card.is-approved {
  border-left: 4px solid #16a34a;
  background: #fcfefd;
}
.qa-step-card.is-pending {
  border-left: 4px solid #f59e0b;
}
.qa-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.qa-step-num {
  background: #edf5ff;
  color: #1264d9;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
}
.qa-step-question {
  flex: 1;
  font-size: 14px;
  color: #162a45;
  line-height: 1.4;
}
.qa-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.qa-badge.approved {
  background: #dcfce7;
  color: #15803d;
}
.qa-badge.pending {
  background: #fef3c7;
  color: #b45309;
}
.qa-step-kw {
  font-size: 12px;
  color: #63758d;
  margin-bottom: 8px;
}
.qa-step-answer {
  background: #f6f9fc;
  border: 1px solid #e5edf7;
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #1e3350;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.qa-step-actions,
.qa-bubble-actions,
.qa-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.qa-btn-test {
  background: #edf5ff;
  border: 1px solid #b8d6ff;
  color: #1264d9;
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.qa-btn-approve {
  background: #16a34a;
  border: 1px solid #15803d;
  color: #ffffff;
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.qa-btn-edit {
  background: #ffffff;
  border: 1px solid #c9d7ea;
  color: #314865;
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.qa-approved-hint {
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
}
.qa-inline-editor {
  background: #f8fbff;
  border: 1px solid #c6ddff;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  display: grid;
  gap: 10px;
}
.qa-inline-editor h4 {
  margin: 0;
  font-size: 14px;
}
.qa-inline-editor label {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #29415e;
}
.qa-inline-editor input,
.qa-inline-editor textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c5d4e8;
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
}
.qa-right-panel {
  position: sticky;
  top: 16px;
}
.qa-chips-bar {
  margin-bottom: 12px;
}
.qa-chips-bar summary {
  color: #5a6d85;
  margin-bottom: 6px;
  font-weight: 600;
}
.qa-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qa-chip {
  background: #f2f7ff;
  border: 1px solid #cfe2ff;
  color: #1659b8;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.qa-chip:hover {
  background: #e1eeff;
}
.qa-chat-box {
  background: #f4f7fb;
  border: 1px solid #dce6f4;
  border-radius: 12px;
  padding: 14px;
  min-height: 340px;
  max-height: 460px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  align-content: start;
  margin-bottom: 12px;
}
.qa-chat-empty {
  text-align: center;
  padding: 56px 20px;
  color: #4f637d;
}
.qa-chat-empty strong {
  display: block;
  color: #1c3554;
  margin-bottom: 8px;
}
.qa-turn {
  display: grid;
  gap: 10px;
}
.qa-msg {
  display: flex;
}
.qa-msg.customer {
  justify-content: flex-end;
}
.qa-msg.customer .qa-bubble {
  background: #1677ff;
  color: #ffffff;
  border-radius: 14px 14px 3px 14px;
  padding: 10px 14px;
  max-width: 85%;
}
.qa-msg.customer .qa-bubble span {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 2px;
}
.qa-msg.customer .qa-bubble p {
  margin: 0;
  font-size: 13.5px;
}
.qa-msg.ai .qa-bubble {
  background: #ffffff;
  border: 1px solid #d5e2f2;
  border-radius: 14px 14px 14px 3px;
  padding: 12px 14px;
  width: 100%;
}
.qa-ai-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #546882;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e3ebf5;
}
.qa-ai-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: #162a45;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.qa-chat-input-bar {
  display: flex;
  gap: 8px;
}
.qa-chat-input-bar input {
  flex: 1;
  padding: 10px 13px;
  border: 1px solid #c5d4e8;
  border-radius: 10px;
  font-size: 14px;
}
.ai-advanced-docs {
  margin-top: 12px;
  border: 1px solid #dce6f4;
  border-radius: 12px;
  padding: 12px 16px;
  background: #fafcff;
}
.ai-advanced-docs > summary {
  cursor: pointer;
  font-weight: 700;
  color: #36506f;
  padding: 4px 0;
}

@media (max-width: 960px) {
  .qa-workspace-grid {
    grid-template-columns: 1fr;
  }
  .qa-workspace-grid.has-model-chat > .qa-right-panel {
    order: -1;
  }
  .has-model-chat .qa-chat-box {
    min-height: 80px;
    max-height: clamp(120px, 30dvh, 320px);
  }
  .has-model-chat .qa-chat-empty {
    padding: 8px;
  }
  .has-model-chat .qa-chat-input-bar input {
    min-width: 0;
    font-size: 16px;
  }
  .qa-right-panel {
    position: static;
  }
}
@media (max-width: 650px) {
  .qa-left-panel > .qa-panel-header {
    flex-direction: column;
    align-items: stretch;
  }
  .qa-left-panel .qa-header-btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .qa-left-panel .qa-header-btns > * {
    min-width: 0;
  }
  .ai-subnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .ai-subnav button {
    font-size: 12px;
    padding: 9px 6px;
  }
  .ai-page-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
