/* De chatpagina /chat (21 oktober 2026): ontwerp A van Melissa, zoals in WhatsApp. De maten komen uit chat-ontwerp/basis.css en a.css
   (bestelproces-overzicht/gereedschap), de kleuren en letters uit de huisstijl (huisstijl.css, eerst geladen) en formulier.css. Geen eigen kleuren:
   alleen de tokens, zodat doelgroep.css (?voor=) alles mee laat kleuren. Het groene stipje van "Nu online" (altijd met de tekst erbij) is de enige
   extra kleur. Op de telefoon een donkere balk bovenaan, het gesprek en vast onderin het typvak; vanaf 900 px links het donkere vlak dat blijft staan. */

:root { --stip: #3d7d52; }
html.vel-open { overflow: hidden; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* De pagina: het gesprek op het zachte wit, minstens één scherm hoog (het typvak staat dan onderin), met de voet eronder */
.chat { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--wit-zacht); }

/* De kop: op de telefoon een donkere balk die bovenaan blijft staan */
.chat-kop { position: sticky; top: 0; z-index: 3; }
.kop-rij { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 6px 8px 16px; }
.kop-knop { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border-radius: 50%; color: var(--blush); transition: background-color .25s ease; }
.kop-knop .ico { transition: transform .35s var(--vloeiend); }
.zij-intro, .zij-los { display: none; }
/* viewport-fit=cover (voor de veilige rand onderin): een iPhone op zijn kant heeft links en rechts ook een rand */
.kop-rij { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
.chat-gesprek { padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
.voet-binnen { padding-left: max(var(--rand), env(safe-area-inset-left)); padding-right: max(var(--rand), env(safe-area-inset-right)); }

/* Het JG-logo in een rondje (keuze van Melissa: het logo, niet haar foto, en geen naam eronder) */
.foto { position: relative; display: block; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--omber); }
.foto img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.foto-groot { width: 68px; height: 68px; }
.foto-klein { width: 30px; height: 30px; }
/* Online: een groen stipje rechtsonder, met een rand in de kleur van de achtergrond */
.foto-stip::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--stip); box-shadow: 0 0 0 3px var(--wit-zacht); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--stip); }
.status i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--stip); }

/* De opening op de telefoon (op de computer alleen voor schermlezers: daar staat hij in het donkere vlak) */
.chat-gesprek { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-intro { display: grid; justify-items: center; gap: 10px; padding: 30px 24px 4px; text-align: center; }
.chat-intro .foto-groot { margin-bottom: 4px; }
.chat-intro h1 { font-size: 36px; line-height: 1.05; text-wrap: balance; }
.chat-intro h1 em { color: var(--roze); }
.chat-intro p { max-width: 28ch; font-size: 16px; line-height: 1.5; color: var(--zacht); }
.chat-intro .status { color: var(--stip); font-size: 15px; }
.geen-js { margin: 16px 16px 0; padding: 14px 18px; border-radius: 14px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); }

/* Over de website van … (een klant) */
.klant-chip { display: inline-block; max-width: 100%; padding: 6px 16px; border-radius: 999px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); font-size: 14px; line-height: 1.5; color: var(--zacht); text-wrap: balance; overflow-wrap: anywhere; }
.chat-intro .klant-chip { font-size: 14px; }
.klant-chip b { font-weight: 600; color: var(--tekst); }

/* De berichten */
.draad { display: flex; flex-direction: column; gap: 6px; padding: 8px 16px 12px; }
.bericht { display: flex; flex-direction: column; min-width: 0; }
.groep-begin { margin-top: 8px; }
.dag + .groep-begin { margin-top: 0; }
.rij { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.rij-jij { justify-content: flex-end; }
.bel { max-width: min(78%, 520px); padding: 11px 16px 12px; border-radius: 20px; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.bel-ik { background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); border-bottom-left-radius: 6px; }
.bel-jij { background: var(--nacht); color: var(--wit); border-bottom-right-radius: 6px; }
.bel a { color: var(--roze); text-underline-offset: 3px; }
.bel a:hover { color: var(--roze-donker); }
.tijd { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--zacht); }
.tijd-jij { align-self: flex-end; margin-right: 4px; }
.tijd-ik { margin-left: 38px; }
/* Komt er nog een bericht van hetzelfde groepje onder, dan staan de tijd en het rondje alleen bij het laatste (chat.js zet niet-laatst) */
.niet-laatst .tijd { display: none; }
.niet-laatst .foto { visibility: hidden; }
.dag { align-self: center; margin: 18px 0 10px; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--zacht); }

