.gemini-ui {
  --text-color: #e8e8ef;
  --subheading-color: #8c8c9e;
  --placeholder-color: #6b6b80;
  --primary-color: #111116;
  /* Lightened from #050507 */
  --secondary-color: rgba(255, 255, 255, 0.05);
  /* Lightened cards */
  --secondary-hover-color: rgba(255, 255, 255, 0.08);
  /* Lightened hover */
  font-family: "Poppins", sans-serif;
  background: var(--primary-color);
  width: 100%;
  height: 100%;
  position: relative;
  font-size: clamp(5.714px, 0.9523vw, 8px);
  /* proportional to phone clamp(150px, 25vw, 210px) width */
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  /* Inside the phone border */
}

body.light_mode .gemini-ui,
.gemini-ui.light_mode {
  --text-color: #222;
  --subheading-color: #a0a0a0;
  --placeholder-color: #6c6c6c;
  --primary-color: #fff;
  --secondary-color: #e9eef6;
  --secondary-hover-color: #dbe1ea;
}

.gemini-ui * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: inherit;
}

.gemini-ui .material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
}

.gemini-ui .header,
.gemini-ui .chat-list .message,
.gemini-ui .typing-form {
  margin: 0 auto;
  width: 100%;
}

.gemini-ui .header {
  margin-top: 2em;
  padding: 1em;
  overflow-x: hidden;
}

.gemini-ui.hide-header .header {
  margin: 0;
  display: none;
}

.gemini-ui .header :where(.title, .subtitle) {
  color: var(--text-color);
  font-weight: 500;
  line-height: 1.2;
}

.gemini-ui .header .title {
  width: fit-content;
  font-size: 3em;
  margin-bottom: 0.5em;
  background-clip: text;
  background: linear-gradient(to right, #5a189a, #FF2D78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gemini-ui .header .subtitle {
  font-size: 2.2em;
  color: var(--subheading-color);
}

.gemini-ui .suggestion-list {
  width: 100%;
  list-style: none;
  display: flex;
  gap: 1.25em;
  margin-top: 2em;
  overflow: hidden;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 1em;
}

.gemini-ui .suggestion-list::-webkit-scrollbar {
  display: none;
}

.gemini-ui .suggestion-list .suggestion {
  cursor: pointer;
  padding: 1.25em;
  width: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-radius: 0.75em;
  justify-content: space-between;
  background: var(--secondary-color);
  transition: 0.2s ease;
}

.gemini-ui .suggestion-list .suggestion:hover {
  background: var(--secondary-hover-color);
}

.gemini-ui .suggestion-list .suggestion :where(.text, .icon) {
  font-weight: 400;
  color: var(--text-color);
}

.gemini-ui .suggestion-list .suggestion .text {
  font-size: 1.2em;
  text-align: left;
  width: 100%;
}

.gemini-ui .suggestion-list .suggestion .icon {
  width: 28px;
  height: 28px;
  display: flex;
  font-size: 1.3em;
  margin-top: 2.5em;
  align-self: flex-end;
  align-items: center;
  border-radius: 50%;
  justify-content: center;
  color: var(--text-color);
  background: var(--primary-color);
}

.gemini-ui .chat-list {
  padding: 1em 1em 10em;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.gemini-ui .chat-list::-webkit-scrollbar {
  display: none;
}

.gemini-ui .chat-list .message.incoming {
  margin-top: 1.5em;
}

.gemini-ui .chat-list .message .message-content {
  display: flex;
  gap: 1em;
  width: 100%;
  align-items: flex-start;
}

.gemini-ui .chat-list .message .text {
  color: var(--text-color);
  white-space: pre-wrap;
  font-size: 1.4em;
  line-height: 1.4;
}

.gemini-ui .chat-list .message.error .text {
  color: #e55865;
}

.gemini-ui .chat-list .message.loading .text {
  display: none;
}

.gemini-ui .chat-list .message .avatar {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
  align-self: flex-start;
  flex-shrink: 0;
}

.gemini-ui .chat-list .message.loading .avatar {
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

.gemini-ui .chat-list .message .icon {
  color: var(--text-color);
  cursor: pointer;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  font-size: 1.2em;
  margin-left: 2.5em;
  visibility: hidden;
}

.gemini-ui .chat-list .message .icon.hide {
  visibility: hidden;
}

.gemini-ui .chat-list .message:not(.loading, .error):hover .icon:not(.hide) {
  visibility: visible;
}

.gemini-ui .chat-list .message .icon:hover {
  background: var(--secondary-hover-color);
}

.gemini-ui .chat-list .message .loading-indicator {
  display: none;
  gap: 0.8em;
  width: 100%;
  flex-direction: column;
}

.gemini-ui .chat-list .message.loading .loading-indicator {
  display: flex;
}

.gemini-ui .chat-list .message .loading-indicator .loading-bar {
  height: 6px;
  width: 100%;
  border-radius: 0.135em;
  background: linear-gradient(to right, #5a189a, var(--primary-color), #5a189a);
  background-size: 200% 100%;
  animation: loading 3s linear infinite;
}

.gemini-ui .chat-list .message .loading-indicator .loading-bar:last-child {
  width: 70%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.gemini-ui .typing-area {
  position: absolute;
  /* Kept to absolute inside relative container */
  width: 100%;
  left: 0;
  bottom: 0;
  padding: 1em;
  background: var(--primary-color);
  z-index: 10;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.gemini-ui .typing-area :where(.typing-form, .action-buttons) {
  display: flex;
  gap: 0.75em;
}

.gemini-ui .typing-form .input-wrapper {
  width: 100%;
  height: 36px;
  display: flex;
  position: relative;
}

.gemini-ui .typing-form .typing-input {
  height: 100%;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 1.2em;
  color: var(--text-color);
  padding: 0.8em 3em 0.8em 1em;
  border-radius: 100px;
  background: var(--secondary-color);
}

.gemini-ui .typing-form .typing-input:focus {
  background: var(--secondary-hover-color);
}

.gemini-ui .typing-form .typing-input::placeholder {
  color: var(--placeholder-color);
}

.gemini-ui .typing-area .icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  font-size: 1.4em;
  color: var(--text-color);
  align-items: center;
  justify-content: center;
  background: var(--secondary-color);
  transition: 0.2s ease;
}

.gemini-ui .typing-area .icon:hover {
  background: var(--secondary-hover-color);
}

.gemini-ui .typing-form #send-message-button {
  position: absolute;
  right: 0;
  outline: none;
  border: none;
  transform: scale(0);
  background: transparent;
  transition: transform 0.2s ease;
}

.gemini-ui .typing-form .typing-input:valid~#send-message-button {
  transform: scale(1);
}

.gemini-ui .typing-area .disclaimer-text {
  text-align: center;
  font-size: 0.8em;
  margin-top: 1em;
  color: var(--placeholder-color);
}