:root {
  /* Welt: Papierliste am Küchentisch – warme Neutraltöne, ein Grün als Akzent, Heftrand als Signatur */
  --bg: #f7f4ee; --card: #fdfbf7; --raised: #efe9df; --ink: #1f1b16; --sec: #5e554a; --muted: #756c60;
  --line: rgba(31, 27, 22, .1); --accent: #2f6f5e; --accent-ink: #fff; --soft: #e6eee9;
  --warn: #b23b2a; --gold: #b8892a; --rand: #d99a93; --fill: #cfc6b8;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r: 12px; --gap: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161513; --card: #1c1a18; --raised: #262421; --ink: #efe9de; --sec: #aaa398; --muted: #8f897f;
          --line: rgba(239, 233, 222, .09); --accent: #6dbba3; --accent-ink: #10201b; --soft: #22302b;
          --warn: #e5705a; --gold: #d9ad52; --rand: #8a4b45; --fill: #4a463f; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45;
       padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent); }
h1 { font-size: 1.5rem; font-weight: 500; line-height: 1.2; margin: 0 0 4px; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 12px; }
b, strong { font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Kopf und Navigation */
.top { position: sticky; top: 0; z-index: 5; background: #1f2d3a; color: #f7f4ee;
       padding: env(safe-area-inset-top) 0 0; }
.brand { display: inline-block; color: inherit; text-decoration: none; font-weight: 600; padding: 12px 16px 4px; }
nav { display: flex; gap: 4px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { color: inherit; opacity: .75; text-decoration: none; white-space: nowrap; padding: 6px 10px;
        border-radius: 999px; font-size: .9rem; }
nav a b { display: inline-block; min-width: 1.3em; text-align: center; font-size: .75rem;
          background: rgba(255,255,255,.15); border-radius: 999px; margin-right: 2px; }
nav a.on { opacity: 1; background: rgba(255,255,255,.14); }
@media (prefers-color-scheme: dark) { .top { background: #12110f; color: var(--ink); border-bottom: 1px solid var(--line); } }

main { max-width: 760px; margin: 0 auto; padding: var(--gap); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--gap);
        margin-bottom: var(--gap); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* Formulare */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=tel], input[type=search], input[type=date],
input[type=datetime-local], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.btn { border: 1px solid var(--line); background: var(--card); padding: 10px 16px; border-radius: 10px;
       cursor: pointer; min-height: 44px; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease); }
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn.danger { color: var(--warn); }
.btn.on { background: var(--soft); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.kbd { font: 12px/16px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--line);
        border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; margin-left: 8px; white-space: nowrap; }
.btn.primary .kbd { color: inherit; border-color: currentColor; opacity: .7; }
@media (hover: none) { .kbd { display: none; } }
.feld { position: relative; }
.feld .unk { position: absolute; right: 6px; top: 26px; border: 0; background: none; color: var(--muted);
             font-size: .8rem; padding: 6px; cursor: pointer; }
.feld.unbekannt input, .feld.unbekannt select { opacity: .5; }
.feld.unbekannt .unk { color: var(--accent); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* Fortschritt */
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.stat b { display: block; font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); }

/* Fragen- und Namenskarte */
.frage { font-size: 1.4rem; font-weight: 500; line-height: 1.3; margin: 8px 0 12px; }
/* Signatur: Heftrand – eine feine Randlinie wie im Schulheft, nur an der Arbeitskarte */
.heft { position: relative; padding-left: 32px; }
.heft::before { content: ""; position: absolute; left: 16px; top: 0; bottom: 0; width: 1px; background: var(--rand); }
.aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.aktionen .primary { grid-column: 1 / -1; }
@media (min-width: 560px) { .aktionen { grid-template-columns: auto auto 1fr; } .aktionen .primary { grid-column: auto; justify-self: end; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--soft); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.vorname { font-size: 2.6rem; font-weight: 500; letter-spacing: -.02em; text-align: center; margin: 12px 0 4px; line-height: 1.1; }
.big-q { text-align: center; color: var(--muted); }
.notiert { list-style: none; padding: 0; margin: 10px 0 0; }
.notiert li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0;
              border-top: 1px solid var(--line); }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; }

/* Listen */
.liste { list-style: none; padding: 0; margin: 0; }
.liste > li { padding: 12px 0; border-top: 1px solid var(--line); }
.liste > li:first-child { border-top: 0; }
.item { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.item .name { font-weight: 500; }
.badge { display: inline-block; min-width: 24px; text-align: center; border-radius: 6px; padding: 1px 6px;
         font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); }
/* A ist die Priorität und trägt den Akzent; B und C bleiben neutral */
.badge.A { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge.B { background: var(--raised); color: var(--ink); }
.tag { font-size: .78rem; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--muted); }
.tel { white-space: nowrap; font-weight: 500; text-decoration: none; padding: 8px 12px; border-radius: 8px;
       background: var(--soft); }
details > summary { cursor: pointer; }
.ohne-nr { margin-top: 8px; color: var(--sec); font-size: .9rem; }

/* ABC */
.abc-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.abc-btns .btn { padding: 14px 8px; text-align: center; }
.abc-btns .btn b { display: block; font-size: 1.6rem; font-weight: 500; }
.swipe { touch-action: pan-y; transition: transform 180ms var(--ease); }
.swipe.go-A { transform: translateX(40px); } .swipe.go-C { transform: translateX(-40px); } .swipe.go-B { transform: translateY(-30px); }

/* Strukturleiter-Modus: groß und gut lesbar für das gemeinsame Durchgehen */
.sl .frage, .sl .kname { font-size: 1.8rem; }
.sl .leitfrage { font-size: 1.15rem; }
.leitfrage { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.leitsatz { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; margin: 10px 0; color: var(--muted); }
.kname { font-size: 1.4rem; font-weight: 500; }

/* Dashboard */
.funnel .stufe { display: grid; grid-template-columns: 9.5em 1fr 3em; gap: 8px; align-items: center; margin: 8px 0; font-size: .9rem; }
.funnel .stufe span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.funnel .bar > i { background: var(--fill); }
.funnel .key .bar > i { background: var(--accent); }
.funnel .key span { font-weight: 600; }
/* Moment: zehn Felder für zehn Rekrutierungsgespräche */
.ziel { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 12px 0; }
.ziel i { aspect-ratio: 1; border-radius: 6px; border: 1px solid var(--line); background: var(--raised); }
.ziel i.voll { background: var(--accent); border-color: var(--accent); }
.zahl { font-size: 2rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.woche { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 90px; }
.woche div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .72rem; color: var(--muted); }
.woche i { display: block; width: 70%; background: var(--fill); border-radius: 4px 4px 0 0; min-height: 2px; margin: 4px 0; }
.woche .heute i { background: var(--accent); }
.woche span { font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* Modal und Meldung */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal > .card { width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; margin: 0; border-radius: 16px 16px 0 0; }
@media (min-width: 700px) { .modal { align-items: center; } .modal > .card { border-radius: 16px; } }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
         background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0;
         transition: opacity 200ms var(--ease); pointer-events: none; z-index: 30; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--warn); color: #fff; }
.login { max-width: 360px; margin: 12vh auto 0; }
