:root {
  color-scheme: light dark;
  --background: #0f172a;
  --surface: rgba(15, 23, 42, 0.8);
  --surface-light: #f8fafc;
  --text-primary: #f8fafc;
  --text-secondary: rgba(248, 250, 252, 0.7);
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --border: rgba(248, 250, 252, 0.08);
  --success: #22c55e;
  --danger: #ef4444;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.25), transparent 60%),
    var(--background);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 2rem;
}

header {
  text-align: center;
}

/* Soft-SPA shell: sticky header keeps nav / indexer / connect across routes. */
.spa-body.spa-active {
  gap: 1.25rem;
}

.spa-header {
  position: sticky;
  top: 0;
  z-index: 900;
  text-align: center;
  padding: 0.75rem 0 0.25rem;
  margin: -0.5rem 0 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 55%, rgba(15, 23, 42, 0.72) 100%);
  backdrop-filter: blur(14px);
}

.spa-header-text h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.spa-app {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  flex: 1;
}

.spa-route-loading {
  position: fixed;
  top: 5.5rem;
  right: 1.25rem;
  z-index: 950;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
}

.spa-route-loading .loading-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 2px;
}

.spa-page-extras {
  /* Modals / wizards extracted from page partials live here. */
}

@media (max-width: 768px), (max-device-width: 768px) {
  .spa-header {
    margin: 0;
    padding-top: 0.25rem;
  }
}

.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(16px);
  position: relative;
  /* Keep the nav (and its burger dropdown) above following page content. */
  z-index: 50;
}

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-burger:hover {
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent);
}

.nav-burger-icon {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-tab {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.1);
}

.nav-tab.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.nav-lock-btn:hover:not(:disabled) {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.nav-lock-btn:disabled,
.nav-lock-btn.is-locking {
  opacity: 0.6;
  cursor: wait;
}

.nav-lock-icon {
  display: block;
}

.nav-indexer-status {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: default;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.nav-indexer-status.is-toggleable {
  cursor: pointer;
}

.nav-indexer-status.is-toggleable:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
}

.nav-indexer-status:disabled {
  opacity: 0.7;
  cursor: wait;
}

.nav-indexer-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
}

.nav-indexer-status.is-active .nav-indexer-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.nav-indexer-status.is-standby .nav-indexer-dot,
.nav-indexer-status.is-behind .nav-indexer-dot {
  background: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.22);
}

.nav-indexer-status.is-stale .nav-indexer-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.nav-indexer-status.is-offline .nav-indexer-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.nav-indexer-status.is-active {
  color: #86efac;
}

.nav-indexer-status.is-standby,
.nav-indexer-status.is-behind {
  color: #fde047;
}

.nav-indexer-status.is-stale {
  color: #fca5a5;
}

.nav-indexer-caption {
  line-height: 1;
}

.nav-connect-btn {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.nav-connect-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
}

.nav-connect-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.nav-connect-btn.is-connected {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
}

.nav-connect-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Logged-in user chip: two blockies + "user (device)". */
.nav-identity-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.user-device-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 16rem;
  padding: 0.25rem 0.55rem 0.25rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: default;
  text-align: left;
}

.user-device-identity.nav-identity {
  height: 2.5rem;
  box-sizing: border-box;
}

.user-device-blockies {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.user-device-blockie {
  border-radius: 4px;
  display: block;
  background: rgba(15, 23, 42, 0.6);
}

.user-device-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.registered-signer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--surface-secondary, rgba(15, 23, 42, 0.4));
  border-radius: 4px;
}

.registered-signer .user-device-identity,
.payment-signer-identity {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100%;
}

.nav-popover {
  position: fixed;
  z-index: 1200;
  min-width: 12rem;
  max-width: min(20rem, calc(100vw - 1rem));
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
}

.nav-popover-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.nav-popover-body {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
}

.nav-popover-action {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-popover-action:hover {
  background: rgba(56, 189, 248, 0.22);
}

@media (max-width: 768px), (max-device-width: 768px) {
  .main-nav {
    gap: 0.35rem;
    padding: 0.35rem;
    justify-content: flex-start;
  }

  .nav-burger {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
  }

  .main-nav.nav-open {
    z-index: 900;
  }

  .main-nav.nav-open .nav-links {
    display: flex;
  }

  .nav-tab {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }

  .nav-tab.active::after {
    display: none;
  }

  .nav-tools {
    margin-left: auto;
    gap: 0.35rem;
  }

  /* Icon-only chips on phone: status always; wallet only once connected. */
  .nav-indexer-status {
    width: 2.5rem;
    padding: 0;
    justify-content: center;
    gap: 0;
    cursor: pointer;
  }

  .nav-indexer-caption {
    display: none;
  }

  .nav-connect-btn.is-connected {
    width: 2.5rem;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .nav-connect-btn.is-connected .nav-connect-label {
    display: none;
  }

  /* Identity chip on phone: blockies only; tap reveals "user (device)". */
  .user-device-identity {
    max-width: none;
    padding: 0.25rem;
    cursor: pointer;
  }

  .user-device-identity.nav-identity {
    width: auto;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.35rem;
    justify-content: center;
  }

  .user-device-label {
    display: none;
  }

  .registered-signer .user-device-identity,
  .payment-signer-identity {
    cursor: pointer;
  }
}

h1 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(16px);
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 320px;
  width: 100%;
}

label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

input[type="search"],
input[type="text"] {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="search"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

button {
  cursor: pointer;
  appearance: none;
  border-radius: 10px;
  border: none;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #0f172a;
  box-shadow: 0 18px 40px rgba(14, 165, 233, 0.35);
}

button.secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(56, 189, 248, 0.12);
}

button.expand-btn,
button.collapse-btn,
button.check-btn {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
}

.actions-column .actions-buttons {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

tbody tr td {
  vertical-align: middle;
}

.wallet-row-collapsed .entity-readonly {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.status-collapsed .status-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(18px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.08);
  text-align: left;
}

th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

tbody tr:last-child td {
  border-bottom: none;
}

td code {
  background: rgba(14, 116, 144, 0.25);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #e0f2fe;
}

.address {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  word-break: break-all;
}

.label-input {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.label-input input {
  flex: 1;
  min-width: 0;
}

.label-save-button {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.cosigners-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cosigner-item {
  display: flex;
  align-items: center;
}

.cosigner-item .address {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  word-break: break-all;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 120px;
}

.action-buttons button {
  flex: 1 1 45%;
}

.empty-state td {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
}

footer {
  text-align: center;
  color: var(--text-secondary);
}

footer code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.2);
  color: inherit;
}

#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  min-width: 220px;
  max-width: 320px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text-primary);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 0.9rem;
  z-index: 1002;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

#toast.error {
  background: rgba(239, 68, 68, 0.92);
  box-shadow: 0 18px 60px rgba(239, 68, 68, 0.45);
}

