/* =============================================================================
   CORRESPONDENCE PAGE — Recovery tracking
   ============================================================================= */

body {
  background: var(--zinc-950);
  color: var(--zinc-400);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  overflow-y: auto;
  min-height: 100vh;
}

/* ── Grain overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Dot grid ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(circle, var(--zinc-700) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
}

/* ── Main container ── */
.corr-main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 52px 20px 60px;
}

/* =============================================================================
   STATS STRIP OVERRIDES (shared with index)
   ============================================================================= */

#stats-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,11,0.94);
  border-bottom: 1px solid var(--zinc-800);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.strip-nav-link {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--zinc-500);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--zinc-800);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.strip-nav-link:hover {
  color: var(--zinc-200);
  border-color: var(--zinc-600);
  background: rgba(39,39,42,0.3);
}

/* =============================================================================
   SCORECARD DASHBOARD
   ============================================================================= */

.scorecard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.scorecard-item {
  background: rgba(18,18,20,0.95);
  border: 1px solid var(--zinc-800);
  border-radius: 6px;
  padding: 12px 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.scorecard-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--zinc-600);
  margin-bottom: 4px;
}

.scorecard-value {
  font-family: 'Geist Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.scorecard-detail {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  color: var(--zinc-600);
  margin-top: 4px;
  line-height: 1.4;
}

.scorecard-value.val-frozen { color: #60a5fa; }
.scorecard-value.val-exchanges { color: var(--amber-500); }
.scorecard-value.val-laundered { color: var(--violet-400); }
.scorecard-value.val-contacted { color: var(--zinc-300); }

/* =============================================================================
   EXCHANGE CARDS
   ============================================================================= */

.exchange-card {
  background: rgba(18,18,20,0.95);
  border: 1px solid var(--zinc-800);
  border-left: 3px solid var(--zinc-700);
  border-radius: 6px;
  margin-bottom: 10px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  overflow: hidden;
}

.exchange-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.exchange-card-header:hover {
  background: rgba(39,39,42,0.15);
}

.exchange-card-name {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--zinc-100);
  flex: 1;
}

.exchange-card-status {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.exchange-card-toggle {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-600);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.exchange-card-toggle.expanded {
  transform: rotate(90deg);
}

.exchange-card-summary {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  color: var(--zinc-500);
  padding: 0 16px 0;
  line-height: 1.4;
  max-width: 600px;
}

.exchange-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.exchange-card-body.expanded {
  max-height: 4000px;
}

.exchange-card-content {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--zinc-800);
}

/* ── Meta info ── */
.card-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin-bottom: 14px;
  font-size: 12px;
}

.card-meta-label {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  color: var(--zinc-600);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
  padding-top: 2px;
}

.card-meta-value {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-400);
}

.card-meta-value a {
  color: var(--blue-400);
  text-decoration: none;
}
.card-meta-value a:hover {
  text-decoration: underline;
}

/* ── Section headers ── */
.card-section-title {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--zinc-600);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(39,39,42,0.5);
}

/* =============================================================================
   TX TABLE
   ============================================================================= */

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tx-table th {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--zinc-600);
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--zinc-800);
}

.tx-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(39,39,42,0.3);
  color: var(--zinc-400);
  vertical-align: middle;
}

.tx-table tr:last-child td {
  border-bottom: none;
}

.tx-table .tx-amount {
  font-weight: 600;
  color: var(--zinc-300);
  white-space: nowrap;
}

