/* AI-генератор упражнений */
.hm-ai-head { text-align: center; margin-bottom: 32px; }
.hm-ai-head h1 { font-family: var(--hm-display); font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 8px 0 12px; }
.hm-ai-head p { color: var(--hm-muted); max-width: 600px; margin: 0 auto; }

.hm-ai-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.hm-ai-form textarea {
  width: 100%; padding: 14px 18px; border: 1.5px solid var(--hm-border);
  border-radius: 12px; font-family: var(--hm-sans); font-size: 1rem;
  background: var(--hm-surface); color: var(--hm-text); resize: vertical;
}
.hm-ai-form textarea:focus { outline: none; border-color: var(--hm-bronze); box-shadow: 0 0 0 4px rgba(169,124,80,0.08); }

.hm-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-ai-chip { cursor: pointer; }

.hm-ai-actions { display: flex; justify-content: flex-end; }

.hm-ai-result { display: flex; flex-direction: column; gap: 24px; }
.hm-ai-card { padding: 24px; background: var(--hm-surface); border: 1px solid var(--hm-border); border-radius: 16px; }
.hm-ai-card__head h2 { font-family: var(--hm-display); font-size: 1.6rem; margin: 8px 0 12px; }
.hm-ai-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.9rem; color: var(--hm-muted); }
.hm-ai-desc { font-size: 1.05rem; line-height: 1.6; color: var(--hm-text); margin: 16px 0; }
.hm-ai-section { margin-top: 20px; }
.hm-ai-section h3 { font-family: var(--hm-display); font-size: 1.2rem; margin-bottom: 8px; }
.hm-ai-section ol { padding-left: 22px; }
.hm-ai-section ol li { margin-bottom: 8px; line-height: 1.5; }

.hm-ai-arena { padding: 24px; background: var(--hm-ivory-2); border-radius: 16px; }
.hm-ai-arena h3 { font-family: var(--hm-display); font-size: 1.2rem; margin-bottom: 16px; text-align: center; }

.hm-ai-foot { display: flex; justify-content: center; }

@media (max-width: 640px) {
  .hm-ai-card { padding: 16px; }
  .hm-ai-arena { padding: 12px; }
}

/* ===== Сетка параметров ===== */
.hm-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.hm-ai-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hm-ai-field--full { grid-column: 1 / -1; }
.hm-ai-field label {
  font-size: 0.85rem;
  color: var(--hm-muted);
  font-weight: 500;
}
.hm-ai-field select,
.hm-ai-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--hm-border);
  border-radius: 10px;
  font-family: var(--hm-sans);
  font-size: 0.95rem;
  background: var(--hm-surface);
  color: var(--hm-text);
  box-sizing: border-box;
}
.hm-ai-field select:focus,
.hm-ai-field textarea:focus {
  outline: none;
  border-color: var(--hm-bronze);
  box-shadow: 0 0 0 4px rgba(169,124,80,0.08);
}
.hm-ai-field textarea { resize: vertical; }

/* ===== Арена ===== */
.hm-arena-wrap {
  max-width: 700px;
  margin: 0 auto;
}
.hm-arena {
  width: 100%;
  height: auto;
  border: 2px solid #333;
  border-radius: 10px;
  background: #faf8f4;
  display: block;
}

/* ===== Двухколоночный блок: схема + визуализация ===== */
.hm-ai-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.hm-ai-visual__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hm-ai-visual__col h3 {
  font-family: var(--hm-display);
  font-size: 1.1rem;
  text-align: center;
  margin: 0;
}

.hm-ai-image-box {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--hm-ivory-2);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hm-ai-image-placeholder,
.hm-ai-image-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  color: var(--hm-muted);
}
.hm-ai-image-placeholder i { font-size: 2rem; opacity: 0.4; }
.hm-ai-image-placeholder p { margin: 0; font-size: 0.85rem; }

.hm-ai-image-loading i { font-size: 2rem; color: var(--hm-bronze); }
.hm-ai-image-loading p { margin: 0; font-size: 0.85rem; }

.hm-ai-image-result {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 860px) {
  .hm-ai-visual { grid-template-columns: 1fr; }
}

/* ===== Картинка упражнения (новая схема) ===== */
.hm-ai-image-container {
  padding: 24px;
  background: var(--hm-surface);
  border: 1px solid var(--hm-border);
  border-radius: 16px;
}

.hm-ai-image-container h3 {
  font-family: var(--hm-display);
  font-size: 1.2rem;
  margin: 0 0 16px 0;
}

.hm-ai-image-container .hm-ai-image-box {
  aspect-ratio: 16 / 10;
  background: var(--hm-ivory-2);
  border-radius: 10px;
  overflow: hidden;
}
