/* Gestaltung „Papier und Tinte“ (Spec §2 Rahmen · C2) · keine Webfonts von außen, keine style-Attribute (CSP) */
:root {
  --papier: #f7f2e8; --flaeche: #fffaf0; --tinte: #2b2418; --leise: #7d705a; --linie: #e5dccb;
  --akzent: #a55734; --akzent-text: #ffffff; --auf-farbe: #ffffff; --sanft: #ece4d3; --warn: #9a3f1c; --wichtig: #f3e3c7;
  --ring0: #d9c49d; --ring1: #e6d8bb; --ring2: #eee5d2; --ring3: #f3efe6; --grau: #bdb3a0; --hoch: #5d8a5e;
  /* Kreis-Farben: Rost, Salbei, Taubenblau, Ocker, Pflaume, Moos, Ton, Schiefer */
  --k0: #a55734; --k1: #667a56; --k2: #4f6d8f; --k3: #8f6d12; --k4: #7d4f6d; --k5: #1a7373; --k6: #966650; --k7: #5a6470;
  --serif: Georgia, "Iowan Old Style", "Noto Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --abstand: 1rem; --rund: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --papier: #1c1915; --flaeche: #25211b; --tinte: #ece4d3; --leise: #a89a80; --linie: #3a3329;
          --akzent: #d98a5f; --akzent-text: #1c1915; --auf-farbe: #1c1915; --sanft: #2f2a22; --warn: #e29a6b; --wichtig: #3a3022;
          --ring0: #4a3f2c; --ring1: #3a3226; --ring2: #2f2920; --ring3: #26221b; --grau: #5a5245; --hoch: #8fae78;
          --k0: #d98a5f; --k1: #9db38c; --k2: #86a5c7; --k3: #d4b05a; --k4: #b5849f; --k5: #4fb3ad; --k6: #c99a83; --k7: #93a0ad;
          color-scheme: dark; }
}
.f0 { --farbe: var(--k0); } .f1 { --farbe: var(--k1); } .f2 { --farbe: var(--k2); } .f3 { --farbe: var(--k3); }
.f4 { --farbe: var(--k4); } .f5 { --farbe: var(--k5); } .f6 { --farbe: var(--k6); } .f7 { --farbe: var(--k7); }
.neutral { --farbe: var(--leise); }

* { box-sizing: border-box; }
body { margin: 0; background: var(--papier); color: var(--tinte); font: 16px/1.5 var(--sans);
       padding: env(safe-area-inset-top) 0 calc(4.6rem + env(safe-area-inset-bottom)); }
a { color: var(--akzent); }
h1, h2.buchstabe, .name, .marke { font-family: var(--serif); font-weight: normal; }
h1 { font-size: 1.9rem; margin: .25rem 0 .75rem; line-height: 1.2; }
h2 { font-size: .75rem; color: var(--leise); text-transform: uppercase; letter-spacing: .1em; margin: 1.5rem 0 .4rem; font-weight: 600; }
.kopf { display: flex; justify-content: space-between; align-items: center; padding: .6rem var(--abstand);
        position: sticky; top: 0; background: var(--papier); border-bottom: 1px solid var(--linie); z-index: 2; }
.marke { font-size: 1.35rem; text-decoration: none; color: var(--tinte); }
.kopf { gap: .6rem; top: env(safe-area-inset-top, 0px); }
.kopfsuche { flex: 1 1 auto; min-width: 0; max-width: 28rem; margin: 0; }
.zahnrad { text-decoration: none; font-size: 1.35rem; color: var(--leise); padding: .2rem .5rem; }
main { max-width: 42rem; margin: 0 auto; padding: var(--abstand) calc(var(--abstand) + 1rem) var(--abstand) var(--abstand); }

.leiste { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; z-index: 3;
          background: var(--sanft); border-top: 1px solid var(--linie); padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); }
.leiste a { display: flex; flex-direction: column; align-items: center; min-width: 4.5rem; text-decoration: none;
            color: var(--leise); font-size: .75rem; }
