/* Public /klic-aanvragen — visual parity with Pro desktop Klicbot chat (#view-chat) */

.ka-body {
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --chat-max: 680px;
  --ka-nav-h: 4rem;
  --color-bg-deep: #121212;
  --color-text-main: #e5e7eb;
  --color-text-dim: #9ca3af;
  --color-brand: #ccff00;

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg-deep);
  color: var(--color-text-main);
  /* Match dashboard app chat (Inter), not marketing Work Sans */
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: normal;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  /* Fixed marketing nav (h-16) */
  padding-top: var(--ka-nav-h);
}

/* Homepage tokens force Work Sans on #klicbot-marketing-seo — keep that for nav only */
#klicbot-marketing-seo.ka-body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#klicbot-marketing-seo.ka-body > header {
  font-family: "Work Sans", system-ui, -apple-system, sans-serif;
}

.ka-chat-toolbar {
  display: flex;
  justify-content: flex-end;
  max-width: var(--chat-max);
  width: 100%;
  margin: 0 auto 0.5rem;
  padding: 0 0.15rem;
}

.ka-new-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s var(--smooth), color 0.15s var(--smooth), background 0.15s var(--smooth);
}
.ka-new-chat:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.ka-new-chat i { font-size: 0.8rem; }

.ka-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 0 1.25rem;
}

.ka-banner-wrap {
  max-width: var(--chat-max);
  width: 100%;
  margin: 0.75rem auto 0;
  flex-shrink: 0;
}

.ka-banner {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.ka-banner-text {
  margin: 0;
  flex: 1 1 14rem;
}
.ka-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: #ccff00;
  color: #141414;
  font-weight: 700;
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
}
.ka-banner-cta:hover {
  filter: brightness(1.05);
}
.ka-banner--ok {
  background: rgba(204, 255, 0, 0.1);
  border: 1px solid rgba(204, 255, 0, 0.35);
  color: #e8ff99;
}
.ka-banner--warn {
  background: rgba(255, 180, 0, 0.1);
  border: 1px solid rgba(255, 180, 0, 0.35);
  color: #ffd980;
}

/* ── Welcome landing (Pro empty state) ── */
.ka-landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: calc(var(--chat-max) + 4rem);
  margin: 0 auto;
  gap: 1.1rem;
  padding: 1.5rem 0 max(1.25rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.ka-root.ka-chatting .ka-landing {
  flex: 0 0 auto;
  justify-content: flex-end;
  min-height: 0;
  padding: 0;
  gap: 0;
}
.ka-root.ka-chatting .ka-welcome { display: none; }

.ka-welcome {
  text-align: center;
  width: 100%;
  max-width: var(--chat-max);
  animation: ka-fade-up 0.5s var(--smooth) both;
}

.ka-welcome-sub {
  margin: 0;
  /* Pro #view-chat .kchat-welcome-sub */
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-dim);
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
}

/* Match Pro chat (.kchat-help-info-tip): tip must stack above input zone siblings. */
.ka-help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  flex-shrink: 0;
  z-index: 2;
}
.ka-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition: color 0.15s var(--smooth);
}
.ka-help-tip i { font-size: 14px; }
.ka-help-tip:hover,
.ka-help-tip[aria-expanded="true"],
.ka-help-tip:focus-visible {
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  outline: none;
}

.ka-help-tooltip {
  position: absolute;
  left: 50%;
  /* Open upward so it never covers the input/chips */
  top: auto;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(21rem, calc(100vw - 2rem));
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-bg-card, #1e1e1e);
  border: 1px solid var(--color-border, #2a2a2a);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  text-align: left;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-main, #e5e7eb);
  z-index: 10060;
}
.ka-help-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-border, #2a2a2a);
}
.ka-help-tooltip[hidden] { display: none !important; }
.ka-help-tooltip-lead {
  margin: 0 0 8px;
  color: var(--color-text-dim, #9ca3af);
  font-family: inherit;
  font-weight: 500;
}
.ka-help-tooltip-list {
  margin: 0;
  padding: 0 0 0 1.05rem;
  font-family: inherit;
}
.ka-help-tooltip-list li {
  margin-bottom: 4px;
  font-family: inherit;
}
.ka-help-tooltip-list li:last-child { margin-bottom: 0; }
.ka-help-tooltip-list strong {
  font-family: inherit;
  font-weight: 600;
}

/* Input zone is a later sibling (+ backdrop-filter stacking). Lift welcome when tip is open. */
.ka-root.ka-help-open {
  overflow: visible;
}
.ka-landing.ka-help-open,
.ka-welcome.ka-help-open {
  overflow: visible;
  position: relative;
  z-index: 100;
}
.ka-welcome.ka-help-open .ka-help-wrap {
  z-index: 10055;
}

.ka-welcome-hint {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: var(--color-text-dim);
  font-weight: 400;
}

.ka-input-zone {
  width: 100%;
  max-width: calc(var(--chat-max) + 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ka-root.ka-chatting .ka-input-zone {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: none;
  padding: 0 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--color-bg-deep) 55%, transparent 100%);
  z-index: 15;
}

.ka-input-wrap {
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
}

.ka-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 11px 11px 11px 12px;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s var(--smooth), background 0.2s var(--smooth);
}
.ka-input-box:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.12);
}

