.tg-food-waste-calculator,
.tg-food-waste-calculator * { box-sizing: border-box; }

.tg-food-waste-calculator {
  --tg-fwc-brand: #06485F;
  --tg-fwc-primary: #06485F;
  --tg-fwc-highlight: #06485F;
  --tg-fwc-text: #163237;
  --tg-fwc-muted: rgba(22, 50, 55, .68);
  --tg-fwc-border: rgba(12, 70, 80, .14);
  --tg-fwc-soft: #f4f8f7;
  color: var(--tg-fwc-text);
  font-family: inherit;
}

.tg-fwc-shell {
  min-height: 100%;
  padding: clamp(1rem, 2vw, 1.5rem);
  border-radius: 1rem;
  background: #fff;
  color: var(--tg-fwc-text);
  overflow: hidden;
  border: 1px solid var(--tg-fwc-border);
  box-shadow: 0 18px 50px rgba(12,70,80,.08);
}

.tg-fwc-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.tg-fwc-header h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #1D1D1B; }
.tg-fwc-logo, .tg-fwc-logo-placeholder { width: auto; height: clamp(36px, 7vw, 64px); object-fit: contain; flex: 0 0 auto; }
.tg-fwc-logo-placeholder { width: clamp(36px, 7vw, 64px); border-radius: .6rem; background: var(--tg-fwc-soft); border: 1px solid var(--tg-fwc-border); }