/* Het bonnetje na het eerste bericht: het ene opvallende onderdeel, met de echte dag */
.bon { align-self: flex-end; width: min(86%, 380px); margin-top: 8px; padding: 16px 18px 17px; border-radius: 18px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); overflow-wrap: anywhere; }
.bon-kop { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--roze); }
.bon-kop .vink { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--blush-zacht); }
.bon-kop .ico { width: 14px; height: 14px; stroke-width: 2.2; }
.bon-dag { margin-top: 8px; font-family: var(--serif); font-size: 23px; line-height: 1.2; color: var(--tekst); text-wrap: pretty; }
.bon-mail { margin-top: 7px; font-size: 15px; line-height: 1.5; color: var(--zacht); }
/* Het e-mailadres blijft heel: als blokje naar de volgende regel, niet afgebroken bij een streepje (taak 15). Een heel lang adres breekt binnen het blokje. */
.bon-adres { display: inline-block; max-width: 100%; }
/* Een knop die eruitziet als een link: "Adres aanpassen" en "Nieuw gesprek" */
.chat-link { padding: 0; border: 0; background: none; font: inherit; color: var(--roze); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chat-link:hover { color: var(--roze-donker); }

/* Melissa typt: drie puntjes (hoogstens 10 seconden, zegt de server) */
.typt-rij { margin: 2px 16px 10px; }
.typt { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 20px; border-bottom-left-radius: 6px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); }
.typt i { width: 7px; height: 7px; border-radius: 50%; background: var(--taupe); animation: puntje 1.2s ease-in-out infinite; }
.typt i:nth-child(2) { animation-delay: .15s; }
.typt i:nth-child(3) { animation-delay: .3s; }
@keyframes puntje { 0%, 60%, 100% { opacity: .45; } 30% { opacity: 1; } }

/* "Nieuw gesprek": een rustige regel na het laatste bericht (scrollt mee, nooit vast). De eerste tik vraagt het eerst; de knoppen zijn minstens 44 px hoog. */
.nieuw-gesprek { display: grid; justify-items: center; margin: 4px 16px 10px; text-align: center; }
.nieuw-knop { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 14px; line-height: 1.4; color: var(--zacht); text-decoration: underline; text-decoration-color: var(--lijn-sterk); text-underline-offset: 3px; cursor: pointer; }
.nieuw-vraag { display: grid; justify-items: center; gap: 10px; width: min(100%, 380px); padding: 14px 16px 16px; border-radius: 18px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); }
.nieuw-vraag p { max-width: 30ch; font-size: 15px; line-height: 1.5; color: var(--zacht); text-wrap: balance; }
.nieuw-knoppen { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.nieuw-knoppen button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn-sterk); font: inherit; font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--tekst); cursor: pointer; transition: box-shadow .25s ease; }

/* De link werkt niet (meer) */
.weg { display: grid; justify-items: center; gap: 20px; margin: 18px 16px; padding: 26px 22px 28px; border-radius: 18px; background: var(--wit); box-shadow: 0 0 0 1px var(--lijn); text-align: center; }
.weg p { max-width: 26ch; font-family: var(--serif); font-size: 23px; line-height: 1.25; text-wrap: balance; }
.weg .knop { width: auto; justify-content: center; }

/* Typen en versturen: vast onderin, met de veilige rand van de iPhone */
.schrijf { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--wit-zacht) 18px); }
.schrijf > .fout { margin: 0 6px 10px; }
.schrijf-rij { display: flex; align-items: flex-end; gap: 10px; }
/* Het typvak groeit mee met de tekst (tot zeven regels): een onzichtbare kopie van de tekst (data-kopie, chat.js) geeft de hoogte */
.groei { flex: 1; display: grid; min-width: 0; }
.groei::after { content: attr(data-kopie) " "; visibility: hidden; white-space: pre-wrap; overflow: hidden; }
.groei > textarea, .groei::after { grid-area: 1 / 1 / 2 / 2; min-height: 52px; max-height: 172px; margin: 0; padding: 13px 18px; border: 0; border-radius: 26px; font: 400 17px/1.5 var(--letter); overflow-wrap: anywhere; }
.groei > textarea { width: 100%; resize: none; overflow-y: auto; background: var(--wit); color: var(--tekst); box-shadow: 0 0 0 1px var(--lijn-sterk); transition: box-shadow .2s ease; }
.groei > textarea::placeholder { color: var(--zacht); opacity: 1; }
.groei > textarea:focus-visible { outline: none; box-shadow: 0 0 0 1.5px var(--roze), 0 0 0 5px color-mix(in srgb, var(--roze) 18%, transparent); }
.stuur { flex: none; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: var(--nacht); color: var(--blush); cursor: pointer; transition: box-shadow .35s ease; }
.stuur .ico { transition: transform .35s var(--vloeiend); }
.stuur:focus-visible { outline: 2px solid var(--roze); outline-offset: 3px; }
.stuur:disabled { cursor: progress; opacity: .6; }

