:root {
  --navy: #000028;
  --magenta: #ec008c;
  --bg: #f6f6f9;
  --border: #d9d9e3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--navy);
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app__header h1 {
  margin: 0;
}

.app__header p {
  color: #555;
  margin: 0.25rem 0 1rem;
}

.consent {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 0.5rem 0;
}

.consent__text {
  margin: 0 0 0.75rem;
}

.consent__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.5rem 0;
}

.msg {
  max-width: 80%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.75rem;
  white-space: pre-wrap;
  line-height: 1.4;
}

.msg--user {
  align-self: flex-end;
  background: var(--navy);
  color: #fff;
}

.msg--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
}

.msg--error {
  align-self: center;
  color: #b00020;
  font-size: 0.9rem;
}

/* Rendered Markdown inside assistant bubbles */
.msg--assistant p {
  margin: 0 0 0.5rem;
}
.msg--assistant p:last-child {
  margin-bottom: 0;
}
.msg--assistant ul,
.msg--assistant ol {
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
}
.msg--assistant h1,
.msg--assistant h2,
.msg--assistant h3,
.msg--assistant h4 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1rem;
}
.msg--assistant code {
  background: #f0f0f4;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}
.msg--assistant a {
  color: var(--magenta);
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.composer__input {
  width: 100%;
  resize: vertical;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
}

.composer__actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.btn--primary {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #fff;
}

.composer__input:disabled {
  background: #f0f0f4;
  color: #888;
}

.contact {
  border: none;
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 460px;
  width: 90%;
}

.contact::backdrop {
  background: rgba(0, 0, 40, 0.55);
}

.contact__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.contact__intro {
  margin: 0 0 0.5rem;
}

.contact__note {
  color: #555;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact__input {
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
}

.contact__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.contact__done {
  color: #0a7d33;
  margin: 0.5rem 0 0;
}
