/* =====================================================================
   MagicFit – Stylesheet
   Farbschema übernommen von sts.maier.jetzt
   ===================================================================== */

:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-soft: #efe9dc;
  --text: #241a12;
  --text-soft: #6b5e4c;
  --primary: #7a3df0;
  --primary-dark: #5c22c9;
  --primary-soft: #efe8ff;
  --accent: #c8891f;
  --accent-soft: #f6ecd4;
  --border: #e6ddcb;
  --danger: #c62828;
  --danger-soft: #fdeaea;
  --ok: #1e7d54;
  --ok-soft: #e6f5ee;
  --warn: #9a6700;
  --warn-soft: #fff6e0;
  --shadow: 0 1px 2px rgba(24, 24, 31, .06), 0 8px 24px rgba(36, 26, 18, .08);
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #17120f;
  --surface: #211a20;
  --surface-soft: #2b2330;
  --text: #efe6d0;
  --text-soft: #b3a892;
  --primary: #9b6bff;
  --primary-dark: #b28cff;
  --primary-soft: #2c2342;
  --accent: #e6b13e;
  --accent-soft: #33291a;
  --border: #3a2f28;
  --danger: #ff8a8a;
  --danger-soft: #3a2222;
  --ok: #6fd6a6;
  --ok-soft: #1d3329;
  --warn: #f0c05a;
  --warn-soft: #362d17;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p  { margin: 0 0 .75rem; }
a  { color: var(--primary); }

/* ---------- Kopfbereich ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--accent-soft);
}
.topbar .brand[data-view] { cursor: pointer; }
.topbar .app-emblem {
  width: 40px; height: 40px; object-fit: contain; display: block;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 84%);
          mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 84%);
}
.topbar .app-word {
  font-family: 'Rowdies', system-ui, sans-serif; font-weight: 700; letter-spacing: .03em;
  font-size: 1.15rem;
  background: linear-gradient(90deg, #e2703a, #e6b13e 40%, #3c8f7c 70%, #7a3df0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.01em; }
.topbar .brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.topbar .brand span i { color: var(--primary); font-style: normal; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 1rem; font-weight: 600; color: var(--text-soft); letter-spacing: -.01em; }

/* Hell/Dunkel-Umschalter links vom Namen: eine Einstellung, keine Ansicht –
   deshalb bewusst getrennt von den Bereichssymbolen rechts. Gezeigt wird
   das Symbol des MÖGLICHEN Ziels nicht, sondern der aktuelle Zustand
   (Sonne = hell aktiv, Mond = dunkel aktiv) – konsistent mit data-theme. */
.topbar .themebtn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; cursor: pointer;
  color: var(--text-soft); line-height: 1;
  padding: .3rem; min-width: 2.2rem; margin-right: .15rem;
}
.topbar .themebtn svg { width: 26px; height: 26px; display: block; }
.topbar .themebtn:hover, .topbar .themebtn:focus { background: var(--surface-soft); color: var(--text); }
/* Der Knopf zeigt die AKTION, nicht den Zustand: im Hellmodus den Mond
   („klick → dunkel"), im Dunkelmodus die Sonne („klick → hell"). Basis
   ist der Hellmodus (auch wenn data-theme noch fehlt, etwa bei „auto"
   vor dem JS-Lauf): Mond an, Sonne aus. Der Dunkelmodus dreht es um.
   So ist IMMER genau ein Icon sichtbar. */
.topbar .themebtn .ic-sun { display: none; }
.topbar .themebtn .ic-moon { display: block; }
html[data-theme='dark'] .topbar .themebtn .ic-moon { display: none; }
html[data-theme='dark'] .topbar .themebtn .ic-sun { display: block; }

/* ---------- Layout ---------- */
.wrap { max-width: 900px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card.tight { padding: .75rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 140px; min-width: 0; }
.row.compact > * { flex: 0 0 auto; }
.muted { color: var(--text-soft); font-size: .875rem; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Formulare ---------- */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-soft); margin-bottom: .25rem; }
input, select, textarea {
  width: 100%;
  padding: .6rem .7rem;
  font: inherit;
  font-size: 16px;               /* verhindert Zoom auf iOS */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 70px; resize: vertical; }

