/* Melo Chat: zoals ChatGPT, in de Kamelo-stijl (rustig, wit, zwarte knop, groen slotje). Geen externe bestanden. */
:root {
  --ink: #1d1d1f; --muted: #6e6e73; --faint: #8e8e93; --soft: #f5f5f7; --side: #f9f9fb; --hover: rgba(0, 0, 0, .05); --line: #e5e5ea;
  --bg: #fff; --blue: #0a84ff; --green: #1fa34a; --green-bg: rgba(52, 199, 89, .14);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 16px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { display: grid; grid-template-columns: 260px 1fr; height: 100dvh; }

/* ---------- zijbalk ---------- */
.side { background: var(--side); border-right: 1px solid #efeff2; padding: 14px 10px 10px; display: flex; flex-direction: column; min-width: 0; }
.side-top { display: flex; align-items: center; padding: 2px 8px 14px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.items { display: flex; flex-direction: column; gap: 1px; }
.item { display: flex; align-items: center; gap: 11px; border: 0; background: none; border-radius: 10px; padding: 9px 10px; cursor: pointer;
  font-size: 14.5px; text-align: left; color: var(--ink); text-decoration: none; }
.item:hover { background: var(--hover); }
.item svg { width: 19px; height: 19px; flex: none; }
.side-k { margin: 22px 10px 6px; font-size: 13px; color: var(--faint); }
.convs { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; min-height: 0; }
.conv { position: relative; display: flex; align-items: center; border-radius: 10px; }
.conv:hover, .conv.on { background: var(--hover); }
.conv.on { background: rgba(0, 0, 0, .07); }
.conv > button:first-child { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 9px 10px; cursor: pointer; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .del { flex: none; width: 30px; height: 30px; margin-right: 3px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; opacity: 0; }
.conv:hover .del, .conv.on .del, .conv .del:focus-visible { opacity: 1; }
.conv .del:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.conv .del svg { width: 16px; height: 16px; }
.clear { align-self: flex-start; margin: 6px 0 2px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--faint); cursor: pointer; }
.clear:hover { color: var(--ink); background: var(--hover); }
.org { margin-top: 8px; display: flex; align-items: center; gap: 11px; padding: 10px; border-top: 1px solid #efeff2; }
.org > svg { width: 30px; height: 30px; flex: none; padding: 6px; border-radius: 9px; color: var(--muted); background: var(--hover); }
.org b { display: block; font-size: 14px; font-weight: 600; }
.org small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.trust { margin-top: 8px; display: flex; align-items: center; gap: 11px; border: 0; background: none; border-radius: 12px; padding: 10px; text-align: left; cursor: pointer; }
.trust:hover { background: var(--hover); }
.trust > svg { width: 30px; height: 30px; flex: none; padding: 6px; border-radius: 50%; color: var(--green); background: var(--green-bg); stroke-width: 2.2; }
.trust b { display: block; font-size: 14px; font-weight: 600; }
.trust small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ---------- hoofdvlak ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; min-height: 56px; }
.title { display: none; font-size: 17px; font-weight: 600; }
.icon { border: 0; background: none; padding: 7px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.icon:hover { background: var(--hover); }
.icon svg { width: 20px; height: 20px; }
.menu { display: none; }
.pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--green);
  background: var(--green-bg); border-radius: 999px; padding: 6px 12px 6px 10px; }
.pill svg { width: 14px; height: 14px; stroke-width: 2.3; }

.thread { flex: 1; overflow-y: auto; padding: 8px 20px 28px; }
.thread > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.u { margin-top: 26px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.u .bub { max-width: 80%; background: var(--soft); border-radius: 22px; padding: 11px 18px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.u .pics { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.u .pics img { width: 168px; height: 168px; object-fit: cover; border-radius: 16px; display: block; }
.a { margin-top: 22px; line-height: 1.65; overflow-wrap: anywhere; }
.a p { margin: 0 0 12px; }
.a ul, .a ol { margin: 0 0 12px; padding-left: 22px; }
.a li { margin: 0 0 6px; }

/* nadenken: vier bolletjes die ronddraaien, met de seconden (of het downloadpercentage) erachter */
.think { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; padding: 4px 0; }
.ts { font-variant-numeric: tabular-nums; }
.spin { position: relative; width: 18px; height: 18px; animation: spin 1.2s linear infinite; }
.spin i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.spin i:nth-child(1) { left: 6.5px; top: 0; } .spin i:nth-child(2) { right: 0; top: 6.5px; opacity: .75; }
.spin i:nth-child(3) { left: 6.5px; bottom: 0; opacity: .5; } .spin i:nth-child(4) { left: 0; top: 6.5px; opacity: .3; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- invoer: midden op het lege scherm, onderaan in een gesprek ---------- */
.dock { padding: 0 20px; }
.dock > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.home .thread { display: none; }
.home .dock { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 12vh; }
.main:not(.home) .hello, .main:not(.home) .sugs { display: none; }
.hello { text-align: center; margin-bottom: 26px; }
.hello img { display: block; margin: 0 auto 14px; }
.hello h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.025em; }

.composer { width: 100%; border: 1px solid var(--line); border-radius: 28px; background: var(--bg); padding: 8px; box-shadow: 0 2px 12px rgba(0, 0, 0, .04); }
.composer:focus-within { border-color: #d2d2d7; }
.composer .row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; font: inherit; font-size: 16px; line-height: 1.5; padding: 8px 6px 8px 12px; max-height: 220px;
  background: transparent; color: inherit; }
.composer textarea:disabled { cursor: default; }
.plus, .send { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.plus { background: none; color: var(--ink); }
.plus:hover { background: var(--hover); }
.plus + textarea { padding-left: 4px; }
.plus svg { width: 21px; height: 21px; }
.send { background: var(--ink); color: #fff; }
.send svg { width: 18px; height: 18px; stroke-width: 2.4; }
.send.stop svg { fill: currentColor; stroke: none; }
.send:disabled { opacity: .25; cursor: default; }
.atts { display: flex; gap: 8px; padding: 4px 4px 8px; flex-wrap: wrap; }
.att { position: relative; }
.att img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; display: block; }
.att button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg); background: var(--ink); color: #fff;
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.att button svg { width: 11px; height: 11px; stroke-width: 3; }

.sugs { list-style: none; margin: 18px auto 0; padding: 0 6px; }
.sugs button { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; padding: 12px 10px; border-radius: 12px; cursor: pointer;
  color: var(--muted); font-size: 15.5px; text-align: left; }
.sugs button:hover { background: var(--soft); color: var(--ink); }
.sugs svg { width: 20px; height: 20px; flex: none; }

.fine { margin: 10px auto 12px; text-align: center; font-size: 12px; color: var(--faint); }
.home .fine { margin-top: 26px; }

/* melding: niet beschikbaar, traag, fout */
.note { margin: 0 auto 10px; background: var(--soft); border-radius: 18px; padding: 16px 18px; line-height: 1.5; font-size: 15px; }
.note b { display: block; margin-bottom: 4px; }
.note .btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.note .btns button, .note .btns a { display: inline-block; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none; background: var(--ink); color: #fff; }
.note .btns .ghost { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

/* ---------- smal scherm: zijbalk schuift in ---------- */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 5; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  .side.open { transform: none; }
  .menu { display: grid; }
  .title { display: block; }
  .thread, .dock { padding-left: 14px; padding-right: 14px; }
  .hello h1 { font-size: 26px; }
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f5f5f7; --muted: #a1a1a6; --faint: #8e8e93; --soft: #1c1c1e; --side: #0f0f10; --hover: rgba(255, 255, 255, .07); --line: #38383a; --bg: #000;
    --green-bg: rgba(48, 209, 88, .15); }
  .side { border-right-color: #1c1c1e; }
  .brand img { filter: invert(1); }
  .conv.on { background: rgba(255, 255, 255, .1); }
  .send, .note .btns button, .note .btns a { background: #f5f5f7; color: #000; }
  .att button { background: #f5f5f7; color: #000; }
  .composer:focus-within { border-color: #48484a; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } .side { transition: none; } }

/* ---------- Melo voor bedrijven: licentiescherm, "voor werk" naast de naam, bestanden ---------- */
.brand em { font-style: normal; font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 2px; padding: 2px 8px; border-radius: 999px; background: var(--hover); }
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 20px 12vh; }
.gate img { margin-bottom: 18px; }
.gate h1 { margin: 0 0 8px; font-size: 30px; font-weight: 600; letter-spacing: -.025em; }
.gate > p { margin: 0; max-width: 440px; color: var(--muted); line-height: 1.5; }
.gate-form { margin-top: 26px; display: flex; gap: 8px; width: 100%; max-width: 480px; border: 1px solid var(--line); border-radius: 999px; padding: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .04); background: var(--bg); }
.gate-form:focus-within { border-color: #d2d2d7; }
.gate-form input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 15px; padding: 8px 14px; background: transparent; color: inherit; }
.gate-form button { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 600; font-size: 15px; background: var(--ink); color: var(--bg); cursor: pointer; }
.gate-err { margin: 12px 0 0 !important; color: #d70015 !important; font-size: 14px; }
.gate-link { margin-top: 22px; font-size: 14px; color: var(--muted); text-decoration: none; }
.gate-link:hover { color: var(--ink); }
.file { display: inline-flex; align-items: center; gap: 10px; max-width: 280px; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 8px 8px; background: var(--bg); }
.file i { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--blue); font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.file span { min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att.f { display: flex; }
.att.f button { top: -6px; right: -6px; }
.u .pics .file { max-width: 320px; }

/* ---------- Melo's gezicht (melo-face.js, zelfde als in de extensie): de kameleonkop van 16 okt, in lagen; alle beweging zit in melo-face.js ---------- */
.melo-face { flex: none; display: inline-block; width: 40px; aspect-ratio: 6 / 5; }
.melo-face svg { display: block; width: 100%; height: 100%; overflow: visible; }
.melo-face.big { width: 104px; }
.hello .melo-face { display: block; margin: 0 auto 12px; }
.top .melo-face { margin: -4px -2px; }
.main.home .top .melo-face { visibility: hidden; }   /* op het startscherm staat hij groot boven de vraag */
.mf-row { display: flex; align-items: flex-start; gap: 14px; margin-top: 22px; }
.mf-row > .a { flex: 1; min-width: 0; margin-top: 0; }
.melo-face.mf-msg { width: 38px; margin-top: -5px; }
@media (max-width: 760px) { .mf-row { gap: 10px; } .melo-face.mf-msg { width: 32px; margin-top: -3px; } }
@media (prefers-reduced-motion: reduce) { .melo-face *, .melo-face svg { transition: none !important; animation: none !important; } }
