/* =========================================================
   Hundefutterrechner – Stylesheet
   ========================================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-dark:  #1e7e34;
  --green:       #28a745;
  --green-light: #d4edda;
  --green-pale:  #f0faf3;
  --orange:      #e67e22;
  --orange-light:#fdf3e7;
  --red:         #dc3545;
  --red-light:   #fdecea;
  --yellow:      #ffc107;
  --yellow-light:#fff8e1;
  --blue:        #17a2b8;
  --blue-light:  #d1ecf1;
  --bg:          #f8f9fa;
  --surface:     #ffffff;
  --border:      #dee2e6;
  --text:        #212529;
  --text-muted:  #6c757d;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 4px 24px rgba(0,0,0,.12);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

/* ---------- Utility ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section-light {
  background: var(--green-pale);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 6px;
  border: 2px solid transparent;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
}
.btn-primary   { background: var(--green);    color: #fff; border-color: var(--green); }
.btn-primary:hover  { background: var(--green-dark); border-color: var(--green-dark); }
.btn-secondary { background: var(--surface); color: var(--green); border-color: var(--green); }
.btn-secondary:hover{ background: var(--green-light); }
.btn-danger    { background: var(--red-light); color: var(--red); border-color: var(--red); }
.btn-danger:hover   { background: var(--red); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover    { background: var(--bg); }
.btn-sm        { padding: .25rem .65rem; font-size: .8rem; }

.info-box {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.info-warning  { background: var(--yellow-light); border: 1px solid var(--yellow); color: #664d03; }
.info-danger   { background: var(--red-light);    border: 1px solid var(--red);    color: #842029; }
.info-success  { background: var(--green-light);  border: 1px solid var(--green);  color: #0f5132; }
.info-info     { background: var(--blue-light);   border: 1px solid var(--blue);   color: #0c5460; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 2px solid var(--green-light);
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  height: 60px;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
}

.nav-links {
  display: flex;
  gap: .2rem;
  align-items: center;
}

.nav-links li a {
  padding: .4rem .8rem;
  border-radius: 6px;
  color: var(--text);
  font-weight: 500;
  font-size: .92rem;
  transition: background .15s;
}

.nav-links li a:hover {
  background: var(--green-light);
  color: var(--green-dark);
  text-decoration: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: .4rem;
  border: none;
  background: transparent;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s;
}

.btn-header-cache {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: .3rem .45rem;
  border-radius: 6px;
  transition: background .15s;
  margin-right: .25rem;
}

.btn-header-cache:hover,
.btn-header-cache:focus-visible {
  background: var(--red-light);
}

.btn-header-cache::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 240px;
  max-width: 320px;
  padding: .45rem .6rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  pointer-events: none;
}

.btn-header-cache:hover::after,
.btn-header-cache:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1e7e34 0%, #28a745 50%, #5cb85c 100%);
  color: #fff;
  padding: 4rem 1.25rem;
  text-align: center;
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: .75rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.hero p {
  font-size: 1.1rem;
  opacity: .93;
  margin-bottom: 1.5rem;
}

.vet-warning {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: var(--radius);
  padding: .85rem 1.2rem;
  font-size: .95rem;
  backdrop-filter: blur(4px);
  max-width: 620px;
}

/* ---------- Section Headings ---------- */
.section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ---------- Profile Form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-group input,
.form-group select {
  padding: .55rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}

.condition-alert {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: 8px;
  font-size: .92rem;
  border-left: 4px solid var(--orange);
  background: var(--orange-light);
  color: #5a3000;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ---------- Calculator Grid ---------- */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Ingredients Panel */
.ingredient-search {
  display: flex;
  gap: .6rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}

.ingredient-search input,
.ingredient-search select {
  flex: 1;
  min-width: 120px;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  background: #fff;
}

.ingredient-search input:focus,
.ingredient-search select:focus {
  outline: none;
  border-color: var(--green);
}

.ingredient-list {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 1rem;
}

.ingredient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: default;
}

.ingredient-row:last-child { border-bottom: none; }
.ingredient-row:hover { background: var(--green-light); }

.ingredient-row-info {
  display: flex;
  flex-direction: column;
}

.ingredient-row-name {
  font-weight: 600;
  font-size: .9rem;
}

.ingredient-row-meta {
  font-size: .77rem;
  color: var(--text-muted);
}

.category-badge {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-left: .4rem;
}

