/* Pathways Activity Log — per-artifact slide-over (NEW, additive).
   Design ported from the reference "Audit Log & Provenance" panel. Colors are
   token-only (css/tokens.css) so the panel re-themes light/dark like the rest
   of the portal chrome. */

.pi-activity-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 64, 0);
  /* Sits above the in-portal editor overlay (css/editor.css → 1340) so the
     Activity slide-over is usable from the Editor toolbar too, while staying
     below the app confirm dialog (css/modals.css → 1400). */
  z-index: 1370;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, background .2s;
}
.pi-activity-backdrop.show {
  opacity: 1;
  pointer-events: auto;
  background: rgba(10, 31, 64, .35);
}

.pi-activity-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 92vw;
  z-index: 1371;
  background: var(--wh);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(10, 31, 64, .22);
  transform: translateX(105%);
  transition: transform .25s;
  display: flex;
  flex-direction: column;
}
.pi-activity-panel.show { transform: translateX(0); }

.pi-act-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 11px;
  border-bottom: 1px solid var(--border);
}
.pi-act-head h2 {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0;
}
.pi-act-close {
  border: none;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.pi-act-close:hover { background: var(--wash); color: var(--heading); }

.pi-act-prov {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface-2);
}
.pi-prov-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .76rem;
  color: var(--muted);
}
.pi-prov-row strong {
  color: var(--heading);
  font-weight: 700;
  text-align: right;
  word-break: break-word;
  max-width: 62%;
}

/* Scrollable body that stacks the three sections (Change History, Viewer Log,
   Modification Details). Scroll lives here so all three scroll together. */
.pi-act-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pi-act-section {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.pi-act-section:first-child { border-top: none; }

/* Clickable section header — folds/unfolds the section body below it. */
.pi-act-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  padding: 12px 18px 6px;
  color: inherit;
}
.pi-act-toggle:hover h3 { color: var(--heading); }
.pi-act-arrow {
  color: var(--muted);
  font-size: .7rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .15s;
}
/* Collapsed → arrow points right, body hidden. */
.pi-act-section.is-collapsed .pi-act-arrow { transform: rotate(0deg); }
.pi-act-section.is-collapsed .pi-act-secbody { display: none; }

.pi-act-section h3 {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.pi-act-count { color: var(--muted); font-weight: 400; }
.pi-act-scope {
  font-size: .68rem;
  color: var(--muted);
  padding: 2px 18px 6px;
}
.pi-act-list {
  padding: 4px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pi-act-empty {
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  padding: 8px 0;
}

.pi-act-row {
  border-left: 3px solid var(--su);
  padding: 7px 10px;
  background: var(--wash);
  border-radius: 0 8px 8px 0;
}
.pi-act-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .78rem;
  color: var(--heading);
  font-weight: 600;
}
.pi-act-row-head span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 400;
  white-space: nowrap;
}
.pi-act-row-msg {
  font-size: .8rem;
  color: var(--gr);
  margin-top: 3px;
  line-height: 1.45;
  word-break: break-word;
}
.pi-act-row-who {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 3px;
}
/* Per-section accent on the row's left rule so the three logs read distinctly:
   amber = change (default), brand blue = viewer, vivid blue = modification. */
.pi-act-row--viewer { border-left-color: var(--accent); }
.pi-act-row--mod { border-left-color: var(--vb); }
.pi-act-row-meta {
  font-size: .72rem;
  color: var(--heading);
  font-weight: 600;
  margin-top: 4px;
}

/* Activity toolbar button — matches the existing toolbar chip styling. */
.toolbar-activity-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wash);
  color: var(--heading);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 14px;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, Arial, sans-serif;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .1s;
}
.toolbar-activity-btn:hover { background: var(--chip); }

@media (max-width: 480px) {
  .pi-activity-panel { width: 100vw; }
}
