/* Chatbotpagina: één vast chatvenster; alleen het gesprek scrollt */
html, body.chat-body { height: 100%; }
body.chat-body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.chat-pagina {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 18px 16px 20px;
}
.chat-venster {
  position: relative;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--papier);
  border: 1px solid var(--lijn);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(59,42,32,.10), 0 1px 3px rgba(59,42,32,.06);
  overflow: hidden;
}

/* kop van het venster */
.chat-kop {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--lijn);
  background: var(--papier);
}
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bruin); object-fit: cover; flex: none; }
.chat-naam { flex: 1; min-width: 0; line-height: 1.2; }
.chat-naam h1 { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-naam span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--grijs); }
.chat-naam span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3FA36B; }
.chat-melding { margin: 0; border-radius: 0; flex: none; }

/* taalkeuze */
.taal { position: relative; flex: none; }
.taal-knop {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--lijn);
  background: var(--creme);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.taal-knop:hover, .taal-knop[aria-expanded="true"] { border-color: var(--messing); }
.taal-paneel {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  z-index: 20;
  width: 260px;
  max-width: calc(100vw - 24px);
  display: flex;
  flex-direction: column;
  background: var(--papier);
  border: 1px solid var(--lijn);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(59,42,32,.16);
  overflow: hidden;
}
.taal-zoek {
  margin: 8px 8px 4px;
  padding: 9px 12px;
  border: 1px solid var(--lijn);
  border-radius: 10px;
  background: var(--creme);
  font-size: 14px;
  outline: none;
}
.taal-zoek:focus { border-color: var(--messing); }
.taal-lijst {
  margin: 0; padding: 4px 6px 6px;
  list-style: none;
  max-height: min(380px, 55vh);
  overflow-y: auto;
  scrollbar-width: thin;
}
.taal-groep {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grijs);
}
.taal-lijst li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
}
.taal-lijst li small { color: var(--grijs); font-size: 11px; letter-spacing: .06em; }
.taal-lijst li:hover, .taal-lijst li:focus { background: var(--creme); outline: none; }
.taal-lijst li[aria-selected="true"] { background: var(--bruin); color: #fff; }
.taal-lijst li[aria-selected="true"] small { color: rgba(255,255,255,.7); }

/* ---------- Gesprek ---------- */
.gesprek {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--creme);
  scrollbar-width: thin;
  scrollbar-color: var(--lijn) transparent;
}
.bericht {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  animation: in .18s ease-out;
  scroll-margin-top: 12px;
}
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.bericht.gebruiker {
  align-self: flex-end;
  background: var(--bruin);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bericht.bot {
  align-self: flex-start;
  background: var(--papier);
  border: 1px solid var(--lijn);
  border-bottom-left-radius: 4px;
}
.bericht p { margin: 0 0 6px; }
.bericht p:last-child { margin-bottom: 0; }

.gezocht {
  font-size: 11.5px;
  color: var(--grijs);
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.gezocht b { font-weight: 500; color: var(--inkt); }

.oordeel {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 10px;
  margin: 6px 0;
}
.oordeel .icoon {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.oordeel strong { display: block; font-weight: 600; }
.oordeel small { color: inherit; opacity: .85; font-size: 12.5px; }
.oordeel.ja { background: var(--rood-tint); color: var(--rood); }
.oordeel.ja .icoon { background: var(--rood); }
.oordeel.nee { background: var(--ok-tint); color: var(--ok); }
.oordeel.nee .icoon { background: var(--ok); }
.oordeel.sporen { background: var(--oranje-tint); color: var(--oranje); }
.oordeel.sporen .icoon { background: var(--oranje); }

.categorie {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--bruin);
  margin: 10px 0 4px;
}
.lijst { list-style: none; margin: 0; padding: 0; }
.lijst li {
  padding: 6px 0;
  border-bottom: 1px solid var(--lijn);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.lijst li:last-child { border-bottom: 0; }
.lijst .tags { color: var(--grijs); font-size: 12px; text-align: right; }

.waarschuwing {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--oranje-tint);
  color: var(--oranje);
  font-size: 13px;
}

.allergeen-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--rood-tint);
  color: var(--rood);
}
.tag.spoor { background: var(--oranje-tint); color: var(--oranje); }
.tag small { opacity: .8; }