.badge-protein   { background: #e8f4fd; color: #0d6efd; }
.badge-dryfood   { background: #e3f2fd; color: #1565c0; }
.badge-grain     { background: #fff8e1; color: #e65100; }
.badge-vegetable { background: var(--green-light); color: var(--green-dark); }
.badge-fruit     { background: #fce4ec; color: #c62828; }
.badge-oil       { background: #f3e5f5; color: #6a1b9a; }
.badge-supplement{ background: #e0f2f1; color: #00695c; }

.add-ingredient-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: .2rem .4rem;
  border-radius: 4px;
  line-height: 1;
  transition: transform .12s;
}
.add-ingredient-btn:hover { transform: scale(1.3); }

/* Recipe Panel */
.recipe-subtitle {
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: .75rem;
}

.profile-recipe-tabs {
  display: flex;
  gap: .45rem;
  margin-bottom: .65rem;
  flex-wrap: wrap;
}

.profile-recipe-tab {
  border: 1.5px solid var(--green-light);
  background: var(--surface);
  color: var(--green-dark);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-recipe-tab.active {
  background: var(--green-light);
  border-color: var(--green);
}

.example-recipes {
  margin-bottom: .75rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.example-recipes-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .45rem;
}

.example-recipes-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.example-recipes-hint {
  margin: .35rem 0 0;
}

.recipe-list {
  min-height: 120px;
  margin-bottom: .75rem;
}

.empty-recipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.small { font-size: .82rem; }

.recipe-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .65rem;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: .45rem;
  border: 1px solid var(--border);
}

.recipe-item-icon { font-size: 1.1rem; }

.recipe-item-info { flex: 1; min-width: 0; }
.recipe-item-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-item-kcal { font-size: .77rem; color: var(--text-muted); }

.recipe-item-amount {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.recipe-item-amount input {
  width: 68px;
  padding: .28rem .45rem;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  font-size: .88rem;
  text-align: right;
  background: #fff;
}

.recipe-item-amount input:focus {
  outline: none;
  border-color: var(--green);
}

.recipe-item-amount span { font-size: .82rem; color: var(--text-muted); }

.recipe-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: .2rem .35rem;
  border-radius: 4px;
  transition: color .12s;
}
.recipe-item-remove:hover { color: var(--red); }

.recipe-item-lock {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: .18rem .38rem;
  border-radius: 5px;
  transition: color .12s, border-color .12s, background .12s;
}
.recipe-item-lock:hover {
  border-color: var(--red);
  color: var(--red);
}
.recipe-item-lock.active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(220, 53, 69, .08);
}

/* Cook toggle (gekocht / ungekocht) */
.cook-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.cook-opt {
  padding: .22rem .48rem;
  font-size: .72rem;
  background: #fff;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  white-space: nowrap;
}

.cook-opt + .cook-opt {
  border-left: 1.5px solid var(--border);
}

.cook-opt.active {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.recipe-totals {
  border-top: 2px solid var(--border);
  padding-top: .75rem;
  margin-top: .5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  padding: .2rem 0;
}

.total-row span:last-child { font-weight: 700; }

/* Recipe action buttons */
.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* Optimize notification */
.optimize-notification {
  background: var(--yellow-light);
  border: 1.5px solid var(--yellow);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-top: .75rem;
  font-size: .85rem;
}

.optimize-notification ul {
  list-style: disc;
  margin: .4rem 0 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

/* Multiply panel */
.multiply-panel {
  margin-top: .75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg);
}

.multiply-controls {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}

.multiply-controls label {
  font-weight: 600;
  font-size: .9rem;
}

.multiply-controls input[type="number"] {
  width: 5rem;
  padding: .35rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  text-align: center;
}

.multiply-controls input[type="number"]:focus {
  outline: none;
  border-color: var(--green);
}

.multiply-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
}

.multiply-table th,
.multiply-table td {
  padding: .4rem .6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.multiply-table th {
  font-weight: 700;
  background: var(--green-light);
  color: var(--green-dark);
}

.multiply-table .multiply-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.multiply-table tfoot .multiply-total-row td {
  background: var(--green-pale);
  font-size: .85rem;
}

.multiply-note {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .6rem;
}

.multiply-empty {
  color: var(--text-muted);
  font-size: .85rem;
}

/* Custom Ingredient Form */
.custom-ingredient-section { margin-top: .75rem; }

.custom-form {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: .75rem;
  background: var(--bg);
}

.custom-form h4 { margin-bottom: .75rem; font-size: 1rem; }

.mini-form { display: flex; flex-direction: column; gap: .6rem; }

.mini-form input,
.mini-form select {
  width: 100%;
  padding: .45rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .88rem;
  background: #fff;
}

.mini-form input:focus,
.mini-form select:focus {
  outline: none;
  border-color: var(--green);
}

.nutrition-inputs label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: .4rem;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}

.btn-row {
  display: flex;
  gap: .5rem;
  margin-top: .25rem;
}

/* ---------- Nutrition Overview ---------- */
.overview-header { margin-bottom: 1.5rem; }

.daily-info h3 { margin-bottom: 1rem; font-size: 1.1rem; }

.daily-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}

.stat {
  background: var(--bg);
  border-radius: 8px;
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  border: 1px solid var(--border);
}

.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--green-dark); }

.nutrition-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.nutrition-card h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--green-dark);
  border-bottom: 2px solid var(--green-light);
  padding-bottom: .4rem;
}

/* Nutrient Bars */
.nutrient-bar-item {
  margin-bottom: .85rem;
}

.nutrient-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  margin-bottom: .25rem;
}

.nutrient-bar-name { font-weight: 600; }
.nutrient-bar-value { color: var(--text-muted); }

.nutrient-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: visible;
  position: relative;
}

