/* أوبتس — «التطبيقات مثل Claude» 2026-11-13. حبر وورق (ألوان الثيم بس، بلا ذهبي)، منطقي RTL/LTR، 44px للمس. */
.cx-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cx-top .cx-q { flex: 1 1 220px; margin-top: 0; min-height: 44px; }
.cx-top .cx-add { flex: none; }
.cx-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.cx-chips::-webkit-scrollbar { display: none; }
.cx-chip { flex: none; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--silver); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.cx-chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cx-chip:focus-visible, .cx-opt:focus-visible, .cx-sw:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; }
.cx-h { font-size: 13px; font-weight: 600; color: var(--mute); margin: 18px 0 8px; letter-spacing: 0; }
.cx-rows .cx-row { gap: 12px; }
.cx-row .lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-row .sub, .cx-card .sub { color: var(--mute); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cx-n { font-weight: 600; }
.cx-logo { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--panel2);
  border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 15px; }
.cx-row.is-linked .cx-logo { border-color: var(--line2); }
.cx-badge { display: inline-block; align-self: flex-start; margin-inline-start: 0; padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--line2);
  color: var(--silver); font-size: 11.5px; font-weight: 500; vertical-align: middle; }
.cx-soon { font-size: 13px; }
.cx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cx-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); min-height: 150px; }
.cx-card .cx-logo { width: 40px; height: 40px; }
.cx-card .btn, .cx-card .cx-soon { margin-top: auto; align-self: flex-start; }
.cx-empty { padding: 18px 0; text-align: center; color: var(--mute); }
.cx-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cx-foot .lnk, .cx-pfoot .lnk { min-height: 44px; padding: 0; background: none; border: 0; color: var(--text); text-decoration: underline;
  text-underline-offset: 3px; font: inherit; cursor: pointer; }

/* الأوراق */
.cx-ov { position: fixed; inset: 0; z-index: 80; background: #0009; display: grid; place-items: center; padding: 16px; animation: fadeIn .16s ease-out both; }
.cx-sheet { width: min(560px, 100%); max-height: calc(100dvh - 32px); }
.cx-sheet .sheet-head { padding: 14px 14px 8px 18px; }
.cx-sheet .cx-x { width: 44px; height: 44px; margin-inline-start: auto; }
.cx-body { padding: 4px 18px 16px; overflow: auto; flex: 1; }
.cx-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.cx-ft:empty { display: none; }
.cx-ft .btn, .cx-acts .btn { width: auto; margin-top: 0; min-height: 44px; }
.cx-mhead { display: flex; gap: 12px; align-items: center; padding: 6px 0 4px; }
.cx-mhead > div { display: flex; flex-direction: column; gap: 2px; }
.cx-allbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 0 0; }
.cx-allbar .lbl { flex: 1 1 140px; color: var(--silver); font-size: 14px; }
.cx-allbar select { min-height: 44px; padding: 7px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; }
.cx-allbar .btn { width: auto; margin-top: 0; }
.cx-tool .sub { color: var(--mute); font-size: 13px; }
.cx-tn { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.cx-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cx-opt { min-height: 40px; padding: 6px 8px; border: 0; background: transparent; color: var(--silver); font: inherit; font-size: 13.5px; cursor: pointer; }
.cx-opt + .cx-opt { border-inline-start: 1px solid var(--line); }
.cx-opt.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cx-opt.never.on { background: var(--panel2); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.cx-opt:disabled { opacity: .38; cursor: not-allowed; }
.cx-danger { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.cx-danger .btn { width: auto; }
.cx-sure { margin: 0 0 8px; }
.cx-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }
.cx-form .cx-lab, .cx-found .cx-lab { display: block; margin-top: 12px; font-size: 14px; color: var(--silver); }
.cx-found .card-set { margin-top: 12px; }
.cx-adv { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; }
.cx-adv summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--silver); }
.cx-code1 { display: block; margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: var(--code); font-size: 12.5px; overflow-wrap: anywhere; }
.cx-warn { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--danger); background: var(--panel2); }
.cx-warn p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; }
.cx-check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.cx-check input { width: 20px; height: 20px; accent-color: var(--text); }
.cx-err { color: var(--danger); margin: 10px 0 0; }
.cx-note { padding: 10px 12px; border-radius: 12px; background: var(--panel2); color: var(--silver); font-size: 14px; }
.cx-client .cx-steps { margin: 0; padding-inline-start: 22px; line-height: 1.9; font-size: 14.5px; }
.cx-code { margin: 12px 0 0; padding: 12px; border-radius: 12px; background: var(--code); border: 1px solid var(--line); font-size: 12.5px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; text-align: left; }

/* زر «التطبيقات» وقائمته بصندوق الكتابة */
#composer { position: relative; }
.cx-cbtn { position: relative; width: auto !important; min-width: 44px; padding-inline: 10px; gap: 6px; display: inline-flex; align-items: center; }
.cx-cbtn .cx-cl { font-size: 13.5px; }
.cx-cbtn .cx-dot { position: absolute; top: 8px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--silver); }
.cx-pop { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 30; width: min(340px, calc(100vw - 32px)); max-height: min(420px, 60dvh);
  overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px var(--shadow); padding: 10px 14px; }
.cx-ph { font-weight: 700; font-size: 15px; padding: 4px 0; }
.cx-plist .hint { margin: 2px 0 8px; font-size: 13px; color: var(--mute); }
.cx-plist .btn { width: auto; }
.cx-pop { text-align: start; }
.cx-prow { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--line); }
.cx-prow .cx-logo { width: 30px; height: 30px; font-size: 13px; }
.cx-prow .cx-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cx-sw { flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; padding: 0; }
.cx-sw::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--mute); transition: inset-inline-start var(--dur, .18s) var(--ease, ease); }
.cx-sw[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.cx-sw[aria-checked="true"]::after { inset-inline-start: 21px; background: var(--on-accent); }
.cx-pfoot { border-top: 1px solid var(--line); margin-top: 4px; }

/* شارة نشاط الأداة */
.tool.cx-tool-chip .cx-logo { width: 18px; height: 18px; border-radius: 5px; font-size: 10.5px; border: 0; background: transparent; }
.tool.cx-tool-chip.cx-custom { border-style: dashed; }
.tool.wait { border-color: var(--line2); }
.tool.wait .td { color: var(--silver); font-size: 12px; }
.tool.cx-tool-chip[data-cx="blocked"] .td, .tool.cx-tool-chip[data-cx="off"] .td { font-size: 12px; color: var(--mute); }

.cx-toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); inset-inline-start: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 14px; }
[dir="rtl"] .cx-toast { transform: translateX(50%); }
.cx-toast .lnk { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; min-height: 32px; }

@media (max-width: 899px) {
  .cx-cbtn .cx-cl { display: none; }
  .cx-ov { padding: 0; place-items: end stretch; }
  .cx-sheet { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  .cx-ft { position: sticky; bottom: 0; background: var(--panel); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .cx-ft .btn { flex: 1; }
  .cx-cards { grid-template-columns: repeat(2, 1fr); }
  .cx-top .cx-add { flex: 1 1 100%; }
}
