*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: rgb(17 20 27);
  color: #fff;
  overflow: hidden;
}

.ark-page {
  display: flex;
  height: 100dvh;
  flex-direction: column;
  background-color: rgb(17 20 27);
  color: #fff;
}

.ark-page.ark-shell-content {
  height: auto;
  min-height: 100dvh;
  box-sizing: border-box;
}

.ark-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.ark-view {
  margin-bottom: 1rem;
  display: flex;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ark-view.is-chat {
  position: relative;
}

.ark-landing-content,
.ark-landing-top {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.ark-logo-wrap {
  animation: ark-logo-pulse 3s ease-in-out infinite;
}

@keyframes ark-logo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.ark-logo {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
}

.ark-description {
  padding-left: 6rem;
  padding-right: 6rem;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 500;
  color: rgb(156 163 175);
}

.ark-input-wrap {
  width: 100%;
  max-width: 48rem;
  padding-left: 1rem;
  padding-right: 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: ark-fade-up 0.5s ease 0.2s forwards;
}

.ark-view.is-landing .ark-input-wrap {
  margin-top: 0;
}

@media (min-width: 640px) {
  .ark-view.is-landing .ark-input-wrap {
    margin-top: 2.5rem;
  }

  .ark-description {
    padding-left: 0;
    padding-right: 0;
  }

  .ark-landing-top {
    flex: none;
    justify-content: normal;
  }

  .ark-chat-input-fixed {
    bottom: 2.5rem !important;
  }
}

@keyframes ark-fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ark-chat-box {
  position: relative;
  width: 100%;
  border-radius: 32px;
  border: 1px solid rgba(241, 185, 10, 0.1);
  background: rgba(32, 35, 40, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ark-chat-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: radial-gradient(53.75% 76.96% at 50% 141.74%, rgba(241, 185, 10, 0.15) 0%, transparent 100%);
  pointer-events: none;
}

.ark-chat-form {
  position: relative;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.ark-chat-textarea {
  width: 100%;
  resize: none;
  border: 0;
  background: transparent;
  padding: 1rem 1.25rem;
  color: #fff;
  font: inherit;
  outline: none;
  min-height: 56px;
  max-height: 288px;
}

.ark-chat-textarea::placeholder {
  color: rgb(160 160 163);
}

.ark-chat-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.25rem 1.25rem 1rem;
}

.ark-chat-actions-left,
.ark-chat-actions-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ark-chat-actions-right {
  margin-left: auto;
}

.ark-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: rgb(160 160 163);
  cursor: pointer;
  padding: 0;
}

.ark-icon-btn:hover {
  color: #fff;
}

.ark-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ark-icon-btn svg {
  width: 2.25rem;
  height: 2.25rem;
}

.ark-reset-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ark-reset-btn:hover {
  color: rgb(239 68 68);
}

.ark-messages {
  width: 100%;
  max-width: 48rem;
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(180deg, black 80%, transparent);
  -webkit-mask-image: linear-gradient(180deg, black 80%, transparent);
}

.ark-messages-inner {
  height: 100%;
  overflow-y: auto;
  padding: 0.75rem 1rem 8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ark-msg {
  display: flex;
  width: 100%;
}

.ark-msg.is-user {
  justify-content: flex-end;
}

.ark-msg.is-assistant {
  justify-content: flex-start;
}

.ark-msg-bubble {
  max-width: 85%;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  word-break: break-word;
}

.ark-msg.is-user .ark-msg-bubble {
  background: rgba(241, 185, 10, 0.2);
  color: rgb(241 185 10);
}

.ark-msg.is-assistant .ark-msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.ark-typing {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.ark-typing-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(241, 185, 10, 0.6);
  animation: ark-typing 1.2s ease-in-out infinite;
}

.ark-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ark-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes ark-typing {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.ark-chat-input-fixed {
  position: absolute;
  bottom: 1rem;
  z-index: 10;
  width: 100%;
  max-width: 48rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.ark-view.is-hidden {
  display: none;
}

.ark-view.is-chat {
  animation: ark-view-in 0.3s ease;
}

@keyframes ark-view-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ark-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
}

.ark-modal-overlay.is-open {
  display: flex;
}

.ark-modal {
  width: 100%;
  max-width: 28rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgb(17 20 27);
  color: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ark-modal-header {
  padding: 1.5rem 1.5rem 0.5rem;
}

.ark-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.ark-modal-body {
  padding: 0.5rem 1.5rem 1rem;
  font-size: 0.9375rem;
  color: rgb(160 160 163);
  line-height: 1.6;
}

.ark-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0 1.5rem 1.5rem;
}

.ark-btn {
  border: 0;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font: inherit;
  cursor: pointer;
}

.ark-btn-secondary {
  background: transparent;
  color: #fff;
}

.ark-btn-destructive {
  background: rgb(239 68 68);
  color: #fff;
}

.ark-btn-destructive:hover {
  background: rgba(239, 68, 68, 0.9);
}

.ark-btn-primary {
  background: rgb(241 185 10);
  color: #111;
}

.ark-spinner {
  width: 1.5rem;
  height: 1.5rem;
  animation: ark-spin 0.8s linear infinite;
  color: rgba(241, 185, 10, 0.6);
}

@keyframes ark-spin {
  to { transform: rotate(360deg); }
}

.ark-loading-center {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0;
}

.ark-fade-out {
  animation: ark-fade-out 0.3s ease forwards;
}

@keyframes ark-fade-out {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}
