:root {
  --bg: #0b1020;
  --card: #0f172a;
  --muted: #8b95a7;
  --text: #e6eaf2;
  --accent: #4f46e5;
  --good: #10b981;
  --bad: #ef4444;
  --shadow: rgba(0,0,0,0.25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body, #app { height: 100%; }
body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -10%, #1e293b 0%, var(--bg) 50%);
}

.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px env(safe-area-inset-right) 16px;
  background: linear-gradient(180deg, rgba(15,23,42,.9), rgba(15,23,42,.6), transparent);
  backdrop-filter: blur(8px);
}

h1 { margin: 0; font-size: 18px; font-weight: 700; }
h2 { margin: 0 0 8px 0; font-size: 16px; }

.view { padding: 8px 12px 84px 12px; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  margin: 12px 0;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.right { text-align: right; }

.label { color: var(--muted); font-size: 12px; }
.value { font-size: 18px; font-weight: 600; }

.values { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.values li {
  display: flex; align-items: center; justify-content: space-between;
  background: #121c33; padding: 12px 14px; border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.values .chip {
  padding: 4px 8px; border-radius: 999px; font-size: 12px;
  background: rgba(79,70,229,.15); color: #c7d2fe;
}

.tip { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(15,23,42,.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid #24334f;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 10px 4px; border: 0; background: transparent; color: var(--muted);
  font-size: 18px;
}
.tab span { font-size: 11px; }
.tab.active { color: var(--text); font-weight: 600; }

.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 10px 14px;
  background: var(--accent); color: white; font-weight: 600;
  box-shadow: 0 6px 18px rgba(79,70,229,.35);
}
.btn.small { font-size: 12px; padding: 8px 10px; }

.tiny { font-size: 11px; }
.muted { color: var(--muted); }

/* iOS style toggle (auto switch) */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { display: none; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #2a3550;
  transition: .2s; border-radius: 999px;
}
.slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: white; border-radius: 999px; transition: .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
input:checked + .slider {
  background: #22c55e; /* ON = green */
}
input:checked + .slider:before { transform: translateX(20px); }

/* Pull-to-refresh hint (simple) */
body.pull .app-header { background: #0f172a; }

/* Orange highlight for positive (import) */
.import {
  color: orange;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Auto mode: imports green instead of orange */
.auto-on .import {
  background: #22c55e; /* green */
  color: white;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal .card {
  max-width: 300px;
  width: 100%;
}
