@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

#ks-chat-root {
  --ks-chat-brand: #064c39;
  --ks-chat-brand-strong: #043629;
  --ks-chat-brand-soft: #edf3f0;
  --ks-chat-accent: #61b044;
  --ks-chat-ink: #263431;
  --ks-chat-muted: #6c7b76;
  --ks-chat-border: rgba(6, 76, 57, 0.12);
  --ks-chat-border-strong: rgba(6, 76, 57, 0.18);
  --ks-chat-surface: rgba(255, 255, 255, 0.98);
  --ks-chat-surface-soft: #f5f8f6;
  --ks-chat-surface-muted: #eef3f0;
  --ks-chat-shadow: 0 30px 70px -36px rgba(6, 76, 57, 0.36), 0 18px 40px -32px rgba(15, 23, 42, 0.34);
  --ks-chat-radius-xl: 32px;
  --ks-chat-radius-lg: 24px;
  --ks-chat-radius-md: 18px;
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: block;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  color: var(--ks-chat-ink);
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  transition: opacity 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

#ks-chat-root[data-ready="true"] {
  opacity: 1;
}

#ks-chat-root *,
#ks-chat-root *::before,
#ks-chat-root *::after {
  box-sizing: border-box;
}

#ks-chat-root button,
#ks-chat-root input {
  font: inherit;
}

#ks-chat-root a {
  color: inherit;
}

#ks-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 21, 17, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

#ks-chat-root[data-open="true"] #ks-chat-backdrop {
  opacity: 1;
  pointer-events: auto;
}

#ks-chat-root[data-open="true"] #ks-chat-fab {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(18px, 0, 0) scale(0.98);
}

#ks-chat-root[data-open="false"] #ks-chat-panel {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(112%, 0, 0);
}

#ks-chat-root[data-open="true"] #ks-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

#ks-chat-fab,
#ks-chat-panel {
  pointer-events: auto;
  will-change: transform, opacity;
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

#ks-chat-backdrop {
  will-change: transform, opacity;
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

#ks-chat-fab {
  position: absolute;
  top: auto;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: min(238px, calc(100vw - 48px));
  max-width: min(238px, calc(100vw - 48px));
  padding: 12px 18px 12px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ks-chat-brand), #0b5f48);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 22px 42px -26px rgba(6, 76, 57, 0.72);
  transform: translate3d(0, 0, 0);
}

#ks-chat-fab:hover {
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 24px 50px -28px rgba(6, 76, 57, 0.74);
}

#ks-chat-fab:focus-visible,
.ks-chat-header-button:focus-visible,
.ks-chat-text-link:focus-visible,
.ks-chat-smart-card:focus-visible,
.ks-chat-smart-send:focus-visible,
.ks-chat-inline-pill:focus-visible,
.ks-chat-help-card:focus-visible,
.ks-chat-help-topic:focus-visible,
.ks-chat-help-cta:focus-visible,
.ks-chat-suggestion-chip:focus-visible,
.ks-chat-icon-button:focus-visible,
.ks-chat-send-button:focus-visible,
#ks-chat-help-search:focus-visible,
#ks-smart-input:focus-visible,
#ks-chat-input:focus-visible {
  outline: 3px solid rgba(97, 176, 68, 0.28);
  outline-offset: 3px;
}

.ks-chat-fab-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ks-chat-fab-icon svg {
  width: 20px;
  height: 20px;
}

.ks-chat-fab-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

#ks-chat-panel {
  position: absolute;
  top: auto;
  right: 24px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: min(82vh, 760px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ks-chat-border);
  border-radius: var(--ks-chat-radius-xl);
  background: var(--ks-chat-surface);
  box-shadow: var(--ks-chat-shadow);
  backdrop-filter: blur(18px);
  transform-origin: right bottom;
}

.ks-chat-view {
  display: none;
  min-height: 0;
  height: 100%;
  flex-direction: column;
}

.ks-chat-view.is-active {
  display: flex;
}

.ks-chat-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ks-chat-header-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(6, 76, 57, 0.08);
  color: #5b6d67;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ks-chat-header-button:hover {
  background: rgba(6, 76, 57, 0.12);
  color: var(--ks-chat-brand);
  transform: translateY(-1px);
}

.ks-chat-header-button svg {
  width: 18px;
  height: 18px;
}

.ks-chat-header-button-light {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
}

.ks-chat-header-button-light:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.ks-chat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ks-chat-section-header h2,
.ks-chat-help-heading {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #33413d;
}

.ks-chat-text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ks-chat-brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ks-chat-smart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
  background: linear-gradient(145deg, var(--ks-chat-brand), #0a5b45);
  color: #fff;
}

