:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2420;
  --muted: #66706a;
  --line: #dcd8cf;
  --brand: #1f6f54;
  --brand-ink: #ffffff;
  --error: #a3312a;
  --error-bg: #fbeceb;
  --ok: #1f6f54;
  --ok-bg: #e7f3ee;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131714;
    --card: #1c221e;
    --ink: #eef1ee;
    --muted: #9aa59e;
    --line: #2f3832;
    --brand: #4fb08c;
    --brand-ink: #0d1410;
    --error: #f0a39d;
    --error-bg: #3a1f1d;
    --ok: #8fd4b7;
    --ok-bg: #1c3229;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.center { display: flex; flex-direction: column; justify-content: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
}
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 4px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }

form { margin-top: 18px; }
label { display: block; font-size: 0.9rem; font-weight: 600; margin: 14px 0 6px; }
input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
input:focus-visible, button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.hint { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }

.msg {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--error);
  background: var(--error-bg);
}
.msg.ok { color: var(--ok); background: var(--ok-bg); }

button { font: inherit; cursor: pointer; }
.primary {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.primary:disabled { opacity: 0.6; cursor: default; }
.link {
  background: none;
  border: 0;
  padding: 12px 4px;
  min-height: 44px;
  color: var(--brand);
  font-weight: 600;
}
#auth-switch { display: block; width: 100%; margin-top: 8px; text-align: center; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
