/* 에이전트 채팅 이미지·영상 생성 카드 — public/js/agent-media-gen.js */
.mg-card {
  --mg-line: rgba(128,128,128,.28);
  --mg-muted: #6b6b6b;
  margin: 10px auto 0; padding: 14px; width: 100%; max-width: 560px; min-width: 0; box-sizing: border-box;
  border: 1px solid var(--mg-line); border-radius: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
body.dark-theme .mg-card { --mg-muted: #a0a0a0; }
.mg-title { font-weight: 600; font-size: .95em; }
.mg-prompt {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 4.5em;
  padding: 8px 10px; border: 1px solid var(--mg-line); border-radius: 10px;
  background: transparent; color: inherit; font: inherit; font-size: .9em; line-height: 1.45;
}
.mg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mg-row select, .mg-duration {
  min-width: 0; padding: 6px 8px; border: 1px solid var(--mg-line); border-radius: 8px;
  background: transparent; color: inherit; font: inherit; font-size: .85em;
}
/* 펼친 목록은 OS 가 그려 테마를 모른다 — 바탕·글자를 둘 다 정해야 검은 바탕에 검은 글씨가 안 된다. */
.mg-row select option { background: #fff; color: #1f1f1f; }
body.dark-theme .mg-row select option { background: #1f1f1f; color: #e8e8e8; }
.mg-model { flex: 1 1 180px; }
.mg-field { display: inline-flex; align-items: center; gap: 4px; font-size: .85em; }
.mg-duration { width: 4.5em; }
.mg-frames { display: flex; gap: 8px; }
.mg-frames:empty { display: none; }
.mg-frame {
  position: relative; width: 96px; height: 64px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--mg-line); border-radius: 8px; cursor: pointer;
  font-size: .75em; color: var(--mg-muted); background: center / cover no-repeat;
}
.mg-frame.filled span { visibility: hidden; }
.mg-frame[hidden] { display: none; }
.mg-frame-clear {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; line-height: 18px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer;
}
.mg-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.mg-cost { font-size: .8em; color: var(--mg-muted); }
.mg-go {
  padding: 8px 16px; border: 1px solid var(--agent-accent); border-radius: 20px;
  background: var(--agent-accent); color: var(--agent-on-accent);
  font: inherit; font-size: .88em; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.mg-go:disabled { opacity: .5; cursor: not-allowed; }
.mg-status { font-size: .85em; color: var(--mg-muted); }
.mg-status:empty { display: none; }
.mg-failed .mg-status { color: #d93025; }
.mg-topup { color: inherit; text-decoration: underline; }
.mg-result:empty { display: none; }
.mg-media { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; object-fit: contain; object-position: center; border-radius: 10px; background: rgba(128,128,128,.12); }
.chat-msg.agent .chat-bubble > :is(img,video,audio,canvas,iframe),
.chat-msg.agent .chat-bubble :is(p,figure) :is(img,video,audio,canvas,iframe) { display: block; max-width: 100%; margin-inline: auto; }
.mg-caption { margin-top: 6px; font-size: .8em; color: var(--mg-muted); }
.mg-gone { padding: 18px; border-radius: 10px; background: rgba(128,128,128,.1); font-size: .85em; color: var(--mg-muted); }
