:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #18202a;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(120deg, rgba(246, 90, 101, 0.12), transparent 36%),
    linear-gradient(240deg, rgba(25, 139, 111, 0.14), transparent 40%),
    #f4f6f8;
}

button,
textarea {
  font: inherit;
}

.shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.assistant-panel {
  width: min(880px, 100%);
  height: min(760px, calc(100vh - 48px));
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(24, 32, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(21, 31, 44, 0.16);
}

.topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid #e6ebf0;
  background: #ffffff;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ef4d63;
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
}

h1 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: #6b7787;
  font-size: 14px;
}

.messages {
  overflow-y: auto;
  padding: 22px;
  background: #f8fafb;
}

.message {
  display: flex;
  margin-bottom: 14px;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(620px, 88%);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
}

.assistant .bubble {
  background: #ffffff;
  border: 1px solid #e3e8ee;
  color: #1f2933;
}

.user .bubble {
  background: #1d8a69;
  color: #ffffff;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid #e6ebf0;
  background: #ffffff;
}

.quick-actions button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d6dde5;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}

.quick-actions button:hover {
  border-color: #1d8a69;
  color: #16684f;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 22px 18px;
  background: #ffffff;
}

textarea {
  width: 100%;
  max-height: 116px;
  resize: none;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 13px 14px;
  outline: none;
  line-height: 1.5;
}

textarea:focus {
  border-color: #1d8a69;
  box-shadow: 0 0 0 3px rgba(29, 138, 105, 0.14);
}

#send-button {
  min-width: 84px;
  border: 0;
  border-radius: 8px;
  background: #1d8a69;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

#send-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 640px) {
  .shell {
    padding: 0;
  }

  .assistant-panel {
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar,
  .messages,
  .quick-actions,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 18px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  #send-button {
    height: 42px;
  }
}
