/* ASL AI Memory Viewer — Self-contained modal */
.asl-mem-modal { position: fixed; inset: 0; z-index: 99998; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.asl-mem-modal.asl-mem-hidden { display: none; }
.asl-mem-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); cursor: pointer; }
.asl-mem-window {
  position: relative; width: min(1100px, 96vw); height: min(82vh, 800px);
  background: #14172A; color: #e2e8f0; border: 1px solid #2a2f4a;
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; overflow: hidden;
}
.asl-mem-header { padding: 14px 18px; border-bottom: 1px solid #2a2f4a; display: flex; justify-content: space-between; align-items: center; flex: none; }
.asl-mem-header h3 { margin: 0; font-size: 16px; }
.asl-mem-close { background: transparent; border: none; cursor: pointer; color: #94a3b8; font-size: 18px; padding: 6px 10px; }
.asl-mem-toolbar { padding: 10px 14px; display: flex; gap: 8px; border-bottom: 1px solid #2a2f4a; flex: none; }
.asl-mem-search-input { flex: 1; background: #0f1220; border: 1px solid #2a2f4a; color: #e2e8f0; padding: 8px 12px; border-radius: 8px; font-family: inherit; font-size: 13px; }
.asl-mem-select, .asl-mem-btn { background: #0f1220; border: 1px solid #2a2f4a; color: #e2e8f0; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.asl-mem-btn:hover, .asl-mem-select:hover { background: #1a1d35; }
.asl-mem-body { flex: 1; display: grid; grid-template-columns: 1fr 1.4fr; gap: 0; overflow: hidden; }
.asl-mem-list { overflow-y: auto; border-right: 1px solid #2a2f4a; padding: 8px; }
[dir="rtl"] .asl-mem-list { border-right: none; border-left: 1px solid #2a2f4a; }
.asl-mem-detail { overflow-y: auto; padding: 16px 20px; }
.asl-mem-loading, .asl-mem-empty, .asl-mem-detail-empty { color: #94a3b8; text-align: center; padding: 32px 16px; font-size: 13px; }
.asl-mem-card { background: #1a1d35; border: 1px solid #2a2f4a; border-radius: 10px; padding: 10px 12px; margin: 6px 0; cursor: pointer; transition: border .15s; }
.asl-mem-card:hover { border-color: #1d4ed8; }
.asl-mem-card-header { display: flex; justify-content: space-between; font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.asl-mem-type { background: #2a2f4a; padding: 2px 8px; border-radius: 10px; }
.asl-mem-card-title { font-weight: 600; color: #fff; font-size: 14px; }
.asl-mem-card-summary { color: #cbd5e1; font-size: 12px; margin-top: 4px; }
.asl-mem-card-agent { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.asl-mem-detail h4 { margin: 0 0 6px; color: #fff; }
.asl-mem-detail h5 { margin: 18px 0 6px; color: #cbd5e1; font-size: 13px; }
.asl-mem-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #94a3b8; margin-bottom: 12px; }
.asl-mem-summary { line-height: 1.7; color: #cbd5e1; font-size: 13.5px; }
.asl-mem-detail details { margin: 12px 0; }
.asl-mem-detail details summary { cursor: pointer; color: #94a3b8; font-size: 12px; }
.asl-mem-detail pre { background: #0f1220; padding: 10px 12px; border-radius: 8px; font-size: 12px; max-height: 240px; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; }
.asl-mem-tags { margin: 12px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.asl-mem-tags span { background: #1a1d35; border: 1px solid #2a2f4a; padding: 2px 10px; border-radius: 10px; font-size: 11px; }
.asl-mem-related { list-style: none; padding: 0; margin: 0; }
.asl-mem-related li { padding: 8px 10px; background: #1a1d35; border-left: 3px solid #1d4ed8; margin: 4px 0; border-radius: 4px; cursor: pointer; font-size: 12px; }
.asl-mem-related li:hover { background: #2a2f4a; }
.asl-mem-footer { padding: 8px 18px; border-top: 1px solid #2a2f4a; font-size: 11px; color: #94a3b8; flex: none; }
@media (max-width: 768px) { .asl-mem-window { width: 100vw; height: 100vh; border-radius: 0; } .asl-mem-body { grid-template-columns: 1fr; } }
