* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.app {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1rem;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

details summary {
  cursor: pointer;
  color: #8b949e;
  font-size: 0.875rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

input[type="password"] {
  background: #21262d;
  border: 1px solid #30363d;
  color: inherit;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 90%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: #238636;
  color: #fff;
}

.message.assistant {
  align-self: flex-start;
  background: #21262d;
  border: 1px solid #30363d;
}

.message.assistant pre {
  background: #161b22;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message.assistant code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background: #161b22;
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
}

.message.assistant pre code {
  background: none;
  padding: 0;
}

.message.assistant p { margin-bottom: 0.5rem; }
.message.assistant p:last-child { margin-bottom: 0; }
.message.assistant ul, .message.assistant ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
}
.message.assistant li { margin-bottom: 0.25rem; }
.message.assistant blockquote {
  border-left: 3px solid #30363d;
  padding-left: 0.75rem;
  margin: 0.5rem 0;
  color: #8b949e;
}

footer {
  padding: 1rem;
  border-top: 1px solid #30363d;
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

textarea {
  flex: 1;
  background: #21262d;
  border: 1px solid #30363d;
  color: inherit;
  padding: 0.75rem;
  border-radius: 6px;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  max-height: 200px;
}

button {
  background: #238636;
  color: #fff;
  border: none;
  padding: 0 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

button:hover { background: #2ea043; }
button:disabled { background: #30363d; cursor: not-allowed; }
