:root {
  --bg: #111418;
  --card: #1b1f26;
  --card-2: #232834;
  --line: #2c3340;
  --text: #eef1f5;
  --muted: #9aa4b2;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --good: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0.9rem calc(env(safe-area-inset-bottom) + 5rem);
  max-width: 640px;
  margin: 0 auto;
}

h1 { font-size: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.error { color: var(--danger); }
.block { display: block; }

.screen { padding-top: 0.8rem; }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.topbar h1 { flex: 1; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.9rem;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  color: var(--text);
  background: var(--card-2);
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary-2); color: #fff; }
.btn-primary:active { background: var(--primary-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-lg { width: 100%; font-size: 1.1rem; padding: 0.95rem; min-height: 52px; }

/* Inputs */
input, textarea, select {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}

/* Login + home */
#login-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
#home-status { margin-top: 0.5rem; }
.btn + .btn { margin-top: 0; }