.tg-fwc-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); gap: clamp(1rem, 2vw, 1.5rem); align-items: start; }
.tg-fwc-results { min-width: 0; display: grid; gap: 1.25rem; }
.tg-fwc-settings { position: sticky; top: 1rem; min-width: 0; }
.tg-fwc-settings-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; border: 1px solid rgba(12,70,80,.18); background: var(--tg-fwc-brand); color: #fff; border-radius: .9rem; padding: .9rem 1rem; font: inherit; font-weight: 800; cursor: pointer; }
.tg-fwc-settings-toggle__icon { width: 1.6rem; height: 1.6rem; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 1.25rem; line-height: 1; }
.tg-fwc-settings-body { display: none; margin-top: .75rem; padding: 1rem; }
.tg-fwc-settings-body.is-open { display: block; }
.tg-fwc-input-stack { display: grid; gap: 1rem; padding: 1rem; border: 1px solid var(--tg-fwc-border); border-radius: 1rem; background: #f8fbfa; }

.tg-fwc-slider-block { display: grid; grid-template-columns: 1fr auto; gap: .45rem .9rem; align-items: center; min-width: 0; }
.tg-fwc-slider-block .tg-fwc-label { grid-column: 1 / -1; }
.tg-fwc-label { font-size: .9rem; color: var(--tg-fwc-muted); font-weight: 700; }
.tg-fwc-slider-horizontal { appearance: none; width: 100%; height: .55rem; border-radius: 999px; outline: none; background: linear-gradient(90deg, var(--tg-fwc-range-from) 0%, var(--tg-fwc-range-to) var(--tg-fwc-range-pct), rgba(6,72,95,.12) var(--tg-fwc-range-pct), rgba(6,72,95,.12) 100%); cursor: pointer; }
.tg-fwc-slider-horizontal::-webkit-slider-thumb { appearance: none; width: 1.25rem; height: 1.25rem; border-radius: 999px; background: #fff; border: 3px solid var(--tg-fwc-brand); box-shadow: 0 3px 12px rgba(6,72,95,.22); }
.tg-fwc-slider-horizontal::-moz-range-thumb { width: 1.25rem; height: 1.25rem; border-radius: 999px; background: #fff; border: 3px solid var(--tg-fwc-brand); box-shadow: 0 3px 12px rgba(6,72,95,.22); }
.tg-fwc-slider-horizontal.is-active { box-shadow: 0 0 0 4px rgba(6,72,95,.10); }
.tg-fwc-slider-value { font-size: .95rem; font-weight: 800; color: var(--tg-fwc-brand); text-align: right; white-space: nowrap; }

.tg-fwc-control-block { display: grid; gap: .7rem; padding-top: .25rem; }
.tg-fwc-control-block h3 { margin: 0; font-size: 1rem; font-weight: 800; color: #1D1D1B; }
.tg-fwc-bin-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tg-fwc-bin { appearance: none; border: 1px solid rgba(12,70,80,.20); background: #fff; color: var(--tg-fwc-muted); border-radius: .75rem; padding: .62rem .8rem; cursor: pointer; transition: all .18s ease; font: inherit; font-weight: 750; }
.tg-fwc-bin:hover { border-color: rgba(12,70,80,.45); }
.tg-fwc-bin.is-active { border-color: var(--tg-fwc-primary); background: rgba(6,72,95,.10); color: #06485F; box-shadow: 0 6px 18px rgba(6,72,95,.10); }

.tg-fwc-grid { display: grid; gap: 1.25rem; }
.tg-fwc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tg-fwc-card { background: #fff; border: 1px solid var(--tg-fwc-border); border-radius: 1rem; padding: 1rem; box-shadow: 0 10px 28px rgba(12,70,80,.06); }
.tg-fwc-card h3 { margin: 0 0 .8rem; font-size: 1.08rem; font-weight: 800; color: #1D1D1B; }
.tg-fwc-note { margin: .75rem 0 0; font-size: .78rem; color: var(--tg-fwc-muted); line-height: 1.45; }
.tg-fwc-center { text-align: center; }

.tg-fwc-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.tg-fwc-checkbox { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .92rem; color: var(--tg-fwc-text); }
.tg-fwc-checkbox input { accent-color: var(--tg-fwc-primary); }
.tg-fwc-meal-grid { display: grid; gap: .85rem; }
.tg-fwc-meal-slider { display: grid; grid-template-columns: 5.6rem 1fr 4.4rem; gap: .65rem; align-items: center; }
.tg-fwc-meal-slider input { width: 100%; accent-color: var(--tg-fwc-primary); border:none; background-color: #efefef; }
.tg-fwc-meal-name { font-size: .88rem; color: var(--tg-fwc-text); }
.tg-fwc-meal-value { text-align: right; font-weight: 800; color: var(--tg-fwc-brand); font-size: .88rem; }

.tg-fwc-kpi-grid, .tg-fwc-plaus-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tg-fwc-kpi { background: #f8fbfa; border: 1px solid var(--tg-fwc-border); border-radius: .9rem; padding: 1rem; text-align: center; min-width: 0; }
.tg-fwc-kpi-label { color: var(--tg-fwc-muted); font-size: .9rem; margin-bottom: .45rem; font-weight: 750; }
.tg-fwc-kpi-value { font-weight: 850; font-size: clamp(1.15rem, 2vw, 1.65rem); color: var(--tg-fwc-kpi-color, var(--tg-fwc-brand)); line-height: 1.15; overflow-wrap: anywhere; }
.tg-fwc-kpi-note { color: rgba(22,50,55,.58); font-size: .72rem; margin-top: .45rem; line-height: 1.35; }
.tg-fwc-kpi.is-highlight .tg-fwc-kpi-value { color: var(--tg-fwc-primary); }

.tg-fwc-plaus-kpi { position: relative; padding-top: 1.15rem; }
.tg-fwc-plaus-icon { --tg-fwc-fill: 50%; --tg-fwc-icon-color: var(--tg-fwc-brand); --tg-fwc-icon-url: none; position: relative; width: 8rem; height: 8rem; margin: 0 auto .65rem; display: grid; place-items: center; background: transparent; border: 0; overflow: visible; }
.tg-fwc-plaus-icon__mask { position: absolute; inset: .25rem; display: block; background: currentColor; color: var(--tg-fwc-icon-color); -webkit-mask-image: var(--tg-fwc-icon-url); mask-image: var(--tg-fwc-icon-url); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; transition: clip-path .35s ease, opacity .2s ease, transform .18s ease; }
.tg-fwc-plaus-icon__mask--base { opacity: .18; }
.tg-fwc-plaus-icon__mask--fill { opacity: 1; clip-path: inset(calc(100% - var(--tg-fwc-fill)) 0 0 0); }
.tg-fwc-plaus-icon--fallback { color: var(--tg-fwc-icon-color); }
.tg-fwc-plaus-icon__fallback { color: var(--tg-fwc-icon-color); font-size: 2rem; line-height: 1; }
.tg-fwc-plaus-kpi:hover .tg-fwc-plaus-icon { transform: translateY(-2px); transition: transform .18s ease; }
.tg-fwc-plaus-kpi:hover .tg-fwc-plaus-icon__mask--fill { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--tg-fwc-icon-color) 30%, transparent)); }

.tg-fwc-ring { height: 10rem; position: relative; display: grid; place-items: center; }
.tg-fwc-ring svg { width: 100%; height: 100%; max-width: 10rem; overflow: visible; }
.tg-fwc-ring__center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tg-fwc-ring-value { font-size: 1.4rem; font-weight: 850; color: var(--tg-fwc-brand); }
.tg-fwc-green { color: var(--tg-fwc-primary); }
.tg-fwc-bio-mark { color: var(--tg-fwc-primary); font-weight: 850; font-size: 1.15rem; }
.tg-fwc-ring .tg-fwc-bio-leaf { display: block; width: 2.5rem; height: 2.5rem; margin: 0 auto .15rem; }
.tg-fwc-bio-mark { text-align: center; }
.tg-fwc-footer { margin-top: 1rem; font-size: .72rem; color: var(--tg-fwc-muted); line-height: 1.45; }
.tg-fwc-editor-preview { border: 1px dashed var(--tg-fwc-brand); padding: 1rem; background: #f7faf9; }
.tg-fwc-editor-preview p { margin-bottom: 0; }

/* Tellergrammaturen */
.tg-fwc-meal-grams input[type="range"],
.tg-fwc-gram-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #d1d5db !important;
}

.tg-fwc-meal-grams input[type="range"]::-webkit-slider-runnable-track,
.tg-fwc-gram-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: #d1d5db;
}

.tg-fwc-meal-grams input[type="range"]::-moz-range-track,
.tg-fwc-gram-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: #d1d5db;
}

.tg-fwc-settings-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: .08em;
    color: #1D1D1B;
    margin-bottom: 3px;
    margin-top: 5px;
    text-align: center;
}

.tg-fwc-divider {
    border: 0;
    height: 1px;
    background: #e5e7eb;
    margin: 24px 0;
}

.tg-fwc-settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 1120px) {
  .tg-fwc-kpi-grid, .tg-fwc-plaus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .tg-fwc-layout { grid-template-columns: 1fr; }
  .tg-fwc-settings { position: static; order: -1; }
  .tg-fwc-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .tg-fwc-shell { padding: 1rem; border-radius: .75rem; }
  .tg-fwc-header { align-items: flex-start; }
  .tg-fwc-kpi-grid, .tg-fwc-plaus-grid { grid-template-columns: 1fr; }
  .tg-fwc-meal-slider { grid-template-columns: 1fr; gap: .35rem; }
  .tg-fwc-meal-value { text-align: left; }
  .tg-fwc-slider-block { grid-template-columns: 1fr; }
  .tg-fwc-slider-value { text-align: left; }
}

/* Backend-driven extensions */
.tg-fwc-main-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.12;
  font-weight: 850;
  color: #1D1D1B;
  letter-spacing: -.025em;
}

.tg-fwc-scenario {
  display: grid;
  gap: .45rem;
  margin-bottom: .85rem;
  padding: 1rem;
  border: 1px solid var(--tg-fwc-border);
  border-radius: .9rem;
  background: #f8fbfa;
}

.tg-fwc-select {
  width: 100%;
  border: 1px solid rgba(12,70,80,.18);
  border-radius: .7rem;
  padding: .7rem .8rem;
  background: #fff;
  color: var(--tg-fwc-text);
  font: inherit;
  font-weight: 750;
}

.tg-fwc-card,
.tg-fwc-kpi {
  position: relative;
}

.tg-fwc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .8rem;
}

.tg-fwc-card-head h3,
.tg-fwc-card .tg-fwc-card-head h3 {
  margin: 0;
  color: #1D1D1B;
}

.tg-fwc-info {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tg-fwc-card > .tg-fwc-card-head .tg-fwc-info {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
}

.tg-fwc-info__icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(12,70,80,.24);
  background: #fff;
  color: var(--tg-fwc-brand);
  font-size: .78rem;
  line-height: 1;
  font-weight: 850;
  font-style: normal;
  cursor: help;
}

.tg-fwc-info__bubble {
  position: absolute;
  left: 0;
  top: calc(100% + .45rem);
  width: min(16rem, 70vw);
  padding: .65rem .75rem;
  border-radius: .65rem;
  background: #163237;
  color: #fff;
  font-size: .78rem;
  line-height: 1.35;
  font-weight: 500;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-.2rem);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  box-shadow: 0 12px 26px rgba(12,70,80,.18);
  pointer-events: none;
}

