:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #23221e;
  --soft: #6b6a63;
  --line: #e4e3dc;
  --accent: #1f6f50;
  --accent-ink: #ffffff;
  --warn: #b5532f;
  --chip: #eeede7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151513;
    --card: #1f1f1c;
    --ink: #ecebe6;
    --soft: #a3a29a;
    --line: #34332f;
    --accent: #4fb489;
    --accent-ink: #0d1a14;
    --warn: #e08a63;
    --chip: #2a2a26;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 calc(72px + env(safe-area-inset-bottom));
}

header.top {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
header.top h1 { font-size: 15px; font-weight: 600; color: var(--soft); margin: 0; letter-spacing: .02em; }
header.top button { background: none; border: 0; color: var(--soft); font-size: 15px; cursor: pointer; padding: 4px; }

main { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 12px 0;
}
.eyebrow { font-size: 13px; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 4px; }
.headline { font-size: 26px; line-height: 1.25; font-weight: 650; margin: 0 0 6px; }
.muted { color: var(--soft); }
.chip {
  display: inline-block;
  background: var(--chip);
  color: var(--soft);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  margin: 2px 4px 2px 0;
}

/* Notion-Inhalt */
.doc h1, .doc h2, .doc h3 { line-height: 1.3; margin: 22px 0 6px; }
.doc h1 { font-size: 22px; }
.doc h2 { font-size: 19px; }
.doc h3 { font-size: 17px; }
.doc > :first-child { margin-top: 0; }
.doc p { margin: 6px 0; }
.doc ul, .doc ol { margin: 6px 0; padding-left: 22px; }
.doc li { margin: 3px 0; }
.doc a { color: var(--accent); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.doc blockquote, .doc .callout { border-left: 3px solid var(--line); margin: 8px 0; padding: 2px 12px; color: var(--soft); }
.doc .todo { list-style: none; margin-left: -22px; }
.doc .todo.done { color: var(--soft); text-decoration: line-through; }
.table-wrap { overflow-x: auto; margin: 8px 0; -webkit-overflow-scrolling: touch; }
.doc table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.doc td, .doc th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--chip); font-weight: 600; }

/* Buttons & Formulare */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button.btn, a.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
button.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.btn.selected { border-color: var(--accent); color: var(--accent); }
button.btn:disabled { opacity: .5; }
label { display: block; font-size: 14px; color: var(--soft); margin: 12px 0 4px; }
input[type=text], input[type=url], input[type=password], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 84px; resize: vertical; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggles button { font: inherit; font-size: 14px; border-radius: 999px; padding: 5px 12px; border: 1px solid var(--line); background: var(--card); color: var(--soft); cursor: pointer; }
.toggles button.on { border-color: var(--accent); color: var(--accent); background: var(--chip); }

.list-item { padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child, .eyebrow + .list-item { border-top: 0; padding-top: 0; }
.list-item .title { font-weight: 600; }
.status-Vorschlag, .status-Neu { color: var(--warn); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* Navigation unten (iPhone/iPad) */
nav.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  flex: 1;
  max-width: 180px;
  background: none;
  border: 0;
  color: var(--soft);
  font: inherit;
  font-size: 12px;
  padding: 8px 0 10px;
  cursor: pointer;
}
nav.tabs button span { display: block; font-size: 22px; line-height: 1.2; }
nav.tabs button.active { color: var(--accent); font-weight: 600; }

/* Login */
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
.error { color: var(--warn); font-size: 15px; min-height: 22px; margin-top: 8px; }

@media (min-width: 900px) {
  body { font-size: 17px; }
  .headline { font-size: 30px; }
}
