:root {
  --bg: #0b0d12;
  --bg-card: #14171f;
  --bg-card-locked: #10131a;
  --border: #232936;
  --border-active: #3a82f6;
  --text: #e8ecf3;
  --text-dim: #8a93a6;
  --text-locked: #4a5161;
  --accent: #3a82f6;
  --accent-hover: #5a98f8;
  --ok: #34d399;
  --no: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.steps {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: opacity 0.2s, border-color 0.2s;
}
.step[data-state="locked"] {
  background: var(--bg-card-locked);
  opacity: 0.55;
  pointer-events: none;
  padding-top: 10px;
  padding-bottom: 10px;
}
.step[data-state="locked"] .step-body { display: none; }
.step[data-state="locked"] .step-head { margin-bottom: 0; }
.step[data-state="locked"] .step-num {
  background: transparent;
  color: var(--text-locked);
  border-color: var(--border);
}
.step[data-state="active"] {
  border-color: var(--border-active);
  box-shadow: 0 0 0 1px rgba(58, 130, 246, 0.18);
}
.step[data-state="done"] .step-num {
  background: var(--ok);
  color: #0b0d12;
  border-color: var(--ok);
}

/* Mute interactive elements once a step is completed so attention flows
   to whichever step is currently active. */
.step[data-state="done"] .chip[aria-pressed="true"] {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.step[data-state="done"] .primary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.step[data-state="done"] .primary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
/* The Continue button is the only live action inside a "done" step — keep it
   primary blue so users notice it. */
.step[data-state="done"] .primary#btn-continue {
  background: var(--accent);
  color: white;
  border: none;
}
.step[data-state="done"] .primary#btn-continue:hover {
  background: var(--accent-hover);
}
/* Once a send has completed, lock step 2 so the user can't change chips or
   re-trigger the send. */
.step[data-step="2"][data-state="done"] .step-body {
  pointer-events: none;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-active);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  background: rgba(58, 130, 246, 0.12);
}
.step h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.step p {
  color: var(--text-dim);
  margin: 0 0 8px;
}

.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled {
  background: #2a3142;
  color: #6b7280;
  cursor: not-allowed;
}
.primary.success {
  background: transparent;
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.primary.success:hover:not(:disabled) {
  background: rgba(52, 211, 153, 0.08);
}

.outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.outline:hover:not(:disabled) {
  border-color: var(--text-dim);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.centered {
  text-align: center;
  margin: 4px 0 8px;
}

.summary-label {
  margin: 16px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#wallet-result { margin-top: 8px; }
.balances { font-size: 13px; color: var(--text); }
#btn-continue { margin-top: 8px; }

.reveal {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.reveal p { margin: 4px 0 0; }
.reveal > p:first-child { margin-top: 0; }
.reveal p.reveal-note {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}
.reveal p.reveal-note strong { color: var(--text); }

.kv {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  flex-wrap: wrap;
}
.kv .k {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.addr {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 6px;
  word-break: break-all;
}
.ok { color: var(--ok); margin: 0; }
.no { color: var(--no); }

.substep {
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}
.substep:last-of-type { margin-bottom: 4px; }
.substep[data-state="locked"] {
  opacity: 0.45;
  pointer-events: none;
}
.substep[data-state="locked"] .chips { display: none; }
.substep[data-state="locked"] > label { margin-bottom: 0; }
.substep[data-state="active"] { border-left-color: var(--border-active); }
.substep[data-state="done"] { border-left-color: var(--ok); }
.substep > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.send-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.status {
  font-size: 13px;
}
.status:empty { display: none; }
.status.error { color: var(--no); }
.status.success { color: var(--ok); }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.5;
}
.checklist.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  row-gap: 8px;
  margin-top: 18px;
  margin-bottom: 18px;
}
.checklist.two-col li:nth-child(1) { grid-column: 1; grid-row: 1; }
.checklist.two-col li:nth-child(2) { grid-column: 1; grid-row: 2; }
.checklist.two-col li:nth-child(3) { grid-column: 2; grid-row: 1; }
.checklist.two-col li:nth-child(4) { grid-column: 2; grid-row: 2; }
.checklist.two-col li:nth-child(5) { grid-column: 2; grid-row: 3; }
@media (max-width: 480px) {
  .checklist.two-col { grid-template-columns: 1fr; }
  .checklist.two-col li {
    grid-column: 1;
    grid-row: auto;
  }
}
.checklist li { color: var(--text); }
.checklist em { color: var(--text-dim); font-style: normal; font-size: 12px; }

.protected {
  margin: 20px 0 14px;
  color: var(--text);
  font-weight: 500;
}

.modal { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  max-width: 920px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px 22px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
@media (max-width: 720px) {
  .modal-card { margin: 24px 16px; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tx-id {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  background: transparent;
  padding: 0;
  word-break: break-all;
}
.explorer-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}
.explorer-link:hover { color: var(--accent-hover); }
.modal-footer {
  margin-top: 14px;
  text-align: left;
}
.modal-close {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  flex: 0 0 auto;
}
.modal-close:hover {
  color: var(--text);
  border-color: var(--accent);
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .modal-grid { grid-template-columns: 1fr; }
}
.tx-panel-full { grid-column: 1 / -1; }
.tx-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.tx-panel h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tx-entry .tx-prev {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 2px;
  word-break: break-all;
}
.tx-entry .tx-amount {
  display: block;
  font-weight: 600;
  font-size: 14px;
}
.tx-entry .tx-addr {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--text-dim);
  word-break: break-all;
}
.tx-confidential {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-style: italic;
  font-weight: 600;
  color: var(--text);
}
.tx-confidential svg {
  color: var(--text-dim);
  flex: 0 0 auto;
}
.tx-confidential-note {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 13px;
}
.eye-badge {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
  vertical-align: text-bottom;
}
.modal-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -8px 0 14px;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}
.tx-entry .tx-confidential { display: flex; margin-bottom: 2px; }

.tx-token-name { font-weight: 500; }
.tx-token-uid {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--accent);
  word-break: break-all;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

