:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --accent: #38bdf8;
  --text: #e2e8f0;
  --muted: #94a3b8;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  color: var(--text);
}

main.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
}

.tagline {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(8, 7, 56, 0.6);
}

.profile-panel form,
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}

input,
textarea,
select,
button {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(15, 23, 42, 0.4);
  color: var(--text);
}

button {
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #02131f;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messages {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 0.5rem;
}

.message {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.15);
}

.message.assistant {
  align-self: flex-start;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.1);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 680px) {
  main.app {
    padding: 1rem;
  }
  header h1 {
    font-size: 1.8rem;
  }
}