.tg-fwc-info:hover .tg-fwc-info__bubble,
.tg-fwc-info:focus-within .tg-fwc-info__bubble,
.tg-fwc-info:focus .tg-fwc-info__bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tg-fwc-kpi .tg-fwc-info + .tg-fwc-plaus-icon {
  margin-top: .35rem;
}

.tg-fwc-debug {
  border: 1px solid rgba(124,58,237,.24);
  background: #faf7ff;
  border-radius: 1rem;
  padding: 1rem;
  color: var(--tg-fwc-highlight-blue, #06485F);
}

.tg-fwc-debug summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--tg-fwc-highlight-blue, #06485F);
}

.tg-fwc-debug pre {
  overflow: auto;
  max-height: 28rem;
  margin: .85rem 0 0;
  padding: .85rem;
  border-radius: .7rem;
  background: #fff;
  border: 1px solid rgba(124,58,237,.18);
  font-size: .78rem;
  line-height: 1.4;
}

/* More robust grey background for Tellergrammatur sliders */
.tg-fwc-meal-grams .tg-fwc-gram-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tg-fwc-primary) 0%, var(--tg-fwc-primary) var(--tg-fwc-range-pct), #d1d5db var(--tg-fwc-range-pct), #d1d5db 100%) !important;
  outline: none;
  accent-color: auto;
}

