/* Nutri-Fit – Orange & Blau, modern und ruhig.
   Die Farben --orange und --blue (samt Abstufungen) setzt die App aus den Admin-Einstellungen. */

:root {
  --orange: #f26b1f;
  --orange-dark: #d05c1b;
  --orange-soft: #fef0e9;
  --blue: #1b3a6b;
  --blue-dark: #122646;
  --blue-mid: #3c5884;
  --blue-soft: #e8ebf0;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --text: #1c2333;
  --text-muted: #5b6577;
  --line: #e1e6ef;
  --green: #1f8f5f;
  --green-soft: #e3f5ec;
  --red: #c93c3c;
  --red-soft: #fde8e8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 8px 24px -12px rgba(20, 30, 60, .18);
  --shadow-hover: 0 2px 4px rgba(20, 30, 60, .06), 0 18px 34px -14px rgba(20, 40, 80, .32);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.modal-open { overflow: hidden; }
a { color: var(--blue-mid); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--blue); letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 60%, transparent); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 300; }
.skip-link:focus { left: 8px; }

/* ---------- Kopf ---------- */
.site-header {
  background: linear-gradient(115deg, var(--blue-dark) 0%, var(--blue) 55%, var(--blue-mid) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 6px 24px -12px rgba(0, 0, 0, .5);
}
.header-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark svg { display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; }
.brand-accent { color: var(--orange); }
.brand-claim { font-size: .78rem; opacity: .8; margin-top: 3px; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px;
  color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 600; font-size: .95rem; position: relative;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-link.active { background: var(--orange); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--orange) 80%, transparent); }
