:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #121417;
  --muted: #68717d;
  --line: #dbe1e8;
  --green: #0b7a4b;
  --green-soft: #e7f6ef;
  --red: #b42318;
  --red-soft: #fdeceb;
  --amber: #a15c00;
  --amber-soft: #fff4df;
  --ink: #22252a;
  --shadow: 0 10px 24px rgba(18, 20, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p,
.panel-head p,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.live {
  background: var(--red-soft);
  color: var(--red);
}

button {
  font: inherit;
}

.icon-button,
.text-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 36px;
  font-size: 18px;
}

.text-button,
.text-link-button {
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.icon-button:hover,
.text-button:hover,
.text-link-button:hover {
  border-color: #aeb8c4;
}

.icon-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.text-link-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.layout {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 20px 28px 36px;
}

.wallets-page-layout {
  width: min(1680px, 100%);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  overflow: hidden;
}

.login-panel .modal-actions {
  justify-content: stretch;
}

.login-panel .text-button {
  width: 100%;
}

.top-activity-panel {
  margin-bottom: 16px;
}

.main-nav-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
}

.main-nav-card {
  display: grid;
  min-width: 0;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  color: var(--ink);
  text-decoration: none;
}

.main-nav-card:hover {
  border-color: #aeb8c4;
  background: #fff;
}

.main-nav-card strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(760px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.dashboard-main-grid,
.profile-logs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  min-height: 54px;
}