.tg-fwc-meal-grams .tg-fwc-gram-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent !important;
}

.tg-fwc-meal-grams .tg-fwc-gram-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -5px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--tg-fwc-brand);
  box-shadow: 0 3px 12px rgba(6,72,95,.22);
}

.tg-fwc-meal-grams .tg-fwc-gram-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #d1d5db !important;
}

.tg-fwc-meal-grams .tg-fwc-gram-slider::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--tg-fwc-primary) !important;
}

.tg-fwc-meal-grams .tg-fwc-gram-slider::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--tg-fwc-brand);
  box-shadow: 0 3px 12px rgba(6,72,95,.22);
}

/* Full-row comparison cards */
.tg-fwc-comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.tg-fwc-comparison-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .85fr) minmax(280px, 1.15fr);
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--tg-fwc-border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(12,70,80,.06);
}

.tg-fwc-comparison-card .tg-fwc-kpi-value {
  color: var(--tg-fwc-highlight, var(--tg-fwc-brand));
}

.tg-fwc-comparison-main {
  position: relative;
  min-width: 0;
  padding-left: 1.8rem;
}

.tg-fwc-comparison-main .tg-fwc-info {
  top: 0;
  left: 0;
}

.tg-fwc-comparison-visual {
  display: grid;
  gap: .65rem;
  align-items: center;
  padding: .9rem;
  border-radius: .9rem;
  background: #f8fbfa;
  border: 1px solid rgba(12,70,80,.08);
}

.tg-fwc-comparison-svg {
  width: min(100%, 13rem);
  height: auto;
  justify-self: center;
  overflow: visible;
  color: var(--tg-fwc-highlight, var(--tg-fwc-brand));
}

.tg-fwc-comparison-svg__empty {
  color: rgba(29,29,27,.12);
}

