body {
  margin: 0;
  height: 100vh;
  display: flex;
  font-family: sans-serif;
}

/* ---------- Чат ---------- */
.chatBox {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 400px;
  max-width: 500px;
  margin-left: auto;
  border-left: 1px solid #ccc;
  box-sizing: border-box;
}

#chat {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.userMsg, .aiMsg {
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 80%;
  word-wrap: break-word;
}
.userMsg { align-self: flex-start; background: #aef7ba; }
.aiMsg   { align-self: flex-end;   background: #40a4ff; }

#textarea, #button {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  flex-shrink: 0;
}
#textarea{
  height: 80px;
}
#button { margin-top: 4px; }

.chatBox button{
  padding: 40px 0;
}

/* ---------- Карточки (Flexbox) ---------- */
#mainBox {
  flex: 1;              /* занимает всё свободное место */
  display: flex;
}

#mainBox iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
}

.item {
  flex: 0 1 calc(50% - 10px); /* 2 в ряд, с учётом gap */
  min-width: 250px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.imgBox {
  width: 100%;
  padding-top: 100%;
  position: relative;
  overflow: hidden;
}
.imgBox img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.txtBox {
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.txtBox h1 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.txtBox p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
