/* ============================================================
   ACTIVITY DRAWER + cross-page polish styles
   ============================================================ */

.act-root {
  position: fixed;
  inset: 0;
  z-index: 999;
  visibility: hidden;
  pointer-events: none;
}
.act-root.open {
  visibility: visible;
  pointer-events: auto;
}

.act-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity .2s ease-out;
}
.act-root.open .act-backdrop { opacity: 1; }

.act-drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(460px, calc(100vw - 32px));
  background: var(--surface, #0d0e0f);
  border-left: 1px solid var(--border, #2a2c2c);
  box-shadow: -20px 0 60px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  transform: translateX(8px);
  opacity: 0;
  transition: transform .22s ease-out, opacity .22s ease-out;
  overflow: hidden;
}
.act-root.open .act-drawer {
  transform: translateX(0);
  opacity: 1;
}

/* ── Header ─────────────────── */
.act-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #2a2c2c);
  background: var(--surface-1, #1a1c1c);
}
.act-head-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-2, #bccbb9);
}
.act-head-title svg { color: var(--primary-bright, #53e076); }
.act-head-actions { display: inline-flex; gap: 8px; align-items: center; }
.act-kbd {
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--surface-4, #343535);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-3, #869585);
  background: var(--surface-2, #1e2020);
}
.act-close {
  background: var(--surface-2, #1e2020);
  border: 1px solid var(--border, #2a2c2c);
  border-radius: 6px;
  color: var(--text-2, #bccbb9);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.act-close:hover {
  background: var(--surface-3, #292a2a);
  color: var(--text, #e3e2e2);
}

/* ── Summary ─────────────────── */
.act-summary {
  display: flex;
  gap: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #2a2c2c);
  background: var(--surface-1, #1a1c1c);
}
.act-stat {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  border-right: 1px solid var(--border, #2a2c2c);
}
.act-stat:last-child { border-right: none; }
.act-stat-num {
  font-family: var(--mono, monospace);
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #e3e2e2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.act-stat-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute, #6b7470);
}
.act-stat-lbl.warn  { color: var(--warning, #ffb74d); }
.act-stat-lbl.error { color: var(--error, #ffb4ab); }

/* ── Filter chips ─────────────────── */
.act-filters {
  display: flex; gap: 4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #2a2c2c);
  background: var(--surface, #0d0e0f);
  flex-wrap: wrap;
}
.act-chip {
  background: var(--surface-2, #1e2020);
  border: 1px solid var(--border, #2a2c2c);
  color: var(--text-3, #869585);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.act-chip:hover { background: var(--surface-3, #292a2a); color: var(--text, #e3e2e2); }
.act-chip.active {
  background: var(--primary-soft, rgba(83,224,118,.1));
  color: var(--primary-bright, #53e076);
  border-color: var(--primary-line, rgba(83,224,118,.32));
  font-weight: 600;
}

/* ── List ─────────────────── */
.act-list {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 8px 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3, #292a2a) transparent;
}
.act-list::-webkit-scrollbar { width: 6px; }
.act-list::-webkit-scrollbar-thumb {
  background: var(--surface-3, #292a2a);
  border-radius: 3px;
}

.act-row {
  display: grid;
  grid-template-columns: 56px 16px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 6px;
  transition: background .12s;
}
.act-row:hover { background: var(--surface-1, #1a1c1c); }
.act-time {
  font-size: 11px;
  color: var(--text-mute, #6b7470);
  white-space: nowrap;
}
.act-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.act-icon.sev-success { background: var(--primary); color: #003914; }
.act-icon.sev-info    { background: var(--info-soft, rgba(126,192,238,.15)); color: var(--info); }
.act-icon.sev-warn    { background: var(--warning-soft, rgba(255,183,77,.15)); color: var(--warning); }
.act-icon.sev-error   { background: var(--error-soft, rgba(255,180,171,.15)); color: var(--error); }
.act-icon svg { width: 10px; height: 10px; }

.act-body { min-width: 0; }
.act-row-title {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.act-who {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #e3e2e2);
}
.act-target {
  font-size: 11.5px;
  color: var(--text-2, #bccbb9);
}
.act-meta {
  font-size: 11px;
  color: var(--text-mute, #6b7470);
  line-height: 1.5;
}

.act-empty {
  list-style: none;
  text-align: center;
  padding: 40px 20px;
  font-size: 12px;
  color: var(--text-mute, #6b7470);
}

/* ── Footer ─────────────────── */
.act-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border, #2a2c2c);
  background: var(--surface-1, #1a1c1c);
  font-size: 11px;
  color: var(--text-mute, #6b7470);
}
.act-foot-meta {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .02em;
  flex: 1;
  padding-right: 12px;
}
.act-foot-link {
  color: var(--primary-bright, #53e076);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
}
.act-foot-link:hover { text-decoration: underline; }


/* ============================================================
   STATUS PILL nav cue
   ============================================================ */
.topbar .pill {
  cursor: pointer;
}
.topbar .pill:hover {
  outline: 1px solid var(--primary-line);
  outline-offset: 1px;
}

/* Connection card focused (after cross-page nav) */
.conn-card.focused-card {
  animation: card-focus 1.6s ease-out;
  border-color: var(--primary-bright) !important;
}
@keyframes card-focus {
  0%   { box-shadow: 0 0 0 0 rgba(83,224,118,.5); }
  30%  { box-shadow: 0 0 0 6px rgba(83,224,118,.35); }
  100% { box-shadow: 0 0 0 0 rgba(83,224,118,0); }
}


/* ============================================================
   SHARED PAGE FOOTER (subtle, for workspaces)
   ============================================================ */
.page-foot-shared {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--text-mute);
  letter-spacing: .03em;
}
.page-foot-shared .pfs-shortcuts {
  display: flex; gap: 16px;
  font-family: var(--mono);
}
.page-foot-shared kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border: 1px solid var(--surface-4);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--text-3);
  background: var(--surface-2);
  margin-right: 4px;
}


/* ============================================================
   ════════════════════════════════════════════════════════════
   V3 ACTIVITY DRAWER ADDITIONS · pass 4 · audit #32 (ported)
   ════════════════════════════════════════════════════════════
   Styles for the populated state — empty/loading row, day
   separators, inline action buttons, per-integration tags.
   activity.js EVENTS = [] today; these styles work as soon as
   pushActivity() is wired. */

.act-stat .ph { display: inline-block; }
.act-stat[data-ph-source]::after { display: none; }

.act-row.act-empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px;
  gap: 8px;
  color: var(--text-mute);
}
.act-row.act-empty-state .ae-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: 50%;
  color: var(--text-3);
}
.act-row.act-empty-state .ae-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.act-row.act-empty-state .ae-desc {
  font-size: 11.5px; text-align: center; max-width: 34ch; line-height: 1.5;
}

.act-day-sep {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px 6px;
  font: 700 9.5px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-mute);
}
.act-day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.act-row-action {
  background: transparent;
  border: 1px solid var(--surface-4);
  color: var(--text-3);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
  margin-right: 6px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.act-row-action:hover { background: var(--surface-3); color: var(--text); }
.act-row-action .icon { width: 10px; height: 10px; }
.act-row-action.primary {
  background: var(--primary-soft);
  border-color: var(--primary-line);
  color: var(--primary-bright);
}

.act-group-tag {
  display: inline-block;
  font: 700 9.5px/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--text-3);
  margin-right: 6px;
}
.act-group-tag.spotify { background: rgba(30, 215, 96, .12); color: #1ed760; }
.act-group-tag.drive   { background: rgba(72, 133, 237, .14); color: #6e9bf2; }
.act-group-tag.gmail   { background: rgba(220, 53, 69, .12); color: #f08c92; }
.act-group-tag.buffer  { background: rgba(168, 85, 247, .14); color: #c084fc; }
.act-group-tag.system  { background: var(--surface-3); color: var(--text-2); }
