.osvhchat {
  --osvhchat-color: #006dab;
  --osvhchat-accent: transparent;
  --osvhchat-bg: #ffffff;
  --osvhchat-fg: #1c1f24;
  --osvhchat-muted: #5d6470;
  --osvhchat-bot-bg: #f1f3f6;
  --osvhchat-border: #dde1e6;
  --osvhchat-link: var(--osvhchat-color);
  position: fixed;
  bottom: 20px;
  z-index: 9999;
  /* Lettertype van de site zelf overnemen; alleen grootte en regelafstand vastleggen. */
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--osvhchat-fg);
}
.osvhchat--right { right: 20px; }
.osvhchat--left { left: 20px; }

/* Donker thema (instelling Kleurenschema): standaard volgt de chat het apparaat
   (osvhchat--auto); "altijd licht" en "altijd donker" zijn ook mogelijk. */
.osvhchat--dark {
  --osvhchat-bg: #1d2026;
  --osvhchat-fg: #e9ebee;
  --osvhchat-muted: #a3a9b3;
  --osvhchat-bot-bg: #2a2e36;
  --osvhchat-border: #3a3f48;
  --osvhchat-link: #9cc4ff;
}

@media (prefers-color-scheme: dark) {
  .osvhchat--auto {
    --osvhchat-bg: #1d2026;
    --osvhchat-fg: #e9ebee;
    --osvhchat-muted: #a3a9b3;
    --osvhchat-bot-bg: #2a2e36;
    --osvhchat-border: #3a3f48;
    --osvhchat-link: #9cc4ff;
  }
}

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

.osvhchat__sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.osvhchat__toggle {
  display: grid; place-items: center;
  width: 58px; height: 58px; border: 0; border-radius: 50%;
  background: var(--osvhchat-color); color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}
.osvhchat__toggle:hover { transform: scale(1.06); }
.osvhchat__toggle:focus-visible { outline: 3px solid var(--osvhchat-fg); outline-offset: 3px; }
.osvhchat.is-open .osvhchat__toggle { display: none; }

.osvhchat__panel {
  display: flex; flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 40px));
  background: var(--osvhchat-bg);
  border: 1px solid var(--osvhchat-border);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
  overflow: hidden;
}
.osvhchat__panel[hidden] { display: none; }

.osvhchat__header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--osvhchat-color); color: #fff;
  /* Accentstreep, zoals onder het actieve menu-item op de site. */
  border-bottom: 3px solid var(--osvhchat-accent);
}
.osvhchat__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.osvhchat__title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2; color: inherit; }
.osvhchat__subtitle { margin: 0; font-size: 12px; line-height: 1.3; opacity: .85; color: inherit; }
.osvhchat__reset, .osvhchat__close {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  font: inherit; opacity: .9; padding: 2px 6px; border-radius: 6px;
}
.osvhchat__reset { font-size: 13px; text-decoration: underline; }
.osvhchat__close { font-size: 24px; line-height: 1; }
.osvhchat__reset:hover, .osvhchat__close:hover { opacity: 1; background: rgba(255, 255, 255, .15); }

.osvhchat__log {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}

.osvhchat__msg {
  max-width: 88%; padding: 9px 12px; border-radius: 12px;
  overflow-wrap: anywhere;
}
.osvhchat__msg p { margin: 0 0 .5em; }
.osvhchat__msg p:last-child { margin-bottom: 0; }
.osvhchat__msg ul { margin: .2em 0 .5em; padding-left: 1.2em; }
.osvhchat__msg--user {
  align-self: flex-end; background: var(--osvhchat-color); color: #fff;
  border-bottom-right-radius: 4px; white-space: pre-wrap;
}
.osvhchat__msg--bot {
  align-self: flex-start; background: var(--osvhchat-bot-bg);
  border-bottom-left-radius: 4px;
}
.osvhchat__msg.is-pending { color: var(--osvhchat-muted); font-style: italic; }
.osvhchat__msg.is-error { border: 1px solid #c0392b; }

.osvhchat__msg a { color: var(--osvhchat-link); }

.osvhchat__more {
  display: inline-block; margin-top: 6px; font-weight: 600;
}

.osvhchat__result {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--osvhchat-bg); border: 1px solid var(--osvhchat-border);
}
.osvhchat__result-title { font-weight: 600; }
.osvhchat__snippet { margin-top: 4px; font-size: 14px; color: var(--osvhchat-fg); }
.osvhchat__snippet p { margin: 0 0 .35em; }
.osvhchat__snippet p:last-child { margin-bottom: 0; }
.osvhchat__snippet ul { margin: .2em 0 .35em; padding-left: 1.1em; }

.osvhchat__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.osvhchat__chips-label { width: 100%; font-size: 13px; color: var(--osvhchat-muted); }
.osvhchat__chip {
  border: 1px solid var(--osvhchat-color); background: var(--osvhchat-bg); color: var(--osvhchat-link);
  border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.osvhchat__chip:hover { background: var(--osvhchat-color); color: #fff; }
.osvhchat__chip:focus-visible { outline: 2px solid var(--osvhchat-color); outline-offset: 2px; }

/* De panelhoogte past zich aan; het invoerveld onderaan krijgt ademruimte. */
.osvhchat__form {
  display: flex; gap: 8px; padding: 10px 10px 12px; border-top: 1px solid var(--osvhchat-border);
}
.osvhchat__input {
  flex: 1; resize: none; min-height: 40px; max-height: 120px;
  padding: 9px 11px; border: 1px solid var(--osvhchat-border); border-radius: 10px;
  background: var(--osvhchat-bg); color: var(--osvhchat-fg); font: inherit;
}
.osvhchat__input:focus { outline: 2px solid var(--osvhchat-color); outline-offset: -1px; }
.osvhchat__send {
  border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer;
  background: var(--osvhchat-color); color: #fff; font: inherit; font-weight: 600;
}
.osvhchat__send:disabled { opacity: .55; cursor: wait; }

@media (max-width: 480px) {
  .osvhchat { bottom: 12px; }
  .osvhchat--right { right: 12px; }
  .osvhchat--left { left: 12px; }
  .osvhchat__panel { height: calc(100vh - 24px); }
}
