/* =====================================================================
   ai-khung-noidung.css — KHUNG AI NỘI DUNG DÙNG CHUNG (B339 · 13). CHỈ token :root canonical; bố cục chỉ đổi ở ≤900px (khối cuối tệp).
   Bám 2 ảnh mẫu: hàng [ô nhắn | 🎤 | Tải tệp] · 4 gợi ý nhanh · "Bản đề xuất" (nền xanh nhạt, tô vàng chỗ đổi, Bỏ / Dùng bản này).
   ===================================================================== */
.akh { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
/* thuộc tính hidden phải thắng display:flex của .akh-prop/.akh-doc (CSS đè hidden — đã cắn thật ở khối CSKH) */
.akh [hidden], .akh-prop[hidden] { display: none !important; }
.akh-row { display: flex; align-items: stretch; gap: var(--space-2); min-width: 0; }
.akh-ta {
  flex: 1 1 auto; min-width: 0; min-height: calc(var(--control-h) * 1.4); resize: vertical;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: var(--text-lg); line-height: 1.4;   /* ≥16px: iOS không tự phóng khi chạm */
}
.akh-ta:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
.akh-ta::placeholder { color: var(--text-muted); }
.akh-ta:disabled { background: var(--bg-subtle); color: var(--text-disabled); }
.akh-row .amk-voice-btn { align-self: stretch; height: auto; min-height: calc(var(--control-h) * 1.4); }
.akh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: var(--control-h); padding: 0 var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface);
  color: var(--text-primary); font: inherit; font-size: var(--text-md); font-weight: var(--weight-medium); cursor: pointer;
}
.akh-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.akh-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.akh-btn:disabled { color: var(--text-disabled); cursor: not-allowed; }
.akh-file { flex: 0 0 auto; align-self: stretch; min-height: calc(var(--control-h) * 1.4); white-space: nowrap; }
.akh-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.akh-chip {
  min-height: 32px; padding: 0 var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: var(--text-md); cursor: pointer;
}
.akh-chip:hover:not(:disabled) { border-color: var(--brand-primary); color: var(--brand-primary); }
.akh-chip:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.akh-chip:disabled { color: var(--text-disabled); cursor: not-allowed; }
.akh-doc { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.akh-doc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akh-x { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; font: inherit; padding: var(--space-1); min-width: 28px; min-height: 28px; }
.akh-x:hover { color: var(--status-danger); }
.akh-status { font-size: var(--text-sm); color: var(--text-secondary); }
.akh.is-busy .akh-status::before { content: '⏳ '; }
.akh-err {
  padding: var(--space-2) var(--space-3); border: 1px solid var(--status-danger); border-radius: var(--radius-sm);
  background: var(--status-danger-soft); color: var(--status-danger); font-size: var(--text-md);
}
.akh-err-li { font-size: var(--text-sm); }
.akh-prop {
  padding: var(--space-3); border: 1px solid var(--status-success); border-radius: var(--radius-sm);
  background: var(--status-success-soft); color: var(--text-primary); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0;
}
.akh-prop-t { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-strong, var(--text-primary)); }
.akh-seg { font-size: var(--text-md); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.akh-doi { background: var(--status-warning-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.akh-line { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--border-soft); }
.akh-line:first-of-type { border-top: 0; padding-top: 0; }
.akh-line-h { font-size: var(--text-sm); color: var(--text-secondary); }
.akh-note { font-size: var(--text-md); color: var(--text-secondary); }
.akh-acts { display: flex; justify-content: flex-end; gap: var(--space-2); }
.akh-dung { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--text-inverse); font-weight: var(--weight-semibold); }
.akh-dung:hover:not(:disabled) { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }

/* ≤900px: ô nhắn chiếm cả dòng, 🎤 + Tải tệp xuống dòng dưới; nút đủ tầm chạm. Khối này PHẢI nằm cuối tệp. */
@media (max-width: 900px) {
  .akh-row { flex-wrap: wrap; }
  .akh-ta { flex: 1 1 100%; }
  .akh-row .amk-voice-btn, .akh-file { min-height: var(--control-h); flex: 1 1 0; }
  .akh-btn { min-height: 44px; }
  .akh-chip { min-height: 40px; }
  .akh-acts .akh-btn { flex: 1 1 0; }
}