.nutrient-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease, background .4s;
  max-width: 100%;
  min-width: 0;
}

.bar-low      { background: var(--red); }
.bar-medium   { background: var(--yellow); }
.bar-good     { background: var(--green); }
.bar-high     { background: var(--orange); }

.nutrient-bar-percent {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: .1rem;
  display: block;
}

.ca-p-ratio {
  margin-top: .85rem;
  padding: .65rem .85rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: .88rem;
  border: 1px solid var(--border);
}

/* Nutrition Table */
.details-table { overflow-x: auto; }
.details-table h4 { margin-bottom: 1rem; color: var(--green-dark); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead th {
  background: var(--green-pale);
  padding: .65rem .85rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--green-light);
  white-space: nowrap;
}

tbody td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--green-pale); }

.coverage-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
}

.cov-low    { background: var(--red-light);    color: var(--red); }
.cov-medium { background: var(--yellow-light); color: #664d03; }
.cov-good   { background: var(--green-light);  color: var(--green-dark); }
.cov-high   { background: var(--orange-light); color: #7a3b00; }

/* Supplements Box */
.supplement-box {
  margin-top: 1.5rem;
}

.supplement-box h4 {
  color: var(--green-dark);
  margin-bottom: .75rem;
  font-size: 1rem;
}

.supplement-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .65rem;
}

.supplement-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .7rem .85rem;
  border-radius: 8px;
  font-size: .87rem;
  border: 1px solid var(--border);
}

.supplement-item.required {
  background: var(--red-light);
  border-color: #f5c6cb;
}

.supplement-item.recommended {
  background: var(--yellow-light);
  border-color: #ffeeba;
}

.supplement-item.optional {
  background: var(--blue-light);
  border-color: #bee5eb;
}

/* ---------- Vegan Tips ---------- */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.tip-card { display: flex; flex-direction: column; gap: .65rem; }

.tip-card-wide { grid-column: 1 / -1; }

.tip-icon { font-size: 2rem; }

.tip-card h3 {
  font-size: 1.05rem;
  color: var(--green-dark);
}

.tip-card p { font-size: .9rem; }

.tip-list { display: flex; flex-direction: column; gap: .4rem; }
.tip-list li { font-size: .88rem; padding-left: .2rem; }

.tip-list.danger li { color: var(--red); }

.tip-note {
  background: var(--yellow-light);
  border: 1px solid var(--yellow);
  border-radius: 6px;
  padding: .55rem .75rem;
  font-size: .83rem;
  color: #664d03;
}

.vet-note {
  background: var(--blue-light);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: .55rem .75rem;
  font-size: .83rem;
  color: #0c5460;
  margin-top: .4rem;
}

/* ---------- Conditions Accordion ---------- */
.vet-warning-box {
  background: var(--red-light);
  border: 1.5px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .93rem;
  color: #842029;
}

.conditions-accordion { display: flex; flex-direction: column; gap: .75rem; }

.condition-item {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calculator-tips { margin-bottom: 1.25rem; }

.condition-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background .14s;
}

.condition-header:hover { background: var(--green-pale); }

.condition-icon { font-size: 1.4rem; }

.condition-header h3 {
  flex: 1;
  font-size: 1.05rem;
  color: var(--green-dark);
  margin: 0;
}

.toggle-icon {
  font-size: .85rem;
  color: var(--text-muted);
  transition: transform .2s;
}

.condition-item.open .toggle-icon { transform: rotate(180deg); }