/* Duidelijke hovers, alleen met een muis: elk icoon beweegt op zijn eigen manier (de pijl naar voren, de kop-iconen omhoog, het kruisje draait) */
@media (hover: hover) {
  .kop-knop:hover { background: color-mix(in srgb, var(--wit) 9%, transparent); }
  .kop-knop:hover .ico { transform: translateY(-2px); }
  .groei > textarea:hover:not(:focus-visible) { box-shadow: 0 0 0 1px var(--zacht); }
  .stuur:hover:not(:disabled) { box-shadow: 0 10px 24px color-mix(in srgb, var(--nacht) 25%, transparent); }
  .stuur:hover:not(:disabled) .ico { transform: translateX(3px); }
  .vel-sluit:hover { background: var(--wit-zacht); color: var(--tekst); }
  .vel-sluit:hover .ico { transform: rotate(90deg); }
  .nieuw-knop:hover { color: var(--tekst); text-decoration-color: currentColor; }
  .nieuw-knoppen button:hover { box-shadow: 0 0 0 1px var(--tekst); }
}

/* Het vel "Waar mag mijn antwoord heen?": op de telefoon schuift het van onderen omhoog */
.vel { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); margin: 0; padding: 0; border: 0; border-radius: 26px 26px 0 0; background: var(--wit); color: var(--tekst); box-shadow: 0 -20px 50px color-mix(in srgb, var(--nacht) 18%, transparent); overflow-y: auto; overscroll-behavior: contain; }
/* De donkere laag erachter: --nacht met 45% (een ::backdrop erft in oudere browsers geen variabelen) */
.vel::backdrop { background: rgb(22 18 15 / .45); }
.vel[open] { animation: vel-omhoog .3s var(--vloeiend); }
@keyframes vel-omhoog { from { transform: translateY(40px); opacity: 0; } }
.vel-binnen { position: relative; display: grid; gap: 18px; padding: 26px max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.greep { justify-self: center; width: 40px; height: 5px; margin: -12px 0 2px; border-radius: 3px; background: var(--lijn-sterk); }
/* De kop houdt de hele breedte (zoals in het ontwerp op één regel); het kruisje staat in de hoek, naast het greepje */
.vel h2 { font-size: 29px; line-height: 1.1; text-wrap: balance; }
.vel-sluit { position: absolute; top: 4px; right: 6px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--zacht); cursor: pointer; transition: background-color .25s ease; }
.vel-sluit .ico { transition: transform .35s var(--vloeiend); }
.je-bericht { padding: 12px 15px; border-radius: 14px; background: var(--wit-zacht); font-size: 15px; line-height: 1.5; color: var(--zacht); }
.je-bericht span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.vel .veld { gap: 8px; margin: 0; }
.vel .veld label { font-size: 16px; font-weight: 500; }
.vel .veld input { min-height: 54px; padding: 14px 16px; border-radius: 14px; font-size: 17px; }
.vel .spamfilter { min-height: 65px; margin: 0; }
.privacy { font-size: 14px; line-height: 1.5; color: var(--zacht); }
.privacy a { color: var(--zacht); }
.privacy a:hover { color: var(--tekst); }
.vel .knop { width: 100%; justify-content: center; gap: 12px; min-height: 56px; padding: 0 26px; font-size: 17px; }
.vel .knop:disabled { cursor: progress; opacity: .7; transform: none; }
/* Op een breder scherm een kaart in het midden */
@media (min-width: 600px) {
  .vel { inset: 0; width: min(480px, calc(100% - 48px)); height: fit-content; max-height: calc(100dvh - 48px); margin: auto; border-radius: 26px; box-shadow: 0 30px 80px color-mix(in srgb, var(--nacht) 25%, transparent); }
  .vel-binnen { padding: 32px; }
  .vel h2 { padding-right: 36px; }
  .vel-sluit { top: 16px; right: 16px; width: 44px; height: 44px; }
  .greep { display: none; }
}

