/* ============================================================
   Chat2Evidence — Step 2: Certificate Setup Styles
   ============================================================ */

#step2 {
  max-width: 640px;
  margin: 0 auto;
  padding: 44px var(--space-4) 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: var(--space-6);
}
.toggle-row-info { flex: 1; min-width: 0; }
.toggle-label {
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toggle-desc {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Stat chips from parsed chat */
#parsedStats {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
  margin-bottom: var(--space-5);
  padding: 0;
  transition: color var(--t-fast);
}
.btn-back:hover { color: var(--teal); }
.btn-back svg { width: 16px; height: 16px; }

/* Privacy note */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--gray-400);
  font-size: .78rem;
  margin-top: var(--space-4);
}
.privacy-note svg { width: 13px; height: 13px; color: var(--teal); }

/* ============================================================
   Step 3: Preview & Download Styles
   ============================================================ */

#step3 {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px var(--space-4) 0;
}

/* Layout grid */
.preview-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 720px) {
  .preview-layout { grid-template-columns: 1fr; }
}

/* Chat preview card */
.chat-preview {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: visible;
}
.chat-header-bar {
  background: var(--navy);
  color: var(--white);
  padding: 13px 18px;
  font-weight: 700;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-bar svg { width: 18px; height: 18px; color: var(--teal-light); }

.chat-body {
  padding: 0;
  overflow-y: visible;
  background: transparent;
  scroll-behavior: smooth;
}
/* Custom scrollbar */
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.18);
  border-radius: 4px;
}

/* Date separator */
.msg-date {
  text-align: center;
  margin: 12px 0 8px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-700);
  background: rgba(255,255,255,.75);
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--r-full);
  width: 100%;
  background: transparent;
}
.msg-date span {
  background: rgba(255,255,255,.75);
  padding: 3px 12px;
  border-radius: var(--r-full);
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* Bubbles */
.msg-row {
  display: flex;
  margin-bottom: 6px;
}
.msg-row.sent  { justify-content: flex-end; }
.msg-row.recv  { justify-content: flex-start; }

.bubble {
  max-width: 74%;
  min-width: 72px;
  padding: 8px 11px 5px;
  border-radius: 10px;
  font-size: .875rem;
  line-height: 1.5;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  word-wrap: break-word;
}
.bubble.sent {
  background: var(--sent-bg);
  border-bottom-right-radius: 2px;
}
.bubble.recv {
  background: var(--recv-bg);
  border-bottom-left-radius: 2px;
}
.bubble .sender-name {
  font-size: .72rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 2px;
}
.bubble .msg-text {
  color: var(--gray-800);
  white-space: pre-wrap;
}
.bubble .msg-text.media-msg { color: var(--gray-500); font-style: italic; }
.bubble .ts {
  font-size: .67rem;
  color: var(--gray-400);
  text-align: right;
  margin-top: 3px;
  line-height: 1;
}
.bubble.sent .ts  { color: #7ac7a8; }
.bubble .ticks    { color: #53bdeb; font-size: .65rem; }

/* Side panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-title {
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-3);
}

/* Ready banner */
.ready-banner {
  background: linear-gradient(135deg, var(--teal-bg) 0%, #e0fdf4 100%);
  border: 1px solid var(--teal-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: var(--space-5);
  text-align: center;
}
.ready-banner h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.ready-banner p {
  font-size: .82rem;
  color: var(--gray-500);
}
.ready-icon {
  width: 36px; height: 36px;
  background: var(--teal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.ready-icon svg { width: 20px; height: 20px; color: white; }

#pdfError {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: .85rem;
  margin-bottom: var(--space-4);
}

/* ── DOCUMENT LIBRARY ──────────────────────────────────────────────────────── */
.doc-library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
  gap: 12px;
  flex-wrap: wrap;
}
.doc-library-row:last-child { border-bottom: none; }
.doc-lib-info { flex: 1; min-width: 0; }
.doc-lib-title {
  font-weight: 700;
  color: var(--navy);
  font-size: .88rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-lib-meta { font-size: .75rem; color: var(--gray-500); }
.doc-lib-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.doc-lib-dl {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
}
.doc-lib-del {
  background: white;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: .78rem;
  cursor: pointer;
  font-family: var(--font-sans);
}
.doc-lib-del:hover { background: #fef2f2; }
