/* 梗圖產生器 */
#mg [hidden] { display: none !important; }
.mg-note { background: #fff8e6; border-left: 4px solid #d9a400; padding: 10px 14px; border-radius: 6px; font-size: 1rem; }
.mg-blank { margin: 10px 0; }
.mg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.mg-row select { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; background: #fff; }
.mg-color { width: 56px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mg-preview { position: sticky; top: 8px; text-align: center; min-width: 0; }
.mg-preview canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; background: #f1f3f6; }
.mg-controls { min-width: 0; }
.mg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.mg-chip { min-height: 44px; padding: 0 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-size: .95rem; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.mg-chip[aria-pressed="true"] { border-color: var(--brand); background: #eff4ff; font-weight: 600; }
#mg-text { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit; resize: vertical; }
.it-field output { font-weight: 700; }
@media (max-width: 800px) {
  .mg-grid { grid-template-columns: minmax(0, 1fr); }
  .mg-preview { position: sticky; top: 0; z-index: 5; background: #fff; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .mg-preview canvas { max-height: 40vh; }
  .mg-preview .it-meta { display: none; }
  .mg-controls input, .mg-controls select, .mg-controls textarea, .mg-controls button { scroll-margin-top: calc(40vh + 24px); }
}
.mg-warn { color: #b3261e; font-weight: 600; margin: 6px 0; }