.condition-content {
  display: none;
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

.condition-item.open .condition-content { display: block; }

.condition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.condition-grid h4 {
  font-size: .92rem;
  color: var(--green-dark);
  margin-bottom: .5rem;
}

.condition-grid ul {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.condition-grid ul li { font-size: .88rem; }

.ingredient-list-info { display: flex; flex-direction: column; gap: .3rem; }
.ingredient-list-info li { font-size: .85rem; }
.ingredient-list-info.good li::marker { color: var(--green); }
.ingredient-list-info.bad  li::marker { color: var(--red); }

.condition-note {
  background: var(--blue-light);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: .65rem .9rem;
  font-size: .85rem;
  color: #0c5460;
}

.condition-breeds {
  margin-top: 1rem;
  background: var(--yellow-light);
  border: 1px solid var(--yellow);
  border-radius: 6px;
  padding: .75rem 1rem;
  font-size: .85rem;
}

.condition-breeds h4 {
  font-size: .88rem;
  color: var(--text);
  margin-bottom: .45rem;
}

.condition-breeds ul {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .75rem;
  margin-bottom: .55rem;
}

.condition-breeds ul li { font-size: .83rem; }

.condition-breeds .breeds-note {
  font-size: .8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Disclaimer ---------- */
.disclaimer-box {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.disclaimer-icon { font-size: 3rem; margin-bottom: 1rem; }

.disclaimer-box h2 {
  font-size: 1.5rem;
  color: var(--green-dark);
  justify-content: center;
  margin-bottom: 1.25rem;
}

.disclaimer-content {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.disclaimer-content p,
.disclaimer-content ul li { font-size: .93rem; color: var(--text); }

.disclaimer-content ul {
  list-style: disc;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.disclaimer-highlight {
  background: var(--green-light);
  border: 1.5px solid var(--green);
  border-radius: 8px;
  padding: .85rem 1.1rem;
  color: var(--green-dark);
  font-size: .95rem !important;
  text-align: center;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: 1.75rem 1.25rem;
}

.footer p { font-size: .9rem; }
.footer .footer-note { font-size: .78rem; opacity: .7; margin-top: .3rem; }
.footer a { color: #fff; text-decoration: underline; }
.footer a:hover { opacity: .85; }
.footer-legal-links {
  margin-top: .45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  flex-wrap: wrap;
  font-size: .84rem;
}
.footer-legal-links a {
  font-weight: 700;
  opacity: 1;
}
.footer-legal-links span {
  opacity: .65;
}

/* ---------- Scrollbar ---------- */
.ingredient-list::-webkit-scrollbar { width: 6px; }
.ingredient-list::-webkit-scrollbar-track { background: var(--bg); }
.ingredient-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .condition-grid  { grid-template-columns: 1fr; }
  .nutrition-cards { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: #fff; border-bottom: 2px solid var(--green-light); padding: .75rem 1.25rem; gap: .2rem; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .hero h1 { font-size: 1.75rem; }
  .form-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .daily-stats { grid-template-columns: 1fr 1fr; }
  .supplement-list { grid-template-columns: 1fr; }
  table { font-size: .78rem; }
  thead th, tbody td { padding: .45rem .5rem; }
}

@media (max-width: 480px) {
  .daily-stats { grid-template-columns: 1fr; }
  .nutrition-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.45rem; }

  /* Recipe item: 2-row grid so cook-toggle doesn't overflow on narrow screens */
  .recipe-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: .3rem .5rem;
    align-items: center;
  }
  .recipe-item-icon   { grid-column: 1; grid-row: 1; }
  .recipe-item-info   { grid-column: 2; grid-row: 1; min-width: 0; }
  .recipe-item-amount { grid-column: 3; grid-row: 1; }
  .recipe-item-lock   { grid-column: 4; grid-row: 1; }
  .recipe-item-remove { grid-column: 5; grid-row: 1; }
  /* Cook-toggle (optional) spans the full width in row 2 */
  .cook-toggle        { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Mobile landscape ---------- */
@media (max-width: 900px) and (orientation: landscape) {
  .nav-container { height: auto; min-height: 60px; }
  .nav-links { flex-wrap: wrap; }
  .hero { padding: 1.5rem 1.25rem; }
  .hero h1 { font-size: 1.5rem; }
}

/* ---------- Ingredient source badge & dose hint ---------- */
.ingredient-source-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 10px;
  background: var(--blue-light);
  color: #0c5460;
  margin-left: .35rem;
  cursor: help;
}
.ingredient-dose-hint {
  display: block;
  font-size: .74rem;
  color: var(--green-dark);
  font-weight: 600;
  margin-top: .15rem;
}

/* ---------- Category–Macro hint ---------- */
.category-macro-hint {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .85rem;
  margin: .55rem 0 .75rem;
  padding: .55rem .75rem;
  background: var(--green-pale);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--text-muted);
}
.cmh-item {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.cmh-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cmh-protein { background: #4a90d9; }
.cmh-fat     { background: #f5a623; }
.cmh-carbs   { background: #7ed321; }
.cmh-supp    { background: #b0b0b0; }

/* ---------- Save & Saved-Recipes UI ---------- */
.save-recipe-form {
  margin-top: .65rem;
  padding: .75rem 1rem;
  background: var(--green-pale);
  border: 1.5px solid var(--green-light);
  border-radius: 8px;
}

.save-recipe-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.save-recipe-row input,
.save-recipe-row select {
  flex: 1;
  min-width: 160px;
  padding: .38rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  background: #fff;
}

.save-recipe-row input:focus,
.save-recipe-row select:focus {
  outline: none;
  border-color: var(--green);
}

.saved-recipes-section {
  margin-top: .85rem;
  border-top: 1px solid var(--border);
  padding-top: .65rem;
}

.saved-recipes-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem 0;
}

.saved-recipes-toggle:hover { text-decoration: underline; }

.saved-recipes-container {
  margin-top: .6rem;
}

.saved-recipe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: .45rem;
  flex-wrap: wrap;
}

.saved-recipe-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.saved-recipe-name {
  font-weight: 600;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-recipe-meta {
  font-size: .76rem;
  color: var(--text-muted);
}

.saved-recipe-actions {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
}

.saved-profile-select {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.saved-profile-select input[type="checkbox"] {
  accent-color: var(--green);
}

.saved-recipes-empty {
  font-size: .85rem;
  color: var(--text-muted);
  padding: .4rem 0;
}

.saved-profiles-empty {
  font-size: .85rem;
  color: var(--text-muted);
  padding: .4rem 0;
}

.pantry-section h4 {
  margin: .85rem 0 .35rem;
  color: var(--green-dark);
}

.pantry-row-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .76rem;
  color: var(--text-muted);
}

.pantry-amount-input {
  width: 80px;
}

.multi-profile-recipe {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .75rem;
  margin-bottom: .5rem;
  background: var(--bg);
}

.multi-profile-recipe h5 {
  margin-bottom: .35rem;
  color: var(--green-dark);
}

/* ---------- PDF / Print action row ---------- */
.print-action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.print-hint {
  font-size: .82rem;
  color: var(--text-muted);
}

.print-controls-stack {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.print-layout-panel {
  margin-top: 0;
}

.print-layout-panel h4 {
  margin-bottom: .45rem;
}

.print-layout-hint {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
}

.print-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .6rem .9rem;
}

.print-layout-item {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.print-layout-item label {
  font-size: .85rem;
}

.print-layout-field {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.print-empty-text {
  color: var(--text-muted);
  font-size: 10pt;
}

/* ---------- Print-only elements (hidden in browser) ---------- */
.print-only {
  display: none;
}

/* ---------- Print ---------- */
@page {
  margin: 1.5cm;
}

@media print {
  body.dark-mode {
    --bg:          #f8f9fa;
    --surface:     #ffffff;
    --border:      #dee2e6;
    --text:        #212529;
    --text-muted:  #6c757d;
    --green-pale:  #f0faf3;
    --green-light: #d4edda;
  }

  /* Hide non-essential sections */
  .navbar, .hero, #rechner, #vegane-tipps, #krankheiten, #hinweis, .footer,
  .no-print, #no-profile-warning, .print-action-row {
    display: none !important;
  }

  /* Show print-only elements */
  .print-only {
    display: block !important;
  }

  .print-layout-hidden {
    display: none !important;
  }

  .print-layout-page-break {
    break-before: page;
    page-break-before: always;
  }

  /* Page setup */
  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  section {
    padding: .5rem 0 !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  h2 {
    font-size: 15pt;
    border-bottom: 1.5pt solid #000;
    padding-bottom: 3pt;
    margin-bottom: 8pt;
  }

  h4 {
    font-size: 11pt;
    margin-bottom: 4pt;
  }

  /* Print header with dog profile */
  #print-meta {
    margin-bottom: 14pt;
    padding: 8pt 10pt;
    border: 1pt solid #ccc;
    border-radius: 4pt;
    background: #f8f8f8;
  }
  .print-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8pt;
    margin-bottom: 8pt;
  }
  .print-section-title span {
    font-size: 9pt;
    color: #555;
  }
  .print-section-title h3 {
    margin: 0;
    font-size: 12pt;
  }
  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8pt;
    font-size: 10pt;
  }
  .print-meta-item {
    border: 0.5pt solid #d7d7d7;
    border-radius: 4pt;
    background: #fff;
    padding: 5pt 6pt;
    display: flex;
    flex-direction: column;
    gap: 2pt;
  }
  .print-meta-label {
    font-size: 8pt;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .03em;
  }

  /* Card / layout overrides */
  .card {
    box-shadow: none;
    border: 1pt solid #ccc;
    background: #fff !important;
    color: #000 !important;
    break-inside: avoid;
    padding: 8pt !important;
  }

  .section-light {
    background: #fff !important;
  }

  /* Overview header (page flow is controlled via print layout settings) */
  .overview-header {
    margin-bottom: 12pt;
  }

  .daily-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  /* All 3 nutrition cards in one row on page 2 */
  .nutrition-cards {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8pt !important;
    margin-bottom: 12pt;
  }

  /* Reduce nutrition card text to fit three columns on one page */
  .nutrition-card {
    font-size: 9pt;
  }
  .nutrition-card h4 {
    font-size: 10pt;
    margin-bottom: 3pt;
  }
  .nutrient-bar-name {
    font-size: 8pt;
  }
  .nutrient-bar-value {
    font-size: 8pt;
  }
  .nutrient-bar-percent {
    font-size: 7pt;
  }
  .nutrient-bar-track {
    height: 5pt;
  }

  /* Bars */
  .nutrient-bar-track,
  .nutrient-bar-fill,
  thead,
  .ratio-bar,
  .ratio-seg {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Table */
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
  }
  thead th, tbody td {
    border: 0.5pt solid #ccc;
    padding: 3pt 5pt;
  }
  thead { background: #f0f0f0; }

  /* Ratio panel */
  .macro-ratio-card { break-inside: avoid; }

  /* Print recipe summary (no forced page break – Tagesbedarf follows on same page) */
  #print-recipe {
    margin-top: 12pt;
    margin-bottom: 14pt;
  }
  #print-multiply {
    margin-top: 12pt;
    margin-bottom: 14pt;
  }
  .print-recipe-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }
  .print-recipe-table th,
  .print-recipe-table td {
    border: 0.5pt solid #ccc;
    padding: 4pt 6pt;
    text-align: left;
  }
  .print-recipe-table thead { background: #f0f0f0; }
  .print-recipe-table tfoot td { font-weight: bold; background: #f8f8f8; }

  #nutrition-overview {
    display: block !important;
  }
  #nutrition-overview > * {
    margin-bottom: 12pt;
  }
  #nutrition-overview > *:last-child {
    margin-bottom: 0;
  }
  /* Section profil hidden */
  #profil { display: none !important; }
}

/* =========================================================
   Macro Ratio Panel  (5+1 Nährwerte)
   ========================================================= */
.macro-ratio-card {
  margin-top: 1.5rem;
}

.combined-ingredients-card {
  margin-top: 1rem;
}
.combined-ingredients-title {
  font-size: 1rem;
  color: var(--green-dark);
  margin-bottom: .35rem;
}
.combined-ingredients-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.combined-ingredients-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.combined-ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .5rem .65rem;
  border-radius: .55rem;
  background: var(--green-light);
}
.combined-ingredient-name {
  font-weight: 600;
  color: var(--text-main);
}
.combined-ingredient-amount {
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
}
.combined-ingredients-empty {
  font-size: .86rem;
  color: var(--text-muted);
}

/* Header */
.ratio-header {
  margin-bottom: 1.25rem;
}
.ratio-title-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .6rem;
}
.ratio-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: .1rem;
}
.ratio-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .2rem;
}
.ratio-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.ratio-cond-badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 20px;
  padding: .25rem .85rem;
  font-size: .8rem;
  font-weight: 600;
}