.ks-chat-smart-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ks-chat-smart-brand-mark,
.ks-chat-help-brand-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ks-chat-smart-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.ks-chat-smart-brand-mark svg,
.ks-chat-help-brand-mark svg {
  width: 20px;
  height: 20px;
}

.ks-chat-smart-brand-copy,
.ks-chat-help-brand-copy {
  min-width: 0;
}

.ks-chat-smart-title,
.ks-chat-help-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ks-chat-smart-subtitle,
.ks-chat-help-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.ks-chat-smart-subtitle {
  color: rgba(255, 255, 255, 0.76);
}

.ks-chat-smart-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--ks-chat-surface-soft) 100%);
}

.ks-chat-smart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ks-chat-smart-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 15px;
  border: 1px solid var(--ks-chat-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ks-chat-smart-card:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 76, 57, 0.22);
  box-shadow: 0 16px 34px -30px rgba(6, 76, 57, 0.45);
  background: #fff;
}

.ks-chat-smart-card-icon,
.ks-chat-help-card-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ks-chat-brand);
  background: rgba(6, 76, 57, 0.09);
}

.ks-chat-smart-card-icon svg,
.ks-chat-help-card-icon svg {
  width: 18px;
  height: 18px;
}

.ks-chat-smart-card-title,
.ks-chat-help-card-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #22312d;
}

.ks-chat-smart-card-copy {
  font-size: 11px;
  line-height: 1.45;
  color: var(--ks-chat-muted);
}

.ks-chat-smart-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.ks-chat-inline-pill {
  justify-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(6, 76, 57, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ks-chat-brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ks-chat-smart-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 6px 6px 18px;
  border: 1px solid rgba(6, 76, 57, 0.1);
  border-radius: 999px;
  background: var(--ks-chat-surface-muted);
}

#ks-smart-input,
#ks-chat-help-search,
#ks-chat-input {
  border: 0;
  background: transparent;
  color: var(--ks-chat-ink);
}

#ks-smart-input::placeholder,
#ks-chat-help-search::placeholder,
#ks-chat-input::placeholder {
  color: #9aa8a3;
}

#ks-smart-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  font-size: 14px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

#ks-smart-input:focus,
#ks-chat-help-search:focus,
#ks-chat-input:focus {
  outline: none;
}

.ks-chat-smart-send,
.ks-chat-send-button {
  flex: 0 0 auto;
  border: 0;
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.ks-chat-smart-send {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--ks-chat-brand);
  box-shadow: 0 16px 30px -20px rgba(6, 76, 57, 0.74);
}

.ks-chat-smart-send:hover,
.ks-chat-send-button:hover {
  transform: translateY(-1px);
}

.ks-chat-smart-send svg,
.ks-chat-send-button svg {
  width: 18px;
  height: 18px;
}

.ks-chat-smart-send:disabled,
.ks-chat-send-button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.ks-chat-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(6, 76, 57, 0.06);
  background: rgba(255, 255, 255, 0.92);
}

.ks-chat-help-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ks-chat-help-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--ks-chat-brand);
  background: var(--ks-chat-brand-soft);
}

.ks-chat-help-subtitle {
  color: #5f726d;
}

.ks-chat-help-search-wrap {
  padding: 12px 18px 14px;
  background: var(--ks-chat-brand-soft);
  border-bottom: 1px solid rgba(6, 76, 57, 0.06);
}

.ks-chat-help-search {
  position: relative;
  display: block;
}

.ks-chat-help-search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  color: #7f8f89;
  transform: translateY(-50%);
}

.ks-chat-help-search-icon svg {
  width: 18px;
  height: 18px;
}

#ks-chat-help-search {
  width: 100%;
  min-height: 46px;
  padding: 0 16px 0 44px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(6, 76, 57, 0.08);
}

.ks-chat-help-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faf9 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 76, 57, 0.24) transparent;
}

.ks-chat-help-scroll::-webkit-scrollbar,
#ks-chat-messages::-webkit-scrollbar,
.ks-chat-suggestions::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ks-chat-help-scroll::-webkit-scrollbar-thumb,
#ks-chat-messages::-webkit-scrollbar-thumb,
.ks-chat-suggestions::-webkit-scrollbar-thumb {
  background: rgba(6, 76, 57, 0.16);
  border-radius: 999px;
}

.ks-chat-help-section {
  display: grid;
  gap: 16px;
}

.ks-chat-help-section + .ks-chat-help-section {
  margin-top: 26px;
}

