/* dark contract explorer — matches compiler page */
:root {
  --bg: #0f1115;
  --panel: #161a20;
  --panel-2: #1c2129;
  --border: #262d36;
  --border-2: #2f3742;
  --text: #e6edf3;
  --text-dim: #9aa4b2;
  --muted: #6b7280;
  --blue: #1f6feb;
  --blue-hi: #2f81f7;
  --green: #2ea043;
  --green-soft: rgba(46, 160, 67, 0.14);
  --amber: #d29922;
  --red: #f85149;
  --mono: 'Consolas', 'Menlo', 'SF Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, 'Segoe UI', Roboto, sans-serif;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--blue-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,160,67,0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(46,160,67,0); }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes btnPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.reveal { animation: fadeUp 0.45s ease both; }
.reveal:nth-of-type(1) { animation-delay: 0.02s; }
.reveal:nth-of-type(2) { animation-delay: 0.06s; }
.reveal:nth-of-type(3) { animation-delay: 0.10s; }
.reveal:nth-of-type(4) { animation-delay: 0.14s; }
.reveal:nth-of-type(5) { animation-delay: 0.18s; }
.reveal:nth-of-type(6) { animation-delay: 0.22s; }
.reveal:nth-of-type(7) { animation-delay: 0.26s; }

.pill.pulse .dot.green { animation: pulseDot 1.8s ease-in-out infinite; }
.dot.green.big { animation: pulseDot 2.2s ease-in-out infinite; }

.tx-row-in { animation: rowIn 0.35s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.tb-icon { color: var(--blue-hi); font-size: 18px; }
.tb-title { font-size: 15px; font-weight: 600; }
.tb-right { display: flex; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
}
.pill.ok { color: var(--green); }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; background: var(--muted); flex-shrink: 0;
}
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.blue { background: var(--blue-hi); }
.dot.big { width: 10px; height: 10px; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex; flex-direction: column; gap: 16px;
}

.contract-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cb-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.cb-meta { min-width: 0; }
.cb-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.cb-addr-row { display: flex; align-items: center; gap: 6px; }
.cb-addr { font-family: var(--mono); font-size: 13.5px; color: var(--text); word-break: break-all; }
.copy-btn {
  color: var(--muted);
  padding: 4px; border-radius: 4px;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.copy-btn:hover { background: var(--panel-2); color: var(--text); }
.copy-btn.copied { color: var(--green); transform: scale(1.15); }
.btn-ghost {
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  transition: border-color 0.15s, color 0.15s, transform 0.12s;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-hi); }
.btn-ghost:active { animation: btnPop 0.22s ease; }

.owner-card {
  padding: 14px 18px;
  background: var(--green-soft);
  border: 1px solid rgba(46, 160, 67, 0.3);
  border-radius: 12px;
}
.owner-row { display: flex; align-items: center; gap: 14px; }
.owner-title { font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: 2px; }
.owner-sub { font-size: 12.5px; color: var(--text-dim); }
.owner-sub .mono { font-family: var(--mono); color: var(--text); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 12.5px; }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-card {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-val { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.stat-val b { font-size: 20px; }
.stat-val.amber { color: var(--amber); }
.stat-val.green { color: var(--green); }
.stat-val.red { color: var(--red); }
.stat-sub { font-size: 12px; color: var(--muted); }
.eth-glyph { color: var(--blue-hi); font-size: 18px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.steps { padding: 4px; }
.steps summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: background 0.15s;
}
.steps summary::-webkit-details-marker { display: none; }
.steps summary:hover { background: var(--panel-2); }
.summary-left { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.summary-arrow { color: var(--text-dim); transition: transform 0.2s; font-size: 12px; }
.steps[open] .summary-arrow { transform: rotate(180deg); }

.steps-body {
  padding: 8px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.step-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.step-item:first-child { border-top: none; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.step-text h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.step-text p { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.step-text p b { color: var(--text); }

.funding { padding: 20px; }
.funding-head h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.funding-head p { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }

.addr-block {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}
.addr-block .addr {
  flex: 1;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
}
.copy-big {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--blue); color: #fff;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}
.copy-big:hover { background: var(--blue-hi); }
.copy-big:active { animation: btnPop 0.22s ease; }
.copy-big.copied { background: var(--green); transform: scale(1.05); }

.notes { list-style: none; margin-bottom: 14px; }
.notes li {
  padding: 5px 0 5px 18px;
  position: relative;
  color: var(--text-dim);
  font-size: 13px;
}
.notes li::before {
  content: "";
  position: absolute;
  left: 4px; top: 12px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--blue-hi);
}
.notes li b { color: var(--text); }

.verify-row { padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }

.tx-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.tx-head h3 { font-size: 15px; font-weight: 600; }
.tx-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--green);
  background: var(--green-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.tx-live .dot.green { animation: pulseDot 1.8s ease-in-out infinite; }

.tx-toolbar {
  padding: 10px 20px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}

.tx-scroll { overflow-x: auto; }

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}
.tx-table thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tx-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  white-space: nowrap;
}
.tx-table tbody tr:last-child td { border-bottom: none; }
.tx-table tbody tr { transition: background 0.15s; }
.tx-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.link-cell { color: var(--blue-hi); cursor: pointer; }
.link-cell:hover { text-decoration: underline; }
.copy-mini { color: var(--muted); margin-left: 6px; font-size: 11px; }
.addr-yellow { color: #f0d27b; }
.amount-cell { color: var(--text); }

.method-pill {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--panel-2);
}

.in-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(47, 129, 247, 0.15);
  color: var(--blue-hi);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.withdraw-panel { padding: 20px; }
.withdraw-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.withdraw-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.withdraw-sub { font-size: 12.5px; color: var(--muted); }
.withdraw-btn {
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.12s;
}
.withdraw-btn:hover:not(:disabled) { background: var(--blue-hi); }
.withdraw-btn:active:not(:disabled) { animation: btnPop 0.22s ease; }
.withdraw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.page-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr; }
  .page { padding: 16px 14px 32px; }
  .withdraw-row { flex-direction: column; align-items: flex-start; }
  .withdraw-btn { width: 100%; }
}