/* Heartbeat: pending soft-refresh countdown before applying indexer activity. */
.indexer-activity-banner {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: min(420px, calc(100vw - 2rem));
  padding: 0.85rem 1rem 0.65rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.55);
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.35;
}

.indexer-activity-banner[hidden] {
  display: none !important;
}

.indexer-activity-banner-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.indexer-activity-banner-copy {
  flex: 1;
  min-width: 0;
}

.indexer-activity-banner-event {
  margin: 0 0 0.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.indexer-activity-banner-action {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.indexer-activity-banner-cancel {
  flex-shrink: 0;
  margin: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.indexer-activity-banner-progress {
  margin-top: 0.7rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.indexer-activity-banner-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: var(--accent, #38bdf8);
  border-radius: inherit;
}

@keyframes indexer-activity-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
  background: var(--success);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-indicator .status-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-indicator .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.status-indicator.success {
  color: var(--success);
}

.status-indicator.success .status-icon {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-indicator.error {
  color: var(--danger);
}

.status-indicator.error .status-icon {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.status-indicator.neutral .status-icon {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.status-message {
  line-height: 1.3;
}

.status-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.balance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.balance-summary span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
}

.balance-label {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-primary);
}

.address-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.address-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.copy-address-icon {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  opacity: 0.7;
  flex-shrink: 0;
  cursor: pointer;
}

.copy-address-icon:hover {
  color: var(--accent);
  opacity: 1;
}

.copy-address-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.copy-address-link:hover {
  text-decoration: underline;
}

.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
}

.breadcrumb a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.loading-section,
.error-section {
  text-align: center;
  padding: 3rem 1rem;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid rgba(148, 163, 184, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--danger);
}

.error-icon {
  font-size: 3rem;
  font-weight: 700;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(16px);
}

.detail-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.detail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.detail-card-header h2 {
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item .address-value {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--text-primary);
}

.balance-display {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.balance-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.balance-item .balance-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.balance-item .balance-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
}

.risk-input-group,
.risk-vendor-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.risk-input-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-address-input {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.risk-address-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.risk-vendor-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-vendor-select {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.risk-vendor-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.risk-vendor-card h3 {
  margin-bottom: 1rem;
}

.risk-header {
  margin-bottom: 1.5rem;
}

.risk-severity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.risk-badge {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-badge.high {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.risk-badge.medium {
  background: rgba(234, 179, 8, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.risk-badge.low {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.risk-badge.neutral {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.risk-badge.severe {
  background: rgba(40, 20, 12, 0.65);
  color: #e7c4a8;
  border: 1px solid rgba(80, 40, 24, 0.8);
}

.risk-badge.risk-badge-lg {
  font-size: 1.5rem;
  padding: 0.75rem 1.5rem;
  letter-spacing: 0.06em;
}

.wizard-aml-modal-content {
  max-width: 800px;
}

.wizard-aml-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0 0.25rem;
}

.aml-subject-address {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.aml-subject-address-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.aml-subject-address-value {
  display: block;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
  cursor: pointer;
}

.aml-subject-address-value:hover {
  border-color: var(--accent);
}

.wizard-aml-full .aml-subject-address {
  align-items: flex-start;
  text-align: left;
  margin-bottom: 0.75rem;
}

.wizard-aml-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.wizard-aml-badge-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 8rem;
}

.wizard-aml-badge-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wizard-aml-reason {
  margin: 0;
  max-width: 32rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.wizard-aml-summary-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}

.wizard-aml-full .wizard-aml-summary-actions {
  justify-content: flex-start;
  margin-bottom: 1.25rem;
}

.address-type {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 6px;
}

.risk-summary-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.12);
}

.risk-summary-section h3 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.summary-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.summary-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}

.provider-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.summary-text {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.summary-text.error-text {
  color: #f87171;
}

.risk-vendor-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.12);
}

.risk-vendor-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.risk-reason {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.risk-subsection {
  margin-top: 1.5rem;
}

.risk-subsection h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.risk-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.risk-list li {
  padding: 0.75rem;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.risk-list li strong {
  color: var(--text-primary);
}

.risk-list li small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.exposures-section {
  margin-bottom: 1.5rem;
}

.exposures-section:last-child {
  margin-bottom: 0;
}

.exposure-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.exposures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.exposure-item {
  padding: 1rem;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.exposure-item.exposure-direct {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.exposure-item.exposure-indirect {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.08);
}

.exposure-category {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-transform: capitalize;
  margin-bottom: 0.5rem;
}

.exposure-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  margin-bottom: 0.5rem;
}

.exposure-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.exposure-type,
.exposure-direction {
  padding: 0.2rem 0.4rem;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 4px;
  text-transform: capitalize;
}

.no-data {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* Incoming Payments Styles */
.incoming-payment-register {
  margin-bottom: 2rem;
}

.register-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.incoming-address-input,
.amount-input {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-primary);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.incoming-address-input:focus,
.amount-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.aml-check-result {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
}

.incoming-aml-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.aml-check-result h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.collapse-button {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  min-width: auto;
}

.incoming-aml-rescreen {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.12);
}

.incoming-aml-vendor-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.12);
}

.incoming-aml-vendor-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.incoming-aml-vendor-section h5 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.incoming-aml-provider {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.incoming-aml-provider:last-child {
  margin-bottom: 0;
}

.risk-reason-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.register-actions {
  display: flex;
  gap: 1rem;
}

.registered-incoming-list {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
}

.registered-incoming-list h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.registered-incoming-grid {
  display: grid;
  gap: 1.5rem;
}

.registered-incoming-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
}

.registered-incoming-header {
  display: flex;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.registered-address {
  flex: 1 1 0;
  min-width: 0;
}

.registered-incoming-header .registered-amount {
  flex: 1 1 0;
  min-width: 0;
}

.registered-incoming-header .registered-signer {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.signature-pending {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.signature-valid {
  color: var(--success);
  font-weight: 600;
}

.signature-invalid,
.signature-error {
  color: var(--danger);
  font-weight: 600;
}

.registered-amount-with-action {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
}

.registered-amount-with-action .registered-amount {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.registered-address,
.registered-amount {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}


.delete-button-cross {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
  position: absolute;
  top: 0;
  right: 0;
}

.delete-button-cross:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.delete-button-cross:active {
  transform: scale(0.95);
}

.registered-address strong,
.registered-amount strong {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.registered-risk-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
}

.view-risk-icon-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.view-risk-icon-button:hover {
  background: rgba(248, 250, 252, 0.1);
  border-color: var(--accent);
}

.registered-memo {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.registered-memo label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.memo-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.memo-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 3rem;
}

.memo-input:focus {
  outline: none;
  border-color: var(--accent);
}

.save-memo-button {
  flex-shrink: 0;
  align-self: flex-start;
}

.risk-badge-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.registered-status {
  margin-bottom: 1rem;
}

.status-item {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-item:last-child {
  margin-bottom: 0;
}

.status-item strong {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.status-success {
  color: var(--success);
  font-weight: 600;
}

.status-error {
  color: var(--danger);
  font-weight: 600;
}

.status-neutral {
  color: var(--text-secondary);
}

.status-pending {
  color: var(--text-secondary);
  font-style: italic;
}

.status-info {
  color: var(--accent);
  font-weight: 500;
}

.status-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: normal;
  margin-left: 0.5rem;
}

.registered-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.registered-actions button {
  flex: 1;
  min-width: 120px;
}

.receipt-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  transition: color 0.2s ease;
}

.receipt-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Payment transaction table (status section) */
/* Header row above the transactions table: title on the left, compact refresh
   (Check Transfers) button on the right. */
.tx-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tx-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 600;
}

.tx-refresh-btn {
  flex: 0 0 auto;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
}

.payment-tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.payment-tx-table thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.payment-tx-table th.tx-amount-col {
  text-align: right;
}

.payment-tx-table tbody td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.payment-tx-table tbody tr:last-child td {
  border-bottom: none;
}

.payment-tx-table .tx-datetime {
  white-space: nowrap;
}

.payment-tx-table .tx-txid {
  font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', ui-monospace, monospace;
  white-space: nowrap;
}

.payment-tx-table .tx-amount {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', ui-monospace, monospace;
}

.payment-tx-table .tx-actions {
  white-space: nowrap;
}

/* The description column always takes the remaining width so the other (fixed,
   content-sized) columns don't shift when a description gets shorter on reload. */
.payment-tx-table .tx-desc-col,
.payment-tx-table .tx-desc {
  width: 100%;
  color: var(--text-primary);
}

/* TxID cell: short receipt link followed by a copy icon. */
.payment-tx-table .tx-txid-link {
  color: inherit;
  text-decoration: underline;
}

.payment-tx-table .tx-txid-link:hover {
  text-decoration: none;
}

.payment-tx-table .tx-copy-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.payment-tx-table .tx-copy-icon:hover {
  color: var(--text-primary);
}

.payment-tx-table .tx-txid-empty {
  color: var(--text-secondary);
}

/* Inline mini-buttons in the Actions column. */
.tx-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  margin-right: 0.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-secondary, rgba(15, 23, 42, 0.4));
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tx-action-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
}

.tx-action-btn.tx-close-btn {
  color: var(--danger);
}

.tx-action-btn.tx-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

.tx-action-btn.tx-connect-btn,
.tx-action-btn.backup-connect-btn {
  color: var(--accent);
}

.tx-action-btn.tx-connect-btn:hover,
.tx-action-btn.backup-connect-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
}

/* Row states: confirmed = green, still-to-do = red, submitted-to-TronLink = blue. */
.payment-tx-table .tx-confirmed td {
  color: var(--success);
}

.payment-tx-table .tx-todo td {
  color: var(--danger);
}

.payment-tx-table .tx-submitted td {
  color: var(--accent);
}

/* Eligible-to-sign = purple: a partially signed tx is stored locally and the
   connected wallet is an outstanding cosigner invited to finalize it in-app. */
/* Finalize-sign action on a pending row (kept distinct from the row color). */
.tx-action-btn.tx-finalize-sign-btn,
.tx-action-btn.backup-sign-btn {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.5);
}

.tx-action-btn.tx-finalize-sign-btn:hover,
.tx-action-btn.backup-sign-btn:hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: #a78bfa;
}

/* "Share via TronLink" relays the signed tx to TronLink's multisig queue: blue arrow. */
.tx-action-btn.tx-share-btn {
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.5);
}

.tx-action-btn.tx-share-btn:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
}

/* Broadcast a fully signed pending transaction (single-sig save-then-send), and the
   equivalent Send action on a held backup transaction. */
.tx-action-btn.tx-broadcast-btn,
.tx-action-btn.backup-send-btn {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.5);
}

.tx-action-btn.tx-broadcast-btn:hover,
.tx-action-btn.backup-send-btn:hover {
  background: rgba(5, 150, 105, 0.18);
  border-color: #059669;
}

/* Renew a live backup: signs a successor with a fresh expiration, amber like a nudge. */
.tx-action-btn.backup-renew-btn {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
}

.tx-action-btn.backup-renew-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
}

.tx-action-btn.tx-delete-pending-btn,
.tx-action-btn.backup-delete-btn {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.45);
}

