:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --bg-alt: #1a2332;
  --surface-elevated: #222c3d;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-bright: #5aa3ff;
  --accent-dim: #2563c7;
  --success: #3ecf8e;
  --warn: #f0b429;
  --danger: #f56565;
  --radius: 10px;
  --btn-radius: 9px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Disable rubber-band / elastic overscroll (macOS Safari, iOS, Chrome) */
html {
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1e2a3d 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
  overscroll-behavior: none;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 2rem) 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.125rem;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.three {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid.stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.charts-row {
  align-items: stretch;
}

.chart-island {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  background: linear-gradient(165deg, rgba(26, 35, 50, 0.98) 0%, rgba(15, 20, 28, 0.95) 100%);
}

.chart-island .chart-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.chart-island-empty {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 1rem 0.5rem;
  text-align: center;
  justify-content: center;
}

.stat {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat .value {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 4rem;
  resize: vertical;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.row > div {
  flex: 1 1 140px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(165deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-dim) 100%);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 2px 4px rgba(0, 0, 0, 0.25),
    0 8px 24px rgba(61, 139, 253, 0.28);
}

.btn-primary:hover {
  text-decoration: none;
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 4px 12px rgba(0, 0, 0, 0.3),
    0 12px 32px rgba(61, 139, 253, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(139, 156, 179, 0.35);
}

.btn-secondary:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 156, 179, 0.55);
  color: var(--text);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: rgba(45, 58, 79, 0.9);
}

.btn-ghost:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
  color: #fecaca;
  background: rgba(245, 101, 101, 0.12);
  border-color: rgba(245, 101, 101, 0.45);
}

.btn-danger:hover {
  background: rgba(245, 101, 101, 0.2);
  border-color: rgba(245, 101, 101, 0.65);
  text-decoration: none;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: rgba(254, 202, 202, 0.55);
  background: rgba(245, 101, 101, 0.08);
  border-color: rgba(245, 101, 101, 0.28);
}

.btn-danger:disabled:hover {
  filter: none;
  transform: none;
  color: rgba(254, 202, 202, 0.55);
  background: rgba(245, 101, 101, 0.08);
  border-color: rgba(245, 101, 101, 0.28);
}

.btn-sm {
  min-height: 2.15rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}

.btn-del {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
}

.btn-del:hover {
  color: var(--danger);
  border-color: rgba(245, 101, 101, 0.5);
  background: rgba(245, 101, 101, 0.08);
  text-decoration: none;
}

.btn-del:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.btn-del:disabled:hover {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.inline-form {
  display: inline;
  margin: 0;
}

.td-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.tx-history-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.tx-history-head h2 {
  margin: 0;
}

.tx-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.wallet-list-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tx-sentinel {
  height: 1px;
}

.tx-loader {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem 0 0.5rem;
}

/* Author `display:flex` beats the UA `[hidden]` rule — force hide when not loading */
.tx-loader[hidden] {
  display: none !important;
}

.tx-loader-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.5;
  animation: tx-pulse 1.2s ease-in-out infinite;
}

.tx-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.tx-loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes tx-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%           { opacity: 1;    transform: scale(1);    }
}

.tx-history-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tx-history-table {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
}