/* Computer: links het donkere vlak (40%, hoogstens 560 px) dat blijft staan, rechts het gesprek van hoogstens 760 px */
@media (min-width: 900px) {
  .chat { flex-direction: row; }
  .chat-kop { align-self: flex-start; flex: none; display: flex; flex-direction: column; width: 40%; max-width: 560px; height: 100vh; height: 100dvh; padding: 44px 56px 40px; }
  .kop-rij { min-height: 0; padding: 0; }
  .chat[data-modus="bezoeker"] #knop-mail { display: none; } /* onderaan staat "Liever WhatsApp of mail?" */
  .zij-intro { display: block; margin-block: auto; padding-block: 32px; }
  .zij-intro .foto-groot { width: 84px; height: 84px; margin-bottom: 28px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--blush) 35%, transparent); }
  .chat-kop .foto-stip::after { box-shadow: 0 0 0 3px var(--nacht); }
  .zij-kop { font-family: var(--serif); font-size: 56px; line-height: 1.02; text-wrap: balance; }
  .zij-kop em { font-style: italic; color: var(--blush); }
  .zij-intro .kop-tekst { max-width: 30ch; margin-top: 18px; font-size: 18px; line-height: 1.5; color: color-mix(in srgb, var(--wit) 80%, var(--taupe)); }
  .zij-intro .status { margin-top: 18px; font-size: 17px; color: var(--wit); }
  .zij-intro .klant-chip { margin-top: 22px; }
  .zij-los { display: block; font-size: 15px; line-height: 1.6; color: var(--taupe); }
  .zij-links { display: flex; flex-wrap: wrap; gap: 2px 20px; }
  .zij-los a { color: var(--wit); text-underline-offset: 3px; }
  .zij-los a:hover { color: var(--blush); }
  /* De opening in main blijft voor schermlezers (met de h1), het donkere vlak toont hem */
  .chat-intro { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .chat-gesprek { width: 100%; max-width: 760px; margin: 0 auto; }
  .draad { padding: 40px 48px 12px; }
  .typt-rij { margin-inline: 48px; }
  .nieuw-gesprek { margin-inline: 48px; }
  .weg { margin: 40px 48px; }
  .schrijf { padding: 12px 48px calc(32px + env(safe-area-inset-bottom)); }
}

/* De stijl van een doelgroep (?voor=, doelgroep.css). Beauty en feesten hebben een lichte kop: daar donkere tekst en het oudroze accent. */
:root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .kop-knop { color: var(--roze); }
:root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .zij-kop em { color: var(--roze); }
:root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .zij-intro .status { color: var(--tekst); }
:root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .zij-los { color: var(--zacht); }
:root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .zij-los a { color: var(--tekst); }
:root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .chat-kop .foto-stip::after { box-shadow: 0 0 0 3px var(--wit-zacht); }
@media (hover: hover) { :root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .kop-knop:hover { background: color-mix(in srgb, var(--nacht) 6%, transparent); } }
@media (min-width: 900px) { :root:is([data-doelgroep="beauty"], [data-doelgroep="feesten"]) .kop.chat-kop { border-bottom: 0; border-right: 1px solid var(--lijn); } }
/* De kop in het donkere vlak volgt de koppen van de doelgroep (doelgroep.css doet dat voor h1, h2 en h3) */
:root:is([data-doelgroep="coaching"], [data-doelgroep="streek"], [data-doelgroep="feesten"]) .zij-kop { font-weight: 500; }
:root[data-doelgroep="trouwlocatie"] .zij-kop { font-weight: 600; }
:root[data-doelgroep="trouwlocatie"] .zij-kop em { font-weight: 500; }
:root:is([data-doelgroep="bouw"], [data-doelgroep="club"]) .zij-kop { font-weight: 700; letter-spacing: -.015em; }
:root:is([data-doelgroep="horeca"], [data-doelgroep="bouw"], [data-doelgroep="club"]) .zij-kop em { font-style: normal; }

/* Alleen kleine overgangen, en geen beweging als iemand dat liever niet heeft */
@media (prefers-reduced-motion: reduce) {
  .vel[open] { animation: none; }
  .typt i { animation: none; opacity: 1; }
  .kop-knop .ico, .stuur, .stuur .ico, .vel-sluit .ico, .groei > textarea, .nieuw-knoppen button { transition: none; }
}
