/* The receipt pop-up. A centred glass panel on desktop, a bottom sheet on phones. */

.receipt {
  width: min(540px, 100vw - 24px);
  max-width: none;
  max-height: min(880px, 100dvh - 32px);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
}
.receipt::backdrop {
  background: rgba(3, 4, 6, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade var(--base) ease-out both;
}
.receipt[open] { display: flex; }
.receipt[open] .receipt__panel { animation: sheet-in var(--slow) var(--ease-spring) both; }
.receipt.is-closing .receipt__panel { animation: sheet-out 170ms ease-in both; }
.receipt.is-closing::backdrop { animation: fade 170ms ease-in reverse both; }

@keyframes fade { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(26px) scale(0.965); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px) scale(0.98); } }

.receipt__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(26, 29, 37, 0.9), rgba(13, 15, 20, 0.94));
  border-color: var(--line-strong);
}
.receipt__panel[data-state='xd'] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 0 0 1px rgba(255, 61, 79, 0.25), 0 40px 120px -30px rgba(255, 61, 79, 0.35); }
.receipt__panel[data-state='sniped'] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 0 0 1px rgba(255, 178, 36, 0.2), 0 40px 120px -30px rgba(255, 178, 36, 0.22); }

.rc-head {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.rc-head__id { flex: 1; min-width: 0; }
.rc-head__id h2 { font: 600 1.25rem/1.2 var(--mono); letter-spacing: -0.02em; }
.rc-head__id p { font-size: var(--t-sm); color: var(--ink-2); }
.rc-ca {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin-top: 4px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--fill);
  color: var(--ink-2);
  font: 400 var(--t-xs)/1 var(--mono);
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.rc-ca:hover { background: var(--fill-strong); color: var(--ink); }

.rc-body {
  flex: 1;
  display: grid;
  gap: var(--s-5);
  padding: var(--s-5);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* the verdict */
.rc-verdict { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s-4); }
.rc-verdict p { font-size: var(--t-md); line-height: 1.45; text-wrap: pretty; }
.rc-stamp {
  padding: 9px 12px 8px;
  border: 2px solid var(--c);
  border-radius: 8px;
  color: var(--c-ink);
  font: 600 1rem/1 var(--mono);
  letter-spacing: 0.1em;
  transform: rotate(-6deg);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 24px -6px var(--c);
}
.receipt[open] .rc-stamp { animation: stamp 420ms var(--ease-spring) 180ms both; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-16deg) scale(1.7); }
}

/* blocks */
.rc-block { display: grid; gap: 10px; padding-top: var(--s-5); border-top: 1px dashed var(--line-strong); }
.rc-block h3 {
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rc-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 400 var(--t-sm)/1.4 var(--mono);
}
.rc-line span { color: var(--ink-2); }
.rc-line i { flex: 1; min-width: 16px; border-bottom: 1px dotted var(--line-strong); transform: translateY(-3px); }
.rc-line b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.rc-line[data-tone='xd'] b, .rc-line[data-tone='down'] b { color: var(--x-ink); }
.rc-line[data-tone='sniped'] b { color: var(--amber-ink); }
.rc-line[data-tone='up'] b, .rc-line[data-tone='clean'] b { color: var(--up); }

/* supply bar */
.rc-supply { display: grid; gap: 10px; }
.rc-supply__bar { display: flex; gap: 3px; height: 12px; }
.rc-supply__bar span { min-width: 4px; border-radius: 4px; background: var(--p); }
.rc-supply__key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-xs); color: var(--ink-2); }
.rc-supply__key li { display: inline-flex; align-items: center; gap: 6px; }
.rc-supply__key i { width: 8px; height: 8px; border-radius: 2px; background: var(--p); }
.rc-supply__key b { font: 500 var(--t-xs)/1 var(--mono); color: var(--ink); }
[data-part='xd'] { --p: var(--x); }
[data-part='sniped'] { --p: var(--amber); }
[data-part='dev'] { --p: var(--steel); }
[data-part='rest'] { --p: rgba(255, 255, 255, 0.14); }

/* funding map */
.rc-map { width: 100%; height: auto; max-height: 260px; }
.rc-map__link { fill: none; stroke: var(--x); stroke-width: 1.2; opacity: 0.7; stroke-dasharray: 3 5; animation: flow 1.6s linear infinite; }
.rc-map__w { fill: var(--bg-raise); stroke: var(--ink-3); stroke-width: 1.5; }
.rc-map__w.is-linked { fill: var(--x); stroke: var(--x); }
.rc-map__f { fill: var(--x-soft); stroke: var(--x); stroke-width: 1.5; }
.rc-map__t { fill: var(--ink-2); font: 400 10px var(--mono); }
@keyframes flow { to { stroke-dashoffset: -16; } }

/* proof list */
.rc-proof { display: grid; }
.rc-proof li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font: 400 var(--t-xs)/1.2 var(--mono);
}
.rc-proof li:last-child { border-bottom: 0; }
.rc-proof__w { color: var(--ink); }
.rc-proof__p { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rc-proof__tag { color: var(--ink-3); }
.rc-proof__tag[data-on='true'] { color: var(--x-ink); }
.rc-proof__a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.rc-proof__a:hover { color: var(--ink); }

.rc-caution {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--fill);
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--ink-2);
}

/* scan area */
.rc-scan { display: grid; gap: var(--s-5); }
.btn--scan { width: 100%; border-color: var(--line-strong); background: var(--fill-strong); }
.btn--scan:disabled { cursor: progress; color: var(--ink-2); animation: blink 1.4s ease-in-out infinite; }
.rc-caution--bad { border-color: rgba(255, 61, 79, 0.4); color: var(--x-ink); }
.rc-reasons { display: grid; gap: var(--s-2); font-size: var(--t-sm); line-height: 1.5; color: var(--ink-2); }
.rc-reasons li { padding-left: var(--s-4); border-left: 2px solid var(--line-strong); }

.rc-actions {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

@media (max-width: 599px) {
  .receipt {
    width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
  }
  .receipt__panel { border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; }
  .receipt[open] .receipt__panel { animation-name: sheet-up; }
  .rc-verdict { grid-template-columns: 1fr; justify-items: start; }
  .rc-proof li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .rc-proof__tag { display: none; }
  .rc-proof li:has(.rc-proof__tag[data-on='true']) .rc-proof__w::after { content: ' · same funder'; color: var(--x-ink); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
