/* captain-kit.css — the Captain ("Assist") pages drawn with captain-kit.js
   (Documents, FAQs). They sit in the overview's own shell (.cpo, in
   captain-overview.css: width, padding, colours, buttons, cards), so these
   rules add only what the overview does not have. Light first; the
   platform's lime replaces blue in the dark. */
[data-crm-capk-host] { position: relative; }

/* ---------------------------------------------------------------- search */
.cpk-search {
  display: inline-flex; align-items: center; gap: 8px; width: 300px; height: 38px; padding: 0 6px 0 12px;
  border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-card); color: var(--c-muted);
  box-shadow: none; cursor: text;
}
.cpo[dir="rtl"] .cpk-search { padding: 0 12px 0 6px; }
.cpk-search:focus-within { border-color: #b9c4d0; }
.cpk-search > .fi { font-size: 14px; }
.cpo .cpk-search-input {
  flex: 1; min-width: 0; width: auto !important; height: 36px; margin: 0 !important; padding: 0 !important;
  border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important;
  color: var(--c-ink); font: inherit; font-size: 13px;
}
.cpo .cpk-search-input::-webkit-search-cancel-button { display: none; }
/* The platform draws every <kbd> as a full-height key; these are two small
   hints inside the field, so every box property is set here. */
.cpk-kbd { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.cpo .cpk-kbd kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; margin: 0; padding: 0 5px;
  border: 1px solid var(--c-line); border-radius: 5px; background: var(--c-soft); box-shadow: none;
  color: var(--c-muted); font-family: inherit; font-size: 11px; font-weight: 500; line-height: 1;
}

/* -------------------------------------------------------------- dropdown */
.cpo .cpk-drop {
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 14px;
  border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-card); color: var(--c-ink);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.cpo[dir="rtl"] .cpk-drop { padding: 0 14px 0 12px; }
.cpo .cpk-drop:hover { border-color: #b9c4d0; }
.cpk-drop > .fi { font-size: 15px; }
.cpk-drop-caret { color: var(--c-muted); margin-inline-start: 4px; }

/* ------------------------------------------------------------------ menu */
.cpk-menu {
  position: fixed; z-index: 10050; min-width: 190px; padding: 6px; display: grid; gap: 2px;
  border: 1px solid #e7eaf0; border-radius: 8px; background: #fff; color: #101828;
  box-shadow: 0 14px 30px rgba(16, 24, 40, .14); font-size: 13px;
}
.dark .cpk-menu { border-color: #2c3138; background: #1b1e23; color: #e8eaed; }
.cpk-menu hr { margin: 4px 2px; border: 0; border-top: 1px solid #e7eaf0; }
.dark .cpk-menu hr { border-top-color: #2c3138; }
.cpk-menu .cpk-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; white-space: nowrap;
}
.cpk-menu .cpk-menu-item .fi { font-size: 14px; opacity: .8; }
.cpk-menu .cpk-menu-item:hover, .cpk-menu .cpk-menu-item.is-on { background: #f2f4f7; }
.dark .cpk-menu .cpk-menu-item:hover, .dark .cpk-menu .cpk-menu-item.is-on { background: #23272d; }
.cpk-menu .cpk-menu-item.is-danger { color: #e5484d; }
.cpk-menu-check { margin-inline-start: auto; opacity: 1 !important; }

/* ---------------------------------------------------------------- dialog */
.cpk-back { position: fixed; inset: 0; z-index: 10040; display: grid; place-items: center; padding: 16px; background: rgba(16, 24, 40, .45); }
.cpk-dialog {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 8px;
  background: #fff; color: #101828; box-shadow: 0 24px 60px rgba(16, 24, 40, .25); font-size: 13px; text-align: start;
}
.dark .cpk-dialog { background: #1b1e23; color: #e8eaed; }
.cpk-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.cpk-dialog-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.cpk-dialog-head p { margin: 4px 0 0; color: #667085; font-size: 13px; }
.dark .cpk-dialog-head p { color: #98a1ad; }
.cpk-dialog .cpk-x { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; font-size: 16px; }
.cpk-dialog .cpk-x:hover { background: rgba(0, 0, 0, .06); }
.cpk-dialog-body { padding: 14px 20px 6px; }
.cpk-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.cpk-confirm-text { margin: 0; line-height: 1.6; color: #475467; }
.dark .cpk-confirm-text { color: #b8c0cc; }

/* Dialogs live outside .cpo, so they carry their own copy of the buttons. */
.cpk-dialog .cpo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid #e7eaf0; border-radius: 8px; background: #fff; color: #101828;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.dark .cpk-dialog .cpo-btn { border-color: #2c3138; background: #23272d; color: #e8eaed; }
.cpk-dialog .cpo-btn.is-primary { background: #d4fb08; border-color: #d4fb08; color: #1d2400; }
.cpk-dialog .cpo-btn.is-danger { background: #e5484d; border-color: #e5484d; color: #fff; }
.cpk-dialog .cpo-btn:disabled { opacity: .6; cursor: default; }

.cpk-form { display: grid; gap: 14px; }
.cpk-field { display: grid; gap: 6px; }
.cpk-field > span { font-size: 12.5px; font-weight: 600; }
.cpk-field > small { color: #667085; font-size: 12px; line-height: 1.5; }
.dark .cpk-field > small { color: #98a1ad; }
.cpk-dialog .cpk-input, .cpk-dialog .cpk-textarea {
  width: 100% !important; height: 40px; margin: 0 !important; padding: 0 12px !important; border: 1px solid #d0d5dd !important;
  border-radius: 8px; background: #fff !important; color: #101828; font: inherit; font-size: 13.5px; box-shadow: none !important; outline: 0;
}
.cpk-dialog .cpk-textarea { height: auto; min-height: 140px; padding: 10px 12px !important; line-height: 1.55; resize: vertical; }
.cpk-dialog .cpk-input:focus, .cpk-dialog .cpk-textarea:focus { border-color: #98a2b3 !important; }
.dark .cpk-dialog .cpk-input, .dark .cpk-dialog .cpk-textarea { border-color: #353b44 !important; background: #23272d !important; color: #e8eaed; }
.cpk-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 8px; background: #f2f4f7; }
.dark .cpk-seg { background: #23272d; }
.cpk-dialog .cpk-seg-b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.cpk-dialog .cpk-seg-b.is-on { background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.dark .cpk-dialog .cpk-seg-b.is-on { background: #353b44; }
.cpk-dialog .cpk-drop-zone {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 84px; padding: 14px;
  border: 1.5px dashed #d0d5dd; border-radius: 8px; background: none; color: #667085; font: inherit; cursor: pointer;
}
.cpk-dialog .cpk-drop-zone .fi { font-size: 20px; }
.cpk-dialog .cpk-drop-zone.has-file { border-style: solid; color: #101828; }
.dark .cpk-dialog .cpk-drop-zone { border-color: #353b44; color: #98a1ad; }
.dark .cpk-dialog .cpk-drop-zone.has-file { color: #e8eaed; }

/* ----------------------------------------------------------------- toast */
.cpk-toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 10060; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 8px; background: #101828; color: #fff; font-size: 13px; line-height: 1.5;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .25); transition: opacity .4s;
}
.cpk-toast.is-bad { background: #b42318; }
.cpk-toast.is-out { opacity: 0; }

/* ----------------------------------------------------------- points card */
.cpo-card.cpk-points { display: grid; grid-template-columns: minmax(0, 1fr) 300px; padding: 0; margin-bottom: 18px; }
.cpk-points-main { display: flex; gap: 16px; padding: 20px 22px; border-inline-end: 1px solid var(--c-line); }
.cpk-points-ic, .cpk-points-sic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; font-size: 19px; }
.cpk-points-ic { background: color-mix(in srgb, var(--c-lime) 30%, var(--c-card)); color: var(--c-lime-ink); }
.dark .cpk-points-ic { color: var(--c-lime); background: rgba(212, 251, 8, .12); }
.cpk-points-sic { background: var(--crm-tint); color: var(--crm-ink); }
.dark .cpk-points-sic { background: rgba(212, 251, 8, .12); color: #d4fb08; }
.cpk-points-body { flex: 1; min-width: 0; }
.cpk-points-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cpk-points-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.cpk-grow { flex: 1; }
.cpo .cpo-btn.cpk-buy { height: 36px; padding: 0 18px; border-radius: 20px; }
.cpk-points-big { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 12px; }
.cpk-points-big strong { font-size: 28px; font-weight: 800; line-height: 1; }
.cpk-points-big span { color: var(--c-muted); font-size: 13.5px; }
.cpk-points-meter { height: 8px; margin-bottom: 12px; }
.cpk-points-side { display: flex; align-items: center; gap: 16px; padding: 20px 22px; }
.cpk-points-slabel { display: block; font-size: 14px; font-weight: 700; }
.cpk-points-sval { display: block; margin: 4px 0; font-size: 28px; font-weight: 800; line-height: 1.1; }
.cpk-points-scap { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; }

/* ----------------------------------------------------------------- pager */
.cpk-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 4px; }
.cpk-pager-nav { display: inline-flex; align-items: center; gap: 8px; }
.cpk-pager-n { font-size: 13px; font-variant-numeric: tabular-nums; }
.cpo .cpo-btn.is-icon { width: 36px; height: 36px; padding: 0; }
.cpo .cpo-btn:disabled { opacity: .45; cursor: default; }

/* ============================================================= Documents */
.cdoc-filters { display: flex; gap: 12px; flex-wrap: wrap; margin: -2px 0 18px; }

.cdoc-spot {
  display: flex; align-items: center; gap: 28px; padding: 16px 24px; margin-bottom: 18px;
  border: 1.5px dashed var(--c-line); border-radius: 8px;
}
.cdoc-art svg { display: block; width: 150px; height: 100px; }
.cdoc-art-bg { fill: #f1edff; }
.cdoc-art-back { fill: #b8a6f5; }
.cdoc-art-page { fill: #ffffff; stroke: #7c5cf0; stroke-width: 2; }
.cdoc-art-line { stroke: #7c5cf0; stroke-width: 3; stroke-linecap: round; fill: none; }
.cdoc-art-spark { fill: #7c5cf0; }
.dark .cdoc-art-bg { fill: #2a2440; }
.dark .cdoc-art-page { fill: #1b1e23; }
.cdoc-spot-copy strong { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 700; }
.cdoc-spot-copy p { margin: 0; max-width: 760px; color: var(--c-muted); font-size: 13.5px; line-height: 1.6; }

.cdoc-list { display: grid; gap: 10px; }
.cdoc-list.is-loading { opacity: .55; pointer-events: none; }
.cpo-card.cdoc-row {
  display: grid; grid-template-columns: 50px minmax(0, 1fr) auto 170px 38px; align-items: center; gap: 18px;
  padding: 13px 18px 13px 22px; border-radius: 8px;
}
.cpo[dir="rtl"] .cpo-card.cdoc-row { padding: 13px 22px 13px 18px; }
.cdoc-row-ic { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 8px; background: var(--c-soft); color: var(--c-muted); font-size: 20px; }
.cdoc-row-mid { min-width: 0; }
.cdoc-row-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.cdoc-row-meta { display: flex; align-items: center; gap: 22px; margin-top: 6px; min-width: 0; color: var(--c-muted); font-size: 13px; }
.cdoc-row-meta > span, .cdoc-row-link { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.cdoc-row-meta > span { flex: none; }
.cdoc-row-meta .fi { font-size: 13px; flex: none; }
.cdoc-row-link { color: inherit; text-decoration: none; overflow: hidden; }
.cdoc-row-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.cdoc-row-link:hover { color: var(--c-ink); }
.cdoc-row-out { font-size: 11px !important; }
.cpo .cdoc-row-faqs { border: 0; background: none; padding: 4px 6px; color: var(--c-ink); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; border-radius: 6px; }
.cpo button.cdoc-row-faqs:hover { background: var(--c-soft); }
.cdoc-row-st { display: inline-flex; align-items: center; gap: 8px; color: var(--c-muted); font-size: 13.5px; white-space: nowrap; }
.cdoc-row-st .fi { font-size: 15px; }
.cdoc-row-st.is-run { color: var(--c-blue); }
.cdoc-row-st.is-run .fi { animation: cdoc-spin 1.2s linear infinite; }
.cdoc-row-st.is-bad { color: var(--c-red); }
@keyframes cdoc-spin { to { transform: rotate(360deg); } }
.cpo .cdoc-row-more {
  width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--c-line); border-radius: 8px;
  background: var(--c-card); color: var(--c-ink); cursor: pointer; font-size: 15px;
}
.cpo .cdoc-row-more:hover { border-color: #b9c4d0; }

.cdoc-empty { position: relative; }
.cdoc-sample { display: grid; gap: 10px; opacity: .5; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); }
.cdoc-sample + .cdoc-empty-msg { margin-top: -70px; }
.cdoc-empty-msg { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 16px 30px; }
.cdoc-empty-ic { width: 54px; height: 60px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 8px; background: var(--c-soft); color: var(--c-muted); font-size: 26px; }
.cdoc-empty-msg h2 { margin: 0 0 8px; font-size: 21px; font-weight: 700; }
.cdoc-empty-msg p { margin: 0 0 18px; max-width: 460px; color: var(--c-muted); font-size: 13.5px; line-height: 1.6; }
.cdoc-empty-msg .cpo-btn { height: 42px; padding: 0 20px; font-size: 14px; }

/* ----------------------------------------------------------------- width */
@media (max-width: 1100px) {
  .cpo-card.cpk-points { grid-template-columns: minmax(0, 1fr); }
  .cpk-points-main { border-inline-end: 0; border-bottom: 1px solid var(--c-line); }
  .cpo-card.cdoc-row { grid-template-columns: 50px minmax(0, 1fr) auto 38px; }
  .cdoc-row-st { display: none; }
}
@media (max-width: 720px) {
  .cpk-search { width: 100%; }
  .cdoc-spot { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cpo-card.cdoc-row { grid-template-columns: 40px minmax(0, 1fr) 38px; gap: 12px; padding: 12px 14px; }
  .cdoc-row-ic { width: 40px; height: 40px; }
  .cdoc-row-faqs { display: none; }
  .cdoc-row-meta > span:first-child { display: none; }
}

/* ======================================================== shared, round 2 */
/* The overview's two AI points cards, side by side (crmCap.creditRow). */
.cpk-credit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.cpk-credit-head { align-items: flex-start; }
.cpk-credit-renew { margin-top: 6px; font-size: 12.5px; }
.cpk-credit-row .cpo-credit-big { margin-top: 10px; }
.cpk-credit-row .cpo-card > .cpo-muted { font-size: 12.5px; }

/* A dismissible note (crmCap.banner). */
.cpk-banner {
  position: relative; display: flex; align-items: center; gap: 18px; margin-bottom: 14px; padding: 16px 48px 16px 22px;
  border: 1px solid var(--c-info-line); border-radius: 8px; background: var(--c-info);
}
.cpo[dir="rtl"] .cpk-banner { padding: 16px 22px 16px 48px; }
.cpk-banner-ic { flex: none; font-size: 26px; color: var(--crm-ink); }
.dark .cpk-banner-ic { color: var(--c-lime); }
.cpk-banner-copy strong { display: block; margin-bottom: 4px; font-size: 14.5px; font-weight: 700; }
.cpk-banner-copy span { color: var(--c-muted); font-size: 13px; line-height: 1.55; }
.cpo .cpk-banner-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--crm-ink); font-size: 15px; cursor: pointer; }
.dark .cpo .cpk-banner-x { color: var(--c-muted); }
.cpo .cpk-banner-x:hover { background: rgba(0, 0, 0, .06); }

.cpk-dialog.is-wide { width: min(640px, 100%); }
.cpk-dialog.is-xwide { width: min(900px, 100%); }

/* ============================================================= Scenarios */
.cscn-art svg { display: block; width: 180px; height: 150px; }
.cscn-art-bg { fill: #eef9e8; }
.dark .cscn-art-bg { fill: #1f2a1c; }
.cscn-art-spark path { fill: none; stroke: #4cc760; stroke-width: 3; stroke-linecap: round; }
.cscn-art-back { fill: #e3e7ed; }
.cscn-art-page { fill: #fff; stroke: #e3e7ed; filter: drop-shadow(0 6px 10px rgba(16, 24, 40, .08)); }
.dark .cscn-art-back { fill: #2c3138; }
.dark .cscn-art-page { fill: #23272d; stroke: #353b44; }
.cscn-art-line { stroke: #cfd5dd; stroke-width: 5; stroke-linecap: round; }
.dark .cscn-art-line { stroke: #3a414b; }
.cscn-art-chat { fill: #22c55e; }
.cscn-art-dot { fill: #fff; }

.cpo-card.cscn-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 38px; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 8px; }
.cpo-card.cscn-row.is-off { opacity: .65; }
.cscn-row-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: #e7f8ef; color: #12a150; font-size: 18px; }
.dark .cscn-row-ic { background: rgba(62, 207, 122, .13); color: #3ecf7a; }
.cscn-row-mid { min-width: 0; }
.cscn-row-t { display: block; font-size: 15px; font-weight: 600; unicode-bidi: plaintext; }
.cscn-row-d { margin: 4px 0 0; color: var(--c-muted); font-size: 13.5px; line-height: 1.55; unicode-bidi: plaintext;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cscn-list { margin-bottom: 14px; }

.cpo-card.cscn-tpls { padding: 18px 20px 20px; }
.cscn-tpls-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cscn-tpls-head strong { display: block; margin-bottom: 3px; font-size: 14.5px; font-weight: 700; }
.cscn-tpls-head span { color: var(--c-muted); font-size: 12.5px; }
.cpo .cscn-link { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--crm-ink); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.dark .cpo .cscn-link { color: var(--c-lime); }
.cpo .cscn-link:hover { text-decoration: underline; }
.cscn-tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cscn-tpl-grid.is-dialog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cscn-tpl { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--c-line, #e7eaf0); border-radius: 8px; background: var(--c-card, #fff); }
.cpk-dialog .cscn-tpl { border-color: #e7eaf0; background: #fff; }
.dark .cpk-dialog .cscn-tpl { border-color: #2c3138; background: #23272d; }
.cscn-tpl-top { display: flex; gap: 14px; }
.cscn-tpl-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; font-size: 19px; }
.cscn-tpl-ic.is-green { background: #e7f8ef; color: #12a150; }
.cscn-tpl-ic.is-blue { background: var(--crm-tint); color: var(--crm-ink); }
.cscn-tpl-ic.is-orange { background: #fff3e3; color: #e8890c; }
.cscn-tpl-ic.is-red { background: #fdecec; color: #e5484d; }
.dark .cscn-tpl-ic.is-green { background: rgba(62, 207, 122, .13); color: #3ecf7a; }
.dark .cscn-tpl-ic.is-blue { background: rgba(212, 251, 8, .12); color: #d4fb08; }
.dark .cscn-tpl-ic.is-orange { background: rgba(240, 180, 41, .13); color: #f0b429; }
.dark .cscn-tpl-ic.is-red { background: rgba(255, 107, 111, .13); color: #ff6b6f; }
.cscn-tpl-copy strong { display: block; margin-bottom: 4px; font-size: 13.5px; font-weight: 700; }
.cscn-tpl-copy span { display: block; color: #667085; font-size: 12.5px; line-height: 1.5; }
.dark .cscn-tpl-copy span { color: #98a1ad; }
.cscn-tpl .cscn-tpl-use {
  margin-inline-start: 58px; height: 34px; border: 1px solid #e7eaf0; border-radius: 8px; background: #fff; color: #101828;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.dark .cscn-tpl .cscn-tpl-use { border-color: #353b44; background: #1b1e23; color: #e8eaed; }
.cscn-tpl .cscn-tpl-use:hover { border-color: #b9c4d0; }

.cpk-dialog .cscn-desc { min-height: 70px; }
.cpk-dialog .cscn-instr { min-height: 180px; }
.cscn-count { justify-self: end; }
.cscn-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cpk-dialog .cscn-tool-btn { height: 30px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: none; }
.dark .cpk-dialog .cscn-tool-btn { border-color: #353b44; }
.cscn-tools small { color: #667085; font-size: 12px; }
.cscn-on { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }

@media (max-width: 1100px) {
  .cpk-credit-row { grid-template-columns: minmax(0, 1fr); }
  .cscn-tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cscn-tpl-grid, .cscn-tpl-grid.is-dialog { grid-template-columns: minmax(0, 1fr); }
  .cpo-card.cscn-row { grid-template-columns: minmax(0, 1fr) auto 38px; }
  .cscn-row-ic { display: none; }
}

/* ============================================================ Playground */
.cpg-ic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--c-lime) 22%, var(--c-card)); color: #3f7d0e; font-size: 19px; }
.dark .cpg-ic { background: rgba(212, 251, 8, .12); color: #d4fb08; }

.cpo-card.cpg-points { padding: 22px 24px; margin-bottom: 18px; }
.cpg-points-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cpg-points-head h3 { margin: 0; font-size: 19px; font-weight: 700; }
.cpo .cpo-btn.cpg-buy { height: 46px; padding: 0 30px; border-radius: 8px; font-size: 14.5px; font-weight: 700; }
.cpg-points-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin-top: 12px; }
.cpg-points-left { padding-inline-end: 40px; border-inline-end: 1px solid var(--c-line); }
.cpg-points-right { padding-inline-start: 46px; display: grid; align-content: center; gap: 14px; }
.cpg-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.cpg-big strong { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.cpg-big span { color: var(--c-muted); font-size: 16px; font-weight: 600; }
.cpg-meter { height: 14px; margin-bottom: 14px; border-radius: 8px; }
.cpg-meter i { border-radius: 8px; }
.cpg-use-l { display: block; margin-bottom: 8px; font-size: 13.5px; }
.cpg-use-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 18px; }
.cpg-use-row .cpo-meter { height: 10px; }
.cpg-use-row b { text-align: end; font-size: 15px; font-variant-numeric: tabular-nums; }

.cpo-card.cpg-chat { padding: 22px 24px 18px; }
.cpg-chat-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.cpg-chat-copy { flex: 1; min-width: 0; }
.cpg-chat-copy h3 { margin: 4px 0 6px; font-size: 19px; font-weight: 700; }
.cpg-chat-copy p { margin: 0; color: var(--c-muted); font-size: 14.5px; line-height: 1.5; }
.cpo .cpo-btn.cpg-reset { width: 48px; height: 48px; border-radius: 8px; font-size: 17px; }

.cpg-log {
  display: flex; flex-direction: column; gap: 14px; height: 300px; overflow-y: auto; padding: 18px;
  border: 1px solid var(--c-line); border-radius: 8px; background: color-mix(in srgb, var(--c-soft) 45%, var(--c-card));
}
.cpg-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.cpg-empty-ic { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: var(--c-soft); color: var(--c-muted); font-size: 20px; }
.dark .cpg-empty-ic { background: #2c3138; }
.cpg-empty strong { font-size: 14.5px; font-weight: 600; }
.cpg-empty span { color: var(--c-muted); font-size: 13.5px; }

.cpg-msg { display: flex; align-items: flex-end; gap: 10px; max-width: 78%; }
.cpg-msg.is-user { align-self: flex-end; flex-direction: row-reverse; }
.cpg-msg.is-bot { align-self: flex-start; }
.cpg-av { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--c-soft); color: var(--c-ink); font-size: 14px; }
.dark .cpg-av { background: #2c3138; }
.cpg-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cpg-msg.is-user .cpg-col { align-items: flex-end; }
.cpg-agent { color: var(--c-muted); font-size: 11.5px; padding-inline-start: 4px; }
.cpg-bubble { padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.cpg-msg.is-user .cpg-bubble { background: var(--c-lime); color: #1d2400; border-end-end-radius: 4px; }
.cpg-msg.is-bot .cpg-bubble { background: var(--c-card); border: 1px solid var(--c-line); border-end-start-radius: 4px; }
.cpg-msg.is-error .cpg-bubble { border-color: color-mix(in srgb, var(--c-red) 45%, var(--c-line)); color: var(--c-red); }
.cpg-trace { display: flex; flex-wrap: wrap; gap: 6px; }
.cpg-trace span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; background: var(--c-soft); color: var(--c-muted); font-size: 11.5px; }
.cpg-trace span span { padding: 0; background: none; }
.cpg-typing { display: inline-flex; align-items: center; gap: 4px; padding: 14px 16px; }
.cpg-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); animation: cpg-dot 1.2s infinite ease-in-out; }
.cpg-typing i:nth-child(2) { animation-delay: .15s; }
.cpg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cpg-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cpg-limit { display: flex; align-items: center; gap: 12px; margin: 22px 0 22px; padding: 13px 18px; border-radius: 8px; background: var(--c-soft); color: var(--c-muted); font-size: 13.5px; }
.dark .cpg-limit { background: #23272d; }
.cpg-limit .fi { font-size: 16px; }
.cpg-limit b { color: var(--c-ink); font-weight: 600; }

.cpg-input { display: flex; align-items: center; gap: 10px; height: 66px; padding: 0 8px 0 24px; border: 1px solid var(--c-line); border-radius: 33px; background: var(--c-card); }
.cpo[dir="rtl"] .cpg-input { padding: 0 24px 0 8px; }
.cpg-input:focus-within { border-color: #b9c4d0; }
.cpo .cpg-field { flex: 1; min-width: 0; width: auto !important; height: 60px; margin: 0 !important; padding: 0 !important; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; color: var(--c-ink); font: inherit; font-size: 15.5px; }
.cpo .cpg-send { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--c-lime); color: #1d2400; font-size: 19px; cursor: pointer; }
.cpo .cpg-send:disabled { opacity: .55; cursor: default; }
.cpo[dir="rtl"] .cpg-send .fi { transform: scaleX(-1); }
.cpg-foot { margin: 14px 0 0; text-align: center; color: var(--c-muted); font-size: 12.5px; }

@media (max-width: 900px) {
  .cpg-points-cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cpg-points-left { padding-inline-end: 0; border-inline-end: 0; padding-bottom: 18px; border-bottom: 1px solid var(--c-line); }
  .cpg-points-right { padding-inline-start: 0; }
  .cpg-msg { max-width: 92%; }
}

/* ======================================================= Connected Inboxes */
.cpo-card.cinb-points { padding: 22px 24px; margin-bottom: 18px; }
.cinb-points-ic { flex: none; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--c-lime) 18%, var(--c-card)); color: var(--c-ink); font-size: 20px; }
.dark .cinb-points-ic { background: rgba(212, 251, 8, .12); color: #d4fb08; }
.cpo .cpo-btn.cinb-buy { height: 46px; padding: 0 26px; border-radius: 23px; font-size: 14.5px; font-weight: 700; }
.cinb-big { margin: 14px 0 16px; }
.cinb-meter { height: 14px; border-radius: 8px; }
.cinb-meter i { border-radius: 8px; }
.cinb-left { margin-top: 12px; font-size: 13.5px; }
.cinb-use { display: grid; gap: 16px; margin-top: 20px; padding-top: 22px; border-top: 1px solid var(--c-line); }
.cinb-use-row { display: grid; grid-template-columns: minmax(170px, 300px) minmax(0, 1fr) 70px; align-items: center; gap: 30px; font-size: 14.5px; }
.cinb-use-row .cpo-meter { height: 12px; border-radius: 8px; }
.cinb-use-row .cpo-meter i { border-radius: 8px; }
.cinb-use-row b { text-align: end; font-size: 15.5px; font-variant-numeric: tabular-nums; }

.cpo-card.cinb-row { display: flex; align-items: center; gap: 22px; padding: 20px 30px; border-radius: 8px; }
.cinb-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 500; unicode-bidi: plaintext; }
.cinb-av { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; background: var(--c-soft); color: var(--c-ink); }
.cinb-av svg { width: 22px; height: 22px; }
.cinb-av.is-whatsapp { background: #e3f7ea; color: #1faa59; }
.cinb-av.is-messenger { background: #e8f0ff; color: #0a7cff; }
.cinb-av.is-instagram { background: #fde8f1; color: #d62976; }
.cinb-av.is-telegram { background: #e5f4fb; color: #229ed9; }
.cinb-av.is-tiktok { background: #eef0f3; color: #111; }
.cinb-av.is-email { background: #fff3e3; color: #e8890c; }
.cinb-av.is-web { background: var(--crm-tint); color: var(--crm-ink); }
.dark .cinb-av { background: #2c3138; }
.dark .cinb-av.is-whatsapp { background: rgba(31, 170, 89, .16); }
.dark .cinb-av.is-messenger, .dark .cinb-av.is-web { background: rgba(10, 124, 255, .16); }
.dark .cinb-av.is-instagram { background: rgba(214, 41, 118, .16); }
.dark .cinb-av.is-tiktok { color: #e8eaed; }
.cpo-card.cinb-row .cdoc-row-more { width: 44px; height: 44px; font-size: 17px; }

.cinb-pick { display: grid; gap: 8px; max-height: 380px; overflow-y: auto; }
.cpk-dialog .cinb-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 1px solid #e7eaf0; border-radius: 8px;
  background: #fff; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.dark .cpk-dialog .cinb-opt { border-color: #2c3138; background: #23272d; }
.cpk-dialog .cinb-opt:hover { border-color: #b9c4d0; }
.cpk-dialog .cinb-opt.is-on { border-color: #a6c400; box-shadow: 0 0 0 3px rgba(212, 251, 8, .35); }
.cpk-dialog .cinb-opt.is-taken { opacity: .55; cursor: not-allowed; }
.cpk-dialog .cinb-opt .cinb-av { width: 40px; height: 40px; font-size: 18px; }
.cinb-opt-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cinb-opt-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; unicode-bidi: plaintext; }
.cinb-opt-copy small { color: #667085; font-size: 12px; }
.cinb-opt-check { visibility: hidden; color: #6f8a00; font-size: 16px; }
.dark .cinb-opt-check { color: #d4fb08; }
.cinb-opt.is-on .cinb-opt-check { visibility: visible; }

@media (max-width: 900px) {
  .cinb-use-row { grid-template-columns: minmax(0, 1fr) 50px; gap: 8px 16px; }
  .cinb-use-row > span { grid-column: 1 / -1; }
  .cpo-card.cinb-row { padding: 16px 18px; gap: 14px; }
}

/* ================================================================= Tools */
.cpo-card.cctl-spot { display: flex; align-items: center; gap: 28px; padding: 22px 24px; margin-bottom: 22px; }
.cctl-art svg { display: block; width: 134px; height: 119px; }
.cctl-art-bg { fill: #f3f0fb; }
.dark .cctl-art-bg { fill: #2a2440; }
.cctl-art-band { fill: none; stroke: #a07af5; stroke-width: 30; stroke-linecap: round; }
.cctl-art-mic { fill: none; stroke: #9f7bf4; stroke-width: 24; stroke-linecap: round; }
.cctl-art-head { fill: #fff; stroke: #111; stroke-width: 30; }
.cctl-art-eye { fill: #111; }
.cctl-art-spark path { fill: none; stroke: #8b5cf6; stroke-width: 26; stroke-linecap: round; }

.cctl-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 24px 40px;
  border: 1.5px dashed var(--c-line); border-radius: 8px;
}
.cctl-empty-art svg { display: block; width: 200px; height: 130px; }
.cctl-empty-bg { fill: #eef1f5; }
.dark .cctl-empty-bg { fill: #23272d; }
.cctl-empty-page { fill: #fff; stroke: #e3e7ed; filter: drop-shadow(0 6px 10px rgba(16, 24, 40, .08)); }
.dark .cctl-empty-page { fill: #1b1e23; stroke: #353b44; }
.cctl-empty-rule { stroke: #e3e7ed; }
.cctl-empty-dot { fill: #cfd5dd; }
.cctl-empty-line { stroke: #dfe3e9; stroke-width: 4; stroke-linecap: round; }
.dark .cctl-empty-rule, .dark .cctl-empty-line { stroke: #353b44; }
.cctl-empty-wrench-bg { fill: #d4fb08; }
.cctl-empty-wrench { fill: none; stroke: #111; stroke-width: 2.4; stroke-linejoin: round; }
.cctl-empty-spark path { fill: none; stroke: #111; stroke-width: 3.2; stroke-linecap: round; }
.dark .cctl-empty-spark path { stroke: #e8eaed; }
.cctl-empty h2 { margin: 16px 0 10px; font-size: 23px; font-weight: 700; }
.cctl-empty p { margin: 0 0 24px; max-width: 560px; color: var(--c-muted); font-size: 14.5px; line-height: 1.65; }

.cpo-card.cctl-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 38px; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 8px; }
.cpo-card.cctl-row.is-off { opacity: .65; }
.cctl-row-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: #f1edff; color: #7c5cf0; font-size: 18px; }
.dark .cctl-row-ic { background: #2a2440; color: #b793ff; }
.cctl-row-mid { min-width: 0; }
.cctl-row-t { display: block; font-size: 15px; font-weight: 600; }
.cctl-ep { min-width: 0; }
.cctl-ep > span { direction: ltr; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.cctl-verb { flex: none; padding: 2px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--c-soft); color: var(--c-ink); }
.cctl-verb.is-get { background: #e7f8ef; color: #12a150; }
.cctl-verb.is-post { background: var(--crm-tint); color: var(--crm-ink); }
.cctl-verb.is-put, .cctl-verb.is-patch { background: #fff3e3; color: #c26a00; }
.cctl-verb.is-delete { background: #fdecec; color: #e5484d; }

.cctl-line { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.cpk-dialog .cctl-select { padding-inline-end: 30px !important; }
.cpk-dialog .cctl-desc { min-height: 70px; }
.cpk-dialog .cctl-code { min-height: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; direction: ltr; text-align: left; }
.cctl-auth { display: grid; gap: 12px; }
.cctl-auth-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cctl-auth-fields:empty { display: none; }
.cctl-params { display: grid; gap: 8px; }
.cctl-param { display: grid; grid-template-columns: minmax(0, 1.1fr) 120px minmax(0, 1.6fr) auto 30px; align-items: center; gap: 8px; }
.cctl-param-req { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.cctl-params:not(:empty) + .cscn-tool-btn { margin-top: 4px; }
.cpk-field .cscn-tool-btn { justify-self: start; }
.cctl-test-result { padding: 10px 12px; border-radius: 8px; background: #f2f4f7; font-size: 12.5px; }
.dark .cctl-test-result { background: #23272d; }
.cctl-test-result.is-ok b { color: #12a150; }
.cctl-test-result.is-bad b, .cctl-test-result.is-bad { color: #e5484d; }
.cctl-test-result pre { margin: 6px 0 0; max-height: 140px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: inherit; direction: ltr; text-align: left; }
.cpk-dialog-foot .cctl-test { margin-inline-end: auto; }

@media (max-width: 720px) {
  .cpo-card.cctl-spot { flex-direction: column; align-items: flex-start; }
  .cctl-line { grid-template-columns: minmax(0, 1fr); }
  .cctl-param { grid-template-columns: minmax(0, 1fr) 110px; }
  .cctl-param > :nth-child(3) { grid-column: 1 / -1; }
  .cpo-card.cctl-row { grid-template-columns: minmax(0, 1fr) auto 38px; }
  .cctl-row-ic { display: none; }
}

/* A field with choices must look like one: the reset strips the arrow. */
.cpk-dialog select.cctl-select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 11px center !important; background-size: 12px !important;
}
.cpk-dialog[dir="rtl"] select.cctl-select { background-position: left 11px center !important; padding-inline-end: 12px !important; padding-inline-start: 30px !important; }

/* =========================================================== MCP Servers */
.cpo-card.cmcp-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: start; gap: 22px; padding: 26px 30px; border-radius: 8px; }
.cmcp-ic { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--c-lime) 18%, var(--c-card)); color: var(--c-ink); font-size: 22px; }
.dark .cmcp-ic { background: rgba(212, 251, 8, .12); color: #d4fb08; }
.cmcp-mid { min-width: 0; padding-top: 4px; }
.cmcp-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cmcp-name { font-size: 20px; font-weight: 700; }
.cmcp-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 18px; font-size: 13.5px; font-weight: 500; background: var(--c-soft); color: var(--c-muted); }
.cmcp-badge i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.cmcp-badge.is-ok { background: color-mix(in srgb, var(--c-lime) 28%, var(--c-card)); color: #1d2400; }
.cmcp-badge.is-ok i { background: #22a447; }
.dark .cmcp-badge.is-ok { background: rgba(212, 251, 8, .14); color: #d4fb08; }
.cmcp-badge.is-run { color: var(--crm-ink); }
.cmcp-badge.is-bad { background: #fdecec; color: #e5484d; }
.dark .cmcp-badge.is-bad { background: rgba(255, 107, 111, .13); color: #ff6b6f; }
.cmcp-url { margin-top: 10px; color: var(--c-muted); font-size: 15px; direction: ltr; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmcp-count { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--c-muted); font-size: 15px; }
.cmcp-count .fi { font-size: 16px; color: var(--c-ink); }
.cmcp-err { margin: 10px 0 0; color: var(--c-red); font-size: 13px; }
.cmcp-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.cmcp-acts .cpo-btn { height: 48px; padding: 0 20px; font-size: 14.5px; font-weight: 500; border-radius: 8px; }
.cmcp-acts .cpo-btn .fi { font-size: 16px; }
.cmcp-av { color: var(--c-ink); }
.cpk-dialog .cmcp-manage { margin-top: 12px; }

.cmcp-edit { display: grid; gap: 12px; }
.cmcp-edit-bar { display: flex; align-items: center; gap: 14px; }
.cmcp-edit-bar .cpk-input { flex: 1; }
.cmcp-all { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12.5px; cursor: pointer; }
.cmcp-tools { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding-inline-end: 4px; }
.cmcp-tool { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid #e7eaf0; border-radius: 8px; cursor: pointer; }
.dark .cmcp-tool { border-color: #2c3138; }
.cmcp-tool[hidden] { display: none; }
.cmcp-tool input { margin-top: 3px; flex: none; accent-color: #9bc400; }
.cmcp-tool-copy { display: grid; gap: 2px; min-width: 0; }
.cmcp-tool-copy strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cmcp-tool-copy small { color: #667085; font-size: 12px; line-height: 1.45; }
.dark .cmcp-tool-copy small { color: #98a1ad; }

@media (max-width: 900px) {
  .cpo-card.cmcp-row { grid-template-columns: 48px minmax(0, 1fr); padding: 18px; }
  .cmcp-acts { grid-column: 1 / -1; }
}

/* ============================================================== Settings */
.cpo-card.cinb-points.is-compact { padding: 18px 22px; }
.cinb-points.is-compact .cpg-points-head h3 { font-size: 16px; }
.cinb-points.is-compact .cinb-buy { height: 38px; padding: 0 24px; }
.cinb-points.is-compact .cinb-big { margin: 8px 0 12px; }
.cinb-points.is-compact .cinb-big strong { font-size: 30px; }
.cinb-points.is-compact .cinb-big span { font-size: 13px; }
.cinb-points.is-compact .cinb-meter { height: 8px; }
.cinb-points.is-compact .cinb-left { margin-top: 8px; font-size: 12.5px; }
.cinb-points.is-compact .cinb-use { gap: 10px; margin-top: 10px; padding-top: 0; border-top: 0; }
.cinb-points.is-compact .cinb-use-row { font-size: 13px; gap: 24px; }
.cinb-points.is-compact .cinb-use-row .cpo-meter { height: 9px; }
.cinb-points.is-compact .cinb-use-row b { font-size: 13px; }

.cset { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.cpo-card.cset-nav { display: grid; gap: 4px; padding: 14px; position: sticky; top: 0; }
.cset-nav-a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; color: var(--c-ink); text-decoration: none; font-size: 13.5px; }
.cset-nav-a .fi { font-size: 17px; color: var(--c-muted); }
.cset-nav-a:hover { background: var(--c-soft); }
.cset-nav-a.is-on { background: color-mix(in srgb, var(--c-lime) 22%, var(--c-card)); font-weight: 600; }
.cset-nav-a.is-on .fi { color: var(--c-ink); }
.dark .cset-nav-a.is-on { background: rgba(212, 251, 8, .13); }
.cpo-card.cset-body { padding: 22px 22px 24px; }
.cset-title { margin: 0 0 6px; font-size: 21px; font-weight: 700; }
.cset-desc { margin: 0 0 18px; color: var(--c-muted); font-size: 13px; }
.cset-form { display: grid; gap: 14px; }
.cset-field { display: grid; gap: 7px; }
.cset-label { font-size: 13px; font-weight: 600; }
.cset-sub { margin-top: 6px; }
.cset-hint { color: var(--c-muted); font-size: 12px; line-height: 1.5; }
.cset-hint-top { margin-top: -8px; }
.cpo .cset-input {
  width: 100% !important; height: 40px; margin: 0 !important; padding: 0 14px !important; border: 1px solid var(--c-line) !important;
  border-radius: 8px; background: var(--c-soft) !important; color: var(--c-ink); font: inherit; font-size: 13.5px; box-shadow: none !important; outline: 0;
}
.cpo .cset-input:focus { border-color: #98a2b3 !important; background: var(--c-card) !important; }
.cpo .cset-area { height: auto; padding: 10px 14px !important; line-height: 1.55; resize: vertical; }
.cpo select.cset-select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-inline-end: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 11px center !important; background-size: 12px !important;
}
.cpo[dir="rtl"] select.cset-select { background-position: left 11px center !important; }

.cset-md { position: relative; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-soft); }
.cset-md:focus-within { border-color: #98a2b3; background: var(--c-card); }
.cset-md-bar { display: flex; align-items: center; gap: 4px; padding: 8px 10px 4px; }
.cpo .cset-md-b { width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--c-ink); cursor: pointer; font-size: 13px; }
.cpo .cset-md-b:hover { background: rgba(0, 0, 0, .06); }
.cset-md-sep { width: 1px; height: 18px; margin: 0 6px; background: var(--c-line); }
.cpo .cset-md-area { display: block; width: 100% !important; min-height: 96px; margin: 0 !important; padding: 6px 14px 26px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--c-ink); font: inherit; font-size: 14px; line-height: 1.6; resize: vertical; outline: 0; }
.cset-md-count { position: absolute; bottom: 8px; inset-inline-end: 12px; color: var(--c-muted); font-size: 11px; }
.cset-md-count.is-over { color: var(--c-red); }

.cset-checks { display: grid; gap: 10px; margin-top: -4px; }
.cset-check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.cset-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--crm-ink); flex: none; }
.dark .cset-check input { accent-color: #d4fb08; }
.cset-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 8px; }
.cset-toggle strong { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.cset-toggle small { color: var(--c-muted); font-size: 12px; }
.cset-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 4px 6px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-soft); }
.cset-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--c-card); border: 1px solid var(--c-line); font-size: 12.5px; direction: ltr; }
.cset-chip button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--c-muted); cursor: pointer; }
.cpo .cset-chips .cset-chip-input { flex: 1; min-width: 200px; width: auto !important; height: 30px; border: 0 !important; background: transparent !important; padding: 0 8px !important; }
.cset-save { justify-self: start; min-width: 80px; }
.cset-danger { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--c-line); }
.cset-danger strong { display: block; margin-bottom: 4px; font-size: 13.5px; }
.cset-danger small { display: block; max-width: 460px; color: var(--c-muted); font-size: 12px; line-height: 1.5; }
.cpo .cpo-btn.is-danger { background: #e5484d; border-color: #e5484d; color: #fff; }

.cset-choices { display: grid; gap: 10px; }
.cset-choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 8px; cursor: pointer; }
.cset-choice.is-on { border-color: color-mix(in srgb, var(--c-lime) 70%, #9bb600); background: color-mix(in srgb, var(--c-lime) 8%, var(--c-card)); }
.cset-choice input { margin-top: 3px; accent-color: #6f8a00; flex: none; }
.dark .cset-choice input { accent-color: #d4fb08; }
.cset-choice-copy { display: grid; gap: 3px; }
.cset-choice-copy strong { font-size: 13.5px; font-weight: 600; }
.cset-choice-copy small { color: var(--c-muted); font-size: 12.5px; line-height: 1.5; }
.cset-timing { display: grid; gap: 8px; }
.cset-timing[hidden], .cset-toggle[hidden], .cset-field[hidden], .cset-note[hidden] { display: none; }
.cset-timing-row { display: flex; align-items: center; gap: 8px; }
.cpo .cset-num { width: 80px !important; }
.cset-note { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--crm-alert-bg, #fff1f2); color: var(--crm-alert-ink, #c8243b); font-size: 12.5px; line-height: 1.5; }
.dark .cset-note { background: #2e2512; color: #f0b429; }

.cset-group { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--c-line); border-radius: 8px; }
.cset-group[hidden] { display: none; }
.cset-group.is-nested { background: var(--c-soft); }
.cset-group-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cpo .cset-match { width: auto !important; min-width: 80px; height: 34px; }
.cset-conds { display: grid; gap: 8px; }
.cset-cond { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.2fr) 34px; align-items: center; gap: 8px; }
.cset-cond > [hidden] { display: none; }
.cset-cond.is-bad .cset-cond-val { border-color: var(--c-red) !important; }
.cpo .cset-x { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--c-muted); cursor: pointer; }
.cpo .cset-x:hover { background: var(--c-soft); color: var(--c-red); }
.cset-group-acts { display: flex; gap: 18px; flex-wrap: wrap; }
.cpo .cset-link { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--crm-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dark .cpo .cset-link { color: #d4fb08; }

.cset-add { display: flex; gap: 10px; }
.cset-add .cpo-btn { flex: none; height: 40px; }
.cpo .cset-search { max-width: 280px; }
.cset-items { display: grid; gap: 8px; }
.cset-item { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border: 1px solid var(--c-line); border-radius: 8px; font-size: 13.5px; }
.cset-item-t { flex: 1; min-width: 0; line-height: 1.5; unicode-bidi: plaintext; }
.cset-item.is-example { border-style: dashed; color: var(--c-muted); }
.cset-item-edit { flex: 1; }
.cset-examples { display: grid; gap: 8px; }
.cset-examples:empty { display: none; }
.cset-ex-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

@media (max-width: 1000px) {
  .cset { grid-template-columns: minmax(0, 1fr); }
  .cpo-card.cset-nav { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cpo-card.cset-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cset-cond { grid-template-columns: minmax(0, 1fr) 34px; }
  .cset-cond > select:nth-child(2), .cset-cond > .cset-cond-val, .cset-cond > select:nth-child(4) { grid-column: 1; }
  .cset-danger { flex-direction: column; align-items: flex-start; }
}