.nav-icon { font-size: 1.05rem; }
.badge {
  position: absolute; top: -4px; right: -2px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #fff; color: var(--orange-dark); font-size: .72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* ---------- Grundlayout ---------- */
.app-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; outline: none; }
.site-footer { text-align: center; color: var(--text-muted); font-size: .8rem; padding: 18px; }
.loading { text-align: center; color: var(--text-muted); padding: 60px 0; }
.view { animation: fade .2s ease-out; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .intro { color: var(--text-muted); margin: 0; max-width: 720px; }
.section-title { margin: 8px 0 6px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card, .card + section, section + .card { margin-top: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.hint { font-size: .8rem; color: var(--text-muted); margin: 12px 0 0; }
.ok-text { color: var(--green); }
.warn-text { color: var(--orange-dark); }
.form-error { color: var(--red); min-height: 1.2em; margin: 0; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 12px; }
.span-all { grid-column: 1 / -1; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; }

.empty { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty h2 { color: var(--text); }
.empty.error h2 { color: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:hover { background: #e6eaf2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--orange) 70%, transparent); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }
.btn-light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-light:hover { background: rgba(255, 255, 255, .24); }
.btn-secondary { background: var(--surface); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--blue-mid); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #f9d4d4; }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn {
  border: none; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: .95rem;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { background: var(--red-soft); color: var(--red); }

/* ---------- Formulare ---------- */
input[type="text"], input[type="number"], input[type="password"], input[type="search"], input[type="email"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-mid) 20%, transparent); }
input:disabled { background: var(--surface-2); }
textarea { resize: vertical; min-height: 60px; }
input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.field-hint { font-size: .78rem; color: var(--text-muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; background: var(--surface); font-weight: 600; font-size: .9rem; user-select: none;
}
.check input { accent-color: var(--orange); margin: 0; }
.check.on { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box input { padding-left: 38px; }
.search-box::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .9rem; opacity: .65; pointer-events: none; }
.color-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text-muted); transition: all .15s;
}
.chip:hover { border-color: var(--blue-mid); color: var(--blue); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip .dot { margin: 0; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: .75rem; font-weight: 600; margin: 1px 2px 1px 0; }
.tag.orange { background: var(--orange-soft); color: var(--orange-dark); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag-solid { background: var(--cat-color, var(--blue)); color: #fff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; flex-shrink: 0; }

/* ---------- Startseite ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: center;
  background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--orange) 45%, transparent) 0, transparent 45%),
    linear-gradient(125deg, var(--blue-dark), var(--blue) 60%, var(--blue-mid));
  color: #fff; border-radius: 24px; padding: 40px; margin-bottom: 24px; box-shadow: var(--shadow-hover); overflow: hidden;
}
.hero h1 { color: #fff; font-size: 2.3rem; max-width: 18ch; }
.hero p { opacity: .9; font-size: 1.08rem; max-width: 56ch; }
.hero-art { position: relative; height: 200px; }
.bubble {
  position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(4px);
  animation: float 6s ease-in-out infinite;
}
.b1 { width: 110px; height: 110px; font-size: 3.2rem; left: 10%; top: 10%; }
.b2 { width: 74px; height: 74px; font-size: 2.1rem; left: 58%; top: 0; animation-delay: -2s; }
.b3 { width: 96px; height: 96px; font-size: 2.8rem; left: 50%; top: 52%; animation-delay: -4s; background: color-mix(in srgb, var(--orange) 55%, transparent); }
.b4 { width: 62px; height: 62px; font-size: 1.8rem; left: 18%; top: 66%; animation-delay: -1s; }
@keyframes float { 50% { transform: translateY(-10px); } }
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.area-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden;
}
.area-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; opacity: .12; background: var(--blue); }
.area-card.tone-orange::after { background: var(--orange); }
.area-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.area-card h2 { margin: 4px 0 0; }
.area-card p { margin: 0; color: var(--text-muted); font-size: .93rem; }
.area-icon { font-size: 2rem; }
.area-meta { margin-top: auto; padding-top: 8px; font-size: .8rem; font-weight: 700; color: var(--orange-dark); }

/* ---------- Kochbuch-Kacheln ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.tile::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(150deg, color-mix(in srgb, var(--cat-color, var(--orange)) 16%, transparent), transparent 62%);
}
.tile::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cat-color, var(--orange)); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.has-img { color: #fff; }
.tile.has-img::before { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(10, 20, 40, .82)); z-index: 1; }
.tile-body { position: relative; z-index: 2; padding: 18px 18px 18px 22px; }
.tile-title { font-weight: 700; font-size: 1.08rem; line-height: 1.3; margin: 0; color: inherit; }
.tile.add-tile { border: 2px dashed var(--line); box-shadow: none; align-items: center; justify-content: center; color: var(--text-muted); font-weight: 600; background: transparent; }
.tile.add-tile::before, .tile.add-tile::after { display: none; }
.tile.add-tile:hover { border-color: var(--orange); color: var(--orange-dark); transform: none; }

/* ---------- Rezept-Detail ---------- */
.recipe-hero { display: grid; grid-template-columns: 1fr; gap: 20px; }
.recipe-hero.with-img { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.recipe-img { border-radius: var(--radius); width: 100%; height: 100%; max-height: 360px; object-fit: cover; box-shadow: var(--shadow); }
.recipe-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 16px; color: var(--text-muted); font-size: .92rem; }
.recipe-notes { margin-top: 14px; background: var(--orange-soft); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); }
.recipe-grid { margin-top: 20px; }
.recipe-steps { margin-top: 16px; }
.servings-ctl { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.servings-ctl button { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--surface); font-size: 1.2rem; cursor: pointer; font-weight: 700; color: var(--blue); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.servings-ctl button:hover { background: var(--orange); color: #fff; }
.servings-ctl input { width: 56px; text-align: center; border: none; background: transparent; font-weight: 700; padding: 4px; }
.servings-ctl input:focus { box-shadow: none; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { display: grid; grid-template-columns: 100px 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.ingredients li:last-child { border-bottom: none; }
.ing-amount { font-weight: 700; color: var(--blue); text-align: right; white-space: nowrap; }
.ing-note { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.ing-unknown { color: var(--orange-dark); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 4px 8px 16px 52px; cursor: pointer; border-radius: 8px; transition: opacity .2s; }
.steps li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 4px; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.steps li.done { opacity: .45; text-decoration: line-through; }
.steps li.done::before { content: "✓"; background: var(--green); }
.nutri-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.nutri-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; }
.nutri-box .val { font-weight: 800; font-size: 1.12rem; color: var(--blue); display: block; }
.nutri-box .lbl { font-size: .66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; hyphens: auto; }
.nutri-box.kcal .val { color: var(--orange-dark); }
.macro-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 14px 0 6px; }
.macro-bar span { display: block; height: 100%; }
.macro-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--text-muted); }
.macro-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.c-protein { background: var(--blue-mid); }
.c-carbs { background: var(--orange); }
.c-fat { background: #f2b01f; }
.nutri-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .9rem; }
.nutri-table th, .nutri-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.nutri-table th:first-child, .nutri-table td:first-child { text-align: left; }
.nutri-table th { font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.check-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.check-row { display: grid; grid-template-columns: 22px 90px 1fr; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--orange); }
.check-row .amt { font-weight: 700; color: var(--blue); text-align: right; }

/* ---------- Ernährung ---------- */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.article-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; border-left: 5px solid var(--blue-mid);
}
.article-card:nth-child(even) { border-left-color: var(--orange); }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.article-card h3 { margin: 0; }
.article-card p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.article-body { max-width: 780px; font-size: 1.02rem; }
.article-body h2 { margin-top: 1.2em; font-size: 1.5rem; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin-top: 1.4em; color: var(--orange-dark); }
.article-body li { margin-bottom: .3em; }
.article-body.preview { max-height: 640px; overflow: auto; font-size: .95rem; }

/* ---------- Fitness ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 10px; }
.plan-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; border-top: 4px solid var(--blue-mid);
}
.plan-card.own { border-top-color: var(--orange); }
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.plan-card h3 { margin: 10px 0 6px; }
.plan-card p { margin: 0 0 6px; }
.plan-card-map .legend { display: none; }
.plan-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.plan-toolbar-fields { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.plan-toolbar-fields .field { flex: 1 1 240px; }
.plan-toolbar-fields .field.grow { flex: 3 1 260px; }
.fitness-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.fitness-main > .card + .card { margin-top: 16px; }
.fitness-side { position: sticky; top: 84px; }
.fitness-side .card + .card { margin-top: 16px; }
.body-schema { text-align: center; }
.body-views { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.body-views figure { margin: 0; }
.body-views figcaption { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.body-schema svg { width: 100%; height: auto; display: block; max-height: 340px; }
.body-schema.compact svg { max-height: 150px; }
.body-schema .outline { fill: #e4e9f2; stroke: #c6cfdd; stroke-width: 1.2; }
.body-schema .zone { stroke: #fff; stroke-width: 1.4; transition: fill .9s ease, stroke .4s, opacity .15s; }
.body-schema.heat .zone { stroke: #c9d1de; }
.body-schema.heat .detail-lines line { stroke: rgba(120, 130, 150, .35); }
.body-schema .zone:hover { opacity: .8; }
.body-schema .detail-lines line { stroke: rgba(255, 255, 255, .55); stroke-width: 1; pointer-events: none; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: .78rem; color: var(--text-muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.muscle-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: 12px; }
.muscle-table th { font-size: .72rem; color: var(--text-muted); text-align: left; font-weight: 600; padding: 4px; text-transform: uppercase; letter-spacing: .04em; }
.muscle-table td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.muscle-table tr:hover td { background: var(--surface-2); }
.muscle-table .num { font-weight: 700; }
.muscle-table .num.muted { font-weight: 500; }
.week-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat .val { display: block; font-weight: 800; font-size: 1.25rem; color: var(--blue); }
.stat .lbl { font-size: .72rem; color: var(--text-muted); }
.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 8px; align-items: start; }
.day-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px;
  min-height: 120px; border-top: 4px solid var(--blue-mid); cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.day-card.rest { border-top-color: var(--green); background: linear-gradient(180deg, color-mix(in srgb, var(--green) 6%, var(--surface)), var(--surface)); }
.day-card.active { border-color: var(--orange); border-top-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-head h3 { margin: 0; font-size: 1rem; }
.day-card > input[type="text"] { padding: 6px 10px; font-weight: 600; }
.day-rest-note { color: var(--green); font-weight: 600; font-size: .88rem; margin: auto 0; text-align: center; }
.plan-items { display: flex; flex-direction: column; gap: 6px; }
.plan-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; padding: 8px 8px 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .88rem; cursor: default; }
.plan-item .name { font-weight: 700; line-height: 1.25; }
.plan-item .detail { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; color: var(--text-muted); font-size: .8rem; margin-top: 5px; }
.plan-item input[type="number"] { width: 50px; padding: 3px 4px; text-align: center; }
.plan-item input[type="text"] { width: 72px; padding: 3px 6px; text-align: center; }
.plan-item select { width: auto; padding: 3px 4px; font-size: .8rem; }
.item-actions { display: flex; flex-direction: column; }
.item-actions .icon-btn { width: 26px; height: 22px; border-radius: 6px; font-size: .8rem; }
.day-picker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 12px 0; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.day-chip { width: 40px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; color: var(--text-muted); position: relative; }
.day-chip.has::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--blue-mid); }
.day-chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.day-chip.active::after { background: #fff; }
.exercise-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-height: 720px; overflow: auto; padding: 2px; }
.exercise-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.exercise-card:hover { border-color: var(--orange); }
.exercise-card .name { font-weight: 700; color: var(--blue); }
.exercise-card .desc { font-size: .8rem; color: var(--text-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.exercise-card .add-row { display: flex; gap: 6px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.warnings { display: flex; flex-direction: column; gap: 8px; }
.warn { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--orange-soft); color: var(--orange-dark); font-size: .88rem; border-left: 4px solid var(--orange); }
.warn.ok { background: var(--green-soft); color: var(--green); border-left-color: var(--green); }
.warn.info { background: var(--blue-soft); color: var(--blue); border-left-color: var(--blue-mid); }
.warn.error { background: var(--red-soft); color: var(--red); border-left-color: var(--red); }
.warn.busy { background: var(--blue-soft); color: var(--blue); border-left-color: var(--blue-mid); }

/* Tagesansicht des Körperschemas */
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.segmented button { border: none; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .85rem; color: var(--text-muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--blue); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.day-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 6px; font-weight: 700; color: var(--orange-dark); }
.day-switch:empty { display: none; }
.day-switch .icon-btn { font-size: 1.4rem; line-height: 1; }
.heat-legend { width: 100%; max-width: 280px; margin: 0 auto; }
.heat-bar { height: 10px; border-radius: 999px; border: 1px solid var(--line); background: linear-gradient(90deg, #ffffff, #facc15 50%, #dc2626); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.heat-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
.heat-dot { border: 1px solid #c9d1de; }
.heat-val { font-size: 1rem !important; text-transform: capitalize; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.week-strip-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .75rem; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.week-strip-day .bar { width: 70%; height: 26px; border-radius: 6px; border: 1px solid #c9d1de; transition: background .9s ease; }
.week-strip-day.active { border-color: var(--orange); color: var(--orange-dark); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 20%, transparent); }
.week-strip-day.today, .day-chip.today { text-decoration: underline; text-underline-offset: 3px; }
.today-badge { margin-left: 6px; font-size: .68rem; font-weight: 700; color: #fff; background: var(--orange); border-radius: 999px; padding: 1px 7px; vertical-align: 2px; }

/* ---------- Einkauf ---------- */
.shop-group { margin-bottom: 18px; }
.shop-group h3 { font-size: .85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; }
.shop-item input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--green); flex-shrink: 0; cursor: pointer; }
.shop-item .txt { flex: 1; min-width: 0; }
.shop-item .amt { font-weight: 700; color: var(--blue); margin-right: 8px; }
.shop-item .src { font-size: .75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.shop-item.done { opacity: .55; }
.shop-item.done .txt > div:first-child { text-decoration: line-through; }
.shop-add { display: grid; grid-template-columns: 100px 100px 1fr auto; gap: 8px; }
.shop-actions { margin-top: 8px; }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-menu { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 84px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.admin-menu a { padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-weight: 600; font-size: .93rem; }
.admin-menu a:hover { background: var(--surface-2); }
.admin-menu a.active { background: var(--blue); color: #fff; }
.admin-menu .logout { margin-top: 8px; }
.admin-content { min-width: 0; }
.admin-content > .row.between { margin-bottom: 12px; }
.admin-content .fitness-layout { grid-template-columns: minmax(0, 1fr) 320px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-decoration: none; color: var(--text); border-left: 5px solid var(--orange); transition: transform .15s; }
.stat-tile:nth-child(even) { border-left-color: var(--blue-mid); }
.stat-tile:hover { transform: translateY(-2px); }
.stat-tile .val { display: block; font-size: 1.9rem; font-weight: 800; color: var(--blue); }
.stat-tile .lbl { color: var(--text-muted); font-weight: 600; }
.quick-links { display: flex; flex-direction: column; gap: 6px; }
.quick-links a { text-decoration: none; font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.table th.num, .table td.num { text-align: right; }
.table tr:hover td { background: #fafbfe; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions > * + * { margin-left: 4px; }
.table.compact th, .table.compact td { padding: 7px 6px; font-size: .9rem; }
.table-wrap { overflow: auto; }
.settings-table input { max-width: 110px; }
.login-box { max-width: 440px; margin: 40px auto; }

.recipe-form > .card + .card { margin-top: 16px; }
.ing-editor { display: flex; flex-direction: column; gap: 6px; }
.ing-row { display: grid; grid-template-columns: 76px 86px minmax(120px, 1.3fr) minmax(90px, 1fr) minmax(150px, 1.4fr) auto; gap: 6px; align-items: start; }
.ing-row.ing-head { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.ing-row select, .ing-row input { padding: 7px 8px; }
.food-cell .status { margin-top: 3px; line-height: 1.25; font-size: .75rem; }
.row-actions { display: flex; align-items: center; }
.row-actions .icon-btn { width: 28px; height: 32px; border-radius: 6px; }
.bulk-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 12px; }
.nutri-preview { min-height: 60px; }
.steps-editor { display: flex; flex-direction: column; gap: 8px; }
.step-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: start; }
.step-no { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.img-preview { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.img-preview img { max-width: 320px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.save-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border-radius: var(--radius); box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, .3);
}
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--text-muted);
  background: var(--surface-2); cursor: pointer; transition: all .15s; margin: 14px 0; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.dropzone:hover, .dropzone.over { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }
.drop-icon { font-size: 2rem; }
.file-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.analyze-status { margin-top: 12px; }
.muscle-weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.muscle-weights label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .88rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.muscle-weights select, .muscle-weights input { width: 96px; padding: 4px 6px; }
.cat-editor { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.cat-row { display: flex; gap: 8px; align-items: center; }
.chip.preset { gap: 4px; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 3px solid rgba(0, 0, 0, .15); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dialog & Toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 50, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.modal-wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 20px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toast-host { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; align-items: center; }
.toast { background: var(--blue); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(10px); transition: all .25s; font-weight: 600; max-width: min(90vw, 560px); text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* ---------- Druck ---------- */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  .site-header, .site-footer, .no-print, .toast-host, .modal-backdrop, .admin-menu { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; color: #000; display: block; }
  .app-main { padding: 0; max-width: none; }
  .admin-layout { display: block; }
  .card, .tile { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .recipe-hero.with-img { grid-template-columns: 2fr 1fr; }
  .recipe-img { max-height: 200px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .steps li.done { opacity: 1; text-decoration: none; }
  .steps li.done::before { content: counter(step); background: var(--orange); }
  a { color: inherit; text-decoration: none; }
  .shop-item { border: none; border-bottom: 1px solid #ddd; border-radius: 0; padding: 6px 0; }
  .print-plan h1 { font-size: 1.5rem; margin-bottom: 4px; }
  .print-head p { margin: 0 0 4px; }
  .print-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 10pt; }
  .print-table th, .print-table td { border: 1px solid #999; padding: 5px 7px; text-align: left; vertical-align: top; }
  .print-table th { background: #eef1f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-table .rest-row td { background: #eef8f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-table td.write-in { min-width: 110px; }
  .print-days { break-inside: avoid; margin: 8px 0 14px; }
  .print-days h3 { margin: 0 0 6px; }
  .print-day-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 6px; }
  .print-day-map { border: 1px solid #ccc; border-radius: 8px; padding: 4px; text-align: center; font-size: 9pt; }
  .print-day-map .body-schema svg { max-height: 120px; }
  .print-day-map figcaption { display: none; }
  .print-bottom { display: grid; grid-template-columns: 240px 1fr; gap: 18px; break-inside: avoid; align-items: start; }
  .print-bottom .body-schema svg { max-height: 220px; }
  .body-schema .zone, .legend i, .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .muscle-table { font-size: 9pt; }
}

/* ---------- Mobil ---------- */
@media (max-width: 1000px) {
  .fitness-layout, .admin-content .fitness-layout { grid-template-columns: 1fr; }
  .fitness-side { position: static; }
  .fitness-side { order: -1; }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-menu { position: static; flex-direction: row; flex-wrap: wrap; }
  .recipe-hero.with-img, .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .ing-row { grid-template-columns: 70px 80px 1fr auto; }
  .ing-row > input:nth-of-type(3), .ing-row .food-cell { grid-column: 1 / span 3; }
  .ing-row.ing-head { display: none; }
  .ing-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .header-inner { padding: 8px 12px; }
  .brand-claim { display: none; }
  .nav-label { display: none; }
  .nav-link { padding: 8px 11px; font-size: 1.1rem; }
  .app-main { padding: 16px 12px 40px; }
  .hero { padding: 26px 20px; }
  .hero h1 { font-size: 1.7rem; }
  h1 { font-size: 1.55rem; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .tile { min-height: 120px; }
  .shop-add { grid-template-columns: 1fr 1fr; }
  .shop-add input[type="text"]:not([inputmode]) { grid-column: span 2; }
  .shop-add .btn { grid-column: span 2; }
  .ingredients li { grid-template-columns: 80px 1fr; }
  .ingredients li .ing-note { grid-column: 2; }
  .plan-card { grid-template-columns: 1fr; }
  .plan-card-map { display: none; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Kochbuch einlesen (Admin) ---- */
.bk-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; }
.bk-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.bk-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bk-progress { height: 10px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; margin: 10px 0; }
.bk-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-mid), var(--orange)); transition: width .4s ease; }
.bk-bar { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.bk-bar input[type=search] { flex: 1 1 200px; min-width: 160px; width: auto; }
.bk-bar select, .bk-main select { width: auto; max-width: 100%; }
.bk-main select { width: 100%; }
.bk-group { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); }
.bk-group > summary { cursor: pointer; padding: 10px 14px; list-style: none; }
.bk-group > summary::-webkit-details-marker { display: none; }
.bk-group > summary::before { content: '▸'; display: inline-block; margin-right: 8px; color: var(--orange); transition: transform .15s; }
.bk-group[open] > summary::before { transform: rotate(90deg); }
.bk-rows { border-top: 1px solid var(--line); max-height: 70vh; overflow-y: auto; }
.bk-row { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.bk-row:last-child { border-bottom: 0; }
.bk-row.saved { opacity: .6; }
.bk-main { display: grid; grid-template-columns: 22px 1fr minmax(120px, 160px) auto; gap: 10px; align-items: center; }
.bk-main input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--orange); }
.bk-title { min-width: 0; overflow-wrap: anywhere; }
.bk-detail { margin: 4px 0 0 32px; }
.bk-detail > summary { cursor: pointer; color: var(--blue); }
.bk-preview { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 6px 24px; padding: 6px 0; }
.bk-preview ul, .bk-preview ol { margin: 0; padding-left: 20px; }
.bk-preview p { grid-column: 1 / -1; margin: 0; }
.tag-warn { background: var(--orange-soft); color: var(--orange-dark); margin-left: 8px; }
@media (max-width: 720px) {
  .bk-main { grid-template-columns: 22px 1fr; }
  .bk-main select, .bk-main .btn { grid-column: 2; }
  .bk-detail { margin-left: 0; }
  .bk-preview { grid-template-columns: 1fr; }
}
