* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f7f7;
  color: #111;
}
.app {
  max-width: 980px;
  margin: 0 auto;
  height: 100vh;
  display: grid;
  grid-template-rows: 56px auto 1fr 120px;
}
.header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid #ddd;
  font-weight: 700;
  background: white;
}
.examples {
  padding: 12px 16px 8px;
  background: white;
  border-bottom: 1px solid #ddd;
}
.examples-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 8px;
}
.examples-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.example-chip {
  border: 1px solid #ccc;
  border-radius: 999px;
  background: #f3f3f3;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px 14px;
  text-align: left;
}
.example-chip:hover:not(:disabled) {
  background: #e9e9e9;
}
.chat {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 8px;
  max-width: 85%;
  line-height: 1.4;
}
.msg.user {
  align-self: flex-end;
  background: #111;
  color: white;
}
.msg.assistant {
  align-self: flex-start;
  background: white;
  border: 1px solid #ddd;
}
.loading-msg {
  min-width: 160px;
}
.loading-label {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  opacity: 0.25;
  animation: pulse-dot 1s ease-in-out infinite;
}
.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
.composer {
  border-top: 1px solid #ddd;
  background: white;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}
textarea {
  width: 100%;
  resize: none;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}
button {
  border: none;
  border-radius: 8px;
  background: #111;
  color: white;
  font-weight: 700;
  cursor: pointer;
}
button.sending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@keyframes pulse-dot {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: scale(0.9);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 768px) {
  .app { grid-template-rows: 52px auto 1fr 140px; }
  .composer { grid-template-columns: 1fr; }
  button { height: 44px; }
  .msg { max-width: 100%; }
  .example-chip { width: 100%; }
}