.launch-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.launch-summary-item {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.launch-summary-filter {
  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.launch-summary-filter:hover,
.launch-summary-filter:focus-visible {
  background: #f2f6fb;
  outline: 0;
  box-shadow: inset 0 0 0 1px #b9c9dc;
}

.launch-summary-filter.active {
  background: #eef4ff;
  box-shadow: inset 0 0 0 2px #7da2d8;
}

.launch-summary-item:last-child {
  border-right: 0;
}

.launch-summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.launch-summary-item strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launch-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.launch-limit-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.launch-limit-control select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.wallet-panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-head-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.wallet-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.wallet-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.wallet-summary span {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.wallet-summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-list-head {
  align-items: flex-start;
}

.wallet-list-heading {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
}

.wallet-list-summary {
  display: grid;
  gap: 8px;
}

.wallet-summary-context {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.wallet-summary-context span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wallet-summary-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.wallet-summary-card {
  display: grid;
  min-width: 0;
  min-height: 72px;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.wallet-summary-card span,
.wallet-summary-card small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-summary-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-summary-card.primary {
  border-color: #b9c9dc;
  background: #f8fbff;
}

.wallet-summary-card.balance {
  border-color: #b9dfc6;
  background: var(--green-soft);
}

.wallet-panel-tools select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

td.mint-cell {
  max-width: 210px;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
}

.decision,
.signal {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.decision.accepted,
.signal.on {
  background: var(--green-soft);
  color: var(--green);
}

.decision.rejected,
.signal.off {
  background: var(--red-soft);
  color: var(--red);
}

.signal.strategy {
  max-width: 130px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: #eef4ff;
  color: #1d4ed8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
}

.side-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.trade-panel {
  grid-column: 1 / -1;
}

.config-list,
.strategy-config-list {
  display: grid;
  margin: 0;
  padding: 8px 16px 16px;
  gap: 8px;
}

.config-list div,
.strategy-config-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  min-height: 26px;
  align-items: center;
}

.config-list dt,
.strategy-config-list dt {
  color: var(--muted);
  font-size: 12px;
}

.config-list dd,
.strategy-config-list dd {
  margin: 0;
  max-width: 190px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-list,
.activity-list,
.wallet-box {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.trade-panel .trade-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-box {
  gap: 6px;
}

.trade-item,
.activity-item,
.wallet-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.activity-item {
  border-left-width: 4px;
}

.activity-item.success {
  border-color: #bce8d2;
  border-left-color: var(--green);
  background: #f6fffa;
}

.activity-item.success strong {
  color: #075f3c;
}

.activity-item.warning {
  border-color: #f4d79d;
  border-left-color: var(--amber);
  background: #fffaf0;
}

.activity-item.warning strong {
  color: #7b4700;
}

.activity-item.error {
  border-color: #f3b9b4;
  border-left-color: var(--red);
  background: #fff7f6;
}

.activity-item.error strong {
  color: #8c1d14;
}

.activity-item.neutral {
  border-left-color: #8fa0b3;
}

.wallet-list-large .wallet-item {
  padding-left: 42px;
}

.wallet-row {
  cursor: pointer;
}

.wallet-row:focus-within,
.wallet-row:hover {
  border-color: #b9c9dc;
  background: #f8fbff;
}

.wallet-item-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 10px;
}

.wallet-item-compact .wallet-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.strategy-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.strategy-head {
  display: grid;
  gap: 8px;
}

.strategy-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strategy-title-main {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.strategy-head-actions {
  display: grid;
  grid-template-columns: minmax(126px, 1.28fr) minmax(96px, 1fr) minmax(88px, 0.92fr);
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.strategy-head-actions .text-button,
.strategy-head-actions .text-link-button {
  justify-content: center;
  min-width: 0;
  padding-inline: 8px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-head-actions-two {
  grid-template-columns: minmax(148px, 1fr) minmax(106px, 0.72fr);
}

.strategy-panel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.strategies-page-panel .panel-head {
  align-items: flex-start;
}

.strategies-page-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.strategies-page-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.strategies-page-list .strategy-item {
  grid-template-rows: auto auto auto;
  min-width: 0;
  padding: 12px;
}

.strategies-page-list .strategy-head {
  align-content: start;
}

.strategy-head-actions-page {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strategies-page-list .strategy-config-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0;
  overflow: visible;
}

.strategies-page-list .strategy-config-list div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.strategies-page-list .strategy-config-list dt,
.strategies-page-list .strategy-config-list dd {
  min-width: 0;
}

.strategies-page-list .strategy-config-list dd {
  max-width: min(260px, 46vw);
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.strategy-title-row strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.strategy-badge.active {
  background: var(--green-soft);
  color: var(--green);
}

.strategy-badge.paused {
  background: var(--amber-soft);
  color: var(--amber);
}

.strategy-badge.limit {
  background: var(--red-soft);
  color: var(--red);
}

.strategy-badge.archived {
  background: #f3f4f6;
  color: var(--muted);
}

.strategy-status-button.start {
  border-color: #b9dfc6;
  color: var(--green);
}

.strategy-status-button.pause {
  border-color: #f0d7a6;
  color: var(--amber);
}

.strategy-wallet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.strategy-wallet-tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-wallet-tag.connected {
  border-color: #b9dfc6;
  background: var(--green-soft);
  color: var(--green);
}

.strategy-wallet-tag.disconnected {
  border-color: #f0d7a6;
  background: #fff8e9;
  color: #8a6500;
}

.strategy-wallet-tag.archived {
  background: #f3f4f6;
  color: var(--muted);
}

.strategy-item .strategy-config-list {
  padding: 0;
}

.strategy-volume-limit {
  display: grid;
  gap: 6px;
  padding: 8px 0 2px;
}

.strategy-volume-limit-head,
.strategy-volume-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.strategy-volume-limit-head span,
.strategy-volume-meta {
  color: var(--muted);
  font-size: 12px;
}

.strategy-volume-limit-head strong {
  font-size: 12px;
}

.strategy-volume-limit-tools {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.strategy-limit-lock {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.strategy-limit-refresh {
  min-height: 28px;
  padding-inline: 9px;
  font-size: 12px;
}

.strategy-volume-limit.locked .strategy-volume-track span {
  background: var(--red);
}

.strategy-volume-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
}

.strategy-volume-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.strategy-performance-modal-body,
.strategy-performance-body {
  display: grid;
  gap: 12px;
}

.performance-range-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.strategy-performance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.performance-metric-card {
  display: grid;
  gap: 6px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.performance-metric-card span,
.performance-result-row span {
  color: var(--muted);
  font-size: 12px;
}

.performance-metric-card strong {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 18px;
}

.performance-usd-equivalent {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.performance-wallet-row .performance-usd-equivalent {
  margin-left: 4px;
  font-size: 10px;
}

.performance-metric-card.positive strong,
.performance-result-row .positive {
  color: var(--green);
}

.performance-metric-card.negative strong,
.performance-result-row .negative {
  color: var(--red);
}

.performance-result-list {
  display: grid;
  gap: 6px;
}

.wallet-performance-pager {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-top: 2px;
}

.performance-section {
  display: grid;
  gap: 8px;
}

.performance-section.secondary {
  opacity: 0.92;
}

.performance-section-head {
  display: grid;
  gap: 2px;
}

.performance-section-head h3 {
  margin: 0;
  font-size: 13px;
}

.performance-transaction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.performance-transaction-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.performance-transaction-card.successful {
  border-color: #b9dfc6;
  background: var(--green-soft);
}

.performance-transaction-card.failed {
  border-color: #f0c2bf;
  background: var(--red-soft);
}

.performance-transaction-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.performance-transaction-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.performance-transaction-card dt {
  color: var(--muted);
  font-size: 12px;
}

.performance-transaction-card dd {
  margin: 0;
  font-weight: 800;
}

.performance-wallet-table {
  display: grid;
  gap: 6px;
}

.performance-wallet-count {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.performance-wallet-header,
.performance-wallet-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.3fr) minmax(132px, 0.9fr) minmax(118px, 0.78fr)
    minmax(130px, 0.85fr) minmax(78px, 0.48fr) minmax(58px, 0.4fr);
  gap: 10px;
  align-items: center;
}

.performance-wallet-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.performance-wallet-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  font-size: 12px;
}

.performance-wallet-row.inactive {
  background: #f8fafc;
  color: var(--muted);
}

.performance-wallet-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.performance-wallet-row strong,
.performance-wallet-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-wallet-row div span {
  color: var(--muted);
}

.performance-wallet-row .performance-wallet-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
}

.performance-wallet-balance-pill {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.performance-wallet-funding-status {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.performance-wallet-row .performance-wallet-balance {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
}

.performance-wallet-row .performance-wallet-balance b {
  color: var(--red);
  font-size: 11px;
}

.performance-wallet-status {
  font-size: 11px;
  font-weight: 800;
  text-transform: lowercase;
}

.performance-wallet-status.approved {
  color: var(--green);
}

.performance-wallet-status.disapproved,
.performance-wallet-status.not-approve {
  color: var(--red);
}

.performance-wallet-status.archived {
  color: var(--muted);
}

.performance-wallet-row .positive {
  color: var(--green);
  font-weight: 800;
}

.performance-wallet-row .negative {
  color: var(--red);
  font-weight: 800;
}

.performance-wallet-row .neutral {
  color: var(--muted);
  font-weight: 800;
}

.performance-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.performance-result-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.performance-result-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-item-compact .wallet-balance {
  grid-column: 1;
}

.wallet-item-compact .wallet-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
}

.wallet-list-header,
.wallet-row {
  display: grid;
  grid-template-columns: 28px minmax(240px, 1.35fr) minmax(112px, 0.5fr) minmax(132px, 0.58fr) minmax(92px, 0.42fr) minmax(144px, 0.58fr) minmax(328px, 0.9fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.wallet-list-header {
  padding: 0 12px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-row.wallet-item {
  padding: 10px 12px;
}

.wallet-cell {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.wallet-cell strong {
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.wallet-cell-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-select-cell {
  justify-items: center;
  padding-top: 4px;
}

.wallet-status-cell {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wallet-strategy-cell {
  align-content: start;
}

.wallet-strategy-tags {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.wallet-strategy-tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef6ff;
  color: #25577f;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-item.selected {
  border-color: #9fb3c8;
  background: #f6fbff;
}

.wallet-copy-button {
  flex: 0 0 auto;
  width: 32px;
  min-height: 32px;
  font-size: 16px;
}

.trade-item strong,
.activity-item strong,
.wallet-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-item span,
.activity-item span,
.wallet-item span {
  color: var(--muted);
  font-size: 12px;
}

.wallet-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.wallet-status.connected {
  background: var(--green-soft);
  color: var(--green);
}

.wallet-status.disconnected {
  background: var(--red-soft);
  color: var(--red);
}

.wallet-status.archived {
  background: #edf1f5;
  color: var(--muted);
}

.wallet-new-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-key {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.wallet-key-row {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 6px;
  align-items: center;
}

.wallet-solscan-link {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.wallet-solscan-link:hover,
.wallet-solscan-link:focus-visible {
  color: #075985;
  text-decoration: underline;
}

.wallet-item .wallet-name {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.wallet-delta.positive {
  color: var(--green);
}

.wallet-delta.negative {
  color: var(--red);
}

.wallet-delta.neutral {
  color: var(--muted);
}

.wallet-performance-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.wallet-performance-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wallet-performance-summary strong,
.wallet-performance-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-performance-address-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
  word-break: break-word;
}

.wallet-performance-address-link:hover,
.wallet-performance-address-link:focus-visible {
  color: #075985;
  text-decoration: underline;
}

.wallet-performance-strategies {
  justify-content: flex-start;
}

.wallet-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.wallet-row > .wallet-actions .text-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 7px;
  font-size: 11px;
  white-space: nowrap;
}

.wallet-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.wallet-select-all,
.wallet-select-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.wallet-select-row {
  position: absolute;
  top: 12px;
  left: 12px;
}

.wallet-row .wallet-select-row {
  position: static;
}

.wallet-select-all input,
.wallet-select-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.wallet-selection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.wallet-selected-balance {
  font-weight: 700;
}

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

.wallet-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.wallet-form-title {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.wallet-form-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wallet-form-headline .text-button {
  min-height: 32px;
  padding-inline: 12px;
}

.wallet-form-headline .text-button.active {
  border-color: #9fb3c8;
  background: #eef6ff;
  color: #075985;
}

.wallet-form-grid {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
}

.wallet-form-grid-single {
  grid-template-columns: minmax(120px, 1fr);
}

.wallet-list-message {
  margin: 0;
  padding: 0 12px 8px;
}

.wallet-create-page-panel {
  overflow: hidden;
}

.wallet-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.wallet-create-grid .wallet-form {
  border-top: 1px solid var(--line);
}

.wallet-generator-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.wallet-generator-tab {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.wallet-generator-tab.active {
  border-color: #9fb7d2;
  background: #edf6ff;
  color: var(--text);
}

.wallet-generator-panel {
  display: grid;
  gap: 10px;
}

.wallet-history-actions,
.wallet-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wallet-history-search {
  display: block;
}

.wallet-history-search input {
  width: 100%;
  min-width: 0;
}

.wallet-generated-history-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.wallet-generated-history-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfdff;
}

.wallet-generated-history-main,
.wallet-generated-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.wallet-generated-history-main strong,
.wallet-generated-history-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-generated-history-main span,
.wallet-generated-history-meta {
  color: var(--muted);
  font-size: 12px;
}

.wallet-generated-history-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.wallet-generated-export-button {
  min-height: 28px;
  padding-inline: 10px;
}

.wallet-export-confirm {
  display: grid;
  gap: 10px;
}

.wallet-export-result {
  display: grid;
  gap: 10px;
}

.wallet-export-result textarea {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.wallet-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.wallet-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
}

.wallet-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.wallet-tab.active {
  border-color: #9fb3c8;
  background: #eef6ff;
  color: #075985;
}

#walletSearchInput {
  grid-column: 1 / 3;
  grid-row: 1;
}

#walletLimitSelect {
  grid-column: 3;
  grid-row: 1;
}

#walletStatusFilter {
  grid-column: 1;
  grid-row: 2;
  width: fit-content;
}

#walletStrategyFilter {
  grid-column: 2;
  grid-row: 2;
  min-width: 150px;
  width: fit-content;
}

#walletSortSelect {
  grid-column: 3;
  grid-row: 2;
  width: fit-content;
}

.wallet-tools input,
.wallet-tools select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.wallet-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.wallet-page-grid > aside.panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wallet-page-grid > aside.panel .panel-head {
  grid-column: 1 / -1;
}

.wallet-list-large {
  display: grid;
  gap: 8px;
  overflow-x: hidden;
  padding: 12px;
}

.wallet-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.wallet-pager-actions {
  display: flex;
  gap: 8px;
}

.withdraw-logs-panel {
  display: grid;
  gap: 0;
  padding: 12px;
}

.withdraw-logs-panel.hidden {
  display: none;
}

.withdraw-logs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.withdraw-logs-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.withdraw-logs-table td {
  vertical-align: middle;
}

.withdraw-log-address,
.withdraw-log-link {
  max-width: 150px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
}

.withdraw-log-link {
  display: inline-block;
  color: #075985;
  font-weight: 700;
  text-decoration: none;
}

.withdraw-log-link:hover {
  text-decoration: underline;
}

.launch-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.launch-pager-actions {
  display: flex;
  gap: 8px;
}

.wallet-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wallet-form input,
.wallet-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.wallet-form textarea {
  min-height: 92px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

input::placeholder,
textarea::placeholder {
  color: #87919d;
  opacity: 1;
}

.form-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

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

.form-message.error {
  color: var(--red);
}

.form-message.ok {
  color: var(--green);
}

.activity-panel {
  margin-top: 16px;
}

.top-activity-panel.activity-panel {
  margin-top: 0;
}

.activity-strategy-summary {
  display: grid;
  grid-template-columns: minmax(520px, 0.95fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.activity-strategy-summary .empty {
  grid-column: 1 / -1;
  padding: 8px;
}

.activity-strategy-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.activity-strategy-stats article {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.activity-strategy-stats span,
.activity-active-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-strategy-stats strong {
  font-size: 18px;
}

.activity-strategy-stats small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-balance-card {
  align-content: start;
}

.activity-strategy-stats .positive {
  color: var(--green);
}

.activity-strategy-stats .muted-count {
  color: var(--muted);
}

.activity-active-strategies {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.activity-strategy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.activity-strategy-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-strategy-chip.active {
  background: var(--green-soft);
  color: var(--green);
}

.activity-strategy-chip.paused {
  background: var(--amber-soft);
  color: var(--amber);
}

.activity-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.activity-meta,
.activity-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  align-items: center;
}

.activity-pill,
.activity-mint {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-strategy-pill {
  border-color: #c7d7fe;
  background: #eef4ff;
  color: #3157a5;
}

.activity-wallet-link {
  border-color: #bce8d2;
  background: var(--green-soft);
  color: var(--green);
}

.activity-wallet-link:hover,
.activity-wallet-link:focus-visible {
  border-color: var(--green);
  text-decoration: underline;
}

.activity-wallet-pill.approved {
  border-color: #bce8d2;
  background: var(--green-soft);
  color: var(--green);
}

.activity-wallet-pill.not-approved {
  border-color: #f3b9b4;
  background: var(--red-soft);
  color: var(--red);
}

.activity-wallet-pill.archived {
  border-color: var(--line);
  background: #edf1f5;
  color: var(--muted);
}

.activity-wallet-pill.unknown {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.activity-wallet-link.approved:hover,
.activity-wallet-link.approved:focus-visible {
  border-color: var(--green);
}

.activity-wallet-link.not-approved:hover,
.activity-wallet-link.not-approved:focus-visible {
  border-color: var(--red);
}

.activity-wallet-link.archived:hover,
.activity-wallet-link.archived:focus-visible,
.activity-wallet-link.unknown:hover,
.activity-wallet-link.unknown:focus-visible {
  border-color: #9fb3c8;
}

.dashboard-analytics-panel {
  margin-bottom: 16px;
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #fbfcfd;
}

.analytics-card {
  display: grid;
  min-width: 0;
  min-height: clamp(320px, 36vh, 460px);
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.analytics-card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-card-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.analytics-card-head p,
.analytics-card-main span,
.analytics-card-main small,
.analytics-donut-meta span,
.analytics-donut-meta small,
.analytics-more {
  color: var(--muted);
  font-size: 12px;
}

.analytics-kpi {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.analytics-kpi.positive {
  color: var(--green);
}

.analytics-kpi.warning {
  color: var(--amber);
}

.analytics-kpi.negative {
  color: var(--red);
}

.analytics-card-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.analytics-card-main strong {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-card-main span,
.analytics-donut-meta span {
  font-weight: 800;
  text-transform: uppercase;
}

.analytics-bars,
.analytics-limit-list,
.analytics-donut-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.analytics-bar-row,
.analytics-limit-row {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.analytics-bar-link {
  border-radius: 8px;
  padding: 2px;
  color: inherit;
  text-decoration: none;
}

.analytics-bar-link:hover,
.analytics-bar-link:focus-visible {
  outline: 0;
  background: #f8fafc;
}

.analytics-bar-link:focus-visible {
  box-shadow: 0 0 0 2px rgba(11, 122, 75, 0.22);
}

.analytics-limit-row {
  position: relative;
}

.analytics-limit-button {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 2px 78px 2px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.analytics-limit-button:hover,
.analytics-limit-button:focus-visible {
  outline: 0;
  background: #f8fafc;
}

.analytics-limit-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(11, 122, 75, 0.22);
}

.analytics-limit-tools {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.analytics-limit-refresh {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  min-height: 24px;
  padding-inline: 8px;
  font-size: 11px;
}

.analytics-bar-meta,
.analytics-limit-name,
.analytics-limit-value,
.analytics-donut-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analytics-bar-meta span,
.analytics-limit-name strong,
.analytics-limit-value strong,
.analytics-donut-row span,
.analytics-donut-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-bar-meta span,
.analytics-limit-value span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-bar-meta strong,
.analytics-limit-value strong,
.analytics-donut-row strong {
  font-size: 12px;
}

.analytics-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e9edf2;
}

.analytics-track span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #94a3b8;
}

.analytics-track span.accepted,
.analytics-track span.positive {
  background: #0b7a4b;
}

.analytics-track span.rejected,
.analytics-track span.danger {
  background: #b42318;
}

.analytics-track span.executed {
  background: #2563eb;
}

.analytics-track span.warning {
  background: #a15c00;
}

.analytics-limit-name strong {
  font-size: 13px;
}

.analytics-limit-name span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.analytics-limit-name span.active {
  background: var(--green-soft);
  color: var(--green);
}

.analytics-limit-name span.paused {
  background: var(--amber-soft);
  color: var(--amber);
}

.analytics-limit-name span.limit {
  background: var(--red-soft);
  color: var(--red);
}

.analytics-more {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.analytics-wallet-chart {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.analytics-donut {
  position: relative;
  display: grid;
  width: 126px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
}

.analytics-donut::after {
  position: absolute;
  inset: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  content: "";
}

.analytics-donut span {
  position: relative;
  z-index: 1;
  max-width: 74px;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
}

.analytics-donut-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.analytics-donut-meta strong {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-donut-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.analytics-donut-row i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.analytics-donut-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.empty {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.error-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #f0a4a0;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
}

.error-panel pre {
  overflow-x: auto;
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.modal {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

#strategyPerformanceModal {
  width: min(1040px, calc(100% - 28px));
}

.modal::backdrop {
  background: rgba(18, 20, 23, 0.42);
}

.modal-panel {
  display: grid;
  max-height: calc(100vh - 40px);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-body {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
}

.modal-body label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.modal-body input,
.modal-body select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.strategy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.strategy-field-full {
  grid-column: 1 / -1;
}

.strategy-wallet-fields {
  display: grid;
  gap: 8px;
}

.strategy-wallet-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.strategy-editor-tools:not(.hidden) {
  display: flex;
  align-items: center;
}

.strategy-linked-wallets {
  display: grid;
  gap: 4px;
}

.strategy-linked-wallet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
}

.strategy-linked-wallet-row strong,
.strategy-linked-wallet-row span,
.strategy-linked-wallet-empty {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-linked-wallet-row.connected {
  border-color: #b9dfc6;
  background: var(--green-soft);
}

.strategy-linked-wallet-row.disconnected {
  border-color: #f0d7a6;
  background: #fff8e9;
}

.strategy-linked-wallet-row.archived {
  background: #f3f4f6;
}

.strategy-wallet-options {
  display: grid;
  gap: 6px;
}

.strategy-wallet-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fbfcfd;
  color: var(--text);
  cursor: pointer;
}

.strategy-wallet-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.strategy-wallet-option-body {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.8fr);
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.strategy-wallet-option-body strong,
.strategy-wallet-option-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-wallet-option-body strong {
  font-size: 13px;
}

.strategy-wallet-option-body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.strategy-wallet-option-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.strategy-wallet-option-address {
  max-width: 150px;
}

.strategy-wallet-option-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.strategy-wallet-option-badge.balance {
  background: #f8fafc;
  color: var(--text);
}

.strategy-wallet-option-badge.approved {
  background: var(--green-soft);
  color: var(--green);
}

.strategy-wallet-option-badge.not-approve {
  background: var(--red-soft);
  color: var(--red);
}

.strategy-wallet-empty.empty {
  padding: 10px 0;
  text-align: left;
}

.wallet-dialog-modal .modal-body {
  gap: 12px;
}

.wallet-dialog-field {
  display: grid;
  gap: 6px;
}

.wallet-dialog-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wallet-dialog-field input,
.wallet-dialog-field textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.wallet-dialog-field textarea {
  min-height: 92px;
  resize: vertical;
}

.text-button.danger {
  border-color: #f0a4a0;
  color: var(--red);
}

.text-button.danger:hover {
  border-color: var(--red);
}

.withdraw-balance-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.withdraw-recipients {
  display: grid;
  gap: 8px;
}

.withdraw-recipient {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 92px auto;
  gap: 8px;
  align-items: center;
}

.hidden {
  display: none;
}

@media (max-width: 1240px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-card-wide {
    grid-column: 1 / -1;
  }

  .strategies-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-list-header {
    display: none;
  }

  .wallet-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .wallet-address-cell,
  .wallet-balance-cell,
  .wallet-token-cell,
  .wallet-status-cell,
  .wallet-strategy-cell,
  .wallet-row > .wallet-actions {
    grid-column: 2;
  }

  .wallet-row > .wallet-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .main-nav-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-card-wide {
    grid-column: auto;
  }

  .strategies-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .launch-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-list {
    grid-template-columns: 1fr;
  }

  .wallet-page-grid {
    grid-template-columns: 1fr;
  }

  .wallet-summary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wallet-page-grid > aside.panel {
    grid-template-columns: 1fr;
  }

  .wallet-create-grid {
    grid-template-columns: 1fr;
  }

  .wallet-form-grid {
    grid-template-columns: 1fr;
  }

  .launch-panel-tools,
  .launch-pager,
  .wallet-performance-pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .wallet-tools {
    grid-template-columns: 1fr;
  }

  #walletSearchInput,
  #walletLimitSelect,
  #walletStatusFilter,
  #walletStrategyFilter,
  #walletSortSelect {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .wallet-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-selection-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  #walletSearchInput,
  #walletLimitSelect,
  #walletStatusFilter,
  #walletSortSelect {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .withdraw-recipient {
    grid-template-columns: 1fr;
  }

  .strategy-fields {
    grid-template-columns: 1fr;
  }

  .strategy-performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-wallet-option-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .side-stack,
  .strategies-page-list,
  .trade-panel .trade-list {
    grid-template-columns: 1fr;
  }

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

  .strategy-performance-grid,
  .activity-strategy-summary,
  .analytics-wallet-chart,
  .performance-range-controls,
  .performance-transaction-grid,
  .performance-result-row {
    grid-template-columns: 1fr;
  }

  .analytics-card {
    min-height: 0;
  }

  .analytics-donut {
    justify-self: center;
  }

  .performance-wallet-header {
    display: none;
  }

  .performance-wallet-row {
    grid-template-columns: 1fr;
  }

  .performance-wallet-row > span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .performance-wallet-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }
}

@media (max-width: 620px) {
  .topbar,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .main-nav-panel {
    grid-template-columns: 1fr;
  }

  .wallet-panel .panel-head {
    grid-template-columns: 1fr;
  }

  .wallet-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-panel-tools {
    justify-content: flex-start;
  }

  .launch-summary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .launch-summary-item:last-child {
    border-bottom: 0;
  }

  th,
  td {
    padding: 10px;
  }
}
