/* Mneme — geteiltes Stil-System ("Warmes Archiv-Licht").
   Design-Tokens + wiederverwendbare Komponenten (App-Bar, Bottom-Nav, FAB,
   Buttons, Chips, Cards). Seiten ziehen sich das hier; Feature-spezifisches
   Layout bleibt pro Seite. Ziel: Inhalt ist der Held, Bedienung tritt zurueck.
   Helle, warme Pergament-Welt — zeitlos wie ein aufgeschlagenes Buch, aber
   lebendig, freundlich, neugierig. EIN Schalter (dieser :root-Block) flippt die
   ganze App; Seiten benutzen nur var(--…), nie Hex. Icons: /icons.svg. */

:root {
  /* Flaechen — neutral & hell (Creme rausgenommen, Mario: wirkte "aeltelig") */
  --bg:        #ffffff;          /* reinweisser Grund */
  --surface:   #ffffff;          /* Karten — weiss, Abgrenzung ueber --line + Schatten */
  --surface-2: #f1f1f4;          /* Inputs / Sekundaer-Buttons — neutrales Hellgrau */
  --line:      #e6e6ea;          /* weiche, neutrale Trennlinie */
  --fg:        #23232a;          /* fast-schwarze, neutrale Tinte */
  --muted:     #8a8a93;          /* neutrales Grau */

  /* Akzent — lebhaft (Koralle) + Sekundaer (Teal, fuer hellen Grund vertieft) */
  --accent:    #f25c4c;
  --accent-2:  #18a394;
  --accent-ink:#ffffff;          /* Text auf Akzent */
  --accent-soft: rgba(242,92,76,.12);   /* zarte Akzent-Waesche (aktive Zustaende) */
  /* Sonnen-Gradient (Ringelblume -> Mohn -> Rose) — Freude, Waerme, Aufbruch */
  --grad:      linear-gradient(135deg, #ffb347 0%, #ff7a59 48%, #f0588e 100%);
  --warn:      #d98412;
  --ok:        #2f9e6e;

  /* Bluetenstrauss (Flower-Power: Freiheit, Farbe, Individualitaet) — vintage-warm,
     nicht neon. Sektionen/Icons rotieren durch diese Toene -> bunt statt monoton. */
  --bloom-marigold: #e6a02e;   /* Ringelblume / Sonne */
  --bloom-poppy:    #e2663a;   /* Mohn / verbranntes Orange */
  --bloom-rose:     #d65f8b;   /* Wildrose */
  --bloom-sage:     #5b9b6b;   /* Salbei / Avocado-Gruen */
  --bloom-teal:     #1f9e91;   /* Petrol-Teal */
  --bloom-violet:   #8a6cb4;   /* 70er-Violett */

  /* Glas-Leisten + Overlays (Tokens, damit der Hell/Dunkel-Flip ein Ort bleibt) */
  --bar-top:    rgba(255,255,255,.82);  /* App-Bar oben */
  --bar-bottom: rgba(255,255,255,.9);   /* Bottom-Nav */
  --scrim:      rgba(20,20,28,.42);      /* Sheet-Verdunkler */

  --r:    18px;                   /* Karten */
  --r-sm: 12px;                   /* Buttons/Inputs */
  --r-pill: 999px;
  --shadow: 0 6px 22px rgba(20,20,30,.08);
  --shadow-accent: 0 8px 20px rgba(242,92,76,.30);
  --bar-h: 64px;                  /* Hoehe der Bottom-Nav */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tap: 44px;                    /* Mindest-Tap-Ziel */
  --font: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif;
}

/* ---- Eigenes Icon-Set (Sprite /icons.svg) ------------------------------ */
/* <svg class="ic"><use href="/icons.svg#name"/></svg> — Strich erbt currentColor.
   Eine Familie fuer Lupe, Erfassen, Nav, Sheet. Groesse via font-size/em. */
.ic {
  width: 1.3em; height: 1.3em; flex: none;
  vertical-align: -0.22em;
}
.ic, .bottomnav svg, .appbar .iconbtn svg, .mn-sheet .row svg, .actbtn svg {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body.mn {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  /* Platz fuer die Bottom-Nav, damit nichts verdeckt wird */
  padding-bottom: calc(var(--bar-h) + var(--safe-b) + 8px);
}
.mn a { color: var(--accent); }

/* ---- App-Bar (oben, schlank) ------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .6rem;
  padding: max(.6rem, env(safe-area-inset-top)) 1rem .6rem;
  background: var(--bar-top); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar .brand { font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; }
.appbar .brand .dot { color: var(--accent); }
.appbar .spacer { flex: 1; }
.appbar .sub { color: var(--muted); font-size: .8rem; }
.iconbtn {
  width: var(--tap); height: var(--tap); border: none; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--fg); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  position: relative;
}
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 22px; height: 22px; }
.badge-dot {
  position: absolute; top: 7px; right: 8px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: var(--r-pill); background: var(--accent);
  color: var(--accent-ink); font-size: .66rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface-2);
}

/* ---- Buttons / Chips --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: none; border-radius: var(--r-sm); padding: .75rem 1.1rem;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  background: var(--surface-2); color: var(--fg);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-accent); }
.btn-ghost   { background: transparent; border: 1px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg);
  border-radius: var(--r-pill); padding: .3rem .7rem; font-size: .85rem;
  text-decoration: none;
}
a.chip:active, a.chip:hover { border-color: var(--accent); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow);
}

/* ---- Bottom-Navigation (Icons, daumenfreundlich) ----------------------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--bar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: var(--bar-bottom); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.bottomnav .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; text-decoration: none;
  color: var(--muted); font-size: .66rem; font-weight: 600; position: relative;
  background: none; border: none; cursor: pointer; padding: 6px 0;
}
.bottomnav .tab svg { width: 24px; height: 24px; }
.bottomnav .tab.active { color: var(--accent); }
.bottomnav .tab .dot {
  position: absolute; top: 4px; right: calc(50% - 18px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink); font-size: .62rem;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}
/* zentrale Haupt-Aktion (Erfassen) — angehoben, Gradient */
.bottomnav .fab {
  flex: 0 0 auto; width: 60px; margin: 0 6px; align-self: center;
}
.bottomnav .fab a {
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; margin-top: -22px; border-radius: var(--r-pill);
  background: var(--grad); color: #fff; box-shadow: var(--shadow-accent);
  text-decoration: none;
}
.bottomnav .fab a:active { transform: scale(.95); }
.bottomnav .fab svg { width: 28px; height: 28px; }

/* ---- "Mehr"-Popup ------------------------------------------------------ */
.mn-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none;
}
.mn-sheet.open { display: block; }
.mn-sheet .scrim { position: fixed; inset: 0; background: var(--scrim); }
.mn-sheet .panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top-left-radius: 22px; border-top-right-radius: 22px;
  border-top: 1px solid var(--line); padding: .6rem 1rem calc(1rem + var(--safe-b));
  box-shadow: 0 -8px 30px rgba(70,50,25,.16);
}
.mn-sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line);
  margin: .3rem auto .7rem; }
.mn-sheet .row {
  display: flex; align-items: center; gap: .9rem; padding: .85rem .4rem;
  color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line);
}
.mn-sheet .row:last-child { border-bottom: none; }
.mn-sheet .row svg { width: 22px; height: 22px; color: var(--accent); }
.mn-sheet .row .lbl { font-weight: 600; }
.mn-sheet .row .cnt { margin-left: auto; color: var(--accent); font-weight: 800; font-size: .85rem; }