button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--primary); color: #fff;
  transition: background .15s ease;
}
button:hover { background: var(--primary-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--primary); border-color: var(--border); }
button.ghost:hover { background: var(--primary-soft); }
button.danger { background: var(--danger); }
button.small { padding: .35rem .7rem; font-size: .85rem; }
button.icon { padding: .3rem .55rem; font-size: .9rem; background: transparent; color: var(--text-soft); border-color: var(--border); }
button.icon:hover { background: var(--surface-soft); color: var(--text); }

/* ---------- Navigation unten ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--accent-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; border: none; border-radius: 0;
  color: var(--text-soft); font-size: .68rem; font-weight: 600;
  padding: .5rem .2rem .55rem; display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
.tabbar button .ic { font-size: 1.15rem; line-height: 1; }
.tabbar button.active { color: var(--accent); background: none; }

/* ---------- Bausteine ---------- */
.pill {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark);
}
.pill.ok    { background: var(--ok-soft);    color: var(--ok); }
.pill.warn  { background: var(--warn-soft);  color: var(--warn); }
.pill.err   { background: var(--danger-soft);color: var(--danger); }
.pill.grey  { background: var(--surface-soft); color: var(--text-soft); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: none; }
.list .grow { flex: 1; min-width: 0; }
.list .grow .t { font-weight: 600; }
.list .grow .s { font-size: .8rem; color: var(--text-soft); }
/* Zusätzliche Makros (KH/Fett/Ballaststoffe) je Mahlzeit: auf dem Handy
   fehlt der Platz, daher erst ab Tablet/Desktop-Breite in derselben Zeile. */
.list .grow .makros-desktop { display: none; }
@media (min-width: 640px) {
  .list .grow .makros-desktop { display: inline; }
}

/* Coach-Dashboard: drei Kennzahl-Kacheln je Klient. Auf dem Handy
   untereinander, ab Tablet nebeneinander. */
.coachgrid { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 640px) {
  .coachgrid { grid-template-columns: repeat(3, 1fr); }
}
.coachgrid .cbox {
  background: var(--surface-soft); border-radius: 10px; padding: .6rem .7rem;
}
.coachgrid .cbox .k { font-size: .75rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .03em; }
.coachgrid .cbox .v { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-top: .1rem; }
.coachgrid .cbox .v.muted { color: var(--text-soft); font-weight: 600; }
.coachgrid .cbox .s { font-size: .75rem; }
.coachgrid .cbox canvas.spark { width: 100%; margin-top: .35rem; display: block; }

/* Klienten-Detailseite: Diagramme volle Breite, Übungs-Legende */
#ccWeight, #ccKcal, #ccProt, #ccTrain { width: 100%; display: block; }
.cclegend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .5rem; }
.cclegend .ccleg { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text-soft); }
.cclegend .ccleg i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

/* Hover-Tooltip für die Diagramme (Messwert an der Maus) */
.charttip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: .3rem .5rem; font-size: .78rem; line-height: 1.3;
  box-shadow: var(--shadow); white-space: nowrap;
}
.charttip.hidden { display: none; }

.stat { display: flex; gap: .5rem; flex-wrap: wrap; }
.stat .box {
  flex: 1 1 90px; background: var(--surface-soft);
  border-radius: 10px; padding: .55rem .65rem;
}
.stat .box .v { font-size: 1.15rem; font-weight: 800; }
.stat .box .k { font-size: .7rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .03em; }

