/**
 * src/css/dobo2-memory.css
 * D4 — the memory panel UI. Same design system as dobo2-dock.css (navy
 * #022448, amber #fea619, surface #F8FAFC, Inter); own #dobo2mem-* / .dobo2mem-*
 * selector namespace — zero collision with dobo2-dock.css or page CSS.
 *
 * New, separate file (not appended to dobo2-dock.css, which the D3 agent's
 * frontend work is actively touching — see the phase report's collision-
 * avoidance notes). Loaded as its own <link> in dashboard.html.
 */

#dobo2mem-root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.dobo2mem-bell {
  position: fixed;
  /* No-navbar fallback: top-docked like a nav item, never a bottom corner FAB */
  top: 10px;
  right: 60px;
  bottom: auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #ffffff;
  color: #475569;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 36, 72, 0.18);
  z-index: 9997;
}
.dobo2mem-bell.show::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fea619;
  border: 1px solid #ffffff;
}

.dobo2mem-panel {
  position: fixed;
  right: 16px;
  top: 56px;
  bottom: auto;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(2, 36, 72, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9997;
  border: 1px solid #E2E8F0;
}
.dobo2mem-panel.open { display: flex; }

.dobo2mem-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #022448;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
}
.dobo2mem-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.dobo2mem-tabs {
  display: flex;
  border-bottom: 1px solid #E2E8F0;
}
.dobo2mem-tab {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
  background: #F8FAFC;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.dobo2mem-tab.active {
  color: #022448;
  font-weight: 600;
  border-bottom-color: #fea619;
  background: #ffffff;
}

.dobo2mem-body {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
}

/* ─── Empty states (item G: every list/panel gets a real empty state) ────── */
.dobo2mem-empty {
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 22px 8px;
}

.dobo2mem-content-view {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  color: #1e293b;
  line-height: 1.5;
  min-height: 60px;
}

.dobo2mem-textarea {
  width: 100%;
  min-height: 140px;
  font-family: inherit;
  font-size: 12.5px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
  box-sizing: border-box;
}

.dobo2mem-meta {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 6px;
}

.dobo2mem-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.dobo2mem-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dobo2mem-btn-amber { background: #fea619; color: #022448; }
.dobo2mem-btn-ghost { background: #F1F5F9; color: #022448; }
.dobo2mem-btn-danger { background: #fee2e2; color: #991b1b; }

.dobo2mem-proposal {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 12px;
}
.dobo2mem-proposal-summary {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}
.dobo2mem-proposal-preview {
  white-space: pre-wrap;
  word-break: break-word;
  color: #451a03;
  max-height: 80px;
  overflow-y: auto;
  margin-bottom: 8px;
  font-size: 11.5px;
}

.dobo2mem-history-item {
  border-bottom: 1px solid #F1F5F9;
  padding: 8px 0;
  font-size: 11.5px;
}
.dobo2mem-history-action {
  font-weight: 600;
  color: #022448;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.02em;
}
.dobo2mem-history-time {
  color: #94a3b8;
  font-size: 10px;
  float: right;
}
.dobo2mem-history-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: #475569;
  margin-top: 4px;
}

.dobo2mem-status {
  font-size: 11px;
  padding: 4px 14px;
  color: #64748b;
  min-height: 16px;
}
.dobo2mem-status.error { color: #dc2626; }
.dobo2mem-status.ok { color: #16a34a; }

/* ─── 360px sweep (item G) ────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .dobo2mem-bell { right: 56px; }
  .dobo2mem-panel {
    right: 6px;
    left: 6px;
    width: auto;
  }
}

/* Nav-bar mounted: drop the old fixed corner positioning. */
.dobo2-navgroup .dobo2mem-bell { position: static; right: auto; bottom: auto; }
.dobo2mem-panel { top: 68px; right: 16px; bottom: auto; max-height: 70vh; }
@media (max-width: 640px) { .dobo2mem-panel { top: 60px; right: 8px; left: 8px; width: auto; } }

/* In the nav group: match the flat .dobo2-navbtn look exactly (no white pill). */
.dobo2-navgroup .dobo2mem-bell {
  position: static; right: auto; top: auto; bottom: auto; left: auto;
  width: 36px; height: 36px; border-radius: 9px;
  border: none; background: transparent; color: #475569;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: none; transition: background .15s ease, color .15s ease;
}
.dobo2-navgroup .dobo2mem-bell:hover { background: rgba(2,36,72,0.08); color: #022448; }
