:root {
  --bg: #09090a;
  --surface: #0f0f11;
  --line: #1f1f23;
  --line-2: #2e2e34;
  --text: #e6e6e8;
  --muted: #7d7d86;
  --dim: #4a4a52;
  --accent: #ff6a00;
  --accent-ink: #0a0a0a;
  --ok: #38c98b;
  --err: #ff5252;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg) 70%);
  pointer-events: none;
  z-index: -1;
}

button, input, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 16px var(--mono);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand img { display: block; }
.brand b { color: var(--accent); font-weight: 600; }
.ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 12px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line-2);
  padding: 6px 10px;
}
.ticker .mono { color: var(--text); }
.ticker-dot { width: 6px; height: 6px; background: var(--dim); }
.ticker-dot.ok { background: var(--ok); }
.ticker-dot.warn { background: #e5b546; }
.ticker-dot.bad { background: var(--err); }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tags li {
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  border: 1px solid var(--line-2);
  padding: 4px 8px;
}
.tags li:first-child { border-color: var(--accent); color: var(--accent); }
.net-name { font-size: 12px; color: var(--text); }

/* buttons */
.btn {
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  padding: 10px 16px;
  font: 500 13px var(--mono);
  border-radius: 0;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:not(:disabled):hover { background: #ff7d22; }
.btn-line { border-color: var(--line-2); }
.btn-line:not(:disabled):hover { border-color: var(--text); }
.btn-ghost { color: var(--muted); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { color: var(--text); }
.btn-wide { width: 100%; padding: 14px; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* layout */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 56px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.intro h1 {
  font: 600 32px/1.1 var(--sans);
  letter-spacing: -0.03em;
}
.intro p { color: var(--muted); margin-top: 8px; }

/* panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.idx { color: var(--accent); }
.order-id { margin-left: auto; color: var(--dim); text-transform: none; letter-spacing: 0; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font: 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.field-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  background: var(--bg);
  transition: border-color .12s;
}
.field-row:focus-within { border-color: var(--text); }
.field-row input, .field-row output {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  font: 500 22px var(--mono);
}
.field-static { border-style: dashed; }
.field-static output { color: var(--muted); }
.unit {
  padding: 0 14px;
  font: 500 12px var(--mono);
  color: var(--muted);
  border-left: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
}
textarea {
  background: var(--bg);
  border: 1px solid var(--line-2);
  outline: 0;
  padding: 10px 14px;
  font: 13px/1.5 var(--mono);
  resize: none;
  word-break: break-all;
  border-radius: 0;
}
textarea:focus { border-color: var(--text); }
.field-note { font: 11px var(--mono); color: var(--dim); min-height: 1em; }
.field-note.ok { color: var(--ok); }
.field-note.bad { color: var(--err); }
.error {
  font: 12px var(--mono);
  color: var(--err);
  border-left: 2px solid var(--err);
  padding: 6px 10px;
}

/* summary */
.summary { display: flex; flex-direction: column; border: 1px solid var(--line); }
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.summary dd { font: 500 13px var(--mono); text-align: right; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  cursor: pointer;
  font: 500 12px var(--mono);
  color: var(--muted);
}
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); border-bottom-color: var(--accent); }
.tab-body { display: flex; flex-direction: column; gap: 14px; }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.kv .mono { color: var(--text); }

/* deposit */
.deposit { display: flex; gap: 18px; align-items: flex-start; }
.qr {
  flex-shrink: 0;
  width: 152px;
  height: 152px;
  padding: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr img, .qr canvas { display: block; width: 136px !important; height: 136px !important; }
.qr.empty {
  background: var(--bg);
  border: 1px dashed var(--line-2);
  color: var(--dim);
  font: 11px var(--mono);
  text-align: center;
}
.deposit-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.copy-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.big { font-size: 18px; font-weight: 500; }
.addr { font-size: 12px; word-break: break-all; line-height: 1.45; }

/* status */
.status {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.status li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  font: 11px var(--mono);
  color: var(--dim);
  border-right: 1px solid var(--line);
}
.status li:last-child { border-right: 0; }
.dot { width: 6px; height: 6px; background: var(--line-2); }
.status li.is-active { color: var(--text); }
.status li.is-active .dot { background: var(--accent); animation: blink 1.2s steps(2) infinite; }
.status li.is-done { color: var(--muted); }
.status li.is-done .dot { background: var(--ok); }
@keyframes blink { 50% { opacity: .2; } }

#txNote a { color: var(--accent); }

/* facts */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 20px;
  gap: 16px;
}
.facts span { color: var(--accent); font-size: 11px; }
.facts p { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* footer */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  font: 11px var(--mono);
  color: var(--dim);
}

/* toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font: 500 12px var(--mono);
  padding: 8px 14px;
  z-index: 10;
}

@media (max-width: 560px) {
  .bar { padding: 12px 16px; }
  .ticker > span:nth-child(2) { display: none; }
  .wrap { padding-top: 32px; }
  .intro h1 { font-size: 26px; }
  .deposit { flex-direction: column; align-items: center; }
  .deposit-info { width: 100%; }
  .status { grid-template-columns: repeat(2, 1fr); }
  .status li:nth-child(2) { border-right: 0; }
  .status li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .facts { grid-template-columns: 1fr; }
  .foot { flex-direction: column; gap: 4px; padding: 12px 16px; }
}
