/* Shared by the login page and the app shell. Mobile-first, dark only. */
:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --border: #333;
  --text: #ececec;
  --muted: #a0a0a0;
  --accent: #f2a541;
  --on-accent: #121212;
  --danger: #ff8a80;
  --tabbar-height: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2 { margin: 0; line-height: 1.2; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* Login */
body.login { display: grid; place-items: center; padding: 16px; }

.login-card { width: 100%; max-width: 360px; }
.login-card h1 { margin-bottom: 24px; text-align: center; font-size: 2rem; }
.login-card form { display: grid; gap: 8px; }
.login-card label { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }
.login-card input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.login-card button { margin-top: 16px; min-height: 48px; }
.error { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: #3a1d1d; color: var(--danger); }

/* App shell */
body.shell { padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.25rem; }
.topbar form { margin: 0; }

.view { padding: 16px; }
.view h2 { margin-bottom: 8px; font-size: 1.5rem; }
.placeholder { color: var(--muted); }

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.tabbar a {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar a[aria-disabled="true"] { opacity: 0.5; }
