/* The K Platform — Chat Assistant styles.
 * Uses the shared tokens from platform.css: --k-ivory, --k-champagne,
 * --k-forest, --k-gold, --k-ink, --k-muted, .k-btn, .k-chip, .k-input.
 * Visible text rule: no dashes in user-facing strings. This file has
 * no CSS content strings at all, so nothing visible can carry one.
 */

.kchat-root {
  font-family: var(--k-font-body);
  color: var(--k-ink);
  z-index: 9998;
}

.kchat-hidden { display: none !important; }

/* Launcher: 56px gold circle, bottom right. */
.kchat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--k-gold);
  box-shadow: 0 8px 24px rgba(10, 53, 42, 0.30);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 9999;
  animation: kchat-pop 0.35s ease-out;
}
.kchat-launcher:hover { background: #bd8a45; }
.kchat-launcher:focus-visible { outline: 3px solid var(--k-forest); outline-offset: 2px; }
.kchat-launcher.kchat-open { background: var(--k-forest); }

@keyframes kchat-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Teaser bubble: one small dismissible bubble, once per session. */
.kchat-teaser {
  position: fixed;
  right: 88px;
  bottom: 30px;
  max-width: 250px;
  background: #fff;
  border: 1px solid var(--k-line);
  border-radius: 12px;
  box-shadow: var(--k-shadow);
  padding: 12px 34px 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--k-forest);
  z-index: 9999;
  animation: kchat-fade 0.3s ease-out;
}
.kchat-teaser-close {
  position: absolute;
  top: 4px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--k-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

@keyframes kchat-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Panel: about 380px by 550px on desktop, full screen under 768px. */
.kchat-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  width: 380px;
  height: 550px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border: 1px solid var(--k-line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(10, 53, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  animation: kchat-fade 0.2s ease-out;
}

.kchat-header {
  background: var(--k-forest);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.kchat-title {
  font-family: var(--k-font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}
.kchat-disclosure {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 3px;
}
.kchat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
}

.kchat-tabs {
  display: flex;
  border-bottom: 1px solid var(--k-line);
  flex-shrink: 0;
}
.kchat-tab {
  flex: 1;
  border: none;
  background: #fff;
  padding: 11px 0;
  font-family: var(--k-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--k-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.kchat-tab-on {
  color: var(--k-forest);
  border-bottom-color: var(--k-gold);
}

.kchat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.kchat-view-chat { background: var(--k-ivory); }

.kchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.kchat-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.kchat-bot {
  background: #fff;
  border: 1px solid var(--k-line);
  color: var(--k-ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.kchat-user {
  background: var(--k-forest);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.kchat-line {
  margin-top: 4px;
  font-size: 13px;
  color: var(--k-ink);
}
.kchat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.kchat-action {
  text-decoration: none;
  font-size: 12px;
  padding: 7px 12px;
}
a.kchat-action { display: inline-block; }
.kchat-typing { color: var(--k-muted); font-style: italic; }

.kchat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid var(--k-line);
  flex-shrink: 0;
}
.kchat-chip { font-size: 12px; padding: 7px 12px; }

.kchat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--k-line);
  flex-shrink: 0;
}
.kchat-input { flex: 1; min-width: 0; }
.kchat-send { flex-shrink: 0; padding: 11px 18px; }

/* Call view, inside the same widget. */
.kchat-view-call {
  padding: 24px 20px;
  background: #fff;
  gap: 4px;
}
.kchat-call-title {
  font-family: var(--k-font-serif);
  font-size: 22px;
  color: var(--k-forest);
  font-weight: 500;
  margin-bottom: 10px;
}
.kchat-call-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--k-muted);
  margin: 0 0 12px;
}
.kchat-call-btn { width: 100%; margin: 6px 0 14px; }
.kchat-call-note { margin: 0; font-size: 14px; }
.kchat-call-link { color: var(--k-forest); font-weight: 600; }

@media (max-width: 767px) {
  .kchat-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .kchat-launcher { right: 16px; bottom: 16px; }
  .kchat-teaser { right: 84px; bottom: 24px; max-width: 220px; }
}
