:root {
  --bg: #0e0f12; --card: #17191f; --line: #262a33;
  --text: #f2f3f5; --dim: #9aa2b1;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --pad: 16px;
}
@media (prefers-color-scheme: light) {
  :root { --bg:#f6f7f9; --card:#fff; --line:#e3e6eb; --text:#12141a; --dim:#5b6472; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, system-ui, sans-serif;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
#app { padding: var(--pad); max-width: 640px; margin: 0 auto; }
h1 { font-size: 1.3rem; margin: 0 0 12px; }
h2 { font-size: 1rem; margin: 24px 0 8px; color: var(--dim); font-weight: 600; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: var(--pad); margin-bottom: 12px;
}
.big { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.dim { color: var(--dim); font-size: 0.875rem; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.bar.under > i { background: var(--warn); }
.flag { color: var(--warn); font-size: 0.8rem; }
.guess::after { content: " ~"; color: var(--warn); }
#tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs button {
  flex: 1; padding: 14px 4px; background: none; border: 0;
  color: var(--dim); font: inherit; font-size: 0.75rem;
}
#tabs button[aria-current="page"] { color: var(--text); font-weight: 600; }
button.primary {
  width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: var(--text); color: var(--bg); font: inherit; font-weight: 600;
}
button.secondary { background: var(--line); color: var(--text); }
input, select {
  width: 100%; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; margin-bottom: 8px;
}
ul.entries { list-style: none; padding: 0; margin: 0; }
ul.entries li {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
ul.entries li:last-child { border-bottom: 0; }
