* {
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  margin: 0;
  background: #111;
  color: #fff;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  margin-top: 0;
}

.chat {
  min-height: 60vh;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px;
  background: #181818;
  overflow-y: auto;
  margin-bottom: 12px;
}

.msg {
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.user {
  background: #244;
}

.assistant {
  background: #262626;
}

.system {
  background: #442;
}

textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #333;
  background: #181818;
  color: #fff;
  padding: 12px;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: #2d6cdf;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background: #1f50a8;
}

button:last-child {
  background: #aa3333;
}

button:last-child:hover {
  background: #802626;
}

/* --- Стили для Markdown ответа ассистента --- */
.assistant p {
  margin: 0 0 12px;
}

.assistant p:last-child {
  margin-bottom: 0;
}

.assistant strong {
  font-weight: 700;
}

.assistant em {
  font-style: italic;
}

.assistant code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.95em;
}

.assistant pre {
  background: #0d0d0d;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 10px 0;
}

.assistant pre code {
  background: transparent;
  padding: 0;
}

.assistant ul,
.assistant ol {
  padding-left: 22px;
  margin: 10px 0;
}

.assistant blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 3px solid #666;
  color: #ddd;
}

.assistant h1,
.assistant h2,
.assistant h3,
.assistant h4 {
  margin: 14px 0 10px;
  line-height: 1.25;
}

.assistant a {
  color: #8ab4ff;
  text-decoration: none;
}

.assistant a:hover {
  text-decoration: underline;
}

/* --- НОВОЕ: Стили для сгенерированных картинок --- */
.assistant img {
  max-width: 100%; /* Картинка не вылезет за пределы чата */
  height: auto;
  border-radius: 10px; /* Скругленные углы в стиле интерфейса */
  margin-top: 8px;
  display: block;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* Небольшая тень для красоты */
}}

.user {
  background: #244;
}

.assistant {
  background: #262626;
}

.system {
  background: #442;
}

textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #333;
  background: #181818;
  color: #fff;
  padding: 12px;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: #2d6cdf;
  color: white;
  font-size: 16px;
}

button:last-child {
  background: #aa3333;
}
.msg {
  line-height: 1.5;
}

.assistant p {
  margin: 0 0 12px;
}

.assistant p:last-child {
  margin-bottom: 0;
}

.assistant strong {
  font-weight: 700;
}

.assistant em {
  font-style: italic;
}

.assistant code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.95em;
}

.assistant pre {
  background: #0d0d0d;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 10px 0;
}

.assistant pre code {
  background: transparent;
  padding: 0;
}

.assistant ul,
.assistant ol {
  padding-left: 22px;
  margin: 10px 0;
}

.assistant blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 3px solid #666;
  color: #ddd;
}

.assistant h1,
.assistant h2,
.assistant h3,
.assistant h4 {
  margin: 14px 0 10px;
  line-height: 1.25;
}

.assistant a {
  color: #8ab4ff;
  text-decoration: none;
}

.assistant a:hover {
  text-decoration: underline;
}
