:root {
  --bg: #f6f3ec; --card: #ffffff; --ink: #1f2a24; --muted: #6b716c; --line: #e3ded2;
  --accent: #2f6b4f; --accent-ink: #ffffff; --warn: #b4532a; --ok: #2f6b4f;
  --radius: 14px; --tabbar-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 17px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--warn); }

.topbar {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; background: var(--ink); color: #fff;
}
.brand { font-weight: 700; letter-spacing: .02em; }
.me { color: #fff; text-decoration: none; font-size: .95rem; opacity: .9; padding: 4px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; }

.main { max-width: 640px; margin: 0 auto; padding: 16px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }
.is-guest .main { padding-top: calc(env(safe-area-inset-top) + 32px); }

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

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; min-height: var(--tabbar-h); display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 600;
}
.tabbar a.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 12px; cursor: pointer; min-height: 48px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); width: 100%; }
input[type=password], input[type=text], input[type=number] {
  font: inherit; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 48px;
}
input:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }

.msg { padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; }
.msg-error { background: #fbe9e2; color: var(--warn); }
.msg-ok { background: #e3f1e8; color: var(--ok); }

/* Anmelden */
.login { max-width: 420px; margin: 0 auto; }
.login h1 { text-align: center; margin-bottom: 20px; }
.login-form { display: grid; gap: 14px; }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who-tile { position: relative; }
.who-tile input { position: absolute; opacity: 0; inset: 0; }
.who-tile span {
  display: flex; align-items: center; justify-content: center; min-height: 72px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--line); font-weight: 700; font-size: 1.1rem; cursor: pointer;
}
.who-tile input:checked + span { border-color: var(--accent); background: #e3f1e8; color: var(--accent); }
.who-tile input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.pin-label { font-weight: 600; margin-bottom: -8px; }
.pin { text-align: center; font-size: 1.8rem !important; letter-spacing: .6em; padding-left: .6em !important; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item > div { display: grid; gap: 2px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }

/* Einstellungen */
.page-title { margin: 4px 4px 14px; }
.group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; }
.group legend { font-weight: 700; padding: 0 6px; }
.hint { font-weight: 400; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.row-buttons form { flex: 1 1 200px; }
.row-buttons .btn { width: 100%; }
