:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --text: #000000;
  --text-2: rgba(60, 60, 67, 0.62);
  --separator: rgba(60, 60, 67, 0.14);
  --accent: #007aff;
  --btn: #6e6e73;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #ffffff;
    --text-2: rgba(235, 235, 245, 0.62);
    --separator: rgba(84, 84, 88, 0.6);
    --accent: #0a84ff;
    --btn: #48484a;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 56px)
    calc(env(safe-area-inset-right, 0px) + 16px)
    calc(env(safe-area-inset-bottom, 0px) + 40px)
    calc(env(safe-area-inset-left, 0px) + 16px);
}
h1 {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
h2 {
  margin: 32px 0 12px;
  font-size: 22px;
  font-weight: 700;
}
.apps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-rows: 1fr; /* alle Karten gleich hoch */
  gap: 12px;
}
.apps > li { display: flex; }
/* Jede Karte ist gleich aufgebaut: Kopf (Icon, Name, Beschreibung) und unten eine Knopfzeile */
.app {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, filter 120ms ease;
}
.app:has(.btn-open:active) { transform: scale(0.985); filter: brightness(0.94); }
.app-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-head img {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  box-shadow: 0 0 0 0.5px var(--separator);
}
.app-head img { background: var(--bg); object-fit: contain; }
/* Platzhalter für Seiten ohne eigenes Icon */
.app-letter {
  flex: none;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--btn);
  color: #fff;
  font-size: 26px;
  font-weight: 600;
}
.app-text { flex: 1; min-width: 0; }
.app-name {
  display: block;
  font-size: 19px;
  font-weight: 600;
}
.app-desc {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: var(--text-2);
}
.app-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--btn);
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
    /* Der Öffnen-Knopf macht die ganze Karte anklickbar */
.btn-open::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
/* Weitere Knöpfe liegen darüber und bleiben einzeln anklickbar */
.btn-more {
  position: relative;
  z-index: 1;
  padding: 0 10px;
  font-weight: 400;
  color: var(--text-2);
  background: none;
}
.btn-more:hover { color: var(--text); }
.btn-more:active { opacity: 0.6; }
.intro {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 16px;
}
.intro p { margin: 0; }
.intro p + p { margin-top: 10px; }
.intro strong { color: var(--text); font-weight: 600; }
a.inline { color: var(--accent); text-decoration: none; }
a.inline:hover { text-decoration: underline; }
footer {
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--text); }
.sub { margin: 0; color: var(--text-2); font-size: 15px; }
.sub a { color: var(--accent); text-decoration: none; }
/* Kompakte Liste für alte Experimente */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.list li + li { border-top: 0.5px solid var(--separator); }
.list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
}
.list a:active { background: var(--separator); }
.list .n { flex: none; font-weight: 600; }
.list .d { flex: 1; min-width: 0; color: var(--text-2); font-size: 15px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── team: Navigation, Formulare, Konto ─── */
main { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); }
.top { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; font-size: 15px; }
.top a { color: var(--text-2); text-decoration: none; }
.top a:hover { color: var(--text); }
.top .brand { color: var(--text); font-weight: 700; font-size: 17px; }
.top .spacer { flex: 1; }
.top form { margin: 0; }
.linkish { padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--text); }
.card { padding: 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.auth { max-width: 380px; margin: 12vh auto 0; }
.form { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.form label { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.form input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--separator); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit;
}
.form input:focus { outline: 3px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form .btn { margin-top: 16px; }
button.btn { border: 0; font-family: inherit; cursor: pointer; }
.btn.primary { min-height: 44px; background: var(--accent); }
.btn.small { min-height: 30px; padding: 0 14px; font-size: 14px; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.notice { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.notice.error { background: rgba(255, 59, 48, 0.14); color: #d70015; }
.notice.ok { background: rgba(52, 199, 89, 0.16); color: #248a3d; }
@media (prefers-color-scheme: dark) {
  .notice.error { color: #ff6961; }
  .notice.ok { color: #30d158; }
}
.foot { margin-top: 24px; text-align: center; font-size: 13px; }
.foot a { color: var(--text-2); text-decoration: none; }
.devices li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.devices form { margin: 0; }
.dev { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dev .n { font-weight: 600; }
.dev .d { font-size: 13px; color: var(--text-2); }
.tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }
.after { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .app { transition: none; } }
