:root {
  --trykai-green: #c8ff45;
  --trykai-green-strong: #aaff00;
  --trykai-ink: #070907;
  --trykai-panel: #0d110d;
  --trykai-line: rgba(200, 255, 69, 0.24);
  --trykai-muted: #a8b1a6;
}

.trykai-chat,
.trykai-chat * {
  box-sizing: border-box;
}

.trykai-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99998;
  color: #f7faf6;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.trykai-chat button,
.trykai-chat textarea,
.trykai-chat a {
  font: inherit;
}

.trykai-chat__launcher {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  padding: 7px 16px 7px 8px;
  border: 1px solid rgba(200, 255, 69, 0.52);
  border-radius: 999px;
  background: rgba(7, 9, 7, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38), 0 0 24px rgba(170, 255, 0, 0.13);
  color: #fff;
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.trykai-chat__launcher:hover,
.trykai-chat__launcher:focus-visible {
  transform: translateY(-2px);
  border-color: var(--trykai-green);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.45), 0 0 30px rgba(170, 255, 0, 0.2);
  outline: none;
}

.trykai-chat__launcher img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(170, 255, 0, 0.28);
}

.trykai-chat__launcher span {
  display: grid;
  gap: 2px;
}

.trykai-chat__launcher strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.trykai-chat__launcher small {
  position: relative;
  padding-left: 12px;
  color: var(--trykai-muted);
  font-size: 11px;
}

.trykai-chat__launcher small::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--trykai-green-strong);
  box-shadow: 0 0 9px rgba(170, 255, 0, 0.9);
  content: "";
  transform: translateY(-50%);
}

.trykai-chat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto auto auto;
  width: min(430px, calc(100vw - 32px));
  height: min(690px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(200, 255, 69, 0.32);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(170, 255, 0, 0.08), transparent 33%),
    var(--trykai-panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58), 0 0 44px rgba(170, 255, 0, 0.12);
  transform-origin: right bottom;
  animation: trykai-panel-in 180ms ease-out both;
}

.trykai-chat__panel[hidden] {
  display: none;
}

.trykai-chat.is-open .trykai-chat__launcher {
  visibility: hidden;
  pointer-events: none;
}

.trykai-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--trykai-line);
  background: rgba(3, 5, 3, 0.82);
}

.trykai-chat__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.trykai-chat__identity img {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(170, 255, 0, 0.22);
}

.trykai-chat__identity div {
  display: grid;
  gap: 1px;
}

.trykai-chat__identity strong {
  color: #fff;
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1;
}

.trykai-chat__identity span {
  color: var(--trykai-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.trykai-chat__identity small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dce8d8;
  font-size: 11px;
}

.trykai-chat__identity i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--trykai-green-strong);
  box-shadow: 0 0 8px rgba(170, 255, 0, 0.88);
}

.trykai-chat__close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(200, 255, 69, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #dfe6dc;
  font-size: 24px;
  cursor: pointer;
}

.trykai-chat__close:hover,
.trykai-chat__close:focus-visible {
  border-color: var(--trykai-green);
  color: var(--trykai-green);
  outline: none;
}

.trykai-chat__capabilities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--trykai-line);
  background: rgba(255, 255, 255, 0.025);
}

.trykai-chat__capabilities span {
  padding: 10px 8px;
  color: #cfd8cc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
}

.trykai-chat__capabilities span + span {
  border-left: 1px solid var(--trykai-line);
}

.trykai-chat__conversation {
  overflow-y: auto;
  padding: 18px;
  scrollbar-color: rgba(200, 255, 69, 0.34) transparent;
  scrollbar-width: thin;
}

.trykai-chat__message {
  width: fit-content;
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  margin: 0 0 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.trykai-chat__message p {
  padding: 0;
  margin: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.trykai-chat__message small {
  display: block;
  padding-left: 10px;
  border-left: 2px solid var(--trykai-green);
  margin-top: 9px;
  color: var(--trykai-muted);
  font-size: 10px;
  line-height: 1.45;
}

.trykai-chat__message--kai {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 5px;
  background: #171d17;
  color: #f4f8f2;
}

.trykai-chat__message--visitor {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: var(--trykai-green);
  color: #10140e;
}

.trykai-chat__message--error {
  border: 1px solid rgba(255, 181, 181, 0.3);
  background: rgba(108, 31, 31, 0.35);
  color: #ffe9e9;
}

.trykai-chat__message.is-pending {
  color: var(--trykai-muted);
  animation: trykai-pulse 1.1s ease-in-out infinite alternate;
}

.trykai-chat__prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.16);
}

.trykai-chat__prompts button,
.trykai-chat__prompts a {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid rgba(200, 255, 69, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #eef3eb;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.trykai-chat__prompts a {
  border-color: rgba(200, 255, 69, 0.64);
  background: rgba(200, 255, 69, 0.08);
  color: var(--trykai-green);
}

.trykai-chat__prompts button:hover,
.trykai-chat__prompts button:focus-visible,
.trykai-chat__prompts a:hover,
.trykai-chat__prompts a:focus-visible {
  border-color: var(--trykai-green);
  background: rgba(200, 255, 69, 0.11);
  outline: none;
}

.trykai-chat__prompts button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.trykai-chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--trykai-line);
  background: #080b08;
}

.trykai-chat__form textarea {
  width: 100%;
  min-height: 50px;
  max-height: 110px;
  resize: none;
  padding: 12px 13px;
  border: 1px solid rgba(200, 255, 69, 0.26);
  border-radius: 12px;
  background: #121712;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.trykai-chat__form textarea::placeholder {
  color: #7f897d;
}

.trykai-chat__form textarea:focus {
  border-color: var(--trykai-green);
  box-shadow: 0 0 0 3px rgba(200, 255, 69, 0.1);
  outline: none;
}

.trykai-chat__form button {
  min-width: 76px;
  border: 0;
  border-radius: 12px;
  background: var(--trykai-green);
  color: #10140e;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.trykai-chat__form button:hover,
.trykai-chat__form button:focus-visible {
  background: #d7ff77;
  outline: none;
}

.trykai-chat__form button:disabled,
.trykai-chat__form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.trykai-chat__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px 11px;
  background: #080b08;
  color: #859083;
  font-size: 10px;
}

.trykai-chat__footer a {
  color: #b9c5b5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.trykai-chat .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes trykai-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes trykai-pulse {
  from { opacity: 0.48; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .trykai-chat {
    right: 12px;
    bottom: 12px;
  }

  .trykai-chat__launcher {
    min-width: 0;
    padding-right: 13px;
  }

  .trykai-chat__panel {
    position: fixed;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: min(720px, calc(100dvh - 20px));
    border-radius: 20px;
  }

  .trykai-chat__conversation {
    padding: 14px;
  }

  .trykai-chat__message {
    max-width: 94%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trykai-chat__launcher,
  .trykai-chat__panel,
  .trykai-chat__message.is-pending {
    transition: none;
    animation: none;
  }
}