.ka-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ka-attach {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.ka-attach:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}
.ka-attach:disabled {
  opacity: 0.45;
  cursor: default;
}

.ka-staged-wrap { width: 100%; }
.ka-staged {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ka-staged-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(204, 255, 0, 0.12);
  color: var(--color-brand);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ka-staged-info { flex: 1; min-width: 0; }
.ka-staged-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ka-staged-size {
  font-size: 0.7rem;
  color: var(--color-text-dim);
}
.ka-staged-remove {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 6px;
  border-radius: 6px;
}
.ka-staged-remove:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ka-textarea {
  flex: 1;
  min-width: 80px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-main);
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  min-height: 26px;
  overflow-y: auto;
  padding: 0;
}
.ka-textarea::placeholder { color: rgba(255, 255, 255, 0.25); }
.ka-textarea:disabled { opacity: 0.6; }

.ka-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  transition: background 0.18s var(--smooth), transform 0.2s var(--spring), box-shadow 0.18s var(--smooth), color 0.18s var(--smooth);
}
.ka-send-icon {
  font-size: 15px;
  line-height: 1;
  display: block;
}
.ka-send.ready {
  background: linear-gradient(135deg, #ccff00 0%, #b8f000 100%);
  color: #000;
  box-shadow: 0 2px 12px rgba(204, 255, 0, 0.3);
}
.ka-send.ready:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(204, 255, 0, 0.45);
}
.ka-send:disabled { cursor: default; }
.ka-send:not(.ready):disabled { opacity: 1; }

.ka-input-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
  width: 100%;
  animation: ka-fade-up 0.5s var(--smooth) 0.1s both;
}
.ka-root.ka-chatting .ka-input-chips { display: none; }

.ka-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 38px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s var(--smooth), background 0.15s var(--smooth), transform 0.2s var(--spring);
}
.ka-chip:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}
.ka-chip-icon {
  display: inline-flex;
  opacity: 0.8;
}
.ka-chip-icon i { font-size: 13px; }

.ka-fine {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.4;
}
.ka-fine a { color: rgba(255, 255, 255, 0.55); }
.ka-root.ka-chatting .ka-fine { display: none; }

/* ── Active chat messages ── */
.ka-scroll {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0 8.5rem;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}
.ka-scroll::-webkit-scrollbar { width: 2px; }
.ka-scroll::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.ka-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  box-sizing: border-box;
}

.ka-msg {
  display: flex;
  max-width: 92%;
  animation: ka-fade-up 0.35s var(--smooth) both;
}
.ka-msg--bot { align-self: flex-start; }
.ka-msg--user { align-self: flex-end; }
.ka-msg--err { align-self: stretch; max-width: 100%; }

.ka-msg-bubble {
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ka-msg--bot .ka-msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
}
.ka-msg--user .ka-msg-bubble {
  background: rgba(204, 255, 0, 0.14);
  border: 1px solid rgba(204, 255, 0, 0.28);
  color: #f4ffe0;
}
.ka-msg--err .ka-msg-bubble {
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: #ffb4b4;
  font-size: 0.85rem;
}
.ka-msg a { color: var(--color-brand); }

.ka-typing {
  align-self: flex-start;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
}

.ka-dyn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 0.5rem;
  align-self: flex-start;
  max-width: var(--chat-max);
}

.ka-msg--draw {
  max-width: 100%;
  align-self: stretch;
}
.ka-draw-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.ka-draw-container {
  width: 100%;
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0e0e0e;
}
.ka-draw-container .kdraw-root {
  min-height: 320px;
}

.ka-dropzone {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(18, 18, 18, 0.82);
  border: 2px dashed rgba(204, 255, 0, 0.45);
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ka-dropzone.active {
  display: flex;
}
.ka-dropzone-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-brand);
}

@keyframes ka-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  .ka-root { padding: 0 0.85rem; }
  .ka-welcome-sub { font-size: 1.15rem; }
  .ka-input-chips {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ka-chip {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
  .ka-root.ka-chatting .ka-input-zone {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}