.leiste a span { font-size: 1.4rem; line-height: 1.2; }
.leiste a[aria-current="page"] { color: var(--akzent); font-weight: 700; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); padding: .6rem .9rem; margin-bottom: .5rem; }
.zeile { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }
.leise { color: var(--leise); font-size: .9rem; }
.knopf { display: inline-block; border: 1px solid var(--akzent); color: var(--akzent); background: transparent;
         border-radius: 999px; padding: .35rem .9rem; font: inherit; font-size: .95rem; text-decoration: none; cursor: pointer; }
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); }
.knopf:disabled { opacity: .5; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
input, textarea, select { width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--linie);
                          border-radius: 10px; background: var(--flaeche); color: var(--tinte); }
input[type="checkbox"] { width: auto; }
textarea { min-height: 5rem; }
#wichtigstes { background: var(--wichtig); border-left: 4px solid var(--akzent); font-family: var(--serif); font-style: italic; }
.arten { display: flex; flex-wrap: wrap; gap: .4rem; }
.arten .knopf[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); }
.marken { display: flex; flex-wrap: wrap; gap: .3rem; }
.marke-klein { border: 1px solid var(--linie); border-radius: 999px; padding: .1rem .6rem; font-size: .85rem; }
.hinweis { margin: .5rem var(--abstand); padding: .5rem .75rem; border-radius: 10px; background: var(--flaeche);
           border: 1px solid var(--warn); color: var(--warn); }
.zeitleiste .karte { border-left: 4px solid var(--linie); }
.versteckt { display: none !important; }
/* Server-Status live über body-Attribute (app.js) · Personenseite zeichnet dafür nicht neu */
body[data-nur-lesen="1"] .nur-schreiben, body[data-radicale-ok="0"] .nur-schreiben { display: none !important; }
body:not([data-radicale-ok="0"]) .nur-radicale-aus { display: none !important; }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.chip { border: 1px solid var(--farbe, var(--linie)); background: var(--flaeche); color: var(--tinte); border-radius: 999px;
        padding: .2rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.voll { background: var(--farbe, var(--akzent)); border-color: var(--farbe, var(--akzent)); color: var(--auf-farbe); }
.chip.ort { border-style: dashed; border-color: var(--leise); }
.chip[aria-pressed="true"] { background: var(--farbe, var(--akzent)); border-color: var(--farbe, var(--akzent)); color: var(--auf-farbe); }
.formzeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .35rem 0; }
.formzeile input { width: auto; min-width: 0; flex: 1 1 9rem; }
.formzeile input[data-feld=beschriftung] { flex: 1 1 7rem; }
.formzeile input[data-feld=strasse] { flex: 2 1 12rem; }
.formzeile input[data-feld=plz] { flex: 1 1 5rem; }
.chip.modus { background: var(--tinte); border-color: var(--tinte); color: var(--papier); }
.chip.leise-chip { color: var(--leise); border-color: transparent; background: transparent; }

.avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          flex: none; background: var(--farbe, var(--leise)); color: var(--auf-farbe); font-size: .85rem; object-fit: cover; }
img.avatar { background: var(--sanft); }
.avatar.gross { width: 5.5rem; height: 5.5rem; font-size: 1.8rem; font-family: var(--serif); }

h2.buchstabe { scroll-margin-top: 3.5rem; }
.register h2.buchstabe { color: var(--akzent); font-size: 1rem; letter-spacing: .08em; text-transform: none; margin: 1rem 0 .1rem; }
.eintrag { display: flex; align-items: center; gap: .75rem; padding: .5rem .25rem; border-bottom: 1px solid var(--linie);
           text-decoration: none; color: var(--tinte); font-weight: normal; margin: 0; }
