/* activity-mindmap-panel.css - Activity / Memory / Mind map inspector (R12) */

/* Desktop side panel (no center overlay) */
@media (min-width: 1100px) {
  #researchInspector.r12-inspector-open {
    width: min(400px, 32vw) !important;
    min-width: 360px !important;
    max-width: 440px !important;
    flex: 0 0 min(400px, 32vw) !important;
    position: relative !important;
    transform: none !important;
    z-index: auto !important;
  }
  #researchInspector.r12-inspector-open ~ #uiExtInspOverlay,
  #uiExtInspOverlay,
  .r11-inspector-overlay {
    display: none !important;
    pointer-events: none !important;
  }
  body:has(#researchInspector.r12-inspector-open) #uiExtInspOverlay,
  body:has(#researchInspector.r12-inspector-open) .r11-inspector-overlay {
    display: none !important;
  }
}

/* Tablet drawer */
@media (min-width: 700px) and (max-width: 1099px) {
  #researchInspector.r12-drawer-open {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px !important;
    max-width: 92vw !important;
    z-index: 820 !important;
    transform: translateX(0) !important;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
    border-left: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
    background: var(--bg-surface, #151c24);
  }
  .r12-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 810;
  }
}

/* Mobile bottom sheet */
@media (max-width: 699px) {
  #researchInspector.r12-sheet-open {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto !important;
    height: 72dvh;
    max-height: 92dvh;
    width: 100% !important;
    z-index: 820 !important;
    transform: translateY(0) !important;
    border-radius: 16px 16px 0 0;
    border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
    background: var(--bg-surface, #151c24);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  }
  .r12-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 810;
  }
}

.r12-inspector-collapse {
  color: var(--text-muted, #9ca3af);
}
.r12-inspector-collapse:hover {
  color: var(--text-main, #f3f4f6);
}

/* Timeline */
.r12-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.r12-tl-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 10px 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
  background: var(--bg-elevated, rgba(20, 31, 42, 0.55));
}
.r12-tl-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--titi-icon-normal, #8fa1b5);
  box-shadow: 0 0 0 3px rgba(143, 161, 181, 0.15);
}
.r12-tl-item.is-running .r12-tl-dot { background: var(--accent, #4f9cff); box-shadow: 0 0 0 3px rgba(79, 156, 255, 0.2); }
.r12-tl-item.is-success .r12-tl-dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2); }
.r12-tl-item.is-error .r12-tl-dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2); }
.r12-tl-item.is-warning .r12-tl-dot { background: #fbbf24; }

.r12-tl-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main, #f3f4f6);
  line-height: 1.35;
}
.r12-tl-detail {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  line-height: 1.45;
}
.r12-tl-detail.is-expanded { max-height: none; }
.r12-tl-detail.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.r12-tl-expand {
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent, #4f9cff);
  font-size: 11px;
  cursor: pointer;
}
.r12-tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.r12-tl-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--titi-chip-bg, rgba(20, 31, 42, 0.86));
  border: 1px solid var(--titi-chip-border, rgba(255, 255, 255, 0.08));
  color: var(--text-muted, #9ca3af);
}
.r12-progress {
  margin-top: 8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.r12-progress > span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent, #4f9cff), var(--titi-icon-active, #49d3c6));
  animation: r12-progress-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes r12-progress-pulse {
  from { width: 28%; opacity: 0.7; }
  to { width: 72%; opacity: 1; }
}

/* Memory */
.r12-memory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 2px 12px;
}
.r12-memory-section {
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-elevated, rgba(20, 31, 42, 0.45));
}
.r12-memory-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main, #f3f4f6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.r12-memory-section p,
.r12-memory-section li {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  line-height: 1.45;
}
.r12-memory-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #9ca3af);
  font-size: 13px;
}

/* Mind map */
.r12-mindmap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px 12px;
}
.r12-mindmap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.r12-mindmap-cluster {
  flex: 1 1 140px;
  min-width: 120px;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  background: var(--titi-chip-bg, rgba(20, 31, 42, 0.86));
  padding: 10px;
}
.r12-mindmap-cluster h5 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--titi-icon-active, #49d3c6);
}
.r12-mindmap-node {
  font-size: 11px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main, #f3f4f6);
  line-height: 1.35;
}
.r12-mindmap-svg {
  width: 100%;
  height: 28px;
  opacity: 0.35;
}

/* Source lineage */
.r12-lineage-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.r12-lineage-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
  background: rgba(255, 255, 255, 0.03);
}
.r12-lineage-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main, #f3f4f6);
}
.r12-lineage-meta {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  margin-top: 4px;
}

.r12-activity-heading {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-main, #f3f4f6);
  letter-spacing: 0.02em;
}