.tx-history-table th,
.tx-history-table td {
  width: calc(100% / 6);
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tx-history-table .td-actions {
  width: calc(100% / 6);
  white-space: normal;
}

.tx-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Match Edit (btn-sm + secondary) to Delete (btn-del) footprint */
.tx-row-actions .btn {
  box-sizing: border-box;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
}

.tx-edit-readonly {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.tx-edit-readonly .muted {
  display: inline-block;
  min-width: 4.5rem;
  margin-right: 0.35rem;
}

.tx-history-table td:nth-child(4) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error {
  background: rgba(245, 101, 101, 0.12);
  border: 1px solid var(--danger);
  color: #fecaca;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.pill.dep {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.pill.wdr {
  background: rgba(240, 180, 41, 0.15);
  color: var(--warn);
}

.pill.brw {
  background: rgba(61, 139, 253, 0.18);
  color: var(--accent);
}

.pill.ret {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.chart-wrap {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
}

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

.wallet-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.wallet-list-item:last-child {
  border-bottom: none;
}

.wallet-list-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.wallet-list-link:hover {
  color: var(--accent);
}

.wallet-list-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

/* Match Edit + Export height in the wallet list (same as .btn-del min-height) */
.wallet-list-item-actions .btn-member-edit,
.wallet-list-item-actions .btn-wallet-export {
  box-sizing: border-box;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon export: same footprint and rest/hover as .btn-member-edit */
.btn-wallet-export {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.btn-wallet-export:hover {
  color: var(--accent);
  border-color: rgba(61, 139, 253, 0.35);
  background: rgba(61, 139, 253, 0.08);
  text-decoration: none;
}

.btn-wallet-export:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.members-section {
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.members-roster-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.members-roster-head-text {
  flex: 1;
  min-width: 0;
}

.members-roster-head-text h2 {
  margin: 0 0 0.35rem;
}

.btn-add-member {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(139, 156, 179, 0.28);
  border-radius: var(--btn-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(0, 0, 0, 0.12) 100%);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease;
}

.btn-add-member:hover {
  color: var(--accent-bright);
  border-color: rgba(61, 139, 253, 0.5);
  background: rgba(61, 139, 253, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 4px 16px rgba(61, 139, 253, 0.2);
  transform: translateY(-1px);
}

.btn-add-member.is-active {
  color: #fff;
  border-color: rgba(61, 139, 253, 0.65);
  background: linear-gradient(165deg, rgba(90, 163, 255, 0.35) 0%, rgba(61, 139, 253, 0.28) 100%);
  box-shadow: 0 0 0 1px rgba(61, 139, 253, 0.25), 0 6px 20px rgba(61, 139, 253, 0.25);
}

.btn-add-member:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* —— Modal —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 16, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(90vh, 100%);
  overflow-y: auto;
  background: linear-gradient(165deg, var(--surface-elevated) 0%, var(--surface) 100%);
  border: 1px solid rgba(61, 139, 253, 0.12);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 28px 90px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(61, 139, 253, 0.08);
  padding: 1.35rem 1.5rem 1.5rem;
  animation: modal-in 0.2s ease-out;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-dialog.modal-dialog-danger {
  border-color: rgba(245, 101, 101, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 28px 90px rgba(0, 0, 0, 0.65),
    0 0 72px rgba(245, 101, 101, 0.07);
}

.modal-dialog-danger .modal-title {
  color: #fca5a5;
}

.modal-delete-confirm-prompt {
  margin-top: -0.35rem;
}

.modal-delete-confirm-name {
  display: inline;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-dialog {
    animation: none;
  }
  .btn,
  .btn-primary:hover,
  .btn-add-member:hover {
    transform: none;
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: none;
}

.btn-icon-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.35rem -0.35rem 0 0;
  padding: 0;
  border: none;
  border-radius: var(--btn-radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.btn-icon-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.modal-description {
  margin: 0 0 1.15rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

.modal-form label {
  margin-bottom: 0.4rem;
}

.modal-form input[type="text"] {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--btn-radius);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.95rem;
}

.modal-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(61, 139, 253, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.15);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
}

/* Compact modal actions (aligned with .btn-sm / list controls) */
.modal-footer .btn {
  min-height: 2.15rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
}

.members-roster-lead {
  margin: 0;
  font-size: 0.875rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.members-empty {
  margin: 0;
  padding: 0.5rem 0 0.25rem;
}

.members-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.members-table {
  width: 100%;
  min-width: 560px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.members-table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.7rem 0.85rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 28, 0.85);
}

.members-table thead th:first-child {
  border-top-left-radius: 7px;
}

.members-table thead th:last-child {
  border-top-right-radius: 7px;
}

.members-row td {
  padding: 0.85rem;
  text-align: center;
  border-bottom: 1px solid rgba(45, 58, 79, 0.65);
  vertical-align: middle;
  transition: background-color 0.12s ease;
}

.members-row:last-child td:first-child {
  border-bottom-left-radius: 7px;
}

.members-row:last-child td:last-child {
  border-bottom-right-radius: 7px;
}

.members-row:last-child td {
  border-bottom: none;
}

.members-row:hover td {
  background: rgba(61, 139, 253, 0.06);
}

.member-name-display {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.members-td-num {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 450;
}

.pool-pct-chip {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  background: rgba(61, 139, 253, 0.12);
  border-radius: 6px;
  border: 1px solid rgba(61, 139, 253, 0.22);
}

.members-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-member-edit {
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.btn-member-edit:hover {
  color: var(--accent);
  border-color: rgba(61, 139, 253, 0.35);
  background: rgba(61, 139, 253, 0.08);
}

/* ── Transaction action buttons ─────────────────────────── */
.tx-action-row {
  display: flex;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.btn-tx {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.25rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-tx-in {
  color: #3ecf8e;
  border-color: rgba(62, 207, 142, 0.25);
}

.btn-tx-in:hover {
  border-color: rgba(62, 207, 142, 0.6);
  background: rgba(62, 207, 142, 0.07);
}

.btn-tx-out {
  color: #f0b429;
  border-color: rgba(240, 180, 41, 0.25);
}

.btn-tx-out:hover {
  border-color: rgba(240, 180, 41, 0.6);
  background: rgba(240, 180, 41, 0.07);
}

/* ── Transaction type option cards ──────────────────────── */
.tx-option-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.25rem 0 1.25rem;
}

.tx-option-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.tx-option-card:hover {
  border-color: rgba(61, 139, 253, 0.4);
  background: rgba(61, 139, 253, 0.04);
}

.tx-option-card.is-selected {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.09);
}

.tx-option-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.tx-option-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Modal form inputs (number, select, textarea) ───────── */
.modal-select,
.modal-input,
.modal-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: block;
}

.modal-select:focus,
.modal-input:focus,
.modal-textarea:focus {
  outline: none;
  border-color: rgba(61, 139, 253, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.15);
}

/* Custom member dropdown (deposit / withdraw modals) */
.modal-member-select {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
}

.modal-member-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-member-select-trigger:hover {
  border-color: rgba(139, 156, 179, 0.45);
}

.modal-member-select-trigger:focus {
  outline: none;
}

.modal-member-select-trigger:focus-visible {
  border-color: rgba(61, 139, 253, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.15);
}

.modal-member-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-member-select-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  padding-left: 0.5rem;
  color: var(--muted);
  pointer-events: none;
  transition: transform 0.2s ease, color 0.15s ease;
}

.modal-member-select-trigger.is-open .modal-member-select-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.modal-member-select-menu {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.modal-member-select-menu[hidden] {
  display: none !important;
}

.modal-member-select-option {
  padding: 0.55rem 1rem;
  margin: 0 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.1s ease, color 0.1s ease;
}

.modal-member-select-option:hover {
  background: rgba(61, 139, 253, 0.1);
  color: var(--text);
}

.modal-member-select-option[aria-selected="true"] {
  background: rgba(61, 139, 253, 0.14);
  color: var(--accent);
  font-weight: 500;
}

#edit-tx-amount::-webkit-outer-spin-button,
#edit-tx-amount::-webkit-inner-spin-button,
#deposit-amount::-webkit-outer-spin-button,
#deposit-amount::-webkit-inner-spin-button,
#withdraw-amount::-webkit-outer-spin-button,
#withdraw-amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#edit-tx-amount,
#deposit-amount,
#withdraw-amount {
  appearance: textfield;
  -moz-appearance: textfield;
}

.modal-textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.modal-label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ── Modal inline error ──────────────────────────────────── */
.modal-error {
  display: none;
  font-size: 0.85rem;
  color: #f56565;
  background: rgba(245, 101, 101, 0.1);
  border-left: 3px solid #f56565;
  border-radius: 0 6px 6px 0;
  padding: 0.55rem 0.75rem;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.modal-error.is-visible {
  display: block;
}

.login-box {
  max-width: 360px;
  margin: 4rem auto;
}

.login-box h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.login-box .lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
