@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #0B0F14;
  --surface: #121822;
  --surface-2: #182130;
  --border: #232C38;
  --text: #E6EDF3;
  --text-dim: #8A97A6;
  --up: #3ECF8E;
  --down: #F2545B;
  --accent: #E8A33D;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 88px;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* --- signature element: scrolling ticker tape --- */
.ticker-wrap {
  background: #000;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.ticker {
  display: inline-block;
  animation: scroll 30s linear infinite;
}
.ticker-wrap:hover .ticker { animation-play-state: paused; }
.ticker-item {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 0 22px;
  border-right: 1px solid var(--border);
}
.ticker-item .up { color: var(--up); }
.ticker-item .down { color: var(--down); }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

header.app-header {
  padding: 18px 16px 4px;
}
header.app-header h1 {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 2px;
}
header.app-header .disclaimer {
  font-size: 11px;
  color: var(--text-dim);
}

main {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.portfolio-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.portfolio-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 4px;
}
.portfolio-sub .up { color: var(--up); }
.portfolio-sub .down { color: var(--down); }

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 4px 0 8px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.row:last-child { border-bottom: none; }

.symbol {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 14px;
}
.sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}
.pill.buy { background: rgba(62,207,142,0.15); color: var(--up); }
.pill.sell { background: rgba(242,84,91,0.15); color: var(--down); }
.pill.hold { background: rgba(138,151,166,0.15); color: var(--text-dim); }

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-buy { background: var(--up); color: #06231A; }
.btn-sell { background: var(--down); color: #2B0508; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-amount-group { display: flex; gap: 6px; margin-top: 8px; }

input[type=text], input[type=number] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  width: 100%;
}

.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row input { flex: 1; }

.trade-log-item .amount { font-family: 'JetBrains Mono', monospace; }

/* fixed auto-trade control bar */
.auto-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auto-bar .label { font-size: 13px; font-weight: 600; }
.auto-bar .status { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.switch {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: 0.2s;
}
.slider:before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: 0.2s;
}
input:checked + .slider { background: rgba(232,163,61,0.25); border-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); background: var(--accent); }

.empty { color: var(--text-dim); font-size: 13px; text-align: center; padding: 12px 0; }