.ks-chat-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ks-chat-help-card {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 14px;
  border: 1px solid var(--ks-chat-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.ks-chat-help-card:hover {
  transform: translateY(-1px);
  border-color: var(--ks-chat-border-strong);
  background: #fff;
}

.ks-chat-help-topics {
  display: grid;
  gap: 10px;
}

.ks-chat-help-topic {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--ks-chat-brand-soft);
  color: #33413d;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.ks-chat-help-topic:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 76, 57, 0.12);
  background: #f1f5f3;
}

.ks-chat-help-topic-arrow {
  color: #9aa8a3;
  font-size: 18px;
  line-height: 1;
}

.ks-chat-help-empty {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--ks-chat-brand-soft);
  color: var(--ks-chat-muted);
  font-size: 13px;
  line-height: 1.5;
}

.ks-chat-help-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid rgba(6, 76, 57, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

.ks-chat-help-avatars {
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.ks-chat-help-avatar {
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 12px -10px rgba(15, 23, 42, 0.4);
}

.ks-chat-help-avatar:first-child {
  margin-left: 0;
}

.ks-chat-help-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ks-chat-help-footer-copy {
  min-width: 0;
  flex: 1;
}

.ks-chat-help-footer-copy p,
.ks-chat-help-footer-copy strong {
  display: block;
}

.ks-chat-help-footer-copy p {
  margin: 0;
  font-size: 11px;
  color: var(--ks-chat-muted);
}

.ks-chat-help-footer-copy strong {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #23312d;
}

.ks-chat-help-cta {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ks-chat-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px -22px rgba(6, 76, 57, 0.7);
}

.ks-chat-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(6, 76, 57, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.ks-chat-conversation-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ks-chat-conversation-logo {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ks-chat-brand-soft);
  overflow: hidden;
}

.ks-chat-conversation-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ks-chat-conversation-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ks-chat-brand);
}

.ks-chat-conversation-banner {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(6, 76, 57, 0.08);
  background: var(--ks-chat-brand-soft);
  text-align: center;
  color: rgba(6, 76, 57, 0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#ks-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 18px 18px;
  background: linear-gradient(180deg, #ffffff 0%, var(--ks-chat-surface-soft) 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 76, 57, 0.24) transparent;
}

.ks-chat-message,
#ks-chat-typing {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.ks-chat-message {
  margin-bottom: 18px;
}

.ks-chat-message:last-child {
  margin-bottom: 0;
}

.ks-chat-message.is-user {
  justify-content: flex-end;
}

.ks-chat-message-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
}

.ks-chat-message-avatar-agent {
  background: var(--ks-chat-brand);
}

.ks-chat-message-avatar-user {
  background: rgba(6, 76, 57, 0.1);
  color: var(--ks-chat-brand);
}

.ks-chat-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ks-chat-message-stack,
.ks-chat-typing-stack {
  max-width: min(82%, 292px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ks-chat-message.is-user .ks-chat-message-stack {
  align-items: flex-end;
}

.ks-chat-message-label {
  display: block;
  padding-left: 4px;
  color: rgba(6, 76, 57, 0.46);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.ks-chat-bubble {
  border-radius: 20px;
  padding: 14px 15px;
  font-size: 14px;
  line-height: 1.62;
  letter-spacing: -0.01em;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.3);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.ks-chat-message.is-agent .ks-chat-bubble {
  background: #edf2ef;
  color: #31403c;
  border-bottom-left-radius: 8px;
}

.ks-chat-message.is-user .ks-chat-bubble {
  background: var(--ks-chat-brand);
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: 0 18px 34px -28px rgba(6, 76, 57, 0.65);
}

.ks-chat-bubble p {
  margin: 0;
}

.ks-chat-bubble img {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid rgba(6, 76, 57, 0.12);
}

.ks-chat-timestamp {
  padding: 0 2px;
  color: #99a6a1;
  font-size: 10px;
  line-height: 1.2;
}

#ks-chat-typing {
  margin-top: -2px;
  margin-bottom: 10px;
}

#ks-chat-typing.hidden {
  display: none;
}

.ks-chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 11px 14px;
  border-radius: 999px;
  background: #edf2ef;
}

.ks-chat-typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(6, 76, 57, 0.38);
  animation: ks-chat-bounce 1.1s infinite ease-in-out;
}

.ks-chat-typing-bubble span:nth-child(2) {
  animation-delay: 0.15s;
}

.ks-chat-typing-bubble span:nth-child(3) {
  animation-delay: 0.3s;
}

.ks-chat-typing-label {
  color: #9aa8a3;
  font-size: 11px;
  line-height: 1.3;
}