.tx-action-btn.tx-delete-pending-btn:hover,
.tx-action-btn.backup-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

.payment-tx-table .tx-empty-cell {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

/* Description toggle lives in the datetime cell; desktop keeps the full Description
   column, so the toggle/detail are phone-only. */
.tx-desc-toggle,
.tx-desc-detail {
  display: none;
}

@media (max-width: 768px), (max-device-width: 768px) {
  .payment-tx-table {
    font-size: 0.8rem;
  }

  .payment-tx-table thead th.tx-desc-col,
  .payment-tx-table td.tx-desc {
    display: none;
  }

  .payment-tx-table thead th,
  .payment-tx-table tbody td {
    padding: 0.4rem 0.35rem;
  }

  .payment-tx-table .tx-datetime {
    white-space: normal;
  }

  .tx-datetime-value {
    display: inline;
  }

  .tx-desc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
  }

  .tx-desc-toggle:hover,
  .tx-row.tx-desc-open .tx-desc-toggle {
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.45);
  }

  .tx-desc-detail {
    display: block;
    margin-top: 0.35rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.45);
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: normal;
  }

  .tx-desc-detail[hidden] {
    display: none;
  }

  .tx-refresh-label {
    display: none;
  }

  .tx-refresh-btn {
    padding: 0.3rem 0.45rem;
    min-width: 2rem;
  }

  .payment-card {
    padding: 1rem;
  }

  .payment-actions {
    gap: 0.5rem;
  }

  .payment-actions button {
    flex: 1 1 auto;
  }
}