/* Two-column grid */
.ratio-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

/* Energy section */
.ratio-section-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

/* Legend */
.ratio-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .8rem;
  margin-bottom: .75rem;
  color: var(--text-muted);
}
.ratio-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.ratio-dot.ratio-protein { background: #4a90d9; }
.ratio-dot.ratio-fat     { background: #f5a623; }
.ratio-dot.ratio-carbs   { background: #7ed321; }

/* Rows (Ziel / Rezept) */
.ratio-rows {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: .85rem;
}
.ratio-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ratio-row-label {
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  width: 4.5rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Stacked bar */
.ratio-bar {
  flex: 1;
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ratio-bar.ratio-empty {
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
}
.ratio-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  white-space: nowrap;
  overflow: hidden;
  transition: width .3s ease;
}
.ratio-protein { background: #4a90d9; }
.ratio-fat     { background: #f5a623; }
.ratio-carbs   { background: #7ed321; }

/* Delta chips */
.ratio-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .1rem;
}
.delta-chip {
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 12px;
}
.delta-ok   { background: var(--green-light);  color: var(--green-dark); }
.delta-high { background: var(--orange-light); color: #7a3b00; }
.delta-low  { background: var(--yellow-light); color: #664d03; }

/* Qualitative section */
.ratio-qual-section {
  min-width: 220px;
  max-width: 280px;
}
.ratio-qual-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .55rem;
}
.ratio-qual-label {
  font-size: .78rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ratio-qual-track {
  width: 80px;
  height: 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.ratio-qual-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
}
.ratio-qual-pct {
  font-size: .74rem;
  font-weight: 600;
  width: 2.5rem;
  text-align: right;
  flex-shrink: 0;
  color: var(--text-muted);
}
.ratio-note {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .65rem;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 700px) {
  .ratio-grid {
    grid-template-columns: 1fr;
  }
  .ratio-qual-section {
    max-width: 100%;
  }
}

/* =========================================================
   Target Editor (inline macro-target customizer)
   ========================================================= */
.target-editor-toggle {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .85rem;
  color: var(--green-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn-link:hover {
  text-decoration: underline;
}
.btn-link em {
  font-style: normal;
  font-weight: 600;
}

.target-editor {
  margin-top: .85rem;
  padding: 1rem 1.1rem;
  background: var(--green-pale);
  border: 1px solid var(--green-light);
  border-radius: var(--radius);
}
.target-editor-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .85rem;
  line-height: 1.5;
}

.target-sliders {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-bottom: .85rem;
}
.target-slider-row {
  display: grid;
  grid-template-columns: 130px 1fr 54px;
  align-items: center;
  gap: .6rem;
}
.target-slider-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.target-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}
.target-slider-val {
  font-size: .82rem;
  font-weight: 700;
  color: var(--green-dark);
  text-align: right;
}

.target-sum-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  margin-bottom: .9rem;
}
.target-sum-row > span:first-child {
  font-weight: 600;
  color: var(--text-muted);
}
.sum-ok   { font-weight: 700; color: var(--green-dark); }
.sum-warn { font-weight: 700; color: var(--orange); }
.target-sum-hint {
  font-size: .76rem;
  color: var(--text-muted);
}

.target-editor-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}
.btn-sm {
  padding: .3rem .75rem;
  font-size: .82rem;
}

@media (max-width: 560px) {
  .target-slider-row {
    grid-template-columns: 1fr 2fr 44px;
  }
}

/* =========================================================
   DARK MODE
   ========================================================= */
body.dark-mode {
  --bg:          #121212;
  --surface:     #1e1e1e;
  --border:      #333;
  --text:        #e0e0e0;
  --text-muted:  #9e9e9e;
  --heading-accent: #b7f5c6;
  --green-pale:  #0a1f0f;
  --green-light: #1a3a23;
  --shadow:      0 2px 12px rgba(0,0,0,.4);
  --shadow-lg:   0 4px 24px rgba(0,0,0,.6);
}

body.dark-mode .navbar {
  background: #1a1a1a;
  border-bottom-color: #333;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select {
  background: #2a2a2a;
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus {
  background: #333;
}

body.dark-mode .ingredient-search input,
body.dark-mode .ingredient-search select {
  background: #2a2a2a;
  color: var(--text);
  border-color: #444;
}

body.dark-mode .recipe-item-amount input,
body.dark-mode .cook-opt,
body.dark-mode .mini-form input,
body.dark-mode .mini-form select {
  background: #2a2a2a;
  color: var(--text);
  border-color: #444;
}

body.dark-mode .cook-opt + .cook-opt {
  border-left-color: #444;
}

body.dark-mode .cook-opt.active {
  background: var(--green);
  color: #fff;
}

body.dark-mode .optimize-notification {
  background: #2e2600;
  border-color: #7a6000;
  color: var(--text);
}

body.dark-mode .btn-danger {
  background: #4a2028;
  color: #ffc7d0;
  border-color: #b45f6a;
}

body.dark-mode .btn-danger:hover {
  background: #b45f6a;
  color: #fff;
  border-color: #b45f6a;
}

body.dark-mode .badge-protein   { background: #1d3042; color: #9ec5ff; }
body.dark-mode .badge-dryfood   { background: #1b2b3f; color: #99c4f3; }
body.dark-mode .badge-grain     { background: #3b2d15; color: #ffd49b; }
body.dark-mode .badge-vegetable { background: #1f3a28; color: #b7f5c6; }
body.dark-mode .badge-fruit     { background: #3a1f2d; color: #ffb6c1; }
body.dark-mode .badge-oil       { background: #2e213b; color: #d2b4f0; }
body.dark-mode .badge-supplement{ background: #173436; color: #9ee3dc; }

body.dark-mode .tip-note {
  background: #35280c;
  border-color: #a67f16;
  color: #ffe8ad;
}

body.dark-mode .vet-note {
  background: #102630;
  border-color: #2f7381;
  color: #bdeaf2;
}

body.dark-mode .condition-alert,
body.dark-mode .validation-warn {
  background: #35280c;
  border-color: #a67f16;
  color: #ffe8ad;
}

body.dark-mode .validation-danger {
  background: #3a1d24;
  border-color: #b45f6a;
  color: #ffd7df;
}

body.dark-mode .nav-links {
  background: #1a1a1a;
  border-bottom-color: #2b4a34;
}

body.dark-mode .info-warning  { background: #33280a; border-color: #c09000; color: #e8c642; }
body.dark-mode .info-info     { background: #0a1f2a; border-color: #1a7a8a; color: #7ecfdf; }
body.dark-mode .info-success  { background: #1b3a24; border-color: #4f9d64; color: #dff5e6; }
body.dark-mode .info-danger   { background: #3a1d24; border-color: #b45f6a; color: #ffd7df; }
body.dark-mode .save-recipe-row input,
body.dark-mode .save-recipe-row select {
  background: #2a2a2a;
  color: var(--text);
  border-color: #444;
}

/* Dark mode: supplement recommendations */
body.dark-mode .supplement-box h4,
body.dark-mode .disclaimer-box h2 {
  color: var(--heading-accent);
}

body.dark-mode .supplement-item {
  color: #f1f5f2;
}

body.dark-mode .supplement-item strong {
  color: inherit;
}

body.dark-mode .supplement-item.required {
  background: #3a1f24;
  border-color: #9a4d59;
}

body.dark-mode .supplement-item.recommended {
  background: #35280c;
  border-color: #a67f16;
}

body.dark-mode .supplement-item.optional {
  background: #102630;
  border-color: #2f7381;
}

body.dark-mode .disclaimer-highlight {
  background: #1d3b26;
  border-color: #4f9d64;
  color: #e7f7eb;
}

/* Dark mode toggle button */
.btn-dark-mode {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: .3rem .45rem;
  border-radius: 6px;
  transition: background .15s;
  margin-right: .25rem;
}
.btn-dark-mode:hover { background: var(--green-light); }

.btn-dark-mode::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 170px;
  max-width: 280px;
  padding: .45rem .6rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  pointer-events: none;
}

.btn-dark-mode:hover::after,
.btn-dark-mode:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-header-cache-spacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .45rem;
  font-size: 1.1rem;
  line-height: 1;
  margin-right: .25rem;
  flex-shrink: 0;
  visibility: hidden;
  pointer-events: none;
}

body.dark-mode .btn-header-cache:hover,
body.dark-mode .btn-header-cache:focus-visible {
  background: #47242b;
}

body.dark-mode .btn-header-cache::after,
body.dark-mode .btn-dark-mode::after {
  background: #262626;
  border-color: #444;
  color: #f2f2f2;
}

.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.popup-dialog {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  padding: 1rem 1rem .9rem;
}

.popup-title {
  margin: 0 0 .5rem;
  color: var(--green-dark);
  font-size: 1.08rem;
}

.popup-message {
  margin: 0;
  color: var(--text);
  white-space: pre-line;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  margin-top: 1rem;
}

body.dark-mode .popup-dialog {
  background: #232323;
  border-color: #444;
}

body.dark-mode .popup-title {
  color: var(--heading-accent);
}

/* =========================================================
   PROFILE FORM EXTRAS
   ========================================================= */
.label-hint {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: .35rem;
}

.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.form-group-wide {
  grid-column: 1 / -1;
}

.form-group-checkbox {
  justify-content: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

/* BCS slider row */
.bcs-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .4rem;
}

.bcs-row input[type="range"] {
  flex: 1;
  accent-color: var(--green);
  cursor: pointer;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: var(--green);
}

.bcs-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.bcs-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--green-dark);
  margin-top: -5px;
}

.bcs-row input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.bcs-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--green-dark);
}

.bcs-row input[type="range"].bcs-overweight-lock {
  background: linear-gradient(90deg, #ced4da calc(100% * 5 / 9), var(--green) calc(100% * 5 / 9));
}

.bcs-row output {
  min-width: 22px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
  text-align: center;
}

.bcs-display {
  padding: .35rem .75rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  margin-top: .25rem;
}

.bcs-good   { background: var(--green-light);  color: var(--green-dark); }
.bcs-warn   { background: var(--yellow-light); color: #6d4000; }
.bcs-danger { background: var(--red-light);    color: var(--red); }
.bcs-info   { background: var(--bg);           color: var(--text-muted); }

/* =========================================================
   MOBILE CALCULATOR TABS
   ========================================================= */
.calc-tabs {
  display: none;
  gap: .5rem;
  margin-bottom: 1rem;
}

.calc-tab {
  flex: 1;
  padding: .6rem 1rem;
  border: 2px solid var(--green-light);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.calc-tab.active {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: var(--green);
}

@media (max-width: 700px) {
  .calc-tabs { display: flex; }
  .tab-hidden { display: none !important; }
}

/* =========================================================
   RECENTLY USED INGREDIENTS
   ========================================================= */
.recently-used-list {
  margin: .75rem 0;
  border: 1px solid var(--green-light);
  border-radius: 8px;
  background: var(--green-pale);
  overflow: hidden;
}

.recent-header {
  padding: .45rem .75rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-light);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .75rem;
  border-top: 1px solid var(--green-light);
}

.recent-item-name {
  font-size: .88rem;
  color: var(--text);
}

/* =========================================================
   VALIDATION WARNINGS
   ========================================================= */
#validation-warnings {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.validation-warning {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border-left: 4px solid;
}

.validation-warn {
  background: var(--yellow-light);
  border-color: var(--orange);
  color: #5a3000;
}

.validation-danger {
  background: var(--red-light);
  border-color: var(--red);
  color: #842029;
}

.validation-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.validation-warning p {
  font-size: .88rem;
  margin-top: .2rem;
  line-height: 1.5;
}

/* =========================================================
   ENERGY DENSITY STAT (Vorschlag 4)
   ========================================================= */
.daily-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem 1.5rem;
}

/* =========================================================
   IMPROVED SECTION SPACING (Vorschlag 5)
   ========================================================= */
.nutrition-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.nutrition-card.card {
  padding: 1.5rem;
}

.nutrition-card h4 {
  margin-bottom: 1rem;
}

.overview-header {
  margin-bottom: 1.5rem;
}

.details-table.card {
  margin-bottom: 1.5rem;
}

#supplement-recommendations.card {
  margin-bottom: 1.25rem;
}

/* =========================================================
   PDF IMPROVEMENTS (Vorschlag 5)
   ========================================================= */
@media print {
  .nutrition-cards { gap: .75rem; }
  .nutrition-card.card { break-inside: avoid; padding: .85rem; }
  .details-table.card { break-inside: auto; }
  #supplement-recommendations.card { break-inside: avoid; }

  /* Reset dark mode colors for print/PDF – prevents near-white text on white background */
  body.dark-mode .supplement-item {
    color: #000;
    background: initial;
    border-color: #ccc;
  }
  body.dark-mode .supplement-item.required     { background: #fdecea; border-color: #f5c6cb; }
  body.dark-mode .supplement-item.recommended  { background: #fff8e1; border-color: #ffeeba; }
  body.dark-mode .supplement-item.optional     { background: #d1ecf1; border-color: #bee5eb; }
  body.dark-mode .supplement-box h4            { color: #1e7e34; }
  body.dark-mode .disclaimer-box h2            { color: #1e7e34; }
  body.dark-mode .disclaimer-highlight         { background: #d4edda; border-color: #28a745; color: #1e7e34; }
}


/* ---------- Embedded info page ---------- */
.info-embed-frame {
  width: 100%;
  min-height: 1200px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .info-embed-frame {
    min-height: 1400px;
  }
}
