* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fff;
  color: #111;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid #ccc;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid #ccc;
}

.title {
  font-weight: 700;
}

.subtitle {
  font-size: 12px;
  color: #444;
}

.token-block {
  display: flex;
  gap: 8px;
  align-items: center;
}

.token-input,
.prompt {
  width: 100%;
  border: 1px solid #bbb;
  padding: 8px;
  font: inherit;
}

.timeline {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  max-width: 80%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.message.user {
  align-self: flex-end;
  background: #eaf2ff;
}

.message.assistant {
  align-self: flex-start;
  background: #f3f3f3;
}

.message.command {
  align-self: flex-start;
  background: #fff;
  border-style: dashed;
}

.message.result {
  align-self: flex-start;
  background: #f8f8f8;
}

.message.error {
  align-self: flex-start;
  background: #fff1f1;
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Arial, sans-serif;
}

.message-meta {
  margin: 6px 0 0;
  font-size: 11px;
  color: #555;
}

.composer {
  border-top: 1px solid #ccc;
  padding: 8px 10px 10px;
}

.status-line {
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}

.composer-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  justify-content: flex-end;
}

.small-button {
  border: 1px solid #aaa;
  background: #f5f5f5;
  padding: 8px 10px;
  font: inherit;
}

.small-button:disabled {
  opacity: 0.45;
}

@media (max-width: 900px) {
  .app {
    max-width: 100%;
    border: 0;
  }

  .topbar,
  .token-block {
    flex-direction: column;
    align-items: stretch;
  }
}