.tx-hash-link {
  color: var(--blue-400);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.tx-hash-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.tx-addr-link {
  color: var(--zinc-500);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.15s;
}
.tx-addr-link:hover {
  color: var(--zinc-300);
}

/* ── Chain badges ── */
.chain-badge {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
  line-height: 1.4;
}

.chain-badge-eth { background: #4a6a9e; color: #e4e4e7; }
.chain-badge-bsc { background: #a38614; color: #09090b; }
.chain-badge-tron { background: #b04455; color: #e4e4e7; }
.chain-badge-xmr { background: #52525b; color: #e4e4e7; }

/* ── Status badges ── */
.status-badge {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
}

.status-badge-frozen { background: rgba(37,99,235,0.2); color: #60a5fa; border: 1px solid rgba(37,99,235,0.3); }
.status-badge-swapped { background: rgba(185,28,28,0.15); color: #f87171; border: 1px solid rgba(185,28,28,0.25); }
.status-badge-deposited { background: rgba(212,160,23,0.15); color: #d4a017; border: 1px solid rgba(212,160,23,0.25); }
.status-badge-pending { background: rgba(113,113,122,0.15); color: #d4d4d8; border: 1px solid rgba(113,113,122,0.25); }

/* ── Copy button ── */
.copy-btn {
  background: none;
  border: none;
  color: var(--zinc-600);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 2px;
  font-size: 12px;
  transition: color 0.15s, background 0.15s;
  vertical-align: middle;
  line-height: 1;
}
.copy-btn:hover {
  color: var(--zinc-300);
  background: rgba(39,39,42,0.4);
}
.copy-btn.copied {
  color: var(--green-400);
}

/* =============================================================================
   TIMELINE
   ============================================================================= */

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--zinc-800);
}

.timeline-item {
  position: relative;
  padding: 0 0 10px 0;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -19px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--zinc-950);
}

.timeline-dot-sent { background: #60a5fa; }
.timeline-dot-recv { background: #4ade80; }
.timeline-dot-info { background: var(--zinc-600); }

.timeline-date {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-600);
  margin-bottom: 1px;
}

.timeline-direction {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-right: 4px;
}
.timeline-direction-sent { color: #60a5fa; }
.timeline-direction-recv { color: #4ade80; }
.timeline-direction-info { color: var(--zinc-500); }

.timeline-text {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  color: var(--zinc-400);
  line-height: 1.5;
}

/* =============================================================================
   ACTION ITEMS
   ============================================================================= */

.action-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  color: var(--zinc-400);
  line-height: 1.5;
}

.action-checkbox {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 1px solid var(--zinc-700);
  border-radius: 3px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-checkbox.done {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.4);
}

.action-checkbox.done::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #4ade80;
}

.action-item.done .action-text {
  color: var(--zinc-600);
  text-decoration: line-through;
}

/* =============================================================================
   WALLET LIST
   ============================================================================= */

.wallet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
}

.wallet-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--zinc-500);
  min-width: 100px;
}

.wallet-addr {
  color: var(--zinc-400);
  text-decoration: none;
  transition: color 0.15s;
}
.wallet-addr:hover {
  color: var(--zinc-200);
}

/* =============================================================================
   XMR DATA
   ============================================================================= */

.xmr-block {
  background: rgba(39,39,42,0.2);
  border: 1px solid rgba(39,39,42,0.4);
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 6px;
}

.xmr-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
}

.xmr-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--zinc-600);
  min-width: 70px;
  flex-shrink: 0;
}

.xmr-value {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-400);
  word-break: break-all;
}

.xmr-value a {
  color: var(--blue-400);
  text-decoration: none;
}
.xmr-value a:hover {
  text-decoration: underline;
}

/* =============================================================================
   WATERMARK
   ============================================================================= */

.corr-watermark {
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: rgba(39,39,42,0.35);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 20px 0;
  user-select: none;
}

/* =============================================================================
   PAGE TITLE
   ============================================================================= */

.page-title {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--zinc-500);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 6px rgba(212,160,23,0.5);
}

.corr-contribute {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: rgba(18,18,20,0.95);
  border: 1px solid var(--zinc-800);
  border-radius: 6px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.corr-contribute-copy {
  font-size: 12px;
  line-height: 1.5;
  color: var(--zinc-400);
}

.corr-contribute-file {
  font-family: 'Geist Mono', monospace;
  color: var(--zinc-200);
}

.corr-pr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid rgba(96,165,250,0.28);
  background: rgba(37,99,235,0.12);
  color: #bfdbfe;
  text-decoration: none;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.corr-pr-btn:hover {
  background: rgba(37,99,235,0.18);
  border-color: rgba(96,165,250,0.42);
  color: #dbeafe;
  transform: translateY(-1px);
}

.exchange-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(39,39,42,0.7);
}

.corr-pr-btn-inline {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 700px) {
  .corr-contribute {
    flex-direction: column;
    align-items: stretch;
  }
  .corr-pr-btn {
    width: 100%;
  }
  .scorecard {
    grid-template-columns: repeat(2, 1fr);
  }
  .corr-main {
    padding: 52px 12px 40px;
  }
  .card-meta {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .tx-table {
    font-size: 12px;
  }
}

@media (max-width: 500px) {
  .scorecard {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.card-notes {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: #d4d4d8;
  line-height: 1.6;
  padding: 8px 12px;
  background: rgba(39,39,42,0.3);
  border-radius: 4px;
  border-left: 2px solid #3f3f46;
}

.transcript-toggle {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: #d4d4d8;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 8px;
  border-top: 1px solid #27272a;
  transition: color 0.15s;
}
.transcript-toggle:hover {
  color: #d4d4d8;
}
.transcript-arrow {
  display: inline-block;
  font-size: 12px;
  margin-right: 6px;
  transition: transform 0.15s;
}
.transcript-body {
  margin-top: 8px;
}
.transcript-text {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #d4d4d8;
  background: rgba(9,9,11,0.6);
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

.tl-expand-btn {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: #60a5fa;
  cursor: pointer;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid rgba(96,165,250,0.3);
  border-radius: 3px;
  transition: all 0.15s;
}
.tl-expand-btn:hover {
  background: rgba(96,165,250,0.1);
  border-color: rgba(96,165,250,0.5);
}
.tl-content {
  margin-top: 6px;
}
.tl-content-text {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #d4d4d8;
  background: rgba(9,9,11,0.6);
  border: 1px solid #27272a;
  border-radius: 4px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}
