/*
 * CODSHIPX_AI_R85_R7_R4_R1_CUSTOMER_BOT_CONTROL_LIGHT_FINAL
 * Matches the existing CRM Knowledge / Bot Rules visual language.
 */

.cx-r85-r5-launch {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:134px;
  height:50px;
  margin:0;
  padding:0 22px;
  border:1px solid rgba(31,126,102,.35);
  border-radius:15px;
  color:#fff;
  background:linear-gradient(180deg,#176b58 0%,#0d5646 100%);
  box-shadow:
    0 12px 28px rgba(13,86,70,.18),
    inset 0 1px 0 rgba(255,255,255,.12);
  font:800 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:-.01em;
  white-space:nowrap;
  cursor:pointer;
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}

.cx-r85-r5-launch:hover {
  transform:translateY(-1px);
  filter:brightness(1.03);
}

.cx-r85-r5-launch:active {
  transform:translateY(0) scale(.985);
}

.cx-r85-r5-backdrop {
  position:fixed;
  inset:0;
  z-index:2147482100;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(5,12,18,.50);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.cx-r85-r5-shell {
  width:min(1120px,96vw);
  height:min(780px,90vh);
  display:grid;
  grid-template-columns:238px minmax(0,1fr);
  overflow:hidden;
  color:#10233e;
  border:1px solid rgba(148,163,184,.28);
  border-radius:24px;
  background:
    radial-gradient(circle at 92% 0%,rgba(153,237,18,.08),transparent 27%),
    #fff;
  box-shadow:0 34px 90px rgba(2,12,27,.28);
}

.cx-r85-r5-side {
  padding:22px 14px;
  overflow:auto;
  border-right:1px solid #e8eef5;
  background:#f8fbfd;
}

.cx-r85-r5-side h2 {
  margin:0 9px 5px;
  color:#0b1f3a;
  font-size:19px;
  line-height:1.18;
  letter-spacing:-.025em;
}

.cx-r85-r5-side p {
  margin:0 9px 18px;
  color:#6b7f99;
  font-size:12px;
  line-height:1.5;
}

.cx-r85-r5-cat {
  width:100%;
  display:block;
  margin:3px 0;
  padding:11px 12px;
  border:1px solid transparent;
  border-radius:12px;
  color:#53687f;
  background:transparent;
  text-align:left;
  cursor:pointer;
  font:750 13px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  transition:background .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease;
}

.cx-r85-r5-cat:hover {
  color:#173a32;
  background:#effbf6;
}

.cx-r85-r5-cat.active {
  color:#0d5d48;
  border-color:#cfe9df;
  background:#effbf6;
  box-shadow:inset 3px 0 0 #91df13;
}

.cx-r85-r5-main {
  min-width:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fff;
}

.cx-r85-r5-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:23px 26px 18px;
  border-bottom:1px solid #e8eef5;
  background:rgba(255,255,255,.88);
}

.cx-r85-r5-head h3 {
  margin:0 0 5px;
  color:#0b1f3a;
  font-size:21px;
  line-height:1.18;
  letter-spacing:-.03em;
}

.cx-r85-r5-head p {
  max-width:680px;
  margin:0;
  color:#6b7f99;
  font-size:12.5px;
  line-height:1.55;
}

.cx-r85-r5-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.cx-r85-r5-btn {
  min-height:38px;
  padding:0 13px;
  border:1px solid #d7e2ec;
  border-radius:11px;
  color:#29425f;
  background:#fff;
  cursor:pointer;
  font-size:12px;
  font-weight:800;
  transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease;
}

.cx-r85-r5-btn:hover {
  border-color:#c4d5e2;
  box-shadow:0 5px 14px rgba(15,38,63,.06);
}

.cx-r85-r5-btn:active {
  transform:scale(.985);
}

.cx-r85-r5-btn.primary {
  color:#102600;
  border-color:#8bd500;
  background:linear-gradient(180deg,#a6f20d,#8dde00);
  box-shadow:0 9px 20px rgba(139,213,0,.18);
}

.cx-r85-r5-body {
  flex:1;
  overflow:auto;
  padding:22px 26px 28px;
  color:#10233e;
  background:#fff;
}

.cx-r85-r5-alert {
  margin-bottom:16px;
  padding:12px 14px;
  border:1px solid #d6ebbd;
  border-radius:13px;
  color:#42631f;
  background:#f5fbe9;
  font-size:12px;
  line-height:1.55;
}

.cx-r85-r5-legacy {
  margin-bottom:16px;
  padding:12px 14px;
  border:1px solid #d9e9f4;
  border-radius:13px;
  color:#47637c;
  background:#f5faff;
  font-size:12px;
  line-height:1.5;
}

.cx-r85-r5-list {
  display:grid;
  gap:10px;
}

.cx-r85-r5-row {
  padding:15px 16px;
  border:1px solid #e0e8f0;
  border-radius:17px;
  background:#fbfdff;
  box-shadow:0 5px 14px rgba(15,38,63,.025);
}

.cx-r85-r5-row-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.cx-r85-r5-row h4 {
  margin:0 0 6px;
  color:#11253f;
  font-size:14px;
}

.cx-r85-r5-meta {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  color:#71849d;
  font-size:11px;
}

.cx-r85-r5-pill {
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border:1px solid #dce6ee;
  border-radius:999px;
  color:#53687f;
  background:#fff;
}

.cx-r85-r5-preview {
  max-height:110px;
  overflow:hidden;
  margin-top:10px;
  color:#52677f;
  font-size:12px;
  line-height:1.55;
  white-space:pre-wrap;
}

.cx-r85-r5-row-actions {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.cx-r85-r5-empty {
  padding:30px 24px;
  border:1px dashed #d7e2ec;
  border-radius:16px;
  color:#7b8ca2;
  background:#fbfdff;
  text-align:center;
  font-size:13px;
}

.cx-r85-r5-editor {
  display:grid;
  gap:14px;
  padding:18px;
  border:1px solid #dfe8f0;
  border-radius:19px;
  background:#f8fbfd;
}

.cx-r85-r5-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.cx-r85-r5-field {
  display:grid;
  gap:7px;
}

.cx-r85-r5-field.wide {
  grid-column:1/-1;
}

.cx-r85-r5-field span {
  color:#52677f;
  font-size:12px;
  font-weight:800;
}

.cx-r85-r5-field small {
  color:#8191a5;
  font-size:11px;
  line-height:1.45;
}

.cx-r85-r5-field input,
.cx-r85-r5-field select,
.cx-r85-r5-field textarea {
  width:100%;
  box-sizing:border-box;
  border:1px solid #d5e0ea;
  border-radius:13px;
  outline:none;
  color:#122640;
  background:#fff;
  padding:10px 12px;
  font:500 13px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  transition:border-color .15s ease,box-shadow .15s ease;
}

.cx-r85-r5-field input,
.cx-r85-r5-field select {
  min-height:44px;
}

.cx-r85-r5-field input:focus,
.cx-r85-r5-field select:focus,
.cx-r85-r5-field textarea:focus {
  border-color:#90d621;
  box-shadow:0 0 0 3px rgba(144,214,33,.13);
}

.cx-r85-r5-field textarea {
  min-height:130px;
  resize:vertical;
}

.cx-r85-r5-field textarea.json {
  min-height:92px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12px;
}

.cx-r85-r5-editor-actions {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:4px;
}

.cx-r85-r5-body::-webkit-scrollbar,
.cx-r85-r5-side::-webkit-scrollbar {
  width:9px;
  height:9px;
}

.cx-r85-r5-body::-webkit-scrollbar-thumb,
.cx-r85-r5-side::-webkit-scrollbar-thumb {
  border:2px solid transparent;
  border-radius:999px;
  background:#cad6e0;
  background-clip:padding-box;
}

@media (max-width:820px) {
  .cx-r85-r5-backdrop {
    align-items:flex-end;
    padding:10px;
  }

  .cx-r85-r5-shell {
    width:100%;
    height:min(92vh,900px);
    border-radius:21px;
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0,1fr);
  }

  .cx-r85-r5-side {
    display:flex;
    gap:5px;
    padding:10px;
    overflow:auto;
    border-right:0;
    border-bottom:1px solid #e8eef5;
    background:#f8fbfd;
  }

  .cx-r85-r5-side h2,
  .cx-r85-r5-side p {
    display:none;
  }

  .cx-r85-r5-cat {
    width:auto;
    white-space:nowrap;
  }

  .cx-r85-r5-grid {
    grid-template-columns:1fr;
  }

  .cx-r85-r5-head,
  .cx-r85-r5-body {
    padding-left:17px;
    padding-right:17px;
  }
}