.suggesties { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggesties button {
  border: 1px solid var(--lijn);
  background: var(--papier);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.suggesties button:hover { border-color: var(--messing); }

/* ---------- Invoer ---------- */
.invoer-zone {
  flex: none;
  background: var(--papier);
  border-top: 1px solid var(--lijn);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
}
.chips-wrap { position: relative; }
.chips-rij {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px 2px 8px;
  scrollbar-width: none;
  cursor: grab;
}
.chips-rij.slepen { cursor: grabbing; }
.chips-rij.slepen .chip { pointer-events: none; }
.chips-rij::-webkit-scrollbar { display: none; }
.chips-pijl {
  position: absolute;
  top: 3px;
  z-index: 2;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--lijn);
  background: var(--papier);
  color: var(--bruin);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59,42,32,.12);
}
.chips-pijl.links { left: -2px; }
.chips-pijl.rechts { right: -2px; }
/* op een telefoon veeg je gewoon; de pijltjes alleen met een muis */
@media (hover: none) { .chips-pijl { display: none; } }
.chip {
  flex: none;
  border: 1px solid var(--lijn);
  background: var(--papier);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.chip[aria-pressed="true"] { background: var(--bruin); border-color: var(--bruin); color: #fff; }

.filter-knop {
  width: 100%;
  margin-bottom: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px;
  background: var(--groen);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
}

.vraag-form {
  display: flex;
  gap: 8px;
  background: var(--papier);
  border: 1px solid var(--lijn);
  border-radius: 999px;
  padding: 5px 5px 5px 18px;
  box-shadow: 0 2px 10px rgba(59,42,32,.06);
}
.vraag-form:focus-within { border-color: var(--messing); }
.vraag-form input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px; /* voorkomt inzoomen op iPhone */
  min-width: 0;
}
.vraag-form button {
  flex: none;
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--bruin);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.voet { font-size: 11px; color: var(--grijs); text-align: center; margin: 7px 0 0; }

/* telefoon: venster over de hele breedte */
@media (max-width: 600px) {
  .chat-pagina { padding: 0; }
  .chat-venster { border: 0; border-radius: 0; box-shadow: none; }
  .chat-kop { padding: 10px 12px; }
  .gesprek { padding: 14px 12px; }
}

/* AI */
.ai-label {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bruin);
  color: #fff;
  margin-right: 2px;
  vertical-align: 1px;
}
.denken { display: inline-flex; gap: 4px; padding: 4px 2px; }
.denken i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grijs);
  animation: denk 1s infinite ease-in-out;
}
.denken i:nth-child(2) { animation-delay: .15s; }
.denken i:nth-child(3) { animation-delay: .3s; }
@keyframes denk { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.tag.extra { background: #ECE7F3; color: #5B4A7A; }
.kenmerken { font-size: 13px; color: var(--grijs); margin-top: 6px !important; }
.kenmerken b { color: var(--inkt); font-weight: 600; }
.chip.dieet { background: var(--groen); border-color: var(--groen); color: #fff; }
.chip.dieet[aria-pressed="true"] { background: var(--groen); box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px var(--groen); margin: 0 3px; }
.chip.dieet[aria-pressed="true"]::before { content: "✓ "; }

.kz { color: var(--groen) !important; opacity: 1 !important; font-weight: 500; }
.aanpasbaar-kop { margin-top: 12px !important; font-weight: 500; color: var(--groen); }

/* "Alles tegelijk" bij een vraag met meerdere allergenen */
.samen {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--lijn, #e5ddd2);
  font-size: 13px;
}

/* Disclaimer boven de begroeting */
.disclaimer {
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--creme);
  border: 1px solid var(--lijn);
  color: var(--grijs);
  font-size: 12px;
  line-height: 1.45;
}
