.mechtarik-page {
  --mr-ink: #193958;
  --mr-muted: #48617b;
  --mr-paper: #edf6ff;
  --mr-white: #fcfdff;
  --mr-line: #b6cce2;
  --mr-gold: #3c6998;
  --mr-blue: #dcedff;
  --mr-pink: #f9e3ed;
  --mr-berry: #753b59;
  padding-inline: max(16px, calc((100% - 912px) / 2));
}

.mechtarik-page .mechtarik-welcome {
  grid-template-columns: minmax(0, 184px) minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  gap: 24px;
  max-width: 760px;
  margin: clamp(16px, 5vh, 48px) auto 0;
  padding: 24px 32px;
  border-radius: 24px;
  background: var(--mr-white);
  box-shadow: 0 12px 34px rgb(46 88 125 / 9%);
  text-align: start;
}

.mechtarik-page .mechtarik-portrait {
  width: 100%;
  padding: 8px;
  border-radius: 50%;
  background: var(--mr-blue);
  filter: none;
}

.mechtarik-page .mechtarik-welcome h1 {
  margin: 0 0 12px;
  font-size: clamp(2.5rem, 5.2vw, 3.5rem);
  line-height: 1.05;
}

.mechtarik-page .mechtarik-welcome p {
  margin-inline: 0;
  text-wrap: pretty;
}

.mechtarik-page .mechtarik-welcome .mechtarik-welcome-question {
  width: fit-content;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--mr-pink);
  color: var(--mr-berry);
  font-weight: 650;
}

.mechtarik-page .mechtarik-prompts {
  max-width: 760px;
  margin: 16px auto;
  justify-content: center;
}

.mechtarik-page .mechtarik-prompts button:hover {
  background: var(--mr-blue);
}

.mechtarik-page .mechtarik-prompts span {
  color: var(--mr-berry);
}

.mechtarik-page .mechtarik-message-question {
  background: var(--mr-blue);
}

.mechtarik-page .mechtarik-message-answer {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
}

.mechtarik-reply-avatar {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 52px;
  height: 52px;
  padding: 4px;
  border-radius: 50%;
  background: var(--mr-blue);
}

.mechtarik-reply-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mechtarik-orbit-star {
  position: absolute;
  inset: -4px;
  pointer-events: none;
  animation: mechtarik-orbit 2.8s cubic-bezier(.45, .4, .55, .6) infinite;
}

.mechtarik-orbit-star::after {
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #d24f86;
  clip-path: polygon(50% 0, 62% 34%, 100% 36%, 71% 60%, 81% 98%, 50% 75%, 19% 98%, 29% 60%, 0 36%, 38% 34%);
  transform: translate(-50%, -50%);
  content: '';
}

@keyframes mechtarik-orbit {
  from { transform: rotate(38deg); }
  to { transform: rotate(398deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mechtarik-orbit-star {
    animation: none;
    transform: rotate(38deg);
  }
}

.mechtarik-page .mechtarik-message-answer > div {
  padding: 12px 16px;
  border-radius: 4px 16px 16px 16px;
  background: var(--mr-white);
}

.mechtarik-page .mechtarik-message-answer:has(.mechtarik-orbit-star) > div {
  justify-self: start;
  background: var(--mr-pink);
  color: var(--mr-berry);
}

.mechtarik-page .mechtarik-message-answer p:last-child,
.mechtarik-page .mechtarik-message-answer ul:last-child {
  margin-bottom: 0;
}

.mechtarik-page .mechtarik-compose form {
  border-color: #8eacc8;
}

.mechtarik-page .mechtarik-compose form:focus-within {
  border-color: var(--mr-gold);
}

.mechtarik-page .mechtarik-send {
  color: #fff;
  background: #225888;
}

.mechtarik-page .mechtarik-send:hover {
  background: #194773;
}

.mechtarik-page .mechtarik-voice:hover {
  background: var(--mr-blue);
}

.mechtarik-page .mechtarik-voice[data-recording] {
  color: var(--mr-berry);
  background: var(--mr-pink);
}

@media (max-width: 650px) {
  .mechtarik-page .mechtarik-welcome {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 12px 16px 16px;
    text-align: center;
  }

  .mechtarik-page .mechtarik-portrait {
    width: 104px;
    padding: 4px;
  }

  .mechtarik-page .mechtarik-welcome h1 {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 7.8vw, 2.25rem);
  }

  .mechtarik-page .mechtarik-welcome p {
    margin-inline: auto;
    font-size: .875rem;
  }

  .mechtarik-page .mechtarik-welcome .mechtarik-welcome-question {
    margin-bottom: 8px;
    padding: 4px 8px;
  }

  .mechtarik-page .mechtarik-prompts {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .mechtarik-page .mechtarik-message-answer {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .mechtarik-reply-avatar {
    width: 40px;
    height: 40px;
  }

  .mechtarik-orbit-star::after {
    width: 11px;
    height: 11px;
  }
}
