/* PfotenKalorien – Design Variables & Styles */

:root {
  --color-background-primary: #ffffff;
  --color-background-secondary: #fafaf8;
  --color-text-primary: #1a1208;
  --color-text-secondary: #6b5a3e;
  --color-text-tertiary: #a08c6e;
  --color-border-tertiary: #e8ddd0;
  --color-border-secondary: #d4c4a8;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
}

input[type="number"] {
  padding: 10px 12px;
  border: 1px solid var(--color-border-tertiary);
  border-radius: 10px;
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-background-primary);
  width: 100%;
  outline: none;
  transition: border-color .15s;
}

input[type="number"]:focus {
  border-color: #BA7517;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.cat-btn {
  padding: 12px;
  border-radius: 16px;
  border: 1.5px solid var(--color-border-tertiary);
  background: var(--color-background-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s;
  width: 100%;
}

.cat-btn:hover { border-color: var(--color-border-secondary); }

.cat-btn.selected {
  border: 2px solid #BA7517;
  background: #FAEEDA;
}

.cat-btn.selected .cat-label { color: #633806; }
.cat-btn.selected .cat-sub   { color: #854F0B; }

.cat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  display: block;
}

.cat-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  display: block;
  margin-top: 2px;
}

.result-card {
  background: #FAEEDA;
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1.5px solid #EF9F27;
}

.metric {
  background: var(--color-background-primary);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}

.metric-label {
  font-size: 12px;
  color: #854F0B;
  margin: 0 0 4px;
}

.metric-value {
  font-size: 24px;
  font-weight: 500;
  color: #412402;
  margin: 0;
}

.warn-box {
  background: #FFF8EE;
  border: 1px solid #FAC775;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 12px;
}

.card {
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-2-sm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  display: block;
  margin-bottom: 4px;
}

.optional-tag {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.required-star { color: #D85A30; }

.calc-btn {
  width: 100%;
  padding: 14px;
  background: #BA7517;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  margin-top: 0.5rem;
}

.calc-btn:hover { background: #9f6212; }

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1rem;
}

.result-title {
  font-size: 15px;
  font-weight: 500;
  color: #412402;
  margin: 0 0 1rem;
}

.warn-text {
  font-size: 12px;
  color: #854F0B;
  margin: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.category-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0 0 10px;
}

#category-section { margin-top: 1rem; }

/* Layout */
.wrapper { padding: 1.5rem 0; max-width: 600px; margin: 0 auto; }

/* Header */
.header { display: flex; align-items: center; gap: 12px; margin-bottom: 2rem; }
.header-icon { width: 44px; height: 44px; border-radius: 50%; background: #FAEEDA; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.header-title { font-size: 20px; font-weight: 500; margin: 0; color: var(--color-text-primary); }
.header-sub { font-size: 13px; color: var(--color-text-secondary); margin: 0; }

/* Section label */
.section-label-note { font-weight: 400; color: var(--color-text-tertiary); }

/* Checkbox */
.checkbox { width: 16px; height: 16px; accent-color: #BA7517; }
.checkbox-text { font-size: 14px; color: var(--color-text-primary); }

/* Category hint */
.category-hint { font-size: 12px; color: var(--color-text-secondary); margin: 1rem 0 10px; }

/* Moisture custom */
.moisture-custom-wrap { margin-top: 12px; }

/* Moisture direct */
#moisture-direct-section { margin-top: 1rem; }

/* Metrics last row */
.metrics-grid--last { margin-bottom: 0; }

/* Error box hidden by default */
.error-box { display: none; margin-top: 1rem; }

/* warn-nfe hidden by default */
#warn-nfe { display: none; margin-top: 12px; }


.hidden {
    display: none;
}



/* ── Tooltip ── */
.has-tooltip {
  position: relative;
  cursor: help;
  display: inline-block;
}

.has-tooltip::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, currentColor 30%, currentColor 70%, transparent);
  opacity: 0.35;
  transition: opacity 0.2s ease;
}
.has-tooltip:hover::after { opacity: 0.7; }

.has-tooltip [role="tooltip"] {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 240px;
  padding: 10px 13px;
  background: #fff;           /* deine --bg-Variable hier */
  border: 0.5px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  font-size: 12.5px;
  line-height: 1.6;
  color: #555;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
}

/* Pfeil oben */
.has-tooltip [role="tooltip"]::before {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ccc;
}
.has-tooltip [role="tooltip"]::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5.5px solid transparent;
  border-top-color: #fff;
  margin-top: -1px;
}

.has-tooltip:hover [role="tooltip"],
.has-tooltip:focus-within [role="tooltip"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 10px;
  opacity: 0.45;
  vertical-align: middle;
  margin-left: 4px;
  transition: opacity 0.15s ease;
}
.has-tooltip:hover .tooltip-icon { opacity: 0.9; }