/* JARO Chat Shell — Phase 5 minimal styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  background: #fff;
  box-shadow: 0 0 0 1px #e0e0e0;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

.shell-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2e7d32;
}
.status.loading      { background: #fff8e1; color: #f57f17; }
.status.error        { background: #ffebee; color: #c62828; }
.status.reconnecting { background: #e3f2fd; color: #1565c0; }
.status.disconnected { background: #fce4ec; color: #880e4f; }
.status.streaming    { background: #e8eaf6; color: #283593; }

#message-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}
.message.user   { align-self: flex-end; }
.message.system { align-self: flex-start; }

.message-bubble {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.message.user   .message-bubble { background: #1565c0; color: #fff; border-bottom-right-radius: 3px; }
.message.system .message-bubble { background: #f0f0f0; color: #1a1a1a; border-bottom-left-radius: 3px; }

.message-meta {
  font-size: 0.72rem;
  color: #888;
  margin-top: 2px;
  padding: 0 0.25rem;
}
.message.user .message-meta { text-align: right; }

.banner {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  border-left: 4px solid;
}
.banner-warn  { background: #fff8e1; border-color: #f9a825; color: #5d4037; }
.banner-error { background: #ffebee; border-color: #c62828; color: #c62828; }

.auth-panel {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0;
}

.auth-panel input {
  flex: 1;
  padding: 0.45rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.auth-panel input:focus {
  outline: 2px solid #1565c0;
  border-color: transparent;
}

#chat-form {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#message-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
}
#message-input:focus { outline: 2px solid #1565c0; border-color: transparent; }

.form-row {
  display: flex;
  justify-content: flex-end;
}

.secondary-btn,
#submit-btn,
#auth-request-btn,
#auth-verify-btn {
  padding: 0.45rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#submit-btn,
#auth-request-btn,
#auth-verify-btn {
  background: #1565c0;
  color: #fff;
}

.secondary-btn {
  background: #eceff1;
  color: #263238;
}

#submit-btn:hover:not(:disabled),
#auth-request-btn:hover:not(:disabled),
#auth-verify-btn:hover:not(:disabled) {
  background: #1976d2;
}

.secondary-btn:hover:not(:disabled) {
  background: #dfe5e8;
}

.secondary-btn:disabled,
#submit-btn:disabled,
#auth-request-btn:disabled,
#auth-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 500px) {
  .message { max-width: 95%; }
  .auth-panel,
  .form-row { flex-direction: column; }
}
