:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2f81f7;
  --accent-hover: #1f6feb;
  --green: #3fb950;
  --red: #f85149;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f81f7, #8957e5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
}
.brand h1 { margin: 0; font-size: 22px; }
.tagline { margin: 0; color: var(--muted); font-size: 13px; }
.wallet-area { display: flex; align-items: center; gap: 10px; }
.wallet-status { font-size: 13px; color: var(--muted); font-family: monospace; }
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); background: transparent; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.execute {
  background: #22c55e;
  color: #052e16;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border: none;
}
.btn.execute:hover:not(:disabled) { background: #4ade80; }
.btn.execute-sell {
  background: #f87171;
  color: #450a0a;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border: none;
}
.btn.execute-sell:hover:not(:disabled) { background: #ef4444; }
#update-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fbbf24;
  color: #451a03;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 10px 12px;
}
#update-banner .btn {
  margin-left: 10px;
  padding: 6px 14px;
  font-size: 13px;
  background: #451a03;
  color: #fef3c7;
}
.btn.small-btn { padding: 8px 10px; font-size: 12px; flex: 0 0 auto; }
.btn.wallet-btn { display: block; width: 100%; margin: 8px 0; background: var(--card); border: 1px solid var(--border); }
.btn.wallet-btn:hover { border-color: var(--accent); background: var(--card); }
.hidden { display: none !important; }
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: min(360px, 90vw);
}
.modal-card h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.note { margin-top: 12px; line-height: 1.5; }
.error { color: var(--red); margin-top: 8px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  padding: 24px;
  flex: 1;
  align-items: start;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head h2 { margin: 0 0 12px; font-size: 18px; }
table.signals { width: 100%; border-collapse: collapse; font-size: 14px; }
table.signals th, table.signals td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
table.signals th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.signal-buy { color: var(--green); font-weight: 700; }
.signal-sell { color: var(--red); font-weight: 700; }
.signal-hold { color: var(--muted); font-weight: 700; }
.swap-row { margin-bottom: 12px; }
.swap-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.swap-row.inline { display: flex; align-items: center; gap: 10px; }
.swap-row.inline label { margin: 0; }
.swap-input { display: flex; gap: 8px; }
.swap-input select, .swap-input input, .swap-row.inline input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}
.swap-input select { flex: 0 0 110px; }
.swap-input input { flex: 1; min-width: 0; }
.flip { width: 100%; margin: 4px 0 12px; }
#quote-info { margin-top: 8px; line-height: 1.6; }
#swap-result a { color: var(--accent); }
footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
a { color: var(--accent); }