.bar { height: 8px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; margin-top: .35rem; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bar > i.over { background: var(--danger); }

canvas { width: 100%; height: auto; display: block; }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .dow { font-size: .65rem; text-align: center; color: var(--text-soft); font-weight: 700; padding: .2rem 0; }
.cal .day {
  aspect-ratio: 1 / 1; border-radius: 8px; background: var(--surface-soft);
  border: 1px solid transparent; padding: .2rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cal .day.empty { background: transparent; cursor: default; }
.cal .day.today { border-color: var(--primary); }
.cal .day.sel { background: var(--primary); color: #fff; }
.cal .day .n { font-size: .78rem; font-weight: 700; }
.cal .day .dots { display: flex; gap: 2px; }
.cal .day .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-soft); display: block; }
.cal .day .dots i.w { background: #3aa3ff; }
.cal .day .dots i.d { background: var(--primary); }
.cal .day .dots i.t { background: #f0a500; }
.cal .day .dots i.a { background: #2fb37a; }
.cal .day .dots i.m { background: #e5677f; }
.cal .day.sel .dots i { background: #fff; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(10, 10, 16, .5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0;
}
.modal {
  background: var(--surface); width: 100%; max-width: 560px;
  border-radius: 18px 18px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal-bg { align-items: center; padding: 1rem; }
  .modal { border-radius: 18px; }
}
.modal h2 { margin-bottom: .75rem; }
.modal .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.modal .actions button { flex: 0 1 auto; }

/* ---------- Meldungen ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 5rem; z-index: 60;
  background: var(--text); color: var(--bg);
  padding: .6rem 1rem; border-radius: 999px; font-size: .875rem; font-weight: 600;
  box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
.note { padding: .7rem .8rem; border-radius: 10px; font-size: .875rem; margin-bottom: .75rem; }
.note.info { background: var(--primary-soft); color: var(--primary-dark); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.err  { background: var(--danger-soft); color: var(--danger); }
.note.ok   { background: var(--ok-soft); color: var(--ok); }

/* ---------- Anmeldung ---------- */
.auth { max-width: 400px; margin: 2rem auto; padding: 0 1rem 3rem; }
.auth .logo { text-align: center; margin-bottom: 1.25rem; }
.auth .logo img { width: 76px; height: 76px; border-radius: 20px; }
.auth .logo .n { font-weight: 800; font-size: 1.4rem; margin-top: .5rem; }
.auth .logo .n i { color: var(--primary); font-style: normal; }
.auth .logo .s { font-size: .85rem; color: var(--text-soft); }
.auth .switch { text-align: center; margin-top: .75rem; font-size: .875rem; }
.auth .switch a { cursor: pointer; }

/* =====================================================================
   PRISMASPHERE – Retro-Future 70er / Vintage · Esoterik · Wissenschaft
   Nur auf die öffentliche Landing gescopt (.auth.prisma), App unberührt.
   ===================================================================== */
/* PRISMASPHERE-Palette – global, damit sie auch in der eingeloggten
   Startseite (Magazin im App-Bereich) verfügbar ist. */
:root {
  --ps-ink: #1b1230;
  --ps-ink2: #241640;
  --ps-paper: #efe6d0;
  --ps-paper2: #e4d7ba;
  --ps-orange: #e2703a;
  --ps-gold: #e6b13e;
  --ps-teal: #3c8f7c;
  --ps-violet: #7a3df0;
  --ps-rust: #a8412a;
  --ps-cream-soft: rgba(239,230,208,.72);
}

/* Ausgeloggte Landing: ganzer Viewport dunkel (keine hellen Ränder) */
html.ps-landing, html.ps-landing body { background: #17120f; }

.auth.prisma {
  max-width: 1000px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1100px 460px at 50% 2%, rgba(122,61,240,.20), transparent 62%),
    radial-gradient(560px 280px at 82% 14%, rgba(230,177,62,.12), transparent 60%),
    #17120f;
  color: var(--ps-paper);
  border-radius: 18px;
  padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2rem) 2.4rem;
  margin: 1.2rem auto;
}
.auth.prisma .ps-band    { order: 0; }
.auth.prisma .ps-hero    { order: 1; }
.auth.prisma #publicInfo { order: 2; }
.auth.prisma .card       { order: 3; max-width: 460px; margin: 1rem auto 0; width: 100%; }
.auth.prisma .legal      { order: 4; margin-top: 1.4rem; }

/* ---- Oberes Band (sticky) + Login ---- */
.ps-band {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .5rem clamp(.6rem, 2vw, 1.1rem);
  margin: calc(-1 * clamp(1rem, 2.5vw, 2rem)) calc(-1 * clamp(1rem, 3vw, 2rem)) 0;
  border-radius: 18px 18px 0 0;
  background: rgba(20,15,12,.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(230,177,62,.28);
}
.ps-band-brand { display: flex; align-items: center; gap: .55rem; }
.ps-band-emblem { width: 52px; height: 52px; object-fit: contain;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 84%);
          mask-image: radial-gradient(circle at 50% 50%, #000 60%, transparent 84%); }
.ps-band-word {
  font-family: 'Rowdies', system-ui, sans-serif; font-weight: 700; letter-spacing: .04em;
  font-size: clamp(1.15rem, 3.6vw, 1.65rem);
  background: linear-gradient(90deg, #e2703a, #e6b13e 40%, #3c8f7c 70%, #7a3df0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ps-band-login { display: flex; align-items: center; gap: .4rem; margin-left: auto; flex-wrap: wrap; }
.ps-band-login input {
  width: 9rem; max-width: 34vw; padding: .42rem .55rem; border-radius: 9px;
  background: rgba(27,18,48,.6); border: 1px solid rgba(239,230,208,.22); color: var(--ps-paper);
}
.ps-band-login input::placeholder { color: rgba(239,230,208,.45); }
.ps-band-login #btnLogin {
  padding: .42rem .8rem; border: none; border-radius: 9px; font-weight: 700; color: #241203;
  background: linear-gradient(90deg, var(--ps-orange), var(--ps-gold));
}
.ps-band-login #btnDemo { padding: .42rem .6rem; border-radius: 9px; }

/* ---- Hero (nur ausgeloggt) ---- */
.ps-hero { text-align: center; padding: .6rem 0 .2rem; }
.ps-hero-emblem {
  display: block; width: min(300px, 66%); height: auto; margin: 0 auto -0.2rem;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 82%);
          mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 82%);
}
.ps-hero-word {
  font-family: 'Rowdies', system-ui, sans-serif; font-weight: 700;
  font-size: clamp(1.9rem, 6.5vw, 3.2rem); letter-spacing: .06em; margin: 0; line-height: 1;
  background: linear-gradient(90deg, #e2703a, #e6b13e 38%, #3c8f7c 68%, #7a3df0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ps-hero .ps-tag {
  font-family: 'Orbitron', system-ui, sans-serif; font-size: .58rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--ps-gold); margin: .6rem 0 0;
}
.ps-hero-lead {
  max-width: 640px; margin: .8rem auto 0; color: var(--ps-cream-soft);
  font-family: 'Space Grotesk', system-ui, sans-serif; font-size: .95rem; line-height: 1.55;
}
.ps-hero .ps-dateline { margin-top: .7rem; }

/* ---- Masthead ---- */
.ps-emblem { width: 92px; height: 92px; filter: drop-shadow(0 0 18px rgba(230,177,62,.25)); }
.ps-word {
  font-family: 'Orbitron', system-ui, sans-serif; font-weight: 900;
  font-size: clamp(1.8rem, 6vw, 3.2rem); letter-spacing: .14em;
  margin: .2rem 0 0; line-height: 1;
  background: linear-gradient(90deg, var(--ps-orange), var(--ps-gold) 40%, var(--ps-teal) 70%, var(--ps-violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ps-tag {
  font-family: 'Orbitron', system-ui, sans-serif; font-size: .68rem; letter-spacing: .38em;
  text-transform: uppercase; color: var(--ps-gold); margin-top: .55rem; padding-left: .38em;
}
.ps-rule {
  height: 4px; margin: .9rem auto .5rem; max-width: 320px; border-radius: 4px;
  background: linear-gradient(90deg, var(--ps-rust), var(--ps-orange), var(--ps-gold), var(--ps-teal), var(--ps-violet));
}
.ps-dateline {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ps-cream-soft);
}

/* ---- Login-Karte in Theme ---- */
.auth.prisma .card {
  background: rgba(239,230,208,.05); border: 1px solid rgba(230,177,62,.3);
  border-radius: 14px; backdrop-filter: blur(2px); margin-top: 1.4rem;
}
.auth.prisma .card h2 { font-family: 'Rozha One', Georgia, serif; font-weight: 400; letter-spacing: .01em; }
.auth.prisma label { color: var(--ps-cream-soft); }
.auth.prisma input {
  background: rgba(27,18,48,.5); border: 1px solid rgba(239,230,208,.22); color: var(--ps-paper);
}
.auth.prisma input::placeholder { color: rgba(239,230,208,.4); }
.auth.prisma .muted, .auth.prisma .switch { color: var(--ps-cream-soft); }
.auth.prisma .switch a, .auth.prisma .legal a { color: var(--ps-gold); }
.auth.prisma #btnLogin { background: linear-gradient(90deg, var(--ps-orange), var(--ps-gold)); border: none; color: #241203; font-weight: 700; }
.auth.prisma .legal { text-align: center; font-size: .78rem; }

/* ---- Magazin-Bereich ---- */
.pubinfo { width: 100%; }
.ps-sec { margin: 1.6rem 0; }
.ps-eyebrow {
  font-family: 'Orbitron', system-ui, sans-serif; font-size: .64rem; letter-spacing: .34em;
  text-transform: uppercase; color: var(--ps-gold); display: flex; align-items: center; gap: .6rem;
  margin-bottom: .8rem;
}
.ps-eyebrow::after { content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(230,177,62,.5), transparent); }
.ps-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); justify-content: center; }
.ps-grid-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ps-prev { font-size: .78rem; color: #4f4230; padding: .1rem .5rem 0; line-height: 1.35; }
.ps-card-wide { min-height: 0; }
.ps-card-wide .ps-thumb { height: 130px; }
/* Wissen: Leitartikel + Nebenspalte */
.ps-lead-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: .75rem; align-items: start; }
.ps-lead .ps-thumb { height: 180px; }
.ps-lead .t { font-size: 1.35rem; }
@media (max-width: 640px) { .ps-lead-grid { grid-template-columns: 1fr; } }
.ps-card {
  position: relative; text-align: left; cursor: pointer; color: var(--ps-ink);
  background: linear-gradient(160deg, var(--ps-paper), var(--ps-paper2));
  border: none; border-radius: 12px; padding: .95rem .9rem;
  display: flex; flex-direction: column; gap: .35rem; min-height: 92px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .12s ease;
}
.ps-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
  border-radius: 3px; background: linear-gradient(180deg, var(--ps-orange), var(--ps-teal)); }
.ps-card:hover { transform: translateY(-3px); }
.ps-card .t { font-family: 'Rozha One', Georgia, serif; font-size: 1.05rem; line-height: 1.15; padding-left: .5rem; padding-right: 3.6rem; }
.ps-card .s { font-size: .74rem; color: #5a4a33; padding-left: .5rem; }
.ps-card .s:first-child { padding-right: 3rem; }
/* Bild-Vorschau in Karten */
.ps-card-img { padding-top: .55rem; }
.ps-thumb {
  height: 96px; margin: -0.35rem .0 .5rem .5rem; border-radius: 9px;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.ps-thumb-ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ps-orange), var(--ps-gold) 45%, var(--ps-teal) 80%);
}
.ps-thumb-ph span { font-family: 'Rowdies', sans-serif; font-size: 2rem; color: rgba(36,18,3,.6); }
.ps-thumb-lg { height: 200px; margin: 0 0 .8rem; border-radius: 12px; }
.ps-story .ps-thumb { margin-left: .5rem; }
.ps-adbadge {
  position: absolute; top: .5rem; right: .5rem; font-family: 'Orbitron', sans-serif;
  font-size: .54rem; letter-spacing: .12em; font-weight: 700; color: #241203;
  background: var(--ps-gold); padding: .12rem .4rem; border-radius: 5px;
}
.ps-avatar {
  width: 42px; height: 42px; border-radius: 50%; margin-left: .5rem;
  background: radial-gradient(circle at 30% 30%, var(--ps-gold), var(--ps-orange));
  color: #241203; font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif; overflow: hidden;
}
.ps-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Wissens-Teaser (Platzhalter, als „Bald“ markiert) */
.ps-story { background: linear-gradient(160deg, var(--ps-ink2), var(--ps-ink));
  border: 1px solid rgba(230,177,62,.25); color: var(--ps-paper); box-shadow: none; }
.ps-story::before { background: linear-gradient(180deg, var(--ps-gold), var(--ps-violet)); }
.ps-story .t { color: var(--ps-paper); }
.ps-story .s:first-of-type { padding-right: 2.8rem; }
.ps-story .s { color: var(--ps-cream-soft); }
.ps-soon { position: absolute; top: .5rem; right: .5rem; font-family: 'Orbitron', sans-serif;
  font-size: .54rem; letter-spacing: .12em; color: var(--ps-ink); background: var(--ps-teal);
  padding: .12rem .4rem; border-radius: 5px; }
/* Verzeichnis */
.ps-tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .6rem; }
.ps-tab {
  font-family: 'Orbitron', sans-serif; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; background: transparent; color: var(--ps-gold);
  border: 1px solid rgba(230,177,62,.4); border-radius: 999px; padding: .35rem .8rem;
}
.ps-tab.on { background: var(--ps-gold); color: #241203; }
#psSearch { width: 100%; background: rgba(27,18,48,.5); border: 1px solid rgba(239,230,208,.22);
  color: var(--ps-paper); border-radius: 10px; padding: .55rem .7rem; }
.ps-line { display: block; width: 100%; text-align: left; cursor: pointer; color: var(--ps-paper);
  background: rgba(239,230,208,.06); border: 1px solid rgba(239,230,208,.12); border-radius: 10px;
  padding: .55rem .7rem; margin-bottom: .4rem; font-size: .875rem; }
.ps-line:hover { border-color: var(--ps-gold); }
.ps-line .s { color: var(--ps-cream-soft); }
.ps-note { text-align: center; font-size: .74rem; color: var(--ps-cream-soft); margin-top: 1.2rem;
  font-family: 'Space Grotesk', system-ui, sans-serif; }
.chip { display: inline-block; background: rgba(122,61,240,.15); color: var(--ps-violet);
  border: 1px solid rgba(122,61,240,.3); border-radius: 999px; padding: .12rem .55rem;
  font-size: .78rem; margin: 0 .15rem .25rem 0; }
.verok { color: var(--ps-teal); font-weight: 800; }

@media (max-width: 560px) {
  .ps-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .ps-card { transition: none; } }

.codes { background: var(--surface-soft); border-radius: 10px; padding: .75rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; letter-spacing: .04em; }
.codes div { padding: .12rem 0; }

table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th, table.data td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--border); }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-soft); }
table.data td.num, table.data th.num { text-align: right; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

footer.legal { text-align: center; font-size: .8rem; color: var(--text-soft); padding: 1rem 0 0; }
footer.legal a { margin: 0 .4rem; cursor: pointer; }

/* ---------- Segment-Umschalter (Vorrat / Lebensmittel / Gerichte) ---------- */
.seg { display: flex; gap: .25rem; background: var(--surface-soft); border-radius: 999px; padding: .25rem; }
.seg button {
  flex: 1; background: none; color: var(--text-soft);
  border-radius: 999px; padding: .45rem .5rem; font-size: .875rem; font-weight: 600;
}
.seg button:hover { background: transparent; color: var(--text); }
.seg button.active { background: var(--primary); color: #fff; }

/* ---------- Lange Listen: scrollbar mit fixierter Kopfzeile ---------- */
.longlist { max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.longlist table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--border);
}
.longlist table.data tbody tr:nth-child(even) { background: var(--surface-soft); }

/* ---------- Wochenplan ---------- */
.weekgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: .6rem; }
.wdcol {
  background: var(--surface-soft); border: 1px solid transparent;
  border-radius: 10px; padding: .35rem .2rem; min-height: 76px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.wdcol.today { border-color: var(--primary); }
.wdname { font-size: .68rem; font-weight: 800; color: var(--text-soft); letter-spacing: .03em; }
.wdchip {
  width: 100%; background: var(--primary); color: #fff;
  border-radius: 7px; padding: .22rem .18rem; cursor: pointer;
  font-size: .62rem; font-weight: 700; line-height: 1.15;
  text-align: center; word-break: break-word;
}
.wdchip span {
  display: block; font-weight: 500; opacity: .8; font-size: .58rem;
}
.wdrest { font-size: .62rem; color: var(--text-soft); margin-top: .5rem; }

/* ---------- Wochentagsauswahl im Dialog ---------- */
.daypick { display: flex; gap: .25rem; }
.daypick button {
  flex: 1; padding: .45rem .1rem; font-size: .78rem; font-weight: 700;
  border-radius: 9px; background: var(--surface-soft); color: var(--text-soft);
  border: 1px solid var(--border);
}
.daypick button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Übungsauswahl im Dialog ---------- */
.picklist { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.pickrow {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .6rem; border-bottom: 1px solid var(--border);
  cursor: pointer; font-weight: 400; margin: 0;
}
.pickrow:last-child { border-bottom: none; }
.pickrow.on { background: var(--primary-soft); }
.pickrow input { width: auto; flex: 0 0 auto; }
.pickrow .grow { flex: 1; min-width: 0; }
.pickrow .t { display: block; font-weight: 600; font-size: .9rem; color: var(--text); }
.pickrow .s { display: block; font-size: .75rem; color: var(--text-soft); }

/* ---------- Tagesansicht: Trainingsblock ---------- */
.sessionblock { border-left: 3px solid var(--primary); padding-left: .7rem; margin-bottom: .9rem; }
.sessionblock:last-child { margin-bottom: 0; }
.ok-dot { color: var(--ok); font-size: .7rem; vertical-align: middle; }

/* ---------- Kalender: geplantes Training ---------- */
.cal .day.plan-open { box-shadow: inset 0 0 0 2px var(--primary); }
.cal .day.plan-done { box-shadow: inset 0 0 0 2px var(--ok); }
.cal .day.sel.plan-open, .cal .day.sel.plan-done { box-shadow: none; }
.legend-ring {
  display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  box-shadow: inset 0 0 0 2px var(--primary); vertical-align: middle;
}

/* ---------- Aufgaben ---------- */
.taskrow { align-items: flex-start; }
.taskrow .check {
  flex: 0 0 auto; width: 24px; height: 24px; padding: 0; margin-top: 2px;
  border-radius: 7px; border: 2px solid var(--border);
  background: transparent; color: #fff;
  font-size: .8rem; line-height: 1; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.taskrow .check:hover { border-color: var(--primary); background: transparent; }
.taskrow .check.on { background: var(--ok); border-color: var(--ok); }
.taskrow.done .t { text-decoration: line-through; color: var(--text-soft); }
.taskrow .s { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }

/* Kalenderpunkt für Aufgaben */
.cal .day .dots i.a { background: #2fb37a; }

/* Sieben Reiter: etwas kompakter, damit die Beschriftung passt */
.tabbar button { font-size: .62rem; padding-left: .1rem; padding-right: .1rem; }
.tabbar button .ic { font-size: 1.05rem; }

/* ---------- Fotoerfassung: erkannte Positionen ---------- */
.aiitem {
  border: 1px solid var(--border); border-radius: 10px;
  padding: .6rem; margin-bottom: .5rem; background: var(--surface-soft);
}
.aiitem .grow { flex: 1; }

/* ---------- Vertraulicher Bereich ---------- */
.emojibar { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .4rem; }
.emojibar .emo {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: .25rem .4rem; font-size: 1.05rem; line-height: 1;
}
.emojibar .emo:hover { background: var(--primary-soft); }

/* Einmal-Betrachter */
.modal-bg.once { background: rgba(0, 0, 0, .92); }
.onceview { background: #0d0d12; color: #f2f1f7; }
.onceview .muted { color: #9a99ad; }

.oncebox {
  position: relative; margin-top: .6rem; border-radius: 12px; overflow: hidden;
  background: #16161f; min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: none;
}
.oncehide {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #16161f; color: #9a99ad; font-size: .85rem; font-weight: 600;
  transition: opacity .12s ease;
}
.oncehide.away { opacity: 0; pointer-events: none; }

.oncecontent {
  width: 100%; filter: blur(26px); transition: filter .12s ease;
  display: flex; align-items: center; justify-content: center;
}
.oncecontent.shown { filter: none; }
.oncecontent canvas, .oncecontent video { max-width: 100%; height: auto; display: block; border-radius: 8px; }
.oncetext { padding: 1.2rem; font-size: 1.05rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.watermark {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .18); font-size: .78rem; font-weight: 700;
  transform: rotate(-20deg); letter-spacing: .05em;
}

/* Acht Reiter: noch etwas kompakter */
.tabbar button { font-size: .56rem; }
.tabbar button .ic { font-size: 1rem; }

/* ---------- Verlauf der Nährwerte ---------- */
.seg.small button { font-size: .74rem; padding: .35rem .3rem; }
.makrobar {
  display: flex; height: 14px; border-radius: 999px; overflow: hidden;
  background: var(--surface-soft);
}
.makrobar > i { display: block; height: 100%; }
.modelrow { padding: .2rem 0; }

/* ---------- Segmente mit Überlauf ---------- */
.seg.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.seg.scrollx::-webkit-scrollbar { display: none; }
.seg.scrollx button { flex: 0 0 auto; white-space: nowrap; padding-left: .7rem; padding-right: .7rem; }

/* ---------- Nährstoff-Eingabe ---------- */
.nutgroup {
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-soft); padding: .5rem .6rem .2rem; background: var(--surface-soft);
}
.nutrow {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .6rem; border-bottom: 1px solid var(--border);
}
.nutrow:last-child { border-bottom: none; }
.nutname { flex: 1; font-size: .85rem; }
.nutval { width: 90px; flex: 0 0 auto; padding: .35rem .5rem; }
.nutunit { width: 26px; flex: 0 0 auto; font-size: .78rem; color: var(--text-soft); }

/* --- Zutaten-Editor für Gerichte -------------------------------------- */
.picklist.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.pickrow[draggable="true"] { cursor: grab; }
.pickrow[draggable="true"]:active { cursor: grabbing; }
.pickrow input { width: 70px; }

/* Trinken: Balken der letzten Tage */
.drinkbars { display: flex; gap: .25rem; align-items: flex-end; }
.drinkbars .db { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.drinkbars .dbcol {
  width: 100%; height: 70px; background: var(--surface-soft);
  border-radius: 3px; display: flex; flex-direction: column;
  justify-content: flex-end; overflow: hidden;
}
.drinkbars .dbcol i { display: block; width: 100%; border-radius: 3px; min-height: 0; }
.drinkbars .dblbl { font-size: .65rem; color: var(--text-soft); }

/* ---------- Bereichssymbole in der Kopfzeile ---------- */
.topnav { display: flex; align-items: center; gap: .2rem; }
.topnav button {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px;
  color: var(--text-soft); line-height: 1;
  padding: .3rem; min-width: 2.2rem;
}
/* Symbole in Logogröße (Logo: 30px) */
.topnav button svg { width: 30px; height: 30px; display: block; }
.topnav button:hover, .topnav button:focus { background: var(--surface-soft); color: var(--text); }
.topnav button.active { color: var(--primary); background: var(--surface-soft); }

/* Vier Reiter: Symbole in SVG, Beschriftung passend dazu */
.tabbar button { font-size: .74rem; font-weight: 600; letter-spacing: -.01em; padding-left: .3rem; padding-right: .3rem; gap: .2rem; }
.tabbar button .ic { display: block; line-height: 0; }
.tabbar button .ic svg { width: 24px; height: 24px; display: block; }

/* Kalenderpunkte etwas größer und deutlicher */
.cal .day .dots { gap: 3px; }
.cal .day .dots i { width: 6px; height: 6px; }

/* Auf schmalen Geräten weicht der Kontoname den Symbolen */
@media (max-width: 520px) {
  .topbar { gap: .4rem; padding-left: .7rem; padding-right: .7rem; }
  .topbar .who { display: none; }
  .topbar .brand span { display: none; }
  .topbar .themebtn { padding: .25rem .15rem; min-width: 2rem; margin-right: 0; }
  .topbar .themebtn svg { width: 24px; height: 24px; }
  .topnav button { padding: .25rem .15rem; min-width: 2rem; }
  .topnav button svg { width: 26px; height: 26px; }
}

/* Zähler an den Kopfzeilen-Symbolen */
.topnav button { position: relative; }
.topnav button.hasbadge::after {
  content: attr(data-badge);
  position: absolute; top: .12rem; right: .02rem;
  min-width: .95rem; height: .95rem; padding: 0 .15rem;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: .58rem; font-weight: 700; line-height: .95rem; text-align: center;
}

/* ===== Notfallbogen: Druckansicht (erste @media print-Regel der App) ===== */

/* Das Druck-Overlay liegt normal unsichtbar über der App und wird nur im
   Druck (und im "printing"-Zustand als Vorschau) angezeigt. */
#printHost { display: none; }
body.printing #printHost {
  display: block;
  position: fixed; inset: 0; z-index: 1000;
  background: #fff; color: #000;
  overflow: auto; padding: 1.2rem;
}
.print-bar {
  display: flex; gap: .5rem; justify-content: flex-end;
  margin-bottom: 1rem; max-width: 720px; margin-left: auto; margin-right: auto;
}
.notfall-print {
  max-width: 720px; margin: 0 auto; color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.notfall-print h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
.notfall-print h2 {
  font-size: 1rem; margin: 1.1rem 0 .3rem;
  border-bottom: 1px solid #000; padding-bottom: .15rem;
}
.notfall-print .kopf { font-size: 1.05rem; margin-bottom: .3rem; }
.notfall-print table.np { width: 100%; border-collapse: collapse; margin-top: .2rem; }
.notfall-print table.np td, .notfall-print table.np th {
  padding: .25rem .4rem; vertical-align: top; text-align: left;
  border-bottom: 1px solid #ccc; font-size: .92rem;
}
.notfall-print table.np th { font-weight: 700; border-bottom: 1px solid #000; }
.notfall-print table.np td.lbl { width: 32%; font-weight: 600; }
.notfall-print .fuss {
  margin-top: 1.5rem; padding-top: .4rem; border-top: 1px solid #000;
  font-size: .78rem; color: #333;
}

@media print {
  /* Im Druck nur das Overlay zeigen, den Rest der App komplett ausblenden. */
  body.printing > *:not(#printHost) { display: none !important; }
  #printHost {
    display: block !important; position: static !important;
    padding: 0 !important; background: #fff !important;
  }
  .no-print { display: none !important; }
  @page { margin: 1.5cm; }
  .notfall-print { max-width: none; }
  .notfall-print h2 { page-break-after: avoid; }
  .notfall-print table.np tr { page-break-inside: avoid; }
}