.tg-fwc-comparison-svg__fill {
  color: var(--tg-fwc-highlight, var(--tg-fwc-brand));
  transition: clip-path .35s ease;
}

.tg-fwc-comparison-text {
  font-weight: 800;
  color: var(--tg-fwc-highlight, var(--tg-fwc-brand));
  line-height: 1.3;
}

@media (max-width: 760px) {
  .tg-fwc-comparison-card { grid-template-columns: 1fr; }
}

/* Vergleichsillustrationen als große, farbfüllbare Masken-Icons */
.tg-fwc-comparison-mask-icon {
  position: relative;
  display: block;
  width: min(100%, 13rem);
  height: 13rem;
  justify-self: center;
  color: var(--tg-fwc-highlight, var(--tg-fwc-brand));
}

.tg-fwc-comparison-mask-icon__shape {
  position: absolute;
  inset: 0;
  display: block;
  background: currentColor;
  -webkit-mask-image: var(--tg-fwc-comparison-icon-url);
  mask-image: var(--tg-fwc-comparison-icon-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: clip-path .35s ease, opacity .2s ease, transform .18s ease;
}

.tg-fwc-comparison-mask-icon__shape--empty {
  color: rgba(29,29,27,.12);
}

.tg-fwc-comparison-mask-icon__shape--fill {
  color: var(--tg-fwc-highlight, var(--tg-fwc-brand));
  clip-path: inset(calc(100% - var(--tg-fwc-icon-fill)) 0 0 0);
}

.tg-fwc-comparison-card:hover .tg-fwc-comparison-mask-icon__shape--fill {
  filter: drop-shadow(0 5px 12px color-mix(in srgb, var(--tg-fwc-highlight) 28%, transparent));
}

.tg-food-waste-calculator fieldset.tg-fwc-settings-body{border:0;margin:0;min-width:0}
.tg-food-waste-calculator fieldset:disabled input,.tg-food-waste-calculator fieldset:disabled button,.tg-food-waste-calculator select:disabled{cursor:not-allowed;opacity:.55}
.tg-food-waste-calculator .tg-fwc-access-notice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin: 0 0 1rem;
  padding: 1rem 1.125rem;
  border: 1px solid #FAB742;
  border-left: 1px solid #FAB742;
  border-radius: .75rem;
  background: rgba(250, 186, 93, .2);
  color: #06485f;
  line-height: 1.55;
  text-align: left;
}
.tg-food-waste-calculator .tg-fwc-scenario { margin-bottom: 1rem; }
.tg-food-waste-calculator .tg-fwc-access-notice__icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  margin-top: .1rem;
}
.tg-food-waste-calculator .tg-fwc-access-notice a {
  min-width: 0;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .2em;
  overflow-wrap: anywhere;
}
.tg-food-waste-calculator .tg-fwc-access-notice a:hover { color: #e20026; }
.tg-food-waste-calculator .tg-fwc-access-notice a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.tg-waste-compact{display:flex;gap:1.5rem;align-items:center;padding:1.5rem;background:white;border-radius:10px;color:#06485f}.tg-waste-target{flex:0 0 130px;width:130px;height:130px;border:8px solid #16879d;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.tg-waste-target strong{font-size:1.3rem}.tg-waste-target span{font-size:.75rem}.tg-waste-compact h3{margin:0 0 .75rem}.tg-waste-compact a{display:block;margin-top:.75rem}.tg-waste-dialog{width:min(1200px,calc(100% - 2rem));max-height:90vh;overflow:auto;border:0;border-radius:12px;padding:1.5rem;box-sizing:border-box}.tg-waste-dialog::backdrop{background:rgba(0,0,0,.58)}.tg-waste-dialog>[data-waste-close]{display:block;margin-left:auto;font-size:1.5rem}.tg-fwc-personal-goal{padding:1rem;background:#e8f1e4;border-radius:8px}@media(max-width:480px){.tg-waste-compact{gap:1rem;padding:1rem}.tg-waste-target{flex-basis:100px;width:100px;height:100px}}
