:root {
  --bg: #14171C;
  --surface: #1B1F26;
  --surface-2: #232833;
  --text: #ECEEF0;
  --text-muted: #8B93A1;
  --accent: #4FB6A8;
  --accent-2: #E8654C;
  --border: #2C323D;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: 0.02em; }

main#view {
  flex: 1; padding: 16px 16px 88px;
  max-width: 640px; margin: 0 auto; width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 600; }

.row { display: flex; flex-direction: column; gap: 10px; }

input, select, button {
  font: inherit;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
}
input::placeholder { color: var(--text-muted); }

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  background: var(--accent);
  color: #0D1210;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
button:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  width: auto;
}

.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text-muted); width: auto; }
.checkbox input { width: auto; padding: 0; }

.sets-list, .plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sets-list li, .plain-list li {
  padding: 10px 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.muted { color: var(--text-muted); }
.error { color: var(--accent-2); min-height: 1.2em; margin: 0; }

.auth {
  max-width: 360px; margin: 15vh auto 0; padding: 0 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.auth h1 { font-size: 1.4rem; margin-bottom: 4px; }
.auth form { display: flex; flex-direction: column; gap: 10px; }

.bottomnav {
  position: sticky; bottom: 0;
  display: flex; border-top: 1px solid var(--border);
  background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; text-align: center; padding: 14px 0;
  color: var(--text-muted); text-decoration: none; font-size: 0.85rem;
}
.bottomnav a.active { color: var(--accent); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