/* Expandable extras (receipt + tracking) in the card header. */
.payment-extras {
  margin-top: 0.5rem;
}

.payment-extras-summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  list-style: none;
  user-select: none;
}

.payment-extras-summary::-webkit-details-marker {
  display: none;
}

.payment-extras-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
}

.payment-extras[open] .payment-extras-summary::before {
  transform: rotate(90deg);
}

.payment-extras-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
}

.payment-extras-body a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.payment-extras-body a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.payment-extras-body .receipt-icon {
  display: inline-flex;
  align-items: center;
}

/* Completed payment: friendly label instead of "0 USDT". */
.payment-amount-success {
  color: var(--success);
  font-size: 1.1rem;
}

/* Blocking loader shown while a TronLink transaction is being created. */
.card-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}

.card-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2.25rem;
  border-radius: 12px;
  background: var(--surface, #0f172a);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.card-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: card-loader-spin 0.8s linear infinite;
}

.card-loader-text {
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: center;
}

@keyframes card-loader-spin {
  to { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 900px;
  max-height: 90vh;
  margin: 5vh auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: rgba(248, 250, 252, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

@media (max-width: 768px), (max-device-width: 768px) {
  .modal-content {
    margin: 2vh auto;
    max-height: 96vh;
    max-width: 95%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .registered-actions {
    flex-direction: column;
  }

  .registered-actions button {
    width: 100%;
  }
}

@media (max-width: 768px), (max-device-width: 768px) {
  .register-form {
    grid-template-columns: 1fr;
  }

  .registered-incoming-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .registered-amount-with-action {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .delete-button-cross {
    position: absolute;
    top: 0;
    right: 0;
  }
  body {
    padding: 1.5rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .controls-right button {
    flex: 0 0 auto;
  }

  .label-input {
    flex-direction: column;
    align-items: stretch;
  }

  .label-save-button {
    width: 100%;
  }

  .cosigners-list {
    gap: 0.35rem;
  }

  .summary-cards-container {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 0;
  }

  /* Card-style stacking for data tables — keep the payment transaction table on its
     own compact layout (see .payment-tx-table rules below). */
  table:not(.payment-tx-table) thead {
    display: none;
  }

  table:not(.payment-tx-table) tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }

  table:not(.payment-tx-table) tbody tr td {
    border-bottom: none;
    padding: 0;
  }

  table:not(.payment-tx-table) tbody tr td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
  }
}

.payment-card {
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.payment-card.hiding {
  opacity: 0;
  transform: translateY(-20px);
  max-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: none;
}

/* Unified payment card (shared by send, receive, and address detail pages). */
.payment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(16px);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* The connected web3 wallet is this card's own party (sender/receiver) or one of
   its cosigners — tint it purple so the user can spot the cards they can act on. */
.payment-card.wallet-relevant {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(139, 92, 246, 0.06)), var(--surface);
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 22px 60px rgba(76, 29, 149, 0.35);
}

/* Inside the detail page's compact rows the card has no shadow; keep the tint. */
.compact-payment-details .payment-card.wallet-relevant {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(139, 92, 246, 0.06)), var(--surface);
}

.payment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.payment-own-info,
.payment-counterparty {
  flex: 1;
  min-width: 0;
}

.payment-amount {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.payment-own-address,
.payment-counterparty-address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.payment-own-address .address,
.payment-counterparty .address,
.payment-counterparty-address .address {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

.copyable-address {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.copyable-address .tx-copy-icon {
  flex-shrink: 0;
  margin-left: 0;
  margin-top: 0.15rem;
}

.payment-entity {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.payment-balance {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.payment-amount-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
}

.payment-amount-open {
  color: var(--accent);
}

.compact-payment-amount.open-sum {
  font-style: italic;
}

.payment-registered-at {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.payment-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.payment-actions button {
  flex: 0 0 auto;
}

/* Delete now lives as a link inside the "Advanced" section, styled as a danger link. */
.payment-extras-body a.payment-delete-link {
  color: var(--danger);
}

.payment-extras-body a.payment-delete-link:hover {
  color: var(--danger);
}

@media (max-width: 768px), (max-device-width: 768px) {
  .payment-card-header {
    flex-direction: column;
  }

  .payment-amount {
    text-align: left;
  }
}

/* Public tracking page: a single stripped-down payment card, centered. */
body.track-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.track-shell {
  width: 100%;
  max-width: 800px;
  padding: 2rem 1.25rem 3rem;
}

.track-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.track-brand h1 {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0 0 0.3rem;
}

.track-brand p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.track-card-slot .payment-card-tracking {
  width: 100%;
  overflow: hidden;
}

/* Tracking is a single focused card, not a dense list — stack the header so
   addresses and the remaining amount stay readable instead of wrapping in
   three tight columns. */
.payment-card-tracking .payment-card-header {
  flex-direction: column;
  gap: 1rem;
}

.payment-card-tracking .payment-amount {
  text-align: left;
}

.payment-card-tracking .payment-amount-value {
  font-size: 1.85rem;
}

.payment-card-tracking .registered-status {
  overflow: hidden;
}

@media (max-width: 768px), (max-device-width: 768px) {
  .track-shell {
    padding: 1.25rem 0.85rem 2rem;
  }

  .payment-card-tracking .payment-card-header {
    gap: 1.25rem;
  }

  .payment-card-tracking .payment-amount-value {
    font-size: 1.6rem;
  }

  .payment-card-tracking .payment-tx-table .tx-amount {
    font-size: 0.75rem;
  }
}

/* Transfer receipt is now a link under the signer name */
.payment-receipt-row {
  margin-top: 0.35rem;
}

.payment-receipt-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.payment-receipt-link:hover {
  text-decoration: underline;
}

/* Hero investigate (AML) icon */
.hero-investigate-btn {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(56, 189, 248, 0.08);
}

.hero-investigate-btn:hover {
  background: rgba(56, 189, 248, 0.18);
}

/* Cosigners expandable inside the hero */
.hero-cosigners {
  margin-top: 0.9rem;
}

.hero-cosigners-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-cosigners-summary::-webkit-details-marker {
  display: none;
}

.hero-cosigners-caret {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.hero-cosigners[open] .hero-cosigners-caret {
  transform: rotate(45deg);
}

.hero-cosigners-count {
  font-weight: 400;
  color: var(--text-secondary);
}

.hero-cosigners-body {
  margin-top: 0.5rem;
  padding-left: 1.05rem;
}

/* Payments block (no longer a collapsible section) */
.address-payments {
  margin-top: 0.5rem;
}

.address-payments-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.address-payments-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.address-payments-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Backup transaction module (wallet details page): the pre-signed sweep held for a
   one-click send. Reuses .payment-tx-table for the signed transaction itself. */
.backup-plan {
  margin-top: 1.25rem;
}

.backup-plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

.backup-plan-form,
.backup-plan-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem;
}

.backup-plan-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 12rem;
}

.backup-plan-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.backup-plan-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.backup-plan-muted {
  font-weight: 400;
  color: var(--text-secondary);
}

.backup-plan-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.backup-plan-select,
.backup-plan-input {
  padding: 0.6rem 0.7rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}

.backup-plan-select:focus,
.backup-plan-input:focus {
  outline: none;
  border-color: var(--accent);
}

.backup-plan-actions {
  margin-left: auto;
}

.backup-plan-warning {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.backup-plan .payment-tx-table {
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .backup-plan-form,
  .backup-plan-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .backup-plan-actions {
    margin-left: 0;
  }
}

/* Address detail page */
.address-detail-main {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.address-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(16px);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* The connected web3 wallet is this address or one of its cosigners. */
.address-hero.wallet-relevant {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(139, 92, 246, 0.06)), var(--surface);
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 22px 60px rgba(76, 29, 149, 0.35);
}

/* Indexed USDT transfer or blacklist event touches a blacklisted address linked to this wallet. */
.address-hero.wallet-blacklist-exposed {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 22px 60px rgba(127, 29, 29, 0.45);
}

.wallet-blacklist-emergency {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(185, 28, 28, 0.12));
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: #fecaca;
}

.wallet-blacklist-emergency-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  animation: wallet-blacklist-pulse 1.6s ease-in-out infinite;
}

.wallet-blacklist-emergency-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.wallet-blacklist-emergency-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fee2e2;
}

.wallet-blacklist-emergency-paths {
  margin: 0.2rem 0 0;
  padding: 0 0 0 0.9em;
  list-style: disc;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #fecaca;
}

.wallet-blacklist-emergency-paths li {
  word-break: break-all;
}

.wallet-blacklist-emergency-paths .wallet-blacklist-more {
  list-style: none;
  margin-left: -0.9em;
  color: rgba(254, 202, 202, 0.65);
  font-size: 0.78rem;
}

.wallet-blacklist-emergency-count {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.65);
  border: 1px solid rgba(254, 202, 202, 0.45);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wallet-blacklist-emergency-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-blacklist-emergency-compact .wallet-blacklist-emergency-icon {
  font-size: 1.35rem;
  cursor: help;
}

@keyframes wallet-blacklist-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.85; }
}

/* Pinned "Connected wallet" section on the wallets page, shown above the filter. */
.connected-wallet-section {
  margin-bottom: 2rem;
}

.connected-wallet-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.connected-wallet-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.9);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
}

/* The pinned card is always shown expanded, so the collapse control is a no-op. */
.connected-wallet-section .wallet-collapse-btn {
  display: none;
}

.address-hero-top {
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.address-hero-primary {
  flex: 1;
  min-width: 260px;
}

.address-hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.address-hero-value {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 1rem;
  word-break: break-all;
  line-height: 1.5;
}

.address-hero-value .copy-address-icon {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.address-hero-value .copy-address-icon:hover {
  color: var(--accent);
}

.address-hero-aml {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.address-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.address-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.multisig-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.multisig-badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.multisig-badge.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.multisig-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.automation-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

.wallet-card-collapsed .automation-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

.multisig-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.multisig-configure-btn {
  height: 1.7rem;
  padding: 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1;
}

/* Funded wallet without a usable backup transaction (wallets list). */
.wallet-backup-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.wallet-backup-warning:hover {
  background: rgba(245, 158, 11, 0.24);
}

.wallet-backup-warning-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.address-hero-balances-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.address-hero-balances {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.refresh-balances-btn {
  flex-shrink: 0;
  margin-bottom: 0.15rem;
}

.balance-card {
  min-width: 130px;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
}

.balance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.balance-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.balance-card-value {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 1.35rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Balance Check info sign + hover tooltip */
.balance-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  color: var(--text-secondary);
  outline: none;
}

.balance-info.balance-info-ok {
  color: var(--success);
}

.balance-info.balance-info-bad {
  color: var(--danger);
}

.balance-info-icon {
  display: block;
}

.balance-info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: max-content;
  max-width: 260px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--surface, #0f172a);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
  color: var(--text-primary);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.balance-info:hover .balance-info-tooltip,
.balance-info:focus .balance-info-tooltip,
.balance-info:focus-visible .balance-info-tooltip {
  opacity: 1;
  visibility: visible;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-button:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.icon-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-button.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.address-hero-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.action-button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.action-button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.action-incoming .action-button-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.action-outgoing .action-button-icon {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}

.action-button-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.action-button-text strong {
  font-size: 0.95rem;
}

.action-button-text small {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.address-secondary-section,
.address-payments-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.section-expand-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-expand-trigger::-webkit-details-marker {
  display: none;
}

.section-caret {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(-135deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] > .section-expand-trigger .section-caret {
  transform: rotate(45deg);
}

.section-summary-hint {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.section-expand-content {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.cosigners-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.cosigner-line {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cosigner-line .address {
  color: var(--text-primary);
}

.cosigner-path {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cosigner-path-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.section-expand-content .risk-address-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.75rem 0;
}

.section-expand-content .risk-address-label a {
  color: var(--accent);
}

.payments-subsection {
  margin-top: 1rem;
}

.payments-subsection:first-child {
  margin-top: 0.75rem;
}

.payments-subsection-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.compact-payments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-payments-empty {
  padding: 0.75rem 0;
  font-size: 0.9rem;
}

.compact-payment-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.compact-payment-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.compact-payment-expand {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  line-height: 1;
}

.compact-expand-icon {
  font-size: 0.65rem;
}

.compact-payment-arrow {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.compact-payment-arrow.incoming {
  color: var(--success);
}

.compact-payment-arrow.outgoing {
  color: var(--danger);
}

.compact-payment-datetime {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.compact-payment-address {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.82rem;
}

/* Mutations (and any list that shows both sides): fixed columns so sender /
   recipient line up across rows, and AML stays immediately after the pair. */
.compact-payment-addresses {
  display: grid;
  grid-template-columns: 16rem auto 16rem;
  align-items: center;
  column-gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
}

.compact-payment-addresses .compact-payment-address {
  display: block;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-payment-addr-sep {
  color: var(--text-secondary);
  flex-shrink: 0;
  font-size: 0.75rem;
  text-align: center;
}

.compact-payment-own {
  color: var(--accent);
  font-weight: 600;
}

.compact-payment-amount {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
}

.compact-payment-amount.credit {
  color: var(--success);
}

.compact-payment-amount.debit {
  color: var(--danger);
}

.compact-status-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.compact-status-symbol.complete {
  color: var(--success);
}

.compact-status-symbol.incomplete {
  color: #facc15;
}

/* Ghost (unmatched on-chain transfer) rows: visibly muted / not-registered. */
.compact-payment-row.ghost {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.25);
  opacity: 0.85;
}

.compact-payment-row.ghost .compact-payment-address,
.compact-payment-row.ghost .compact-payment-datetime {
  color: var(--text-secondary);
}

.compact-payment-row.ghost .compact-payment-arrow {
  opacity: 0.55;
}

.compact-payment-row.ghost .compact-payment-amount.credit,
.compact-payment-row.ghost .compact-payment-amount.debit {
  color: var(--text-secondary);
}

.compact-payment-row.blacklist-exposed {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 12px 36px rgba(127, 29, 29, 0.35);
  opacity: 1;
}

.payment-blacklist-emergency-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
  cursor: help;
  animation: wallet-blacklist-pulse 1.6s ease-in-out infinite;
}

.payment-card.payment-blacklist-exposed {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 22px 60px rgba(127, 29, 29, 0.4);
}

/* Reminder that the source wallet's backup transaction still needs signatures. */
.payment-backup-reminder {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.12);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.payment-backup-reminder a {
  color: #c4b5fd;
  font-weight: 600;
}

.payment-backup-reminder-icon {
  flex-shrink: 0;
  line-height: 1.2;
}

.payment-blacklist-emergency {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(185, 28, 28, 0.12));
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: #fecaca;
}

.payment-blacklist-emergency-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  animation: wallet-blacklist-pulse 1.6s ease-in-out infinite;
}

.payment-blacklist-emergency-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.payment-blacklist-emergency-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fee2e2;
}

.payment-blacklist-emergency-paths {
  margin: 0.15rem 0 0;
  padding: 0 0 0 0.9em;
  list-style: disc;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #fecaca;
}

.payment-blacklist-emergency-paths li {
  word-break: break-all;
}

.compact-ghost-marker {
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  filter: grayscale(0.3);
  opacity: 0.7;
}

.compact-ghost-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.ghost-register-btn {
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.ghost-register-btn:hover {
  background: rgba(56, 189, 248, 0.18);
}

.compact-payment-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.compact-status-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.compact-status-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.compact-status-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
}

.compact-status-info {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
}

.compact-status-pending {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
}

.compact-payment-aml-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.compact-risk-badge {
  font-size: 0.65rem !important;
  padding: 0.1rem 0.35rem !important;
  white-space: nowrap;
}

.risk-badge.risk-internal {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

a.compact-payment-address {
  color: var(--accent);
  text-decoration: none;
}

a.compact-payment-address:hover {
  text-decoration: underline;
}

.compact-action-btn {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.compact-payment-row .delete-button-cross {
  position: static;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.compact-payment-row .delete-button-cross:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: none;
}

.compact-detail-actions {
  margin-bottom: 0.75rem;
}

.compact-detail-actions button {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}

.compact-payment-details {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.25);
}

/* The embedded shared payment card sits flush inside the expanded row. */
.compact-payment-details .payment-card {
  box-shadow: none;
  margin: 0;
}

.compact-payment-details-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-detail-counterparty .compact-detail-address {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

.compact-detail-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  align-items: flex-start;
}

.compact-detail-label {
  min-width: 7rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.compact-detail-memo {
  flex-direction: column;
  margin-top: 0.25rem;
}

.compact-detail-memo .memo-input-group {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.compact-detail-memo .memo-input {
  flex: 1;
}

.wizard-card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.wizard-address-title {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
}

/* Shared payment wizard modal */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.wizard-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.wizard-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.wizard-overlay.show .wizard-modal {
  transform: scale(1);
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.wizard-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.wizard-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.wizard-close:hover {
  color: var(--text-primary);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-step-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-step-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.wizard-input {
  width: 100%;
  padding: 0.875rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  margin-bottom: 1rem;
}

.wizard-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* "Use wallet balance (N USDT)" — fills the amount from the detail-page wallet. */
.wizard-fill-balance {
  display: inline-block;
  margin: -0.55rem 0 1rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.wizard-fill-balance:hover {
  color: var(--accent-hover);
}

.wizard-fill-balance[hidden] {
  display: none;
}

.wizard-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.wizard-card {
  background: rgba(15, 23, 42, 0.4);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.wizard-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.wizard-card.selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.15);
}

.wizard-card-title {
  font-weight: 600;
}

.wizard-card-tip {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.wizard-card-tip.previously-used {
  color: var(--success);
}

.wizard-card-tip.insufficient-funds {
  color: var(--danger);
}

.wizard-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.wizard-actions button {
  min-width: 120px;
}

.wizard-progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.wizard-progress-step {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.wizard-progress-step.completed,
.wizard-progress-step.active {
  background: var(--accent);
}

@media (max-width: 768px), (max-device-width: 768px) {
  .address-hero-top {
    flex-direction: column;
  }

  .address-hero-balances-wrap {
    width: 100%;
  }

  .address-hero-balances {
    width: 100%;
  }

  .balance-card {
    flex: 1;
  }

  .compact-payment-main {
    flex-wrap: wrap;
  }

  .compact-payment-addresses {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    flex: 1 1 12rem;
  }

  .compact-payment-aml-group {
    margin-left: 0;
  }
}

/* ------------------------------------------------------------------ */
/* Wallets page                                                       */
/* ------------------------------------------------------------------ */
.wallets-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Controls row: search on the left, entity filter chips filling the rest. */
.wallets-controls {
  align-items: flex-start;
}

.entity-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 320px;
  min-width: 0;
}

.entity-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.entity-filter-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.entity-filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.entity-filter-chip.active {
  color: #0f172a;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  font-weight: 600;
}

@media (max-width: 768px), (max-device-width: 768px) {
  /* In a column layout the 320px flex-basis becomes height and leaves a tall empty
     panel — size both groups to their content instead. */
  .wallets-controls {
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .wallets-controls .search-group {
    max-width: none;
    flex: 0 0 auto;
  }

  .wallets-controls .entity-filter-group {
    flex: 0 0 auto;
    width: 100%;
  }
}

.wallet-card {
  margin-bottom: 0;
}

/* Address links inside wallet cards follow the project accent-link style
   (no default browser blue / purple-visited). */
.wallet-card a.address,
.wallet-card a.address:link,
.wallet-card a.address:visited {
  color: var(--accent);
  text-decoration: none;
}

.wallet-card a.address:hover {
  text-decoration: underline;
}

/* AML badges (Chainalysis + Elliptic) shown compactly on the collapsed row.
   Expanded cards use the shared .address-hero-aml row instead. */
.wallet-aml-badges-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Prominent derivation-index badge. */
.wallet-index-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.wallet-index-badge-collapsed {
  min-width: 2.75rem;
  padding: 0.25rem 0.6rem;
  font-size: 1.15rem;
  border-radius: 10px;
}

/* On the detail page the index lives in the breadcrumb above the card
   (Wallets → #N), so the in-card index badge is redundant and hidden. */
.wallet-card-detail .wallet-index-badge {
  display: none;
}

/* Large breadcrumb on the address-details page: "Wallets → #N", where the
   index badge matches the wallets-page style exactly. */
.wallet-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.wallet-breadcrumb-link,
.wallet-breadcrumb-link:link,
.wallet-breadcrumb-link:visited {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
}

.wallet-breadcrumb-link:hover {
  text-decoration: underline;
}

.wallet-breadcrumb-sep {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-secondary);
}

/* Relevance is kept in the DOM for debugging only; never shown. The [hidden]
   attribute alone is overridden by .address-meta-chip's display, so force it. */
.wallet-relevance-chip {
  display: none !important;
}

/* Right-hand column of an expanded wallet card: collapse control on top of the
   balances block. */
.wallet-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.wallet-collapse-btn,
.wallet-expand-btn {
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1;
}

/* Inline entity editor inside the meta row: caption + pencil, swapped for a
   <select> when editing. */
.wallet-entity {
  display: inline-flex;
  align-items: center;
}

.wallet-entity-view {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wallet-entity-caption {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.wallet-entity-caption.wallet-entity-empty {
  color: var(--text-secondary);
  font-style: italic;
}

.wallet-entity-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.wallet-entity-edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.wallet-entity-select {
  padding: 0.25rem 1.5rem 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-width: 14rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.wallet-entity-select:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.wallet-autotrack {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wallet-autotrack-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.wallet-autotrack-select {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.8);
  font-size: 0.8rem;
}

.wallet-autotrack-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.wallet-autotrack-off {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.45);
  white-space: nowrap;
}

.wallet-entity-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  color: var(--text-primary);
}

/* Collapsed wallet card: a single compact row. */
.wallet-card-collapsed {
  padding: 0.85rem 1.25rem;
}

.wallet-collapsed-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.wallet-collapsed-address {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.9rem;
}

.wallet-collapsed-entity {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.wallet-collapsed-balances {
  display: inline-flex;
  gap: 1rem;
  margin-left: auto;
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.85rem;
}

@media (max-width: 720px), (max-device-width: 720px) {
  .wallet-collapsed-balances {
    margin-left: 0;
    width: 100%;
  }
}

/* Incomplete-payment banners on wallet cards (Wallets page). Same footprint as
   the register action buttons: incoming on the left, outgoing on the right. */
.wallet-banner-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.wallet-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-primary);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.wallet-banner:hover {
  transform: translateY(-1px);
}

/* When only one banner is present it should not stretch across both columns. */
.wallet-banner-row .wallet-banner:only-child {
  grid-column: auto;
}

.wallet-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.wallet-banner-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.wallet-banner-text strong {
  font-size: 0.95rem;
}

.wallet-banner-text small {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.wallet-banner-incoming {
  border-color: rgba(34, 197, 94, 0.35);
}

.wallet-banner-incoming:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.1);
}

.wallet-banner-incoming .wallet-banner-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.wallet-banner-outgoing {
  border-color: rgba(248, 113, 113, 0.35);
}

.wallet-banner-outgoing:hover {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.1);
}

.wallet-banner-outgoing .wallet-banner-icon {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

@media (max-width: 720px), (max-device-width: 720px) {
  .wallet-banner-row {
    grid-template-columns: 1fr;
  }
}

/* Wizard: collapsed "less relevant" address alternatives. */
.wizard-alt-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wizard-alt-toggle {
  align-self: flex-start;
  font-size: 0.85rem;
}

.wizard-alt-grid {
  margin-bottom: 0;
}

/* The grid's display:grid overrides the [hidden] attribute, so force collapse. */
.wizard-alt-grid[hidden] {
  display: none !important;
}
