/* styles.css */
:root {
  --bg: #0b0e14;
  --panel: #12161f;
  --panel-2: #171c28;
  --line: #232a38;
  --txt: #e6e9ef;
  --muted: #8b93a7;
  --accent: #5b8cff;
  --active: #f2b544;
  --done: #37d39b;
  --failed: #ff5d6c;
  --refund: #b98bff;
  --stuck: #ff9f43;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--txt);
  margin: 0;
  font: 14px / 1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

code, .mono {
  font-family: ui-monospace, SF Mono, Menlo, monospace;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 18px;
}

.title h1 {
  letter-spacing: -.02em;
  margin: 0;
  font-size: 20px;
}

.title .sub {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
}

.right {
  display: flex;
  align-items:  center;
  gap: 18px;
}

.stats {
  display: flex;
  gap: 8px;
}

.stat {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-direction: column;
  align-items:  center;
  min-width: 52px;
  padding: 6px 10px;
}

.stat .num {
  font-size: 18px;
  font-weight: 650;
  line-height: 1;
}

.stat .lbl {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
}

.s-active .num {
  color: var(--active);
}

.s-stuck .num {
  color: var(--stuck);
}

.s-done .num {
  color: var(--done);
}

.s-failed .num {
  color: var(--failed);
}

.cluster {
  display: inline-flex;
  text-transform: capitalize;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 8px;
  align-items:  center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
}

.cluster i {
  border-radius: 50%;
  width: 7px;
  height: 7px;
}

.cluster-devnet i {
  background: var(--active);
}

.cluster-devnet {
  color: var(--active);
}

.cluster-mainnet i {
  background: var(--done);
}

.cluster-mainnet {
  color: var(--done);
}

.cluster:hover {
  border-color: var(--muted);
}

.conn {
  display: inline-flex;
  color: var(--muted);
  align-items:  center;
  gap: 7px;
  font-size: 12px;
}

.conn i {
  background: var(--muted);
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.conn-live i {
  background: var(--done);
  animation: pulse 2s infinite;
  box-shadow: 0 0 #37d39b99;
}

.conn-live {
  color: var(--done);
}

.conn-error i {
  background: var(--failed);
}

.conn-error {
  color: var(--failed);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 #37d39b80;
  }

  70% {
    box-shadow: 0 0 0 7px #37d39b00;
  }

  100% {
    box-shadow: 0 0 #37d39b00;
  }
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 14px;
}

.filters {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  gap: 4px;
  padding: 3px;
}

.filters button {
  color: var(--muted);
  cursor: pointer;
  text-transform: capitalize;
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
}

.filters button.on {
  background: var(--panel-2);
  color: var(--txt);
}

.toolbar .src {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 80px 0;
}

.empty .hint {
  opacity: .7;
  font-size: 12px;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .2s;
}

.card.st-active {
  border-left-color: var(--active);
}

.card.st-stuck {
  border-left-color: var(--stuck);
}

.card.st-done {
  border-left-color: var(--done);
}

.card.st-failed {
  border-left-color: var(--failed);
}

.card.st-refund {
  border-left-color: var(--refund);
}

.card-head {
  display: flex;
  cursor: pointer;
  justify-content: space-between;
  align-items:  center;
}

.idcol {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.iid {
  color: var(--accent);
  font-size: 13px;
}

.route {
  color: var(--muted);
  font-size: 12px;
}

.route b {
  color: var(--txt);
  font-weight: 550;
}

.route .arrow {
  color: var(--muted);
  margin: 0 7px;
}

.statecol {
  display: flex;
  flex-direction: column;
  align-items:  flex-end;
  gap: 4px;
}

.time {
  color: var(--muted);
  font-size: 11px;
}

.badges {
  display: inline-flex;
  gap: 6px;
}

.badge {
  letter-spacing: .01em;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
}

.badge.st-active {
  color: var(--active);
  background: #f2b54424;
}

.badge.st-stuck {
  color: var(--stuck);
  background: #ff9f4329;
}

.badge.st-done {
  color: var(--done);
  background: #37d39b24;
}

.badge.st-failed {
  color: var(--failed);
  background: #ff5d6c24;
}

.badge.st-refund {
  color: var(--refund);
  background: #b98bff24;
}

.stepper {
  display: flex;
  margin: 16px 2px 4px;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items:  center;
}

.step .node {
  display: grid;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  z-index: 1;
  border-radius: 50%;
  place-items:  center;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 600;
}

.step .slabel {
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
  font-size: 10px;
}

.step .bar {
  position: absolute;
  background: var(--line);
  z-index: 0;
  width: 100%;
  height: 2px;
  top: 11px;
  left: 50%;
}

.step.past .node {
  background: var(--done);
  border-color: var(--done);
  color: #06110c;
}

.step.past .bar {
  background: var(--done);
}

.step.past .slabel {
  color: var(--txt);
}

.step.now .node {
  background: var(--active);
  border-color: var(--active);
  color: #1a1204;
  box-shadow: 0 0 0 4px #f2b54426;
}

.step.now .slabel {
  color: var(--active);
}

.stepper.failed .step.now .node {
  background: var(--failed);
  border-color: var(--failed);
  color: #fff;
  box-shadow: 0 0 0 4px #ff5d6c26;
}

.stepper.failed .step.now .slabel {
  color: var(--failed);
}

.stepper.refund .step.now .node {
  background: var(--refund);
  border-color: var(--refund);
  box-shadow: 0 0 0 4px #b98bff26;
}

.err {
  color: var(--failed);
  background: #ff5d6c14;
  border-radius: 8px;
  margin-top: 10px;
  padding: 7px 10px;
  font-size: 12px;
}

.detail {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.drow {
  display: flex;
  gap: 12px;
  padding: 3px 0;
  font-size: 12px;
}

.dk {
  color: var(--muted);
  flex-shrink: 0;
  width: 110px;
}

.dv {
  color: var(--txt);
  word-break: break-all;
  display: inline-flex;
  align-items:  center;
  gap: 6px;
}

.cp {
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0 2px;
  font-size: 12px;
}

.cp:hover {
  color: var(--accent);
}

.exlink {
  color: var(--txt);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
}

.exlink:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.timeline {
  margin-top: 12px;
}

.tl-title {
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 10px;
}

.tl-empty {
  color: var(--muted);
  opacity: .6;
  font-size: 12px;
}

.tl-row {
  display: flex;
  align-items:  center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}

.tl-dot {
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
}

.tl-delta {
  color: var(--muted);
  opacity: .8;
  min-width: 40px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.tl-leg {
  color: var(--txt);
  text-transform: capitalize;
  min-width: 64px;
  font-weight: 550;
}

.tl-note {
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

.tl-note.ok {
  color: var(--done);
  background: #37d39b1a;
}

.tl-note.bad {
  color: var(--failed);
  background: #ff5d6c1f;
  font-weight: 600;
}

.tl-type {
  color: var(--muted);
}

.tl-tx {
  color: var(--accent);
  text-decoration: none;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 11px;
}

.tl-tx:hover {
  text-decoration: underline;
}

.tl-at {
  color: var(--muted);
  margin-left: auto;
  font-size: 11px;
}

.tl-total {
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  padding-top: 6px;
}

.tl-total .tl-type b {
  color: var(--txt);
}

.time .e2e {
  color: var(--txt);
  font-weight: 550;
}

.tl-clock {
  color: var(--txt);
  opacity: .85;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
