:root {
  color-scheme: dark;
  --bg: #101418;
  --surface: #171d22;
  --surface-2: #20272d;
  --line: #303a42;
  --text: #f4f7f8;
  --muted: #9ba8af;
  --good: #44d28b;
  --bad: #ff6b6b;
  --accent: #57b8ff;
  --warn: #ffca58;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  justify-content: center;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.status-strip {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 0.75fr;
  gap: 8px;
  margin-bottom: 12px;
}

.status-strip > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.status-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.tab.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: #4c5963;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 10px;
  color: var(--muted);
  font-size: 12px;
}

.section-head h2 {
  color: var(--text);
}

.list {
  display: grid;
  gap: 8px;
}

.signal-card,
.funding-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.signal-card {
  padding: 12px;
}

.signal-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.symbol {
  font-size: 19px;
  font-weight: 800;
}

.spread {
  color: var(--good);
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

.route {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.leg {
  min-width: 0;
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px;
}

.leg span,
.meta {
  color: var(--muted);
  font-size: 12px;
}

.leg strong {
  display: block;
  margin: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.positive {
  color: var(--good);
}

.negative {
  color: var(--bad);
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.funding-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
}

.funding-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.rate {
  font-weight: 800;
  text-align: right;
}

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

.exchange-chip {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.exchange-chip input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-row,
.switch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  margin-bottom: 8px;
}

.settings-row.stacked {
  grid-template-columns: 1fr;
}

.settings-row input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}

.settings-row input[type="number"],
.settings-row input[type="url"],
.settings-row select {
  width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 8px;
}

.settings-row input[type="url"],
.settings-row select {
  width: 100%;
}

.settings-row small {
  color: var(--muted);
  line-height: 1.35;
}

.premium-row strong {
  color: var(--accent);
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3a4249;
  cursor: pointer;
}

.switch span::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: white;
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::before {
  transform: translateX(22px);
}

.primary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #061018;
  font-weight: 800;
}

.fine-print {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 10px 2px 0;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}