.eintrag.markiert { outline: 2px solid var(--akzent); outline-offset: -2px; border-radius: 6px; }
.eintrag .wer { display: flex; flex-direction: column; min-width: 0; }
.eintrag .name { font-size: 1.05rem; }
.eintrag .leise { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.buchstaben { position: fixed; right: .15rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; z-index: 2; max-height: 70vh; overflow-y: auto; }
.buchstaben button { border: 0; background: none; color: var(--akzent); font: .7rem/1.35 var(--sans); padding: 0 .3rem; cursor: pointer; }
.auswahlleiste { position: sticky; bottom: calc(4.4rem + env(safe-area-inset-bottom)); margin-top: 1rem; display: flex; flex-wrap: wrap;
                 gap: .4rem; align-items: center; background: var(--flaeche); border: 1px solid var(--linie);
                 border-radius: var(--rund); padding: .6rem; box-shadow: 0 4px 16px #0002; }
.auswahlleiste select, .auswahlleiste input { width: auto; flex: 1 1 9rem; }

.personleiste { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin: .5rem 0; }
.personkopf { text-align: center; margin-top: .25rem; }
.personkopf .avatar { margin: 0 auto; }
.personkopf h1 { margin: .5rem 0 0; }
.personkopf .chips { justify-content: center; }
.aktionen { display: flex; justify-content: space-around; margin: .75rem 0 1rem; }
.aktion { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-decoration: none; color: var(--akzent); font-size: .75rem; }
.aktion span { display: flex; width: 2.7rem; height: 2.7rem; border-radius: 50%; background: var(--sanft);
               align-items: center; justify-content: center; font-size: 1.15rem; }
.abschnitt { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); padding: .4rem .9rem; margin: .6rem 0; }
.abschnitt h2 { margin: .3rem 0 .2rem; }
.kontaktzeile { padding: .3rem 0; border-bottom: 1px solid var(--linie); overflow-wrap: anywhere; }
.kontaktzeile:last-child { border-bottom: 0; }
.beschriftung { display: block; font-size: .72rem; color: var(--akzent); }

.segment { display: flex; background: var(--sanft); border-radius: 10px; padding: 3px; margin: .5rem 0; }
.segment button { flex: 1; border: 0; background: none; padding: .35rem; border-radius: 8px; font: inherit; color: var(--leise); cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--flaeche); color: var(--tinte); box-shadow: 0 1px 2px #0002; }
.grafik svg { width: 100%; max-width: 30rem; display: block; margin: .5rem auto; }
.grafik .ring { stroke: var(--linie); }
.grafik .r0 { fill: var(--ring0); } .grafik .r1 { fill: var(--ring1); } .grafik .r2 { fill: var(--ring2); } .grafik .r3 { fill: var(--ring3); }
.grafik .ich { fill: var(--akzent); }
.grafik .ich-text { fill: var(--auf-farbe); font: 10px var(--serif); text-anchor: middle; }
.grafik .bunt { fill: var(--farbe); }
.grafik .grau { fill: var(--grau); }
.grafik .ini { fill: var(--auf-farbe); font: 8px var(--sans); text-anchor: middle; pointer-events: none; }
.grafik .trend { font: bold 10px var(--sans); }
.grafik .trend.hoch { fill: var(--hoch); } .grafik .trend.runter { fill: var(--warn); }
.grafik .mehr { cursor: pointer; }
.grafik .mehr circle { fill: var(--flaeche); stroke: var(--akzent); }
.grafik .mehr text { fill: var(--akzent); font: 8px var(--sans); text-anchor: middle; }
.grafik .venn { fill: var(--farbe); fill-opacity: .14; stroke: var(--farbe); stroke-width: 1.5; }
.grafik .venn-name { fill: var(--farbe); font: 13px var(--serif); text-anchor: middle; }
.grafik a:focus circle, .grafik .mehr:focus circle { stroke: var(--tinte); stroke-width: 2; }
.zeile.werkzeuge { justify-content: flex-start; }
.werkzeuge select { flex: 1 1 100%; }
.pfeile { display: flex; gap: .35rem; }
.pfeile .platz { visibility: hidden; }
.farbwahl { display: flex; gap: .35rem; margin: .4rem 0; }
.farbwahl button { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 3px solid transparent; background: var(--farbe); cursor: pointer; }
.farbwahl button[aria-pressed="true"] { border-color: var(--tinte); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.chip:focus-visible, .knopf:focus-visible, .eintrag:focus-visible, .leiste a:focus-visible, button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
