:root {
  color-scheme: light;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 2px 0 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  color: #111827;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 750;
}

.status-pill {
  padding: 8px 12px;
  border: 1px solid #86efac;
  color: #166534;
  background: #ecfdf3;
  border-radius: 8px;
  font-weight: 750;
}

.layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
  align-items: start;
}

.pipeline-column {
  display: grid;
  gap: 14px;
}

.cuan-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.cuan-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cuan-title h2 {
  font-size: 28px;
}

.run-status {
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #ecfdf3;
  color: #047857;
  padding: 8px 14px;
  font-weight: 850;
}

.cuan-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.cuan-card {
  min-height: 150px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.cuan-card.highlight {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.cuan-card h3 {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.cuan-card strong {
  display: block;
  margin-top: 20px;
  color: #111827;
  font-size: 28px;
  line-height: 1.1;
}

.cuan-card p {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}

.equity-panel {
  border: 1px solid #d9e2ec;
  background: #ffffff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.copied-wallets {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
}

.equity-chart {
  width: 100%;
  height: 260px;
  display: block;
}

.chart-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #64748b;
  font-size: 12px;
}

.chart-line {
  fill: none;
  stroke: #16a34a;
  stroke-width: 4;
}

.chart-dot {
  fill: #16a34a;
}

.trade-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.panel {
  border: 1px solid #d9e2ec;
  background: #ffffff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header span {
  color: #64748b;
  font-size: 13px;
}

.score-note {
  background: #f8fafc;
}

.score-note .panel-header {
  margin-bottom: 10px;
}

.score-note-list {
  display: grid;
  gap: 9px;
}

.score-note-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.score-note-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.score-note-list strong {
  color: #111827;
}

.score-note-list span {
  color: #64748b;
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  padding: 10px 11px;
  font: inherit;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 7px;
  background: #2563eb;
  color: #ffffff;
  padding: 9px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  background: #e0f2fe;
  color: #075985;
  padding: 9px 13px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.button-link:hover {
  background: #bae6fd;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

button.secondary:hover {
  background: #cbd5e1;
}

button.danger {
  background: #dc2626;
}

button.danger:hover {
  background: #b91c1c;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #166534;
  font-size: 13px;
}

.wallet-list,
.ledger-list,
.copy-list,
.trade-list,
.paper-summary {
  display: grid;
  gap: 10px;
}

.scan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.scan-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.scan-actions span {
  color: #64748b;
  font-size: 13px;
}

.scan-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.scan-card strong {
  display: block;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.1;
}

.scan-card span {
  color: #64748b;
  font-size: 12px;
  text-transform: capitalize;
}

.wallet-row,
.ledger-row,
.copy-row,
.trade-row,
.paper-card {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  background: #fbfdff;
  border-radius: 8px;
  padding: 12px;
}

.wallet-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.wallet-title {
  color: #111827;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.wallet-address,
.wallet-meta,
.ledger-meta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.tag.candidate {
  background: #7c3aed;
}

.tag.observed {
  background: #0284c7;
}

.tag.qualified {
  background: #ca8a04;
}

.tag.trusted {
  background: #16a34a;
}

.tag.blocked {
  background: #dc2626;
}

.tag.stale {
  background: #64748b;
}

.ledger-panel {
  margin-top: 18px;
}

.copy-panel {
  margin-top: 18px;
  border-color: #bfdbfe;
  background: #f8fbff;
}

.copy-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #ffffff;
}

.trade-row {
  background: #ffffff;
}

.paper-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.paper-card {
  gap: 3px;
  padding: 10px;
  background: #f8fafc;
}

.paper-card strong {
  color: #111827;
  font-size: 18px;
}

.paper-card span {
  color: #64748b;
  font-size: 12px;
}

.pnl-positive {
  color: #16a34a;
  font-weight: 800;
}

.pnl-negative {
  color: #dc2626;
  font-weight: 800;
}

.copy-score {
  min-width: 74px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 10px;
  text-align: center;
  font-weight: 850;
}

.copy-score span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .layout,
  .trade-layout,
  .grid-2,
  .scan-summary,
  .paper-summary,
  .cuan-cards {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 26px;
  }

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