@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap");

:root {
  --bg-top: #fff1dd;
  --bg-mid: #f6efe4;
  --bg-bottom: #e2f2ee;
  --ink: #1f2a2a;
  --line: #d8d8d8;
  --brand: #0b7a75;
  --composer-height: 220px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", sans-serif;
  color: var(--ink);
  background-color: var(--bg-bottom);
  background-image: linear-gradient(
    180deg,
    var(--bg-top) 0%,
    var(--bg-mid) 52%,
    var(--bg-bottom) 100%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  min-height: 100vh;
}

.page {
  width: min(920px, calc(100% - 24px));
  margin: 24px auto 0;
  padding-bottom: calc(var(--composer-height) + 24px);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 2vw + 1rem, 2.2rem);
  line-height: 1.2;
}

.new-chat-button {
  border: 1px solid #0b7a75;
  border-radius: 12px;
  padding: 8px 12px;
  background: #f5fffd;
  color: #0b5853;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.new-chat-button:hover {
  background: #e8f8f5;
}

.chat-shell {
  display: block;
}

.chat {
  min-height: 320px;
  max-height: calc(100vh - var(--composer-height) - 92px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding: 2px 2px 16px;
}

.bubble {
  max-width: 90%;
  line-height: 1.5;
  white-space: pre-wrap;
  animation: rise 0.2s ease-out;
}

.bubble.assistant {
  justify-self: start;
  background: transparent;
  border: none;
  padding: 0;
}

.bubble.assistant a {
  color: #0b7a75;
  text-decoration: underline;
  word-break: break-all;
}

.bubble.thinking {
  opacity: 0.78;
}

.bubble.user {
  justify-self: end;
  border: 1px solid var(--line);
  background: #f3f3f3;
  border-radius: 12px;
  padding: 10px 12px;
}

.start-prompt-row {
  justify-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 1em;
}

.start-prompt-button {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(120deg, var(--brand) 0%, #178e85 100%);
  color: #fff;
  text-align: left;
  cursor: pointer;
  width: fit-content;
  max-width: min(92vw, 460px);
  font-size: 14px;
  font-weight: 700;
}

.start-prompt-button:hover {
  background: linear-gradient(120deg, #0f8a84 0%, #1a9a8f 100%);
}

.start-prompt-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.feedback-row {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
  margin-bottom: 4px;
}

.feedback-button {
  border: 1px solid #c8d8d6;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.feedback-button:hover {
  background: #f1fbf8;
}

.feedback-button.selected {
  border-color: #0b7a75;
  background: #e7f8f5;
}

.feedback-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-form {
  display: grid;
  gap: 10px;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(920px, calc(100% - 24px));
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  z-index: 10;
}

.option-dock {
  display: grid;
  gap: 8px;
}

.option-title {
  margin: 0;
  font-size: 13px;
  color: #445a59;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.option-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.option-button {
  border: 1px solid #b9ddd8;
  border-radius: 10px;
  padding: 9px 10px;
  background: #f5fffd;
  color: #0b5853;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.option-button:hover {
  background: #e8f8f5;
}

.option-send-button {
  border: 1px solid #0b7a75;
  border-radius: 10px;
  padding: 9px 11px;
  background: #0b7a75;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}

.option-send-button:hover {
  background: #0f8a84;
}

.option-button:disabled,
.option-send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea,
button {
  font-family: inherit;
  font-size: 14px;
}

textarea {
  width: 100%;
  border: 1px solid #d8cbb6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  resize: vertical;
}

.disclaimer-row {
  margin: -2px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.disclaimer {
  margin: 0;
  font-size: 11px;
  color: #6a6a6a;
  text-align: left;
}

.shortcut-hint {
  margin: 0;
  font-size: 11px;
  color: #6a6a6a;
  text-align: right;
  white-space: nowrap;
}

#send {
  justify-self: end;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  background: linear-gradient(120deg, var(--brand) 0%, #178e85 100%);
  color: #fff;
  font-weight: 700;
}

#send:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .new-chat-button {
    align-self: flex-end;
  }

  .option-item {
    grid-template-columns: 1fr;
  }

  .chat {
    max-height: calc(100vh - var(--composer-height) - 84px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
