/* Food & Water Footprint Calculator v2 */
.fw-section { position: relative; }
.fw-section .section-head { margin-bottom: 28px; }

.fw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.fw-toolbar .fw-field { min-width: 160px; }

.fw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: start;
}

.fw-controls,
.fw-results {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 22px;
  padding: 22px;
}

.fw-block + .fw-block { margin-top: 22px; }

.fw-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fw-block-title {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.fw-block-head .fw-block-title { margin-bottom: 0; }

.fw-meal-pick .fw-block-title {
  margin-bottom: 0;
}

.fw-meal-select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(124, 247, 212, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.fw-meal-select:focus-visible {
  outline: 2px solid rgba(0, 224, 164, 0.55);
  outline-offset: 2px;
}

.fw-search-wrap { position: relative; margin-bottom: 12px; }

.fw-search,
.fw-plate-row input,
.fw-field input,
.fw-field select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  padding: 11px 12px;
  font: inherit;
}

.fw-search-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b1612;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 8px;
}

.fw-search-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: start;
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.fw-search-item:hover,
.fw-search-item:focus-visible {
  background: rgba(0, 224, 164, 0.12);
  outline: none;
}

.fw-search-item small { color: var(--muted); }
.fw-group-title { margin: 10px 6px 4px; }
.fw-group-item { border: 1px dashed rgba(255, 210, 122, 0.35); margin-top: 4px; }

.fw-plate { display: grid; gap: 10px; }

.fw-plate-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 90px 48px 36px;
  gap: 8px;
  align-items: center;
}

.fw-ing-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: help;
}

.fw-fallback-pill {
  display: inline-block;
  margin-inline-start: 6px;
  font-size: 10px;
  color: #ffd27a;
  font-weight: 700;
}

.fw-unit,
.fw-muted,
.fw-servings-note,
.fw-disclaimer,
.fw-gcc-note,
.fw-delta,
.fw-swap {
  color: var(--muted);
  font-size: 13px;
}

.fw-gcc-note {
  margin-top: 8px;
  color: var(--mint);
  font-weight: 600;
}

.fw-remove,
.fw-link-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.fw-remove {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #ff9b9b;
  font-size: 22px;
  line-height: 1;
}

.fw-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.fw-field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.fw-field.fw-check {
  align-content: end;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.fw-field.fw-check input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.fw-business { margin-top: 12px; }
.fw-business-fields { margin-top: 10px; }
.fw-compare-pick { margin-top: 12px; }

.fw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.fw-card {
  border: 1px solid rgba(0, 224, 164, 0.22);
  background: linear-gradient(180deg, rgba(0, 224, 164, 0.08), rgba(255, 255, 255, 0.02));
  border-radius: 18px;
  padding: 20px;
}

.fw-card-error {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(255, 80, 80, 0.08);
}

.fw-business-card { margin-top: 14px; }

.fw-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.fw-kicker {
  margin: 0;
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fw-card h3 {
  margin: 6px 0 0;
  font-size: 22px;
}

.fw-total {
  margin-top: 16px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1.2;
}

.fw-confidence {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.fw-confidence-high { color: var(--mint); border-color: rgba(0, 224, 164, 0.35); }
.fw-confidence-medium { color: #ffd27a; border-color: rgba(255, 210, 122, 0.35); }
.fw-confidence-low { color: #ff9b9b; border-color: rgba(255, 155, 155, 0.35); }

.fw-split {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.fw-split i { display: block; height: 100%; }
.fw-split .fw-green { background: #3ddc97; }
.fw-split .fw-blue { background: #4da3ff; }
.fw-split .fw-grey { background: #9aa4ae; }

.fw-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.fw-split-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-inline-end: 6px;
}

.fw-split-legend .dot.green { background: #3ddc97; }
.fw-split-legend .dot.blue { background: #4da3ff; }
.fw-split-legend .dot.grey { background: #9aa4ae; }

.fw-compare-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.fw-compare-stats div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.fw-compare-stats strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.fw-compare-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.fw-compare-grid { display: grid; gap: 14px; }
.fw-delta, .fw-swap { margin: 14px 0 0; font-weight: 600; }
.fw-swap { color: #ffd27a; }
.fw-pool-note { margin-top: 8px; font-weight: 600; color: var(--mint); }
.fw-meal-hit { border-inline-start: 3px solid rgba(0, 224, 164, 0.55); }

.fw-sources {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.fw-sources ul {
  margin: 8px 0 0;
  padding-inline-start: 18px;
}

.fw-disclaimer { margin: 18px 0 0; max-width: 900px; line-height: 1.6; }
.fw-error { color: #ff9b9b; }

.fw-ai-embed {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .fw-layout,
  .fw-row-2,
  .fw-compare-stats {
    grid-template-columns: 1fr;
  }

  .fw-plate-row {
    grid-template-columns: minmax(0, 1fr) 84px 44px 34px;
  }

  .fw-total { font-size: 28px; }
}
