/* =========================================================================
   Proof of Talk — design tokens (from verify.html)
   ========================================================================= */
:root {
  --bg: #0a0a0c;
  --surface: #15151a;
  --surface-2: #1d1d24;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f4f6;
  --text-2: #a0a0aa;
  --text-3: #6c6c76;
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, .12);
  --violet: #a78bfa;
  --violet-bg: rgba(167, 139, 250, .14);
  --red: #fb7185;
  --red-bg: rgba(251, 113, 133, .12);
  --radius: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* The HTML `hidden` attribute must beat any author rule like `display: flex`. */
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  padding: calc(env(safe-area-inset-top) + 36px) 20px calc(env(safe-area-inset-bottom) + 36px);
  max-width: 460px;
  margin: 0 auto;
}

.sr-only { position: absolute; left: -9999px; }

/* Reveal-in animation for receipt elements */
.r {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.r.in { opacity: 1; transform: none; }

/* =========================================================================
   Seal
   ========================================================================= */
.seal {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
}
.seal svg { width: 40px; height: 40px; }
.seal.ok { background: var(--green-bg); }
.seal.bad { background: var(--red-bg); }
.seal .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; }
.seal.ok .ring { border-color: rgba(52, 211, 153, .3); }
.seal.bad .ring { border-color: rgba(251, 113, 133, .3); }
@keyframes pulse {
  0%   { transform: scale(1); opacity: .6; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}
.seal .pulse { position: absolute; inset: 0; border-radius: 50%; }
.seal.ok .pulse { background: rgba(52, 211, 153, .25); animation: pulse 1.8s var(--ease) .3s 2; }
.seal.bad .pulse { background: rgba(251, 113, 133, .2); animation: pulse 1.8s var(--ease) .3s 2; }

/* =========================================================================
   Headline + subline
   ========================================================================= */
h1 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
  line-height: 1.15;
  margin-bottom: 10px;
}
.sub {
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.55;
  max-width: 300px;
  margin: 0 auto 30px;
}
.sub b { color: var(--text); font-weight: 600; }

/* =========================================================================
   Section label
   ========================================================================= */
.seclab {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 2px;
}
.seclab .t {
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}
.seclab .meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-left: auto;
}

/* =========================================================================
   Chain (sentences + block rivets)
   ========================================================================= */
.chain { position: relative; margin: 0 0 8px; }
.chain .spine {
  position: absolute;
  left: 19px;
  top: 4px;
  bottom: 18px;
  width: 2px;
  background: var(--line-2);
}

.sent {
  position: relative;
  padding: 4px 0 4px 50px;
  margin-bottom: 2px;
}
.sent p { font-size: 15px; line-height: 1.55; color: var(--text); margin: 0; }
.sent .dot {
  position: absolute;
  left: 13px;
  top: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
}

.rivet {
  position: relative;
  padding: 5px 0 5px 50px;
  margin: 2px 0;
}
.rivet .node {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--violet-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.rivet .node svg { width: 13px; height: 13px; stroke: var(--violet); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  background: var(--surface);
  border: .5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color .15s;
}
.chip:active { border-color: var(--line-2); }
.chip .blk { font-size: 11px; font-weight: 600; color: var(--violet); }
.chip .hash { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.chip .time { font-size: 11px; color: var(--text-3); }

.rivet.fresh .node { background: var(--green-bg); }
.rivet.fresh .node svg { stroke: var(--green); }
.rivet.fresh .chip .blk { color: var(--green); }
.rivet .pz {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(52, 211, 153, .35);
  animation: pz 2.2s var(--ease) infinite;
}
@keyframes pz {
  0%   { transform: translateY(-50%) scale(1); opacity: .6; }
  70%  { transform: translateY(-50%) scale(2); opacity: 0; }
  100% { opacity: 0; }
}

.chip-detail {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: .5px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  word-break: break-all;
  line-height: 1.6;
}
.chip-detail a { color: var(--green); text-decoration: none; font-family: var(--mono); }
.chip.open .chip-detail { display: block; }

.fade-more {
  text-align: center;
  padding: 10px 0 4px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* =========================================================================
   Rows (expandable claim list)
   ========================================================================= */
.rows {
  background: var(--surface);
  border: .5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0 0;
}
.row { padding: 0 16px; }
.row + .row { border-top: .5px solid var(--line); }
.row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  cursor: pointer;
  user-select: none;
}
.row-ic { width: 22px; flex: 0 0 22px; display: flex; justify-content: center; }
.row-ic svg { width: 19px; height: 19px; }
.row-title { flex: 1; font-size: 14.5px; font-weight: 500; }
.chev {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform .3s var(--ease);
}
.row.open .chev { transform: rotate(180deg); }
.row-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.row-body-inner {
  padding: 0 0 16px 34px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.row-body-inner b { color: var(--text); }
.row-body-inner a { color: var(--green); text-decoration: none; }
.row.warn .row-title { color: var(--text-2); }

/* =========================================================================
   Action buttons
   ========================================================================= */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.btn {
  flex: 1;
  height: 50px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform .15s var(--ease);
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: .5px solid var(--line-2);
}

.recruit {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 16px;
  line-height: 1.5;
}
.recruit b { color: var(--text-2); font-weight: 600; }

.tamper-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--red);
  text-decoration: none;
  font-weight: 500;
}

/* =========================================================================
   Loading / empty / error states
   ========================================================================= */
.state-view {
  text-align: center;
  padding: 4rem 0 2rem;
}
.state-line {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--text-2);
}
.state-sub {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
  max-width: 100%;
}
.state-err { color: var(--red); }

/* =========================================================================
   Uploader footer
   ========================================================================= */
.page-footer {
  margin-top: 36px;
  padding-top: 22px;
  border-top: .5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.upload-toggle {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-2);
  border: .5px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.upload-toggle:hover {
  border-color: var(--text-2);
  color: var(--text);
  background: var(--surface);
}

.uploader-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 18px;
  background: var(--surface);
  border: .5px solid var(--line);
  border-radius: var(--radius-sm);
}

.uploader-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-3);
}

#json {
  width: 100%;
  min-height: 200px;
  background: var(--bg);
  border: .5px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  caret-color: var(--green);
}
#json:focus { outline: 1px solid var(--text-3); }

.uploader-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.uploader-panel button {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 9px 14px;
  background: var(--surface-2);
  color: var(--text);
  border: .5px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.uploader-panel button:hover:not([disabled]) { background: rgba(255, 255, 255, .05); }
.uploader-panel button[disabled] { opacity: .4; cursor: not-allowed; }

.upload-status {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.upload-status-ok  { color: var(--green); }
.upload-status-err { color: var(--red); }

.upload-output {
  margin-top: 4px;
  padding: 14px 14px 14px;
  background: var(--green-bg);
  border: .5px solid rgba(52, 211, 153, .35);
  border-radius: 8px;
}
.upload-output .uploader-label { color: var(--green); }
.upload-output #upload-cid {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--green);
  word-break: break-all;
  margin: 6px 0 12px;
}
.upload-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.upload-open {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 4px;
}
.upload-open:hover { text-decoration-color: var(--text); }

.upload-error {
  padding: 10px 12px;
  background: var(--red-bg);
  border: .5px solid rgba(251, 113, 133, .45);
  border-radius: 8px;
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.5;
}

.upload-log-details {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.upload-log-details summary {
  cursor: pointer;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.upload-log-details summary:hover { color: var(--text-2); }
.upload-log {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border: .5px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
  color: var(--text-2);
}