@keyframes ks-chat-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.82);
    opacity: 0.55;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.ks-chat-composer {
  padding: 14px 14px 12px;
  border-top: 1px solid rgba(6, 76, 57, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

.ks-chat-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 4px 8px;
  scrollbar-width: none;
}

.ks-chat-suggestion-chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(6, 76, 57, 0.08);
  border-radius: 999px;
  background: var(--ks-chat-brand-soft);
  color: var(--ks-chat-brand);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ks-chat-suggestion-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(6, 76, 57, 0.14);
  background: #e8f1ec;
}

#ks-chat-form {
  margin-top: 2px;
}

.ks-chat-input-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 6px;
  border: 1px solid rgba(6, 76, 57, 0.08);
  border-radius: 20px;
  background: var(--ks-chat-surface-muted);
}

.ks-chat-emoji-wrap {
  position: relative;
  flex: 0 0 auto;
}

.ks-chat-icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7f8f89;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ks-chat-icon-button:hover {
  background: rgba(6, 76, 57, 0.08);
  color: var(--ks-chat-brand);
  transform: translateY(-1px);
}

.ks-chat-icon-button svg {
  width: 18px;
  height: 18px;
}

.ks-chat-emoji-button {
  font-size: 18px;
  line-height: 1;
}

.ks-chat-emoji-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 172px;
  padding: 10px;
  border: 1px solid rgba(6, 76, 57, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 44px -34px rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(12px);
}

.ks-chat-emoji-menu[hidden] {
  display: none !important;
}

.ks-chat-emoji-item {
  border: 0;
  border-radius: 12px;
  min-height: 38px;
  background: var(--ks-chat-surface-soft);
  color: var(--ks-chat-ink);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.ks-chat-emoji-item:hover {
  transform: translateY(-1px);
  background: #e6efea;
}

#ks-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1.4;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.ks-chat-send-button {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: var(--ks-chat-brand);
  box-shadow: 0 16px 30px -20px rgba(6, 76, 57, 0.74);
}

.ks-chat-powered {
  margin: 10px 0 0;
  text-align: center;
  color: #b0bab5;
  font-size: 10px;
  line-height: 1.3;
}

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

body.ks-chat-drawer-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  #ks-chat-root {
    inset: 0;
  }

  #ks-chat-fab {
    top: auto;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    min-width: 0;
    max-width: min(220px, calc(100vw - 32px));
    justify-content: flex-start;
    transform: none;
  }

  #ks-chat-fab:hover {
    transform: translate3d(0, -1px, 0);
  }

  #ks-chat-root[data-open="true"] #ks-chat-fab {
    transform: translate3d(12px, 0, 0) scale(0.98);
  }

  #ks-chat-root[data-open="false"] #ks-chat-panel {
    transform: translate3d(100%, 0, 0);
  }

  #ks-chat-panel {
    top: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    transform-origin: right center;
  }

  #ks-chat-root[data-open="true"] #ks-chat-panel {
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 540px) {
  #ks-chat-fab {
    max-width: min(210px, calc(100vw - 32px));
  }

  .ks-chat-smart-header,
  .ks-chat-help-header,
  .ks-chat-conversation-header {
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    padding-right: 14px;
    padding-left: 14px;
  }

  .ks-chat-smart-header {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .ks-chat-smart-body,
  .ks-chat-help-scroll {
    padding: 14px;
  }

  .ks-chat-help-search-wrap {
    padding: 12px 14px 14px;
  }

  #ks-chat-messages {
    padding: 18px 14px 14px;
  }

  .ks-chat-composer {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .ks-chat-help-footer {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 420px) {
  .ks-chat-smart-grid,
  .ks-chat-help-grid {
    gap: 10px;
  }

  .ks-chat-smart-card,
  .ks-chat-help-card {
    border-radius: 20px;
  }

  .ks-chat-message-stack,
  .ks-chat-typing-stack {
    max-width: 86%;
  }

  .ks-chat-help-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ks-chat-help-cta {
    margin-left: 42px;
  }
}

@media (max-width: 1023px) {
  body[data-public-nav-open="true"] #ks-chat-fab,
  body[data-public-nav-open="true"] #ks-chat-backdrop,
  body[data-public-nav-open="true"] #ks-chat-panel {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(16px, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #ks-chat-fab,
  #ks-chat-panel,
  .ks-chat-header-button,
  .ks-chat-smart-card,
  .ks-chat-help-card,
  .ks-chat-help-topic,
  .ks-chat-suggestion-chip,
  .ks-chat-icon-button,
  .ks-chat-smart-send,
  .ks-chat-send-button,
  .ks-chat-typing-bubble span {
    animation: none !important;
    transition: none !important;
  }
}
